@decocms/mesh 1.0.23 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/dist/client/assets/{AlertCircle-D7Y5lb85.js → AlertCircle-CRDUE68O.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-DLGdR8R3.js → ArrowLeft-Iy4pjcqu.js} +1 -1
  3. package/dist/client/assets/{ChevronDown-DNVwrHI3.js → ChevronDown-Dj0YzNJ5.js} +1 -1
  4. package/dist/client/assets/{Clock-CbKCY_SW.js → Clock-BGo4abZy.js} +1 -1
  5. package/dist/client/assets/{Calendar-BIuHCFcF.js → Code01-C2mtSXCH.js} +1 -1
  6. package/dist/client/assets/{Copy01-B-rLWzst.js → Copy01-08G580G9.js} +1 -1
  7. package/dist/client/assets/{CpuChip02-wuCmGgd2.js → CpuChip02-vo-KC-ou.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-qrfHOj7f.js → DotsVertical-CDfNa7KY.js} +1 -1
  9. package/dist/client/assets/{File06-DJfHNtkr.js → File06-BwkobN1x.js} +1 -1
  10. package/dist/client/assets/{GitBranch01-DKUtbZqA.js → GitBranch01-Dus6D2gU.js} +1 -1
  11. package/dist/client/assets/{Inbox01-C3SohPjD.js → Inbox01-DrIFHYCY.js} +1 -1
  12. package/dist/client/assets/{InfoCircle-JMKMx9jx.js → InfoCircle-B76kcv1L.js} +1 -1
  13. package/dist/client/assets/{Key01-BUYdliq4.js → Key01-RxQv3BJR.js} +1 -1
  14. package/dist/client/assets/{LinkExternal01-CwO6S7_R.js → LinkExternal01-BdHgX43H.js} +1 -1
  15. package/dist/client/assets/{Loading01-DyCC_wp5.js → Loading01-BtznjYdD.js} +1 -1
  16. package/dist/client/assets/{Lock01-CJO1oPaw.js → Lock01-DGk0NR9v.js} +1 -1
  17. package/dist/client/assets/Play-D_dkbQEF.js +1 -0
  18. package/dist/client/assets/{Plus-BoZvN_rT.js → Plus-Cmmt6kdX.js} +1 -1
  19. package/dist/client/assets/{SearchMd-DBw3zp_M.js → SearchMd-Csv5Q_gT.js} +1 -1
  20. package/dist/client/assets/{Terminal-DURJ2Sop.js → Terminal-mFLPBz-Y.js} +1 -1
  21. package/dist/client/assets/{Trash01-D8NpuzHg.js → Trash01-ZjdY9Thx.js} +1 -1
  22. package/dist/client/assets/{Upload01-BYUhUNdK.js → Upload01-BL_smb86.js} +1 -1
  23. package/dist/client/assets/{X-BV7uqO3B.js → X-DBHfQHAW.js} +1 -1
  24. package/dist/client/assets/{XClose-Dez1KTRy.js → XClose-BjfF1u26.js} +1 -1
  25. package/dist/client/assets/{alert-dialog-2c4JlYwD.js → alert-dialog-CLKrwazh.js} +1 -1
  26. package/dist/client/assets/{auth-catchall-kFa24VQN.js → auth-catchall-L5hNy_48.js} +1 -1
  27. package/dist/client/assets/{auth-DLdX6AGd.js → auth-xselgzK2.js} +1 -1
  28. package/dist/client/assets/{avatar-NC000dj0.js → avatar-D3l3SwY5.js} +1 -1
  29. package/dist/client/assets/{badge-ffsmxYLL.js → badge-6daA1Xk-.js} +1 -1
  30. package/dist/client/assets/{button-BM8Ntdfr.js → button-CFHFP204.js} +1 -1
  31. package/dist/client/assets/{card-BWKGhflg.js → card-DhbXb2hL.js} +1 -1
  32. package/dist/client/assets/{checkbox-CDB4i5WM.js → checkbox-BUzjaLuN.js} +1 -1
  33. package/dist/client/assets/collection-detail-D-1rhDCF.js +184 -0
  34. package/dist/client/assets/{collection-display-button-M0ZEYwbq.js → collection-display-button-s533wXMW.js} +1 -1
  35. package/dist/client/assets/{collection-header-BZq2RMFO.js → collection-header-BTy0NEKS.js} +1 -1
  36. package/dist/client/assets/{collection-page-DV7fHb8_.js → collection-page-CVrAS9E8.js} +1 -1
  37. package/dist/client/assets/{collection-search-D4vMytfv.js → collection-search-CF2FAa9j.js} +1 -1
  38. package/dist/client/assets/{collection-table-wrapper-CDYLUpBi.js → collection-table-wrapper-CIM6pfWy.js} +1 -1
  39. package/dist/client/assets/{connection-card-DMoDmlju.js → connection-card-CoYgiSAy.js} +1 -1
  40. package/dist/client/assets/{connection-detail-BPMKrF4u.js → connection-detail-D9Nx3j__.js} +1 -1
  41. package/dist/client/assets/connections-DwXpLEQ7.js +1 -0
  42. package/dist/client/assets/{core-CJVZ6TZ4.js → core-UzwkWBsa.js} +1 -1
  43. package/dist/client/assets/{create-organization-dialog-DY8wFeXZ.js → create-organization-dialog-DPCOgwS8.js} +1 -1
  44. package/dist/client/assets/dialog-DDJjJiXv.js +1 -0
  45. package/dist/client/assets/{dropdown-menu-4Ypgp2xI.js → dropdown-menu-BVDy9llW.js} +1 -1
  46. package/dist/client/assets/{env-vars-editor-DuAsDAtd.js → env-vars-editor-CSYlB5et.js} +1 -1
  47. package/dist/client/assets/{error-boundary-Dd7BgwTJ.js → error-boundary-BxGgxrSw.js} +1 -1
  48. package/dist/client/assets/{extract-connection-data-C4wZpmQd.js → extract-connection-data-DYIo3urs.js} +1 -1
  49. package/dist/client/assets/{form-DNdbWanJ.js → form-O3ENwuWy.js} +1 -1
  50. package/dist/client/assets/{formatDistanceToNow-CNMZ-Ei_.js → formatDistanceToNow-DbTeYEPs.js} +1 -1
  51. package/dist/client/assets/{gateway-detail-De4b4XSK.js → gateway-detail-4NLA7mwB.js} +1 -1
  52. package/dist/client/assets/{gateways-q4D0Ec2r.js → gateways-Chp0OiTi.js} +1 -1
  53. package/dist/client/assets/{home-RuIm8-ic.js → home-C7yAtry6.js} +1 -1
  54. package/dist/client/assets/{index-CD92JRY8.js → index-B9tJom0a.js} +2 -2
  55. package/dist/client/assets/index-BFYCiRaa.css +1 -0
  56. package/dist/client/assets/{index-CGy1qJ5Y.js → index-C6fnPeNc.js} +1 -1
  57. package/dist/client/assets/{index-BlsDXE23.js → index-CiPLnea-.js} +21 -21
  58. package/dist/client/assets/{index-MYfTA9Ba.js → index-DIWvfi3d.js} +1 -1
  59. package/dist/client/assets/{input-B45bC0Rc.js → input-iugRl47V.js} +1 -1
  60. package/dist/client/assets/json-BJR-gxzf.js +1 -0
  61. package/dist/client/assets/json-syntax-highlighter-o9Q8Bpjl.js +2 -0
  62. package/dist/client/assets/{layout-RDUry3u6.js → layout-pV-LEIdm.js} +1 -1
  63. package/dist/client/assets/{lazy-highlighter-KouMYaFu.js → lazy-highlighter-Czs-NOYe.js} +1 -1
  64. package/dist/client/assets/{localstorage-keys-BNPDgZQf.js → localstorage-keys-0rhjy_fp.js} +1 -1
  65. package/dist/client/assets/{login-BZwM9o36.js → login-CwJiA9wL.js} +1 -1
  66. package/dist/client/assets/{mcp-oauth-BxQJ_sZ7.js → mcp-oauth-BKyHMwxJ.js} +1 -1
  67. package/dist/client/assets/members-tsvd98Wp.js +3 -0
  68. package/dist/client/assets/monitoring-DqS96I2Z.js +4 -0
  69. package/dist/client/assets/{oauth-callback-C8RVlzMp.js → oauth-callback-DrBJtf1G.js} +1 -1
  70. package/dist/client/assets/{page-D9cTJOkH.js → page-CIddjpQi.js} +2 -2
  71. package/dist/client/assets/{popover-CDfnuIYl.js → popover-B_NyiW1Q.js} +1 -1
  72. package/dist/client/assets/prism-light-CEisnFKn.js +1 -0
  73. package/dist/client/assets/resizable-DR6TRvc0.js +98 -0
  74. package/dist/client/assets/{resource-tabs-yHmaZ9ZD.js → resource-tabs-tnRJokpH.js} +1 -1
  75. package/dist/client/assets/{select-CG-oLpgX.js → select-DfammiWD.js} +1 -1
  76. package/dist/client/assets/{settings-CrKQeRt-.js → settings-eYWaSfqs.js} +1 -1
  77. package/dist/client/assets/shell-layout-CuchTujm.js +19 -0
  78. package/dist/client/assets/{spinner-BIp36cWs.js → spinner-D4EsgSmE.js} +1 -1
  79. package/dist/client/assets/store-BbbKGxbw.js +1 -0
  80. package/dist/client/assets/{store-app-detail-CxLOlzfX.js → store-app-detail-N830c_Ks.js} +1 -1
  81. package/dist/client/assets/{switch-Ckivla4Z.js → switch-BXWlo3EE.js} +1 -1
  82. package/dist/client/assets/textarea-D1hQDzao.js +1 -0
  83. package/dist/client/assets/{tools-list-DWIsrkx2.js → tools-list-Bwj-fDqE.js} +1 -1
  84. package/dist/client/assets/{tooltip-CYopm1Sm.js → tooltip-BsevTbJB.js} +1 -1
  85. package/dist/client/assets/types-j-TFLOzi.js +46 -0
  86. package/dist/client/assets/{use-binding-DiGbYyGi.js → use-binding-CXIqq1bv.js} +7 -7
  87. package/dist/client/assets/{use-connection-BGthiOfQ.js → use-connection-jCRGwpV6.js} +1 -1
  88. package/dist/client/assets/{use-connection-resources-B-9emPmy.js → use-connection-resources-DJbpQoWM.js} +1 -1
  89. package/dist/client/assets/{use-gateway-B_vZFCo_.js → use-gateway-J9ygFzp4.js} +1 -1
  90. package/dist/client/assets/{use-list-state-D2xhuXBP.js → use-list-state-BGC5b0Pz.js} +1 -1
  91. package/dist/client/assets/{use-mcp-CKeUPEl8.js → use-mcp-xRGeWjGX.js} +1 -1
  92. package/dist/client/assets/{use-members-DGy3Ohsl.js → use-members-D3_MeK6r.js} +1 -1
  93. package/dist/client/assets/{use-mobile-BSF9aYm8.js → use-mobile-zZh9WHEY.js} +1 -1
  94. package/dist/client/assets/{use-organization-settings-Xs2e_hDY.js → use-organization-settings-_KK3dEko.js} +1 -1
  95. package/dist/client/assets/{use-tool-call-DOhzogS9.js → use-tool-call-Bukcla53.js} +1 -1
  96. package/dist/client/assets/useQuery-DDngHzZ8.js +1 -0
  97. package/dist/client/assets/{useSuspenseInfiniteQuery-HnhdgP6D.js → useSuspenseInfiniteQuery-Cdb8QUCh.js} +1 -1
  98. package/dist/client/assets/{view-mode-toggle-D-v785I-.js → view-mode-toggle-CCJ4Oh3w.js} +1 -1
  99. package/dist/client/index.html +2 -2
  100. package/dist/server/cli.js +144 -144
  101. package/dist/server/migrate.js +85 -85
  102. package/dist/server/server.js +138 -138
  103. package/package.json +1 -1
  104. package/dist/client/assets/collection-detail-DUvB2Vch.js +0 -184
  105. package/dist/client/assets/connections-W2RFM1S-.js +0 -1
  106. package/dist/client/assets/dialog-_0iI5rNw.js +0 -1
  107. package/dist/client/assets/index-BdkjLo3e.css +0 -1
  108. package/dist/client/assets/json-DzSEyFTU.js +0 -1
  109. package/dist/client/assets/json-syntax-highlighter-DO7qBvWL.js +0 -2
  110. package/dist/client/assets/members-b4fCyidG.js +0 -3
  111. package/dist/client/assets/monitoring-C3u-RljV.js +0 -1
  112. package/dist/client/assets/prism-light-CAnIadDL.js +0 -1
  113. package/dist/client/assets/resizable-CwsfF64n.js +0 -98
  114. package/dist/client/assets/shell-layout-DRz6Ov6H.js +0 -19
  115. package/dist/client/assets/store-DpYoNJNm.js +0 -1
  116. package/dist/client/assets/types-Bmw9MVte.js +0 -44
  117. package/dist/client/assets/useQuery-CA4Qsiz4.js +0 -1
@@ -0,0 +1,98 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lazy-highlighter-Czs-NOYe.js","assets/index-CiPLnea-.js","assets/index-BFYCiRaa.css","assets/core-UzwkWBsa.js","assets/json-BESjz4hO.js"])))=>i.map(i=>d[i]);
2
+ import{r as v,c as K,e as co,K as Ge,q as ka,aF as Ud,aG as zd,aH as Qe,w as W,aI as jr,aJ as fo,aK as jd,aL as $d,aM as Yd,Y as $e,X as ir,W as pr,v as ke,aN as ne,aO as It,aP as qd,aQ as Ne,_ as Vd,a3 as Sa,j as m,ax as Wd,f as Gd,t as Ci,aR as kn,a0 as ho,a6 as Qd}from"./index-CiPLnea-.js";import{E as Xd,u as Zd}from"./use-binding-CXIqq1bv.js";import{u as Mt,i as Kt,c as Ia,b as Na,T as wa}from"./tooltip-BsevTbJB.js";import{u as Gt,c as ce,B as Bt}from"./button-CFHFP204.js";import{i as Ra}from"./CpuChip02-vo-KC-ou.js";import{i as po}from"./SearchMd-Csv5Q_gT.js";import{b as Kd,I as mo,U as Jd,e as ef,c as tf,u as nf}from"./use-connection-jCRGwpV6.js";import{u as rf}from"./use-gateway-J9ygFzp4.js";import{i as af}from"./X-DBHfQHAW.js";import{j as sf,i as go,c as uf}from"./dropdown-menu-BVDy9llW.js";import{T as of}from"./textarea-D1hQDzao.js";import{u as lf,L as cf}from"./localstorage-keys-0rhjy_fp.js";import{a as ti}from"./Copy01-08G580G9.js";import{i as df}from"./AlertCircle-CRDUE68O.js";import{i as ff}from"./Terminal-mFLPBz-Y.js";import{C as hf}from"./connection-card-CoYgiSAy.js";import{n as pf}from"./LinkExternal01-BdHgX43H.js";import{J as Dr}from"./json-syntax-highlighter-o9Q8Bpjl.js";import{b as mf,c as gf,d as bf,A as Ef,a as Tf,e as xf,g as _f,f as yf}from"./alert-dialog-CLKrwazh.js";import{b as Af,a as Cf,c as kf,S as Sf}from"./select-DfammiWD.js";import{u as If}from"./use-mobile-zZh9WHEY.js";import{i as Nf}from"./File06-BwkobN1x.js";import{i as wf}from"./InfoCircle-B76kcv1L.js";const bo=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"M15.938 15.938A7.001 7.001 0 0 0 15 2a7.001 7.001 0 0 0-6.938 6.062M16 15a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));bo.displayName="Coins01";const Eo=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"M9 14 4 9m0 0 5-5M4 9h6.4c3.36 0 5.04 0 6.324.654a6 6 0 0 1 2.622 2.622C20 13.56 20 15.24 20 18.6V20"}));Eo.displayName="CornerUpLeft";const To=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"M6 16a4 4 0 0 0 4 4h4a4 4 0 0 0 0-8h-4a4 4 0 0 1 0-8h4a4 4 0 0 1 4 4m-6-6v20"}));To.displayName="CurrencyDollar";const xo=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"M12 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm7-14a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM5 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"}));xo.displayName="DotsGrid";const _o=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"m18 10-4-4M2.5 21.5l3.384-.376c.414-.046.62-.069.814-.131a2 2 0 0 0 .485-.234c.17-.111.317-.259.61-.553L21 7a2.828 2.828 0 1 0-4-4L3.794 16.206c-.294.294-.442.442-.553.611a2 2 0 0 0-.234.485c-.062.193-.085.4-.131.814L2.5 21.5Z"}));_o.displayName="Edit02";const yo=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"M16.2 21H6.931c-.605 0-.908 0-1.049-.12a.5.5 0 0 1-.173-.42c.014-.183.228-.397.657-.826l8.503-8.503c.396-.396.594-.594.822-.668a1 1 0 0 1 .618 0c.228.074.426.272.822.668L21 15v1.2M16.2 21c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C21 18.72 21 17.88 21 16.2M16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4M10.5 8.5a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z"}));yo.displayName="Image01";const Ao=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"M15 16.5V19c0 .932 0 1.398-.152 1.765a2 2 0 0 1-1.083 1.083C13.398 22 12.932 22 12 22c-.932 0-1.398 0-1.765-.152a2 2 0 0 1-1.083-1.083C9 20.398 9 19.932 9 19v-2.5m6 0c2.649-1.157 4.5-3.925 4.5-7a7.5 7.5 0 0 0-15 0c0 3.075 1.851 5.843 4.5 7m6 0H9"}));Ao.displayName="Lightbulb01";const Co=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"m18 8 4 4m0 0-4 4m4-4H9m6-7.796A8.383 8.383 0 0 0 10.667 3C5.88 3 2 7.03 2 12s3.88 9 8.667 9A8.384 8.384 0 0 0 15 19.796"}));Co.displayName="LogOut04";const ko=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"m10 15-3.075 3.114c-.43.434-.644.651-.828.666a.5.5 0 0 1-.421-.172c-.12-.14-.12-.446-.12-1.056v-1.56c0-.548-.449-.944-.99-1.024v0a3 3 0 0 1-2.534-2.533C2 12.219 2 11.96 2 11.445V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C4.28 2 5.12 2 6.8 2h7.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C19 4.28 19 5.12 19 6.8V11m0 11-2.176-1.513c-.306-.213-.46-.32-.626-.395a2.002 2.002 0 0 0-.462-.145c-.18-.033-.367-.033-.74-.033H13.2c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874C10 18.394 10 17.834 10 16.714V14.2c0-1.12 0-1.68.218-2.108a2 2 0 0 1 .874-.874C11.52 11 12.08 11 13.2 11h5.6c1.12 0 1.68 0 2.108.218a2 2 0 0 1 .874.874C22 12.52 22 13.08 22 14.2v2.714c0 .932 0 1.398-.152 1.766a2 2 0 0 1-1.083 1.082c-.367.152-.833.152-1.765.152V22Z"}));ko.displayName="MessageChatSquare";const ni=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"m6.5 13 .784 1.569c.266.53.399.796.576 1.026a3 3 0 0 0 .545.545c.23.177.495.31 1.026.575L11 17.5l-1.569.785c-.53.265-.796.398-1.026.575a3 3 0 0 0-.545.545c-.177.23-.31.495-.576 1.026L6.5 22l-.784-1.569c-.266-.53-.399-.796-.576-1.026a3 3 0 0 0-.545-.545c-.23-.177-.495-.31-1.026-.575L2 17.5l1.569-.785c.53-.265.796-.398 1.026-.575a3 3 0 0 0 .545-.545c.177-.23.31-.495.576-1.026L6.5 13ZM15 2l1.179 3.064c.282.734.423 1.1.642 1.409a3 3 0 0 0 .706.706c.309.22.675.36 1.409.642L22 9l-3.064 1.179c-.734.282-1.1.423-1.409.642a3 3 0 0 0-.706.706c-.22.309-.36.675-.642 1.409L15 16l-1.179-3.064c-.282-.734-.423-1.1-.642-1.409a3 3 0 0 0-.706-.706c-.309-.22-.675-.36-1.409-.642L8 9l3.064-1.179c.734-.282 1.1-.423 1.409-.642a3 3 0 0 0 .706-.706c.22-.309.36-.675.642-1.409L15 2Z"}));ni.displayName="Stars01";const So=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"}));So.displayName="Stop";const Io=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"M16 8V5l3-3 1 2 2 1-3 3h-3Zm0 0-4 4m10 0c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2m5 10a5 5 0 1 1-5-5"}));Io.displayName="Target04";var ar;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const a={};for(const s of i)a[s]=s;return a},t.getValidEnumValues=i=>{const a=t.objectKeys(i).filter(u=>typeof i[i[u]]!="number"),s={};for(const u of a)s[u]=i[u];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(a){return i[a]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&a.push(s);return a},t.find=(i,a)=>{for(const s of i)if(a(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,a=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(a)}t.joinValues=r,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(ar||(ar={}));var gs;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(gs||(gs={}));ar.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);ar.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class $r extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(a){return a.message},r={_errors:[]},i=a=>{for(const s of a.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let u=r,o=0;for(;o<s.path.length;){const l=s.path[o];o===s.path.length-1?(u[l]=u[l]||{_errors:[]},u[l]._errors.push(n(s))):u[l]=u[l]||{_errors:[]},u=u[l],o++}}};return i(this),r}static assert(e){if(!(e instanceof $r))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ar.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n=Object.create(null),r=[];for(const i of this.issues)if(i.path.length>0){const a=i.path[0];n[a]=n[a]||[],n[a].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}$r.create=t=>new $r(t);var bs;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(bs||(bs={}));var ae;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ae||(ae={}));function Jt(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}function Rf(t,e){let n;const r=()=>{if(n)return n;const i=indexedDB.open(t);return i.onupgradeneeded=()=>i.result.createObjectStore(e),n=Jt(i),n.then(a=>{a.onclose=()=>n=void 0},()=>{}),n};return(i,a)=>r().then(s=>a(s.transaction(e,i).objectStore(e)))}let ki;function ri(){return ki||(ki=Rf("keyval-store","keyval")),ki}function La(t,e=ri()){return e("readonly",n=>Jt(n.get(t)))}function Gn(t,e,n=ri()){return n("readwrite",r=>(r.put(e,t),Jt(r.transaction)))}function No(t,e=ri()){return e("readwrite",n=>(n.delete(t),Jt(n.transaction)))}function Lf(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},Jt(t.transaction)}function wo(t=ri()){return t("readonly",e=>{if(e.getAll&&e.getAllKeys)return Promise.all([Jt(e.getAllKeys()),Jt(e.getAll())]).then(([r,i])=>r.map((a,s)=>[a,i[s]]));const n=[];return t("readonly",r=>Lf(r,i=>n.push([i.key,i.value])).then(()=>n))})}async function Of(t,e){const n=`${t}:threads:${e}`;return await La(n)??null}async function vf(t){const e=`${t}:threads:`;return(await wo()).filter(([i])=>typeof i=="string"&&i.startsWith(e)).map(([,i])=>i).filter(i=>!i.hidden).sort((i,a)=>String(a.updated_at).localeCompare(String(i.updated_at)))}function Ro(t,e){const n=`${t}:messages:`;return wo().then(r=>r.filter(([a])=>typeof a=="string"&&a.startsWith(n)).map(([,a])=>a).filter(a=>a.metadata?.thread_id===e||a.threadId===e).sort((a,s)=>{const u=a.metadata?.created_at||a.createdAt||"",o=s.metadata?.created_at||s.createdAt||"";return String(u).localeCompare(String(o))}))}function Zy(){const t=K.c(12),{locator:e}=Mt();let n;t[0]!==e?(n=Ge.threads(e),t[0]=e,t[1]=n):n=t[1];let r;t[2]!==e?(r=()=>vf(e),t[2]=e,t[3]=r):r=t[3];let i;t[4]!==n||t[5]!==r?(i={queryKey:n,queryFn:r,staleTime:3e4},t[4]=n,t[5]=r,t[6]=i):i=t[6];const{data:a,refetch:s}=ka(i);let u;t[7]!==a?(u=a??[],t[7]=a,t[8]=u):u=t[8];let o;return t[9]!==s||t[10]!==u?(o={threads:u,refetch:s},t[9]=s,t[10]=u,t[11]=o):o=t[11],o}function Df(t){const e=K.c(11),{locator:n}=Mt();let r;e[0]!==n||e[1]!==t?(r=Ge.threadMessages(n,t),e[0]=n,e[1]=t,e[2]=r):r=e[2];let i;e[3]!==n||e[4]!==t?(i=()=>Ro(n,t),e[3]=n,e[4]=t,e[5]=i):i=e[5];let a;e[6]!==r||e[7]!==i?(a={queryKey:r,queryFn:i,staleTime:3e4},e[6]=r,e[7]=i,e[8]=a):a=e[8];const{data:s}=ka(a);let u;return e[9]!==s?(u=s??[],e[9]=s,e[10]=u):u=e[10],u}function Oa(){const t=K.c(28),{locator:e}=Mt(),n=co();let r;t[0]!==e?(r=async _=>{const b=`${e}:threads:${_.id}`;return await Gn(b,_),_},t[0]=e,t[1]=r):r=t[1];let i;t[2]!==e||t[3]!==n?(i=()=>{n.invalidateQueries({queryKey:Ge.threads(e)})},t[2]=e,t[3]=n,t[4]=i):i=t[4];let a;t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7];const s=Gt(a);let u;t[8]!==e?(u=async _=>{const{id:b,updates:k}=_,E=`${e}:threads:${b}`,w=await La(E);if(!w)throw new Error(`Thread ${b} not found`);const R={...w,...k};return await Gn(E,R),R},t[8]=e,t[9]=u):u=t[9];let o;t[10]!==e||t[11]!==n?(o=_=>{n.invalidateQueries({queryKey:Ge.threads(e)}),n.invalidateQueries({queryKey:Ge.thread(e,_.id)})},t[10]=e,t[11]=n,t[12]=o):o=t[12];let l;t[13]!==u||t[14]!==o?(l={mutationFn:u,onSuccess:o},t[13]=u,t[14]=o,t[15]=l):l=t[15];const f=Gt(l);let d;t[16]!==e?(d=async _=>{const b=`${e}:threads:${_}`;return await No(b),_},t[16]=e,t[17]=d):d=t[17];let h;t[18]!==e||t[19]!==n?(h=()=>{n.invalidateQueries({queryKey:Ge.threads(e)})},t[18]=e,t[19]=n,t[20]=h):h=t[20];let p;t[21]!==d||t[22]!==h?(p={mutationFn:d,onSuccess:h},t[21]=d,t[22]=h,t[23]=p):p=t[23];const g=Gt(p);let x;return t[24]!==g||t[25]!==s||t[26]!==f?(x={insert:s,update:f,delete:g},t[24]=g,t[25]=s,t[26]=f,t[27]=x):x=t[27],x}function Lo(){const t=K.c(37),{locator:e}=Mt(),n=co();let r;t[0]!==e?(r=async w=>{const R=`${e}:messages:${w.id}`;return await Gn(R,w),w},t[0]=e,t[1]=r):r=t[1];let i;t[2]!==e||t[3]!==n?(i=w=>{const R=w.metadata?.thread_id||w.threadId;R&&n.invalidateQueries({queryKey:Ge.threadMessages(e,R)}),n.invalidateQueries({queryKey:Ge.messages(e)})},t[2]=e,t[3]=n,t[4]=i):i=t[4];let a;t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7];const s=Gt(a);let u;t[8]!==e?(u=async w=>(await Promise.all(w.map(R=>{const S=`${e}:messages:${R.id}`;return Gn(S,R)})),w),t[8]=e,t[9]=u):u=t[9];let o;t[10]!==e||t[11]!==n?(o=w=>{const R=new Set;for(const S of w){const O=S.metadata?.thread_id||S.threadId;O&&R.add(O)}for(const S of R)n.invalidateQueries({queryKey:Ge.threadMessages(e,S)});n.invalidateQueries({queryKey:Ge.messages(e)})},t[10]=e,t[11]=n,t[12]=o):o=t[12];let l;t[13]!==u||t[14]!==o?(l={mutationFn:u,onSuccess:o},t[13]=u,t[14]=o,t[15]=l):l=t[15];const f=Gt(l);let d;t[16]!==e?(d=async w=>{const{id:R,updates:S}=w,O=`${e}:messages:${R}`,F=await La(O);if(!F)throw new Error(`Message ${R} not found`);const j={...F,...S};return await Gn(O,j),j},t[16]=e,t[17]=d):d=t[17];let h;t[18]!==e||t[19]!==n?(h=w=>{const R=w.metadata?.thread_id||w.threadId;R&&n.invalidateQueries({queryKey:Ge.threadMessages(e,R)}),n.invalidateQueries({queryKey:Ge.messages(e)})},t[18]=e,t[19]=n,t[20]=h):h=t[20];let p;t[21]!==d||t[22]!==h?(p={mutationFn:d,onSuccess:h},t[21]=d,t[22]=h,t[23]=p):p=t[23];const g=Gt(p);let x;t[24]!==e?(x=async w=>{const R=`${e}:messages:${w}`;return await No(R),w},t[24]=e,t[25]=x):x=t[25];let _;t[26]!==e||t[27]!==n?(_=()=>{n.invalidateQueries({queryKey:Ge.messages(e)})},t[26]=e,t[27]=n,t[28]=_):_=t[28];let b;t[29]!==_||t[30]!==x?(b={mutationFn:x,onSuccess:_},t[29]=_,t[30]=x,t[31]=b):b=t[31];const k=Gt(b);let E;return t[32]!==k||t[33]!==s||t[34]!==f||t[35]!==g?(E={insert:s,insertMany:f,update:g,delete:k},t[32]=k,t[33]=s,t[34]=f,t[35]=g,t[36]=E):E=t[36],E}async function Pf(t){const e=`/mcp/gateway/${t}`,n={"Content-Type":"application/json",Accept:"application/json, text/event-stream"};try{const r=await fetch(e,{method:"POST",headers:n,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"mesh-chat",version:"1.0.0"}}})});if(!r.ok)return[];if((await r.json()).error)return[];const a=await fetch(e,{method:"POST",headers:n,body:JSON.stringify({jsonrpc:"2.0",id:2,method:"prompts/list",params:{}})});if(!a.ok)return[];const s=await a.json();return s.error?[]:s.result?.prompts||[]}catch{return[]}}function Ky(t){const e=K.c(7);let n;e[0]!==t?(n=Ge.gatewayPrompts(t),e[0]=t,e[1]=n):n=e[1];let r;e[2]!==t?(r=()=>Pf(t),e[2]=t,e[3]=r):r=e[3];let i;return e[4]!==n||e[5]!==r?(i={queryKey:n,queryFn:r,staleTime:6e4,retry:!1},e[4]=n,e[5]=r,e[6]=i):i=e[6],ka(i)}var Oo="vercel.ai.error",Mf=Symbol.for(Oo),Es,Ts,Pt=class vo extends(Ts=Error,Es=Mf,Ts){constructor({name:e,message:n,cause:r}){super(n),this[Es]=!0,this.name=e,this.cause=r}static isInstance(e){return vo.hasMarker(e,Oo)}static hasMarker(e,n){const r=Symbol.for(n);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function Do(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Po="AI_InvalidArgumentError",Mo=`vercel.ai.error.${Po}`,Bf=Symbol.for(Mo),xs,_s,Ff=class extends(_s=Pt,xs=Bf,_s){constructor({message:t,cause:e,argument:n}){super({name:Po,message:t,cause:e}),this[xs]=!0,this.argument=n}static isInstance(t){return Pt.hasMarker(t,Mo)}},Bo="AI_JSONParseError",Fo=`vercel.ai.error.${Bo}`,Hf=Symbol.for(Fo),ys,As,Cs=class extends(As=Pt,ys=Hf,As){constructor({text:t,cause:e}){super({name:Bo,message:`JSON parsing failed: Text: ${t}.
3
+ Error message: ${Do(e)}`,cause:e}),this[ys]=!0,this.text=t}static isInstance(t){return Pt.hasMarker(t,Fo)}},Ho="AI_TypeValidationError",Uo=`vercel.ai.error.${Ho}`,Uf=Symbol.for(Uo),ks,Ss,_n=class Ji extends(Ss=Pt,ks=Uf,Ss){constructor({value:e,cause:n}){super({name:Ho,message:`Type validation failed: Value: ${JSON.stringify(e)}.
4
+ Error message: ${Do(n)}`,cause:n}),this[ks]=!0,this.value=e}static isInstance(e){return Pt.hasMarker(e,Uo)}static wrap({value:e,cause:n}){return Ji.isInstance(n)&&n.value===e?n:new Ji({value:e,cause:n})}},mr=({prefix:t,size:e=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const i=()=>{const a=n.length,s=new Array(e);for(let u=0;u<e;u++)s[u]=n[Math.random()*a|0];return s.join("")};if(t==null)return i;if(n.includes(r))throw new Ff({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${t}${r}${i()}`},zf=mr();function Is(t=globalThis){var e,n,r;return t.window?"runtime/browser":(e=t.navigator)!=null&&e.userAgent?`runtime/${t.navigator.userAgent.toLowerCase()}`:(r=(n=t.process)==null?void 0:n.versions)!=null&&r.node?`runtime/node.js/${t.process.version.substring(0)}`:t.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function Vt(t){if(t==null)return{};const e={};if(t instanceof Headers)t.forEach((n,r)=>{e[r.toLowerCase()]=n});else{Array.isArray(t)||(t=Object.entries(t));for(const[n,r]of t)r!=null&&(e[n.toLowerCase()]=r)}return e}function Ns(t,...e){const n=new Headers(Vt(t)),r=n.get("user-agent")||"";return n.set("user-agent",[r,...e].filter(Boolean).join(" ")),Object.fromEntries(n.entries())}var jf=/"__proto__"\s*:/,$f=/"constructor"\s*:/;function ws(t){const e=JSON.parse(t);return e===null||typeof e!="object"||jf.test(t)===!1&&$f.test(t)===!1?e:Yf(e)}function Yf(t){let e=[t];for(;e.length;){const n=e;e=[];for(const r of n){if(Object.prototype.hasOwnProperty.call(r,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(r,"constructor")&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const i in r){const a=r[i];a&&typeof a=="object"&&e.push(a)}}}return t}function qf(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return ws(t)}try{return ws(t)}finally{Error.stackTraceLimit=e}}function zo(t){if(t.type==="object"||Array.isArray(t.type)&&t.type.includes("object")){t.additionalProperties=!1;const{properties:n}=t;if(n!=null)for(const r of Object.keys(n))n[r]=$t(n[r])}t.items!=null&&(t.items=Array.isArray(t.items)?t.items.map($t):$t(t.items)),t.anyOf!=null&&(t.anyOf=t.anyOf.map($t)),t.allOf!=null&&(t.allOf=t.allOf.map($t)),t.oneOf!=null&&(t.oneOf=t.oneOf.map($t));const{definitions:e}=t;if(e!=null)for(const n of Object.keys(e))e[n]=$t(e[n]);return t}function $t(t){return typeof t=="boolean"?t:zo(t)}var Vf=Symbol("Let zodToJsonSchema decide on which parser to use"),Rs={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},Wf=t=>typeof t=="string"?{...Rs,name:t}:{...Rs,...t};function nt(){return{}}function Gf(t,e){var n,r,i;const a={type:"array"};return(n=t.type)!=null&&n._def&&((i=(r=t.type)==null?void 0:r._def)==null?void 0:i.typeName)!==ae.ZodAny&&(a.items=ye(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(a.minItems=t.minLength.value),t.maxLength&&(a.maxItems=t.maxLength.value),t.exactLength&&(a.minItems=t.exactLength.value,a.maxItems=t.exactLength.value),a}function Qf(t){const e={type:"integer",format:"int64"};if(!t.checks)return e;for(const n of t.checks)switch(n.kind){case"min":n.inclusive?e.minimum=n.value:e.exclusiveMinimum=n.value;break;case"max":n.inclusive?e.maximum=n.value:e.exclusiveMaximum=n.value;break;case"multipleOf":e.multipleOf=n.value;break}return e}function Xf(){return{type:"boolean"}}function jo(t,e){return ye(t.type._def,e)}var Zf=(t,e)=>ye(t.innerType._def,e);function $o(t,e,n){const r=n??e.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((i,a)=>$o(t,e,i))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Kf(t)}}var Kf=t=>{const e={type:"integer",format:"unix-time"};for(const n of t.checks)switch(n.kind){case"min":e.minimum=n.value;break;case"max":e.maximum=n.value;break}return e};function Jf(t,e){return{...ye(t.innerType._def,e),default:t.defaultValue()}}function eh(t,e){return e.effectStrategy==="input"?ye(t.schema._def,e):nt()}function th(t){return{type:"string",enum:Array.from(t.values)}}var nh=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function rh(t,e){const n=[ye(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),ye(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(i=>!!i),r=[];return n.forEach(i=>{if(nh(i))r.push(...i.allOf);else{let a=i;if("additionalProperties"in i&&i.additionalProperties===!1){const{additionalProperties:s,...u}=i;a=u}r.push(a)}}),r.length?{allOf:r}:void 0}function ih(t){const e=typeof t.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(t.value)?"array":"object"}:{type:e==="bigint"?"integer":e,const:t.value}}var Si=void 0,ut={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Si===void 0&&(Si=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Si),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function Yo(t,e){const n={type:"string"};if(t.checks)for(const r of t.checks)switch(r.kind){case"min":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value;break;case"max":n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"email":switch(e.emailStrategy){case"format:email":ot(n,"email",r.message,e);break;case"format:idn-email":ot(n,"idn-email",r.message,e);break;case"pattern:zod":je(n,ut.email,r.message,e);break}break;case"url":ot(n,"uri",r.message,e);break;case"uuid":ot(n,"uuid",r.message,e);break;case"regex":je(n,r.regex,r.message,e);break;case"cuid":je(n,ut.cuid,r.message,e);break;case"cuid2":je(n,ut.cuid2,r.message,e);break;case"startsWith":je(n,RegExp(`^${Ii(r.value,e)}`),r.message,e);break;case"endsWith":je(n,RegExp(`${Ii(r.value,e)}$`),r.message,e);break;case"datetime":ot(n,"date-time",r.message,e);break;case"date":ot(n,"date",r.message,e);break;case"time":ot(n,"time",r.message,e);break;case"duration":ot(n,"duration",r.message,e);break;case"length":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value,n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"includes":{je(n,RegExp(Ii(r.value,e)),r.message,e);break}case"ip":{r.version!=="v6"&&ot(n,"ipv4",r.message,e),r.version!=="v4"&&ot(n,"ipv6",r.message,e);break}case"base64url":je(n,ut.base64url,r.message,e);break;case"jwt":je(n,ut.jwt,r.message,e);break;case"cidr":{r.version!=="v6"&&je(n,ut.ipv4Cidr,r.message,e),r.version!=="v4"&&je(n,ut.ipv6Cidr,r.message,e);break}case"emoji":je(n,ut.emoji(),r.message,e);break;case"ulid":{je(n,ut.ulid,r.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{ot(n,"binary",r.message,e);break}case"contentEncoding:base64":{n.contentEncoding="base64";break}case"pattern:zod":{je(n,ut.base64,r.message,e);break}}break}case"nanoid":je(n,ut.nanoid,r.message,e)}return n}function Ii(t,e){return e.patternStrategy==="escape"?sh(t):t}var ah=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function sh(t){let e="";for(let n=0;n<t.length;n++)ah.has(t[n])||(e+="\\"),e+=t[n];return e}function ot(t,e,n,r){var i;t.format||(i=t.anyOf)!=null&&i.some(a=>a.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format}),delete t.format),t.anyOf.push({format:e,...n&&r.errorMessages&&{errorMessage:{format:n}}})):t.format=e}function je(t,e,n,r){var i;t.pattern||(i=t.allOf)!=null&&i.some(a=>a.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:Ls(e,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):t.pattern=Ls(e,r)}function Ls(t,e){var n;if(!e.applyRegexFlags||!t.flags)return t.source;const r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},i=r.i?t.source.toLowerCase():t.source;let a="",s=!1,u=!1,o=!1;for(let l=0;l<i.length;l++){if(s){a+=i[l],s=!1;continue}if(r.i){if(u){if(i[l].match(/[a-z]/)){o?(a+=i[l],a+=`${i[l-2]}-${i[l]}`.toUpperCase(),o=!1):i[l+1]==="-"&&((n=i[l+2])!=null&&n.match(/[a-z]/))?(a+=i[l],o=!0):a+=`${i[l]}${i[l].toUpperCase()}`;continue}}else if(i[l].match(/[a-z]/)){a+=`[${i[l]}${i[l].toUpperCase()}]`;continue}}if(r.m){if(i[l]==="^"){a+=`(^|(?<=[\r
5
+ ]))`;continue}else if(i[l]==="$"){a+=`($|(?=[\r
6
+ ]))`;continue}}if(r.s&&i[l]==="."){a+=u?`${i[l]}\r
7
+ `:`[${i[l]}\r
8
+ ]`;continue}a+=i[l],i[l]==="\\"?s=!0:u&&i[l]==="]"?u=!1:!u&&i[l]==="["&&(u=!0)}try{new RegExp(a)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return a}function qo(t,e){var n,r,i,a,s,u;const o={type:"object",additionalProperties:(n=ye(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]}))!=null?n:e.allowedAdditionalProperties};if(((r=t.keyType)==null?void 0:r._def.typeName)===ae.ZodString&&((i=t.keyType._def.checks)!=null&&i.length)){const{type:l,...f}=Yo(t.keyType._def,e);return{...o,propertyNames:f}}else{if(((a=t.keyType)==null?void 0:a._def.typeName)===ae.ZodEnum)return{...o,propertyNames:{enum:t.keyType._def.values}};if(((s=t.keyType)==null?void 0:s._def.typeName)===ae.ZodBranded&&t.keyType._def.type._def.typeName===ae.ZodString&&((u=t.keyType._def.type._def.checks)!=null&&u.length)){const{type:l,...f}=jo(t.keyType._def,e);return{...o,propertyNames:f}}}return o}function uh(t,e){if(e.mapStrategy==="record")return qo(t,e);const n=ye(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||nt(),r=ye(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||nt();return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function oh(t){const e=t.values,r=Object.keys(t.values).filter(a=>typeof e[e[a]]!="number").map(a=>e[a]),i=Array.from(new Set(r.map(a=>typeof a)));return{type:i.length===1?i[0]==="string"?"string":"number":["string","number"],enum:r}}function lh(){return{not:nt()}}function ch(){return{type:"null"}}var ea={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function dh(t,e){const n=t.options instanceof Map?Array.from(t.options.values()):t.options;if(n.every(r=>r._def.typeName in ea&&(!r._def.checks||!r._def.checks.length))){const r=n.reduce((i,a)=>{const s=ea[a._def.typeName];return s&&!i.includes(s)?[...i,s]:i},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){const r=n.reduce((i,a)=>{const s=typeof a._def.value;switch(s){case"string":case"number":case"boolean":return[...i,s];case"bigint":return[...i,"integer"];case"object":if(a._def.value===null)return[...i,"null"];default:return i}},[]);if(r.length===n.length){const i=r.filter((a,s,u)=>u.indexOf(a)===s);return{type:i.length>1?i:i[0],enum:n.reduce((a,s)=>a.includes(s._def.value)?a:[...a,s._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,i)=>[...r,...i._def.values.filter(a=>!r.includes(a))],[])};return fh(t,e)}var fh=(t,e)=>{const n=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((r,i)=>ye(r._def,{...e,currentPath:[...e.currentPath,"anyOf",`${i}`]})).filter(r=>!!r&&(!e.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return n.length?{anyOf:n}:void 0};function hh(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return{type:[ea[t.innerType._def.typeName],"null"]};const n=ye(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function ph(t){const e={type:"number"};if(!t.checks)return e;for(const n of t.checks)switch(n.kind){case"int":e.type="integer";break;case"min":n.inclusive?e.minimum=n.value:e.exclusiveMinimum=n.value;break;case"max":n.inclusive?e.maximum=n.value:e.exclusiveMaximum=n.value;break;case"multipleOf":e.multipleOf=n.value;break}return e}function mh(t,e){const n={type:"object",properties:{}},r=[],i=t.shape();for(const s in i){let u=i[s];if(u===void 0||u._def===void 0)continue;const o=bh(u),l=ye(u._def,{...e,currentPath:[...e.currentPath,"properties",s],propertyPath:[...e.currentPath,"properties",s]});l!==void 0&&(n.properties[s]=l,o||r.push(s))}r.length&&(n.required=r);const a=gh(t,e);return a!==void 0&&(n.additionalProperties=a),n}function gh(t,e){if(t.catchall._def.typeName!=="ZodNever")return ye(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function bh(t){try{return t.isOptional()}catch{return!0}}var Eh=(t,e)=>{var n;if(e.currentPath.toString()===((n=e.propertyPath)==null?void 0:n.toString()))return ye(t.innerType._def,e);const r=ye(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:nt()},r]}:nt()},Th=(t,e)=>{if(e.pipeStrategy==="input")return ye(t.in._def,e);if(e.pipeStrategy==="output")return ye(t.out._def,e);const n=ye(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),r=ye(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(i=>i!==void 0)}};function xh(t,e){return ye(t.type._def,e)}function _h(t,e){const r={type:"array",uniqueItems:!0,items:ye(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&(r.minItems=t.minSize.value),t.maxSize&&(r.maxItems=t.maxSize.value),r}function yh(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((n,r)=>ye(n._def,{...e,currentPath:[...e.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:ye(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((n,r)=>ye(n._def,{...e,currentPath:[...e.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function Ah(){return{not:nt()}}function Ch(){return nt()}var kh=(t,e)=>ye(t.innerType._def,e),Sh=(t,e,n)=>{switch(e){case ae.ZodString:return Yo(t,n);case ae.ZodNumber:return ph(t);case ae.ZodObject:return mh(t,n);case ae.ZodBigInt:return Qf(t);case ae.ZodBoolean:return Xf();case ae.ZodDate:return $o(t,n);case ae.ZodUndefined:return Ah();case ae.ZodNull:return ch();case ae.ZodArray:return Gf(t,n);case ae.ZodUnion:case ae.ZodDiscriminatedUnion:return dh(t,n);case ae.ZodIntersection:return rh(t,n);case ae.ZodTuple:return yh(t,n);case ae.ZodRecord:return qo(t,n);case ae.ZodLiteral:return ih(t);case ae.ZodEnum:return th(t);case ae.ZodNativeEnum:return oh(t);case ae.ZodNullable:return hh(t,n);case ae.ZodOptional:return Eh(t,n);case ae.ZodMap:return uh(t,n);case ae.ZodSet:return _h(t,n);case ae.ZodLazy:return()=>t.getter()._def;case ae.ZodPromise:return xh(t,n);case ae.ZodNaN:case ae.ZodNever:return lh();case ae.ZodEffects:return eh(t,n);case ae.ZodAny:return nt();case ae.ZodUnknown:return Ch();case ae.ZodDefault:return Jf(t,n);case ae.ZodBranded:return jo(t,n);case ae.ZodReadonly:return kh(t,n);case ae.ZodCatch:return Zf(t,n);case ae.ZodPipeline:return Th(t,n);case ae.ZodFunction:case ae.ZodVoid:case ae.ZodSymbol:return;default:return(r=>{})()}},Ih=(t,e)=>{let n=0;for(;n<t.length&&n<e.length&&t[n]===e[n];n++);return[(t.length-n).toString(),...e.slice(n)].join("/")};function ye(t,e,n=!1){var r;const i=e.seen.get(t);if(e.override){const o=(r=e.override)==null?void 0:r.call(e,t,e,i,n);if(o!==Vf)return o}if(i&&!n){const o=Nh(i,e);if(o!==void 0)return o}const a={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,a);const s=Sh(t,t.typeName,e),u=typeof s=="function"?ye(s(),e):s;if(u&&wh(t,e,u),e.postProcess){const o=e.postProcess(u,t,e);return a.jsonSchema=u,o}return a.jsonSchema=u,u}var Nh=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:Ih(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((n,r)=>e.currentPath[r]===n)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),nt()):e.$refStrategy==="seen"?nt():void 0}},wh=(t,e,n)=>(t.description&&(n.description=t.description),n),Rh=t=>{const e=Wf(t),n=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([r,i])=>[i._def,{def:i._def,path:[...e.basePath,e.definitionPath,r],jsonSchema:void 0}]))}},Lh=(t,e)=>{var n;const r=Rh(e);let i=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((l,[f,d])=>{var h;return{...l,[f]:(h=ye(d._def,{...r,currentPath:[...r.basePath,r.definitionPath,f]},!0))!=null?h:nt()}},{}):void 0;const a=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,s=(n=ye(t._def,a===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,a]},!1))!=null?n:nt(),u=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;u!==void 0&&(s.title=u);const o=a===void 0?i?{...s,[r.definitionPath]:i}:s:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,a].join("/"),[r.definitionPath]:{...i,[a]:s}};return o.$schema="http://json-schema.org/draft-07/schema#",o},ta=Symbol.for("vercel.ai.schema");function Oh(t){let e;return()=>(e==null&&(e=t()),e)}function ii(t,{validate:e}={}){return{[ta]:!0,_type:void 0,get jsonSchema(){return typeof t=="function"&&(t=t()),t},validate:e}}function vh(t){return typeof t=="object"&&t!==null&&ta in t&&t[ta]===!0&&"jsonSchema"in t&&"validate"in t}function va(t){return t==null?ii({properties:{},additionalProperties:!1}):vh(t)?t:"~standard"in t?t["~standard"].vendor==="zod"?Vo(t):Dh(t):t()}function Dh(t){return ii(()=>t["~standard"].jsonSchema.input({target:"draft-07"}),{validate:async e=>{const n=await t["~standard"].validate(e);return"value"in n?{success:!0,value:n.value}:{success:!1,error:new _n({value:e,cause:n.issues})}}})}function Ph(t,e){var n;const r=(n=void 0)!=null?n:!1;return ii(()=>Lh(t,{$refStrategy:r?"root":"none"}),{validate:async i=>{const a=await t.safeParseAsync(i);return a.success?{success:!0,value:a.data}:{success:!1,error:a.error}}})}function Mh(t,e){var n;const r=(n=void 0)!=null?n:!1;return ii(()=>zo(zd(t,{target:"draft-7",io:"input",reused:r?"ref":"inline"})),{validate:async i=>{const a=await Ud(t,i);return a.success?{success:!0,value:a.data}:{success:!1,error:a.error}}})}function Bh(t){return"_zod"in t}function Vo(t,e){return Bh(t)?Mh(t):Ph(t)}async function Os({value:t,schema:e}){const n=await sr({value:t,schema:e});if(!n.success)throw _n.wrap({value:t,cause:n.error});return n.value}async function sr({value:t,schema:e}){const n=va(e);try{if(n.validate==null)return{success:!0,value:t,rawValue:t};const r=await n.validate(t);return r.success?{success:!0,value:r.value,rawValue:t}:{success:!1,error:_n.wrap({value:t,cause:r.error}),rawValue:t}}catch(r){return{success:!1,error:_n.wrap({value:t,cause:r}),rawValue:t}}}async function en({text:t,schema:e}){try{const n=qf(t);return e==null?{success:!0,value:n,rawValue:n}:await sr({value:n,schema:e})}catch(n){return{success:!1,error:Cs.isInstance(n)?n:new Cs({text:t,cause:n}),rawValue:void 0}}}function Fh({stream:t,schema:e}){return t.pipeThrough(new TextDecoderStream).pipeThrough(new Xd).pipeThrough(new TransformStream({async transform({data:n},r){n!=="[DONE]"&&r.enqueue(await en({text:n,schema:e}))}}))}async function Lt(t){return typeof t=="function"&&(t=t()),Promise.resolve(t)}var Hh=Object.defineProperty,Uh=(t,e)=>{for(var n in e)Hh(t,n,{get:e[n],enumerable:!0})},Wo="AI_NoObjectGeneratedError",Go=`vercel.ai.error.${Wo}`,zh=Symbol.for(Go),Qo,Dt=class extends Pt{constructor({message:t="No object generated.",cause:e,text:n,response:r,usage:i,finishReason:a}){super({name:Wo,message:t,cause:e}),this[Qo]=!0,this.text=n,this.response=r,this.usage=i,this.finishReason=a}static isInstance(t){return Pt.hasMarker(t,Go)}};Qo=zh;var vs="6.0.13",Xo=Qe([W(),jr(Uint8Array),jr(ArrayBuffer),fo(t=>{var e,n;return(n=(e=globalThis.Buffer)==null?void 0:e.isBuffer(t))!=null?n:!1},{message:"Must be a Buffer"})]),ur=jd(()=>Qe([$d(),W(),Yd(),$e(),ir(W(),ur.optional()),pr(ur)])),be=ir(W(),ir(W(),ur.optional())),Zo=ke({type:ne("text"),text:W(),providerOptions:be.optional()}),jh=ke({type:ne("image"),image:Qe([Xo,jr(URL)]),mediaType:W().optional(),providerOptions:be.optional()}),Ko=ke({type:ne("file"),data:Qe([Xo,jr(URL)]),filename:W().optional(),mediaType:W(),providerOptions:be.optional()}),$h=ke({type:ne("reasoning"),text:W(),providerOptions:be.optional()}),Yh=ke({type:ne("tool-call"),toolCallId:W(),toolName:W(),input:It(),providerOptions:be.optional(),providerExecuted:$e().optional()}),qh=qd("type",[ke({type:ne("text"),value:W(),providerOptions:be.optional()}),ke({type:ne("json"),value:ur,providerOptions:be.optional()}),ke({type:ne("execution-denied"),reason:W().optional(),providerOptions:be.optional()}),ke({type:ne("error-text"),value:W(),providerOptions:be.optional()}),ke({type:ne("error-json"),value:ur,providerOptions:be.optional()}),ke({type:ne("content"),value:pr(Qe([ke({type:ne("text"),text:W(),providerOptions:be.optional()}),ke({type:ne("media"),data:W(),mediaType:W()}),ke({type:ne("file-data"),data:W(),mediaType:W(),filename:W().optional(),providerOptions:be.optional()}),ke({type:ne("file-url"),url:W(),providerOptions:be.optional()}),ke({type:ne("file-id"),fileId:Qe([W(),ir(W(),W())]),providerOptions:be.optional()}),ke({type:ne("image-data"),data:W(),mediaType:W(),providerOptions:be.optional()}),ke({type:ne("image-url"),url:W(),providerOptions:be.optional()}),ke({type:ne("image-file-id"),fileId:Qe([W(),ir(W(),W())]),providerOptions:be.optional()}),ke({type:ne("custom"),providerOptions:be.optional()})]))})]),Jo=ke({type:ne("tool-result"),toolCallId:W(),toolName:W(),output:qh,providerOptions:be.optional()}),Vh=ke({type:ne("tool-approval-request"),approvalId:W(),toolCallId:W()}),Wh=ke({type:ne("tool-approval-response"),approvalId:W(),approved:$e(),reason:W().optional()}),Gh=ke({role:ne("system"),content:W(),providerOptions:be.optional()}),Qh=ke({role:ne("user"),content:Qe([W(),pr(Qe([Zo,jh,Ko]))]),providerOptions:be.optional()}),Xh=ke({role:ne("assistant"),content:Qe([W(),pr(Qe([Zo,Ko,$h,Yh,Jo,Vh]))]),providerOptions:be.optional()}),Zh=ke({role:ne("tool"),content:pr(Qe([Jo,Wh])),providerOptions:be.optional()});Qe([Gh,Qh,Xh,Zh]);function el(t,e){if(t===void 0&&e===void 0)return;if(t===void 0)return e;if(e===void 0)return t;const n={...t};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const i=e[r];if(i===void 0)continue;const a=r in t?t[r]:void 0,s=i!==null&&typeof i=="object"&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof RegExp),u=a!=null&&typeof a=="object"&&!Array.isArray(a)&&!(a instanceof Date)&&!(a instanceof RegExp);s&&u?n[r]=el(a,i):n[r]=i}return n}var Kh={};Uh(Kh,{array:()=>n0,choice:()=>r0,json:()=>i0,object:()=>t0,text:()=>e0});function Jh(t){const e=["ROOT"];let n=-1,r=null;function i(o,l,f){switch(o){case'"':{n=l,e.pop(),e.push(f),e.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=l,r=l,e.pop(),e.push(f),e.push("INSIDE_LITERAL");break}case"-":{e.pop(),e.push(f),e.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=l,e.pop(),e.push(f),e.push("INSIDE_NUMBER");break}case"{":{n=l,e.pop(),e.push(f),e.push("INSIDE_OBJECT_START");break}case"[":{n=l,e.pop(),e.push(f),e.push("INSIDE_ARRAY_START");break}}}function a(o,l){switch(o){case",":{e.pop(),e.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=l,e.pop();break}}}function s(o,l){switch(o){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=l,e.pop();break}}}for(let o=0;o<t.length;o++){const l=t[o];switch(e[e.length-1]){case"ROOT":i(l,o,"FINISH");break;case"INSIDE_OBJECT_START":{switch(l){case'"':{e.pop(),e.push("INSIDE_OBJECT_KEY");break}case"}":{n=o,e.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{l==='"'&&(e.pop(),e.push("INSIDE_OBJECT_KEY"));break}case"INSIDE_OBJECT_KEY":{l==='"'&&(e.pop(),e.push("INSIDE_OBJECT_AFTER_KEY"));break}case"INSIDE_OBJECT_AFTER_KEY":{l===":"&&(e.pop(),e.push("INSIDE_OBJECT_BEFORE_VALUE"));break}case"INSIDE_OBJECT_BEFORE_VALUE":{i(l,o,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{a(l,o);break}case"INSIDE_STRING":{switch(l){case'"':{e.pop(),n=o;break}case"\\":{e.push("INSIDE_STRING_ESCAPE");break}default:n=o}break}case"INSIDE_ARRAY_START":{l==="]"?(n=o,e.pop()):(n=o,i(l,o,"INSIDE_ARRAY_AFTER_VALUE"));break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(l){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=o,e.pop();break}default:{n=o;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{i(l,o,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{e.pop(),n=o;break}case"INSIDE_NUMBER":{switch(l){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=o;break}case"e":case"E":case"-":case".":break;case",":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(l,o),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&a(l,o);break}case"}":{e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&a(l,o);break}case"]":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(l,o);break}default:{e.pop();break}}break}case"INSIDE_LITERAL":{const d=t.substring(r,o+1);!"false".startsWith(d)&&!"true".startsWith(d)&&!"null".startsWith(d)?(e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?a(l,o):e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(l,o)):n=o;break}}}let u=t.slice(0,n+1);for(let o=e.length-1;o>=0;o--)switch(e[o]){case"INSIDE_STRING":{u+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{u+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{u+="]";break}case"INSIDE_LITERAL":{const f=t.substring(r,t.length);"true".startsWith(f)?u+="true".slice(f.length):"false".startsWith(f)?u+="false".slice(f.length):"null".startsWith(f)&&(u+="null".slice(f.length))}}return u}async function gr(t){if(t===void 0)return{value:void 0,state:"undefined-input"};let e=await en({text:t});return e.success?{value:e.value,state:"successful-parse"}:(e=await en({text:Jh(t)}),e.success?{value:e.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var e0=()=>({responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:t}){return t},async parsePartialOutput({text:t}){return{partial:t}}}),t0=({schema:t,name:e,description:n})=>{const r=va(t);return{responseFormat:Lt(r.jsonSchema).then(i=>({type:"json",schema:i,...e!=null&&{name:e},...n!=null&&{description:n}})),async parseCompleteOutput({text:i},a){const s=await en({text:i});if(!s.success)throw new Dt({message:"No object generated: could not parse the response.",cause:s.error,text:i,response:a.response,usage:a.usage,finishReason:a.finishReason});const u=await sr({value:s.value,schema:r});if(!u.success)throw new Dt({message:"No object generated: response did not match schema.",cause:u.error,text:i,response:a.response,usage:a.usage,finishReason:a.finishReason});return u.value},async parsePartialOutput({text:i}){const a=await gr(i);switch(a.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:a.value}}}}},n0=({element:t,name:e,description:n})=>{const r=va(t);return{responseFormat:Lt(r.jsonSchema).then(i=>{const{$schema:a,...s}=i;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:s}},required:["elements"],additionalProperties:!1},...e!=null&&{name:e},...n!=null&&{description:n}}}),async parseCompleteOutput({text:i},a){const s=await en({text:i});if(!s.success)throw new Dt({message:"No object generated: could not parse the response.",cause:s.error,text:i,response:a.response,usage:a.usage,finishReason:a.finishReason});const u=s.value;if(u==null||typeof u!="object"||!("elements"in u)||!Array.isArray(u.elements))throw new Dt({message:"No object generated: response did not match schema.",cause:new _n({value:u,cause:"response must be an object with an elements array"}),text:i,response:a.response,usage:a.usage,finishReason:a.finishReason});for(const o of u.elements){const l=await sr({value:o,schema:r});if(!l.success)throw new Dt({message:"No object generated: response did not match schema.",cause:l.error,text:i,response:a.response,usage:a.usage,finishReason:a.finishReason})}return u.elements},async parsePartialOutput({text:i}){const a=await gr(i);switch(a.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const s=a.value;if(s==null||typeof s!="object"||!("elements"in s)||!Array.isArray(s.elements))return;const u=a.state==="repaired-parse"&&s.elements.length>0?s.elements.slice(0,-1):s.elements,o=[];for(const l of u){const f=await sr({value:l,schema:r});f.success&&o.push(f.value)}return{partial:o}}}}}},r0=({options:t,name:e,description:n})=>({responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:t}},required:["result"],additionalProperties:!1},...e!=null&&{name:e},...n!=null&&{description:n}}),async parseCompleteOutput({text:r},i){const a=await en({text:r});if(!a.success)throw new Dt({message:"No object generated: could not parse the response.",cause:a.error,text:r,response:i.response,usage:i.usage,finishReason:i.finishReason});const s=a.value;if(s==null||typeof s!="object"||!("result"in s)||typeof s.result!="string"||!t.includes(s.result))throw new Dt({message:"No object generated: response did not match schema.",cause:new _n({value:s,cause:"response must be an object that contains a choice value."}),text:r,response:i.response,usage:i.usage,finishReason:i.finishReason});return s.result},async parsePartialOutput({text:r}){const i=await gr(r);switch(i.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const a=i.value;if(a==null||typeof a!="object"||!("result"in a)||typeof a.result!="string")return;const s=t.filter(u=>u.startsWith(a.result));return i.state==="successful-parse"?s.includes(a.result)?{partial:a.result}:void 0:s.length===1?{partial:s[0]}:void 0}}}}),i0=({name:t,description:e}={})=>({responseFormat:Promise.resolve({type:"json",...t!=null&&{name:t},...e!=null&&{description:e}}),async parseCompleteOutput({text:n},r){const i=await en({text:n});if(!i.success)throw new Dt({message:"No object generated: could not parse the response.",cause:i.error,text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});return i.value},async parsePartialOutput({text:n}){const r=await gr(n);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return r.value===void 0?void 0:{partial:r.value}}}});mr({prefix:"aitxt",size:24});(class extends TransformStream{constructor(){super({transform(t,e){e.enqueue(`data: ${JSON.stringify(t)}
9
+
10
+ `)},flush(t){t.enqueue(`data: [DONE]
11
+
12
+ `)}})}});var a0=Oh(()=>Vo(Qe([Ne({type:ne("text-start"),id:W(),providerMetadata:be.optional()}),Ne({type:ne("text-delta"),id:W(),delta:W(),providerMetadata:be.optional()}),Ne({type:ne("text-end"),id:W(),providerMetadata:be.optional()}),Ne({type:ne("error"),errorText:W()}),Ne({type:ne("tool-input-start"),toolCallId:W(),toolName:W(),providerExecuted:$e().optional(),dynamic:$e().optional(),title:W().optional()}),Ne({type:ne("tool-input-delta"),toolCallId:W(),inputTextDelta:W()}),Ne({type:ne("tool-input-available"),toolCallId:W(),toolName:W(),input:It(),providerExecuted:$e().optional(),providerMetadata:be.optional(),dynamic:$e().optional(),title:W().optional()}),Ne({type:ne("tool-input-error"),toolCallId:W(),toolName:W(),input:It(),providerExecuted:$e().optional(),providerMetadata:be.optional(),dynamic:$e().optional(),errorText:W(),title:W().optional()}),Ne({type:ne("tool-approval-request"),approvalId:W(),toolCallId:W()}),Ne({type:ne("tool-output-available"),toolCallId:W(),output:It(),providerExecuted:$e().optional(),dynamic:$e().optional(),preliminary:$e().optional()}),Ne({type:ne("tool-output-error"),toolCallId:W(),errorText:W(),providerExecuted:$e().optional(),dynamic:$e().optional()}),Ne({type:ne("tool-output-denied"),toolCallId:W()}),Ne({type:ne("reasoning-start"),id:W(),providerMetadata:be.optional()}),Ne({type:ne("reasoning-delta"),id:W(),delta:W(),providerMetadata:be.optional()}),Ne({type:ne("reasoning-end"),id:W(),providerMetadata:be.optional()}),Ne({type:ne("source-url"),sourceId:W(),url:W(),title:W().optional(),providerMetadata:be.optional()}),Ne({type:ne("source-document"),sourceId:W(),mediaType:W(),title:W(),filename:W().optional(),providerMetadata:be.optional()}),Ne({type:ne("file"),url:W(),mediaType:W(),providerMetadata:be.optional()}),Ne({type:fo(t=>typeof t=="string"&&t.startsWith("data-"),{message:'Type must start with "data-"'}),id:W().optional(),data:It(),transient:$e().optional()}),Ne({type:ne("start-step")}),Ne({type:ne("finish-step")}),Ne({type:ne("start"),messageId:W().optional(),messageMetadata:It().optional()}),Ne({type:ne("finish"),finishReason:Vd(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:It().optional()}),Ne({type:ne("abort")}),Ne({type:ne("message-metadata"),messageMetadata:It()})])));function s0(t){return t.type.startsWith("data-")}function na(t){return t.type.startsWith("tool-")}function u0(t){return t.type==="dynamic-tool"}function ra(t){return na(t)||u0(t)}function Ds(t){return t.type.split("-").slice(1).join("-")}function o0({lastMessage:t,messageId:e}){return{message:t?.role==="assistant"?t:{id:e,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function l0({stream:t,messageMetadataSchema:e,dataPartSchemas:n,runUpdateMessageJob:r,onError:i,onToolCall:a,onData:s}){return t.pipeThrough(new TransformStream({async transform(u,o){await r(async({state:l,write:f})=>{var d,h,p,g;function x(E){const R=l.message.parts.filter(ra).find(S=>S.toolCallId===E);if(R==null)throw new Error(`no tool invocation found for tool call ${E}`);return R}function _(E){var w;const R=l.message.parts.find(F=>na(F)&&F.toolCallId===E.toolCallId),S=E,O=R;R!=null?(R.state=E.state,O.input=S.input,O.output=S.output,O.errorText=S.errorText,O.rawInput=S.rawInput,O.preliminary=S.preliminary,E.title!==void 0&&(O.title=E.title),O.providerExecuted=(w=S.providerExecuted)!=null?w:R.providerExecuted,S.providerMetadata!=null&&R.state==="input-available"&&(R.callProviderMetadata=S.providerMetadata)):l.message.parts.push({type:`tool-${E.toolName}`,toolCallId:E.toolCallId,state:E.state,title:E.title,input:S.input,output:S.output,rawInput:S.rawInput,errorText:S.errorText,providerExecuted:S.providerExecuted,preliminary:S.preliminary,...S.providerMetadata!=null?{callProviderMetadata:S.providerMetadata}:{}})}function b(E){var w,R;const S=l.message.parts.find(j=>j.type==="dynamic-tool"&&j.toolCallId===E.toolCallId),O=E,F=S;S!=null?(S.state=E.state,F.toolName=E.toolName,F.input=O.input,F.output=O.output,F.errorText=O.errorText,F.rawInput=(w=O.rawInput)!=null?w:F.rawInput,F.preliminary=O.preliminary,E.title!==void 0&&(F.title=E.title),F.providerExecuted=(R=O.providerExecuted)!=null?R:S.providerExecuted,O.providerMetadata!=null&&S.state==="input-available"&&(S.callProviderMetadata=O.providerMetadata)):l.message.parts.push({type:"dynamic-tool",toolName:E.toolName,toolCallId:E.toolCallId,state:E.state,input:O.input,output:O.output,errorText:O.errorText,preliminary:O.preliminary,providerExecuted:O.providerExecuted,title:E.title,...O.providerMetadata!=null?{callProviderMetadata:O.providerMetadata}:{}})}async function k(E){if(E!=null){const w=l.message.metadata!=null?el(l.message.metadata,E):E;e!=null&&await Os({value:w,schema:e}),l.message.metadata=w}}switch(u.type){case"text-start":{const E={type:"text",text:"",providerMetadata:u.providerMetadata,state:"streaming"};l.activeTextParts[u.id]=E,l.message.parts.push(E),f();break}case"text-delta":{const E=l.activeTextParts[u.id];E.text+=u.delta,E.providerMetadata=(d=u.providerMetadata)!=null?d:E.providerMetadata,f();break}case"text-end":{const E=l.activeTextParts[u.id];E.state="done",E.providerMetadata=(h=u.providerMetadata)!=null?h:E.providerMetadata,delete l.activeTextParts[u.id],f();break}case"reasoning-start":{const E={type:"reasoning",text:"",providerMetadata:u.providerMetadata,state:"streaming"};l.activeReasoningParts[u.id]=E,l.message.parts.push(E),f();break}case"reasoning-delta":{const E=l.activeReasoningParts[u.id];E.text+=u.delta,E.providerMetadata=(p=u.providerMetadata)!=null?p:E.providerMetadata,f();break}case"reasoning-end":{const E=l.activeReasoningParts[u.id];E.providerMetadata=(g=u.providerMetadata)!=null?g:E.providerMetadata,E.state="done",delete l.activeReasoningParts[u.id],f();break}case"file":{l.message.parts.push({type:"file",mediaType:u.mediaType,url:u.url}),f();break}case"source-url":{l.message.parts.push({type:"source-url",sourceId:u.sourceId,url:u.url,title:u.title,providerMetadata:u.providerMetadata}),f();break}case"source-document":{l.message.parts.push({type:"source-document",sourceId:u.sourceId,mediaType:u.mediaType,title:u.title,filename:u.filename,providerMetadata:u.providerMetadata}),f();break}case"tool-input-start":{const E=l.message.parts.filter(na);l.partialToolCalls[u.toolCallId]={text:"",toolName:u.toolName,index:E.length,dynamic:u.dynamic,title:u.title},u.dynamic?b({toolCallId:u.toolCallId,toolName:u.toolName,state:"input-streaming",input:void 0,providerExecuted:u.providerExecuted,title:u.title}):_({toolCallId:u.toolCallId,toolName:u.toolName,state:"input-streaming",input:void 0,providerExecuted:u.providerExecuted,title:u.title}),f();break}case"tool-input-delta":{const E=l.partialToolCalls[u.toolCallId];E.text+=u.inputTextDelta;const{value:w}=await gr(E.text);E.dynamic?b({toolCallId:u.toolCallId,toolName:E.toolName,state:"input-streaming",input:w,title:E.title}):_({toolCallId:u.toolCallId,toolName:E.toolName,state:"input-streaming",input:w,title:E.title}),f();break}case"tool-input-available":{u.dynamic?b({toolCallId:u.toolCallId,toolName:u.toolName,state:"input-available",input:u.input,providerExecuted:u.providerExecuted,providerMetadata:u.providerMetadata,title:u.title}):_({toolCallId:u.toolCallId,toolName:u.toolName,state:"input-available",input:u.input,providerExecuted:u.providerExecuted,providerMetadata:u.providerMetadata,title:u.title}),f(),a&&!u.providerExecuted&&await a({toolCall:u});break}case"tool-input-error":{u.dynamic?b({toolCallId:u.toolCallId,toolName:u.toolName,state:"output-error",input:u.input,errorText:u.errorText,providerExecuted:u.providerExecuted,providerMetadata:u.providerMetadata}):_({toolCallId:u.toolCallId,toolName:u.toolName,state:"output-error",input:void 0,rawInput:u.input,errorText:u.errorText,providerExecuted:u.providerExecuted,providerMetadata:u.providerMetadata}),f();break}case"tool-approval-request":{const E=x(u.toolCallId);E.state="approval-requested",E.approval={id:u.approvalId},f();break}case"tool-output-denied":{const E=x(u.toolCallId);E.state="output-denied",f();break}case"tool-output-available":{const E=x(u.toolCallId);E.type==="dynamic-tool"?b({toolCallId:u.toolCallId,toolName:E.toolName,state:"output-available",input:E.input,output:u.output,preliminary:u.preliminary,providerExecuted:u.providerExecuted,title:E.title}):_({toolCallId:u.toolCallId,toolName:Ds(E),state:"output-available",input:E.input,output:u.output,providerExecuted:u.providerExecuted,preliminary:u.preliminary,title:E.title}),f();break}case"tool-output-error":{const E=x(u.toolCallId);E.type==="dynamic-tool"?b({toolCallId:u.toolCallId,toolName:E.toolName,state:"output-error",input:E.input,errorText:u.errorText,providerExecuted:u.providerExecuted,title:E.title}):_({toolCallId:u.toolCallId,toolName:Ds(E),state:"output-error",input:E.input,rawInput:E.rawInput,errorText:u.errorText,providerExecuted:u.providerExecuted,title:E.title}),f();break}case"start-step":{l.message.parts.push({type:"step-start"});break}case"finish-step":{l.activeTextParts={},l.activeReasoningParts={};break}case"start":{u.messageId!=null&&(l.message.id=u.messageId),await k(u.messageMetadata),(u.messageId!=null||u.messageMetadata!=null)&&f();break}case"finish":{u.finishReason!=null&&(l.finishReason=u.finishReason),await k(u.messageMetadata),u.messageMetadata!=null&&f();break}case"message-metadata":{await k(u.messageMetadata),u.messageMetadata!=null&&f();break}case"error":{i?.(new Error(u.errorText));break}default:if(s0(u)){n?.[u.type]!=null&&await Os({value:u.data,schema:n[u.type]});const E=u;if(E.transient){s?.(E);break}const w=E.id!=null?l.message.parts.find(R=>E.type===R.type&&E.id===R.id):void 0;w!=null?w.data=E.data:l.message.parts.push(E),s?.(E),f()}}o.enqueue(u)})}}))}async function c0({stream:t,onError:e}){const n=t.getReader();try{for(;;){const{done:r}=await n.read();if(r)break}}catch(r){e?.(r)}finally{n.releaseLock()}}mr({prefix:"aitxt",size:24});mr({prefix:"aiobj",size:24});var d0=class{constructor(){this.queue=[],this.isProcessing=!1}async processQueue(){if(!this.isProcessing){for(this.isProcessing=!0;this.queue.length>0;)await this.queue[0](),this.queue.shift();this.isProcessing=!1}}async run(t){return new Promise((e,n)=>{this.queue.push(async()=>{try{await t(),e()}catch(r){n(r)}}),this.processQueue()})}};mr({prefix:"aiobj",size:24});async function f0(t){if(t==null)return[];if(!globalThis.FileList||!(t instanceof globalThis.FileList))throw new Error("FileList is not supported in the current environment");return Promise.all(Array.from(t).map(async e=>{const{name:n,type:r}=e,i=await new Promise((a,s)=>{const u=new FileReader;u.onload=o=>{var l;a((l=o.target)==null?void 0:l.result)},u.onerror=o=>s(o),u.readAsDataURL(e)});return{type:"file",mediaType:r,filename:n,url:i}}))}var h0=class{constructor({api:t="/api/chat",credentials:e,headers:n,body:r,fetch:i,prepareSendMessagesRequest:a,prepareReconnectToStreamRequest:s}){this.api=t,this.credentials=e,this.headers=n,this.body=r,this.fetch=i,this.prepareSendMessagesRequest=a,this.prepareReconnectToStreamRequest=s}async sendMessages({abortSignal:t,...e}){var n,r,i,a,s;const u=await Lt(this.body),o=await Lt(this.headers),l=await Lt(this.credentials),f={...Vt(o),...Vt(e.headers)},d=await((n=this.prepareSendMessagesRequest)==null?void 0:n.call(this,{api:this.api,id:e.chatId,messages:e.messages,body:{...u,...e.body},headers:f,credentials:l,requestMetadata:e.metadata,trigger:e.trigger,messageId:e.messageId})),h=(r=d?.api)!=null?r:this.api,p=d?.headers!==void 0?Vt(d.headers):f,g=d?.body!==void 0?d.body:{...u,...e.body,id:e.chatId,messages:e.messages,trigger:e.trigger,messageId:e.messageId},x=(i=d?.credentials)!=null?i:l,b=await((a=this.fetch)!=null?a:globalThis.fetch)(h,{method:"POST",headers:Ns({"Content-Type":"application/json",...p},`ai-sdk/${vs}`,Is()),body:JSON.stringify(g),credentials:x,signal:t});if(!b.ok)throw new Error((s=await b.text())!=null?s:"Failed to fetch the chat response.");if(!b.body)throw new Error("The response body is empty.");return this.processResponseStream(b.body)}async reconnectToStream(t){var e,n,r,i,a;const s=await Lt(this.body),u=await Lt(this.headers),o=await Lt(this.credentials),l={...Vt(u),...Vt(t.headers)},f=await((e=this.prepareReconnectToStreamRequest)==null?void 0:e.call(this,{api:this.api,id:t.chatId,body:{...s,...t.body},headers:l,credentials:o,requestMetadata:t.metadata})),d=(n=f?.api)!=null?n:`${this.api}/${t.chatId}/stream`,h=f?.headers!==void 0?Vt(f.headers):l,p=(r=f?.credentials)!=null?r:o,x=await((i=this.fetch)!=null?i:globalThis.fetch)(d,{method:"GET",headers:Ns(h,`ai-sdk/${vs}`,Is()),credentials:p});if(x.status===204)return null;if(!x.ok)throw new Error((a=await x.text())!=null?a:"Failed to fetch the chat response.");if(!x.body)throw new Error("The response body is empty.");return this.processResponseStream(x.body)}},tl=class extends h0{constructor(t={}){super(t)}processResponseStream(t){return Fh({stream:t,schema:a0}).pipeThrough(new TransformStream({async transform(e,n){if(!e.success)throw e.error;n.enqueue(e.value)}}))}},p0=class{constructor({generateId:t=zf,id:e=t(),transport:n=new tl,messageMetadataSchema:r,dataPartSchemas:i,state:a,onError:s,onToolCall:u,onFinish:o,onData:l,sendAutomaticallyWhen:f}){this.activeResponse=void 0,this.jobExecutor=new d0,this.sendMessage=async(d,h)=>{var p,g,x,_;if(d==null){await this.makeRequest({trigger:"submit-message",messageId:(p=this.lastMessage)==null?void 0:p.id,...h});return}let b;if("text"in d||"files"in d?b={parts:[...Array.isArray(d.files)?d.files:await f0(d.files),..."text"in d&&d.text!=null?[{type:"text",text:d.text}]:[]]}:b=d,d.messageId!=null){const k=this.state.messages.findIndex(E=>E.id===d.messageId);if(k===-1)throw new Error(`message with id ${d.messageId} not found`);if(this.state.messages[k].role!=="user")throw new Error(`message with id ${d.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,k+1),this.state.replaceMessage(k,{...b,id:d.messageId,role:(g=b.role)!=null?g:"user",metadata:d.metadata})}else this.state.pushMessage({...b,id:(x=b.id)!=null?x:this.generateId(),role:(_=b.role)!=null?_:"user",metadata:d.metadata});await this.makeRequest({trigger:"submit-message",messageId:d.messageId,...h})},this.regenerate=async({messageId:d,...h}={})=>{const p=d==null?this.state.messages.length-1:this.state.messages.findIndex(g=>g.id===d);if(p===-1)throw new Error(`message ${d} not found`);this.state.messages=this.state.messages.slice(0,this.messages[p].role==="assistant"?p:p+1),await this.makeRequest({trigger:"regenerate-message",messageId:d,...h})},this.resumeStream=async(d={})=>{await this.makeRequest({trigger:"resume-stream",...d})},this.clearError=()=>{this.status==="error"&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolApprovalResponse=async({id:d,approved:h,reason:p})=>this.jobExecutor.run(async()=>{var g,x;const _=this.state.messages,b=_[_.length-1],k=E=>ra(E)&&E.state==="approval-requested"&&E.approval.id===d?{...E,state:"approval-responded",approval:{id:d,approved:h,reason:p}}:E;this.state.replaceMessage(_.length-1,{...b,parts:b.parts.map(k)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(k)),this.status!=="streaming"&&this.status!=="submitted"&&((g=this.sendAutomaticallyWhen)!=null&&g.call(this,{messages:this.state.messages}))&&this.makeRequest({trigger:"submit-message",messageId:(x=this.lastMessage)==null?void 0:x.id})}),this.addToolOutput=async({state:d="output-available",tool:h,toolCallId:p,output:g,errorText:x})=>this.jobExecutor.run(async()=>{var _,b;const k=this.state.messages,E=k[k.length-1],w=R=>ra(R)&&R.toolCallId===p?{...R,state:d,output:g,errorText:x}:R;this.state.replaceMessage(k.length-1,{...E,parts:E.parts.map(w)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(w)),this.status!=="streaming"&&this.status!=="submitted"&&((_=this.sendAutomaticallyWhen)!=null&&_.call(this,{messages:this.state.messages}))&&this.makeRequest({trigger:"submit-message",messageId:(b=this.lastMessage)==null?void 0:b.id})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{var d;this.status!=="streaming"&&this.status!=="submitted"||(d=this.activeResponse)!=null&&d.abortController&&this.activeResponse.abortController.abort()},this.id=e,this.transport=n,this.generateId=t,this.messageMetadataSchema=r,this.dataPartSchemas=i,this.state=a,this.onError=s,this.onToolCall=u,this.onFinish=o,this.onData=l,this.sendAutomaticallyWhen=f}get status(){return this.state.status}setStatus({status:t,error:e}){this.status!==t&&(this.state.status=t,this.state.error=e)}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}set messages(t){this.state.messages=t}async makeRequest({trigger:t,metadata:e,headers:n,body:r,messageId:i}){var a,s,u,o;this.setStatus({status:"submitted",error:void 0});const l=this.lastMessage;let f=!1,d=!1,h=!1;try{const p={state:o0({lastMessage:this.state.snapshot(l),messageId:this.generateId()}),abortController:new AbortController};p.abortController.signal.addEventListener("abort",()=>{f=!0}),this.activeResponse=p;let g;if(t==="resume-stream"){const _=await this.transport.reconnectToStream({chatId:this.id,metadata:e,headers:n,body:r});if(_==null){this.setStatus({status:"ready"});return}g=_}else g=await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:p.abortController.signal,metadata:e,headers:n,body:r,trigger:t,messageId:i});const x=_=>this.jobExecutor.run(()=>_({state:p.state,write:()=>{var b;this.setStatus({status:"streaming"}),p.state.message.id===((b=this.lastMessage)==null?void 0:b.id)?this.state.replaceMessage(this.state.messages.length-1,p.state.message):this.state.pushMessage(p.state.message)}}));await c0({stream:l0({stream:g,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:x,onError:_=>{throw _}}),onError:_=>{throw _}}),this.setStatus({status:"ready"})}catch(p){if(f||p.name==="AbortError")return f=!0,this.setStatus({status:"ready"}),null;h=!0,p instanceof TypeError&&(p.message.toLowerCase().includes("fetch")||p.message.toLowerCase().includes("network"))&&(d=!0),this.onError&&p instanceof Error&&this.onError(p),this.setStatus({status:"error",error:p})}finally{try{(s=this.onFinish)==null||s.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:f,isDisconnect:d,isError:h,finishReason:(a=this.activeResponse)==null?void 0:a.state.finishReason})}catch(p){console.error(p)}this.activeResponse=void 0}(u=this.sendAutomaticallyWhen)!=null&&u.call(this,{messages:this.state.messages})&&!h&&await this.makeRequest({trigger:"submit-message",messageId:(o=this.lastMessage)==null?void 0:o.id,metadata:e,headers:n,body:r})}},Ni,Ps;function m0(){if(Ps)return Ni;Ps=1;function t(e,n){if(typeof e!="function")throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let r,i=0;return function(...s){clearTimeout(r);const u=Date.now(),o=u-i,l=n-o;l<=0?(i=u,e.apply(this,s)):r=setTimeout(()=>{i=Date.now(),e.apply(this,s)},l)}}return Ni=t,Ni}var g0=m0();const b0=Sa(g0);var nl=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},we=(t,e,n)=>(nl(t,e,"read from private field"),n?n.call(t):e.get(t)),ft=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Nt=(t,e,n,r)=>(nl(t,e,"write to private field"),e.set(t,n),n);function E0(t,e){return e!=null?b0(t,e):t}var rt,Pr,Mr,jn,$n,Yn,hn,ia,aa,T0=class{constructor(t=[]){ft(this,rt,void 0),ft(this,Pr,"ready"),ft(this,Mr,void 0),ft(this,jn,new Set),ft(this,$n,new Set),ft(this,Yn,new Set),this.pushMessage=e=>{Nt(this,rt,we(this,rt).concat(e)),we(this,hn).call(this)},this.popMessage=()=>{Nt(this,rt,we(this,rt).slice(0,-1)),we(this,hn).call(this)},this.replaceMessage=(e,n)=>{Nt(this,rt,[...we(this,rt).slice(0,e),this.snapshot(n),...we(this,rt).slice(e+1)]),we(this,hn).call(this)},this.snapshot=e=>structuredClone(e),this["~registerMessagesCallback"]=(e,n)=>{const r=n?E0(e,n):e;return we(this,jn).add(r),()=>{we(this,jn).delete(r)}},this["~registerStatusCallback"]=e=>(we(this,$n).add(e),()=>{we(this,$n).delete(e)}),this["~registerErrorCallback"]=e=>(we(this,Yn).add(e),()=>{we(this,Yn).delete(e)}),ft(this,hn,()=>{we(this,jn).forEach(e=>e())}),ft(this,ia,()=>{we(this,$n).forEach(e=>e())}),ft(this,aa,()=>{we(this,Yn).forEach(e=>e())}),Nt(this,rt,t)}get status(){return we(this,Pr)}set status(t){Nt(this,Pr,t),we(this,ia).call(this)}get error(){return we(this,Mr)}set error(t){Nt(this,Mr,t),we(this,aa).call(this)}get messages(){return we(this,rt)}set messages(t){Nt(this,rt,[...t]),we(this,hn).call(this)}};rt=new WeakMap;Pr=new WeakMap;Mr=new WeakMap;jn=new WeakMap;$n=new WeakMap;Yn=new WeakMap;hn=new WeakMap;ia=new WeakMap;aa=new WeakMap;var pn,Ms=class extends p0{constructor({messages:e,...n}){const r=new T0(e);super({...n,state:r}),ft(this,pn,void 0),this["~registerMessagesCallback"]=(i,a)=>we(this,pn)["~registerMessagesCallback"](i,a),this["~registerStatusCallback"]=i=>we(this,pn)["~registerStatusCallback"](i),this["~registerErrorCallback"]=i=>we(this,pn)["~registerErrorCallback"](i),Nt(this,pn,r)}};pn=new WeakMap;function x0({experimental_throttle:t,resume:e=!1,...n}={}){const r=v.useRef("chat"in n?n.chat:new Ms(n));("chat"in n&&n.chat!==r.current||"id"in n&&r.current.id!==n.id)&&(r.current="chat"in n?n.chat:new Ms(n));const a=v.useCallback(f=>r.current["~registerMessagesCallback"](f,t),[t,r.current.id]),s=v.useSyncExternalStore(a,()=>r.current.messages,()=>r.current.messages),u=v.useSyncExternalStore(r.current["~registerStatusCallback"],()=>r.current.status,()=>r.current.status),o=v.useSyncExternalStore(r.current["~registerErrorCallback"],()=>r.current.error,()=>r.current.error),l=v.useCallback(f=>{typeof f=="function"&&(f=f(r.current.messages)),r.current.messages=f},[r]);return v.useEffect(()=>{e&&r.current.resumeStream()},[e,r]),{id:r.current.id,messages:s,setMessages:l,sendMessage:r.current.sendMessage,regenerate:r.current.regenerate,clearError:r.current.clearError,stop:r.current.stop,error:o,resumeStream:r.current.resumeStream,status:u,addToolResult:r.current.addToolOutput,addToolOutput:r.current.addToolOutput,addToolApprovalResponse:r.current.addToolApprovalResponse}}const _0="You are a helpful assistant.",y0=t=>new tl({api:`/api/${t}/models/stream`,credentials:"include",prepareSendMessagesRequest:({messages:e,requestMetadata:n})=>({body:{messages:e,stream:!0,...n}})});function eA(t){const e=K.c(33),{threadId:n,systemPrompt:r,onCreateThread:i,onError:a,onToolCall:s}=t,{org:u,locator:o}=Mt(),{slug:l}=u,f=Oa(),d=Lo(),h=Df(n),p=r||_0;let g;e[0]!==p?(g={id:"system",role:"system",parts:[{type:"text",text:p}]},e[0]=p,e[1]=g):g=e[1];const _=g;let b;e[2]!==h||e[3]!==_?(b=[_,...h],e[2]=h,e[3]=_,e[4]=b):b=e[4];const k=b,E=`${n}:${p}`;let w;e[5]!==l?(w=y0(l),e[5]=l,e[6]=w):w=e[6];const R=w;let S;e[7]!==o||e[8]!==d||e[9]!==i||e[10]!==f||e[11]!==n?(S=async le=>{const{finishReason:Te,messages:I,isAbort:me,isDisconnect:Ae,isError:y}=le;if(Te!=="stop"||me||Ae||y)return;const V=I.slice(-2).filter(Boolean);if(V.length!==2)return;d.insertMany.mutate(V);const G=V.find(C0)?.parts?.find(A0)?.text.slice(0,100)||"",Q=await Of(o,n);if(!Q){if(i)i({id:n,title:G});else{const X=new Date().toISOString(),ee={id:n,title:G,created_at:X,updated_at:X,hidden:!1};f.insert.mutate(ee)}return}f.update.mutate({id:n,updates:{title:Q.title||G,updated_at:new Date().toISOString()}})},e[7]=o,e[8]=d,e[9]=i,e[10]=f,e[11]=n,e[12]=S):S=e[12];const O=S;let F;e[13]!==a?(F=le=>{console.error("[chat] Chat error:",le),a?.(le)},e[13]=a,e[14]=F):F=e[14];let j;e[15]!==k||e[16]!==E||e[17]!==O||e[18]!==s||e[19]!==F||e[20]!==R?(j={id:E,messages:k,transport:R,onFinish:O,onToolCall:s,onError:F},e[15]=k,e[16]=E,e[17]=O,e[18]=s,e[19]=F,e[20]=R,e[21]=j):j=e[21];const N=x0(j);let P;e[22]!==N?(P=async(le,Te)=>{!le?.trim()||N.status==="submitted"||N.status==="streaming"||await N.sendMessage({id:crypto.randomUUID(),role:"user",parts:[{type:"text",text:le}],metadata:Te},{metadata:Te})},e[22]=N,e[23]=P):P=e[23];const M=P,J=N.messages[0]?.role==="system"?N.messages.length===1:N.messages.length===0,z=N.messages,H=N.status;let Z;e[24]!==N?(Z=N.stop.bind(N),e[24]=N,e[25]=Z):Z=e[25];let re;return e[26]!==N.messages||e[27]!==N.setMessages||e[28]!==N.status||e[29]!==J||e[30]!==M||e[31]!==Z?(re={messages:z,status:H,sendMessage:M,stop:Z,setMessages:N.setMessages,isEmpty:J},e[26]=N.messages,e[27]=N.setMessages,e[28]=N.status,e[29]=J,e[30]=M,e[31]=Z,e[32]=re):re=e[32],re}function A0(t){return t.type==="text"}function C0(t){return t.parts?.find(k0)}function k0(t){return t.type==="text"}const rl={inputValue:"",branchContext:null};function S0(t,e){switch(e.type){case"SET_INPUT":return{...t,inputValue:e.payload};case"START_BRANCH":return{...t,branchContext:e.payload};case"CLEAR_BRANCH":return{...t,branchContext:null};case"RESET":return rl;default:return t}}const il=v.createContext(null),al=()=>crypto.randomUUID();function I0(t){const e=K.c(16),{children:n}=t,{locator:r}=Mt(),[i,a]=v.useReducer(S0,rl),s=Oa(),[u,o]=lf(cf.threadManagerState(r)+":active-id",N0);let l;e[0]!==o||e[1]!==s?(l=_=>{const b=_?.id||crypto.randomUUID(),k=new Date().toISOString(),E={id:b,title:_?.title||"",created_at:_?.created_at||k,updated_at:_?.updated_at||k,hidden:_?.hidden??!1};return s.insert.mutate(E),o(b),E},e[0]=o,e[1]=s,e[2]=l):l=e[2];const f=l;let d;e[3]!==u||e[4]!==o||e[5]!==s?(d=_=>{s.update.mutate({id:_,updates:{hidden:!0,updated_at:new Date().toISOString()}}),u===_&&o(al())},e[3]=u,e[4]=o,e[5]=s,e[6]=d):d=e[6];const h=d;let p;e[7]!==u||e[8]!==f||e[9]!==h||e[10]!==i||e[11]!==o?(p={interactionState:i,interactionDispatch:a,activeThreadId:u,createThread:f,setActiveThreadId:o,hideThread:h},e[7]=u,e[8]=f,e[9]=h,e[10]=i,e[11]=o,e[12]=p):p=e[12];const g=p;let x;return e[13]!==n||e[14]!==g?(x=m.jsx(il.Provider,{value:g,children:n}),e[13]=n,e[14]=g,e[15]=x):x=e[15],x}function N0(t){return t||al()}function w0(){const t=K.c(16),e=v.useContext(il);if(!e)throw new Error("useChat must be used within a ChatProvider");const{interactionState:n,interactionDispatch:r}=e;let i,a,s,u;t[0]!==r?(i=l=>r({type:"SET_INPUT",payload:l}),a=l=>r({type:"START_BRANCH",payload:l}),s=()=>r({type:"CLEAR_BRANCH"}),u=()=>r({type:"RESET"}),t[0]=r,t[1]=i,t[2]=a,t[3]=s,t[4]=u):(i=t[1],a=t[2],s=t[3],u=t[4]);let o;return t[5]!==e.activeThreadId||t[6]!==e.createThread||t[7]!==e.hideThread||t[8]!==e.setActiveThreadId||t[9]!==n.branchContext||t[10]!==n.inputValue||t[11]!==i||t[12]!==a||t[13]!==s||t[14]!==u?(o={inputValue:n.inputValue,branchContext:n.branchContext,setInputValue:i,startBranch:a,clearBranch:s,reset:u,activeThreadId:e.activeThreadId,createThread:e.createThread,setActiveThreadId:e.setActiveThreadId,hideThread:e.hideThread},t[5]=e.activeThreadId,t[6]=e.createThread,t[7]=e.hideThread,t[8]=e.setActiveThreadId,t[9]=n.branchContext,t[10]=n.inputValue,t[11]=i,t[12]=a,t[13]=s,t[14]=u,t[15]=o):o=t[15],o}function tA(t){const e=K.c(19),{prompts:n,onSelect:r,className:i}=t;if(n.length===0)return null;let a,s,u,o;if(e[0]!==i||e[1]!==r||e[2]!==n){const d=n.slice(0,4);e[7]!==i?(u=ce("flex flex-col gap-3 flex-1",i),e[7]=i,e[8]=u):u=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Try asking"}),e[9]=o):o=e[9],a="grid grid-cols-1 sm:grid-cols-2 gap-2";let h;e[10]!==r?(h=p=>m.jsxs("button",{type:"button",onClick:()=>r(p),className:ce("flex items-start gap-3 p-3 rounded-xl","bg-muted/50 hover:bg-muted transition-colors","text-left cursor-pointer group","border border-transparent hover:border-border"),children:[m.jsx("div",{className:"shrink-0 mt-0.5",children:m.jsx(ko,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})}),m.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0 flex-1",children:[m.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:(p.title??p.name).replace(/_/g," ")}),p.description&&m.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:p.description})]})]},p.name),e[10]=r,e[11]=h):h=e[11],s=d.map(h),e[0]=i,e[1]=r,e[2]=n,e[3]=a,e[4]=s,e[5]=u,e[6]=o}else a=e[3],s=e[4],u=e[5],o=e[6];let l;e[12]!==a||e[13]!==s?(l=m.jsx("div",{className:a,children:s}),e[12]=a,e[13]=s,e[14]=l):l=e[14];let f;return e[15]!==u||e[16]!==o||e[17]!==l?(f=m.jsxs("div",{className:u,children:[o,l]}),e[15]=u,e[16]=o,e[17]=l,e[18]=f):f=e[18],f}function R0(t){const e=K.c(66),{value:n,onChange:r,onSubmit:i,onStop:a,disabled:s,isStreaming:u,placeholder:o,className:l,centered:f,contextContent:d,leftActions:h,rightActions:p,maxTextHeight:g,children:x}=t,_=o===void 0?"Ask anything or @ for context":o,b=g===void 0?"164px":g;let k;e[0]!==s||e[1]!==u||e[2]!==n?(k=!s&&!u&&n.trim().length>0,e[0]=s,e[1]=u,e[2]=n,e[3]=k):k=e[3];const E=k;let w;e[4]!==E||e[5]!==u||e[6]!==a||e[7]!==i?(w=he=>{he.preventDefault(),u&&a?a():E&&i()},e[4]=E,e[5]=u,e[6]=a,e[7]=i,e[8]=w):w=e[8];const R=w;let S;e[9]!==E||e[10]!==i?(S=he=>{he.key==="Enter"&&!he.shiftKey&&(he.preventDefault(),E&&i())},e[9]=E,e[10]=i,e[11]=S):S=e[11];const O=S;let F;e[12]!==l?(F=ce("w-full",l),e[12]=l,e[13]=F):F=e[13];let j;e[14]===Symbol.for("react.memo_cache_sentinel")?(j=ce("relative rounded-xl border border-border bg-background w-full min-h-[130px] flex flex-col"),e[14]=j):j=e[14];let N;e[15]!==d?(N=d&&m.jsx("div",{className:"mb-1",children:d}),e[15]=d,e[16]=N):N=e[16];let P;e[17]!==b?(P={maxHeight:b},e[17]=b,e[18]=P):P=e[18];let M;e[19]!==r?(M=he=>r(he.target.value),e[19]=r,e[20]=M):M=e[20];const J=s||u;let z;e[21]===Symbol.for("react.memo_cache_sentinel")?(z=ce("placeholder:text-muted-foreground resize-none focus-visible:ring-0 border-0 p-2 text-sm min-h-[20px] w-full","rounded-none shadow-none"),e[21]=z):z=e[21];let H;e[22]===Symbol.for("react.memo_cache_sentinel")?(H={minHeight:"20px",height:"auto",overflow:"hidden"},e[22]=H):H=e[22];let Z;e[23]!==O||e[24]!==_||e[25]!==M||e[26]!==J||e[27]!==n?(Z=m.jsx(of,{value:n,onChange:M,onKeyDown:O,placeholder:_,disabled:J,className:z,rows:1,style:H}),e[23]=O,e[24]=_,e[25]=M,e[26]=J,e[27]=n,e[28]=Z):Z=e[28];let re;e[29]!==P||e[30]!==Z?(re=m.jsx("div",{className:"overflow-y-auto relative flex-1",style:P,children:Z}),e[29]=P,e[30]=Z,e[31]=re):re=e[31];let le;e[32]!==re||e[33]!==N?(le=m.jsxs("div",{className:"relative flex flex-col gap-2 p-2.5 flex-1",children:[N,re]}),e[32]=re,e[33]=N,e[34]=le):le=e[34];let Te;e[35]!==x||e[36]!==h?(Te=m.jsxs("div",{className:"flex items-center overflow-hidden gap-2 min-w-0",children:[h,x]}),e[35]=x,e[36]=h,e[37]=Te):Te=e[37];const I=u?"button":"submit";let me;e[38]!==u||e[39]!==a?(me=he=>{u&&(he.preventDefault(),he.stopPropagation(),a?.())},e[38]=u,e[39]=a,e[40]=me):me=e[40];const Ae=E||u?"default":"ghost",y=!E&&!u,V=!E&&!u&&"bg-muted text-muted-foreground hover:bg-muted hover:text-muted-foreground cursor-not-allowed";let G;e[41]!==V?(G=ce("size-8 rounded-full transition-all",V),e[41]=V,e[42]=G):G=e[42];const Q=u?"Stop generating":"Send message (Enter)";let X;e[43]!==u?(X=u?m.jsx(So,{size:20}):m.jsx(sf,{size:20}),e[43]=u,e[44]=X):X=e[44];let ee;e[45]!==I||e[46]!==me||e[47]!==Ae||e[48]!==y||e[49]!==G||e[50]!==Q||e[51]!==X?(ee=m.jsx(Bt,{type:I,onClick:me,variant:Ae,size:"icon",disabled:y,className:G,title:Q,children:X}),e[45]=I,e[46]=me,e[47]=Ae,e[48]=y,e[49]=G,e[50]=Q,e[51]=X,e[52]=ee):ee=e[52];let se;e[53]!==p||e[54]!==ee?(se=m.jsxs("div",{className:"flex items-center gap-1",children:[p,ee]}),e[53]=p,e[54]=ee,e[55]=se):se=e[55];let ge;e[56]!==Te||e[57]!==se?(ge=m.jsxs("div",{className:"flex items-center justify-between p-2.5",children:[Te,se]}),e[56]=Te,e[57]=se,e[58]=ge):ge=e[58];let Le;e[59]!==le||e[60]!==ge?(Le=m.jsxs("div",{className:j,children:[le,ge]}),e[59]=le,e[60]=ge,e[61]=Le):Le=e[61];let Be;return e[62]!==R||e[63]!==Le||e[64]!==F?(Be=m.jsx("form",{onSubmit:R,className:F,children:Le}),e[62]=R,e[63]=Le,e[64]=F,e[65]=Be):Be=e[65],Be}function L0(){const t=K.c(3),[e,n]=v.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=async s=>{await navigator.clipboard.writeText(s),n(!0),setTimeout(()=>n(!1),2e3)},t[0]=r):r=t[0];const i=r;let a;return t[1]!==e?(a={handleCopy:i,copied:e},t[1]=e,t[2]=a):a=t[2],a}function Da(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var an=Da();function sl(t){an=t}var Qn={exec:()=>null};function xe(t,e=""){let n=typeof t=="string"?t:t.source;const r={replace:(i,a)=>{let s=typeof a=="string"?a:a.source;return s=s.replace(qe.caret,"$1"),n=n.replace(i,s),r},getRegex:()=>new RegExp(n,e)};return r}var qe={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},O0=/^(?:[ \t]*(?:\n|$))+/,v0=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,D0=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,br=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,P0=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Pa=/(?:[*+-]|\d{1,9}[.)])/,ul=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ol=xe(ul).replace(/bull/g,Pa).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),M0=xe(ul).replace(/bull/g,Pa).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ma=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,B0=/^[^\n]+/,Ba=/(?!\s*\])(?:\\.|[^\[\]\\])+/,F0=xe(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ba).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),H0=xe(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Pa).getRegex(),ai="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Fa=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,U0=xe("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Fa).replace("tag",ai).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ll=xe(Ma).replace("hr",br).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ai).getRegex(),z0=xe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ll).getRegex(),Ha={blockquote:z0,code:v0,def:F0,fences:D0,heading:P0,hr:br,html:U0,lheading:ol,list:H0,newline:O0,paragraph:ll,table:Qn,text:B0},Bs=xe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",br).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ai).getRegex(),j0={...Ha,lheading:M0,table:Bs,paragraph:xe(Ma).replace("hr",br).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Bs).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ai).getRegex()},$0={...Ha,html:xe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Fa).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Qn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:xe(Ma).replace("hr",br).replace("heading",` *#{1,6} *[^
13
+ ]`).replace("lheading",ol).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Y0=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,q0=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,cl=/^( {2,}|\\)\n(?!\s*$)/,V0=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,si=/[\p{P}\p{S}]/u,Ua=/[\s\p{P}\p{S}]/u,dl=/[^\s\p{P}\p{S}]/u,W0=xe(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ua).getRegex(),fl=/(?!~)[\p{P}\p{S}]/u,G0=/(?!~)[\s\p{P}\p{S}]/u,Q0=/(?:[^\s\p{P}\p{S}]|~)/u,X0=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,hl=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Z0=xe(hl,"u").replace(/punct/g,si).getRegex(),K0=xe(hl,"u").replace(/punct/g,fl).getRegex(),pl="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",J0=xe(pl,"gu").replace(/notPunctSpace/g,dl).replace(/punctSpace/g,Ua).replace(/punct/g,si).getRegex(),ep=xe(pl,"gu").replace(/notPunctSpace/g,Q0).replace(/punctSpace/g,G0).replace(/punct/g,fl).getRegex(),tp=xe("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,dl).replace(/punctSpace/g,Ua).replace(/punct/g,si).getRegex(),np=xe(/\\(punct)/,"gu").replace(/punct/g,si).getRegex(),rp=xe(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),ip=xe(Fa).replace("(?:-->|$)","-->").getRegex(),ap=xe("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",ip).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Yr=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,sp=xe(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Yr).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ml=xe(/^!?\[(label)\]\[(ref)\]/).replace("label",Yr).replace("ref",Ba).getRegex(),gl=xe(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ba).getRegex(),up=xe("reflink|nolink(?!\\()","g").replace("reflink",ml).replace("nolink",gl).getRegex(),za={_backpedal:Qn,anyPunctuation:np,autolink:rp,blockSkip:X0,br:cl,code:q0,del:Qn,emStrongLDelim:Z0,emStrongRDelimAst:J0,emStrongRDelimUnd:tp,escape:Y0,link:sp,nolink:gl,punctuation:W0,reflink:ml,reflinkSearch:up,tag:ap,text:V0,url:Qn},op={...za,link:xe(/^!?\[(label)\]\((.*?)\)/).replace("label",Yr).getRegex(),reflink:xe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Yr).getRegex()},sa={...za,emStrongRDelimAst:ep,emStrongLDelim:K0,url:xe(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},lp={...sa,br:xe(cl).replace("{2,}","*").getRegex(),text:xe(sa.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Sr={normal:Ha,gfm:j0,pedantic:$0},Dn={normal:za,gfm:sa,breaks:lp,pedantic:op},cp={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Fs=t=>cp[t];function ht(t,e){if(e){if(qe.escapeTest.test(t))return t.replace(qe.escapeReplace,Fs)}else if(qe.escapeTestNoEncode.test(t))return t.replace(qe.escapeReplaceNoEncode,Fs);return t}function Hs(t){try{t=encodeURI(t).replace(qe.percentDecode,"%")}catch{return null}return t}function Us(t,e){const n=t.replace(qe.findPipe,(a,s,u)=>{let o=!1,l=s;for(;--l>=0&&u[l]==="\\";)o=!o;return o?"|":" |"}),r=n.split(qe.splitPipe);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(qe.slashPipe,"|");return r}function Pn(t,e,n){const r=t.length;if(r===0)return"";let i=0;for(;i<r&&t.charAt(r-i-1)===e;)i++;return t.slice(0,r-i)}function dp(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])n++;else if(t[r]===e[1]&&(n--,n<0))return r;return n>0?-2:-1}function zs(t,e,n,r,i){const a=e.href,s=e.title||null,u=t[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;const o={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:a,title:s,text:u,tokens:r.inlineTokens(u)};return r.state.inLink=!1,o}function fp(t,e,n){const r=t.match(n.other.indentCodeCompensation);if(r===null)return e;const i=r[1];return e.split(`
14
+ `).map(a=>{const s=a.match(n.other.beginningSpace);if(s===null)return a;const[u]=s;return u.length>=i.length?a.slice(i.length):a}).join(`
15
+ `)}var qr=class{options;rules;lexer;constructor(t){this.options=t||an}space(t){const e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){const e=this.rules.block.code.exec(t);if(e){const n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Pn(n,`
16
+ `)}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const n=e[0],r=fp(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(t){const e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){const r=Pn(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){const e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:Pn(e[0],`
17
+ `)}}blockquote(t){const e=this.rules.block.blockquote.exec(t);if(e){let n=Pn(e[0],`
18
+ `).split(`
19
+ `),r="",i="";const a=[];for(;n.length>0;){let s=!1;const u=[];let o;for(o=0;o<n.length;o++)if(this.rules.other.blockquoteStart.test(n[o]))u.push(n[o]),s=!0;else if(!s)u.push(n[o]);else break;n=n.slice(o);const l=u.join(`
20
+ `),f=l.replace(this.rules.other.blockquoteSetextReplace,`
21
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
22
+ ${l}`:l,i=i?`${i}
23
+ ${f}`:f;const d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(f,a,!0),this.lexer.state.top=d,n.length===0)break;const h=a.at(-1);if(h?.type==="code")break;if(h?.type==="blockquote"){const p=h,g=p.raw+`
24
+ `+n.join(`
25
+ `),x=this.blockquote(g);a[a.length-1]=x,r=r.substring(0,r.length-p.raw.length)+x.raw,i=i.substring(0,i.length-p.text.length)+x.text;break}else if(h?.type==="list"){const p=h,g=p.raw+`
26
+ `+n.join(`
27
+ `),x=this.list(g);a[a.length-1]=x,r=r.substring(0,r.length-h.raw.length)+x.raw,i=i.substring(0,i.length-p.raw.length)+x.raw,n=g.substring(a.at(-1).raw.length).split(`
28
+ `);continue}}return{type:"blockquote",raw:r,tokens:a,text:i}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim();const r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const a=this.rules.other.listItemRegex(n);let s=!1;for(;t;){let o=!1,l="",f="";if(!(e=a.exec(t))||this.rules.block.hr.test(t))break;l=e[0],t=t.substring(l.length);let d=e[2].split(`
29
+ `,1)[0].replace(this.rules.other.listReplaceTabs,b=>" ".repeat(3*b.length)),h=t.split(`
30
+ `,1)[0],p=!d.trim(),g=0;if(this.options.pedantic?(g=2,f=d.trimStart()):p?g=e[1].length+1:(g=e[2].search(this.rules.other.nonSpaceChar),g=g>4?1:g,f=d.slice(g),g+=e[1].length),p&&this.rules.other.blankLine.test(h)&&(l+=h+`
31
+ `,t=t.substring(h.length+1),o=!0),!o){const b=this.rules.other.nextBulletRegex(g),k=this.rules.other.hrRegex(g),E=this.rules.other.fencesBeginRegex(g),w=this.rules.other.headingBeginRegex(g),R=this.rules.other.htmlBeginRegex(g);for(;t;){const S=t.split(`
32
+ `,1)[0];let O;if(h=S,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),O=h):O=h.replace(this.rules.other.tabCharGlobal," "),E.test(h)||w.test(h)||R.test(h)||b.test(h)||k.test(h))break;if(O.search(this.rules.other.nonSpaceChar)>=g||!h.trim())f+=`
33
+ `+O.slice(g);else{if(p||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||E.test(d)||w.test(d)||k.test(d))break;f+=`
34
+ `+h}!p&&!h.trim()&&(p=!0),l+=S+`
35
+ `,t=t.substring(S.length+1),d=O.slice(g)}}i.loose||(s?i.loose=!0:this.rules.other.doubleBlankLine.test(l)&&(s=!0));let x=null,_;this.options.gfm&&(x=this.rules.other.listIsTask.exec(f),x&&(_=x[0]!=="[ ] ",f=f.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:l,task:!!x,checked:_,loose:!1,text:f,tokens:[]}),i.raw+=l}const u=i.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let o=0;o<i.items.length;o++)if(this.lexer.state.top=!1,i.items[o].tokens=this.lexer.blockTokens(i.items[o].text,[]),!i.loose){const l=i.items[o].tokens.filter(d=>d.type==="space"),f=l.length>0&&l.some(d=>this.rules.other.anyLine.test(d.raw));i.loose=f}if(i.loose)for(let o=0;o<i.items.length;o++)i.items[o].loose=!0;return i}}html(t){const e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){const e=this.rules.block.def.exec(t);if(e){const n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:r,title:i}}}table(t){const e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;const n=Us(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
36
+ `):[],a={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const s of r)this.rules.other.tableAlignRight.test(s)?a.align.push("right"):this.rules.other.tableAlignCenter.test(s)?a.align.push("center"):this.rules.other.tableAlignLeft.test(s)?a.align.push("left"):a.align.push(null);for(let s=0;s<n.length;s++)a.header.push({text:n[s],tokens:this.lexer.inline(n[s]),header:!0,align:a.align[s]});for(const s of i)a.rows.push(Us(s,a.header.length).map((u,o)=>({text:u,tokens:this.lexer.inline(u),header:!1,align:a.align[o]})));return a}}lheading(t){const e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){const e=this.rules.block.paragraph.exec(t);if(e){const n=e[1].charAt(e[1].length-1)===`
37
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){const e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){const e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){const e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){const e=this.rules.inline.link.exec(t);if(e){const n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const a=Pn(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{const a=dp(e[2],"()");if(a===-2)return;if(a>-1){const u=(e[0].indexOf("!")===0?5:4)+e[1].length+a;e[2]=e[2].substring(0,a),e[0]=e[0].substring(0,u).trim(),e[3]=""}}let r=e[2],i="";if(this.options.pedantic){const a=this.rules.other.pedanticHrefTitle.exec(r);a&&(r=a[1],i=a[3])}else i=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),zs(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){const r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[r.toLowerCase()];if(!i){const a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return zs(n,i,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const a=[...r[0]].length-1;let s,u,o=a,l=0;const f=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,e=e.slice(-1*t.length+a);(r=f.exec(e))!=null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(u=[...s].length,r[3]||r[4]){o+=u;continue}else if((r[5]||r[6])&&a%3&&!((a+u)%3)){l+=u;continue}if(o-=u,o>0)continue;u=Math.min(u,u+o+l);const d=[...r[0]][0].length,h=t.slice(0,a+r.index+d+u);if(Math.min(a,u)%2){const g=h.slice(1,-1);return{type:"em",raw:h,text:g,tokens:this.lexer.inlineTokens(g)}}const p=h.slice(2,-2);return{type:"strong",raw:h,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(t){const e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){const e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){const e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){const e=this.rules.inline.autolink.exec(t);if(e){let n,r;return e[2]==="@"?(n=e[1],r="mailto:"+n):(n=e[1],r=n),{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,r;if(e[2]==="@")n=e[0],r="mailto:"+n;else{let i;do i=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(i!==e[0]);n=e[0],e[1]==="www."?r="http://"+e[0]:r=e[0]}return{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){const e=this.rules.inline.text.exec(t);if(e){const n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},yt=class ua{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||an,this.options.tokenizer=this.options.tokenizer||new qr,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={other:qe,block:Sr.normal,inline:Dn.normal};this.options.pedantic?(n.block=Sr.pedantic,n.inline=Dn.pedantic):this.options.gfm&&(n.block=Sr.gfm,this.options.breaks?n.inline=Dn.breaks:n.inline=Dn.gfm),this.tokenizer.rules=n}static get rules(){return{block:Sr,inline:Dn}}static lex(e,n){return new ua(n).lex(e)}static lexInline(e,n){return new ua(n).inlineTokens(e)}lex(e){e=e.replace(qe.carriageReturn,`
38
+ `),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){const r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],r=!1){for(this.options.pedantic&&(e=e.replace(qe.tabCharGlobal," ").replace(qe.spaceLine,""));e;){let i;if(this.options.extensions?.block?.some(s=>(i=s.call({lexer:this},e,n))?(e=e.substring(i.raw.length),n.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);const s=n.at(-1);i.raw.length===1&&s!==void 0?s.raw+=`
39
+ `:n.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);const s=n.at(-1);s?.type==="paragraph"||s?.type==="text"?(s.raw+=`
40
+ `+i.raw,s.text+=`
41
+ `+i.text,this.inlineQueue.at(-1).src=s.text):n.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);const s=n.at(-1);s?.type==="paragraph"||s?.type==="text"?(s.raw+=`
42
+ `+i.raw,s.text+=`
43
+ `+i.raw,this.inlineQueue.at(-1).src=s.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title});continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),n.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let s=1/0;const u=e.slice(1);let o;this.options.extensions.startBlock.forEach(l=>{o=l.call({lexer:this},u),typeof o=="number"&&o>=0&&(s=Math.min(s,o))}),s<1/0&&s>=0&&(a=e.substring(0,s+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){const s=n.at(-1);r&&s?.type==="paragraph"?(s.raw+=`
44
+ `+i.raw,s.text+=`
45
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):n.push(i),r=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);const s=n.at(-1);s?.type==="text"?(s.raw+=`
46
+ `+i.raw,s.text+=`
47
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):n.push(i);continue}if(e){const s="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){let r=e,i=null;if(this.tokens.links){const u=Object.keys(this.tokens.links);if(u.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)u.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let a=!1,s="";for(;e;){a||(s=""),a=!1;let u;if(this.options.extensions?.inline?.some(l=>(u=l.call({lexer:this},e,n))?(e=e.substring(u.raw.length),n.push(u),!0):!1))continue;if(u=this.tokenizer.escape(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.tag(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.link(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(u.raw.length);const l=n.at(-1);u.type==="text"&&l?.type==="text"?(l.raw+=u.raw,l.text+=u.text):n.push(u);continue}if(u=this.tokenizer.emStrong(e,r,s)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.codespan(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.br(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.del(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.autolink(e)){e=e.substring(u.raw.length),n.push(u);continue}if(!this.state.inLink&&(u=this.tokenizer.url(e))){e=e.substring(u.raw.length),n.push(u);continue}let o=e;if(this.options.extensions?.startInline){let l=1/0;const f=e.slice(1);let d;this.options.extensions.startInline.forEach(h=>{d=h.call({lexer:this},f),typeof d=="number"&&d>=0&&(l=Math.min(l,d))}),l<1/0&&l>=0&&(o=e.substring(0,l+1))}if(u=this.tokenizer.inlineText(o)){e=e.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(s=u.raw.slice(-1)),a=!0;const l=n.at(-1);l?.type==="text"?(l.raw+=u.raw,l.text+=u.text):n.push(u);continue}if(e){const l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return n}},Vr=class{options;parser;constructor(t){this.options=t||an}space(t){return""}code({text:t,lang:e,escaped:n}){const r=(e||"").match(qe.notSpaceStart)?.[0],i=t.replace(qe.endingNewline,"")+`
48
+ `;return r?'<pre><code class="language-'+ht(r)+'">'+(n?i:ht(i,!0))+`</code></pre>
49
+ `:"<pre><code>"+(n?i:ht(i,!0))+`</code></pre>
50
+ `}blockquote({tokens:t}){return`<blockquote>
51
+ ${this.parser.parse(t)}</blockquote>
52
+ `}html({text:t}){return t}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
53
+ `}hr(t){return`<hr>
54
+ `}list(t){const e=t.ordered,n=t.start;let r="";for(let s=0;s<t.items.length;s++){const u=t.items[s];r+=this.listitem(u)}const i=e?"ol":"ul",a=e&&n!==1?' start="'+n+'"':"";return"<"+i+a+`>
55
+ `+r+"</"+i+`>
56
+ `}listitem(t){let e="";if(t.task){const n=this.checkbox({checked:!!t.checked});t.loose?t.tokens[0]?.type==="paragraph"?(t.tokens[0].text=n+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=n+" "+ht(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):e+=n+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`<li>${e}</li>
57
+ `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
58
+ `}table(t){let e="",n="";for(let i=0;i<t.header.length;i++)n+=this.tablecell(t.header[i]);e+=this.tablerow({text:n});let r="";for(let i=0;i<t.rows.length;i++){const a=t.rows[i];n="";for(let s=0;s<a.length;s++)n+=this.tablecell(a[s]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
59
+ <thead>
60
+ `+e+`</thead>
61
+ `+r+`</table>
62
+ `}tablerow({text:t}){return`<tr>
63
+ ${t}</tr>
64
+ `}tablecell(t){const e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
65
+ `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${ht(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){const r=this.parser.parseInline(n),i=Hs(t);if(i===null)return r;t=i;let a='<a href="'+t+'"';return e&&(a+=' title="'+ht(e)+'"'),a+=">"+r+"</a>",a}image({href:t,title:e,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));const i=Hs(t);if(i===null)return ht(n);t=i;let a=`<img src="${t}" alt="${n}"`;return e&&(a+=` title="${ht(e)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:ht(t.text)}},ja=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},At=class oa{options;renderer;textRenderer;constructor(e){this.options=e||an,this.options.renderer=this.options.renderer||new Vr,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ja}static parse(e,n){return new oa(n).parse(e)}static parseInline(e,n){return new oa(n).parseInline(e)}parse(e,n=!0){let r="";for(let i=0;i<e.length;i++){const a=e[i];if(this.options.extensions?.renderers?.[a.type]){const u=a,o=this.options.extensions.renderers[u.type].call({parser:this},u);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(u.type)){r+=o||"";continue}}const s=a;switch(s.type){case"space":{r+=this.renderer.space(s);continue}case"hr":{r+=this.renderer.hr(s);continue}case"heading":{r+=this.renderer.heading(s);continue}case"code":{r+=this.renderer.code(s);continue}case"table":{r+=this.renderer.table(s);continue}case"blockquote":{r+=this.renderer.blockquote(s);continue}case"list":{r+=this.renderer.list(s);continue}case"html":{r+=this.renderer.html(s);continue}case"paragraph":{r+=this.renderer.paragraph(s);continue}case"text":{let u=s,o=this.renderer.text(u);for(;i+1<e.length&&e[i+1].type==="text";)u=e[++i],o+=`
66
+ `+this.renderer.text(u);n?r+=this.renderer.paragraph({type:"paragraph",raw:o,text:o,tokens:[{type:"text",raw:o,text:o,escaped:!0}]}):r+=o;continue}default:{const u='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}parseInline(e,n=this.renderer){let r="";for(let i=0;i<e.length;i++){const a=e[i];if(this.options.extensions?.renderers?.[a.type]){const u=this.options.extensions.renderers[a.type].call({parser:this},a);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){r+=u||"";continue}}const s=a;switch(s.type){case"escape":{r+=n.text(s);break}case"html":{r+=n.html(s);break}case"link":{r+=n.link(s);break}case"image":{r+=n.image(s);break}case"strong":{r+=n.strong(s);break}case"em":{r+=n.em(s);break}case"codespan":{r+=n.codespan(s);break}case"br":{r+=n.br(s);break}case"del":{r+=n.del(s);break}case"text":{r+=n.text(s);break}default:{const u='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}},Br=class{options;block;constructor(t){this.options=t||an}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?yt.lex:yt.lexInline}provideParser(){return this.block?At.parse:At.parseInline}},hp=class{defaults=Da();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=At;Renderer=Vr;TextRenderer=ja;Lexer=yt;Tokenizer=qr;Hooks=Br;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(const r of t)switch(n=n.concat(e.call(this,r)),r.type){case"table":{const i=r;for(const a of i.header)n=n.concat(this.walkTokens(a.tokens,e));for(const a of i.rows)for(const s of a)n=n.concat(this.walkTokens(s.tokens,e));break}case"list":{const i=r;n=n.concat(this.walkTokens(i.items,e));break}default:{const i=r;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(a=>{const s=i[a].flat(1/0);n=n.concat(this.walkTokens(s,e))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,e)))}}return n}use(...t){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{const r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){const a=e.renderers[i.name];a?e.renderers[i.name]=function(...s){let u=i.renderer.apply(this,s);return u===!1&&(u=a.apply(this,s)),u}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const a=e[i.level];a?a.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),r.extensions=e),n.renderer){const i=this.defaults.renderer||new Vr(this.defaults);for(const a in n.renderer){if(!(a in i))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;const s=a,u=n.renderer[s],o=i[s];i[s]=(...l)=>{let f=u.apply(i,l);return f===!1&&(f=o.apply(i,l)),f||""}}r.renderer=i}if(n.tokenizer){const i=this.defaults.tokenizer||new qr(this.defaults);for(const a in n.tokenizer){if(!(a in i))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;const s=a,u=n.tokenizer[s],o=i[s];i[s]=(...l)=>{let f=u.apply(i,l);return f===!1&&(f=o.apply(i,l)),f}}r.tokenizer=i}if(n.hooks){const i=this.defaults.hooks||new Br;for(const a in n.hooks){if(!(a in i))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;const s=a,u=n.hooks[s],o=i[s];Br.passThroughHooks.has(a)?i[s]=l=>{if(this.defaults.async)return Promise.resolve(u.call(i,l)).then(d=>o.call(i,d));const f=u.call(i,l);return o.call(i,f)}:i[s]=(...l)=>{let f=u.apply(i,l);return f===!1&&(f=o.apply(i,l)),f}}r.hooks=i}if(n.walkTokens){const i=this.defaults.walkTokens,a=n.walkTokens;r.walkTokens=function(s){let u=[];return u.push(a.call(this,s)),i&&(u=u.concat(i.call(this,s))),u}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return yt.lex(t,e??this.defaults)}parser(t,e){return At.parse(t,e??this.defaults)}parseMarkdown(t){return(n,r)=>{const i={...r},a={...this.defaults,...i},s=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));a.hooks&&(a.hooks.options=a,a.hooks.block=t);const u=a.hooks?a.hooks.provideLexer():t?yt.lex:yt.lexInline,o=a.hooks?a.hooks.provideParser():t?At.parse:At.parseInline;if(a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(n):n).then(l=>u(l,a)).then(l=>a.hooks?a.hooks.processAllTokens(l):l).then(l=>a.walkTokens?Promise.all(this.walkTokens(l,a.walkTokens)).then(()=>l):l).then(l=>o(l,a)).then(l=>a.hooks?a.hooks.postprocess(l):l).catch(s);try{a.hooks&&(n=a.hooks.preprocess(n));let l=u(n,a);a.hooks&&(l=a.hooks.processAllTokens(l)),a.walkTokens&&this.walkTokens(l,a.walkTokens);let f=o(l,a);return a.hooks&&(f=a.hooks.postprocess(f)),f}catch(l){return s(l)}}}onError(t,e){return n=>{if(n.message+=`
67
+ Please report this to https://github.com/markedjs/marked.`,t){const r="<p>An error occurred:</p><pre>"+ht(n.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(n);throw n}}},tn=new hp;function _e(t,e){return tn.parse(t,e)}_e.options=_e.setOptions=function(t){return tn.setOptions(t),_e.defaults=tn.defaults,sl(_e.defaults),_e};_e.getDefaults=Da;_e.defaults=an;_e.use=function(...t){return tn.use(...t),_e.defaults=tn.defaults,sl(_e.defaults),_e};_e.walkTokens=function(t,e){return tn.walkTokens(t,e)};_e.parseInline=tn.parseInline;_e.Parser=At;_e.parser=At.parse;_e.Renderer=Vr;_e.TextRenderer=ja;_e.Lexer=yt;_e.lexer=yt.lex;_e.Tokenizer=qr;_e.Hooks=Br;_e.parse=_e;_e.options;_e.setOptions;_e.use;_e.walkTokens;_e.parseInline;At.parse;yt.lex;function js(t){const e=[],n=String(t||"");let r=n.indexOf(","),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);const s=n.slice(i,r).trim();(s||!a)&&e.push(s),i=r+1,r=n.indexOf(",",i)}return e}function bl(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const pp=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,mp=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gp={};function $s(t,e){return(gp.jsx?mp:pp).test(t)}const bp=/[ \t\n\f\r]/g;function Ep(t){return typeof t=="object"?t.type==="text"?Ys(t.value):!1:Ys(t)}function Ys(t){return t.replace(bp,"")===""}class Er{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}Er.prototype.normal={};Er.prototype.property={};Er.prototype.space=void 0;function El(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new Er(n,r,e)}function or(t){return t.toLowerCase()}class Xe{constructor(e,n){this.attribute=n,this.property=e}}Xe.prototype.attribute="";Xe.prototype.booleanish=!1;Xe.prototype.boolean=!1;Xe.prototype.commaOrSpaceSeparated=!1;Xe.prototype.commaSeparated=!1;Xe.prototype.defined=!1;Xe.prototype.mustUseProperty=!1;Xe.prototype.number=!1;Xe.prototype.overloadedBoolean=!1;Xe.prototype.property="";Xe.prototype.spaceSeparated=!1;Xe.prototype.space=void 0;let Tp=0;const ue=sn(),De=sn(),la=sn(),Y=sn(),Ie=sn(),Tn=sn(),Je=sn();function sn(){return 2**++Tp}const ca=Object.freeze(Object.defineProperty({__proto__:null,boolean:ue,booleanish:De,commaOrSpaceSeparated:Je,commaSeparated:Tn,number:Y,overloadedBoolean:la,spaceSeparated:Ie},Symbol.toStringTag,{value:"Module"})),wi=Object.keys(ca);class $a extends Xe{constructor(e,n,r,i){let a=-1;if(super(e,n),qs(this,"space",i),typeof r=="number")for(;++a<wi.length;){const s=wi[a];qs(this,wi[a],(r&ca[s])===ca[s])}}}$a.prototype.defined=!0;function qs(t,e,n){n&&(t[e]=n)}function Sn(t){const e={},n={};for(const[r,i]of Object.entries(t.properties)){const a=new $a(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),e[r]=a,n[or(r)]=r,n[or(a.attribute)]=r}return new Er(e,n,t.space)}const Tl=Sn({properties:{ariaActiveDescendant:null,ariaAtomic:De,ariaAutoComplete:null,ariaBusy:De,ariaChecked:De,ariaColCount:Y,ariaColIndex:Y,ariaColSpan:Y,ariaControls:Ie,ariaCurrent:null,ariaDescribedBy:Ie,ariaDetails:null,ariaDisabled:De,ariaDropEffect:Ie,ariaErrorMessage:null,ariaExpanded:De,ariaFlowTo:Ie,ariaGrabbed:De,ariaHasPopup:null,ariaHidden:De,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ie,ariaLevel:Y,ariaLive:null,ariaModal:De,ariaMultiLine:De,ariaMultiSelectable:De,ariaOrientation:null,ariaOwns:Ie,ariaPlaceholder:null,ariaPosInSet:Y,ariaPressed:De,ariaReadOnly:De,ariaRelevant:null,ariaRequired:De,ariaRoleDescription:Ie,ariaRowCount:Y,ariaRowIndex:Y,ariaRowSpan:Y,ariaSelected:De,ariaSetSize:Y,ariaSort:null,ariaValueMax:Y,ariaValueMin:Y,ariaValueNow:Y,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function xl(t,e){return e in t?t[e]:e}function _l(t,e){return xl(t,e.toLowerCase())}const xp=Sn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Tn,acceptCharset:Ie,accessKey:Ie,action:null,allow:null,allowFullScreen:ue,allowPaymentRequest:ue,allowUserMedia:ue,alt:null,as:null,async:ue,autoCapitalize:null,autoComplete:Ie,autoFocus:ue,autoPlay:ue,blocking:Ie,capture:null,charSet:null,checked:ue,cite:null,className:Ie,cols:Y,colSpan:null,content:null,contentEditable:De,controls:ue,controlsList:Ie,coords:Y|Tn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ue,defer:ue,dir:null,dirName:null,disabled:ue,download:la,draggable:De,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ue,formTarget:null,headers:Ie,height:Y,hidden:la,high:Y,href:null,hrefLang:null,htmlFor:Ie,httpEquiv:Ie,id:null,imageSizes:null,imageSrcSet:null,inert:ue,inputMode:null,integrity:null,is:null,isMap:ue,itemId:null,itemProp:Ie,itemRef:Ie,itemScope:ue,itemType:Ie,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ue,low:Y,manifest:null,max:null,maxLength:Y,media:null,method:null,min:null,minLength:Y,multiple:ue,muted:ue,name:null,nonce:null,noModule:ue,noValidate:ue,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:ue,optimum:Y,pattern:null,ping:Ie,placeholder:null,playsInline:ue,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ue,referrerPolicy:null,rel:Ie,required:ue,reversed:ue,rows:Y,rowSpan:Y,sandbox:Ie,scope:null,scoped:ue,seamless:ue,selected:ue,shadowRootClonable:ue,shadowRootDelegatesFocus:ue,shadowRootMode:null,shape:null,size:Y,sizes:null,slot:null,span:Y,spellCheck:De,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Y,step:null,style:null,tabIndex:Y,target:null,title:null,translate:null,type:null,typeMustMatch:ue,useMap:null,value:De,width:Y,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ie,axis:null,background:null,bgColor:null,border:Y,borderColor:null,bottomMargin:Y,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ue,declare:ue,event:null,face:null,frame:null,frameBorder:null,hSpace:Y,leftMargin:Y,link:null,longDesc:null,lowSrc:null,marginHeight:Y,marginWidth:Y,noResize:ue,noHref:ue,noShade:ue,noWrap:ue,object:null,profile:null,prompt:null,rev:null,rightMargin:Y,rules:null,scheme:null,scrolling:De,standby:null,summary:null,text:null,topMargin:Y,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Y,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ue,disableRemotePlayback:ue,prefix:null,property:null,results:Y,security:null,unselectable:null},space:"html",transform:_l}),_p=Sn({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",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:Je,accentHeight:Y,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Y,amplitude:Y,arabicForm:null,ascent:Y,attributeName:null,attributeType:null,azimuth:Y,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Y,by:null,calcMode:null,capHeight:Y,className:Ie,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:Y,diffuseConstant:Y,direction:null,display:null,dur:null,divisor:Y,dominantBaseline:null,download:ue,dx:null,dy:null,edgeMode:null,editable:null,elevation:Y,enableBackground:null,end:null,event:null,exponent:Y,externalResourcesRequired:null,fill:null,fillOpacity:Y,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:Tn,g2:Tn,glyphName:Tn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Y,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Y,horizOriginX:Y,horizOriginY:Y,id:null,ideographic:Y,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Y,k:Y,k1:Y,k2:Y,k3:Y,k4:Y,kernelMatrix:Je,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Y,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Y,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:Y,overlineThickness:Y,paintOrder:null,panose1:null,path:null,pathLength:Y,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ie,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Y,pointsAtY:Y,pointsAtZ:Y,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Je,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Je,rev:Je,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Je,requiredFeatures:Je,requiredFonts:Je,requiredFormats:Je,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:Y,specularExponent:Y,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Y,strikethroughThickness:Y,string:null,stroke:null,strokeDashArray:Je,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Y,strokeOpacity:Y,strokeWidth:null,style:null,surfaceScale:Y,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Je,tabIndex:Y,tableValues:null,target:null,targetX:Y,targetY:Y,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Je,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Y,underlineThickness:Y,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Y,values:null,vAlphabetic:Y,vMathematical:Y,vectorEffect:null,vHanging:Y,vIdeographic:Y,version:null,vertAdvY:Y,vertOriginX:Y,vertOriginY:Y,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Y,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:xl}),yl=Sn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),Al=Sn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:_l}),Cl=Sn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),yp={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Ap=/[A-Z]/g,Vs=/-[a-z]/g,Cp=/^data[-\w.:]+$/i;function ui(t,e){const n=or(e);let r=e,i=Xe;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Cp.test(e)){if(e.charAt(4)==="-"){const a=e.slice(5).replace(Vs,Sp);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=e.slice(4);if(!Vs.test(a)){let s=a.replace(Ap,kp);s.charAt(0)!=="-"&&(s="-"+s),e="data"+s}}i=$a}return new i(r,e)}function kp(t){return"-"+t.toLowerCase()}function Sp(t){return t.charAt(1).toUpperCase()}const Tr=El([Tl,xp,yl,Al,Cl],"html"),Ft=El([Tl,_p,yl,Al,Cl],"svg");function Ws(t){const e=String(t||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function kl(t){return t.join(" ").trim()}var cn={},Ri,Gs;function Ip(){if(Gs)return Ri;Gs=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,u=/^\s+|\s+$/g,o=`
68
+ `,l="/",f="*",d="",h="comment",p="declaration";function g(_,b){if(typeof _!="string")throw new TypeError("First argument must be a string");if(!_)return[];b=b||{};var k=1,E=1;function w(z){var H=z.match(e);H&&(k+=H.length);var Z=z.lastIndexOf(o);E=~Z?z.length-Z:E+z.length}function R(){var z={line:k,column:E};return function(H){return H.position=new S(z),j(),H}}function S(z){this.start=z,this.end={line:k,column:E},this.source=b.source}S.prototype.content=_;function O(z){var H=new Error(b.source+":"+k+":"+E+": "+z);if(H.reason=z,H.filename=b.source,H.line=k,H.column=E,H.source=_,!b.silent)throw H}function F(z){var H=z.exec(_);if(H){var Z=H[0];return w(Z),_=_.slice(Z.length),H}}function j(){F(n)}function N(z){var H;for(z=z||[];H=P();)H!==!1&&z.push(H);return z}function P(){var z=R();if(!(l!=_.charAt(0)||f!=_.charAt(1))){for(var H=2;d!=_.charAt(H)&&(f!=_.charAt(H)||l!=_.charAt(H+1));)++H;if(H+=2,d===_.charAt(H-1))return O("End of comment missing");var Z=_.slice(2,H-2);return E+=2,w(Z),_=_.slice(H),E+=2,z({type:h,comment:Z})}}function M(){var z=R(),H=F(r);if(H){if(P(),!F(i))return O("property missing ':'");var Z=F(a),re=z({type:p,property:x(H[0].replace(t,d)),value:Z?x(Z[0].replace(t,d)):d});return F(s),re}}function J(){var z=[];N(z);for(var H;H=M();)H!==!1&&(z.push(H),N(z));return z}return j(),J()}function x(_){return _?_.replace(u,d):d}return Ri=g,Ri}var Qs;function Np(){if(Qs)return cn;Qs=1;var t=cn&&cn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(cn,"__esModule",{value:!0}),cn.default=n;const e=t(Ip());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const s=(0,e.default)(r),u=typeof i=="function";return s.forEach(o=>{if(o.type!=="declaration")return;const{property:l,value:f}=o;u?i(l,f,o):f&&(a=a||{},a[l]=f)}),a}return cn}var Mn={},Xs;function wp(){if(Xs)return Mn;Xs=1,Object.defineProperty(Mn,"__esModule",{value:!0}),Mn.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(l){return!l||n.test(l)||t.test(l)},s=function(l,f){return f.toUpperCase()},u=function(l,f){return"".concat(f,"-")},o=function(l,f){return f===void 0&&(f={}),a(l)?l:(l=l.toLowerCase(),f.reactCompat?l=l.replace(i,u):l=l.replace(r,u),l.replace(e,s))};return Mn.camelCase=o,Mn}var Bn,Zs;function Rp(){if(Zs)return Bn;Zs=1;var t=Bn&&Bn.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},e=t(Np()),n=wp();function r(i,a){var s={};return!i||typeof i!="string"||(0,e.default)(i,function(u,o){u&&o&&(s[(0,n.camelCase)(u,a)]=o)}),s}return r.default=r,Bn=r,Bn}var Lp=Rp();const Op=Sa(Lp),oi=Sl("end"),gt=Sl("start");function Sl(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function vp(t){const e=gt(t),n=oi(t);if(e&&n)return{start:e,end:n}}function Xn(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?Ks(t.position):"start"in t||"end"in t?Ks(t):"line"in t||"column"in t?da(t):""}function da(t){return Js(t&&t.line)+":"+Js(t&&t.column)}function Ks(t){return da(t&&t.start)+"-"+da(t&&t.end)}function Js(t){return t&&typeof t=="number"?t:1}class Ue extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},s=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof e=="string"?i=e:!a.cause&&e&&(s=!0,i=e.message,a.cause=e),!a.ruleId&&!a.source&&typeof r=="string"){const o=r.indexOf(":");o===-1?a.ruleId=r:(a.source=r.slice(0,o),a.ruleId=r.slice(o+1))}if(!a.place&&a.ancestors&&a.ancestors){const o=a.ancestors[a.ancestors.length-1];o&&(a.place=o.position)}const u=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=u?u.line:void 0,this.name=Xn(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=s&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ue.prototype.file="";Ue.prototype.name="";Ue.prototype.reason="";Ue.prototype.message="";Ue.prototype.stack="";Ue.prototype.column=void 0;Ue.prototype.line=void 0;Ue.prototype.ancestors=void 0;Ue.prototype.cause=void 0;Ue.prototype.fatal=void 0;Ue.prototype.place=void 0;Ue.prototype.ruleId=void 0;Ue.prototype.source=void 0;const Ya={}.hasOwnProperty,Dp=new Map,Pp=/[A-Z]/g,Mp=new Set(["table","tbody","thead","tfoot","tr"]),Bp=new Set(["td","th"]),Il="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Fp(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Vp(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=qp(n,e.jsx,e.jsxs)}const i={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Ft:Tr,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},a=Nl(i,t,void 0);return a&&typeof a!="string"?a:i.create(t,i.Fragment,{children:a||void 0},void 0)}function Nl(t,e,n){if(e.type==="element")return Hp(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return Up(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return jp(t,e,n);if(e.type==="mdxjsEsm")return zp(t,e);if(e.type==="root")return $p(t,e,n);if(e.type==="text")return Yp(t,e)}function Hp(t,e,n){const r=t.schema;let i=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Ft,t.schema=i),t.ancestors.push(e);const a=Rl(t,e.tagName,!1),s=Wp(t,e);let u=Va(t,e);return Mp.has(e.tagName)&&(u=u.filter(function(o){return typeof o=="string"?!Ep(o):!0})),wl(t,s,a,e),qa(s,u),t.ancestors.pop(),t.schema=r,t.create(e,a,s,n)}function Up(t,e){if(e.data&&e.data.estree&&t.evaluater){const r=e.data.estree.body[0];return r.type,t.evaluater.evaluateExpression(r.expression)}lr(t,e.position)}function zp(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);lr(t,e.position)}function jp(t,e,n){const r=t.schema;let i=r;e.name==="svg"&&r.space==="html"&&(i=Ft,t.schema=i),t.ancestors.push(e);const a=e.name===null?t.Fragment:Rl(t,e.name,!0),s=Gp(t,e),u=Va(t,e);return wl(t,s,a,e),qa(s,u),t.ancestors.pop(),t.schema=r,t.create(e,a,s,n)}function $p(t,e,n){const r={};return qa(r,Va(t,e)),t.create(e,t.Fragment,r,n)}function Yp(t,e){return e.value}function wl(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function qa(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function qp(t,e,n){return r;function r(i,a,s,u){const l=Array.isArray(s.children)?n:e;return u?l(a,s,u):l(a,s)}}function Vp(t,e){return n;function n(r,i,a,s){const u=Array.isArray(a.children),o=gt(r);return e(i,a,s,u,{columnNumber:o?o.column-1:void 0,fileName:t,lineNumber:o?o.line:void 0},void 0)}}function Wp(t,e){const n={};let r,i;for(i in e.properties)if(i!=="children"&&Ya.call(e.properties,i)){const a=Qp(t,i,e.properties[i]);if(a){const[s,u]=a;t.tableCellAlignToStyle&&s==="align"&&typeof u=="string"&&Bp.has(e.tagName)?r=u:n[s]=u}}if(r){const a=n.style||(n.style={});a[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Gp(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const a=r.data.estree.body[0];a.type;const s=a.expression;s.type;const u=s.properties[0];u.type,Object.assign(n,t.evaluater.evaluateExpression(u.argument))}else lr(t,e.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const u=r.value.data.estree.body[0];u.type,a=t.evaluater.evaluateExpression(u.expression)}else lr(t,e.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function Va(t,e){const n=[];let r=-1;const i=t.passKeys?new Map:Dp;for(;++r<e.children.length;){const a=e.children[r];let s;if(t.passKeys){const o=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(o){const l=i.get(o)||0;s=o+"-"+l,i.set(o,l+1)}}const u=Nl(t,a,s);u!==void 0&&n.push(u)}return n}function Qp(t,e,n){const r=ui(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?bl(n):kl(n)),r.property==="style"){let i=typeof n=="object"?n:Xp(t,String(n));return t.stylePropertyNameCase==="css"&&(i=Zp(i)),["style",i]}return[t.elementAttributeNameCase==="react"&&r.space?yp[r.property]||r.property:r.attribute,n]}}function Xp(t,e){try{return Op(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const r=n,i=new Ue("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=t.filePath||void 0,i.url=Il+"#cannot-parse-style-attribute",i}}function Rl(t,e,n){let r;if(!n)r={type:"Literal",value:e};else if(e.includes(".")){const i=e.split(".");let a=-1,s;for(;++a<i.length;){const u=$s(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};s=s?{type:"MemberExpression",object:s,property:u,computed:!!(a&&u.type==="Literal"),optional:!1}:u}r=s}else r=$s(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(r.type==="Literal"){const i=r.value;return Ya.call(t.components,i)?t.components[i]:i}if(t.evaluater)return t.evaluater.evaluateExpression(r);lr(t)}function lr(t,e){const n=new Ue("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=Il+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Zp(t){const e={};let n;for(n in t)Ya.call(t,n)&&(e[Kp(n)]=t[n]);return e}function Kp(t){let e=t.replace(Pp,Jp);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function Jp(t){return"-"+t.toLowerCase()}const Li={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},em={};function Wa(t,e){const n=em,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Ll(t,r,i)}function Ll(t,e,n){if(tm(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return eu(t.children,e,n)}return Array.isArray(t)?eu(t,e,n):""}function eu(t,e,n){const r=[];let i=-1;for(;++i<t.length;)r[i]=Ll(t[i],e,n);return r.join("")}function tm(t){return!!(t&&typeof t=="object")}const tu=document.createElement("i");function Ga(t){const e="&"+t+";";tu.innerHTML=e;const n=tu.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function tt(t,e,n,r){const i=t.length;let a=0,s;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(e,n),t.splice(...s);else for(n&&t.splice(e,n);a<r.length;)s=r.slice(a,a+1e4),s.unshift(e,0),t.splice(...s),a+=1e4,e+=1e4}function it(t,e){return t.length>0?(tt(t,t.length,0,e),t):e}const nu={}.hasOwnProperty;function Ol(t){const e={};let n=-1;for(;++n<t.length;)nm(e,t[n]);return e}function nm(t,e){let n;for(n in e){const i=(nu.call(t,n)?t[n]:void 0)||(t[n]={}),a=e[n];let s;if(a)for(s in a){nu.call(i,s)||(i[s]=[]);const u=a[s];rm(i[s],Array.isArray(u)?u:u?[u]:[])}}}function rm(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);tt(t,0,0,r)}function vl(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function lt(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ye=Ht(/[A-Za-z]/),He=Ht(/[\dA-Za-z]/),im=Ht(/[#-'*+\--9=?A-Z^-~]/);function Wr(t){return t!==null&&(t<32||t===127)}const fa=Ht(/\d/),am=Ht(/[\dA-Fa-f]/),sm=Ht(/[!-/:-@[-`{-~]/);function te(t){return t!==null&&t<-2}function Se(t){return t!==null&&(t<0||t===32)}function fe(t){return t===-2||t===-1||t===32}const li=Ht(new RegExp("\\p{P}|\\p{S}","u")),nn=Ht(/\s/);function Ht(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function In(t){const e=[];let n=-1,r=0,i=0;for(;++n<t.length;){const a=t.charCodeAt(n);let s="";if(a===37&&He(t.charCodeAt(n+1))&&He(t.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(s=String.fromCharCode(a));else if(a>55295&&a<57344){const u=t.charCodeAt(n+1);a<56320&&u>56319&&u<57344?(s=String.fromCharCode(a,u),i=1):s="�"}else s=String.fromCharCode(a);s&&(e.push(t.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function Ee(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return s;function s(o){return fe(o)?(t.enter(n),u(o)):e(o)}function u(o){return fe(o)&&a++<i?(t.consume(o),u):(t.exit(n),e(o))}}const um={tokenize:om};function om(t){const e=t.attempt(this.parser.constructs.contentInitial,r,i);let n;return e;function r(u){if(u===null){t.consume(u);return}return t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),Ee(t,e,"linePrefix")}function i(u){return t.enter("paragraph"),a(u)}function a(u){const o=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=o),n=o,s(u)}function s(u){if(u===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(u);return}return te(u)?(t.consume(u),t.exit("chunkText"),a):(t.consume(u),s)}}const lm={tokenize:cm},ru={tokenize:dm};function cm(t){const e=this,n=[];let r=0,i,a,s;return u;function u(E){if(r<n.length){const w=n[r];return e.containerState=w[1],t.attempt(w[0].continuation,o,l)(E)}return l(E)}function o(E){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&k();const w=e.events.length;let R=w,S;for(;R--;)if(e.events[R][0]==="exit"&&e.events[R][1].type==="chunkFlow"){S=e.events[R][1].end;break}b(r);let O=w;for(;O<e.events.length;)e.events[O][1].end={...S},O++;return tt(e.events,R+1,0,e.events.slice(w)),e.events.length=O,l(E)}return u(E)}function l(E){if(r===n.length){if(!i)return h(E);if(i.currentConstruct&&i.currentConstruct.concrete)return g(E);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(ru,f,d)(E)}function f(E){return i&&k(),b(r),h(E)}function d(E){return e.parser.lazy[e.now().line]=r!==n.length,s=e.now().offset,g(E)}function h(E){return e.containerState={},t.attempt(ru,p,g)(E)}function p(E){return r++,n.push([e.currentConstruct,e.containerState]),h(E)}function g(E){if(E===null){i&&k(),b(0),t.consume(E);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),x(E)}function x(E){if(E===null){_(t.exit("chunkFlow"),!0),b(0),t.consume(E);return}return te(E)?(t.consume(E),_(t.exit("chunkFlow")),r=0,e.interrupt=void 0,u):(t.consume(E),x)}function _(E,w){const R=e.sliceStream(E);if(w&&R.push(null),E.previous=a,a&&(a.next=E),a=E,i.defineSkip(E.start),i.write(R),e.parser.lazy[E.start.line]){let S=i.events.length;for(;S--;)if(i.events[S][1].start.offset<s&&(!i.events[S][1].end||i.events[S][1].end.offset>s))return;const O=e.events.length;let F=O,j,N;for(;F--;)if(e.events[F][0]==="exit"&&e.events[F][1].type==="chunkFlow"){if(j){N=e.events[F][1].end;break}j=!0}for(b(r),S=O;S<e.events.length;)e.events[S][1].end={...N},S++;tt(e.events,F+1,0,e.events.slice(O)),e.events.length=S}}function b(E){let w=n.length;for(;w-- >E;){const R=n[w];e.containerState=R[1],R[0].exit.call(e,t)}n.length=E}function k(){i.write([null]),a=void 0,i=void 0,e.containerState._closeFlow=void 0}}function dm(t,e,n){return Ee(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function yn(t){if(t===null||Se(t)||nn(t))return 1;if(li(t))return 2}function ci(t,e,n){const r=[];let i=-1;for(;++i<t.length;){const a=t[i].resolveAll;a&&!r.includes(a)&&(e=a(e,n),r.push(a))}return e}const ha={name:"attention",resolveAll:fm,tokenize:hm};function fm(t,e){let n=-1,r,i,a,s,u,o,l,f;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(r=n;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&e.sliceSerialize(t[r][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[r][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;o=t[r][1].end.offset-t[r][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const d={...t[r][1].end},h={...t[n][1].start};iu(d,-o),iu(h,o),s={type:o>1?"strongSequence":"emphasisSequence",start:d,end:{...t[r][1].end}},u={type:o>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:h},a={type:o>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},i={type:o>1?"strong":"emphasis",start:{...s.start},end:{...u.end}},t[r][1].end={...s.start},t[n][1].start={...u.end},l=[],t[r][1].end.offset-t[r][1].start.offset&&(l=it(l,[["enter",t[r][1],e],["exit",t[r][1],e]])),l=it(l,[["enter",i,e],["enter",s,e],["exit",s,e],["enter",a,e]]),l=it(l,ci(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),l=it(l,[["exit",a,e],["enter",u,e],["exit",u,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(f=2,l=it(l,[["enter",t[n][1],e],["exit",t[n][1],e]])):f=0,tt(t,r-1,n-r+3,l),n=r+l.length-f-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function hm(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=yn(r);let a;return s;function s(o){return a=o,t.enter("attentionSequence"),u(o)}function u(o){if(o===a)return t.consume(o),u;const l=t.exit("attentionSequence"),f=yn(o),d=!f||f===2&&i||n.includes(o),h=!i||i===2&&f||n.includes(r);return l._open=!!(a===42?d:d&&(i||!h)),l._close=!!(a===42?h:h&&(f||!d)),e(o)}}function iu(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const pm={name:"autolink",tokenize:mm};function mm(t,e,n){let r=0;return i;function i(p){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(p),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),a}function a(p){return Ye(p)?(t.consume(p),s):p===64?n(p):l(p)}function s(p){return p===43||p===45||p===46||He(p)?(r=1,u(p)):l(p)}function u(p){return p===58?(t.consume(p),r=0,o):(p===43||p===45||p===46||He(p))&&r++<32?(t.consume(p),u):(r=0,l(p))}function o(p){return p===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(p),t.exit("autolinkMarker"),t.exit("autolink"),e):p===null||p===32||p===60||Wr(p)?n(p):(t.consume(p),o)}function l(p){return p===64?(t.consume(p),f):im(p)?(t.consume(p),l):n(p)}function f(p){return He(p)?d(p):n(p)}function d(p){return p===46?(t.consume(p),r=0,f):p===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(p),t.exit("autolinkMarker"),t.exit("autolink"),e):h(p)}function h(p){if((p===45||He(p))&&r++<63){const g=p===45?h:d;return t.consume(p),g}return n(p)}}const xr={partial:!0,tokenize:gm};function gm(t,e,n){return r;function r(a){return fe(a)?Ee(t,i,"linePrefix")(a):i(a)}function i(a){return a===null||te(a)?e(a):n(a)}}const Dl={continuation:{tokenize:Em},exit:Tm,name:"blockQuote",tokenize:bm};function bm(t,e,n){const r=this;return i;function i(s){if(s===62){const u=r.containerState;return u.open||(t.enter("blockQuote",{_container:!0}),u.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(s),t.exit("blockQuoteMarker"),a}return n(s)}function a(s){return fe(s)?(t.enter("blockQuotePrefixWhitespace"),t.consume(s),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(s))}}function Em(t,e,n){const r=this;return i;function i(s){return fe(s)?Ee(t,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):a(s)}function a(s){return t.attempt(Dl,e,n)(s)}}function Tm(t){t.exit("blockQuote")}const Pl={name:"characterEscape",tokenize:xm};function xm(t,e,n){return r;function r(a){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(a),t.exit("escapeMarker"),i}function i(a){return sm(a)?(t.enter("characterEscapeValue"),t.consume(a),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(a)}}const Ml={name:"characterReference",tokenize:_m};function _m(t,e,n){const r=this;let i=0,a,s;return u;function u(d){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(d),t.exit("characterReferenceMarker"),o}function o(d){return d===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(d),t.exit("characterReferenceMarkerNumeric"),l):(t.enter("characterReferenceValue"),a=31,s=He,f(d))}function l(d){return d===88||d===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(d),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),a=6,s=am,f):(t.enter("characterReferenceValue"),a=7,s=fa,f(d))}function f(d){if(d===59&&i){const h=t.exit("characterReferenceValue");return s===He&&!Ga(r.sliceSerialize(h))?n(d):(t.enter("characterReferenceMarker"),t.consume(d),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return s(d)&&i++<a?(t.consume(d),f):n(d)}}const au={partial:!0,tokenize:Am},su={concrete:!0,name:"codeFenced",tokenize:ym};function ym(t,e,n){const r=this,i={partial:!0,tokenize:R};let a=0,s=0,u;return o;function o(S){return l(S)}function l(S){const O=r.events[r.events.length-1];return a=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,u=S,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),f(S)}function f(S){return S===u?(s++,t.consume(S),f):s<3?n(S):(t.exit("codeFencedFenceSequence"),fe(S)?Ee(t,d,"whitespace")(S):d(S))}function d(S){return S===null||te(S)?(t.exit("codeFencedFence"),r.interrupt?e(S):t.check(au,x,w)(S)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),h(S))}function h(S){return S===null||te(S)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),d(S)):fe(S)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),Ee(t,p,"whitespace")(S)):S===96&&S===u?n(S):(t.consume(S),h)}function p(S){return S===null||te(S)?d(S):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),g(S))}function g(S){return S===null||te(S)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),d(S)):S===96&&S===u?n(S):(t.consume(S),g)}function x(S){return t.attempt(i,w,_)(S)}function _(S){return t.enter("lineEnding"),t.consume(S),t.exit("lineEnding"),b}function b(S){return a>0&&fe(S)?Ee(t,k,"linePrefix",a+1)(S):k(S)}function k(S){return S===null||te(S)?t.check(au,x,w)(S):(t.enter("codeFlowValue"),E(S))}function E(S){return S===null||te(S)?(t.exit("codeFlowValue"),k(S)):(t.consume(S),E)}function w(S){return t.exit("codeFenced"),e(S)}function R(S,O,F){let j=0;return N;function N(H){return S.enter("lineEnding"),S.consume(H),S.exit("lineEnding"),P}function P(H){return S.enter("codeFencedFence"),fe(H)?Ee(S,M,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):M(H)}function M(H){return H===u?(S.enter("codeFencedFenceSequence"),J(H)):F(H)}function J(H){return H===u?(j++,S.consume(H),J):j>=s?(S.exit("codeFencedFenceSequence"),fe(H)?Ee(S,z,"whitespace")(H):z(H)):F(H)}function z(H){return H===null||te(H)?(S.exit("codeFencedFence"),O(H)):F(H)}}}function Am(t,e,n){const r=this;return i;function i(s){return s===null?n(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),a)}function a(s){return r.parser.lazy[r.now().line]?n(s):e(s)}}const Oi={name:"codeIndented",tokenize:km},Cm={partial:!0,tokenize:Sm};function km(t,e,n){const r=this;return i;function i(l){return t.enter("codeIndented"),Ee(t,a,"linePrefix",5)(l)}function a(l){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?s(l):n(l)}function s(l){return l===null?o(l):te(l)?t.attempt(Cm,s,o)(l):(t.enter("codeFlowValue"),u(l))}function u(l){return l===null||te(l)?(t.exit("codeFlowValue"),s(l)):(t.consume(l),u)}function o(l){return t.exit("codeIndented"),e(l)}}function Sm(t,e,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):te(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),i):Ee(t,a,"linePrefix",5)(s)}function a(s){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?e(s):te(s)?i(s):n(s)}}const Im={name:"codeText",previous:wm,resolve:Nm,tokenize:Rm};function Nm(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)i===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(i=r):(r===e||t[r][1].type==="lineEnding")&&(t[i][1].type="codeTextData",r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),e-=r-i-2,r=i+2),i=void 0);return t}function wm(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Rm(t,e,n){let r=0,i,a;return s;function s(d){return t.enter("codeText"),t.enter("codeTextSequence"),u(d)}function u(d){return d===96?(t.consume(d),r++,u):(t.exit("codeTextSequence"),o(d))}function o(d){return d===null?n(d):d===32?(t.enter("space"),t.consume(d),t.exit("space"),o):d===96?(a=t.enter("codeTextSequence"),i=0,f(d)):te(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),o):(t.enter("codeTextData"),l(d))}function l(d){return d===null||d===32||d===96||te(d)?(t.exit("codeTextData"),o(d)):(t.consume(d),l)}function f(d){return d===96?(t.consume(d),i++,f):i===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(d)):(a.type="codeTextData",l(d))}}class Lm{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const i=n||0;this.setCursor(Math.trunc(e));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Fn(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Fn(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Fn(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);Fn(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Fn(this.left,n.reverse())}}}function Fn(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function Bl(t){const e={};let n=-1,r,i,a,s,u,o,l;const f=new Lm(t);for(;++n<f.length;){for(;n in e;)n=e[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(o=r[1]._tokenizer.events,a=0,a<o.length&&o[a][1].type==="lineEndingBlank"&&(a+=2),a<o.length&&o[a][1].type==="content"))for(;++a<o.length&&o[a][1].type!=="content";)o[a][1].type==="chunkText"&&(o[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,Om(f,n)),n=e[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(s=f.get(a),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=a);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},u=f.slice(i,n),u.unshift(r),f.splice(i,n-i+1,u))}}return tt(t,0,Number.POSITIVE_INFINITY,f.slice(0)),!l}function Om(t,e){const n=t.get(e)[1],r=t.get(e)[2];let i=e-1;const a=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const u=s.events,o=[],l={};let f,d,h=-1,p=n,g=0,x=0;const _=[x];for(;p;){for(;t.get(++i)[1]!==p;);a.push(i),p._tokenizer||(f=r.sliceStream(p),p.next||f.push(null),d&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(f),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++h<u.length;)u[h][0]==="exit"&&u[h-1][0]==="enter"&&u[h][1].type===u[h-1][1].type&&u[h][1].start.line!==u[h][1].end.line&&(x=h+1,_.push(x),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):_.pop(),h=_.length;h--;){const b=u.slice(_[h],_[h+1]),k=a.pop();o.push([k,k+b.length-1]),t.splice(k,2,b)}for(o.reverse(),h=-1;++h<o.length;)l[g+o[h][0]]=g+o[h][1],g+=o[h][1]-o[h][0]-1;return l}const vm={resolve:Pm,tokenize:Mm},Dm={partial:!0,tokenize:Bm};function Pm(t){return Bl(t),t}function Mm(t,e){let n;return r;function r(u){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),i(u)}function i(u){return u===null?a(u):te(u)?t.check(Dm,s,a)(u):(t.consume(u),i)}function a(u){return t.exit("chunkContent"),t.exit("content"),e(u)}function s(u){return t.consume(u),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Bm(t,e,n){const r=this;return i;function i(s){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),Ee(t,a,"linePrefix")}function a(s){if(s===null||te(s))return n(s);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?e(s):t.interrupt(r.parser.constructs.flow,n,e)(s)}}function Fl(t,e,n,r,i,a,s,u,o){const l=o||Number.POSITIVE_INFINITY;let f=0;return d;function d(b){return b===60?(t.enter(r),t.enter(i),t.enter(a),t.consume(b),t.exit(a),h):b===null||b===32||b===41||Wr(b)?n(b):(t.enter(r),t.enter(s),t.enter(u),t.enter("chunkString",{contentType:"string"}),x(b))}function h(b){return b===62?(t.enter(a),t.consume(b),t.exit(a),t.exit(i),t.exit(r),e):(t.enter(u),t.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===62?(t.exit("chunkString"),t.exit(u),h(b)):b===null||b===60||te(b)?n(b):(t.consume(b),b===92?g:p)}function g(b){return b===60||b===62||b===92?(t.consume(b),p):p(b)}function x(b){return!f&&(b===null||b===41||Se(b))?(t.exit("chunkString"),t.exit(u),t.exit(s),t.exit(r),e(b)):f<l&&b===40?(t.consume(b),f++,x):b===41?(t.consume(b),f--,x):b===null||b===32||b===40||Wr(b)?n(b):(t.consume(b),b===92?_:x)}function _(b){return b===40||b===41||b===92?(t.consume(b),x):x(b)}}function Hl(t,e,n,r,i,a){const s=this;let u=0,o;return l;function l(p){return t.enter(r),t.enter(i),t.consume(p),t.exit(i),t.enter(a),f}function f(p){return u>999||p===null||p===91||p===93&&!o||p===94&&!u&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(t.exit(a),t.enter(i),t.consume(p),t.exit(i),t.exit(r),e):te(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),f):(t.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||te(p)||u++>999?(t.exit("chunkString"),f(p)):(t.consume(p),o||(o=!fe(p)),p===92?h:d)}function h(p){return p===91||p===92||p===93?(t.consume(p),u++,d):d(p)}}function Ul(t,e,n,r,i,a){let s;return u;function u(h){return h===34||h===39||h===40?(t.enter(r),t.enter(i),t.consume(h),t.exit(i),s=h===40?41:h,o):n(h)}function o(h){return h===s?(t.enter(i),t.consume(h),t.exit(i),t.exit(r),e):(t.enter(a),l(h))}function l(h){return h===s?(t.exit(a),o(s)):h===null?n(h):te(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),Ee(t,l,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===s||h===null||te(h)?(t.exit("chunkString"),l(h)):(t.consume(h),h===92?d:f)}function d(h){return h===s||h===92?(t.consume(h),f):f(h)}}function Zn(t,e){let n;return r;function r(i){return te(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):fe(i)?Ee(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const Fm={name:"definition",tokenize:Um},Hm={partial:!0,tokenize:zm};function Um(t,e,n){const r=this;let i;return a;function a(p){return t.enter("definition"),s(p)}function s(p){return Hl.call(r,t,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function u(p){return i=lt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(t.enter("definitionMarker"),t.consume(p),t.exit("definitionMarker"),o):n(p)}function o(p){return Se(p)?Zn(t,l)(p):l(p)}function l(p){return Fl(t,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function f(p){return t.attempt(Hm,d,d)(p)}function d(p){return fe(p)?Ee(t,h,"whitespace")(p):h(p)}function h(p){return p===null||te(p)?(t.exit("definition"),r.parser.defined.push(i),e(p)):n(p)}}function zm(t,e,n){return r;function r(u){return Se(u)?Zn(t,i)(u):n(u)}function i(u){return Ul(t,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function a(u){return fe(u)?Ee(t,s,"whitespace")(u):s(u)}function s(u){return u===null||te(u)?e(u):n(u)}}const jm={name:"hardBreakEscape",tokenize:$m};function $m(t,e,n){return r;function r(a){return t.enter("hardBreakEscape"),t.consume(a),i}function i(a){return te(a)?(t.exit("hardBreakEscape"),e(a)):n(a)}}const Ym={name:"headingAtx",resolve:qm,tokenize:Vm};function qm(t,e){let n=t.length-2,r=3,i,a;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},a={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},tt(t,r,n-r+1,[["enter",i,e],["enter",a,e],["exit",a,e],["exit",i,e]])),t}function Vm(t,e,n){let r=0;return i;function i(f){return t.enter("atxHeading"),a(f)}function a(f){return t.enter("atxHeadingSequence"),s(f)}function s(f){return f===35&&r++<6?(t.consume(f),s):f===null||Se(f)?(t.exit("atxHeadingSequence"),u(f)):n(f)}function u(f){return f===35?(t.enter("atxHeadingSequence"),o(f)):f===null||te(f)?(t.exit("atxHeading"),e(f)):fe(f)?Ee(t,u,"whitespace")(f):(t.enter("atxHeadingText"),l(f))}function o(f){return f===35?(t.consume(f),o):(t.exit("atxHeadingSequence"),u(f))}function l(f){return f===null||f===35||Se(f)?(t.exit("atxHeadingText"),u(f)):(t.consume(f),l)}}const Wm=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],uu=["pre","script","style","textarea"],Gm={concrete:!0,name:"htmlFlow",resolveTo:Zm,tokenize:Km},Qm={partial:!0,tokenize:e1},Xm={partial:!0,tokenize:Jm};function Zm(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function Km(t,e,n){const r=this;let i,a,s,u,o;return l;function l(y){return f(y)}function f(y){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(y),d}function d(y){return y===33?(t.consume(y),h):y===47?(t.consume(y),a=!0,x):y===63?(t.consume(y),i=3,r.interrupt?e:I):Ye(y)?(t.consume(y),s=String.fromCharCode(y),_):n(y)}function h(y){return y===45?(t.consume(y),i=2,p):y===91?(t.consume(y),i=5,u=0,g):Ye(y)?(t.consume(y),i=4,r.interrupt?e:I):n(y)}function p(y){return y===45?(t.consume(y),r.interrupt?e:I):n(y)}function g(y){const V="CDATA[";return y===V.charCodeAt(u++)?(t.consume(y),u===V.length?r.interrupt?e:M:g):n(y)}function x(y){return Ye(y)?(t.consume(y),s=String.fromCharCode(y),_):n(y)}function _(y){if(y===null||y===47||y===62||Se(y)){const V=y===47,G=s.toLowerCase();return!V&&!a&&uu.includes(G)?(i=1,r.interrupt?e(y):M(y)):Wm.includes(s.toLowerCase())?(i=6,V?(t.consume(y),b):r.interrupt?e(y):M(y)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(y):a?k(y):E(y))}return y===45||He(y)?(t.consume(y),s+=String.fromCharCode(y),_):n(y)}function b(y){return y===62?(t.consume(y),r.interrupt?e:M):n(y)}function k(y){return fe(y)?(t.consume(y),k):N(y)}function E(y){return y===47?(t.consume(y),N):y===58||y===95||Ye(y)?(t.consume(y),w):fe(y)?(t.consume(y),E):N(y)}function w(y){return y===45||y===46||y===58||y===95||He(y)?(t.consume(y),w):R(y)}function R(y){return y===61?(t.consume(y),S):fe(y)?(t.consume(y),R):E(y)}function S(y){return y===null||y===60||y===61||y===62||y===96?n(y):y===34||y===39?(t.consume(y),o=y,O):fe(y)?(t.consume(y),S):F(y)}function O(y){return y===o?(t.consume(y),o=null,j):y===null||te(y)?n(y):(t.consume(y),O)}function F(y){return y===null||y===34||y===39||y===47||y===60||y===61||y===62||y===96||Se(y)?R(y):(t.consume(y),F)}function j(y){return y===47||y===62||fe(y)?E(y):n(y)}function N(y){return y===62?(t.consume(y),P):n(y)}function P(y){return y===null||te(y)?M(y):fe(y)?(t.consume(y),P):n(y)}function M(y){return y===45&&i===2?(t.consume(y),Z):y===60&&i===1?(t.consume(y),re):y===62&&i===4?(t.consume(y),me):y===63&&i===3?(t.consume(y),I):y===93&&i===5?(t.consume(y),Te):te(y)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(Qm,Ae,J)(y)):y===null||te(y)?(t.exit("htmlFlowData"),J(y)):(t.consume(y),M)}function J(y){return t.check(Xm,z,Ae)(y)}function z(y){return t.enter("lineEnding"),t.consume(y),t.exit("lineEnding"),H}function H(y){return y===null||te(y)?J(y):(t.enter("htmlFlowData"),M(y))}function Z(y){return y===45?(t.consume(y),I):M(y)}function re(y){return y===47?(t.consume(y),s="",le):M(y)}function le(y){if(y===62){const V=s.toLowerCase();return uu.includes(V)?(t.consume(y),me):M(y)}return Ye(y)&&s.length<8?(t.consume(y),s+=String.fromCharCode(y),le):M(y)}function Te(y){return y===93?(t.consume(y),I):M(y)}function I(y){return y===62?(t.consume(y),me):y===45&&i===2?(t.consume(y),I):M(y)}function me(y){return y===null||te(y)?(t.exit("htmlFlowData"),Ae(y)):(t.consume(y),me)}function Ae(y){return t.exit("htmlFlow"),e(y)}}function Jm(t,e,n){const r=this;return i;function i(s){return te(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),a):n(s)}function a(s){return r.parser.lazy[r.now().line]?n(s):e(s)}}function e1(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(xr,e,n)}}const t1={name:"htmlText",tokenize:n1};function n1(t,e,n){const r=this;let i,a,s;return u;function u(I){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(I),o}function o(I){return I===33?(t.consume(I),l):I===47?(t.consume(I),R):I===63?(t.consume(I),E):Ye(I)?(t.consume(I),F):n(I)}function l(I){return I===45?(t.consume(I),f):I===91?(t.consume(I),a=0,g):Ye(I)?(t.consume(I),k):n(I)}function f(I){return I===45?(t.consume(I),p):n(I)}function d(I){return I===null?n(I):I===45?(t.consume(I),h):te(I)?(s=d,re(I)):(t.consume(I),d)}function h(I){return I===45?(t.consume(I),p):d(I)}function p(I){return I===62?Z(I):I===45?h(I):d(I)}function g(I){const me="CDATA[";return I===me.charCodeAt(a++)?(t.consume(I),a===me.length?x:g):n(I)}function x(I){return I===null?n(I):I===93?(t.consume(I),_):te(I)?(s=x,re(I)):(t.consume(I),x)}function _(I){return I===93?(t.consume(I),b):x(I)}function b(I){return I===62?Z(I):I===93?(t.consume(I),b):x(I)}function k(I){return I===null||I===62?Z(I):te(I)?(s=k,re(I)):(t.consume(I),k)}function E(I){return I===null?n(I):I===63?(t.consume(I),w):te(I)?(s=E,re(I)):(t.consume(I),E)}function w(I){return I===62?Z(I):E(I)}function R(I){return Ye(I)?(t.consume(I),S):n(I)}function S(I){return I===45||He(I)?(t.consume(I),S):O(I)}function O(I){return te(I)?(s=O,re(I)):fe(I)?(t.consume(I),O):Z(I)}function F(I){return I===45||He(I)?(t.consume(I),F):I===47||I===62||Se(I)?j(I):n(I)}function j(I){return I===47?(t.consume(I),Z):I===58||I===95||Ye(I)?(t.consume(I),N):te(I)?(s=j,re(I)):fe(I)?(t.consume(I),j):Z(I)}function N(I){return I===45||I===46||I===58||I===95||He(I)?(t.consume(I),N):P(I)}function P(I){return I===61?(t.consume(I),M):te(I)?(s=P,re(I)):fe(I)?(t.consume(I),P):j(I)}function M(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(t.consume(I),i=I,J):te(I)?(s=M,re(I)):fe(I)?(t.consume(I),M):(t.consume(I),z)}function J(I){return I===i?(t.consume(I),i=void 0,H):I===null?n(I):te(I)?(s=J,re(I)):(t.consume(I),J)}function z(I){return I===null||I===34||I===39||I===60||I===61||I===96?n(I):I===47||I===62||Se(I)?j(I):(t.consume(I),z)}function H(I){return I===47||I===62||Se(I)?j(I):n(I)}function Z(I){return I===62?(t.consume(I),t.exit("htmlTextData"),t.exit("htmlText"),e):n(I)}function re(I){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(I),t.exit("lineEnding"),le}function le(I){return fe(I)?Ee(t,Te,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):Te(I)}function Te(I){return t.enter("htmlTextData"),s(I)}}const Qa={name:"labelEnd",resolveAll:s1,resolveTo:u1,tokenize:o1},r1={tokenize:l1},i1={tokenize:c1},a1={tokenize:d1};function s1(t){let e=-1;const n=[];for(;++e<t.length;){const r=t[e][1];if(n.push(t[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",e+=i}}return t.length!==n.length&&tt(t,0,t.length,n),t}function u1(t,e){let n=t.length,r=0,i,a,s,u;for(;n--;)if(i=t[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;t[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(t[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const o={type:t[a][1].type==="labelLink"?"link":"image",start:{...t[a][1].start},end:{...t[t.length-1][1].end}},l={type:"label",start:{...t[a][1].start},end:{...t[s][1].end}},f={type:"labelText",start:{...t[a+r+2][1].end},end:{...t[s-2][1].start}};return u=[["enter",o,e],["enter",l,e]],u=it(u,t.slice(a+1,a+r+3)),u=it(u,[["enter",f,e]]),u=it(u,ci(e.parser.constructs.insideSpan.null,t.slice(a+r+4,s-3),e)),u=it(u,[["exit",f,e],t[s-2],t[s-1],["exit",l,e]]),u=it(u,t.slice(s+1)),u=it(u,[["exit",o,e]]),tt(t,a,t.length,u),t}function o1(t,e,n){const r=this;let i=r.events.length,a,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return u;function u(h){return a?a._inactive?d(h):(s=r.parser.defined.includes(lt(r.sliceSerialize({start:a.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(h),t.exit("labelMarker"),t.exit("labelEnd"),o):n(h)}function o(h){return h===40?t.attempt(r1,f,s?f:d)(h):h===91?t.attempt(i1,f,s?l:d)(h):s?f(h):d(h)}function l(h){return t.attempt(a1,f,d)(h)}function f(h){return e(h)}function d(h){return a._balanced=!0,n(h)}}function l1(t,e,n){return r;function r(d){return t.enter("resource"),t.enter("resourceMarker"),t.consume(d),t.exit("resourceMarker"),i}function i(d){return Se(d)?Zn(t,a)(d):a(d)}function a(d){return d===41?f(d):Fl(t,s,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return Se(d)?Zn(t,o)(d):f(d)}function u(d){return n(d)}function o(d){return d===34||d===39||d===40?Ul(t,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):f(d)}function l(d){return Se(d)?Zn(t,f)(d):f(d)}function f(d){return d===41?(t.enter("resourceMarker"),t.consume(d),t.exit("resourceMarker"),t.exit("resource"),e):n(d)}}function c1(t,e,n){const r=this;return i;function i(u){return Hl.call(r,t,a,s,"reference","referenceMarker","referenceString")(u)}function a(u){return r.parser.defined.includes(lt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(u):n(u)}function s(u){return n(u)}}function d1(t,e,n){return r;function r(a){return t.enter("reference"),t.enter("referenceMarker"),t.consume(a),t.exit("referenceMarker"),i}function i(a){return a===93?(t.enter("referenceMarker"),t.consume(a),t.exit("referenceMarker"),t.exit("reference"),e):n(a)}}const f1={name:"labelStartImage",resolveAll:Qa.resolveAll,tokenize:h1};function h1(t,e,n){const r=this;return i;function i(u){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(u),t.exit("labelImageMarker"),a}function a(u){return u===91?(t.enter("labelMarker"),t.consume(u),t.exit("labelMarker"),t.exit("labelImage"),s):n(u)}function s(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):e(u)}}const p1={name:"labelStartLink",resolveAll:Qa.resolveAll,tokenize:m1};function m1(t,e,n){const r=this;return i;function i(s){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(s),t.exit("labelMarker"),t.exit("labelLink"),a}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):e(s)}}const vi={name:"lineEnding",tokenize:g1};function g1(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),Ee(t,e,"linePrefix")}}const Fr={name:"thematicBreak",tokenize:b1};function b1(t,e,n){let r=0,i;return a;function a(l){return t.enter("thematicBreak"),s(l)}function s(l){return i=l,u(l)}function u(l){return l===i?(t.enter("thematicBreakSequence"),o(l)):r>=3&&(l===null||te(l))?(t.exit("thematicBreak"),e(l)):n(l)}function o(l){return l===i?(t.consume(l),r++,o):(t.exit("thematicBreakSequence"),fe(l)?Ee(t,u,"whitespace")(l):u(l))}}const We={continuation:{tokenize:_1},exit:A1,name:"list",tokenize:x1},E1={partial:!0,tokenize:C1},T1={partial:!0,tokenize:y1};function x1(t,e,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return u;function u(p){const g=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:fa(p)){if(r.containerState.type||(r.containerState.type=g,t.enter(g,{_container:!0})),g==="listUnordered")return t.enter("listItemPrefix"),p===42||p===45?t.check(Fr,n,l)(p):l(p);if(!r.interrupt||p===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),o(p)}return n(p)}function o(p){return fa(p)&&++s<10?(t.consume(p),o):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(t.exit("listItemValue"),l(p)):n(p)}function l(p){return t.enter("listItemMarker"),t.consume(p),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,t.check(xr,r.interrupt?n:f,t.attempt(E1,h,d))}function f(p){return r.containerState.initialBlankLine=!0,a++,h(p)}function d(p){return fe(p)?(t.enter("listItemPrefixWhitespace"),t.consume(p),t.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=a+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(p)}}function _1(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(xr,i,a);function i(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ee(t,e,"listItemIndent",r.containerState.size+1)(u)}function a(u){return r.containerState.furtherBlankLines||!fe(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(T1,e,s)(u))}function s(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ee(t,t.attempt(We,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function y1(t,e,n){const r=this;return Ee(t,i,"listItemIndent",r.containerState.size+1);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?e(a):n(a)}}function A1(t){t.exit(this.containerState.type)}function C1(t,e,n){const r=this;return Ee(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const s=r.events[r.events.length-1];return!fe(a)&&s&&s[1].type==="listItemPrefixWhitespace"?e(a):n(a)}}const ou={name:"setextUnderline",resolveTo:k1,tokenize:S1};function k1(t,e){let n=t.length,r,i,a;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!a&&t[n][1].type==="definition"&&(a=n);const s={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",a?(t.splice(i,0,["enter",s,e]),t.splice(a+1,0,["exit",t[r][1],e]),t[r][1].end={...t[a][1].end}):t[r][1]=s,t.push(["exit",s,e]),t}function S1(t,e,n){const r=this;let i;return a;function a(l){let f=r.events.length,d;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){d=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(t.enter("setextHeadingLine"),i=l,s(l)):n(l)}function s(l){return t.enter("setextHeadingLineSequence"),u(l)}function u(l){return l===i?(t.consume(l),u):(t.exit("setextHeadingLineSequence"),fe(l)?Ee(t,o,"lineSuffix")(l):o(l))}function o(l){return l===null||te(l)?(t.exit("setextHeadingLine"),e(l)):n(l)}}const I1={tokenize:N1};function N1(t){const e=this,n=t.attempt(xr,r,t.attempt(this.parser.constructs.flowInitial,i,Ee(t,t.attempt(this.parser.constructs.flow,i,t.attempt(vm,i)),"linePrefix")));return n;function r(a){if(a===null){t.consume(a);return}return t.enter("lineEndingBlank"),t.consume(a),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(a){if(a===null){t.consume(a);return}return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const w1={resolveAll:jl()},R1=zl("string"),L1=zl("text");function zl(t){return{resolveAll:jl(t==="text"?O1:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],a=n.attempt(i,s,u);return s;function s(f){return l(f)?a(f):u(f)}function u(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),o}function o(f){return l(f)?(n.exit("data"),a(f)):(n.consume(f),o)}function l(f){if(f===null)return!0;const d=i[f];let h=-1;if(d)for(;++h<d.length;){const p=d[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function jl(t){return e;function e(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return t?t(n,r):n}}function O1(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const r=t[n-1][1],i=e.sliceStream(r);let a=i.length,s=-1,u=0,o;for(;a--;){const l=i[a];if(typeof l=="string"){for(s=l.length;l.charCodeAt(s-1)===32;)u++,s--;if(s)break;s=-1}else if(l===-2)o=!0,u++;else if(l!==-1){a++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(u=0),u){const l={type:n===t.length||o||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?s:r.start._bufferIndex+s,_index:r.start._index+a,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...l.start},r.start.offset===r.end.offset?Object.assign(r,l):(t.splice(n,0,["enter",l,e],["exit",l,e]),n+=2)}n++}return t}const v1={42:We,43:We,45:We,48:We,49:We,50:We,51:We,52:We,53:We,54:We,55:We,56:We,57:We,62:Dl},D1={91:Fm},P1={[-2]:Oi,[-1]:Oi,32:Oi},M1={35:Ym,42:Fr,45:[ou,Fr],60:Gm,61:ou,95:Fr,96:su,126:su},B1={38:Ml,92:Pl},F1={[-5]:vi,[-4]:vi,[-3]:vi,33:f1,38:Ml,42:ha,60:[pm,t1],91:p1,92:[jm,Pl],93:Qa,95:ha,96:Im},H1={null:[ha,w1]},U1={null:[42,95]},z1={null:[]},j1=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:U1,contentInitial:D1,disable:z1,document:v1,flow:M1,flowInitial:P1,insideSpan:H1,string:B1,text:F1},Symbol.toStringTag,{value:"Module"}));function $1(t,e,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},a=[];let s=[],u=[];const o={attempt:O(R),check:O(S),consume:k,enter:E,exit:w,interrupt:O(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:x,events:[],now:g,parser:t,previous:null,sliceSerialize:h,sliceStream:p,write:d};let f=e.tokenize.call(l,o);return e.resolveAll&&a.push(e),l;function d(P){return s=it(s,P),_(),s[s.length-1]!==null?[]:(F(e,0),l.events=ci(a,l.events,l),l.events)}function h(P,M){return q1(p(P),M)}function p(P){return Y1(s,P)}function g(){const{_bufferIndex:P,_index:M,line:J,column:z,offset:H}=r;return{_bufferIndex:P,_index:M,line:J,column:z,offset:H}}function x(P){i[P.line]=P.column,N()}function _(){let P;for(;r._index<s.length;){const M=s[r._index];if(typeof M=="string")for(P=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===P&&r._bufferIndex<M.length;)b(M.charCodeAt(r._bufferIndex));else b(M)}}function b(P){f=f(P)}function k(P){te(P)?(r.line++,r.column=1,r.offset+=P===-3?2:1,N()):P!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=P}function E(P,M){const J=M||{};return J.type=P,J.start=g(),l.events.push(["enter",J,l]),u.push(J),J}function w(P){const M=u.pop();return M.end=g(),l.events.push(["exit",M,l]),M}function R(P,M){F(P,M.from)}function S(P,M){M.restore()}function O(P,M){return J;function J(z,H,Z){let re,le,Te,I;return Array.isArray(z)?Ae(z):"tokenize"in z?Ae([z]):me(z);function me(Q){return X;function X(ee){const se=ee!==null&&Q[ee],ge=ee!==null&&Q.null,Le=[...Array.isArray(se)?se:se?[se]:[],...Array.isArray(ge)?ge:ge?[ge]:[]];return Ae(Le)(ee)}}function Ae(Q){return re=Q,le=0,Q.length===0?Z:y(Q[le])}function y(Q){return X;function X(ee){return I=j(),Te=Q,Q.partial||(l.currentConstruct=Q),Q.name&&l.parser.constructs.disable.null.includes(Q.name)?G():Q.tokenize.call(M?Object.assign(Object.create(l),M):l,o,V,G)(ee)}}function V(Q){return P(Te,I),H}function G(Q){return I.restore(),++le<re.length?y(re[le]):Z}}}function F(P,M){P.resolveAll&&!a.includes(P)&&a.push(P),P.resolve&&tt(l.events,M,l.events.length-M,P.resolve(l.events.slice(M),l)),P.resolveTo&&(l.events=P.resolveTo(l.events,l))}function j(){const P=g(),M=l.previous,J=l.currentConstruct,z=l.events.length,H=Array.from(u);return{from:z,restore:Z};function Z(){r=P,l.previous=M,l.currentConstruct=J,l.events.length=z,u=H,N()}}function N(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Y1(t,e){const n=e.start._index,r=e.start._bufferIndex,i=e.end._index,a=e.end._bufferIndex;let s;if(n===i)s=[t[n].slice(r,a)];else{if(s=t.slice(n,i),r>-1){const u=s[0];typeof u=="string"?s[0]=u.slice(r):s.shift()}a>0&&s.push(t[i].slice(0,a))}return s}function q1(t,e){let n=-1;const r=[];let i;for(;++n<t.length;){const a=t[n];let s;if(typeof a=="string")s=a;else switch(a){case-5:{s="\r";break}case-4:{s=`
69
+ `;break}case-3:{s=`\r
70
+ `;break}case-2:{s=e?" ":" ";break}case-1:{if(!e&&i)continue;s=" ";break}default:s=String.fromCharCode(a)}i=a===-2,r.push(s)}return r.join("")}function V1(t){const r={constructs:Ol([j1,...(t||{}).extensions||[]]),content:i(um),defined:[],document:i(lm),flow:i(I1),lazy:{},string:i(R1),text:i(L1)};return r;function i(a){return s;function s(u){return $1(r,a,u)}}}function W1(t){for(;!Bl(t););return t}const lu=/[\0\t\n\r]/g;function G1(){let t=1,e="",n=!0,r;return i;function i(a,s,u){const o=[];let l,f,d,h,p;for(a=e+(typeof a=="string"?a.toString():new TextDecoder(s||void 0).decode(a)),d=0,e="",n&&(a.charCodeAt(0)===65279&&d++,n=void 0);d<a.length;){if(lu.lastIndex=d,l=lu.exec(a),h=l&&l.index!==void 0?l.index:a.length,p=a.charCodeAt(h),!l){e=a.slice(d);break}if(p===10&&d===h&&r)o.push(-3),r=void 0;else switch(r&&(o.push(-5),r=void 0),d<h&&(o.push(a.slice(d,h)),t+=h-d),p){case 0:{o.push(65533),t++;break}case 9:{for(f=Math.ceil(t/4)*4,o.push(-2);t++<f;)o.push(-1);break}case 10:{o.push(-4),t=1;break}default:r=!0,t=1}d=h+1}return u&&(r&&o.push(-5),e&&o.push(e),o.push(null)),o}}const Q1=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function X1(t){return t.replace(Q1,Z1)}function Z1(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return vl(n.slice(a?2:1),a?16:10)}return Ga(n)||t}const $l={}.hasOwnProperty;function K1(t,e,n){return typeof e!="string"&&(n=e,e=void 0),J1(n)(W1(V1(n).document().write(G1()(t,e,!0))))}function J1(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Ln),autolinkProtocol:j,autolinkEmail:j,atxHeading:a(kt),blockQuote:a(ge),characterEscape:j,characterReference:j,codeFenced:a(Le),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:a(Le,s),codeText:a(Be,s),codeTextData:j,data:j,codeFlowValue:j,definition:a(he),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:a(Ze),hardBreakEscape:a(Ut),hardBreakTrailing:a(Ut),htmlFlow:a(on,s),htmlFlowData:j,htmlText:a(on,s),htmlTextData:j,image:a(Fe),label:s,link:a(Ln),listItem:a(zt),listItemValue:h,listOrdered:a(Cr,d),listUnordered:a(Cr),paragraph:a(kr),reference:y,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:a(kt),strong:a(Ai),thematicBreak:a(Hd)},exit:{atxHeading:o(),atxHeadingSequence:R,autolink:o(),autolinkEmail:se,autolinkProtocol:ee,blockQuote:o(),characterEscapeValue:N,characterReferenceMarkerHexadecimal:G,characterReferenceMarkerNumeric:G,characterReferenceValue:Q,characterReference:X,codeFenced:o(_),codeFencedFence:x,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:N,codeIndented:o(b),codeText:o(H),codeTextData:N,data:N,definition:o(),definitionDestinationString:w,definitionLabelString:k,definitionTitleString:E,emphasis:o(),hardBreakEscape:o(M),hardBreakTrailing:o(M),htmlFlow:o(J),htmlFlowData:N,htmlText:o(z),htmlTextData:N,image:o(re),label:Te,labelText:le,lineEnding:P,link:o(Z),listItem:o(),listOrdered:o(),listUnordered:o(),paragraph:o(),referenceString:V,resourceDestinationString:I,resourceTitleString:me,resource:Ae,setextHeading:o(F),setextHeadingLineSequence:O,setextHeadingText:S,strong:o(),thematicBreak:o()}};Yl(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(B){let q={type:"root",children:[]};const ie={stack:[q],tokenStack:[],config:e,enter:u,exit:l,buffer:s,resume:f,data:n},pe=[];let Ce=-1;for(;++Ce<B.length;)if(B[Ce][1].type==="listOrdered"||B[Ce][1].type==="listUnordered")if(B[Ce][0]==="enter")pe.push(Ce);else{const st=pe.pop();Ce=i(B,st,Ce)}for(Ce=-1;++Ce<B.length;){const st=e[B[Ce][0]];$l.call(st,B[Ce][1].type)&&st[B[Ce][1].type].call(Object.assign({sliceSerialize:B[Ce][2].sliceSerialize},ie),B[Ce][1])}if(ie.tokenStack.length>0){const st=ie.tokenStack[ie.tokenStack.length-1];(st[1]||cu).call(ie,void 0,st[0])}for(q.position={start:St(B.length>0?B[0][1].start:{line:1,column:1,offset:0}),end:St(B.length>0?B[B.length-2][1].end:{line:1,column:1,offset:0})},Ce=-1;++Ce<e.transforms.length;)q=e.transforms[Ce](q)||q;return q}function i(B,q,ie){let pe=q-1,Ce=-1,st=!1,jt,Et,On,vn;for(;++pe<=ie;){const Ke=B[pe];switch(Ke[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ke[0]==="enter"?Ce++:Ce--,vn=void 0;break}case"lineEndingBlank":{Ke[0]==="enter"&&(jt&&!vn&&!Ce&&!On&&(On=pe),vn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:vn=void 0}if(!Ce&&Ke[0]==="enter"&&Ke[1].type==="listItemPrefix"||Ce===-1&&Ke[0]==="exit"&&(Ke[1].type==="listUnordered"||Ke[1].type==="listOrdered")){if(jt){let ln=pe;for(Et=void 0;ln--;){const Tt=B[ln];if(Tt[1].type==="lineEnding"||Tt[1].type==="lineEndingBlank"){if(Tt[0]==="exit")continue;Et&&(B[Et][1].type="lineEndingBlank",st=!0),Tt[1].type="lineEnding",Et=ln}else if(!(Tt[1].type==="linePrefix"||Tt[1].type==="blockQuotePrefix"||Tt[1].type==="blockQuotePrefixWhitespace"||Tt[1].type==="blockQuoteMarker"||Tt[1].type==="listItemIndent"))break}On&&(!Et||On<Et)&&(jt._spread=!0),jt.end=Object.assign({},Et?B[Et][1].start:Ke[1].end),B.splice(Et||pe,0,["exit",jt,Ke[2]]),pe++,ie++}if(Ke[1].type==="listItemPrefix"){const ln={type:"listItem",_spread:!1,start:Object.assign({},Ke[1].start),end:void 0};jt=ln,B.splice(pe,0,["enter",ln,Ke[2]]),pe++,ie++,On=void 0,vn=!0}}}return B[q][1]._spread=st,ie}function a(B,q){return ie;function ie(pe){u.call(this,B(pe),pe),q&&q.call(this,pe)}}function s(){this.stack.push({type:"fragment",children:[]})}function u(B,q,ie){this.stack[this.stack.length-1].children.push(B),this.stack.push(B),this.tokenStack.push([q,ie||void 0]),B.position={start:St(q.start),end:void 0}}function o(B){return q;function q(ie){B&&B.call(this,ie),l.call(this,ie)}}function l(B,q){const ie=this.stack.pop(),pe=this.tokenStack.pop();if(pe)pe[0].type!==B.type&&(q?q.call(this,B,pe[0]):(pe[1]||cu).call(this,B,pe[0]));else throw new Error("Cannot close `"+B.type+"` ("+Xn({start:B.start,end:B.end})+"): it’s not open");ie.position.end=St(B.end)}function f(){return Wa(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(B){if(this.data.expectingFirstListItemValue){const q=this.stack[this.stack.length-2];q.start=Number.parseInt(this.sliceSerialize(B),10),this.data.expectingFirstListItemValue=void 0}}function p(){const B=this.resume(),q=this.stack[this.stack.length-1];q.lang=B}function g(){const B=this.resume(),q=this.stack[this.stack.length-1];q.meta=B}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){const B=this.resume(),q=this.stack[this.stack.length-1];q.value=B.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){const B=this.resume(),q=this.stack[this.stack.length-1];q.value=B.replace(/(\r?\n|\r)$/g,"")}function k(B){const q=this.resume(),ie=this.stack[this.stack.length-1];ie.label=q,ie.identifier=lt(this.sliceSerialize(B)).toLowerCase()}function E(){const B=this.resume(),q=this.stack[this.stack.length-1];q.title=B}function w(){const B=this.resume(),q=this.stack[this.stack.length-1];q.url=B}function R(B){const q=this.stack[this.stack.length-1];if(!q.depth){const ie=this.sliceSerialize(B).length;q.depth=ie}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function O(B){const q=this.stack[this.stack.length-1];q.depth=this.sliceSerialize(B).codePointAt(0)===61?1:2}function F(){this.data.setextHeadingSlurpLineEnding=void 0}function j(B){const ie=this.stack[this.stack.length-1].children;let pe=ie[ie.length-1];(!pe||pe.type!=="text")&&(pe=Fd(),pe.position={start:St(B.start),end:void 0},ie.push(pe)),this.stack.push(pe)}function N(B){const q=this.stack.pop();q.value+=this.sliceSerialize(B),q.position.end=St(B.end)}function P(B){const q=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ie=q.children[q.children.length-1];ie.position.end=St(B.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(q.type)&&(j.call(this,B),N.call(this,B))}function M(){this.data.atHardBreak=!0}function J(){const B=this.resume(),q=this.stack[this.stack.length-1];q.value=B}function z(){const B=this.resume(),q=this.stack[this.stack.length-1];q.value=B}function H(){const B=this.resume(),q=this.stack[this.stack.length-1];q.value=B}function Z(){const B=this.stack[this.stack.length-1];if(this.data.inReference){const q=this.data.referenceType||"shortcut";B.type+="Reference",B.referenceType=q,delete B.url,delete B.title}else delete B.identifier,delete B.label;this.data.referenceType=void 0}function re(){const B=this.stack[this.stack.length-1];if(this.data.inReference){const q=this.data.referenceType||"shortcut";B.type+="Reference",B.referenceType=q,delete B.url,delete B.title}else delete B.identifier,delete B.label;this.data.referenceType=void 0}function le(B){const q=this.sliceSerialize(B),ie=this.stack[this.stack.length-2];ie.label=X1(q),ie.identifier=lt(q).toLowerCase()}function Te(){const B=this.stack[this.stack.length-1],q=this.resume(),ie=this.stack[this.stack.length-1];if(this.data.inReference=!0,ie.type==="link"){const pe=B.children;ie.children=pe}else ie.alt=q}function I(){const B=this.resume(),q=this.stack[this.stack.length-1];q.url=B}function me(){const B=this.resume(),q=this.stack[this.stack.length-1];q.title=B}function Ae(){this.data.inReference=void 0}function y(){this.data.referenceType="collapsed"}function V(B){const q=this.resume(),ie=this.stack[this.stack.length-1];ie.label=q,ie.identifier=lt(this.sliceSerialize(B)).toLowerCase(),this.data.referenceType="full"}function G(B){this.data.characterReferenceType=B.type}function Q(B){const q=this.sliceSerialize(B),ie=this.data.characterReferenceType;let pe;ie?(pe=vl(q,ie==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):pe=Ga(q);const Ce=this.stack[this.stack.length-1];Ce.value+=pe}function X(B){const q=this.stack.pop();q.position.end=St(B.end)}function ee(B){N.call(this,B);const q=this.stack[this.stack.length-1];q.url=this.sliceSerialize(B)}function se(B){N.call(this,B);const q=this.stack[this.stack.length-1];q.url="mailto:"+this.sliceSerialize(B)}function ge(){return{type:"blockquote",children:[]}}function Le(){return{type:"code",lang:null,meta:null,value:""}}function Be(){return{type:"inlineCode",value:""}}function he(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ze(){return{type:"emphasis",children:[]}}function kt(){return{type:"heading",depth:0,children:[]}}function Ut(){return{type:"break"}}function on(){return{type:"html",value:""}}function Fe(){return{type:"image",title:null,url:"",alt:null}}function Ln(){return{type:"link",title:null,url:"",children:[]}}function Cr(B){return{type:"list",ordered:B.type==="listOrdered",start:null,spread:B._spread,children:[]}}function zt(B){return{type:"listItem",spread:B._spread,checked:null,children:[]}}function kr(){return{type:"paragraph",children:[]}}function Ai(){return{type:"strong",children:[]}}function Fd(){return{type:"text",value:""}}function Hd(){return{type:"thematicBreak"}}}function St(t){return{line:t.line,column:t.column,offset:t.offset}}function Yl(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?Yl(t,r):eg(t,r)}}function eg(t,e){let n;for(n in e)if($l.call(e,n))switch(n){case"canContainEols":{const r=e[n];r&&t[n].push(...r);break}case"transforms":{const r=e[n];r&&t[n].push(...r);break}case"enter":case"exit":{const r=e[n];r&&Object.assign(t[n],r);break}}}function cu(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+Xn({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+Xn({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+Xn({start:e.start,end:e.end})+") is still open")}function tg(t){const e=this;e.parser=n;function n(r){return K1(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function ng(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function rg(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
71
+ `}]}function ig(t,e){const n=e.value?e.value+`
72
+ `:"",r={},i=e.lang?e.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return e.meta&&(a.data={meta:e.meta}),t.patch(e,a),a=t.applyData(e,a),a={type:"element",tagName:"pre",properties:{},children:[a]},t.patch(e,a),a}function ag(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function sg(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function ug(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=String(e.identifier).toUpperCase(),i=In(r.toLowerCase()),a=t.footnoteOrder.indexOf(r);let s,u=t.footnoteCounts.get(r);u===void 0?(u=0,t.footnoteOrder.push(r),s=t.footnoteOrder.length):s=a+1,u+=1,t.footnoteCounts.set(r,u);const o={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};t.patch(e,o);const l={type:"element",tagName:"sup",properties:{},children:[o]};return t.patch(e,l),t.applyData(e,l)}function og(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function lg(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function ql(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const i=t.all(e),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function cg(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return ql(t,e);const i={src:In(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,a),t.applyData(e,a)}function dg(t,e){const n={src:In(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function fg(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function hg(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return ql(t,e);const i={href:In(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,a),t.applyData(e,a)}function pg(t,e){const n={href:In(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function mg(t,e,n){const r=t.all(e),i=n?gg(n):Vl(e),a={},s=[];if(typeof e.checked=="boolean"){const f=r[0];let d;f&&f.type==="element"&&f.tagName==="p"?d=f:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const f=r[u];(i||u!==0||f.type!=="element"||f.tagName!=="p")&&s.push({type:"text",value:`
73
+ `}),f.type==="element"&&f.tagName==="p"&&!i?s.push(...f.children):s.push(f)}const o=r[r.length-1];o&&(i||o.type!=="element"||o.tagName!=="p")&&s.push({type:"text",value:`
74
+ `});const l={type:"element",tagName:"li",properties:a,children:s};return t.patch(e,l),t.applyData(e,l)}function gg(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r<n.length;)e=Vl(n[r])}return e}function Vl(t){const e=t.spread;return e??t.children.length>1}function bg(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(r,!0)};return t.patch(e,a),t.applyData(e,a)}function Eg(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Tg(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function xg(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function _g(t,e){const n=t.all(e),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},u=gt(e.children[1]),o=oi(e.children[e.children.length-1]);u&&o&&(s.position={start:u,end:o}),i.push(s)}const a={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,a),t.applyData(e,a)}function yg(t,e,n){const r=n?n.children:void 0,a=(r?r.indexOf(e):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,u=s?s.length:e.children.length;let o=-1;const l=[];for(;++o<u;){const d=e.children[o],h={},p=s?s[o]:void 0;p&&(h.align=p);let g={type:"element",tagName:a,properties:h,children:[]};d&&(g.children=t.all(d),t.patch(d,g),g=t.applyData(d,g)),l.push(g)}const f={type:"element",tagName:"tr",properties:{},children:t.wrap(l,!0)};return t.patch(e,f),t.applyData(e,f)}function Ag(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const du=9,fu=32;function Cg(t){const e=String(t),n=/\r?\n|\r/g;let r=n.exec(e),i=0;const a=[];for(;r;)a.push(hu(e.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return a.push(hu(e.slice(i),i>0,!1)),a.join("")}function hu(t,e,n){let r=0,i=t.length;if(e){let a=t.codePointAt(r);for(;a===du||a===fu;)r++,a=t.codePointAt(r)}if(n){let a=t.codePointAt(i-1);for(;a===du||a===fu;)i--,a=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function kg(t,e){const n={type:"text",value:Cg(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function Sg(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const Ig={blockquote:ng,break:rg,code:ig,delete:ag,emphasis:sg,footnoteReference:ug,heading:og,html:lg,imageReference:cg,image:dg,inlineCode:fg,linkReference:hg,link:pg,listItem:mg,list:bg,paragraph:Eg,root:Tg,strong:xg,table:_g,tableCell:Ag,tableRow:yg,text:kg,thematicBreak:Sg,toml:Ir,yaml:Ir,definition:Ir,footnoteDefinition:Ir};function Ir(){}const Wl=-1,di=0,Kn=1,Gr=2,Xa=3,Za=4,Ka=5,Ja=6,Gl=7,Ql=8,pu=typeof self=="object"?self:globalThis,Ng=(t,e)=>{const n=(i,a)=>(t.set(a,i),i),r=i=>{if(t.has(i))return t.get(i);const[a,s]=e[i];switch(a){case di:case Wl:return n(s,i);case Kn:{const u=n([],i);for(const o of s)u.push(r(o));return u}case Gr:{const u=n({},i);for(const[o,l]of s)u[r(o)]=r(l);return u}case Xa:return n(new Date(s),i);case Za:{const{source:u,flags:o}=s;return n(new RegExp(u,o),i)}case Ka:{const u=n(new Map,i);for(const[o,l]of s)u.set(r(o),r(l));return u}case Ja:{const u=n(new Set,i);for(const o of s)u.add(r(o));return u}case Gl:{const{name:u,message:o}=s;return n(new pu[u](o),i)}case Ql:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:u}=new Uint8Array(s);return n(new DataView(u),s)}}return n(new pu[a](s),i)};return r},mu=t=>Ng(new Map,t)(0),dn="",{toString:wg}={},{keys:Rg}=Object,Hn=t=>{const e=typeof t;if(e!=="object"||!t)return[di,e];const n=wg.call(t).slice(8,-1);switch(n){case"Array":return[Kn,dn];case"Object":return[Gr,dn];case"Date":return[Xa,dn];case"RegExp":return[Za,dn];case"Map":return[Ka,dn];case"Set":return[Ja,dn];case"DataView":return[Kn,n]}return n.includes("Array")?[Kn,n]:n.includes("Error")?[Gl,n]:[Gr,n]},Nr=([t,e])=>t===di&&(e==="function"||e==="symbol"),Lg=(t,e,n,r)=>{const i=(s,u)=>{const o=r.push(s)-1;return n.set(u,o),o},a=s=>{if(n.has(s))return n.get(s);let[u,o]=Hn(s);switch(u){case di:{let f=s;switch(o){case"bigint":u=Ql,f=s.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+o);f=null;break;case"undefined":return i([Wl],s)}return i([u,f],s)}case Kn:{if(o){let h=s;return o==="DataView"?h=new Uint8Array(s.buffer):o==="ArrayBuffer"&&(h=new Uint8Array(s)),i([o,[...h]],s)}const f=[],d=i([u,f],s);for(const h of s)f.push(a(h));return d}case Gr:{if(o)switch(o){case"BigInt":return i([o,s.toString()],s);case"Boolean":case"Number":case"String":return i([o,s.valueOf()],s)}if(e&&"toJSON"in s)return a(s.toJSON());const f=[],d=i([u,f],s);for(const h of Rg(s))(t||!Nr(Hn(s[h])))&&f.push([a(h),a(s[h])]);return d}case Xa:return i([u,s.toISOString()],s);case Za:{const{source:f,flags:d}=s;return i([u,{source:f,flags:d}],s)}case Ka:{const f=[],d=i([u,f],s);for(const[h,p]of s)(t||!(Nr(Hn(h))||Nr(Hn(p))))&&f.push([a(h),a(p)]);return d}case Ja:{const f=[],d=i([u,f],s);for(const h of s)(t||!Nr(Hn(h)))&&f.push(a(h));return d}}const{message:l}=s;return i([u,{name:o,message:l}],s)};return a},gu=(t,{json:e,lossy:n}={})=>{const r=[];return Lg(!(e||n),!!e,new Map,r)(t),r},An=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?mu(gu(t,e)):structuredClone(t):(t,e)=>mu(gu(t,e));function Og(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function vg(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function Dg(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||Og,r=t.options.footnoteBackLabel||vg,i=t.options.footnoteLabel||"Footnotes",a=t.options.footnoteLabelTagName||"h2",s=t.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let o=-1;for(;++o<t.footnoteOrder.length;){const l=t.footnoteById.get(t.footnoteOrder[o]);if(!l)continue;const f=t.all(l),d=String(l.identifier).toUpperCase(),h=In(d.toLowerCase());let p=0;const g=[],x=t.footnoteCounts.get(d);for(;x!==void 0&&++p<=x;){g.length>0&&g.push({type:"text",value:" "});let k=typeof n=="string"?n:n(o,p);typeof k=="string"&&(k={type:"text",value:k}),g.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(o,p),className:["data-footnote-backref"]},children:Array.isArray(k)?k:[k]})}const _=f[f.length-1];if(_&&_.type==="element"&&_.tagName==="p"){const k=_.children[_.children.length-1];k&&k.type==="text"?k.value+=" ":_.children.push({type:"text",value:" "}),_.children.push(...g)}else f.push(...g);const b={type:"element",tagName:"li",properties:{id:e+"fn-"+h},children:t.wrap(f,!0)};t.patch(l,b),u.push(b)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...An(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
75
+ `},{type:"element",tagName:"ol",properties:{},children:t.wrap(u,!0)},{type:"text",value:`
76
+ `}]}}const fi=(function(t){if(t==null)return Fg;if(typeof t=="function")return hi(t);if(typeof t=="object")return Array.isArray(t)?Pg(t):Mg(t);if(typeof t=="string")return Bg(t);throw new Error("Expected function, string, or object as test")});function Pg(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=fi(t[n]);return hi(r);function r(...i){let a=-1;for(;++a<e.length;)if(e[a].apply(this,i))return!0;return!1}}function Mg(t){const e=t;return hi(n);function n(r){const i=r;let a;for(a in t)if(i[a]!==e[a])return!1;return!0}}function Bg(t){return hi(e);function e(n){return n&&n.type===t}}function hi(t){return e;function e(n,r,i){return!!(Hg(n)&&t.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Fg(){return!0}function Hg(t){return t!==null&&typeof t=="object"&&"type"in t}const Xl=[],Ug=!0,pa=!1,zg="skip";function Zl(t,e,n,r){let i;typeof e=="function"&&typeof n!="function"?(r=n,n=e):i=e;const a=fi(i),s=r?-1:1;u(t,void 0,[])();function u(o,l,f){const d=o&&typeof o=="object"?o:{};if(typeof d.type=="string"){const p=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(o.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=Xl,g,x,_;if((!e||a(o,l,f[f.length-1]||void 0))&&(p=jg(n(o,f)),p[0]===pa))return p;if("children"in o&&o.children){const b=o;if(b.children&&p[0]!==zg)for(x=(r?b.children.length:-1)+s,_=f.concat(b);x>-1&&x<b.children.length;){const k=b.children[x];if(g=u(k,x,_)(),g[0]===pa)return g;x=typeof g[1]=="number"?g[1]:x+s}}return p}}}function jg(t){return Array.isArray(t)?t:typeof t=="number"?[Ug,t]:t==null?Xl:[t]}function pi(t,e,n,r){let i,a,s;typeof e=="function"&&typeof n!="function"?(a=void 0,s=e,i=n):(a=e,s=n,i=r),Zl(t,a,u,i);function u(o,l){const f=l[l.length-1],d=f?f.children.indexOf(o):void 0;return s(o,d,f)}}const ma={}.hasOwnProperty,$g={};function Yg(t,e){const n=e||$g,r=new Map,i=new Map,a=new Map,s={...Ig,...n.handlers},u={all:l,applyData:Vg,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:s,one:o,options:n,patch:qg,wrap:Gg};return pi(t,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const d=f.type==="definition"?r:i,h=String(f.identifier).toUpperCase();d.has(h)||d.set(h,f)}}),u;function o(f,d){const h=f.type,p=u.handlers[h];if(ma.call(u.handlers,h)&&p)return p(u,f,d);if(u.options.passThrough&&u.options.passThrough.includes(h)){if("children"in f){const{children:x,..._}=f,b=An(_);return b.children=u.all(f),b}return An(f)}return(u.options.unknownHandler||Wg)(u,f,d)}function l(f){const d=[];if("children"in f){const h=f.children;let p=-1;for(;++p<h.length;){const g=u.one(h[p],f);if(g){if(p&&h[p-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=bu(g.value)),!Array.isArray(g)&&g.type==="element")){const x=g.children[0];x&&x.type==="text"&&(x.value=bu(x.value))}Array.isArray(g)?d.push(...g):d.push(g)}}}return d}}function qg(t,e){t.position&&(e.position=vp(t))}function Vg(t,e){let n=e;if(t&&t.data){const r=t.data.hName,i=t.data.hChildren,a=t.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&a&&Object.assign(n.properties,An(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Wg(t,e){const n=e.data||{},r="value"in e&&!(ma.call(n,"hProperties")||ma.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function Gg(t,e){const n=[];let r=-1;for(e&&n.push({type:"text",value:`
77
+ `});++r<t.length;)r&&n.push({type:"text",value:`
78
+ `}),n.push(t[r]);return e&&t.length>0&&n.push({type:"text",value:`
79
+ `}),n}function bu(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function Eu(t,e){const n=Yg(t,e),r=n.one(t,void 0),i=Dg(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
80
+ `},i),a}function Qg(t,e){return t&&"run"in t?async function(n,r){const i=Eu(n,{file:r,...e});await t.run(i,r)}:function(n,r){return Eu(n,{file:r,...t||e})}}function Tu(t){if(t)throw t}var Di,xu;function Xg(){if(xu)return Di;xu=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(l){return typeof Array.isArray=="function"?Array.isArray(l):e.call(l)==="[object Array]"},a=function(l){if(!l||e.call(l)!=="[object Object]")return!1;var f=t.call(l,"constructor"),d=l.constructor&&l.constructor.prototype&&t.call(l.constructor.prototype,"isPrototypeOf");if(l.constructor&&!f&&!d)return!1;var h;for(h in l);return typeof h>"u"||t.call(l,h)},s=function(l,f){n&&f.name==="__proto__"?n(l,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):l[f.name]=f.newValue},u=function(l,f){if(f==="__proto__")if(t.call(l,f)){if(r)return r(l,f).value}else return;return l[f]};return Di=function o(){var l,f,d,h,p,g,x=arguments[0],_=1,b=arguments.length,k=!1;for(typeof x=="boolean"&&(k=x,x=arguments[1]||{},_=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});_<b;++_)if(l=arguments[_],l!=null)for(f in l)d=u(x,f),h=u(l,f),x!==h&&(k&&h&&(a(h)||(p=i(h)))?(p?(p=!1,g=d&&i(d)?d:[]):g=d&&a(d)?d:{},s(x,{name:f,newValue:o(k,g,h)})):typeof h<"u"&&s(x,{name:f,newValue:h}));return x},Di}var Zg=Xg();const Pi=Sa(Zg);function ga(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function Kg(){const t=[],e={run:n,use:r};return e;function n(...i){let a=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);u(null,...i);function u(o,...l){const f=t[++a];let d=-1;if(o){s(o);return}for(;++d<i.length;)(l[d]===null||l[d]===void 0)&&(l[d]=i[d]);i=l,f?Jg(f,u)(...l):s(null,...l)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return t.push(i),e}}function Jg(t,e){let n;return r;function r(...s){const u=t.length>s.length;let o;u&&s.push(i);try{o=t.apply(this,s)}catch(l){const f=l;if(u&&n)throw f;return i(f)}u||(o&&o.then&&typeof o.then=="function"?o.then(a,i):o instanceof Error?i(o):a(o))}function i(s,...u){n||(n=!0,e(s,...u))}function a(s){i(null,s)}}const pt={basename:eb,dirname:tb,extname:nb,join:rb,sep:"/"};function eb(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');_r(t);let n=0,r=-1,i=t.length,a;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let s=-1,u=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(a){n=i+1;break}}else s<0&&(a=!0,s=i+1),u>-1&&(t.codePointAt(i)===e.codePointAt(u--)?u<0&&(r=i):(u=-1,r=s));return n===r?r=s:r<0&&(r=t.length),t.slice(n,r)}function tb(t){if(_r(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function nb(t){_r(t);let e=t.length,n=-1,r=0,i=-1,a=0,s;for(;e--;){const u=t.codePointAt(e);if(u===47){if(s){r=e+1;break}continue}n<0&&(s=!0,n=e+1),u===46?i<0?i=e:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function rb(...t){let e=-1,n;for(;++e<t.length;)_r(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":ib(n)}function ib(t){_r(t);const e=t.codePointAt(0)===47;let n=ab(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function ab(t,e){let n="",r=0,i=-1,a=0,s=-1,u,o;for(;++s<=t.length;){if(s<t.length)u=t.codePointAt(s);else{if(u===47)break;u=47}if(u===47){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(o=n.lastIndexOf("/"),o!==n.length-1){o<0?(n="",r=0):(n=n.slice(0,o),r=n.length-1-n.lastIndexOf("/")),i=s,a=0;continue}}else if(n.length>0){n="",r=0,i=s,a=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,s):n=t.slice(i+1,s),r=s-i-1;i=s,a=0}else u===46&&a>-1?a++:a=-1}return n}function _r(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const sb={cwd:ub};function ub(){return"/"}function ba(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function ob(t){if(typeof t=="string")t=new URL(t);else if(!ba(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return lb(t)}function lb(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const r=e.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(e)}const Mi=["history","path","basename","stem","extname","dirname"];class Kl{constructor(e){let n;e?ba(e)?n={path:e}:typeof e=="string"||cb(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":sb.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Mi.length;){const a=Mi[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let i;for(i in n)Mi.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?pt.basename(this.path):void 0}set basename(e){Fi(e,"basename"),Bi(e,"basename"),this.path=pt.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?pt.dirname(this.path):void 0}set dirname(e){_u(this.basename,"dirname"),this.path=pt.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?pt.extname(this.path):void 0}set extname(e){if(Bi(e,"extname"),_u(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=pt.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){ba(e)&&(e=ob(e)),Fi(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?pt.basename(this.path,this.extname):void 0}set stem(e){Fi(e,"stem"),Bi(e,"stem"),this.path=pt.join(this.dirname||"",e+(this.extname||""))}fail(e,n,r){const i=this.message(e,n,r);throw i.fatal=!0,i}info(e,n,r){const i=this.message(e,n,r);return i.fatal=void 0,i}message(e,n,r){const i=new Ue(e,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function Bi(t,e){if(t&&t.includes(pt.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+pt.sep+"`")}function Fi(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function _u(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function cb(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const db=(function(t){const r=this.constructor.prototype,i=r[t],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),fb={}.hasOwnProperty;class es extends db{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Kg()}copy(){const e=new es;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];e.use(...r)}return e.data(Pi(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(zi("data",this.frozen),this.namespace[e]=n,this):fb.call(this.namespace,e)&&this.namespace[e]||void 0:e?(zi("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(e,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=wr(e),r=this.parser||this.Parser;return Hi("parse",r),r(String(n),n)}process(e,n){const r=this;return this.freeze(),Hi("process",this.parser||this.Parser),Ui("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,s){const u=wr(e),o=r.parse(u);r.run(o,u,function(f,d,h){if(f||!d||!h)return l(f);const p=d,g=r.stringify(p,h);mb(g)?h.value=g:h.result=g,l(f,h)});function l(f,d){f||!d?s(f):a?a(d):n(void 0,d)}}}processSync(e){let n=!1,r;return this.freeze(),Hi("processSync",this.parser||this.Parser),Ui("processSync",this.compiler||this.Compiler),this.process(e,i),Au("processSync","process",n),r;function i(a,s){n=!0,Tu(a),r=s}}run(e,n,r){yu(e),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(s,u){const o=wr(n);i.run(e,o,l);function l(f,d,h){const p=d||e;f?u(f):s?s(p):r(void 0,p,h)}}}runSync(e,n){let r=!1,i;return this.run(e,n,a),Au("runSync","run",r),i;function a(s,u){Tu(s),i=u,r=!0}}stringify(e,n){this.freeze();const r=wr(n),i=this.compiler||this.Compiler;return Ui("stringify",i),yu(e),i(e,r)}use(e,...n){const r=this.attachers,i=this.namespace;if(zi("use",this.frozen),e!=null)if(typeof e=="function")o(e,n);else if(typeof e=="object")Array.isArray(e)?u(e):s(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function a(l){if(typeof l=="function")o(l,[]);else if(typeof l=="object")if(Array.isArray(l)){const[f,...d]=l;o(f,d)}else s(l);else throw new TypeError("Expected usable value, not `"+l+"`")}function s(l){if(!("plugins"in l)&&!("settings"in l))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");u(l.plugins),l.settings&&(i.settings=Pi(!0,i.settings,l.settings))}function u(l){let f=-1;if(l!=null)if(Array.isArray(l))for(;++f<l.length;){const d=l[f];a(d)}else throw new TypeError("Expected a list of plugins, not `"+l+"`")}function o(l,f){let d=-1,h=-1;for(;++d<r.length;)if(r[d][0]===l){h=d;break}if(h===-1)r.push([l,...f]);else if(f.length>0){let[p,...g]=f;const x=r[h][1];ga(x)&&ga(p)&&(p=Pi(!0,x,p)),r[h]=[l,p,...g]}}}}const hb=new es().freeze();function Hi(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Ui(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function zi(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function yu(t){if(!ga(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Au(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function wr(t){return pb(t)?t:new Kl(t)}function pb(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function mb(t){return typeof t=="string"||gb(t)}function gb(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const bb="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Cu=[],ku={allowDangerousHtml:!0},Eb=/^(https?|ircs?|mailto|xmpp)$/i,Tb=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function xb(t){const e=_b(t),n=yb(t);return Ab(e.runSync(e.parse(n),n),t)}function _b(t){const e=t.rehypePlugins||Cu,n=t.remarkPlugins||Cu,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...ku}:ku;return hb().use(tg).use(n).use(Qg,r).use(e)}function yb(t){const e=t.children||"",n=new Kl;return typeof e=="string"&&(n.value=e),n}function Ab(t,e){const n=e.allowedElements,r=e.allowElement,i=e.components,a=e.disallowedElements,s=e.skipHtml,u=e.unwrapDisallowed,o=e.urlTransform||Cb;for(const f of Tb)Object.hasOwn(e,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+bb+f.id,void 0);return e.className&&(t={type:"element",tagName:"div",properties:{className:e.className},children:t.type==="root"?t.children:[t]}),pi(t,l),Fp(t,{Fragment:m.Fragment,components:i,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0});function l(f,d,h){if(f.type==="raw"&&h&&typeof d=="number")return s?h.children.splice(d,1):h.children[d]={type:"text",value:f.value},d;if(f.type==="element"){let p;for(p in Li)if(Object.hasOwn(Li,p)&&Object.hasOwn(f.properties,p)){const g=f.properties[p],x=Li[p];(x===null||x.includes(f.tagName))&&(f.properties[p]=o(String(g||""),p,f))}}if(f.type==="element"){let p=n?!n.includes(f.tagName):a?a.includes(f.tagName):!1;if(!p&&r&&typeof d=="number"&&(p=!r(f,d,h)),p&&h&&typeof d=="number")return u&&f.children?h.children.splice(d,1,...f.children):h.children.splice(d,1),d}}}function Cb(t){const e=t.indexOf(":"),n=t.indexOf("?"),r=t.indexOf("#"),i=t.indexOf("/");return e===-1||i!==-1&&e>i||n!==-1&&e>n||r!==-1&&e>r||Eb.test(t.slice(0,e))?t:""}const Su=/[#.]/g;function kb(t,e){const n=t||"",r={};let i=0,a,s;for(;i<n.length;){Su.lastIndex=i;const u=Su.exec(n),o=n.slice(i,u?u.index:n.length);o&&(a?a==="#"?r.id=o:Array.isArray(r.className)?r.className.push(o):r.className=[o]:s=o,i+=o.length),u&&(a=u[0],i++)}return{type:"element",tagName:s||e||"div",properties:r,children:[]}}function Jl(t,e,n){const r=n?wb(n):void 0;function i(a,s,...u){let o;if(a==null){o={type:"root",children:[]};const l=s;u.unshift(l)}else{o=kb(a,e);const l=o.tagName.toLowerCase(),f=r?r.get(l):void 0;if(o.tagName=f||l,Sb(s))u.unshift(s);else for(const[d,h]of Object.entries(s))Ib(t,o.properties,d,h)}for(const l of u)Ea(o.children,l);return o.type==="element"&&o.tagName==="template"&&(o.content={type:"root",children:o.children},o.children=[]),o}return i}function Sb(t){if(t===null||typeof t!="object"||Array.isArray(t))return!0;if(typeof t.type!="string")return!1;const e=t,n=Object.keys(t);for(const r of n){const i=e[r];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const a=i;for(const s of a)if(typeof s!="number"&&typeof s!="string")return!0}}return!!("children"in t&&Array.isArray(t.children))}function Ib(t,e,n,r){const i=ui(t,n);let a;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;a=r}else typeof r=="boolean"?a=r:typeof r=="string"?i.spaceSeparated?a=Ws(r):i.commaSeparated?a=js(r):i.commaOrSpaceSeparated?a=Ws(js(r).join(" ")):a=Iu(i,i.property,r):Array.isArray(r)?a=[...r]:a=i.property==="style"?Nb(r):String(r);if(Array.isArray(a)){const s=[];for(const u of a)s.push(Iu(i,i.property,u));a=s}i.property==="className"&&Array.isArray(e.className)&&(a=e.className.concat(a)),e[i.property]=a}}function Ea(t,e){if(e!=null)if(typeof e=="number"||typeof e=="string")t.push({type:"text",value:String(e)});else if(Array.isArray(e))for(const n of e)Ea(t,n);else if(typeof e=="object"&&"type"in e)e.type==="root"?Ea(t,e.children):t.push(e);else throw new Error("Expected node, nodes, or string, got `"+e+"`")}function Iu(t,e,n){if(typeof n=="string"){if(t.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((t.boolean||t.overloadedBoolean)&&(n===""||or(n)===or(e)))return!0}return n}function Nb(t){const e=[];for(const[n,r]of Object.entries(t))e.push([n,r].join(": "));return e.join("; ")}function wb(t){const e=new Map;for(const n of t)e.set(n.toLowerCase(),n);return e}const Rb=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],Lb=Jl(Tr,"div"),Ob=Jl(Ft,"g",Rb);function vb(t){const e=String(t),n=[];return{toOffset:i,toPoint:r};function r(a){if(typeof a=="number"&&a>-1&&a<=e.length){let s=0;for(;;){let u=n[s];if(u===void 0){const o=Nu(e,n[s-1]);u=o===-1?e.length+1:o+1,n[s]=u}if(u>a)return{line:s+1,column:a-(s>0?n[s-1]:0)+1,offset:a};s++}}}function i(a){if(a&&typeof a.line=="number"&&typeof a.column=="number"&&!Number.isNaN(a.line)&&!Number.isNaN(a.column)){for(;n.length<a.line;){const u=n[n.length-1],o=Nu(e,u),l=o===-1?e.length+1:o+1;if(u===l)break;n.push(l)}const s=(a.line>1?n[a.line-2]:0)+a.column-1;if(s<n[a.line-1])return s}}}function Nu(t,e){const n=t.indexOf("\r",e),r=t.indexOf(`
81
+ `,e);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const Qt={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},ec={}.hasOwnProperty,Db=Object.prototype;function Pb(t,e){const n=e||{};return ts({file:n.file||void 0,location:!1,schema:n.space==="svg"?Ft:Tr,verbose:n.verbose||!1},t)}function ts(t,e){let n;switch(e.nodeName){case"#comment":{const r=e;return n={type:"comment",value:r.data},Hr(t,r,n),n}case"#document":case"#document-fragment":{const r=e,i="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:tc(t,e.childNodes),data:{quirksMode:i}},t.file&&t.location){const a=String(t.file),s=vb(a),u=s.toPoint(0),o=s.toPoint(a.length);n.position={start:u,end:o}}return n}case"#documentType":{const r=e;return n={type:"doctype"},Hr(t,r,n),n}case"#text":{const r=e;return n={type:"text",value:r.value},Hr(t,r,n),n}default:return n=Mb(t,e),n}}function tc(t,e){let n=-1;const r=[];for(;++n<e.length;){const i=ts(t,e[n]);r.push(i)}return r}function Mb(t,e){const n=t.schema;t.schema=e.namespaceURI===Qt.svg?Ft:Tr;let r=-1;const i={};for(;++r<e.attrs.length;){const u=e.attrs[r],o=(u.prefix?u.prefix+":":"")+u.name;ec.call(Db,o)||(i[o]=u.value)}const s=(t.schema.space==="svg"?Ob:Lb)(e.tagName,i,tc(t,e.childNodes));if(Hr(t,e,s),s.tagName==="template"){const u=e,o=u.sourceCodeLocation,l=o&&o.startTag&&bn(o.startTag),f=o&&o.endTag&&bn(o.endTag),d=ts(t,u.content);l&&f&&t.file&&(d.position={start:l.end,end:f.start}),s.content=d}return t.schema=n,s}function Hr(t,e,n){if("sourceCodeLocation"in e&&e.sourceCodeLocation&&t.file){const r=Bb(t,n,e.sourceCodeLocation);r&&(t.location=!0,n.position=r)}}function Bb(t,e,n){const r=bn(n);if(e.type==="element"){const i=e.children[e.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),t.verbose){const a={};let s;if(n.attrs)for(s in n.attrs)ec.call(n.attrs,s)&&(a[ui(t.schema,s).property]=bn(n.attrs[s]));n.startTag;const u=bn(n.startTag),o=n.endTag?bn(n.endTag):void 0,l={opening:u};o&&(l.closing=o),l.properties=a,e.data={position:l}}}return r}function bn(t){const e=wu({line:t.startLine,column:t.startCol,offset:t.startOffset}),n=wu({line:t.endLine,column:t.endCol,offset:t.endOffset});return e||n?{start:e,end:n}:void 0}function wu(t){return t.line&&t.column?t:void 0}const Ru={}.hasOwnProperty;function nc(t,e){const n=e||{};function r(i,...a){let s=r.invalid;const u=r.handlers;if(i&&Ru.call(i,t)){const o=String(i[t]);s=Ru.call(u,o)?u[o]:r.unknown}if(s)return s.call(this,i,...a)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const Fb={},Hb={}.hasOwnProperty,rc=nc("type",{handlers:{root:zb,element:Vb,text:Yb,comment:qb,doctype:$b}});function Ub(t,e){const r=(e||Fb).space;return rc(t,r==="svg"?Ft:Tr)}function zb(t,e){const n={nodeName:"#document",mode:(t.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=ns(t.children,n,e),Nn(t,n),n}function jb(t,e){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=ns(t.children,n,e),Nn(t,n),n}function $b(t){const e={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Nn(t,e),e}function Yb(t){const e={nodeName:"#text",value:t.value,parentNode:null};return Nn(t,e),e}function qb(t){const e={nodeName:"#comment",data:t.value,parentNode:null};return Nn(t,e),e}function Vb(t,e){const n=e;let r=n;t.type==="element"&&t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=Ft);const i=[];let a;if(t.properties){for(a in t.properties)if(a!=="children"&&Hb.call(t.properties,a)){const o=Wb(r,a,t.properties[a]);o&&i.push(o)}}const s=r.space,u={nodeName:t.tagName,tagName:t.tagName,attrs:i,namespaceURI:Qt[s],childNodes:[],parentNode:null};return u.childNodes=ns(t.children,u,r),Nn(t,u),t.tagName==="template"&&t.content&&(u.content=jb(t.content,r)),u}function Wb(t,e,n){const r=ui(t,e);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?bl(n):kl(n));const i={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const a=i.name.indexOf(":");a<0?i.prefix="":(i.name=i.name.slice(a+1),i.prefix=r.attribute.slice(0,a)),i.namespace=Qt[r.space]}return i}function ns(t,e,n){let r=-1;const i=[];if(t)for(;++r<t.length;){const a=rc(t[r],n);a.parentNode=e,i.push(a)}return i}function Nn(t,e){const n=t.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,e.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const Gb=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],Qb=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Re="�";var T;(function(t){t[t.EOF=-1]="EOF",t[t.NULL=0]="NULL",t[t.TABULATION=9]="TABULATION",t[t.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",t[t.LINE_FEED=10]="LINE_FEED",t[t.FORM_FEED=12]="FORM_FEED",t[t.SPACE=32]="SPACE",t[t.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",t[t.QUOTATION_MARK=34]="QUOTATION_MARK",t[t.AMPERSAND=38]="AMPERSAND",t[t.APOSTROPHE=39]="APOSTROPHE",t[t.HYPHEN_MINUS=45]="HYPHEN_MINUS",t[t.SOLIDUS=47]="SOLIDUS",t[t.DIGIT_0=48]="DIGIT_0",t[t.DIGIT_9=57]="DIGIT_9",t[t.SEMICOLON=59]="SEMICOLON",t[t.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",t[t.EQUALS_SIGN=61]="EQUALS_SIGN",t[t.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",t[t.QUESTION_MARK=63]="QUESTION_MARK",t[t.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",t[t.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",t[t.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",t[t.GRAVE_ACCENT=96]="GRAVE_ACCENT",t[t.LATIN_SMALL_A=97]="LATIN_SMALL_A",t[t.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(T||(T={}));const Ve={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function ic(t){return t>=55296&&t<=57343}function Xb(t){return t>=56320&&t<=57343}function Zb(t,e){return(t-55296)*1024+9216+e}function ac(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&t>=1&&t<=31||t>=127&&t<=159}function sc(t){return t>=64976&&t<=65007||Qb.has(t)}var D;(function(t){t.controlCharacterInInputStream="control-character-in-input-stream",t.noncharacterInInputStream="noncharacter-in-input-stream",t.surrogateInInputStream="surrogate-in-input-stream",t.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",t.endTagWithAttributes="end-tag-with-attributes",t.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",t.unexpectedSolidusInTag="unexpected-solidus-in-tag",t.unexpectedNullCharacter="unexpected-null-character",t.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",t.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",t.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",t.missingEndTagName="missing-end-tag-name",t.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",t.unknownNamedCharacterReference="unknown-named-character-reference",t.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",t.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",t.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",t.eofBeforeTagName="eof-before-tag-name",t.eofInTag="eof-in-tag",t.missingAttributeValue="missing-attribute-value",t.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",t.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",t.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",t.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",t.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",t.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",t.missingDoctypePublicIdentifier="missing-doctype-public-identifier",t.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",t.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",t.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",t.cdataInHtmlContent="cdata-in-html-content",t.incorrectlyOpenedComment="incorrectly-opened-comment",t.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",t.eofInDoctype="eof-in-doctype",t.nestedComment="nested-comment",t.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",t.eofInComment="eof-in-comment",t.incorrectlyClosedComment="incorrectly-closed-comment",t.eofInCdata="eof-in-cdata",t.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",t.nullCharacterReference="null-character-reference",t.surrogateCharacterReference="surrogate-character-reference",t.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",t.controlCharacterReference="control-character-reference",t.noncharacterCharacterReference="noncharacter-character-reference",t.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",t.missingDoctypeName="missing-doctype-name",t.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",t.duplicateAttribute="duplicate-attribute",t.nonConformingDoctype="non-conforming-doctype",t.missingDoctype="missing-doctype",t.misplacedDoctype="misplaced-doctype",t.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",t.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",t.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",t.openElementsLeftAfterEof="open-elements-left-after-eof",t.abandonedHeadElementChild="abandoned-head-element-child",t.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",t.nestedNoscriptInHead="nested-noscript-in-head",t.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(D||(D={}));const Kb=65536;class Jb{constructor(e){this.handler=e,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=Kb,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,n){const{line:r,col:i,offset:a}=this,s=i+n,u=a+n;return{code:e,startLine:r,endLine:r,startCol:s,endCol:s,startOffset:u,endOffset:u}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(Xb(n))return this.pos++,this._addGap(),Zb(e,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,T.EOF;return this._err(D.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,n){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,n){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(e,this.pos);for(let r=0;r<e.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==e.charCodeAt(r))return!1;return!0}peek(e){const n=this.pos+e;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,T.EOF;const r=this.html.charCodeAt(n);return r===T.CARRIAGE_RETURN?T.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,T.EOF;let e=this.html.charCodeAt(this.pos);return e===T.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,T.LINE_FEED):e===T.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,ic(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===T.LINE_FEED||e===T.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){ac(e)?this._err(D.controlCharacterInInputStream):sc(e)&&this._err(D.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var de;(function(t){t[t.CHARACTER=0]="CHARACTER",t[t.NULL_CHARACTER=1]="NULL_CHARACTER",t[t.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",t[t.START_TAG=3]="START_TAG",t[t.END_TAG=4]="END_TAG",t[t.COMMENT=5]="COMMENT",t[t.DOCTYPE=6]="DOCTYPE",t[t.EOF=7]="EOF",t[t.HIBERNATION=8]="HIBERNATION"})(de||(de={}));function uc(t,e){for(let n=t.attrs.length-1;n>=0;n--)if(t.attrs[n].name===e)return t.attrs[n].value;return null}const eE=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),tE=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function nE(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=tE.get(t))!==null&&e!==void 0?e:t}var Me;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(Me||(Me={}));const rE=32;var vt;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(vt||(vt={}));function Ta(t){return t>=Me.ZERO&&t<=Me.NINE}function iE(t){return t>=Me.UPPER_A&&t<=Me.UPPER_F||t>=Me.LOWER_A&&t<=Me.LOWER_F}function aE(t){return t>=Me.UPPER_A&&t<=Me.UPPER_Z||t>=Me.LOWER_A&&t<=Me.LOWER_Z||Ta(t)}function sE(t){return t===Me.EQUALS||aE(t)}var Pe;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(Pe||(Pe={}));var xt;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(xt||(xt={}));class uE{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=Pe.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=xt.Strict}startEntity(e){this.decodeMode=e,this.state=Pe.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case Pe.EntityStart:return e.charCodeAt(n)===Me.NUM?(this.state=Pe.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=Pe.NamedEntity,this.stateNamedEntity(e,n));case Pe.NumericStart:return this.stateNumericStart(e,n);case Pe.NumericDecimal:return this.stateNumericDecimal(e,n);case Pe.NumericHex:return this.stateNumericHex(e,n);case Pe.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|rE)===Me.LOWER_X?(this.state=Pe.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=Pe.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,i){if(n!==r){const a=r-n;this.result=this.result*Math.pow(i,a)+Number.parseInt(e.substr(n,a),i),this.consumed+=a}}stateNumericHex(e,n){const r=n;for(;n<e.length;){const i=e.charCodeAt(n);if(Ta(i)||iE(i))n+=1;else return this.addToNumericResult(e,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(e,r,n,16),-1}stateNumericDecimal(e,n){const r=n;for(;n<e.length;){const i=e.charCodeAt(n);if(Ta(i))n+=1;else return this.addToNumericResult(e,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(e,r,n,10),-1}emitNumericEntity(e,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Me.SEMI)this.consumed+=1;else if(this.decodeMode===xt.Strict)return 0;return this.emitCodePoint(nE(this.result),this.consumed),this.errors&&(e!==Me.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:r}=this;let i=r[this.treeIndex],a=(i&vt.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const s=e.charCodeAt(n);if(this.treeIndex=oE(r,i,this.treeIndex+Math.max(1,a),s),this.treeIndex<0)return this.result===0||this.decodeMode===xt.Attribute&&(a===0||sE(s))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],a=(i&vt.VALUE_LENGTH)>>14,a!==0){if(s===Me.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==xt.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,i=(r[n]&vt.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[e]&~vt.VALUE_LENGTH:i[e+1],r),n===3&&this.emitCodePoint(i[e+2],r),r}end(){var e;switch(this.state){case Pe.NamedEntity:return this.result!==0&&(this.decodeMode!==xt.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Pe.NumericDecimal:return this.emitNumericEntity(0,2);case Pe.NumericHex:return this.emitNumericEntity(0,3);case Pe.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Pe.EntityStart:return 0}}}function oE(t,e,n,r){const i=(e&vt.BRANCH_LENGTH)>>7,a=e&vt.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){const o=r-a;return o<0||o>=i?-1:t[n+o]-1}let s=n,u=s+i-1;for(;s<=u;){const o=s+u>>>1,l=t[o];if(l<r)s=o+1;else if(l>r)u=o-1;else return t[o+i]}return-1}var U;(function(t){t.HTML="http://www.w3.org/1999/xhtml",t.MATHML="http://www.w3.org/1998/Math/MathML",t.SVG="http://www.w3.org/2000/svg",t.XLINK="http://www.w3.org/1999/xlink",t.XML="http://www.w3.org/XML/1998/namespace",t.XMLNS="http://www.w3.org/2000/xmlns/"})(U||(U={}));var Xt;(function(t){t.TYPE="type",t.ACTION="action",t.ENCODING="encoding",t.PROMPT="prompt",t.NAME="name",t.COLOR="color",t.FACE="face",t.SIZE="size"})(Xt||(Xt={}));var at;(function(t){t.NO_QUIRKS="no-quirks",t.QUIRKS="quirks",t.LIMITED_QUIRKS="limited-quirks"})(at||(at={}));var L;(function(t){t.A="a",t.ADDRESS="address",t.ANNOTATION_XML="annotation-xml",t.APPLET="applet",t.AREA="area",t.ARTICLE="article",t.ASIDE="aside",t.B="b",t.BASE="base",t.BASEFONT="basefont",t.BGSOUND="bgsound",t.BIG="big",t.BLOCKQUOTE="blockquote",t.BODY="body",t.BR="br",t.BUTTON="button",t.CAPTION="caption",t.CENTER="center",t.CODE="code",t.COL="col",t.COLGROUP="colgroup",t.DD="dd",t.DESC="desc",t.DETAILS="details",t.DIALOG="dialog",t.DIR="dir",t.DIV="div",t.DL="dl",t.DT="dt",t.EM="em",t.EMBED="embed",t.FIELDSET="fieldset",t.FIGCAPTION="figcaption",t.FIGURE="figure",t.FONT="font",t.FOOTER="footer",t.FOREIGN_OBJECT="foreignObject",t.FORM="form",t.FRAME="frame",t.FRAMESET="frameset",t.H1="h1",t.H2="h2",t.H3="h3",t.H4="h4",t.H5="h5",t.H6="h6",t.HEAD="head",t.HEADER="header",t.HGROUP="hgroup",t.HR="hr",t.HTML="html",t.I="i",t.IMG="img",t.IMAGE="image",t.INPUT="input",t.IFRAME="iframe",t.KEYGEN="keygen",t.LABEL="label",t.LI="li",t.LINK="link",t.LISTING="listing",t.MAIN="main",t.MALIGNMARK="malignmark",t.MARQUEE="marquee",t.MATH="math",t.MENU="menu",t.META="meta",t.MGLYPH="mglyph",t.MI="mi",t.MO="mo",t.MN="mn",t.MS="ms",t.MTEXT="mtext",t.NAV="nav",t.NOBR="nobr",t.NOFRAMES="noframes",t.NOEMBED="noembed",t.NOSCRIPT="noscript",t.OBJECT="object",t.OL="ol",t.OPTGROUP="optgroup",t.OPTION="option",t.P="p",t.PARAM="param",t.PLAINTEXT="plaintext",t.PRE="pre",t.RB="rb",t.RP="rp",t.RT="rt",t.RTC="rtc",t.RUBY="ruby",t.S="s",t.SCRIPT="script",t.SEARCH="search",t.SECTION="section",t.SELECT="select",t.SOURCE="source",t.SMALL="small",t.SPAN="span",t.STRIKE="strike",t.STRONG="strong",t.STYLE="style",t.SUB="sub",t.SUMMARY="summary",t.SUP="sup",t.TABLE="table",t.TBODY="tbody",t.TEMPLATE="template",t.TEXTAREA="textarea",t.TFOOT="tfoot",t.TD="td",t.TH="th",t.THEAD="thead",t.TITLE="title",t.TR="tr",t.TRACK="track",t.TT="tt",t.U="u",t.UL="ul",t.SVG="svg",t.VAR="var",t.WBR="wbr",t.XMP="xmp"})(L||(L={}));var c;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.A=1]="A",t[t.ADDRESS=2]="ADDRESS",t[t.ANNOTATION_XML=3]="ANNOTATION_XML",t[t.APPLET=4]="APPLET",t[t.AREA=5]="AREA",t[t.ARTICLE=6]="ARTICLE",t[t.ASIDE=7]="ASIDE",t[t.B=8]="B",t[t.BASE=9]="BASE",t[t.BASEFONT=10]="BASEFONT",t[t.BGSOUND=11]="BGSOUND",t[t.BIG=12]="BIG",t[t.BLOCKQUOTE=13]="BLOCKQUOTE",t[t.BODY=14]="BODY",t[t.BR=15]="BR",t[t.BUTTON=16]="BUTTON",t[t.CAPTION=17]="CAPTION",t[t.CENTER=18]="CENTER",t[t.CODE=19]="CODE",t[t.COL=20]="COL",t[t.COLGROUP=21]="COLGROUP",t[t.DD=22]="DD",t[t.DESC=23]="DESC",t[t.DETAILS=24]="DETAILS",t[t.DIALOG=25]="DIALOG",t[t.DIR=26]="DIR",t[t.DIV=27]="DIV",t[t.DL=28]="DL",t[t.DT=29]="DT",t[t.EM=30]="EM",t[t.EMBED=31]="EMBED",t[t.FIELDSET=32]="FIELDSET",t[t.FIGCAPTION=33]="FIGCAPTION",t[t.FIGURE=34]="FIGURE",t[t.FONT=35]="FONT",t[t.FOOTER=36]="FOOTER",t[t.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",t[t.FORM=38]="FORM",t[t.FRAME=39]="FRAME",t[t.FRAMESET=40]="FRAMESET",t[t.H1=41]="H1",t[t.H2=42]="H2",t[t.H3=43]="H3",t[t.H4=44]="H4",t[t.H5=45]="H5",t[t.H6=46]="H6",t[t.HEAD=47]="HEAD",t[t.HEADER=48]="HEADER",t[t.HGROUP=49]="HGROUP",t[t.HR=50]="HR",t[t.HTML=51]="HTML",t[t.I=52]="I",t[t.IMG=53]="IMG",t[t.IMAGE=54]="IMAGE",t[t.INPUT=55]="INPUT",t[t.IFRAME=56]="IFRAME",t[t.KEYGEN=57]="KEYGEN",t[t.LABEL=58]="LABEL",t[t.LI=59]="LI",t[t.LINK=60]="LINK",t[t.LISTING=61]="LISTING",t[t.MAIN=62]="MAIN",t[t.MALIGNMARK=63]="MALIGNMARK",t[t.MARQUEE=64]="MARQUEE",t[t.MATH=65]="MATH",t[t.MENU=66]="MENU",t[t.META=67]="META",t[t.MGLYPH=68]="MGLYPH",t[t.MI=69]="MI",t[t.MO=70]="MO",t[t.MN=71]="MN",t[t.MS=72]="MS",t[t.MTEXT=73]="MTEXT",t[t.NAV=74]="NAV",t[t.NOBR=75]="NOBR",t[t.NOFRAMES=76]="NOFRAMES",t[t.NOEMBED=77]="NOEMBED",t[t.NOSCRIPT=78]="NOSCRIPT",t[t.OBJECT=79]="OBJECT",t[t.OL=80]="OL",t[t.OPTGROUP=81]="OPTGROUP",t[t.OPTION=82]="OPTION",t[t.P=83]="P",t[t.PARAM=84]="PARAM",t[t.PLAINTEXT=85]="PLAINTEXT",t[t.PRE=86]="PRE",t[t.RB=87]="RB",t[t.RP=88]="RP",t[t.RT=89]="RT",t[t.RTC=90]="RTC",t[t.RUBY=91]="RUBY",t[t.S=92]="S",t[t.SCRIPT=93]="SCRIPT",t[t.SEARCH=94]="SEARCH",t[t.SECTION=95]="SECTION",t[t.SELECT=96]="SELECT",t[t.SOURCE=97]="SOURCE",t[t.SMALL=98]="SMALL",t[t.SPAN=99]="SPAN",t[t.STRIKE=100]="STRIKE",t[t.STRONG=101]="STRONG",t[t.STYLE=102]="STYLE",t[t.SUB=103]="SUB",t[t.SUMMARY=104]="SUMMARY",t[t.SUP=105]="SUP",t[t.TABLE=106]="TABLE",t[t.TBODY=107]="TBODY",t[t.TEMPLATE=108]="TEMPLATE",t[t.TEXTAREA=109]="TEXTAREA",t[t.TFOOT=110]="TFOOT",t[t.TD=111]="TD",t[t.TH=112]="TH",t[t.THEAD=113]="THEAD",t[t.TITLE=114]="TITLE",t[t.TR=115]="TR",t[t.TRACK=116]="TRACK",t[t.TT=117]="TT",t[t.U=118]="U",t[t.UL=119]="UL",t[t.SVG=120]="SVG",t[t.VAR=121]="VAR",t[t.WBR=122]="WBR",t[t.XMP=123]="XMP"})(c||(c={}));const lE=new Map([[L.A,c.A],[L.ADDRESS,c.ADDRESS],[L.ANNOTATION_XML,c.ANNOTATION_XML],[L.APPLET,c.APPLET],[L.AREA,c.AREA],[L.ARTICLE,c.ARTICLE],[L.ASIDE,c.ASIDE],[L.B,c.B],[L.BASE,c.BASE],[L.BASEFONT,c.BASEFONT],[L.BGSOUND,c.BGSOUND],[L.BIG,c.BIG],[L.BLOCKQUOTE,c.BLOCKQUOTE],[L.BODY,c.BODY],[L.BR,c.BR],[L.BUTTON,c.BUTTON],[L.CAPTION,c.CAPTION],[L.CENTER,c.CENTER],[L.CODE,c.CODE],[L.COL,c.COL],[L.COLGROUP,c.COLGROUP],[L.DD,c.DD],[L.DESC,c.DESC],[L.DETAILS,c.DETAILS],[L.DIALOG,c.DIALOG],[L.DIR,c.DIR],[L.DIV,c.DIV],[L.DL,c.DL],[L.DT,c.DT],[L.EM,c.EM],[L.EMBED,c.EMBED],[L.FIELDSET,c.FIELDSET],[L.FIGCAPTION,c.FIGCAPTION],[L.FIGURE,c.FIGURE],[L.FONT,c.FONT],[L.FOOTER,c.FOOTER],[L.FOREIGN_OBJECT,c.FOREIGN_OBJECT],[L.FORM,c.FORM],[L.FRAME,c.FRAME],[L.FRAMESET,c.FRAMESET],[L.H1,c.H1],[L.H2,c.H2],[L.H3,c.H3],[L.H4,c.H4],[L.H5,c.H5],[L.H6,c.H6],[L.HEAD,c.HEAD],[L.HEADER,c.HEADER],[L.HGROUP,c.HGROUP],[L.HR,c.HR],[L.HTML,c.HTML],[L.I,c.I],[L.IMG,c.IMG],[L.IMAGE,c.IMAGE],[L.INPUT,c.INPUT],[L.IFRAME,c.IFRAME],[L.KEYGEN,c.KEYGEN],[L.LABEL,c.LABEL],[L.LI,c.LI],[L.LINK,c.LINK],[L.LISTING,c.LISTING],[L.MAIN,c.MAIN],[L.MALIGNMARK,c.MALIGNMARK],[L.MARQUEE,c.MARQUEE],[L.MATH,c.MATH],[L.MENU,c.MENU],[L.META,c.META],[L.MGLYPH,c.MGLYPH],[L.MI,c.MI],[L.MO,c.MO],[L.MN,c.MN],[L.MS,c.MS],[L.MTEXT,c.MTEXT],[L.NAV,c.NAV],[L.NOBR,c.NOBR],[L.NOFRAMES,c.NOFRAMES],[L.NOEMBED,c.NOEMBED],[L.NOSCRIPT,c.NOSCRIPT],[L.OBJECT,c.OBJECT],[L.OL,c.OL],[L.OPTGROUP,c.OPTGROUP],[L.OPTION,c.OPTION],[L.P,c.P],[L.PARAM,c.PARAM],[L.PLAINTEXT,c.PLAINTEXT],[L.PRE,c.PRE],[L.RB,c.RB],[L.RP,c.RP],[L.RT,c.RT],[L.RTC,c.RTC],[L.RUBY,c.RUBY],[L.S,c.S],[L.SCRIPT,c.SCRIPT],[L.SEARCH,c.SEARCH],[L.SECTION,c.SECTION],[L.SELECT,c.SELECT],[L.SOURCE,c.SOURCE],[L.SMALL,c.SMALL],[L.SPAN,c.SPAN],[L.STRIKE,c.STRIKE],[L.STRONG,c.STRONG],[L.STYLE,c.STYLE],[L.SUB,c.SUB],[L.SUMMARY,c.SUMMARY],[L.SUP,c.SUP],[L.TABLE,c.TABLE],[L.TBODY,c.TBODY],[L.TEMPLATE,c.TEMPLATE],[L.TEXTAREA,c.TEXTAREA],[L.TFOOT,c.TFOOT],[L.TD,c.TD],[L.TH,c.TH],[L.THEAD,c.THEAD],[L.TITLE,c.TITLE],[L.TR,c.TR],[L.TRACK,c.TRACK],[L.TT,c.TT],[L.U,c.U],[L.UL,c.UL],[L.SVG,c.SVG],[L.VAR,c.VAR],[L.WBR,c.WBR],[L.XMP,c.XMP]]);function wn(t){var e;return(e=lE.get(t))!==null&&e!==void 0?e:c.UNKNOWN}const $=c,cE={[U.HTML]:new Set([$.ADDRESS,$.APPLET,$.AREA,$.ARTICLE,$.ASIDE,$.BASE,$.BASEFONT,$.BGSOUND,$.BLOCKQUOTE,$.BODY,$.BR,$.BUTTON,$.CAPTION,$.CENTER,$.COL,$.COLGROUP,$.DD,$.DETAILS,$.DIR,$.DIV,$.DL,$.DT,$.EMBED,$.FIELDSET,$.FIGCAPTION,$.FIGURE,$.FOOTER,$.FORM,$.FRAME,$.FRAMESET,$.H1,$.H2,$.H3,$.H4,$.H5,$.H6,$.HEAD,$.HEADER,$.HGROUP,$.HR,$.HTML,$.IFRAME,$.IMG,$.INPUT,$.LI,$.LINK,$.LISTING,$.MAIN,$.MARQUEE,$.MENU,$.META,$.NAV,$.NOEMBED,$.NOFRAMES,$.NOSCRIPT,$.OBJECT,$.OL,$.P,$.PARAM,$.PLAINTEXT,$.PRE,$.SCRIPT,$.SECTION,$.SELECT,$.SOURCE,$.STYLE,$.SUMMARY,$.TABLE,$.TBODY,$.TD,$.TEMPLATE,$.TEXTAREA,$.TFOOT,$.TH,$.THEAD,$.TITLE,$.TR,$.TRACK,$.UL,$.WBR,$.XMP]),[U.MATHML]:new Set([$.MI,$.MO,$.MN,$.MS,$.MTEXT,$.ANNOTATION_XML]),[U.SVG]:new Set([$.TITLE,$.FOREIGN_OBJECT,$.DESC]),[U.XLINK]:new Set,[U.XML]:new Set,[U.XMLNS]:new Set},xa=new Set([$.H1,$.H2,$.H3,$.H4,$.H5,$.H6]);L.STYLE,L.SCRIPT,L.XMP,L.IFRAME,L.NOEMBED,L.NOFRAMES,L.PLAINTEXT;var A;(function(t){t[t.DATA=0]="DATA",t[t.RCDATA=1]="RCDATA",t[t.RAWTEXT=2]="RAWTEXT",t[t.SCRIPT_DATA=3]="SCRIPT_DATA",t[t.PLAINTEXT=4]="PLAINTEXT",t[t.TAG_OPEN=5]="TAG_OPEN",t[t.END_TAG_OPEN=6]="END_TAG_OPEN",t[t.TAG_NAME=7]="TAG_NAME",t[t.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",t[t.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",t[t.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",t[t.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",t[t.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",t[t.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",t[t.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",t[t.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",t[t.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",t[t.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",t[t.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",t[t.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",t[t.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",t[t.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",t[t.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",t[t.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",t[t.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",t[t.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",t[t.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",t[t.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",t[t.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",t[t.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",t[t.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",t[t.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",t[t.BOGUS_COMMENT=40]="BOGUS_COMMENT",t[t.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",t[t.COMMENT_START=42]="COMMENT_START",t[t.COMMENT_START_DASH=43]="COMMENT_START_DASH",t[t.COMMENT=44]="COMMENT",t[t.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",t[t.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",t[t.COMMENT_END_DASH=49]="COMMENT_END_DASH",t[t.COMMENT_END=50]="COMMENT_END",t[t.COMMENT_END_BANG=51]="COMMENT_END_BANG",t[t.DOCTYPE=52]="DOCTYPE",t[t.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",t[t.DOCTYPE_NAME=54]="DOCTYPE_NAME",t[t.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",t[t.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",t[t.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",t[t.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",t[t.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",t[t.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",t[t.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",t[t.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",t[t.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",t[t.CDATA_SECTION=68]="CDATA_SECTION",t[t.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",t[t.CDATA_SECTION_END=70]="CDATA_SECTION_END",t[t.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",t[t.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(A||(A={}));const ve={DATA:A.DATA,RCDATA:A.RCDATA,RAWTEXT:A.RAWTEXT,SCRIPT_DATA:A.SCRIPT_DATA,PLAINTEXT:A.PLAINTEXT,CDATA_SECTION:A.CDATA_SECTION};function dE(t){return t>=T.DIGIT_0&&t<=T.DIGIT_9}function qn(t){return t>=T.LATIN_CAPITAL_A&&t<=T.LATIN_CAPITAL_Z}function fE(t){return t>=T.LATIN_SMALL_A&&t<=T.LATIN_SMALL_Z}function wt(t){return fE(t)||qn(t)}function Lu(t){return wt(t)||dE(t)}function Rr(t){return t+32}function oc(t){return t===T.SPACE||t===T.LINE_FEED||t===T.TABULATION||t===T.FORM_FEED}function Ou(t){return oc(t)||t===T.SOLIDUS||t===T.GREATER_THAN_SIGN}function hE(t){return t===T.NULL?D.nullCharacterReference:t>1114111?D.characterReferenceOutsideUnicodeRange:ic(t)?D.surrogateCharacterReference:sc(t)?D.noncharacterCharacterReference:ac(t)||t===T.CARRIAGE_RETURN?D.controlCharacterReference:null}class pE{constructor(e,n){this.options=e,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=A.DATA,this.returnState=A.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new Jb(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new uE(eE,(r,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(D.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(D.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const i=hE(r);i&&this._err(i,1)}}:void 0)}_err(e,n=0){var r,i;(i=(r=this.handler).onParseError)===null||i===void 0||i.call(r,this.preprocessor.getError(e,n))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,n,r){this.active=!0,this.preprocessor.write(e,n),this._runParsingLoop(),this.paused||r?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let n=0;n<e;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,n){return this.preprocessor.startsWith(e,n)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:de.START_TAG,tagName:"",tagID:c.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:de.END_TAG,tagName:"",tagID:c.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:de.COMMENT,data:"",location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:de.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,n){this.currentCharacterToken={type:e,chars:n,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e,n;const r=this.currentToken;if(uc(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const i=(e=(n=r.location).attrs)!==null&&e!==void 0?e:n.attrs=Object.create(null);i[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(D.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const e=this.currentToken;this.prepareToken(e),e.tagID=wn(e.tagName),e.type===de.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(D.endTagWithAttributes),e.selfClosing&&this._err(D.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case de.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case de.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case de.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:de.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,n)}_emitCodePoint(e){const n=oc(e)?de.WHITESPACE_CHARACTER:e===T.NULL?de.NULL_CHARACTER:de.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(de.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=A.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?xt.Attribute:xt.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===A.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===A.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===A.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case A.DATA:{this._stateData(e);break}case A.RCDATA:{this._stateRcdata(e);break}case A.RAWTEXT:{this._stateRawtext(e);break}case A.SCRIPT_DATA:{this._stateScriptData(e);break}case A.PLAINTEXT:{this._statePlaintext(e);break}case A.TAG_OPEN:{this._stateTagOpen(e);break}case A.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case A.TAG_NAME:{this._stateTagName(e);break}case A.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case A.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case A.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case A.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case A.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case A.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case A.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case A.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case A.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case A.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case A.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case A.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case A.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case A.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case A.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case A.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case A.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case A.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case A.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case A.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case A.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case A.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case A.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case A.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case A.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case A.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case A.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case A.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case A.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case A.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case A.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case A.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case A.BOGUS_COMMENT:{this._stateBogusComment(e);break}case A.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case A.COMMENT_START:{this._stateCommentStart(e);break}case A.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case A.COMMENT:{this._stateComment(e);break}case A.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case A.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case A.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case A.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case A.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case A.COMMENT_END:{this._stateCommentEnd(e);break}case A.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case A.DOCTYPE:{this._stateDoctype(e);break}case A.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case A.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case A.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case A.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case A.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case A.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case A.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case A.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case A.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case A.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case A.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case A.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case A.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case A.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case A.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case A.CDATA_SECTION:{this._stateCdataSection(e);break}case A.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case A.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case A.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case A.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case T.LESS_THAN_SIGN:{this.state=A.TAG_OPEN;break}case T.AMPERSAND:{this._startCharacterReference();break}case T.NULL:{this._err(D.unexpectedNullCharacter),this._emitCodePoint(e);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case T.AMPERSAND:{this._startCharacterReference();break}case T.LESS_THAN_SIGN:{this.state=A.RCDATA_LESS_THAN_SIGN;break}case T.NULL:{this._err(D.unexpectedNullCharacter),this._emitChars(Re);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case T.LESS_THAN_SIGN:{this.state=A.RAWTEXT_LESS_THAN_SIGN;break}case T.NULL:{this._err(D.unexpectedNullCharacter),this._emitChars(Re);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case T.LESS_THAN_SIGN:{this.state=A.SCRIPT_DATA_LESS_THAN_SIGN;break}case T.NULL:{this._err(D.unexpectedNullCharacter),this._emitChars(Re);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case T.NULL:{this._err(D.unexpectedNullCharacter),this._emitChars(Re);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(wt(e))this._createStartTagToken(),this.state=A.TAG_NAME,this._stateTagName(e);else switch(e){case T.EXCLAMATION_MARK:{this.state=A.MARKUP_DECLARATION_OPEN;break}case T.SOLIDUS:{this.state=A.END_TAG_OPEN;break}case T.QUESTION_MARK:{this._err(D.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=A.BOGUS_COMMENT,this._stateBogusComment(e);break}case T.EOF:{this._err(D.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(D.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=A.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(wt(e))this._createEndTagToken(),this.state=A.TAG_NAME,this._stateTagName(e);else switch(e){case T.GREATER_THAN_SIGN:{this._err(D.missingEndTagName),this.state=A.DATA;break}case T.EOF:{this._err(D.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(D.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=A.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const n=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=A.BEFORE_ATTRIBUTE_NAME;break}case T.SOLIDUS:{this.state=A.SELF_CLOSING_START_TAG;break}case T.GREATER_THAN_SIGN:{this.state=A.DATA,this.emitCurrentTagToken();break}case T.NULL:{this._err(D.unexpectedNullCharacter),n.tagName+=Re;break}case T.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(qn(e)?Rr(e):e)}}_stateRcdataLessThanSign(e){e===T.SOLIDUS?this.state=A.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=A.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){wt(e)?(this.state=A.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=A.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=A.BEFORE_ATTRIBUTE_NAME,!1;case T.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=A.SELF_CLOSING_START_TAG,!1;case T.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=A.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=A.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===T.SOLIDUS?this.state=A.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=A.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){wt(e)?(this.state=A.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=A.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=A.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case T.SOLIDUS:{this.state=A.SCRIPT_DATA_END_TAG_OPEN;break}case T.EXCLAMATION_MARK:{this.state=A.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=A.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){wt(e)?(this.state=A.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=A.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=A.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===T.HYPHEN_MINUS?(this.state=A.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=A.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===T.HYPHEN_MINUS?(this.state=A.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=A.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case T.HYPHEN_MINUS:{this.state=A.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=A.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case T.NULL:{this._err(D.unexpectedNullCharacter),this._emitChars(Re);break}case T.EOF:{this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case T.HYPHEN_MINUS:{this.state=A.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=A.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case T.NULL:{this._err(D.unexpectedNullCharacter),this.state=A.SCRIPT_DATA_ESCAPED,this._emitChars(Re);break}case T.EOF:{this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=A.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case T.HYPHEN_MINUS:{this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=A.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case T.GREATER_THAN_SIGN:{this.state=A.SCRIPT_DATA,this._emitChars(">");break}case T.NULL:{this._err(D.unexpectedNullCharacter),this.state=A.SCRIPT_DATA_ESCAPED,this._emitChars(Re);break}case T.EOF:{this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=A.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===T.SOLIDUS?this.state=A.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:wt(e)?(this._emitChars("<"),this.state=A.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=A.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){wt(e)?(this.state=A.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=A.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=A.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(Ve.SCRIPT,!1)&&Ou(this.preprocessor.peek(Ve.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<Ve.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=A.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case T.HYPHEN_MINUS:{this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case T.NULL:{this._err(D.unexpectedNullCharacter),this._emitChars(Re);break}case T.EOF:{this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case T.HYPHEN_MINUS:{this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case T.NULL:{this._err(D.unexpectedNullCharacter),this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Re);break}case T.EOF:{this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case T.HYPHEN_MINUS:{this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case T.GREATER_THAN_SIGN:{this.state=A.SCRIPT_DATA,this._emitChars(">");break}case T.NULL:{this._err(D.unexpectedNullCharacter),this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Re);break}case T.EOF:{this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===T.SOLIDUS?(this.state=A.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(Ve.SCRIPT,!1)&&Ou(this.preprocessor.peek(Ve.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<Ve.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=A.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.SOLIDUS:case T.GREATER_THAN_SIGN:case T.EOF:{this.state=A.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case T.EQUALS_SIGN:{this._err(D.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=A.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=A.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:case T.SOLIDUS:case T.GREATER_THAN_SIGN:case T.EOF:{this._leaveAttrName(),this.state=A.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case T.EQUALS_SIGN:{this._leaveAttrName(),this.state=A.BEFORE_ATTRIBUTE_VALUE;break}case T.QUOTATION_MARK:case T.APOSTROPHE:case T.LESS_THAN_SIGN:{this._err(D.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break}case T.NULL:{this._err(D.unexpectedNullCharacter),this.currentAttr.name+=Re;break}default:this.currentAttr.name+=String.fromCodePoint(qn(e)?Rr(e):e)}}_stateAfterAttributeName(e){switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.SOLIDUS:{this.state=A.SELF_CLOSING_START_TAG;break}case T.EQUALS_SIGN:{this.state=A.BEFORE_ATTRIBUTE_VALUE;break}case T.GREATER_THAN_SIGN:{this.state=A.DATA,this.emitCurrentTagToken();break}case T.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=A.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.QUOTATION_MARK:{this.state=A.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case T.APOSTROPHE:{this.state=A.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(D.missingAttributeValue),this.state=A.DATA,this.emitCurrentTagToken();break}default:this.state=A.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case T.QUOTATION_MARK:{this.state=A.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case T.AMPERSAND:{this._startCharacterReference();break}case T.NULL:{this._err(D.unexpectedNullCharacter),this.currentAttr.value+=Re;break}case T.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case T.APOSTROPHE:{this.state=A.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case T.AMPERSAND:{this._startCharacterReference();break}case T.NULL:{this._err(D.unexpectedNullCharacter),this.currentAttr.value+=Re;break}case T.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this._leaveAttrValue(),this.state=A.BEFORE_ATTRIBUTE_NAME;break}case T.AMPERSAND:{this._startCharacterReference();break}case T.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=A.DATA,this.emitCurrentTagToken();break}case T.NULL:{this._err(D.unexpectedNullCharacter),this.currentAttr.value+=Re;break}case T.QUOTATION_MARK:case T.APOSTROPHE:case T.LESS_THAN_SIGN:case T.EQUALS_SIGN:case T.GRAVE_ACCENT:{this._err(D.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break}case T.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this._leaveAttrValue(),this.state=A.BEFORE_ATTRIBUTE_NAME;break}case T.SOLIDUS:{this._leaveAttrValue(),this.state=A.SELF_CLOSING_START_TAG;break}case T.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=A.DATA,this.emitCurrentTagToken();break}case T.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:this._err(D.missingWhitespaceBetweenAttributes),this.state=A.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case T.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=A.DATA,this.emitCurrentTagToken();break}case T.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:this._err(D.unexpectedSolidusInTag),this.state=A.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){const n=this.currentToken;switch(e){case T.GREATER_THAN_SIGN:{this.state=A.DATA,this.emitCurrentComment(n);break}case T.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case T.NULL:{this._err(D.unexpectedNullCharacter),n.data+=Re;break}default:n.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(Ve.DASH_DASH,!0)?(this._createCommentToken(Ve.DASH_DASH.length+1),this.state=A.COMMENT_START):this._consumeSequenceIfMatch(Ve.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Ve.DOCTYPE.length+1),this.state=A.DOCTYPE):this._consumeSequenceIfMatch(Ve.CDATA_START,!0)?this.inForeignNode?this.state=A.CDATA_SECTION:(this._err(D.cdataInHtmlContent),this._createCommentToken(Ve.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=A.BOGUS_COMMENT):this._ensureHibernation()||(this._err(D.incorrectlyOpenedComment),this._createCommentToken(2),this.state=A.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case T.HYPHEN_MINUS:{this.state=A.COMMENT_START_DASH;break}case T.GREATER_THAN_SIGN:{this._err(D.abruptClosingOfEmptyComment),this.state=A.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=A.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){const n=this.currentToken;switch(e){case T.HYPHEN_MINUS:{this.state=A.COMMENT_END;break}case T.GREATER_THAN_SIGN:{this._err(D.abruptClosingOfEmptyComment),this.state=A.DATA,this.emitCurrentComment(n);break}case T.EOF:{this._err(D.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=A.COMMENT,this._stateComment(e)}}_stateComment(e){const n=this.currentToken;switch(e){case T.HYPHEN_MINUS:{this.state=A.COMMENT_END_DASH;break}case T.LESS_THAN_SIGN:{n.data+="<",this.state=A.COMMENT_LESS_THAN_SIGN;break}case T.NULL:{this._err(D.unexpectedNullCharacter),n.data+=Re;break}case T.EOF:{this._err(D.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){const n=this.currentToken;switch(e){case T.EXCLAMATION_MARK:{n.data+="!",this.state=A.COMMENT_LESS_THAN_SIGN_BANG;break}case T.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=A.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===T.HYPHEN_MINUS?this.state=A.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=A.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===T.HYPHEN_MINUS?this.state=A.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=A.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==T.GREATER_THAN_SIGN&&e!==T.EOF&&this._err(D.nestedComment),this.state=A.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){const n=this.currentToken;switch(e){case T.HYPHEN_MINUS:{this.state=A.COMMENT_END;break}case T.EOF:{this._err(D.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=A.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){const n=this.currentToken;switch(e){case T.GREATER_THAN_SIGN:{this.state=A.DATA,this.emitCurrentComment(n);break}case T.EXCLAMATION_MARK:{this.state=A.COMMENT_END_BANG;break}case T.HYPHEN_MINUS:{n.data+="-";break}case T.EOF:{this._err(D.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=A.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){const n=this.currentToken;switch(e){case T.HYPHEN_MINUS:{n.data+="--!",this.state=A.COMMENT_END_DASH;break}case T.GREATER_THAN_SIGN:{this._err(D.incorrectlyClosedComment),this.state=A.DATA,this.emitCurrentComment(n);break}case T.EOF:{this._err(D.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=A.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=A.BEFORE_DOCTYPE_NAME;break}case T.GREATER_THAN_SIGN:{this.state=A.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break}case T.EOF:{this._err(D.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(D.missingWhitespaceBeforeDoctypeName),this.state=A.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(qn(e))this._createDoctypeToken(String.fromCharCode(Rr(e))),this.state=A.DOCTYPE_NAME;else switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.NULL:{this._err(D.unexpectedNullCharacter),this._createDoctypeToken(Re),this.state=A.DOCTYPE_NAME;break}case T.GREATER_THAN_SIGN:{this._err(D.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=A.DATA;break}case T.EOF:{this._err(D.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=A.DOCTYPE_NAME}}_stateDoctypeName(e){const n=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=A.AFTER_DOCTYPE_NAME;break}case T.GREATER_THAN_SIGN:{this.state=A.DATA,this.emitCurrentDoctype(n);break}case T.NULL:{this._err(D.unexpectedNullCharacter),n.name+=Re;break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(qn(e)?Rr(e):e)}}_stateAfterDoctypeName(e){const n=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.GREATER_THAN_SIGN:{this.state=A.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Ve.PUBLIC,!1)?this.state=A.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Ve.SYSTEM,!1)?this.state=A.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(D.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=A.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){const n=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=A.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case T.QUOTATION_MARK:{this._err(D.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=A.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{this._err(D.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=A.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(D.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=A.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(D.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=A.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.QUOTATION_MARK:{n.publicId="",this.state=A.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{n.publicId="",this.state=A.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(D.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=A.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(D.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=A.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case T.QUOTATION_MARK:{this.state=A.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case T.NULL:{this._err(D.unexpectedNullCharacter),n.publicId+=Re;break}case T.GREATER_THAN_SIGN:{this._err(D.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=A.DATA;break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case T.APOSTROPHE:{this.state=A.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case T.NULL:{this._err(D.unexpectedNullCharacter),n.publicId+=Re;break}case T.GREATER_THAN_SIGN:{this._err(D.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=A.DATA;break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=A.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case T.GREATER_THAN_SIGN:{this.state=A.DATA,this.emitCurrentDoctype(n);break}case T.QUOTATION_MARK:{this._err(D.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=A.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{this._err(D.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=A.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(D.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=A.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){const n=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=A.DATA;break}case T.QUOTATION_MARK:{n.systemId="",this.state=A.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{n.systemId="",this.state=A.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(D.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=A.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){const n=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=A.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case T.QUOTATION_MARK:{this._err(D.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=A.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{this._err(D.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=A.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(D.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=A.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(D.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=A.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.QUOTATION_MARK:{n.systemId="",this.state=A.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{n.systemId="",this.state=A.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(D.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=A.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(D.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=A.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case T.QUOTATION_MARK:{this.state=A.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case T.NULL:{this._err(D.unexpectedNullCharacter),n.systemId+=Re;break}case T.GREATER_THAN_SIGN:{this._err(D.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=A.DATA;break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case T.APOSTROPHE:{this.state=A.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case T.NULL:{this._err(D.unexpectedNullCharacter),n.systemId+=Re;break}case T.GREATER_THAN_SIGN:{this._err(D.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=A.DATA;break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=A.DATA;break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(D.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=A.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){const n=this.currentToken;switch(e){case T.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=A.DATA;break}case T.NULL:{this._err(D.unexpectedNullCharacter);break}case T.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(e){switch(e){case T.RIGHT_SQUARE_BRACKET:{this.state=A.CDATA_SECTION_BRACKET;break}case T.EOF:{this._err(D.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===T.RIGHT_SQUARE_BRACKET?this.state=A.CDATA_SECTION_END:(this._emitChars("]"),this.state=A.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case T.GREATER_THAN_SIGN:{this.state=A.DATA;break}case T.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=A.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0)if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(T.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&Lu(this.preprocessor.peek(1))?A.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){Lu(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===T.SEMICOLON&&this._err(D.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}}const lc=new Set([c.DD,c.DT,c.LI,c.OPTGROUP,c.OPTION,c.P,c.RB,c.RP,c.RT,c.RTC]),vu=new Set([...lc,c.CAPTION,c.COLGROUP,c.TBODY,c.TD,c.TFOOT,c.TH,c.THEAD,c.TR]),Qr=new Set([c.APPLET,c.CAPTION,c.HTML,c.MARQUEE,c.OBJECT,c.TABLE,c.TD,c.TEMPLATE,c.TH]),mE=new Set([...Qr,c.OL,c.UL]),gE=new Set([...Qr,c.BUTTON]),Du=new Set([c.ANNOTATION_XML,c.MI,c.MN,c.MO,c.MS,c.MTEXT]),Pu=new Set([c.DESC,c.FOREIGN_OBJECT,c.TITLE]),bE=new Set([c.TR,c.TEMPLATE,c.HTML]),EE=new Set([c.TBODY,c.TFOOT,c.THEAD,c.TEMPLATE,c.HTML]),TE=new Set([c.TABLE,c.TEMPLATE,c.HTML]),xE=new Set([c.TD,c.TH]);class _E{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=c.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===c.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===U.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,n){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,n,!0)}pop(){const e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,n){const r=this._indexOf(e);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(e,n,r){const i=this._indexOf(e)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,r),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(e){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(e,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==U.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(e){for(;this.stackTop>=e;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<e)}}popUntilElementPopped(e){const n=this._indexOf(e);this.shortenToLength(Math.max(n,0))}popUntilPopped(e,n){const r=this._indexOfTagNames(e,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(xa,U.HTML)}popUntilTableCellPopped(){this.popUntilPopped(xE,U.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,n){for(let r=this.stackTop;r>=0;r--)if(e.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(e,n){const r=this._indexOfTagNames(e,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(TE,U.HTML)}clearBackToTableBodyContext(){this.clearBackTo(EE,U.HTML)}clearBackToTableRowContext(){this.clearBackTo(bE,U.HTML)}remove(e){const n=this._indexOf(e);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===c.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){const n=this._indexOf(e)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===c.HTML}hasInDynamicScope(e,n){for(let r=this.stackTop;r>=0;r--){const i=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case U.HTML:{if(i===e)return!0;if(n.has(i))return!1;break}case U.SVG:{if(Pu.has(i))return!1;break}case U.MATHML:{if(Du.has(i))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,Qr)}hasInListItemScope(e){return this.hasInDynamicScope(e,mE)}hasInButtonScope(e){return this.hasInDynamicScope(e,gE)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const n=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case U.HTML:{if(xa.has(n))return!0;if(Qr.has(n))return!1;break}case U.SVG:{if(Pu.has(n))return!1;break}case U.MATHML:{if(Du.has(n))return!1;break}}}return!0}hasInTableScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===U.HTML)switch(this.tagIDs[n]){case e:return!0;case c.TABLE:case c.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===U.HTML)switch(this.tagIDs[e]){case c.TBODY:case c.THEAD:case c.TFOOT:return!0;case c.TABLE:case c.HTML:return!1}return!0}hasInSelectScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===U.HTML)switch(this.tagIDs[n]){case e:return!0;case c.OPTION:case c.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&lc.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&vu.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&vu.has(this.currentTagId);)this.pop()}}const ji=3;var mt;(function(t){t[t.Marker=0]="Marker",t[t.Element=1]="Element"})(mt||(mt={}));const Mu={type:mt.Marker};class yE{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,n){const r=[],i=n.length,a=this.treeAdapter.getTagName(e),s=this.treeAdapter.getNamespaceURI(e);for(let u=0;u<this.entries.length;u++){const o=this.entries[u];if(o.type===mt.Marker)break;const{element:l}=o;if(this.treeAdapter.getTagName(l)===a&&this.treeAdapter.getNamespaceURI(l)===s){const f=this.treeAdapter.getAttrList(l);f.length===i&&r.push({idx:u,attrs:f})}}return r}_ensureNoahArkCondition(e){if(this.entries.length<ji)return;const n=this.treeAdapter.getAttrList(e),r=this._getNoahArkConditionCandidates(e,n);if(r.length<ji)return;const i=new Map(n.map(s=>[s.name,s.value]));let a=0;for(let s=0;s<r.length;s++){const u=r[s];u.attrs.every(o=>i.get(o.name)===o.value)&&(a+=1,a>=ji&&this.entries.splice(u.idx,1))}}insertMarker(){this.entries.unshift(Mu)}pushElement(e,n){this._ensureNoahArkCondition(e),this.entries.unshift({type:mt.Element,element:e,token:n})}insertElementAfterBookmark(e,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:mt.Element,element:e,token:n})}removeEntry(e){const n=this.entries.indexOf(e);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const e=this.entries.indexOf(Mu);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const n=this.entries.find(r=>r.type===mt.Marker||this.treeAdapter.getTagName(r.element)===e);return n&&n.type===mt.Element?n:null}getElementEntry(e){return this.entries.find(n=>n.type===mt.Element&&n.element===e)}}const Rt={createDocument(){return{nodeName:"#document",mode:at.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(t,e,n){return{nodeName:t,tagName:t,attrs:n,namespaceURI:e,childNodes:[],parentNode:null}},createCommentNode(t){return{nodeName:"#comment",data:t,parentNode:null}},createTextNode(t){return{nodeName:"#text",value:t,parentNode:null}},appendChild(t,e){t.childNodes.push(e),e.parentNode=t},insertBefore(t,e,n){const r=t.childNodes.indexOf(n);t.childNodes.splice(r,0,e),e.parentNode=t},setTemplateContent(t,e){t.content=e},getTemplateContent(t){return t.content},setDocumentType(t,e,n,r){const i=t.childNodes.find(a=>a.nodeName==="#documentType");if(i)i.name=e,i.publicId=n,i.systemId=r;else{const a={nodeName:"#documentType",name:e,publicId:n,systemId:r,parentNode:null};Rt.appendChild(t,a)}},setDocumentMode(t,e){t.mode=e},getDocumentMode(t){return t.mode},detachNode(t){if(t.parentNode){const e=t.parentNode.childNodes.indexOf(t);t.parentNode.childNodes.splice(e,1),t.parentNode=null}},insertText(t,e){if(t.childNodes.length>0){const n=t.childNodes[t.childNodes.length-1];if(Rt.isTextNode(n)){n.value+=e;return}}Rt.appendChild(t,Rt.createTextNode(e))},insertTextBefore(t,e,n){const r=t.childNodes[t.childNodes.indexOf(n)-1];r&&Rt.isTextNode(r)?r.value+=e:Rt.insertBefore(t,Rt.createTextNode(e),n)},adoptAttributes(t,e){const n=new Set(t.attrs.map(r=>r.name));for(let r=0;r<e.length;r++)n.has(e[r].name)||t.attrs.push(e[r])},getFirstChild(t){return t.childNodes[0]},getChildNodes(t){return t.childNodes},getParentNode(t){return t.parentNode},getAttrList(t){return t.attrs},getTagName(t){return t.tagName},getNamespaceURI(t){return t.namespaceURI},getTextNodeContent(t){return t.value},getCommentNodeContent(t){return t.data},getDocumentTypeNodeName(t){return t.name},getDocumentTypeNodePublicId(t){return t.publicId},getDocumentTypeNodeSystemId(t){return t.systemId},isTextNode(t){return t.nodeName==="#text"},isCommentNode(t){return t.nodeName==="#comment"},isDocumentTypeNode(t){return t.nodeName==="#documentType"},isElementNode(t){return Object.prototype.hasOwnProperty.call(t,"tagName")},setNodeSourceCodeLocation(t,e){t.sourceCodeLocation=e},getNodeSourceCodeLocation(t){return t.sourceCodeLocation},updateNodeSourceCodeLocation(t,e){t.sourceCodeLocation={...t.sourceCodeLocation,...e}}},cc="html",AE="about:legacy-compat",CE="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",dc=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],kE=[...dc,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],SE=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),fc=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],IE=[...fc,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Bu(t,e){return e.some(n=>t.startsWith(n))}function NE(t){return t.name===cc&&t.publicId===null&&(t.systemId===null||t.systemId===AE)}function wE(t){if(t.name!==cc)return at.QUIRKS;const{systemId:e}=t;if(e&&e.toLowerCase()===CE)return at.QUIRKS;let{publicId:n}=t;if(n!==null){if(n=n.toLowerCase(),SE.has(n))return at.QUIRKS;let r=e===null?kE:dc;if(Bu(n,r))return at.QUIRKS;if(r=e===null?fc:IE,Bu(n,r))return at.LIMITED_QUIRKS}return at.NO_QUIRKS}const Fu={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},RE="definitionurl",LE="definitionURL",OE=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(t=>[t.toLowerCase(),t])),vE=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:U.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:U.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:U.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:U.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:U.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:U.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:U.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:U.XML}],["xml:space",{prefix:"xml",name:"space",namespace:U.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:U.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:U.XMLNS}]]),DE=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(t=>[t.toLowerCase(),t])),PE=new Set([c.B,c.BIG,c.BLOCKQUOTE,c.BODY,c.BR,c.CENTER,c.CODE,c.DD,c.DIV,c.DL,c.DT,c.EM,c.EMBED,c.H1,c.H2,c.H3,c.H4,c.H5,c.H6,c.HEAD,c.HR,c.I,c.IMG,c.LI,c.LISTING,c.MENU,c.META,c.NOBR,c.OL,c.P,c.PRE,c.RUBY,c.S,c.SMALL,c.SPAN,c.STRONG,c.STRIKE,c.SUB,c.SUP,c.TABLE,c.TT,c.U,c.UL,c.VAR]);function ME(t){const e=t.tagID;return e===c.FONT&&t.attrs.some(({name:r})=>r===Xt.COLOR||r===Xt.SIZE||r===Xt.FACE)||PE.has(e)}function hc(t){for(let e=0;e<t.attrs.length;e++)if(t.attrs[e].name===RE){t.attrs[e].name=LE;break}}function pc(t){for(let e=0;e<t.attrs.length;e++){const n=OE.get(t.attrs[e].name);n!=null&&(t.attrs[e].name=n)}}function rs(t){for(let e=0;e<t.attrs.length;e++){const n=vE.get(t.attrs[e].name);n&&(t.attrs[e].prefix=n.prefix,t.attrs[e].name=n.name,t.attrs[e].namespace=n.namespace)}}function BE(t){const e=DE.get(t.tagName);e!=null&&(t.tagName=e,t.tagID=wn(t.tagName))}function FE(t,e){return e===U.MATHML&&(t===c.MI||t===c.MO||t===c.MN||t===c.MS||t===c.MTEXT)}function HE(t,e,n){if(e===U.MATHML&&t===c.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===Xt.ENCODING){const i=n[r].value.toLowerCase();return i===Fu.TEXT_HTML||i===Fu.APPLICATION_XML}}return e===U.SVG&&(t===c.FOREIGN_OBJECT||t===c.DESC||t===c.TITLE)}function UE(t,e,n,r){return(!r||r===U.HTML)&&HE(t,e,n)||(!r||r===U.MATHML)&&FE(t,e)}const zE="hidden",jE=8,$E=3;var C;(function(t){t[t.INITIAL=0]="INITIAL",t[t.BEFORE_HTML=1]="BEFORE_HTML",t[t.BEFORE_HEAD=2]="BEFORE_HEAD",t[t.IN_HEAD=3]="IN_HEAD",t[t.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",t[t.AFTER_HEAD=5]="AFTER_HEAD",t[t.IN_BODY=6]="IN_BODY",t[t.TEXT=7]="TEXT",t[t.IN_TABLE=8]="IN_TABLE",t[t.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",t[t.IN_CAPTION=10]="IN_CAPTION",t[t.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",t[t.IN_TABLE_BODY=12]="IN_TABLE_BODY",t[t.IN_ROW=13]="IN_ROW",t[t.IN_CELL=14]="IN_CELL",t[t.IN_SELECT=15]="IN_SELECT",t[t.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",t[t.IN_TEMPLATE=17]="IN_TEMPLATE",t[t.AFTER_BODY=18]="AFTER_BODY",t[t.IN_FRAMESET=19]="IN_FRAMESET",t[t.AFTER_FRAMESET=20]="AFTER_FRAMESET",t[t.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",t[t.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(C||(C={}));const YE={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},mc=new Set([c.TABLE,c.TBODY,c.TFOOT,c.THEAD,c.TR]),Hu={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Rt,onParseError:null};class Uu{constructor(e,n,r=null,i=null){this.fragmentContext=r,this.scriptHandler=i,this.currentToken=null,this.stopped=!1,this.insertionMode=C.INITIAL,this.originalInsertionMode=C.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...Hu,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new pE(this.options,this),this.activeFormattingElements=new yE(this.treeAdapter),this.fragmentContextID=r?wn(this.treeAdapter.getTagName(r)):c.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new _E(this.document,this.treeAdapter,this)}static parse(e,n){const r=new this(n);return r.tokenizer.write(e,!0),r.document}static getFragmentParser(e,n){const r={...Hu,...n};e??(e=r.treeAdapter.createElement(L.TEMPLATE,U.HTML,[]));const i=r.treeAdapter.createElement("documentmock",U.HTML,[]),a=new this(r,i,e);return a.fragmentContextID===c.TEMPLATE&&a.tmplInsertionModeStack.unshift(C.IN_TEMPLATE),a._initTokenizerForFragmentParsing(),a._insertFakeRootElement(),a._resetInsertionMode(),a._findFormInFragmentContext(),a}getFragment(){const e=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,n),n}_err(e,n,r){var i;if(!this.onParseError)return;const a=(i=e.location)!==null&&i!==void 0?i:YE,s={code:n,startLine:a.startLine,startCol:a.startCol,startOffset:a.startOffset,endLine:r?a.startLine:a.endLine,endCol:r?a.startCol:a.endCol,endOffset:r?a.startOffset:a.endOffset};this.onParseError(s)}onItemPush(e,n,r){var i,a;(a=(i=this.treeAdapter).onItemPush)===null||a===void 0||a.call(i,e),r&&this.openElements.stackTop>0&&this._setContextModes(e,n)}onItemPop(e,n){var r,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(i=(r=this.treeAdapter).onItemPop)===null||i===void 0||i.call(r,e,this.openElements.current),n){let a,s;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,s=this.fragmentContextID):{current:a,currentTagId:s}=this.openElements,this._setContextModes(a,s)}}_setContextModes(e,n){const r=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===U.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&e!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,e)}_switchToTextParsing(e,n){this._insertElement(e,U.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=C.TEXT}switchToPlaintextParsing(){this.insertionMode=C.TEXT,this.originalInsertionMode=C.IN_BODY,this.tokenizer.state=ve.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===L.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==U.HTML))switch(this.fragmentContextID){case c.TITLE:case c.TEXTAREA:{this.tokenizer.state=ve.RCDATA;break}case c.STYLE:case c.XMP:case c.IFRAME:case c.NOEMBED:case c.NOFRAMES:case c.NOSCRIPT:{this.tokenizer.state=ve.RAWTEXT;break}case c.SCRIPT:{this.tokenizer.state=ve.SCRIPT_DATA;break}case c.PLAINTEXT:{this.tokenizer.state=ve.PLAINTEXT;break}}}_setDocumentType(e){const n=e.name||"",r=e.publicId||"",i=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,i),e.location){const s=this.treeAdapter.getChildNodes(this.document).find(u=>this.treeAdapter.isDocumentTypeNode(u));s&&this.treeAdapter.setNodeSourceCodeLocation(s,e.location)}}_attachElementToTree(e,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(e,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,e)}}_appendElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location)}_insertElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location),this.openElements.push(r,e.tagID)}_insertFakeElement(e,n){const r=this.treeAdapter.createElement(e,U.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(e){const n=this.treeAdapter.createElement(e.tagName,U.HTML,e.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const e=this.treeAdapter.createElement(L.HTML,U.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,c.HTML)}_appendCommentNode(e,n){const r=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,e.location)}_insertCharacters(e){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,e.chars,r):this.treeAdapter.insertText(n,e.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,e.chars)),!e.location)return;const i=this.treeAdapter.getChildNodes(n),a=r?i.lastIndexOf(r):i.length,s=i[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(s)){const{endLine:o,endCol:l,endOffset:f}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(s,{endLine:o,endCol:l,endOffset:f})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,e.location)}_adoptNodes(e,n){for(let r=this.treeAdapter.getFirstChild(e);r;r=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(e,n){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&n.location){const r=n.location,i=this.treeAdapter.getTagName(e),a=n.type===de.END_TAG&&i===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,a)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,e.tagID===c.SVG&&this.treeAdapter.getTagName(n)===L.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===U.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===c.MGLYPH||e.tagID===c.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,U.HTML)}_processToken(e){switch(e.type){case de.CHARACTER:{this.onCharacter(e);break}case de.NULL_CHARACTER:{this.onNullCharacter(e);break}case de.COMMENT:{this.onComment(e);break}case de.DOCTYPE:{this.onDoctype(e);break}case de.START_TAG:{this._processStartTag(e);break}case de.END_TAG:{this.onEndTag(e);break}case de.EOF:{this.onEof(e);break}case de.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,n,r){const i=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return UE(e,i,a,r)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===mt.Marker||this.openElements.contains(i.element)),r=n===-1?e-1:n-1;for(let i=r;i>=0;i--){const a=this.activeFormattingElements.entries[i];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=C.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(c.P),this.openElements.popUntilTagNamePopped(c.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case c.TR:{this.insertionMode=C.IN_ROW;return}case c.TBODY:case c.THEAD:case c.TFOOT:{this.insertionMode=C.IN_TABLE_BODY;return}case c.CAPTION:{this.insertionMode=C.IN_CAPTION;return}case c.COLGROUP:{this.insertionMode=C.IN_COLUMN_GROUP;return}case c.TABLE:{this.insertionMode=C.IN_TABLE;return}case c.BODY:{this.insertionMode=C.IN_BODY;return}case c.FRAMESET:{this.insertionMode=C.IN_FRAMESET;return}case c.SELECT:{this._resetInsertionModeForSelect(e);return}case c.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case c.HTML:{this.insertionMode=this.headElement?C.AFTER_HEAD:C.BEFORE_HEAD;return}case c.TD:case c.TH:{if(e>0){this.insertionMode=C.IN_CELL;return}break}case c.HEAD:{if(e>0){this.insertionMode=C.IN_HEAD;return}break}}this.insertionMode=C.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let n=e-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===c.TEMPLATE)break;if(r===c.TABLE){this.insertionMode=C.IN_SELECT_IN_TABLE;return}}this.insertionMode=C.IN_SELECT}_isElementCausesFosterParenting(e){return mc.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){const n=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case c.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===U.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case c.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,e,n.beforeElement):this.treeAdapter.appendChild(n.parent,e)}_isSpecialElement(e,n){const r=this.treeAdapter.getNamespaceURI(e);return cE[r].has(n)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){xT(this,e);return}switch(this.insertionMode){case C.INITIAL:{Un(this,e);break}case C.BEFORE_HTML:{Jn(this,e);break}case C.BEFORE_HEAD:{er(this,e);break}case C.IN_HEAD:{tr(this,e);break}case C.IN_HEAD_NO_SCRIPT:{nr(this,e);break}case C.AFTER_HEAD:{rr(this,e);break}case C.IN_BODY:case C.IN_CAPTION:case C.IN_CELL:case C.IN_TEMPLATE:{bc(this,e);break}case C.TEXT:case C.IN_SELECT:case C.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case C.IN_TABLE:case C.IN_TABLE_BODY:case C.IN_ROW:{$i(this,e);break}case C.IN_TABLE_TEXT:{Ac(this,e);break}case C.IN_COLUMN_GROUP:{Xr(this,e);break}case C.AFTER_BODY:{Zr(this,e);break}case C.AFTER_AFTER_BODY:{Ur(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){TT(this,e);return}switch(this.insertionMode){case C.INITIAL:{Un(this,e);break}case C.BEFORE_HTML:{Jn(this,e);break}case C.BEFORE_HEAD:{er(this,e);break}case C.IN_HEAD:{tr(this,e);break}case C.IN_HEAD_NO_SCRIPT:{nr(this,e);break}case C.AFTER_HEAD:{rr(this,e);break}case C.TEXT:{this._insertCharacters(e);break}case C.IN_TABLE:case C.IN_TABLE_BODY:case C.IN_ROW:{$i(this,e);break}case C.IN_COLUMN_GROUP:{Xr(this,e);break}case C.AFTER_BODY:{Zr(this,e);break}case C.AFTER_AFTER_BODY:{Ur(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){_a(this,e);return}switch(this.insertionMode){case C.INITIAL:case C.BEFORE_HTML:case C.BEFORE_HEAD:case C.IN_HEAD:case C.IN_HEAD_NO_SCRIPT:case C.AFTER_HEAD:case C.IN_BODY:case C.IN_TABLE:case C.IN_CAPTION:case C.IN_COLUMN_GROUP:case C.IN_TABLE_BODY:case C.IN_ROW:case C.IN_CELL:case C.IN_SELECT:case C.IN_SELECT_IN_TABLE:case C.IN_TEMPLATE:case C.IN_FRAMESET:case C.AFTER_FRAMESET:{_a(this,e);break}case C.IN_TABLE_TEXT:{zn(this,e);break}case C.AFTER_BODY:{ZE(this,e);break}case C.AFTER_AFTER_BODY:case C.AFTER_AFTER_FRAMESET:{KE(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case C.INITIAL:{JE(this,e);break}case C.BEFORE_HEAD:case C.IN_HEAD:case C.IN_HEAD_NO_SCRIPT:case C.AFTER_HEAD:{this._err(e,D.misplacedDoctype);break}case C.IN_TABLE_TEXT:{zn(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,D.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?_T(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case C.INITIAL:{Un(this,e);break}case C.BEFORE_HTML:{e2(this,e);break}case C.BEFORE_HEAD:{n2(this,e);break}case C.IN_HEAD:{dt(this,e);break}case C.IN_HEAD_NO_SCRIPT:{a2(this,e);break}case C.AFTER_HEAD:{u2(this,e);break}case C.IN_BODY:{ze(this,e);break}case C.IN_TABLE:{Cn(this,e);break}case C.IN_TABLE_TEXT:{zn(this,e);break}case C.IN_CAPTION:{rT(this,e);break}case C.IN_COLUMN_GROUP:{ss(this,e);break}case C.IN_TABLE_BODY:{bi(this,e);break}case C.IN_ROW:{Ei(this,e);break}case C.IN_CELL:{sT(this,e);break}case C.IN_SELECT:{Sc(this,e);break}case C.IN_SELECT_IN_TABLE:{oT(this,e);break}case C.IN_TEMPLATE:{cT(this,e);break}case C.AFTER_BODY:{fT(this,e);break}case C.IN_FRAMESET:{hT(this,e);break}case C.AFTER_FRAMESET:{mT(this,e);break}case C.AFTER_AFTER_BODY:{bT(this,e);break}case C.AFTER_AFTER_FRAMESET:{ET(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?yT(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case C.INITIAL:{Un(this,e);break}case C.BEFORE_HTML:{t2(this,e);break}case C.BEFORE_HEAD:{r2(this,e);break}case C.IN_HEAD:{i2(this,e);break}case C.IN_HEAD_NO_SCRIPT:{s2(this,e);break}case C.AFTER_HEAD:{o2(this,e);break}case C.IN_BODY:{gi(this,e);break}case C.TEXT:{W2(this,e);break}case C.IN_TABLE:{cr(this,e);break}case C.IN_TABLE_TEXT:{zn(this,e);break}case C.IN_CAPTION:{iT(this,e);break}case C.IN_COLUMN_GROUP:{aT(this,e);break}case C.IN_TABLE_BODY:{ya(this,e);break}case C.IN_ROW:{kc(this,e);break}case C.IN_CELL:{uT(this,e);break}case C.IN_SELECT:{Ic(this,e);break}case C.IN_SELECT_IN_TABLE:{lT(this,e);break}case C.IN_TEMPLATE:{dT(this,e);break}case C.AFTER_BODY:{wc(this,e);break}case C.IN_FRAMESET:{pT(this,e);break}case C.AFTER_FRAMESET:{gT(this,e);break}case C.AFTER_AFTER_BODY:{Ur(this,e);break}}}onEof(e){switch(this.insertionMode){case C.INITIAL:{Un(this,e);break}case C.BEFORE_HTML:{Jn(this,e);break}case C.BEFORE_HEAD:{er(this,e);break}case C.IN_HEAD:{tr(this,e);break}case C.IN_HEAD_NO_SCRIPT:{nr(this,e);break}case C.AFTER_HEAD:{rr(this,e);break}case C.IN_BODY:case C.IN_TABLE:case C.IN_CAPTION:case C.IN_COLUMN_GROUP:case C.IN_TABLE_BODY:case C.IN_ROW:case C.IN_CELL:case C.IN_SELECT:case C.IN_SELECT_IN_TABLE:{_c(this,e);break}case C.TEXT:{G2(this,e);break}case C.IN_TABLE_TEXT:{zn(this,e);break}case C.IN_TEMPLATE:{Nc(this,e);break}case C.AFTER_BODY:case C.IN_FRAMESET:case C.AFTER_FRAMESET:case C.AFTER_AFTER_BODY:case C.AFTER_AFTER_FRAMESET:{as(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===T.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case C.IN_HEAD:case C.IN_HEAD_NO_SCRIPT:case C.AFTER_HEAD:case C.TEXT:case C.IN_COLUMN_GROUP:case C.IN_SELECT:case C.IN_SELECT_IN_TABLE:case C.IN_FRAMESET:case C.AFTER_FRAMESET:{this._insertCharacters(e);break}case C.IN_BODY:case C.IN_CAPTION:case C.IN_CELL:case C.IN_TEMPLATE:case C.AFTER_BODY:case C.AFTER_AFTER_BODY:case C.AFTER_AFTER_FRAMESET:{gc(this,e);break}case C.IN_TABLE:case C.IN_TABLE_BODY:case C.IN_ROW:{$i(this,e);break}case C.IN_TABLE_TEXT:{yc(this,e);break}}}}function qE(t,e){let n=t.activeFormattingElements.getElementEntryInScopeWithTagName(e.tagName);return n?t.openElements.contains(n.element)?t.openElements.hasInScope(e.tagID)||(n=null):(t.activeFormattingElements.removeEntry(n),n=null):xc(t,e),n}function VE(t,e){let n=null,r=t.openElements.stackTop;for(;r>=0;r--){const i=t.openElements.items[r];if(i===e.element)break;t._isSpecialElement(i,t.openElements.tagIDs[r])&&(n=i)}return n||(t.openElements.shortenToLength(Math.max(r,0)),t.activeFormattingElements.removeEntry(e)),n}function WE(t,e,n){let r=e,i=t.openElements.getCommonAncestor(e);for(let a=0,s=i;s!==n;a++,s=i){i=t.openElements.getCommonAncestor(s);const u=t.activeFormattingElements.getElementEntry(s),o=u&&a>=$E;!u||o?(o&&t.activeFormattingElements.removeEntry(u),t.openElements.remove(s)):(s=GE(t,u),r===e&&(t.activeFormattingElements.bookmark=u),t.treeAdapter.detachNode(r),t.treeAdapter.appendChild(s,r),r=s)}return r}function GE(t,e){const n=t.treeAdapter.getNamespaceURI(e.element),r=t.treeAdapter.createElement(e.token.tagName,n,e.token.attrs);return t.openElements.replace(e.element,r),e.element=r,r}function QE(t,e,n){const r=t.treeAdapter.getTagName(e),i=wn(r);if(t._isElementCausesFosterParenting(i))t._fosterParentElement(n);else{const a=t.treeAdapter.getNamespaceURI(e);i===c.TEMPLATE&&a===U.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,n)}}function XE(t,e,n){const r=t.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=t.treeAdapter.createElement(i.tagName,r,i.attrs);t._adoptNodes(e,a),t.treeAdapter.appendChild(e,a),t.activeFormattingElements.insertElementAfterBookmark(a,i),t.activeFormattingElements.removeEntry(n),t.openElements.remove(n.element),t.openElements.insertAfter(e,a,i.tagID)}function is(t,e){for(let n=0;n<jE;n++){const r=qE(t,e);if(!r)break;const i=VE(t,r);if(!i)break;t.activeFormattingElements.bookmark=r;const a=WE(t,i,r.element),s=t.openElements.getCommonAncestor(r.element);t.treeAdapter.detachNode(a),s&&QE(t,s,a),XE(t,i,r)}}function _a(t,e){t._appendCommentNode(e,t.openElements.currentTmplContentOrNode)}function ZE(t,e){t._appendCommentNode(e,t.openElements.items[0])}function KE(t,e){t._appendCommentNode(e,t.document)}function as(t,e){if(t.stopped=!0,e.location){const n=t.fragmentContext?0:2;for(let r=t.openElements.stackTop;r>=n;r--)t._setEndLocation(t.openElements.items[r],e);if(!t.fragmentContext&&t.openElements.stackTop>=0){const r=t.openElements.items[0],i=t.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(t._setEndLocation(r,e),t.openElements.stackTop>=1)){const a=t.openElements.items[1],s=t.treeAdapter.getNodeSourceCodeLocation(a);s&&!s.endTag&&t._setEndLocation(a,e)}}}}function JE(t,e){t._setDocumentType(e);const n=e.forceQuirks?at.QUIRKS:wE(e);NE(e)||t._err(e,D.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,n),t.insertionMode=C.BEFORE_HTML}function Un(t,e){t._err(e,D.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,at.QUIRKS),t.insertionMode=C.BEFORE_HTML,t._processToken(e)}function e2(t,e){e.tagID===c.HTML?(t._insertElement(e,U.HTML),t.insertionMode=C.BEFORE_HEAD):Jn(t,e)}function t2(t,e){const n=e.tagID;(n===c.HTML||n===c.HEAD||n===c.BODY||n===c.BR)&&Jn(t,e)}function Jn(t,e){t._insertFakeRootElement(),t.insertionMode=C.BEFORE_HEAD,t._processToken(e)}function n2(t,e){switch(e.tagID){case c.HTML:{ze(t,e);break}case c.HEAD:{t._insertElement(e,U.HTML),t.headElement=t.openElements.current,t.insertionMode=C.IN_HEAD;break}default:er(t,e)}}function r2(t,e){const n=e.tagID;n===c.HEAD||n===c.BODY||n===c.HTML||n===c.BR?er(t,e):t._err(e,D.endTagWithoutMatchingOpenElement)}function er(t,e){t._insertFakeElement(L.HEAD,c.HEAD),t.headElement=t.openElements.current,t.insertionMode=C.IN_HEAD,t._processToken(e)}function dt(t,e){switch(e.tagID){case c.HTML:{ze(t,e);break}case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:{t._appendElement(e,U.HTML),e.ackSelfClosing=!0;break}case c.TITLE:{t._switchToTextParsing(e,ve.RCDATA);break}case c.NOSCRIPT:{t.options.scriptingEnabled?t._switchToTextParsing(e,ve.RAWTEXT):(t._insertElement(e,U.HTML),t.insertionMode=C.IN_HEAD_NO_SCRIPT);break}case c.NOFRAMES:case c.STYLE:{t._switchToTextParsing(e,ve.RAWTEXT);break}case c.SCRIPT:{t._switchToTextParsing(e,ve.SCRIPT_DATA);break}case c.TEMPLATE:{t._insertTemplate(e),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=C.IN_TEMPLATE,t.tmplInsertionModeStack.unshift(C.IN_TEMPLATE);break}case c.HEAD:{t._err(e,D.misplacedStartTagForHeadElement);break}default:tr(t,e)}}function i2(t,e){switch(e.tagID){case c.HEAD:{t.openElements.pop(),t.insertionMode=C.AFTER_HEAD;break}case c.BODY:case c.BR:case c.HTML:{tr(t,e);break}case c.TEMPLATE:{un(t,e);break}default:t._err(e,D.endTagWithoutMatchingOpenElement)}}function un(t,e){t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagId!==c.TEMPLATE&&t._err(e,D.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(c.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode()):t._err(e,D.endTagWithoutMatchingOpenElement)}function tr(t,e){t.openElements.pop(),t.insertionMode=C.AFTER_HEAD,t._processToken(e)}function a2(t,e){switch(e.tagID){case c.HTML:{ze(t,e);break}case c.BASEFONT:case c.BGSOUND:case c.HEAD:case c.LINK:case c.META:case c.NOFRAMES:case c.STYLE:{dt(t,e);break}case c.NOSCRIPT:{t._err(e,D.nestedNoscriptInHead);break}default:nr(t,e)}}function s2(t,e){switch(e.tagID){case c.NOSCRIPT:{t.openElements.pop(),t.insertionMode=C.IN_HEAD;break}case c.BR:{nr(t,e);break}default:t._err(e,D.endTagWithoutMatchingOpenElement)}}function nr(t,e){const n=e.type===de.EOF?D.openElementsLeftAfterEof:D.disallowedContentInNoscriptInHead;t._err(e,n),t.openElements.pop(),t.insertionMode=C.IN_HEAD,t._processToken(e)}function u2(t,e){switch(e.tagID){case c.HTML:{ze(t,e);break}case c.BODY:{t._insertElement(e,U.HTML),t.framesetOk=!1,t.insertionMode=C.IN_BODY;break}case c.FRAMESET:{t._insertElement(e,U.HTML),t.insertionMode=C.IN_FRAMESET;break}case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:case c.NOFRAMES:case c.SCRIPT:case c.STYLE:case c.TEMPLATE:case c.TITLE:{t._err(e,D.abandonedHeadElementChild),t.openElements.push(t.headElement,c.HEAD),dt(t,e),t.openElements.remove(t.headElement);break}case c.HEAD:{t._err(e,D.misplacedStartTagForHeadElement);break}default:rr(t,e)}}function o2(t,e){switch(e.tagID){case c.BODY:case c.HTML:case c.BR:{rr(t,e);break}case c.TEMPLATE:{un(t,e);break}default:t._err(e,D.endTagWithoutMatchingOpenElement)}}function rr(t,e){t._insertFakeElement(L.BODY,c.BODY),t.insertionMode=C.IN_BODY,mi(t,e)}function mi(t,e){switch(e.type){case de.CHARACTER:{bc(t,e);break}case de.WHITESPACE_CHARACTER:{gc(t,e);break}case de.COMMENT:{_a(t,e);break}case de.START_TAG:{ze(t,e);break}case de.END_TAG:{gi(t,e);break}case de.EOF:{_c(t,e);break}}}function gc(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function bc(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function l2(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function c2(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(n,e.attrs))}function d2(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();t.framesetOk&&n&&(t.treeAdapter.detachNode(n),t.openElements.popAllUpToHtmlElement(),t._insertElement(e,U.HTML),t.insertionMode=C.IN_FRAMESET)}function f2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,U.HTML)}function h2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t.openElements.currentTagId!==void 0&&xa.has(t.openElements.currentTagId)&&t.openElements.pop(),t._insertElement(e,U.HTML)}function p2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,U.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function m2(t,e){const n=t.openElements.tmplCount>0;(!t.formElement||n)&&(t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,U.HTML),n||(t.formElement=t.openElements.current))}function g2(t,e){t.framesetOk=!1;const n=e.tagID;for(let r=t.openElements.stackTop;r>=0;r--){const i=t.openElements.tagIDs[r];if(n===c.LI&&i===c.LI||(n===c.DD||n===c.DT)&&(i===c.DD||i===c.DT)){t.openElements.generateImpliedEndTagsWithExclusion(i),t.openElements.popUntilTagNamePopped(i);break}if(i!==c.ADDRESS&&i!==c.DIV&&i!==c.P&&t._isSpecialElement(t.openElements.items[r],i))break}t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,U.HTML)}function b2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,U.HTML),t.tokenizer.state=ve.PLAINTEXT}function E2(t,e){t.openElements.hasInScope(c.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.BUTTON)),t._reconstructActiveFormattingElements(),t._insertElement(e,U.HTML),t.framesetOk=!1}function T2(t,e){const n=t.activeFormattingElements.getElementEntryInScopeWithTagName(L.A);n&&(is(t,e),t.openElements.remove(n.element),t.activeFormattingElements.removeEntry(n)),t._reconstructActiveFormattingElements(),t._insertElement(e,U.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function x2(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,U.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function _2(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(c.NOBR)&&(is(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,U.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function y2(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,U.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function A2(t,e){t.treeAdapter.getDocumentMode(t.document)!==at.QUIRKS&&t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,U.HTML),t.framesetOk=!1,t.insertionMode=C.IN_TABLE}function Ec(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,U.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function Tc(t){const e=uc(t,Xt.TYPE);return e!=null&&e.toLowerCase()===zE}function C2(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,U.HTML),Tc(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}function k2(t,e){t._appendElement(e,U.HTML),e.ackSelfClosing=!0}function S2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._appendElement(e,U.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function I2(t,e){e.tagName=L.IMG,e.tagID=c.IMG,Ec(t,e)}function N2(t,e){t._insertElement(e,U.HTML),t.skipNextNewLine=!0,t.tokenizer.state=ve.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=C.TEXT}function w2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._reconstructActiveFormattingElements(),t.framesetOk=!1,t._switchToTextParsing(e,ve.RAWTEXT)}function R2(t,e){t.framesetOk=!1,t._switchToTextParsing(e,ve.RAWTEXT)}function zu(t,e){t._switchToTextParsing(e,ve.RAWTEXT)}function L2(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,U.HTML),t.framesetOk=!1,t.insertionMode=t.insertionMode===C.IN_TABLE||t.insertionMode===C.IN_CAPTION||t.insertionMode===C.IN_TABLE_BODY||t.insertionMode===C.IN_ROW||t.insertionMode===C.IN_CELL?C.IN_SELECT_IN_TABLE:C.IN_SELECT}function O2(t,e){t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,U.HTML)}function v2(t,e){t.openElements.hasInScope(c.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,U.HTML)}function D2(t,e){t.openElements.hasInScope(c.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(c.RTC),t._insertElement(e,U.HTML)}function P2(t,e){t._reconstructActiveFormattingElements(),hc(e),rs(e),e.selfClosing?t._appendElement(e,U.MATHML):t._insertElement(e,U.MATHML),e.ackSelfClosing=!0}function M2(t,e){t._reconstructActiveFormattingElements(),pc(e),rs(e),e.selfClosing?t._appendElement(e,U.SVG):t._insertElement(e,U.SVG),e.ackSelfClosing=!0}function ju(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,U.HTML)}function ze(t,e){switch(e.tagID){case c.I:case c.S:case c.B:case c.U:case c.EM:case c.TT:case c.BIG:case c.CODE:case c.FONT:case c.SMALL:case c.STRIKE:case c.STRONG:{x2(t,e);break}case c.A:{T2(t,e);break}case c.H1:case c.H2:case c.H3:case c.H4:case c.H5:case c.H6:{h2(t,e);break}case c.P:case c.DL:case c.OL:case c.UL:case c.DIV:case c.DIR:case c.NAV:case c.MAIN:case c.MENU:case c.ASIDE:case c.CENTER:case c.FIGURE:case c.FOOTER:case c.HEADER:case c.HGROUP:case c.DIALOG:case c.DETAILS:case c.ADDRESS:case c.ARTICLE:case c.SEARCH:case c.SECTION:case c.SUMMARY:case c.FIELDSET:case c.BLOCKQUOTE:case c.FIGCAPTION:{f2(t,e);break}case c.LI:case c.DD:case c.DT:{g2(t,e);break}case c.BR:case c.IMG:case c.WBR:case c.AREA:case c.EMBED:case c.KEYGEN:{Ec(t,e);break}case c.HR:{S2(t,e);break}case c.RB:case c.RTC:{v2(t,e);break}case c.RT:case c.RP:{D2(t,e);break}case c.PRE:case c.LISTING:{p2(t,e);break}case c.XMP:{w2(t,e);break}case c.SVG:{M2(t,e);break}case c.HTML:{l2(t,e);break}case c.BASE:case c.LINK:case c.META:case c.STYLE:case c.TITLE:case c.SCRIPT:case c.BGSOUND:case c.BASEFONT:case c.TEMPLATE:{dt(t,e);break}case c.BODY:{c2(t,e);break}case c.FORM:{m2(t,e);break}case c.NOBR:{_2(t,e);break}case c.MATH:{P2(t,e);break}case c.TABLE:{A2(t,e);break}case c.INPUT:{C2(t,e);break}case c.PARAM:case c.TRACK:case c.SOURCE:{k2(t,e);break}case c.IMAGE:{I2(t,e);break}case c.BUTTON:{E2(t,e);break}case c.APPLET:case c.OBJECT:case c.MARQUEE:{y2(t,e);break}case c.IFRAME:{R2(t,e);break}case c.SELECT:{L2(t,e);break}case c.OPTION:case c.OPTGROUP:{O2(t,e);break}case c.NOEMBED:case c.NOFRAMES:{zu(t,e);break}case c.FRAMESET:{d2(t,e);break}case c.TEXTAREA:{N2(t,e);break}case c.NOSCRIPT:{t.options.scriptingEnabled?zu(t,e):ju(t,e);break}case c.PLAINTEXT:{b2(t,e);break}case c.COL:case c.TH:case c.TD:case c.TR:case c.HEAD:case c.FRAME:case c.TBODY:case c.TFOOT:case c.THEAD:case c.CAPTION:case c.COLGROUP:break;default:ju(t,e)}}function B2(t,e){if(t.openElements.hasInScope(c.BODY)&&(t.insertionMode=C.AFTER_BODY,t.options.sourceCodeLocationInfo)){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t._setEndLocation(n,e)}}function F2(t,e){t.openElements.hasInScope(c.BODY)&&(t.insertionMode=C.AFTER_BODY,wc(t,e))}function H2(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n))}function U2(t){const e=t.openElements.tmplCount>0,{formElement:n}=t;e||(t.formElement=null),(n||e)&&t.openElements.hasInScope(c.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(c.FORM):n&&t.openElements.remove(n))}function z2(t){t.openElements.hasInButtonScope(c.P)||t._insertFakeElement(L.P,c.P),t._closePElement()}function j2(t){t.openElements.hasInListItemScope(c.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(c.LI),t.openElements.popUntilTagNamePopped(c.LI))}function $2(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTagsWithExclusion(n),t.openElements.popUntilTagNamePopped(n))}function Y2(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function q2(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker())}function V2(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(L.BR,c.BR),t.openElements.pop(),t.framesetOk=!1}function xc(t,e){const n=e.tagName,r=e.tagID;for(let i=t.openElements.stackTop;i>0;i--){const a=t.openElements.items[i],s=t.openElements.tagIDs[i];if(r===s&&(r!==c.UNKNOWN||t.treeAdapter.getTagName(a)===n)){t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.stackTop>=i&&t.openElements.shortenToLength(i);break}if(t._isSpecialElement(a,s))break}}function gi(t,e){switch(e.tagID){case c.A:case c.B:case c.I:case c.S:case c.U:case c.EM:case c.TT:case c.BIG:case c.CODE:case c.FONT:case c.NOBR:case c.SMALL:case c.STRIKE:case c.STRONG:{is(t,e);break}case c.P:{z2(t);break}case c.DL:case c.UL:case c.OL:case c.DIR:case c.DIV:case c.NAV:case c.PRE:case c.MAIN:case c.MENU:case c.ASIDE:case c.BUTTON:case c.CENTER:case c.FIGURE:case c.FOOTER:case c.HEADER:case c.HGROUP:case c.DIALOG:case c.ADDRESS:case c.ARTICLE:case c.DETAILS:case c.SEARCH:case c.SECTION:case c.SUMMARY:case c.LISTING:case c.FIELDSET:case c.BLOCKQUOTE:case c.FIGCAPTION:{H2(t,e);break}case c.LI:{j2(t);break}case c.DD:case c.DT:{$2(t,e);break}case c.H1:case c.H2:case c.H3:case c.H4:case c.H5:case c.H6:{Y2(t);break}case c.BR:{V2(t);break}case c.BODY:{B2(t,e);break}case c.HTML:{F2(t,e);break}case c.FORM:{U2(t);break}case c.APPLET:case c.OBJECT:case c.MARQUEE:{q2(t,e);break}case c.TEMPLATE:{un(t,e);break}default:xc(t,e)}}function _c(t,e){t.tmplInsertionModeStack.length>0?Nc(t,e):as(t,e)}function W2(t,e){var n;e.tagID===c.SCRIPT&&((n=t.scriptHandler)===null||n===void 0||n.call(t,t.openElements.current)),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}function G2(t,e){t._err(e,D.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}function $i(t,e){if(t.openElements.currentTagId!==void 0&&mc.has(t.openElements.currentTagId))switch(t.pendingCharacterTokens.length=0,t.hasNonWhitespacePendingCharacterToken=!1,t.originalInsertionMode=t.insertionMode,t.insertionMode=C.IN_TABLE_TEXT,e.type){case de.CHARACTER:{Ac(t,e);break}case de.WHITESPACE_CHARACTER:{yc(t,e);break}}else yr(t,e)}function Q2(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,U.HTML),t.insertionMode=C.IN_CAPTION}function X2(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,U.HTML),t.insertionMode=C.IN_COLUMN_GROUP}function Z2(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(L.COLGROUP,c.COLGROUP),t.insertionMode=C.IN_COLUMN_GROUP,ss(t,e)}function K2(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,U.HTML),t.insertionMode=C.IN_TABLE_BODY}function J2(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(L.TBODY,c.TBODY),t.insertionMode=C.IN_TABLE_BODY,bi(t,e)}function eT(t,e){t.openElements.hasInTableScope(c.TABLE)&&(t.openElements.popUntilTagNamePopped(c.TABLE),t._resetInsertionMode(),t._processStartTag(e))}function tT(t,e){Tc(e)?t._appendElement(e,U.HTML):yr(t,e),e.ackSelfClosing=!0}function nT(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,U.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function Cn(t,e){switch(e.tagID){case c.TD:case c.TH:case c.TR:{J2(t,e);break}case c.STYLE:case c.SCRIPT:case c.TEMPLATE:{dt(t,e);break}case c.COL:{Z2(t,e);break}case c.FORM:{nT(t,e);break}case c.TABLE:{eT(t,e);break}case c.TBODY:case c.TFOOT:case c.THEAD:{K2(t,e);break}case c.INPUT:{tT(t,e);break}case c.CAPTION:{Q2(t,e);break}case c.COLGROUP:{X2(t,e);break}default:yr(t,e)}}function cr(t,e){switch(e.tagID){case c.TABLE:{t.openElements.hasInTableScope(c.TABLE)&&(t.openElements.popUntilTagNamePopped(c.TABLE),t._resetInsertionMode());break}case c.TEMPLATE:{un(t,e);break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TBODY:case c.TD:case c.TFOOT:case c.TH:case c.THEAD:case c.TR:break;default:yr(t,e)}}function yr(t,e){const n=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,mi(t,e),t.fosterParentingEnabled=n}function yc(t,e){t.pendingCharacterTokens.push(e)}function Ac(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function zn(t,e){let n=0;if(t.hasNonWhitespacePendingCharacterToken)for(;n<t.pendingCharacterTokens.length;n++)yr(t,t.pendingCharacterTokens[n]);else for(;n<t.pendingCharacterTokens.length;n++)t._insertCharacters(t.pendingCharacterTokens[n]);t.insertionMode=t.originalInsertionMode,t._processToken(e)}const Cc=new Set([c.CAPTION,c.COL,c.COLGROUP,c.TBODY,c.TD,c.TFOOT,c.TH,c.THEAD,c.TR]);function rT(t,e){const n=e.tagID;Cc.has(n)?t.openElements.hasInTableScope(c.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=C.IN_TABLE,Cn(t,e)):ze(t,e)}function iT(t,e){const n=e.tagID;switch(n){case c.CAPTION:case c.TABLE:{t.openElements.hasInTableScope(c.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=C.IN_TABLE,n===c.TABLE&&cr(t,e));break}case c.BODY:case c.COL:case c.COLGROUP:case c.HTML:case c.TBODY:case c.TD:case c.TFOOT:case c.TH:case c.THEAD:case c.TR:break;default:gi(t,e)}}function ss(t,e){switch(e.tagID){case c.HTML:{ze(t,e);break}case c.COL:{t._appendElement(e,U.HTML),e.ackSelfClosing=!0;break}case c.TEMPLATE:{dt(t,e);break}default:Xr(t,e)}}function aT(t,e){switch(e.tagID){case c.COLGROUP:{t.openElements.currentTagId===c.COLGROUP&&(t.openElements.pop(),t.insertionMode=C.IN_TABLE);break}case c.TEMPLATE:{un(t,e);break}case c.COL:break;default:Xr(t,e)}}function Xr(t,e){t.openElements.currentTagId===c.COLGROUP&&(t.openElements.pop(),t.insertionMode=C.IN_TABLE,t._processToken(e))}function bi(t,e){switch(e.tagID){case c.TR:{t.openElements.clearBackToTableBodyContext(),t._insertElement(e,U.HTML),t.insertionMode=C.IN_ROW;break}case c.TH:case c.TD:{t.openElements.clearBackToTableBodyContext(),t._insertFakeElement(L.TR,c.TR),t.insertionMode=C.IN_ROW,Ei(t,e);break}case c.CAPTION:case c.COL:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=C.IN_TABLE,Cn(t,e));break}default:Cn(t,e)}}function ya(t,e){const n=e.tagID;switch(e.tagID){case c.TBODY:case c.TFOOT:case c.THEAD:{t.openElements.hasInTableScope(n)&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=C.IN_TABLE);break}case c.TABLE:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=C.IN_TABLE,cr(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TD:case c.TH:case c.TR:break;default:cr(t,e)}}function Ei(t,e){switch(e.tagID){case c.TH:case c.TD:{t.openElements.clearBackToTableRowContext(),t._insertElement(e,U.HTML),t.insertionMode=C.IN_CELL,t.activeFormattingElements.insertMarker();break}case c.CAPTION:case c.COL:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:case c.TR:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=C.IN_TABLE_BODY,bi(t,e));break}default:Cn(t,e)}}function kc(t,e){switch(e.tagID){case c.TR:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=C.IN_TABLE_BODY);break}case c.TABLE:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=C.IN_TABLE_BODY,ya(t,e));break}case c.TBODY:case c.TFOOT:case c.THEAD:{(t.openElements.hasInTableScope(e.tagID)||t.openElements.hasInTableScope(c.TR))&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=C.IN_TABLE_BODY,ya(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TD:case c.TH:break;default:cr(t,e)}}function sT(t,e){const n=e.tagID;Cc.has(n)?(t.openElements.hasInTableScope(c.TD)||t.openElements.hasInTableScope(c.TH))&&(t._closeTableCell(),Ei(t,e)):ze(t,e)}function uT(t,e){const n=e.tagID;switch(n){case c.TD:case c.TH:{t.openElements.hasInTableScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=C.IN_ROW);break}case c.TABLE:case c.TBODY:case c.TFOOT:case c.THEAD:case c.TR:{t.openElements.hasInTableScope(n)&&(t._closeTableCell(),kc(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:break;default:gi(t,e)}}function Sc(t,e){switch(e.tagID){case c.HTML:{ze(t,e);break}case c.OPTION:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t._insertElement(e,U.HTML);break}case c.OPTGROUP:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop(),t._insertElement(e,U.HTML);break}case c.HR:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop(),t._appendElement(e,U.HTML),e.ackSelfClosing=!0;break}case c.INPUT:case c.KEYGEN:case c.TEXTAREA:case c.SELECT:{t.openElements.hasInSelectScope(c.SELECT)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),e.tagID!==c.SELECT&&t._processStartTag(e));break}case c.SCRIPT:case c.TEMPLATE:{dt(t,e);break}}}function Ic(t,e){switch(e.tagID){case c.OPTGROUP:{t.openElements.stackTop>0&&t.openElements.currentTagId===c.OPTION&&t.openElements.tagIDs[t.openElements.stackTop-1]===c.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop();break}case c.OPTION:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop();break}case c.SELECT:{t.openElements.hasInSelectScope(c.SELECT)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode());break}case c.TEMPLATE:{un(t,e);break}}}function oT(t,e){const n=e.tagID;n===c.CAPTION||n===c.TABLE||n===c.TBODY||n===c.TFOOT||n===c.THEAD||n===c.TR||n===c.TD||n===c.TH?(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),t._processStartTag(e)):Sc(t,e)}function lT(t,e){const n=e.tagID;n===c.CAPTION||n===c.TABLE||n===c.TBODY||n===c.TFOOT||n===c.THEAD||n===c.TR||n===c.TD||n===c.TH?t.openElements.hasInTableScope(n)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),t.onEndTag(e)):Ic(t,e)}function cT(t,e){switch(e.tagID){case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:case c.NOFRAMES:case c.SCRIPT:case c.STYLE:case c.TEMPLATE:case c.TITLE:{dt(t,e);break}case c.CAPTION:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:{t.tmplInsertionModeStack[0]=C.IN_TABLE,t.insertionMode=C.IN_TABLE,Cn(t,e);break}case c.COL:{t.tmplInsertionModeStack[0]=C.IN_COLUMN_GROUP,t.insertionMode=C.IN_COLUMN_GROUP,ss(t,e);break}case c.TR:{t.tmplInsertionModeStack[0]=C.IN_TABLE_BODY,t.insertionMode=C.IN_TABLE_BODY,bi(t,e);break}case c.TD:case c.TH:{t.tmplInsertionModeStack[0]=C.IN_ROW,t.insertionMode=C.IN_ROW,Ei(t,e);break}default:t.tmplInsertionModeStack[0]=C.IN_BODY,t.insertionMode=C.IN_BODY,ze(t,e)}}function dT(t,e){e.tagID===c.TEMPLATE&&un(t,e)}function Nc(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(c.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode(),t.onEof(e)):as(t,e)}function fT(t,e){e.tagID===c.HTML?ze(t,e):Zr(t,e)}function wc(t,e){var n;if(e.tagID===c.HTML){if(t.fragmentContext||(t.insertionMode=C.AFTER_AFTER_BODY),t.options.sourceCodeLocationInfo&&t.openElements.tagIDs[0]===c.HTML){t._setEndLocation(t.openElements.items[0],e);const r=t.openElements.items[1];r&&!(!((n=t.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&t._setEndLocation(r,e)}}else Zr(t,e)}function Zr(t,e){t.insertionMode=C.IN_BODY,mi(t,e)}function hT(t,e){switch(e.tagID){case c.HTML:{ze(t,e);break}case c.FRAMESET:{t._insertElement(e,U.HTML);break}case c.FRAME:{t._appendElement(e,U.HTML),e.ackSelfClosing=!0;break}case c.NOFRAMES:{dt(t,e);break}}}function pT(t,e){e.tagID===c.FRAMESET&&!t.openElements.isRootHtmlElementCurrent()&&(t.openElements.pop(),!t.fragmentContext&&t.openElements.currentTagId!==c.FRAMESET&&(t.insertionMode=C.AFTER_FRAMESET))}function mT(t,e){switch(e.tagID){case c.HTML:{ze(t,e);break}case c.NOFRAMES:{dt(t,e);break}}}function gT(t,e){e.tagID===c.HTML&&(t.insertionMode=C.AFTER_AFTER_FRAMESET)}function bT(t,e){e.tagID===c.HTML?ze(t,e):Ur(t,e)}function Ur(t,e){t.insertionMode=C.IN_BODY,mi(t,e)}function ET(t,e){switch(e.tagID){case c.HTML:{ze(t,e);break}case c.NOFRAMES:{dt(t,e);break}}}function TT(t,e){e.chars=Re,t._insertCharacters(e)}function xT(t,e){t._insertCharacters(e),t.framesetOk=!1}function Rc(t){for(;t.treeAdapter.getNamespaceURI(t.openElements.current)!==U.HTML&&t.openElements.currentTagId!==void 0&&!t._isIntegrationPoint(t.openElements.currentTagId,t.openElements.current);)t.openElements.pop()}function _T(t,e){if(ME(e))Rc(t),t._startTagOutsideForeignContent(e);else{const n=t._getAdjustedCurrentElement(),r=t.treeAdapter.getNamespaceURI(n);r===U.MATHML?hc(e):r===U.SVG&&(BE(e),pc(e)),rs(e),e.selfClosing?t._appendElement(e,r):t._insertElement(e,r),e.ackSelfClosing=!0}}function yT(t,e){if(e.tagID===c.P||e.tagID===c.BR){Rc(t),t._endTagOutsideForeignContent(e);return}for(let n=t.openElements.stackTop;n>0;n--){const r=t.openElements.items[n];if(t.treeAdapter.getNamespaceURI(r)===U.HTML){t._endTagOutsideForeignContent(e);break}const i=t.treeAdapter.getTagName(r);if(i.toLowerCase()===e.tagName){e.tagName=i,t.openElements.shortenToLength(n);break}}}L.AREA,L.BASE,L.BASEFONT,L.BGSOUND,L.BR,L.COL,L.EMBED,L.FRAME,L.HR,L.IMG,L.INPUT,L.KEYGEN,L.LINK,L.META,L.PARAM,L.SOURCE,L.TRACK,L.WBR;const AT=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,CT=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),$u={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function Lc(t,e){const n=DT(t),r=nc("type",{handlers:{root:kT,element:ST,text:IT,comment:vc,doctype:NT,raw:RT},unknown:LT}),i={parser:n?new Uu($u):Uu.getFragmentParser(void 0,$u),handle(u){r(u,i)},stitches:!1,options:e||{}};r(t,i),Rn(i,gt());const a=n?i.parser.document:i.parser.getFragment(),s=Pb(a,{file:i.options.file});return i.stitches&&pi(s,"comment",function(u,o,l){const f=u;if(f.value.stitch&&l&&o!==void 0){const d=l.children;return d[o]=f.value.stitch,o}}),s.type==="root"&&s.children.length===1&&s.children[0].type===t.type?s.children[0]:s}function Oc(t,e){let n=-1;if(t)for(;++n<t.length;)e.handle(t[n])}function kT(t,e){Oc(t.children,e)}function ST(t,e){OT(t,e),Oc(t.children,e),vT(t,e)}function IT(t,e){e.parser.tokenizer.state>4&&(e.parser.tokenizer.state=0);const n={type:de.CHARACTER,chars:t.value,location:Ar(t)};Rn(e,gt(t)),e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)}function NT(t,e){const n={type:de.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Ar(t)};Rn(e,gt(t)),e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)}function wT(t,e){e.stitches=!0;const n=PT(t);if("children"in t&&"children"in n){const r=Lc({type:"root",children:t.children},e.options);n.children=r.children}vc({type:"comment",value:{stitch:n}},e)}function vc(t,e){const n=t.value,r={type:de.COMMENT,data:n,location:Ar(t)};Rn(e,gt(t)),e.parser.currentToken=r,e.parser._processToken(e.parser.currentToken)}function RT(t,e){if(e.parser.tokenizer.preprocessor.html="",e.parser.tokenizer.preprocessor.pos=-1,e.parser.tokenizer.preprocessor.lastGapPos=-2,e.parser.tokenizer.preprocessor.gapStack=[],e.parser.tokenizer.preprocessor.skipNextNewLine=!1,e.parser.tokenizer.preprocessor.lastChunkWritten=!1,e.parser.tokenizer.preprocessor.endOfChunkHit=!1,e.parser.tokenizer.preprocessor.isEol=!1,Dc(e,gt(t)),e.parser.tokenizer.write(e.options.tagfilter?t.value.replace(AT,"&lt;$1$2"):t.value,!1),e.parser.tokenizer._runParsingLoop(),e.parser.tokenizer.state===72||e.parser.tokenizer.state===78){e.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=e.parser.tokenizer._consume();e.parser.tokenizer._callState(n)}}function LT(t,e){const n=t;if(e.options.passThrough&&e.options.passThrough.includes(n.type))wT(n,e);else{let r="";throw CT.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function Rn(t,e){Dc(t,e);const n=t.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=t.parser.tokenizer.preprocessor.line,n.location.endCol=t.parser.tokenizer.preprocessor.col+1,n.location.endOffset=t.parser.tokenizer.preprocessor.offset+1,t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)),t.parser.tokenizer.paused=!1,t.parser.tokenizer.inLoop=!1,t.parser.tokenizer.active=!1,t.parser.tokenizer.returnState=ve.DATA,t.parser.tokenizer.charRefCode=-1,t.parser.tokenizer.consumedAfterSnapshot=-1,t.parser.tokenizer.currentLocation=null,t.parser.tokenizer.currentCharacterToken=null,t.parser.tokenizer.currentToken=null,t.parser.tokenizer.currentAttr={name:"",value:""}}function Dc(t,e){if(e&&e.offset!==void 0){const n={startLine:e.line,startCol:e.column,startOffset:e.offset,endLine:-1,endCol:-1,endOffset:-1};t.parser.tokenizer.preprocessor.lineStartPos=-e.column+1,t.parser.tokenizer.preprocessor.droppedBufferSize=e.offset,t.parser.tokenizer.preprocessor.line=e.line,t.parser.tokenizer.currentLocation=n}}function OT(t,e){const n=t.tagName.toLowerCase();if(e.parser.tokenizer.state===ve.PLAINTEXT)return;Rn(e,gt(t));const r=e.parser.openElements.current;let i="namespaceURI"in r?r.namespaceURI:Qt.html;i===Qt.html&&n==="svg"&&(i=Qt.svg);const a=Ub({...t,children:[]},{space:i===Qt.svg?"svg":"html"}),s={type:de.START_TAG,tagName:n,tagID:wn(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in a?a.attrs:[],location:Ar(t)};e.parser.currentToken=s,e.parser._processToken(e.parser.currentToken),e.parser.tokenizer.lastStartTagName=n}function vT(t,e){const n=t.tagName.toLowerCase();if(!e.parser.tokenizer.inForeignNode&&Gb.includes(n)||e.parser.tokenizer.state===ve.PLAINTEXT)return;Rn(e,oi(t));const r={type:de.END_TAG,tagName:n,tagID:wn(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Ar(t)};e.parser.currentToken=r,e.parser._processToken(e.parser.currentToken),n===e.parser.tokenizer.lastStartTagName&&(e.parser.tokenizer.state===ve.RCDATA||e.parser.tokenizer.state===ve.RAWTEXT||e.parser.tokenizer.state===ve.SCRIPT_DATA)&&(e.parser.tokenizer.state=ve.DATA)}function DT(t){const e=t.type==="root"?t.children[0]:t;return!!(e&&(e.type==="doctype"||e.type==="element"&&e.tagName.toLowerCase()==="html"))}function Ar(t){const e=gt(t)||{line:void 0,column:void 0,offset:void 0},n=oi(t)||{line:void 0,column:void 0,offset:void 0};return{startLine:e.line,startCol:e.column,startOffset:e.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function PT(t){return"children"in t?An({...t,children:[]}):An(t)}function MT(t){return function(e,n){return Lc(e,{...t,file:n})}}function Yu(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(e);for(;i!==-1;)r++,i=n.indexOf(e,i+e.length);return r}function BT(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function FT(t,e,n){const i=fi((n||{}).ignore||[]),a=HT(e);let s=-1;for(;++s<a.length;)Zl(t,"text",u);function u(l,f){let d=-1,h;for(;++d<f.length;){const p=f[d],g=h?h.children:void 0;if(i(p,g?g.indexOf(p):void 0,h))return;h=p}if(h)return o(l,f)}function o(l,f){const d=f[f.length-1],h=a[s][0],p=a[s][1];let g=0;const _=d.children.indexOf(l);let b=!1,k=[];h.lastIndex=0;let E=h.exec(l.value);for(;E;){const w=E.index,R={index:E.index,input:E.input,stack:[...f,l]};let S=p(...E,R);if(typeof S=="string"&&(S=S.length>0?{type:"text",value:S}:void 0),S===!1?h.lastIndex=w+1:(g!==w&&k.push({type:"text",value:l.value.slice(g,w)}),Array.isArray(S)?k.push(...S):S&&k.push(S),g=w+E[0].length,b=!0),!h.global)break;E=h.exec(l.value)}return b?(g<l.value.length&&k.push({type:"text",value:l.value.slice(g)}),d.children.splice(_,1,...k)):k=[l],_+k.length}}function HT(t){const e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!t[0]||Array.isArray(t[0])?t:[t];let r=-1;for(;++r<n.length;){const i=n[r];e.push([UT(i[0]),zT(i[1])])}return e}function UT(t){return typeof t=="string"?new RegExp(BT(t),"g"):t}function zT(t){return typeof t=="function"?t:function(){return t}}const Yi="phrasing",qi=["autolink","link","image","label"];function jT(){return{transforms:[QT],enter:{literalAutolink:YT,literalAutolinkEmail:Vi,literalAutolinkHttp:Vi,literalAutolinkWww:Vi},exit:{literalAutolink:GT,literalAutolinkEmail:WT,literalAutolinkHttp:qT,literalAutolinkWww:VT}}}function $T(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Yi,notInConstruct:qi},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Yi,notInConstruct:qi},{character:":",before:"[ps]",after:"\\/",inConstruct:Yi,notInConstruct:qi}]}}function YT(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function Vi(t){this.config.enter.autolinkProtocol.call(this,t)}function qT(t){this.config.exit.autolinkProtocol.call(this,t)}function VT(t){this.config.exit.data.call(this,t);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function WT(t){this.config.exit.autolinkEmail.call(this,t)}function GT(t){this.exit(t)}function QT(t){FT(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,XT],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),ZT]],{ignore:["link","linkReference"]})}function XT(t,e,n,r,i){let a="";if(!Pc(i)||(/^w/i.test(e)&&(n=e+n,e="",a="http://"),!KT(n)))return!1;const s=JT(n+r);if(!s[0])return!1;const u={type:"link",title:null,url:a+e+s[0],children:[{type:"text",value:e+s[0]}]};return s[1]?[u,{type:"text",value:s[1]}]:u}function ZT(t,e,n,r){return!Pc(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+n,children:[{type:"text",value:e+"@"+n}]}}function KT(t){const e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function JT(t){const e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let n=e[0],r=n.indexOf(")");const i=Yu(t,"(");let a=Yu(t,")");for(;r!==-1&&i>a;)t+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[t,n]}function Pc(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||nn(n)||li(n))&&(!e||n!==47)}Mc.peek=ox;function ex(){this.buffer()}function tx(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function nx(){this.buffer()}function rx(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function ix(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=lt(this.sliceSerialize(t)).toLowerCase(),n.label=e}function ax(t){this.exit(t)}function sx(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=lt(this.sliceSerialize(t)).toLowerCase(),n.label=e}function ux(t){this.exit(t)}function ox(){return"["}function Mc(t,e,n,r){const i=n.createTracker(r);let a=i.move("[^");const s=n.enter("footnoteReference"),u=n.enter("reference");return a+=i.move(n.safe(n.associationId(t),{after:"]",before:a})),u(),s(),a+=i.move("]"),a}function lx(){return{enter:{gfmFootnoteCallString:ex,gfmFootnoteCall:tx,gfmFootnoteDefinitionLabelString:nx,gfmFootnoteDefinition:rx},exit:{gfmFootnoteCallString:ix,gfmFootnoteCall:ax,gfmFootnoteDefinitionLabelString:sx,gfmFootnoteDefinition:ux}}}function cx(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:Mc},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,a,s){const u=a.createTracker(s);let o=u.move("[^");const l=a.enter("footnoteDefinition"),f=a.enter("label");return o+=u.move(a.safe(a.associationId(r),{before:o,after:"]"})),f(),o+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),o+=u.move((e?`
82
+ `:" ")+a.indentLines(a.containerFlow(r,u.current()),e?Bc:dx))),l(),o}}function dx(t,e,n){return e===0?t:Bc(t,e,n)}function Bc(t,e,n){return(n?"":" ")+t}const fx=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Fc.peek=bx;function hx(){return{canContainEols:["delete"],enter:{strikethrough:mx},exit:{strikethrough:gx}}}function px(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:fx}],handlers:{delete:Fc}}}function mx(t){this.enter({type:"delete",children:[]},t)}function gx(t){this.exit(t)}function Fc(t,e,n,r){const i=n.createTracker(r),a=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(t,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),a(),s}function bx(){return"~"}function Ex(t){return t.length}function Tx(t,e){const n=e||{},r=(n.align||[]).concat(),i=n.stringLength||Ex,a=[],s=[],u=[],o=[];let l=0,f=-1;for(;++f<t.length;){const x=[],_=[];let b=-1;for(t[f].length>l&&(l=t[f].length);++b<t[f].length;){const k=xx(t[f][b]);if(n.alignDelimiters!==!1){const E=i(k);_[b]=E,(o[b]===void 0||E>o[b])&&(o[b]=E)}x.push(k)}s[f]=x,u[f]=_}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<l;)a[d]=qu(r[d]);else{const x=qu(r);for(;++d<l;)a[d]=x}d=-1;const h=[],p=[];for(;++d<l;){const x=a[d];let _="",b="";x===99?(_=":",b=":"):x===108?_=":":x===114&&(b=":");let k=n.alignDelimiters===!1?1:Math.max(1,o[d]-_.length-b.length);const E=_+"-".repeat(k)+b;n.alignDelimiters!==!1&&(k=_.length+k+b.length,k>o[d]&&(o[d]=k),p[d]=k),h[d]=E}s.splice(1,0,h),u.splice(1,0,p),f=-1;const g=[];for(;++f<s.length;){const x=s[f],_=u[f];d=-1;const b=[];for(;++d<l;){const k=x[d]||"";let E="",w="";if(n.alignDelimiters!==!1){const R=o[d]-(_[d]||0),S=a[d];S===114?E=" ".repeat(R):S===99?R%2?(E=" ".repeat(R/2+.5),w=" ".repeat(R/2-.5)):(E=" ".repeat(R/2),w=E):w=" ".repeat(R)}n.delimiterStart!==!1&&!d&&b.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&k==="")&&(n.delimiterStart!==!1||d)&&b.push(" "),n.alignDelimiters!==!1&&b.push(E),b.push(k),n.alignDelimiters!==!1&&b.push(w),n.padding!==!1&&b.push(" "),(n.delimiterEnd!==!1||d!==l-1)&&b.push("|")}g.push(n.delimiterEnd===!1?b.join("").replace(/ +$/,""):b.join(""))}return g.join(`
83
+ `)}function xx(t){return t==null?"":String(t)}function qu(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function _x(t,e,n,r){const i=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const s=n.indentLines(n.containerFlow(t,a.current()),yx);return i(),s}function yx(t,e,n){return">"+(n?"":" ")+t}function Ax(t,e){return Vu(t,e.inConstruct,!0)&&!Vu(t,e.notInConstruct,!1)}function Vu(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let r=-1;for(;++r<e.length;)if(t.includes(e[r]))return!0;return!1}function Wu(t,e,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
84
+ `&&Ax(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
85
+ `}function Cx(t,e){const n=String(t);let r=n.indexOf(e),i=r,a=0,s=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++a>s&&(s=a):a=1,i=r+e.length,r=n.indexOf(e,i);return s}function kx(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function Sx(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function Ix(t,e,n,r){const i=Sx(n),a=t.value||"",s=i==="`"?"GraveAccent":"Tilde";if(kx(t,n)){const d=n.enter("codeIndented"),h=n.indentLines(a,Nx);return d(),h}const u=n.createTracker(r),o=i.repeat(Math.max(Cx(a,i)+1,3)),l=n.enter("codeFenced");let f=u.move(o);if(t.lang){const d=n.enter(`codeFencedLang${s}`);f+=u.move(n.safe(t.lang,{before:f,after:" ",encode:["`"],...u.current()})),d()}if(t.lang&&t.meta){const d=n.enter(`codeFencedMeta${s}`);f+=u.move(" "),f+=u.move(n.safe(t.meta,{before:f,after:`
86
+ `,encode:["`"],...u.current()})),d()}return f+=u.move(`
87
+ `),a&&(f+=u.move(a+`
88
+ `)),f+=u.move(o),l(),f}function Nx(t,e,n){return(n?"":" ")+t}function us(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function wx(t,e,n,r){const i=us(n),a=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let u=n.enter("label");const o=n.createTracker(r);let l=o.move("[");return l+=o.move(n.safe(n.associationId(t),{before:l,after:"]",...o.current()})),l+=o.move("]: "),u(),!t.url||/[\0- \u007F]/.test(t.url)?(u=n.enter("destinationLiteral"),l+=o.move("<"),l+=o.move(n.safe(t.url,{before:l,after:">",...o.current()})),l+=o.move(">")):(u=n.enter("destinationRaw"),l+=o.move(n.safe(t.url,{before:l,after:t.title?" ":`
89
+ `,...o.current()}))),u(),t.title&&(u=n.enter(`title${a}`),l+=o.move(" "+i),l+=o.move(n.safe(t.title,{before:l,after:i,...o.current()})),l+=o.move(i),u()),s(),l}function Rx(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function dr(t){return"&#x"+t.toString(16).toUpperCase()+";"}function Kr(t,e,n){const r=yn(t),i=yn(e);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Hc.peek=Lx;function Hc(t,e,n,r){const i=Rx(n),a=n.enter("emphasis"),s=n.createTracker(r),u=s.move(i);let o=s.move(n.containerPhrasing(t,{after:i,before:u,...s.current()}));const l=o.charCodeAt(0),f=Kr(r.before.charCodeAt(r.before.length-1),l,i);f.inside&&(o=dr(l)+o.slice(1));const d=o.charCodeAt(o.length-1),h=Kr(r.after.charCodeAt(0),d,i);h.inside&&(o=o.slice(0,-1)+dr(d));const p=s.move(i);return a(),n.attentionEncodeSurroundingInfo={after:h.outside,before:f.outside},u+o+p}function Lx(t,e,n){return n.options.emphasis||"*"}function Ox(t,e){let n=!1;return pi(t,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,pa}),!!((!t.depth||t.depth<3)&&Wa(t)&&(e.options.setext||n))}function vx(t,e,n,r){const i=Math.max(Math.min(6,t.depth||1),1),a=n.createTracker(r);if(Ox(t,n)){const f=n.enter("headingSetext"),d=n.enter("phrasing"),h=n.containerPhrasing(t,{...a.current(),before:`
90
+ `,after:`
91
+ `});return d(),f(),h+`
92
+ `+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
93
+ `))+1))}const s="#".repeat(i),u=n.enter("headingAtx"),o=n.enter("phrasing");a.move(s+" ");let l=n.containerPhrasing(t,{before:"# ",after:`
94
+ `,...a.current()});return/^[\t ]/.test(l)&&(l=dr(l.charCodeAt(0))+l.slice(1)),l=l?s+" "+l:s,n.options.closeAtx&&(l+=" "+s),o(),u(),l}Uc.peek=Dx;function Uc(t){return t.value||""}function Dx(){return"<"}zc.peek=Px;function zc(t,e,n,r){const i=us(n),a=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let u=n.enter("label");const o=n.createTracker(r);let l=o.move("![");return l+=o.move(n.safe(t.alt,{before:l,after:"]",...o.current()})),l+=o.move("]("),u(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(u=n.enter("destinationLiteral"),l+=o.move("<"),l+=o.move(n.safe(t.url,{before:l,after:">",...o.current()})),l+=o.move(">")):(u=n.enter("destinationRaw"),l+=o.move(n.safe(t.url,{before:l,after:t.title?" ":")",...o.current()}))),u(),t.title&&(u=n.enter(`title${a}`),l+=o.move(" "+i),l+=o.move(n.safe(t.title,{before:l,after:i,...o.current()})),l+=o.move(i),u()),l+=o.move(")"),s(),l}function Px(){return"!"}jc.peek=Mx;function jc(t,e,n,r){const i=t.referenceType,a=n.enter("imageReference");let s=n.enter("label");const u=n.createTracker(r);let o=u.move("![");const l=n.safe(t.alt,{before:o,after:"]",...u.current()});o+=u.move(l+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const d=n.safe(n.associationId(t),{before:o,after:"]",...u.current()});return s(),n.stack=f,a(),i==="full"||!l||l!==d?o+=u.move(d+"]"):i==="shortcut"?o=o.slice(0,-1):o+=u.move("]"),o}function Mx(){return"!"}$c.peek=Bx;function $c(t,e,n){let r=t.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const s=n.unsafe[a],u=n.compilePattern(s);let o;if(s.atBreak)for(;o=u.exec(r);){let l=o.index;r.charCodeAt(l)===10&&r.charCodeAt(l-1)===13&&l--,r=r.slice(0,l)+" "+r.slice(o.index+1)}}return i+r+i}function Bx(){return"`"}function Yc(t,e){const n=Wa(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}qc.peek=Fx;function qc(t,e,n,r){const i=us(n),a=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let u,o;if(Yc(t,n)){const f=n.stack;n.stack=[],u=n.enter("autolink");let d=s.move("<");return d+=s.move(n.containerPhrasing(t,{before:d,after:">",...s.current()})),d+=s.move(">"),u(),n.stack=f,d}u=n.enter("link"),o=n.enter("label");let l=s.move("[");return l+=s.move(n.containerPhrasing(t,{before:l,after:"](",...s.current()})),l+=s.move("]("),o(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(o=n.enter("destinationLiteral"),l+=s.move("<"),l+=s.move(n.safe(t.url,{before:l,after:">",...s.current()})),l+=s.move(">")):(o=n.enter("destinationRaw"),l+=s.move(n.safe(t.url,{before:l,after:t.title?" ":")",...s.current()}))),o(),t.title&&(o=n.enter(`title${a}`),l+=s.move(" "+i),l+=s.move(n.safe(t.title,{before:l,after:i,...s.current()})),l+=s.move(i),o()),l+=s.move(")"),u(),l}function Fx(t,e,n){return Yc(t,n)?"<":"["}Vc.peek=Hx;function Vc(t,e,n,r){const i=t.referenceType,a=n.enter("linkReference");let s=n.enter("label");const u=n.createTracker(r);let o=u.move("[");const l=n.containerPhrasing(t,{before:o,after:"]",...u.current()});o+=u.move(l+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const d=n.safe(n.associationId(t),{before:o,after:"]",...u.current()});return s(),n.stack=f,a(),i==="full"||!l||l!==d?o+=u.move(d+"]"):i==="shortcut"?o=o.slice(0,-1):o+=u.move("]"),o}function Hx(){return"["}function os(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function Ux(t){const e=os(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function zx(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function Wc(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function jx(t,e,n,r){const i=n.enter("list"),a=n.bulletCurrent;let s=t.ordered?zx(n):os(n);const u=t.ordered?s==="."?")":".":Ux(n);let o=e&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!t.ordered){const f=t.children?t.children[0]:void 0;if((s==="*"||s==="-")&&f&&(!f.children||!f.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(o=!0),Wc(n)===s&&f){let d=-1;for(;++d<t.children.length;){const h=t.children[d];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){o=!0;break}}}}o&&(s=u),n.bulletCurrent=s;const l=n.containerFlow(t,r);return n.bulletLastUsed=s,n.bulletCurrent=a,i(),l}function $x(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function Yx(t,e,n,r){const i=$x(n);let a=n.bulletCurrent||os(n);e&&e.type==="list"&&e.ordered&&(a=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+a);let s=a.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(s=Math.ceil(s/4)*4);const u=n.createTracker(r);u.move(a+" ".repeat(s-a.length)),u.shift(s);const o=n.enter("listItem"),l=n.indentLines(n.containerFlow(t,u.current()),f);return o(),l;function f(d,h,p){return h?(p?"":" ".repeat(s))+d:(p?a:a+" ".repeat(s-a.length))+d}}function qx(t,e,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),s=n.containerPhrasing(t,r);return a(),i(),s}const Vx=fi(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Wx(t,e,n,r){return(t.children.some(function(s){return Vx(s)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function Gx(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}Gc.peek=Qx;function Gc(t,e,n,r){const i=Gx(n),a=n.enter("strong"),s=n.createTracker(r),u=s.move(i+i);let o=s.move(n.containerPhrasing(t,{after:i,before:u,...s.current()}));const l=o.charCodeAt(0),f=Kr(r.before.charCodeAt(r.before.length-1),l,i);f.inside&&(o=dr(l)+o.slice(1));const d=o.charCodeAt(o.length-1),h=Kr(r.after.charCodeAt(0),d,i);h.inside&&(o=o.slice(0,-1)+dr(d));const p=s.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:h.outside,before:f.outside},u+o+p}function Qx(t,e,n){return n.options.strong||"*"}function Xx(t,e,n,r){return n.safe(t.value,r)}function Zx(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function Kx(t,e,n){const r=(Wc(n)+(n.options.ruleSpaces?" ":"")).repeat(Zx(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Qc={blockquote:_x,break:Wu,code:Ix,definition:wx,emphasis:Hc,hardBreak:Wu,heading:vx,html:Uc,image:zc,imageReference:jc,inlineCode:$c,link:qc,linkReference:Vc,list:jx,listItem:Yx,paragraph:qx,root:Wx,strong:Gc,text:Xx,thematicBreak:Kx};function Jx(){return{enter:{table:e3,tableData:Gu,tableHeader:Gu,tableRow:n3},exit:{codeText:r3,table:t3,tableData:Wi,tableHeader:Wi,tableRow:Wi}}}function e3(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function t3(t){this.exit(t),this.data.inTable=void 0}function n3(t){this.enter({type:"tableRow",children:[]},t)}function Wi(t){this.exit(t)}function Gu(t){this.enter({type:"tableCell",children:[]},t)}function r3(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,i3));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function i3(t,e){return e==="|"?e:t}function a3(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,i=e.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
95
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:s,tableCell:o,tableRow:u}};function s(p,g,x,_){return l(f(p,x,_),p.align)}function u(p,g,x,_){const b=d(p,x,_),k=l([b]);return k.slice(0,k.indexOf(`
96
+ `))}function o(p,g,x,_){const b=x.enter("tableCell"),k=x.enter("phrasing"),E=x.containerPhrasing(p,{..._,before:a,after:a});return k(),b(),E}function l(p,g){return Tx(p,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function f(p,g,x){const _=p.children;let b=-1;const k=[],E=g.enter("table");for(;++b<_.length;)k[b]=d(_[b],g,x);return E(),k}function d(p,g,x){const _=p.children;let b=-1;const k=[],E=g.enter("tableRow");for(;++b<_.length;)k[b]=o(_[b],p,g,x);return E(),k}function h(p,g,x){let _=Qc.inlineCode(p,g,x);return x.stack.includes("tableCell")&&(_=_.replace(/\|/g,"\\$&")),_}}function s3(){return{exit:{taskListCheckValueChecked:Qu,taskListCheckValueUnchecked:Qu,paragraph:o3}}}function u3(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:l3}}}function Qu(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function o3(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=e.children;let a=-1,s;for(;++a<i.length;){const u=i[a];if(u.type==="paragraph"){s=u;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function l3(t,e,n,r){const i=t.children[0],a=typeof t.checked=="boolean"&&i&&i.type==="paragraph",s="["+(t.checked?"x":" ")+"] ",u=n.createTracker(r);a&&u.move(s);let o=Qc.listItem(t,e,n,{...r,...u.current()});return a&&(o=o.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),o;function l(f){return f+s}}function c3(){return[jT(),lx(),hx(),Jx(),s3()]}function d3(t){return{extensions:[$T(),cx(t),px(),a3(t),u3()]}}const f3={tokenize:E3,partial:!0},Xc={tokenize:T3,partial:!0},Zc={tokenize:x3,partial:!0},Kc={tokenize:_3,partial:!0},h3={tokenize:y3,partial:!0},Jc={name:"wwwAutolink",tokenize:g3,previous:td},ed={name:"protocolAutolink",tokenize:b3,previous:nd},Ct={name:"emailAutolink",tokenize:m3,previous:rd},bt={};function p3(){return{text:bt}}let Yt=48;for(;Yt<123;)bt[Yt]=Ct,Yt++,Yt===58?Yt=65:Yt===91&&(Yt=97);bt[43]=Ct;bt[45]=Ct;bt[46]=Ct;bt[95]=Ct;bt[72]=[Ct,ed];bt[104]=[Ct,ed];bt[87]=[Ct,Jc];bt[119]=[Ct,Jc];function m3(t,e,n){const r=this;let i,a;return s;function s(d){return!Aa(d)||!rd.call(r,r.previous)||ls(r.events)?n(d):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),u(d))}function u(d){return Aa(d)?(t.consume(d),u):d===64?(t.consume(d),o):n(d)}function o(d){return d===46?t.check(h3,f,l)(d):d===45||d===95||He(d)?(a=!0,t.consume(d),o):f(d)}function l(d){return t.consume(d),i=!0,o}function f(d){return a&&i&&Ye(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(d)):n(d)}}function g3(t,e,n){const r=this;return i;function i(s){return s!==87&&s!==119||!td.call(r,r.previous)||ls(r.events)?n(s):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(f3,t.attempt(Xc,t.attempt(Zc,a),n),n)(s))}function a(s){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(s)}}function b3(t,e,n){const r=this;let i="",a=!1;return s;function s(d){return(d===72||d===104)&&nd.call(r,r.previous)&&!ls(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),t.consume(d),u):n(d)}function u(d){if(Ye(d)&&i.length<5)return i+=String.fromCodePoint(d),t.consume(d),u;if(d===58){const h=i.toLowerCase();if(h==="http"||h==="https")return t.consume(d),o}return n(d)}function o(d){return d===47?(t.consume(d),a?l:(a=!0,o)):n(d)}function l(d){return d===null||Wr(d)||Se(d)||nn(d)||li(d)?n(d):t.attempt(Xc,t.attempt(Zc,f),n)(d)}function f(d){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(d)}}function E3(t,e,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,t.consume(s),i):s===46&&r===3?(t.consume(s),a):n(s)}function a(s){return s===null?n(s):e(s)}}function T3(t,e,n){let r,i,a;return s;function s(l){return l===46||l===95?t.check(Kc,o,u)(l):l===null||Se(l)||nn(l)||l!==45&&li(l)?o(l):(a=!0,t.consume(l),s)}function u(l){return l===95?r=!0:(i=r,r=void 0),t.consume(l),s}function o(l){return i||r||!a?n(l):e(l)}}function x3(t,e){let n=0,r=0;return i;function i(s){return s===40?(n++,t.consume(s),i):s===41&&r<n?a(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?t.check(Kc,e,a)(s):s===null||Se(s)||nn(s)?e(s):(t.consume(s),i)}function a(s){return s===41&&r++,t.consume(s),i}}function _3(t,e,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(t.consume(u),r):u===38?(t.consume(u),a):u===93?(t.consume(u),i):u===60||u===null||Se(u)||nn(u)?e(u):n(u)}function i(u){return u===null||u===40||u===91||Se(u)||nn(u)?e(u):r(u)}function a(u){return Ye(u)?s(u):n(u)}function s(u){return u===59?(t.consume(u),r):Ye(u)?(t.consume(u),s):n(u)}}function y3(t,e,n){return r;function r(a){return t.consume(a),i}function i(a){return He(a)?n(a):e(a)}}function td(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||Se(t)}function nd(t){return!Ye(t)}function rd(t){return!(t===47||Aa(t))}function Aa(t){return t===43||t===45||t===46||t===95||He(t)}function ls(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const A3={tokenize:L3,partial:!0};function C3(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:N3,continuation:{tokenize:w3},exit:R3}},text:{91:{name:"gfmFootnoteCall",tokenize:I3},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:k3,resolveTo:S3}}}}function k3(t,e,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const o=r.events[i][1];if(o.type==="labelImage"){s=o;break}if(o.type==="gfmFootnoteCall"||o.type==="labelLink"||o.type==="label"||o.type==="image"||o.type==="link")break}return u;function u(o){if(!s||!s._balanced)return n(o);const l=lt(r.sliceSerialize({start:s.end,end:r.now()}));return l.codePointAt(0)!==94||!a.includes(l.slice(1))?n(o):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(o),t.exit("gfmFootnoteCallLabelMarker"),e(o))}}function S3(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},t[t.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},u=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",i,e],["exit",i,e],["enter",a,e],["enter",s,e],["exit",s,e],["exit",a,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...u),t}function I3(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,s;return u;function u(d){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(d),t.exit("gfmFootnoteCallLabelMarker"),o}function o(d){return d!==94?n(d):(t.enter("gfmFootnoteCallMarker"),t.consume(d),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",l)}function l(d){if(a>999||d===93&&!s||d===null||d===91||Se(d))return n(d);if(d===93){t.exit("chunkString");const h=t.exit("gfmFootnoteCallString");return i.includes(lt(r.sliceSerialize(h)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(d),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(d)}return Se(d)||(s=!0),a++,t.consume(d),d===92?f:l}function f(d){return d===91||d===92||d===93?(t.consume(d),a++,l):l(d)}}function N3(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,s=0,u;return o;function o(g){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(g){return g===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",f):n(g)}function f(g){if(s>999||g===93&&!u||g===null||g===91||Se(g))return n(g);if(g===93){t.exit("chunkString");const x=t.exit("gfmFootnoteDefinitionLabelString");return a=lt(r.sliceSerialize(x)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),h}return Se(g)||(u=!0),s++,t.consume(g),g===92?d:f}function d(g){return g===91||g===92||g===93?(t.consume(g),s++,f):f(g)}function h(g){return g===58?(t.enter("definitionMarker"),t.consume(g),t.exit("definitionMarker"),i.includes(a)||i.push(a),Ee(t,p,"gfmFootnoteDefinitionWhitespace")):n(g)}function p(g){return e(g)}}function w3(t,e,n){return t.check(xr,e,t.attempt(A3,e,n))}function R3(t){t.exit("gfmFootnoteDefinition")}function L3(t,e,n){const r=this;return Ee(t,i,"gfmFootnoteDefinitionIndent",5);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?e(a):n(a)}}function O3(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,u){let o=-1;for(;++o<s.length;)if(s[o][0]==="enter"&&s[o][1].type==="strikethroughSequenceTemporary"&&s[o][1]._close){let l=o;for(;l--;)if(s[l][0]==="exit"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._open&&s[o][1].end.offset-s[o][1].start.offset===s[l][1].end.offset-s[l][1].start.offset){s[o][1].type="strikethroughSequence",s[l][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},s[l][1].start),end:Object.assign({},s[o][1].end)},d={type:"strikethroughText",start:Object.assign({},s[l][1].end),end:Object.assign({},s[o][1].start)},h=[["enter",f,u],["enter",s[l][1],u],["exit",s[l][1],u],["enter",d,u]],p=u.parser.constructs.insideSpan.null;p&&tt(h,h.length,0,ci(p,s.slice(l+1,o),u)),tt(h,h.length,0,[["exit",d,u],["enter",s[o][1],u],["exit",s[o][1],u],["exit",f,u]]),tt(s,l-1,o-l+3,h),o=l+h.length-2;break}}for(o=-1;++o<s.length;)s[o][1].type==="strikethroughSequenceTemporary"&&(s[o][1].type="data");return s}function a(s,u,o){const l=this.previous,f=this.events;let d=0;return h;function h(g){return l===126&&f[f.length-1][1].type!=="characterEscape"?o(g):(s.enter("strikethroughSequenceTemporary"),p(g))}function p(g){const x=yn(l);if(g===126)return d>1?o(g):(s.consume(g),d++,p);if(d<2&&!n)return o(g);const _=s.exit("strikethroughSequenceTemporary"),b=yn(g);return _._open=!b||b===2&&!!x,_._close=!x||x===2&&!!b,u(g)}}}class v3{constructor(){this.map=[]}add(e,n,r){D3(this,e,n,r)}consume(e){if(this.map.sort(function(a,s){return a[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let i=r.pop();for(;i;){for(const a of i)e.push(a);i=r.pop()}this.map.length=0}}function D3(t,e,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<t.map.length;){if(t.map[i][0]===e){t.map[i][1]+=n,t.map[i][2].push(...r);return}i+=1}t.map.push([e,n,r])}}function P3(t,e){let n=!1;const r=[];for(;e<t.length;){const i=t[e];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function M3(){return{flow:{null:{name:"table",tokenize:B3,resolveAll:F3}}}}function B3(t,e,n){const r=this;let i=0,a=0,s;return u;function u(N){let P=r.events.length-1;for(;P>-1;){const z=r.events[P][1].type;if(z==="lineEnding"||z==="linePrefix")P--;else break}const M=P>-1?r.events[P][1].type:null,J=M==="tableHead"||M==="tableRow"?S:o;return J===S&&r.parser.lazy[r.now().line]?n(N):J(N)}function o(N){return t.enter("tableHead"),t.enter("tableRow"),l(N)}function l(N){return N===124||(s=!0,a+=1),f(N)}function f(N){return N===null?n(N):te(N)?a>1?(a=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(N),t.exit("lineEnding"),p):n(N):fe(N)?Ee(t,f,"whitespace")(N):(a+=1,s&&(s=!1,i+=1),N===124?(t.enter("tableCellDivider"),t.consume(N),t.exit("tableCellDivider"),s=!0,f):(t.enter("data"),d(N)))}function d(N){return N===null||N===124||Se(N)?(t.exit("data"),f(N)):(t.consume(N),N===92?h:d)}function h(N){return N===92||N===124?(t.consume(N),d):d(N)}function p(N){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(N):(t.enter("tableDelimiterRow"),s=!1,fe(N)?Ee(t,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):g(N))}function g(N){return N===45||N===58?_(N):N===124?(s=!0,t.enter("tableCellDivider"),t.consume(N),t.exit("tableCellDivider"),x):R(N)}function x(N){return fe(N)?Ee(t,_,"whitespace")(N):_(N)}function _(N){return N===58?(a+=1,s=!0,t.enter("tableDelimiterMarker"),t.consume(N),t.exit("tableDelimiterMarker"),b):N===45?(a+=1,b(N)):N===null||te(N)?w(N):R(N)}function b(N){return N===45?(t.enter("tableDelimiterFiller"),k(N)):R(N)}function k(N){return N===45?(t.consume(N),k):N===58?(s=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(N),t.exit("tableDelimiterMarker"),E):(t.exit("tableDelimiterFiller"),E(N))}function E(N){return fe(N)?Ee(t,w,"whitespace")(N):w(N)}function w(N){return N===124?g(N):N===null||te(N)?!s||i!==a?R(N):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(N)):R(N)}function R(N){return n(N)}function S(N){return t.enter("tableRow"),O(N)}function O(N){return N===124?(t.enter("tableCellDivider"),t.consume(N),t.exit("tableCellDivider"),O):N===null||te(N)?(t.exit("tableRow"),e(N)):fe(N)?Ee(t,O,"whitespace")(N):(t.enter("data"),F(N))}function F(N){return N===null||N===124||Se(N)?(t.exit("data"),O(N)):(t.consume(N),N===92?j:F)}function j(N){return N===92||N===124?(t.consume(N),F):F(N)}}function F3(t,e){let n=-1,r=!0,i=0,a=[0,0,0,0],s=[0,0,0,0],u=!1,o=0,l,f,d;const h=new v3;for(;++n<t.length;){const p=t[n],g=p[1];p[0]==="enter"?g.type==="tableHead"?(u=!1,o!==0&&(Xu(h,e,o,l,f),f=void 0,o=0),l={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",l,e]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,d=void 0,a=[0,0,0,0],s=[0,n+1,0,0],u&&(u=!1,f={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",f,e]])),i=g.type==="tableDelimiterRow"?2:f?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(a[1]!==0&&(s[0]=s[1],d=Lr(h,e,a,i,void 0,d),a=[0,0,0,0]),s[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(s[0]=s[1],d=Lr(h,e,a,i,void 0,d)),a=s,s=[a[1],n,0,0])):g.type==="tableHead"?(u=!0,o=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(o=n,a[1]!==0?(s[0]=s[1],d=Lr(h,e,a,i,n,d)):s[1]!==0&&(d=Lr(h,e,s,i,n,d)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(s[3]=n)}for(o!==0&&Xu(h,e,o,l,f),h.consume(e.events),n=-1;++n<e.events.length;){const p=e.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=P3(e.events,n))}return t}function Lr(t,e,n,r,i,a){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(a.end=Object.assign({},mn(e.events,n[0])),t.add(n[0],0,[["exit",a,e]]));const o=mn(e.events,n[1]);if(a={type:s,start:Object.assign({},o),end:Object.assign({},o)},t.add(n[1],0,[["enter",a,e]]),n[2]!==0){const l=mn(e.events,n[2]),f=mn(e.events,n[3]),d={type:u,start:Object.assign({},l),end:Object.assign({},f)};if(t.add(n[2],0,[["enter",d,e]]),r!==2){const h=e.events[n[2]],p=e.events[n[3]];if(h[1].end=Object.assign({},p[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,x=n[3]-n[2]-1;t.add(g,x,[])}}t.add(n[3]+1,0,[["exit",d,e]])}return i!==void 0&&(a.end=Object.assign({},mn(e.events,i)),t.add(i,0,[["exit",a,e]]),a=void 0),a}function Xu(t,e,n,r,i){const a=[],s=mn(e.events,n);i&&(i.end=Object.assign({},s),a.push(["exit",i,e])),r.end=Object.assign({},s),a.push(["exit",r,e]),t.add(n+1,0,a)}function mn(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const H3={name:"tasklistCheck",tokenize:z3};function U3(){return{text:{91:H3}}}function z3(t,e,n){const r=this;return i;function i(o){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(o):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(o),t.exit("taskListCheckMarker"),a)}function a(o){return Se(o)?(t.enter("taskListCheckValueUnchecked"),t.consume(o),t.exit("taskListCheckValueUnchecked"),s):o===88||o===120?(t.enter("taskListCheckValueChecked"),t.consume(o),t.exit("taskListCheckValueChecked"),s):n(o)}function s(o){return o===93?(t.enter("taskListCheckMarker"),t.consume(o),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),u):n(o)}function u(o){return te(o)?e(o):fe(o)?t.check({tokenize:j3},e,n)(o):n(o)}}function j3(t,e,n){return Ee(t,r,"whitespace");function r(i){return i===null?n(i):e(i)}}function $3(t){return Ol([p3(),C3(),O3(t),M3(),U3()])}const Y3={};function q3(t){const e=this,n=t||Y3,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push($3(n)),a.push(c3()),s.push(d3(n))}const V3=v.lazy(()=>Wd(()=>import("./lazy-highlighter-Czs-NOYe.js"),__vite__mapDeps([0,1,2,3,4])));function id(){const t=K.c(3),[e,n]=v.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=async s=>{await navigator.clipboard.writeText(s),n(!0),setTimeout(()=>n(!1),2e3)},t[0]=r):r=t[0];const i=r;let a;return t[1]!==e?(a={handleCopy:i,copied:e},t[1]=e,t[2]=a):a=t[2],a}function W3(){const t=K.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[85,70],t[0]=e):e=t[0];const n=e;let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx("div",{className:"p-4 font-mono text-sm",style:{background:"#2d2d2d",borderRadius:"0 0 0.5rem 0.5rem",overflow:"auto",minHeight:"4rem"},children:n.map(G3)}),t[1]=r):r=t[1],r}function G3(t,e){return m.jsxs("div",{className:"flex gap-2 items-center my-1",children:[e>2&&e<7&&m.jsx("div",{className:"w-4 h-4 rounded-sm opacity-40 animate-pulse",style:{background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.1}s`}}),e%4===0&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"3rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.12}s`}}),e%3===1&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"2.5rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.14}s`}}),m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:`${t}%`,background:"rgba(255, 255, 255, 0.1)",animationDelay:`${e*.1}s`}}),e%5===2&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"4rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.16}s`}})]},e)}function Q3(t){const e=K.c(12),n=v.useRef(null),{handleCopy:r,copied:i}=id(),a=X3;let s;e[0]!==r?(s=async()=>{const h=a(n.current);await r(h)},e[0]=r,e[1]=s):s=e[1];const u=s;let o;e[2]!==i?(o=i?m.jsx(Kt,{size:12}):m.jsx(ti,{size:12}),e[2]=i,e[3]=o):o=e[3];let l;e[4]!==u||e[5]!==o?(l=m.jsx("div",{className:"flex justify-end items-center",children:m.jsxs(Bt,{variant:"ghost",onClick:u,"aria-label":"Copy as CSV",className:"text-muted-foreground hover:text-foreground h-6 text-[10px]",type:"button",children:["Copy as CSV",o]})}),e[4]=u,e[5]=o,e[6]=l):l=e[6];let f;e[7]!==t?(f=m.jsx("div",{className:"overflow-x-auto mb-4 rounded-lg border border-border",children:m.jsx("table",{ref:n,...t,className:"min-w-full border-collapse text-sm",children:t.children})}),e[7]=t,e[8]=f):f=e[8];let d;return e[9]!==l||e[10]!==f?(d=m.jsxs(m.Fragment,{children:[l,f]}),e[9]=l,e[10]=f,e[11]=d):d=e[11],d}function X3(t){return t?Array.from(t.querySelectorAll("tr")).map(Z3).join(`
97
+ `):""}function Z3(t){return Array.from(t.querySelectorAll("th,td")).map(K3).join(",")}function K3(t){let e=t.textContent||"";return e=e.replace(/"/g,'""'),e.search(/([",\n])/g)>=0&&(e=`"${e}"`),e}const J3=[q3],e_=[MT],t_={p:t=>m.jsx("p",{...t,className:"leading-relaxed text-sm mb-2 last:mb-0"}),strong:t=>m.jsx("strong",{...t,className:"font-bold"}),em:t=>m.jsx("em",{...t,className:"italic"}),a:t=>m.jsx("a",{...t,target:"_blank",rel:"noopener noreferrer",className:"text-primary-dark hover:underline break-all font-medium"}),ul:t=>m.jsx("ul",{...t,className:"list-disc ml-6 my-4 space-y-2"}),ol:t=>m.jsx("ol",{...t,className:"list-decimal ml-6 my-4 space-y-2"}),li:t=>m.jsx("li",{...t,className:"leading-relaxed text-sm"}),code:t=>m.jsx("code",{...t,className:"px-1 py-0.5 bg-muted rounded text-sm font-mono break-all"}),pre:t=>m.jsx("pre",{...t,className:"flex w-full min-w-0 my-4 bg-muted rounded overflow-hidden",children:m.jsx("code",{className:"flex-1 min-w-0 p-4 text-sm font-mono whitespace-pre overflow-x-auto",children:t.children})}),table:t=>m.jsx(Q3,{...t}),thead:t=>m.jsx("thead",{...t,className:"bg-muted",children:t.children}),tr:t=>m.jsx("tr",{...t,className:"even:bg-muted/50 border-b border-border last:border-0"}),th:t=>m.jsx("th",{...t,className:"px-4 py-2 text-left font-semibold text-muted-foreground border-b border-border"}),td:t=>m.jsx("td",{...t,className:"px-4 py-2 border-b border-border"})},ad=v.memo(t=>{const e=K.c(2),{content:n}=t;let r;return e[0]!==n?(r=m.jsx(xb,{remarkPlugins:J3,rehypePlugins:e_,components:t_,children:n}),e[0]=n,e[1]=r):r=e[1],r},(t,e)=>t.content===e.content);function n_(t){const e=K.c(20),{language:n,content:r}=t,{handleCopy:i,copied:a}=id(),s=n||"text";let u;e[0]!==s?(u=m.jsx("span",{className:"text-xs font-mono uppercase text-muted-foreground tracking-widest select-none",children:s}),e[0]=s,e[1]=u):u=e[1];let o;e[2]!==r||e[3]!==i?(o=()=>i(r),e[2]=r,e[3]=i,e[4]=o):o=e[4];let l;e[5]!==a?(l=a?m.jsx(Kt,{size:14}):m.jsx(ti,{size:14}),e[5]=a,e[6]=l):l=e[6];let f;e[7]!==o||e[8]!==l?(f=m.jsx(Bt,{size:"icon",variant:"ghost",onClick:o,"aria-label":"Copy code",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:l}),e[7]=o,e[8]=l,e[9]=f):f=e[9];let d;e[10]!==u||e[11]!==f?(d=m.jsxs("div",{className:"flex items-center justify-between p-1 pl-4 bg-muted border-b border-border",children:[u,f]}),e[10]=u,e[11]=f,e[12]=d):d=e[12];let h;e[13]===Symbol.for("react.memo_cache_sentinel")?(h=m.jsx(W3,{}),e[13]=h):h=e[13];let p;e[14]!==r||e[15]!==n?(p=m.jsx(v.Suspense,{fallback:h,children:m.jsx(V3,{language:n,content:r})}),e[14]=r,e[15]=n,e[16]=p):p=e[16];let g;return e[17]!==d||e[18]!==p?(g=m.jsxs("div",{className:"my-4 rounded-lg bg-muted overflow-hidden border border-border grid min-w-0",children:[d,p]}),e[17]=d,e[18]=p,e[19]=g):g=e[19],g}ad.displayName="MemoizedMarkdownBlock";const cs=t=>{const e=K.c(7),{id:n,text:r}=t;let i;e[0]!==r?(i=_e.lexer(r),e[0]=r,e[1]=i):i=e[1];const a=i;let s;if(e[2]!==a||e[3]!==n){let u;e[5]!==n?(u=(o,l)=>o.type==="code"?m.jsx(n_,{language:o.lang,content:o.text},`${n}-block_${l}`):m.jsx(ad,{content:o.raw},`${n}-block_${l}`),e[5]=n,e[6]=u):u=e[6],s=a.map(u),e[2]=a,e[3]=n,e[4]=s}else s=e[4];return s};cs.displayName="MemoizedMarkdown";function sd(t){const e=K.c(18),{id:n,part:r,copyable:i,extraActions:a,hasToolCallAfter:s}=t,u=i===void 0?!1:i,o=s===void 0?!1:s,{handleCopy:l}=L0(),[f,d]=v.useState(!1);let h;e[0]!==l||e[1]!==r.text?(h=async()=>{await l(r.text),d(!0),setTimeout(()=>d(!1),2e3)},e[0]=l,e[1]=r.text,e[2]=h):h=e[2];const p=h,g=u&&a,x=g||a,_=!o&&"mb-2";let b;e[3]!==_?(b=ce("group/part relative",_),e[3]=_,e[4]=b):b=e[4];let k;e[5]!==n||e[6]!==r.text?(k=m.jsx(cs,{id:n,text:r.text}),e[5]=n,e[6]=r.text,e[7]=k):k=e[7];let E;e[8]!==a||e[9]!==p||e[10]!==f||e[11]!==x||e[12]!==g?(E=x&&m.jsx("div",{className:"flex w-full items-center text-xs text-muted-foreground opacity-0 pointer-events-none transition-all duration-200 group-hover/part:opacity-100 group-hover/part:pointer-events-auto mt-2",children:m.jsxs("div",{className:"flex items-center gap-1",children:[g&&m.jsx(Bt,{onClick:p,variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground size-6 whitespace-nowrap",children:f?m.jsx(Kt,{size:12}):m.jsx(ti,{size:12})}),a]})}),e[8]=a,e[9]=p,e[10]=f,e[11]=x,e[12]=g,e[13]=E):E=e[13];let w;return e[14]!==b||e[15]!==k||e[16]!==E?(w=m.jsxs("div",{className:b,children:[k,E]}),e[14]=b,e[15]=k,e[16]=E,e[17]=w):w=e[17],w}function r_(t){const e=K.c(27),{toolName:n,input:r,output:i}=t;let a;if(e[0]!==i){const o=JSON.stringify(i,null,2);a=o.length>2e3?o.slice(0,2e3)+"...[TRUNCATED]":o,e[0]=i,e[1]=a}else a=e[1];const s=a;if(n==="READ_MCP_TOOLS"){const o=r?.id;if(o){let l;return e[2]!==o?(l=m.jsx(Zu,{connectionId:o}),e[2]=o,e[3]=l):l=e[3],l}}if(n==="CALL_MCP_TOOL"){const o=r?.connectionId;let l;e[4]!==o?(l=o&&m.jsx(Zu,{connectionId:o,compact:!0}),e[4]=o,e[5]=l):l=e[5];let f;e[6]!==i?(f=JSON.stringify(i,null,2),e[6]=i,e[7]=f):f=e[7];let d;e[8]!==f?(d=m.jsx("div",{className:"absolute top-1 right-1 z-10",children:m.jsx(i_,{text:f})}),e[8]=f,e[9]=d):d=e[9];let h;e[10]===Symbol.for("react.memo_cache_sentinel")?(h=m.jsx("div",{className:"font-semibold text-muted-foreground mb-0.5 text-[10px] uppercase tracking-wider px-2 pt-2",children:"Input"}),e[10]=h):h=e[10];let p;e[11]!==r?(p=JSON.stringify(r,null,2),e[11]=r,e[12]=p):p=e[12];let g;e[13]!==p?(g=m.jsx("div",{className:"mb-2",children:m.jsx(Dr,{jsonString:p,padding:"0.5rem"})}),e[13]=p,e[14]=g):g=e[14];let x;e[15]===Symbol.for("react.memo_cache_sentinel")?(x=m.jsx("div",{className:"font-semibold text-muted-foreground mb-0.5 text-[10px] uppercase tracking-wider px-2",children:"Output"}),e[15]=x):x=e[15];let _;e[16]!==s?(_=m.jsx("div",{children:m.jsx(Dr,{jsonString:s,padding:"0.5rem"})}),e[16]=s,e[17]=_):_=e[17];let b;e[18]!==d||e[19]!==g||e[20]!==_?(b=m.jsxs("div",{className:"relative bg-muted rounded-md overflow-auto max-h-[200px]",children:[d,h,g,x,_]}),e[18]=d,e[19]=g,e[20]=_,e[21]=b):b=e[21];let k;return e[22]!==b||e[23]!==l?(k=m.jsxs("div",{className:"flex flex-col gap-2",children:[l,b]}),e[22]=b,e[23]=l,e[24]=k):k=e[24],k}let u;return e[25]!==s?(u=m.jsx(Dr,{jsonString:s,padding:"0"}),e[25]=s,e[26]=u):u=e[26],u}function Zu(t){const e=K.c(15),{connectionId:n,compact:r}=t,i=Kd(n),{org:a}=Mt(),{slug:s}=a,u=Gd();if(!i)return null;let o;e[0]!==i.id||e[1]!==u||e[2]!==s?(o=()=>{u({to:"/$org/mcps/$connectionId",params:{org:s,connectionId:i.id}})},e[0]=i.id,e[1]=u,e[2]=s,e[3]=o):o=e[3];const l=o;if(r){let d;e[4]!==i.title?(d=m.jsx("span",{className:"font-medium text-foreground",children:i.title}),e[4]=i.title,e[5]=d):d=e[5];let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=m.jsx(pf,{size:12}),e[6]=h):h=e[6];let p;e[7]!==l?(p=m.jsx("button",{type:"button",onClick:l,className:"hover:text-foreground transition-colors",title:"Open connection",children:h}),e[7]=l,e[8]=p):p=e[8];let g;return e[9]!==d||e[10]!==p?(g=m.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-muted/50 px-2 py-1 rounded-md w-fit",children:[d,p]}),e[9]=d,e[10]=p,e[11]=g):g=e[11],g}let f;return e[12]!==i||e[13]!==l?(f=m.jsx(hf,{connection:i,onClick:l}),e[12]=i,e[13]=l,e[14]=f):f=e[14],f}function i_({text:t}){const e=async()=>{try{if(navigator.clipboard)await navigator.clipboard.writeText(t),Ci.success("Copied to clipboard");else throw new Error("Clipboard API unavailable")}catch(n){try{const r=document.createElement("textarea");r.value=t,r.style.position="fixed",r.style.left="-9999px",r.style.top="0",document.body.appendChild(r),r.focus(),r.select();const i=document.execCommand("copy");if(document.body.removeChild(r),i)Ci.success("Copied to clipboard");else throw new Error("Fallback copy failed")}catch(r){console.error("Copy failed",n,r),Ci.error("Failed to copy to clipboard")}}};return m.jsx(Bt,{size:"icon",variant:"ghost",className:"h-5 w-5 hover:bg-background/50",onClick:e,children:m.jsx(ti,{size:12})})}function Ku(t){const e=K.c(50),{part:n}=t,{state:r}=n;let i;e[0]!==n?(i="toolName"in n?n.toolName:n.type.replace("tool-",""),e[0]=n,e[1]=i):i=e[1];const a=i,[s,u]=v.useState(!1);let o;e[2]!==s?(o=()=>u(!s),e[2]=s,e[3]=o):o=e[3];let l;e[4]!==r?(l=r==="output-error"?m.jsx(df,{className:"size-4 text-destructive shrink-0"}):m.jsx(ff,{className:ce("size-4 text-muted-foreground shrink-0",(r==="input-streaming"||r==="input-available")&&"shimmer")}),e[4]=r,e[5]=l):l=e[5];const f=r==="output-error"&&"text-destructive/90",d=(r==="input-streaming"||r==="input-available")&&"shimmer";let h;e[6]!==f||e[7]!==d?(h=ce("text-xs font-medium text-muted-foreground truncate",f,d),e[6]=f,e[7]=d,e[8]=h):h=e[8];const p=r==="input-streaming"&&`Streaming ${a} arguments`,g=r==="input-available"&&`Calling ${a}`,x=r==="output-available"&&`Called ${a}`,_=r==="output-error"&&`Error calling ${a}`;let b;e[9]!==_||e[10]!==h||e[11]!==p||e[12]!==g||e[13]!==x?(b=m.jsxs("span",{className:h,children:[p,g,x,_]}),e[9]=_,e[10]=h,e[11]=p,e[12]=g,e[13]=x,e[14]=b):b=e[14];let k;e[15]!==b||e[16]!==l?(k=m.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[l,b]}),e[15]=b,e[16]=l,e[17]=k):k=e[17];const E=s&&"rotate-90";let w;e[18]!==E?(w=ce("size-4 text-muted-foreground transition-transform",E),e[18]=E,e[19]=w):w=e[19];let R;e[20]!==w?(R=m.jsx("div",{className:"flex items-center gap-2 shrink-0",children:m.jsx(go,{className:w})}),e[20]=w,e[21]=R):R=e[21];let S;e[22]!==k||e[23]!==R||e[24]!==o?(S=m.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-2 w-full cursor-pointer p-3",children:[k,R]}),e[22]=k,e[23]=R,e[24]=o,e[25]=S):S=e[25];const O=s?"max-h-[1000px] opacity-100":"max-h-0 opacity-0";let F;e[26]!==O?(F=ce("transition-all duration-200 ease-in-out overflow-hidden",O),e[26]=O,e[27]=F):F=e[27];let j;e[28]===Symbol.for("react.memo_cache_sentinel")?(j=m.jsx("div",{className:"w-4 relative shrink-0",children:m.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-0.25 bg-border"})}),e[28]=j):j=e[28];let N;e[29]!==n.input||e[30]!==r?(N=(r==="input-streaming"||r==="input-available"||r==="output-available")&&!!n.input&&m.jsxs("div",{className:"flex flex-col gap-0.5",children:[m.jsx("div",{className:"px-1 h-5 flex items-center",children:m.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Input"})}),m.jsx("div",{className:"border border-border rounded-lg max-h-[200px] overflow-auto p-2",children:m.jsx(Dr,{jsonString:JSON.stringify(n.input,null,2),padding:"0"})})]}),e[29]=n.input,e[30]=r,e[31]=N):N=e[31];let P;e[32]!==n.input||e[33]!==n.output||e[34]!==r||e[35]!==a?(P=r==="output-available"&&m.jsxs("div",{className:"flex flex-col gap-0.5",children:[m.jsx("div",{className:"px-1 h-5 flex items-center",children:m.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Output"})}),m.jsx("div",{className:"border border-border rounded-lg max-h-[200px] overflow-auto p-2",children:m.jsx(r_,{toolName:a,input:n.input,output:n.output})})]}),e[32]=n.input,e[33]=n.output,e[34]=r,e[35]=a,e[36]=P):P=e[36];let M;e[37]!==n||e[38]!==r?(M=r==="output-error"&&m.jsxs("div",{className:"flex flex-col gap-0.5",children:[m.jsx("div",{className:"px-1 h-5 flex items-center",children:m.jsx("span",{className:"text-xs font-medium text-destructive/90",children:"Error"})}),m.jsx("div",{className:"border border-destructive/20 rounded-lg max-h-[200px] overflow-auto p-2 bg-destructive/10",children:m.jsx("pre",{className:"text-xs font-mono text-destructive whitespace-pre-wrap wrap-break-word",children:"errorText"in n&&typeof n.errorText=="string"?n.errorText:"An unknown error occurred"})})]}),e[37]=n,e[38]=r,e[39]=M):M=e[39];let J;e[40]!==N||e[41]!==P||e[42]!==M?(J=m.jsxs("div",{className:"flex ml-[7px] px-3 pb-3",children:[j,m.jsxs("div",{className:"flex flex-col gap-4 flex-1 min-w-0 pt-2",children:[N,P,M]})]}),e[40]=N,e[41]=P,e[42]=M,e[43]=J):J=e[43];let z;e[44]!==F||e[45]!==J?(z=m.jsx("div",{className:F,children:J}),e[44]=F,e[45]=J,e[46]=z):z=e[46];let H;return e[47]!==S||e[48]!==z?(H=m.jsx("div",{className:"flex flex-col my-4 w-full min-w-0",children:m.jsxs("div",{className:"border border-border/75 rounded-lg flex flex-col bg-background w-full min-w-0 overflow-hidden",children:[S,z]})}),e[47]=S,e[48]=z,e[49]=H):H=e[49],H}const a_={openrouter:t=>{const e=t?.openrouter;return typeof e=="object"&&e!==null&&"usage"in e&&typeof e.usage=="object"&&e.usage!==null&&"cost"in e.usage&&typeof e.usage.cost=="number"?e.usage.cost:null}};function s_(t){if(!t?.providerMetadata)return null;for(const e of Object.values(a_)){const n=e(t.providerMetadata);if(n!==null)return n}return null}function u_(t){return t.reduce((e,n)=>{const r=n.metadata?.usage;return r?{inputTokens:e.inputTokens+(r.inputTokens??0),outputTokens:e.outputTokens+(r.outputTokens??0),totalTokens:e.totalTokens+(r.totalTokens??0),cost:e.cost+(s_(r)??0)}:e},{inputTokens:0,outputTokens:0,totalTokens:0,cost:0})}function o_(t){const e=K.c(38),{messages:n}=t;let r,i,a,s,u,o,l,f,d,h,p,g;if(e[0]!==n){g=Symbol.for("react.early_return_sentinel");e:{const w=u_(n);if(!w){g=null;break e}const{totalTokens:R,inputTokens:S,outputTokens:O,cost:F}=w;if(a=F,!R&&!S&&!O){g=null;break e}i=Ia;let j;e[13]===Symbol.for("react.memo_cache_sentinel")?(j=m.jsx(bo,{size:12}),e[13]=j):j=e[13];const N=m.jsxs(Bt,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground pl-1! h-6 gap-1 whitespace-nowrap",children:[j,m.jsx("span",{className:"text-[10px] font-mono tabular-nums",children:R.toLocaleString()})]});e[14]!==N?(p=m.jsx(Na,{asChild:!0,children:N}),e[14]=N,e[15]=p):p=e[15],r=wa,d="top",h="font-mono text-[11px]",u="grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",e[16]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx("span",{className:"text-muted",children:"in"}),e[16]=o):o=e[16],l=m.jsx("span",{children:S.toLocaleString()}),e[17]===Symbol.for("react.memo_cache_sentinel")?(f=m.jsx("span",{className:"text-muted",children:"out"}),e[17]=f):f=e[17],s=O.toLocaleString()}e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=s,e[5]=u,e[6]=o,e[7]=l,e[8]=f,e[9]=d,e[10]=h,e[11]=p,e[12]=g}else r=e[1],i=e[2],a=e[3],s=e[4],u=e[5],o=e[6],l=e[7],f=e[8],d=e[9],h=e[10],p=e[11],g=e[12];if(g!==Symbol.for("react.early_return_sentinel"))return g;let x;e[18]!==s?(x=m.jsx("span",{children:s}),e[18]=s,e[19]=x):x=e[19];let _;e[20]!==a?(_=a>0&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-muted",children:"cost"}),m.jsxs("span",{children:["$",a.toFixed(4)]})]}),e[20]=a,e[21]=_):_=e[21];let b;e[22]!==x||e[23]!==_||e[24]!==u||e[25]!==o||e[26]!==l||e[27]!==f?(b=m.jsxs("div",{className:u,children:[o,l,f,x,_]}),e[22]=x,e[23]=_,e[24]=u,e[25]=o,e[26]=l,e[27]=f,e[28]=b):b=e[28];let k;e[29]!==r||e[30]!==b||e[31]!==d||e[32]!==h?(k=m.jsx(r,{side:d,className:h,children:b}),e[29]=r,e[30]=b,e[31]=d,e[32]=h,e[33]=k):k=e[33];let E;return e[34]!==i||e[35]!==k||e[36]!==p?(E=m.jsxs(i,{children:[p,k]}),e[34]=i,e[35]=k,e[36]=p,e[37]=E):E=e[37],E}const l_={planning:{icon:m.jsx(Io,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Planning next moves"},thinking:{icon:m.jsx(ni,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Thinking"}},c_=1200;function d_(){const t=K.c(7),[e,n]=v.useState("planning");let r,i;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const o=setTimeout(()=>{n("thinking")},c_);return()=>{clearTimeout(o)}},i=[],t[0]=r,t[1]=i):(r=t[0],i=t[1]),v.useEffect(r,i);const a=l_[e];let s;t[2]!==a.label?(s=m.jsxs("span",{className:"text-xs text-muted-foreground shimmer",children:[a.label,"..."]}),t[2]=a.label,t[3]=s):s=t[3];let u;return t[4]!==a.icon||t[5]!==s?(u=m.jsx("div",{className:"flex items-center gap-1.5 py-2 opacity-60",children:m.jsxs("span",{className:"flex items-center gap-1.5",children:[a.icon,s]})}),t[4]=a.icon,t[5]=s,t[6]=u):u=t[6],u}function f_(t){const e=K.c(10),{duration:n,parts:r,id:i}=t,a=n/1e3;let s;e[0]!==a?(s=a.toFixed(1),e[0]=a,e[1]=s):s=e[1];const u=s,[o,l]=v.useState(!1),[f,d]=v.useState(!1);let h;if(e[2]!==i||e[3]!==f||e[4]!==o||e[5]!==r||e[6]!==u){const p=r.filter(p_),g=p.some(h_),x=g||f;let _,b;e[8]===Symbol.for("react.memo_cache_sentinel")?(_=()=>l(!0),b=()=>l(!1),e[8]=_,e[9]=b):(_=e[8],b=e[9]),h=m.jsxs("div",{className:"flex flex-col mb-2",children:[m.jsx("button",{type:"button",onClick:()=>!g&&d(!f),onMouseEnter:_,onMouseLeave:b,className:ce("flex items-center gap-1.5 py-2 opacity-60 transition-opacity",!g&&"cursor-pointer hover:opacity-100",g&&"cursor-default"),children:m.jsxs("span",{className:"flex items-center gap-1.5",children:[g?m.jsx(ni,{className:"text-muted-foreground shrink-0 shimmer",size:14}):o?m.jsx(go,{className:ce("text-muted-foreground transition-transform shrink-0",f&&"rotate-90"),size:14}):m.jsx(Ao,{className:"text-muted-foreground shrink-0",size:14}),m.jsx("span",{className:ce("text-xs text-muted-foreground",g&&"shimmer"),children:g?"Thinking...":`Thought for ${u}s`})]})}),x&&m.jsx("div",{className:"ml-[6px] border-l-2 pl-4 mt-1 mb-2 max-h-[300px] overflow-y-auto",children:p.map((k,E)=>m.jsx("div",{className:"text-muted-foreground markdown-sm pb-2",children:m.jsx(cs,{id:`${i}-reasoning-${E}`,text:k.text})},`${i}-reasoning-${E}`))})]}),e[2]=i,e[3]=f,e[4]=o,e[5]=r,e[6]=u,e[7]=h}else h=e[7];return h}function h_(t){return t.state==="streaming"}function p_(t){return t.type==="reasoning"}function m_(t){const e=K.c(11),{part:n,id:r,usageStats:i,isFollowedByToolCall:a}=t;switch(n.type){case"dynamic-tool":{let s;return e[0]!==r||e[1]!==n?(s=m.jsx(Ku,{part:n,id:r}),e[0]=r,e[1]=n,e[2]=s):s=e[2],s}case"text":{let s;return e[3]!==r||e[4]!==a||e[5]!==n||e[6]!==i?(s=m.jsx(sd,{id:r,part:n,extraActions:i,copyable:!0,hasToolCallAfter:a}),e[3]=r,e[4]=a,e[5]=n,e[6]=i,e[7]=s):s=e[7],s}case"reasoning":return null;case"step-start":case"file":case"source-url":case"source-document":return null;default:if(n.type.startsWith("tool-")){const s=n;let u;return e[8]!==r||e[9]!==s?(u=m.jsx(Ku,{part:s,id:r}),e[8]=r,e[9]=s,e[10]=u):u=e[10],u}}throw new Error(`Unknown part type: ${n.type}`)}function g_(t){const e=K.c(32),{message:n,status:r,className:i}=t,{id:a,parts:s}=n,l=r==="streaming"||r==="submitted",f=v.useRef(null);let d;e[0]!==a?(d=()=>{const z=localStorage.getItem(`msg-duration-${a}`);return z?Number(z):null},e[0]=a,e[1]=d):d=e[1];const[h,p]=v.useState(d);let g,x;e[2]!==l?(g=()=>{l&&f.current===null&&(f.current=Date.now())},x=[l],e[2]=l,e[3]=g,e[4]=x):(g=e[3],x=e[4]),v.useEffect(g,x);let _,b;e[5]!==h||e[6]!==a||e[7]!==s.length?(_=()=>{if(s.length>0&&h===null&&f.current!==null){const z=Date.now()-f.current;p(z),localStorage.setItem(`msg-duration-${a}`,z.toString())}},b=[s.length,h,a],e[5]=h,e[6]=a,e[7]=s.length,e[8]=_,e[9]=b):(_=e[8],b=e[9]),v.useEffect(_,b);const k=s.length>0;let E;e[10]!==s?(E=s.some(E_),e[10]=s,e[11]=E):E=e[11];const w=E;let R;e[12]!==l||e[13]!==s?(R=l&&s.some(b_),e[12]=l,e[13]=s,e[14]=R):R=e[14];const O=k&&(w||R)&&h!==null;let F;e[15]!==n?(F=m.jsx(o_,{messages:[n]}),e[15]=n,e[16]=F):F=e[16];const j=F;let N;e[17]!==i?(N=ce("w-full min-w-0 group relative flex items-start gap-4 px-4 z-20 text-foreground flex-row",i),e[17]=i,e[18]=N):N=e[18];let P;e[19]!==h||e[20]!==k||e[21]!==a||e[22]!==l||e[23]!==s||e[24]!==O||e[25]!==j?(P=k?m.jsxs(m.Fragment,{children:[O&&m.jsx(f_,{duration:h,parts:s,id:a}),s.map((z,H)=>{const Z=s[H+1],re=Z&&(Z.type==="dynamic-tool"||Z.type.startsWith("tool-"));return m.jsx(m_,{part:z,id:a,usageStats:H===s.length-1?j:void 0,isFollowedByToolCall:re},`${a}-${H}`)})]}):l?m.jsx(d_,{}):null,e[19]=h,e[20]=k,e[21]=a,e[22]=l,e[23]=s,e[24]=O,e[25]=j,e[26]=P):P=e[26];let M;e[27]!==P?(M=m.jsx("div",{className:"flex flex-col min-w-0 w-full items-start",children:m.jsx("div",{className:"w-full min-w-0 not-only:rounded-2xl text-sm wrap-break-word overflow-wrap-anywhere bg-transparent",children:P})}),e[27]=P,e[28]=M):M=e[28];let J;return e[29]!==M||e[30]!==N?(J=m.jsx("div",{className:N,children:M}),e[29]=M,e[30]=N,e[31]=J):J=e[31],J}function b_(t){return t.type==="reasoning"&&t.state==="streaming"}function E_(t){return t.type==="reasoning"}const ud=v.createContext(null);function od(t){const e=K.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx(m.Fragment,{children:n}),e[0]=n,e[1]=r):r=e[1],r}function T_(t){const e=[];for(let n=0;n<t.length;n++){const r=t[n];if(!v.isValidElement(r))continue;if(r.props?.message?.role==="assistant"){const a=t[n-1],s=v.isValidElement(a)&&a.props?.message?.role,u=a&&v.isValidElement(a)&&s==="user"?a:null;e.push({user:u,assistant:r})}}return e}function x_(t){const e=K.c(27),{children:n,className:r,minHeightOffset:i}=t,a=v.useRef(null);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],e[0]=s):s=e[0];const u=v.useRef(s);let o,l,f,d,h,p,g;if(e[1]!==n||e[2]!==r||e[3]!==i){const k=v.Children.toArray(n),E=k[k.length-1];l=E&&v.isValidElement(E)&&E.type===od?E:null;const w=l?k.slice(0,-1):k,R=T_(w);let S;e[11]===Symbol.for("react.memo_cache_sentinel")?(S=F=>{const j=u.current[F];if(j&&a.current){const N=a.current.offsetTop,P=j.offsetTop;a.current.scrollTo({top:P-N,behavior:"smooth"})}},e[11]=S):S=e[11];const O=S;o=ud.Provider,e[12]===Symbol.for("react.memo_cache_sentinel")?(g={scrollToPair:O},e[12]=g):g=e[12],h=a,e[13]!==r?(p=ce("w-full min-w-0 max-w-full overflow-y-auto h-full overflow-x-hidden",r),e[13]=r,e[14]=p):p=e[14],f="flex flex-col min-w-0 max-w-2xl mx-auto w-full",d=R.map((F,j)=>{const N=j===R.length-1;return m.jsxs("div",{ref:P=>{u.current[j]=P},className:"flex flex-col pb-2",style:N&&i?{minHeight:`calc(100vh - ${i}px)`}:void 0,children:[m.jsx("div",{className:"sticky top-0 z-50 bg-background w-full h-4"}),m.jsx("div",{className:"sticky mb-3 top-4 z-50",children:F.user&&v.isValidElement(F.user)?v.cloneElement(F.user,{pairIndex:j}):F.user}),F.assistant]},j)}),e[1]=n,e[2]=r,e[3]=i,e[4]=o,e[5]=l,e[6]=f,e[7]=d,e[8]=h,e[9]=p,e[10]=g}else o=e[4],l=e[5],f=e[6],d=e[7],h=e[8],p=e[9],g=e[10];let x;e[15]!==l||e[16]!==f||e[17]!==d?(x=m.jsxs("div",{className:f,children:[d,l]}),e[15]=l,e[16]=f,e[17]=d,e[18]=x):x=e[18];let _;e[19]!==h||e[20]!==p||e[21]!==x?(_=m.jsx("div",{ref:h,className:p,children:x}),e[19]=h,e[20]=p,e[21]=x,e[22]=_):_=e[22];let b;return e[23]!==o||e[24]!==g||e[25]!==_?(b=m.jsx(o,{value:g,children:_}),e[23]=o,e[24]=g,e[25]=_,e[26]=b):b=e[26],b}function __(t){const e=K.c(5),{locator:n}=Mt(),r=Lo(),i=Oa();let a;return e[0]!==n||e[1]!==r||e[2]!==t||e[3]!==i?(a=async(u,o,l)=>{const f=await Ro(n,l),d=f.findIndex(_=>_.id===u);if(d===-1){console.warn(`[branch] Message ${u} not found in thread ${l}`);return}const h=f.slice(0,d).filter(y_),p=crypto.randomUUID(),g=new Date().toISOString(),x={id:p,title:"",created_at:g,updated_at:g,hidden:!1};if(await i.insert.mutateAsync(x),h.length>0){const _=h.map(b=>({...b,id:crypto.randomUUID(),metadata:{...b.metadata,thread_id:p,created_at:b.metadata?.created_at||g}}));await r.insertMany.mutateAsync(_)}t(p)},e[0]=n,e[1]=r,e[2]=t,e[3]=i,e[4]=a):a=e[4],a}function y_(t){return t.role!=="system"}function A_(t){const e=K.c(18),{messageId:n,parts:r}=t,[i,a]=v.useState(!1),{setInputValue:s,startBranch:u,setActiveThreadId:o,activeThreadId:l}=w0(),f=__(o);let d;e[0]!==r?(d=r.filter(k_).map(C_).join(`
98
+ `),e[0]=r,e[1]=d):d=e[1];const h=d;let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=S=>{S.stopPropagation(),a(!0)},e[2]=p):p=e[2];const g=p;let x;e[3]!==l||e[4]!==f||e[5]!==n||e[6]!==h||e[7]!==s||e[8]!==u?(x=async()=>{await f(n,h,l),s(h),u({originalThreadId:l,originalMessageId:n,originalMessageText:h}),a(!1)},e[3]=l,e[4]=f,e[5]=n,e[6]=h,e[7]=s,e[8]=u,e[9]=x):x=e[9];const _=x;let b;e[10]===Symbol.for("react.memo_cache_sentinel")?(b=m.jsx("div",{className:"flex justify-center items-end px-2 pb-1",children:m.jsxs(Ia,{children:[m.jsx(Na,{asChild:!0,children:m.jsx(Bt,{onClick:g,variant:"ghost",size:"xs",className:"opacity-0 group-hover:opacity-100 hover:bg-gray-200/70 rounded-md transition-opacity text-muted-foreground hover:text-foreground aspect-square w-6 h-6 p-0",children:m.jsx(_o,{size:16,className:"p-0.5"})})}),m.jsx(wa,{side:"bottom",children:"Edit message"})]})}),e[10]=b):b=e[10];let k;e[11]===Symbol.for("react.memo_cache_sentinel")?(k=m.jsxs(mf,{children:[m.jsx(gf,{children:"Edit message?"}),m.jsx(bf,{children:"This will create a new conversation branch from this point. The original conversation will remain unchanged."})]}),e[11]=k):k=e[11];let E;e[12]===Symbol.for("react.memo_cache_sentinel")?(E=m.jsx(Ef,{children:"Cancel"}),e[12]=E):E=e[12];let w;e[13]!==_?(w=m.jsxs(Tf,{children:[k,m.jsxs(xf,{children:[E,m.jsx(_f,{onClick:_,children:"Confirm"})]})]}),e[13]=_,e[14]=w):w=e[14];let R;return e[15]!==i||e[16]!==w?(R=m.jsxs(m.Fragment,{children:[b,m.jsx(yf,{open:i,onOpenChange:a,children:w})]}),e[15]=i,e[16]=w,e[17]=R):R=e[17],R}function C_(t){return t.text}function k_(t){return t.type==="text"}function S_(t){const e=K.c(29),{message:n,className:r,pairIndex:i}=t,{id:a,parts:s}=n,u=v.useContext(ud),[o,l]=v.useState(!1);if(!s||s.length===0)return null;let f;e[0]!==u||e[1]!==i?(f=()=>{l(!0),i!==void 0&&u?.scrollToPair(i)},e[0]=u,e[1]=i,e[2]=f):f=e[2];const d=f;let h;e[3]!==r?(h=ce("message-block w-full min-w-0 group relative flex items-start gap-4 px-2.5 text-foreground flex-row-reverse",r),e[3]=r,e[4]=h):h=e[4];let p,g;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=()=>l(!0),g=()=>l(!1),e[5]=p,e[6]=g):(p=e[5],g=e[6]);const x=o?"overflow-auto opacity-100":"overflow-hidden opacity-99 mask-b-from-1%";let _;e[7]!==x?(_=ce("z-10 px-4 py-2 transition-opacity max-h-[120px] flex-1",x),e[7]=x,e[8]=_):_=e[8];let b;if(e[9]!==a||e[10]!==s){let O;e[12]!==a?(O=(F,j)=>F.type==="text"?m.jsx(sd,{id:a,part:F},`${a}-${j}`):null,e[12]=a,e[13]=O):O=e[13],b=s.map(O),e[9]=a,e[10]=s,e[11]=b}else b=e[11];let k;e[14]!==b?(k=m.jsx("div",{children:b}),e[14]=b,e[15]=k):k=e[15];let E;e[16]!==_||e[17]!==k?(E=m.jsx("div",{className:_,children:k}),e[16]=_,e[17]=k,e[18]=E):E=e[18];let w;e[19]!==a||e[20]!==s?(w=m.jsx(A_,{messageId:a,parts:s}),e[19]=a,e[20]=s,e[21]=w):w=e[21];let R;e[22]!==d||e[23]!==w||e[24]!==E?(R=m.jsxs("div",{tabIndex:0,onClick:d,onFocus:p,onBlur:g,className:"w-full border min-w-0 shadow-xs rounded-lg text-[0.9375rem] wrap-break-word overflow-wrap-anywhere bg-background cursor-pointer transition-colors relative flex outline-none",children:[E,w]}),e[22]=d,e[23]=w,e[24]=E,e[25]=R):R=e[25];let S;return e[26]!==R||e[27]!==h?(S=m.jsx(m.Fragment,{children:m.jsx("div",{className:h,children:R})}),e[26]=R,e[27]=h,e[28]=S):S=e[28],S}function I_(t){const e=K.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(kn.Root,{"data-slot":"drawer",...n}),e[2]=n,e[3]=r):r=e[3],r}function N_(t){const e=K.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(kn.Trigger,{"data-slot":"drawer-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function w_(t){const e=K.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(kn.Portal,{"data-slot":"drawer-portal",...n}),e[2]=n,e[3]=r):r=e[3],r}function R_(t){const e=K.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=ce("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",n),e[3]=n,e[4]=i):i=e[4];let a;return e[5]!==r||e[6]!==i?(a=m.jsx(kn.Overlay,{"data-slot":"drawer-overlay",className:i,...r}),e[5]=r,e[6]=i,e[7]=a):a=e[7],a}function L_(t){const e=K.c(12);let n,r,i;e[0]!==t?({className:r,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx(R_,{}),e[4]=a):a=e[4];let s;e[5]!==r?(s=ce("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",r),e[5]=r,e[6]=s):s=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=u):u=e[7];let o;return e[8]!==n||e[9]!==i||e[10]!==s?(o=m.jsxs(w_,{"data-slot":"drawer-portal",children:[a,m.jsxs(kn.Content,{"data-slot":"drawer-content",className:s,...i,children:[u,n]})]}),e[8]=n,e[9]=i,e[10]=s,e[11]=o):o=e[11],o}function O_(t){const e=K.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=ce("flex flex-col gap-1.5 px-4 py-2",n),e[3]=n,e[4]=i):i=e[4];let a;return e[5]!==r||e[6]!==i?(a=m.jsx("div",{"data-slot":"drawer-header",className:i,...r}),e[5]=r,e[6]=i,e[7]=a):a=e[7],a}function v_(t){const e=K.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=ce("text-foreground font-semibold",n),e[3]=n,e[4]=i):i=e[4];let a;return e[5]!==r||e[6]!==i?(a=m.jsx(kn.Title,{"data-slot":"drawer-title",className:i,...r}),e[5]=r,e[6]=i,e[7]=a):a=e[7],a}function Ju({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,i]=D_({defaultProp:e,onChange:n}),a=t!==void 0,s=a?t:r,u=ho(n),o=v.useCallback(l=>{if(a){const d=typeof l=="function"?l(t):l;d!==t&&u(d)}else i(l)},[a,t,i,u]);return[s,o]}function D_({defaultProp:t,onChange:e}){const n=v.useState(t),[r]=n,i=v.useRef(r),a=ho(e);return v.useEffect(()=>{i.current!==r&&(a(r),i.current=r)},[r,i,a]),n}const ld=v.createContext({isMobile:!1,setValue:()=>{}}),ds=()=>v.useContext(ld),cd=t=>{const e=K.c(37);let n,r,i,a,s,u,o,l;e[0]!==t?({children:n,defaultOpen:r,open:u,onOpenChange:a,defaultValue:i,value:l,onValueChange:s,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=a,e[5]=s,e[6]=u,e[7]=o,e[8]=l):(n=e[1],r=e[2],i=e[3],a=e[4],s=e[5],u=e[6],o=e[7],l=e[8]);const f=If(),d=r??!1;let h;e[9]!==a||e[10]!==u||e[11]!==d?(h={prop:u,defaultProp:d,onChange:a},e[9]=a,e[10]=u,e[11]=d,e[12]=h):h=e[12];const[p,g]=Ju(h);let x;e[13]!==i||e[14]!==s||e[15]!==l?(x={prop:l,defaultProp:i,onChange:s},e[13]=i,e[14]=s,e[15]=l,e[16]=x):x=e[16];const[_,b]=Ju(x);let k;e[17]!==b?(k=F=>{F&&b(F)},e[17]=b,e[18]=k):k=e[18];const E=k;let w;e[19]!==f||e[20]!==E?(w={isMobile:f,setValue:E},e[19]=f,e[20]=E,e[21]=w):w=e[21];let R;e[22]!==n||e[23]!==p||e[24]!==o||e[25]!==g?(R=m.jsx(I_,{open:p,onOpenChange:g,...o,children:n}),e[22]=n,e[23]=p,e[24]=o,e[25]=g,e[26]=R):R=e[26];let S;e[27]!==p||e[28]!==o||e[29]!==g||e[30]!==E||e[31]!==R||e[32]!==_?(S=m.jsx(Sf,{open:p,onOpenChange:g,value:_,onValueChange:E,...o,children:R}),e[27]=p,e[28]=o,e[29]=g,e[30]=E,e[31]=R,e[32]=_,e[33]=S):S=e[33];let O;return e[34]!==w||e[35]!==S?(O=m.jsx(ld.Provider,{value:w,children:S}),e[34]=w,e[35]=S,e[36]=O):O=e[36],O},dd=t=>{const{children:e,title:n,headerActions:r,...i}=t,{isMobile:a}=ds(),{className:s,...u}=i;return a?m.jsxs(L_,{...u,children:[m.jsxs(O_,{className:ce(r?"flex flex-row items-center justify-between":"hidden"),children:[m.jsx(v_,{children:n}),r]}),m.jsx("div",{className:ce("flex flex-col gap-2 p-2 py-4",s),children:e})]}):m.jsx(kf,{...i,children:e})},fd=t=>{const e=K.c(7);let n,r;e[0]!==t?({children:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);const{isMobile:i}=ds();let a;return e[3]!==n||e[4]!==i||e[5]!==r?(a=i?m.jsx(N_,{asChild:!0,children:m.jsx(Bt,{variant:"outline",...r,children:n})}):m.jsx(Cf,{...r,children:n}),e[3]=n,e[4]=i,e[5]=r,e[6]=a):a=e[6],a},hd=t=>{const e=K.c(7);let n,r;e[0]!==t?({children:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);const{isMobile:i}=ds();let a;return e[3]!==n||e[4]!==i||e[5]!==r?(a=i?m.jsx("span",{...r,children:n}):m.jsx(Af,{...r,children:n}),e[3]=n,e[4]=i,e[5]=r,e[6]=a):a=e[6],a};function P_(){const t=K.c(4),e=rf();let n;t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1];let r;return t[2]!==n?(r=n.map(M_),t[2]=n,t[3]=r):r=t[3],r}function M_(t){return{id:t.id,title:t.title,description:t.description??null,icon:t.icon??null,fallbackIcon:m.jsx(Ra,{})}}function B_(t){const e=K.c(24),{gateway:n,isSelected:r}=t,i=r&&"bg-accent";let a;e[0]!==i?(a=ce("flex items-start gap-3 py-3 px-3 hover:bg-accent cursor-pointer rounded-lg",i),e[0]=i,e[1]=a):a=e[1];let s;e[2]!==n.fallbackIcon?(s=n.fallbackIcon??m.jsx(Ra,{}),e[2]=n.fallbackIcon,e[3]=s):s=e[3];let u;e[4]!==n.icon||e[5]!==n.title||e[6]!==s?(u=m.jsx(mo,{icon:n.icon,name:n.title,size:"sm",fallbackIcon:s,className:"size-10"}),e[4]=n.icon,e[5]=n.title,e[6]=s,e[7]=u):u=e[7];let o;e[8]!==n.title?(o=m.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=o):o=e[9];let l;e[10]!==r?(l=r&&m.jsx(Kt,{size:16,className:"text-foreground shrink-0"}),e[10]=r,e[11]=l):l=e[11];let f;e[12]!==o||e[13]!==l?(f=m.jsxs("div",{className:"flex items-center justify-between",children:[o,l]}),e[12]=o,e[13]=l,e[14]=f):f=e[14];let d;e[15]!==n.description?(d=n.description&&m.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1 leading-relaxed",children:n.description}),e[15]=n.description,e[16]=d):d=e[16];let h;e[17]!==f||e[18]!==d?(h=m.jsxs("div",{className:"flex flex-col flex-1 min-w-0 gap-0.5",children:[f,d]}),e[17]=f,e[18]=d,e[19]=h):h=e[19];let p;return e[20]!==a||e[21]!==u||e[22]!==h?(p=m.jsxs("div",{className:a,children:[u,h]}),e[20]=a,e[21]=u,e[22]=h,e[23]=p):p=e[23],p}function F_(t){const e=K.c(12),{gateway:n}=t;if(!n){let u;return e[0]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx("span",{className:"text-sm text-muted-foreground",children:"Select gateway"}),e[0]=u):u=e[0],u}let r;e[1]!==n.fallbackIcon?(r=n.fallbackIcon??m.jsx(Ra,{}),e[1]=n.fallbackIcon,e[2]=r):r=e[2];let i;e[3]!==n.icon||e[4]!==n.title||e[5]!==r?(i=m.jsx(mo,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:r,className:"w-5! h-5! min-w-5! shrink-0 rounded-sm"}),e[3]=n.icon,e[4]=n.title,e[5]=r,e[6]=i):i=e[6];let a;e[7]!==n.title?(a=m.jsx("span",{className:"text-sm text-muted-foreground group-hover:text-foreground transition-colors truncate min-w-0 max-w-[200px] hidden sm:inline-block",children:n.title}),e[7]=n.title,e[8]=a):a=e[8];let s;return e[9]!==i||e[10]!==a?(s=m.jsxs("div",{className:"flex items-center gap-2 min-w-0 max-w-full",children:[i,a]}),e[9]=i,e[10]=a,e[11]=s):s=e[11],s}function nA(t){const e=K.c(37),{selectedGatewayId:n,onGatewayChange:r,variant:i,className:a,placeholder:s}=t,u=i===void 0?"bordered":i,o=s===void 0?"Select gateway":s,[l,f]=v.useState(!1),d=P_();let h;if(e[0]!==d||e[1]!==n){let P;e[3]!==n?(P=M=>M.id===n,e[3]=n,e[4]=P):P=e[4],h=d.find(P),e[0]=d,e[1]=n,e[2]=h}else h=e[2];const p=h;let g;e[5]!==r?(g=P=>{r(P),f(!1)},e[5]=r,e[6]=g):g=e[6];const x=g,_=n||"",b=u==="borderless"&&"border-0 md:border-none";let k;e[7]!==a||e[8]!==b?(k=ce("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 max-w-full",b,a),e[7]=a,e[8]=b,e[9]=k):k=e[9];let E;e[10]!==p?(E=m.jsx(F_,{gateway:p}),e[10]=p,e[11]=E):E=e[11];let w;e[12]!==o||e[13]!==E?(w=m.jsx(hd,{placeholder:o,className:"min-w-0 max-w-full",children:E}),e[12]=o,e[13]=E,e[14]=w):w=e[14];let R;e[15]!==k||e[16]!==w?(R=m.jsx(fd,{size:"sm",className:k,children:w}),e[15]=k,e[16]=w,e[17]=R):R=e[17];let S;e[18]===Symbol.for("react.memo_cache_sentinel")?(S=m.jsx("div",{className:"border-b px-4 py-3 bg-background/95 backdrop-blur sticky top-0 z-10",children:m.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[m.jsx(po,{size:16}),m.jsx("span",{className:"text-sm",children:"Search for a gateway..."})]})}),e[18]=S):S=e[18];let O;if(e[19]!==d||e[20]!==x||e[21]!==n){let P;e[23]!==x||e[24]!==n?(P=M=>m.jsx("div",{onClick:()=>x(M.id),className:"outline-none",children:m.jsx(B_,{gateway:M,isSelected:M.id===n})},M.id),e[23]=x,e[24]=n,e[25]=P):P=e[25],O=d.map(P),e[19]=d,e[20]=x,e[21]=n,e[22]=O}else O=e[22];let F;e[26]!==O?(F=m.jsxs("div",{className:"flex flex-col max-h-[400px]",children:[S,m.jsx("div",{className:"overflow-y-auto p-2 flex flex-col gap-1",children:O})]}),e[26]=O,e[27]=F):F=e[27];let j;e[28]!==o||e[29]!==F?(j=m.jsx(dd,{title:o,className:"w-full md:w-[400px] p-0",children:F}),e[28]=o,e[29]=F,e[30]=j):j=e[30];let N;return e[31]!==x||e[32]!==l||e[33]!==R||e[34]!==j||e[35]!==_?(N=m.jsxs(cd,{open:l,onOpenChange:f,value:_,onValueChange:x,children:[R,j]}),e[31]=x,e[32]=l,e[33]=R,e[34]=j,e[35]=_,e[36]=N):N=e[36],N}function H_(t,e){const n=K.c(4);let r;n[0]!==e?(r={},n[0]=e,n[1]=r):r=n[1];const i=r,a=t??Jd;let s;return n[2]!==a?(s=tf(a),n[2]=a,n[3]=s):s=n[3],ef(a,"LLM",s,i)}function U_(){const t=K.c(8),e=nf();let n;t[0]!==e?(n={connections:e,binding:"LLMS"},t[0]=e,t[1]=n):n=t[1];const[r]=Zd(n),i=H_(r?.id);if(!i||!r){let s;return t[2]===Symbol.for("react.memo_cache_sentinel")?(s=[],t[2]=s):s=t[2],s}let a;if(t[3]!==r||t[4]!==i){let s;t[6]!==r?(s=u=>({...u,name:u.title,contextWindow:u.limits?.contextWindow,outputLimit:u.limits?.maxOutputTokens,inputCost:u.costs?.input,outputCost:u.costs?.output,provider:u.provider,connectionId:r.id,connectionName:r.title}),t[6]=r,t[7]=s):s=t[7],a=i.map(s).sort(z_),t[3]=r,t[4]=i,t[5]=a}else a=t[5];return a}function z_(t,e){return t.name.localeCompare(e.name)}const j_={reasoning:{icon:m.jsx(ni,{className:"size-4"}),bg:"bg-purple-100",text:"text-purple-700",label:"Reasoning"},"image-upload":{icon:m.jsx(yo,{className:"size-4"}),bg:"bg-teal-100",text:"text-teal-700",label:"Can analyze images"},"file-upload":{icon:m.jsx(Nf,{className:"size-4"}),bg:"bg-blue-100",text:"text-blue-700",label:"Can analyze files"},"web-search":{icon:m.jsx(po,{className:"size-4"}),bg:"bg-amber-100",text:"text-amber-700",label:"Can search the web to answer questions"}},pd=v.memo(function(e){const n=K.c(11),{capability:r}=e,i=j_[r];let a;n[0]!==r||n[1]!==i?(a=i||{icon:m.jsx(Kt,{className:"size-4"}),bg:"bg-slate-200",text:"text-slate-700",label:r},n[0]=r,n[1]=i,n[2]=a):a=n[2];const s=a,u=`flex items-center justify-center h-6 w-6 rounded-sm ${s.bg} ${s.text}`;let o;n[3]!==s.icon||n[4]!==u?(o=m.jsx(Na,{asChild:!0,children:m.jsx("div",{className:u,children:s.icon})}),n[3]=s.icon,n[4]=u,n[5]=o):o=n[5];let l;n[6]!==s.label?(l=m.jsx(wa,{children:m.jsx("p",{children:s.label})}),n[6]=s.label,n[7]=l):l=n[7];let f;return n[8]!==o||n[9]!==l?(f=m.jsxs(Ia,{children:[o,l]}),n[8]=o,n[9]=l,n[10]=f):f=n[10],f}),eo=v.memo(function(e){const n=K.c(54),{model:r,compact:i}=e,a=i===void 0?!1:i;if(!r){let b;return n[0]===Symbol.for("react.memo_cache_sentinel")?(b=m.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),n[0]=b):b=n[0],b}const s=r.contextWindow||r.inputCost||r.outputCost||r.outputLimit;if(!s&&!a){let b;n[1]!==r.logo||n[2]!==r.name?(b=r.logo&&m.jsx("img",{src:r.logo,className:"w-6 h-6",alt:r.name}),n[1]=r.logo,n[2]=r.name,n[3]=b):b=n[3];let k;n[4]!==r.name?(k=m.jsx("p",{className:"text-lg font-medium leading-7",children:r.name}),n[4]=r.name,n[5]=k):k=n[5];let E;n[6]!==b||n[7]!==k?(E=m.jsxs("div",{className:"flex items-center gap-3 py-2 px-0",children:[b,k]}),n[6]=b,n[7]=k,n[8]=E):E=n[8];let w;n[9]!==r.description?(w=r.description&&m.jsx("p",{className:"text-sm text-muted-foreground",children:r.description}),n[9]=r.description,n[10]=w):w=n[10];let R;return n[11]!==E||n[12]!==w?(R=m.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[E,w]}),n[11]=E,n[12]=w,n[13]=R):R=n[13],R}if(!s&&a)return null;if(a){let b;n[14]!==r.contextWindow?(b=r.contextWindow&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Context"}),m.jsxs("span",{className:"text-foreground font-medium",children:[r.contextWindow.toLocaleString()," tokens"]})]}),n[14]=r.contextWindow,n[15]=b):b=n[15];let k;n[16]!==r.inputCost?(k=r.inputCost&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Input cost"}),m.jsxs("span",{className:"text-foreground font-medium",children:["$",r.inputCost.toFixed(2)," / 1M"]})]}),n[16]=r.inputCost,n[17]=k):k=n[17];let E;n[18]!==r.outputCost?(E=r.outputCost&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Output cost"}),m.jsxs("span",{className:"text-foreground font-medium",children:["$",r.outputCost.toFixed(2)," / 1M"]})]}),n[18]=r.outputCost,n[19]=E):E=n[19];let w;n[20]!==r.outputLimit?(w=r.outputLimit&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Output limit"}),m.jsxs("span",{className:"text-foreground font-medium",children:[r.outputLimit.toLocaleString()," tokens"]})]}),n[20]=r.outputLimit,n[21]=w):w=n[21];let R;return n[22]!==b||n[23]!==k||n[24]!==E||n[25]!==w?(R=m.jsxs("div",{className:"flex flex-col gap-2.5 pt-3 pb-3 px-3 rounded-b-lg text-xs",children:[b,k,E,w]}),n[22]=b,n[23]=k,n[24]=E,n[25]=w,n[26]=R):R=n[26],R}let u;n[27]!==r.logo||n[28]!==r.name?(u=r.logo&&m.jsx("img",{src:r.logo,className:"w-6 h-6",alt:r.name}),n[27]=r.logo,n[28]=r.name,n[29]=u):u=n[29];let o;n[30]!==r.name?(o=m.jsx("p",{className:"text-lg font-medium leading-7",children:r.name}),n[30]=r.name,n[31]=o):o=n[31];let l;n[32]!==u||n[33]!==o?(l=m.jsxs("div",{className:"flex items-center gap-3",children:[u,o]}),n[32]=u,n[33]=o,n[34]=l):l=n[34];let f;n[35]!==r.capabilities?(f=r.capabilities&&r.capabilities.length>0&&m.jsx("div",{className:"flex items-center gap-2",children:r.capabilities.map(q_)}),n[35]=r.capabilities,n[36]=f):f=n[36];let d;n[37]!==l||n[38]!==f?(d=m.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[l,f]}),n[37]=l,n[38]=f,n[39]=d):d=n[39];let h;n[40]!==r.contextWindow?(h=r.contextWindow&&m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(uf,{className:"w-3.5 h-3.5 text-muted-foreground"}),m.jsx("p",{className:"text-sm text-foreground",children:"Context window"})]}),m.jsxs("p",{className:"text-sm text-muted-foreground",children:[r.contextWindow.toLocaleString()," tokens"]})]}),n[40]=r.contextWindow,n[41]=h):h=n[41];let p;n[42]!==r.inputCost||n[43]!==r.outputCost?(p=(r.inputCost||r.outputCost)&&m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(To,{className:"w-3.5 h-3.5 text-muted-foreground"}),m.jsx("p",{className:"text-sm text-foreground",children:"Costs"})]}),m.jsxs("div",{className:"flex flex-col gap-0.5",children:[r.inputCost!==null&&r.inputCost!==void 0&&m.jsxs("p",{className:"text-sm text-muted-foreground",children:["$",r.inputCost.toFixed(2)," / 1M tokens (input)"]}),r.outputCost!==null&&r.outputCost!==void 0&&m.jsxs("p",{className:"text-sm text-muted-foreground",children:["$",r.outputCost.toFixed(2)," / 1M tokens (output)"]})]})]}),n[42]=r.inputCost,n[43]=r.outputCost,n[44]=p):p=n[44];let g;n[45]!==r.outputLimit?(g=r.outputLimit&&m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(Co,{className:"w-4.5 h-4.5 text-muted-foreground/70"}),m.jsx("p",{className:"text-sm text-foreground",children:"Output limit"})]}),m.jsxs("p",{className:"text-sm text-muted-foreground",children:[r.outputLimit.toLocaleString()," token limit"]})]}),n[45]=r.outputLimit,n[46]=g):g=n[46];let x;n[47]!==h||n[48]!==p||n[49]!==g?(x=m.jsxs("div",{className:"flex flex-col gap-4",children:[h,p,g]}),n[47]=h,n[48]=p,n[49]=g,n[50]=x):x=n[50];let _;return n[51]!==x||n[52]!==d?(_=m.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[d,x]}),n[51]=x,n[52]=d,n[53]=_):_=n[53],_}),$_=v.memo(function(e){const n=K.c(27),{model:r,onHover:i,isSelected:a,hasExpandedInfo:s}=e,u=s?"rounded-t-lg":"rounded-lg";let o;n[0]!==u?(o=ce("flex items-center gap-2 h-10 py-4 px-3 hover:bg-accent cursor-pointer",u),n[0]=u,n[1]=o):o=n[1];let l;n[2]!==r||n[3]!==i?(l=()=>i(r),n[2]=r,n[3]=i,n[4]=l):l=n[4];let f;n[5]!==r.logo||n[6]!==r.name?(f=r.logo&&m.jsx("img",{src:r.logo,className:"w-5 h-5 shrink-0",alt:r.name}),n[5]=r.logo,n[6]=r.name,n[7]=f):f=n[7];let d;n[8]!==r.name?(d=m.jsx("span",{className:"text-sm text-foreground",children:r.name}),n[8]=r.name,n[9]=d):d=n[9];let h;n[10]!==s||n[11]!==r.capabilities?(h=s&&r.capabilities&&r.capabilities.length>0&&m.jsx("div",{className:"md:hidden flex items-center gap-1.5 ml-auto",children:r.capabilities.map(V_)}),n[10]=s,n[11]=r.capabilities,n[12]=h):h=n[12];let p;n[13]!==s||n[14]!==a?(p=a&&!s&&m.jsx(Kt,{className:"w-4 h-4 text-foreground ml-auto"}),n[13]=s,n[14]=a,n[15]=p):p=n[15];let g;n[16]!==s||n[17]!==a?(g=a&&s&&m.jsx(Kt,{className:"w-4 h-4 text-foreground ml-2 shrink-0"}),n[16]=s,n[17]=a,n[18]=g):g=n[18];let x;return n[19]!==o||n[20]!==l||n[21]!==f||n[22]!==d||n[23]!==h||n[24]!==p||n[25]!==g?(x=m.jsxs("div",{className:o,onMouseEnter:l,children:[f,d,h,p,g]}),n[19]=o,n[20]=l,n[21]=f,n[22]=d,n[23]=h,n[24]=p,n[25]=g,n[26]=x):x=n[26],x});function Y_(t){const e=K.c(9),{model:n}=t;if(!n){let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx("span",{className:"text-sm text-muted-foreground",children:"Select model"}),e[0]=s):s=e[0],s}let r;e[1]!==n.logo||e[2]!==n.name?(r=n.logo&&m.jsx("img",{src:n.logo,className:"w-5 h-5 shrink-0 rounded-sm",alt:n.name}),e[1]=n.logo,e[2]=n.name,e[3]=r):r=e[3];let i;e[4]!==n.name?(i=m.jsx("span",{className:"text-sm text-muted-foreground group-hover:text-foreground transition-colors truncate min-w-0 max-w-[200px] hidden sm:inline-block",children:n.name}),e[4]=n.name,e[5]=i):i=e[5];let a;return e[6]!==r||e[7]!==i?(a=m.jsxs("div",{className:"flex items-center gap-2 min-w-0 max-w-full",children:[r,i]}),e[6]=r,e[7]=i,e[8]=a):a=e[8],a}function rA(t){const e=K.c(57),{selectedModel:n,onModelChange:r,variant:i,className:a,placeholder:s}=t,u=i===void 0?"borderless":i,o=s===void 0?"Select model":s,[l,f]=v.useState(!1),[d,h]=v.useState(null),[p,g]=v.useState(!1),x=U_();let _;e[0]!==x||e[1]!==n?(_=n?x.find(V=>V.id===n.id&&V.connectionId===n.connectionId)?.id:void 0,e[0]=x,e[1]=n,e[2]=_):_=e[2];const b=_;let k;if(e[3]!==x||e[4]!==b){let V;e[6]!==b?(V=G=>G.id===b,e[6]=b,e[7]=V):V=e[7],k=x.find(V),e[3]=x,e[4]=b,e[5]=k}else k=e[5];const E=k;let w;e[8]!==x||e[9]!==r?(w=V=>{const G=x.find(Q=>Q.id===V);G&&(r({id:G.id,connectionId:G.connectionId,provider:G.provider??void 0}),f(!1))},e[8]=x,e[9]=r,e[10]=w):w=e[10];const R=w;if(x.length===0)return null;const S=b||"",O=u==="borderless"&&"md:border-none";let F;e[11]!==a||e[12]!==O?(F=ce("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 max-w-full",O,a),e[11]=a,e[12]=O,e[13]=F):F=e[13];let j;e[14]!==E?(j=m.jsx(Y_,{model:E}),e[14]=E,e[15]=j):j=e[15];let N;e[16]!==o||e[17]!==j?(N=m.jsx(hd,{placeholder:o,className:"min-w-0 max-w-full",children:j}),e[16]=o,e[17]=j,e[18]=N):N=e[18];let P;e[19]!==N||e[20]!==F?(P=m.jsx(fd,{size:"sm",className:F,children:N}),e[19]=N,e[20]=F,e[21]=P):P=e[21];let M;e[22]!==p?(M=()=>g(!p),e[22]=p,e[23]=M):M=e[23];const J=p?"text-foreground":"text-muted-foreground";let z;e[24]!==J?(z=ce("w-5 h-5 transition-colors",J),e[24]=J,e[25]=z):z=e[25];let H;e[26]!==z?(H=m.jsx(wf,{className:z}),e[26]=z,e[27]=H):H=e[27];let Z;e[28]!==M||e[29]!==H?(Z=m.jsx("button",{type:"button",onClick:M,className:"md:hidden flex items-center justify-center h-8 w-8 rounded-lg hover:bg-accent transition-colors","aria-label":"Toggle model info",children:H}),e[28]=M,e[29]=H,e[30]=Z):Z=e[30];let re;if(e[31]!==R||e[32]!==x||e[33]!==b||e[34]!==p){let V;e[36]!==R||e[37]!==b||e[38]!==p?(V=G=>m.jsxs("div",{onClick:()=>R(G.id),className:ce("rounded-lg mb-1",G.id===b&&"bg-accent"),children:[m.jsx($_,{model:G,onHover:h,isSelected:G.id===b,hasExpandedInfo:p}),p&&m.jsx("div",{className:"md:hidden",children:m.jsx(eo,{model:G,compact:!0})})]},G.id),e[36]=R,e[37]=b,e[38]=p,e[39]=V):V=e[39],re=x.map(V),e[31]=R,e[32]=x,e[33]=b,e[34]=p,e[35]=re}else re=e[35];let le;e[40]!==re?(le=m.jsx("div",{className:"flex-1 overflow-y-auto px-0.5 md:border-r",children:re}),e[40]=re,e[41]=le):le=e[41];const Te=d||E||null;let I;e[42]!==Te?(I=m.jsx("div",{className:"hidden md:block md:w-[300px] p-3",children:m.jsx(eo,{model:Te})}),e[42]=Te,e[43]=I):I=e[43];let me;e[44]!==le||e[45]!==I?(me=m.jsxs("div",{className:"flex flex-col md:flex-row h-[350px]",children:[le,I]}),e[44]=le,e[45]=I,e[46]=me):me=e[46];let Ae;e[47]!==o||e[48]!==Z||e[49]!==me?(Ae=m.jsx(dd,{title:o,className:"w-full md:w-auto md:min-w-[600px] [&_button[aria-label='Scroll down']]:!hidden [&_button[aria-label='Scroll up']]:!hidden",headerActions:Z,children:me}),e[47]=o,e[48]=Z,e[49]=me,e[50]=Ae):Ae=e[50];let y;return e[51]!==R||e[52]!==l||e[53]!==P||e[54]!==Ae||e[55]!==S?(y=m.jsxs(cd,{open:l,onOpenChange:f,value:S,onValueChange:R,children:[P,Ae]}),e[51]=R,e[52]=l,e[53]=P,e[54]=Ae,e[55]=S,e[56]=y):y=e[56],y}function q_(t){return m.jsx(pd,{capability:t},t)}function V_(t){return m.jsx(pd,{capability:t},t)}function W_({messageCount:t,sentinelRef:e}){const n=v.useRef(t),r=v.useRef(0);t>n.current&&r.current!==t&&queueMicrotask(()=>{e.current?.scrollIntoView({behavior:"smooth",block:"start"}),r.current=t}),n.current=t}function to(t,e){const n=v.Children.toArray(t);for(const r of n)if(v.isValidElement(r)&&r.type===e)return r;return null}function G_(t){const e=K.c(5),{className:n,children:r}=t;let i;e[0]!==n?(i=ce("flex flex-col h-full w-full bg-sidebar transform-[translateZ(0)]",n),e[0]=n,e[1]=i):i=e[1];let a;return e[2]!==r||e[3]!==i?(a=m.jsx("div",{className:i,children:r}),e[2]=r,e[3]=i,e[4]=a):a=e[4],a}function Q_(t){const e=K.c(11),{children:n}=t;let r;e[0]!==n?(r=to(n,md),e[0]=n,e[1]=r):r=e[1];const i=r;let a;e[2]!==n?(a=to(n,gd),e[2]=n,e[3]=a):a=e[3];const s=a,u=i?.props.children;let o;e[4]!==u?(o=m.jsx("div",{className:"flex items-center gap-2",children:u}),e[4]=u,e[5]=o):o=e[5];const l=s?.props.children;let f;e[6]!==l?(f=m.jsx("div",{className:"flex items-center gap-1",children:l}),e[6]=l,e[7]=f):f=e[7];let d;return e[8]!==o||e[9]!==f?(d=m.jsxs("div",{className:"flex h-12 items-center justify-between border-b border-border px-4 flex-none",children:[o,f]}),e[8]=o,e[9]=f,e[10]=d):d=e[10],d}function md(t){const e=K.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx(m.Fragment,{children:n}),e[0]=n,e[1]=r):r=e[1],r}function gd(t){const e=K.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx(m.Fragment,{children:n}),e[0]=n,e[1]=r):r=e[1],r}function X_(t){const e=K.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=ce("flex-1 min-h-0 overflow-y-auto",r),e[0]=r,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=m.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function Z_(t){const e=K.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx("div",{className:"h-full w-full flex items-center justify-center max-w-2xl mx-auto",children:n}),e[0]=n,e[1]=r):r=e[1],r}function K_(t){const e=K.c(12),{messages:n,status:r,minHeightOffset:i}=t,a=i===void 0?240:i,s=v.useRef(null);let u;e[0]!==n.length?(u={messageCount:n.length,sentinelRef:s},e[0]=n.length,e[1]=u):u=e[1],W_(u);let o;if(e[2]!==n||e[3]!==r){let d;e[5]!==n.length||e[6]!==r?(d=(h,p)=>h.role==="user"?m.jsx(S_,{message:h},h.id):h.role==="assistant"?m.jsx(g_,{message:h,status:p===n.length-1?r:void 0},h.id):null,e[5]=n.length,e[6]=r,e[7]=d):d=e[7],o=n.map(d),e[2]=n,e[3]=r,e[4]=o}else o=e[4];let l;e[8]===Symbol.for("react.memo_cache_sentinel")?(l=m.jsx(od,{children:m.jsx("div",{ref:s,className:"h-0"})}),e[8]=l):l=e[8];let f;return e[9]!==a||e[10]!==o?(f=m.jsxs(x_,{minHeightOffset:a,children:[o,l]}),e[9]=a,e[10]=o,e[11]=f):f=e[11],f}function J_(t){const e=K.c(3),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=ce("flex-none w-full mx-auto p-2","max-w-2xl min-w-0"),e[0]=r):r=e[0];let i;return e[1]!==n?(i=m.jsx("div",{className:r,children:n}),e[1]=n,e[2]=i):i=e[2],i}function ey(t){const e=K.c(16),{branchContext:n,clearBranchContext:r,onGoToOriginalMessage:i,setInputValue:a}=t;if(!n)return null;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx(Eo,{size:14,className:"text-muted-foreground mt-0.5 shrink-0"}),e[0]=s):s=e[0];let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Editing message (click to view original):"}),e[1]=u):u=e[1];let o;e[2]!==n.originalMessageText?(o=m.jsxs("div",{className:"flex-1 min-w-0",children:[u,m.jsx("div",{className:"text-muted-foreground/70 line-clamp-2",children:n.originalMessageText})]}),e[2]=n.originalMessageText,e[3]=o):o=e[3];let l,f;e[4]!==r||e[5]!==a?(l=g=>{g.stopPropagation(),r(),a("")},f=g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(),a(""))},e[4]=r,e[5]=a,e[6]=l,e[7]=f):(l=e[6],f=e[7]);let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsx(af,{size:14}),e[8]=d):d=e[8];let h;e[9]!==l||e[10]!==f?(h=m.jsx("span",{role:"button",tabIndex:0,onClick:l,onKeyDown:f,className:"text-muted-foreground hover:text-foreground transition-colors shrink-0",title:"Cancel editing",children:d}),e[9]=l,e[10]=f,e[11]=h):h=e[11];let p;return e[12]!==i||e[13]!==o||e[14]!==h?(p=m.jsxs("button",{type:"button",onClick:i,className:"flex items-start gap-2 px-2 py-2 rounded-lg border border-dashed border-muted-foreground/30 bg-muted/50 text-sm hover:bg-muted transition-colors cursor-pointer text-left w-full",title:"Click to view original message",children:[s,o,h]}),e[12]=i,e[13]=o,e[14]=h,e[15]=p):p=e[15],p}const iA=Object.assign(G_,{Header:Object.assign(Q_,{Left:md,Right:gd}),Main:X_,Messages:K_,EmptyState:Z_,Footer:J_,Input:R0,BranchPreview:ey,Provider:I0});function aA(){const t=K.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx("div",{className:"size-6 rounded-lg bg-muted animate-pulse"}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsxs("div",{className:"flex items-center gap-3",children:[e,m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsx("div",{className:"h-3.5 w-28 rounded bg-muted animate-pulse"}),m.jsx("div",{className:"h-3 w-40 rounded bg-muted/60 animate-pulse"})]})]}),t[1]=n):n=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx("div",{className:"flex items-center h-12 flex-none border-b border-border/80 px-4",children:m.jsxs("div",{className:"flex items-center justify-between gap-3 w-full",children:[n,m.jsxs("div",{className:"flex items-end gap-2",children:[m.jsx("div",{className:"h-6 w-6 rounded-full bg-muted animate-pulse"}),m.jsx("div",{className:"h-6 w-6 rounded-lg bg-muted animate-pulse"})]})]})}),t[2]=r):r=t[2];let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=m.jsx("div",{className:"flex-1 overflow-hidden px-4 py-4",children:m.jsxs("div",{className:"mx-auto flex w-full max-w-2xl flex-col gap-4",children:[m.jsx(Or,{align:"right",width:"w-3/4"}),m.jsx(Or,{align:"left",width:"w-full",lines:3}),m.jsx(Or,{align:"right",width:"w-2/3"}),m.jsx(Or,{align:"left",width:"w-5/6",lines:2})]})}),t[3]=i):i=t[3];let a;t[4]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx("div",{className:"relative flex flex-1 flex-col gap-2 p-2.5",children:m.jsx("div",{className:"relative flex-1",children:m.jsxs("div",{className:"space-y-2 p-2",children:[m.jsx("div",{className:"h-3 w-full rounded bg-muted/40 animate-pulse"}),m.jsx("div",{className:"h-3 w-4/5 rounded bg-muted/40 animate-pulse"})]})})}),t[4]=a):a=t[4];let s;t[5]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx("div",{className:"flex items-center gap-1",children:m.jsx("div",{className:"size-8 rounded-full bg-muted/60 animate-pulse"})}),t[5]=s):s=t[5];let u;return t[6]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsxs("div",{className:"flex h-full w-full flex-col bg-sidebar",children:[r,i,m.jsx("div",{className:"px-4 py-4",children:m.jsx("div",{className:"mx-auto w-full max-w-2xl",children:m.jsxs("div",{className:"relative flex min-h-[130px] flex-col rounded-xl border border-border bg-background shadow-sm",children:[a,m.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2.5",children:[s,m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("div",{className:"h-8 w-32 rounded-lg bg-muted/60 animate-pulse"}),m.jsx("div",{className:"size-8 rounded-full bg-muted animate-pulse"})]})]})]})})})]}),t[6]=u):u=t[6],u}function Or(t){const e=K.c(22),{align:n,width:r,lines:i}=t,a=r===void 0?"w-full":r,s=i===void 0?1:i,u=n==="right"?"flex-row-reverse":"flex-row";let o;e[0]!==u?(o=ce("flex w-full gap-4 px-4 py-2",u),e[0]=u,e[1]=o):o=e[1];const l=n==="right"?"ml-auto max-w-3/4 items-end":"w-full items-start";let f;e[2]!==l?(f=ce("flex min-w-0 flex-col gap-2",l),e[2]=l,e[3]=f):f=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsx("div",{className:"h-3 w-16 rounded bg-muted/40 animate-pulse"}),e[4]=d):d=e[4];const h=n==="right"?"bg-muted":"bg-transparent border border-border/40";let p;e[5]!==h||e[6]!==a?(p=ce("min-w-0 rounded-2xl p-4",h,a),e[5]=h,e[6]=a,e[7]=p):p=e[7];let g;e[8]!==s?(g=Array.from({length:s}),e[8]=s,e[9]=g):g=e[9];let x;e[10]!==s||e[11]!==g?(x=m.jsx("div",{className:"space-y-2",children:g.map((E,w)=>m.jsx("div",{className:ce("h-3 rounded bg-muted-foreground/20 animate-pulse",w===s-1?"w-3/4":"w-full"),style:{animationDelay:`${w*.1}s`}},w))}),e[10]=s,e[11]=g,e[12]=x):x=e[12];let _;e[13]!==x||e[14]!==p?(_=m.jsx("div",{className:p,children:x}),e[13]=x,e[14]=p,e[15]=_):_=e[15];let b;e[16]!==_||e[17]!==f?(b=m.jsxs("div",{className:f,children:[d,_]}),e[16]=_,e[17]=f,e[18]=b):b=e[18];let k;return e[19]!==b||e[20]!==o?(k=m.jsx("div",{className:o,children:b}),e[19]=b,e[20]=o,e[21]=k):k=e[21],k}const Ti=v.createContext(null);Ti.displayName="PanelGroupContext";const Oe={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},fs=10,Zt=v.useLayoutEffect,no=Qd.useId,ty=typeof no=="function"?no:()=>null;let ny=0;function hs(t=null){const e=ty(),n=v.useRef(t||e||null);return n.current===null&&(n.current=""+ny++),t??n.current}function bd({children:t,className:e="",collapsedSize:n,collapsible:r,defaultSize:i,forwardedRef:a,id:s,maxSize:u,minSize:o,onCollapse:l,onExpand:f,onResize:d,order:h,style:p,tagName:g="div",...x}){const _=v.useContext(Ti);if(_===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:b,expandPanel:k,getPanelSize:E,getPanelStyle:w,groupId:R,isPanelCollapsed:S,reevaluatePanelConstraints:O,registerPanel:F,resizePanel:j,unregisterPanel:N}=_,P=hs(s),M=v.useRef({callbacks:{onCollapse:l,onExpand:f,onResize:d},constraints:{collapsedSize:n,collapsible:r,defaultSize:i,maxSize:u,minSize:o},id:P,idIsFromProps:s!==void 0,order:h});v.useRef({didLogMissingDefaultSizeWarning:!1}),Zt(()=>{const{callbacks:z,constraints:H}=M.current,Z={...H};M.current.id=P,M.current.idIsFromProps=s!==void 0,M.current.order=h,z.onCollapse=l,z.onExpand=f,z.onResize=d,H.collapsedSize=n,H.collapsible=r,H.defaultSize=i,H.maxSize=u,H.minSize=o,(Z.collapsedSize!==H.collapsedSize||Z.collapsible!==H.collapsible||Z.maxSize!==H.maxSize||Z.minSize!==H.minSize)&&O(M.current,Z)}),Zt(()=>{const z=M.current;return F(z),()=>{N(z)}},[h,P,F,N]),v.useImperativeHandle(a,()=>({collapse:()=>{b(M.current)},expand:z=>{k(M.current,z)},getId(){return P},getSize(){return E(M.current)},isCollapsed(){return S(M.current)},isExpanded(){return!S(M.current)},resize:z=>{j(M.current,z)}}),[b,k,E,S,P,j]);const J=w(M.current,i);return v.createElement(g,{...x,children:t,className:e,id:P,style:{...J,...p},[Oe.groupId]:R,[Oe.panel]:"",[Oe.panelCollapsible]:r||void 0,[Oe.panelId]:P,[Oe.panelSize]:parseFloat(""+J.flexGrow).toFixed(1)})}const Ed=v.forwardRef((t,e)=>v.createElement(bd,{...t,forwardedRef:e}));bd.displayName="Panel";Ed.displayName="forwardRef(Panel)";let Ca=null,zr=-1,Ot=null;function ry(t,e){if(e){const n=(e&Ad)!==0,r=(e&Cd)!==0,i=(e&kd)!==0,a=(e&Sd)!==0;if(n)return i?"se-resize":a?"ne-resize":"e-resize";if(r)return i?"sw-resize":a?"nw-resize":"w-resize";if(i)return"s-resize";if(a)return"n-resize"}switch(t){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function iy(){Ot!==null&&(document.head.removeChild(Ot),Ca=null,Ot=null,zr=-1)}function Gi(t,e){var n,r;const i=ry(t,e);if(Ca!==i){if(Ca=i,Ot===null&&(Ot=document.createElement("style"),document.head.appendChild(Ot)),zr>=0){var a;(a=Ot.sheet)===null||a===void 0||a.removeRule(zr)}zr=(n=(r=Ot.sheet)===null||r===void 0?void 0:r.insertRule(`*{cursor: ${i} !important;}`))!==null&&n!==void 0?n:-1}}function Td(t){return t.type==="keydown"}function xd(t){return t.type.startsWith("pointer")}function _d(t){return t.type.startsWith("mouse")}function xi(t){if(xd(t)){if(t.isPrimary)return{x:t.clientX,y:t.clientY}}else if(_d(t))return{x:t.clientX,y:t.clientY};return{x:1/0,y:1/0}}function ay(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function sy(t,e,n){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}function uy(t,e){if(t===e)throw new Error("Cannot compare node with itself");const n={a:ao(t),b:ao(e)};let r;for(;n.a.at(-1)===n.b.at(-1);)t=n.a.pop(),e=n.b.pop(),r=t;oe(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:io(ro(n.a)),b:io(ro(n.b))};if(i.a===i.b){const a=r.childNodes,s={a:n.a.at(-1),b:n.b.at(-1)};let u=a.length;for(;u--;){const o=a[u];if(o===s.a)return 1;if(o===s.b)return-1}}return Math.sign(i.a-i.b)}const oy=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function ly(t){var e;const n=getComputedStyle((e=yd(t))!==null&&e!==void 0?e:t).display;return n==="flex"||n==="inline-flex"}function cy(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||ly(t))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||oy.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function ro(t){let e=t.length;for(;e--;){const n=t[e];if(oe(n,"Missing node"),cy(n))return n}return null}function io(t){return t&&Number(getComputedStyle(t).zIndex)||0}function ao(t){const e=[];for(;t;)e.push(t),t=yd(t);return e}function yd(t){const{parentNode:e}=t;return e&&e instanceof ShadowRoot?e.host:e}const Ad=1,Cd=2,kd=4,Sd=8,dy=ay()==="coarse";let ct=[],xn=!1,Wt=new Map,_i=new Map;const fr=new Set;function fy(t,e,n,r,i){var a;const{ownerDocument:s}=e,u={direction:n,element:e,hitAreaMargins:r,setResizeHandlerState:i},o=(a=Wt.get(s))!==null&&a!==void 0?a:0;return Wt.set(s,o+1),fr.add(u),Jr(),function(){var f;_i.delete(t),fr.delete(u);const d=(f=Wt.get(s))!==null&&f!==void 0?f:1;if(Wt.set(s,d-1),Jr(),d===1&&Wt.delete(s),ct.includes(u)){const h=ct.indexOf(u);h>=0&&ct.splice(h,1),ms(),i("up",!0,null)}}}function hy(t){const{target:e}=t,{x:n,y:r}=xi(t);xn=!0,ps({target:e,x:n,y:r}),Jr(),ct.length>0&&(ei("down",t),t.preventDefault(),Id(e)||t.stopImmediatePropagation())}function Qi(t){const{x:e,y:n}=xi(t);if(xn&&t.buttons===0&&(xn=!1,ei("up",t)),!xn){const{target:r}=t;ps({target:r,x:e,y:n})}ei("move",t),ms(),ct.length>0&&t.preventDefault()}function Xi(t){const{target:e}=t,{x:n,y:r}=xi(t);_i.clear(),xn=!1,ct.length>0&&(t.preventDefault(),Id(e)||t.stopImmediatePropagation()),ei("up",t),ps({target:e,x:n,y:r}),ms(),Jr()}function Id(t){let e=t;for(;e;){if(e.hasAttribute(Oe.resizeHandle))return!0;e=e.parentElement}return!1}function ps({target:t,x:e,y:n}){ct.splice(0);let r=null;(t instanceof HTMLElement||t instanceof SVGElement)&&(r=t),fr.forEach(i=>{const{element:a,hitAreaMargins:s}=i,u=a.getBoundingClientRect(),{bottom:o,left:l,right:f,top:d}=u,h=dy?s.coarse:s.fine;if(e>=l-h&&e<=f+h&&n>=d-h&&n<=o+h){if(r!==null&&document.contains(r)&&a!==r&&!a.contains(r)&&!r.contains(a)&&uy(r,a)>0){let g=r,x=!1;for(;g&&!g.contains(a);){if(sy(g.getBoundingClientRect(),u)){x=!0;break}g=g.parentElement}if(x)return}ct.push(i)}})}function Zi(t,e){_i.set(t,e)}function ms(){let t=!1,e=!1;ct.forEach(r=>{const{direction:i}=r;i==="horizontal"?t=!0:e=!0});let n=0;_i.forEach(r=>{n|=r}),t&&e?Gi("intersection",n):t?Gi("horizontal",n):e?Gi("vertical",n):iy()}let Ki=new AbortController;function Jr(){Ki.abort(),Ki=new AbortController;const t={capture:!0,signal:Ki.signal};fr.size&&(xn?(ct.length>0&&Wt.forEach((e,n)=>{const{body:r}=n;e>0&&(r.addEventListener("contextmenu",Xi,t),r.addEventListener("pointerleave",Qi,t),r.addEventListener("pointermove",Qi,t))}),window.addEventListener("pointerup",Xi,t),window.addEventListener("pointercancel",Xi,t)):Wt.forEach((e,n)=>{const{body:r}=n;e>0&&(r.addEventListener("pointerdown",hy,t),r.addEventListener("pointermove",Qi,t))}))}function ei(t,e){fr.forEach(n=>{const{setResizeHandlerState:r}=n,i=ct.includes(n);r(t,i,e)})}function py(){const[t,e]=v.useState(0);return v.useCallback(()=>e(n=>n+1),[])}function oe(t,e){if(!t)throw console.error(e),Error(e)}function rn(t,e,n=fs){return t.toFixed(n)===e.toFixed(n)?0:t>e?1:-1}function _t(t,e,n=fs){return rn(t,e,n)===0}function et(t,e,n){return rn(t,e,n)===0}function my(t,e,n){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++){const i=t[r],a=e[r];if(!et(i,a,n))return!1}return!0}function En({panelConstraints:t,panelIndex:e,size:n}){const r=t[e];oe(r!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:i=0,collapsible:a,maxSize:s=100,minSize:u=0}=r;if(rn(n,u)<0)if(a){const o=(i+u)/2;rn(n,o)<0?n=i:n=u}else n=u;return n=Math.min(s,n),n=parseFloat(n.toFixed(fs)),n}function Vn({delta:t,initialLayout:e,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(et(t,0))return e;const s=[...e],[u,o]=r;oe(u!=null,"Invalid first pivot index"),oe(o!=null,"Invalid second pivot index");let l=0;if(a==="keyboard"){{const d=t<0?o:u,h=n[d];oe(h,`Panel constraints not found for index ${d}`);const{collapsedSize:p=0,collapsible:g,minSize:x=0}=h;if(g){const _=e[d];if(oe(_!=null,`Previous layout not found for panel index ${d}`),et(_,p)){const b=x-_;rn(b,Math.abs(t))>0&&(t=t<0?0-b:b)}}}{const d=t<0?u:o,h=n[d];oe(h,`No panel constraints found for index ${d}`);const{collapsedSize:p=0,collapsible:g,minSize:x=0}=h;if(g){const _=e[d];if(oe(_!=null,`Previous layout not found for panel index ${d}`),et(_,x)){const b=_-p;rn(b,Math.abs(t))>0&&(t=t<0?0-b:b)}}}}{const d=t<0?1:-1;let h=t<0?o:u,p=0;for(;;){const x=e[h];oe(x!=null,`Previous layout not found for panel index ${h}`);const b=En({panelConstraints:n,panelIndex:h,size:100})-x;if(p+=b,h+=d,h<0||h>=n.length)break}const g=Math.min(Math.abs(t),Math.abs(p));t=t<0?0-g:g}{let h=t<0?u:o;for(;h>=0&&h<n.length;){const p=Math.abs(t)-Math.abs(l),g=e[h];oe(g!=null,`Previous layout not found for panel index ${h}`);const x=g-p,_=En({panelConstraints:n,panelIndex:h,size:x});if(!et(g,_)&&(l+=g-_,s[h]=_,l.toPrecision(3).localeCompare(Math.abs(t).toPrecision(3),void 0,{numeric:!0})>=0))break;t<0?h--:h++}}if(my(i,s))return i;{const d=t<0?o:u,h=e[d];oe(h!=null,`Previous layout not found for panel index ${d}`);const p=h+l,g=En({panelConstraints:n,panelIndex:d,size:p});if(s[d]=g,!et(g,p)){let x=p-g,b=t<0?o:u;for(;b>=0&&b<n.length;){const k=s[b];oe(k!=null,`Previous layout not found for panel index ${b}`);const E=k+x,w=En({panelConstraints:n,panelIndex:b,size:E});if(et(k,w)||(x-=w-k,s[b]=w),et(x,0))break;t>0?b--:b++}}}const f=s.reduce((d,h)=>h+d,0);return et(f,100)?s:i}function gy({layout:t,panelsArray:e,pivotIndices:n}){let r=0,i=100,a=0,s=0;const u=n[0];oe(u!=null,"No pivot index found"),e.forEach((d,h)=>{const{constraints:p}=d,{maxSize:g=100,minSize:x=0}=p;h===u?(r=x,i=g):(a+=x,s+=g)});const o=Math.min(i,100-a),l=Math.max(r,100-s),f=t[u];return{valueMax:o,valueMin:l,valueNow:f}}function hr(t,e=document){return Array.from(e.querySelectorAll(`[${Oe.resizeHandleId}][data-panel-group-id="${t}"]`))}function Nd(t,e,n=document){const i=hr(t,n).findIndex(a=>a.getAttribute(Oe.resizeHandleId)===e);return i??null}function wd(t,e,n){const r=Nd(t,e,n);return r!=null?[r,r+1]:[-1,-1]}function Rd(t,e=document){var n;if(e instanceof HTMLElement&&(e==null||(n=e.dataset)===null||n===void 0?void 0:n.panelGroupId)==t)return e;const r=e.querySelector(`[data-panel-group][data-panel-group-id="${t}"]`);return r||null}function yi(t,e=document){const n=e.querySelector(`[${Oe.resizeHandleId}="${t}"]`);return n||null}function by(t,e,n,r=document){var i,a,s,u;const o=yi(e,r),l=hr(t,r),f=o?l.indexOf(o):-1,d=(i=(a=n[f])===null||a===void 0?void 0:a.id)!==null&&i!==void 0?i:null,h=(s=(u=n[f+1])===null||u===void 0?void 0:u.id)!==null&&s!==void 0?s:null;return[d,h]}function Ey({committedValuesRef:t,eagerValuesRef:e,groupId:n,layout:r,panelDataArray:i,panelGroupElement:a,setLayout:s}){v.useRef({didWarnAboutMissingResizeHandle:!1}),Zt(()=>{if(!a)return;const u=hr(n,a);for(let o=0;o<i.length-1;o++){const{valueMax:l,valueMin:f,valueNow:d}=gy({layout:r,panelsArray:i,pivotIndices:[o,o+1]}),h=u[o];if(h!=null){const p=i[o];oe(p,`No panel data found for index "${o}"`),h.setAttribute("aria-controls",p.id),h.setAttribute("aria-valuemax",""+Math.round(l)),h.setAttribute("aria-valuemin",""+Math.round(f)),h.setAttribute("aria-valuenow",d!=null?""+Math.round(d):"")}}return()=>{u.forEach((o,l)=>{o.removeAttribute("aria-controls"),o.removeAttribute("aria-valuemax"),o.removeAttribute("aria-valuemin"),o.removeAttribute("aria-valuenow")})}},[n,r,i,a]),v.useEffect(()=>{if(!a)return;const u=e.current;oe(u,"Eager values not found");const{panelDataArray:o}=u,l=Rd(n,a);oe(l!=null,`No group found for id "${n}"`);const f=hr(n,a);oe(f,`No resize handles found for group id "${n}"`);const d=f.map(h=>{const p=h.getAttribute(Oe.resizeHandleId);oe(p,"Resize handle element has no handle id attribute");const[g,x]=by(n,p,o,a);if(g==null||x==null)return()=>{};const _=b=>{if(!b.defaultPrevented)switch(b.key){case"Enter":{b.preventDefault();const k=o.findIndex(E=>E.id===g);if(k>=0){const E=o[k];oe(E,`No panel data found for index ${k}`);const w=r[k],{collapsedSize:R=0,collapsible:S,minSize:O=0}=E.constraints;if(w!=null&&S){const F=Vn({delta:et(w,R)?O-R:R-w,initialLayout:r,panelConstraints:o.map(j=>j.constraints),pivotIndices:wd(n,p,a),prevLayout:r,trigger:"keyboard"});r!==F&&s(F)}}break}}};return h.addEventListener("keydown",_),()=>{h.removeEventListener("keydown",_)}});return()=>{d.forEach(h=>h())}},[a,t,e,n,r,i,s])}function so(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function Ld(t,e){const n=t==="horizontal",{x:r,y:i}=xi(e);return n?r:i}function Ty(t,e,n,r,i){const a=n==="horizontal",s=yi(e,i);oe(s,`No resize handle element found for id "${e}"`);const u=s.getAttribute(Oe.groupId);oe(u,"Resize handle element has no group id attribute");let{initialCursorPosition:o}=r;const l=Ld(n,t),f=Rd(u,i);oe(f,`No group element found for id "${u}"`);const d=f.getBoundingClientRect(),h=a?d.width:d.height;return(l-o)/h*100}function xy(t,e,n,r,i,a){if(Td(t)){const s=n==="horizontal";let u=0;t.shiftKey?u=100:i!=null?u=i:u=10;let o=0;switch(t.key){case"ArrowDown":o=s?0:u;break;case"ArrowLeft":o=s?-u:0;break;case"ArrowRight":o=s?u:0;break;case"ArrowUp":o=s?0:-u;break;case"End":o=100;break;case"Home":o=-100;break}return o}else return r==null?0:Ty(t,e,n,r,a)}function _y({panelDataArray:t}){const e=Array(t.length),n=t.map(a=>a.constraints);let r=0,i=100;for(let a=0;a<t.length;a++){const s=n[a];oe(s,`Panel constraints not found for index ${a}`);const{defaultSize:u}=s;u!=null&&(r++,e[a]=u,i-=u)}for(let a=0;a<t.length;a++){const s=n[a];oe(s,`Panel constraints not found for index ${a}`);const{defaultSize:u}=s;if(u!=null)continue;const o=t.length-r,l=i/o;r++,e[a]=l,i-=l}return e}function fn(t,e,n){e.forEach((r,i)=>{const a=t[i];oe(a,`Panel data not found for index ${i}`);const{callbacks:s,constraints:u,id:o}=a,{collapsedSize:l=0,collapsible:f}=u,d=n[o];if(d==null||r!==d){n[o]=r;const{onCollapse:h,onExpand:p,onResize:g}=s;g&&g(r,d),f&&(h||p)&&(p&&(d==null||_t(d,l))&&!_t(r,l)&&p(),h&&(d==null||!_t(d,l))&&_t(r,l)&&h())}})}function vr(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n])return!1;return!0}function yy({defaultSize:t,dragState:e,layout:n,panelData:r,panelIndex:i,precision:a=3}){const s=n[i];let u;return s==null?u=t!=null?t.toPrecision(a):"1":r.length===1?u="1":u=s.toPrecision(a),{flexBasis:0,flexGrow:u,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function Ay(t,e=10){let n=null;return(...i)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{t(...i)},e)}}function uo(t){try{if(typeof localStorage<"u")t.getItem=e=>localStorage.getItem(e),t.setItem=(e,n)=>{localStorage.setItem(e,n)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),t.getItem=()=>null,t.setItem=()=>{}}}function Od(t){return`react-resizable-panels:${t}`}function vd(t){return t.map(e=>{const{constraints:n,id:r,idIsFromProps:i,order:a}=e;return i?r:a?`${a}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((e,n)=>e.localeCompare(n)).join(",")}function Dd(t,e){try{const n=Od(t),r=e.getItem(n);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function Cy(t,e,n){var r,i;const a=(r=Dd(t,n))!==null&&r!==void 0?r:{},s=vd(e);return(i=a[s])!==null&&i!==void 0?i:null}function ky(t,e,n,r,i){var a;const s=Od(t),u=vd(e),o=(a=Dd(t,i))!==null&&a!==void 0?a:{};o[u]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{i.setItem(s,JSON.stringify(o))}catch(l){console.error(l)}}function oo({layout:t,panelConstraints:e}){const n=[...t],r=n.reduce((a,s)=>a+s,0);if(n.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${n.map(a=>`${a}%`).join(", ")}`);if(!et(r,100)&&n.length>0)for(let a=0;a<e.length;a++){const s=n[a];oe(s!=null,`No layout data found for index ${a}`);const u=100/r*s;n[a]=u}let i=0;for(let a=0;a<e.length;a++){const s=n[a];oe(s!=null,`No layout data found for index ${a}`);const u=En({panelConstraints:e,panelIndex:a,size:s});s!=u&&(i+=s-u,n[a]=u)}if(!et(i,0))for(let a=0;a<e.length;a++){const s=n[a];oe(s!=null,`No layout data found for index ${a}`);const u=s+i,o=En({panelConstraints:e,panelIndex:a,size:u});if(s!==o&&(i-=o-s,n[a]=o,et(i,0)))break}return n}const Sy=100,Wn={getItem:t=>(uo(Wn),Wn.getItem(t)),setItem:(t,e)=>{uo(Wn),Wn.setItem(t,e)}},lo={};function Pd({autoSaveId:t=null,children:e,className:n="",direction:r,forwardedRef:i,id:a=null,onLayout:s=null,keyboardResizeBy:u=null,storage:o=Wn,style:l,tagName:f="div",...d}){const h=hs(a),p=v.useRef(null),[g,x]=v.useState(null),[_,b]=v.useState([]),k=py(),E=v.useRef({}),w=v.useRef(new Map),R=v.useRef(0),S=v.useRef({autoSaveId:t,direction:r,dragState:g,id:h,keyboardResizeBy:u,onLayout:s,storage:o}),O=v.useRef({layout:_,panelDataArray:[],panelDataArrayChanged:!1});v.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),v.useImperativeHandle(i,()=>({getId:()=>S.current.id,getLayout:()=>{const{layout:y}=O.current;return y},setLayout:y=>{const{onLayout:V}=S.current,{layout:G,panelDataArray:Q}=O.current,X=oo({layout:y,panelConstraints:Q.map(ee=>ee.constraints)});so(G,X)||(b(X),O.current.layout=X,V&&V(X),fn(Q,X,E.current))}}),[]),Zt(()=>{S.current.autoSaveId=t,S.current.direction=r,S.current.dragState=g,S.current.id=h,S.current.onLayout=s,S.current.storage=o}),Ey({committedValuesRef:S,eagerValuesRef:O,groupId:h,layout:_,panelDataArray:O.current.panelDataArray,setLayout:b,panelGroupElement:p.current}),v.useEffect(()=>{const{panelDataArray:y}=O.current;if(t){if(_.length===0||_.length!==y.length)return;let V=lo[t];V==null&&(V=Ay(ky,Sy),lo[t]=V);const G=[...y],Q=new Map(w.current);V(t,G,Q,_,o)}},[t,_,o]),v.useEffect(()=>{});const F=v.useCallback(y=>{const{onLayout:V}=S.current,{layout:G,panelDataArray:Q}=O.current;if(y.constraints.collapsible){const X=Q.map(Le=>Le.constraints),{collapsedSize:ee=0,panelSize:se,pivotIndices:ge}=qt(Q,y,G);if(oe(se!=null,`Panel size not found for panel "${y.id}"`),!_t(se,ee)){w.current.set(y.id,se);const Be=gn(Q,y)===Q.length-1?se-ee:ee-se,he=Vn({delta:Be,initialLayout:G,panelConstraints:X,pivotIndices:ge,prevLayout:G,trigger:"imperative-api"});vr(G,he)||(b(he),O.current.layout=he,V&&V(he),fn(Q,he,E.current))}}},[]),j=v.useCallback((y,V)=>{const{onLayout:G}=S.current,{layout:Q,panelDataArray:X}=O.current;if(y.constraints.collapsible){const ee=X.map(Ze=>Ze.constraints),{collapsedSize:se=0,panelSize:ge=0,minSize:Le=0,pivotIndices:Be}=qt(X,y,Q),he=V??Le;if(_t(ge,se)){const Ze=w.current.get(y.id),kt=Ze!=null&&Ze>=he?Ze:he,on=gn(X,y)===X.length-1?ge-kt:kt-ge,Fe=Vn({delta:on,initialLayout:Q,panelConstraints:ee,pivotIndices:Be,prevLayout:Q,trigger:"imperative-api"});vr(Q,Fe)||(b(Fe),O.current.layout=Fe,G&&G(Fe),fn(X,Fe,E.current))}}},[]),N=v.useCallback(y=>{const{layout:V,panelDataArray:G}=O.current,{panelSize:Q}=qt(G,y,V);return oe(Q!=null,`Panel size not found for panel "${y.id}"`),Q},[]),P=v.useCallback((y,V)=>{const{panelDataArray:G}=O.current,Q=gn(G,y);return yy({defaultSize:V,dragState:g,layout:_,panelData:G,panelIndex:Q})},[g,_]),M=v.useCallback(y=>{const{layout:V,panelDataArray:G}=O.current,{collapsedSize:Q=0,collapsible:X,panelSize:ee}=qt(G,y,V);return oe(ee!=null,`Panel size not found for panel "${y.id}"`),X===!0&&_t(ee,Q)},[]),J=v.useCallback(y=>{const{layout:V,panelDataArray:G}=O.current,{collapsedSize:Q=0,collapsible:X,panelSize:ee}=qt(G,y,V);return oe(ee!=null,`Panel size not found for panel "${y.id}"`),!X||rn(ee,Q)>0},[]),z=v.useCallback(y=>{const{panelDataArray:V}=O.current;V.push(y),V.sort((G,Q)=>{const X=G.order,ee=Q.order;return X==null&&ee==null?0:X==null?-1:ee==null?1:X-ee}),O.current.panelDataArrayChanged=!0,k()},[k]);Zt(()=>{if(O.current.panelDataArrayChanged){O.current.panelDataArrayChanged=!1;const{autoSaveId:y,onLayout:V,storage:G}=S.current,{layout:Q,panelDataArray:X}=O.current;let ee=null;if(y){const ge=Cy(y,X,G);ge&&(w.current=new Map(Object.entries(ge.expandToSizes)),ee=ge.layout)}ee==null&&(ee=_y({panelDataArray:X}));const se=oo({layout:ee,panelConstraints:X.map(ge=>ge.constraints)});so(Q,se)||(b(se),O.current.layout=se,V&&V(se),fn(X,se,E.current))}}),Zt(()=>{const y=O.current;return()=>{y.layout=[]}},[]);const H=v.useCallback(y=>{let V=!1;const G=p.current;return G&&window.getComputedStyle(G,null).getPropertyValue("direction")==="rtl"&&(V=!0),function(X){X.preventDefault();const ee=p.current;if(!ee)return()=>null;const{direction:se,dragState:ge,id:Le,keyboardResizeBy:Be,onLayout:he}=S.current,{layout:Ze,panelDataArray:kt}=O.current,{initialLayout:Ut}=ge??{},on=wd(Le,y,ee);let Fe=xy(X,y,se,ge,Be,ee);const Ln=se==="horizontal";Ln&&V&&(Fe=-Fe);const Cr=kt.map(Ai=>Ai.constraints),zt=Vn({delta:Fe,initialLayout:Ut??Ze,panelConstraints:Cr,pivotIndices:on,prevLayout:Ze,trigger:Td(X)?"keyboard":"mouse-or-touch"}),kr=!vr(Ze,zt);(xd(X)||_d(X))&&R.current!=Fe&&(R.current=Fe,!kr&&Fe!==0?Ln?Zi(y,Fe<0?Ad:Cd):Zi(y,Fe<0?kd:Sd):Zi(y,0)),kr&&(b(zt),O.current.layout=zt,he&&he(zt),fn(kt,zt,E.current))}},[]),Z=v.useCallback((y,V)=>{const{onLayout:G}=S.current,{layout:Q,panelDataArray:X}=O.current,ee=X.map(Ze=>Ze.constraints),{panelSize:se,pivotIndices:ge}=qt(X,y,Q);oe(se!=null,`Panel size not found for panel "${y.id}"`);const Be=gn(X,y)===X.length-1?se-V:V-se,he=Vn({delta:Be,initialLayout:Q,panelConstraints:ee,pivotIndices:ge,prevLayout:Q,trigger:"imperative-api"});vr(Q,he)||(b(he),O.current.layout=he,G&&G(he),fn(X,he,E.current))},[]),re=v.useCallback((y,V)=>{const{layout:G,panelDataArray:Q}=O.current,{collapsedSize:X=0,collapsible:ee}=V,{collapsedSize:se=0,collapsible:ge,maxSize:Le=100,minSize:Be=0}=y.constraints,{panelSize:he}=qt(Q,y,G);he!=null&&(ee&&ge&&_t(he,X)?_t(X,se)||Z(y,se):he<Be?Z(y,Be):he>Le&&Z(y,Le))},[Z]),le=v.useCallback((y,V)=>{const{direction:G}=S.current,{layout:Q}=O.current;if(!p.current)return;const X=yi(y,p.current);oe(X,`Drag handle element not found for id "${y}"`);const ee=Ld(G,V);x({dragHandleId:y,dragHandleRect:X.getBoundingClientRect(),initialCursorPosition:ee,initialLayout:Q})},[]),Te=v.useCallback(()=>{x(null)},[]),I=v.useCallback(y=>{const{panelDataArray:V}=O.current,G=gn(V,y);G>=0&&(V.splice(G,1),delete E.current[y.id],O.current.panelDataArrayChanged=!0,k())},[k]),me=v.useMemo(()=>({collapsePanel:F,direction:r,dragState:g,expandPanel:j,getPanelSize:N,getPanelStyle:P,groupId:h,isPanelCollapsed:M,isPanelExpanded:J,reevaluatePanelConstraints:re,registerPanel:z,registerResizeHandle:H,resizePanel:Z,startDragging:le,stopDragging:Te,unregisterPanel:I,panelGroupElement:p.current}),[F,g,r,j,N,P,h,M,J,re,z,H,Z,le,Te,I]),Ae={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return v.createElement(Ti.Provider,{value:me},v.createElement(f,{...d,children:e,className:n,id:a,ref:p,style:{...Ae,...l},[Oe.group]:"",[Oe.groupDirection]:r,[Oe.groupId]:h}))}const Md=v.forwardRef((t,e)=>v.createElement(Pd,{...t,forwardedRef:e}));Pd.displayName="PanelGroup";Md.displayName="forwardRef(PanelGroup)";function gn(t,e){return t.findIndex(n=>n===e||n.id===e.id)}function qt(t,e,n){const r=gn(t,e),a=r===t.length-1?[r-1,r]:[r,r+1],s=n[r];return{...e.constraints,panelSize:s,pivotIndices:a}}function Iy({disabled:t,handleId:e,resizeHandler:n,panelGroupElement:r}){v.useEffect(()=>{if(t||n==null||r==null)return;const i=yi(e,r);if(i==null)return;const a=s=>{if(!s.defaultPrevented)switch(s.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{s.preventDefault(),n(s);break}case"F6":{s.preventDefault();const u=i.getAttribute(Oe.groupId);oe(u,`No group element found for id "${u}"`);const o=hr(u,r),l=Nd(u,e,r);oe(l!==null,`No resize element found for id "${e}"`);const f=s.shiftKey?l>0?l-1:o.length-1:l+1<o.length?l+1:0;o[f].focus();break}}};return i.addEventListener("keydown",a),()=>{i.removeEventListener("keydown",a)}},[r,t,e,n])}function Bd({children:t=null,className:e="",disabled:n=!1,hitAreaMargins:r,id:i,onBlur:a,onClick:s,onDragging:u,onFocus:o,onPointerDown:l,onPointerUp:f,style:d={},tabIndex:h=0,tagName:p="div",...g}){var x,_;const b=v.useRef(null),k=v.useRef({onClick:s,onDragging:u,onPointerDown:l,onPointerUp:f});v.useEffect(()=>{k.current.onClick=s,k.current.onDragging=u,k.current.onPointerDown=l,k.current.onPointerUp=f});const E=v.useContext(Ti);if(E===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:w,groupId:R,registerResizeHandle:S,startDragging:O,stopDragging:F,panelGroupElement:j}=E,N=hs(i),[P,M]=v.useState("inactive"),[J,z]=v.useState(!1),[H,Z]=v.useState(null),re=v.useRef({state:P});Zt(()=>{re.current.state=P}),v.useEffect(()=>{if(n)Z(null);else{const me=S(N);Z(()=>me)}},[n,N,S]);const le=(x=r?.coarse)!==null&&x!==void 0?x:15,Te=(_=r?.fine)!==null&&_!==void 0?_:5;v.useEffect(()=>{if(n||H==null)return;const me=b.current;oe(me,"Element ref not attached");let Ae=!1;return fy(N,me,w,{coarse:le,fine:Te},(V,G,Q)=>{if(!G){M("inactive");return}switch(V){case"down":{M("drag"),Ae=!1,oe(Q,'Expected event to be defined for "down" action'),O(N,Q);const{onDragging:X,onPointerDown:ee}=k.current;X?.(!0),ee?.();break}case"move":{const{state:X}=re.current;Ae=!0,X!=="drag"&&M("hover"),oe(Q,'Expected event to be defined for "move" action'),H(Q);break}case"up":{M("hover"),F();const{onClick:X,onDragging:ee,onPointerUp:se}=k.current;ee?.(!1),se?.(),Ae||X?.();break}}})},[le,w,n,Te,S,N,H,O,F]),Iy({disabled:n,handleId:N,resizeHandler:H,panelGroupElement:j});const I={touchAction:"none",userSelect:"none"};return v.createElement(p,{...g,children:t,className:e,id:i,onBlur:()=>{z(!1),a?.()},onFocus:()=>{z(!0),o?.()},ref:b,role:"separator",style:{...I,...d},tabIndex:h,[Oe.groupDirection]:w,[Oe.groupId]:R,[Oe.resizeHandle]:"",[Oe.resizeHandleActive]:P==="drag"?"pointer":J?"keyboard":void 0,[Oe.resizeHandleEnabled]:!n,[Oe.resizeHandleId]:N,[Oe.resizeHandleState]:P})}Bd.displayName="PanelResizeHandle";function sA(t){const e=K.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=ce("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",n),e[3]=n,e[4]=i):i=e[4];let a;return e[5]!==r||e[6]!==i?(a=m.jsx(Md,{"data-slot":"resizable-panel-group",className:i,...r}),e[5]=r,e[6]=i,e[7]=a):a=e[7],a}function uA(t){const e=K.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(Ed,{"data-slot":"resizable-panel",...n}),e[2]=n,e[3]=r):r=e[3],r}function oA(t){const e=K.c(12);let n,r,i;e[0]!==t?({withHandle:i,className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);let a;e[4]!==n?(a=ce("bg-border focus-visible:ring-ring relative flex w-[0.5px] items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",n),e[4]=n,e[5]=a):a=e[5];let s;e[6]!==i?(s=i&&m.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:m.jsx(xo,{className:"size-2.5"})}),e[6]=i,e[7]=s):s=e[7];let u;return e[8]!==r||e[9]!==a||e[10]!==s?(u=m.jsx(Bd,{"data-slot":"resizable-handle",className:a,...r,children:s}),e[8]=r,e[9]=a,e[10]=s,e[11]=u):u=e[11],u}export{iA as C,N_ as D,nA as G,tA as I,rA as M,uA as R,o_ as U,Zy as a,P_ as b,U_ as c,eA as d,Ky as e,L_ as f,O_ as g,v_ as h,Ju as i,I_ as j,oA as k,aA as l,sA as m,So as n,w0 as u};