db-studio 2.0.1 → 2.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 (159) hide show
  1. package/dist/index.js +75 -75
  2. package/dist/index.js.map +1 -1
  3. package/dist/web-dist/assets/{_pathlessLayout-aKKQKRJX.js → _pathlessLayout-CUDS1e28.js} +1 -1
  4. package/dist/web-dist/assets/_pathlessLayout-WZkezfN7.js +2 -0
  5. package/dist/web-dist/assets/{_queryId-DnPgn-AJ.js → _queryId-CEJb62Vl.js} +1 -1
  6. package/dist/web-dist/assets/{_table-DIbpzW3q.js → _table-6SZEx92j.js} +1 -1
  7. package/dist/web-dist/assets/_table-BUNHOVIK.js +1 -0
  8. package/dist/web-dist/assets/_table-CwyP_2EP.js +1 -0
  9. package/dist/web-dist/assets/{abap-DQayJW6v.js → abap-B-HzHdT_.js} +1 -1
  10. package/dist/web-dist/assets/{apex-Djzlm7in.js → apex-t5VcK3BF.js} +1 -1
  11. package/dist/web-dist/assets/{azcli-Bbikkqe4.js → azcli-Ce3iuV2p.js} +1 -1
  12. package/dist/web-dist/assets/{badge-HtbO9hWg.js → badge-COF6gx-2.js} +1 -1
  13. package/dist/web-dist/assets/{bat-BUFda2RT.js → bat-bOBZcLbK.js} +1 -1
  14. package/dist/web-dist/assets/{bicep-CuUgDHWX.js → bicep-TSicgsnM.js} +1 -1
  15. package/dist/web-dist/assets/{browser-B6gU7HWo.js → browser-B-fV6CZb.js} +1 -1
  16. package/dist/web-dist/assets/{bundle-mjs-DEMZsBkP.js → bundle-mjs-CZwf2xtr.js} +1 -1
  17. package/dist/web-dist/assets/{cameligo-DITobApP.js → cameligo-D-9xpPXV.js} +1 -1
  18. package/dist/web-dist/assets/{chat-sidebar-Cr2fVFDF.js → chat-sidebar-DwzCElBd.js} +5 -5
  19. package/dist/web-dist/assets/{clojure-DTFcSI8F.js → clojure-9X3x3csE.js} +1 -1
  20. package/dist/web-dist/assets/{code-editor-BpsclD2u.js → code-editor-tPwHd3zF.js} +4 -4
  21. package/dist/web-dist/assets/{coffee-CmIRg0oP.js → coffee-anOch8Z-.js} +1 -1
  22. package/dist/web-dist/assets/{connect-BM4hZPnz.js → connect-l3LjAClZ.js} +1 -1
  23. package/dist/web-dist/assets/{constants-BBxXyYPa.js → constants-CKAehpPm.js} +3 -3
  24. package/dist/web-dist/assets/{cpp-BwBWpZT1.js → cpp-oW293AoF.js} +1 -1
  25. package/dist/web-dist/assets/{csharp-BnWK75m3.js → csharp-BOXMgm5k.js} +1 -1
  26. package/dist/web-dist/assets/{csp-Dohj3XYI.js → csp-D67JhNKT.js} +1 -1
  27. package/dist/web-dist/assets/{css-DN4GbnxY.js → css-Bk6H7_K_.js} +1 -1
  28. package/dist/web-dist/assets/{cssMode-CiAtMuTk.js → cssMode-G6latsS7.js} +1 -1
  29. package/dist/web-dist/assets/{cypher-CKAK8eD4.js → cypher-DB0LBjic.js} +1 -1
  30. package/dist/web-dist/assets/{dart-imWXBTLy.js → dart-CS3MbwLP.js} +1 -1
  31. package/dist/web-dist/assets/{database.store-73Wsz2L5.js → database.store-BuqVJMY6.js} +7 -7
  32. package/dist/web-dist/assets/{dist-DwRWhVwY.js → dist-Bz0qAN0x.js} +1 -1
  33. package/dist/web-dist/assets/{dist-D4HUXaJv.js → dist-Cf0L32Jd.js} +1 -1
  34. package/dist/web-dist/assets/{dockerfile-CXOK4zpC.js → dockerfile-BGz3qsmk.js} +1 -1
  35. package/dist/web-dist/assets/{ecl-lOrW9o9k.js → ecl-lt3qcklx.js} +1 -1
  36. package/dist/web-dist/assets/{editor.api-DSevzNN8.js → editor.api-BTIrAcm5.js} +1 -1
  37. package/dist/web-dist/assets/{elixir-DgvzEwPU.js → elixir-cMyUafed.js} +1 -1
  38. package/dist/web-dist/assets/{esm-DC8GK2En.js → esm-B-4Q6MuQ.js} +1 -1
  39. package/dist/web-dist/assets/{flow9-l3BJy5NQ.js → flow9-BI9V6TuS.js} +1 -1
  40. package/dist/web-dist/assets/{format-cell-value-CuhjnBNV.js → format-cell-value-CgUtYv8B.js} +1 -1
  41. package/dist/web-dist/assets/{freemarker2-73G2DeCz.js → freemarker2-mnCFA3xV.js} +1 -1
  42. package/dist/web-dist/assets/{fsharp-sfou20I_.js → fsharp-I1kqnt0E.js} +1 -1
  43. package/dist/web-dist/assets/{go-DnjkNg4Q.js → go-Cg4qMFVj.js} +1 -1
  44. package/dist/web-dist/assets/{graphql-BJFXvNDL.js → graphql-CvtHcP49.js} +1 -1
  45. package/dist/web-dist/assets/{handlebars-DXg2L0KG.js → handlebars-BUcE6Uyy.js} +1 -1
  46. package/dist/web-dist/assets/{hcl-B4FYtDde.js → hcl-BkvCdKNu.js} +1 -1
  47. package/dist/web-dist/assets/highlighted-body-OFNGDK62-t8UIAZOZ.js +1 -0
  48. package/dist/web-dist/assets/{html-BvAUQUXw.js → html-BBqcfykD.js} +1 -1
  49. package/dist/web-dist/assets/{htmlMode-hZ3EloXT.js → htmlMode-D8je66Rk.js} +1 -1
  50. package/dist/web-dist/assets/icons-DxFtdMXW.js +1 -0
  51. package/dist/web-dist/assets/index-QVi4Lb9U.css +2 -0
  52. package/dist/web-dist/assets/index-WFVurGCI.js +34 -0
  53. package/dist/web-dist/assets/{indexes-BYqaS45O.js → indexes-C3Qddb5L.js} +1 -1
  54. package/dist/web-dist/assets/{ini-H3EW14Oa.js → ini-CPc8BCWu.js} +1 -1
  55. package/dist/web-dist/assets/{java-Cu5qHMXc.js → java-C9Yie4SH.js} +1 -1
  56. package/dist/web-dist/assets/{javascript-bJHYh6Or.js → javascript-CuGq5ydO.js} +1 -1
  57. package/dist/web-dist/assets/{json-editor-ZcSS1MRc.js → json-editor-Dc1E8Fc-.js} +1 -1
  58. package/dist/web-dist/assets/{jsonMode-CDMOUPss.js → jsonMode-BgdTmYik.js} +1 -1
  59. package/dist/web-dist/assets/{julia-CZ0npMib.js → julia--qJGRfN8.js} +1 -1
  60. package/dist/web-dist/assets/{keys-By5o7bPm.js → keys-Bs0DRbCB.js} +1 -1
  61. package/dist/web-dist/assets/{kotlin-BpW0qHIt.js → kotlin-C3MSe-0N.js} +1 -1
  62. package/dist/web-dist/assets/{label-C93T1BbF.js → label-DzHJlGAx.js} +1 -1
  63. package/dist/web-dist/assets/{less-DTBM-Kxp.js → less-DOBYgWSY.js} +1 -1
  64. package/dist/web-dist/assets/{lexon-CLOvNp8v.js → lexon-Djd2rGvJ.js} +1 -1
  65. package/dist/web-dist/assets/{liquid-IpfBCIUY.js → liquid-DXfHmR66.js} +1 -1
  66. package/dist/web-dist/assets/{logs-CnLvqVtL.js → logs-BortjBc-.js} +1 -1
  67. package/dist/web-dist/assets/{lspLanguageFeatures-CnYZSn_O.js → lspLanguageFeatures-C7-iyD6G.js} +1 -1
  68. package/dist/web-dist/assets/{lua-BERpVknn.js → lua-Ck8vNcPw.js} +1 -1
  69. package/dist/web-dist/assets/{m3-B_gILjHh.js → m3-a6Kl4TV0.js} +1 -1
  70. package/dist/web-dist/assets/{markdown-DamaZSqy.js → markdown-DkcRBwO0.js} +1 -1
  71. package/dist/web-dist/assets/{mdx-BTw_ghf-.js → mdx-QI5o45qz.js} +1 -1
  72. package/dist/web-dist/assets/{mermaid-GHXKKRXX-B7fOqMvZ.js → mermaid-GHXKKRXX-D35eppUc.js} +1 -1
  73. package/dist/web-dist/assets/{middleware-DKaxoFZs.js → middleware-CXk7SlTF.js} +1 -1
  74. package/dist/web-dist/assets/{mips-BkjI-_01.js → mips-Cc1YVI2p.js} +1 -1
  75. package/dist/web-dist/assets/{module-BbdCXsK0.js → module-D_kjbMCc.js} +1 -1
  76. package/dist/web-dist/assets/{monaco-theme-DkPj5STI.js → monaco-theme-C2k_taVU.js} +4 -4
  77. package/dist/web-dist/assets/{msdax-5OSOIuww.js → msdax-Bh41xUoQ.js} +1 -1
  78. package/dist/web-dist/assets/{mysql-CMtxQW5J.js → mysql-BZTZMxPa.js} +1 -1
  79. package/dist/web-dist/assets/{objective-c-CoW52So-.js → objective-c-CxZIMOHQ.js} +1 -1
  80. package/dist/web-dist/assets/{overlay.store-BL-3zX6X.js → overlay.store-DsUdwZjE.js} +1 -1
  81. package/dist/web-dist/assets/{pascal-BxyU4sPJ.js → pascal-I-WmLkmD.js} +1 -1
  82. package/dist/web-dist/assets/{pascaligo-C63_040U.js → pascaligo-DEZ-6bwf.js} +1 -1
  83. package/dist/web-dist/assets/{perl-ayfptt23.js → perl-DfeHQJxJ.js} +1 -1
  84. package/dist/web-dist/assets/{personal-preferences.store-BIr71Re8.js → personal-preferences.store-DXSnKmVN.js} +1 -1
  85. package/dist/web-dist/assets/{pgsql-CPGqMVI3.js → pgsql-OdOoQYPW.js} +1 -1
  86. package/dist/web-dist/assets/{php-DA-YJ6wI.js → php-CF1bUutw.js} +1 -1
  87. package/dist/web-dist/assets/{pla-DesDCKWW.js → pla-BHZr0GrY.js} +1 -1
  88. package/dist/web-dist/assets/{postiats-B8yhii_n.js → postiats-BSB6a63H.js} +1 -1
  89. package/dist/web-dist/assets/{powerquery-CG8tCOct.js → powerquery-Bu0p84Ye.js} +1 -1
  90. package/dist/web-dist/assets/{powershell-C68aZHza.js → powershell-Dcq3YM6T.js} +1 -1
  91. package/dist/web-dist/assets/{preload-helper-DZhPwQp1.js → preload-helper-DF7hIgef.js} +1 -1
  92. package/dist/web-dist/assets/{protobuf-OaVxpJrs.js → protobuf-CsWrQxqX.js} +1 -1
  93. package/dist/web-dist/assets/{pug-0lOSC2rA.js → pug-DLQiv3Bp.js} +1 -1
  94. package/dist/web-dist/assets/{python-C8ab8TeJ.js → python-BvKEpyP9.js} +1 -1
  95. package/dist/web-dist/assets/{qsharp-BmHeDwNl.js → qsharp-D8nrRUNu.js} +1 -1
  96. package/dist/web-dist/assets/{queries.store-Dwdw-Gej.js → queries.store-BaeyNA64.js} +1 -1
  97. package/dist/web-dist/assets/query-runner-f473QQSD.js +17 -0
  98. package/dist/web-dist/assets/{r-DoHxhOJg.js → r-xhyKpGTk.js} +1 -1
  99. package/dist/web-dist/assets/{radix-ui-ByvuE8TW.js → radix-ui-CxCv--D1.js} +2 -2
  100. package/dist/web-dist/assets/{razor-DynaHCXX.js → razor-Ceb9S1Rz.js} +1 -1
  101. package/dist/web-dist/assets/react-DEQ0BgTL.js +1 -0
  102. package/dist/web-dist/assets/{react-dom-DQQG0g0D.js → react-dom-ITw3Lqwx.js} +1 -1
  103. package/dist/web-dist/assets/{redis-CSL-jfR-.js → redis-BnpkEvbr.js} +1 -1
  104. package/dist/web-dist/assets/redis-value-DMk0-Zuc.js +1 -0
  105. package/dist/web-dist/assets/{redshift-Cb-LWZ8f.js → redshift-BpxVXjAI.js} +1 -1
  106. package/dist/web-dist/assets/{restructuredtext-DTqnvYsu.js → restructuredtext-5afXtW7D.js} +1 -1
  107. package/dist/web-dist/assets/{rolldown-runtime-0wqQW3ea.js → rolldown-runtime-fzu9RN21.js} +1 -1
  108. package/dist/web-dist/assets/{ruby-DbgDuslH.js → ruby-CHaoWUHT.js} +1 -1
  109. package/dist/web-dist/assets/{runner-DFzqBXp0.js → runner-NsYjzIZs.js} +1 -1
  110. package/dist/web-dist/assets/{rust-CWzrsIL_.js → rust-Bw0WVsLy.js} +1 -1
  111. package/dist/web-dist/assets/{sb-BghszYt-.js → sb-CEjXmIyG.js} +1 -1
  112. package/dist/web-dist/assets/{scala-Cw9RU1Qz.js → scala-BuaCSaU6.js} +1 -1
  113. package/dist/web-dist/assets/{schema-B_EtHxTf.js → schema-CE1yGygf.js} +1 -1
  114. package/dist/web-dist/assets/{schema-iTfBKwXl.js → schema-rxLBue8Q.js} +1 -1
  115. package/dist/web-dist/assets/{scheme-DeYmvmAH.js → scheme-DIKzlmFG.js} +1 -1
  116. package/dist/web-dist/assets/{scss-D_S6B2H1.js → scss-C2_UsWzg.js} +1 -1
  117. package/dist/web-dist/assets/{select-DU0HoKZ4.js → select-C-nrz7Tx.js} +1 -1
  118. package/dist/web-dist/assets/{separator-CZgXYjVQ.js → separator-DnB61XAO.js} +1 -1
  119. package/dist/web-dist/assets/{sheet-sidebar-KvxY47ZZ.js → sheet-sidebar-BGxJGRbd.js} +1 -1
  120. package/dist/web-dist/assets/{shell-B59ItoUV.js → shell-2aEL2EVH.js} +1 -1
  121. package/dist/web-dist/assets/{solidity-De0h6YhL.js → solidity-D-5XfYE1.js} +1 -1
  122. package/dist/web-dist/assets/{sophia-DWmKHYE0.js → sophia-s4MFSvUF.js} +1 -1
  123. package/dist/web-dist/assets/{sparql-0sKQlAae.js → sparql-Dkv46wS5.js} +1 -1
  124. package/dist/web-dist/assets/{spinner-FJ-tXoFX.js → spinner-CNnB5r0X.js} +1 -1
  125. package/dist/web-dist/assets/{sql-Cafrv7gm.js → sql-Dz9Xhs8s.js} +1 -1
  126. package/dist/web-dist/assets/{st-qkFqcB41.js → st-Cbo0XVmr.js} +1 -1
  127. package/dist/web-dist/assets/{swift-CDPKFfVs.js → swift-B66X97nW.js} +1 -1
  128. package/dist/web-dist/assets/{systemverilog-rjtBmhAJ.js → systemverilog-gGKga8Gf.js} +1 -1
  129. package/dist/web-dist/assets/{table-DmoKTp5U.js → table-C8WK3uAc.js} +1 -1
  130. package/dist/web-dist/assets/tables-D98Kbmcb.js +16 -0
  131. package/dist/web-dist/assets/{tanstack-Cb7WFPRi.js → tanstack-RwHFfmqj.js} +4 -4
  132. package/dist/web-dist/assets/{tcl-C0NrUCCP.js → tcl-BtbeJsUN.js} +1 -1
  133. package/dist/web-dist/assets/{tsMode-C2yuf0pi.js → tsMode-BgtcNcpl.js} +1 -1
  134. package/dist/web-dist/assets/{twig-RBrBABOf.js → twig-0_nXiuYs.js} +1 -1
  135. package/dist/web-dist/assets/{typescript-DWkZjHjp.js → typescript-Cy_CzC_-.js} +1 -1
  136. package/dist/web-dist/assets/{typespec-DfQiGud4.js → typespec-DBO6_WMJ.js} +1 -1
  137. package/dist/web-dist/assets/{use-database-engine-Mwmv8X7V.js → use-database-engine-DZZj7-4J.js} +1 -1
  138. package/dist/web-dist/assets/{use-theme-BLw5dtZV.js → use-theme-DBhPknw6.js} +1 -1
  139. package/dist/web-dist/assets/{utils-awMbhLwX.js → utils-EJLOIroS.js} +1 -1
  140. package/dist/web-dist/assets/{vb-BslxQW9i.js → vb-DFJjBsW2.js} +1 -1
  141. package/dist/web-dist/assets/{visualizer-LoD_yU5U.js → visualizer-CgYlDJ_-.js} +1 -1
  142. package/dist/web-dist/assets/{vscode-Ba8jYSS7.js → vscode-wuSgCuZI.js} +1 -1
  143. package/dist/web-dist/assets/{wgsl-Bq67ZIFU.js → wgsl-U3RBM2M0.js} +1 -1
  144. package/dist/web-dist/assets/{workers-rMl5Xrk2.js → workers-ClRH6A2w.js} +1 -1
  145. package/dist/web-dist/assets/{xml-PfDqoe6w.js → xml-D11j3J2_.js} +1 -1
  146. package/dist/web-dist/assets/{yaml-CIuY3cB5.js → yaml-D7Z_4mnx.js} +1 -1
  147. package/dist/web-dist/index.html +31 -31
  148. package/package.json +1 -1
  149. package/dist/web-dist/assets/_pathlessLayout-s6cwJxH6.js +0 -2
  150. package/dist/web-dist/assets/_table-Bgt0zJ9m.js +0 -1
  151. package/dist/web-dist/assets/_table-CU8PHZQE.js +0 -1
  152. package/dist/web-dist/assets/highlighted-body-OFNGDK62-Bi4CQl8I.js +0 -1
  153. package/dist/web-dist/assets/icons-CheF8KGp.js +0 -1
  154. package/dist/web-dist/assets/index-YCx2RIFq.js +0 -34
  155. package/dist/web-dist/assets/index-mbFBVmHb.css +0 -2
  156. package/dist/web-dist/assets/query-runner-C430BH5I.js +0 -17
  157. package/dist/web-dist/assets/react-CKF1H7h0.js +0 -1
  158. package/dist/web-dist/assets/redis-value-Bf0tOet0.js +0 -1
  159. package/dist/web-dist/assets/tables-By-PTDwU.js +0 -13
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/highlighted-body-OFNGDK62-Bi4CQl8I.js","assets/rolldown-runtime-0wqQW3ea.js","assets/icons-CheF8KGp.js","assets/radix-ui-ByvuE8TW.js"])))=>i.map(i=>d[i]);
2
- import{n as pi,r as tr,t as kn}from"./rolldown-runtime-0wqQW3ea.js";import{Dt as tu,E as nu,It as ru,L as iu,Pt as au,St as su,h as ou,n as lu,st as cu}from"./icons-CheF8KGp.js";import{At as uu,Dt as Ki,c as hu,ft as du,jt as fu,l as pu,s as mu}from"./radix-ui-ByvuE8TW.js";import{n as Us,t as js}from"./bundle-mjs-DEMZsBkP.js";import{t as me}from"./utils-awMbhLwX.js";import{a as gu,c as Eu,n as nr,o as Tu,t as zs}from"./overlay.store-BL-3zX6X.js";import{c as bu,d as ku,l as Au,t as _u,u as xu}from"./sheet-sidebar-KvxY47ZZ.js";import{H as yu,U as Cu,q as Su}from"./constants-BBxXyYPa.js";import{t as Nu}from"./database.store-73Wsz2L5.js";import{t as $s}from"./preload-helper-DZhPwQp1.js";import{i as Iu,r as vu}from"./separator-CZgXYjVQ.js";import{C as wu,a as Ys,d as Lu,f as Ru,l as qs,p as zr,u as Vs}from"./index-YCx2RIFq.js";import{n as Ws}from"./_pathlessLayout-s6cwJxH6.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"db-studio@2.0.1"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="92c21e9e-afb5-4731-9abe-eb2845bd816e",e._sentryDebugIdIdentifier="sentry-dbid-92c21e9e-afb5-4731-9abe-eb2845bd816e")}catch{}})();var Ou=["Show me all tables in my database","What columns are in the users table?","Write a query to find all active users","How many orders were placed last month?","Find top 5 customers by total spend","Write a JOIN between users and orders","Users who haven't made any purchase yet","Generate monthly revenue summary query","Suggest useful indexes for better performance","Show schema of the products / inventory table","Latest 20 orders with customer names","Help me write a safe UPDATE query"],rr=(function(e){if(e==null)return Bu;if(typeof e=="function")return ir(e);if(typeof e=="object")return Array.isArray(e)?Du(e):Pu(e);if(typeof e=="string")return Mu(e);throw new Error("Expected function, string, or object as test")});function Du(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=rr(e[n]);return ir(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function Pu(e){const t=e;return ir(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function Mu(e){return ir(t);function t(n){return n&&n.type===e}}function ir(e){return t;function t(n,r,i){return!!(Fu(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Bu(){return!0}function Fu(e){return e!==null&&typeof e=="object"&&"type"in e}var Gs=[];var rn="skip";function mi(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=rr(i),s=r?-1:1;l(e,void 0,[])();function l(o,u,d){const h=o&&typeof o=="object"?o:{};if(typeof h.type=="string"){const p=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(o.type+(p?"<"+p+">":""))+")"})}return f;function f(){let p=Gs,E,N,y;if((!t||a(o,u,d[d.length-1]||void 0))&&(p=Hu(n(o,d)),p[0]===!1))return p;if("children"in o&&o.children){const _=o;if(_.children&&p[0]!=="skip")for(N=(r?_.children.length:-1)+s,y=d.concat(_);N>-1&&N<_.children.length;){const C=_.children[N];if(E=l(C,N,y)(),E[0]===!1)return E;N=typeof E[1]=="number"?E[1]:N+s}}return p}}}function Hu(e){return Array.isArray(e)?e:typeof e=="number"?[!0,e]:e==null?Gs:[e]}function Xe(e,t,n,r){let i,a,s;typeof t=="function"&&typeof n!="function"?(a=void 0,s=t,i=n):(a=t,s=n,i=r),mi(e,a,l,i);function l(o,u){const d=u[u.length-1],h=d?d.children.indexOf(o):void 0;return s(o,h,d)}}var k=tr(ru(),1),m=fu(),Ht={indicator:"indicator",textOnly:"text-only",remove:"remove"};function Uu({defaultOrigin:e="",allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:i=[],blockedImageClass:a="inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm",blockedLinkClass:s="text-gray-500",linkBlockPolicy:l=Ht.indicator,imageBlockPolicy:o=Ht.indicator}){const u=t.length&&!t.every(h=>h==="*"),d=n.length&&!n.every(h=>h==="*");if(!e&&(u||d))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return h=>{const f=Vu(e,t,n,r,i,a,s,l,o);Qs(h),Xe(h,f)}}function Xi(e,t){if(typeof e!="string")return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith("/")||e.startsWith("./")||e.startsWith("../"))try{return new URL(e,"http://example.com")}catch{return null}return null}}function ju(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}var zu=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),$u=new Set(["javascript:","data:","file:","vbscript:"]);function Zi(e,t,n,r=!1,i=!1,a=[]){if(!e)return null;if(typeof e=="string"&&e.startsWith("#")&&!i)try{if(new URL(e,"http://example.com").hash===e)return e}catch{}if(typeof e=="string"&&e.startsWith("data:"))return i&&r&&e.startsWith("data:image/")?e:null;if(typeof e=="string"&&e.startsWith("blob:")){try{if(new URL(e).protocol==="blob:"&&e.length>5){const o=e.substring(5);if(o&&o.length>0&&o!=="invalid")return e}}catch{return null}return null}const s=Xi(e,n);if(!s||$u.has(s.protocol)||!(zu.has(s.protocol)||a.includes(s.protocol)||a.includes("*")))return null;if(s.protocol==="mailto:"||!s.protocol.match(/^https?:$/))return s.href;const l=ju(e);return s&&t.some(o=>{const u=Xi(o,n);return!u||u.origin!==s.origin?!1:s.href.startsWith(u.href)})?l?s.pathname+s.search+s.hash:s.href:t.includes("*")?s.protocol!=="https:"&&s.protocol!=="http:"?null:l?s.pathname+s.search+s.hash:s.href:null}function Qs(e){if("children"in e&&Array.isArray(e.children)){e.children=e.children.filter(t=>t!=null);for(const t of e.children)Qs(t)}}var Tr=Symbol("node-seen");function Yu(e,t,n){return t===Ht.remove?{type:"remove"}:t===Ht.textOnly?{type:"replace",element:{type:"element",tagName:"span",properties:{},children:[...e.children]}}:{type:"replace",element:{type:"element",tagName:"span",properties:{title:"Blocked URL: "+String(e.properties.href),class:n},children:[...e.children,{type:"text",value:" [blocked]"}]}}}function qu(e,t,n){if(t===Ht.remove)return{type:"remove"};if(t===Ht.textOnly){const r=String(e.properties.alt||"");return r?{type:"replace",element:{type:"element",tagName:"span",properties:{},children:[{type:"text",value:r}]}}:{type:"remove"}}return{type:"replace",element:{type:"element",tagName:"span",properties:{class:n},children:[{type:"text",value:"[Image blocked: "+String(e.properties.alt||"No description")+"]"}]}}}var Vu=(e,t,n,r,i,a,s,l,o)=>{const u=(d,h,f)=>{if(d.type!=="element"||d[Tr])return!0;if(d.tagName==="a"){const p=Zi(d.properties.href,t,e,!1,!1,i);if(p===null){if(d[Tr]=!0,Xe(d,u),f&&typeof h=="number"){const E=Yu(d,l,s);if(E.type==="remove")return f.children.splice(h,1),[rn,h];f.children[h]=E.element}return rn}else return d.properties.href=p,d.properties.target="_blank",d.properties.rel="noopener noreferrer",!0}if(d.tagName==="img"){const p=Zi(d.properties.src,n,e,r,!0,i);if(p===null){if(d[Tr]=!0,Xe(d,u),f&&typeof h=="number"){const E=qu(d,o,a);if(E.type==="remove")return f.children.splice(h,1),[rn,h];f.children[h]=E.element}return rn}else return d.properties.src=p,!0}return!0};return u},Ji=typeof self=="object"?self:globalThis,Wu=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,s]=t[i];switch(a){case 0:case-1:return n(s,i);case 1:{const l=n([],i);for(const o of s)l.push(r(o));return l}case 2:{const l=n({},i);for(const[o,u]of s)l[r(o)]=r(u);return l}case 3:return n(new Date(s),i);case 4:{const{source:l,flags:o}=s;return n(new RegExp(l,o),i)}case 5:{const l=n(new Map,i);for(const[o,u]of s)l.set(r(o),r(u));return l}case 6:{const l=n(new Set,i);for(const o of s)l.add(r(o));return l}case 7:{const{name:l,message:o}=s;return n(new Ji[l](o),i)}case 8: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:l}=new Uint8Array(s);return n(new DataView(l),s)}}return n(new Ji[a](s),i)};return r},ea=e=>Wu(new Map,e)(0),Dt="",{toString:Gu}={},{keys:Qu}=Object,Xt=e=>{const t=typeof e;if(t!=="object"||!e)return[0,t];const n=Gu.call(e).slice(8,-1);switch(n){case"Array":return[1,Dt];case"Object":return[2,Dt];case"Date":return[3,Dt];case"RegExp":return[4,Dt];case"Map":return[5,Dt];case"Set":return[6,Dt];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},Dn=([e,t])=>e===0&&(t==="function"||t==="symbol"),Ku=(e,t,n,r)=>{const i=(s,l)=>{const o=r.push(s)-1;return n.set(l,o),o},a=s=>{if(n.has(s))return n.get(s);let[l,o]=Xt(s);switch(l){case 0:{let d=s;switch(o){case"bigint":l=8,d=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+o);d=null;break;case"undefined":return i([-1],s)}return i([l,d],s)}case 1:{if(o){let f=s;return o==="DataView"?f=new Uint8Array(s.buffer):o==="ArrayBuffer"&&(f=new Uint8Array(s)),i([o,[...f]],s)}const d=[],h=i([l,d],s);for(const f of s)d.push(a(f));return h}case 2:{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(t&&"toJSON"in s)return a(s.toJSON());const d=[],h=i([l,d],s);for(const f of Qu(s))(e||!Dn(Xt(s[f])))&&d.push([a(f),a(s[f])]);return h}case 3:return i([l,s.toISOString()],s);case 4:{const{source:d,flags:h}=s;return i([l,{source:d,flags:h}],s)}case 5:{const d=[],h=i([l,d],s);for(const[f,p]of s)(e||!(Dn(Xt(f))||Dn(Xt(p))))&&d.push([a(f),a(p)]);return h}case 6:{const d=[],h=i([l,d],s);for(const f of s)(e||!Dn(Xt(f)))&&d.push(a(f));return h}}const{message:u}=s;return i([l,{name:o,message:u}],s)};return a},ta=(e,{json:t,lossy:n}={})=>{const r=[];return Ku(!(t||n),!!t,new Map,r)(e),r},yt=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ea(ta(e,t)):structuredClone(e):(e,t)=>ea(ta(e,t));var An=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};An.prototype.normal={};An.prototype.property={};An.prototype.space=void 0;function Ks(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new An(n,r,t)}function gn(e){return e.toLowerCase()}var Re=class{constructor(e,t){this.attribute=t,this.property=e}};Re.prototype.attribute="";Re.prototype.booleanish=!1;Re.prototype.boolean=!1;Re.prototype.commaOrSpaceSeparated=!1;Re.prototype.commaSeparated=!1;Re.prototype.defined=!1;Re.prototype.mustUseProperty=!1;Re.prototype.number=!1;Re.prototype.overloadedBoolean=!1;Re.prototype.property="";Re.prototype.spaceSeparated=!1;Re.prototype.space=void 0;var $r=pi({boolean:()=>Z,booleanish:()=>be,commaOrSpaceSeparated:()=>Me,commaSeparated:()=>Bt,number:()=>F,overloadedBoolean:()=>Yr,spaceSeparated:()=>ue}),Xu=0,Z=Nt(),be=Nt(),Yr=Nt(),F=Nt(),ue=Nt(),Bt=Nt(),Me=Nt();function Nt(){return 2**++Xu}var br=Object.keys($r),gi=class extends Re{constructor(e,t,n,r){let i=-1;if(super(e,t),na(this,"space",r),typeof n=="number")for(;++i<br.length;){const a=br[i];na(this,br[i],(n&$r[a])===$r[a])}}};gi.prototype.defined=!0;function na(e,t,n){n&&(e[t]=n)}function zt(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new gi(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[gn(r)]=r,n[gn(a.attribute)]=r}return new An(t,n,e.space)}var Xs=zt({properties:{ariaActiveDescendant:null,ariaAtomic:be,ariaAutoComplete:null,ariaBusy:be,ariaChecked:be,ariaColCount:F,ariaColIndex:F,ariaColSpan:F,ariaControls:ue,ariaCurrent:null,ariaDescribedBy:ue,ariaDetails:null,ariaDisabled:be,ariaDropEffect:ue,ariaErrorMessage:null,ariaExpanded:be,ariaFlowTo:ue,ariaGrabbed:be,ariaHasPopup:null,ariaHidden:be,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ue,ariaLevel:F,ariaLive:null,ariaModal:be,ariaMultiLine:be,ariaMultiSelectable:be,ariaOrientation:null,ariaOwns:ue,ariaPlaceholder:null,ariaPosInSet:F,ariaPressed:be,ariaReadOnly:be,ariaRelevant:null,ariaRequired:be,ariaRoleDescription:ue,ariaRowCount:F,ariaRowIndex:F,ariaRowSpan:F,ariaSelected:be,ariaSetSize:F,ariaSort:null,ariaValueMax:F,ariaValueMin:F,ariaValueNow:F,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Zs(e,t){return t in e?e[t]:t}function Js(e,t){return Zs(e,t.toLowerCase())}var Zu=zt({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Bt,acceptCharset:ue,accessKey:ue,action:null,allow:null,allowFullScreen:Z,allowPaymentRequest:Z,allowUserMedia:Z,alt:null,as:null,async:Z,autoCapitalize:null,autoComplete:ue,autoFocus:Z,autoPlay:Z,blocking:ue,capture:null,charSet:null,checked:Z,cite:null,className:ue,cols:F,colSpan:null,content:null,contentEditable:be,controls:Z,controlsList:ue,coords:F|Bt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Z,defer:Z,dir:null,dirName:null,disabled:Z,download:Yr,draggable:be,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Z,formTarget:null,headers:ue,height:F,hidden:Yr,high:F,href:null,hrefLang:null,htmlFor:ue,httpEquiv:ue,id:null,imageSizes:null,imageSrcSet:null,inert:Z,inputMode:null,integrity:null,is:null,isMap:Z,itemId:null,itemProp:ue,itemRef:ue,itemScope:Z,itemType:ue,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Z,low:F,manifest:null,max:null,maxLength:F,media:null,method:null,min:null,minLength:F,multiple:Z,muted:Z,name:null,nonce:null,noModule:Z,noValidate:Z,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:Z,optimum:F,pattern:null,ping:ue,placeholder:null,playsInline:Z,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Z,referrerPolicy:null,rel:ue,required:Z,reversed:Z,rows:F,rowSpan:F,sandbox:ue,scope:null,scoped:Z,seamless:Z,selected:Z,shadowRootClonable:Z,shadowRootDelegatesFocus:Z,shadowRootMode:null,shape:null,size:F,sizes:null,slot:null,span:F,spellCheck:be,src:null,srcDoc:null,srcLang:null,srcSet:null,start:F,step:null,style:null,tabIndex:F,target:null,title:null,translate:null,type:null,typeMustMatch:Z,useMap:null,value:be,width:F,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ue,axis:null,background:null,bgColor:null,border:F,borderColor:null,bottomMargin:F,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Z,declare:Z,event:null,face:null,frame:null,frameBorder:null,hSpace:F,leftMargin:F,link:null,longDesc:null,lowSrc:null,marginHeight:F,marginWidth:F,noResize:Z,noHref:Z,noShade:Z,noWrap:Z,object:null,profile:null,prompt:null,rev:null,rightMargin:F,rules:null,scheme:null,scrolling:be,standby:null,summary:null,text:null,topMargin:F,valueType:null,version:null,vAlign:null,vLink:null,vSpace:F,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Z,disableRemotePlayback:Z,prefix:null,property:null,results:F,security:null,unselectable:null},space:"html",transform:Js}),Ju=zt({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:Me,accentHeight:F,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:F,amplitude:F,arabicForm:null,ascent:F,attributeName:null,attributeType:null,azimuth:F,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:F,by:null,calcMode:null,capHeight:F,className:ue,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:F,diffuseConstant:F,direction:null,display:null,dur:null,divisor:F,dominantBaseline:null,download:Z,dx:null,dy:null,edgeMode:null,editable:null,elevation:F,enableBackground:null,end:null,event:null,exponent:F,externalResourcesRequired:null,fill:null,fillOpacity:F,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:Bt,g2:Bt,glyphName:Bt,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:F,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:F,horizOriginX:F,horizOriginY:F,id:null,ideographic:F,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:F,k:F,k1:F,k2:F,k3:F,k4:F,kernelMatrix:Me,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:F,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:F,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:F,overlineThickness:F,paintOrder:null,panose1:null,path:null,pathLength:F,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ue,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:F,pointsAtY:F,pointsAtZ:F,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Me,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Me,rev:Me,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Me,requiredFeatures:Me,requiredFonts:Me,requiredFormats:Me,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:F,specularExponent:F,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:F,strikethroughThickness:F,string:null,stroke:null,strokeDashArray:Me,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:F,strokeOpacity:F,strokeWidth:null,style:null,surfaceScale:F,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Me,tabIndex:F,tableValues:null,target:null,targetX:F,targetY:F,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Me,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:F,underlineThickness:F,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:F,values:null,vAlphabetic:F,vMathematical:F,vectorEffect:null,vHanging:F,vIdeographic:F,version:null,vertAdvY:F,vertOriginX:F,vertOriginY:F,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:F,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Zs}),eo=zt({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),to=zt({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Js}),no=zt({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),eh={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"},th=/[A-Z]/g,ra=/-[a-z]/g,nh=/^data[-\w.:]+$/i;function ar(e,t){const n=gn(t);let r=t,i=Re;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&nh.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(ra,ih);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!ra.test(a)){let s=a.replace(th,rh);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=gi}return new i(r,t)}function rh(e){return"-"+e.toLowerCase()}function ih(e){return e.charAt(1).toUpperCase()}var _n=Ks([Xs,Zu,eo,to,no],"html"),pt=Ks([Xs,Ju,eo,to,no],"svg");function ia(e){const t=[],n=String(e||"");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)&&t.push(s),i=r+1,r=n.indexOf(",",i)}return t}function ro(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}var aa=/[#.]/g;function ah(e,t){const n=e||"",r={};let i=0,a,s;for(;i<n.length;){aa.lastIndex=i;const l=aa.exec(n),o=n.slice(i,l?l.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),l&&(a=l[0],i++)}return{type:"element",tagName:s||t||"div",properties:r,children:[]}}function sa(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function io(e){return e.join(" ").trim()}function ao(e,t,n){const r=n?ch(n):void 0;function i(a,s,...l){let o;if(a==null){o={type:"root",children:[]};const u=s;l.unshift(u)}else{o=ah(a,t);const u=o.tagName.toLowerCase(),d=r?r.get(u):void 0;if(o.tagName=d||u,sh(s))l.unshift(s);else for(const[h,f]of Object.entries(s))oh(e,o.properties,h,f)}for(const u of l)qr(o.children,u);return o.type==="element"&&o.tagName==="template"&&(o.content={type:"root",children:o.children},o.children=[]),o}return i}function sh(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const i=t[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 e&&Array.isArray(e.children))}function oh(e,t,n,r){const i=ar(e,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=sa(r):i.commaSeparated?a=ia(r):i.commaOrSpaceSeparated?a=sa(ia(r).join(" ")):a=oa(i,i.property,r):Array.isArray(r)?a=[...r]:a=i.property==="style"?lh(r):String(r);if(Array.isArray(a)){const s=[];for(const l of a)s.push(oa(i,i.property,l));a=s}i.property==="className"&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function qr(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)qr(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?qr(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function oa(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||gn(n)===gn(t)))return!0}return n}function lh(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function ch(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}var uh=["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"],hh=ao(_n,"div"),dh=ao(pt,"g",uh);function fh(e){const t=String(e),n=[];return{toOffset:i,toPoint:r};function r(a){if(typeof a=="number"&&a>-1&&a<=t.length){let s=0;for(;;){let l=n[s];if(l===void 0){const o=la(t,n[s-1]);l=o===-1?t.length+1:o+1,n[s]=l}if(l>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 l=n[n.length-1],o=la(t,l),u=o===-1?t.length+1:o+1;if(l===u)break;n.push(u)}const s=(a.line>1?n[a.line-2]:0)+a.column-1;if(s<n[a.line-1])return s}}}function la(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/highlighted-body-OFNGDK62-t8UIAZOZ.js","assets/rolldown-runtime-fzu9RN21.js","assets/icons-DxFtdMXW.js","assets/radix-ui-CxCv--D1.js"])))=>i.map(i=>d[i]);
2
+ import{n as pi,r as tr,t as kn}from"./rolldown-runtime-fzu9RN21.js";import{At as tu,D as nu,Lt as ru,Tt as iu,g as au,lt as su,n as ou,z as lu,zt as cu}from"./icons-DxFtdMXW.js";import{At as uu,Dt as Ki,ft as hu,jt as du,n as fu,r as pu,t as mu}from"./radix-ui-CxCv--D1.js";import{n as Us,t as js}from"./bundle-mjs-CZwf2xtr.js";import{t as me}from"./utils-EJLOIroS.js";import{a as gu,c as Eu,n as nr,o as Tu,t as zs}from"./overlay.store-DsUdwZjE.js";import{c as bu,d as ku,l as Au,t as _u,u as xu}from"./sheet-sidebar-BGxJGRbd.js";import{H as yu,U as Cu,q as Su}from"./constants-CKAehpPm.js";import{t as Nu}from"./database.store-BuqVJMY6.js";import{t as $s}from"./preload-helper-DF7hIgef.js";import{i as Iu,r as vu}from"./separator-DnB61XAO.js";import{C as wu,a as Ys,d as Lu,f as Ru,l as qs,p as zr,u as Vs}from"./index-WFVurGCI.js";import{n as Ws}from"./_pathlessLayout-WZkezfN7.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"db-studio@2.1.0"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ad356737-ddaf-4ba9-ba0a-4fe709fcdc41",e._sentryDebugIdIdentifier="sentry-dbid-ad356737-ddaf-4ba9-ba0a-4fe709fcdc41")}catch{}})();var Ou=["Show me all tables in my database","What columns are in the users table?","Write a query to find all active users","How many orders were placed last month?","Find top 5 customers by total spend","Write a JOIN between users and orders","Users who haven't made any purchase yet","Generate monthly revenue summary query","Suggest useful indexes for better performance","Show schema of the products / inventory table","Latest 20 orders with customer names","Help me write a safe UPDATE query"],rr=(function(e){if(e==null)return Bu;if(typeof e=="function")return ir(e);if(typeof e=="object")return Array.isArray(e)?Du(e):Pu(e);if(typeof e=="string")return Mu(e);throw new Error("Expected function, string, or object as test")});function Du(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=rr(e[n]);return ir(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function Pu(e){const t=e;return ir(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function Mu(e){return ir(t);function t(n){return n&&n.type===e}}function ir(e){return t;function t(n,r,i){return!!(Fu(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Bu(){return!0}function Fu(e){return e!==null&&typeof e=="object"&&"type"in e}var Gs=[];var rn="skip";function mi(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=rr(i),s=r?-1:1;l(e,void 0,[])();function l(o,u,d){const h=o&&typeof o=="object"?o:{};if(typeof h.type=="string"){const p=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(o.type+(p?"<"+p+">":""))+")"})}return f;function f(){let p=Gs,E,N,y;if((!t||a(o,u,d[d.length-1]||void 0))&&(p=Hu(n(o,d)),p[0]===!1))return p;if("children"in o&&o.children){const _=o;if(_.children&&p[0]!=="skip")for(N=(r?_.children.length:-1)+s,y=d.concat(_);N>-1&&N<_.children.length;){const C=_.children[N];if(E=l(C,N,y)(),E[0]===!1)return E;N=typeof E[1]=="number"?E[1]:N+s}}return p}}}function Hu(e){return Array.isArray(e)?e:typeof e=="number"?[!0,e]:e==null?Gs:[e]}function Xe(e,t,n,r){let i,a,s;typeof t=="function"&&typeof n!="function"?(a=void 0,s=t,i=n):(a=t,s=n,i=r),mi(e,a,l,i);function l(o,u){const d=u[u.length-1],h=d?d.children.indexOf(o):void 0;return s(o,h,d)}}var k=tr(cu(),1),m=du(),Ht={indicator:"indicator",textOnly:"text-only",remove:"remove"};function Uu({defaultOrigin:e="",allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:i=[],blockedImageClass:a="inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm",blockedLinkClass:s="text-gray-500",linkBlockPolicy:l=Ht.indicator,imageBlockPolicy:o=Ht.indicator}){const u=t.length&&!t.every(h=>h==="*"),d=n.length&&!n.every(h=>h==="*");if(!e&&(u||d))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return h=>{const f=Vu(e,t,n,r,i,a,s,l,o);Qs(h),Xe(h,f)}}function Xi(e,t){if(typeof e!="string")return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith("/")||e.startsWith("./")||e.startsWith("../"))try{return new URL(e,"http://example.com")}catch{return null}return null}}function ju(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}var zu=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),$u=new Set(["javascript:","data:","file:","vbscript:"]);function Zi(e,t,n,r=!1,i=!1,a=[]){if(!e)return null;if(typeof e=="string"&&e.startsWith("#")&&!i)try{if(new URL(e,"http://example.com").hash===e)return e}catch{}if(typeof e=="string"&&e.startsWith("data:"))return i&&r&&e.startsWith("data:image/")?e:null;if(typeof e=="string"&&e.startsWith("blob:")){try{if(new URL(e).protocol==="blob:"&&e.length>5){const o=e.substring(5);if(o&&o.length>0&&o!=="invalid")return e}}catch{return null}return null}const s=Xi(e,n);if(!s||$u.has(s.protocol)||!(zu.has(s.protocol)||a.includes(s.protocol)||a.includes("*")))return null;if(s.protocol==="mailto:"||!s.protocol.match(/^https?:$/))return s.href;const l=ju(e);return s&&t.some(o=>{const u=Xi(o,n);return!u||u.origin!==s.origin?!1:s.href.startsWith(u.href)})?l?s.pathname+s.search+s.hash:s.href:t.includes("*")?s.protocol!=="https:"&&s.protocol!=="http:"?null:l?s.pathname+s.search+s.hash:s.href:null}function Qs(e){if("children"in e&&Array.isArray(e.children)){e.children=e.children.filter(t=>t!=null);for(const t of e.children)Qs(t)}}var Tr=Symbol("node-seen");function Yu(e,t,n){return t===Ht.remove?{type:"remove"}:t===Ht.textOnly?{type:"replace",element:{type:"element",tagName:"span",properties:{},children:[...e.children]}}:{type:"replace",element:{type:"element",tagName:"span",properties:{title:"Blocked URL: "+String(e.properties.href),class:n},children:[...e.children,{type:"text",value:" [blocked]"}]}}}function qu(e,t,n){if(t===Ht.remove)return{type:"remove"};if(t===Ht.textOnly){const r=String(e.properties.alt||"");return r?{type:"replace",element:{type:"element",tagName:"span",properties:{},children:[{type:"text",value:r}]}}:{type:"remove"}}return{type:"replace",element:{type:"element",tagName:"span",properties:{class:n},children:[{type:"text",value:"[Image blocked: "+String(e.properties.alt||"No description")+"]"}]}}}var Vu=(e,t,n,r,i,a,s,l,o)=>{const u=(d,h,f)=>{if(d.type!=="element"||d[Tr])return!0;if(d.tagName==="a"){const p=Zi(d.properties.href,t,e,!1,!1,i);if(p===null){if(d[Tr]=!0,Xe(d,u),f&&typeof h=="number"){const E=Yu(d,l,s);if(E.type==="remove")return f.children.splice(h,1),[rn,h];f.children[h]=E.element}return rn}else return d.properties.href=p,d.properties.target="_blank",d.properties.rel="noopener noreferrer",!0}if(d.tagName==="img"){const p=Zi(d.properties.src,n,e,r,!0,i);if(p===null){if(d[Tr]=!0,Xe(d,u),f&&typeof h=="number"){const E=qu(d,o,a);if(E.type==="remove")return f.children.splice(h,1),[rn,h];f.children[h]=E.element}return rn}else return d.properties.src=p,!0}return!0};return u},Ji=typeof self=="object"?self:globalThis,Wu=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,s]=t[i];switch(a){case 0:case-1:return n(s,i);case 1:{const l=n([],i);for(const o of s)l.push(r(o));return l}case 2:{const l=n({},i);for(const[o,u]of s)l[r(o)]=r(u);return l}case 3:return n(new Date(s),i);case 4:{const{source:l,flags:o}=s;return n(new RegExp(l,o),i)}case 5:{const l=n(new Map,i);for(const[o,u]of s)l.set(r(o),r(u));return l}case 6:{const l=n(new Set,i);for(const o of s)l.add(r(o));return l}case 7:{const{name:l,message:o}=s;return n(new Ji[l](o),i)}case 8: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:l}=new Uint8Array(s);return n(new DataView(l),s)}}return n(new Ji[a](s),i)};return r},ea=e=>Wu(new Map,e)(0),Dt="",{toString:Gu}={},{keys:Qu}=Object,Xt=e=>{const t=typeof e;if(t!=="object"||!e)return[0,t];const n=Gu.call(e).slice(8,-1);switch(n){case"Array":return[1,Dt];case"Object":return[2,Dt];case"Date":return[3,Dt];case"RegExp":return[4,Dt];case"Map":return[5,Dt];case"Set":return[6,Dt];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},Dn=([e,t])=>e===0&&(t==="function"||t==="symbol"),Ku=(e,t,n,r)=>{const i=(s,l)=>{const o=r.push(s)-1;return n.set(l,o),o},a=s=>{if(n.has(s))return n.get(s);let[l,o]=Xt(s);switch(l){case 0:{let d=s;switch(o){case"bigint":l=8,d=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+o);d=null;break;case"undefined":return i([-1],s)}return i([l,d],s)}case 1:{if(o){let f=s;return o==="DataView"?f=new Uint8Array(s.buffer):o==="ArrayBuffer"&&(f=new Uint8Array(s)),i([o,[...f]],s)}const d=[],h=i([l,d],s);for(const f of s)d.push(a(f));return h}case 2:{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(t&&"toJSON"in s)return a(s.toJSON());const d=[],h=i([l,d],s);for(const f of Qu(s))(e||!Dn(Xt(s[f])))&&d.push([a(f),a(s[f])]);return h}case 3:return i([l,s.toISOString()],s);case 4:{const{source:d,flags:h}=s;return i([l,{source:d,flags:h}],s)}case 5:{const d=[],h=i([l,d],s);for(const[f,p]of s)(e||!(Dn(Xt(f))||Dn(Xt(p))))&&d.push([a(f),a(p)]);return h}case 6:{const d=[],h=i([l,d],s);for(const f of s)(e||!Dn(Xt(f)))&&d.push(a(f));return h}}const{message:u}=s;return i([l,{name:o,message:u}],s)};return a},ta=(e,{json:t,lossy:n}={})=>{const r=[];return Ku(!(t||n),!!t,new Map,r)(e),r},yt=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ea(ta(e,t)):structuredClone(e):(e,t)=>ea(ta(e,t));var An=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};An.prototype.normal={};An.prototype.property={};An.prototype.space=void 0;function Ks(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new An(n,r,t)}function gn(e){return e.toLowerCase()}var Re=class{constructor(e,t){this.attribute=t,this.property=e}};Re.prototype.attribute="";Re.prototype.booleanish=!1;Re.prototype.boolean=!1;Re.prototype.commaOrSpaceSeparated=!1;Re.prototype.commaSeparated=!1;Re.prototype.defined=!1;Re.prototype.mustUseProperty=!1;Re.prototype.number=!1;Re.prototype.overloadedBoolean=!1;Re.prototype.property="";Re.prototype.spaceSeparated=!1;Re.prototype.space=void 0;var $r=pi({boolean:()=>Z,booleanish:()=>be,commaOrSpaceSeparated:()=>Me,commaSeparated:()=>Bt,number:()=>F,overloadedBoolean:()=>Yr,spaceSeparated:()=>ue}),Xu=0,Z=Nt(),be=Nt(),Yr=Nt(),F=Nt(),ue=Nt(),Bt=Nt(),Me=Nt();function Nt(){return 2**++Xu}var br=Object.keys($r),gi=class extends Re{constructor(e,t,n,r){let i=-1;if(super(e,t),na(this,"space",r),typeof n=="number")for(;++i<br.length;){const a=br[i];na(this,br[i],(n&$r[a])===$r[a])}}};gi.prototype.defined=!0;function na(e,t,n){n&&(e[t]=n)}function zt(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new gi(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[gn(r)]=r,n[gn(a.attribute)]=r}return new An(t,n,e.space)}var Xs=zt({properties:{ariaActiveDescendant:null,ariaAtomic:be,ariaAutoComplete:null,ariaBusy:be,ariaChecked:be,ariaColCount:F,ariaColIndex:F,ariaColSpan:F,ariaControls:ue,ariaCurrent:null,ariaDescribedBy:ue,ariaDetails:null,ariaDisabled:be,ariaDropEffect:ue,ariaErrorMessage:null,ariaExpanded:be,ariaFlowTo:ue,ariaGrabbed:be,ariaHasPopup:null,ariaHidden:be,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ue,ariaLevel:F,ariaLive:null,ariaModal:be,ariaMultiLine:be,ariaMultiSelectable:be,ariaOrientation:null,ariaOwns:ue,ariaPlaceholder:null,ariaPosInSet:F,ariaPressed:be,ariaReadOnly:be,ariaRelevant:null,ariaRequired:be,ariaRoleDescription:ue,ariaRowCount:F,ariaRowIndex:F,ariaRowSpan:F,ariaSelected:be,ariaSetSize:F,ariaSort:null,ariaValueMax:F,ariaValueMin:F,ariaValueNow:F,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Zs(e,t){return t in e?e[t]:t}function Js(e,t){return Zs(e,t.toLowerCase())}var Zu=zt({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Bt,acceptCharset:ue,accessKey:ue,action:null,allow:null,allowFullScreen:Z,allowPaymentRequest:Z,allowUserMedia:Z,alt:null,as:null,async:Z,autoCapitalize:null,autoComplete:ue,autoFocus:Z,autoPlay:Z,blocking:ue,capture:null,charSet:null,checked:Z,cite:null,className:ue,cols:F,colSpan:null,content:null,contentEditable:be,controls:Z,controlsList:ue,coords:F|Bt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Z,defer:Z,dir:null,dirName:null,disabled:Z,download:Yr,draggable:be,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Z,formTarget:null,headers:ue,height:F,hidden:Yr,high:F,href:null,hrefLang:null,htmlFor:ue,httpEquiv:ue,id:null,imageSizes:null,imageSrcSet:null,inert:Z,inputMode:null,integrity:null,is:null,isMap:Z,itemId:null,itemProp:ue,itemRef:ue,itemScope:Z,itemType:ue,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Z,low:F,manifest:null,max:null,maxLength:F,media:null,method:null,min:null,minLength:F,multiple:Z,muted:Z,name:null,nonce:null,noModule:Z,noValidate:Z,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:Z,optimum:F,pattern:null,ping:ue,placeholder:null,playsInline:Z,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Z,referrerPolicy:null,rel:ue,required:Z,reversed:Z,rows:F,rowSpan:F,sandbox:ue,scope:null,scoped:Z,seamless:Z,selected:Z,shadowRootClonable:Z,shadowRootDelegatesFocus:Z,shadowRootMode:null,shape:null,size:F,sizes:null,slot:null,span:F,spellCheck:be,src:null,srcDoc:null,srcLang:null,srcSet:null,start:F,step:null,style:null,tabIndex:F,target:null,title:null,translate:null,type:null,typeMustMatch:Z,useMap:null,value:be,width:F,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ue,axis:null,background:null,bgColor:null,border:F,borderColor:null,bottomMargin:F,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Z,declare:Z,event:null,face:null,frame:null,frameBorder:null,hSpace:F,leftMargin:F,link:null,longDesc:null,lowSrc:null,marginHeight:F,marginWidth:F,noResize:Z,noHref:Z,noShade:Z,noWrap:Z,object:null,profile:null,prompt:null,rev:null,rightMargin:F,rules:null,scheme:null,scrolling:be,standby:null,summary:null,text:null,topMargin:F,valueType:null,version:null,vAlign:null,vLink:null,vSpace:F,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Z,disableRemotePlayback:Z,prefix:null,property:null,results:F,security:null,unselectable:null},space:"html",transform:Js}),Ju=zt({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:Me,accentHeight:F,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:F,amplitude:F,arabicForm:null,ascent:F,attributeName:null,attributeType:null,azimuth:F,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:F,by:null,calcMode:null,capHeight:F,className:ue,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:F,diffuseConstant:F,direction:null,display:null,dur:null,divisor:F,dominantBaseline:null,download:Z,dx:null,dy:null,edgeMode:null,editable:null,elevation:F,enableBackground:null,end:null,event:null,exponent:F,externalResourcesRequired:null,fill:null,fillOpacity:F,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:Bt,g2:Bt,glyphName:Bt,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:F,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:F,horizOriginX:F,horizOriginY:F,id:null,ideographic:F,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:F,k:F,k1:F,k2:F,k3:F,k4:F,kernelMatrix:Me,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:F,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:F,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:F,overlineThickness:F,paintOrder:null,panose1:null,path:null,pathLength:F,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ue,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:F,pointsAtY:F,pointsAtZ:F,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Me,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Me,rev:Me,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Me,requiredFeatures:Me,requiredFonts:Me,requiredFormats:Me,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:F,specularExponent:F,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:F,strikethroughThickness:F,string:null,stroke:null,strokeDashArray:Me,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:F,strokeOpacity:F,strokeWidth:null,style:null,surfaceScale:F,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Me,tabIndex:F,tableValues:null,target:null,targetX:F,targetY:F,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Me,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:F,underlineThickness:F,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:F,values:null,vAlphabetic:F,vMathematical:F,vectorEffect:null,vHanging:F,vIdeographic:F,version:null,vertAdvY:F,vertOriginX:F,vertOriginY:F,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:F,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Zs}),eo=zt({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),to=zt({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Js}),no=zt({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),eh={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"},th=/[A-Z]/g,ra=/-[a-z]/g,nh=/^data[-\w.:]+$/i;function ar(e,t){const n=gn(t);let r=t,i=Re;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&nh.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(ra,ih);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!ra.test(a)){let s=a.replace(th,rh);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=gi}return new i(r,t)}function rh(e){return"-"+e.toLowerCase()}function ih(e){return e.charAt(1).toUpperCase()}var _n=Ks([Xs,Zu,eo,to,no],"html"),pt=Ks([Xs,Ju,eo,to,no],"svg");function ia(e){const t=[],n=String(e||"");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)&&t.push(s),i=r+1,r=n.indexOf(",",i)}return t}function ro(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}var aa=/[#.]/g;function ah(e,t){const n=e||"",r={};let i=0,a,s;for(;i<n.length;){aa.lastIndex=i;const l=aa.exec(n),o=n.slice(i,l?l.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),l&&(a=l[0],i++)}return{type:"element",tagName:s||t||"div",properties:r,children:[]}}function sa(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function io(e){return e.join(" ").trim()}function ao(e,t,n){const r=n?ch(n):void 0;function i(a,s,...l){let o;if(a==null){o={type:"root",children:[]};const u=s;l.unshift(u)}else{o=ah(a,t);const u=o.tagName.toLowerCase(),d=r?r.get(u):void 0;if(o.tagName=d||u,sh(s))l.unshift(s);else for(const[h,f]of Object.entries(s))oh(e,o.properties,h,f)}for(const u of l)qr(o.children,u);return o.type==="element"&&o.tagName==="template"&&(o.content={type:"root",children:o.children},o.children=[]),o}return i}function sh(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const i=t[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 e&&Array.isArray(e.children))}function oh(e,t,n,r){const i=ar(e,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=sa(r):i.commaSeparated?a=ia(r):i.commaOrSpaceSeparated?a=sa(ia(r).join(" ")):a=oa(i,i.property,r):Array.isArray(r)?a=[...r]:a=i.property==="style"?lh(r):String(r);if(Array.isArray(a)){const s=[];for(const l of a)s.push(oa(i,i.property,l));a=s}i.property==="className"&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function qr(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)qr(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?qr(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function oa(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||gn(n)===gn(t)))return!0}return n}function lh(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function ch(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}var uh=["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"],hh=ao(_n,"div"),dh=ao(pt,"g",uh);function fh(e){const t=String(e),n=[];return{toOffset:i,toPoint:r};function r(a){if(typeof a=="number"&&a>-1&&a<=t.length){let s=0;for(;;){let l=n[s];if(l===void 0){const o=la(t,n[s-1]);l=o===-1?t.length+1:o+1,n[s]=l}if(l>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 l=n[n.length-1],o=la(t,l),u=o===-1?t.length+1:o+1;if(l===u)break;n.push(u)}const s=(a.line>1?n[a.line-2]:0)+a.column-1;if(s<n[a.line-1])return s}}}function la(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
3
3
  `,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}var _t={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/"},so={}.hasOwnProperty,ph=Object.prototype;function mh(e,t){const n=t||{};return Ei({file:n.file||void 0,location:!1,schema:n.space==="svg"?pt:_n,verbose:n.verbose||!1},e)}function Ei(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},zn(e,r,n),n}case"#document":case"#document-fragment":{const r=t,i="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:oo(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){const a=String(e.file),s=fh(a),l=s.toPoint(0),o=s.toPoint(a.length);n.position={start:l,end:o}}return n}case"#documentType":{const r=t;return n={type:"doctype"},zn(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},zn(e,r,n),n}default:return n=gh(e,t),n}}function oo(e,t){let n=-1;const r=[];for(;++n<t.length;){const i=Ei(e,t[n]);r.push(i)}return r}function gh(e,t){const n=e.schema;e.schema=t.namespaceURI===_t.svg?pt:_n;let r=-1;const i={};for(;++r<t.attrs.length;){const s=t.attrs[r],l=(s.prefix?s.prefix+":":"")+s.name;so.call(ph,l)||(i[l]=s.value)}const a=(e.schema.space==="svg"?dh:hh)(t.tagName,i,oo(e,t.childNodes));if(zn(e,t,a),a.tagName==="template"){const s=t,l=s.sourceCodeLocation,o=l&&l.startTag&&Mt(l.startTag),u=l&&l.endTag&&Mt(l.endTag),d=Ei(e,s.content);o&&u&&e.file&&(d.position={start:o.end,end:u.start}),a.content=d}return e.schema=n,a}function zn(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=Eh(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function Eh(e,t,n){const r=Mt(n);if(t.type==="element"){const i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){const a={};let s;if(n.attrs)for(s in n.attrs)so.call(n.attrs,s)&&(a[ar(e.schema,s).property]=Mt(n.attrs[s]));n.startTag;const l=Mt(n.startTag),o=n.endTag?Mt(n.endTag):void 0,u={opening:l};o&&(u.closing=o),u.properties=a,t.data={position:u}}}return r}function Mt(e){const t=ca({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=ca({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function ca(e){return e.line&&e.column?e:void 0}var ua={}.hasOwnProperty;function lo(e,t){const n=t||{};function r(i,...a){let s=r.invalid;const l=r.handlers;if(i&&ua.call(i,e)){const o=String(i[e]);s=ua.call(l,o)?l[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}var Th={},bh={}.hasOwnProperty,co=lo("type",{handlers:{root:Ah,element:Sh,text:yh,comment:Ch,doctype:xh}});function kh(e,t){const n=(t||Th).space;return co(e,n==="svg"?pt:_n)}function Ah(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=Ti(e.children,n,t),$t(e,n),n}function _h(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=Ti(e.children,n,t),$t(e,n),n}function xh(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return $t(e,t),t}function yh(e){const t={nodeName:"#text",value:e.value,parentNode:null};return $t(e,t),t}function Ch(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return $t(e,t),t}function Sh(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=pt);const i=[];let a;if(e.properties){for(a in e.properties)if(a!=="children"&&bh.call(e.properties,a)){const o=Nh(r,a,e.properties[a]);o&&i.push(o)}}const s=r.space,l={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:_t[s],childNodes:[],parentNode:null};return l.childNodes=Ti(e.children,l,r),$t(e,l),e.tagName==="template"&&e.content&&(l.content=_h(e.content,r)),l}function Nh(e,t,n){const r=ar(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?ro(n):io(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=_t[r.space]}return i}function Ti(e,t,n){let r=-1;const i=[];if(e)for(;++r<e.length;){const a=co(e[r],n);a.parentNode=t,i.push(a)}return i}function $t(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.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})}var Ih=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],vh=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]);var g;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(g||(g={}));var we={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function uo(e){return e>=55296&&e<=57343}function wh(e){return e>=56320&&e<=57343}function Lh(e,t){return(e-55296)*1024+9216+t}function ho(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function fo(e){return e>=64976&&e<=65007||vh.has(e)}var L;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(L||(L={}));var Rh=65536,Oh=class{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=Rh,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,t){const{line:n,col:r,offset:i}=this,a=r+t,s=i+t;return{code:e,startLine:n,endLine:n,startCol:a,endCol:a,startOffset:s,endOffset:s}}_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 t=this.html.charCodeAt(this.pos+1);if(wh(t))return this.pos++,this._addGap(),Lh(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,g.EOF;return this._err(L.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,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let n=0;n<e.length;n++)if((this.html.charCodeAt(this.pos+n)|32)!==e.charCodeAt(n))return!1;return!0}peek(e){const t=this.pos+e;if(t>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,g.EOF;const n=this.html.charCodeAt(t);return n===g.CARRIAGE_RETURN?g.LINE_FEED:n}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,g.EOF;let e=this.html.charCodeAt(this.pos);return e===g.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,g.LINE_FEED):e===g.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,uo(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===g.LINE_FEED||e===g.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){ho(e)?this._err(L.controlCharacterInInputStream):fo(e)&&this._err(L.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}},ee;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(ee||(ee={}));function po(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}var Dh=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(e=>e.charCodeAt(0))),kr,Ph=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]]),$x=(kr=String.fromCodePoint)!==null&&kr!==void 0?kr:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function Mh(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=Ph.get(e))!==null&&t!==void 0?t:e}var Ae;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Ae||(Ae={}));var Bh=32,ht;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(ht||(ht={}));function Vr(e){return e>=Ae.ZERO&&e<=Ae.NINE}function Fh(e){return e>=Ae.UPPER_A&&e<=Ae.UPPER_F||e>=Ae.LOWER_A&&e<=Ae.LOWER_F}function Hh(e){return e>=Ae.UPPER_A&&e<=Ae.UPPER_Z||e>=Ae.LOWER_A&&e<=Ae.LOWER_Z||Vr(e)}function Uh(e){return e===Ae.EQUALS||Hh(e)}var ke;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(ke||(ke={}));var rt;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(rt||(rt={}));var jh=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=ke.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=rt.Strict}startEntity(e){this.decodeMode=e,this.state=ke.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case ke.EntityStart:return e.charCodeAt(t)===Ae.NUM?(this.state=ke.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=ke.NamedEntity,this.stateNamedEntity(e,t));case ke.NumericStart:return this.stateNumericStart(e,t);case ke.NumericDecimal:return this.stateNumericDecimal(e,t);case ke.NumericHex:return this.stateNumericHex(e,t);case ke.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|Bh)===Ae.LOWER_X?(this.state=ke.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=ke.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){const i=n-t;this.result=this.result*Math.pow(r,i)+Number.parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){const n=t;for(;t<e.length;){const r=e.charCodeAt(t);if(Vr(r)||Fh(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){const n=t;for(;t<e.length;){const r=e.charCodeAt(t);if(Vr(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)===null||n===void 0||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Ae.SEMI)this.consumed+=1;else if(this.decodeMode===rt.Strict)return 0;return this.emitCodePoint(Mh(this.result),this.consumed),this.errors&&(e!==Ae.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:n}=this;let r=n[this.treeIndex],i=(r&ht.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const a=e.charCodeAt(t);if(this.treeIndex=zh(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===rt.Attribute&&(i===0||Uh(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&ht.VALUE_LENGTH)>>14,i!==0){if(a===Ae.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==rt.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:n}=this,r=(n[t]&ht.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~ht.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case ke.NamedEntity:return this.result!==0&&(this.decodeMode!==rt.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ke.NumericDecimal:return this.emitNumericEntity(0,2);case ke.NumericHex:return this.emitNumericEntity(0,3);case ke.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ke.EntityStart:return 0}}};function zh(e,t,n,r){const i=(t&ht.BRANCH_LENGTH)>>7,a=t&ht.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){const o=r-a;return o<0||o>=i?-1:e[n+o]-1}let s=n,l=s+i-1;for(;s<=l;){const o=s+l>>>1,u=e[o];if(u<r)s=o+1;else if(u>r)l=o-1;else return e[o+i]}return-1}var M;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(M||(M={}));var xt;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(xt||(xt={}));var Ue;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Ue||(Ue={}));var v;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(v||(v={}));var c;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(c||(c={}));var $h=new Map([[v.A,c.A],[v.ADDRESS,c.ADDRESS],[v.ANNOTATION_XML,c.ANNOTATION_XML],[v.APPLET,c.APPLET],[v.AREA,c.AREA],[v.ARTICLE,c.ARTICLE],[v.ASIDE,c.ASIDE],[v.B,c.B],[v.BASE,c.BASE],[v.BASEFONT,c.BASEFONT],[v.BGSOUND,c.BGSOUND],[v.BIG,c.BIG],[v.BLOCKQUOTE,c.BLOCKQUOTE],[v.BODY,c.BODY],[v.BR,c.BR],[v.BUTTON,c.BUTTON],[v.CAPTION,c.CAPTION],[v.CENTER,c.CENTER],[v.CODE,c.CODE],[v.COL,c.COL],[v.COLGROUP,c.COLGROUP],[v.DD,c.DD],[v.DESC,c.DESC],[v.DETAILS,c.DETAILS],[v.DIALOG,c.DIALOG],[v.DIR,c.DIR],[v.DIV,c.DIV],[v.DL,c.DL],[v.DT,c.DT],[v.EM,c.EM],[v.EMBED,c.EMBED],[v.FIELDSET,c.FIELDSET],[v.FIGCAPTION,c.FIGCAPTION],[v.FIGURE,c.FIGURE],[v.FONT,c.FONT],[v.FOOTER,c.FOOTER],[v.FOREIGN_OBJECT,c.FOREIGN_OBJECT],[v.FORM,c.FORM],[v.FRAME,c.FRAME],[v.FRAMESET,c.FRAMESET],[v.H1,c.H1],[v.H2,c.H2],[v.H3,c.H3],[v.H4,c.H4],[v.H5,c.H5],[v.H6,c.H6],[v.HEAD,c.HEAD],[v.HEADER,c.HEADER],[v.HGROUP,c.HGROUP],[v.HR,c.HR],[v.HTML,c.HTML],[v.I,c.I],[v.IMG,c.IMG],[v.IMAGE,c.IMAGE],[v.INPUT,c.INPUT],[v.IFRAME,c.IFRAME],[v.KEYGEN,c.KEYGEN],[v.LABEL,c.LABEL],[v.LI,c.LI],[v.LINK,c.LINK],[v.LISTING,c.LISTING],[v.MAIN,c.MAIN],[v.MALIGNMARK,c.MALIGNMARK],[v.MARQUEE,c.MARQUEE],[v.MATH,c.MATH],[v.MENU,c.MENU],[v.META,c.META],[v.MGLYPH,c.MGLYPH],[v.MI,c.MI],[v.MO,c.MO],[v.MN,c.MN],[v.MS,c.MS],[v.MTEXT,c.MTEXT],[v.NAV,c.NAV],[v.NOBR,c.NOBR],[v.NOFRAMES,c.NOFRAMES],[v.NOEMBED,c.NOEMBED],[v.NOSCRIPT,c.NOSCRIPT],[v.OBJECT,c.OBJECT],[v.OL,c.OL],[v.OPTGROUP,c.OPTGROUP],[v.OPTION,c.OPTION],[v.P,c.P],[v.PARAM,c.PARAM],[v.PLAINTEXT,c.PLAINTEXT],[v.PRE,c.PRE],[v.RB,c.RB],[v.RP,c.RP],[v.RT,c.RT],[v.RTC,c.RTC],[v.RUBY,c.RUBY],[v.S,c.S],[v.SCRIPT,c.SCRIPT],[v.SEARCH,c.SEARCH],[v.SECTION,c.SECTION],[v.SELECT,c.SELECT],[v.SOURCE,c.SOURCE],[v.SMALL,c.SMALL],[v.SPAN,c.SPAN],[v.STRIKE,c.STRIKE],[v.STRONG,c.STRONG],[v.STYLE,c.STYLE],[v.SUB,c.SUB],[v.SUMMARY,c.SUMMARY],[v.SUP,c.SUP],[v.TABLE,c.TABLE],[v.TBODY,c.TBODY],[v.TEMPLATE,c.TEMPLATE],[v.TEXTAREA,c.TEXTAREA],[v.TFOOT,c.TFOOT],[v.TD,c.TD],[v.TH,c.TH],[v.THEAD,c.THEAD],[v.TITLE,c.TITLE],[v.TR,c.TR],[v.TRACK,c.TRACK],[v.TT,c.TT],[v.U,c.U],[v.UL,c.UL],[v.SVG,c.SVG],[v.VAR,c.VAR],[v.WBR,c.WBR],[v.XMP,c.XMP]]);function Yt(e){var t;return(t=$h.get(e))!==null&&t!==void 0?t:c.UNKNOWN}var B=c,Yh={[M.HTML]:new Set([B.ADDRESS,B.APPLET,B.AREA,B.ARTICLE,B.ASIDE,B.BASE,B.BASEFONT,B.BGSOUND,B.BLOCKQUOTE,B.BODY,B.BR,B.BUTTON,B.CAPTION,B.CENTER,B.COL,B.COLGROUP,B.DD,B.DETAILS,B.DIR,B.DIV,B.DL,B.DT,B.EMBED,B.FIELDSET,B.FIGCAPTION,B.FIGURE,B.FOOTER,B.FORM,B.FRAME,B.FRAMESET,B.H1,B.H2,B.H3,B.H4,B.H5,B.H6,B.HEAD,B.HEADER,B.HGROUP,B.HR,B.HTML,B.IFRAME,B.IMG,B.INPUT,B.LI,B.LINK,B.LISTING,B.MAIN,B.MARQUEE,B.MENU,B.META,B.NAV,B.NOEMBED,B.NOFRAMES,B.NOSCRIPT,B.OBJECT,B.OL,B.P,B.PARAM,B.PLAINTEXT,B.PRE,B.SCRIPT,B.SECTION,B.SELECT,B.SOURCE,B.STYLE,B.SUMMARY,B.TABLE,B.TBODY,B.TD,B.TEMPLATE,B.TEXTAREA,B.TFOOT,B.TH,B.THEAD,B.TITLE,B.TR,B.TRACK,B.UL,B.WBR,B.XMP]),[M.MATHML]:new Set([B.MI,B.MO,B.MN,B.MS,B.MTEXT,B.ANNOTATION_XML]),[M.SVG]:new Set([B.TITLE,B.FOREIGN_OBJECT,B.DESC]),[M.XLINK]:new Set,[M.XML]:new Set,[M.XMLNS]:new Set},Wr=new Set([B.H1,B.H2,B.H3,B.H4,B.H5,B.H6]),Yx=new Set([v.STYLE,v.SCRIPT,v.XMP,v.IFRAME,v.NOEMBED,v.NOFRAMES,v.PLAINTEXT]),T;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(T||(T={}));var Te={DATA:T.DATA,RCDATA:T.RCDATA,RAWTEXT:T.RAWTEXT,SCRIPT_DATA:T.SCRIPT_DATA,PLAINTEXT:T.PLAINTEXT,CDATA_SECTION:T.CDATA_SECTION};function qh(e){return e>=g.DIGIT_0&&e<=g.DIGIT_9}function an(e){return e>=g.LATIN_CAPITAL_A&&e<=g.LATIN_CAPITAL_Z}function Vh(e){return e>=g.LATIN_SMALL_A&&e<=g.LATIN_SMALL_Z}function lt(e){return Vh(e)||an(e)}function ha(e){return lt(e)||qh(e)}function Pn(e){return e+32}function mo(e){return e===g.SPACE||e===g.LINE_FEED||e===g.TABULATION||e===g.FORM_FEED}function da(e){return mo(e)||e===g.SOLIDUS||e===g.GREATER_THAN_SIGN}function Wh(e){return e===g.NULL?L.nullCharacterReference:e>1114111?L.characterReferenceOutsideUnicodeRange:uo(e)?L.surrogateCharacterReference:fo(e)?L.noncharacterCharacterReference:ho(e)||e===g.CARRIAGE_RETURN?L.controlCharacterReference:null}var Gh=class{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=T.DATA,this.returnState=T.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new Oh(t),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new jh(Dh,(n,r)=>{this.preprocessor.pos=this.entityStartPos+r-1,this._flushCodePointConsumedAsCharacterReference(n)},t.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(L.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:n=>{this._err(L.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+n)},validateNumericCharacterReference:n=>{const r=Wh(n);r&&this._err(r,1)}}:void 0)}_err(e,t=0){var n,r;(r=(n=this.handler).onParseError)===null||r===void 0||r.call(n,this.preprocessor.getError(e,t))}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,t,n){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||n?.()}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 t=0;t<e;t++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,t){return this.preprocessor.startsWith(e,t)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:ee.START_TAG,tagName:"",tagID:c.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:ee.END_TAG,tagName:"",tagID:c.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:ee.COMMENT,data:"",location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:ee.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e,t;const n=this.currentToken;if(po(n,this.currentAttr.name)===null){if(n.attrs.push(this.currentAttr),n.location&&this.currentLocation){const r=(e=(t=n.location).attrs)!==null&&e!==void 0?e:t.attrs=Object.create(null);r[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(L.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=Yt(e.tagName),e.type===ee.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(L.endTagWithAttributes),e.selfClosing&&this._err(L.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 ee.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case ee.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case ee.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken)}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:ee.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=t;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,t)}_emitCodePoint(e){const t=mo(e)?ee.WHITESPACE_CHARACTER:e===g.NULL?ee.NULL_CHARACTER:ee.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(ee.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=T.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?rt.Attribute:rt.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===T.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===T.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===T.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case T.DATA:this._stateData(e);break;case T.RCDATA:this._stateRcdata(e);break;case T.RAWTEXT:this._stateRawtext(e);break;case T.SCRIPT_DATA:this._stateScriptData(e);break;case T.PLAINTEXT:this._statePlaintext(e);break;case T.TAG_OPEN:this._stateTagOpen(e);break;case T.END_TAG_OPEN:this._stateEndTagOpen(e);break;case T.TAG_NAME:this._stateTagName(e);break;case T.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(e);break;case T.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(e);break;case T.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(e);break;case T.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(e);break;case T.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(e);break;case T.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(e);break;case T.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(e);break;case T.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(e);break;case T.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(e);break;case T.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(e);break;case T.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(e);break;case T.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(e);break;case T.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(e);break;case T.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(e);break;case T.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(e);break;case T.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(e);break;case T.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(e);break;case T.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(e);break;case T.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(e);break;case T.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(e);break;case T.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(e);break;case T.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(e);break;case T.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(e);break;case T.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(e);break;case T.ATTRIBUTE_NAME:this._stateAttributeName(e);break;case T.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(e);break;case T.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(e);break;case T.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(e);break;case T.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(e);break;case T.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(e);break;case T.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(e);break;case T.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(e);break;case T.BOGUS_COMMENT:this._stateBogusComment(e);break;case T.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(e);break;case T.COMMENT_START:this._stateCommentStart(e);break;case T.COMMENT_START_DASH:this._stateCommentStartDash(e);break;case T.COMMENT:this._stateComment(e);break;case T.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(e);break;case T.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(e);break;case T.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(e);break;case T.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(e);break;case T.COMMENT_END_DASH:this._stateCommentEndDash(e);break;case T.COMMENT_END:this._stateCommentEnd(e);break;case T.COMMENT_END_BANG:this._stateCommentEndBang(e);break;case T.DOCTYPE:this._stateDoctype(e);break;case T.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(e);break;case T.DOCTYPE_NAME:this._stateDoctypeName(e);break;case T.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(e);break;case T.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(e);break;case T.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(e);break;case T.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(e);break;case T.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(e);break;case T.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(e);break;case T.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break;case T.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(e);break;case T.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(e);break;case T.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(e);break;case T.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(e);break;case T.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(e);break;case T.BOGUS_DOCTYPE:this._stateBogusDoctype(e);break;case T.CDATA_SECTION:this._stateCdataSection(e);break;case T.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(e);break;case T.CDATA_SECTION_END:this._stateCdataSectionEnd(e);break;case T.CHARACTER_REFERENCE:this._stateCharacterReference();break;case T.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(e);break;default:throw new Error("Unknown state")}}_stateData(e){switch(e){case g.LESS_THAN_SIGN:this.state=T.TAG_OPEN;break;case g.AMPERSAND:this._startCharacterReference();break;case g.NULL:this._err(L.unexpectedNullCharacter),this._emitCodePoint(e);break;case g.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case g.AMPERSAND:this._startCharacterReference();break;case g.LESS_THAN_SIGN:this.state=T.RCDATA_LESS_THAN_SIGN;break;case g.NULL:this._err(L.unexpectedNullCharacter),this._emitChars("�");break;case g.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case g.LESS_THAN_SIGN:this.state=T.RAWTEXT_LESS_THAN_SIGN;break;case g.NULL:this._err(L.unexpectedNullCharacter),this._emitChars("�");break;case g.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case g.LESS_THAN_SIGN:this.state=T.SCRIPT_DATA_LESS_THAN_SIGN;break;case g.NULL:this._err(L.unexpectedNullCharacter),this._emitChars("�");break;case g.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case g.NULL:this._err(L.unexpectedNullCharacter),this._emitChars("�");break;case g.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateTagOpen(e){if(lt(e))this._createStartTagToken(),this.state=T.TAG_NAME,this._stateTagName(e);else switch(e){case g.EXCLAMATION_MARK:this.state=T.MARKUP_DECLARATION_OPEN;break;case g.SOLIDUS:this.state=T.END_TAG_OPEN;break;case g.QUESTION_MARK:this._err(L.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=T.BOGUS_COMMENT,this._stateBogusComment(e);break;case g.EOF:this._err(L.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break;default:this._err(L.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=T.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(lt(e))this._createEndTagToken(),this.state=T.TAG_NAME,this._stateTagName(e);else switch(e){case g.GREATER_THAN_SIGN:this._err(L.missingEndTagName),this.state=T.DATA;break;case g.EOF:this._err(L.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break;default:this._err(L.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=T.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const t=this.currentToken;switch(e){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:this.state=T.BEFORE_ATTRIBUTE_NAME;break;case g.SOLIDUS:this.state=T.SELF_CLOSING_START_TAG;break;case g.GREATER_THAN_SIGN:this.state=T.DATA,this.emitCurrentTagToken();break;case g.NULL:this._err(L.unexpectedNullCharacter),t.tagName+="�";break;case g.EOF:this._err(L.eofInTag),this._emitEOFToken();break;default:t.tagName+=String.fromCodePoint(an(e)?Pn(e):e)}}_stateRcdataLessThanSign(e){e===g.SOLIDUS?this.state=T.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=T.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){lt(e)?(this.state=T.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=T.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const t=this.currentToken;switch(t.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=T.BEFORE_ATTRIBUTE_NAME,!1;case g.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=T.SELF_CLOSING_START_TAG,!1;case g.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=T.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=T.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===g.SOLIDUS?this.state=T.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=T.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){lt(e)?(this.state=T.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=T.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=T.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case g.SOLIDUS:this.state=T.SCRIPT_DATA_END_TAG_OPEN;break;case g.EXCLAMATION_MARK:this.state=T.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break;default:this._emitChars("<"),this.state=T.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){lt(e)?(this.state=T.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=T.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=T.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===g.HYPHEN_MINUS?(this.state=T.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=T.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===g.HYPHEN_MINUS?(this.state=T.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=T.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case g.HYPHEN_MINUS:this.state=T.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break;case g.LESS_THAN_SIGN:this.state=T.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case g.NULL:this._err(L.unexpectedNullCharacter),this._emitChars("�");break;case g.EOF:this._err(L.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case g.HYPHEN_MINUS:this.state=T.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break;case g.LESS_THAN_SIGN:this.state=T.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case g.NULL:this._err(L.unexpectedNullCharacter),this.state=T.SCRIPT_DATA_ESCAPED,this._emitChars("�");break;case g.EOF:this._err(L.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=T.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case g.HYPHEN_MINUS:this._emitChars("-");break;case g.LESS_THAN_SIGN:this.state=T.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case g.GREATER_THAN_SIGN:this.state=T.SCRIPT_DATA,this._emitChars(">");break;case g.NULL:this._err(L.unexpectedNullCharacter),this.state=T.SCRIPT_DATA_ESCAPED,this._emitChars("�");break;case g.EOF:this._err(L.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=T.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===g.SOLIDUS?this.state=T.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:lt(e)?(this._emitChars("<"),this.state=T.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=T.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){lt(e)?(this.state=T.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=T.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=T.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(we.SCRIPT,!1)&&da(this.preprocessor.peek(we.SCRIPT.length))){this._emitCodePoint(e);for(let t=0;t<we.SCRIPT.length;t++)this._emitCodePoint(this._consume());this.state=T.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=T.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case g.HYPHEN_MINUS:this.state=T.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break;case g.LESS_THAN_SIGN:this.state=T.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break;case g.NULL:this._err(L.unexpectedNullCharacter),this._emitChars("�");break;case g.EOF:this._err(L.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case g.HYPHEN_MINUS:this.state=T.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break;case g.LESS_THAN_SIGN:this.state=T.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break;case g.NULL:this._err(L.unexpectedNullCharacter),this.state=T.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars("�");break;case g.EOF:this._err(L.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=T.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case g.HYPHEN_MINUS:this._emitChars("-");break;case g.LESS_THAN_SIGN:this.state=T.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break;case g.GREATER_THAN_SIGN:this.state=T.SCRIPT_DATA,this._emitChars(">");break;case g.NULL:this._err(L.unexpectedNullCharacter),this.state=T.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars("�");break;case g.EOF:this._err(L.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=T.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===g.SOLIDUS?(this.state=T.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=T.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(we.SCRIPT,!1)&&da(this.preprocessor.peek(we.SCRIPT.length))){this._emitCodePoint(e);for(let t=0;t<we.SCRIPT.length;t++)this._emitCodePoint(this._consume());this.state=T.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=T.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.SOLIDUS:case g.GREATER_THAN_SIGN:case g.EOF:this.state=T.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case g.EQUALS_SIGN:this._err(L.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=T.ATTRIBUTE_NAME;break;default:this._createAttr(""),this.state=T.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:case g.SOLIDUS:case g.GREATER_THAN_SIGN:case g.EOF:this._leaveAttrName(),this.state=T.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case g.EQUALS_SIGN:this._leaveAttrName(),this.state=T.BEFORE_ATTRIBUTE_VALUE;break;case g.QUOTATION_MARK:case g.APOSTROPHE:case g.LESS_THAN_SIGN:this._err(L.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break;case g.NULL:this._err(L.unexpectedNullCharacter),this.currentAttr.name+="�";break;default:this.currentAttr.name+=String.fromCodePoint(an(e)?Pn(e):e)}}_stateAfterAttributeName(e){switch(e){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.SOLIDUS:this.state=T.SELF_CLOSING_START_TAG;break;case g.EQUALS_SIGN:this.state=T.BEFORE_ATTRIBUTE_VALUE;break;case g.GREATER_THAN_SIGN:this.state=T.DATA,this.emitCurrentTagToken();break;case g.EOF:this._err(L.eofInTag),this._emitEOFToken();break;default:this._createAttr(""),this.state=T.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.QUOTATION_MARK:this.state=T.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break;case g.APOSTROPHE:this.state=T.ATTRIBUTE_VALUE_SINGLE_QUOTED;break;case g.GREATER_THAN_SIGN:this._err(L.missingAttributeValue),this.state=T.DATA,this.emitCurrentTagToken();break;default:this.state=T.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case g.QUOTATION_MARK:this.state=T.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case g.AMPERSAND:this._startCharacterReference();break;case g.NULL:this._err(L.unexpectedNullCharacter),this.currentAttr.value+="�";break;case g.EOF:this._err(L.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case g.APOSTROPHE:this.state=T.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case g.AMPERSAND:this._startCharacterReference();break;case g.NULL:this._err(L.unexpectedNullCharacter),this.currentAttr.value+="�";break;case g.EOF:this._err(L.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:this._leaveAttrValue(),this.state=T.BEFORE_ATTRIBUTE_NAME;break;case g.AMPERSAND:this._startCharacterReference();break;case g.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=T.DATA,this.emitCurrentTagToken();break;case g.NULL:this._err(L.unexpectedNullCharacter),this.currentAttr.value+="�";break;case g.QUOTATION_MARK:case g.APOSTROPHE:case g.LESS_THAN_SIGN:case g.EQUALS_SIGN:case g.GRAVE_ACCENT:this._err(L.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break;case g.EOF:this._err(L.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:this._leaveAttrValue(),this.state=T.BEFORE_ATTRIBUTE_NAME;break;case g.SOLIDUS:this._leaveAttrValue(),this.state=T.SELF_CLOSING_START_TAG;break;case g.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=T.DATA,this.emitCurrentTagToken();break;case g.EOF:this._err(L.eofInTag),this._emitEOFToken();break;default:this._err(L.missingWhitespaceBetweenAttributes),this.state=T.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case g.GREATER_THAN_SIGN:{const t=this.currentToken;t.selfClosing=!0,this.state=T.DATA,this.emitCurrentTagToken();break}case g.EOF:this._err(L.eofInTag),this._emitEOFToken();break;default:this._err(L.unexpectedSolidusInTag),this.state=T.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){const t=this.currentToken;switch(e){case g.GREATER_THAN_SIGN:this.state=T.DATA,this.emitCurrentComment(t);break;case g.EOF:this.emitCurrentComment(t),this._emitEOFToken();break;case g.NULL:this._err(L.unexpectedNullCharacter),t.data+="�";break;default:t.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(we.DASH_DASH,!0)?(this._createCommentToken(we.DASH_DASH.length+1),this.state=T.COMMENT_START):this._consumeSequenceIfMatch(we.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(we.DOCTYPE.length+1),this.state=T.DOCTYPE):this._consumeSequenceIfMatch(we.CDATA_START,!0)?this.inForeignNode?this.state=T.CDATA_SECTION:(this._err(L.cdataInHtmlContent),this._createCommentToken(we.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=T.BOGUS_COMMENT):this._ensureHibernation()||(this._err(L.incorrectlyOpenedComment),this._createCommentToken(2),this.state=T.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case g.HYPHEN_MINUS:this.state=T.COMMENT_START_DASH;break;case g.GREATER_THAN_SIGN:{this._err(L.abruptClosingOfEmptyComment),this.state=T.DATA;const t=this.currentToken;this.emitCurrentComment(t);break}default:this.state=T.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){const t=this.currentToken;switch(e){case g.HYPHEN_MINUS:this.state=T.COMMENT_END;break;case g.GREATER_THAN_SIGN:this._err(L.abruptClosingOfEmptyComment),this.state=T.DATA,this.emitCurrentComment(t);break;case g.EOF:this._err(L.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+="-",this.state=T.COMMENT,this._stateComment(e)}}_stateComment(e){const t=this.currentToken;switch(e){case g.HYPHEN_MINUS:this.state=T.COMMENT_END_DASH;break;case g.LESS_THAN_SIGN:t.data+="<",this.state=T.COMMENT_LESS_THAN_SIGN;break;case g.NULL:this._err(L.unexpectedNullCharacter),t.data+="�";break;case g.EOF:this._err(L.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){const t=this.currentToken;switch(e){case g.EXCLAMATION_MARK:t.data+="!",this.state=T.COMMENT_LESS_THAN_SIGN_BANG;break;case g.LESS_THAN_SIGN:t.data+="<";break;default:this.state=T.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===g.HYPHEN_MINUS?this.state=T.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=T.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===g.HYPHEN_MINUS?this.state=T.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=T.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==g.GREATER_THAN_SIGN&&e!==g.EOF&&this._err(L.nestedComment),this.state=T.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){const t=this.currentToken;switch(e){case g.HYPHEN_MINUS:this.state=T.COMMENT_END;break;case g.EOF:this._err(L.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+="-",this.state=T.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){const t=this.currentToken;switch(e){case g.GREATER_THAN_SIGN:this.state=T.DATA,this.emitCurrentComment(t);break;case g.EXCLAMATION_MARK:this.state=T.COMMENT_END_BANG;break;case g.HYPHEN_MINUS:t.data+="-";break;case g.EOF:this._err(L.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+="--",this.state=T.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){const t=this.currentToken;switch(e){case g.HYPHEN_MINUS:t.data+="--!",this.state=T.COMMENT_END_DASH;break;case g.GREATER_THAN_SIGN:this._err(L.incorrectlyClosedComment),this.state=T.DATA,this.emitCurrentComment(t);break;case g.EOF:this._err(L.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+="--!",this.state=T.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:this.state=T.BEFORE_DOCTYPE_NAME;break;case g.GREATER_THAN_SIGN:this.state=T.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break;case g.EOF:{this._err(L.eofInDoctype),this._createDoctypeToken(null);const t=this.currentToken;t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(L.missingWhitespaceBeforeDoctypeName),this.state=T.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(an(e))this._createDoctypeToken(String.fromCharCode(Pn(e))),this.state=T.DOCTYPE_NAME;else switch(e){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.NULL:this._err(L.unexpectedNullCharacter),this._createDoctypeToken("�"),this.state=T.DOCTYPE_NAME;break;case g.GREATER_THAN_SIGN:{this._err(L.missingDoctypeName),this._createDoctypeToken(null);const t=this.currentToken;t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=T.DATA;break}case g.EOF:{this._err(L.eofInDoctype),this._createDoctypeToken(null);const t=this.currentToken;t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=T.DOCTYPE_NAME}}_stateDoctypeName(e){const t=this.currentToken;switch(e){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:this.state=T.AFTER_DOCTYPE_NAME;break;case g.GREATER_THAN_SIGN:this.state=T.DATA,this.emitCurrentDoctype(t);break;case g.NULL:this._err(L.unexpectedNullCharacter),t.name+="�";break;case g.EOF:this._err(L.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.name+=String.fromCodePoint(an(e)?Pn(e):e)}}_stateAfterDoctypeName(e){const t=this.currentToken;switch(e){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.GREATER_THAN_SIGN:this.state=T.DATA,this.emitCurrentDoctype(t);break;case g.EOF:this._err(L.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._consumeSequenceIfMatch(we.PUBLIC,!1)?this.state=T.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(we.SYSTEM,!1)?this.state=T.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(L.invalidCharacterSequenceAfterDoctypeName),t.forceQuirks=!0,this.state=T.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){const t=this.currentToken;switch(e){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:this.state=T.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break;case g.QUOTATION_MARK:this._err(L.missingWhitespaceAfterDoctypePublicKeyword),t.publicId="",this.state=T.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case g.APOSTROPHE:this._err(L.missingWhitespaceAfterDoctypePublicKeyword),t.publicId="",this.state=T.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case g.GREATER_THAN_SIGN:this._err(L.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=T.DATA,this.emitCurrentDoctype(t);break;case g.EOF:this._err(L.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(L.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=T.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){const t=this.currentToken;switch(e){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.QUOTATION_MARK:t.publicId="",this.state=T.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case g.APOSTROPHE:t.publicId="",this.state=T.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case g.GREATER_THAN_SIGN:this._err(L.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=T.DATA,this.emitCurrentDoctype(t);break;case g.EOF:this._err(L.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(L.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=T.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){const t=this.currentToken;switch(e){case g.QUOTATION_MARK:this.state=T.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case g.NULL:this._err(L.unexpectedNullCharacter),t.publicId+="�";break;case g.GREATER_THAN_SIGN:this._err(L.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=T.DATA;break;case g.EOF:this._err(L.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){const t=this.currentToken;switch(e){case g.APOSTROPHE:this.state=T.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case g.NULL:this._err(L.unexpectedNullCharacter),t.publicId+="�";break;case g.GREATER_THAN_SIGN:this._err(L.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=T.DATA;break;case g.EOF:this._err(L.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){const t=this.currentToken;switch(e){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:this.state=T.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break;case g.GREATER_THAN_SIGN:this.state=T.DATA,this.emitCurrentDoctype(t);break;case g.QUOTATION_MARK:this._err(L.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId="",this.state=T.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case g.APOSTROPHE:this._err(L.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId="",this.state=T.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case g.EOF:this._err(L.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(L.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=T.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){const t=this.currentToken;switch(e){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=T.DATA;break;case g.QUOTATION_MARK:t.systemId="",this.state=T.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case g.APOSTROPHE:t.systemId="",this.state=T.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case g.EOF:this._err(L.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(L.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=T.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){const t=this.currentToken;switch(e){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:this.state=T.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break;case g.QUOTATION_MARK:this._err(L.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId="",this.state=T.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case g.APOSTROPHE:this._err(L.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId="",this.state=T.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case g.GREATER_THAN_SIGN:this._err(L.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=T.DATA,this.emitCurrentDoctype(t);break;case g.EOF:this._err(L.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(L.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=T.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){const t=this.currentToken;switch(e){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.QUOTATION_MARK:t.systemId="",this.state=T.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case g.APOSTROPHE:t.systemId="",this.state=T.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case g.GREATER_THAN_SIGN:this._err(L.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=T.DATA,this.emitCurrentDoctype(t);break;case g.EOF:this._err(L.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(L.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=T.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){const t=this.currentToken;switch(e){case g.QUOTATION_MARK:this.state=T.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case g.NULL:this._err(L.unexpectedNullCharacter),t.systemId+="�";break;case g.GREATER_THAN_SIGN:this._err(L.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=T.DATA;break;case g.EOF:this._err(L.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){const t=this.currentToken;switch(e){case g.APOSTROPHE:this.state=T.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case g.NULL:this._err(L.unexpectedNullCharacter),t.systemId+="�";break;case g.GREATER_THAN_SIGN:this._err(L.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=T.DATA;break;case g.EOF:this._err(L.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){const t=this.currentToken;switch(e){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=T.DATA;break;case g.EOF:this._err(L.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(L.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=T.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){const t=this.currentToken;switch(e){case g.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=T.DATA;break;case g.NULL:this._err(L.unexpectedNullCharacter);break;case g.EOF:this.emitCurrentDoctype(t),this._emitEOFToken()}}_stateCdataSection(e){switch(e){case g.RIGHT_SQUARE_BRACKET:this.state=T.CDATA_SECTION_BRACKET;break;case g.EOF:this._err(L.eofInCdata),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===g.RIGHT_SQUARE_BRACKET?this.state=T.CDATA_SECTION_END:(this._emitChars("]"),this.state=T.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case g.GREATER_THAN_SIGN:this.state=T.DATA;break;case g.RIGHT_SQUARE_BRACKET:this._emitChars("]");break;default:this._emitChars("]]"),this.state=T.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(g.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&ha(this.preprocessor.peek(1))?T.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){ha(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===g.SEMICOLON&&this._err(L.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}},go=new Set([c.DD,c.DT,c.LI,c.OPTGROUP,c.OPTION,c.P,c.RB,c.RP,c.RT,c.RTC]),fa=new Set([...go,c.CAPTION,c.COLGROUP,c.TBODY,c.TD,c.TFOOT,c.TH,c.THEAD,c.TR]),Vn=new Set([c.APPLET,c.CAPTION,c.HTML,c.MARQUEE,c.OBJECT,c.TABLE,c.TD,c.TEMPLATE,c.TH]),Qh=new Set([...Vn,c.OL,c.UL]),Kh=new Set([...Vn,c.BUTTON]),pa=new Set([c.ANNOTATION_XML,c.MI,c.MN,c.MO,c.MS,c.MTEXT]),ma=new Set([c.DESC,c.FOREIGN_OBJECT,c.TITLE]),Xh=new Set([c.TR,c.TEMPLATE,c.HTML]),Zh=new Set([c.TBODY,c.TFOOT,c.THEAD,c.TEMPLATE,c.HTML]),Jh=new Set([c.TABLE,c.TEMPLATE,c.HTML]),ed=new Set([c.TD,c.TH]),td=class{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,t,n){this.treeAdapter=t,this.handler=n,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)===M.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,t){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=t,this.currentTagId=t,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,t,!0)}pop(){const e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){const n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&(this.current=t)}insertAfter(e,t,n){const r=this._indexOf(e)+1;this.items.splice(r,0,t),this.tagIDs.splice(r,0,n),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do t=this.tagIDs.lastIndexOf(e,t-1);while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==M.HTML);this.shortenToLength(Math.max(t,0))}shortenToLength(e){for(;this.stackTop>=e;){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop<e)}}popUntilElementPopped(e){const t=this._indexOf(e);this.shortenToLength(Math.max(t,0))}popUntilPopped(e,t){const n=this._indexOfTagNames(e,t);this.shortenToLength(Math.max(n,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(Wr,M.HTML)}popUntilTableCellPopped(){this.popUntilPopped(ed,M.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,t){for(let n=this.stackTop;n>=0;n--)if(e.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===t)return n;return-1}clearBackTo(e,t){const n=this._indexOfTagNames(e,t);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(Jh,M.HTML)}clearBackToTableBodyContext(){this.clearBackTo(Zh,M.HTML)}clearBackToTableRowContext(){this.clearBackTo(Xh,M.HTML)}remove(e){const t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,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 t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===c.HTML}hasInDynamicScope(e,t){for(let n=this.stackTop;n>=0;n--){const r=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case M.HTML:if(r===e)return!0;if(t.has(r))return!1;break;case M.SVG:if(ma.has(r))return!1;break;case M.MATHML:if(pa.has(r))return!1}}return!0}hasInScope(e){return this.hasInDynamicScope(e,Vn)}hasInListItemScope(e){return this.hasInDynamicScope(e,Qh)}hasInButtonScope(e){return this.hasInDynamicScope(e,Kh)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const t=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case M.HTML:if(Wr.has(t))return!0;if(Vn.has(t))return!1;break;case M.SVG:if(ma.has(t))return!1;break;case M.MATHML:if(pa.has(t))return!1}}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===M.HTML)switch(this.tagIDs[t]){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])===M.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 t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===M.HTML)switch(this.tagIDs[t]){case e:return!0;case c.OPTION:case c.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&go.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&fa.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&fa.has(this.currentTagId);)this.pop()}},Ar=3,Ke;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Ke||(Ke={}));var ga={type:Ke.Marker},nd=class{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){const n=[],r=t.length,i=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let s=0;s<this.entries.length;s++){const l=this.entries[s];if(l.type===Ke.Marker)break;const{element:o}=l;if(this.treeAdapter.getTagName(o)===i&&this.treeAdapter.getNamespaceURI(o)===a){const u=this.treeAdapter.getAttrList(o);u.length===r&&n.push({idx:s,attrs:u})}}return n}_ensureNoahArkCondition(e){if(this.entries.length<Ar)return;const t=this.treeAdapter.getAttrList(e),n=this._getNoahArkConditionCandidates(e,t);if(n.length<Ar)return;const r=new Map(t.map(a=>[a.name,a.value]));let i=0;for(let a=0;a<n.length;a++){const s=n[a];s.attrs.every(l=>r.get(l.name)===l.value)&&(i+=1,i>=Ar&&this.entries.splice(s.idx,1))}}insertMarker(){this.entries.unshift(ga)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:Ke.Element,element:e,token:t})}insertElementAfterBookmark(e,t){const n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:Ke.Element,element:e,token:t})}removeEntry(e){const t=this.entries.indexOf(e);t!==-1&&this.entries.splice(t,1)}clearToLastMarker(){const e=this.entries.indexOf(ga);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const t=this.entries.find(n=>n.type===Ke.Marker||this.treeAdapter.getTagName(n.element)===e);return t&&t.type===Ke.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===Ke.Element&&t.element===e)}},ct={createDocument(){return{nodeName:"#document",mode:Ue.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const i=e.childNodes.find(a=>a.nodeName==="#documentType");if(i)i.name=t,i.publicId=n,i.systemId=r;else{const a={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};ct.appendChild(e,a)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(ct.isTextNode(n)){n.value+=t;return}}ct.appendChild(e,ct.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&ct.isTextNode(r)?r.value+=t:ct.insertBefore(e,ct.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},Eo="html",rd="about:legacy-compat",id="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",To=["+//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//"],ad=[...To,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],sd=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),bo=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],od=[...bo,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Ea(e,t){return t.some(n=>e.startsWith(n))}function ld(e){return e.name===Eo&&e.publicId===null&&(e.systemId===null||e.systemId===rd)}function cd(e){if(e.name!==Eo)return Ue.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===id)return Ue.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),sd.has(n))return Ue.QUIRKS;let r=t===null?ad:To;if(Ea(n,r))return Ue.QUIRKS;if(r=t===null?bo:od,Ea(n,r))return Ue.LIMITED_QUIRKS}return Ue.NO_QUIRKS}var Ta={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},ud="definitionurl",hd="definitionURL",dd=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(e=>[e.toLowerCase(),e])),fd=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:M.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:M.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:M.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:M.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:M.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:M.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:M.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:M.XML}],["xml:space",{prefix:"xml",name:"space",namespace:M.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:M.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:M.XMLNS}]]),pd=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(e=>[e.toLowerCase(),e])),md=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 gd(e){const t=e.tagID;return t===c.FONT&&e.attrs.some(({name:n})=>n===xt.COLOR||n===xt.SIZE||n===xt.FACE)||md.has(t)}function ko(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===ud){e.attrs[t].name=hd;break}}function Ao(e){for(let t=0;t<e.attrs.length;t++){const n=dd.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function bi(e){for(let t=0;t<e.attrs.length;t++){const n=fd.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function Ed(e){const t=pd.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Yt(e.tagName))}function Td(e,t){return t===M.MATHML&&(e===c.MI||e===c.MO||e===c.MN||e===c.MS||e===c.MTEXT)}function bd(e,t,n){if(t===M.MATHML&&e===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===Ta.TEXT_HTML||i===Ta.APPLICATION_XML}}return t===M.SVG&&(e===c.FOREIGN_OBJECT||e===c.DESC||e===c.TITLE)}function kd(e,t,n,r){return(!r||r===M.HTML)&&bd(e,t,n)||(!r||r===M.MATHML)&&Td(e,t)}var Ad="hidden",_d=8,xd=3,b;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(b||(b={}));var yd={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},_o=new Set([c.TABLE,c.TBODY,c.TFOOT,c.THEAD,c.TR]),ba={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:ct,onParseError:null},ka=class{constructor(e,t,n=null,r=null){this.fragmentContext=n,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=b.INITIAL,this.originalInsertionMode=b.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={...ba,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=t??this.treeAdapter.createDocument(),this.tokenizer=new Gh(this.options,this),this.activeFormattingElements=new nd(this.treeAdapter),this.fragmentContextID=n?Yt(this.treeAdapter.getTagName(n)):c.UNKNOWN,this._setContextModes(n??this.document,this.fragmentContextID),this.openElements=new td(this.document,this.treeAdapter,this)}static parse(e,t){const n=new this(t);return n.tokenizer.write(e,!0),n.document}static getFragmentParser(e,t){const n={...ba,...t};e!=null||(e=n.treeAdapter.createElement(v.TEMPLATE,M.HTML,[]));const r=n.treeAdapter.createElement("documentmock",M.HTML,[]),i=new this(n,r,e);return i.fragmentContextID===c.TEMPLATE&&i.tmplInsertionModeStack.unshift(b.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){const e=this.treeAdapter.getFirstChild(this.document),t=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,t),t}_err(e,t,n){var r;if(!this.onParseError)return;const i=(r=e.location)!==null&&r!==void 0?r:yd,a={code:t,startLine:i.startLine,startCol:i.startCol,startOffset:i.startOffset,endLine:n?i.startLine:i.endLine,endCol:n?i.startCol:i.endCol,endOffset:n?i.startOffset:i.endOffset};this.onParseError(a)}onItemPush(e,t,n){var r,i;(i=(r=this.treeAdapter).onItemPush)===null||i===void 0||i.call(r,e),n&&this.openElements.stackTop>0&&this._setContextModes(e,t)}onItemPop(e,t){var n,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(r=(n=this.treeAdapter).onItemPop)===null||r===void 0||r.call(n,e,this.openElements.current),t){let i,a;this.openElements.stackTop===0&&this.fragmentContext?(i=this.fragmentContext,a=this.fragmentContextID):{current:i,currentTagId:a}=this.openElements,this._setContextModes(i,a)}}_setContextModes(e,t){const n=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===M.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&e!==void 0&&t!==void 0&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,M.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=b.TEXT}switchToPlaintextParsing(){this.insertionMode=b.TEXT,this.originalInsertionMode=b.IN_BODY,this.tokenizer.state=Te.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)===v.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==M.HTML))switch(this.fragmentContextID){case c.TITLE:case c.TEXTAREA:this.tokenizer.state=Te.RCDATA;break;case c.STYLE:case c.XMP:case c.IFRAME:case c.NOEMBED:case c.NOFRAMES:case c.NOSCRIPT:this.tokenizer.state=Te.RAWTEXT;break;case c.SCRIPT:this.tokenizer.state=Te.SCRIPT_DATA;break;case c.PLAINTEXT:this.tokenizer.state=Te.PLAINTEXT}}_setDocumentType(e){const t=e.name||"",n=e.publicId||"",r=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,t,n,r),e.location){const i=this.treeAdapter.getChildNodes(this.document).find(a=>this.treeAdapter.isDocumentTypeNode(a));i&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){const n=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const n=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(n??this.document,e)}}_appendElement(e,t){const n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,t){const n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,t){const n=this.treeAdapter.createElement(e,M.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,t)}_insertTemplate(e){const t=this.treeAdapter.createElement(e.tagName,M.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){const e=this.treeAdapter.createElement(v.HTML,M.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,c.HTML)}_appendCommentNode(e,t){const n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let t,n;if(this._shouldFosterParentOnInsertion()?({parent:t,beforeElement:n}=this._findFosterParentingLocation(),n?this.treeAdapter.insertTextBefore(t,e.chars,n):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;const r=this.treeAdapter.getChildNodes(t),i=r[(n?r.lastIndexOf(n):r.length)-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){const{endLine:a,endCol:s,endOffset:l}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:a,endCol:s,endOffset:l})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){const n=t.location,r=this.treeAdapter.getTagName(e),i=t.type===ee.END_TAG&&r===t.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,n;return this.openElements.stackTop===0&&this.fragmentContext?(t=this.fragmentContext,n=this.fragmentContextID):{current:t,currentTagId:n}=this.openElements,e.tagID===c.SVG&&this.treeAdapter.getTagName(t)===v.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(t)===M.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===c.MGLYPH||e.tagID===c.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,t,M.HTML)}_processToken(e){switch(e.type){case ee.CHARACTER:this.onCharacter(e);break;case ee.NULL_CHARACTER:this.onNullCharacter(e);break;case ee.COMMENT:this.onComment(e);break;case ee.DOCTYPE:this.onDoctype(e);break;case ee.START_TAG:this._processStartTag(e);break;case ee.END_TAG:this.onEndTag(e);break;case ee.EOF:this.onEof(e);break;case ee.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(e)}}_isIntegrationPoint(e,t,n){const r=this.treeAdapter.getNamespaceURI(t),i=this.treeAdapter.getAttrList(t);return kd(e,r,i,n)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const t=this.activeFormattingElements.entries.findIndex(r=>r.type===Ke.Marker||this.openElements.contains(r.element)),n=t===-1?e-1:t-1;for(let r=n;r>=0;r--){const i=this.activeFormattingElements.entries[r];this._insertElement(i.token,this.treeAdapter.getNamespaceURI(i.element)),i.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=b.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=b.IN_ROW;return;case c.TBODY:case c.THEAD:case c.TFOOT:this.insertionMode=b.IN_TABLE_BODY;return;case c.CAPTION:this.insertionMode=b.IN_CAPTION;return;case c.COLGROUP:this.insertionMode=b.IN_COLUMN_GROUP;return;case c.TABLE:this.insertionMode=b.IN_TABLE;return;case c.BODY:this.insertionMode=b.IN_BODY;return;case c.FRAMESET:this.insertionMode=b.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?b.AFTER_HEAD:b.BEFORE_HEAD;return;case c.TD:case c.TH:if(e>0){this.insertionMode=b.IN_CELL;return}break;case c.HEAD:if(e>0){this.insertionMode=b.IN_HEAD;return}}this.insertionMode=b.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){const n=this.openElements.tagIDs[t];if(n===c.TEMPLATE)break;if(n===c.TABLE){this.insertionMode=b.IN_SELECT_IN_TABLE;return}}this.insertionMode=b.IN_SELECT}_isElementCausesFosterParenting(e){return _o.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 t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case c.TEMPLATE:if(this.treeAdapter.getNamespaceURI(t)===M.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break;case c.TABLE:{const n=this.treeAdapter.getParentNode(t);return n?{parent:n,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){const n=this.treeAdapter.getNamespaceURI(e);return Yh[n].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){tp(this,e);return}switch(this.insertionMode){case b.INITIAL:Zt(this,e);break;case b.BEFORE_HTML:ln(this,e);break;case b.BEFORE_HEAD:cn(this,e);break;case b.IN_HEAD:un(this,e);break;case b.IN_HEAD_NO_SCRIPT:hn(this,e);break;case b.AFTER_HEAD:dn(this,e);break;case b.IN_BODY:case b.IN_CAPTION:case b.IN_CELL:case b.IN_TEMPLATE:yo(this,e);break;case b.TEXT:case b.IN_SELECT:case b.IN_SELECT_IN_TABLE:this._insertCharacters(e);break;case b.IN_TABLE:case b.IN_TABLE_BODY:case b.IN_ROW:_r(this,e);break;case b.IN_TABLE_TEXT:wo(this,e);break;case b.IN_COLUMN_GROUP:Wn(this,e);break;case b.AFTER_BODY:Gn(this,e);break;case b.AFTER_AFTER_BODY:$n(this,e)}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){ep(this,e);return}switch(this.insertionMode){case b.INITIAL:Zt(this,e);break;case b.BEFORE_HTML:ln(this,e);break;case b.BEFORE_HEAD:cn(this,e);break;case b.IN_HEAD:un(this,e);break;case b.IN_HEAD_NO_SCRIPT:hn(this,e);break;case b.AFTER_HEAD:dn(this,e);break;case b.TEXT:this._insertCharacters(e);break;case b.IN_TABLE:case b.IN_TABLE_BODY:case b.IN_ROW:_r(this,e);break;case b.IN_COLUMN_GROUP:Wn(this,e);break;case b.AFTER_BODY:Gn(this,e);break;case b.AFTER_AFTER_BODY:$n(this,e)}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){Gr(this,e);return}switch(this.insertionMode){case b.INITIAL:case b.BEFORE_HTML:case b.BEFORE_HEAD:case b.IN_HEAD:case b.IN_HEAD_NO_SCRIPT:case b.AFTER_HEAD:case b.IN_BODY:case b.IN_TABLE:case b.IN_CAPTION:case b.IN_COLUMN_GROUP:case b.IN_TABLE_BODY:case b.IN_ROW:case b.IN_CELL:case b.IN_SELECT:case b.IN_SELECT_IN_TABLE:case b.IN_TEMPLATE:case b.IN_FRAMESET:case b.AFTER_FRAMESET:Gr(this,e);break;case b.IN_TABLE_TEXT:Jt(this,e);break;case b.AFTER_BODY:Ld(this,e);break;case b.AFTER_AFTER_BODY:case b.AFTER_AFTER_FRAMESET:Rd(this,e)}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case b.INITIAL:Od(this,e);break;case b.BEFORE_HEAD:case b.IN_HEAD:case b.IN_HEAD_NO_SCRIPT:case b.AFTER_HEAD:this._err(e,L.misplacedDoctype);break;case b.IN_TABLE_TEXT:Jt(this,e)}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,L.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?np(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case b.INITIAL:Zt(this,e);break;case b.BEFORE_HTML:Dd(this,e);break;case b.BEFORE_HEAD:Md(this,e);break;case b.IN_HEAD:qe(this,e);break;case b.IN_HEAD_NO_SCRIPT:Hd(this,e);break;case b.AFTER_HEAD:jd(this,e);break;case b.IN_BODY:xe(this,e);break;case b.IN_TABLE:Ut(this,e);break;case b.IN_TABLE_TEXT:Jt(this,e);break;case b.IN_CAPTION:Ff(this,e);break;case b.IN_COLUMN_GROUP:_i(this,e);break;case b.IN_TABLE_BODY:lr(this,e);break;case b.IN_ROW:cr(this,e);break;case b.IN_CELL:jf(this,e);break;case b.IN_SELECT:Oo(this,e);break;case b.IN_SELECT_IN_TABLE:$f(this,e);break;case b.IN_TEMPLATE:qf(this,e);break;case b.AFTER_BODY:Wf(this,e);break;case b.IN_FRAMESET:Gf(this,e);break;case b.AFTER_FRAMESET:Kf(this,e);break;case b.AFTER_AFTER_BODY:Zf(this,e);break;case b.AFTER_AFTER_FRAMESET:Jf(this,e)}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?rp(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case b.INITIAL:Zt(this,e);break;case b.BEFORE_HTML:Pd(this,e);break;case b.BEFORE_HEAD:Bd(this,e);break;case b.IN_HEAD:Fd(this,e);break;case b.IN_HEAD_NO_SCRIPT:Ud(this,e);break;case b.AFTER_HEAD:zd(this,e);break;case b.IN_BODY:or(this,e);break;case b.TEXT:If(this,e);break;case b.IN_TABLE:En(this,e);break;case b.IN_TABLE_TEXT:Jt(this,e);break;case b.IN_CAPTION:Hf(this,e);break;case b.IN_COLUMN_GROUP:Uf(this,e);break;case b.IN_TABLE_BODY:Qr(this,e);break;case b.IN_ROW:Ro(this,e);break;case b.IN_CELL:zf(this,e);break;case b.IN_SELECT:Do(this,e);break;case b.IN_SELECT_IN_TABLE:Yf(this,e);break;case b.IN_TEMPLATE:Vf(this,e);break;case b.AFTER_BODY:Mo(this,e);break;case b.IN_FRAMESET:Qf(this,e);break;case b.AFTER_FRAMESET:Xf(this,e);break;case b.AFTER_AFTER_BODY:$n(this,e)}}onEof(e){switch(this.insertionMode){case b.INITIAL:Zt(this,e);break;case b.BEFORE_HTML:ln(this,e);break;case b.BEFORE_HEAD:cn(this,e);break;case b.IN_HEAD:un(this,e);break;case b.IN_HEAD_NO_SCRIPT:hn(this,e);break;case b.AFTER_HEAD:dn(this,e);break;case b.IN_BODY:case b.IN_TABLE:case b.IN_CAPTION:case b.IN_COLUMN_GROUP:case b.IN_TABLE_BODY:case b.IN_ROW:case b.IN_CELL:case b.IN_SELECT:case b.IN_SELECT_IN_TABLE:Io(this,e);break;case b.TEXT:vf(this,e);break;case b.IN_TABLE_TEXT:Jt(this,e);break;case b.IN_TEMPLATE:Po(this,e);break;case b.AFTER_BODY:case b.IN_FRAMESET:case b.AFTER_FRAMESET:case b.AFTER_AFTER_BODY:case b.AFTER_AFTER_FRAMESET:Ai(this,e)}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===g.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 b.IN_HEAD:case b.IN_HEAD_NO_SCRIPT:case b.AFTER_HEAD:case b.TEXT:case b.IN_COLUMN_GROUP:case b.IN_SELECT:case b.IN_SELECT_IN_TABLE:case b.IN_FRAMESET:case b.AFTER_FRAMESET:this._insertCharacters(e);break;case b.IN_BODY:case b.IN_CAPTION:case b.IN_CELL:case b.IN_TEMPLATE:case b.AFTER_BODY:case b.AFTER_AFTER_BODY:case b.AFTER_AFTER_FRAMESET:xo(this,e);break;case b.IN_TABLE:case b.IN_TABLE_BODY:case b.IN_ROW:_r(this,e);break;case b.IN_TABLE_TEXT:vo(this,e)}}};function Cd(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):No(e,t),n}function Sd(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function Nd(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,s=i;s!==n;a++,s=i){i=e.openElements.getCommonAncestor(s);const l=e.activeFormattingElements.getElementEntry(s),o=l&&a>=xd;!l||o?(o&&e.activeFormattingElements.removeEntry(l),e.openElements.remove(s)):(s=Id(e,l),r===t&&(e.activeFormattingElements.bookmark=l),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(s,r),r=s)}return r}function Id(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function vd(e,t,n){const r=e.treeAdapter.getTagName(t),i=Yt(r);if(e._isElementCausesFosterParenting(i))e._fosterParentElement(n);else{const a=e.treeAdapter.getNamespaceURI(t);i===c.TEMPLATE&&a===M.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function wd(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function ki(e,t){for(let n=0;n<_d;n++){const r=Cd(e,t);if(!r)break;const i=Sd(e,r);if(!i)break;e.activeFormattingElements.bookmark=r;const a=Nd(e,i,r.element),s=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(a),s&&vd(e,s,a),wd(e,i,r)}}function Gr(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function Ld(e,t){e._appendCommentNode(t,e.openElements.items[0])}function Rd(e,t){e._appendCommentNode(t,e.document)}function Ai(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],i=e.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const a=e.openElements.items[1],s=e.treeAdapter.getNodeSourceCodeLocation(a);s&&!s.endTag&&e._setEndLocation(a,t)}}}}function Od(e,t){e._setDocumentType(t);const n=t.forceQuirks?Ue.QUIRKS:cd(t);ld(t)||e._err(t,L.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=b.BEFORE_HTML}function Zt(e,t){e._err(t,L.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Ue.QUIRKS),e.insertionMode=b.BEFORE_HTML,e._processToken(t)}function Dd(e,t){t.tagID===c.HTML?(e._insertElement(t,M.HTML),e.insertionMode=b.BEFORE_HEAD):ln(e,t)}function Pd(e,t){const n=t.tagID;(n===c.HTML||n===c.HEAD||n===c.BODY||n===c.BR)&&ln(e,t)}function ln(e,t){e._insertFakeRootElement(),e.insertionMode=b.BEFORE_HEAD,e._processToken(t)}function Md(e,t){switch(t.tagID){case c.HTML:xe(e,t);break;case c.HEAD:e._insertElement(t,M.HTML),e.headElement=e.openElements.current,e.insertionMode=b.IN_HEAD;break;default:cn(e,t)}}function Bd(e,t){const n=t.tagID;n===c.HEAD||n===c.BODY||n===c.HTML||n===c.BR?cn(e,t):e._err(t,L.endTagWithoutMatchingOpenElement)}function cn(e,t){e._insertFakeElement(v.HEAD,c.HEAD),e.headElement=e.openElements.current,e.insertionMode=b.IN_HEAD,e._processToken(t)}function qe(e,t){switch(t.tagID){case c.HTML:xe(e,t);break;case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:e._appendElement(t,M.HTML),t.ackSelfClosing=!0;break;case c.TITLE:e._switchToTextParsing(t,Te.RCDATA);break;case c.NOSCRIPT:e.options.scriptingEnabled?e._switchToTextParsing(t,Te.RAWTEXT):(e._insertElement(t,M.HTML),e.insertionMode=b.IN_HEAD_NO_SCRIPT);break;case c.NOFRAMES:case c.STYLE:e._switchToTextParsing(t,Te.RAWTEXT);break;case c.SCRIPT:e._switchToTextParsing(t,Te.SCRIPT_DATA);break;case c.TEMPLATE:e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=b.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(b.IN_TEMPLATE);break;case c.HEAD:e._err(t,L.misplacedStartTagForHeadElement);break;default:un(e,t)}}function Fd(e,t){switch(t.tagID){case c.HEAD:e.openElements.pop(),e.insertionMode=b.AFTER_HEAD;break;case c.BODY:case c.BR:case c.HTML:un(e,t);break;case c.TEMPLATE:It(e,t);break;default:e._err(t,L.endTagWithoutMatchingOpenElement)}}function It(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==c.TEMPLATE&&e._err(t,L.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(c.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,L.endTagWithoutMatchingOpenElement)}function un(e,t){e.openElements.pop(),e.insertionMode=b.AFTER_HEAD,e._processToken(t)}function Hd(e,t){switch(t.tagID){case c.HTML:xe(e,t);break;case c.BASEFONT:case c.BGSOUND:case c.HEAD:case c.LINK:case c.META:case c.NOFRAMES:case c.STYLE:qe(e,t);break;case c.NOSCRIPT:e._err(t,L.nestedNoscriptInHead);break;default:hn(e,t)}}function Ud(e,t){switch(t.tagID){case c.NOSCRIPT:e.openElements.pop(),e.insertionMode=b.IN_HEAD;break;case c.BR:hn(e,t);break;default:e._err(t,L.endTagWithoutMatchingOpenElement)}}function hn(e,t){const n=t.type===ee.EOF?L.openElementsLeftAfterEof:L.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=b.IN_HEAD,e._processToken(t)}function jd(e,t){switch(t.tagID){case c.HTML:xe(e,t);break;case c.BODY:e._insertElement(t,M.HTML),e.framesetOk=!1,e.insertionMode=b.IN_BODY;break;case c.FRAMESET:e._insertElement(t,M.HTML),e.insertionMode=b.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:e._err(t,L.abandonedHeadElementChild),e.openElements.push(e.headElement,c.HEAD),qe(e,t),e.openElements.remove(e.headElement);break;case c.HEAD:e._err(t,L.misplacedStartTagForHeadElement);break;default:dn(e,t)}}function zd(e,t){switch(t.tagID){case c.BODY:case c.HTML:case c.BR:dn(e,t);break;case c.TEMPLATE:It(e,t);break;default:e._err(t,L.endTagWithoutMatchingOpenElement)}}function dn(e,t){e._insertFakeElement(v.BODY,c.BODY),e.insertionMode=b.IN_BODY,sr(e,t)}function sr(e,t){switch(t.type){case ee.CHARACTER:yo(e,t);break;case ee.WHITESPACE_CHARACTER:xo(e,t);break;case ee.COMMENT:Gr(e,t);break;case ee.START_TAG:xe(e,t);break;case ee.END_TAG:or(e,t);break;case ee.EOF:Io(e,t)}}function xo(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function yo(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function $d(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function Yd(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function qd(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,M.HTML),e.insertionMode=b.IN_FRAMESET)}function Vd(e,t){e.openElements.hasInButtonScope(c.P)&&e._closePElement(),e._insertElement(t,M.HTML)}function Wd(e,t){e.openElements.hasInButtonScope(c.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Wr.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,M.HTML)}function Gd(e,t){e.openElements.hasInButtonScope(c.P)&&e._closePElement(),e._insertElement(t,M.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function Qd(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(c.P)&&e._closePElement(),e._insertElement(t,M.HTML),n||(e.formElement=e.openElements.current))}function Kd(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const i=e.openElements.tagIDs[r];if(n===c.LI&&i===c.LI||(n===c.DD||n===c.DT)&&(i===c.DD||i===c.DT)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.popUntilTagNamePopped(i);break}if(i!==c.ADDRESS&&i!==c.DIV&&i!==c.P&&e._isSpecialElement(e.openElements.items[r],i))break}e.openElements.hasInButtonScope(c.P)&&e._closePElement(),e._insertElement(t,M.HTML)}function Xd(e,t){e.openElements.hasInButtonScope(c.P)&&e._closePElement(),e._insertElement(t,M.HTML),e.tokenizer.state=Te.PLAINTEXT}function Zd(e,t){e.openElements.hasInScope(c.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(c.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,M.HTML),e.framesetOk=!1}function Jd(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(v.A);n&&(ki(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,M.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function ef(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,M.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function tf(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(c.NOBR)&&(ki(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,M.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function nf(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,M.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function rf(e,t){e.treeAdapter.getDocumentMode(e.document)!==Ue.QUIRKS&&e.openElements.hasInButtonScope(c.P)&&e._closePElement(),e._insertElement(t,M.HTML),e.framesetOk=!1,e.insertionMode=b.IN_TABLE}function Co(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,M.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function So(e){const t=po(e,xt.TYPE);return t!=null&&t.toLowerCase()===Ad}function af(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,M.HTML),So(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function sf(e,t){e._appendElement(t,M.HTML),t.ackSelfClosing=!0}function of(e,t){e.openElements.hasInButtonScope(c.P)&&e._closePElement(),e._appendElement(t,M.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function lf(e,t){t.tagName=v.IMG,t.tagID=c.IMG,Co(e,t)}function cf(e,t){e._insertElement(t,M.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Te.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=b.TEXT}function uf(e,t){e.openElements.hasInButtonScope(c.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Te.RAWTEXT)}function hf(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Te.RAWTEXT)}function Aa(e,t){e._switchToTextParsing(t,Te.RAWTEXT)}function df(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,M.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===b.IN_TABLE||e.insertionMode===b.IN_CAPTION||e.insertionMode===b.IN_TABLE_BODY||e.insertionMode===b.IN_ROW||e.insertionMode===b.IN_CELL?b.IN_SELECT_IN_TABLE:b.IN_SELECT}function ff(e,t){e.openElements.currentTagId===c.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,M.HTML)}function pf(e,t){e.openElements.hasInScope(c.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,M.HTML)}function mf(e,t){e.openElements.hasInScope(c.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(c.RTC),e._insertElement(t,M.HTML)}function gf(e,t){e._reconstructActiveFormattingElements(),ko(t),bi(t),t.selfClosing?e._appendElement(t,M.MATHML):e._insertElement(t,M.MATHML),t.ackSelfClosing=!0}function Ef(e,t){e._reconstructActiveFormattingElements(),Ao(t),bi(t),t.selfClosing?e._appendElement(t,M.SVG):e._insertElement(t,M.SVG),t.ackSelfClosing=!0}function _a(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,M.HTML)}function xe(e,t){switch(t.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:ef(e,t);break;case c.A:Jd(e,t);break;case c.H1:case c.H2:case c.H3:case c.H4:case c.H5:case c.H6:Wd(e,t);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:Vd(e,t);break;case c.LI:case c.DD:case c.DT:Kd(e,t);break;case c.BR:case c.IMG:case c.WBR:case c.AREA:case c.EMBED:case c.KEYGEN:Co(e,t);break;case c.HR:of(e,t);break;case c.RB:case c.RTC:pf(e,t);break;case c.RT:case c.RP:mf(e,t);break;case c.PRE:case c.LISTING:Gd(e,t);break;case c.XMP:uf(e,t);break;case c.SVG:Ef(e,t);break;case c.HTML:$d(e,t);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:qe(e,t);break;case c.BODY:Yd(e,t);break;case c.FORM:Qd(e,t);break;case c.NOBR:tf(e,t);break;case c.MATH:gf(e,t);break;case c.TABLE:rf(e,t);break;case c.INPUT:af(e,t);break;case c.PARAM:case c.TRACK:case c.SOURCE:sf(e,t);break;case c.IMAGE:lf(e,t);break;case c.BUTTON:Zd(e,t);break;case c.APPLET:case c.OBJECT:case c.MARQUEE:nf(e,t);break;case c.IFRAME:hf(e,t);break;case c.SELECT:df(e,t);break;case c.OPTION:case c.OPTGROUP:ff(e,t);break;case c.NOEMBED:case c.NOFRAMES:Aa(e,t);break;case c.FRAMESET:qd(e,t);break;case c.TEXTAREA:cf(e,t);break;case c.NOSCRIPT:e.options.scriptingEnabled?Aa(e,t):_a(e,t);break;case c.PLAINTEXT:Xd(e,t);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:_a(e,t)}}function Tf(e,t){if(e.openElements.hasInScope(c.BODY)&&(e.insertionMode=b.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function bf(e,t){e.openElements.hasInScope(c.BODY)&&(e.insertionMode=b.AFTER_BODY,Mo(e,t))}function kf(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function Af(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(c.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(c.FORM):n&&e.openElements.remove(n))}function _f(e){e.openElements.hasInButtonScope(c.P)||e._insertFakeElement(v.P,c.P),e._closePElement()}function xf(e){e.openElements.hasInListItemScope(c.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(c.LI),e.openElements.popUntilTagNamePopped(c.LI))}function yf(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function Cf(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function Sf(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function Nf(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(v.BR,c.BR),e.openElements.pop(),e.framesetOk=!1}function No(e,t){const n=t.tagName,r=t.tagID;for(let i=e.openElements.stackTop;i>0;i--){const a=e.openElements.items[i],s=e.openElements.tagIDs[i];if(r===s&&(r!==c.UNKNOWN||e.treeAdapter.getTagName(a)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=i&&e.openElements.shortenToLength(i);break}if(e._isSpecialElement(a,s))break}}function or(e,t){switch(t.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:ki(e,t);break;case c.P:_f(e);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:kf(e,t);break;case c.LI:xf(e);break;case c.DD:case c.DT:yf(e,t);break;case c.H1:case c.H2:case c.H3:case c.H4:case c.H5:case c.H6:Cf(e);break;case c.BR:Nf(e);break;case c.BODY:Tf(e,t);break;case c.HTML:bf(e,t);break;case c.FORM:Af(e);break;case c.APPLET:case c.OBJECT:case c.MARQUEE:Sf(e,t);break;case c.TEMPLATE:It(e,t);break;default:No(e,t)}}function Io(e,t){e.tmplInsertionModeStack.length>0?Po(e,t):Ai(e,t)}function If(e,t){var n;t.tagID===c.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function vf(e,t){e._err(t,L.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function _r(e,t){if(e.openElements.currentTagId!==void 0&&_o.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=b.IN_TABLE_TEXT,t.type){case ee.CHARACTER:wo(e,t);break;case ee.WHITESPACE_CHARACTER:vo(e,t)}else xn(e,t)}function wf(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,M.HTML),e.insertionMode=b.IN_CAPTION}function Lf(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,M.HTML),e.insertionMode=b.IN_COLUMN_GROUP}function Rf(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(v.COLGROUP,c.COLGROUP),e.insertionMode=b.IN_COLUMN_GROUP,_i(e,t)}function Of(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,M.HTML),e.insertionMode=b.IN_TABLE_BODY}function Df(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(v.TBODY,c.TBODY),e.insertionMode=b.IN_TABLE_BODY,lr(e,t)}function Pf(e,t){e.openElements.hasInTableScope(c.TABLE)&&(e.openElements.popUntilTagNamePopped(c.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function Mf(e,t){So(t)?e._appendElement(t,M.HTML):xn(e,t),t.ackSelfClosing=!0}function Bf(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,M.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Ut(e,t){switch(t.tagID){case c.TD:case c.TH:case c.TR:Df(e,t);break;case c.STYLE:case c.SCRIPT:case c.TEMPLATE:qe(e,t);break;case c.COL:Rf(e,t);break;case c.FORM:Bf(e,t);break;case c.TABLE:Pf(e,t);break;case c.TBODY:case c.TFOOT:case c.THEAD:Of(e,t);break;case c.INPUT:Mf(e,t);break;case c.CAPTION:wf(e,t);break;case c.COLGROUP:Lf(e,t);break;default:xn(e,t)}}function En(e,t){switch(t.tagID){case c.TABLE:e.openElements.hasInTableScope(c.TABLE)&&(e.openElements.popUntilTagNamePopped(c.TABLE),e._resetInsertionMode());break;case c.TEMPLATE:It(e,t);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:xn(e,t)}}function xn(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,sr(e,t),e.fosterParentingEnabled=n}function vo(e,t){e.pendingCharacterTokens.push(t)}function wo(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Jt(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)xn(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}var Lo=new Set([c.CAPTION,c.COL,c.COLGROUP,c.TBODY,c.TD,c.TFOOT,c.TH,c.THEAD,c.TR]);function Ff(e,t){const n=t.tagID;Lo.has(n)?e.openElements.hasInTableScope(c.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(c.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=b.IN_TABLE,Ut(e,t)):xe(e,t)}function Hf(e,t){const n=t.tagID;switch(n){case c.CAPTION:case c.TABLE:e.openElements.hasInTableScope(c.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(c.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=b.IN_TABLE,n===c.TABLE&&En(e,t));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:or(e,t)}}function _i(e,t){switch(t.tagID){case c.HTML:xe(e,t);break;case c.COL:e._appendElement(t,M.HTML),t.ackSelfClosing=!0;break;case c.TEMPLATE:qe(e,t);break;default:Wn(e,t)}}function Uf(e,t){switch(t.tagID){case c.COLGROUP:e.openElements.currentTagId===c.COLGROUP&&(e.openElements.pop(),e.insertionMode=b.IN_TABLE);break;case c.TEMPLATE:It(e,t);break;case c.COL:break;default:Wn(e,t)}}function Wn(e,t){e.openElements.currentTagId===c.COLGROUP&&(e.openElements.pop(),e.insertionMode=b.IN_TABLE,e._processToken(t))}function lr(e,t){switch(t.tagID){case c.TR:e.openElements.clearBackToTableBodyContext(),e._insertElement(t,M.HTML),e.insertionMode=b.IN_ROW;break;case c.TH:case c.TD:e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(v.TR,c.TR),e.insertionMode=b.IN_ROW,cr(e,t);break;case c.CAPTION:case c.COL:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=b.IN_TABLE,Ut(e,t));break;default:Ut(e,t)}}function Qr(e,t){const n=t.tagID;switch(t.tagID){case c.TBODY:case c.TFOOT:case c.THEAD:e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=b.IN_TABLE);break;case c.TABLE:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=b.IN_TABLE,En(e,t));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:En(e,t)}}function cr(e,t){switch(t.tagID){case c.TH:case c.TD:e.openElements.clearBackToTableRowContext(),e._insertElement(t,M.HTML),e.insertionMode=b.IN_CELL,e.activeFormattingElements.insertMarker();break;case c.CAPTION:case c.COL:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:case c.TR:e.openElements.hasInTableScope(c.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=b.IN_TABLE_BODY,lr(e,t));break;default:Ut(e,t)}}function Ro(e,t){switch(t.tagID){case c.TR:e.openElements.hasInTableScope(c.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=b.IN_TABLE_BODY);break;case c.TABLE:e.openElements.hasInTableScope(c.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=b.IN_TABLE_BODY,Qr(e,t));break;case c.TBODY:case c.TFOOT:case c.THEAD:(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(c.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=b.IN_TABLE_BODY,Qr(e,t));break;case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TD:case c.TH:break;default:En(e,t)}}function jf(e,t){const n=t.tagID;Lo.has(n)?(e.openElements.hasInTableScope(c.TD)||e.openElements.hasInTableScope(c.TH))&&(e._closeTableCell(),cr(e,t)):xe(e,t)}function zf(e,t){const n=t.tagID;switch(n){case c.TD:case c.TH:e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=b.IN_ROW);break;case c.TABLE:case c.TBODY:case c.TFOOT:case c.THEAD:case c.TR:e.openElements.hasInTableScope(n)&&(e._closeTableCell(),Ro(e,t));break;case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:break;default:or(e,t)}}function Oo(e,t){switch(t.tagID){case c.HTML:xe(e,t);break;case c.OPTION:e.openElements.currentTagId===c.OPTION&&e.openElements.pop(),e._insertElement(t,M.HTML);break;case c.OPTGROUP:e.openElements.currentTagId===c.OPTION&&e.openElements.pop(),e.openElements.currentTagId===c.OPTGROUP&&e.openElements.pop(),e._insertElement(t,M.HTML);break;case c.HR:e.openElements.currentTagId===c.OPTION&&e.openElements.pop(),e.openElements.currentTagId===c.OPTGROUP&&e.openElements.pop(),e._appendElement(t,M.HTML),t.ackSelfClosing=!0;break;case c.INPUT:case c.KEYGEN:case c.TEXTAREA:case c.SELECT:e.openElements.hasInSelectScope(c.SELECT)&&(e.openElements.popUntilTagNamePopped(c.SELECT),e._resetInsertionMode(),t.tagID!==c.SELECT&&e._processStartTag(t));break;case c.SCRIPT:case c.TEMPLATE:qe(e,t)}}function Do(e,t){switch(t.tagID){case c.OPTGROUP:e.openElements.stackTop>0&&e.openElements.currentTagId===c.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===c.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===c.OPTGROUP&&e.openElements.pop();break;case c.OPTION:e.openElements.currentTagId===c.OPTION&&e.openElements.pop();break;case c.SELECT:e.openElements.hasInSelectScope(c.SELECT)&&(e.openElements.popUntilTagNamePopped(c.SELECT),e._resetInsertionMode());break;case c.TEMPLATE:It(e,t)}}function $f(e,t){const n=t.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?(e.openElements.popUntilTagNamePopped(c.SELECT),e._resetInsertionMode(),e._processStartTag(t)):Oo(e,t)}function Yf(e,t){const n=t.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?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(c.SELECT),e._resetInsertionMode(),e.onEndTag(t)):Do(e,t)}function qf(e,t){switch(t.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:qe(e,t);break;case c.CAPTION:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:e.tmplInsertionModeStack[0]=b.IN_TABLE,e.insertionMode=b.IN_TABLE,Ut(e,t);break;case c.COL:e.tmplInsertionModeStack[0]=b.IN_COLUMN_GROUP,e.insertionMode=b.IN_COLUMN_GROUP,_i(e,t);break;case c.TR:e.tmplInsertionModeStack[0]=b.IN_TABLE_BODY,e.insertionMode=b.IN_TABLE_BODY,lr(e,t);break;case c.TD:case c.TH:e.tmplInsertionModeStack[0]=b.IN_ROW,e.insertionMode=b.IN_ROW,cr(e,t);break;default:e.tmplInsertionModeStack[0]=b.IN_BODY,e.insertionMode=b.IN_BODY,xe(e,t)}}function Vf(e,t){t.tagID===c.TEMPLATE&&It(e,t)}function Po(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(c.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Ai(e,t)}function Wf(e,t){t.tagID===c.HTML?xe(e,t):Gn(e,t)}function Mo(e,t){var n;if(t.tagID===c.HTML){if(e.fragmentContext||(e.insertionMode=b.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===c.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else Gn(e,t)}function Gn(e,t){e.insertionMode=b.IN_BODY,sr(e,t)}function Gf(e,t){switch(t.tagID){case c.HTML:xe(e,t);break;case c.FRAMESET:e._insertElement(t,M.HTML);break;case c.FRAME:e._appendElement(t,M.HTML),t.ackSelfClosing=!0;break;case c.NOFRAMES:qe(e,t)}}function Qf(e,t){t.tagID===c.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==c.FRAMESET&&(e.insertionMode=b.AFTER_FRAMESET))}function Kf(e,t){switch(t.tagID){case c.HTML:xe(e,t);break;case c.NOFRAMES:qe(e,t)}}function Xf(e,t){t.tagID===c.HTML&&(e.insertionMode=b.AFTER_AFTER_FRAMESET)}function Zf(e,t){t.tagID===c.HTML?xe(e,t):$n(e,t)}function $n(e,t){e.insertionMode=b.IN_BODY,sr(e,t)}function Jf(e,t){switch(t.tagID){case c.HTML:xe(e,t);break;case c.NOFRAMES:qe(e,t)}}function ep(e,t){t.chars="�",e._insertCharacters(t)}function tp(e,t){e._insertCharacters(t),e.framesetOk=!1}function Bo(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==M.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function np(e,t){if(gd(t))Bo(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===M.MATHML?ko(t):r===M.SVG&&(Ed(t),Ao(t)),bi(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function rp(e,t){if(t.tagID===c.P||t.tagID===c.BR){Bo(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===M.HTML){e._endTagOutsideForeignContent(t);break}const i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}var qx=new Set([v.AREA,v.BASE,v.BASEFONT,v.BGSOUND,v.BR,v.COL,v.EMBED,v.FRAME,v.HR,v.IMG,v.INPUT,v.KEYGEN,v.LINK,v.META,v.PARAM,v.SOURCE,v.TRACK,v.WBR]),ur=Fo("end"),Ze=Fo("start");function Fo(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};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 Ho(e){const t=Ze(e),n=ur(e);if(t&&n)return{start:t,end:n}}var ip=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,ap=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),xa={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function Uo(e,t){const n=mp(e),r=lo("type",{handlers:{root:sp,element:op,text:lp,comment:zo,doctype:cp,raw:hp},unknown:dp}),i={parser:n?new ka(xa):ka.getFragmentParser(void 0,xa),handle(l){r(l,i)},stitches:!1,options:t||{}};r(e,i),qt(i,Ze());const a=n?i.parser.document:i.parser.getFragment(),s=mh(a,{file:i.options.file});return i.stitches&&Xe(s,"comment",function(l,o,u){const d=l;if(d.value.stitch&&u&&o!==void 0){const h=u.children;return h[o]=d.value.stitch,o}}),s.type==="root"&&s.children.length===1&&s.children[0].type===e.type?s.children[0]:s}function jo(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function sp(e,t){jo(e.children,t)}function op(e,t){fp(e,t),jo(e.children,t),pp(e,t)}function lp(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:ee.CHARACTER,chars:e.value,location:yn(e)};qt(t,Ze(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function cp(e,t){const n={type:ee.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:yn(e)};qt(t,Ze(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function up(e,t){t.stitches=!0;const n=gp(e);"children"in e&&"children"in n&&(n.children=Uo({type:"root",children:e.children},t.options).children),zo({type:"comment",value:{stitch:n}},t)}function zo(e,t){const n=e.value,r={type:ee.COMMENT,data:n,location:yn(e)};qt(t,Ze(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function hp(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,$o(t,Ze(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(ip,"&lt;$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function dp(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))up(n,t);else{let r="";throw ap.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 qt(e,t){$o(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=Te.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function $o(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function fp(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Te.PLAINTEXT)return;qt(t,Ze(e));const r=t.parser.openElements.current;let i="namespaceURI"in r?r.namespaceURI:_t.html;i===_t.html&&n==="svg"&&(i=_t.svg);const a=kh({...e,children:[]},{space:i===_t.svg?"svg":"html"}),s={type:ee.START_TAG,tagName:n,tagID:Yt(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in a?a.attrs:[],location:yn(e)};t.parser.currentToken=s,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function pp(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&Ih.includes(n)||t.parser.tokenizer.state===Te.PLAINTEXT)return;qt(t,ur(e));const r={type:ee.END_TAG,tagName:n,tagID:Yt(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:yn(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Te.RCDATA||t.parser.tokenizer.state===Te.RAWTEXT||t.parser.tokenizer.state===Te.SCRIPT_DATA)&&(t.parser.tokenizer.state=Te.DATA)}function mp(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function yn(e){const t=Ze(e)||{line:void 0,column:void 0,offset:void 0},n=ur(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function gp(e){return"children"in e?yt({...e,children:[]}):yt(e)}function Kr(e){return function(t,n){return Uo(t,{...e,file:n})}}var Tt=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],kt={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Tt,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Tt],h2:[["className","sr-only"]],img:[...Tt,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Tt,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Tt],table:[...Tt],ul:[...Tt,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},ut={}.hasOwnProperty;function Ep(e,t){let n={type:"root",children:[]};const r=Yo({schema:t?{...kt,...t}:kt,stack:[]},e);return r&&(Array.isArray(r)?r.length===1?n=r[0]:n.children=r:n=r),n}function Yo(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return Tp(e,n);case"doctype":return bp(e,n);case"element":return kp(e,n);case"root":return Ap(e,n);case"text":return _p(e,n)}}}function Tp(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),i={type:"comment",value:r<0?n:n.slice(0,r)};return Cn(i,t),i}}function bp(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return Cn(n,t),n}}function kp(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=qo(e,t.children),i=xp(e,t.properties);e.stack.pop();let a=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&ut.call(e.schema.ancestors,n))){const l=e.schema.ancestors[n];let o=-1;for(a=!1;++o<l.length;)e.stack.includes(l[o])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const s={type:"element",tagName:n,properties:i,children:r};return Cn(s,t),s}function Ap(e,t){const n={type:"root",children:qo(e,t.children)};return Cn(n,t),n}function _p(e,t){const n={type:"text",value:typeof t.value=="string"?t.value:""};return Cn(n,t),n}function qo(e,t){const n=[];if(Array.isArray(t)){const r=t;let i=-1;for(;++i<r.length;){const a=Yo(e,r[i]);a&&(Array.isArray(a)?n.push(...a):n.push(a))}}return n}function xp(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&ut.call(r,n)?r[n]:void 0,s=r&&ut.call(r,"*")?r["*"]:void 0,l=t&&typeof t=="object"?t:{},o={};let u;for(u in l)if(ut.call(l,u)){const d=l[u];let h=ya(e,Ca(a,u),u,d);h==null&&(h=ya(e,Ca(s,u),u,d)),h!=null&&(o[u]=h)}if(i&&ut.call(i,n)){const d=i[n];for(u in d)ut.call(d,u)&&!ut.call(o,u)&&(o[u]=d[u])}return o}function ya(e,t,n,r){return t?Array.isArray(r)?yp(e,t,n,r):Vo(e,t,n,r):void 0}function yp(e,t,n,r){let i=-1;const a=[];for(;++i<r.length;){const s=Vo(e,t,n,r[i]);(typeof s=="number"||typeof s=="string")&&a.push(s)}return a}function Vo(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&Cp(e,n,r)){if(typeof t=="object"&&t.length>1){let i=!1,a=0;for(;++a<t.length;){const s=t[a];if(s&&typeof s=="object"&&"flags"in s){if(s.test(String(r))){i=!0;break}}else if(s===r){i=!0;break}}if(!i)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function Cp(e,t,n){const r=e.schema.protocols&&ut.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const i=String(n),a=i.indexOf(":"),s=i.indexOf("?"),l=i.indexOf("#"),o=i.indexOf("/");if(a<0||o>-1&&a>o||s>-1&&a>s||l>-1&&a>l)return!0;let u=-1;for(;++u<r.length;){const d=r[u];if(a===d.length&&i.slice(0,d.length)===d)return!0}return!1}function Cn(e,t){const n=Ho(t);t.data&&(e.data=yt(t.data)),n&&(e.position=n)}function Ca(e,t){let n,r=-1;if(e)for(;++r<e.length;){const i=e[r],a=typeof i=="string"?i:i[0];if(a===t)return i;a==="data*"&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function Wo(e){return function(t){return Ep(t,e)}}function Sa(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}var Se=mt(/[A-Za-z]/),_e=mt(/[\dA-Za-z]/),Sp=mt(/[#-'*+\--9=?A-Z^-~]/);function Qn(e){return e!==null&&(e<32||e===127)}var Xr=mt(/\d/),Np=mt(/[\dA-Fa-f]/),Ip=mt(/[!-/:-@[-`{-~]/);function G(e){return e!==null&&e<-2}function le(e){return e!==null&&(e<0||e===32)}function ne(e){return e===-2||e===-1||e===32}var hr=mt(/\p{P}|\p{S}/u),Ct=mt(/\s/);function mt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function vp(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function wp(e,t,n){const r=rr((n||{}).ignore||[]),i=Lp(t);let a=-1;for(;++a<i.length;)mi(e,"text",s);function s(o,u){let d=-1,h;for(;++d<u.length;){const f=u[d],p=h?h.children:void 0;if(r(f,p?p.indexOf(f):void 0,h))return;h=f}if(h)return l(o,u)}function l(o,u){const d=u[u.length-1],h=i[a][0],f=i[a][1];let p=0;const E=d.children.indexOf(o);let N=!1,y=[];h.lastIndex=0;let _=h.exec(o.value);for(;_;){const C=_.index,w={index:_.index,input:_.input,stack:[...u,o]};let R=f(..._,w);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1?h.lastIndex=C+1:(p!==C&&y.push({type:"text",value:o.value.slice(p,C)}),Array.isArray(R)?y.push(...R):R&&y.push(R),p=C+_[0].length,N=!0),!h.global)break;_=h.exec(o.value)}return N?(p<o.value.length&&y.push({type:"text",value:o.value.slice(p)}),d.children.splice(E,1,...y)):y=[o],E+y.length}}function Lp(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([Rp(i[0]),Op(i[1])])}return t}function Rp(e){return typeof e=="string"?new RegExp(vp(e),"g"):e}function Op(e){return typeof e=="function"?e:function(){return e}}var xr="phrasing",yr=["autolink","link","image","label"];function Dp(){return{transforms:[jp],enter:{literalAutolink:Mp,literalAutolinkEmail:Cr,literalAutolinkHttp:Cr,literalAutolinkWww:Cr},exit:{literalAutolink:Up,literalAutolinkEmail:Hp,literalAutolinkHttp:Bp,literalAutolinkWww:Fp}}}function Pp(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:xr,notInConstruct:yr},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:xr,notInConstruct:yr},{character:":",before:"[ps]",after:"\\/",inConstruct:xr,notInConstruct:yr}]}}function Mp(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Cr(e){this.config.enter.autolinkProtocol.call(this,e)}function Bp(e){this.config.exit.autolinkProtocol.call(this,e)}function Fp(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function Hp(e){this.config.exit.autolinkEmail.call(this,e)}function Up(e){this.exit(e)}function jp(e){wp(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,zp],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,$p]],{ignore:["link","linkReference"]})}function zp(e,t,n,r,i){let a="";if(!Go(i)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!Yp(n)))return!1;const s=qp(n+r);if(!s[0])return!1;const l={type:"link",title:null,url:a+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[l,{type:"text",value:s[1]}]:l}function $p(e,t,n,r){return!Go(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Yp(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function qp(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Sa(e,"(");let a=Sa(e,")");for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function Go(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Ct(n)||hr(n))&&(!t||n!==47)}function Ye(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}Qo.peek=em;function Vp(){this.buffer()}function Wp(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Gp(){this.buffer()}function Qp(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Kp(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ye(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Xp(e){this.exit(e)}function Zp(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ye(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Jp(e){this.exit(e)}function em(){return"["}function Qo(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const s=n.enter("footnoteReference"),l=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{after:"]",before:a})),l(),s(),a+=i.move("]"),a}function tm(){return{enter:{gfmFootnoteCallString:Vp,gfmFootnoteCall:Wp,gfmFootnoteDefinitionLabelString:Gp,gfmFootnoteDefinition:Qp},exit:{gfmFootnoteCallString:Kp,gfmFootnoteCall:Xp,gfmFootnoteDefinitionLabelString:Zp,gfmFootnoteDefinition:Jp}}}function nm(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Qo},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,a,s){const l=a.createTracker(s);let o=l.move("[^");const u=a.enter("footnoteDefinition"),d=a.enter("label");return o+=l.move(a.safe(a.associationId(r),{before:o,after:"]"})),d(),o+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),o+=l.move((t?`
4
4
  `:" ")+a.indentLines(a.containerFlow(r,l.current()),t?Ko:rm))),u(),o}}function rm(e,t,n){return t===0?e:Ko(e,t,n)}function Ko(e,t,n){return(n?"":" ")+e}var im=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Xo.peek=cm;function am(){return{canContainEols:["delete"],enter:{strikethrough:om},exit:{strikethrough:lm}}}function sm(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:im}],handlers:{delete:Xo}}}function om(e){this.enter({type:"delete",children:[]},e)}function lm(e){this.exit(e)}function Xo(e,t,n,r){const i=n.createTracker(r),a=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),a(),s}function cm(){return"~"}function um(e){return e.length}function hm(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||um,a=[],s=[],l=[],o=[];let u=0,d=-1;for(;++d<e.length;){const N=[],y=[];let _=-1;for(e[d].length>u&&(u=e[d].length);++_<e[d].length;){const C=dm(e[d][_]);if(n.alignDelimiters!==!1){const w=i(C);y[_]=w,(o[_]===void 0||w>o[_])&&(o[_]=w)}N.push(C)}s[d]=N,l[d]=y}let h=-1;if(typeof r=="object"&&"length"in r)for(;++h<u;)a[h]=Na(r[h]);else{const N=Na(r);for(;++h<u;)a[h]=N}h=-1;const f=[],p=[];for(;++h<u;){const N=a[h];let y="",_="";N===99?(y=":",_=":"):N===108?y=":":N===114&&(_=":");let C=n.alignDelimiters===!1?1:Math.max(1,o[h]-y.length-_.length);const w=y+"-".repeat(C)+_;n.alignDelimiters!==!1&&(C=y.length+C+_.length,C>o[h]&&(o[h]=C),p[h]=C),f[h]=w}s.splice(1,0,f),l.splice(1,0,p),d=-1;const E=[];for(;++d<s.length;){const N=s[d],y=l[d];h=-1;const _=[];for(;++h<u;){const C=N[h]||"";let w="",R="";if(n.alignDelimiters!==!1){const O=o[h]-(y[h]||0),S=a[h];S===114?w=" ".repeat(O):S===99?O%2?(w=" ".repeat(O/2+.5),R=" ".repeat(O/2-.5)):(w=" ".repeat(O/2),R=w):R=" ".repeat(O)}n.delimiterStart!==!1&&!h&&_.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&C==="")&&(n.delimiterStart!==!1||h)&&_.push(" "),n.alignDelimiters!==!1&&_.push(w),_.push(C),n.alignDelimiters!==!1&&_.push(R),n.padding!==!1&&_.push(" "),(n.delimiterEnd!==!1||h!==u-1)&&_.push("|")}E.push(n.delimiterEnd===!1?_.join("").replace(/ +$/,""):_.join(""))}return E.join(`
5
5
  `)}function dm(e){return e==null?"":String(e)}function Na(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function fm(e,t,n,r){const i=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const s=n.indentLines(n.containerFlow(e,a.current()),pm);return i(),s}function pm(e,t,n){return">"+(n?"":" ")+e}function mm(e,t){return Ia(e,t.inConstruct,!0)&&!Ia(e,t.notInConstruct,!1)}function Ia(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function va(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
@@ -109,14 +109,14 @@ ${e}</tr>
109
109
  `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Ge(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=ds(e);if(i===null)return r;e=i;let a='<a href="'+e+'"';return t&&(a+=' title="'+Ge(t)+'"'),a+=">"+r+"</a>",a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=ds(e);if(i===null)return Ge(n);e=i;let a=`<img src="${e}" alt="${Ge(n)}"`;return t&&(a+=` title="${Ge(t)}"`),a+=">",a}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Ge(e.text)}},zi=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},$e=class si{options;renderer;textRenderer;constructor(t){this.options=t||wt,this.options.renderer=this.options.renderer||new Jn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new zi}static parse(t,n){return new si(n).parse(t)}static parseInline(t,n){return new si(n).parseInline(t)}parse(t){this.renderer.parser=this;let n="";for(let r=0;r<t.length;r++){let i=t[r];if(this.options.extensions?.renderers?.[i.type]){let s=i,l=this.options.extensions.renderers[s.type].call({parser:this},s);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(s.type)){n+=l||"";continue}}let a=i;switch(a.type){case"space":n+=this.renderer.space(a);break;case"hr":n+=this.renderer.hr(a);break;case"heading":n+=this.renderer.heading(a);break;case"code":n+=this.renderer.code(a);break;case"table":n+=this.renderer.table(a);break;case"blockquote":n+=this.renderer.blockquote(a);break;case"list":n+=this.renderer.list(a);break;case"checkbox":n+=this.renderer.checkbox(a);break;case"html":n+=this.renderer.html(a);break;case"def":n+=this.renderer.def(a);break;case"paragraph":n+=this.renderer.paragraph(a);break;case"text":n+=this.renderer.text(a);break;default:{let s='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return n}parseInline(t,n=this.renderer){this.renderer.parser=this;let r="";for(let i=0;i<t.length;i++){let a=t[i];if(this.options.extensions?.renderers?.[a.type]){let l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){r+=l||"";continue}}let 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"checkbox":r+=n.checkbox(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:{let l='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}},sn=class{options;block;constructor(e){this.options=e||wt}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?ze.lex:ze.lexInline}provideParser(e=this.block){return e?$e.parse:$e.parseInline}},dA=class{defaults=Di();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=$e;Renderer=Jn;TextRenderer=zi;Lexer=ze;Tokenizer=Zn;Hooks=sn;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{let i=r;for(let a of i.header)n=n.concat(this.walkTokens(a.tokens,t));for(let a of i.rows)for(let s of a)n=n.concat(this.walkTokens(s.tokens,t));break}case"list":{let i=r;n=n.concat(this.walkTokens(i.items,t));break}default:{let i=r;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(a=>{let s=i[a].flat(1/0);n=n.concat(this.walkTokens(s,t))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let 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){let a=t.renderers[i.name];a?t.renderers[i.name]=function(...s){let l=i.renderer.apply(this,s);return l===!1&&(l=a.apply(this,s)),l}:t.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'");let a=t[i.level];a?a.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),n.renderer){let i=this.defaults.renderer||new Jn(this.defaults);for(let a in n.renderer){if(!(a in i))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let s=a,l=n.renderer[s],o=i[s];i[s]=(...u)=>{let d=l.apply(i,u);return d===!1&&(d=o.apply(i,u)),d||""}}r.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new Zn(this.defaults);for(let a in n.tokenizer){if(!(a in i))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let s=a,l=n.tokenizer[s],o=i[s];i[s]=(...u)=>{let d=l.apply(i,u);return d===!1&&(d=o.apply(i,u)),d}}r.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new sn;for(let a in n.hooks){if(!(a in i))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let s=a,l=n.hooks[s],o=i[s];sn.passThroughHooks.has(a)?i[s]=u=>{if(this.defaults.async&&sn.passThroughHooksRespectAsync.has(a))return(async()=>{let h=await l.call(i,u);return o.call(i,h)})();let d=l.call(i,u);return o.call(i,d)}:i[s]=(...u)=>{if(this.defaults.async)return(async()=>{let h=await l.apply(i,u);return h===!1&&(h=await o.apply(i,u)),h})();let d=l.apply(i,u);return d===!1&&(d=o.apply(i,u)),d}}r.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,a=n.walkTokens;r.walkTokens=function(s){let l=[];return l.push(a.call(this,s)),i&&(l=l.concat(i.call(this,s))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ze.lex(e,t??this.defaults)}parser(e,t){return $e.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(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 t>"u"||t===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let s=i.hooks?await i.hooks.preprocess(t):t,l=await(i.hooks?await i.hooks.provideLexer(e):e?ze.lex:ze.lexInline)(s,i),o=i.hooks?await i.hooks.processAllTokens(l):l;i.walkTokens&&await Promise.all(this.walkTokens(o,i.walkTokens));let u=await(i.hooks?await i.hooks.provideParser(e):e?$e.parse:$e.parseInline)(o,i);return i.hooks?await i.hooks.postprocess(u):u})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let s=(i.hooks?i.hooks.provideLexer(e):e?ze.lex:ze.lexInline)(t,i);i.hooks&&(s=i.hooks.processAllTokens(s)),i.walkTokens&&this.walkTokens(s,i.walkTokens);let l=(i.hooks?i.hooks.provideParser(e):e?$e.parse:$e.parseInline)(s,i);return i.hooks&&(l=i.hooks.postprocess(l)),l}catch(s){return a(s)}}}onError(e,t){return n=>{if(n.message+=`
110
110
  Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error occurred:</p><pre>"+Ge(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},St=new dA;function se(e,t){return St.parse(e,t)}se.options=se.setOptions=function(e){return St.setOptions(e),se.defaults=St.defaults,Gl(se.defaults),se};se.getDefaults=Di;se.defaults=wt;se.use=function(...e){return St.use(...e),se.defaults=St.defaults,Gl(se.defaults),se};se.walkTokens=function(e,t){return St.walkTokens(e,t)};se.parseInline=St.parseInline;se.Parser=$e;se.parser=$e.parse;se.Renderer=Jn;se.TextRenderer=zi;se.Lexer=ze;se.lexer=ze.lex;se.Tokenizer=Zn;se.Hooks=sn;se.parse=se;var Vx=se.options,Wx=se.setOptions,Gx=se.use,Qx=se.walkTokens,Kx=se.parseInline,Xx=$e.parse,Zx=ze.lex,fA=300,pA="300px",mA=500;function gA(e={}){let{immediate:t=!1,debounceDelay:n=fA,rootMargin:r=pA,idleTimeout:i=mA}=e,[a,s]=(0,k.useState)(!1),l=(0,k.useRef)(null),o=(0,k.useRef)(null),u=(0,k.useRef)(null),d=(0,k.useMemo)(()=>p=>{let E=Date.now();return window.setTimeout(()=>{p({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-E))})},1)},[]),h=(0,k.useMemo)(()=>typeof window<"u"&&window.requestIdleCallback?(p,E)=>window.requestIdleCallback(p,E):d,[d]),f=(0,k.useMemo)(()=>typeof window<"u"&&window.cancelIdleCallback?p=>window.cancelIdleCallback(p):p=>{clearTimeout(p)},[]);return(0,k.useEffect)(()=>{if(t){s(!0);return}let p=l.current;if(!p)return;o.current&&(clearTimeout(o.current),o.current=null),u.current&&(f(u.current),u.current=null);let E=()=>{o.current&&(clearTimeout(o.current),o.current=null),u.current&&(f(u.current),u.current=null)},N=w=>{u.current=h(R=>{R.timeRemaining()>0||R.didTimeout?(s(!0),w.disconnect()):u.current=h(()=>{s(!0),w.disconnect()},{timeout:i/2})},{timeout:i})},y=w=>{E(),o.current=window.setTimeout(()=>{var R,O;let S=w.takeRecords();(S.length===0||(O=(R=S.at(-1))==null?void 0:R.isIntersecting)!=null&&O)&&N(w)},n)},_=(w,R)=>{w.isIntersecting?y(R):E()},C=new IntersectionObserver(w=>{for(let R of w)_(R,C)},{rootMargin:r,threshold:0});return C.observe(p),()=>{o.current&&clearTimeout(o.current),u.current&&f(u.current),C.disconnect()}},[t,n,r,i,f,h]),{shouldRender:a,containerRef:l}}var rc=/\s/,EA=/^\s+$/,TA=new Set(["code","pre","svg","math","annotation"]),bA=e=>typeof e=="object"&&e!==null&&"type"in e&&e.type==="element",kA=e=>e.some(t=>bA(t)&&TA.has(t.tagName)),AA=e=>{let t=[],n="",r=!1;for(let i of e){let a=rc.test(i);a!==r&&n&&(t.push(n),n=""),n+=i,r=a}return n&&t.push(n),t},_A=e=>{let t=[],n="";for(let r of e)rc.test(r)?n+=r:(n&&(t.push(n),n=""),t.push(r));return n&&t.push(n),t},xA=(e,t,n,r,i,a)=>{let s=`--sd-animation:sd-${t};--sd-duration:${i?0:n}ms;--sd-easing:${r}`;return a&&(s+=`;--sd-delay:${a}ms`),{type:"element",tagName:"span",properties:{"data-sd-animate":!0,style:s},children:[{type:"text",value:e}]}},yA=(e,t,n,r,i)=>{let a=t.at(-1);if(!(a&&"children"in a))return;if(kA(t))return rn;let s=a,l=s.children.indexOf(e);if(l===-1)return;let o=e.value;if(!o.trim()){i.count+=o.length;return}let u=n.sep==="char"?_A(o):AA(o),d=r.prevContentLength,h=u.map(f=>{let p=i.count;if(i.count+=f.length,EA.test(f))return{type:"text",value:f};let E=d>0&&p<d,N=E?0:i.newIndex++*n.stagger;return xA(f,n.animation,n.duration,n.easing,E,N)});return s.children.splice(l,1,...h),l+h.length},CA=0;function oi(e){var t,n,r,i,a;let s={animation:(t=e?.animation)!=null?t:"fadeIn",duration:(n=e?.duration)!=null?n:150,easing:(r=e?.easing)!=null?r:"ease",sep:(i=e?.sep)!=null?i:"word",stagger:(a=e?.stagger)!=null?a:40},l={prevContentLength:0,lastRenderCharCount:0},o=CA++,u=()=>d=>{let h={count:0,newIndex:0};mi(d,"text",(f,p)=>yA(f,p,s,l,h)),l.lastRenderCharCount=h.count,l.prevContentLength=0};return Object.defineProperty(u,"name",{value:`rehypeAnimate$${o}`}),{name:"animate",type:"animate",rehypePlugin:u,setPrevContentLength(d){l.prevContentLength=d},getLastRenderCharCount(){let d=l.lastRenderCharCount;return l.lastRenderCharCount=0,d}}}oi();var ic=(0,k.createContext)(!1),SA=()=>(0,k.useContext)(ic),$i=(...e)=>js(Us(e)),NA=(e,t)=>{if(!e||!t)return t;let n=`${e}:`;return t.split(/\s+/).filter(Boolean).map(r=>r.startsWith(n)?r:`${e}:${r}`).join(" ")},IA=e=>e?(...t)=>NA(e,js(Us(t))):$i,Ft=(e,t,n)=>{let r=typeof t=="string"&&n.startsWith("text/csv")?"\uFEFF":"",i=typeof t=="string"?new Blob([r+t],{type:n}):t,a=URL.createObjectURL(i),s=document.createElement("a");s.href=a,s.download=e,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(a)},li=(0,k.createContext)($i),te=()=>(0,k.useContext)(li),vA=$i("block","before:content-[counter(line)]","before:inline-block","before:[counter-increment:line]","before:w-6","before:mr-4","before:text-[13px]","before:text-right","before:text-muted-foreground/50","before:font-mono","before:select-none"),wA=e=>{let t={};for(let n of e.split(";")){let r=n.indexOf(":");if(r>0){let i=n.slice(0,r).trim(),a=n.slice(r+1).trim();i&&a&&(t[i]=a)}}return t},LA=(0,k.memo)(({children:e,result:t,language:n,className:r,startLine:i,lineNumbers:a=!0,...s})=>{let l=te(),o=(0,k.useMemo)(()=>l(vA),[l]),u=(0,k.useMemo)(()=>{let d={};return t.bg&&(d["--sdm-bg"]=t.bg),t.fg&&(d["--sdm-fg"]=t.fg),t.rootStyle&&Object.assign(d,wA(t.rootStyle)),d},[t.bg,t.fg,t.rootStyle]);return(0,m.jsx)("div",{className:l(r,"overflow-x-auto rounded-md border border-border bg-background p-4 text-sm"),"data-language":n,"data-streamdown":"code-block-body",...s,children:(0,m.jsx)("pre",{className:l(r,"bg-[var(--sdm-bg,inherit]","dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit)]"),style:u,children:(0,m.jsx)("code",{className:a?l("[counter-increment:line_0] [counter-reset:line]"):void 0,style:a&&i&&i>1?{counterReset:`line ${i-1}`}:void 0,children:t.tokens.map((d,h)=>(0,m.jsx)("span",{className:a?o:void 0,children:d.length===0||d.length===1&&d[0].content===""?`
111
111
  `:d.map((f,p)=>{let E={},N=!!f.bgColor;if(f.color&&(E["--sdm-c"]=f.color),f.bgColor&&(E["--sdm-tbg"]=f.bgColor),f.htmlStyle)for(let[y,_]of Object.entries(f.htmlStyle))y==="color"?E["--sdm-c"]=_:y==="background-color"?(E["--sdm-tbg"]=_,N=!0):E[y]=_;return(0,m.jsx)("span",{className:l("text-[var(--sdm-c,inherit)]","dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]",N&&"bg-[var(--sdm-tbg)]",N&&"dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]"),style:E,...f.htmlAttrs,children:f.content},p)})},h))})})})},(e,t)=>e.result===t.result&&e.language===t.language&&e.className===t.className&&e.startLine===t.startLine&&e.lineNumbers===t.lineNumbers),RA=({className:e,language:t,style:n,isIncomplete:r,...i})=>{let a=te();return(0,m.jsx)("div",{className:a("my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":"code-block",style:{contentVisibility:"auto",containIntrinsicSize:"auto 200px",...n},...i})},ac=(0,k.createContext)({code:""}),sc=()=>(0,k.useContext)(ac),OA=({language:e})=>{let t=te();return(0,m.jsx)("div",{className:t("flex h-8 items-center text-muted-foreground text-xs"),"data-language":e,"data-streamdown":"code-block-header",children:(0,m.jsx)("span",{className:t("ml-1 font-mono lowercase"),children:e})})},DA=e=>{let t=e.length;for(;t>0&&e[t-1]===`
112
- `;)t--;return e.slice(0,t)},PA=(0,k.lazy)(()=>$s(()=>import("./highlighted-body-OFNGDK62-Bi4CQl8I.js").then(e=>({default:e.HighlightedCodeBlockBody})),__vite__mapDeps([0,1,2,3]))),MA=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,startLine:a,lineNumbers:s,...l})=>{let o=te(),u=(0,k.useMemo)(()=>DA(e),[e]),d=(0,k.useMemo)(()=>({bg:"transparent",fg:"inherit",tokens:u.split(`
112
+ `;)t--;return e.slice(0,t)},PA=(0,k.lazy)(()=>$s(()=>import("./highlighted-body-OFNGDK62-t8UIAZOZ.js").then(e=>({default:e.HighlightedCodeBlockBody})),__vite__mapDeps([0,1,2,3]))),MA=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,startLine:a,lineNumbers:s,...l})=>{let o=te(),u=(0,k.useMemo)(()=>DA(e),[e]),d=(0,k.useMemo)(()=>({bg:"transparent",fg:"inherit",tokens:u.split(`
113
113
  `).map(h=>[{content:h,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[u]);return(0,m.jsx)(ac.Provider,{value:{code:e},children:(0,m.jsxs)(RA,{isIncomplete:i,language:t,children:[(0,m.jsx)(OA,{language:t}),r?(0,m.jsx)("div",{className:o("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:(0,m.jsx)("div",{className:o("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"code-block-actions",children:r})}):null,(0,m.jsx)(k.Suspense,{fallback:(0,m.jsx)(LA,{className:n,language:t,lineNumbers:s,result:d,startLine:a,...l}),children:(0,m.jsx)(PA,{className:n,code:u,language:t,lineNumbers:s,raw:d,startLine:a,...l})})]})})},BA=e=>(0,m.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,m.jsx)("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),FA=e=>(0,m.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,m.jsx)("path",{clipRule:"evenodd",d:"M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z",fill:"currentColor",fillRule:"evenodd"})}),HA=e=>(0,m.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,m.jsx)("path",{clipRule:"evenodd",d:"M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z",fill:"currentColor",fillRule:"evenodd"})}),UA=e=>(0,m.jsxs)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[(0,m.jsx)("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),(0,m.jsx)("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,m.jsx)("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),(0,m.jsx)("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),(0,m.jsx)("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),(0,m.jsx)("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),(0,m.jsx)("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),(0,m.jsx)("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),(0,m.jsx)("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),(0,m.jsx)("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),jA=e=>(0,m.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,m.jsx)("path",{clipRule:"evenodd",d:"M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z",fill:"currentColor",fillRule:"evenodd"})}),zA=e=>(0,m.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,m.jsx)("path",{clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z",fill:"currentColor",fillRule:"evenodd"})}),$A=e=>(0,m.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,m.jsx)("path",{clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z",fill:"currentColor",fillRule:"evenodd"})}),YA=e=>(0,m.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,m.jsx)("path",{clipRule:"evenodd",d:"M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z",fill:"currentColor",fillRule:"evenodd"})}),qA=e=>(0,m.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,m.jsx)("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),VA=e=>(0,m.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,m.jsx)("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),on={CheckIcon:BA,CopyIcon:FA,DownloadIcon:HA,ExternalLinkIcon:YA,Loader2Icon:UA,Maximize2Icon:jA,RotateCcwIcon:zA,XIcon:$A,ZoomInIcon:qA,ZoomOutIcon:VA},oc=(0,k.createContext)(on),WA=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(i=>e[i]===t[i])},ms=({icons:e,children:t})=>{let n=(0,k.useRef)(e),r=(0,k.useRef)(e?{...on,...e}:on);WA(n.current,e)||(n.current=e,r.current=e?{...on,...e}:on);let i=r.current;return(0,m.jsx)(oc.Provider,{value:i,children:t})},Ve=()=>(0,k.useContext)(oc),lc={copyCode:"Copy Code",downloadFile:"Download file",downloadDiagram:"Download diagram",downloadDiagramAsSvg:"Download diagram as SVG",downloadDiagramAsPng:"Download diagram as PNG",downloadDiagramAsMmd:"Download diagram as MMD",viewFullscreen:"View fullscreen",exitFullscreen:"Exit fullscreen",mermaidFormatSvg:"SVG",mermaidFormatPng:"PNG",mermaidFormatMmd:"MMD",copyTable:"Copy table",copyTableAsMarkdown:"Copy table as Markdown",copyTableAsCsv:"Copy table as CSV",copyTableAsTsv:"Copy table as TSV",downloadTable:"Download table",downloadTableAsCsv:"Download table as CSV",downloadTableAsMarkdown:"Download table as Markdown",tableFormatMarkdown:"Markdown",tableFormatCsv:"CSV",tableFormatTsv:"TSV",imageNotAvailable:"Image not available",downloadImage:"Download image",openExternalLink:"Open external link?",externalLinkWarning:"You're about to visit an external website.",close:"Close",copyLink:"Copy link",copied:"Copied",openLink:"Open link"},ci=(0,k.createContext)(lc),at=()=>(0,k.useContext)(ci),gs=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:a,...s})=>{let l=te(),[o,u]=(0,k.useState)(!1),d=(0,k.useRef)(0),{code:h}=sc(),{isAnimating:f}=(0,k.useContext)(Fe),p=at(),E=a??h,N=async()=>{var C;if(typeof window>"u"||!((C=navigator?.clipboard)!=null&&C.writeText)){t?.(new Error("Clipboard API not available"));return}try{o||(await navigator.clipboard.writeText(E),u(!0),e?.(),d.current=window.setTimeout(()=>u(!1),n))}catch(w){t?.(w)}};(0,k.useEffect)(()=>()=>{window.clearTimeout(d.current)},[]);let y=Ve(),_=o?y.CheckIcon:y.CopyIcon;return(0,m.jsx)("button",{className:l("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-copy-button",disabled:f,onClick:N,title:p.copyCode,type:"button",...s,children:r??(0,m.jsx)(_,{size:14})})},Es={"1c":"1c","1c-query":"1cq",abap:"abap","actionscript-3":"as",ada:"ada",adoc:"adoc","angular-html":"html","angular-ts":"ts",apache:"conf",apex:"cls",apl:"apl",applescript:"applescript",ara:"ara",asciidoc:"adoc",asm:"asm",astro:"astro",awk:"awk",ballerina:"bal",bash:"sh",bat:"bat",batch:"bat",be:"be",beancount:"beancount",berry:"berry",bibtex:"bib",bicep:"bicep",blade:"blade.php",bsl:"bsl",c:"c","c#":"cs","c++":"cpp",cadence:"cdc",cairo:"cairo",cdc:"cdc",clarity:"clar",clj:"clj",clojure:"clj","closure-templates":"soy",cmake:"cmake",cmd:"cmd",cobol:"cob",codeowners:"CODEOWNERS",codeql:"ql",coffee:"coffee",coffeescript:"coffee","common-lisp":"lisp",console:"sh",coq:"v",cpp:"cpp",cql:"cql",crystal:"cr",cs:"cs",csharp:"cs",css:"css",csv:"csv",cue:"cue",cypher:"cql",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",docker:"dockerfile",dockerfile:"dockerfile",dotenv:"env","dream-maker":"dm",edge:"edge",elisp:"el",elixir:"ex",elm:"elm","emacs-lisp":"el",erb:"erb",erl:"erl",erlang:"erl",f:"f","f#":"fs",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"f90",f95:"f95",fennel:"fnl",fish:"fish",fluent:"ftl",for:"for","fortran-fixed-form":"f","fortran-free-form":"f90",fs:"fs",fsharp:"fs",fsl:"fsl",ftl:"ftl",gdresource:"tres",gdscript:"gd",gdshader:"gdshader",genie:"gs",gherkin:"feature","git-commit":"gitcommit","git-rebase":"gitrebase",gjs:"js",gleam:"gleam","glimmer-js":"js","glimmer-ts":"ts",glsl:"glsl",gnuplot:"plt",go:"go",gql:"gql",graphql:"graphql",groovy:"groovy",gts:"gts",hack:"hack",haml:"haml",handlebars:"hbs",haskell:"hs",haxe:"hx",hbs:"hbs",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",hs:"hs",html:"html","html-derivative":"html",http:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",jade:"jade",java:"java",javascript:"js",jinja:"jinja",jison:"jison",jl:"jl",js:"js",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",julia:"jl",kotlin:"kt",kql:"kql",kt:"kt",kts:"kts",kusto:"kql",latex:"tex",lean:"lean",lean4:"lean",less:"less",liquid:"liquid",lisp:"lisp",lit:"lit",llvm:"ll",log:"log",logo:"logo",lua:"lua",luau:"luau",make:"mak",makefile:"mak",markdown:"md",marko:"marko",matlab:"m",md:"md",mdc:"mdc",mdx:"mdx",mediawiki:"wiki",mermaid:"mmd",mips:"s",mipsasm:"s",mmd:"mmd",mojo:"mojo",move:"move",nar:"nar",narrat:"narrat",nextflow:"nf",nf:"nf",nginx:"conf",nim:"nim",nix:"nix",nu:"nu",nushell:"nu",objc:"m","objective-c":"m","objective-cpp":"mm",ocaml:"ml",pascal:"pas",perl:"pl",perl6:"p6",php:"php",plsql:"pls",po:"po",polar:"polar",postcss:"pcss",pot:"pot",potx:"potx",powerquery:"pq",powershell:"ps1",prisma:"prisma",prolog:"pl",properties:"properties",proto:"proto",protobuf:"proto",ps:"ps",ps1:"ps1",pug:"pug",puppet:"pp",purescript:"purs",py:"py",python:"py",ql:"ql",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",racket:"rkt",raku:"raku",razor:"cshtml",rb:"rb",reg:"reg",regex:"regex",regexp:"regexp",rel:"rel",riscv:"s",rs:"rs",rst:"rst",ruby:"rb",rust:"rs",sas:"sas",sass:"sass",scala:"scala",scheme:"scm",scss:"scss",sdbl:"sdbl",sh:"sh",shader:"shader",shaderlab:"shader",shell:"sh",shellscript:"sh",shellsession:"sh",smalltalk:"st",solidity:"sol",soy:"soy",sparql:"rq",spl:"spl",splunk:"spl",sql:"sql","ssh-config":"config",stata:"do",styl:"styl",stylus:"styl",svelte:"svelte",swift:"swift","system-verilog":"sv",systemd:"service",talon:"talon",talonscript:"talon",tasl:"tasl",tcl:"tcl",templ:"templ",terraform:"tf",tex:"tex",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"ts","ts-tags":"ts",tsp:"tsp",tsv:"tsv",tsx:"tsx",turtle:"ttl",twig:"twig",typ:"typ",typescript:"ts",typespec:"tsp",typst:"typ",v:"v",vala:"vala",vb:"vb",verilog:"v",vhdl:"vhdl",vim:"vim",viml:"vim",vimscript:"vim",vue:"vue","vue-html":"html","vue-vine":"vine",vy:"vy",vyper:"vy",wasm:"wasm",wenyan:"wy",wgsl:"wgsl",wiki:"wiki",wikitext:"wiki",wit:"wit",wl:"wl",wolfram:"wl",xml:"xml",xsl:"xsl",yaml:"yaml",yml:"yml",zenscript:"zs",zig:"zig",zsh:"zsh",文言:"wy"},GA=({onDownload:e,onError:t,language:n,children:r,className:i,code:a,...s})=>{let l=te(),{code:o}=sc(),{isAnimating:u}=(0,k.useContext)(Fe),d=at(),h=Ve(),f=a??o,p=`file.${n&&n in Es?Es[n]:"txt"}`,E="text/plain",N=()=>{try{Ft(p,f,E),e?.()}catch(y){t?.(y)}};return(0,m.jsx)("button",{className:l("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-download-button",disabled:u,onClick:N,title:d.downloadFile,type:"button",...s,children:r??(0,m.jsx)(h.DownloadIcon,{size:14})})},Ts=()=>{let{Loader2Icon:e}=Ve(),t=te();return(0,m.jsxs)("div",{className:t("w-full divide-y divide-border overflow-hidden rounded-xl border border-border"),children:[(0,m.jsx)("div",{className:t("h-[46px] w-full bg-muted/80")}),(0,m.jsx)("div",{className:t("flex w-full items-center justify-center p-4"),children:(0,m.jsx)(e,{className:t("size-4 animate-spin")})})]})},QA=/\.[^/.]+$/,KA=({node:e,className:t,src:n,alt:r,onLoad:i,onError:a,...s})=>{let{DownloadIcon:l}=Ve(),o=te(),u=(0,k.useRef)(null),[d,h]=(0,k.useState)(!1),[f,p]=(0,k.useState)(!1),E=at(),N=s.width!=null||s.height!=null,y=(d||N)&&!f,_=f&&!N;(0,k.useEffect)(()=>{let O=u.current;if(O!=null&&O.complete){let S=O.naturalWidth>0;h(S),p(!S)}},[]);let C=(0,k.useCallback)(O=>{h(!0),p(!1),i?.(O)},[i]),w=(0,k.useCallback)(O=>{h(!1),p(!0),a?.(O)},[a]),R=async()=>{if(n)try{let O=await(await fetch(n)).blob(),S=new URL(n,window.location.origin).pathname.split("/").pop()||"",$=S.split(".").pop(),Y=S.includes(".")&&$!==void 0&&$.length<=4,W="";if(Y)W=S;else{let I=O.type,U="png";I.includes("jpeg")||I.includes("jpg")?U="jpg":I.includes("png")?U="png":I.includes("svg")?U="svg":I.includes("gif")?U="gif":I.includes("webp")&&(U="webp"),W=`${(r||S||"image").replace(QA,"")}.${U}`}Ft(W,O,O.type)}catch{window.open(n,"_blank")}};return n?(0,m.jsxs)("div",{className:o("group relative my-4 inline-block"),"data-streamdown":"image-wrapper",children:[(0,m.jsx)("img",{alt:r,className:o("max-w-full rounded-lg",_&&"hidden",t),"data-streamdown":"image",onError:w,onLoad:C,ref:u,src:n,...s}),_&&(0,m.jsx)("span",{className:o("text-muted-foreground text-xs italic"),"data-streamdown":"image-fallback",children:E.imageNotAvailable}),(0,m.jsx)("div",{className:o("pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block")}),y&&(0,m.jsx)("button",{className:o("absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background","opacity-0 group-hover:opacity-100"),onClick:R,title:E.downloadImage,type:"button",children:(0,m.jsx)(l,{size:14})})]}):null},mn=0,Yi=()=>{mn+=1,mn===1&&(document.body.style.overflow="hidden")},qi=()=>{mn=Math.max(0,mn-1),mn===0&&(document.body.style.overflow="")},XA=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:i,CopyIcon:a,ExternalLinkIcon:s,XIcon:l}=Ve(),o=te(),[u,d]=(0,k.useState)(!1),h=at(),f=(0,k.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),d(!0),setTimeout(()=>d(!1),2e3)}catch{}},[e]),p=(0,k.useCallback)(()=>{r(),n()},[r,n]);return(0,k.useEffect)(()=>{if(t){Yi();let E=N=>{N.key==="Escape"&&n()};return document.addEventListener("keydown",E),()=>{document.removeEventListener("keydown",E),qi()}}},[t,n]),t?(0,m.jsx)("div",{className:o("fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm"),"data-streamdown":"link-safety-modal",onClick:n,onKeyDown:E=>{E.key==="Escape"&&n()},role:"button",tabIndex:0,children:(0,m.jsxs)("div",{className:o("relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg"),onClick:E=>E.stopPropagation(),onKeyDown:E=>E.stopPropagation(),role:"presentation",children:[(0,m.jsx)("button",{className:o("absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:n,title:h.close,type:"button",children:(0,m.jsx)(l,{size:16})}),(0,m.jsxs)("div",{className:o("flex flex-col gap-2"),children:[(0,m.jsxs)("div",{className:o("flex items-center gap-2 font-semibold text-lg"),children:[(0,m.jsx)(s,{size:20}),(0,m.jsx)("span",{children:h.openExternalLink})]}),(0,m.jsx)("p",{className:o("text-muted-foreground text-sm"),children:h.externalLinkWarning})]}),(0,m.jsx)("div",{className:o("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),(0,m.jsxs)("div",{className:o("flex gap-2"),children:[(0,m.jsx)("button",{className:o("flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted"),onClick:f,type:"button",children:u?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(i,{size:14}),(0,m.jsx)("span",{children:h.copied})]}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(a,{size:14}),(0,m.jsx)("span",{children:h.copyLink})]})}),(0,m.jsxs)("button",{className:o("flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90"),onClick:p,type:"button",children:[(0,m.jsx)(s,{size:14}),(0,m.jsx)("span",{children:h.openLink})]})]})]})}):null},ui=(0,k.createContext)(null),Vi=()=>(0,k.useContext)(ui),Jx=()=>{var e;let t=Vi();return(e=t?.code)!=null?e:null},Wi=()=>{var e;let t=Vi();return(e=t?.mermaid)!=null?e:null},ZA=e=>{var t;let n=Vi();return n!=null&&n.renderers&&e&&(t=n.renderers.find(r=>Array.isArray(r.language)?r.language.includes(e):r.language===e))!=null?t:null},JA=(e,t)=>{var n;let r=(n=void 0)!=null?n:5;return new Promise((i,a)=>{let s="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e))),l=new Image;l.crossOrigin="anonymous",l.onload=()=>{let o=document.createElement("canvas"),u=l.width*r,d=l.height*r;o.width=u,o.height=d;let h=o.getContext("2d");if(!h){a(new Error("Failed to create 2D canvas context for PNG export"));return}h.drawImage(l,0,0,u,d),o.toBlob(f=>{if(!f){a(new Error("Failed to create PNG blob"));return}i(f)},"image/png")},l.onerror=()=>a(new Error("Failed to load SVG image")),l.src=s})},e_=({chart:e,children:t,className:n,onDownload:r,config:i,onError:a})=>{let s=te(),[l,o]=(0,k.useState)(!1),u=(0,k.useRef)(null),{isAnimating:d}=(0,k.useContext)(Fe),h=Ve(),f=Wi(),p=at(),E=async N=>{try{if(N==="mmd"){Ft("diagram.mmd",e,"text/plain"),o(!1),r?.(N);return}if(!f){a?.(new Error("Mermaid plugin not available"));return}let y=f.getMermaid(i),_=e.split("").reduce((R,O)=>(R<<5)-R+O.charCodeAt(0)|0,0),C=`mermaid-${Math.abs(_)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:w}=await y.render(C,e);if(!w){a?.(new Error("SVG not found. Please wait for the diagram to render."));return}if(N==="svg"){Ft("diagram.svg",w,"image/svg+xml"),o(!1),r?.(N);return}if(N==="png"){Ft("diagram.png",await JA(w),"image/png"),r?.(N),o(!1);return}}catch(y){a?.(y)}};return(0,k.useEffect)(()=>{let N=y=>{let _=y.composedPath();u.current&&!_.includes(u.current)&&o(!1)};return document.addEventListener("mousedown",N),()=>{document.removeEventListener("mousedown",N)}},[]),(0,m.jsxs)("div",{className:s("relative"),ref:u,children:[(0,m.jsx)("button",{className:s("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",n),disabled:d,onClick:()=>o(!l),title:p.downloadDiagram,type:"button",children:t??(0,m.jsx)(h.DownloadIcon,{size:14})}),l?(0,m.jsxs)("div",{className:s("absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[(0,m.jsx)("button",{className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>E("svg"),title:p.downloadDiagramAsSvg,type:"button",children:p.mermaidFormatSvg}),(0,m.jsx)("button",{className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>E("png"),title:p.downloadDiagramAsPng,type:"button",children:p.mermaidFormatPng}),(0,m.jsx)("button",{className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>E("mmd"),title:p.downloadDiagramAsMmd,type:"button",children:p.mermaidFormatMmd})]}):null]})},t_=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...a})=>{let{Maximize2Icon:s,XIcon:l}=Ve(),o=te(),[u,d]=(0,k.useState)(!1),{isAnimating:h,controls:f}=(0,k.useContext)(Fe),p=at(),E=(()=>{if(typeof f=="boolean")return f;let y=f.mermaid;return y===!1?!1:y===!0||y===void 0?!0:y.panZoom!==!1})(),N=()=>{d(!u)};return(0,k.useEffect)(()=>{if(u){Yi();let y=_=>{_.key==="Escape"&&d(!1)};return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y),qi()}}},[u]),(0,k.useEffect)(()=>{u?n?.():r&&r()},[u,n,r]),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("button",{className:o("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),disabled:h,onClick:N,title:p.viewFullscreen,type:"button",...a,children:(0,m.jsx)(s,{size:14})}),u?(0,Wl.createPortal)((0,m.jsxs)("div",{className:o("fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm"),onClick:N,onKeyDown:y=>{y.key==="Escape"&&N()},role:"button",tabIndex:0,children:[(0,m.jsx)("button",{className:o("absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:N,title:p.exitFullscreen,type:"button",children:(0,m.jsx)(l,{size:20})}),(0,m.jsx)("div",{className:o("flex size-full items-center justify-center p-4"),onClick:y=>y.stopPropagation(),onKeyDown:y=>y.stopPropagation(),role:"presentation",children:(0,m.jsx)(G_,{chart:e,className:o("size-full [&_svg]:h-auto [&_svg]:w-auto"),config:t,fullscreen:!0,showControls:E})})]}),document.body):null]})},cc=e=>{var t,n;let r=[],i=[],a=e.querySelectorAll("thead th");for(let l of a)r.push(((t=l.textContent)==null?void 0:t.trim())||"");let s=e.querySelectorAll("tbody tr");for(let l of s){let o=[],u=l.querySelectorAll("td");for(let d of u)o.push(((n=d.textContent)==null?void 0:n.trim())||"");i.push(o)}return{headers:r,rows:i}},uc=e=>{let{headers:t,rows:n}=e,r=l=>{let o=!1,u=!1;for(let d of l){if(d==='"'){o=!0,u=!0;break}(d===","||d===`
114
114
  `)&&(o=!0)}return o?u?`"${l.replace(/"/g,'""')}"`:`"${l}"`:l},i=t.length>0?n.length+1:n.length,a=new Array(i),s=0;t.length>0&&(a[s]=t.map(r).join(","),s+=1);for(let l of n)a[s]=l.map(r).join(","),s+=1;return a.join(`
115
115
  `)},n_=e=>{let{headers:t,rows:n}=e,r=l=>{let o=!1;for(let d of l)if(d===" "||d===`
116
116
  `||d==="\r"){o=!0;break}if(!o)return l;let u=[];for(let d of l)d===" "?u.push("\\t"):d===`
117
117
  `?u.push("\\n"):d==="\r"?u.push("\\r"):u.push(d);return u.join("")},i=t.length>0?n.length+1:n.length,a=new Array(i),s=0;t.length>0&&(a[s]=t.map(r).join(" "),s+=1);for(let l of n)a[s]=l.map(r).join(" "),s+=1;return a.join(`
118
118
  `)},Fr=e=>{let t=!1;for(let r of e)if(r==="\\"||r==="|"){t=!0;break}if(!t)return e;let n=[];for(let r of e)r==="\\"?n.push("\\\\"):r==="|"?n.push("\\|"):n.push(r);return n.join("")},hi=e=>{let{headers:t,rows:n}=e;if(t.length===0)return"";let r=new Array(n.length+2),i=0,a=t.map(l=>Fr(l));r[i]=`| ${a.join(" | ")} |`,i+=1;let s=new Array(t.length);for(let l=0;l<t.length;l+=1)s[l]="---";r[i]=`| ${s.join(" | ")} |`,i+=1;for(let l of n)if(l.length<t.length){let o=new Array(t.length);for(let u=0;u<t.length;u+=1)o[u]=u<l.length?Fr(l[u]):"";r[i]=`| ${o.join(" | ")} |`,i+=1}else{let o=l.map(u=>Fr(u));r[i]=`| ${o.join(" | ")} |`,i+=1}return r.join(`
119
- `)},hc=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let a=te(),[s,l]=(0,k.useState)(!1),[o,u]=(0,k.useState)(!1),d=(0,k.useRef)(null),h=(0,k.useRef)(0),{isAnimating:f}=(0,k.useContext)(Fe),p=at(),E=async _=>{var C,w;if(typeof window>"u"||!((C=navigator?.clipboard)!=null&&C.write)){r?.(new Error("Clipboard API not available"));return}try{let R=(w=d.current)==null?void 0:w.closest('[data-streamdown="table-wrapper"]'),O=R?.querySelector("table");if(!O){r?.(new Error("Table not found"));return}let S=cc(O),$=({csv:uc,tsv:n_,md:hi}[_]||hi)(S),Y=new ClipboardItem({"text/plain":new Blob([$],{type:"text/plain"}),"text/html":new Blob([O.outerHTML],{type:"text/html"})});await navigator.clipboard.write([Y]),u(!0),l(!1),n?.(_),h.current=window.setTimeout(()=>u(!1),i)}catch(R){r?.(R)}};(0,k.useEffect)(()=>{let _=C=>{let w=C.composedPath();d.current&&!w.includes(d.current)&&l(!1)};return document.addEventListener("mousedown",_),()=>{document.removeEventListener("mousedown",_),window.clearTimeout(h.current)}},[]);let N=Ve(),y=o?N.CheckIcon:N.CopyIcon;return(0,m.jsxs)("div",{className:a("relative"),ref:d,children:[(0,m.jsx)("button",{className:a("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:f,onClick:()=>l(!s),title:p.copyTable,type:"button",children:e??(0,m.jsx)(y,{height:14,width:14})}),s?(0,m.jsxs)("div",{className:a("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[(0,m.jsx)("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>E("md"),title:p.copyTableAsMarkdown,type:"button",children:p.tableFormatMarkdown}),(0,m.jsx)("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>E("csv"),title:p.copyTableAsCsv,type:"button",children:p.tableFormatCsv}),(0,m.jsx)("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>E("tsv"),title:p.copyTableAsTsv,type:"button",children:p.tableFormatTsv})]}):null]})},dc=({children:e,className:t,onDownload:n,onError:r})=>{let i=te(),[a,s]=(0,k.useState)(!1),l=(0,k.useRef)(null),{isAnimating:o}=(0,k.useContext)(Fe),u=at(),d=Ve(),h=f=>{var p;try{let E=(p=l.current)==null?void 0:p.closest('[data-streamdown="table-wrapper"]'),N=E?.querySelector("table");if(!N){r?.(new Error("Table not found"));return}let y=cc(N),_=f==="csv"?uc(y):hi(y);Ft(`table.${f==="csv"?"csv":"md"}`,_,f==="csv"?"text/csv":"text/markdown"),s(!1),n?.(f)}catch(E){r?.(E)}};return(0,k.useEffect)(()=>{let f=p=>{let E=p.composedPath();l.current&&!E.includes(l.current)&&s(!1)};return document.addEventListener("mousedown",f),()=>{document.removeEventListener("mousedown",f)}},[]),(0,m.jsxs)("div",{className:i("relative"),ref:l,children:[(0,m.jsx)("button",{className:i("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:o,onClick:()=>s(!a),title:u.downloadTable,type:"button",children:e??(0,m.jsx)(d.DownloadIcon,{size:14})}),a?(0,m.jsxs)("div",{className:i("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[(0,m.jsx)("button",{className:i("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>h("csv"),title:u.downloadTableAsCsv,type:"button",children:u.tableFormatCsv}),(0,m.jsx)("button",{className:i("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>h("markdown"),title:u.downloadTableAsMarkdown,type:"button",children:u.tableFormatMarkdown})]}):null]})},r_=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:a}=Ve(),s=te(),[l,o]=(0,k.useState)(!1),{isAnimating:u}=(0,k.useContext)(Fe),d=at(),h=()=>{o(!0)},f=()=>{o(!1)};return(0,k.useEffect)(()=>{if(l){Yi();let p=E=>{E.key==="Escape"&&o(!1)};return document.addEventListener("keydown",p),()=>{document.removeEventListener("keydown",p),qi()}}},[l]),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("button",{className:s("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:u,onClick:h,title:d.viewFullscreen,type:"button",children:(0,m.jsx)(i,{size:14})}),l?(0,Wl.createPortal)((0,m.jsx)("div",{"aria-label":d.viewFullscreen,"aria-modal":"true",className:s("fixed inset-0 z-50 flex flex-col bg-background"),"data-streamdown":"table-fullscreen",onClick:f,onKeyDown:p=>{p.key==="Escape"&&f()},role:"dialog",children:(0,m.jsxs)("div",{className:s("flex h-full flex-col"),onClick:p=>p.stopPropagation(),onKeyDown:p=>p.stopPropagation(),role:"presentation",children:[(0,m.jsxs)("div",{className:s("flex items-center justify-end gap-1 p-4"),children:[n?(0,m.jsx)(hc,{}):null,r?(0,m.jsx)(dc,{}):null,(0,m.jsx)("button",{className:s("rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:f,title:d.exitFullscreen,type:"button",children:(0,m.jsx)(a,{size:20})})]}),(0,m.jsx)("div",{className:s("flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10"),children:(0,m.jsx)("table",{className:s("w-full border-collapse border border-border"),"data-streamdown":"table",children:e})})]})}),document.body):null]})},i_=({children:e,className:t,showControls:n,showCopy:r=!0,showDownload:i=!0,showFullscreen:a=!0,...s})=>{let l=te(),o=n&&r,u=n&&i,d=n&&a,h=o||u||d;return(0,m.jsxs)("div",{className:l("my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2"),"data-streamdown":"table-wrapper",children:[h?(0,m.jsxs)("div",{className:l("flex items-center justify-end gap-1"),children:[o?(0,m.jsx)(hc,{}):null,u?(0,m.jsx)(dc,{}):null,d?(0,m.jsx)(r_,{showCopy:o,showDownload:u,children:e}):null]}):null,(0,m.jsx)("div",{className:l("border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background"),children:(0,m.jsx)("table",{className:l("w-full divide-y divide-border",t),"data-streamdown":"table",...s,children:e})})]})},a_=/startLine=(\d+)/,s_=/\bnoLineNumbers\b/,o_=(0,k.lazy)(()=>$s(()=>import("./mermaid-GHXKKRXX-B7fOqMvZ.js").then(e=>({default:e.Mermaid})),[])),l_=/language-([^\s]+)/;function gr(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,i=e.position.end,a=t.position.end;return n?.line===r?.line&&n?.column===r?.column&&i?.line===a?.line&&i?.column===a?.column}function ge(e,t){return e.className===t.className&&gr(e.node,t.node)}var di=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,Hr=(e,t)=>{if(typeof e=="boolean")return e;let n=e.table;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},bs=(e,t)=>{if(typeof e=="boolean")return e;let n=e.code;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},Un=(e,t)=>{if(typeof e=="boolean")return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},Gi=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("ol",{className:i("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...r,children:e})},(e,t)=>ge(e,t));Gi.displayName="MarkdownOl";var fc=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("li",{className:i("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...r,children:e})},(e,t)=>e.className===t.className&&gr(e.node,t.node));fc.displayName="MarkdownLi";var pc=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("ul",{className:i("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...r,children:e})},(e,t)=>ge(e,t));pc.displayName="MarkdownUl";var mc=(0,k.memo)(({className:e,node:t,...n})=>{let r=te();return(0,m.jsx)("hr",{className:r("my-6 border-border",e),"data-streamdown":"horizontal-rule",...n})},(e,t)=>ge(e,t));mc.displayName="MarkdownHr";var gc=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("span",{className:i("font-semibold",t),"data-streamdown":"strong",...r,children:e})},(e,t)=>ge(e,t));gc.displayName="MarkdownStrong";var c_=({children:e,className:t,href:n,node:r,...i})=>{let a=te(),{linkSafety:s}=(0,k.useContext)(Fe),[l,o]=(0,k.useState)(!1),u=n==="streamdown:incomplete-link",d=(0,k.useCallback)(async E=>{if(!(!(s!=null&&s.enabled&&n)||u)){if(E.preventDefault(),s.onLinkCheck&&await s.onLinkCheck(n)){window.open(n,"_blank","noreferrer");return}o(!0)}},[s,n,u]),h=(0,k.useCallback)(()=>{n&&window.open(n,"_blank","noreferrer")},[n]),f=(0,k.useCallback)(()=>{o(!1)},[]),p={url:n??"",isOpen:l,onClose:f,onConfirm:h};return s!=null&&s.enabled&&n?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("button",{className:a("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":u,"data-streamdown":"link",onClick:d,type:"button",children:e}),s.renderModal?s.renderModal(p):(0,m.jsx)(XA,{...p})]}):(0,m.jsx)("a",{className:a("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":u,"data-streamdown":"link",href:n,rel:"noreferrer",target:"_blank",...i,children:e})},Ec=(0,k.memo)(c_,(e,t)=>ge(e,t)&&e.href===t.href);Ec.displayName="MarkdownA";var Tc=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("h1",{className:i("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...r,children:e})},(e,t)=>ge(e,t));Tc.displayName="MarkdownH1";var bc=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("h2",{className:i("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...r,children:e})},(e,t)=>ge(e,t));bc.displayName="MarkdownH2";var kc=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("h3",{className:i("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...r,children:e})},(e,t)=>ge(e,t));kc.displayName="MarkdownH3";var Ac=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("h4",{className:i("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...r,children:e})},(e,t)=>ge(e,t));Ac.displayName="MarkdownH4";var _c=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("h5",{className:i("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...r,children:e})},(e,t)=>ge(e,t));_c.displayName="MarkdownH5";var xc=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("h6",{className:i("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...r,children:e})},(e,t)=>ge(e,t));xc.displayName="MarkdownH6";var yc=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let{controls:i}=(0,k.useContext)(Fe),a=di(i,"table"),s=Hr(i,"copy"),l=Hr(i,"download"),o=Hr(i,"fullscreen");return(0,m.jsx)(i_,{className:t,showControls:a,showCopy:s,showDownload:l,showFullscreen:o,...r,children:e})},(e,t)=>ge(e,t));yc.displayName="MarkdownTable";var Cc=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("thead",{className:i("bg-muted/80",t),"data-streamdown":"table-header",...r,children:e})},(e,t)=>ge(e,t));Cc.displayName="MarkdownThead";var Sc=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("tbody",{className:i("divide-y divide-border",t),"data-streamdown":"table-body",...r,children:e})},(e,t)=>ge(e,t));Sc.displayName="MarkdownTbody";var Nc=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("tr",{className:i("border-border",t),"data-streamdown":"table-row",...r,children:e})},(e,t)=>ge(e,t));Nc.displayName="MarkdownTr";var Ic=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("th",{className:i("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...r,children:e})},(e,t)=>ge(e,t));Ic.displayName="MarkdownTh";var vc=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("td",{className:i("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...r,children:e})},(e,t)=>ge(e,t));vc.displayName="MarkdownTd";var wc=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("blockquote",{className:i("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...r,children:e})},(e,t)=>ge(e,t));wc.displayName="MarkdownBlockquote";var Lc=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("sup",{className:i("text-sm",t),"data-streamdown":"superscript",...r,children:e})},(e,t)=>ge(e,t));Lc.displayName="MarkdownSup";var Rc=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("sub",{className:i("text-sm",t),"data-streamdown":"subscript",...r,children:e})},(e,t)=>ge(e,t));Rc.displayName="MarkdownSub";var Oc=(0,k.memo)(({children:e,className:t,node:n,...r})=>{if("data-footnotes"in r){let i=s=>{var l,o;if(!(0,k.isValidElement)(s))return!1;let u=Array.isArray(s.props.children)?s.props.children:[s.props.children],d=!1,h=!1;for(let f of u)if(f){if(typeof f=="string")f.trim()!==""&&(d=!0);else if((0,k.isValidElement)(f))if(((l=f.props)==null?void 0:l["data-footnote-backref"])!==void 0)h=!0;else{let p=Array.isArray(f.props.children)?f.props.children:[f.props.children];for(let E of p){if(typeof E=="string"&&E.trim()!==""){d=!0;break}if((0,k.isValidElement)(E)&&((o=E.props)==null?void 0:o["data-footnote-backref"])===void 0){d=!0;break}}}}return h&&!d},a=Array.isArray(e)?e.map(s=>{if(!(0,k.isValidElement)(s))return s;if(s.type===Gi){let l=(Array.isArray(s.props.children)?s.props.children:[s.props.children]).filter(o=>!i(o));return l.length===0?null:{...s,props:{...s.props,children:l}}}return s}):e;return(Array.isArray(a)?a.some(s=>s!==null):a!==null)?(0,m.jsx)("section",{className:t,...r,children:a}):null}return(0,m.jsx)("section",{className:t,...r,children:e})},(e,t)=>ge(e,t));Oc.displayName="MarkdownSection";var u_=({node:e,className:t,children:n,...r})=>{var i,a;let s=te(),l=!("data-block"in r),{mermaid:o,controls:u,lineNumbers:d}=(0,k.useContext)(Fe),h=Wi(),f=SA(),p=t?.match(l_),E=(i=p?.at(1))!=null?i:"",N=ZA(E);if(l)return(0,m.jsx)("code",{className:s("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...r,children:n});let y=(a=e?.properties)==null?void 0:a.metastring,_=y?.match(a_),C=_?Number.parseInt(_[1],10):void 0,w=C!==void 0&&C>=1?C:void 0,R=!(y&&s_.test(y))&&d!==!1,O="";if((0,k.isValidElement)(n)&&n.props&&typeof n.props=="object"&&"children"in n.props&&typeof n.props.children=="string"?O=n.props.children:typeof n=="string"&&(O=n),N){let W=N.component;return(0,m.jsx)(k.Suspense,{fallback:(0,m.jsx)(Ts,{}),children:(0,m.jsx)(W,{code:O,isIncomplete:f,language:E,meta:y})})}if(E==="mermaid"&&h){let W=di(u,"mermaid"),I=Un(u,"download"),U=Un(u,"copy"),z=Un(u,"fullscreen"),q=Un(u,"panZoom"),J=W&&(I||U||z);return(0,m.jsx)(k.Suspense,{fallback:(0,m.jsx)(Ts,{}),children:(0,m.jsxs)("div",{className:s("group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",t),"data-streamdown":"mermaid-block",children:[(0,m.jsx)("div",{className:s("flex h-8 items-center text-muted-foreground text-xs"),children:(0,m.jsx)("span",{className:s("ml-1 font-mono lowercase"),children:"mermaid"})}),J?(0,m.jsx)("div",{className:s("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:(0,m.jsxs)("div",{className:s("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"mermaid-block-actions",children:[I?(0,m.jsx)(e_,{chart:O,config:o?.config}):null,U?(0,m.jsx)(gs,{code:O}):null,z?(0,m.jsx)(t_,{chart:O,config:o?.config}):null]})}):null,(0,m.jsx)("div",{className:s("rounded-md border border-border bg-background"),children:(0,m.jsx)(o_,{chart:O,config:o?.config,showControls:q})})]})})}let S=di(u,"code"),$=bs(u,"download"),Y=bs(u,"copy");return(0,m.jsx)(MA,{className:t,code:O,isIncomplete:f,language:E,lineNumbers:R,startLine:w,children:S?(0,m.jsxs)(m.Fragment,{children:[$?(0,m.jsx)(GA,{code:O,language:E}):null,Y?(0,m.jsx)(gs,{}):null]}):null})},Dc=(0,k.memo)(u_,(e,t)=>e.className===t.className&&gr(e.node,t.node));Dc.displayName="MarkdownCode";var Pc=(0,k.memo)(KA,(e,t)=>e.className===t.className&&gr(e.node,t.node));Pc.displayName="MarkdownImg";var Mc=(0,k.memo)(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(i=>i!=null&&i!=="");if(r.length===1&&(0,k.isValidElement)(r[0])){let i=r[0].props.node,a=i?.tagName;if(a==="img")return(0,m.jsx)(m.Fragment,{children:e});if(a==="code"&&"data-block"in r[0].props)return(0,m.jsx)(m.Fragment,{children:e})}return(0,m.jsx)("p",{...n,children:e})},(e,t)=>ge(e,t));Mc.displayName="MarkdownParagraph";var h_={ol:Gi,li:fc,ul:pc,hr:mc,strong:gc,a:Ec,h1:Tc,h2:bc,h3:kc,h4:Ac,h5:_c,h6:xc,table:yc,thead:Cc,tbody:Sc,tr:Nc,th:Ic,td:vc,blockquote:wc,code:Dc,img:Pc,pre:({children:e})=>(0,k.isValidElement)(e)?(0,k.cloneElement)(e,{"data-block":"true"}):e,sup:Lc,sub:Rc,p:Mc,section:Oc},d_=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,f_=/\p{L}/u;function ks(e){let t=e.replace(/^#{1,6}\s+/gm,"").replace(/(\*{1,3}|_{1,3})/g,"").replace(/`[^`]*`/g,"").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/^[\s>*\-+\d.]+/gm,"");for(let n of t){if(d_.test(n))return"rtl";if(f_.test(n))return"ltr"}return"ltr"}var p_=/^[ \t]{0,3}(`{3,}|~{3,})/,m_=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,As=e=>{let t=e.split(`
119
+ `)},hc=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let a=te(),[s,l]=(0,k.useState)(!1),[o,u]=(0,k.useState)(!1),d=(0,k.useRef)(null),h=(0,k.useRef)(0),{isAnimating:f}=(0,k.useContext)(Fe),p=at(),E=async _=>{var C,w;if(typeof window>"u"||!((C=navigator?.clipboard)!=null&&C.write)){r?.(new Error("Clipboard API not available"));return}try{let R=(w=d.current)==null?void 0:w.closest('[data-streamdown="table-wrapper"]'),O=R?.querySelector("table");if(!O){r?.(new Error("Table not found"));return}let S=cc(O),$=({csv:uc,tsv:n_,md:hi}[_]||hi)(S),Y=new ClipboardItem({"text/plain":new Blob([$],{type:"text/plain"}),"text/html":new Blob([O.outerHTML],{type:"text/html"})});await navigator.clipboard.write([Y]),u(!0),l(!1),n?.(_),h.current=window.setTimeout(()=>u(!1),i)}catch(R){r?.(R)}};(0,k.useEffect)(()=>{let _=C=>{let w=C.composedPath();d.current&&!w.includes(d.current)&&l(!1)};return document.addEventListener("mousedown",_),()=>{document.removeEventListener("mousedown",_),window.clearTimeout(h.current)}},[]);let N=Ve(),y=o?N.CheckIcon:N.CopyIcon;return(0,m.jsxs)("div",{className:a("relative"),ref:d,children:[(0,m.jsx)("button",{className:a("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:f,onClick:()=>l(!s),title:p.copyTable,type:"button",children:e??(0,m.jsx)(y,{height:14,width:14})}),s?(0,m.jsxs)("div",{className:a("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[(0,m.jsx)("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>E("md"),title:p.copyTableAsMarkdown,type:"button",children:p.tableFormatMarkdown}),(0,m.jsx)("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>E("csv"),title:p.copyTableAsCsv,type:"button",children:p.tableFormatCsv}),(0,m.jsx)("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>E("tsv"),title:p.copyTableAsTsv,type:"button",children:p.tableFormatTsv})]}):null]})},dc=({children:e,className:t,onDownload:n,onError:r})=>{let i=te(),[a,s]=(0,k.useState)(!1),l=(0,k.useRef)(null),{isAnimating:o}=(0,k.useContext)(Fe),u=at(),d=Ve(),h=f=>{var p;try{let E=(p=l.current)==null?void 0:p.closest('[data-streamdown="table-wrapper"]'),N=E?.querySelector("table");if(!N){r?.(new Error("Table not found"));return}let y=cc(N),_=f==="csv"?uc(y):hi(y);Ft(`table.${f==="csv"?"csv":"md"}`,_,f==="csv"?"text/csv":"text/markdown"),s(!1),n?.(f)}catch(E){r?.(E)}};return(0,k.useEffect)(()=>{let f=p=>{let E=p.composedPath();l.current&&!E.includes(l.current)&&s(!1)};return document.addEventListener("mousedown",f),()=>{document.removeEventListener("mousedown",f)}},[]),(0,m.jsxs)("div",{className:i("relative"),ref:l,children:[(0,m.jsx)("button",{className:i("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:o,onClick:()=>s(!a),title:u.downloadTable,type:"button",children:e??(0,m.jsx)(d.DownloadIcon,{size:14})}),a?(0,m.jsxs)("div",{className:i("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[(0,m.jsx)("button",{className:i("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>h("csv"),title:u.downloadTableAsCsv,type:"button",children:u.tableFormatCsv}),(0,m.jsx)("button",{className:i("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>h("markdown"),title:u.downloadTableAsMarkdown,type:"button",children:u.tableFormatMarkdown})]}):null]})},r_=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:a}=Ve(),s=te(),[l,o]=(0,k.useState)(!1),{isAnimating:u}=(0,k.useContext)(Fe),d=at(),h=()=>{o(!0)},f=()=>{o(!1)};return(0,k.useEffect)(()=>{if(l){Yi();let p=E=>{E.key==="Escape"&&o(!1)};return document.addEventListener("keydown",p),()=>{document.removeEventListener("keydown",p),qi()}}},[l]),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("button",{className:s("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:u,onClick:h,title:d.viewFullscreen,type:"button",children:(0,m.jsx)(i,{size:14})}),l?(0,Wl.createPortal)((0,m.jsx)("div",{"aria-label":d.viewFullscreen,"aria-modal":"true",className:s("fixed inset-0 z-50 flex flex-col bg-background"),"data-streamdown":"table-fullscreen",onClick:f,onKeyDown:p=>{p.key==="Escape"&&f()},role:"dialog",children:(0,m.jsxs)("div",{className:s("flex h-full flex-col"),onClick:p=>p.stopPropagation(),onKeyDown:p=>p.stopPropagation(),role:"presentation",children:[(0,m.jsxs)("div",{className:s("flex items-center justify-end gap-1 p-4"),children:[n?(0,m.jsx)(hc,{}):null,r?(0,m.jsx)(dc,{}):null,(0,m.jsx)("button",{className:s("rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:f,title:d.exitFullscreen,type:"button",children:(0,m.jsx)(a,{size:20})})]}),(0,m.jsx)("div",{className:s("flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10"),children:(0,m.jsx)("table",{className:s("w-full border-collapse border border-border"),"data-streamdown":"table",children:e})})]})}),document.body):null]})},i_=({children:e,className:t,showControls:n,showCopy:r=!0,showDownload:i=!0,showFullscreen:a=!0,...s})=>{let l=te(),o=n&&r,u=n&&i,d=n&&a,h=o||u||d;return(0,m.jsxs)("div",{className:l("my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2"),"data-streamdown":"table-wrapper",children:[h?(0,m.jsxs)("div",{className:l("flex items-center justify-end gap-1"),children:[o?(0,m.jsx)(hc,{}):null,u?(0,m.jsx)(dc,{}):null,d?(0,m.jsx)(r_,{showCopy:o,showDownload:u,children:e}):null]}):null,(0,m.jsx)("div",{className:l("border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background"),children:(0,m.jsx)("table",{className:l("w-full divide-y divide-border",t),"data-streamdown":"table",...s,children:e})})]})},a_=/startLine=(\d+)/,s_=/\bnoLineNumbers\b/,o_=(0,k.lazy)(()=>$s(()=>import("./mermaid-GHXKKRXX-D35eppUc.js").then(e=>({default:e.Mermaid})),[])),l_=/language-([^\s]+)/;function gr(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,i=e.position.end,a=t.position.end;return n?.line===r?.line&&n?.column===r?.column&&i?.line===a?.line&&i?.column===a?.column}function ge(e,t){return e.className===t.className&&gr(e.node,t.node)}var di=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,Hr=(e,t)=>{if(typeof e=="boolean")return e;let n=e.table;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},bs=(e,t)=>{if(typeof e=="boolean")return e;let n=e.code;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},Un=(e,t)=>{if(typeof e=="boolean")return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},Gi=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("ol",{className:i("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...r,children:e})},(e,t)=>ge(e,t));Gi.displayName="MarkdownOl";var fc=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("li",{className:i("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...r,children:e})},(e,t)=>e.className===t.className&&gr(e.node,t.node));fc.displayName="MarkdownLi";var pc=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("ul",{className:i("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...r,children:e})},(e,t)=>ge(e,t));pc.displayName="MarkdownUl";var mc=(0,k.memo)(({className:e,node:t,...n})=>{let r=te();return(0,m.jsx)("hr",{className:r("my-6 border-border",e),"data-streamdown":"horizontal-rule",...n})},(e,t)=>ge(e,t));mc.displayName="MarkdownHr";var gc=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("span",{className:i("font-semibold",t),"data-streamdown":"strong",...r,children:e})},(e,t)=>ge(e,t));gc.displayName="MarkdownStrong";var c_=({children:e,className:t,href:n,node:r,...i})=>{let a=te(),{linkSafety:s}=(0,k.useContext)(Fe),[l,o]=(0,k.useState)(!1),u=n==="streamdown:incomplete-link",d=(0,k.useCallback)(async E=>{if(!(!(s!=null&&s.enabled&&n)||u)){if(E.preventDefault(),s.onLinkCheck&&await s.onLinkCheck(n)){window.open(n,"_blank","noreferrer");return}o(!0)}},[s,n,u]),h=(0,k.useCallback)(()=>{n&&window.open(n,"_blank","noreferrer")},[n]),f=(0,k.useCallback)(()=>{o(!1)},[]),p={url:n??"",isOpen:l,onClose:f,onConfirm:h};return s!=null&&s.enabled&&n?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("button",{className:a("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":u,"data-streamdown":"link",onClick:d,type:"button",children:e}),s.renderModal?s.renderModal(p):(0,m.jsx)(XA,{...p})]}):(0,m.jsx)("a",{className:a("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":u,"data-streamdown":"link",href:n,rel:"noreferrer",target:"_blank",...i,children:e})},Ec=(0,k.memo)(c_,(e,t)=>ge(e,t)&&e.href===t.href);Ec.displayName="MarkdownA";var Tc=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("h1",{className:i("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...r,children:e})},(e,t)=>ge(e,t));Tc.displayName="MarkdownH1";var bc=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("h2",{className:i("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...r,children:e})},(e,t)=>ge(e,t));bc.displayName="MarkdownH2";var kc=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("h3",{className:i("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...r,children:e})},(e,t)=>ge(e,t));kc.displayName="MarkdownH3";var Ac=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("h4",{className:i("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...r,children:e})},(e,t)=>ge(e,t));Ac.displayName="MarkdownH4";var _c=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("h5",{className:i("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...r,children:e})},(e,t)=>ge(e,t));_c.displayName="MarkdownH5";var xc=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("h6",{className:i("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...r,children:e})},(e,t)=>ge(e,t));xc.displayName="MarkdownH6";var yc=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let{controls:i}=(0,k.useContext)(Fe),a=di(i,"table"),s=Hr(i,"copy"),l=Hr(i,"download"),o=Hr(i,"fullscreen");return(0,m.jsx)(i_,{className:t,showControls:a,showCopy:s,showDownload:l,showFullscreen:o,...r,children:e})},(e,t)=>ge(e,t));yc.displayName="MarkdownTable";var Cc=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("thead",{className:i("bg-muted/80",t),"data-streamdown":"table-header",...r,children:e})},(e,t)=>ge(e,t));Cc.displayName="MarkdownThead";var Sc=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("tbody",{className:i("divide-y divide-border",t),"data-streamdown":"table-body",...r,children:e})},(e,t)=>ge(e,t));Sc.displayName="MarkdownTbody";var Nc=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("tr",{className:i("border-border",t),"data-streamdown":"table-row",...r,children:e})},(e,t)=>ge(e,t));Nc.displayName="MarkdownTr";var Ic=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("th",{className:i("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...r,children:e})},(e,t)=>ge(e,t));Ic.displayName="MarkdownTh";var vc=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("td",{className:i("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...r,children:e})},(e,t)=>ge(e,t));vc.displayName="MarkdownTd";var wc=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("blockquote",{className:i("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...r,children:e})},(e,t)=>ge(e,t));wc.displayName="MarkdownBlockquote";var Lc=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("sup",{className:i("text-sm",t),"data-streamdown":"superscript",...r,children:e})},(e,t)=>ge(e,t));Lc.displayName="MarkdownSup";var Rc=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let i=te();return(0,m.jsx)("sub",{className:i("text-sm",t),"data-streamdown":"subscript",...r,children:e})},(e,t)=>ge(e,t));Rc.displayName="MarkdownSub";var Oc=(0,k.memo)(({children:e,className:t,node:n,...r})=>{if("data-footnotes"in r){let i=s=>{var l,o;if(!(0,k.isValidElement)(s))return!1;let u=Array.isArray(s.props.children)?s.props.children:[s.props.children],d=!1,h=!1;for(let f of u)if(f){if(typeof f=="string")f.trim()!==""&&(d=!0);else if((0,k.isValidElement)(f))if(((l=f.props)==null?void 0:l["data-footnote-backref"])!==void 0)h=!0;else{let p=Array.isArray(f.props.children)?f.props.children:[f.props.children];for(let E of p){if(typeof E=="string"&&E.trim()!==""){d=!0;break}if((0,k.isValidElement)(E)&&((o=E.props)==null?void 0:o["data-footnote-backref"])===void 0){d=!0;break}}}}return h&&!d},a=Array.isArray(e)?e.map(s=>{if(!(0,k.isValidElement)(s))return s;if(s.type===Gi){let l=(Array.isArray(s.props.children)?s.props.children:[s.props.children]).filter(o=>!i(o));return l.length===0?null:{...s,props:{...s.props,children:l}}}return s}):e;return(Array.isArray(a)?a.some(s=>s!==null):a!==null)?(0,m.jsx)("section",{className:t,...r,children:a}):null}return(0,m.jsx)("section",{className:t,...r,children:e})},(e,t)=>ge(e,t));Oc.displayName="MarkdownSection";var u_=({node:e,className:t,children:n,...r})=>{var i,a;let s=te(),l=!("data-block"in r),{mermaid:o,controls:u,lineNumbers:d}=(0,k.useContext)(Fe),h=Wi(),f=SA(),p=t?.match(l_),E=(i=p?.at(1))!=null?i:"",N=ZA(E);if(l)return(0,m.jsx)("code",{className:s("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...r,children:n});let y=(a=e?.properties)==null?void 0:a.metastring,_=y?.match(a_),C=_?Number.parseInt(_[1],10):void 0,w=C!==void 0&&C>=1?C:void 0,R=!(y&&s_.test(y))&&d!==!1,O="";if((0,k.isValidElement)(n)&&n.props&&typeof n.props=="object"&&"children"in n.props&&typeof n.props.children=="string"?O=n.props.children:typeof n=="string"&&(O=n),N){let W=N.component;return(0,m.jsx)(k.Suspense,{fallback:(0,m.jsx)(Ts,{}),children:(0,m.jsx)(W,{code:O,isIncomplete:f,language:E,meta:y})})}if(E==="mermaid"&&h){let W=di(u,"mermaid"),I=Un(u,"download"),U=Un(u,"copy"),z=Un(u,"fullscreen"),q=Un(u,"panZoom"),J=W&&(I||U||z);return(0,m.jsx)(k.Suspense,{fallback:(0,m.jsx)(Ts,{}),children:(0,m.jsxs)("div",{className:s("group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",t),"data-streamdown":"mermaid-block",children:[(0,m.jsx)("div",{className:s("flex h-8 items-center text-muted-foreground text-xs"),children:(0,m.jsx)("span",{className:s("ml-1 font-mono lowercase"),children:"mermaid"})}),J?(0,m.jsx)("div",{className:s("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:(0,m.jsxs)("div",{className:s("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"mermaid-block-actions",children:[I?(0,m.jsx)(e_,{chart:O,config:o?.config}):null,U?(0,m.jsx)(gs,{code:O}):null,z?(0,m.jsx)(t_,{chart:O,config:o?.config}):null]})}):null,(0,m.jsx)("div",{className:s("rounded-md border border-border bg-background"),children:(0,m.jsx)(o_,{chart:O,config:o?.config,showControls:q})})]})})}let S=di(u,"code"),$=bs(u,"download"),Y=bs(u,"copy");return(0,m.jsx)(MA,{className:t,code:O,isIncomplete:f,language:E,lineNumbers:R,startLine:w,children:S?(0,m.jsxs)(m.Fragment,{children:[$?(0,m.jsx)(GA,{code:O,language:E}):null,Y?(0,m.jsx)(gs,{}):null]}):null})},Dc=(0,k.memo)(u_,(e,t)=>e.className===t.className&&gr(e.node,t.node));Dc.displayName="MarkdownCode";var Pc=(0,k.memo)(KA,(e,t)=>e.className===t.className&&gr(e.node,t.node));Pc.displayName="MarkdownImg";var Mc=(0,k.memo)(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(i=>i!=null&&i!=="");if(r.length===1&&(0,k.isValidElement)(r[0])){let i=r[0].props.node,a=i?.tagName;if(a==="img")return(0,m.jsx)(m.Fragment,{children:e});if(a==="code"&&"data-block"in r[0].props)return(0,m.jsx)(m.Fragment,{children:e})}return(0,m.jsx)("p",{...n,children:e})},(e,t)=>ge(e,t));Mc.displayName="MarkdownParagraph";var h_={ol:Gi,li:fc,ul:pc,hr:mc,strong:gc,a:Ec,h1:Tc,h2:bc,h3:kc,h4:Ac,h5:_c,h6:xc,table:yc,thead:Cc,tbody:Sc,tr:Nc,th:Ic,td:vc,blockquote:wc,code:Dc,img:Pc,pre:({children:e})=>(0,k.isValidElement)(e)?(0,k.cloneElement)(e,{"data-block":"true"}):e,sup:Lc,sub:Rc,p:Mc,section:Oc},d_=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,f_=/\p{L}/u;function ks(e){let t=e.replace(/^#{1,6}\s+/gm,"").replace(/(\*{1,3}|_{1,3})/g,"").replace(/`[^`]*`/g,"").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/^[\s>*\-+\d.]+/gm,"");for(let n of t){if(d_.test(n))return"rtl";if(f_.test(n))return"ltr"}return"ltr"}var p_=/^[ \t]{0,3}(`{3,}|~{3,})/,m_=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,As=e=>{let t=e.split(`
120
120
  `),n=null,r=0;for(let i of t){let a=p_.exec(i);if(n===null){if(a){let s=a[1];n=s[0],r=s.length}}else if(a){let s=a[1],l=s[0],o=s.length;l===n&&o>=r&&(n=null,r=0)}}return n!==null},g_=e=>{let t=e.split(`
121
121
  `);for(let n of t){let r=n.trim();if(r.length>0&&r.includes("|")&&m_.test(r))return!0}return!1},E_=()=>e=>{Xe(e,"html",(t,n,r)=>{!r||typeof n!="number"||(r.children[n]={type:"text",value:t.value})})},_s=[],xs={allowDangerousHtml:!0},jn=new WeakMap,T_=class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(n||r||i)){let o="default";return this.keyCache.set(e,o),o}let a=o=>{if(!o||o.length===0)return"";let u="";for(let d=0;d<o.length;d+=1){let h=o[d];if(d>0&&(u+=","),Array.isArray(h)){let[f,p]=h;if(typeof f=="function"){let E=jn.get(f);E||(E=f.name,jn.set(f,E)),u+=E}else u+=String(f);u+=":",u+=JSON.stringify(p)}else if(typeof h=="function"){let f=jn.get(h);f||(f=h.name,jn.set(h,f)),u+=f}else u+=String(h)}return u},s=a(n),l=`${a(r)}::${s}::${i?JSON.stringify(i):""}`;return this.keyCache.set(e,l),l}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let r=this.cache.keys().next().value;r&&this.cache.delete(r)}this.cache.set(n,t)}clear(){this.cache.clear()}},ys=new T_,Bc=e=>{let t=b_(e),n=e.children||"";return S_(t.runSync(t.parse(n),n),e)},b_=e=>{let t=ys.get(e);if(t)return t;let n=A_(e);return ys.set(e,n),n},k_=e=>e.some(t=>Array.isArray(t)?t[0]===Kr:t===Kr),A_=e=>{let t=e.rehypePlugins||_s,n=e.remarkPlugins||_s,r=k_(t)?n:[...n,E_],i=e.remarkRehypeOptions?{...xs,...e.remarkRehypeOptions}:xs;return y0().use(xk).use(r).use(a0,i).use(t)},__=e=>e,x_=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:"text",value:r}},y_=(e,t)=>{var n;for(let r in wr)if(Object.hasOwn(wr,r)&&Object.hasOwn(e.properties,r)){let i=e.properties[r],a=wr[r];(a===null||a.includes(e.tagName))&&(e.properties[r]=(n=t(String(i||""),r,e))!=null?n:void 0)}},C_=(e,t,n,r,i,a)=>{let s=!1;return r?s=!r.includes(e.tagName):i&&(s=i.includes(e.tagName)),!s&&a&&typeof t=="number"&&(s=!a(e,t,n)),s},S_=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:a,unwrapDisallowed:s,urlTransform:l}=t;if(n||r||i||a||l){let o=l||__;Xe(e,(u,d,h)=>{if(u.type==="raw"&&h&&typeof d=="number")return x_(h,d,a,u.value),d;if(u.type==="element"&&(y_(u,o),C_(u,d,h,r,i,n)&&h&&typeof d=="number"))return s&&u.children?h.children.splice(d,1,...u.children):h.children.splice(d,1),d})}return Lb(e,{Fragment:m.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0})},N_=/\[\^[\w-]{1,200}\](?!:)/,I_=/\[\^[\w-]{1,200}\]:/,v_=/<(\w+)[\s>]/,w_=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Cs=new Map,Ss=new Map,L_=e=>{let t=e.toLowerCase(),n=Cs.get(t);if(n)return n;let r=new RegExp(`<${t}(?=[\\s>/])[^>]*>`,"gi");return Cs.set(t,r),r},R_=e=>{let t=e.toLowerCase(),n=Ss.get(t);if(n)return n;let r=new RegExp(`</${t}(?=[\\s>])[^>]*>`,"gi");return Ss.set(t,r),r},Ns=(e,t)=>{if(w_.has(t.toLowerCase()))return 0;let n=e.match(L_(t));if(!n)return 0;let r=0;for(let i of n)i.trimEnd().endsWith("/>")||(r+=1);return r},Is=(e,t)=>{let n=e.match(R_(t));return n?n.length:0},O_=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]==="$"&&e[n+1]==="$"&&(t+=1,n+=1);return t},D_=e=>{let t=N_.test(e),n=I_.test(e);if(t||n)return[e];let r=ze.lex(e,{gfm:!0}),i=[],a=[],s=!1;for(let l of r){let o=l.raw,u=i.length;if(a.length>0){i[u-1]+=o;let d=a.at(-1),h=Ns(o,d),f=Is(o,d);for(let p=0;p<h;p+=1)a.push(d);for(let p=0;p<f;p+=1)a.length>0&&a.at(-1)===d&&a.pop();continue}if(l.type==="html"&&l.block){let d=o.match(v_);if(d){let h=d[1];Ns(o,h)>Is(o,h)&&a.push(h)}}if(u>0&&!s){let d=i[u-1];if(O_(d)%2===1){i[u-1]=d+o;continue}}i.push(o),l.type!=="space"&&(s=l.type==="code")}return i},P_=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let i=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(i,(a,s,l,o)=>{if(!l.includes(`
122
122
 
@@ -128,5 +128,5 @@ Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error
128
128
  `)?"":`
129
129
  `)}${o}
130
130
 
131
- `})}return n},M_=/([\\`*_~[\]|])/g,B_=e=>e.replace(M_,"\\$1"),F_=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let i=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(i,(a,s,l,o)=>s+B_(l).replace(/\n\n/g,"&#10;&#10;")+o)}return n},Fc=e=>e.type==="text"?e.value:"children"in e&&Array.isArray(e.children)?e.children.map(Fc).join(""):"",H_=e=>t=>{if(!e||e.length===0)return;let n=new Set(e.map(r=>r.toLowerCase()));Xe(t,"element",r=>{if(n.has(r.tagName.toLowerCase())){let i=Fc(r);r.children=i?[{type:"text",value:i}]:[]}})},U_=()=>e=>{Xe(e,"code",t=>{var n,r;t.meta&&(t.data=(n=t.data)!=null?n:{},t.data.hProperties={...(r=t.data.hProperties)!=null?r:{},metastring:t.meta})})},j_=/^[ \t]*<[\w!/?-]/,z_=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,$_=e=>typeof e!="string"||e.length===0||!j_.test(e)?e:e.replace(z_,"$1"),vs,ws,Ls,Rs,qn={...kt,protocols:{...kt.protocols,href:[...(ws=(vs=kt.protocols)==null?void 0:vs.href)!=null?ws:[],"tel"]},attributes:{...kt.attributes,code:[...(Rs=(Ls=kt.attributes)==null?void 0:Ls.code)!=null?Rs:[],"metastring"]}},fi={raw:Kr,sanitize:[Wo,qn],harden:[Uu,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},Y_={gfm:[aT,{}],codeMeta:U_},Os=Object.values(fi),q_=Object.values(Y_),V_={block:" ▋",circle:" ●"},Hc=["github-light","github-dark"],Uc={enabled:!0},Fe=(0,k.createContext)({shikiTheme:Hc,controls:!0,isAnimating:!1,lineNumbers:!0,mode:"streaming",mermaid:void 0,linkSafety:Uc}),jc=(0,k.memo)(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:n,index:r,isIncomplete:i,dir:a,animatePlugin:s,...l})=>{if(s){let d=s.getLastRenderCharCount();s.setPrevContentLength(d)}let o=typeof e=="string"&&n?$_(e):e,u=(0,m.jsx)(Bc,{...l,children:o});return(0,m.jsx)(ic.Provider,{value:i,children:a?(0,m.jsx)("div",{dir:a,style:{display:"contents"},children:u}):u})},(e,t)=>{if(e.content!==t.content||e.shouldNormalizeHtmlIndentation!==t.shouldNormalizeHtmlIndentation||e.index!==t.index||e.isIncomplete!==t.isIncomplete||e.dir!==t.dir)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(i=>{var a,s;return((a=e.components)==null?void 0:a[i])!==((s=t.components)==null?void 0:s[i])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});jc.displayName="Block";var Qi=(0,k.memo)(({children:e,mode:t="streaming",dir:n,parseIncompleteMarkdown:r=!0,normalizeHtmlIndentation:i=!1,components:a,rehypePlugins:s=Os,remarkPlugins:l=q_,className:o,shikiTheme:u=Hc,mermaid:d,controls:h=!0,isAnimating:f=!1,animated:p,BlockComponent:E=jc,parseMarkdownIntoBlocksFn:N=D_,caret:y,plugins:_,remend:C,linkSafety:w=Uc,lineNumbers:R=!0,allowedTags:O,literalTagContent:S,translations:$,icons:Y,prefix:W,onAnimationStart:I,onAnimationEnd:U,...z})=>{let q=(0,k.useId)(),[J,Q]=(0,k.useTransition)(),H=(0,k.useMemo)(()=>IA(W),[W]),P=(0,k.useRef)(null),V=(0,k.useRef)(I),X=(0,k.useRef)(U);V.current=I,X.current=U,(0,k.useEffect)(()=>{var re,ce,ve;if(t==="static")return;let We=P.current;if(P.current=f,We===null){f&&((re=V.current)==null||re.call(V));return}f&&!We?(ce=V.current)==null||ce.call(V):!f&&We&&((ve=X.current)==null||ve.call(X))},[f,t]);let A=(0,k.useMemo)(()=>O?Object.keys(O):[],[O]),oe=(0,k.useMemo)(()=>{if(typeof e!="string")return"";let re=t==="streaming"&&r?gb(e,C):e;return S&&S.length>0&&(re=F_(re,S)),A.length>0&&(re=P_(re,A)),re},[e,t,r,C,A,S]),fe=(0,k.useMemo)(()=>N(oe),[oe,N]),[x,Oe]=(0,k.useState)(fe);(0,k.useEffect)(()=>{t==="streaming"&&!He?Q(()=>{Oe(fe)}):Oe(fe)},[fe,t]);let Ee=t==="streaming"?x:fe,pe=(0,k.useMemo)(()=>n==="auto"?Ee.map(ks):void 0,[Ee,n]),gt=(0,k.useMemo)(()=>Ee.map((re,ce)=>`${q}-${ce}`),[Ee.length,q]),De=(0,k.useMemo)(()=>p===!0?"true":p?JSON.stringify(p):"",[p]),He=(0,k.useMemo)(()=>De?De==="true"?oi():oi(p):null,[De]),et=(0,k.useMemo)(()=>{var re,ce;return{shikiTheme:(ce=(re=_?.code)==null?void 0:re.getThemes())!=null?ce:u,controls:h,isAnimating:f,lineNumbers:R,mode:t,mermaid:d,linkSafety:w}},[u,h,f,R,t,d,w,_?.code]),vn=(0,k.useMemo)(()=>$?JSON.stringify($):"",[$]),wn=(0,k.useMemo)(()=>({...lc,...$}),[vn]),Ln=(0,k.useMemo)(()=>{let{inlineCode:re,...ce}=a??{},ve={...h_,...ce};if(re){let We=ve.code;ve.code=Et=>"data-block"in Et?We?(0,k.createElement)(We,Et):null:(0,k.createElement)(re,Et)}return ve},[a]),Rn=(0,k.useMemo)(()=>{let re=[];return _!=null&&_.cjk&&(re=[...re,..._.cjk.remarkPluginsBefore]),re=[...re,...l],_!=null&&_.cjk&&(re=[...re,..._.cjk.remarkPluginsAfter]),_!=null&&_.math&&(re=[...re,_.math.remarkPlugin]),re},[l,_?.math,_?.cjk]),Gt=(0,k.useMemo)(()=>{var re;let ce=s;if(O&&Object.keys(O).length>0&&s===Os){let ve={...qn,tagNames:[...(re=qn.tagNames)!=null?re:[],...Object.keys(O)],attributes:{...qn.attributes,...O}};ce=[fi.raw,[Wo,ve],fi.harden]}return S&&S.length>0&&(ce=[...ce,[H_,S]]),_!=null&&_.math&&(ce=[...ce,_.math.rehypePlugin]),He&&f&&(ce=[...ce,He.rehypePlugin]),ce},[s,_?.math,He,f,O,S]),Lt=(0,k.useMemo)(()=>{if(!f||Ee.length===0)return!1;let re=Ee.at(-1);return As(re)||g_(re)},[f,Ee]),On=(0,k.useMemo)(()=>y&&f&&!Lt?{"--streamdown-caret":`"${V_[y]}"`}:void 0,[y,f,Lt]);return t==="static"?(0,m.jsx)(ci.Provider,{value:wn,children:(0,m.jsx)(ui.Provider,{value:_??null,children:(0,m.jsx)(Fe.Provider,{value:et,children:(0,m.jsx)(ms,{icons:Y,children:(0,m.jsx)(li.Provider,{value:H,children:(0,m.jsx)("div",{className:H("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",o),dir:n==="auto"?ks(oe):n,children:(0,m.jsx)(Bc,{components:Ln,rehypePlugins:Gt,remarkPlugins:Rn,...z,children:oe})})})})})})}):(0,m.jsx)(ci.Provider,{value:wn,children:(0,m.jsx)(ui.Provider,{value:_??null,children:(0,m.jsx)(Fe.Provider,{value:et,children:(0,m.jsx)(ms,{icons:Y,children:(0,m.jsx)(li.Provider,{value:H,children:(0,m.jsxs)("div",{className:H("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",y&&!Lt?"[&>*:last-child]:after:inline [&>*:last-child]:after:align-baseline [&>*:last-child]:after:content-[var(--streamdown-caret)]":null,o),style:On,children:[Ee.length===0&&y&&f&&(0,m.jsx)("span",{}),Ee.map((re,ce)=>{var ve;let We=ce===Ee.length-1,Et=f&&We&&As(re);return(0,m.jsx)(E,{animatePlugin:He,components:Ln,content:re,dir:(ve=pe?.[ce])!=null?ve:n!=="auto"?n:void 0,index:ce,isIncomplete:Et,rehypePlugins:Gt,remarkPlugins:Rn,shouldNormalizeHtmlIndentation:i,shouldParseIncompleteMarkdown:r,...z},gt[ce])})]})})})})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety&&e.lineNumbers===t.lineNumbers&&e.normalizeHtmlIndentation===t.normalizeHtmlIndentation&&e.literalTagContent===t.literalTagContent&&JSON.stringify(e.translations)===JSON.stringify(t.translations)&&e.prefix===t.prefix&&e.dir===t.dir);Qi.displayName="Streamdown";var W_=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:i=.1,showControls:a=!0,initialZoom:s=1,fullscreen:l=!1})=>{let{RotateCcwIcon:o,ZoomInIcon:u,ZoomOutIcon:d}=Ve(),h=te(),f=(0,k.useRef)(null),p=(0,k.useRef)(null),[E,N]=(0,k.useState)(s),[y,_]=(0,k.useState)({x:0,y:0}),[C,w]=(0,k.useState)(!1),[R,O]=(0,k.useState)({x:0,y:0}),[S,$]=(0,k.useState)({x:0,y:0}),Y=(0,k.useCallback)(H=>{N(P=>Math.max(n,Math.min(r,P+H)))},[n,r]),W=(0,k.useCallback)(()=>{Y(i)},[Y,i]),I=(0,k.useCallback)(()=>{Y(-i)},[Y,i]),U=(0,k.useCallback)(()=>{N(s),_({x:0,y:0})},[s]),z=(0,k.useCallback)(H=>{H.preventDefault();let P=H.deltaY>0?-i:i;Y(P)},[Y,i]),q=(0,k.useCallback)(H=>{if(H.button!==0||H.isPrimary===!1)return;w(!0),O({x:H.clientX,y:H.clientY}),$(y);let P=H.currentTarget;P instanceof HTMLElement&&P.setPointerCapture(H.pointerId)},[y]),J=(0,k.useCallback)(H=>{if(!C)return;H.preventDefault();let P=H.clientX-R.x,V=H.clientY-R.y;_({x:S.x+P,y:S.y+V})},[C,R,S]),Q=(0,k.useCallback)(H=>{w(!1);let P=H.currentTarget;P instanceof HTMLElement&&P.releasePointerCapture(H.pointerId)},[]);return(0,k.useEffect)(()=>{let H=f.current;if(H)return H.addEventListener("wheel",z,{passive:!1}),()=>{H.removeEventListener("wheel",z)}},[z]),(0,k.useEffect)(()=>{let H=p.current;if(H&&C)return document.body.style.userSelect="none",H.addEventListener("pointermove",J,{passive:!1}),H.addEventListener("pointerup",Q),H.addEventListener("pointercancel",Q),()=>{document.body.style.userSelect="",H.removeEventListener("pointermove",J),H.removeEventListener("pointerup",Q),H.removeEventListener("pointercancel",Q)}},[C,J,Q]),(0,m.jsxs)("div",{className:h("relative flex flex-col",l?"h-full w-full":"min-h-28 w-full",t),ref:f,style:{cursor:C?"grabbing":"grab"},children:[a?(0,m.jsxs)("div",{className:h("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/80 p-1 supports-[backdrop-filter]:bg-background/70 supports-[backdrop-filter]:backdrop-blur-sm",l?"bottom-4 left-4":"bottom-2 left-2"),children:[(0,m.jsx)("button",{className:h("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:E>=r,onClick:W,title:"Zoom in",type:"button",children:(0,m.jsx)(u,{size:16})}),(0,m.jsx)("button",{className:h("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:E<=n,onClick:I,title:"Zoom out",type:"button",children:(0,m.jsx)(d,{size:16})}),(0,m.jsx)("button",{className:h("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"),onClick:U,title:"Reset zoom and pan",type:"button",children:(0,m.jsx)(o,{size:16})})]}):null,(0,m.jsx)("div",{className:h("flex-1 origin-center transition-transform duration-150 ease-out",l?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:q,ref:p,role:"application",style:{transform:`translate(${y.x}px, ${y.y}px) scale(${E})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},G_=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let a=te(),[s,l]=(0,k.useState)(null),[o,u]=(0,k.useState)(!1),[d,h]=(0,k.useState)(""),[f,p]=(0,k.useState)(""),[E,N]=(0,k.useState)(0),{mermaid:y}=(0,k.useContext)(Fe),_=Wi(),C=y?.errorComponent,{shouldRender:w,containerRef:R}=gA({immediate:r});if((0,k.useEffect)(()=>{if(w){if(!_){l("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{l(null),u(!0);let S=_.getMermaid(n),$=e.split("").reduce((I,U)=>(I<<5)-I+U.charCodeAt(0)|0,0),Y=`mermaid-${Math.abs($)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:W}=await S.render(Y,e);h(W),p(W)}catch(S){if(!(f||d)){let $=S instanceof Error?S.message:"Failed to render Mermaid chart";l($)}}finally{u(!1)}})()}},[e,n,E,w,_]),!(w||d||f))return(0,m.jsx)("div",{className:a("my-4 min-h-[200px]",t),ref:R});if(o&&!d&&!f)return(0,m.jsx)("div",{className:a("my-4 flex justify-center p-4",t),ref:R,children:(0,m.jsxs)("div",{className:a("flex items-center space-x-2 text-muted-foreground"),children:[(0,m.jsx)("div",{className:a("h-4 w-4 animate-spin rounded-full border-current border-b-2")}),(0,m.jsx)("span",{className:a("text-sm"),children:"Loading diagram..."})]})});if(s&&!d&&!f){let S=()=>N($=>$+1);return C?(0,m.jsx)("div",{ref:R,children:(0,m.jsx)(C,{chart:e,error:s,retry:S})}):(0,m.jsxs)("div",{className:a("rounded-md bg-red-50 p-4",t),ref:R,children:[(0,m.jsxs)("p",{className:a("font-mono text-red-700 text-sm"),children:["Mermaid Error: ",s]}),(0,m.jsxs)("details",{className:a("mt-2"),children:[(0,m.jsx)("summary",{className:a("cursor-pointer text-red-600 text-xs"),children:"Show Code"}),(0,m.jsx)("pre",{className:a("mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs"),children:e})]})]})}let O=d||f;return(0,m.jsx)("div",{className:a("size-full",t),"data-streamdown":"mermaid",ref:R,children:(0,m.jsx)(W_,{className:a(r?"size-full overflow-hidden":"overflow-hidden",t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:(0,m.jsx)("div",{"aria-label":"Mermaid chart",className:a("flex justify-center",r?"size-full items-center":null),dangerouslySetInnerHTML:{__html:O},role:"img"})})})},Q_={damping:.7,stiffness:.05,mass:1.25},K_=70,X_=1e3/60,Z_=350,Er=!1;globalThis.document?.addEventListener("mousedown",()=>{Er=!0});globalThis.document?.addEventListener("mouseup",()=>{Er=!1});globalThis.document?.addEventListener("click",()=>{Er=!1});var J_=(e={})=>{const[t,n]=(0,k.useState)(!1),[r,i]=(0,k.useState)(e.initial!==!1),[a,s]=(0,k.useState)(!1),l=(0,k.useRef)(null);l.current=e;const o=(0,k.useCallback)(()=>{if(!Er)return!1;const C=window.getSelection();if(!C||!C.rangeCount)return!1;const w=C.getRangeAt(0);return w.commonAncestorContainer.contains(y.current)||y.current?.contains(w.commonAncestorContainer)},[]),u=(0,k.useCallback)(C=>{h.isAtBottom=C,i(C)},[]),d=(0,k.useCallback)(C=>{h.escapedFromLock=C,n(C)},[]),h=(0,k.useMemo)(()=>{let C;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return y.current?.scrollTop??0},set scrollTop(w){if(y.current){const{scrollBehavior:R}=getComputedStyle(y.current);R!=="auto"&&(y.current.style.scrollBehavior="auto"),y.current.scrollTop=w,h.ignoreScrollToTop=y.current.scrollTop,R!=="auto"&&(y.current.style.scrollBehavior=R)}},get targetScrollTop(){return!y.current||!_.current?0:y.current.scrollHeight-1-y.current.clientHeight},get calculatedTargetScrollTop(){if(!y.current||!_.current)return 0;const{targetScrollTop:w}=this;if(!e.targetScrollTop)return w;if(C?.targetScrollTop===w)return C.calculatedScrollTop;const R=Math.max(Math.min(e.targetScrollTop(w,{scrollElement:y.current,contentElement:_.current}),w),0);return C={targetScrollTop:w,calculatedScrollTop:R},requestAnimationFrame(()=>{C=void 0}),R},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=K_}}},[]),f=(0,k.useCallback)((C={})=>{typeof C=="string"&&(C={animation:C}),C.preserveScrollPosition||u(!0);const w=Date.now()+(Number(C.wait)||0),R=jr(l.current,C.animation),{ignoreEscapes:O=!1}=C;let S,$=h.calculatedTargetScrollTop;C.duration instanceof Promise?C.duration.finally(()=>{S=Date.now()}):S=w+(C.duration??0);const Y=async()=>{const W=new Promise(requestAnimationFrame).then(()=>{if(!h.isAtBottom)return h.animation=void 0,!1;const{scrollTop:I}=h,U=performance.now(),z=(U-(h.lastTick??U))/X_;if(h.animation||(h.animation={behavior:R,promise:W,ignoreEscapes:O}),h.animation.behavior===R&&(h.lastTick=U),o()||w>Date.now())return Y();if(I<Math.min($,h.calculatedTargetScrollTop)){if(h.animation?.behavior===R){if(R==="instant")return h.scrollTop=h.calculatedTargetScrollTop,Y();h.velocity=(R.damping*h.velocity+R.stiffness*h.scrollDifference)/R.mass,h.accumulated+=h.velocity*z,h.scrollTop+=h.accumulated,h.scrollTop!==I&&(h.accumulated=0)}return Y()}return S>Date.now()?($=h.calculatedTargetScrollTop,Y()):(h.animation=void 0,h.scrollTop<h.calculatedTargetScrollTop?f({animation:jr(l.current,l.current.resize),ignoreEscapes:O,duration:Math.max(0,S-Date.now())||void 0}):h.isAtBottom)});return W.then(I=>(requestAnimationFrame(()=>{h.animation||(h.lastTick=void 0,h.velocity=0)}),I))};return C.wait!==!0&&(h.animation=void 0),h.animation?.behavior===R?h.animation.promise:Y()},[u,o,h]),p=(0,k.useCallback)(()=>{d(!0),u(!1)},[d,u]),E=(0,k.useCallback)(({target:C})=>{if(C!==y.current)return;const{scrollTop:w,ignoreScrollToTop:R}=h;let{lastScrollTop:O=w}=h;h.lastScrollTop=w,h.ignoreScrollToTop=void 0,R&&R>w&&(O=R),s(h.isNearBottom),setTimeout(()=>{if(h.resizeDifference||w===R)return;if(o()){d(!0),u(!1);return}const S=w>O,$=w<O;if(h.animation?.ignoreEscapes){h.scrollTop=O;return}$&&(d(!0),u(!1)),S&&d(!1),!h.escapedFromLock&&h.isNearBottom&&u(!0)},1)},[d,u,o,h]),N=(0,k.useCallback)(({target:C,deltaY:w})=>{let R=C;for(;!["scroll","auto"].includes(getComputedStyle(R).overflow);){if(!R.parentElement)return;R=R.parentElement}R===y.current&&w<0&&y.current.scrollHeight>y.current.clientHeight&&!h.animation?.ignoreEscapes&&(d(!0),u(!1))},[d,u,h]),y=Ds(C=>{y.current?.removeEventListener("scroll",E),y.current?.removeEventListener("wheel",N),C?.addEventListener("scroll",E,{passive:!0}),C?.addEventListener("wheel",N,{passive:!0})},[]),_=Ds(C=>{if(h.resizeObserver?.disconnect(),!C)return;let w;h.resizeObserver=new ResizeObserver(([R])=>{const{height:O}=R.contentRect,S=O-(w??O);if(h.resizeDifference=S,h.scrollTop>h.targetScrollTop&&(h.scrollTop=h.targetScrollTop),s(h.isNearBottom),S>=0){const $=jr(l.current,w?l.current.resize:l.current.initial);f({animation:$,wait:!0,preserveScrollPosition:!0,duration:$==="instant"?void 0:Z_})}else h.isNearBottom&&(d(!1),u(!0));w=O,requestAnimationFrame(()=>{setTimeout(()=>{h.resizeDifference===S&&(h.resizeDifference=0)},1)})}),h.resizeObserver?.observe(C)},[]);return{contentRef:_,scrollRef:y,scrollToBottom:f,stopScroll:p,isAtBottom:r||a,isNearBottom:a,escapedFromLock:t,state:h}};function Ds(e,t){const n=(0,k.useCallback)(r=>(n.current=r,e(r)),t);return n}var Ur=new Map;function jr(...e){const t={...Q_};let n=!1;for(const i of e){if(i==="instant"){n=!0;continue}typeof i=="object"&&(n=!1,t.damping=i.damping??t.damping,t.stiffness=i.stiffness??t.stiffness,t.mass=i.mass??t.mass)}const r=JSON.stringify(t);return Ur.has(r)||Ur.set(r,Object.freeze(t)),n?"instant":Ur.get(r)}var zc=(0,k.createContext)(null),ex=typeof window<"u"?k.useLayoutEffect:k.useEffect;function er({instance:e,children:t,resize:n,initial:r,mass:i,damping:a,stiffness:s,targetScrollTop:l,contextRef:o,...u}){const d=(0,k.useRef)(null),h=k.useCallback((O,S)=>(R?.targetScrollTop??l)?.(O,S)??O,[l]),f=J_({mass:i,damping:a,stiffness:s,resize:n,initial:r,targetScrollTop:h}),{scrollRef:p,contentRef:E,scrollToBottom:N,stopScroll:y,isAtBottom:_,escapedFromLock:C,state:w}=e??f,R=(0,k.useMemo)(()=>({scrollToBottom:N,stopScroll:y,scrollRef:p,isAtBottom:_,escapedFromLock:C,contentRef:E,state:w,get targetScrollTop(){return d.current},set targetScrollTop(O){d.current=O}}),[N,_,E,p,y,C,w]);return(0,k.useImperativeHandle)(o,()=>R,[R]),ex(()=>{p.current&&getComputedStyle(p.current).overflow==="visible"&&(p.current.style.overflow="auto")},[]),k.createElement(zc.Provider,{value:R},k.createElement("div",{...u},typeof t=="function"?t(R):t))}(function(e){function t({children:n,scrollClassName:r,...i}){const a=$c();return k.createElement("div",{ref:a.scrollRef,style:{height:"100%",width:"100%",scrollbarGutter:"stable both-edges"},className:r},k.createElement("div",{...i,ref:a.contentRef},typeof n=="function"?n(a):n))}e.Content=t})(er||(er={}));function $c(){const e=(0,k.useContext)(zc);if(!e)throw new Error("use-stick-to-bottom component context must be used within a StickToBottom component");return e}var tx=({className:e,...t})=>(0,m.jsx)(er,{className:me("relative flex-1 overflow-y-hidden",e),initial:"smooth",resize:"smooth",role:"log",...t}),nx=({className:e,...t})=>(0,m.jsx)(er.Content,{className:me("flex flex-col gap-8 p-4",e),...t}),rx=({className:e,...t})=>{const{isAtBottom:n,scrollToBottom:r}=$c(),i=(0,k.useCallback)(()=>{r()},[r]);return!n&&(0,m.jsx)(nr,{className:me("absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full",e),onClick:i,size:"icon",type:"button",variant:"outline",...t,children:(0,m.jsx)(au,{className:"size-4"})})},Ps=[{variant:"shine",component:({children:e,className:t,...n})=>(0,m.jsx)("span",{...n,className:me("bg-[linear-gradient(110deg,#bfbfbf,35%,#000,50%,#bfbfbf,75%,#bfbfbf)] dark:bg-[linear-gradient(110deg,#404040,35%,#fff,50%,#404040,75%,#404040)]","bg-size-[200%_100%] bg-clip-text text-transparent","animate-shine",t),children:e})}];function ix({variant:e="shine",className:t,...n}){const r=Ps.find(i=>i.variant===e)?.component||Ps[0].component;return(0,m.jsx)(du,{className:me("font-medium text-sm"),children:(0,m.jsx)(r,{...n,className:t})})}var Ms=({className:e,from:t,...n})=>(0,m.jsx)("div",{className:me("group flex w-full max-w-[95%] flex-col gap-2",t==="user"?"is-user ml-auto justify-end":"is-assistant",e),...n}),Bs=({children:e,className:t,...n})=>(0,m.jsx)("div",{className:me("is-user:dark flex w-fit max-w-full min-w-0 flex-col gap-2 overflow-hidden text-sm","group-[.is-user]:ml-auto group-[.is-user]:rounded-lg group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground","group-[.is-assistant]:text-foreground",t),...n,children:e}),Yc=(0,k.createContext)(null),ax=()=>{const e=(0,k.use)(Yc);if(!e)throw new Error("MessageBranch components must be used within MessageBranch");return e},Fs=({defaultBranch:e=0,onBranchChange:t,className:n,...r})=>{const[i,a]=(0,k.useState)(e),[s,l]=(0,k.useState)([]),o=f=>{a(f),t?.(f)},u=()=>{const f=i>0?i-1:s.length-1;o(f)},d=()=>{const f=i<s.length-1?i+1:0;o(f)},h={currentBranch:i,totalBranches:s.length,goToPrevious:u,goToNext:d,branches:s,setBranches:l};return(0,m.jsx)(Yc.Provider,{value:h,children:(0,m.jsx)("div",{className:me("grid w-full gap-2 [&>div]:pb-0",n),...r})})},Hs=({children:e,...t})=>{const{currentBranch:n,setBranches:r,branches:i}=ax(),a=Array.isArray(e)?e:[e];return(0,k.useEffect)(()=>{i.length!==a.length&&r(a)},[a,i,r]),a.map((s,l)=>(0,m.jsx)("div",{className:me("grid gap-2 overflow-hidden [&>div]:pb-0",l===n?"block":"hidden"),...t,children:s},s.key))},qc=(0,k.memo)(({className:e,...t})=>(0,m.jsx)(Qi,{className:me("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);qc.displayName="MessageResponse";var sx="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",ox=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=sx[n[e]&63];return t},lx=(0,k.createContext)(null),cx=(0,k.createContext)(null),Vc=()=>(0,k.useContext)(lx),ux=()=>(0,k.useContext)(cx),Wc=(0,k.createContext)(null),hx=()=>{const e=ux(),t=(0,k.use)(Wc),n=e??t;if(!n)throw new Error("usePromptInputAttachments must be used within a PromptInput or PromptInputProvider");return n},dx=({className:e,accept:t,multiple:n,globalDrop:r,syncHiddenInput:i,maxFiles:a,maxFileSize:s,onError:l,onSubmit:o,children:u,...d})=>{const h=Vc(),f=!!h,p=(0,k.useRef)(null),E=(0,k.useRef)(null),[N,y]=(0,k.useState)([]),_=f?h.attachments.files:N,C=(0,k.useRef)(_);C.current=_;const w=(0,k.useCallback)(()=>{p.current?.click()},[]),R=(0,k.useCallback)(P=>!t||t.trim()===""?!0:t.split(",").map(V=>V.trim()).filter(Boolean).some(V=>{if(V.endsWith("/*")){const X=V.slice(0,-1);return P.type.startsWith(X)}return P.type===V}),[t]),O=(0,k.useCallback)(P=>{const V=Array.from(P),X=V.filter(fe=>R(fe));if(V.length&&X.length===0){l?.({code:"accept",message:"No files match the accepted types."});return}const A=fe=>s?fe.size<=s:!0,oe=X.filter(A);if(X.length>0&&oe.length===0){l?.({code:"max_file_size",message:"All files exceed the maximum size."});return}y(fe=>{const x=typeof a=="number"?Math.max(0,a-fe.length):void 0,Oe=typeof x=="number"?oe.slice(0,x):oe;typeof x=="number"&&oe.length>x&&l?.({code:"max_files",message:"Too many files. Some were not added."});const Ee=[];for(const pe of Oe)Ee.push({id:ox(),type:"file",url:URL.createObjectURL(pe),mediaType:pe.type,filename:pe.name});return fe.concat(Ee)})},[R,a,s,l]),S=(0,k.useCallback)(P=>y(V=>{const X=V.find(A=>A.id===P);return X?.url&&URL.revokeObjectURL(X.url),V.filter(A=>A.id!==P)}),[]),$=(0,k.useCallback)(()=>y(P=>{for(const V of P)V.url&&URL.revokeObjectURL(V.url);return[]}),[]),Y=f?h.attachments.add:O,W=f?h.attachments.remove:S,I=f?h.attachments.clear:$,U=f?h.attachments.openFileDialog:w;(0,k.useEffect)(()=>{f&&h.__registerFileInput(p,()=>p.current?.click())},[f,h]),(0,k.useEffect)(()=>{i&&p.current&&_.length===0&&(p.current.value="")},[_,i]),(0,k.useEffect)(()=>{const P=E.current;if(!P||r)return;const V=A=>{A.dataTransfer?.types?.includes("Files")&&A.preventDefault()},X=A=>{A.dataTransfer?.types?.includes("Files")&&A.preventDefault(),A.dataTransfer?.files&&A.dataTransfer.files.length>0&&Y(A.dataTransfer.files)};return P.addEventListener("dragover",V),P.addEventListener("drop",X),()=>{P.removeEventListener("dragover",V),P.removeEventListener("drop",X)}},[Y,r]),(0,k.useEffect)(()=>{if(!r)return;const P=X=>{X.dataTransfer?.types?.includes("Files")&&X.preventDefault()},V=X=>{X.dataTransfer?.types?.includes("Files")&&X.preventDefault(),X.dataTransfer?.files&&X.dataTransfer.files.length>0&&Y(X.dataTransfer.files)};return document.addEventListener("dragover",P),document.addEventListener("drop",V),()=>{document.removeEventListener("dragover",P),document.removeEventListener("drop",V)}},[Y,r]),(0,k.useEffect)(()=>()=>{if(!f)for(const P of C.current)P.url&&URL.revokeObjectURL(P.url)},[f]);const z=P=>{P.currentTarget.files&&Y(P.currentTarget.files),P.currentTarget.value=""},q=async P=>{try{const V=await(await fetch(P)).blob();return new Promise(X=>{const A=new FileReader;A.onloadend=()=>X(A.result),A.onerror=()=>X(null),A.readAsDataURL(V)})}catch{return null}},J=(0,k.useMemo)(()=>({files:_.map(P=>({...P,id:P.id})),add:Y,remove:W,clear:I,openFileDialog:U,fileInputRef:p}),[_,Y,W,I,U]),Q=P=>{P.preventDefault();const V=P.currentTarget,X=f?h.textInput.value:new FormData(V).get("message")||"";f||V.reset(),Promise.all(_.map(async({id:A,...oe})=>{if(oe.url?.startsWith("blob:")){const fe=await q(oe.url);return{...oe,url:fe??oe.url}}return oe})).then(A=>{try{const oe=o({text:X,files:A},P);oe instanceof Promise?oe.then(()=>{I(),f&&h.textInput.clear()}).catch(()=>{}):(I(),f&&h.textInput.clear())}catch{}}).catch(()=>{})},H=(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("input",{accept:t,"aria-label":"Upload files",className:"hidden",multiple:n,onChange:z,ref:p,title:"Upload files",type:"file"}),(0,m.jsx)("form",{className:me("w-full",e),onSubmit:Q,ref:E,...d,children:(0,m.jsx)(bu,{className:"overflow-hidden",children:u})})]});return f?H:(0,m.jsx)(Wc.Provider,{value:J,children:H})},fx=({className:e,...t})=>(0,m.jsx)("div",{className:me("contents",e),...t}),px=({onChange:e,className:t,placeholder:n="What would you like to know?",...r})=>{const i=Vc(),a=hx(),[s,l]=(0,k.useState)(!1),o=h=>{if(h.key==="Enter"){if(s||h.nativeEvent.isComposing||h.shiftKey)return;h.preventDefault();const f=h.currentTarget.form;if(f?.querySelector('button[type="submit"]')?.disabled)return;f?.requestSubmit()}if(h.key==="Backspace"&&h.currentTarget.value===""&&a.files.length>0){h.preventDefault();const f=a.files.at(-1);f&&a.remove(f.id)}},u=h=>{const f=h.clipboardData?.items;if(!f)return;const p=[];for(const E of f)if(E.kind==="file"){const N=E.getAsFile();N&&p.push(N)}p.length>0&&(h.preventDefault(),a.add(p))},d=i?{value:i.textInput.value,onChange:h=>{i.textInput.setInput(h.currentTarget.value),e?.(h)}}:{onChange:e};return(0,m.jsx)(ku,{className:me("field-sizing-content max-h-48 min-h-16",t),name:"message",onCompositionEnd:()=>l(!1),onCompositionStart:()=>l(!0),onKeyDown:o,onPaste:u,placeholder:n,...r,...d})},mx=({className:e,...t})=>(0,m.jsx)(Au,{align:"block-end",className:me("justify-between justify-end gap-1",e),...t}),gx=({className:e,variant:t="default",size:n="icon-sm",status:r,children:i,...a})=>{let s=(0,m.jsx)(cu,{className:"size-4"});return r==="submitted"?s=(0,m.jsx)(iu,{className:"size-4 animate-spin"}):r==="streaming"?s=(0,m.jsx)(ou,{className:"size-4"}):r==="error"&&(s=(0,m.jsx)(lu,{className:"size-4"})),(0,m.jsx)(xu,{"aria-label":"Submit",className:me(e),size:n,type:"submit",variant:t,...a,children:i??s})};function Ex({...e}){return(0,m.jsx)(hu,{"data-slot":"collapsible",...e})}function Tx({...e}){return(0,m.jsx)(pu,{"data-slot":"collapsible-trigger",...e})}function bx({...e}){return(0,m.jsx)(mu,{"data-slot":"collapsible-content",...e})}var kx=({children:e,as:t="p",className:n,duration:r=2,spread:i=2})=>{const a=(0,k.useMemo)(()=>(e?.length??0)*i,[e,i]);return(0,m.jsx)(t,{className:me("relative inline-block bg-size-[250%_100%,auto] bg-clip-text text-transparent","[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]","animate-shimmer",n),style:{"--spread":`${a}px`,"--duration":`${r}s`,backgroundImage:"var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))"},children:e})},Ax=(0,k.memo)(kx),Gc=(0,k.createContext)(null),_x=()=>{const e=(0,k.use)(Gc);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},xx=1e3,yx=1e3,Qc=(0,k.memo)(({className:e,isStreaming:t=!1,open:n,defaultOpen:r=!0,onOpenChange:i,duration:a,children:s,...l})=>{const[o,u]=Ki({prop:n,defaultProp:r,onChange:i}),[d,h]=Ki({prop:a,defaultProp:void 0}),[f,p]=(0,k.useState)(!1),[E,N]=(0,k.useState)(null);(0,k.useEffect)(()=>{t?E===null&&N(Date.now()):E!==null&&(h(Math.ceil((Date.now()-E)/yx)),N(null))},[t,E,h]),(0,k.useEffect)(()=>{if(r&&!t&&o&&!f){const _=setTimeout(()=>{u(!1),p(!0)},xx);return()=>clearTimeout(_)}},[t,o,r,u,f]);const y=_=>{u(_)};return(0,m.jsx)(Gc.Provider,{value:{isStreaming:t,isOpen:o,setIsOpen:u,duration:d},children:(0,m.jsx)(Ex,{className:me("not-prose mb-4",e),onOpenChange:y,open:o,...l,children:s})})}),Cx=(e,t)=>e||t===0?(0,m.jsx)(Ax,{duration:1,children:"Thinking..."}):t===void 0?(0,m.jsx)("p",{children:"Thought for a few seconds"}):(0,m.jsxs)("p",{children:["Thought for ",t," seconds"]}),Kc=(0,k.memo)(({className:e,children:t,getThinkingMessage:n=Cx,...r})=>{const{isStreaming:i,isOpen:a,duration:s}=_x();return(0,m.jsx)(Tx,{className:me("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...r,children:t??(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(tu,{className:"size-4"}),n(i,s),(0,m.jsx)(su,{className:me("size-4 transition-transform",a?"rotate-180":"rotate-0")})]})})}),Xc=(0,k.memo)(({className:e,children:t,...n})=>(0,m.jsx)(bx,{className:me("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...n,children:(0,m.jsx)(Qi,{children:t})}));Qc.displayName="Reasoning";Kc.displayName="ReasoningTrigger";Xc.displayName="ReasoningContent";var Sx=({className:e,children:t,...n})=>(0,m.jsxs)(vu,{className:"w-full overflow-x-auto whitespace-nowrap",...n,children:[(0,m.jsx)("div",{className:me("flex w-max flex-nowrap items-center gap-2",e),children:t}),(0,m.jsx)(Iu,{className:"hidden",orientation:"horizontal"})]}),Nx=({suggestion:e,onClick:t,className:n,variant:r="outline",size:i="sm",children:a,...s})=>{const l=()=>{t?.(e)};return(0,m.jsx)(nr,{className:me("cursor-pointer rounded-full px-4",n),onClick:l,size:i,type:"button",variant:r,...s,children:a||e})},ey=pi({ChatSidebar:()=>vx}),Ix=({db:e,onRateLimitRefetch:t,onControllerReady:n})=>{const[r,i]=(0,k.useState)(""),[a,s]=(0,k.useState)(null),{openOverlay:l}=zs(),{pendingPrompt:o,consumePrompt:u}=wu(),{includeSchemaInAiContext:d,provider:h,model:f}=qs(),p=Vs(zr),E=Ys(),N=p.status[h],y=N?.state==="set"||N?.state==="locked",{rateLimit:_}=Ws({enabled:E&&h==="gemini"&&!y}),{remaining:C}=_??{remaining:0,limit:0},w=y||h==="gemini"&&C>0,{messages:R,sendMessage:O,isLoading:S,clear:$,stop:Y}=Lu({connection:Ru(`${Cu()}${Su.API_PREFIX}/chat`,()=>({headers:yu()})),body:{db:e,includeSchema:d},byok:zr,forwardedProps:{provider:h,model:f},onError:q=>s(q.message),onFinish:()=>{h==="gemini"&&!y&&t()}});(0,k.useEffect)(()=>{!o||S||!E||!w||(u(),O(o))},[w,u,E,S,o,O]),(0,k.useEffect)(()=>{n({clear:()=>{$(),i(""),s(null)},isLoading:S})},[$,S,n]);const W=q=>{const J=!!q.text,Q=!!q.files?.length;!(J||Q)||S||(s(null),O(q.text),i(""))},I=q=>{s(null),O(q),i("")},U=()=>{Y(),i("")},z=S?"streaming":"ready";return(0,m.jsxs)("div",{className:"relative flex size-full flex-col divide-y overflow-hidden",children:[(0,m.jsxs)(tx,{children:[(0,m.jsx)(nx,{children:R.length===0?(0,m.jsx)("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:(0,m.jsxs)("div",{className:"text-center space-y-2",children:[(0,m.jsx)("p",{className:"text-lg font-medium",children:"Start a new conversation"}),(0,m.jsx)("p",{className:"text-sm",children:"Ask me anything to get started"})]})}):(0,m.jsxs)(m.Fragment,{children:[R.map(q=>{const J=q.parts.filter(P=>P.type==="thinking"),Q=q.parts.reduce((P,V)=>V.type==="text"?P+(V.content??""):P,""),H=J.length>0;return(0,m.jsx)(Fs,{defaultBranch:0,children:(0,m.jsx)(Hs,{children:(0,m.jsx)(Ms,{from:q.role==="user"?"user":"assistant",children:(0,m.jsxs)("div",{children:[H&&q.role==="assistant"&&(0,m.jsxs)(Qc,{duration:0,children:[(0,m.jsx)(Kc,{}),(0,m.jsx)(Xc,{children:J.map(P=>P.content).join(`
131
+ `})}return n},M_=/([\\`*_~[\]|])/g,B_=e=>e.replace(M_,"\\$1"),F_=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let i=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(i,(a,s,l,o)=>s+B_(l).replace(/\n\n/g,"&#10;&#10;")+o)}return n},Fc=e=>e.type==="text"?e.value:"children"in e&&Array.isArray(e.children)?e.children.map(Fc).join(""):"",H_=e=>t=>{if(!e||e.length===0)return;let n=new Set(e.map(r=>r.toLowerCase()));Xe(t,"element",r=>{if(n.has(r.tagName.toLowerCase())){let i=Fc(r);r.children=i?[{type:"text",value:i}]:[]}})},U_=()=>e=>{Xe(e,"code",t=>{var n,r;t.meta&&(t.data=(n=t.data)!=null?n:{},t.data.hProperties={...(r=t.data.hProperties)!=null?r:{},metastring:t.meta})})},j_=/^[ \t]*<[\w!/?-]/,z_=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,$_=e=>typeof e!="string"||e.length===0||!j_.test(e)?e:e.replace(z_,"$1"),vs,ws,Ls,Rs,qn={...kt,protocols:{...kt.protocols,href:[...(ws=(vs=kt.protocols)==null?void 0:vs.href)!=null?ws:[],"tel"]},attributes:{...kt.attributes,code:[...(Rs=(Ls=kt.attributes)==null?void 0:Ls.code)!=null?Rs:[],"metastring"]}},fi={raw:Kr,sanitize:[Wo,qn],harden:[Uu,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},Y_={gfm:[aT,{}],codeMeta:U_},Os=Object.values(fi),q_=Object.values(Y_),V_={block:" ▋",circle:" ●"},Hc=["github-light","github-dark"],Uc={enabled:!0},Fe=(0,k.createContext)({shikiTheme:Hc,controls:!0,isAnimating:!1,lineNumbers:!0,mode:"streaming",mermaid:void 0,linkSafety:Uc}),jc=(0,k.memo)(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:n,index:r,isIncomplete:i,dir:a,animatePlugin:s,...l})=>{if(s){let d=s.getLastRenderCharCount();s.setPrevContentLength(d)}let o=typeof e=="string"&&n?$_(e):e,u=(0,m.jsx)(Bc,{...l,children:o});return(0,m.jsx)(ic.Provider,{value:i,children:a?(0,m.jsx)("div",{dir:a,style:{display:"contents"},children:u}):u})},(e,t)=>{if(e.content!==t.content||e.shouldNormalizeHtmlIndentation!==t.shouldNormalizeHtmlIndentation||e.index!==t.index||e.isIncomplete!==t.isIncomplete||e.dir!==t.dir)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(i=>{var a,s;return((a=e.components)==null?void 0:a[i])!==((s=t.components)==null?void 0:s[i])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});jc.displayName="Block";var Qi=(0,k.memo)(({children:e,mode:t="streaming",dir:n,parseIncompleteMarkdown:r=!0,normalizeHtmlIndentation:i=!1,components:a,rehypePlugins:s=Os,remarkPlugins:l=q_,className:o,shikiTheme:u=Hc,mermaid:d,controls:h=!0,isAnimating:f=!1,animated:p,BlockComponent:E=jc,parseMarkdownIntoBlocksFn:N=D_,caret:y,plugins:_,remend:C,linkSafety:w=Uc,lineNumbers:R=!0,allowedTags:O,literalTagContent:S,translations:$,icons:Y,prefix:W,onAnimationStart:I,onAnimationEnd:U,...z})=>{let q=(0,k.useId)(),[J,Q]=(0,k.useTransition)(),H=(0,k.useMemo)(()=>IA(W),[W]),P=(0,k.useRef)(null),V=(0,k.useRef)(I),X=(0,k.useRef)(U);V.current=I,X.current=U,(0,k.useEffect)(()=>{var re,ce,ve;if(t==="static")return;let We=P.current;if(P.current=f,We===null){f&&((re=V.current)==null||re.call(V));return}f&&!We?(ce=V.current)==null||ce.call(V):!f&&We&&((ve=X.current)==null||ve.call(X))},[f,t]);let A=(0,k.useMemo)(()=>O?Object.keys(O):[],[O]),oe=(0,k.useMemo)(()=>{if(typeof e!="string")return"";let re=t==="streaming"&&r?gb(e,C):e;return S&&S.length>0&&(re=F_(re,S)),A.length>0&&(re=P_(re,A)),re},[e,t,r,C,A,S]),fe=(0,k.useMemo)(()=>N(oe),[oe,N]),[x,Oe]=(0,k.useState)(fe);(0,k.useEffect)(()=>{t==="streaming"&&!He?Q(()=>{Oe(fe)}):Oe(fe)},[fe,t]);let Ee=t==="streaming"?x:fe,pe=(0,k.useMemo)(()=>n==="auto"?Ee.map(ks):void 0,[Ee,n]),gt=(0,k.useMemo)(()=>Ee.map((re,ce)=>`${q}-${ce}`),[Ee.length,q]),De=(0,k.useMemo)(()=>p===!0?"true":p?JSON.stringify(p):"",[p]),He=(0,k.useMemo)(()=>De?De==="true"?oi():oi(p):null,[De]),et=(0,k.useMemo)(()=>{var re,ce;return{shikiTheme:(ce=(re=_?.code)==null?void 0:re.getThemes())!=null?ce:u,controls:h,isAnimating:f,lineNumbers:R,mode:t,mermaid:d,linkSafety:w}},[u,h,f,R,t,d,w,_?.code]),vn=(0,k.useMemo)(()=>$?JSON.stringify($):"",[$]),wn=(0,k.useMemo)(()=>({...lc,...$}),[vn]),Ln=(0,k.useMemo)(()=>{let{inlineCode:re,...ce}=a??{},ve={...h_,...ce};if(re){let We=ve.code;ve.code=Et=>"data-block"in Et?We?(0,k.createElement)(We,Et):null:(0,k.createElement)(re,Et)}return ve},[a]),Rn=(0,k.useMemo)(()=>{let re=[];return _!=null&&_.cjk&&(re=[...re,..._.cjk.remarkPluginsBefore]),re=[...re,...l],_!=null&&_.cjk&&(re=[...re,..._.cjk.remarkPluginsAfter]),_!=null&&_.math&&(re=[...re,_.math.remarkPlugin]),re},[l,_?.math,_?.cjk]),Gt=(0,k.useMemo)(()=>{var re;let ce=s;if(O&&Object.keys(O).length>0&&s===Os){let ve={...qn,tagNames:[...(re=qn.tagNames)!=null?re:[],...Object.keys(O)],attributes:{...qn.attributes,...O}};ce=[fi.raw,[Wo,ve],fi.harden]}return S&&S.length>0&&(ce=[...ce,[H_,S]]),_!=null&&_.math&&(ce=[...ce,_.math.rehypePlugin]),He&&f&&(ce=[...ce,He.rehypePlugin]),ce},[s,_?.math,He,f,O,S]),Lt=(0,k.useMemo)(()=>{if(!f||Ee.length===0)return!1;let re=Ee.at(-1);return As(re)||g_(re)},[f,Ee]),On=(0,k.useMemo)(()=>y&&f&&!Lt?{"--streamdown-caret":`"${V_[y]}"`}:void 0,[y,f,Lt]);return t==="static"?(0,m.jsx)(ci.Provider,{value:wn,children:(0,m.jsx)(ui.Provider,{value:_??null,children:(0,m.jsx)(Fe.Provider,{value:et,children:(0,m.jsx)(ms,{icons:Y,children:(0,m.jsx)(li.Provider,{value:H,children:(0,m.jsx)("div",{className:H("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",o),dir:n==="auto"?ks(oe):n,children:(0,m.jsx)(Bc,{components:Ln,rehypePlugins:Gt,remarkPlugins:Rn,...z,children:oe})})})})})})}):(0,m.jsx)(ci.Provider,{value:wn,children:(0,m.jsx)(ui.Provider,{value:_??null,children:(0,m.jsx)(Fe.Provider,{value:et,children:(0,m.jsx)(ms,{icons:Y,children:(0,m.jsx)(li.Provider,{value:H,children:(0,m.jsxs)("div",{className:H("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",y&&!Lt?"[&>*:last-child]:after:inline [&>*:last-child]:after:align-baseline [&>*:last-child]:after:content-[var(--streamdown-caret)]":null,o),style:On,children:[Ee.length===0&&y&&f&&(0,m.jsx)("span",{}),Ee.map((re,ce)=>{var ve;let We=ce===Ee.length-1,Et=f&&We&&As(re);return(0,m.jsx)(E,{animatePlugin:He,components:Ln,content:re,dir:(ve=pe?.[ce])!=null?ve:n!=="auto"?n:void 0,index:ce,isIncomplete:Et,rehypePlugins:Gt,remarkPlugins:Rn,shouldNormalizeHtmlIndentation:i,shouldParseIncompleteMarkdown:r,...z},gt[ce])})]})})})})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety&&e.lineNumbers===t.lineNumbers&&e.normalizeHtmlIndentation===t.normalizeHtmlIndentation&&e.literalTagContent===t.literalTagContent&&JSON.stringify(e.translations)===JSON.stringify(t.translations)&&e.prefix===t.prefix&&e.dir===t.dir);Qi.displayName="Streamdown";var W_=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:i=.1,showControls:a=!0,initialZoom:s=1,fullscreen:l=!1})=>{let{RotateCcwIcon:o,ZoomInIcon:u,ZoomOutIcon:d}=Ve(),h=te(),f=(0,k.useRef)(null),p=(0,k.useRef)(null),[E,N]=(0,k.useState)(s),[y,_]=(0,k.useState)({x:0,y:0}),[C,w]=(0,k.useState)(!1),[R,O]=(0,k.useState)({x:0,y:0}),[S,$]=(0,k.useState)({x:0,y:0}),Y=(0,k.useCallback)(H=>{N(P=>Math.max(n,Math.min(r,P+H)))},[n,r]),W=(0,k.useCallback)(()=>{Y(i)},[Y,i]),I=(0,k.useCallback)(()=>{Y(-i)},[Y,i]),U=(0,k.useCallback)(()=>{N(s),_({x:0,y:0})},[s]),z=(0,k.useCallback)(H=>{H.preventDefault();let P=H.deltaY>0?-i:i;Y(P)},[Y,i]),q=(0,k.useCallback)(H=>{if(H.button!==0||H.isPrimary===!1)return;w(!0),O({x:H.clientX,y:H.clientY}),$(y);let P=H.currentTarget;P instanceof HTMLElement&&P.setPointerCapture(H.pointerId)},[y]),J=(0,k.useCallback)(H=>{if(!C)return;H.preventDefault();let P=H.clientX-R.x,V=H.clientY-R.y;_({x:S.x+P,y:S.y+V})},[C,R,S]),Q=(0,k.useCallback)(H=>{w(!1);let P=H.currentTarget;P instanceof HTMLElement&&P.releasePointerCapture(H.pointerId)},[]);return(0,k.useEffect)(()=>{let H=f.current;if(H)return H.addEventListener("wheel",z,{passive:!1}),()=>{H.removeEventListener("wheel",z)}},[z]),(0,k.useEffect)(()=>{let H=p.current;if(H&&C)return document.body.style.userSelect="none",H.addEventListener("pointermove",J,{passive:!1}),H.addEventListener("pointerup",Q),H.addEventListener("pointercancel",Q),()=>{document.body.style.userSelect="",H.removeEventListener("pointermove",J),H.removeEventListener("pointerup",Q),H.removeEventListener("pointercancel",Q)}},[C,J,Q]),(0,m.jsxs)("div",{className:h("relative flex flex-col",l?"h-full w-full":"min-h-28 w-full",t),ref:f,style:{cursor:C?"grabbing":"grab"},children:[a?(0,m.jsxs)("div",{className:h("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/80 p-1 supports-[backdrop-filter]:bg-background/70 supports-[backdrop-filter]:backdrop-blur-sm",l?"bottom-4 left-4":"bottom-2 left-2"),children:[(0,m.jsx)("button",{className:h("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:E>=r,onClick:W,title:"Zoom in",type:"button",children:(0,m.jsx)(u,{size:16})}),(0,m.jsx)("button",{className:h("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:E<=n,onClick:I,title:"Zoom out",type:"button",children:(0,m.jsx)(d,{size:16})}),(0,m.jsx)("button",{className:h("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"),onClick:U,title:"Reset zoom and pan",type:"button",children:(0,m.jsx)(o,{size:16})})]}):null,(0,m.jsx)("div",{className:h("flex-1 origin-center transition-transform duration-150 ease-out",l?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:q,ref:p,role:"application",style:{transform:`translate(${y.x}px, ${y.y}px) scale(${E})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},G_=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let a=te(),[s,l]=(0,k.useState)(null),[o,u]=(0,k.useState)(!1),[d,h]=(0,k.useState)(""),[f,p]=(0,k.useState)(""),[E,N]=(0,k.useState)(0),{mermaid:y}=(0,k.useContext)(Fe),_=Wi(),C=y?.errorComponent,{shouldRender:w,containerRef:R}=gA({immediate:r});if((0,k.useEffect)(()=>{if(w){if(!_){l("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{l(null),u(!0);let S=_.getMermaid(n),$=e.split("").reduce((I,U)=>(I<<5)-I+U.charCodeAt(0)|0,0),Y=`mermaid-${Math.abs($)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:W}=await S.render(Y,e);h(W),p(W)}catch(S){if(!(f||d)){let $=S instanceof Error?S.message:"Failed to render Mermaid chart";l($)}}finally{u(!1)}})()}},[e,n,E,w,_]),!(w||d||f))return(0,m.jsx)("div",{className:a("my-4 min-h-[200px]",t),ref:R});if(o&&!d&&!f)return(0,m.jsx)("div",{className:a("my-4 flex justify-center p-4",t),ref:R,children:(0,m.jsxs)("div",{className:a("flex items-center space-x-2 text-muted-foreground"),children:[(0,m.jsx)("div",{className:a("h-4 w-4 animate-spin rounded-full border-current border-b-2")}),(0,m.jsx)("span",{className:a("text-sm"),children:"Loading diagram..."})]})});if(s&&!d&&!f){let S=()=>N($=>$+1);return C?(0,m.jsx)("div",{ref:R,children:(0,m.jsx)(C,{chart:e,error:s,retry:S})}):(0,m.jsxs)("div",{className:a("rounded-md bg-red-50 p-4",t),ref:R,children:[(0,m.jsxs)("p",{className:a("font-mono text-red-700 text-sm"),children:["Mermaid Error: ",s]}),(0,m.jsxs)("details",{className:a("mt-2"),children:[(0,m.jsx)("summary",{className:a("cursor-pointer text-red-600 text-xs"),children:"Show Code"}),(0,m.jsx)("pre",{className:a("mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs"),children:e})]})]})}let O=d||f;return(0,m.jsx)("div",{className:a("size-full",t),"data-streamdown":"mermaid",ref:R,children:(0,m.jsx)(W_,{className:a(r?"size-full overflow-hidden":"overflow-hidden",t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:(0,m.jsx)("div",{"aria-label":"Mermaid chart",className:a("flex justify-center",r?"size-full items-center":null),dangerouslySetInnerHTML:{__html:O},role:"img"})})})},Q_={damping:.7,stiffness:.05,mass:1.25},K_=70,X_=1e3/60,Z_=350,Er=!1;globalThis.document?.addEventListener("mousedown",()=>{Er=!0});globalThis.document?.addEventListener("mouseup",()=>{Er=!1});globalThis.document?.addEventListener("click",()=>{Er=!1});var J_=(e={})=>{const[t,n]=(0,k.useState)(!1),[r,i]=(0,k.useState)(e.initial!==!1),[a,s]=(0,k.useState)(!1),l=(0,k.useRef)(null);l.current=e;const o=(0,k.useCallback)(()=>{if(!Er)return!1;const C=window.getSelection();if(!C||!C.rangeCount)return!1;const w=C.getRangeAt(0);return w.commonAncestorContainer.contains(y.current)||y.current?.contains(w.commonAncestorContainer)},[]),u=(0,k.useCallback)(C=>{h.isAtBottom=C,i(C)},[]),d=(0,k.useCallback)(C=>{h.escapedFromLock=C,n(C)},[]),h=(0,k.useMemo)(()=>{let C;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return y.current?.scrollTop??0},set scrollTop(w){if(y.current){const{scrollBehavior:R}=getComputedStyle(y.current);R!=="auto"&&(y.current.style.scrollBehavior="auto"),y.current.scrollTop=w,h.ignoreScrollToTop=y.current.scrollTop,R!=="auto"&&(y.current.style.scrollBehavior=R)}},get targetScrollTop(){return!y.current||!_.current?0:y.current.scrollHeight-1-y.current.clientHeight},get calculatedTargetScrollTop(){if(!y.current||!_.current)return 0;const{targetScrollTop:w}=this;if(!e.targetScrollTop)return w;if(C?.targetScrollTop===w)return C.calculatedScrollTop;const R=Math.max(Math.min(e.targetScrollTop(w,{scrollElement:y.current,contentElement:_.current}),w),0);return C={targetScrollTop:w,calculatedScrollTop:R},requestAnimationFrame(()=>{C=void 0}),R},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=K_}}},[]),f=(0,k.useCallback)((C={})=>{typeof C=="string"&&(C={animation:C}),C.preserveScrollPosition||u(!0);const w=Date.now()+(Number(C.wait)||0),R=jr(l.current,C.animation),{ignoreEscapes:O=!1}=C;let S,$=h.calculatedTargetScrollTop;C.duration instanceof Promise?C.duration.finally(()=>{S=Date.now()}):S=w+(C.duration??0);const Y=async()=>{const W=new Promise(requestAnimationFrame).then(()=>{if(!h.isAtBottom)return h.animation=void 0,!1;const{scrollTop:I}=h,U=performance.now(),z=(U-(h.lastTick??U))/X_;if(h.animation||(h.animation={behavior:R,promise:W,ignoreEscapes:O}),h.animation.behavior===R&&(h.lastTick=U),o()||w>Date.now())return Y();if(I<Math.min($,h.calculatedTargetScrollTop)){if(h.animation?.behavior===R){if(R==="instant")return h.scrollTop=h.calculatedTargetScrollTop,Y();h.velocity=(R.damping*h.velocity+R.stiffness*h.scrollDifference)/R.mass,h.accumulated+=h.velocity*z,h.scrollTop+=h.accumulated,h.scrollTop!==I&&(h.accumulated=0)}return Y()}return S>Date.now()?($=h.calculatedTargetScrollTop,Y()):(h.animation=void 0,h.scrollTop<h.calculatedTargetScrollTop?f({animation:jr(l.current,l.current.resize),ignoreEscapes:O,duration:Math.max(0,S-Date.now())||void 0}):h.isAtBottom)});return W.then(I=>(requestAnimationFrame(()=>{h.animation||(h.lastTick=void 0,h.velocity=0)}),I))};return C.wait!==!0&&(h.animation=void 0),h.animation?.behavior===R?h.animation.promise:Y()},[u,o,h]),p=(0,k.useCallback)(()=>{d(!0),u(!1)},[d,u]),E=(0,k.useCallback)(({target:C})=>{if(C!==y.current)return;const{scrollTop:w,ignoreScrollToTop:R}=h;let{lastScrollTop:O=w}=h;h.lastScrollTop=w,h.ignoreScrollToTop=void 0,R&&R>w&&(O=R),s(h.isNearBottom),setTimeout(()=>{if(h.resizeDifference||w===R)return;if(o()){d(!0),u(!1);return}const S=w>O,$=w<O;if(h.animation?.ignoreEscapes){h.scrollTop=O;return}$&&(d(!0),u(!1)),S&&d(!1),!h.escapedFromLock&&h.isNearBottom&&u(!0)},1)},[d,u,o,h]),N=(0,k.useCallback)(({target:C,deltaY:w})=>{let R=C;for(;!["scroll","auto"].includes(getComputedStyle(R).overflow);){if(!R.parentElement)return;R=R.parentElement}R===y.current&&w<0&&y.current.scrollHeight>y.current.clientHeight&&!h.animation?.ignoreEscapes&&(d(!0),u(!1))},[d,u,h]),y=Ds(C=>{y.current?.removeEventListener("scroll",E),y.current?.removeEventListener("wheel",N),C?.addEventListener("scroll",E,{passive:!0}),C?.addEventListener("wheel",N,{passive:!0})},[]),_=Ds(C=>{if(h.resizeObserver?.disconnect(),!C)return;let w;h.resizeObserver=new ResizeObserver(([R])=>{const{height:O}=R.contentRect,S=O-(w??O);if(h.resizeDifference=S,h.scrollTop>h.targetScrollTop&&(h.scrollTop=h.targetScrollTop),s(h.isNearBottom),S>=0){const $=jr(l.current,w?l.current.resize:l.current.initial);f({animation:$,wait:!0,preserveScrollPosition:!0,duration:$==="instant"?void 0:Z_})}else h.isNearBottom&&(d(!1),u(!0));w=O,requestAnimationFrame(()=>{setTimeout(()=>{h.resizeDifference===S&&(h.resizeDifference=0)},1)})}),h.resizeObserver?.observe(C)},[]);return{contentRef:_,scrollRef:y,scrollToBottom:f,stopScroll:p,isAtBottom:r||a,isNearBottom:a,escapedFromLock:t,state:h}};function Ds(e,t){const n=(0,k.useCallback)(r=>(n.current=r,e(r)),t);return n}var Ur=new Map;function jr(...e){const t={...Q_};let n=!1;for(const i of e){if(i==="instant"){n=!0;continue}typeof i=="object"&&(n=!1,t.damping=i.damping??t.damping,t.stiffness=i.stiffness??t.stiffness,t.mass=i.mass??t.mass)}const r=JSON.stringify(t);return Ur.has(r)||Ur.set(r,Object.freeze(t)),n?"instant":Ur.get(r)}var zc=(0,k.createContext)(null),ex=typeof window<"u"?k.useLayoutEffect:k.useEffect;function er({instance:e,children:t,resize:n,initial:r,mass:i,damping:a,stiffness:s,targetScrollTop:l,contextRef:o,...u}){const d=(0,k.useRef)(null),h=k.useCallback((O,S)=>(R?.targetScrollTop??l)?.(O,S)??O,[l]),f=J_({mass:i,damping:a,stiffness:s,resize:n,initial:r,targetScrollTop:h}),{scrollRef:p,contentRef:E,scrollToBottom:N,stopScroll:y,isAtBottom:_,escapedFromLock:C,state:w}=e??f,R=(0,k.useMemo)(()=>({scrollToBottom:N,stopScroll:y,scrollRef:p,isAtBottom:_,escapedFromLock:C,contentRef:E,state:w,get targetScrollTop(){return d.current},set targetScrollTop(O){d.current=O}}),[N,_,E,p,y,C,w]);return(0,k.useImperativeHandle)(o,()=>R,[R]),ex(()=>{p.current&&getComputedStyle(p.current).overflow==="visible"&&(p.current.style.overflow="auto")},[]),k.createElement(zc.Provider,{value:R},k.createElement("div",{...u},typeof t=="function"?t(R):t))}(function(e){function t({children:n,scrollClassName:r,...i}){const a=$c();return k.createElement("div",{ref:a.scrollRef,style:{height:"100%",width:"100%",scrollbarGutter:"stable both-edges"},className:r},k.createElement("div",{...i,ref:a.contentRef},typeof n=="function"?n(a):n))}e.Content=t})(er||(er={}));function $c(){const e=(0,k.useContext)(zc);if(!e)throw new Error("use-stick-to-bottom component context must be used within a StickToBottom component");return e}var tx=({className:e,...t})=>(0,m.jsx)(er,{className:me("relative flex-1 overflow-y-hidden",e),initial:"smooth",resize:"smooth",role:"log",...t}),nx=({className:e,...t})=>(0,m.jsx)(er.Content,{className:me("flex flex-col gap-8 p-4",e),...t}),rx=({className:e,...t})=>{const{isAtBottom:n,scrollToBottom:r}=$c(),i=(0,k.useCallback)(()=>{r()},[r]);return!n&&(0,m.jsx)(nr,{className:me("absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full",e),onClick:i,size:"icon",type:"button",variant:"outline",...t,children:(0,m.jsx)(ru,{className:"size-4"})})},Ps=[{variant:"shine",component:({children:e,className:t,...n})=>(0,m.jsx)("span",{...n,className:me("bg-[linear-gradient(110deg,#bfbfbf,35%,#000,50%,#bfbfbf,75%,#bfbfbf)] dark:bg-[linear-gradient(110deg,#404040,35%,#fff,50%,#404040,75%,#404040)]","bg-size-[200%_100%] bg-clip-text text-transparent","animate-shine",t),children:e})}];function ix({variant:e="shine",className:t,...n}){const r=Ps.find(i=>i.variant===e)?.component||Ps[0].component;return(0,m.jsx)(hu,{className:me("font-medium text-sm"),children:(0,m.jsx)(r,{...n,className:t})})}var Ms=({className:e,from:t,...n})=>(0,m.jsx)("div",{className:me("group flex w-full max-w-[95%] flex-col gap-2",t==="user"?"is-user ml-auto justify-end":"is-assistant",e),...n}),Bs=({children:e,className:t,...n})=>(0,m.jsx)("div",{className:me("is-user:dark flex w-fit max-w-full min-w-0 flex-col gap-2 overflow-hidden text-sm","group-[.is-user]:ml-auto group-[.is-user]:rounded-lg group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground","group-[.is-assistant]:text-foreground",t),...n,children:e}),Yc=(0,k.createContext)(null),ax=()=>{const e=(0,k.use)(Yc);if(!e)throw new Error("MessageBranch components must be used within MessageBranch");return e},Fs=({defaultBranch:e=0,onBranchChange:t,className:n,...r})=>{const[i,a]=(0,k.useState)(e),[s,l]=(0,k.useState)([]),o=f=>{a(f),t?.(f)},u=()=>{const f=i>0?i-1:s.length-1;o(f)},d=()=>{const f=i<s.length-1?i+1:0;o(f)},h={currentBranch:i,totalBranches:s.length,goToPrevious:u,goToNext:d,branches:s,setBranches:l};return(0,m.jsx)(Yc.Provider,{value:h,children:(0,m.jsx)("div",{className:me("grid w-full gap-2 [&>div]:pb-0",n),...r})})},Hs=({children:e,...t})=>{const{currentBranch:n,setBranches:r,branches:i}=ax(),a=Array.isArray(e)?e:[e];return(0,k.useEffect)(()=>{i.length!==a.length&&r(a)},[a,i,r]),a.map((s,l)=>(0,m.jsx)("div",{className:me("grid gap-2 overflow-hidden [&>div]:pb-0",l===n?"block":"hidden"),...t,children:s},s.key))},qc=(0,k.memo)(({className:e,...t})=>(0,m.jsx)(Qi,{className:me("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);qc.displayName="MessageResponse";var sx="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",ox=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=sx[n[e]&63];return t},lx=(0,k.createContext)(null),cx=(0,k.createContext)(null),Vc=()=>(0,k.useContext)(lx),ux=()=>(0,k.useContext)(cx),Wc=(0,k.createContext)(null),hx=()=>{const e=ux(),t=(0,k.use)(Wc),n=e??t;if(!n)throw new Error("usePromptInputAttachments must be used within a PromptInput or PromptInputProvider");return n},dx=({className:e,accept:t,multiple:n,globalDrop:r,syncHiddenInput:i,maxFiles:a,maxFileSize:s,onError:l,onSubmit:o,children:u,...d})=>{const h=Vc(),f=!!h,p=(0,k.useRef)(null),E=(0,k.useRef)(null),[N,y]=(0,k.useState)([]),_=f?h.attachments.files:N,C=(0,k.useRef)(_);C.current=_;const w=(0,k.useCallback)(()=>{p.current?.click()},[]),R=(0,k.useCallback)(P=>!t||t.trim()===""?!0:t.split(",").map(V=>V.trim()).filter(Boolean).some(V=>{if(V.endsWith("/*")){const X=V.slice(0,-1);return P.type.startsWith(X)}return P.type===V}),[t]),O=(0,k.useCallback)(P=>{const V=Array.from(P),X=V.filter(fe=>R(fe));if(V.length&&X.length===0){l?.({code:"accept",message:"No files match the accepted types."});return}const A=fe=>s?fe.size<=s:!0,oe=X.filter(A);if(X.length>0&&oe.length===0){l?.({code:"max_file_size",message:"All files exceed the maximum size."});return}y(fe=>{const x=typeof a=="number"?Math.max(0,a-fe.length):void 0,Oe=typeof x=="number"?oe.slice(0,x):oe;typeof x=="number"&&oe.length>x&&l?.({code:"max_files",message:"Too many files. Some were not added."});const Ee=[];for(const pe of Oe)Ee.push({id:ox(),type:"file",url:URL.createObjectURL(pe),mediaType:pe.type,filename:pe.name});return fe.concat(Ee)})},[R,a,s,l]),S=(0,k.useCallback)(P=>y(V=>{const X=V.find(A=>A.id===P);return X?.url&&URL.revokeObjectURL(X.url),V.filter(A=>A.id!==P)}),[]),$=(0,k.useCallback)(()=>y(P=>{for(const V of P)V.url&&URL.revokeObjectURL(V.url);return[]}),[]),Y=f?h.attachments.add:O,W=f?h.attachments.remove:S,I=f?h.attachments.clear:$,U=f?h.attachments.openFileDialog:w;(0,k.useEffect)(()=>{f&&h.__registerFileInput(p,()=>p.current?.click())},[f,h]),(0,k.useEffect)(()=>{i&&p.current&&_.length===0&&(p.current.value="")},[_,i]),(0,k.useEffect)(()=>{const P=E.current;if(!P||r)return;const V=A=>{A.dataTransfer?.types?.includes("Files")&&A.preventDefault()},X=A=>{A.dataTransfer?.types?.includes("Files")&&A.preventDefault(),A.dataTransfer?.files&&A.dataTransfer.files.length>0&&Y(A.dataTransfer.files)};return P.addEventListener("dragover",V),P.addEventListener("drop",X),()=>{P.removeEventListener("dragover",V),P.removeEventListener("drop",X)}},[Y,r]),(0,k.useEffect)(()=>{if(!r)return;const P=X=>{X.dataTransfer?.types?.includes("Files")&&X.preventDefault()},V=X=>{X.dataTransfer?.types?.includes("Files")&&X.preventDefault(),X.dataTransfer?.files&&X.dataTransfer.files.length>0&&Y(X.dataTransfer.files)};return document.addEventListener("dragover",P),document.addEventListener("drop",V),()=>{document.removeEventListener("dragover",P),document.removeEventListener("drop",V)}},[Y,r]),(0,k.useEffect)(()=>()=>{if(!f)for(const P of C.current)P.url&&URL.revokeObjectURL(P.url)},[f]);const z=P=>{P.currentTarget.files&&Y(P.currentTarget.files),P.currentTarget.value=""},q=async P=>{try{const V=await(await fetch(P)).blob();return new Promise(X=>{const A=new FileReader;A.onloadend=()=>X(A.result),A.onerror=()=>X(null),A.readAsDataURL(V)})}catch{return null}},J=(0,k.useMemo)(()=>({files:_.map(P=>({...P,id:P.id})),add:Y,remove:W,clear:I,openFileDialog:U,fileInputRef:p}),[_,Y,W,I,U]),Q=P=>{P.preventDefault();const V=P.currentTarget,X=f?h.textInput.value:new FormData(V).get("message")||"";f||V.reset(),Promise.all(_.map(async({id:A,...oe})=>{if(oe.url?.startsWith("blob:")){const fe=await q(oe.url);return{...oe,url:fe??oe.url}}return oe})).then(A=>{try{const oe=o({text:X,files:A},P);oe instanceof Promise?oe.then(()=>{I(),f&&h.textInput.clear()}).catch(()=>{}):(I(),f&&h.textInput.clear())}catch{}}).catch(()=>{})},H=(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("input",{accept:t,"aria-label":"Upload files",className:"hidden",multiple:n,onChange:z,ref:p,title:"Upload files",type:"file"}),(0,m.jsx)("form",{className:me("w-full",e),onSubmit:Q,ref:E,...d,children:(0,m.jsx)(bu,{className:"overflow-hidden",children:u})})]});return f?H:(0,m.jsx)(Wc.Provider,{value:J,children:H})},fx=({className:e,...t})=>(0,m.jsx)("div",{className:me("contents",e),...t}),px=({onChange:e,className:t,placeholder:n="What would you like to know?",...r})=>{const i=Vc(),a=hx(),[s,l]=(0,k.useState)(!1),o=h=>{if(h.key==="Enter"){if(s||h.nativeEvent.isComposing||h.shiftKey)return;h.preventDefault();const f=h.currentTarget.form;if(f?.querySelector('button[type="submit"]')?.disabled)return;f?.requestSubmit()}if(h.key==="Backspace"&&h.currentTarget.value===""&&a.files.length>0){h.preventDefault();const f=a.files.at(-1);f&&a.remove(f.id)}},u=h=>{const f=h.clipboardData?.items;if(!f)return;const p=[];for(const E of f)if(E.kind==="file"){const N=E.getAsFile();N&&p.push(N)}p.length>0&&(h.preventDefault(),a.add(p))},d=i?{value:i.textInput.value,onChange:h=>{i.textInput.setInput(h.currentTarget.value),e?.(h)}}:{onChange:e};return(0,m.jsx)(ku,{className:me("field-sizing-content max-h-48 min-h-16",t),name:"message",onCompositionEnd:()=>l(!1),onCompositionStart:()=>l(!0),onKeyDown:o,onPaste:u,placeholder:n,...r,...d})},mx=({className:e,...t})=>(0,m.jsx)(Au,{align:"block-end",className:me("justify-between justify-end gap-1",e),...t}),gx=({className:e,variant:t="default",size:n="icon-sm",status:r,children:i,...a})=>{let s=(0,m.jsx)(su,{className:"size-4"});return r==="submitted"?s=(0,m.jsx)(lu,{className:"size-4 animate-spin"}):r==="streaming"?s=(0,m.jsx)(au,{className:"size-4"}):r==="error"&&(s=(0,m.jsx)(ou,{className:"size-4"})),(0,m.jsx)(xu,{"aria-label":"Submit",className:me(e),size:n,type:"submit",variant:t,...a,children:i??s})};function Ex({...e}){return(0,m.jsx)(fu,{"data-slot":"collapsible",...e})}function Tx({...e}){return(0,m.jsx)(pu,{"data-slot":"collapsible-trigger",...e})}function bx({...e}){return(0,m.jsx)(mu,{"data-slot":"collapsible-content",...e})}var kx=({children:e,as:t="p",className:n,duration:r=2,spread:i=2})=>{const a=(0,k.useMemo)(()=>(e?.length??0)*i,[e,i]);return(0,m.jsx)(t,{className:me("relative inline-block bg-size-[250%_100%,auto] bg-clip-text text-transparent","[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]","animate-shimmer",n),style:{"--spread":`${a}px`,"--duration":`${r}s`,backgroundImage:"var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))"},children:e})},Ax=(0,k.memo)(kx),Gc=(0,k.createContext)(null),_x=()=>{const e=(0,k.use)(Gc);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},xx=1e3,yx=1e3,Qc=(0,k.memo)(({className:e,isStreaming:t=!1,open:n,defaultOpen:r=!0,onOpenChange:i,duration:a,children:s,...l})=>{const[o,u]=Ki({prop:n,defaultProp:r,onChange:i}),[d,h]=Ki({prop:a,defaultProp:void 0}),[f,p]=(0,k.useState)(!1),[E,N]=(0,k.useState)(null);(0,k.useEffect)(()=>{t?E===null&&N(Date.now()):E!==null&&(h(Math.ceil((Date.now()-E)/yx)),N(null))},[t,E,h]),(0,k.useEffect)(()=>{if(r&&!t&&o&&!f){const _=setTimeout(()=>{u(!1),p(!0)},xx);return()=>clearTimeout(_)}},[t,o,r,u,f]);const y=_=>{u(_)};return(0,m.jsx)(Gc.Provider,{value:{isStreaming:t,isOpen:o,setIsOpen:u,duration:d},children:(0,m.jsx)(Ex,{className:me("not-prose mb-4",e),onOpenChange:y,open:o,...l,children:s})})}),Cx=(e,t)=>e||t===0?(0,m.jsx)(Ax,{duration:1,children:"Thinking..."}):t===void 0?(0,m.jsx)("p",{children:"Thought for a few seconds"}):(0,m.jsxs)("p",{children:["Thought for ",t," seconds"]}),Kc=(0,k.memo)(({className:e,children:t,getThinkingMessage:n=Cx,...r})=>{const{isStreaming:i,isOpen:a,duration:s}=_x();return(0,m.jsx)(Tx,{className:me("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...r,children:t??(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(tu,{className:"size-4"}),n(i,s),(0,m.jsx)(iu,{className:me("size-4 transition-transform",a?"rotate-180":"rotate-0")})]})})}),Xc=(0,k.memo)(({className:e,children:t,...n})=>(0,m.jsx)(bx,{className:me("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...n,children:(0,m.jsx)(Qi,{children:t})}));Qc.displayName="Reasoning";Kc.displayName="ReasoningTrigger";Xc.displayName="ReasoningContent";var Sx=({className:e,children:t,...n})=>(0,m.jsxs)(vu,{className:"w-full overflow-x-auto whitespace-nowrap",...n,children:[(0,m.jsx)("div",{className:me("flex w-max flex-nowrap items-center gap-2",e),children:t}),(0,m.jsx)(Iu,{className:"hidden",orientation:"horizontal"})]}),Nx=({suggestion:e,onClick:t,className:n,variant:r="outline",size:i="sm",children:a,...s})=>{const l=()=>{t?.(e)};return(0,m.jsx)(nr,{className:me("cursor-pointer rounded-full px-4",n),onClick:l,size:i,type:"button",variant:r,...s,children:a||e})},ey=pi({ChatSidebar:()=>vx}),Ix=({db:e,onRateLimitRefetch:t,onControllerReady:n})=>{const[r,i]=(0,k.useState)(""),[a,s]=(0,k.useState)(null),{openOverlay:l}=zs(),{pendingPrompt:o,consumePrompt:u}=wu(),{includeSchemaInAiContext:d,provider:h,model:f}=qs(),p=Vs(zr),E=Ys(),N=p.status[h],y=N?.state==="set"||N?.state==="locked",{rateLimit:_}=Ws({enabled:E&&h==="gemini"&&!y}),{remaining:C}=_??{remaining:0,limit:0},w=y||h==="gemini"&&C>0,{messages:R,sendMessage:O,isLoading:S,clear:$,stop:Y}=Lu({connection:Ru(`${Cu()}${Su.API_PREFIX}/chat`,()=>({headers:yu()})),body:{db:e,includeSchema:d},byok:zr,forwardedProps:{provider:h,model:f},onError:q=>s(q.message),onFinish:()=>{h==="gemini"&&!y&&t()}});(0,k.useEffect)(()=>{!o||S||!E||!w||(u(),O(o))},[w,u,E,S,o,O]),(0,k.useEffect)(()=>{n({clear:()=>{$(),i(""),s(null)},isLoading:S})},[$,S,n]);const W=q=>{const J=!!q.text,Q=!!q.files?.length;!(J||Q)||S||(s(null),O(q.text),i(""))},I=q=>{s(null),O(q),i("")},U=()=>{Y(),i("")},z=S?"streaming":"ready";return(0,m.jsxs)("div",{className:"relative flex size-full flex-col divide-y overflow-hidden",children:[(0,m.jsxs)(tx,{children:[(0,m.jsx)(nx,{children:R.length===0?(0,m.jsx)("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:(0,m.jsxs)("div",{className:"text-center space-y-2",children:[(0,m.jsx)("p",{className:"text-lg font-medium",children:"Start a new conversation"}),(0,m.jsx)("p",{className:"text-sm",children:"Ask me anything to get started"})]})}):(0,m.jsxs)(m.Fragment,{children:[R.map(q=>{const J=q.parts.filter(P=>P.type==="thinking"),Q=q.parts.reduce((P,V)=>V.type==="text"?P+(V.content??""):P,""),H=J.length>0;return(0,m.jsx)(Fs,{defaultBranch:0,children:(0,m.jsx)(Hs,{children:(0,m.jsx)(Ms,{from:q.role==="user"?"user":"assistant",children:(0,m.jsxs)("div",{children:[H&&q.role==="assistant"&&(0,m.jsxs)(Qc,{duration:0,children:[(0,m.jsx)(Kc,{}),(0,m.jsx)(Xc,{children:J.map(P=>P.content).join(`
132
132
  `)})]}),(0,m.jsx)(Bs,{children:(0,m.jsx)(qc,{children:Q})})]})})})},q.id)}),S&&(0,m.jsx)(Fs,{defaultBranch:0,children:(0,m.jsx)(Hs,{children:(0,m.jsx)(Ms,{from:"assistant",children:(0,m.jsx)(Bs,{children:(0,m.jsx)(ix,{children:"Thinking..."})})})})})]})}),(0,m.jsx)(rx,{})]}),(0,m.jsxs)("div",{className:"grid shrink-0 gap-4 pt-3",children:[a&&(0,m.jsx)("div",{className:"mx-4 rounded-lg border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:a}),!w&&(0,m.jsxs)("div",{className:"mx-4 rounded-lg border p-3 text-sm",children:[(0,m.jsx)("p",{className:"text-muted-foreground",children:h==="gemini"?"The hosted AI limit is exhausted. Add a personal Gemini key to continue.":`Add a ${h} API key to use this provider.`}),(0,m.jsx)(nr,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>l("settings.app"),children:"Open settings"})]}),R.length===0&&w&&(0,m.jsx)(Sx,{className:"px-4",children:Ou.map(q=>(0,m.jsx)(Nx,{onClick:()=>I(q),suggestion:q,size:"lg",children:q},q))}),(0,m.jsx)("div",{className:"w-full px-4 pb-4",children:(0,m.jsxs)(dx,{globalDrop:!0,multiple:!0,onSubmit:W,children:[(0,m.jsx)(fx,{children:(0,m.jsx)(px,{onChange:q=>i(q.target.value),value:r,placeholder:"Type a message..."})}),(0,m.jsx)(mx,{children:(0,m.jsx)(gx,{className:"h-8!",status:z,onClick:S?U:void 0,disabled:!w})})]})})]})]})},vx=()=>{const{isOverlayOpen:e,closeOverlay:t}=zs(),{selectedDatabase:n}=Nu(),{includeSchemaInAiContext:r,provider:i,model:a}=qs(),s=Vs(zr),l=Ys(),o=s.status[i],u=o?.state==="set"||o?.state==="locked",{rateLimit:d,refetchRateLimit:h}=Ws({enabled:l&&i==="gemini"&&!u}),[f,p]=(0,k.useState)(null),E=(0,k.useRef)(N=>p(N));return(0,m.jsx)(_u,{title:"AI Assistant",cta:(0,m.jsxs)("div",{className:"flex items-center gap-2",children:[d&&!u&&(0,m.jsxs)(gu,{children:[(0,m.jsx)(Eu,{asChild:!0,children:(0,m.jsxs)("span",{className:"text-xs px-2 py-1 cursor-default text-muted-foreground",children:[d.remaining,"/",d.limit]})}),(0,m.jsx)(Tu,{side:"bottom",children:(0,m.jsxs)("p",{children:[d.remaining," messages remaining"]})})]}),n&&f&&(0,m.jsxs)(nr,{type:"button",variant:"outline",size:"lg",onClick:f.clear,disabled:f.isLoading,children:[(0,m.jsx)(nu,{className:"size-4 mr-1"}),"New Chat"]})]}),closeButton:!1,open:e("chat.assistant"),size:"max-w-2xl!",contentClassName:"p-0 flex flex-col h-[calc(100vh-4rem)] flex-1",onOpenChange:N=>{N||t("chat.assistant")},children:n?(0,m.jsx)(Ix,{db:n,onRateLimitRefetch:h,onControllerReady:E.current},`${n}:${r}:${i}:${a}`):(0,m.jsx)("div",{className:"flex items-center justify-center h-full text-muted-foreground p-8",children:(0,m.jsxs)("div",{className:"text-center space-y-2",children:[(0,m.jsx)("p",{className:"text-lg font-medium",children:"No database selected"}),(0,m.jsx)("p",{className:"text-sm",children:"Select a database from the sidebar to start chatting."})]})})})};export{vx as ChatSidebar,G_ as a,Fe as i,LA as n,Jx as r,ey as t};