@decocms/mesh 2.19.0 → 2.20.1

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 (140) hide show
  1. package/dist/client/assets/{AlertCircle-DZfqNByx.js → AlertCircle-DeGhTF84.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-Cd6RM4A6.js → ArrowLeft-m6KeIjPT.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-VMKONnWJ.js → ArrowUp-BDjaIiFu.js} +1 -1
  4. package/dist/client/assets/{Check-Clnl6VO2.js → Check-Cs5AiVxS.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-CUCzTkUk.js → ChevronDown-7pGjkuTY.js} +1 -1
  6. package/dist/client/assets/{Code01-BAik7hF-.js → Code01-BdN1qNoI.js} +1 -1
  7. package/dist/client/assets/{Copy01-CCfh45Hm.js → Copy01-B_oHlu2-.js} +1 -1
  8. package/dist/client/assets/{DotsHorizontal-H1CDe03p.js → DotsHorizontal-B-RZHKDt.js} +1 -1
  9. package/dist/client/assets/{DotsVertical-CubHWPM8.js → DotsVertical-HKe7Lpcg.js} +1 -1
  10. package/dist/client/assets/{Download01-DUxaWCdv.js → Download01-4uLxYlt-.js} +1 -1
  11. package/dist/client/assets/{Edit01-tXex8wx0.js → Edit01-CcxqoKWW.js} +1 -1
  12. package/dist/client/assets/{File06-1GHbOIr4.js → File06-K5gpmB1y.js} +1 -1
  13. package/dist/client/assets/{FilterLines-Ttp2swRG.js → FilterLines-BCus583X.js} +1 -1
  14. package/dist/client/assets/{FlipBackward-BkcMu9OY.js → FlipBackward-MuxfY5vX.js} +1 -1
  15. package/dist/client/assets/{GitBranch01-V6D4YBhB.js → GitBranch01-ClkRJDdk.js} +1 -1
  16. package/dist/client/assets/{Grid01-Bf8eAyhK.js → Grid01-XLGz76ym.js} +1 -1
  17. package/dist/client/assets/{Home02-8q2bbK8n.js → Home02-CeVIG1t0.js} +1 -1
  18. package/dist/client/assets/{Image01-Ba0mxAoN.js → Image01-CycaMeSm.js} +1 -1
  19. package/dist/client/assets/{Inbox01-BvYPvM_p.js → Inbox01-1DQwZbO-.js} +1 -1
  20. package/dist/client/assets/{InfoCircle-DKA0-FHH.js → InfoCircle-DXvgKrQ3.js} +1 -1
  21. package/dist/client/assets/{Key01-CrI4HON6.js → Key01-B8mxyE2f.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-CqAE-za3.js → LinkExternal01-B4WpWXG7.js} +1 -1
  23. package/dist/client/assets/{List-C6tpn114.js → List-DWWQESNh.js} +1 -1
  24. package/dist/client/assets/{Loading01-wy6i08TR.js → Loading01-BtKovu_m.js} +1 -1
  25. package/dist/client/assets/{Lock01-CGlDIBQ9.js → Lock01-CDOVc6ZJ.js} +1 -1
  26. package/dist/client/assets/{Play-BvhASZjZ.js → Play-DYDE6oE1.js} +1 -1
  27. package/dist/client/assets/{Plus-DaMIylfN.js → Plus-CPExS1G1.js} +1 -1
  28. package/dist/client/assets/{SearchMd-DsK25qy7.js → SearchMd-DwKDi1yz.js} +1 -1
  29. package/dist/client/assets/{Terminal-cal0VHQd.js → Terminal-LP4GeLJv.js} +1 -1
  30. package/dist/client/assets/{Trash01-pB5oOXYU.js → Trash01-DCb3R_1E.js} +1 -1
  31. package/dist/client/assets/{Upload01-BRGUFGKZ.js → Upload01-BKDlh_J7.js} +1 -1
  32. package/dist/client/assets/{X-Bq7VzczH.js → X-DWXiZn3v.js} +1 -1
  33. package/dist/client/assets/{XClose-zOphE63W.js → XClose-s9vu-dQj.js} +1 -1
  34. package/dist/client/assets/{alert-dialog-BBkPKiLO.js → alert-dialog-CNXrLp-S.js} +1 -1
  35. package/dist/client/assets/{auth-catchall-D7-AwG4p.js → auth-catchall-M9fqis8u.js} +1 -1
  36. package/dist/client/assets/{avatar-CumXES9B.js → avatar-noXapmql.js} +1 -1
  37. package/dist/client/assets/{badge-tnyrO2LA.js → badge-ChGpQW0J.js} +1 -1
  38. package/dist/client/assets/{binder-BxHiGQ64.js → binder-DZT62WgB.js} +1 -1
  39. package/dist/client/assets/{button-BQMZIX_4.js → button-Dh_UOMtF.js} +1 -1
  40. package/dist/client/assets/{card-B-rrjyBF.js → card-Bjs7HBa2.js} +1 -1
  41. package/dist/client/assets/{checkbox-CJvAgYlu.js → checkbox-DiEhrfCa.js} +1 -1
  42. package/dist/client/assets/{collection-detail-w6psdBlt.js → collection-detail-BHOMTlVb.js} +1 -1
  43. package/dist/client/assets/{collection-display-button-Bi_NXbuN.js → collection-display-button-DKfm8yFW.js} +1 -1
  44. package/dist/client/assets/{collection-header-BfNxri-N.js → collection-header-Cn-YMrm9.js} +1 -1
  45. package/dist/client/assets/{collection-page-DJtrTRMH.js → collection-page-A6cy4ewQ.js} +1 -1
  46. package/dist/client/assets/{collection-search-9baWd84b.js → collection-search-Bm9HY_m8.js} +1 -1
  47. package/dist/client/assets/collection-tab-BQzpUnQW.js +1 -0
  48. package/dist/client/assets/{collection-table-wrapper-Cu-yqUsH.js → collection-table-wrapper-CnCS_a8f.js} +1 -1
  49. package/dist/client/assets/{connection-BdWKvn2K.js → connection-DuIRkEvB.js} +1 -1
  50. package/dist/client/assets/{connection-card-CwhA62aK.js → connection-card-Db71-JIc.js} +1 -1
  51. package/dist/client/assets/{connection-detail-BvvvvXz6.js → connection-detail-C1yH43Km.js} +1 -1
  52. package/dist/client/assets/{connections-CfRRCGSZ.js → connections-Bd35VTO7.js} +1 -1
  53. package/dist/client/assets/constants-C1rpewgJ.js +1 -0
  54. package/dist/client/assets/{create-organization-dialog-gxAB4wwP.js → create-organization-dialog-B19KPYZ1.js} +1 -1
  55. package/dist/client/assets/{dialog-BOTxth8M.js → dialog-BFNjB_wS.js} +1 -1
  56. package/dist/client/assets/{dropdown-menu-Cwg_0qoi.js → dropdown-menu-T7u8fl7N.js} +1 -1
  57. package/dist/client/assets/{dynamic-plugin-layout-DcLqC1O8.js → dynamic-plugin-layout-CaPvL2ak.js} +1 -1
  58. package/dist/client/assets/{empty-state-DeORHrTg.js → empty-state-DhpaMqQD.js} +1 -1
  59. package/dist/client/assets/{empty-state-2SJ3WxPr.js → empty-state-ylKJe6-v.js} +1 -1
  60. package/dist/client/assets/{env-vars-editor-qkfhYptd.js → env-vars-editor-BwDtTYE8.js} +1 -1
  61. package/dist/client/assets/{error-boundary-KUKN2TxD.js → error-boundary-_npCfvs4.js} +1 -1
  62. package/dist/client/assets/{extract-connection-data-37AfJqs-.js → extract-connection-data-DfFE7uXb.js} +1 -1
  63. package/dist/client/assets/file-browser-NWpg0oN1.js +2 -0
  64. package/dist/client/assets/{form-o9xmUpnK.js → form-BEM8UzSv.js} +1 -1
  65. package/dist/client/assets/gateway-detail-BrjbS3jo.js +1 -0
  66. package/dist/client/assets/{gateways-fe-SAKln.js → gateways-DhcOJhD5.js} +1 -1
  67. package/dist/client/assets/grid-view-BUF5kath.js +1 -0
  68. package/dist/client/assets/{home-OB-BKE3S.js → home-DyK0jpSk.js} +1 -1
  69. package/dist/client/assets/{index-BGlkGnRh.js → index-BRipTsvS.js} +12 -12
  70. package/dist/client/assets/{index-DuoIQX0P.js → index-C6eYxyql.js} +1 -1
  71. package/dist/client/assets/{index-DB3RU6w4.js → index-DanqEyuv.js} +1 -1
  72. package/dist/client/assets/{index-nfXEOl8p.js → index-Dh8Y3NBs.js} +9 -9
  73. package/dist/client/assets/index-H07QDM93.css +1 -0
  74. package/dist/client/assets/{index-BdoGlqOh.js → index-skH-OUyO.js} +2 -2
  75. package/dist/client/assets/{infiniteQueryObserver-B-zosqIG.js → infiniteQueryObserver-Dvgbvv4A.js} +1 -1
  76. package/dist/client/assets/{input-B0JGK4qg.js → input-CdlPz8Vq.js} +1 -1
  77. package/dist/client/assets/{layout-LCGR_e4n.js → layout-DopLDDPE.js} +1 -1
  78. package/dist/client/assets/{lazy-highlighter-7Ygumnp-.js → lazy-highlighter-CQ8gN0d3.js} +1 -1
  79. package/dist/client/assets/{localstorage-keys-DJgrMpsR.js → localstorage-keys-B_H3St2R.js} +1 -1
  80. package/dist/client/assets/{login-CPHiXmVM.js → login-1cuD6_Oo.js} +1 -1
  81. package/dist/client/assets/{mcp-oauth-DHBNZNZN.js → mcp-oauth-B6eUt4Mr.js} +1 -1
  82. package/dist/client/assets/{mcp-server-card-CCJD8rY5.js → mcp-server-card-DTQIT3pj.js} +1 -1
  83. package/dist/client/assets/mcp-server-detail-BB_FT5IH.js +1 -0
  84. package/dist/client/assets/{members-BUKGWKo1.js → members-Cy4UaFKY.js} +1 -1
  85. package/dist/client/assets/{monaco-editor-2dgkKSmS.js → monaco-editor-CKUC5K4P.js} +1 -1
  86. package/dist/client/assets/{monitoring-Co2ahvWI.js → monitoring-DOZ3Tm1E.js} +11 -11
  87. package/dist/client/assets/{oauth-callback-DqMgYj7o.js → oauth-callback-DxWqmOqk.js} +1 -1
  88. package/dist/client/assets/page-wGlLXgmM.js +1 -0
  89. package/dist/client/assets/{page-CUhEXv2W.js → page-zq0-MjKt.js} +1 -1
  90. package/dist/client/assets/{pin-to-sidebar-button-BcuLv1ea.js → pin-to-sidebar-button-C5qdidS1.js} +1 -1
  91. package/dist/client/assets/{plugin-empty-state-BMZ2lKdt.js → plugin-empty-state-cSLsH0S-.js} +1 -1
  92. package/dist/client/assets/{plugin-header-CzG6IJ7x.js → plugin-header-CzG38AxU.js} +1 -1
  93. package/dist/client/assets/{plugins-DrfogMhA.js → plugins-BqbdQ0eM.js} +1 -1
  94. package/dist/client/assets/{popover-CXUBdgho.js → popover-B4iU4oXK.js} +1 -1
  95. package/dist/client/assets/{project-context-provider-DhgIBvJ2.js → project-context-provider-Ci1EHyGR.js} +1 -1
  96. package/dist/client/assets/{registry-utils-C1MEHnjt.js → registry-utils-8goOeMwE.js} +1 -1
  97. package/dist/client/assets/{resizable-CwvNlApq.js → resizable-BteAr06H.js} +1 -1
  98. package/dist/client/assets/{resource-tabs-BnWaqzvN.js → resource-tabs-Dzc9tSXU.js} +1 -1
  99. package/dist/client/assets/{select--nDzC8in.js → select-B4aq4vxk.js} +1 -1
  100. package/dist/client/assets/{settings-18XrU-68.js → settings-B6nAEWR5.js} +1 -1
  101. package/dist/client/assets/shell-layout-CNkO6ROG.js +3 -0
  102. package/dist/client/assets/{spinner-BJxZd1VB.js → spinner-DwVZzFPC.js} +1 -1
  103. package/dist/client/assets/{switch-BFRma3Oi.js → switch-PB1r01nO.js} +1 -1
  104. package/dist/client/assets/{textarea-CZGp5M36.js → textarea-B7no0HbU.js} +1 -1
  105. package/dist/client/assets/{tool-set-selector-D-ihTeCw.js → tool-set-selector-Cl3nu1df.js} +1 -1
  106. package/dist/client/assets/{tools-list-DdaO5B-A.js → tools-list-DNdG8U23.js} +1 -1
  107. package/dist/client/assets/{tooltip-DSjdME5j.js → tooltip-DgJ4R-G6.js} +1 -1
  108. package/dist/client/assets/{typewriter-title-D3pHLziM.js → typewriter-title-YmbwonUg.js} +1 -1
  109. package/dist/client/assets/{use-binding-CdMfLY85.js → use-binding-R6SoNecZ.js} +1 -1
  110. package/dist/client/assets/{use-collections-B_r4T3b1.js → use-collections-CC15C_nK.js} +1 -1
  111. package/dist/client/assets/{use-connection-W2V2j8pE.js → use-connection-BY9aOm7H.js} +1 -1
  112. package/dist/client/assets/{use-connection-resources-_fz_82N5.js → use-connection-resources-D2N-7Fdh.js} +1 -1
  113. package/dist/client/assets/{use-create-gateway-DGaCqRhz.js → use-create-gateway-D4_8vfl-.js} +1 -1
  114. package/dist/client/assets/{use-gateway-CijYzCU9.js → use-gateway-CmDE4xLF.js} +1 -1
  115. package/dist/client/assets/{use-gateway-system-prompt-CusPzWe3.js → use-gateway-system-prompt-nzDoNyO-.js} +1 -1
  116. package/dist/client/assets/{use-list-state-DNPGmD9A.js → use-list-state-B0HVVNOr.js} +1 -1
  117. package/dist/client/assets/{use-mcp-fzL3ILVj.js → use-mcp-DUgnx05H.js} +1 -1
  118. package/dist/client/assets/{use-members-Cs5znkoZ.js → use-members-DEeTkVb7.js} +1 -1
  119. package/dist/client/assets/{use-mobile-DPzmQj9d.js → use-mobile-CZeMkOxo.js} +1 -1
  120. package/dist/client/assets/{use-organization-settings-sFF34W-p.js → use-organization-settings-8tWqPbhq.js} +1 -1
  121. package/dist/client/assets/{use-tool-call-CCdok443.js → use-tool-call-_jHZu2qb.js} +1 -1
  122. package/dist/client/assets/useInfiniteQuery-x4_y1w34.js +1 -0
  123. package/dist/client/assets/{useMutation-mOecCzvG.js → useMutation-n0xwrWOz.js} +1 -1
  124. package/dist/client/assets/useQuery-FRehIqtM.js +1 -0
  125. package/dist/client/assets/{value-C7yMc_BN.js → value-BOu8imSs.js} +1 -1
  126. package/dist/client/assets/{view-mode-toggle-DdRtk7o-.js → view-mode-toggle-Z5AVjYj0.js} +1 -1
  127. package/dist/client/assets/{workflow-Ca7LNIxD.js → workflow-CZ2JUtj_.js} +1 -1
  128. package/dist/client/index.html +2 -2
  129. package/package.json +2 -2
  130. package/dist/client/assets/collection-tab-Ct4krCcB.js +0 -1
  131. package/dist/client/assets/constants-BoL9C76L.js +0 -1
  132. package/dist/client/assets/file-browser-D3uR2C9M.js +0 -2
  133. package/dist/client/assets/gateway-detail-B6zUy6TE.js +0 -1
  134. package/dist/client/assets/grid-view-vZ2Zpkzy.js +0 -1
  135. package/dist/client/assets/index-Dh9ePU0t.css +0 -1
  136. package/dist/client/assets/mcp-server-detail-B2BLpdBe.js +0 -1
  137. package/dist/client/assets/page-Xy2zuFaN.js +0 -1
  138. package/dist/client/assets/shell-layout-DPrrZeqr.js +0 -3
  139. package/dist/client/assets/useInfiniteQuery-Bx9UQHNH.js +0 -1
  140. package/dist/client/assets/useQuery-B_cnJjvx.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lazy-highlighter-7Ygumnp-.js","assets/index-BdoGlqOh.js","assets/index-Dh9ePU0t.css"])))=>i.map(i=>d[i]);
2
- import{r as j,c as Q,j as m,aH as ud,aI as od,aJ as ld,aK as nt,z as G,aL as Lr,aM as $u,aN as cd,aO as dd,aP as fd,L as Xe,J as Zn,I as ar,y as Te,aQ as te,aG as Pt,aR as hd,aS as Ae,_ as pd,X as ai,v as ui,x as oi,K as je,d as Yu,t as Kn,a as qu,f as Vu,aT as md,aU as gd,B as bd,E as Ed,aV as Td,a5 as xd,a6 as li,a8 as _d,a7 as yd,aa as Ad,as as kd,a3 as Cd,a9 as Id}from"./index-BdoGlqOh.js";import{c as ie,B as Me}from"./button-BQMZIX_4.js";import{i as Nd}from"./X-Bq7VzczH.js";import{I as ci,E as Sd}from"./empty-state-DeORHrTg.js";import{u as zt}from"./project-context-provider-DhgIBvJ2.js";import{a as ur,b as or,P as lr}from"./popover-CXUBdgho.js";import{T as wd}from"./textarea-CZGp5M36.js";import{i as Gu}from"./AlertCircle-DZfqNByx.js";import{i as Rd,E as Od}from"./error-boundary-KUKN2TxD.js";import{i as Ld}from"./ArrowUp-VMKONnWJ.js";import{t as vd}from"./ChevronDown-CUCzTkUk.js";import{u as Dd,i as di}from"./use-gateway-CijYzCU9.js";import{i as Pd}from"./Edit01-tXex8wx0.js";import{U as Md,c as Bd}from"./connection-BdWKvn2K.js";import{b as Fd}from"./use-collections-B_r4T3b1.js";import{u as Wu,a as Ud}from"./use-connection-W2V2j8pE.js";import{b as Hd}from"./use-binding-CdMfLY85.js";import{u as Xt}from"./useMutation-mOecCzvG.js";import{a as jd,u as zd}from"./use-gateway-system-prompt-CusPzWe3.js";import{u as vs,L as Qu}from"./localstorage-keys-DJgrMpsR.js";import{I as fi}from"./input-B0JGK4qg.js";import{T as xn,b as _n,a as hi,c as yn}from"./tooltip-DSjdME5j.js";import{i as $r}from"./Check-Clnl6VO2.js";import{i as Yr}from"./SearchMd-DsK25qy7.js";import{u as $d}from"./use-create-gateway-DGaCqRhz.js";import{S as Yd,a as qd,b as Vd,c as Gd,d as Wd}from"./select--nDzC8in.js";import{i as Qd}from"./File06-1GHbOIr4.js";import{c as Xd,i as Xu}from"./Grid01-Bf8eAyhK.js";import{a as Zd}from"./Image01-Ba0mxAoN.js";import{a as Kd,F as Jd,b as ef,c as tf,d as nf,e as rf,f as sf}from"./form-o9xmUpnK.js";import{S as Zu}from"./spinner-BJxZd1VB.js";import{a as pi}from"./Copy01-CCfh45Hm.js";import{i as af}from"./Terminal-cal0VHQd.js";import{M as Ku,s as na}from"./monaco-editor-2dgkKSmS.js";import{b as uf,c as of,d as lf,A as cf,a as df,e as ff,g as hf,f as pf}from"./alert-dialog-BBkPKiLO.js";import{O as mf,b as gf,c as bf}from"./well-known-mcp-DOEdYmKO.js";import{g as Ef}from"./generate-id-Dyweu44Y.js";import{s as Tf}from"./Trash01-pB5oOXYU.js";var Jn;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const i={};for(const a of s)i[a]=a;return i},t.getValidEnumValues=s=>{const i=t.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),a={};for(const u of i)a[u]=s[u];return t.objectValues(a)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const a in s)Object.prototype.hasOwnProperty.call(s,a)&&i.push(a);return i},t.find=(s,i)=>{for(const a of s)if(i(a))return a},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,i=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(Jn||(Jn={}));var ra;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(ra||(ra={}));Jn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);Jn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class vr extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(i){return i.message},r={_errors:[]},s=i=>{for(const a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let u=r,l=0;for(;l<a.path.length;){const o=a.path[l];l===a.path.length-1?(u[o]=u[o]||{_errors:[]},u[o]._errors.push(n(a))):u[o]=u[o]||{_errors:[]},u=u[o],l++}}};return s(this),r}static assert(e){if(!(e instanceof vr))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Jn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const i=s.path[0];n[i]=n[i]||[],n[i].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}vr.create=t=>new vr(t);var sa;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(sa||(sa={}));var ne;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ne||(ne={}));const Ju=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"M17.115 15.358c-.27.306-.554.608-.851.905-4.296 4.296-9.678 5.88-12.021 3.536-1.607-1.606-1.368-4.641.325-7.775M6.89 8.725c.281-.32.578-.636.888-.947C12.074 3.482 17.456 1.9 19.8 4.243c1.608 1.607 1.367 4.645-.33 7.781m-3.206-4.246c4.296 4.296 5.88 9.678 3.536 12.021-2.343 2.343-7.725.76-12.02-3.535C3.483 11.968 1.9 6.586 4.244 4.243c2.343-2.343 7.725-.76 12.02 3.535ZM13 12a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"}));Ju.displayName="Atom02";const eo=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"m7 15 5 5 5-5M7 9l5-5 5 5"}));eo.displayName="ChevronSelectorVertical";const to=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"M15.938 15.938A7.001 7.001 0 0 0 15 2a7.001 7.001 0 0 0-6.938 6.062M16 15a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));to.displayName="Coins01";const no=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"M9 14 4 9m0 0 5-5M4 9h6.4c3.36 0 5.04 0 6.324.654a6 6 0 0 1 2.622 2.622C20 13.56 20 15.24 20 18.6V20"}));no.displayName="CornerUpLeft";const ro=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"M6 16a4 4 0 0 0 4 4h4a4 4 0 0 0 0-8h-4a4 4 0 0 1 0-8h4a4 4 0 0 1 4 4m-6-6v20"}));ro.displayName="CurrencyDollar";const so=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"m18 10-4-4M2.5 21.5l3.384-.376c.414-.046.62-.069.814-.131a2 2 0 0 0 .485-.234c.17-.111.317-.259.61-.553L21 7a2.828 2.828 0 1 0-4-4L3.794 16.206c-.294.294-.442.442-.553.611a2 2 0 0 0-.234.485c-.062.193-.085.4-.131.814L2.5 21.5Z"}));so.displayName="Edit02";const io=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"M15 16.5V19c0 .932 0 1.398-.152 1.765a2 2 0 0 1-1.083 1.083C13.398 22 12.932 22 12 22c-.932 0-1.398 0-1.765-.152a2 2 0 0 1-1.083-1.083C9 20.398 9 19.932 9 19v-2.5m6 0c2.649-1.157 4.5-3.925 4.5-7a7.5 7.5 0 0 0-15 0c0 3.075 1.851 5.843 4.5 7m6 0H9"}));io.displayName="Lightbulb01";const ao=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"m18 8 4 4m0 0-4 4m4-4H9m6-7.796A8.383 8.383 0 0 0 10.667 3C5.88 3 2 7.03 2 12s3.88 9 8.667 9A8.384 8.384 0 0 0 15 19.796"}));ao.displayName="LogOut04";const qr=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"m6.5 13 .784 1.569c.266.53.399.796.576 1.026a3 3 0 0 0 .545.545c.23.177.495.31 1.026.575L11 17.5l-1.569.785c-.53.265-.796.398-1.026.575a3 3 0 0 0-.545.545c-.177.23-.31.495-.576 1.026L6.5 22l-.784-1.569c-.266-.53-.399-.796-.576-1.026a3 3 0 0 0-.545-.545c-.23-.177-.495-.31-1.026-.575L2 17.5l1.569-.785c.53-.265.796-.398 1.026-.575a3 3 0 0 0 .545-.545c.177-.23.31-.495.576-1.026L6.5 13ZM15 2l1.179 3.064c.282.734.423 1.1.642 1.409a3 3 0 0 0 .706.706c.309.22.675.36 1.409.642L22 9l-3.064 1.179c-.734.282-1.1.423-1.409.642a3 3 0 0 0-.706.706c-.22.309-.36.675-.642 1.409L15 16l-1.179-3.064c-.282-.734-.423-1.1-.642-1.409a3 3 0 0 0-.706-.706c-.309-.22-.675-.36-1.409-.642L8 9l3.064-1.179c.734-.282 1.1-.423 1.409-.642a3 3 0 0 0 .706-.706c.22-.309.36-.675.642-1.409L15 2Z"}));qr.displayName="Stars01";const uo=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"}));uo.displayName="Stop";const oo=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"M16 8V5l3-3 1 2 2 1-3 3h-3Zm0 0-4 4m10 0c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2m5 10a5 5 0 1 1-5-5"}));oo.displayName="Target04";const lo=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"m15 9-6 6m0-6 6 6m7-3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));lo.displayName="XCircle";function $e(t){const e=Q.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let s;e[3]!==n?(s=ie("bg-accent animate-pulse rounded-md",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==r||e[6]!==s?(i=m.jsx("div",{"data-slot":"skeleton",className:s,...r}),e[5]=r,e[6]=s,e[7]=i):i=e[7],i}const ia=[{border:"border-purple-400",bg:"bg-purple-400",text:"text-white",bgLight:"bg-purple-400/10"},{border:"border-blue-400",bg:"bg-blue-400",text:"text-white",bgLight:"bg-blue-400/10"},{border:"border-indigo-400",bg:"bg-indigo-400",text:"text-white",bgLight:"bg-indigo-400/10"},{border:"border-violet-400",bg:"bg-violet-400",text:"text-white",bgLight:"bg-violet-400/10"},{border:"border-pink-400",bg:"bg-pink-400",text:"text-white",bgLight:"bg-pink-400/10"},{border:"border-fuchsia-400",bg:"bg-fuchsia-400",text:"text-white",bgLight:"bg-fuchsia-400/10"},{border:"border-emerald-400",bg:"bg-emerald-400",text:"text-white",bgLight:"bg-emerald-400/10"},{border:"border-teal-400",bg:"bg-teal-400",text:"text-white",bgLight:"bg-teal-400/10"},{border:"border-cyan-400",bg:"bg-cyan-400",text:"text-white",bgLight:"bg-cyan-400/10"},{border:"border-sky-400",bg:"bg-sky-400",text:"text-white",bgLight:"bg-sky-400/10"},{border:"border-orange-400",bg:"bg-orange-400",text:"text-white",bgLight:"bg-orange-400/10"},{border:"border-amber-400",bg:"bg-amber-400",text:"text-white",bgLight:"bg-amber-400/10"},{border:"border-rose-400",bg:"bg-rose-400",text:"text-white",bgLight:"bg-rose-400/10"},{border:"border-lime-400",bg:"bg-lime-400",text:"text-white",bgLight:"bg-lime-400/10"}];function xf(t){let e=0;for(let n=0;n<t.length;n++)e=t.charCodeAt(n)+((e<<5)-e);return Math.abs(e)}function co(t){if(t==null)return null;const n=xf(t)%ia.length;return ia[n]}var fo="vercel.ai.error",_f=Symbol.for(fo),aa,ua,Ct=class ho extends(ua=Error,aa=_f,ua){constructor({name:e,message:n,cause:r}){super(n),this[aa]=!0,this.name=e,this.cause=r}static isInstance(e){return ho.hasMarker(e,fo)}static hasMarker(e,n){const r=Symbol.for(n);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function po(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var mo="AI_InvalidArgumentError",go=`vercel.ai.error.${mo}`,yf=Symbol.for(go),oa,la,Af=class extends(la=Ct,oa=yf,la){constructor({message:t,cause:e,argument:n}){super({name:mo,message:t,cause:e}),this[oa]=!0,this.argument=n}static isInstance(t){return Ct.hasMarker(t,go)}},bo="AI_JSONParseError",Eo=`vercel.ai.error.${bo}`,kf=Symbol.for(Eo),ca,da,fa=class extends(da=Ct,ca=kf,da){constructor({text:t,cause:e}){super({name:bo,message:`JSON parsing failed: Text: ${t}.
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lazy-highlighter-CQ8gN0d3.js","assets/index-skH-OUyO.js","assets/index-H07QDM93.css"])))=>i.map(i=>d[i]);
2
+ import{r as j,c as Q,j as m,aH as ud,aI as od,aJ as ld,aK as nt,z as G,aL as Lr,aM as $u,aN as cd,aO as dd,aP as fd,L as Xe,J as Zn,I as ar,y as Te,aQ as te,aG as Pt,aR as hd,aS as Ae,_ as pd,X as ai,v as ui,x as oi,K as je,d as Yu,t as Kn,a as qu,f as Vu,aT as md,aU as gd,B as bd,E as Ed,aV as Td,a5 as xd,a6 as li,a8 as _d,a7 as yd,aa as Ad,as as kd,a3 as Cd,a9 as Id}from"./index-skH-OUyO.js";import{c as re,B as Me}from"./button-Dh_UOMtF.js";import{i as Nd}from"./X-DWXiZn3v.js";import{I as ci,E as Sd}from"./empty-state-DhpaMqQD.js";import{u as zt}from"./project-context-provider-Ci1EHyGR.js";import{a as ur,b as or,P as lr}from"./popover-B4iU4oXK.js";import{T as wd}from"./textarea-B7no0HbU.js";import{i as Gu}from"./AlertCircle-DeGhTF84.js";import{i as Rd,E as Od}from"./error-boundary-_npCfvs4.js";import{i as Ld}from"./ArrowUp-BDjaIiFu.js";import{t as vd}from"./ChevronDown-7pGjkuTY.js";import{u as Dd,i as di}from"./use-gateway-CmDE4xLF.js";import{i as Pd}from"./Edit01-CcxqoKWW.js";import{U as Md,c as Bd}from"./connection-DuIRkEvB.js";import{b as Fd}from"./use-collections-CC15C_nK.js";import{u as Wu,a as Ud}from"./use-connection-BY9aOm7H.js";import{b as Hd}from"./use-binding-R6SoNecZ.js";import{u as Xt}from"./useMutation-n0xwrWOz.js";import{a as jd,u as zd}from"./use-gateway-system-prompt-nzDoNyO-.js";import{u as vs,L as Qu}from"./localstorage-keys-B_H3St2R.js";import{I as fi}from"./input-CdlPz8Vq.js";import{T as xn,b as _n,a as hi,c as yn}from"./tooltip-DgJ4R-G6.js";import{i as $r}from"./Check-Cs5AiVxS.js";import{i as Yr}from"./SearchMd-DwKDi1yz.js";import{u as $d}from"./use-create-gateway-D4_8vfl-.js";import{S as Yd,a as qd,b as Vd,c as Gd,d as Wd}from"./select-B4aq4vxk.js";import{i as Qd}from"./File06-K5gpmB1y.js";import{c as Xd,i as Xu}from"./Grid01-XLGz76ym.js";import{a as Zd}from"./Image01-CycaMeSm.js";import{a as Kd,F as Jd,b as ef,c as tf,d as nf,e as rf,f as sf}from"./form-BEM8UzSv.js";import{S as Zu}from"./spinner-DwVZzFPC.js";import{a as pi}from"./Copy01-B_oHlu2-.js";import{i as af}from"./Terminal-LP4GeLJv.js";import{M as Ku,s as na}from"./monaco-editor-CKUC5K4P.js";import{b as uf,c as of,d as lf,A as cf,a as df,e as ff,g as hf,f as pf}from"./alert-dialog-CNXrLp-S.js";import{O as mf,b as gf,c as bf}from"./well-known-mcp-DOEdYmKO.js";import{g as Ef}from"./generate-id-Dyweu44Y.js";import{s as Tf}from"./Trash01-DCb3R_1E.js";var Jn;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const i={};for(const a of s)i[a]=a;return i},t.getValidEnumValues=s=>{const i=t.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),a={};for(const u of i)a[u]=s[u];return t.objectValues(a)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const a in s)Object.prototype.hasOwnProperty.call(s,a)&&i.push(a);return i},t.find=(s,i)=>{for(const a of s)if(i(a))return a},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,i=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(Jn||(Jn={}));var ra;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(ra||(ra={}));Jn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);Jn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class vr extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(i){return i.message},r={_errors:[]},s=i=>{for(const a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let u=r,l=0;for(;l<a.path.length;){const o=a.path[l];l===a.path.length-1?(u[o]=u[o]||{_errors:[]},u[o]._errors.push(n(a))):u[o]=u[o]||{_errors:[]},u=u[o],l++}}};return s(this),r}static assert(e){if(!(e instanceof vr))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Jn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const i=s.path[0];n[i]=n[i]||[],n[i].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}vr.create=t=>new vr(t);var sa;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(sa||(sa={}));var ne;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ne||(ne={}));const Ju=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"M17.115 15.358c-.27.306-.554.608-.851.905-4.296 4.296-9.678 5.88-12.021 3.536-1.607-1.606-1.368-4.641.325-7.775M6.89 8.725c.281-.32.578-.636.888-.947C12.074 3.482 17.456 1.9 19.8 4.243c1.608 1.607 1.367 4.645-.33 7.781m-3.206-4.246c4.296 4.296 5.88 9.678 3.536 12.021-2.343 2.343-7.725.76-12.02-3.535C3.483 11.968 1.9 6.586 4.244 4.243c2.343-2.343 7.725-.76 12.02 3.535ZM13 12a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"}));Ju.displayName="Atom02";const eo=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"m7 15 5 5 5-5M7 9l5-5 5 5"}));eo.displayName="ChevronSelectorVertical";const to=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"M15.938 15.938A7.001 7.001 0 0 0 15 2a7.001 7.001 0 0 0-6.938 6.062M16 15a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));to.displayName="Coins01";const no=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"M9 14 4 9m0 0 5-5M4 9h6.4c3.36 0 5.04 0 6.324.654a6 6 0 0 1 2.622 2.622C20 13.56 20 15.24 20 18.6V20"}));no.displayName="CornerUpLeft";const ro=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"M6 16a4 4 0 0 0 4 4h4a4 4 0 0 0 0-8h-4a4 4 0 0 1 0-8h4a4 4 0 0 1 4 4m-6-6v20"}));ro.displayName="CurrencyDollar";const so=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"m18 10-4-4M2.5 21.5l3.384-.376c.414-.046.62-.069.814-.131a2 2 0 0 0 .485-.234c.17-.111.317-.259.61-.553L21 7a2.828 2.828 0 1 0-4-4L3.794 16.206c-.294.294-.442.442-.553.611a2 2 0 0 0-.234.485c-.062.193-.085.4-.131.814L2.5 21.5Z"}));so.displayName="Edit02";const io=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"M15 16.5V19c0 .932 0 1.398-.152 1.765a2 2 0 0 1-1.083 1.083C13.398 22 12.932 22 12 22c-.932 0-1.398 0-1.765-.152a2 2 0 0 1-1.083-1.083C9 20.398 9 19.932 9 19v-2.5m6 0c2.649-1.157 4.5-3.925 4.5-7a7.5 7.5 0 0 0-15 0c0 3.075 1.851 5.843 4.5 7m6 0H9"}));io.displayName="Lightbulb01";const ao=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"m18 8 4 4m0 0-4 4m4-4H9m6-7.796A8.383 8.383 0 0 0 10.667 3C5.88 3 2 7.03 2 12s3.88 9 8.667 9A8.384 8.384 0 0 0 15 19.796"}));ao.displayName="LogOut04";const qr=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"m6.5 13 .784 1.569c.266.53.399.796.576 1.026a3 3 0 0 0 .545.545c.23.177.495.31 1.026.575L11 17.5l-1.569.785c-.53.265-.796.398-1.026.575a3 3 0 0 0-.545.545c-.177.23-.31.495-.576 1.026L6.5 22l-.784-1.569c-.266-.53-.399-.796-.576-1.026a3 3 0 0 0-.545-.545c-.23-.177-.495-.31-1.026-.575L2 17.5l1.569-.785c.53-.265.796-.398 1.026-.575a3 3 0 0 0 .545-.545c.177-.23.31-.495.576-1.026L6.5 13ZM15 2l1.179 3.064c.282.734.423 1.1.642 1.409a3 3 0 0 0 .706.706c.309.22.675.36 1.409.642L22 9l-3.064 1.179c-.734.282-1.1.423-1.409.642a3 3 0 0 0-.706.706c-.22.309-.36.675-.642 1.409L15 16l-1.179-3.064c-.282-.734-.423-1.1-.642-1.409a3 3 0 0 0-.706-.706c-.309-.22-.675-.36-1.409-.642L8 9l3.064-1.179c.734-.282 1.1-.423 1.409-.642a3 3 0 0 0 .706-.706c.22-.309.36-.675.642-1.409L15 2Z"}));qr.displayName="Stars01";const uo=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"}));uo.displayName="Stop";const oo=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"M16 8V5l3-3 1 2 2 1-3 3h-3Zm0 0-4 4m10 0c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2m5 10a5 5 0 1 1-5-5"}));oo.displayName="Target04";const lo=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"m15 9-6 6m0-6 6 6m7-3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));lo.displayName="XCircle";function $e(t){const e=Q.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let s;e[3]!==n?(s=re("bg-accent animate-pulse rounded-md",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==r||e[6]!==s?(i=m.jsx("div",{"data-slot":"skeleton",className:s,...r}),e[5]=r,e[6]=s,e[7]=i):i=e[7],i}const ia=[{border:"border-purple-400",bg:"bg-purple-400",text:"text-white",bgLight:"bg-purple-400/10"},{border:"border-blue-400",bg:"bg-blue-400",text:"text-white",bgLight:"bg-blue-400/10"},{border:"border-indigo-400",bg:"bg-indigo-400",text:"text-white",bgLight:"bg-indigo-400/10"},{border:"border-violet-400",bg:"bg-violet-400",text:"text-white",bgLight:"bg-violet-400/10"},{border:"border-pink-400",bg:"bg-pink-400",text:"text-white",bgLight:"bg-pink-400/10"},{border:"border-fuchsia-400",bg:"bg-fuchsia-400",text:"text-white",bgLight:"bg-fuchsia-400/10"},{border:"border-emerald-400",bg:"bg-emerald-400",text:"text-white",bgLight:"bg-emerald-400/10"},{border:"border-teal-400",bg:"bg-teal-400",text:"text-white",bgLight:"bg-teal-400/10"},{border:"border-cyan-400",bg:"bg-cyan-400",text:"text-white",bgLight:"bg-cyan-400/10"},{border:"border-sky-400",bg:"bg-sky-400",text:"text-white",bgLight:"bg-sky-400/10"},{border:"border-orange-400",bg:"bg-orange-400",text:"text-white",bgLight:"bg-orange-400/10"},{border:"border-amber-400",bg:"bg-amber-400",text:"text-white",bgLight:"bg-amber-400/10"},{border:"border-rose-400",bg:"bg-rose-400",text:"text-white",bgLight:"bg-rose-400/10"},{border:"border-lime-400",bg:"bg-lime-400",text:"text-white",bgLight:"bg-lime-400/10"}];function xf(t){let e=0;for(let n=0;n<t.length;n++)e=t.charCodeAt(n)+((e<<5)-e);return Math.abs(e)}function co(t){if(t==null)return null;const n=xf(t)%ia.length;return ia[n]}var fo="vercel.ai.error",_f=Symbol.for(fo),aa,ua,Ct=class ho extends(ua=Error,aa=_f,ua){constructor({name:e,message:n,cause:r}){super(n),this[aa]=!0,this.name=e,this.cause=r}static isInstance(e){return ho.hasMarker(e,fo)}static hasMarker(e,n){const r=Symbol.for(n);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function po(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var mo="AI_InvalidArgumentError",go=`vercel.ai.error.${mo}`,yf=Symbol.for(go),oa,la,Af=class extends(la=Ct,oa=yf,la){constructor({message:t,cause:e,argument:n}){super({name:mo,message:t,cause:e}),this[oa]=!0,this.argument=n}static isInstance(t){return Ct.hasMarker(t,go)}},bo="AI_JSONParseError",Eo=`vercel.ai.error.${bo}`,kf=Symbol.for(Eo),ca,da,fa=class extends(da=Ct,ca=kf,da){constructor({text:t,cause:e}){super({name:bo,message:`JSON parsing failed: Text: ${t}.
3
3
  Error message: ${po(e)}`,cause:e}),this[ca]=!0,this.text=t}static isInstance(t){return Ct.hasMarker(t,Eo)}},To="AI_TypeValidationError",xo=`vercel.ai.error.${To}`,Cf=Symbol.for(xo),ha,pa,gn=class Ds extends(pa=Ct,ha=Cf,pa){constructor({value:e,cause:n}){super({name:To,message:`Type validation failed: Value: ${JSON.stringify(e)}.
4
4
  Error message: ${po(n)}`,cause:n}),this[ha]=!0,this.value=e}static isInstance(e){return Ct.hasMarker(e,xo)}static wrap({value:e,cause:n}){return Ds.isInstance(n)&&n.value===e?n:new Ds({value:e,cause:n})}},cr=({prefix:t,size:e=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const s=()=>{const i=n.length,a=new Array(e);for(let u=0;u<e;u++)a[u]=n[Math.random()*i|0];return a.join("")};if(t==null)return s;if(n.includes(r))throw new Af({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${t}${r}${s()}`},If=cr();function ma(t=globalThis){var e,n,r;return t.window?"runtime/browser":(e=t.navigator)!=null&&e.userAgent?`runtime/${t.navigator.userAgent.toLowerCase()}`:(r=(n=t.process)==null?void 0:n.versions)!=null&&r.node?`runtime/node.js/${t.process.version.substring(0)}`:t.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function Qt(t){if(t==null)return{};const e={};if(t instanceof Headers)t.forEach((n,r)=>{e[r.toLowerCase()]=n});else{Array.isArray(t)||(t=Object.entries(t));for(const[n,r]of t)r!=null&&(e[n.toLowerCase()]=r)}return e}function ga(t,...e){const n=new Headers(Qt(t)),r=n.get("user-agent")||"";return n.set("user-agent",[r,...e].filter(Boolean).join(" ")),Object.fromEntries(n.entries())}var Nf=/"__proto__"\s*:/,Sf=/"constructor"\s*:/;function ba(t){const e=JSON.parse(t);return e===null||typeof e!="object"||Nf.test(t)===!1&&Sf.test(t)===!1?e:wf(e)}function wf(t){let e=[t];for(;e.length;){const n=e;e=[];for(const r of n){if(Object.prototype.hasOwnProperty.call(r,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(r,"constructor")&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const s in r){const i=r[s];i&&typeof i=="object"&&e.push(i)}}}return t}function Rf(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return ba(t)}try{return ba(t)}finally{Error.stackTraceLimit=e}}function mi(t){if(t.type==="object"||Array.isArray(t.type)&&t.type.includes("object")){t.additionalProperties=!1;const{properties:n}=t;if(n!=null)for(const r of Object.keys(n))n[r]=Gt(n[r])}t.items!=null&&(t.items=Array.isArray(t.items)?t.items.map(Gt):Gt(t.items)),t.anyOf!=null&&(t.anyOf=t.anyOf.map(Gt)),t.allOf!=null&&(t.allOf=t.allOf.map(Gt)),t.oneOf!=null&&(t.oneOf=t.oneOf.map(Gt));const{definitions:e}=t;if(e!=null)for(const n of Object.keys(e))e[n]=Gt(e[n]);return t}function Gt(t){return typeof t=="boolean"?t:mi(t)}var Of=Symbol("Let zodToJsonSchema decide on which parser to use"),Ea={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},Lf=t=>typeof t=="string"?{...Ea,name:t}:{...Ea,...t};function ct(){return{}}function vf(t,e){var n,r,s;const i={type:"array"};return(n=t.type)!=null&&n._def&&((s=(r=t.type)==null?void 0:r._def)==null?void 0:s.typeName)!==ne.ZodAny&&(i.items=be(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(i.minItems=t.minLength.value),t.maxLength&&(i.maxItems=t.maxLength.value),t.exactLength&&(i.minItems=t.exactLength.value,i.maxItems=t.exactLength.value),i}function Df(t){const e={type:"integer",format:"int64"};if(!t.checks)return e;for(const n of t.checks)switch(n.kind){case"min":n.inclusive?e.minimum=n.value:e.exclusiveMinimum=n.value;break;case"max":n.inclusive?e.maximum=n.value:e.exclusiveMaximum=n.value;break;case"multipleOf":e.multipleOf=n.value;break}return e}function Pf(){return{type:"boolean"}}function _o(t,e){return be(t.type._def,e)}var Mf=(t,e)=>be(t.innerType._def,e);function yo(t,e,n){const r=n??e.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((s,i)=>yo(t,e,s))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Bf(t)}}var Bf=t=>{const e={type:"integer",format:"unix-time"};for(const n of t.checks)switch(n.kind){case"min":e.minimum=n.value;break;case"max":e.maximum=n.value;break}return e};function Ff(t,e){return{...be(t.innerType._def,e),default:t.defaultValue()}}function Uf(t,e){return e.effectStrategy==="input"?be(t.schema._def,e):ct()}function Hf(t){return{type:"string",enum:Array.from(t.values)}}var jf=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function zf(t,e){const n=[be(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),be(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(s=>!!s),r=[];return n.forEach(s=>{if(jf(s))r.push(...s.allOf);else{let i=s;if("additionalProperties"in s&&s.additionalProperties===!1){const{additionalProperties:a,...u}=s;i=u}r.push(i)}}),r.length?{allOf:r}:void 0}function $f(t){const e=typeof t.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(t.value)?"array":"object"}:{type:e==="bigint"?"integer":e,const:t.value}}var ls=void 0,mt={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(ls===void 0&&(ls=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),ls),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function Ao(t,e){const n={type:"string"};if(t.checks)for(const r of t.checks)switch(r.kind){case"min":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value;break;case"max":n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"email":switch(e.emailStrategy){case"format:email":gt(n,"email",r.message,e);break;case"format:idn-email":gt(n,"idn-email",r.message,e);break;case"pattern:zod":Qe(n,mt.email,r.message,e);break}break;case"url":gt(n,"uri",r.message,e);break;case"uuid":gt(n,"uuid",r.message,e);break;case"regex":Qe(n,r.regex,r.message,e);break;case"cuid":Qe(n,mt.cuid,r.message,e);break;case"cuid2":Qe(n,mt.cuid2,r.message,e);break;case"startsWith":Qe(n,RegExp(`^${cs(r.value,e)}`),r.message,e);break;case"endsWith":Qe(n,RegExp(`${cs(r.value,e)}$`),r.message,e);break;case"datetime":gt(n,"date-time",r.message,e);break;case"date":gt(n,"date",r.message,e);break;case"time":gt(n,"time",r.message,e);break;case"duration":gt(n,"duration",r.message,e);break;case"length":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value,n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"includes":{Qe(n,RegExp(cs(r.value,e)),r.message,e);break}case"ip":{r.version!=="v6"&&gt(n,"ipv4",r.message,e),r.version!=="v4"&&gt(n,"ipv6",r.message,e);break}case"base64url":Qe(n,mt.base64url,r.message,e);break;case"jwt":Qe(n,mt.jwt,r.message,e);break;case"cidr":{r.version!=="v6"&&Qe(n,mt.ipv4Cidr,r.message,e),r.version!=="v4"&&Qe(n,mt.ipv6Cidr,r.message,e);break}case"emoji":Qe(n,mt.emoji(),r.message,e);break;case"ulid":{Qe(n,mt.ulid,r.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{gt(n,"binary",r.message,e);break}case"contentEncoding:base64":{n.contentEncoding="base64";break}case"pattern:zod":{Qe(n,mt.base64,r.message,e);break}}break}case"nanoid":Qe(n,mt.nanoid,r.message,e)}return n}function cs(t,e){return e.patternStrategy==="escape"?qf(t):t}var Yf=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function qf(t){let e="";for(let n=0;n<t.length;n++)Yf.has(t[n])||(e+="\\"),e+=t[n];return e}function gt(t,e,n,r){var s;t.format||(s=t.anyOf)!=null&&s.some(i=>i.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format}),delete t.format),t.anyOf.push({format:e,...n&&r.errorMessages&&{errorMessage:{format:n}}})):t.format=e}function Qe(t,e,n,r){var s;t.pattern||(s=t.allOf)!=null&&s.some(i=>i.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:Ta(e,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):t.pattern=Ta(e,r)}function Ta(t,e){var n;if(!e.applyRegexFlags||!t.flags)return t.source;const r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},s=r.i?t.source.toLowerCase():t.source;let i="",a=!1,u=!1,l=!1;for(let o=0;o<s.length;o++){if(a){i+=s[o],a=!1;continue}if(r.i){if(u){if(s[o].match(/[a-z]/)){l?(i+=s[o],i+=`${s[o-2]}-${s[o]}`.toUpperCase(),l=!1):s[o+1]==="-"&&((n=s[o+2])!=null&&n.match(/[a-z]/))?(i+=s[o],l=!0):i+=`${s[o]}${s[o].toUpperCase()}`;continue}}else if(s[o].match(/[a-z]/)){i+=`[${s[o]}${s[o].toUpperCase()}]`;continue}}if(r.m){if(s[o]==="^"){i+=`(^|(?<=[\r
5
5
  ]))`;continue}else if(s[o]==="$"){i+=`($|(?=[\r
@@ -18,7 +18,7 @@ ${a.join(`
18
18
 
19
19
  Help the user understand and work with this resource.`),e[1]=t,e[2]=s,e[3]=r.collectionName,e[4]=r.connectionId,e[5]=r.itemId,e[6]=i}else i=e[6];return i.join(`
20
20
 
21
- `)}function p0(){const t=Q.c(5),e=oi(),{org:n}=zt();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const s=Yu(r);let i;return t[1]!==n||t[2]!==s||t[3]!==e?(i=a=>{const l=a.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!l||!l[1])return;const o=l[1],d=s.connectionId;if(!d)return;e.invalidateQueries({queryKey:je.collection(n.slug,d,o)});const f=o.toLowerCase().replace(/_/g," ");Kn.success(`${f} updated`)},t[1]=n,t[2]=s,t[3]=e,t[4]=i):i=t[4],i}function qo(){const t=Q.c(2),e=Dd();let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function m0(t){const e=Q.c(24),{gateway:n,isSelected:r}=t,s=r&&"bg-accent";let i;e[0]!==s?(i=ie("flex items-start gap-3 py-3 px-3 hover:bg-accent cursor-pointer rounded-xl transition-colors",s),e[0]=s,e[1]=i):i=e[1];let a;e[2]!==n.fallbackIcon?(a=n.fallbackIcon??m.jsx(di,{}),e[2]=n.fallbackIcon,e[3]=a):a=e[3];let u;e[4]!==n.icon||e[5]!==n.title||e[6]!==a?(u=m.jsx(ci,{icon:n.icon,name:n.title,size:"sm",fallbackIcon:a,className:"size-10 rounded-xl border border-stone-200/60 shadow-sm shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=a,e[7]=u):u=e[7];let l;e[8]!==n.title?(l=m.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=l):l=e[9];let o;e[10]!==r?(o=r&&m.jsx($r,{size:16,className:"text-foreground shrink-0"}),e[10]=r,e[11]=o):o=e[11];let d;e[12]!==l||e[13]!==o?(d=m.jsxs("div",{className:"flex items-center justify-between",children:[l,o]}),e[12]=l,e[13]=o,e[14]=d):d=e[14];let f;e[15]!==n.description?(f=n.description&&m.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1 leading-relaxed",children:n.description}),e[15]=n.description,e[16]=f):f=e[16];let p;e[17]!==d||e[18]!==f?(p=m.jsxs("div",{className:"flex flex-col flex-1 min-w-0 gap-0.5",children:[d,f]}),e[17]=d,e[18]=f,e[19]=p):p=e[19];let h;return e[20]!==i||e[21]!==u||e[22]!==p?(h=m.jsxs("div",{className:i,children:[u,p]}),e[20]=i,e[21]=u,e[22]=p,e[23]=h):h=e[23],h}function Vo(t){const e=Q.c(25),{gateways:n,selectedGatewayId:r,onGatewayChange:s,searchInputRef:i}=t,[a,u]=j.useState(""),l=j.useRef(null),o=i??l;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={navigateOnCreate:!0},e[0]=d):d=e[0];const{createGateway:f,isCreating:p}=$d(d);let h;e:{if(!a.trim()){h=n;break e}let P;if(e[1]!==n||e[2]!==a){const S=a.toLowerCase();P=n.filter(B=>B.title.toLowerCase().includes(S)||B.description?.toLowerCase().includes(S)),e[1]=n,e[2]=a,e[3]=P}else P=e[3];h=P}const g=h;let _;e[4]!==s?(_=P=>{s(P),u("")},e[4]=s,e[5]=_):_=e[5];const T=_;let E;e[6]===Symbol.for("react.memo_cache_sentinel")?(E=m.jsx(Yr,{size:16,className:"text-muted-foreground pointer-events-none shrink-0"}),e[6]=E):E=e[6];let A;e[7]===Symbol.for("react.memo_cache_sentinel")?(A=P=>u(P.target.value),e[7]=A):A=e[7];let b;e[8]!==o||e[9]!==a?(b=m.jsx(fi,{ref:o,type:"text",placeholder:"Search for an agent...",value:a,onChange:A,className:"flex-1 h-8 text-sm border-0 focus-visible:ring-0 focus-visible:ring-offset-0 shadow-none p-0"}),e[8]=o,e[9]=a,e[10]=b):b=e[10];const w=p?"Creating...":"Create Agent";let R;e[11]!==f||e[12]!==p||e[13]!==w?(R=m.jsx(Me,{onClick:f,variant:"outline",size:"sm",className:"h-8 px-3 rounded-lg text-sm font-medium shrink-0",disabled:p,children:w}),e[11]=f,e[12]=p,e[13]=w,e[14]=R):R=e[14];let I;e[15]!==b||e[16]!==R?(I=m.jsx("div",{className:"border-b px-4 py-3 bg-background/95 backdrop-blur sticky top-0 z-10",children:m.jsxs("div",{className:"relative flex items-center gap-2",children:[E,b,R]})}),e[15]=b,e[16]=R,e[17]=I):I=e[17];let L;e[18]!==g||e[19]!==T||e[20]!==r?(L=m.jsx("div",{className:"overflow-y-auto p-1.5",children:g.length>0?m.jsx("div",{className:"grid grid-cols-2 gap-0.5",children:g.map(P=>m.jsx("div",{role:"button",tabIndex:0,onClick:()=>T(P.id),onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),T(P.id))},className:"outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-xl",children:m.jsx(m0,{gateway:P,isSelected:P.id===r})},P.id))}):m.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No agents found"})}),e[18]=g,e[19]=T,e[20]=r,e[21]=L):L=e[21];let M;return e[22]!==L||e[23]!==I?(M=m.jsxs("div",{className:"flex flex-col max-h-[400px]",children:[I,L]}),e[22]=L,e[23]=I,e[24]=M):M=e[24],M}function g0(t){const e=Q.c(37),{selectedGatewayId:n,onGatewayChange:r,gateways:s,className:i,placeholder:a,showTooltip:u,disabled:l}=t,o=a===void 0?"Select Agent":a,d=u===void 0?!0:u,f=l===void 0?!1:l,[p,h]=j.useState(!1),g=j.useRef(null),_=qo(),T=s??_;let E,A;e[0]!==p?(E=()=>{p&&setTimeout(()=>{g.current?.focus()},0)},A=[p],e[0]=p,e[1]=E,e[2]=A):(E=e[1],A=e[2]),j.useEffect(E,A);let b;e[3]!==T||e[4]!==n?(b=n?T.find(re=>re.id===n):null,e[3]=T,e[4]=n,e[5]=b):b=e[5];const w=b;let R;e[6]!==r?(R=re=>{r(re),h(!1)},e[6]=r,e[7]=R):R=e[7];const I=R;let L;e[8]===Symbol.for("react.memo_cache_sentinel")?(L=re=>{h(re)},e[8]=L):L=e[8];const M=L,P=f?"cursor-not-allowed opacity-50":"cursor-pointer hover:bg-accent";let S;e[9]!==i||e[10]!==P?(S=ie("flex items-center justify-center p-1 rounded-md transition-colors shrink-0",P,i),e[9]=i,e[10]=P,e[11]=S):S=e[11];let B;e[12]!==w?(B=w?m.jsx(ci,{icon:w.icon,name:w.title,size:"xs",fallbackIcon:w.fallbackIcon??m.jsx(di,{size:12}),className:"size-5 rounded-md"}):m.jsx("img",{src:"/favicon.svg",alt:"Default Agent",className:"size-5 rounded-md"}),e[12]=w,e[13]=B):B=e[13];let $;e[14]!==f||e[15]!==o||e[16]!==S||e[17]!==B?($=m.jsx("button",{type:"button",disabled:f,className:S,"aria-label":o,children:B}),e[14]=f,e[15]=o,e[16]=S,e[17]=B,e[18]=$):$=e[18];const X=$,q=f?!1:p,U=f?void 0:M;let W;e[19]!==X?(W=m.jsx(_n,{asChild:!0,children:m.jsx(ur,{asChild:!0,children:X})}),e[19]=X,e[20]=W):W=e[20];let V;e[21]!==p||e[22]!==w?.title||e[23]!==d?(V=d&&!p&&m.jsx(xn,{side:"top",className:"text-xs",children:w?.title??"Choose an agent to chat with"}),e[21]=p,e[22]=w?.title,e[23]=d,e[24]=V):V=e[24];let K;e[25]!==W||e[26]!==V?(K=m.jsx(hi,{children:m.jsxs(yn,{children:[W,V]})}),e[25]=W,e[26]=V,e[27]=K):K=e[27];let J;e[28]!==T||e[29]!==I||e[30]!==n?(J=m.jsx(or,{className:"w-[550px] p-0 overflow-hidden",align:"start",side:"top",sideOffset:8,children:m.jsx(Vo,{gateways:T,selectedGatewayId:n,onGatewayChange:I,searchInputRef:g})}),e[28]=T,e[29]=I,e[30]=n,e[31]=J):J=e[31];let k;return e[32]!==q||e[33]!==U||e[34]!==K||e[35]!==J?(k=m.jsxs(lr,{open:q,onOpenChange:U,children:[K,J]}),e[32]=q,e[33]=U,e[34]=K,e[35]=J,e[36]=k):k=e[36],k}const b0=["x-ai/grok-code-fast-1","anthropic/claude-sonnet-4.5","google/gemini-2.5-flash","xiaomi/mimo-v2-flash:free","google/gemini-3-flash-preview","deepseek/deepseek-v3.2","anthropic/claude-opus-4.5","x-ai/grok-4.1-fast","google/gemini-2.5-flash-lite","google/gemini-2.0-flash-001"],js=new Map;b0.forEach((t,e)=>{js.set(t,e)});function Ti(t){const e=Q.c(3);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={pageSize:999},e[0]=n):n=e[0];const r=u0(t??void 0,n);let s;return e[1]!==r?(s=r.filter(T0).sort(E0),e[1]=r,e[2]=s):s=e[2],s}function E0(t,e){const n=js.get(t.id),r=js.get(e.id);return n!==void 0&&r!==void 0?n-r:n!==void 0?-1:r!==void 0?1:t.title.localeCompare(e.title)}function T0(t){return t.limits?.contextWindow&&t.limits?.maxOutputTokens}const x0={reasoning:{icon:m.jsx(qr,{className:"size-4"}),label:"Reasoning"},"image-upload":{icon:m.jsx(Zd,{className:"size-4"}),label:"Can analyze images"},"file-upload":{icon:m.jsx(Qd,{className:"size-4"}),label:"Can analyze files"},"web-search":{icon:m.jsx(Yr,{className:"size-4"}),label:"Can search the web to answer questions"}};function Go(t){const e=Q.c(10),{capability:n}=t,r=x0[n];let s,i;e[0]!==n||e[1]!==r?(s=r||{icon:null,label:n},i=s.label.split("-").map(_0).join(" "),e[0]=n,e[1]=r,e[2]=s,e[3]=i):(s=e[2],i=e[3]);const a=i;let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u={backgroundColor:"color-mix(in oklch, var(--chart-1) 15%, transparent)",color:"var(--chart-1)"},e[4]=u):u=e[4];let l;e[5]!==a?(l=m.jsx("span",{children:a}),e[5]=a,e[6]=l):l=e[6];let o;return e[7]!==s.icon||e[8]!==l?(o=m.jsxs("div",{className:"flex items-center gap-1.5 py-0.5 px-1.5 rounded-md text-xs font-medium",style:u,children:[s.icon,l]}),e[7]=s.icon,e[8]=l,e[9]=o):o=e[9],o}function _0(t){return t.charAt(0).toUpperCase()+t.slice(1)}function y0(t){const e=Q.c(53),{model:n,compact:r}=t,s=r===void 0?!1:r;if(!n){let T;return e[0]===Symbol.for("react.memo_cache_sentinel")?(T=m.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),e[0]=T):T=e[0],T}const i=n.limits?.contextWindow||n.costs?.input||n.costs?.output||n.limits?.maxOutputTokens;if(!i&&!s){let T;e[1]!==n.logo||e[2]!==n.title?(T=n.logo&&m.jsx("img",{src:n.logo,className:"w-6 h-6",alt:n.title}),e[1]=n.logo,e[2]=n.title,e[3]=T):T=e[3];let E;e[4]!==n.title?(E=m.jsx("p",{className:"text-lg font-medium leading-7",children:n.title}),e[4]=n.title,e[5]=E):E=e[5];let A;e[6]!==T||e[7]!==E?(A=m.jsxs("div",{className:"flex items-center gap-3 py-2 px-0",children:[T,E]}),e[6]=T,e[7]=E,e[8]=A):A=e[8];let b;e[9]!==n.description?(b=n.description&&m.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[9]=n.description,e[10]=b):b=e[10];let w;return e[11]!==A||e[12]!==b?(w=m.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[A,b]}),e[11]=A,e[12]=b,e[13]=w):w=e[13],w}if(!i&&s)return null;if(s){let T;e[14]!==n.limits?(T=n.limits?.contextWindow&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Context"}),m.jsxs("span",{className:"text-foreground font-medium",children:[n.limits.contextWindow.toLocaleString()," tokens"]})]}),e[14]=n.limits,e[15]=T):T=e[15];let E;e[16]!==n.costs?(E=n.costs?.input&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Input cost"}),m.jsxs("span",{className:"text-foreground font-medium",children:["$",n.costs.input.toFixed(2)," / 1M"]})]}),e[16]=n.costs,e[17]=E):E=e[17];let A;e[18]!==n.costs?(A=n.costs?.output&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Output cost"}),m.jsxs("span",{className:"text-foreground font-medium",children:["$",n.costs.output.toFixed(2)," / 1M"]})]}),e[18]=n.costs,e[19]=A):A=e[19];let b;e[20]!==n.limits?(b=n.limits?.maxOutputTokens&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Output limit"}),m.jsxs("span",{className:"text-foreground font-medium",children:[n.limits.maxOutputTokens.toLocaleString()," tokens"]})]}),e[20]=n.limits,e[21]=b):b=e[21];let w;return e[22]!==T||e[23]!==E||e[24]!==A||e[25]!==b?(w=m.jsxs("div",{className:"flex flex-col gap-2.5 pt-3 pb-3 px-3 rounded-b-lg text-xs",children:[T,E,A,b]}),e[22]=T,e[23]=E,e[24]=A,e[25]=b,e[26]=w):w=e[26],w}let a;e[27]!==n.logo||e[28]!==n.title?(a=n.logo&&m.jsx("img",{src:n.logo,className:"w-6 h-6 shrink-0",alt:n.title}),e[27]=n.logo,e[28]=n.title,e[29]=a):a=e[29];let u;e[30]!==n.title?(u=m.jsx("p",{className:"text-lg font-medium leading-7 wrap-break-word min-w-0",children:n.title}),e[30]=n.title,e[31]=u):u=e[31];let l;e[32]!==a||e[33]!==u?(l=m.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[a,u]}),e[32]=a,e[33]=u,e[34]=l):l=e[34];let o;e[35]!==n.capabilities?(o=n.capabilities&&n.capabilities.length>0&&m.jsx("div",{className:"flex items-center gap-2",children:n.capabilities.map(A0)}),e[35]=n.capabilities,e[36]=o):o=e[36];let d;e[37]!==l||e[38]!==o?(d=m.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[l,o]}),e[37]=l,e[38]=o,e[39]=d):d=e[39];let f;e[40]!==n.limits?(f=n.limits?.contextWindow&&m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(Xd,{className:"w-3.5 h-3.5 text-muted-foreground"}),m.jsx("p",{className:"text-sm text-foreground",children:"Context window"})]}),m.jsxs("p",{className:"text-sm text-muted-foreground",children:[n.limits.contextWindow.toLocaleString()," tokens"]})]}),e[40]=n.limits,e[41]=f):f=e[41];let p;e[42]!==n.costs?(p=(n.costs?.input||n.costs?.output)&&m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(ro,{className:"w-3.5 h-3.5 text-muted-foreground"}),m.jsx("p",{className:"text-sm text-foreground",children:"Costs"})]}),m.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.costs?.input!==null&&n.costs?.input!==void 0&&m.jsxs("p",{className:"text-sm text-muted-foreground",children:["$",n.costs.input.toFixed(2)," / 1M tokens (input)"]}),n.costs?.output!==null&&n.costs?.output!==void 0&&m.jsxs("p",{className:"text-sm text-muted-foreground",children:["$",n.costs.output.toFixed(2)," / 1M tokens (output)"]})]})]}),e[42]=n.costs,e[43]=p):p=e[43];let h;e[44]!==n.limits?(h=n.limits?.maxOutputTokens&&m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(ao,{className:"w-4.5 h-4.5 text-muted-foreground/70"}),m.jsx("p",{className:"text-sm text-foreground",children:"Output limit"})]}),m.jsxs("p",{className:"text-sm text-muted-foreground",children:[n.limits.maxOutputTokens.toLocaleString()," token limit"]})]}),e[44]=n.limits,e[45]=h):h=e[45];let g;e[46]!==f||e[47]!==p||e[48]!==h?(g=m.jsxs("div",{className:"flex flex-col gap-4",children:[f,p,h]}),e[46]=f,e[47]=p,e[48]=h,e[49]=g):g=e[49];let _;return e[50]!==g||e[51]!==d?(_=m.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[d,g]}),e[50]=g,e[51]=d,e[52]=_):_=e[52],_}function A0(t){return m.jsx(Go,{capability:t},t)}function k0(t){const e=Q.c(15),{model:n,onHover:r}=t;let s;e[0]!==n||e[1]!==r?(s=()=>r(n),e[0]=n,e[1]=r,e[2]=s):s=e[2];let i;e[3]!==n.logo||e[4]!==n.title?(i=n.logo&&m.jsx("img",{src:n.logo,className:"w-5 h-5 shrink-0",alt:n.title}),e[3]=n.logo,e[4]=n.title,e[5]=i):i=e[5];let a;e[6]!==n.title?(a=m.jsx("span",{className:"text-sm text-foreground flex-1 min-w-0 line-clamp-1",children:n.title}),e[6]=n.title,e[7]=a):a=e[7];let u;e[8]!==n.capabilities?(u=n.capabilities&&n.capabilities.length>0&&m.jsx("div",{className:"flex items-center gap-1.5 shrink-0",children:n.capabilities.slice(0,2).map(C0)}),e[8]=n.capabilities,e[9]=u):u=e[9];let l;return e[10]!==s||e[11]!==i||e[12]!==a||e[13]!==u?(l=m.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:s,children:[i,a,u]}),e[10]=s,e[11]=i,e[12]=a,e[13]=u,e[14]=l):l=e[14],l}function C0(t){return m.jsx(Go,{capability:t},t)}function I0(t){const e=Q.c(10),{model:n,placeholder:r}=t,s=r===void 0?"Select model":r;if(!n){let l;return e[0]!==s?(l=m.jsx("span",{className:"text-sm text-muted-foreground",children:s}),e[0]=s,e[1]=l):l=e[1],l}let i;e[2]!==n.logo||e[3]!==n.title?(i=n.logo&&m.jsx("img",{src:n.logo,className:"w-5 h-5 shrink-0 rounded-sm",alt:n.title}),e[2]=n.logo,e[3]=n.title,e[4]=i):i=e[4];let a;e[5]!==n.title?(a=m.jsx("span",{className:"text-sm text-muted-foreground group-hover:text-foreground transition-colors truncate min-w-0 hidden sm:inline-block",children:n.title}),e[5]=n.title,e[6]=a):a=e[6];let u;return e[7]!==i||e[8]!==a?(u=m.jsxs("div",{className:"flex items-center gap-2 min-w-0 overflow-hidden",children:[i,a]}),e[7]=i,e[8]=a,e[9]=u):u=e[9],u}function N0(){const t=Q.c(6);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:m.jsxs("div",{className:"flex items-center gap-2.5 h-12 px-4",children:[m.jsx($e,{className:"size-4 shrink-0"}),m.jsx($e,{className:"flex-1 h-6"}),m.jsx($e,{className:"w-[140px] h-8 shrink-0"})]})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[400px] md:min-w-[400px]",children:[e,m.jsx("div",{className:"flex-1 overflow-y-auto px-0.5 pt-2 space-y-1",children:Array.from({length:6}).map(S0)})]}),t[1]=n):n=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[m.jsx($e,{className:"size-6 shrink-0"}),m.jsx($e,{className:"h-6 w-32"})]}),t[2]=r):r=t[2];let s;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[r,m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx($e,{className:"h-6 w-20 rounded-md"}),m.jsx($e,{className:"h-6 w-24 rounded-md"})]})]}),t[3]=s):s=t[3];let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsx($e,{className:"h-4 w-24"}),m.jsx($e,{className:"h-4 w-32"})]}),t[4]=i):i=t[4];let a;return t[5]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsxs("div",{className:"flex flex-col md:flex-row h-[350px]",children:[n,m.jsx("div",{className:"hidden md:block md:w-[320px] md:shrink-0 p-3",children:m.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[s,m.jsxs("div",{className:"flex flex-col gap-4",children:[i,m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsx($e,{className:"h-4 w-16"}),m.jsx($e,{className:"h-4 w-40"})]})]})]})})]}),t[5]=a):a=t[5],a}function S0(t,e){return m.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[m.jsx($e,{className:"size-5 shrink-0 rounded-sm"}),m.jsx($e,{className:"flex-1 h-4"}),m.jsx($e,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function w0(t){const e=Q.c(39),{selectedModel:n,onModelChange:r,onClose:s,modelsConnections:i}=t,[a,u]=j.useState(null),[l,o]=j.useState(""),d=j.useRef(null),[f,p]=j.useState(n?.connectionId??null),h=bi(),g=i??h,_=Ti(f);let T,E;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=()=>{setTimeout(()=>{d.current?.focus()},0)},E=[],e[0]=T,e[1]=E):(T=e[0],E=e[1]),j.useEffect(T,E);let A;e[2]!==_||e[3]!==l?(A=l.trim()?_.filter(J=>{const k=l.toLowerCase();return J.title.toLowerCase().includes(k)||J.provider?.toLowerCase().includes(k)||J.description?.toLowerCase().includes(k)}):_,e[2]=_,e[3]=l,e[4]=A):A=e[4];const b=A;let w;e[5]===Symbol.for("react.memo_cache_sentinel")?(w=J=>{p(J)},e[5]=w):w=e[5];const R=w;let I;e[6]!==_||e[7]!==s||e[8]!==r||e[9]!==f?(I=J=>{const k=_.find(re=>re.id===J);!k||!f||(r({id:k.id,connectionId:f,provider:k.provider??void 0}),o(""),s())},e[6]=_,e[7]=s,e[8]=r,e[9]=f,e[10]=I):I=e[10];const L=I;let M;e[11]===Symbol.for("react.memo_cache_sentinel")?(M=m.jsx(Yr,{size:16,className:"text-muted-foreground shrink-0"}),e[11]=M):M=e[11];let P;e[12]===Symbol.for("react.memo_cache_sentinel")?(P=J=>o(J.target.value),e[12]=P):P=e[12];let S;e[13]!==l?(S=m.jsx(fi,{ref:d,type:"text",placeholder:"Search for a model...",value:l,onChange:P,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[13]=l,e[14]=S):S=e[14];let B;e[15]!==g||e[16]!==f?(B=g.length>0&&m.jsxs(Yd,{value:f??"",onValueChange:R,children:[m.jsxs(qd,{size:"sm",className:"w-auto min-w-[140px] h-8 shrink-0 [&>svg:last-child]:hidden",onClick:O0,children:[m.jsx(Vd,{placeholder:"Select connection"}),m.jsx(eo,{className:"size-4 opacity-50 shrink-0 pointer-events-none"})]}),m.jsx(Gd,{children:g.map(R0)})]}),e[15]=g,e[16]=f,e[17]=B):B=e[17];let $;e[18]!==S||e[19]!==B?($=m.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:m.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 cursor-text",children:[M,S,B]})}),e[18]=S,e[19]=B,e[20]=$):$=e[20];let X;e[21]!==b||e[22]!==L||e[23]!==n?.id?(X=b.length>0?b.map(J=>{const k=J.id===n?.id;return m.jsx("div",{onClick:()=>L(J.id),className:ie("rounded-lg mb-1",k&&"bg-accent"),children:m.jsx(k0,{model:J,onHover:u})},J.id)}):m.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No models found"}),e[21]=b,e[22]=L,e[23]=n?.id,e[24]=X):X=e[24];let q;e[25]!==X?(q=m.jsx("div",{className:"flex-1 overflow-y-auto px-0.5 pt-2",children:X}),e[25]=X,e[26]=q):q=e[26];let U;e[27]!==$||e[28]!==q?(U=m.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[400px] md:min-w-[400px]",children:[$,q]}),e[27]=$,e[28]=q,e[29]=U):U=e[29];let W;e[30]!==a||e[31]!==_||e[32]!==n?(W=a||(n?_.find(J=>J.id===n.id):null)||null,e[30]=a,e[31]=_,e[32]=n,e[33]=W):W=e[33];let V;e[34]!==W?(V=m.jsx("div",{className:"hidden md:block md:w-[320px] md:shrink-0 p-3",children:m.jsx(y0,{model:W})}),e[34]=W,e[35]=V):V=e[35];let K;return e[36]!==U||e[37]!==V?(K=m.jsxs("div",{className:"flex flex-col md:flex-row h-[350px]",children:[U,V]}),e[36]=U,e[37]=V,e[38]=K):K=e[38],K}function R0(t){return m.jsx(Wd,{value:t.id,children:m.jsxs("div",{className:"flex items-center gap-2",children:[t.icon?m.jsx("img",{src:t.icon,alt:t.title,className:"w-4 h-4 rounded"}):m.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:t.title.slice(0,1).toUpperCase()}),m.jsx("span",{children:t.title})]})},t.id)}function O0(t){return t.stopPropagation()}function L0(t){const e=Q.c(23),{selectedModel:n,onModelChange:r,modelsConnections:s,variant:i,className:a,placeholder:u}=t,l=i===void 0?"borderless":i,o=u===void 0?"Select model":u,[d,f]=j.useState(!1),p=bi(),h=s??p,g=n?.connectionId??null,_=Ti(g);let T;e[0]!==_||e[1]!==n?(T=n?_.find(B=>B.id===n.id):void 0,e[0]=_,e[1]=n,e[2]=T):T=e[2];const E=T;if(h.length===0)return null;const A=l==="borderless"?"ghost":"outline",b=l==="borderless"&&"md:border-none";let w;e[3]!==a||e[4]!==b?(w=ie("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 shrink justify-start overflow-hidden",b,a),e[3]=a,e[4]=b,e[5]=w):w=e[5];let R;e[6]!==E||e[7]!==o?(R=m.jsx(I0,{model:E,placeholder:o}),e[6]=E,e[7]=o,e[8]=R):R=e[8];let I;e[9]!==A||e[10]!==w||e[11]!==R?(I=m.jsx(ur,{asChild:!0,children:m.jsx(Me,{variant:A,size:"sm",className:w,children:R})}),e[9]=A,e[10]=w,e[11]=R,e[12]=I):I=e[12];let L;e[13]===Symbol.for("react.memo_cache_sentinel")?(L=m.jsx(N0,{}),e[13]=L):L=e[13];let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M=()=>f(!1),e[14]=M):M=e[14];let P;e[15]!==h||e[16]!==r||e[17]!==n?(P=m.jsx(or,{className:"w-full md:w-auto p-0",align:"start",side:"bottom",sideOffset:8,children:m.jsx(j.Suspense,{fallback:L,children:m.jsx(w0,{selectedModel:n,onModelChange:r,onClose:M,modelsConnections:h})})}),e[15]=h,e[16]=r,e[17]=n,e[18]=P):P=e[18];let S;return e[19]!==d||e[20]!==P||e[21]!==I?(S=m.jsxs(lr,{open:d,onOpenChange:f,children:[I,P]}),e[19]=d,e[20]=P,e[21]=I,e[22]=S):S=e[22],S}const v0=t=>new Bo({api:`/api/${t}/models/stream`,credentials:"include",prepareSendMessagesRequest:({messages:e,requestMetadata:n={}})=>{const{system:r,...s}=n,i=r?{id:crypto.randomUUID(),role:"system",parts:[{type:"text",text:r}]}:null;return{body:{messages:i?[i,...e]:e,stream:!0,...s}}}}),Ca=(t,e)=>t?.find(n=>n.id===e)??t?.[0]??null,D0=(t,e)=>{const n=Q.c(14);let r;n[0]!==t?(r=Qu.chatSelectedModel(t),n[0]=t,n[1]=r):r=n[1];const[s,i]=vs(r,null),a=s?.connectionId;let u;n[2]!==e||n[3]!==a?(u=Ca(e,a),n[2]=e,n[3]=a,n[4]=u):u=n[4];const l=u,o=Ti(l?.id??null),d=s?.id;let f;n[5]!==o||n[6]!==d?(f=Ca(o,d),n[5]=o,n[6]=d,n[7]=f):f=n[7];const p=f;let h;n[8]!==l||n[9]!==p?(h=p&&l?.id?{id:p.id,provider:p.provider,limits:p.limits,connectionId:l.id}:null,n[8]=l,n[9]=p,n[10]=h):h=n[10];const g=h;let _;return n[11]!==g||n[12]!==i?(_=[g,i],n[11]=g,n[12]=i,n[13]=_):_=n[13],_},Wo={inputValue:"",branchContext:null,finishReason:null};function P0(t,e){switch(e.type){case"SET_INPUT":return{...t,inputValue:e.payload};case"START_BRANCH":return{...t,branchContext:e.payload};case"CLEAR_BRANCH":return{...t,branchContext:null};case"SET_FINISH_REASON":return{...t,finishReason:e.payload};case"CLEAR_FINISH_REASON":return{...t,finishReason:null};case"RESET":return Wo;default:return t}}const Qo=j.createContext(null),Xo=()=>crypto.randomUUID();function M0(t){const e=Q.c(75),{children:n}=t,{locator:r,org:s}=zt(),{data:i}=qu.useSession(),a=i?.user??null,[u,l]=j.useReducer(P0,Wo),o=$o(),d=Yo(),{threads:f}=zo(),[p,h]=vs(Qu.threadManagerState(r)+":active-id",j0),g=f0(p),_=qo(),[T,E]=vs(`${r}:selected-gateway-id`,null),A=bi(),[b,w]=D0(r,A),R=h0(T),I=p0();let L;e[0]!==p||e[1]!==f?(L=f.find(le=>le.id===p)??null,e[0]=p,e[1]=f,e[2]=L):L=e[2];const M=L;let P;e[3]!==_||e[4]!==T?(P=T?_.find(le=>le.id===T)??null:null,e[3]=_,e[4]=T,e[5]=P):P=e[5];const S=P;let B;e[6]!==s.slug?(B=v0(s.slug),e[6]=s.slug,e[7]=B):B=e[7];const $=B;let X;e[8]!==p||e[9]!==r||e[10]!==d||e[11]!==S?.id||e[12]!==o?(X=async le=>{const{finishReason:D,messages:Y,isAbort:Z,isDisconnect:ue,isError:me}=le;if(l({type:"SET_FINISH_REASON",payload:D??null}),D!=="stop"||Z||ue||me)return;const ze=Y.slice(-2).filter(Boolean);if(ze.length!==2){console.warn("[chat] Expected 2 messages, got",ze.length);return}d.insertMany.mutate(ze);const xt=ze.find(U0)?.parts?.find(F0)?.text.slice(0,100)||"",at=await c0(r,p);if(!at){const vt=new Date().toISOString(),Vt={id:p,title:xt,created_at:vt,updated_at:vt,hidden:!1,gatewayId:S?.id};o.insert.mutate(Vt);return}o.update.mutate({id:p,updates:{title:at.title||xt,gatewayId:at.gatewayId||S?.id,updated_at:new Date().toISOString()}})},e[8]=p,e[9]=r,e[10]=d,e[11]=S?.id,e[12]=o,e[13]=X):X=e[13];const q=X,U=B0;let W;e[14]!==p||e[15]!==q||e[16]!==I||e[17]!==g||e[18]!==$?(W={id:p,messages:g,transport:$,onFinish:q,onToolCall:I,onError:U},e[14]=p,e[15]=q,e[16]=I,e[17]=g,e[18]=$,e[19]=W):W=e[19];const V=a0(W),K=V.status==="submitted"||V.status==="streaming",J=V.messages.length===0;let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=le=>l({type:"SET_INPUT",payload:le}),e[20]=k):k=e[20];const re=k;let he;e[21]===Symbol.for("react.memo_cache_sentinel")?(he=le=>l({type:"START_BRANCH",payload:le}),e[21]=he):he=e[21];const N=he;let Ee;e[22]===Symbol.for("react.memo_cache_sentinel")?(Ee=()=>l({type:"CLEAR_BRANCH"}),e[22]=Ee):Ee=e[22];const ve=Ee;let fe;e[23]===Symbol.for("react.memo_cache_sentinel")?(fe=()=>l({type:"RESET"}),e[23]=fe):fe=e[23];const Ge=fe;let Ie;e[24]!==h||e[25]!==o?(Ie=le=>{const D=le?.id||crypto.randomUUID(),Y=new Date().toISOString(),Z={id:D,title:le?.title||"",created_at:le?.created_at||Y,updated_at:le?.updated_at||Y,hidden:le?.hidden??!1,gatewayId:le?.gatewayId};return o.insert.mutate(Z),h(D),Z},e[24]=h,e[25]=o,e[26]=Ie):Ie=e[26];const Ne=Ie;let ye;e[27]!==p||e[28]!==h||e[29]!==o?(ye=le=>{o.update.mutate({id:le,updates:{hidden:!0,updated_at:new Date().toISOString()}}),p===le&&h(Xo())},e[27]=p,e[28]=h,e[29]=o,e[30]=ye):ye=e[30];const Fe=ye;let Re;e[31]!==E?(Re=le=>{E(le)},e[31]=E,e[32]=Re):Re=e[32];const De=Re;let Oe;e[33]!==w?(Oe=le=>{w({id:le.id,connectionId:le.connectionId})},e[33]=w,e[34]=Oe):Oe=e[34];const Ue=Oe;let Se;e[35]!==p||e[36]!==V||e[37]!==R||e[38]!==K||e[39]!==S?.id||e[40]!==b||e[41]!==a?.image||e[42]!==a?.name?(Se=async le=>{if(!b){Kn.error("No model configured");return}if(!le?.trim()||K)return;re(""),ve(),l({type:"CLEAR_FINISH_REASON"});const D={created_at:new Date().toISOString(),thread_id:p,system:R,model:{id:b.id,connectionId:b.connectionId,provider:b.provider??void 0,limits:b.limits??void 0},gateway:{id:S?.id??null},user:{avatar:a?.image??void 0,name:a?.name??"you"}};await V.sendMessage({id:crypto.randomUUID(),role:"user",parts:[{type:"text",text:le}],metadata:D},{metadata:D})},e[35]=p,e[36]=V,e[37]=R,e[38]=K,e[39]=S?.id,e[40]=b,e[41]=a?.image,e[42]=a?.name,e[43]=Se):Se=e[43];const He=Se;let We;e[44]!==V?(We=()=>V.stop(),e[44]=V,e[45]=We):We=e[45];const Tt=We;let Je;e[46]===Symbol.for("react.memo_cache_sentinel")?(Je=()=>l({type:"CLEAR_FINISH_REASON"}),e[46]=Je):Je=e[46];const qt=Je;let st;e[47]!==M||e[48]!==p||e[49]!==V.clearError||e[50]!==V.error||e[51]!==V.messages||e[52]!==V.setMessages||e[53]!==V.status||e[54]!==u.branchContext||e[55]!==u.finishReason||e[56]!==u.inputValue||e[57]!==Ne||e[58]!==_||e[59]!==Fe||e[60]!==J||e[61]!==K||e[62]!==A||e[63]!==S||e[64]!==b||e[65]!==He||e[66]!==h||e[67]!==De||e[68]!==Ue||e[69]!==Tt||e[70]!==f?(st={inputValue:u.inputValue,branchContext:u.branchContext,setInputValue:re,startBranch:N,clearBranch:ve,resetInteraction:Ge,activeThreadId:p,activeThread:M,threads:f,createThread:Ne,setActiveThreadId:h,hideThread:Fe,gateways:_,selectedGateway:S,setGatewayId:De,modelsConnections:A,selectedModel:b,setSelectedModel:Ue,messages:V.messages,chatStatus:V.status,isStreaming:K,isChatEmpty:J,sendMessage:He,stopStreaming:Tt,setMessages:V.setMessages,chatError:V.error,clearChatError:V.clearError,finishReason:u.finishReason,clearFinishReason:qt},e[47]=M,e[48]=p,e[49]=V.clearError,e[50]=V.error,e[51]=V.messages,e[52]=V.setMessages,e[53]=V.status,e[54]=u.branchContext,e[55]=u.finishReason,e[56]=u.inputValue,e[57]=Ne,e[58]=_,e[59]=Fe,e[60]=J,e[61]=K,e[62]=A,e[63]=S,e[64]=b,e[65]=He,e[66]=h,e[67]=De,e[68]=Ue,e[69]=Tt,e[70]=f,e[71]=st):st=e[71];const dt=st;let it;return e[72]!==n||e[73]!==dt?(it=m.jsx(Qo.Provider,{value:dt,children:n}),e[72]=n,e[73]=dt,e[74]=it):it=e[74],it}function B0(t){console.error("[chat] Chat error:",t)}function F0(t){return t.type==="text"}function U0(t){return t.parts?.find(H0)}function H0(t){return t.type==="text"}function j0(t){return t||Xo()}function An(){const t=j.useContext(Qo);if(!t)throw new Error("useChat must be used within a ChatProvider");return t}const z0={openrouter:t=>{const e=t?.openrouter;return typeof e=="object"&&e!==null&&"usage"in e&&typeof e.usage=="object"&&e.usage!==null&&"cost"in e.usage&&typeof e.usage.cost=="number"?e.usage.cost:null}};function $0(t){if(!t?.providerMetadata)return null;for(const e of Object.values(z0)){const n=e(t.providerMetadata);if(n!==null)return n}return null}function Y0(t){return t.reduce((e,n)=>{const r=n.metadata?.usage;return r?{inputTokens:e.inputTokens+(r.inputTokens??0),outputTokens:e.outputTokens+(r.outputTokens??0),totalTokens:e.totalTokens+(r.totalTokens??0),cost:e.cost+($0(r)??0)}:e},{inputTokens:0,outputTokens:0,totalTokens:0,cost:0})}function Zo(t){const e=Q.c(38),{messages:n}=t;let r,s,i,a,u,l,o,d,f,p,h,g;if(e[0]!==n){g=Symbol.for("react.early_return_sentinel");e:{const w=Y0(n);if(!w){g=null;break e}const{totalTokens:R,inputTokens:I,outputTokens:L,cost:M}=w;if(i=M,!R&&!I&&!L){g=null;break e}s=yn;let P;e[13]===Symbol.for("react.memo_cache_sentinel")?(P=m.jsx(to,{size:12}),e[13]=P):P=e[13];const S=m.jsxs(Me,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground pl-1! h-6 gap-1 whitespace-nowrap shrink-0",children:[P,m.jsx("span",{className:"text-[10px] font-mono tabular-nums",children:R.toLocaleString()})]});e[14]!==S?(h=m.jsx(_n,{asChild:!0,children:S}),e[14]=S,e[15]=h):h=e[15],r=xn,f="top",p="font-mono text-[11px]",u="grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",e[16]===Symbol.for("react.memo_cache_sentinel")?(l=m.jsx("span",{className:"text-muted",children:"in"}),e[16]=l):l=e[16],o=m.jsx("span",{children:I.toLocaleString()}),e[17]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsx("span",{className:"text-muted",children:"out"}),e[17]=d):d=e[17],a=L.toLocaleString()}e[0]=n,e[1]=r,e[2]=s,e[3]=i,e[4]=a,e[5]=u,e[6]=l,e[7]=o,e[8]=d,e[9]=f,e[10]=p,e[11]=h,e[12]=g}else r=e[1],s=e[2],i=e[3],a=e[4],u=e[5],l=e[6],o=e[7],d=e[8],f=e[9],p=e[10],h=e[11],g=e[12];if(g!==Symbol.for("react.early_return_sentinel"))return g;let _;e[18]!==a?(_=m.jsx("span",{children:a}),e[18]=a,e[19]=_):_=e[19];let T;e[20]!==i?(T=i>0&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-muted",children:"cost"}),m.jsxs("span",{children:["$",i.toFixed(4)]})]}),e[20]=i,e[21]=T):T=e[21];let E;e[22]!==_||e[23]!==T||e[24]!==u||e[25]!==l||e[26]!==o||e[27]!==d?(E=m.jsxs("div",{className:u,children:[l,o,d,_,T]}),e[22]=_,e[23]=T,e[24]=u,e[25]=l,e[26]=o,e[27]=d,e[28]=E):E=e[28];let A;e[29]!==r||e[30]!==E||e[31]!==f||e[32]!==p?(A=m.jsx(r,{side:f,className:p,children:E}),e[29]=r,e[30]=E,e[31]=f,e[32]=p,e[33]=A):A=e[33];let b;return e[34]!==s||e[35]!==A||e[36]!==h?(b=m.jsxs(s,{children:[h,A]}),e[34]=s,e[35]=A,e[36]=h,e[37]=b):b=e[37],b}function q0({gatewayId:t,gateways:e,onGatewayChange:n,disabled:r=!1}){const[s,i]=j.useState(!1),a=j.useRef(null),u=Vu(),{org:l}=zt(),o=e.find(g=>g.id===t);if(!o)return null;j.useEffect(()=>{s&&setTimeout(()=>{a.current?.focus()},0)},[s]);const d=co(t),f=g=>{g.stopPropagation(),n(null)},p=g=>{g.stopPropagation(),u({to:"/$org/gateways/$gatewayId",params:{org:l.slug,gatewayId:t}})},h=g=>{n(g),i(!1)};return m.jsxs("div",{className:ie("flex items-center justify-between px-3 py-1.5 rounded-t-xl",d?.bg),children:[m.jsxs(lr,{open:s,onOpenChange:i,children:[m.jsx(ur,{asChild:!0,children:m.jsxs("button",{type:"button",disabled:r,className:ie("flex items-center gap-1.5 hover:opacity-80 transition-opacity",r?"cursor-not-allowed opacity-50":"cursor-pointer"),children:[m.jsx(ci,{icon:o.icon,name:o.title,size:"2xs",fallbackIcon:o.fallbackIcon??m.jsx(di,{size:10})}),m.jsx("span",{className:"text-xs text-white font-normal",children:o.title}),m.jsx(vd,{size:14,className:"text-white/50"})]})}),m.jsx(or,{className:"w-[550px] p-0 overflow-hidden",align:"start",side:"top",sideOffset:8,children:m.jsx(Vo,{gateways:e,selectedGatewayId:t,onGatewayChange:h,searchInputRef:a})})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("button",{type:"button",onClick:p,disabled:r,className:ie("flex items-center justify-center p-1 rounded-full transition-colors",r?"cursor-not-allowed opacity-50":"cursor-pointer hover:bg-white/10"),"aria-label":"Edit gateway",children:m.jsx(Pd,{size:14,className:"text-white"})}),m.jsx("button",{type:"button",onClick:f,disabled:r,className:ie("flex items-center justify-center p-1 rounded-full transition-colors",r?"cursor-not-allowed opacity-50":"cursor-pointer hover:bg-white/10"),"aria-label":"Reset to default",children:m.jsx(lo,{size:14,className:"text-white"})})]})]})}function V0(){const t=Q.c(120),{inputValue:e,setInputValue:n,branchContext:r,clearBranch:s,setActiveThreadId:i,gateways:a,selectedGateway:u,setGatewayId:l,modelsConnections:o,selectedModel:d,setSelectedModel:f,messages:p,isStreaming:h,sendMessage:g,stopStreaming:_,chatError:T,clearChatError:E,finishReason:A,clearFinishReason:b}=An();let w;t[0]!==e||t[1]!==h||t[2]!==d?(w=!h&&d&&e.trim().length>0,t[0]=e,t[1]=h,t[2]=d,t[3]=w):w=t[3];const R=w;let I;t[4]!==R||t[5]!==e||t[6]!==h||t[7]!==g||t[8]!==_?(I=Z=>{Z.preventDefault(),h?_():R&&g(e.trim())},t[4]=R,t[5]=e,t[6]=h,t[7]=g,t[8]=_,t[9]=I):I=t[9];const L=I;let M;t[10]!==R||t[11]!==e||t[12]!==g?(M=Z=>{Z.key==="Enter"&&!Z.shiftKey&&(Z.preventDefault(),R&&g(e.trim()))},t[10]=R,t[11]=e,t[12]=g,t[13]=M):M=t[13];const P=M;let S;t[14]!==r||t[15]!==s||t[16]!==i||t[17]!==n?(S=()=>{r&&(i(r.originalThreadId),s(),n(""))},t[14]=r,t[15]=s,t[16]=i,t[17]=n,t[18]=S):S=t[18];const B=S;let $;t[19]!==T||t[20]!==g?($=()=>{T&&g(`I encountered this error: ${T.message}. Can you help me fix it?`)},t[19]=T,t[20]=g,t[21]=$):$=t[21];const X=$;let q;t[22]!==g?(q=()=>{g("Please continue.")},t[22]=g,t[23]=q):q=t[23];const U=q;let W,V,K,J,k,re;if(t[24]!==r||t[25]!==T||t[26]!==s||t[27]!==E||t[28]!==b||t[29]!==A||t[30]!==U||t[31]!==X||t[32]!==B||t[33]!==u||t[34]!==d||t[35]!==n){const Z=u?co(u.id):null;W=d?"Ask anything or @ for context":"Select a model to start chatting",J="flex flex-col gap-2 w-full min-h-42 justify-end",t[42]!==T||t[43]!==E||t[44]!==X?(k=T&&m.jsxs(Ls,{variant:"danger",title:"Error occurred",description:T.message,icon:m.jsx(Gu,{size:16}),onDismiss:E,children:[m.jsx(Me,{size:"sm",variant:"outline",onClick:X,className:"h-7 text-xs",children:"Fix in chat"}),m.jsx(Me,{size:"sm",variant:"outline",disabled:!0,className:"h-7 text-xs",children:"Report"})]}),t[42]=T,t[43]=E,t[44]=X,t[45]=k):k=t[45],t[46]!==b||t[47]!==A||t[48]!==U?(re=A&&A!=="stop"&&m.jsx(Ls,{variant:"warning",title:"Response incomplete",description:A==="length"?"Response reached the model's output limit. Different models have different limits. Try switching models or asking it to continue.":A==="content-filter"?"Response was filtered due to content policy.":A==="tool-calls"?"Response paused after tool execution to prevent infinite loops and save costs. Click continue to keep working.":`Response stopped unexpectedly: ${A}`,icon:m.jsx(Rd,{size:16}),onDismiss:b,children:m.jsx(Me,{size:"sm",variant:"outline",onClick:U,className:"h-7 text-xs",children:"Continue"})}),t[46]=b,t[47]=A,t[48]=U,t[49]=re):re=t[49],t[50]!==r||t[51]!==s||t[52]!==B||t[53]!==n?(V=r&&m.jsx(Ls,{variant:"default",title:"Editing message (click to view original)",description:r.originalMessageText,icon:m.jsx(no,{size:14}),onDismiss:()=>{s(),n("")},children:m.jsx(Me,{size:"sm",variant:"outline",onClick:B,className:"h-7 text-xs",children:"View original"})}),t[50]=r,t[51]=s,t[52]=B,t[53]=n,t[54]=V):V=t[54],K=ie("relative rounded-xl w-full flex flex-col",u&&"shadow-sm",Z?.bg),t[24]=r,t[25]=T,t[26]=s,t[27]=E,t[28]=b,t[29]=A,t[30]=U,t[31]=X,t[32]=B,t[33]=u,t[34]=d,t[35]=n,t[36]=W,t[37]=V,t[38]=K,t[39]=J,t[40]=k,t[41]=re}else W=t[36],V=t[37],K=t[38],J=t[39],k=t[40],re=t[41];let he;t[55]!==a||t[56]!==h||t[57]!==u||t[58]!==l?(he=u&&m.jsx(q0,{gatewayId:u.id,gateways:a,onGatewayChange:l,disabled:h}),t[55]=a,t[56]=h,t[57]=u,t[58]=l,t[59]=he):he=t[59];const N=!u&&"shadow-sm";let Ee;t[60]!==N?(Ee=ie("w-full relative rounded-xl min-h-[130px] flex flex-col border border-border bg-background",N),t[60]=N,t[61]=Ee):Ee=t[61];let ve;t[62]===Symbol.for("react.memo_cache_sentinel")?(ve={maxHeight:"164px"},t[62]=ve):ve=t[62];let fe;t[63]!==n?(fe=Z=>n(Z.target.value),t[63]=n,t[64]=fe):fe=t[64];const Ge=!d||h;let Ie;t[65]===Symbol.for("react.memo_cache_sentinel")?(Ie=ie("placeholder:text-muted-foreground resize-none focus-visible:ring-0 border-0 p-2 text-[15px]! min-h-[20px] w-full","rounded-none shadow-none","min-h-[20px] h-auto overflow-hidden"),t[65]=Ie):Ie=t[65];let Ne;t[66]!==P||t[67]!==e||t[68]!==W||t[69]!==fe||t[70]!==Ge?(Ne=m.jsx("div",{className:"relative flex flex-col gap-2 p-2.5 flex-1",children:m.jsx("div",{className:"overflow-y-auto relative flex-1",style:ve,children:m.jsx(wd,{rows:1,value:e,onChange:fe,onKeyDown:P,placeholder:W,disabled:Ge,className:Ie})})}),t[66]=P,t[67]=e,t[68]=W,t[69]=fe,t[70]=Ge,t[71]=Ne):Ne=t[71];let ye;t[72]!==a||t[73]!==h||t[74]!==u||t[75]!==l?(ye=!u&&m.jsx(g0,{selectedGatewayId:null,onGatewayChange:l,gateways:a,placeholder:"Agent",disabled:h}),t[72]=a,t[73]=h,t[74]=u,t[75]=l,t[76]=ye):ye=t[76];const Fe=d??void 0;let Re;t[77]!==o||t[78]!==f||t[79]!==Fe?(Re=m.jsx(L0,{selectedModel:Fe,onModelChange:f,modelsConnections:o,placeholder:"Model",variant:"borderless"}),t[77]=o,t[78]=f,t[79]=Fe,t[80]=Re):Re=t[80];let De;t[81]!==p?(De=m.jsx(Zo,{messages:p}),t[81]=p,t[82]=De):De=t[82];let Oe;t[83]!==ye||t[84]!==Re||t[85]!==De?(Oe=m.jsxs("div",{className:"flex items-center gap-2 min-w-0 overflow-hidden",children:[ye,Re,De]}),t[83]=ye,t[84]=Re,t[85]=De,t[86]=Oe):Oe=t[86];const Ue=h?"button":"submit";let Se;t[87]!==h||t[88]!==_?(Se=Z=>{h&&(Z.preventDefault(),Z.stopPropagation(),_())},t[87]=h,t[88]=_,t[89]=Se):Se=t[89];const He=R||h?"default":"ghost",We=!R&&!h,Tt=!R&&!h&&"bg-muted text-muted-foreground hover:bg-muted hover:text-muted-foreground cursor-not-allowed";let Je;t[90]!==Tt?(Je=ie("size-8 rounded-full transition-all",Tt),t[90]=Tt,t[91]=Je):Je=t[91];const qt=h?"Stop generating":"Send message (Enter)";let st;t[92]!==h?(st=h?m.jsx(uo,{size:20}):m.jsx(Ld,{size:20}),t[92]=h,t[93]=st):st=t[93];let dt;t[94]!==Ue||t[95]!==Se||t[96]!==He||t[97]!==We||t[98]!==Je||t[99]!==qt||t[100]!==st?(dt=m.jsx("div",{className:"flex items-center gap-1",children:m.jsx(Me,{type:Ue,onClick:Se,variant:He,size:"icon",disabled:We,className:Je,title:qt,children:st})}),t[94]=Ue,t[95]=Se,t[96]=He,t[97]=We,t[98]=Je,t[99]=qt,t[100]=st,t[101]=dt):dt=t[101];let it;t[102]!==Oe||t[103]!==dt?(it=m.jsxs("div",{className:"flex items-center justify-between p-2.5",children:[Oe,dt]}),t[102]=Oe,t[103]=dt,t[104]=it):it=t[104];let le;t[105]!==L||t[106]!==Ee||t[107]!==Ne||t[108]!==it?(le=m.jsx("div",{className:"p-0.5",children:m.jsxs("form",{onSubmit:L,className:Ee,children:[Ne,it]})}),t[105]=L,t[106]=Ee,t[107]=Ne,t[108]=it,t[109]=le):le=t[109];let D;t[110]!==he||t[111]!==le||t[112]!==K?(D=m.jsxs("div",{className:K,children:[he,le]}),t[110]=he,t[111]=le,t[112]=K,t[113]=D):D=t[113];let Y;return t[114]!==V||t[115]!==D||t[116]!==J||t[117]!==k||t[118]!==re?(Y=m.jsxs("div",{className:J,children:[k,re,V,D]}),t[114]=V,t[115]=D,t[116]=J,t[117]=k,t[118]=re,t[119]=Y):Y=t[119],Y}const G0={name:"mesh-chat",version:"1.0.0"};function W0(t){if(typeof window>"u")throw new Error("Gateway prompts require a browser environment.");const e=new URL(`/mcp/gateway/${t}`,window.location.origin);return new gd(e,{requestInit:{headers:{Accept:"application/json, text/event-stream","Content-Type":"application/json"}}})}async function Ko(t,e){const n=new md(G0),r=W0(t);try{return await n.connect(r),await e(n)}catch(s){const i=s instanceof Error?s.message:String(s);throw console.error(`[gateway-prompts] Error for gateway ${t}:`,s),new Error(`Failed to communicate with gateway: ${i}`)}finally{await n.close().catch(console.error)}}async function Q0(t){try{return(await Ko(t,n=>n.listPrompts())).prompts??[]}catch(e){return console.error("[gateway-prompts] Failed to list prompts:",e),[]}}async function X0(t,e,n){const r=n??{};return await Ko(t,s=>s.getPrompt({name:e,arguments:r}))}function Z0(t){const e=Q.c(7);let n;e[0]!==t?(n=je.gatewayPrompts(t),e[0]=t,e[1]=n):n=e[1];let r;e[2]!==t?(r=()=>Q0(t),e[2]=t,e[3]=r):r=e[3];let s;return e[4]!==n||e[5]!==r?(s={queryKey:n,queryFn:r,staleTime:6e4,retry:!1},e[4]=n,e[5]=r,e[6]=s):s=e[6],ui(s)}const Ia=3;function Jo(t){const e=Q.c(23),{prompt:n,onSelect:r,isSelected:s,isDisabled:i,isLoading:a}=t,u=n.description??n.name;let l;e[0]!==r||e[1]!==n?(l=()=>r(n),e[0]=r,e[1]=n,e[2]=l):l=e[2];const o=i||a,d=s&&"bg-accent/50 text-foreground",f=a&&"bg-accent/50 text-foreground",p=(i||a)&&"cursor-not-allowed hover:bg-accent/50";let h;e[3]!==d||e[4]!==f||e[5]!==p?(h=ie("px-3 py-1.5 text-xs text-muted-foreground hover:text-foreground border border-border rounded-full hover:bg-accent/50 transition-colors cursor-pointer flex items-center gap-1.5",d,f,p),e[3]=d,e[4]=f,e[5]=p,e[6]=h):h=e[6];const g=n.title??n.name;let _;if(e[7]!==g){let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=/_/g,e[9]=w):w=e[9],_=g.replace(w," "),e[7]=g,e[8]=_}else _=e[8];let T;e[10]!==a?(T=a&&m.jsx(Zu,{size:"xs"}),e[10]=a,e[11]=T):T=e[11];let E;e[12]!==l||e[13]!==o||e[14]!==h||e[15]!==_||e[16]!==T?(E=m.jsx(_n,{asChild:!0,children:m.jsxs("button",{type:"button",onClick:l,disabled:o,className:h,children:[_,T]})}),e[12]=l,e[13]=o,e[14]=h,e[15]=_,e[16]=T,e[17]=E):E=e[17];let A;e[18]!==u?(A=m.jsx(xn,{side:"bottom",className:"max-w-xs",children:m.jsx("p",{className:"text-xs",children:u})}),e[18]=u,e[19]=A):A=e[19];let b;return e[20]!==E||e[21]!==A?(b=m.jsxs(yn,{children:[E,A]}),e[20]=E,e[21]=A,e[22]=b):b=e[22],b}function K0(t){const e=Q.c(23),{prompts:n,onSelect:r,loadingPrompt:s,className:i}=t;if(n.length===0)return null;let a,u,l,o,d;if(e[0]!==i||e[1]!==s||e[2]!==r||e[3]!==n){const h=n.slice(0,Ia),g=n.slice(Ia),_=g.length>0,T=!!s;a=hi,d=300,e[9]!==i?(u=ie("flex flex-wrap items-center justify-center gap-2",i),e[9]=i,e[10]=u):u=e[10];let E;e[11]!==T||e[12]!==s?.name||e[13]!==r?(E=A=>m.jsx(Jo,{prompt:A,onSelect:r,isLoading:s?.name===A.name,isDisabled:T&&s?.name!==A.name},A.name),e[11]=T,e[12]=s?.name,e[13]=r,e[14]=E):E=e[14],l=h.map(E),o=_&&m.jsxs(lr,{children:[m.jsx(ur,{asChild:!0,children:m.jsxs("button",{type:"button",disabled:T,className:ie("size-7 flex items-center justify-center text-xs text-muted-foreground hover:text-foreground border border-border rounded-full hover:bg-accent/50 transition-colors cursor-pointer",T&&"opacity-60 cursor-not-allowed"),children:["+",g.length]})}),m.jsx(or,{side:"bottom",align:"center",className:"w-auto p-2",children:m.jsx("div",{className:"flex flex-col gap-1",children:g.map(A=>{const b=A.description??A.name,w=s?.name===A.name;return m.jsxs(yn,{children:[m.jsx(_n,{asChild:!0,children:m.jsxs("button",{type:"button",onClick:()=>r(A),disabled:T&&!w,className:ie("px-3 py-1.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent/50 rounded-md transition-colors cursor-pointer text-left flex items-center gap-1.5",w&&"bg-accent/50 text-foreground",T&&!w&&"opacity-60 cursor-not-allowed"),children:[(A.title??A.name).replace(/_/g," "),w&&m.jsx(Zu,{size:"xs"})]})}),m.jsx(xn,{side:"right",className:"max-w-xs",children:m.jsx("p",{className:"text-xs",children:b})})]},A.name)})})})]}),e[0]=i,e[1]=s,e[2]=r,e[3]=n,e[4]=a,e[5]=u,e[6]=l,e[7]=o,e[8]=d}else a=e[4],u=e[5],l=e[6],o=e[7],d=e[8];let f;e[15]!==u||e[16]!==l||e[17]!==o?(f=m.jsxs("div",{className:u,children:[l,o]}),e[15]=u,e[16]=l,e[17]=o,e[18]=f):f=e[18];let p;return e[19]!==a||e[20]!==d||e[21]!==f?(p=m.jsx(a,{delayDuration:d,children:f}),e[19]=a,e[20]=d,e[21]=f,e[22]=p):p=e[22],p}function J0(t){const e={};for(const n of t.arguments??[])e[n.name]=n.required?G().min(1,"Required"):G();return Te(e)}function ep(t){const e={};for(const n of t.arguments??[])e[n.name]="";return e}function tp(t){for(const e of t.messages??[]){if(e.role!=="user"||e.content?.type!=="text")continue;const n=e.content.text?.trim();if(n)return n}return null}function np(t){const e=Q.c(40),{prompt:n,onCancel:r,onSubmit:s}=t;let i;if(e[0]!==n){const M=J0(n);i=bd(M),e[0]=n,e[1]=i}else i=e[1];const u=i;let l;e[2]!==n?(l=ep(n),e[2]=n,e[3]=l):l=e[3];let o;e[4]!==u||e[5]!==l?(o={resolver:u,defaultValues:l,mode:"onChange"},e[4]=u,e[5]=l,e[6]=o):o=e[6];const d=Ed(o);let f;e[7]!==n.arguments?(f=n.arguments??[],e[7]=n.arguments,e[8]=f):f=e[8];const p=f;let h;e[9]!==r||e[10]!==n?(h=m.jsx(Jo,{prompt:n,onSelect:r,isSelected:!0}),e[9]=r,e[10]=n,e[11]=h):h=e[11];let g;e[12]!==n.description?(g=n.description?m.jsx("p",{className:"text-xs text-muted-foreground max-w-xl text-center",children:n.description}):null,e[12]=n.description,e[13]=g):g=e[13];let _;e[14]!==d||e[15]!==s?(_=d.handleSubmit(s),e[14]=d,e[15]=s,e[16]=_):_=e[16];let T;if(e[17]!==p||e[18]!==d.control){let M;e[20]!==d.control?(M=P=>m.jsx(Jd,{control:d.control,name:P.name,render:S=>{const{field:B}=S;return m.jsxs(ef,{children:[m.jsxs(tf,{className:"text-xs",children:[P.name,P.required?" *":""]}),m.jsx(nf,{children:m.jsx(fi,{...B,value:B.value??"",required:P.required,placeholder:P.description??"",className:"h-9"})}),P.description?m.jsx(rf,{className:"text-xs",children:P.description}):null,m.jsx(sf,{})]})}},P.name),e[20]=d.control,e[21]=M):M=e[21],T=p.map(M),e[17]=p,e[18]=d.control,e[19]=T}else T=e[19];let E;e[22]!==r?(E=m.jsx(Me,{type:"button",variant:"ghost",size:"sm",className:"h-8 px-3 text-xs",onClick:r,children:"Cancel"}),e[22]=r,e[23]=E):E=e[23];const A=!d.formState.isValid;let b;e[24]!==A?(b=m.jsx(Me,{type:"submit",size:"sm",className:"h-8 px-3 text-xs",disabled:A,children:"Use prompt"}),e[24]=A,e[25]=b):b=e[25];let w;e[26]!==E||e[27]!==b?(w=m.jsxs("div",{className:"flex justify-end gap-2",children:[E,b]}),e[26]=E,e[27]=b,e[28]=w):w=e[28];let R;e[29]!==w||e[30]!==_||e[31]!==T?(R=m.jsxs("form",{className:"w-full max-w-xl flex flex-col gap-3",onSubmit:_,autoComplete:"off",children:[T,w]}),e[29]=w,e[30]=_,e[31]=T,e[32]=R):R=e[32];let I;e[33]!==d||e[34]!==R?(I=m.jsx(Kd,{...d,children:R}),e[33]=d,e[34]=R,e[35]=I):I=e[35];let L;return e[36]!==I||e[37]!==h||e[38]!==g?(L=m.jsxs("div",{className:"flex flex-col items-center gap-3 w-full",children:[h,g,I]}),e[36]=I,e[37]=h,e[38]=g,e[39]=L):L=e[39],L}function rp(){const t=Q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsxs(m.Fragment,{children:[m.jsx($e,{className:"h-6 w-20 rounded-full border border-border"}),m.jsx($e,{className:"h-6 w-24 rounded-full border border-border"})]}),t[0]=e):e=t[0],e}function sp(t,e){switch(e.type){case"SELECT_PROMPT":return!e.prompt.arguments||e.prompt.arguments.length===0?{stage:"loading",prompt:e.prompt}:{stage:"collectingArguments",prompt:e.prompt};case"CANCEL":return{stage:"idle"};case"START_LOADING":return{stage:"loading",prompt:e.prompt,arguments:e.arguments};case"RESET":return{stage:"idle"};default:return t}}function ip({gatewayId:t}){const{setInputValue:e}=An(),{data:n}=Z0(t),[r,s]=j.useReducer(sp,{stage:"idle"});if(n.length===0)return null;const i=async(o,d)=>{try{const f=await X0(t,o.name,d),p=tp(f)??o.description??o.name;e(p),s({type:"RESET"})}catch(f){console.error("[ice-breakers] Failed to fetch prompt:",f),Kn.error("Failed to load prompt. Please try again."),s({type:"RESET"})}},a=async o=>{if(o.arguments&&o.arguments.length>0){s({type:"SELECT_PROMPT",prompt:o});return}s({type:"START_LOADING",prompt:o}),await i(o)},u=()=>{s({type:"CANCEL"})},l=async o=>{if(r.stage!=="collectingArguments")return;const{prompt:d}=r;s({type:"START_LOADING",prompt:d,arguments:o}),await i(d,o)};return m.jsx("div",{className:"relative w-full",children:r.stage==="collectingArguments"?m.jsx("div",{className:"animate-in fade-in-0 zoom-in-95 duration-300",children:m.jsx(np,{prompt:r.prompt,onCancel:u,onSubmit:l})},"expanded"):m.jsx("div",{className:"animate-in fade-in-0 zoom-in-95 duration-300",children:m.jsx(K0,{prompts:n,onSelect:a,loadingPrompt:r.stage==="loading"?r.prompt:null})},"list")})}function ap(t){const e=Q.c(8),{className:n}=t,{selectedGateway:r}=An();let s;e[0]!==n?(s=ie("flex flex-wrap items-center justify-center gap-2",n),e[0]=n,e[1]=s):s=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i={minHeight:"32px"},e[2]=i):i=e[2];let a;e[3]!==r?(a=r&&m.jsx(Od,{fallback:null,children:m.jsx(j.Suspense,{fallback:m.jsx(rp,{}),children:m.jsx(ip,{gatewayId:r.id})})},r.id),e[3]=r,e[4]=a):a=e[4];let u;return e[5]!==s||e[6]!==a?(u=m.jsx("div",{className:s,style:i,children:a}),e[5]=s,e[6]=a,e[7]=u):u=e[7],u}function up(){const t=Q.c(3),[e,n]=j.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=async a=>{await navigator.clipboard.writeText(a),n(!0),setTimeout(()=>n(!1),2e3)},t[0]=r):r=t[0];const s=r;let i;return t[1]!==e?(i={handleCopy:s,copied:e},t[1]=e,t[2]=i):i=t[2],i}function xi(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var rn=xi();function el(t){rn=t}var zn={exec:()=>null};function pe(t,e=""){let n=typeof t=="string"?t:t.source;const r={replace:(s,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(Ke.caret,"$1"),n=n.replace(s,a),r},getRegex:()=>new RegExp(n,e)};return r}var Ke={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},op=/^(?:[ \t]*(?:\n|$))+/,lp=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,cp=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,fr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,dp=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,_i=/(?:[*+-]|\d{1,9}[.)])/,tl=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,nl=pe(tl).replace(/bull/g,_i).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),fp=pe(tl).replace(/bull/g,_i).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),yi=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,hp=/^[^\n]+/,Ai=/(?!\s*\])(?:\\.|[^\[\]\\])+/,pp=pe(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ai).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),mp=pe(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,_i).getRegex(),Wr="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ki=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,gp=pe("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ki).replace("tag",Wr).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),rl=pe(yi).replace("hr",fr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Wr).getRegex(),bp=pe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",rl).getRegex(),Ci={blockquote:bp,code:lp,def:pp,fences:cp,heading:dp,hr:fr,html:gp,lheading:nl,list:mp,newline:op,paragraph:rl,table:zn,text:hp},Na=pe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",fr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Wr).getRegex(),Ep={...Ci,lheading:fp,table:Na,paragraph:pe(yi).replace("hr",fr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Na).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Wr).getRegex()},Tp={...Ci,html:pe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ki).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:zn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:pe(yi).replace("hr",fr).replace("heading",` *#{1,6} *[^
21
+ `)}function p0(){const t=Q.c(5),e=oi(),{org:n}=zt();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const s=Yu(r);let i;return t[1]!==n||t[2]!==s||t[3]!==e?(i=a=>{const l=a.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!l||!l[1])return;const o=l[1],d=s.connectionId;if(!d)return;e.invalidateQueries({queryKey:je.collection(n.slug,d,o)});const f=o.toLowerCase().replace(/_/g," ");Kn.success(`${f} updated`)},t[1]=n,t[2]=s,t[3]=e,t[4]=i):i=t[4],i}function qo(){const t=Q.c(2),e=Dd();let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function m0(t){const e=Q.c(24),{gateway:n,isSelected:r}=t,s=r&&"bg-accent";let i;e[0]!==s?(i=re("flex items-start gap-3 py-3 px-3 hover:bg-accent cursor-pointer rounded-xl transition-colors",s),e[0]=s,e[1]=i):i=e[1];let a;e[2]!==n.fallbackIcon?(a=n.fallbackIcon??m.jsx(di,{}),e[2]=n.fallbackIcon,e[3]=a):a=e[3];let u;e[4]!==n.icon||e[5]!==n.title||e[6]!==a?(u=m.jsx(ci,{icon:n.icon,name:n.title,size:"sm",fallbackIcon:a,className:"size-10 rounded-xl border border-stone-200/60 shadow-sm shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=a,e[7]=u):u=e[7];let l;e[8]!==n.title?(l=m.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=l):l=e[9];let o;e[10]!==r?(o=r&&m.jsx($r,{size:16,className:"text-foreground shrink-0"}),e[10]=r,e[11]=o):o=e[11];let d;e[12]!==l||e[13]!==o?(d=m.jsxs("div",{className:"flex items-center justify-between",children:[l,o]}),e[12]=l,e[13]=o,e[14]=d):d=e[14];let f;e[15]!==n.description?(f=n.description&&m.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1 leading-relaxed",children:n.description}),e[15]=n.description,e[16]=f):f=e[16];let p;e[17]!==d||e[18]!==f?(p=m.jsxs("div",{className:"flex flex-col flex-1 min-w-0 gap-0.5",children:[d,f]}),e[17]=d,e[18]=f,e[19]=p):p=e[19];let h;return e[20]!==i||e[21]!==u||e[22]!==p?(h=m.jsxs("div",{className:i,children:[u,p]}),e[20]=i,e[21]=u,e[22]=p,e[23]=h):h=e[23],h}function Vo(t){const e=Q.c(25),{gateways:n,selectedGatewayId:r,onGatewayChange:s,searchInputRef:i}=t,[a,u]=j.useState(""),l=j.useRef(null),o=i??l;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={navigateOnCreate:!0},e[0]=d):d=e[0];const{createGateway:f,isCreating:p}=$d(d);let h;e:{if(!a.trim()){h=n;break e}let P;if(e[1]!==n||e[2]!==a){const S=a.toLowerCase();P=n.filter(B=>B.title.toLowerCase().includes(S)||B.description?.toLowerCase().includes(S)),e[1]=n,e[2]=a,e[3]=P}else P=e[3];h=P}const g=h;let _;e[4]!==s?(_=P=>{s(P),u("")},e[4]=s,e[5]=_):_=e[5];const T=_;let E;e[6]===Symbol.for("react.memo_cache_sentinel")?(E=m.jsx(Yr,{size:16,className:"text-muted-foreground pointer-events-none shrink-0"}),e[6]=E):E=e[6];let A;e[7]===Symbol.for("react.memo_cache_sentinel")?(A=P=>u(P.target.value),e[7]=A):A=e[7];let b;e[8]!==o||e[9]!==a?(b=m.jsx(fi,{ref:o,type:"text",placeholder:"Search for an agent...",value:a,onChange:A,className:"flex-1 h-8 text-sm border-0 focus-visible:ring-0 focus-visible:ring-offset-0 shadow-none p-0"}),e[8]=o,e[9]=a,e[10]=b):b=e[10];const w=p?"Creating...":"Create Agent";let R;e[11]!==f||e[12]!==p||e[13]!==w?(R=m.jsx(Me,{onClick:f,variant:"outline",size:"sm",className:"h-8 px-3 rounded-lg text-sm font-medium shrink-0",disabled:p,children:w}),e[11]=f,e[12]=p,e[13]=w,e[14]=R):R=e[14];let I;e[15]!==b||e[16]!==R?(I=m.jsx("div",{className:"border-b px-4 py-3 bg-background/95 backdrop-blur sticky top-0 z-10",children:m.jsxs("div",{className:"relative flex items-center gap-2",children:[E,b,R]})}),e[15]=b,e[16]=R,e[17]=I):I=e[17];let L;e[18]!==g||e[19]!==T||e[20]!==r?(L=m.jsx("div",{className:"overflow-y-auto p-1.5",children:g.length>0?m.jsx("div",{className:"grid grid-cols-2 gap-0.5",children:g.map(P=>m.jsx("div",{role:"button",tabIndex:0,onClick:()=>T(P.id),onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),T(P.id))},className:"outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-xl",children:m.jsx(m0,{gateway:P,isSelected:P.id===r})},P.id))}):m.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No agents found"})}),e[18]=g,e[19]=T,e[20]=r,e[21]=L):L=e[21];let M;return e[22]!==L||e[23]!==I?(M=m.jsxs("div",{className:"flex flex-col max-h-[400px]",children:[I,L]}),e[22]=L,e[23]=I,e[24]=M):M=e[24],M}function g0(t){const e=Q.c(37),{selectedGatewayId:n,onGatewayChange:r,gateways:s,className:i,placeholder:a,showTooltip:u,disabled:l}=t,o=a===void 0?"Select Agent":a,d=u===void 0?!0:u,f=l===void 0?!1:l,[p,h]=j.useState(!1),g=j.useRef(null),_=qo(),T=s??_;let E,A;e[0]!==p?(E=()=>{p&&setTimeout(()=>{g.current?.focus()},0)},A=[p],e[0]=p,e[1]=E,e[2]=A):(E=e[1],A=e[2]),j.useEffect(E,A);let b;e[3]!==T||e[4]!==n?(b=n?T.find(se=>se.id===n):null,e[3]=T,e[4]=n,e[5]=b):b=e[5];const w=b;let R;e[6]!==r?(R=se=>{r(se),h(!1)},e[6]=r,e[7]=R):R=e[7];const I=R;let L;e[8]===Symbol.for("react.memo_cache_sentinel")?(L=se=>{h(se)},e[8]=L):L=e[8];const M=L,P=f?"cursor-not-allowed opacity-50":"cursor-pointer hover:bg-accent";let S;e[9]!==i||e[10]!==P?(S=re("flex items-center justify-center p-1 rounded-md transition-colors shrink-0",P,i),e[9]=i,e[10]=P,e[11]=S):S=e[11];let B;e[12]!==w?(B=w?m.jsx(ci,{icon:w.icon,name:w.title,size:"xs",fallbackIcon:w.fallbackIcon??m.jsx(di,{size:12}),className:"size-5 rounded-md"}):m.jsx("img",{src:"/favicon.svg",alt:"Default Agent",className:"size-5 rounded-md"}),e[12]=w,e[13]=B):B=e[13];let $;e[14]!==f||e[15]!==o||e[16]!==S||e[17]!==B?($=m.jsx("button",{type:"button",disabled:f,className:S,"aria-label":o,children:B}),e[14]=f,e[15]=o,e[16]=S,e[17]=B,e[18]=$):$=e[18];const X=$,q=f?!1:p,U=f?void 0:M;let W;e[19]!==X?(W=m.jsx(_n,{asChild:!0,children:m.jsx(ur,{asChild:!0,children:X})}),e[19]=X,e[20]=W):W=e[20];let V;e[21]!==p||e[22]!==w?.title||e[23]!==d?(V=d&&!p&&m.jsx(xn,{side:"top",className:"text-xs",children:w?.title??"Choose an agent to chat with"}),e[21]=p,e[22]=w?.title,e[23]=d,e[24]=V):V=e[24];let K;e[25]!==W||e[26]!==V?(K=m.jsx(hi,{children:m.jsxs(yn,{children:[W,V]})}),e[25]=W,e[26]=V,e[27]=K):K=e[27];let J;e[28]!==T||e[29]!==I||e[30]!==n?(J=m.jsx(or,{className:"w-[550px] p-0 overflow-hidden",align:"start",side:"top",sideOffset:8,children:m.jsx(Vo,{gateways:T,selectedGatewayId:n,onGatewayChange:I,searchInputRef:g})}),e[28]=T,e[29]=I,e[30]=n,e[31]=J):J=e[31];let k;return e[32]!==q||e[33]!==U||e[34]!==K||e[35]!==J?(k=m.jsxs(lr,{open:q,onOpenChange:U,children:[K,J]}),e[32]=q,e[33]=U,e[34]=K,e[35]=J,e[36]=k):k=e[36],k}const b0=["x-ai/grok-code-fast-1","anthropic/claude-sonnet-4.5","google/gemini-2.5-flash","xiaomi/mimo-v2-flash:free","google/gemini-3-flash-preview","deepseek/deepseek-v3.2","anthropic/claude-opus-4.5","x-ai/grok-4.1-fast","google/gemini-2.5-flash-lite","google/gemini-2.0-flash-001"],js=new Map;b0.forEach((t,e)=>{js.set(t,e)});function Ti(t){const e=Q.c(3);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={pageSize:999},e[0]=n):n=e[0];const r=u0(t??void 0,n);let s;return e[1]!==r?(s=r.filter(T0).sort(E0),e[1]=r,e[2]=s):s=e[2],s}function E0(t,e){const n=js.get(t.id),r=js.get(e.id);return n!==void 0&&r!==void 0?n-r:n!==void 0?-1:r!==void 0?1:t.title.localeCompare(e.title)}function T0(t){return t.limits?.contextWindow&&t.limits?.maxOutputTokens}const x0={reasoning:{icon:m.jsx(qr,{className:"size-4"}),label:"Reasoning"},"image-upload":{icon:m.jsx(Zd,{className:"size-4"}),label:"Can analyze images"},"file-upload":{icon:m.jsx(Qd,{className:"size-4"}),label:"Can analyze files"},"web-search":{icon:m.jsx(Yr,{className:"size-4"}),label:"Can search the web to answer questions"}};function Go(t){const e=Q.c(10),{capability:n}=t,r=x0[n];let s,i;e[0]!==n||e[1]!==r?(s=r||{icon:null,label:n},i=s.label.split("-").map(_0).join(" "),e[0]=n,e[1]=r,e[2]=s,e[3]=i):(s=e[2],i=e[3]);const a=i;let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u={backgroundColor:"color-mix(in oklch, var(--chart-1) 15%, transparent)",color:"var(--chart-1)"},e[4]=u):u=e[4];let l;e[5]!==a?(l=m.jsx("span",{children:a}),e[5]=a,e[6]=l):l=e[6];let o;return e[7]!==s.icon||e[8]!==l?(o=m.jsxs("div",{className:"flex items-center gap-1.5 py-0.5 px-1.5 rounded-md text-xs font-medium",style:u,children:[s.icon,l]}),e[7]=s.icon,e[8]=l,e[9]=o):o=e[9],o}function _0(t){return t.charAt(0).toUpperCase()+t.slice(1)}function y0(t){const e=Q.c(53),{model:n,compact:r}=t,s=r===void 0?!1:r;if(!n){let T;return e[0]===Symbol.for("react.memo_cache_sentinel")?(T=m.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),e[0]=T):T=e[0],T}const i=n.limits?.contextWindow||n.costs?.input||n.costs?.output||n.limits?.maxOutputTokens;if(!i&&!s){let T;e[1]!==n.logo||e[2]!==n.title?(T=n.logo&&m.jsx("img",{src:n.logo,className:"w-6 h-6",alt:n.title}),e[1]=n.logo,e[2]=n.title,e[3]=T):T=e[3];let E;e[4]!==n.title?(E=m.jsx("p",{className:"text-lg font-medium leading-7",children:n.title}),e[4]=n.title,e[5]=E):E=e[5];let A;e[6]!==T||e[7]!==E?(A=m.jsxs("div",{className:"flex items-center gap-3 py-2 px-0",children:[T,E]}),e[6]=T,e[7]=E,e[8]=A):A=e[8];let b;e[9]!==n.description?(b=n.description&&m.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[9]=n.description,e[10]=b):b=e[10];let w;return e[11]!==A||e[12]!==b?(w=m.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[A,b]}),e[11]=A,e[12]=b,e[13]=w):w=e[13],w}if(!i&&s)return null;if(s){let T;e[14]!==n.limits?(T=n.limits?.contextWindow&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Context"}),m.jsxs("span",{className:"text-foreground font-medium",children:[n.limits.contextWindow.toLocaleString()," tokens"]})]}),e[14]=n.limits,e[15]=T):T=e[15];let E;e[16]!==n.costs?(E=n.costs?.input&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Input cost"}),m.jsxs("span",{className:"text-foreground font-medium",children:["$",n.costs.input.toFixed(2)," / 1M"]})]}),e[16]=n.costs,e[17]=E):E=e[17];let A;e[18]!==n.costs?(A=n.costs?.output&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Output cost"}),m.jsxs("span",{className:"text-foreground font-medium",children:["$",n.costs.output.toFixed(2)," / 1M"]})]}),e[18]=n.costs,e[19]=A):A=e[19];let b;e[20]!==n.limits?(b=n.limits?.maxOutputTokens&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Output limit"}),m.jsxs("span",{className:"text-foreground font-medium",children:[n.limits.maxOutputTokens.toLocaleString()," tokens"]})]}),e[20]=n.limits,e[21]=b):b=e[21];let w;return e[22]!==T||e[23]!==E||e[24]!==A||e[25]!==b?(w=m.jsxs("div",{className:"flex flex-col gap-2.5 pt-3 pb-3 px-3 rounded-b-lg text-xs",children:[T,E,A,b]}),e[22]=T,e[23]=E,e[24]=A,e[25]=b,e[26]=w):w=e[26],w}let a;e[27]!==n.logo||e[28]!==n.title?(a=n.logo&&m.jsx("img",{src:n.logo,className:"w-6 h-6 shrink-0",alt:n.title}),e[27]=n.logo,e[28]=n.title,e[29]=a):a=e[29];let u;e[30]!==n.title?(u=m.jsx("p",{className:"text-lg font-medium leading-7 wrap-break-word min-w-0",children:n.title}),e[30]=n.title,e[31]=u):u=e[31];let l;e[32]!==a||e[33]!==u?(l=m.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[a,u]}),e[32]=a,e[33]=u,e[34]=l):l=e[34];let o;e[35]!==n.capabilities?(o=n.capabilities&&n.capabilities.length>0&&m.jsx("div",{className:"flex items-center gap-2",children:n.capabilities.map(A0)}),e[35]=n.capabilities,e[36]=o):o=e[36];let d;e[37]!==l||e[38]!==o?(d=m.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[l,o]}),e[37]=l,e[38]=o,e[39]=d):d=e[39];let f;e[40]!==n.limits?(f=n.limits?.contextWindow&&m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(Xd,{className:"w-3.5 h-3.5 text-muted-foreground"}),m.jsx("p",{className:"text-sm text-foreground",children:"Context window"})]}),m.jsxs("p",{className:"text-sm text-muted-foreground",children:[n.limits.contextWindow.toLocaleString()," tokens"]})]}),e[40]=n.limits,e[41]=f):f=e[41];let p;e[42]!==n.costs?(p=(n.costs?.input||n.costs?.output)&&m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(ro,{className:"w-3.5 h-3.5 text-muted-foreground"}),m.jsx("p",{className:"text-sm text-foreground",children:"Costs"})]}),m.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.costs?.input!==null&&n.costs?.input!==void 0&&m.jsxs("p",{className:"text-sm text-muted-foreground",children:["$",n.costs.input.toFixed(2)," / 1M tokens (input)"]}),n.costs?.output!==null&&n.costs?.output!==void 0&&m.jsxs("p",{className:"text-sm text-muted-foreground",children:["$",n.costs.output.toFixed(2)," / 1M tokens (output)"]})]})]}),e[42]=n.costs,e[43]=p):p=e[43];let h;e[44]!==n.limits?(h=n.limits?.maxOutputTokens&&m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(ao,{className:"w-4.5 h-4.5 text-muted-foreground/70"}),m.jsx("p",{className:"text-sm text-foreground",children:"Output limit"})]}),m.jsxs("p",{className:"text-sm text-muted-foreground",children:[n.limits.maxOutputTokens.toLocaleString()," token limit"]})]}),e[44]=n.limits,e[45]=h):h=e[45];let g;e[46]!==f||e[47]!==p||e[48]!==h?(g=m.jsxs("div",{className:"flex flex-col gap-4",children:[f,p,h]}),e[46]=f,e[47]=p,e[48]=h,e[49]=g):g=e[49];let _;return e[50]!==g||e[51]!==d?(_=m.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[d,g]}),e[50]=g,e[51]=d,e[52]=_):_=e[52],_}function A0(t){return m.jsx(Go,{capability:t},t)}function k0(t){const e=Q.c(15),{model:n,onHover:r}=t;let s;e[0]!==n||e[1]!==r?(s=()=>r(n),e[0]=n,e[1]=r,e[2]=s):s=e[2];let i;e[3]!==n.logo||e[4]!==n.title?(i=n.logo&&m.jsx("img",{src:n.logo,className:"w-5 h-5 shrink-0",alt:n.title}),e[3]=n.logo,e[4]=n.title,e[5]=i):i=e[5];let a;e[6]!==n.title?(a=m.jsx("span",{className:"text-sm text-foreground flex-1 min-w-0 line-clamp-1",children:n.title}),e[6]=n.title,e[7]=a):a=e[7];let u;e[8]!==n.capabilities?(u=n.capabilities&&n.capabilities.length>0&&m.jsx("div",{className:"flex items-center gap-1.5 shrink-0",children:n.capabilities.slice(0,2).map(C0)}),e[8]=n.capabilities,e[9]=u):u=e[9];let l;return e[10]!==s||e[11]!==i||e[12]!==a||e[13]!==u?(l=m.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:s,children:[i,a,u]}),e[10]=s,e[11]=i,e[12]=a,e[13]=u,e[14]=l):l=e[14],l}function C0(t){return m.jsx(Go,{capability:t},t)}function I0(t){const e=Q.c(10),{model:n,placeholder:r}=t,s=r===void 0?"Select model":r;if(!n){let l;return e[0]!==s?(l=m.jsx("span",{className:"text-sm text-muted-foreground",children:s}),e[0]=s,e[1]=l):l=e[1],l}let i;e[2]!==n.logo||e[3]!==n.title?(i=n.logo&&m.jsx("img",{src:n.logo,className:"w-5 h-5 shrink-0 rounded-sm",alt:n.title}),e[2]=n.logo,e[3]=n.title,e[4]=i):i=e[4];let a;e[5]!==n.title?(a=m.jsx("span",{className:"text-sm text-muted-foreground group-hover:text-foreground transition-colors truncate min-w-0 hidden sm:inline-block",children:n.title}),e[5]=n.title,e[6]=a):a=e[6];let u;return e[7]!==i||e[8]!==a?(u=m.jsxs("div",{className:"flex items-center gap-2 min-w-0 overflow-hidden",children:[i,a]}),e[7]=i,e[8]=a,e[9]=u):u=e[9],u}function N0(){const t=Q.c(6);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:m.jsxs("div",{className:"flex items-center gap-2.5 h-12 px-4",children:[m.jsx($e,{className:"size-4 shrink-0"}),m.jsx($e,{className:"flex-1 h-6"}),m.jsx($e,{className:"w-[140px] h-8 shrink-0"})]})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[400px] md:min-w-[400px]",children:[e,m.jsx("div",{className:"flex-1 overflow-y-auto px-0.5 pt-2 space-y-1",children:Array.from({length:6}).map(S0)})]}),t[1]=n):n=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[m.jsx($e,{className:"size-6 shrink-0"}),m.jsx($e,{className:"h-6 w-32"})]}),t[2]=r):r=t[2];let s;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[r,m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx($e,{className:"h-6 w-20 rounded-md"}),m.jsx($e,{className:"h-6 w-24 rounded-md"})]})]}),t[3]=s):s=t[3];let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsx($e,{className:"h-4 w-24"}),m.jsx($e,{className:"h-4 w-32"})]}),t[4]=i):i=t[4];let a;return t[5]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsxs("div",{className:"flex flex-col md:flex-row h-[350px]",children:[n,m.jsx("div",{className:"hidden md:block md:w-[320px] md:shrink-0 p-3",children:m.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[s,m.jsxs("div",{className:"flex flex-col gap-4",children:[i,m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsx($e,{className:"h-4 w-16"}),m.jsx($e,{className:"h-4 w-40"})]})]})]})})]}),t[5]=a):a=t[5],a}function S0(t,e){return m.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[m.jsx($e,{className:"size-5 shrink-0 rounded-sm"}),m.jsx($e,{className:"flex-1 h-4"}),m.jsx($e,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function w0(t){const e=Q.c(39),{selectedModel:n,onModelChange:r,onClose:s,modelsConnections:i}=t,[a,u]=j.useState(null),[l,o]=j.useState(""),d=j.useRef(null),[f,p]=j.useState(n?.connectionId??null),h=bi(),g=i??h,_=Ti(f);let T,E;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=()=>{setTimeout(()=>{d.current?.focus()},0)},E=[],e[0]=T,e[1]=E):(T=e[0],E=e[1]),j.useEffect(T,E);let A;e[2]!==_||e[3]!==l?(A=l.trim()?_.filter(J=>{const k=l.toLowerCase();return J.title.toLowerCase().includes(k)||J.provider?.toLowerCase().includes(k)||J.description?.toLowerCase().includes(k)}):_,e[2]=_,e[3]=l,e[4]=A):A=e[4];const b=A;let w;e[5]===Symbol.for("react.memo_cache_sentinel")?(w=J=>{p(J)},e[5]=w):w=e[5];const R=w;let I;e[6]!==_||e[7]!==s||e[8]!==r||e[9]!==f?(I=J=>{const k=_.find(se=>se.id===J);!k||!f||(r({id:k.id,connectionId:f,provider:k.provider??void 0}),o(""),s())},e[6]=_,e[7]=s,e[8]=r,e[9]=f,e[10]=I):I=e[10];const L=I;let M;e[11]===Symbol.for("react.memo_cache_sentinel")?(M=m.jsx(Yr,{size:16,className:"text-muted-foreground shrink-0"}),e[11]=M):M=e[11];let P;e[12]===Symbol.for("react.memo_cache_sentinel")?(P=J=>o(J.target.value),e[12]=P):P=e[12];let S;e[13]!==l?(S=m.jsx(fi,{ref:d,type:"text",placeholder:"Search for a model...",value:l,onChange:P,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[13]=l,e[14]=S):S=e[14];let B;e[15]!==g||e[16]!==f?(B=g.length>0&&m.jsxs(Yd,{value:f??"",onValueChange:R,children:[m.jsxs(qd,{size:"sm",className:"w-auto min-w-[140px] h-8 shrink-0 [&>svg:last-child]:hidden",onClick:O0,children:[m.jsx(Vd,{placeholder:"Select connection"}),m.jsx(eo,{className:"size-4 opacity-50 shrink-0 pointer-events-none"})]}),m.jsx(Gd,{children:g.map(R0)})]}),e[15]=g,e[16]=f,e[17]=B):B=e[17];let $;e[18]!==S||e[19]!==B?($=m.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:m.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 cursor-text",children:[M,S,B]})}),e[18]=S,e[19]=B,e[20]=$):$=e[20];let X;e[21]!==b||e[22]!==L||e[23]!==n?.id?(X=b.length>0?b.map(J=>{const k=J.id===n?.id;return m.jsx("div",{onClick:()=>L(J.id),className:re("rounded-lg mb-1",k&&"bg-accent"),children:m.jsx(k0,{model:J,onHover:u})},J.id)}):m.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No models found"}),e[21]=b,e[22]=L,e[23]=n?.id,e[24]=X):X=e[24];let q;e[25]!==X?(q=m.jsx("div",{className:"flex-1 overflow-y-auto px-0.5 pt-2",children:X}),e[25]=X,e[26]=q):q=e[26];let U;e[27]!==$||e[28]!==q?(U=m.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[400px] md:min-w-[400px]",children:[$,q]}),e[27]=$,e[28]=q,e[29]=U):U=e[29];let W;e[30]!==a||e[31]!==_||e[32]!==n?(W=a||(n?_.find(J=>J.id===n.id):null)||null,e[30]=a,e[31]=_,e[32]=n,e[33]=W):W=e[33];let V;e[34]!==W?(V=m.jsx("div",{className:"hidden md:block md:w-[320px] md:shrink-0 p-3",children:m.jsx(y0,{model:W})}),e[34]=W,e[35]=V):V=e[35];let K;return e[36]!==U||e[37]!==V?(K=m.jsxs("div",{className:"flex flex-col md:flex-row h-[350px]",children:[U,V]}),e[36]=U,e[37]=V,e[38]=K):K=e[38],K}function R0(t){return m.jsx(Wd,{value:t.id,children:m.jsxs("div",{className:"flex items-center gap-2",children:[t.icon?m.jsx("img",{src:t.icon,alt:t.title,className:"w-4 h-4 rounded"}):m.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:t.title.slice(0,1).toUpperCase()}),m.jsx("span",{children:t.title})]})},t.id)}function O0(t){return t.stopPropagation()}function L0(t){const e=Q.c(23),{selectedModel:n,onModelChange:r,modelsConnections:s,variant:i,className:a,placeholder:u}=t,l=i===void 0?"borderless":i,o=u===void 0?"Select model":u,[d,f]=j.useState(!1),p=bi(),h=s??p,g=n?.connectionId??null,_=Ti(g);let T;e[0]!==_||e[1]!==n?(T=n?_.find(B=>B.id===n.id):void 0,e[0]=_,e[1]=n,e[2]=T):T=e[2];const E=T;if(h.length===0)return null;const A=l==="borderless"?"ghost":"outline",b=l==="borderless"&&"md:border-none";let w;e[3]!==a||e[4]!==b?(w=re("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 shrink justify-start overflow-hidden",b,a),e[3]=a,e[4]=b,e[5]=w):w=e[5];let R;e[6]!==E||e[7]!==o?(R=m.jsx(I0,{model:E,placeholder:o}),e[6]=E,e[7]=o,e[8]=R):R=e[8];let I;e[9]!==A||e[10]!==w||e[11]!==R?(I=m.jsx(ur,{asChild:!0,children:m.jsx(Me,{variant:A,size:"sm",className:w,children:R})}),e[9]=A,e[10]=w,e[11]=R,e[12]=I):I=e[12];let L;e[13]===Symbol.for("react.memo_cache_sentinel")?(L=m.jsx(N0,{}),e[13]=L):L=e[13];let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M=()=>f(!1),e[14]=M):M=e[14];let P;e[15]!==h||e[16]!==r||e[17]!==n?(P=m.jsx(or,{className:"w-full md:w-auto p-0",align:"start",side:"bottom",sideOffset:8,children:m.jsx(j.Suspense,{fallback:L,children:m.jsx(w0,{selectedModel:n,onModelChange:r,onClose:M,modelsConnections:h})})}),e[15]=h,e[16]=r,e[17]=n,e[18]=P):P=e[18];let S;return e[19]!==d||e[20]!==P||e[21]!==I?(S=m.jsxs(lr,{open:d,onOpenChange:f,children:[I,P]}),e[19]=d,e[20]=P,e[21]=I,e[22]=S):S=e[22],S}const v0=t=>new Bo({api:`/api/${t}/models/stream`,credentials:"include",prepareSendMessagesRequest:({messages:e,requestMetadata:n={}})=>{const{system:r,...s}=n,i=r?{id:crypto.randomUUID(),role:"system",parts:[{type:"text",text:r}]}:null;return{body:{messages:i?[i,...e]:e,stream:!0,...s}}}}),Ca=(t,e)=>t?.find(n=>n.id===e)??t?.[0]??null,D0=(t,e)=>{const n=Q.c(14);let r;n[0]!==t?(r=Qu.chatSelectedModel(t),n[0]=t,n[1]=r):r=n[1];const[s,i]=vs(r,null),a=s?.connectionId;let u;n[2]!==e||n[3]!==a?(u=Ca(e,a),n[2]=e,n[3]=a,n[4]=u):u=n[4];const l=u,o=Ti(l?.id??null),d=s?.id;let f;n[5]!==o||n[6]!==d?(f=Ca(o,d),n[5]=o,n[6]=d,n[7]=f):f=n[7];const p=f;let h;n[8]!==l||n[9]!==p?(h=p&&l?.id?{id:p.id,provider:p.provider,limits:p.limits,connectionId:l.id}:null,n[8]=l,n[9]=p,n[10]=h):h=n[10];const g=h;let _;return n[11]!==g||n[12]!==i?(_=[g,i],n[11]=g,n[12]=i,n[13]=_):_=n[13],_},Wo={inputValue:"",branchContext:null,finishReason:null};function P0(t,e){switch(e.type){case"SET_INPUT":return{...t,inputValue:e.payload};case"START_BRANCH":return{...t,branchContext:e.payload};case"CLEAR_BRANCH":return{...t,branchContext:null};case"SET_FINISH_REASON":return{...t,finishReason:e.payload};case"CLEAR_FINISH_REASON":return{...t,finishReason:null};case"RESET":return Wo;default:return t}}const Qo=j.createContext(null),Xo=()=>crypto.randomUUID();function M0(t){const e=Q.c(75),{children:n}=t,{locator:r,org:s}=zt(),{data:i}=qu.useSession(),a=i?.user??null,[u,l]=j.useReducer(P0,Wo),o=$o(),d=Yo(),{threads:f}=zo(),[p,h]=vs(Qu.threadManagerState(r)+":active-id",j0),g=f0(p),_=qo(),[T,E]=vs(`${r}:selected-gateway-id`,null),A=bi(),[b,w]=D0(r,A),R=h0(T),I=p0();let L;e[0]!==p||e[1]!==f?(L=f.find(le=>le.id===p)??null,e[0]=p,e[1]=f,e[2]=L):L=e[2];const M=L;let P;e[3]!==_||e[4]!==T?(P=T?_.find(le=>le.id===T)??null:null,e[3]=_,e[4]=T,e[5]=P):P=e[5];const S=P;let B;e[6]!==s.slug?(B=v0(s.slug),e[6]=s.slug,e[7]=B):B=e[7];const $=B;let X;e[8]!==p||e[9]!==r||e[10]!==d||e[11]!==S?.id||e[12]!==o?(X=async le=>{const{finishReason:D,messages:Y,isAbort:Z,isDisconnect:ue,isError:me}=le;if(l({type:"SET_FINISH_REASON",payload:D??null}),D!=="stop"||Z||ue||me)return;const ze=Y.slice(-2).filter(Boolean);if(ze.length!==2){console.warn("[chat] Expected 2 messages, got",ze.length);return}d.insertMany.mutate(ze);const xt=ze.find(U0)?.parts?.find(F0)?.text.slice(0,100)||"",at=await c0(r,p);if(!at){const vt=new Date().toISOString(),Vt={id:p,title:xt,created_at:vt,updated_at:vt,hidden:!1,gatewayId:S?.id};o.insert.mutate(Vt);return}o.update.mutate({id:p,updates:{title:at.title||xt,gatewayId:at.gatewayId||S?.id,updated_at:new Date().toISOString()}})},e[8]=p,e[9]=r,e[10]=d,e[11]=S?.id,e[12]=o,e[13]=X):X=e[13];const q=X,U=B0;let W;e[14]!==p||e[15]!==q||e[16]!==I||e[17]!==g||e[18]!==$?(W={id:p,messages:g,transport:$,onFinish:q,onToolCall:I,onError:U},e[14]=p,e[15]=q,e[16]=I,e[17]=g,e[18]=$,e[19]=W):W=e[19];const V=a0(W),K=V.status==="submitted"||V.status==="streaming",J=V.messages.length===0;let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=le=>l({type:"SET_INPUT",payload:le}),e[20]=k):k=e[20];const se=k;let he;e[21]===Symbol.for("react.memo_cache_sentinel")?(he=le=>l({type:"START_BRANCH",payload:le}),e[21]=he):he=e[21];const N=he;let Ee;e[22]===Symbol.for("react.memo_cache_sentinel")?(Ee=()=>l({type:"CLEAR_BRANCH"}),e[22]=Ee):Ee=e[22];const ve=Ee;let fe;e[23]===Symbol.for("react.memo_cache_sentinel")?(fe=()=>l({type:"RESET"}),e[23]=fe):fe=e[23];const Ge=fe;let Ie;e[24]!==h||e[25]!==o?(Ie=le=>{const D=le?.id||crypto.randomUUID(),Y=new Date().toISOString(),Z={id:D,title:le?.title||"",created_at:le?.created_at||Y,updated_at:le?.updated_at||Y,hidden:le?.hidden??!1,gatewayId:le?.gatewayId};return o.insert.mutate(Z),h(D),Z},e[24]=h,e[25]=o,e[26]=Ie):Ie=e[26];const Ne=Ie;let ye;e[27]!==p||e[28]!==h||e[29]!==o?(ye=le=>{o.update.mutate({id:le,updates:{hidden:!0,updated_at:new Date().toISOString()}}),p===le&&h(Xo())},e[27]=p,e[28]=h,e[29]=o,e[30]=ye):ye=e[30];const Fe=ye;let Re;e[31]!==E?(Re=le=>{E(le)},e[31]=E,e[32]=Re):Re=e[32];const De=Re;let Oe;e[33]!==w?(Oe=le=>{w({id:le.id,connectionId:le.connectionId})},e[33]=w,e[34]=Oe):Oe=e[34];const Ue=Oe;let Se;e[35]!==p||e[36]!==V||e[37]!==R||e[38]!==K||e[39]!==S?.id||e[40]!==b||e[41]!==a?.image||e[42]!==a?.name?(Se=async le=>{if(!b){Kn.error("No model configured");return}if(!le?.trim()||K)return;se(""),ve(),l({type:"CLEAR_FINISH_REASON"});const D={created_at:new Date().toISOString(),thread_id:p,system:R,model:{id:b.id,connectionId:b.connectionId,provider:b.provider??void 0,limits:b.limits??void 0},gateway:{id:S?.id??null},user:{avatar:a?.image??void 0,name:a?.name??"you"}};await V.sendMessage({id:crypto.randomUUID(),role:"user",parts:[{type:"text",text:le}],metadata:D},{metadata:D})},e[35]=p,e[36]=V,e[37]=R,e[38]=K,e[39]=S?.id,e[40]=b,e[41]=a?.image,e[42]=a?.name,e[43]=Se):Se=e[43];const He=Se;let We;e[44]!==V?(We=()=>V.stop(),e[44]=V,e[45]=We):We=e[45];const Tt=We;let Je;e[46]===Symbol.for("react.memo_cache_sentinel")?(Je=()=>l({type:"CLEAR_FINISH_REASON"}),e[46]=Je):Je=e[46];const qt=Je;let st;e[47]!==M||e[48]!==p||e[49]!==V.clearError||e[50]!==V.error||e[51]!==V.messages||e[52]!==V.setMessages||e[53]!==V.status||e[54]!==u.branchContext||e[55]!==u.finishReason||e[56]!==u.inputValue||e[57]!==Ne||e[58]!==_||e[59]!==Fe||e[60]!==J||e[61]!==K||e[62]!==A||e[63]!==S||e[64]!==b||e[65]!==He||e[66]!==h||e[67]!==De||e[68]!==Ue||e[69]!==Tt||e[70]!==f?(st={inputValue:u.inputValue,branchContext:u.branchContext,setInputValue:se,startBranch:N,clearBranch:ve,resetInteraction:Ge,activeThreadId:p,activeThread:M,threads:f,createThread:Ne,setActiveThreadId:h,hideThread:Fe,gateways:_,selectedGateway:S,setGatewayId:De,modelsConnections:A,selectedModel:b,setSelectedModel:Ue,messages:V.messages,chatStatus:V.status,isStreaming:K,isChatEmpty:J,sendMessage:He,stopStreaming:Tt,setMessages:V.setMessages,chatError:V.error,clearChatError:V.clearError,finishReason:u.finishReason,clearFinishReason:qt},e[47]=M,e[48]=p,e[49]=V.clearError,e[50]=V.error,e[51]=V.messages,e[52]=V.setMessages,e[53]=V.status,e[54]=u.branchContext,e[55]=u.finishReason,e[56]=u.inputValue,e[57]=Ne,e[58]=_,e[59]=Fe,e[60]=J,e[61]=K,e[62]=A,e[63]=S,e[64]=b,e[65]=He,e[66]=h,e[67]=De,e[68]=Ue,e[69]=Tt,e[70]=f,e[71]=st):st=e[71];const dt=st;let it;return e[72]!==n||e[73]!==dt?(it=m.jsx(Qo.Provider,{value:dt,children:n}),e[72]=n,e[73]=dt,e[74]=it):it=e[74],it}function B0(t){console.error("[chat] Chat error:",t)}function F0(t){return t.type==="text"}function U0(t){return t.parts?.find(H0)}function H0(t){return t.type==="text"}function j0(t){return t||Xo()}function An(){const t=j.useContext(Qo);if(!t)throw new Error("useChat must be used within a ChatProvider");return t}const z0={openrouter:t=>{const e=t?.openrouter;return typeof e=="object"&&e!==null&&"usage"in e&&typeof e.usage=="object"&&e.usage!==null&&"cost"in e.usage&&typeof e.usage.cost=="number"?e.usage.cost:null}};function $0(t){if(!t?.providerMetadata)return null;for(const e of Object.values(z0)){const n=e(t.providerMetadata);if(n!==null)return n}return null}function Y0(t){return t.reduce((e,n)=>{const r=n.metadata?.usage;return r?{inputTokens:e.inputTokens+(r.inputTokens??0),outputTokens:e.outputTokens+(r.outputTokens??0),totalTokens:e.totalTokens+(r.totalTokens??0),cost:e.cost+($0(r)??0)}:e},{inputTokens:0,outputTokens:0,totalTokens:0,cost:0})}function Zo(t){const e=Q.c(38),{messages:n}=t;let r,s,i,a,u,l,o,d,f,p,h,g;if(e[0]!==n){g=Symbol.for("react.early_return_sentinel");e:{const w=Y0(n);if(!w){g=null;break e}const{totalTokens:R,inputTokens:I,outputTokens:L,cost:M}=w;if(i=M,!R&&!I&&!L){g=null;break e}s=yn;let P;e[13]===Symbol.for("react.memo_cache_sentinel")?(P=m.jsx(to,{size:12}),e[13]=P):P=e[13];const S=m.jsxs(Me,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground pl-1! h-6 gap-1 whitespace-nowrap shrink-0",children:[P,m.jsx("span",{className:"text-[10px] font-mono tabular-nums",children:R.toLocaleString()})]});e[14]!==S?(h=m.jsx(_n,{asChild:!0,children:S}),e[14]=S,e[15]=h):h=e[15],r=xn,f="top",p="font-mono text-[11px]",u="grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",e[16]===Symbol.for("react.memo_cache_sentinel")?(l=m.jsx("span",{className:"text-muted",children:"in"}),e[16]=l):l=e[16],o=m.jsx("span",{children:I.toLocaleString()}),e[17]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsx("span",{className:"text-muted",children:"out"}),e[17]=d):d=e[17],a=L.toLocaleString()}e[0]=n,e[1]=r,e[2]=s,e[3]=i,e[4]=a,e[5]=u,e[6]=l,e[7]=o,e[8]=d,e[9]=f,e[10]=p,e[11]=h,e[12]=g}else r=e[1],s=e[2],i=e[3],a=e[4],u=e[5],l=e[6],o=e[7],d=e[8],f=e[9],p=e[10],h=e[11],g=e[12];if(g!==Symbol.for("react.early_return_sentinel"))return g;let _;e[18]!==a?(_=m.jsx("span",{children:a}),e[18]=a,e[19]=_):_=e[19];let T;e[20]!==i?(T=i>0&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-muted",children:"cost"}),m.jsxs("span",{children:["$",i.toFixed(4)]})]}),e[20]=i,e[21]=T):T=e[21];let E;e[22]!==_||e[23]!==T||e[24]!==u||e[25]!==l||e[26]!==o||e[27]!==d?(E=m.jsxs("div",{className:u,children:[l,o,d,_,T]}),e[22]=_,e[23]=T,e[24]=u,e[25]=l,e[26]=o,e[27]=d,e[28]=E):E=e[28];let A;e[29]!==r||e[30]!==E||e[31]!==f||e[32]!==p?(A=m.jsx(r,{side:f,className:p,children:E}),e[29]=r,e[30]=E,e[31]=f,e[32]=p,e[33]=A):A=e[33];let b;return e[34]!==s||e[35]!==A||e[36]!==h?(b=m.jsxs(s,{children:[h,A]}),e[34]=s,e[35]=A,e[36]=h,e[37]=b):b=e[37],b}function q0({gatewayId:t,gateways:e,onGatewayChange:n,disabled:r=!1}){const[s,i]=j.useState(!1),a=j.useRef(null),u=Vu(),{org:l}=zt(),o=e.find(g=>g.id===t);if(!o)return null;j.useEffect(()=>{s&&setTimeout(()=>{a.current?.focus()},0)},[s]);const d=co(t),f=g=>{g.stopPropagation(),n(null)},p=g=>{g.stopPropagation(),u({to:"/$org/gateways/$gatewayId",params:{org:l.slug,gatewayId:t}})},h=g=>{n(g),i(!1)};return m.jsxs("div",{className:re("flex items-center justify-between px-3 py-1.5 rounded-t-xl",d?.bg),children:[m.jsxs(lr,{open:s,onOpenChange:i,children:[m.jsx(ur,{asChild:!0,children:m.jsxs("button",{type:"button",disabled:r,className:re("flex items-center gap-1.5 hover:opacity-80 transition-opacity",r?"cursor-not-allowed opacity-50":"cursor-pointer"),children:[m.jsx(ci,{icon:o.icon,name:o.title,size:"2xs",fallbackIcon:o.fallbackIcon??m.jsx(di,{size:10})}),m.jsx("span",{className:"text-xs text-white font-normal",children:o.title}),m.jsx(vd,{size:14,className:"text-white/50"})]})}),m.jsx(or,{className:"w-[550px] p-0 overflow-hidden",align:"start",side:"top",sideOffset:8,children:m.jsx(Vo,{gateways:e,selectedGatewayId:t,onGatewayChange:h,searchInputRef:a})})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("button",{type:"button",onClick:p,disabled:r,className:re("flex items-center justify-center p-1 rounded-full transition-colors",r?"cursor-not-allowed opacity-50":"cursor-pointer hover:bg-white/10"),"aria-label":"Edit gateway",children:m.jsx(Pd,{size:14,className:"text-white"})}),m.jsx("button",{type:"button",onClick:f,disabled:r,className:re("flex items-center justify-center p-1 rounded-full transition-colors",r?"cursor-not-allowed opacity-50":"cursor-pointer hover:bg-white/10"),"aria-label":"Reset to default",children:m.jsx(lo,{size:14,className:"text-white"})})]})]})}function V0(){const t=Q.c(120),{inputValue:e,setInputValue:n,branchContext:r,clearBranch:s,setActiveThreadId:i,gateways:a,selectedGateway:u,setGatewayId:l,modelsConnections:o,selectedModel:d,setSelectedModel:f,messages:p,isStreaming:h,sendMessage:g,stopStreaming:_,chatError:T,clearChatError:E,finishReason:A,clearFinishReason:b}=An();let w;t[0]!==e||t[1]!==h||t[2]!==d?(w=!h&&d&&e.trim().length>0,t[0]=e,t[1]=h,t[2]=d,t[3]=w):w=t[3];const R=w;let I;t[4]!==R||t[5]!==e||t[6]!==h||t[7]!==g||t[8]!==_?(I=Z=>{Z.preventDefault(),h?_():R&&g(e.trim())},t[4]=R,t[5]=e,t[6]=h,t[7]=g,t[8]=_,t[9]=I):I=t[9];const L=I;let M;t[10]!==R||t[11]!==e||t[12]!==g?(M=Z=>{Z.key==="Enter"&&!Z.shiftKey&&(Z.preventDefault(),R&&g(e.trim()))},t[10]=R,t[11]=e,t[12]=g,t[13]=M):M=t[13];const P=M;let S;t[14]!==r||t[15]!==s||t[16]!==i||t[17]!==n?(S=()=>{r&&(i(r.originalThreadId),s(),n(""))},t[14]=r,t[15]=s,t[16]=i,t[17]=n,t[18]=S):S=t[18];const B=S;let $;t[19]!==T||t[20]!==g?($=()=>{T&&g(`I encountered this error: ${T.message}. Can you help me fix it?`)},t[19]=T,t[20]=g,t[21]=$):$=t[21];const X=$;let q;t[22]!==g?(q=()=>{g("Please continue.")},t[22]=g,t[23]=q):q=t[23];const U=q;let W,V,K,J,k,se;if(t[24]!==r||t[25]!==T||t[26]!==s||t[27]!==E||t[28]!==b||t[29]!==A||t[30]!==U||t[31]!==X||t[32]!==B||t[33]!==u||t[34]!==d||t[35]!==n){const Z=u?co(u.id):null;W=d?"Ask anything or @ for context":"Select a model to start chatting",J="flex flex-col gap-2 w-full min-h-42 justify-end",t[42]!==T||t[43]!==E||t[44]!==X?(k=T&&m.jsxs(Ls,{variant:"danger",title:"Error occurred",description:T.message,icon:m.jsx(Gu,{size:16}),onDismiss:E,children:[m.jsx(Me,{size:"sm",variant:"outline",onClick:X,className:"h-7 text-xs",children:"Fix in chat"}),m.jsx(Me,{size:"sm",variant:"outline",disabled:!0,className:"h-7 text-xs",children:"Report"})]}),t[42]=T,t[43]=E,t[44]=X,t[45]=k):k=t[45],t[46]!==b||t[47]!==A||t[48]!==U?(se=A&&A!=="stop"&&m.jsx(Ls,{variant:"warning",title:"Response incomplete",description:A==="length"?"Response reached the model's output limit. Different models have different limits. Try switching models or asking it to continue.":A==="content-filter"?"Response was filtered due to content policy.":A==="tool-calls"?"Response paused after tool execution to prevent infinite loops and save costs. Click continue to keep working.":`Response stopped unexpectedly: ${A}`,icon:m.jsx(Rd,{size:16}),onDismiss:b,children:m.jsx(Me,{size:"sm",variant:"outline",onClick:U,className:"h-7 text-xs",children:"Continue"})}),t[46]=b,t[47]=A,t[48]=U,t[49]=se):se=t[49],t[50]!==r||t[51]!==s||t[52]!==B||t[53]!==n?(V=r&&m.jsx(Ls,{variant:"default",title:"Editing message (click to view original)",description:r.originalMessageText,icon:m.jsx(no,{size:14}),onDismiss:()=>{s(),n("")},children:m.jsx(Me,{size:"sm",variant:"outline",onClick:B,className:"h-7 text-xs",children:"View original"})}),t[50]=r,t[51]=s,t[52]=B,t[53]=n,t[54]=V):V=t[54],K=re("relative rounded-xl w-full flex flex-col",u&&"shadow-sm",Z?.bg),t[24]=r,t[25]=T,t[26]=s,t[27]=E,t[28]=b,t[29]=A,t[30]=U,t[31]=X,t[32]=B,t[33]=u,t[34]=d,t[35]=n,t[36]=W,t[37]=V,t[38]=K,t[39]=J,t[40]=k,t[41]=se}else W=t[36],V=t[37],K=t[38],J=t[39],k=t[40],se=t[41];let he;t[55]!==a||t[56]!==h||t[57]!==u||t[58]!==l?(he=u&&m.jsx(q0,{gatewayId:u.id,gateways:a,onGatewayChange:l,disabled:h}),t[55]=a,t[56]=h,t[57]=u,t[58]=l,t[59]=he):he=t[59];const N=!u&&"shadow-sm";let Ee;t[60]!==N?(Ee=re("w-full relative rounded-xl min-h-[130px] flex flex-col border border-border bg-background",N),t[60]=N,t[61]=Ee):Ee=t[61];let ve;t[62]===Symbol.for("react.memo_cache_sentinel")?(ve={maxHeight:"164px"},t[62]=ve):ve=t[62];let fe;t[63]!==n?(fe=Z=>n(Z.target.value),t[63]=n,t[64]=fe):fe=t[64];const Ge=!d||h;let Ie;t[65]===Symbol.for("react.memo_cache_sentinel")?(Ie=re("placeholder:text-muted-foreground resize-none focus-visible:ring-0 border-0 p-2 text-[15px]! min-h-[20px] w-full","rounded-none shadow-none","min-h-[20px] h-auto overflow-hidden"),t[65]=Ie):Ie=t[65];let Ne;t[66]!==P||t[67]!==e||t[68]!==W||t[69]!==fe||t[70]!==Ge?(Ne=m.jsx("div",{className:"relative flex flex-col gap-2 p-2.5 flex-1",children:m.jsx("div",{className:"overflow-y-auto relative flex-1",style:ve,children:m.jsx(wd,{rows:1,value:e,onChange:fe,onKeyDown:P,placeholder:W,disabled:Ge,className:Ie})})}),t[66]=P,t[67]=e,t[68]=W,t[69]=fe,t[70]=Ge,t[71]=Ne):Ne=t[71];let ye;t[72]!==a||t[73]!==h||t[74]!==u||t[75]!==l?(ye=!u&&m.jsx(g0,{selectedGatewayId:null,onGatewayChange:l,gateways:a,placeholder:"Agent",disabled:h}),t[72]=a,t[73]=h,t[74]=u,t[75]=l,t[76]=ye):ye=t[76];const Fe=d??void 0;let Re;t[77]!==o||t[78]!==f||t[79]!==Fe?(Re=m.jsx(L0,{selectedModel:Fe,onModelChange:f,modelsConnections:o,placeholder:"Model",variant:"borderless"}),t[77]=o,t[78]=f,t[79]=Fe,t[80]=Re):Re=t[80];let De;t[81]!==p?(De=m.jsx(Zo,{messages:p}),t[81]=p,t[82]=De):De=t[82];let Oe;t[83]!==ye||t[84]!==Re||t[85]!==De?(Oe=m.jsxs("div",{className:"flex items-center gap-2 min-w-0 overflow-hidden",children:[ye,Re,De]}),t[83]=ye,t[84]=Re,t[85]=De,t[86]=Oe):Oe=t[86];const Ue=h?"button":"submit";let Se;t[87]!==h||t[88]!==_?(Se=Z=>{h&&(Z.preventDefault(),Z.stopPropagation(),_())},t[87]=h,t[88]=_,t[89]=Se):Se=t[89];const He=R||h?"default":"ghost",We=!R&&!h,Tt=!R&&!h&&"bg-muted text-muted-foreground hover:bg-muted hover:text-muted-foreground cursor-not-allowed";let Je;t[90]!==Tt?(Je=re("size-8 rounded-full transition-all",Tt),t[90]=Tt,t[91]=Je):Je=t[91];const qt=h?"Stop generating":"Send message (Enter)";let st;t[92]!==h?(st=h?m.jsx(uo,{size:20}):m.jsx(Ld,{size:20}),t[92]=h,t[93]=st):st=t[93];let dt;t[94]!==Ue||t[95]!==Se||t[96]!==He||t[97]!==We||t[98]!==Je||t[99]!==qt||t[100]!==st?(dt=m.jsx("div",{className:"flex items-center gap-1",children:m.jsx(Me,{type:Ue,onClick:Se,variant:He,size:"icon",disabled:We,className:Je,title:qt,children:st})}),t[94]=Ue,t[95]=Se,t[96]=He,t[97]=We,t[98]=Je,t[99]=qt,t[100]=st,t[101]=dt):dt=t[101];let it;t[102]!==Oe||t[103]!==dt?(it=m.jsxs("div",{className:"flex items-center justify-between p-2.5",children:[Oe,dt]}),t[102]=Oe,t[103]=dt,t[104]=it):it=t[104];let le;t[105]!==L||t[106]!==Ee||t[107]!==Ne||t[108]!==it?(le=m.jsx("div",{className:"p-0.5",children:m.jsxs("form",{onSubmit:L,className:Ee,children:[Ne,it]})}),t[105]=L,t[106]=Ee,t[107]=Ne,t[108]=it,t[109]=le):le=t[109];let D;t[110]!==he||t[111]!==le||t[112]!==K?(D=m.jsxs("div",{className:K,children:[he,le]}),t[110]=he,t[111]=le,t[112]=K,t[113]=D):D=t[113];let Y;return t[114]!==V||t[115]!==D||t[116]!==J||t[117]!==k||t[118]!==se?(Y=m.jsxs("div",{className:J,children:[k,se,V,D]}),t[114]=V,t[115]=D,t[116]=J,t[117]=k,t[118]=se,t[119]=Y):Y=t[119],Y}const G0={name:"mesh-chat",version:"1.0.0"};function W0(t){if(typeof window>"u")throw new Error("Gateway prompts require a browser environment.");const e=new URL(`/mcp/gateway/${t}`,window.location.origin);return new gd(e,{requestInit:{headers:{Accept:"application/json, text/event-stream","Content-Type":"application/json"}}})}async function Ko(t,e){const n=new md(G0),r=W0(t);try{return await n.connect(r),await e(n)}catch(s){const i=s instanceof Error?s.message:String(s);throw console.error(`[gateway-prompts] Error for gateway ${t}:`,s),new Error(`Failed to communicate with gateway: ${i}`)}finally{await n.close().catch(console.error)}}async function Q0(t){try{return(await Ko(t,n=>n.listPrompts())).prompts??[]}catch(e){return console.error("[gateway-prompts] Failed to list prompts:",e),[]}}async function X0(t,e,n){const r=n??{};return await Ko(t,s=>s.getPrompt({name:e,arguments:r}))}function Z0(t){const e=Q.c(7);let n;e[0]!==t?(n=je.gatewayPrompts(t),e[0]=t,e[1]=n):n=e[1];let r;e[2]!==t?(r=()=>Q0(t),e[2]=t,e[3]=r):r=e[3];let s;return e[4]!==n||e[5]!==r?(s={queryKey:n,queryFn:r,staleTime:6e4,retry:!1},e[4]=n,e[5]=r,e[6]=s):s=e[6],ui(s)}const Ia=3;function Jo(t){const e=Q.c(23),{prompt:n,onSelect:r,isSelected:s,isDisabled:i,isLoading:a}=t,u=n.description??n.name;let l;e[0]!==r||e[1]!==n?(l=()=>r(n),e[0]=r,e[1]=n,e[2]=l):l=e[2];const o=i||a,d=s&&"bg-accent/50 text-foreground",f=a&&"bg-accent/50 text-foreground",p=(i||a)&&"cursor-not-allowed hover:bg-accent/50";let h;e[3]!==d||e[4]!==f||e[5]!==p?(h=re("px-3 py-1.5 text-xs text-muted-foreground hover:text-foreground border border-border rounded-full hover:bg-accent/50 transition-colors cursor-pointer flex items-center gap-1.5",d,f,p),e[3]=d,e[4]=f,e[5]=p,e[6]=h):h=e[6];const g=n.title??n.name;let _;if(e[7]!==g){let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=/_/g,e[9]=w):w=e[9],_=g.replace(w," "),e[7]=g,e[8]=_}else _=e[8];let T;e[10]!==a?(T=a&&m.jsx(Zu,{size:"xs"}),e[10]=a,e[11]=T):T=e[11];let E;e[12]!==l||e[13]!==o||e[14]!==h||e[15]!==_||e[16]!==T?(E=m.jsx(_n,{asChild:!0,children:m.jsxs("button",{type:"button",onClick:l,disabled:o,className:h,children:[_,T]})}),e[12]=l,e[13]=o,e[14]=h,e[15]=_,e[16]=T,e[17]=E):E=e[17];let A;e[18]!==u?(A=m.jsx(xn,{side:"bottom",className:"max-w-xs",children:m.jsx("p",{className:"text-xs",children:u})}),e[18]=u,e[19]=A):A=e[19];let b;return e[20]!==E||e[21]!==A?(b=m.jsxs(yn,{children:[E,A]}),e[20]=E,e[21]=A,e[22]=b):b=e[22],b}function K0(t){const e=Q.c(23),{prompts:n,onSelect:r,loadingPrompt:s,className:i}=t;if(n.length===0)return null;let a,u,l,o,d;if(e[0]!==i||e[1]!==s||e[2]!==r||e[3]!==n){const h=n.slice(0,Ia),g=n.slice(Ia),_=g.length>0,T=!!s;a=hi,d=300,e[9]!==i?(u=re("flex flex-wrap items-center justify-center gap-2",i),e[9]=i,e[10]=u):u=e[10];let E;e[11]!==T||e[12]!==s?.name||e[13]!==r?(E=A=>m.jsx(Jo,{prompt:A,onSelect:r,isLoading:s?.name===A.name,isDisabled:T&&s?.name!==A.name},A.name),e[11]=T,e[12]=s?.name,e[13]=r,e[14]=E):E=e[14],l=h.map(E),o=_&&m.jsxs(lr,{children:[m.jsx(ur,{asChild:!0,children:m.jsxs("button",{type:"button",disabled:T,className:re("size-7 flex items-center justify-center text-xs text-muted-foreground hover:text-foreground border border-border rounded-full hover:bg-accent/50 transition-colors cursor-pointer",T&&"opacity-60 cursor-not-allowed"),children:["+",g.length]})}),m.jsx(or,{side:"bottom",align:"center",className:"w-auto p-2",children:m.jsx("div",{className:"flex flex-col gap-1",children:g.map(A=>{const b=A.description??A.name,w=s?.name===A.name;return m.jsxs(yn,{children:[m.jsx(_n,{asChild:!0,children:m.jsxs("button",{type:"button",onClick:()=>r(A),disabled:T&&!w,className:re("px-3 py-1.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent/50 rounded-md transition-colors cursor-pointer text-left flex items-center gap-1.5",w&&"bg-accent/50 text-foreground",T&&!w&&"opacity-60 cursor-not-allowed"),children:[(A.title??A.name).replace(/_/g," "),w&&m.jsx(Zu,{size:"xs"})]})}),m.jsx(xn,{side:"right",className:"max-w-xs",children:m.jsx("p",{className:"text-xs",children:b})})]},A.name)})})})]}),e[0]=i,e[1]=s,e[2]=r,e[3]=n,e[4]=a,e[5]=u,e[6]=l,e[7]=o,e[8]=d}else a=e[4],u=e[5],l=e[6],o=e[7],d=e[8];let f;e[15]!==u||e[16]!==l||e[17]!==o?(f=m.jsxs("div",{className:u,children:[l,o]}),e[15]=u,e[16]=l,e[17]=o,e[18]=f):f=e[18];let p;return e[19]!==a||e[20]!==d||e[21]!==f?(p=m.jsx(a,{delayDuration:d,children:f}),e[19]=a,e[20]=d,e[21]=f,e[22]=p):p=e[22],p}function J0(t){const e={};for(const n of t.arguments??[])e[n.name]=n.required?G().min(1,"Required"):G();return Te(e)}function ep(t){const e={};for(const n of t.arguments??[])e[n.name]="";return e}function tp(t){for(const e of t.messages??[]){if(e.role!=="user"||e.content?.type!=="text")continue;const n=e.content.text?.trim();if(n)return n}return null}function np(t){const e=Q.c(40),{prompt:n,onCancel:r,onSubmit:s}=t;let i;if(e[0]!==n){const M=J0(n);i=bd(M),e[0]=n,e[1]=i}else i=e[1];const u=i;let l;e[2]!==n?(l=ep(n),e[2]=n,e[3]=l):l=e[3];let o;e[4]!==u||e[5]!==l?(o={resolver:u,defaultValues:l,mode:"onChange"},e[4]=u,e[5]=l,e[6]=o):o=e[6];const d=Ed(o);let f;e[7]!==n.arguments?(f=n.arguments??[],e[7]=n.arguments,e[8]=f):f=e[8];const p=f;let h;e[9]!==r||e[10]!==n?(h=m.jsx(Jo,{prompt:n,onSelect:r,isSelected:!0}),e[9]=r,e[10]=n,e[11]=h):h=e[11];let g;e[12]!==n.description?(g=n.description?m.jsx("p",{className:"text-xs text-muted-foreground max-w-xl text-center",children:n.description}):null,e[12]=n.description,e[13]=g):g=e[13];let _;e[14]!==d||e[15]!==s?(_=d.handleSubmit(s),e[14]=d,e[15]=s,e[16]=_):_=e[16];let T;if(e[17]!==p||e[18]!==d.control){let M;e[20]!==d.control?(M=P=>m.jsx(Jd,{control:d.control,name:P.name,render:S=>{const{field:B}=S;return m.jsxs(ef,{children:[m.jsxs(tf,{className:"text-xs",children:[P.name,P.required?" *":""]}),m.jsx(nf,{children:m.jsx(fi,{...B,value:B.value??"",required:P.required,placeholder:P.description??"",className:"h-9"})}),P.description?m.jsx(rf,{className:"text-xs",children:P.description}):null,m.jsx(sf,{})]})}},P.name),e[20]=d.control,e[21]=M):M=e[21],T=p.map(M),e[17]=p,e[18]=d.control,e[19]=T}else T=e[19];let E;e[22]!==r?(E=m.jsx(Me,{type:"button",variant:"ghost",size:"sm",className:"h-8 px-3 text-xs",onClick:r,children:"Cancel"}),e[22]=r,e[23]=E):E=e[23];const A=!d.formState.isValid;let b;e[24]!==A?(b=m.jsx(Me,{type:"submit",size:"sm",className:"h-8 px-3 text-xs",disabled:A,children:"Use prompt"}),e[24]=A,e[25]=b):b=e[25];let w;e[26]!==E||e[27]!==b?(w=m.jsxs("div",{className:"flex justify-end gap-2",children:[E,b]}),e[26]=E,e[27]=b,e[28]=w):w=e[28];let R;e[29]!==w||e[30]!==_||e[31]!==T?(R=m.jsxs("form",{className:"w-full max-w-xl flex flex-col gap-3",onSubmit:_,autoComplete:"off",children:[T,w]}),e[29]=w,e[30]=_,e[31]=T,e[32]=R):R=e[32];let I;e[33]!==d||e[34]!==R?(I=m.jsx(Kd,{...d,children:R}),e[33]=d,e[34]=R,e[35]=I):I=e[35];let L;return e[36]!==I||e[37]!==h||e[38]!==g?(L=m.jsxs("div",{className:"flex flex-col items-center gap-3 w-full",children:[h,g,I]}),e[36]=I,e[37]=h,e[38]=g,e[39]=L):L=e[39],L}function rp(){const t=Q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsxs(m.Fragment,{children:[m.jsx($e,{className:"h-6 w-20 rounded-full border border-border"}),m.jsx($e,{className:"h-6 w-24 rounded-full border border-border"})]}),t[0]=e):e=t[0],e}function sp(t,e){switch(e.type){case"SELECT_PROMPT":return!e.prompt.arguments||e.prompt.arguments.length===0?{stage:"loading",prompt:e.prompt}:{stage:"collectingArguments",prompt:e.prompt};case"CANCEL":return{stage:"idle"};case"START_LOADING":return{stage:"loading",prompt:e.prompt,arguments:e.arguments};case"RESET":return{stage:"idle"};default:return t}}function ip({gatewayId:t}){const{setInputValue:e}=An(),{data:n}=Z0(t),[r,s]=j.useReducer(sp,{stage:"idle"});if(n.length===0)return null;const i=async(o,d)=>{try{const f=await X0(t,o.name,d),p=tp(f)??o.description??o.name;e(p),s({type:"RESET"})}catch(f){console.error("[ice-breakers] Failed to fetch prompt:",f),Kn.error("Failed to load prompt. Please try again."),s({type:"RESET"})}},a=async o=>{if(o.arguments&&o.arguments.length>0){s({type:"SELECT_PROMPT",prompt:o});return}s({type:"START_LOADING",prompt:o}),await i(o)},u=()=>{s({type:"CANCEL"})},l=async o=>{if(r.stage!=="collectingArguments")return;const{prompt:d}=r;s({type:"START_LOADING",prompt:d,arguments:o}),await i(d,o)};return m.jsx("div",{className:"relative w-full",children:r.stage==="collectingArguments"?m.jsx("div",{className:"animate-in fade-in-0 zoom-in-95 duration-300",children:m.jsx(np,{prompt:r.prompt,onCancel:u,onSubmit:l})},"expanded"):m.jsx("div",{className:"animate-in fade-in-0 zoom-in-95 duration-300",children:m.jsx(K0,{prompts:n,onSelect:a,loadingPrompt:r.stage==="loading"?r.prompt:null})},"list")})}function ap(t){const e=Q.c(8),{className:n}=t,{selectedGateway:r}=An();let s;e[0]!==n?(s=re("flex flex-wrap items-center justify-center gap-2",n),e[0]=n,e[1]=s):s=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i={minHeight:"32px"},e[2]=i):i=e[2];let a;e[3]!==r?(a=r&&m.jsx(Od,{fallback:null,children:m.jsx(j.Suspense,{fallback:m.jsx(rp,{}),children:m.jsx(ip,{gatewayId:r.id})})},r.id),e[3]=r,e[4]=a):a=e[4];let u;return e[5]!==s||e[6]!==a?(u=m.jsx("div",{className:s,style:i,children:a}),e[5]=s,e[6]=a,e[7]=u):u=e[7],u}function up(){const t=Q.c(3),[e,n]=j.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=async a=>{await navigator.clipboard.writeText(a),n(!0),setTimeout(()=>n(!1),2e3)},t[0]=r):r=t[0];const s=r;let i;return t[1]!==e?(i={handleCopy:s,copied:e},t[1]=e,t[2]=i):i=t[2],i}function xi(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var rn=xi();function el(t){rn=t}var zn={exec:()=>null};function pe(t,e=""){let n=typeof t=="string"?t:t.source;const r={replace:(s,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(Ke.caret,"$1"),n=n.replace(s,a),r},getRegex:()=>new RegExp(n,e)};return r}var Ke={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},op=/^(?:[ \t]*(?:\n|$))+/,lp=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,cp=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,fr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,dp=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,_i=/(?:[*+-]|\d{1,9}[.)])/,tl=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,nl=pe(tl).replace(/bull/g,_i).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),fp=pe(tl).replace(/bull/g,_i).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),yi=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,hp=/^[^\n]+/,Ai=/(?!\s*\])(?:\\.|[^\[\]\\])+/,pp=pe(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ai).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),mp=pe(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,_i).getRegex(),Wr="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ki=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,gp=pe("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ki).replace("tag",Wr).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),rl=pe(yi).replace("hr",fr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Wr).getRegex(),bp=pe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",rl).getRegex(),Ci={blockquote:bp,code:lp,def:pp,fences:cp,heading:dp,hr:fr,html:gp,lheading:nl,list:mp,newline:op,paragraph:rl,table:zn,text:hp},Na=pe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",fr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Wr).getRegex(),Ep={...Ci,lheading:fp,table:Na,paragraph:pe(yi).replace("hr",fr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Na).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Wr).getRegex()},Tp={...Ci,html:pe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ki).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:zn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:pe(yi).replace("hr",fr).replace("heading",` *#{1,6} *[^
22
22
  ]`).replace("lheading",nl).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},xp=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,_p=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,sl=/^( {2,}|\\)\n(?!\s*$)/,yp=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Qr=/[\p{P}\p{S}]/u,Ii=/[\s\p{P}\p{S}]/u,il=/[^\s\p{P}\p{S}]/u,Ap=pe(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ii).getRegex(),al=/(?!~)[\p{P}\p{S}]/u,kp=/(?!~)[\s\p{P}\p{S}]/u,Cp=/(?:[^\s\p{P}\p{S}]|~)/u,Ip=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,ul=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Np=pe(ul,"u").replace(/punct/g,Qr).getRegex(),Sp=pe(ul,"u").replace(/punct/g,al).getRegex(),ol="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",wp=pe(ol,"gu").replace(/notPunctSpace/g,il).replace(/punctSpace/g,Ii).replace(/punct/g,Qr).getRegex(),Rp=pe(ol,"gu").replace(/notPunctSpace/g,Cp).replace(/punctSpace/g,kp).replace(/punct/g,al).getRegex(),Op=pe("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,il).replace(/punctSpace/g,Ii).replace(/punct/g,Qr).getRegex(),Lp=pe(/\\(punct)/,"gu").replace(/punct/g,Qr).getRegex(),vp=pe(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Dp=pe(ki).replace("(?:-->|$)","-->").getRegex(),Pp=pe("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Dp).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Dr=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Mp=pe(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Dr).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ll=pe(/^!?\[(label)\]\[(ref)\]/).replace("label",Dr).replace("ref",Ai).getRegex(),cl=pe(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ai).getRegex(),Bp=pe("reflink|nolink(?!\\()","g").replace("reflink",ll).replace("nolink",cl).getRegex(),Ni={_backpedal:zn,anyPunctuation:Lp,autolink:vp,blockSkip:Ip,br:sl,code:_p,del:zn,emStrongLDelim:Np,emStrongRDelimAst:wp,emStrongRDelimUnd:Op,escape:xp,link:Mp,nolink:cl,punctuation:Ap,reflink:ll,reflinkSearch:Bp,tag:Pp,text:yp,url:zn},Fp={...Ni,link:pe(/^!?\[(label)\]\((.*?)\)/).replace("label",Dr).getRegex(),reflink:pe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Dr).getRegex()},zs={...Ni,emStrongRDelimAst:Rp,emStrongLDelim:Sp,url:pe(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Up={...zs,br:pe(sl).replace("{2,}","*").getRegex(),text:pe(zs.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Tr={normal:Ci,gfm:Ep,pedantic:Tp},wn={normal:Ni,gfm:zs,breaks:Up,pedantic:Fp},Hp={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Sa=t=>Hp[t];function yt(t,e){if(e){if(Ke.escapeTest.test(t))return t.replace(Ke.escapeReplace,Sa)}else if(Ke.escapeTestNoEncode.test(t))return t.replace(Ke.escapeReplaceNoEncode,Sa);return t}function wa(t){try{t=encodeURI(t).replace(Ke.percentDecode,"%")}catch{return null}return t}function Ra(t,e){const n=t.replace(Ke.findPipe,(i,a,u)=>{let l=!1,o=a;for(;--o>=0&&u[o]==="\\";)l=!l;return l?"|":" |"}),r=n.split(Ke.splitPipe);let s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(Ke.slashPipe,"|");return r}function Rn(t,e,n){const r=t.length;if(r===0)return"";let s=0;for(;s<r&&t.charAt(r-s-1)===e;)s++;return t.slice(0,r-s)}function jp(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])n++;else if(t[r]===e[1]&&(n--,n<0))return r;return n>0?-2:-1}function Oa(t,e,n,r,s){const i=e.href,a=e.title||null,u=t[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;const l={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:a,text:u,tokens:r.inlineTokens(u)};return r.state.inLink=!1,l}function zp(t,e,n){const r=t.match(n.other.indentCodeCompensation);if(r===null)return e;const s=r[1];return e.split(`
23
23
  `).map(i=>{const a=i.match(n.other.beginningSpace);if(a===null)return i;const[u]=a;return u.length>=s.length?i.slice(s.length):i}).join(`
24
24
  `)}var Pr=class{options;rules;lexer;constructor(t){this.options=t||rn}space(t){const e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){const e=this.rules.block.code.exec(t);if(e){const n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Rn(n,`
@@ -73,10 +73,10 @@ ${t}</tr>
73
73
  `}tablecell(t){const e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
74
74
  `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${yt(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){const r=this.parser.parseInline(n),s=wa(t);if(s===null)return r;t=s;let i='<a href="'+t+'"';return e&&(i+=' title="'+yt(e)+'"'),i+=">"+r+"</a>",i}image({href:t,title:e,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));const s=wa(t);if(s===null)return yt(n);t=s;let i=`<img src="${t}" alt="${n}"`;return e&&(i+=` title="${yt(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:yt(t.text)}},Si=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},Ot=class Ys{options;renderer;textRenderer;constructor(e){this.options=e||rn,this.options.renderer=this.options.renderer||new Mr,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Si}static parse(e,n){return new Ys(n).parse(e)}static parseInline(e,n){return new Ys(n).parseInline(e)}parse(e,n=!0){let r="";for(let s=0;s<e.length;s++){const i=e[s];if(this.options.extensions?.renderers?.[i.type]){const u=i,l=this.options.extensions.renderers[u.type].call({parser:this},u);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(u.type)){r+=l||"";continue}}const a=i;switch(a.type){case"space":{r+=this.renderer.space(a);continue}case"hr":{r+=this.renderer.hr(a);continue}case"heading":{r+=this.renderer.heading(a);continue}case"code":{r+=this.renderer.code(a);continue}case"table":{r+=this.renderer.table(a);continue}case"blockquote":{r+=this.renderer.blockquote(a);continue}case"list":{r+=this.renderer.list(a);continue}case"html":{r+=this.renderer.html(a);continue}case"paragraph":{r+=this.renderer.paragraph(a);continue}case"text":{let u=a,l=this.renderer.text(u);for(;s+1<e.length&&e[s+1].type==="text";)u=e[++s],l+=`
75
75
  `+this.renderer.text(u);n?r+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):r+=l;continue}default:{const u='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}parseInline(e,n=this.renderer){let r="";for(let s=0;s<e.length;s++){const i=e[s];if(this.options.extensions?.renderers?.[i.type]){const u=this.options.extensions.renderers[i.type].call({parser:this},i);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=u||"";continue}}const a=i;switch(a.type){case"escape":{r+=n.text(a);break}case"html":{r+=n.html(a);break}case"link":{r+=n.link(a);break}case"image":{r+=n.image(a);break}case"strong":{r+=n.strong(a);break}case"em":{r+=n.em(a);break}case"codespan":{r+=n.codespan(a);break}case"br":{r+=n.br(a);break}case"del":{r+=n.del(a);break}case"text":{r+=n.text(a);break}default:{const u='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}},Sr=class{options;block;constructor(t){this.options=t||rn}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?Rt.lex:Rt.lexInline}provideParser(){return this.block?Ot.parse:Ot.parseInline}},$p=class{defaults=xi();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Ot;Renderer=Mr;TextRenderer=Si;Lexer=Rt;Tokenizer=Pr;Hooks=Sr;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(const r of t)switch(n=n.concat(e.call(this,r)),r.type){case"table":{const s=r;for(const i of s.header)n=n.concat(this.walkTokens(i.tokens,e));for(const i of s.rows)for(const a of i)n=n.concat(this.walkTokens(a.tokens,e));break}case"list":{const s=r;n=n.concat(this.walkTokens(s.items,e));break}default:{const s=r;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(i=>{const a=s[i].flat(1/0);n=n.concat(this.walkTokens(a,e))}):s.tokens&&(n=n.concat(this.walkTokens(s.tokens,e)))}}return n}use(...t){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{const r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){const i=e.renderers[s.name];i?e.renderers[s.name]=function(...a){let u=s.renderer.apply(this,a);return u===!1&&(u=i.apply(this,a)),u}:e.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const i=e[s.level];i?i.unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),r.extensions=e),n.renderer){const s=this.defaults.renderer||new Mr(this.defaults);for(const i in n.renderer){if(!(i in s))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;const a=i,u=n.renderer[a],l=s[a];s[a]=(...o)=>{let d=u.apply(s,o);return d===!1&&(d=l.apply(s,o)),d||""}}r.renderer=s}if(n.tokenizer){const s=this.defaults.tokenizer||new Pr(this.defaults);for(const i in n.tokenizer){if(!(i in s))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;const a=i,u=n.tokenizer[a],l=s[a];s[a]=(...o)=>{let d=u.apply(s,o);return d===!1&&(d=l.apply(s,o)),d}}r.tokenizer=s}if(n.hooks){const s=this.defaults.hooks||new Sr;for(const i in n.hooks){if(!(i in s))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;const a=i,u=n.hooks[a],l=s[a];Sr.passThroughHooks.has(i)?s[a]=o=>{if(this.defaults.async)return Promise.resolve(u.call(s,o)).then(f=>l.call(s,f));const d=u.call(s,o);return l.call(s,d)}:s[a]=(...o)=>{let d=u.apply(s,o);return d===!1&&(d=l.apply(s,o)),d}}r.hooks=s}if(n.walkTokens){const s=this.defaults.walkTokens,i=n.walkTokens;r.walkTokens=function(a){let u=[];return u.push(i.call(this,a)),s&&(u=u.concat(s.call(this,a))),u}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return Rt.lex(t,e??this.defaults)}parser(t,e){return Ot.parse(t,e??this.defaults)}parseMarkdown(t){return(n,r)=>{const s={...r},i={...this.defaults,...s},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&s.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 n>"u"||n===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=t);const u=i.hooks?i.hooks.provideLexer():t?Rt.lex:Rt.lexInline,l=i.hooks?i.hooks.provideParser():t?Ot.parse:Ot.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then(o=>u(o,i)).then(o=>i.hooks?i.hooks.processAllTokens(o):o).then(o=>i.walkTokens?Promise.all(this.walkTokens(o,i.walkTokens)).then(()=>o):o).then(o=>l(o,i)).then(o=>i.hooks?i.hooks.postprocess(o):o).catch(a);try{i.hooks&&(n=i.hooks.preprocess(n));let o=u(n,i);i.hooks&&(o=i.hooks.processAllTokens(o)),i.walkTokens&&this.walkTokens(o,i.walkTokens);let d=l(o,i);return i.hooks&&(d=i.hooks.postprocess(d)),d}catch(o){return a(o)}}}onError(t,e){return n=>{if(n.message+=`
76
- Please report this to https://github.com/markedjs/marked.`,t){const r="<p>An error occurred:</p><pre>"+yt(n.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(n);throw n}}},tn=new $p;function ge(t,e){return tn.parse(t,e)}ge.options=ge.setOptions=function(t){return tn.setOptions(t),ge.defaults=tn.defaults,el(ge.defaults),ge};ge.getDefaults=xi;ge.defaults=rn;ge.use=function(...t){return tn.use(...t),ge.defaults=tn.defaults,el(ge.defaults),ge};ge.walkTokens=function(t,e){return tn.walkTokens(t,e)};ge.parseInline=tn.parseInline;ge.Parser=Ot;ge.parser=Ot.parse;ge.Renderer=Mr;ge.TextRenderer=Si;ge.Lexer=Rt;ge.lexer=Rt.lex;ge.Tokenizer=Pr;ge.Hooks=Sr;ge.parse=ge;ge.options;ge.setOptions;ge.use;ge.walkTokens;ge.parseInline;Ot.parse;Rt.lex;function La(t){const e=[],n=String(t||"");let r=n.indexOf(","),s=0,i=!1;for(;!i;){r===-1&&(r=n.length,i=!0);const a=n.slice(s,r).trim();(a||!i)&&e.push(a),s=r+1,r=n.indexOf(",",s)}return e}function dl(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Yp=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,qp=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Vp={};function va(t,e){return(Vp.jsx?qp:Yp).test(t)}const Gp=/[ \t\n\f\r]/g;function Wp(t){return typeof t=="object"?t.type==="text"?Da(t.value):!1:Da(t)}function Da(t){return t.replace(Gp,"")===""}class hr{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}hr.prototype.normal={};hr.prototype.property={};hr.prototype.space=void 0;function fl(t,e){const n={},r={};for(const s of t)Object.assign(n,s.property),Object.assign(r,s.normal);return new hr(n,r,e)}function nr(t){return t.toLowerCase()}class rt{constructor(e,n){this.attribute=n,this.property=e}}rt.prototype.attribute="";rt.prototype.booleanish=!1;rt.prototype.boolean=!1;rt.prototype.commaOrSpaceSeparated=!1;rt.prototype.commaSeparated=!1;rt.prototype.defined=!1;rt.prototype.mustUseProperty=!1;rt.prototype.number=!1;rt.prototype.overloadedBoolean=!1;rt.prototype.property="";rt.prototype.spaceSeparated=!1;rt.prototype.space=void 0;let Qp=0;const se=sn(),Le=sn(),qs=sn(),z=sn(),_e=sn(),mn=sn(),ot=sn();function sn(){return 2**++Qp}const Vs=Object.freeze(Object.defineProperty({__proto__:null,boolean:se,booleanish:Le,commaOrSpaceSeparated:ot,commaSeparated:mn,number:z,overloadedBoolean:qs,spaceSeparated:_e},Symbol.toStringTag,{value:"Module"})),hs=Object.keys(Vs);class wi extends rt{constructor(e,n,r,s){let i=-1;if(super(e,n),Pa(this,"space",s),typeof r=="number")for(;++i<hs.length;){const a=hs[i];Pa(this,hs[i],(r&Vs[a])===Vs[a])}}}wi.prototype.defined=!0;function Pa(t,e,n){n&&(t[e]=n)}function kn(t){const e={},n={};for(const[r,s]of Object.entries(t.properties)){const i=new wi(r,t.transform(t.attributes||{},r),s,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),e[r]=i,n[nr(r)]=r,n[nr(i.attribute)]=r}return new hr(e,n,t.space)}const hl=kn({properties:{ariaActiveDescendant:null,ariaAtomic:Le,ariaAutoComplete:null,ariaBusy:Le,ariaChecked:Le,ariaColCount:z,ariaColIndex:z,ariaColSpan:z,ariaControls:_e,ariaCurrent:null,ariaDescribedBy:_e,ariaDetails:null,ariaDisabled:Le,ariaDropEffect:_e,ariaErrorMessage:null,ariaExpanded:Le,ariaFlowTo:_e,ariaGrabbed:Le,ariaHasPopup:null,ariaHidden:Le,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:_e,ariaLevel:z,ariaLive:null,ariaModal:Le,ariaMultiLine:Le,ariaMultiSelectable:Le,ariaOrientation:null,ariaOwns:_e,ariaPlaceholder:null,ariaPosInSet:z,ariaPressed:Le,ariaReadOnly:Le,ariaRelevant:null,ariaRequired:Le,ariaRoleDescription:_e,ariaRowCount:z,ariaRowIndex:z,ariaRowSpan:z,ariaSelected:Le,ariaSetSize:z,ariaSort:null,ariaValueMax:z,ariaValueMin:z,ariaValueNow:z,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function pl(t,e){return e in t?t[e]:e}function ml(t,e){return pl(t,e.toLowerCase())}const Xp=kn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:mn,acceptCharset:_e,accessKey:_e,action:null,allow:null,allowFullScreen:se,allowPaymentRequest:se,allowUserMedia:se,alt:null,as:null,async:se,autoCapitalize:null,autoComplete:_e,autoFocus:se,autoPlay:se,blocking:_e,capture:null,charSet:null,checked:se,cite:null,className:_e,cols:z,colSpan:null,content:null,contentEditable:Le,controls:se,controlsList:_e,coords:z|mn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:se,defer:se,dir:null,dirName:null,disabled:se,download:qs,draggable:Le,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:se,formTarget:null,headers:_e,height:z,hidden:qs,high:z,href:null,hrefLang:null,htmlFor:_e,httpEquiv:_e,id:null,imageSizes:null,imageSrcSet:null,inert:se,inputMode:null,integrity:null,is:null,isMap:se,itemId:null,itemProp:_e,itemRef:_e,itemScope:se,itemType:_e,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:se,low:z,manifest:null,max:null,maxLength:z,media:null,method:null,min:null,minLength:z,multiple:se,muted:se,name:null,nonce:null,noModule:se,noValidate:se,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:se,optimum:z,pattern:null,ping:_e,placeholder:null,playsInline:se,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:se,referrerPolicy:null,rel:_e,required:se,reversed:se,rows:z,rowSpan:z,sandbox:_e,scope:null,scoped:se,seamless:se,selected:se,shadowRootClonable:se,shadowRootDelegatesFocus:se,shadowRootMode:null,shape:null,size:z,sizes:null,slot:null,span:z,spellCheck:Le,src:null,srcDoc:null,srcLang:null,srcSet:null,start:z,step:null,style:null,tabIndex:z,target:null,title:null,translate:null,type:null,typeMustMatch:se,useMap:null,value:Le,width:z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:_e,axis:null,background:null,bgColor:null,border:z,borderColor:null,bottomMargin:z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:se,declare:se,event:null,face:null,frame:null,frameBorder:null,hSpace:z,leftMargin:z,link:null,longDesc:null,lowSrc:null,marginHeight:z,marginWidth:z,noResize:se,noHref:se,noShade:se,noWrap:se,object:null,profile:null,prompt:null,rev:null,rightMargin:z,rules:null,scheme:null,scrolling:Le,standby:null,summary:null,text:null,topMargin:z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:z,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:se,disableRemotePlayback:se,prefix:null,property:null,results:z,security:null,unselectable:null},space:"html",transform:ml}),Zp=kn({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:ot,accentHeight:z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:z,amplitude:z,arabicForm:null,ascent:z,attributeName:null,attributeType:null,azimuth:z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:z,by:null,calcMode:null,capHeight:z,className:_e,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:z,diffuseConstant:z,direction:null,display:null,dur:null,divisor:z,dominantBaseline:null,download:se,dx:null,dy:null,edgeMode:null,editable:null,elevation:z,enableBackground:null,end:null,event:null,exponent:z,externalResourcesRequired:null,fill:null,fillOpacity:z,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:mn,g2:mn,glyphName:mn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:z,horizOriginX:z,horizOriginY:z,id:null,ideographic:z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:z,k:z,k1:z,k2:z,k3:z,k4:z,kernelMatrix:ot,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:z,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:z,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:z,overlineThickness:z,paintOrder:null,panose1:null,path:null,pathLength:z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:_e,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:z,pointsAtY:z,pointsAtZ:z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ot,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ot,rev:ot,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ot,requiredFeatures:ot,requiredFonts:ot,requiredFormats:ot,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:z,specularExponent:z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:z,strikethroughThickness:z,string:null,stroke:null,strokeDashArray:ot,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:z,strokeOpacity:z,strokeWidth:null,style:null,surfaceScale:z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ot,tabIndex:z,tableValues:null,target:null,targetX:z,targetY:z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ot,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:z,underlineThickness:z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:z,values:null,vAlphabetic:z,vMathematical:z,vectorEffect:null,vHanging:z,vIdeographic:z,version:null,vertAdvY:z,vertOriginX:z,vertOriginY:z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:pl}),gl=kn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),bl=kn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ml}),El=kn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),Kp={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"},Jp=/[A-Z]/g,Ma=/-[a-z]/g,em=/^data[-\w.:]+$/i;function Xr(t,e){const n=nr(e);let r=e,s=rt;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&em.test(e)){if(e.charAt(4)==="-"){const i=e.slice(5).replace(Ma,nm);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=e.slice(4);if(!Ma.test(i)){let a=i.replace(Jp,tm);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}s=wi}return new s(r,e)}function tm(t){return"-"+t.toLowerCase()}function nm(t){return t.charAt(1).toUpperCase()}const pr=fl([hl,Xp,gl,bl,El],"html"),$t=fl([hl,Zp,gl,bl,El],"svg");function Ba(t){const e=String(t||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function Tl(t){return t.join(" ").trim()}var ln={},ps,Fa;function rm(){if(Fa)return ps;Fa=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,u=/^\s+|\s+$/g,l=`
77
- `,o="/",d="*",f="",p="comment",h="declaration";function g(T,E){if(typeof T!="string")throw new TypeError("First argument must be a string");if(!T)return[];E=E||{};var A=1,b=1;function w(q){var U=q.match(e);U&&(A+=U.length);var W=q.lastIndexOf(l);b=~W?q.length-W:b+q.length}function R(){var q={line:A,column:b};return function(U){return U.position=new I(q),P(),U}}function I(q){this.start=q,this.end={line:A,column:b},this.source=E.source}I.prototype.content=T;function L(q){var U=new Error(E.source+":"+A+":"+b+": "+q);if(U.reason=q,U.filename=E.source,U.line=A,U.column=b,U.source=T,!E.silent)throw U}function M(q){var U=q.exec(T);if(U){var W=U[0];return w(W),T=T.slice(W.length),U}}function P(){M(n)}function S(q){var U;for(q=q||[];U=B();)U!==!1&&q.push(U);return q}function B(){var q=R();if(!(o!=T.charAt(0)||d!=T.charAt(1))){for(var U=2;f!=T.charAt(U)&&(d!=T.charAt(U)||o!=T.charAt(U+1));)++U;if(U+=2,f===T.charAt(U-1))return L("End of comment missing");var W=T.slice(2,U-2);return b+=2,w(W),T=T.slice(U),b+=2,q({type:p,comment:W})}}function $(){var q=R(),U=M(r);if(U){if(B(),!M(s))return L("property missing ':'");var W=M(i),V=q({type:h,property:_(U[0].replace(t,f)),value:W?_(W[0].replace(t,f)):f});return M(a),V}}function X(){var q=[];S(q);for(var U;U=$();)U!==!1&&(q.push(U),S(q));return q}return P(),X()}function _(T){return T?T.replace(u,f):f}return ps=g,ps}var Ua;function sm(){if(Ua)return ln;Ua=1;var t=ln&&ln.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ln,"__esModule",{value:!0}),ln.default=n;const e=t(rm());function n(r,s){let i=null;if(!r||typeof r!="string")return i;const a=(0,e.default)(r),u=typeof s=="function";return a.forEach(l=>{if(l.type!=="declaration")return;const{property:o,value:d}=l;u?s(o,d,l):d&&(i=i||{},i[o]=d)}),i}return ln}var On={},Ha;function im(){if(Ha)return On;Ha=1,Object.defineProperty(On,"__esModule",{value:!0}),On.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,i=function(o){return!o||n.test(o)||t.test(o)},a=function(o,d){return d.toUpperCase()},u=function(o,d){return"".concat(d,"-")},l=function(o,d){return d===void 0&&(d={}),i(o)?o:(o=o.toLowerCase(),d.reactCompat?o=o.replace(s,u):o=o.replace(r,u),o.replace(e,a))};return On.camelCase=l,On}var Ln,ja;function am(){if(ja)return Ln;ja=1;var t=Ln&&Ln.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},e=t(sm()),n=im();function r(s,i){var a={};return!s||typeof s!="string"||(0,e.default)(s,function(u,l){u&&l&&(a[(0,n.camelCase)(u,i)]=l)}),a}return r.default=r,Ln=r,Ln}var um=am();const om=ai(um),Zr=xl("end"),It=xl("start");function xl(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function lm(t){const e=It(t),n=Zr(t);if(e&&n)return{start:e,end:n}}function $n(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?za(t.position):"start"in t||"end"in t?za(t):"line"in t||"column"in t?Gs(t):""}function Gs(t){return $a(t&&t.line)+":"+$a(t&&t.column)}function za(t){return Gs(t&&t.start)+"-"+Gs(t&&t.end)}function $a(t){return t&&typeof t=="number"?t:1}class qe extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",i={},a=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof e=="string"?s=e:!i.cause&&e&&(a=!0,s=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const u=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=u?u.line:void 0,this.name=$n(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}qe.prototype.file="";qe.prototype.name="";qe.prototype.reason="";qe.prototype.message="";qe.prototype.stack="";qe.prototype.column=void 0;qe.prototype.line=void 0;qe.prototype.ancestors=void 0;qe.prototype.cause=void 0;qe.prototype.fatal=void 0;qe.prototype.place=void 0;qe.prototype.ruleId=void 0;qe.prototype.source=void 0;const Ri={}.hasOwnProperty,cm=new Map,dm=/[A-Z]/g,fm=new Set(["table","tbody","thead","tfoot","tr"]),hm=new Set(["td","th"]),_l="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function pm(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=ym(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=_m(n,e.jsx,e.jsxs)}const s={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?$t:pr,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},i=yl(s,t,void 0);return i&&typeof i!="string"?i:s.create(t,s.Fragment,{children:i||void 0},void 0)}function yl(t,e,n){if(e.type==="element")return mm(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return gm(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return Em(t,e,n);if(e.type==="mdxjsEsm")return bm(t,e);if(e.type==="root")return Tm(t,e,n);if(e.type==="text")return xm(t,e)}function mm(t,e,n){const r=t.schema;let s=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=$t,t.schema=s),t.ancestors.push(e);const i=kl(t,e.tagName,!1),a=Am(t,e);let u=Li(t,e);return fm.has(e.tagName)&&(u=u.filter(function(l){return typeof l=="string"?!Wp(l):!0})),Al(t,a,i,e),Oi(a,u),t.ancestors.pop(),t.schema=r,t.create(e,i,a,n)}function gm(t,e){if(e.data&&e.data.estree&&t.evaluater){const r=e.data.estree.body[0];return r.type,t.evaluater.evaluateExpression(r.expression)}rr(t,e.position)}function bm(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);rr(t,e.position)}function Em(t,e,n){const r=t.schema;let s=r;e.name==="svg"&&r.space==="html"&&(s=$t,t.schema=s),t.ancestors.push(e);const i=e.name===null?t.Fragment:kl(t,e.name,!0),a=km(t,e),u=Li(t,e);return Al(t,a,i,e),Oi(a,u),t.ancestors.pop(),t.schema=r,t.create(e,i,a,n)}function Tm(t,e,n){const r={};return Oi(r,Li(t,e)),t.create(e,t.Fragment,r,n)}function xm(t,e){return e.value}function Al(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function Oi(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function _m(t,e,n){return r;function r(s,i,a,u){const o=Array.isArray(a.children)?n:e;return u?o(i,a,u):o(i,a)}}function ym(t,e){return n;function n(r,s,i,a){const u=Array.isArray(i.children),l=It(r);return e(s,i,a,u,{columnNumber:l?l.column-1:void 0,fileName:t,lineNumber:l?l.line:void 0},void 0)}}function Am(t,e){const n={};let r,s;for(s in e.properties)if(s!=="children"&&Ri.call(e.properties,s)){const i=Cm(t,s,e.properties[s]);if(i){const[a,u]=i;t.tableCellAlignToStyle&&a==="align"&&typeof u=="string"&&hm.has(e.tagName)?r=u:n[a]=u}}if(r){const i=n.style||(n.style={});i[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function km(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const i=r.data.estree.body[0];i.type;const a=i.expression;a.type;const u=a.properties[0];u.type,Object.assign(n,t.evaluater.evaluateExpression(u.argument))}else rr(t,e.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const u=r.value.data.estree.body[0];u.type,i=t.evaluater.evaluateExpression(u.expression)}else rr(t,e.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function Li(t,e){const n=[];let r=-1;const s=t.passKeys?new Map:cm;for(;++r<e.children.length;){const i=e.children[r];let a;if(t.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const o=s.get(l)||0;a=l+"-"+o,s.set(l,o+1)}}const u=yl(t,i,a);u!==void 0&&n.push(u)}return n}function Cm(t,e,n){const r=Xr(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?dl(n):Tl(n)),r.property==="style"){let s=typeof n=="object"?n:Im(t,String(n));return t.stylePropertyNameCase==="css"&&(s=Nm(s)),["style",s]}return[t.elementAttributeNameCase==="react"&&r.space?Kp[r.property]||r.property:r.attribute,n]}}function Im(t,e){try{return om(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const r=n,s=new qe("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=t.filePath||void 0,s.url=_l+"#cannot-parse-style-attribute",s}}function kl(t,e,n){let r;if(!n)r={type:"Literal",value:e};else if(e.includes(".")){const s=e.split(".");let i=-1,a;for(;++i<s.length;){const u=va(s[i])?{type:"Identifier",name:s[i]}:{type:"Literal",value:s[i]};a=a?{type:"MemberExpression",object:a,property:u,computed:!!(i&&u.type==="Literal"),optional:!1}:u}r=a}else r=va(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(r.type==="Literal"){const s=r.value;return Ri.call(t.components,s)?t.components[s]:s}if(t.evaluater)return t.evaluater.evaluateExpression(r);rr(t)}function rr(t,e){const n=new qe("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=_l+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Nm(t){const e={};let n;for(n in t)Ri.call(t,n)&&(e[Sm(n)]=t[n]);return e}function Sm(t){let e=t.replace(dm,wm);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function wm(t){return"-"+t.toLowerCase()}const ms={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Rm={};function vi(t,e){const n=Rm,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Cl(t,r,s)}function Cl(t,e,n){if(Om(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return Ya(t.children,e,n)}return Array.isArray(t)?Ya(t,e,n):""}function Ya(t,e,n){const r=[];let s=-1;for(;++s<t.length;)r[s]=Cl(t[s],e,n);return r.join("")}function Om(t){return!!(t&&typeof t=="object")}const qa=document.createElement("i");function Di(t){const e="&"+t+";";qa.innerHTML=e;const n=qa.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function lt(t,e,n,r){const s=t.length;let i=0,a;if(e<0?e=-e>s?0:s+e:e=e>s?s:e,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(e,n),t.splice(...a);else for(n&&t.splice(e,n);i<r.length;)a=r.slice(i,i+1e4),a.unshift(e,0),t.splice(...a),i+=1e4,e+=1e4}function ht(t,e){return t.length>0?(lt(t,t.length,0,e),t):e}const Va={}.hasOwnProperty;function Il(t){const e={};let n=-1;for(;++n<t.length;)Lm(e,t[n]);return e}function Lm(t,e){let n;for(n in e){const s=(Va.call(t,n)?t[n]:void 0)||(t[n]={}),i=e[n];let a;if(i)for(a in i){Va.call(s,a)||(s[a]=[]);const u=i[a];vm(s[a],Array.isArray(u)?u:u?[u]:[])}}}function vm(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);lt(t,0,0,r)}function Nl(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function bt(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ze=Yt(/[A-Za-z]/),Ye=Yt(/[\dA-Za-z]/),Dm=Yt(/[#-'*+\--9=?A-Z^-~]/);function Br(t){return t!==null&&(t<32||t===127)}const Ws=Yt(/\d/),Pm=Yt(/[\dA-Fa-f]/),Mm=Yt(/[!-/:-@[-`{-~]/);function ee(t){return t!==null&&t<-2}function xe(t){return t!==null&&(t<0||t===32)}function oe(t){return t===-2||t===-1||t===32}const Kr=Yt(new RegExp("\\p{P}|\\p{S}","u")),nn=Yt(/\s/);function Yt(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Cn(t){const e=[];let n=-1,r=0,s=0;for(;++n<t.length;){const i=t.charCodeAt(n);let a="";if(i===37&&Ye(t.charCodeAt(n+1))&&Ye(t.charCodeAt(n+2)))s=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){const u=t.charCodeAt(n+1);i<56320&&u>56319&&u<57344?(a=String.fromCharCode(i,u),s=1):a="�"}else a=String.fromCharCode(i);a&&(e.push(t.slice(r,n),encodeURIComponent(a)),r=n+s+1,a=""),s&&(n+=s,s=0)}return e.join("")+t.slice(r)}function de(t,e,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(l){return oe(l)?(t.enter(n),u(l)):e(l)}function u(l){return oe(l)&&i++<s?(t.consume(l),u):(t.exit(n),e(l))}}const Bm={tokenize:Fm};function Fm(t){const e=t.attempt(this.parser.constructs.contentInitial,r,s);let n;return e;function r(u){if(u===null){t.consume(u);return}return t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),de(t,e,"linePrefix")}function s(u){return t.enter("paragraph"),i(u)}function i(u){const l=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(u)}function a(u){if(u===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(u);return}return ee(u)?(t.consume(u),t.exit("chunkText"),i):(t.consume(u),a)}}const Um={tokenize:Hm},Ga={tokenize:jm};function Hm(t){const e=this,n=[];let r=0,s,i,a;return u;function u(b){if(r<n.length){const w=n[r];return e.containerState=w[1],t.attempt(w[0].continuation,l,o)(b)}return o(b)}function l(b){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,s&&A();const w=e.events.length;let R=w,I;for(;R--;)if(e.events[R][0]==="exit"&&e.events[R][1].type==="chunkFlow"){I=e.events[R][1].end;break}E(r);let L=w;for(;L<e.events.length;)e.events[L][1].end={...I},L++;return lt(e.events,R+1,0,e.events.slice(w)),e.events.length=L,o(b)}return u(b)}function o(b){if(r===n.length){if(!s)return p(b);if(s.currentConstruct&&s.currentConstruct.concrete)return g(b);e.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(Ga,d,f)(b)}function d(b){return s&&A(),E(r),p(b)}function f(b){return e.parser.lazy[e.now().line]=r!==n.length,a=e.now().offset,g(b)}function p(b){return e.containerState={},t.attempt(Ga,h,g)(b)}function h(b){return r++,n.push([e.currentConstruct,e.containerState]),p(b)}function g(b){if(b===null){s&&A(),E(0),t.consume(b);return}return s=s||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:i}),_(b)}function _(b){if(b===null){T(t.exit("chunkFlow"),!0),E(0),t.consume(b);return}return ee(b)?(t.consume(b),T(t.exit("chunkFlow")),r=0,e.interrupt=void 0,u):(t.consume(b),_)}function T(b,w){const R=e.sliceStream(b);if(w&&R.push(null),b.previous=i,i&&(i.next=b),i=b,s.defineSkip(b.start),s.write(R),e.parser.lazy[b.start.line]){let I=s.events.length;for(;I--;)if(s.events[I][1].start.offset<a&&(!s.events[I][1].end||s.events[I][1].end.offset>a))return;const L=e.events.length;let M=L,P,S;for(;M--;)if(e.events[M][0]==="exit"&&e.events[M][1].type==="chunkFlow"){if(P){S=e.events[M][1].end;break}P=!0}for(E(r),I=L;I<e.events.length;)e.events[I][1].end={...S},I++;lt(e.events,M+1,0,e.events.slice(L)),e.events.length=I}}function E(b){let w=n.length;for(;w-- >b;){const R=n[w];e.containerState=R[1],R[0].exit.call(e,t)}n.length=b}function A(){s.write([null]),i=void 0,s=void 0,e.containerState._closeFlow=void 0}}function jm(t,e,n){return de(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function bn(t){if(t===null||xe(t)||nn(t))return 1;if(Kr(t))return 2}function Jr(t,e,n){const r=[];let s=-1;for(;++s<t.length;){const i=t[s].resolveAll;i&&!r.includes(i)&&(e=i(e,n),r.push(i))}return e}const Qs={name:"attention",resolveAll:zm,tokenize:$m};function zm(t,e){let n=-1,r,s,i,a,u,l,o,d;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(r=n;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&e.sliceSerialize(t[r][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[r][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;l=t[r][1].end.offset-t[r][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const f={...t[r][1].end},p={...t[n][1].start};Wa(f,-l),Wa(p,l),a={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...t[r][1].end}},u={type:l>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:p},i={type:l>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},s={type:l>1?"strong":"emphasis",start:{...a.start},end:{...u.end}},t[r][1].end={...a.start},t[n][1].start={...u.end},o=[],t[r][1].end.offset-t[r][1].start.offset&&(o=ht(o,[["enter",t[r][1],e],["exit",t[r][1],e]])),o=ht(o,[["enter",s,e],["enter",a,e],["exit",a,e],["enter",i,e]]),o=ht(o,Jr(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),o=ht(o,[["exit",i,e],["enter",u,e],["exit",u,e],["exit",s,e]]),t[n][1].end.offset-t[n][1].start.offset?(d=2,o=ht(o,[["enter",t[n][1],e],["exit",t[n][1],e]])):d=0,lt(t,r-1,n-r+3,o),n=r+o.length-d-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function $m(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=bn(r);let i;return a;function a(l){return i=l,t.enter("attentionSequence"),u(l)}function u(l){if(l===i)return t.consume(l),u;const o=t.exit("attentionSequence"),d=bn(l),f=!d||d===2&&s||n.includes(l),p=!s||s===2&&d||n.includes(r);return o._open=!!(i===42?f:f&&(s||!p)),o._close=!!(i===42?p:p&&(d||!f)),e(l)}}function Wa(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const Ym={name:"autolink",tokenize:qm};function qm(t,e,n){let r=0;return s;function s(h){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(h),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),i}function i(h){return Ze(h)?(t.consume(h),a):h===64?n(h):o(h)}function a(h){return h===43||h===45||h===46||Ye(h)?(r=1,u(h)):o(h)}function u(h){return h===58?(t.consume(h),r=0,l):(h===43||h===45||h===46||Ye(h))&&r++<32?(t.consume(h),u):(r=0,o(h))}function l(h){return h===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(h),t.exit("autolinkMarker"),t.exit("autolink"),e):h===null||h===32||h===60||Br(h)?n(h):(t.consume(h),l)}function o(h){return h===64?(t.consume(h),d):Dm(h)?(t.consume(h),o):n(h)}function d(h){return Ye(h)?f(h):n(h)}function f(h){return h===46?(t.consume(h),r=0,d):h===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(h),t.exit("autolinkMarker"),t.exit("autolink"),e):p(h)}function p(h){if((h===45||Ye(h))&&r++<63){const g=h===45?p:f;return t.consume(h),g}return n(h)}}const mr={partial:!0,tokenize:Vm};function Vm(t,e,n){return r;function r(i){return oe(i)?de(t,s,"linePrefix")(i):s(i)}function s(i){return i===null||ee(i)?e(i):n(i)}}const Sl={continuation:{tokenize:Wm},exit:Qm,name:"blockQuote",tokenize:Gm};function Gm(t,e,n){const r=this;return s;function s(a){if(a===62){const u=r.containerState;return u.open||(t.enter("blockQuote",{_container:!0}),u.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(a),t.exit("blockQuoteMarker"),i}return n(a)}function i(a){return oe(a)?(t.enter("blockQuotePrefixWhitespace"),t.consume(a),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(a))}}function Wm(t,e,n){const r=this;return s;function s(a){return oe(a)?de(t,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):i(a)}function i(a){return t.attempt(Sl,e,n)(a)}}function Qm(t){t.exit("blockQuote")}const wl={name:"characterEscape",tokenize:Xm};function Xm(t,e,n){return r;function r(i){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(i),t.exit("escapeMarker"),s}function s(i){return Mm(i)?(t.enter("characterEscapeValue"),t.consume(i),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(i)}}const Rl={name:"characterReference",tokenize:Zm};function Zm(t,e,n){const r=this;let s=0,i,a;return u;function u(f){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),l}function l(f){return f===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(f),t.exit("characterReferenceMarkerNumeric"),o):(t.enter("characterReferenceValue"),i=31,a=Ye,d(f))}function o(f){return f===88||f===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(f),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),i=6,a=Pm,d):(t.enter("characterReferenceValue"),i=7,a=Ws,d(f))}function d(f){if(f===59&&s){const p=t.exit("characterReferenceValue");return a===Ye&&!Di(r.sliceSerialize(p))?n(f):(t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return a(f)&&s++<i?(t.consume(f),d):n(f)}}const Qa={partial:!0,tokenize:Jm},Xa={concrete:!0,name:"codeFenced",tokenize:Km};function Km(t,e,n){const r=this,s={partial:!0,tokenize:R};let i=0,a=0,u;return l;function l(I){return o(I)}function o(I){const L=r.events[r.events.length-1];return i=L&&L[1].type==="linePrefix"?L[2].sliceSerialize(L[1],!0).length:0,u=I,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),d(I)}function d(I){return I===u?(a++,t.consume(I),d):a<3?n(I):(t.exit("codeFencedFenceSequence"),oe(I)?de(t,f,"whitespace")(I):f(I))}function f(I){return I===null||ee(I)?(t.exit("codeFencedFence"),r.interrupt?e(I):t.check(Qa,_,w)(I)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),p(I))}function p(I){return I===null||ee(I)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),f(I)):oe(I)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),de(t,h,"whitespace")(I)):I===96&&I===u?n(I):(t.consume(I),p)}function h(I){return I===null||ee(I)?f(I):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),g(I))}function g(I){return I===null||ee(I)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),f(I)):I===96&&I===u?n(I):(t.consume(I),g)}function _(I){return t.attempt(s,w,T)(I)}function T(I){return t.enter("lineEnding"),t.consume(I),t.exit("lineEnding"),E}function E(I){return i>0&&oe(I)?de(t,A,"linePrefix",i+1)(I):A(I)}function A(I){return I===null||ee(I)?t.check(Qa,_,w)(I):(t.enter("codeFlowValue"),b(I))}function b(I){return I===null||ee(I)?(t.exit("codeFlowValue"),A(I)):(t.consume(I),b)}function w(I){return t.exit("codeFenced"),e(I)}function R(I,L,M){let P=0;return S;function S(U){return I.enter("lineEnding"),I.consume(U),I.exit("lineEnding"),B}function B(U){return I.enter("codeFencedFence"),oe(U)?de(I,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):$(U)}function $(U){return U===u?(I.enter("codeFencedFenceSequence"),X(U)):M(U)}function X(U){return U===u?(P++,I.consume(U),X):P>=a?(I.exit("codeFencedFenceSequence"),oe(U)?de(I,q,"whitespace")(U):q(U)):M(U)}function q(U){return U===null||ee(U)?(I.exit("codeFencedFence"),L(U)):M(U)}}}function Jm(t,e,n){const r=this;return s;function s(a){return a===null?n(a):(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}const gs={name:"codeIndented",tokenize:t1},e1={partial:!0,tokenize:n1};function t1(t,e,n){const r=this;return s;function s(o){return t.enter("codeIndented"),de(t,i,"linePrefix",5)(o)}function i(o){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(o):n(o)}function a(o){return o===null?l(o):ee(o)?t.attempt(e1,a,l)(o):(t.enter("codeFlowValue"),u(o))}function u(o){return o===null||ee(o)?(t.exit("codeFlowValue"),a(o)):(t.consume(o),u)}function l(o){return t.exit("codeIndented"),e(o)}}function n1(t,e,n){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?n(a):ee(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s):de(t,i,"linePrefix",5)(a)}function i(a){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?e(a):ee(a)?s(a):n(a)}}const r1={name:"codeText",previous:i1,resolve:s1,tokenize:a1};function s1(t){let e=t.length-4,n=3,r,s;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)s===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(s=r):(r===e||t[r][1].type==="lineEnding")&&(t[s][1].type="codeTextData",r!==s+2&&(t[s][1].end=t[r-1][1].end,t.splice(s+2,r-s-2),e-=r-s-2,r=s+2),s=void 0);return t}function i1(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function a1(t,e,n){let r=0,s,i;return a;function a(f){return t.enter("codeText"),t.enter("codeTextSequence"),u(f)}function u(f){return f===96?(t.consume(f),r++,u):(t.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(t.enter("space"),t.consume(f),t.exit("space"),l):f===96?(i=t.enter("codeTextSequence"),s=0,d(f)):ee(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),l):(t.enter("codeTextData"),o(f))}function o(f){return f===null||f===32||f===96||ee(f)?(t.exit("codeTextData"),l(f)):(t.consume(f),o)}function d(f){return f===96?(t.consume(f),s++,d):s===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(f)):(i.type="codeTextData",o(f))}}class u1{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const s=n||0;this.setCursor(Math.trunc(e));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&vn(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),vn(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),vn(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);vn(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);vn(this.left,n.reverse())}}}function vn(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function Ol(t){const e={};let n=-1,r,s,i,a,u,l,o;const d=new u1(t);for(;++n<d.length;){for(;n in e;)n=e[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,o1(d,n)),n=e[n],o=!0);else if(r[1]._container){for(i=n,s=void 0;i--;)if(a=d.get(i),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(s&&(d.get(s)[1].type="lineEndingBlank"),a[1].type="lineEnding",s=i);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;s&&(r[1].end={...d.get(s)[1].start},u=d.slice(s,n),u.unshift(r),d.splice(s,n-s+1,u))}}return lt(t,0,Number.POSITIVE_INFINITY,d.slice(0)),!o}function o1(t,e){const n=t.get(e)[1],r=t.get(e)[2];let s=e-1;const i=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const u=a.events,l=[],o={};let d,f,p=-1,h=n,g=0,_=0;const T=[_];for(;h;){for(;t.get(++s)[1]!==h;);i.push(s),h._tokenizer||(d=r.sliceStream(h),h.next||d.push(null),f&&a.defineSkip(h.start),h._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(d),h._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),f=h,h=h.next}for(h=n;++p<u.length;)u[p][0]==="exit"&&u[p-1][0]==="enter"&&u[p][1].type===u[p-1][1].type&&u[p][1].start.line!==u[p][1].end.line&&(_=p+1,T.push(_),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(a.events=[],h?(h._tokenizer=void 0,h.previous=void 0):T.pop(),p=T.length;p--;){const E=u.slice(T[p],T[p+1]),A=i.pop();l.push([A,A+E.length-1]),t.splice(A,2,E)}for(l.reverse(),p=-1;++p<l.length;)o[g+l[p][0]]=g+l[p][1],g+=l[p][1]-l[p][0]-1;return o}const l1={resolve:d1,tokenize:f1},c1={partial:!0,tokenize:h1};function d1(t){return Ol(t),t}function f1(t,e){let n;return r;function r(u){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),s(u)}function s(u){return u===null?i(u):ee(u)?t.check(c1,a,i)(u):(t.consume(u),s)}function i(u){return t.exit("chunkContent"),t.exit("content"),e(u)}function a(u){return t.consume(u),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function h1(t,e,n){const r=this;return s;function s(a){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),de(t,i,"linePrefix")}function i(a){if(a===null||ee(a))return n(a);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?e(a):t.interrupt(r.parser.constructs.flow,n,e)(a)}}function Ll(t,e,n,r,s,i,a,u,l){const o=l||Number.POSITIVE_INFINITY;let d=0;return f;function f(E){return E===60?(t.enter(r),t.enter(s),t.enter(i),t.consume(E),t.exit(i),p):E===null||E===32||E===41||Br(E)?n(E):(t.enter(r),t.enter(a),t.enter(u),t.enter("chunkString",{contentType:"string"}),_(E))}function p(E){return E===62?(t.enter(i),t.consume(E),t.exit(i),t.exit(s),t.exit(r),e):(t.enter(u),t.enter("chunkString",{contentType:"string"}),h(E))}function h(E){return E===62?(t.exit("chunkString"),t.exit(u),p(E)):E===null||E===60||ee(E)?n(E):(t.consume(E),E===92?g:h)}function g(E){return E===60||E===62||E===92?(t.consume(E),h):h(E)}function _(E){return!d&&(E===null||E===41||xe(E))?(t.exit("chunkString"),t.exit(u),t.exit(a),t.exit(r),e(E)):d<o&&E===40?(t.consume(E),d++,_):E===41?(t.consume(E),d--,_):E===null||E===32||E===40||Br(E)?n(E):(t.consume(E),E===92?T:_)}function T(E){return E===40||E===41||E===92?(t.consume(E),_):_(E)}}function vl(t,e,n,r,s,i){const a=this;let u=0,l;return o;function o(h){return t.enter(r),t.enter(s),t.consume(h),t.exit(s),t.enter(i),d}function d(h){return u>999||h===null||h===91||h===93&&!l||h===94&&!u&&"_hiddenFootnoteSupport"in a.parser.constructs?n(h):h===93?(t.exit(i),t.enter(s),t.consume(h),t.exit(s),t.exit(r),e):ee(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),d):(t.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||ee(h)||u++>999?(t.exit("chunkString"),d(h)):(t.consume(h),l||(l=!oe(h)),h===92?p:f)}function p(h){return h===91||h===92||h===93?(t.consume(h),u++,f):f(h)}}function Dl(t,e,n,r,s,i){let a;return u;function u(p){return p===34||p===39||p===40?(t.enter(r),t.enter(s),t.consume(p),t.exit(s),a=p===40?41:p,l):n(p)}function l(p){return p===a?(t.enter(s),t.consume(p),t.exit(s),t.exit(r),e):(t.enter(i),o(p))}function o(p){return p===a?(t.exit(i),l(a)):p===null?n(p):ee(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),de(t,o,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===a||p===null||ee(p)?(t.exit("chunkString"),o(p)):(t.consume(p),p===92?f:d)}function f(p){return p===a||p===92?(t.consume(p),d):d(p)}}function Yn(t,e){let n;return r;function r(s){return ee(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),n=!0,r):oe(s)?de(t,r,n?"linePrefix":"lineSuffix")(s):e(s)}}const p1={name:"definition",tokenize:g1},m1={partial:!0,tokenize:b1};function g1(t,e,n){const r=this;let s;return i;function i(h){return t.enter("definition"),a(h)}function a(h){return vl.call(r,t,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function u(h){return s=bt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(t.enter("definitionMarker"),t.consume(h),t.exit("definitionMarker"),l):n(h)}function l(h){return xe(h)?Yn(t,o)(h):o(h)}function o(h){return Ll(t,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function d(h){return t.attempt(m1,f,f)(h)}function f(h){return oe(h)?de(t,p,"whitespace")(h):p(h)}function p(h){return h===null||ee(h)?(t.exit("definition"),r.parser.defined.push(s),e(h)):n(h)}}function b1(t,e,n){return r;function r(u){return xe(u)?Yn(t,s)(u):n(u)}function s(u){return Dl(t,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function i(u){return oe(u)?de(t,a,"whitespace")(u):a(u)}function a(u){return u===null||ee(u)?e(u):n(u)}}const E1={name:"hardBreakEscape",tokenize:T1};function T1(t,e,n){return r;function r(i){return t.enter("hardBreakEscape"),t.consume(i),s}function s(i){return ee(i)?(t.exit("hardBreakEscape"),e(i)):n(i)}}const x1={name:"headingAtx",resolve:_1,tokenize:y1};function _1(t,e){let n=t.length-2,r=3,s,i;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},i={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},lt(t,r,n-r+1,[["enter",s,e],["enter",i,e],["exit",i,e],["exit",s,e]])),t}function y1(t,e,n){let r=0;return s;function s(d){return t.enter("atxHeading"),i(d)}function i(d){return t.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&r++<6?(t.consume(d),a):d===null||xe(d)?(t.exit("atxHeadingSequence"),u(d)):n(d)}function u(d){return d===35?(t.enter("atxHeadingSequence"),l(d)):d===null||ee(d)?(t.exit("atxHeading"),e(d)):oe(d)?de(t,u,"whitespace")(d):(t.enter("atxHeadingText"),o(d))}function l(d){return d===35?(t.consume(d),l):(t.exit("atxHeadingSequence"),u(d))}function o(d){return d===null||d===35||xe(d)?(t.exit("atxHeadingText"),u(d)):(t.consume(d),o)}}const A1=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Za=["pre","script","style","textarea"],k1={concrete:!0,name:"htmlFlow",resolveTo:N1,tokenize:S1},C1={partial:!0,tokenize:R1},I1={partial:!0,tokenize:w1};function N1(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function S1(t,e,n){const r=this;let s,i,a,u,l;return o;function o(N){return d(N)}function d(N){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(N),f}function f(N){return N===33?(t.consume(N),p):N===47?(t.consume(N),i=!0,_):N===63?(t.consume(N),s=3,r.interrupt?e:k):Ze(N)?(t.consume(N),a=String.fromCharCode(N),T):n(N)}function p(N){return N===45?(t.consume(N),s=2,h):N===91?(t.consume(N),s=5,u=0,g):Ze(N)?(t.consume(N),s=4,r.interrupt?e:k):n(N)}function h(N){return N===45?(t.consume(N),r.interrupt?e:k):n(N)}function g(N){const Ee="CDATA[";return N===Ee.charCodeAt(u++)?(t.consume(N),u===Ee.length?r.interrupt?e:$:g):n(N)}function _(N){return Ze(N)?(t.consume(N),a=String.fromCharCode(N),T):n(N)}function T(N){if(N===null||N===47||N===62||xe(N)){const Ee=N===47,ve=a.toLowerCase();return!Ee&&!i&&Za.includes(ve)?(s=1,r.interrupt?e(N):$(N)):A1.includes(a.toLowerCase())?(s=6,Ee?(t.consume(N),E):r.interrupt?e(N):$(N)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):i?A(N):b(N))}return N===45||Ye(N)?(t.consume(N),a+=String.fromCharCode(N),T):n(N)}function E(N){return N===62?(t.consume(N),r.interrupt?e:$):n(N)}function A(N){return oe(N)?(t.consume(N),A):S(N)}function b(N){return N===47?(t.consume(N),S):N===58||N===95||Ze(N)?(t.consume(N),w):oe(N)?(t.consume(N),b):S(N)}function w(N){return N===45||N===46||N===58||N===95||Ye(N)?(t.consume(N),w):R(N)}function R(N){return N===61?(t.consume(N),I):oe(N)?(t.consume(N),R):b(N)}function I(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(t.consume(N),l=N,L):oe(N)?(t.consume(N),I):M(N)}function L(N){return N===l?(t.consume(N),l=null,P):N===null||ee(N)?n(N):(t.consume(N),L)}function M(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||xe(N)?R(N):(t.consume(N),M)}function P(N){return N===47||N===62||oe(N)?b(N):n(N)}function S(N){return N===62?(t.consume(N),B):n(N)}function B(N){return N===null||ee(N)?$(N):oe(N)?(t.consume(N),B):n(N)}function $(N){return N===45&&s===2?(t.consume(N),W):N===60&&s===1?(t.consume(N),V):N===62&&s===4?(t.consume(N),re):N===63&&s===3?(t.consume(N),k):N===93&&s===5?(t.consume(N),J):ee(N)&&(s===6||s===7)?(t.exit("htmlFlowData"),t.check(C1,he,X)(N)):N===null||ee(N)?(t.exit("htmlFlowData"),X(N)):(t.consume(N),$)}function X(N){return t.check(I1,q,he)(N)}function q(N){return t.enter("lineEnding"),t.consume(N),t.exit("lineEnding"),U}function U(N){return N===null||ee(N)?X(N):(t.enter("htmlFlowData"),$(N))}function W(N){return N===45?(t.consume(N),k):$(N)}function V(N){return N===47?(t.consume(N),a="",K):$(N)}function K(N){if(N===62){const Ee=a.toLowerCase();return Za.includes(Ee)?(t.consume(N),re):$(N)}return Ze(N)&&a.length<8?(t.consume(N),a+=String.fromCharCode(N),K):$(N)}function J(N){return N===93?(t.consume(N),k):$(N)}function k(N){return N===62?(t.consume(N),re):N===45&&s===2?(t.consume(N),k):$(N)}function re(N){return N===null||ee(N)?(t.exit("htmlFlowData"),he(N)):(t.consume(N),re)}function he(N){return t.exit("htmlFlow"),e(N)}}function w1(t,e,n){const r=this;return s;function s(a){return ee(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i):n(a)}function i(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}function R1(t,e,n){return r;function r(s){return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),t.attempt(mr,e,n)}}const O1={name:"htmlText",tokenize:L1};function L1(t,e,n){const r=this;let s,i,a;return u;function u(k){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(k),l}function l(k){return k===33?(t.consume(k),o):k===47?(t.consume(k),R):k===63?(t.consume(k),b):Ze(k)?(t.consume(k),M):n(k)}function o(k){return k===45?(t.consume(k),d):k===91?(t.consume(k),i=0,g):Ze(k)?(t.consume(k),A):n(k)}function d(k){return k===45?(t.consume(k),h):n(k)}function f(k){return k===null?n(k):k===45?(t.consume(k),p):ee(k)?(a=f,V(k)):(t.consume(k),f)}function p(k){return k===45?(t.consume(k),h):f(k)}function h(k){return k===62?W(k):k===45?p(k):f(k)}function g(k){const re="CDATA[";return k===re.charCodeAt(i++)?(t.consume(k),i===re.length?_:g):n(k)}function _(k){return k===null?n(k):k===93?(t.consume(k),T):ee(k)?(a=_,V(k)):(t.consume(k),_)}function T(k){return k===93?(t.consume(k),E):_(k)}function E(k){return k===62?W(k):k===93?(t.consume(k),E):_(k)}function A(k){return k===null||k===62?W(k):ee(k)?(a=A,V(k)):(t.consume(k),A)}function b(k){return k===null?n(k):k===63?(t.consume(k),w):ee(k)?(a=b,V(k)):(t.consume(k),b)}function w(k){return k===62?W(k):b(k)}function R(k){return Ze(k)?(t.consume(k),I):n(k)}function I(k){return k===45||Ye(k)?(t.consume(k),I):L(k)}function L(k){return ee(k)?(a=L,V(k)):oe(k)?(t.consume(k),L):W(k)}function M(k){return k===45||Ye(k)?(t.consume(k),M):k===47||k===62||xe(k)?P(k):n(k)}function P(k){return k===47?(t.consume(k),W):k===58||k===95||Ze(k)?(t.consume(k),S):ee(k)?(a=P,V(k)):oe(k)?(t.consume(k),P):W(k)}function S(k){return k===45||k===46||k===58||k===95||Ye(k)?(t.consume(k),S):B(k)}function B(k){return k===61?(t.consume(k),$):ee(k)?(a=B,V(k)):oe(k)?(t.consume(k),B):P(k)}function $(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(t.consume(k),s=k,X):ee(k)?(a=$,V(k)):oe(k)?(t.consume(k),$):(t.consume(k),q)}function X(k){return k===s?(t.consume(k),s=void 0,U):k===null?n(k):ee(k)?(a=X,V(k)):(t.consume(k),X)}function q(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||xe(k)?P(k):(t.consume(k),q)}function U(k){return k===47||k===62||xe(k)?P(k):n(k)}function W(k){return k===62?(t.consume(k),t.exit("htmlTextData"),t.exit("htmlText"),e):n(k)}function V(k){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(k),t.exit("lineEnding"),K}function K(k){return oe(k)?de(t,J,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):J(k)}function J(k){return t.enter("htmlTextData"),a(k)}}const Pi={name:"labelEnd",resolveAll:M1,resolveTo:B1,tokenize:F1},v1={tokenize:U1},D1={tokenize:H1},P1={tokenize:j1};function M1(t){let e=-1;const n=[];for(;++e<t.length;){const r=t[e][1];if(n.push(t[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const s=r.type==="labelImage"?4:2;r.type="data",e+=s}}return t.length!==n.length&&lt(t,0,t.length,n),t}function B1(t,e){let n=t.length,r=0,s,i,a,u;for(;n--;)if(s=t[n][1],i){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;t[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(a){if(t[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(i=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(a=n);const l={type:t[i][1].type==="labelLink"?"link":"image",start:{...t[i][1].start},end:{...t[t.length-1][1].end}},o={type:"label",start:{...t[i][1].start},end:{...t[a][1].end}},d={type:"labelText",start:{...t[i+r+2][1].end},end:{...t[a-2][1].start}};return u=[["enter",l,e],["enter",o,e]],u=ht(u,t.slice(i+1,i+r+3)),u=ht(u,[["enter",d,e]]),u=ht(u,Jr(e.parser.constructs.insideSpan.null,t.slice(i+r+4,a-3),e)),u=ht(u,[["exit",d,e],t[a-2],t[a-1],["exit",o,e]]),u=ht(u,t.slice(a+1)),u=ht(u,[["exit",l,e]]),lt(t,i,t.length,u),t}function F1(t,e,n){const r=this;let s=r.events.length,i,a;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){i=r.events[s][1];break}return u;function u(p){return i?i._inactive?f(p):(a=r.parser.defined.includes(bt(r.sliceSerialize({start:i.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(p),t.exit("labelMarker"),t.exit("labelEnd"),l):n(p)}function l(p){return p===40?t.attempt(v1,d,a?d:f)(p):p===91?t.attempt(D1,d,a?o:f)(p):a?d(p):f(p)}function o(p){return t.attempt(P1,d,f)(p)}function d(p){return e(p)}function f(p){return i._balanced=!0,n(p)}}function U1(t,e,n){return r;function r(f){return t.enter("resource"),t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),s}function s(f){return xe(f)?Yn(t,i)(f):i(f)}function i(f){return f===41?d(f):Ll(t,a,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function a(f){return xe(f)?Yn(t,l)(f):d(f)}function u(f){return n(f)}function l(f){return f===34||f===39||f===40?Dl(t,o,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function o(f){return xe(f)?Yn(t,d)(f):d(f)}function d(f){return f===41?(t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),t.exit("resource"),e):n(f)}}function H1(t,e,n){const r=this;return s;function s(u){return vl.call(r,t,i,a,"reference","referenceMarker","referenceString")(u)}function i(u){return r.parser.defined.includes(bt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(u):n(u)}function a(u){return n(u)}}function j1(t,e,n){return r;function r(i){return t.enter("reference"),t.enter("referenceMarker"),t.consume(i),t.exit("referenceMarker"),s}function s(i){return i===93?(t.enter("referenceMarker"),t.consume(i),t.exit("referenceMarker"),t.exit("reference"),e):n(i)}}const z1={name:"labelStartImage",resolveAll:Pi.resolveAll,tokenize:$1};function $1(t,e,n){const r=this;return s;function s(u){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(u),t.exit("labelImageMarker"),i}function i(u){return u===91?(t.enter("labelMarker"),t.consume(u),t.exit("labelMarker"),t.exit("labelImage"),a):n(u)}function a(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):e(u)}}const Y1={name:"labelStartLink",resolveAll:Pi.resolveAll,tokenize:q1};function q1(t,e,n){const r=this;return s;function s(a){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelLink"),i}function i(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):e(a)}}const bs={name:"lineEnding",tokenize:V1};function V1(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),de(t,e,"linePrefix")}}const wr={name:"thematicBreak",tokenize:G1};function G1(t,e,n){let r=0,s;return i;function i(o){return t.enter("thematicBreak"),a(o)}function a(o){return s=o,u(o)}function u(o){return o===s?(t.enter("thematicBreakSequence"),l(o)):r>=3&&(o===null||ee(o))?(t.exit("thematicBreak"),e(o)):n(o)}function l(o){return o===s?(t.consume(o),r++,l):(t.exit("thematicBreakSequence"),oe(o)?de(t,u,"whitespace")(o):u(o))}}const tt={continuation:{tokenize:Z1},exit:J1,name:"list",tokenize:X1},W1={partial:!0,tokenize:eg},Q1={partial:!0,tokenize:K1};function X1(t,e,n){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return u;function u(h){const g=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:Ws(h)){if(r.containerState.type||(r.containerState.type=g,t.enter(g,{_container:!0})),g==="listUnordered")return t.enter("listItemPrefix"),h===42||h===45?t.check(wr,n,o)(h):o(h);if(!r.interrupt||h===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(h)}return n(h)}function l(h){return Ws(h)&&++a<10?(t.consume(h),l):(!r.interrupt||a<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(t.exit("listItemValue"),o(h)):n(h)}function o(h){return t.enter("listItemMarker"),t.consume(h),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,t.check(mr,r.interrupt?n:d,t.attempt(W1,p,f))}function d(h){return r.containerState.initialBlankLine=!0,i++,p(h)}function f(h){return oe(h)?(t.enter("listItemPrefixWhitespace"),t.consume(h),t.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=i+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(h)}}function Z1(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(mr,s,i);function s(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,de(t,e,"listItemIndent",r.containerState.size+1)(u)}function i(u){return r.containerState.furtherBlankLines||!oe(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(Q1,e,a)(u))}function a(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,de(t,t.attempt(tt,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function K1(t,e,n){const r=this;return de(t,s,"listItemIndent",r.containerState.size+1);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?e(i):n(i)}}function J1(t){t.exit(this.containerState.type)}function eg(t,e,n){const r=this;return de(t,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const a=r.events[r.events.length-1];return!oe(i)&&a&&a[1].type==="listItemPrefixWhitespace"?e(i):n(i)}}const Ka={name:"setextUnderline",resolveTo:tg,tokenize:ng};function tg(t,e){let n=t.length,r,s,i;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(s=n)}else t[n][1].type==="content"&&t.splice(n,1),!i&&t[n][1].type==="definition"&&(i=n);const a={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[s][1].type="setextHeadingText",i?(t.splice(s,0,["enter",a,e]),t.splice(i+1,0,["exit",t[r][1],e]),t[r][1].end={...t[i][1].end}):t[r][1]=a,t.push(["exit",a,e]),t}function ng(t,e,n){const r=this;let s;return i;function i(o){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(t.enter("setextHeadingLine"),s=o,a(o)):n(o)}function a(o){return t.enter("setextHeadingLineSequence"),u(o)}function u(o){return o===s?(t.consume(o),u):(t.exit("setextHeadingLineSequence"),oe(o)?de(t,l,"lineSuffix")(o):l(o))}function l(o){return o===null||ee(o)?(t.exit("setextHeadingLine"),e(o)):n(o)}}const rg={tokenize:sg};function sg(t){const e=this,n=t.attempt(mr,r,t.attempt(this.parser.constructs.flowInitial,s,de(t,t.attempt(this.parser.constructs.flow,s,t.attempt(l1,s)),"linePrefix")));return n;function r(i){if(i===null){t.consume(i);return}return t.enter("lineEndingBlank"),t.consume(i),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function s(i){if(i===null){t.consume(i);return}return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const ig={resolveAll:Ml()},ag=Pl("string"),ug=Pl("text");function Pl(t){return{resolveAll:Ml(t==="text"?og:void 0),tokenize:e};function e(n){const r=this,s=this.parser.constructs[t],i=n.attempt(s,a,u);return a;function a(d){return o(d)?i(d):u(d)}function u(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return o(d)?(n.exit("data"),i(d)):(n.consume(d),l)}function o(d){if(d===null)return!0;const f=s[d];let p=-1;if(f)for(;++p<f.length;){const h=f[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function Ml(t){return e;function e(n,r){let s=-1,i;for(;++s<=n.length;)i===void 0?n[s]&&n[s][1].type==="data"&&(i=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==i+2&&(n[i][1].end=n[s-1][1].end,n.splice(i+2,s-i-2),s=i+2),i=void 0);return t?t(n,r):n}}function og(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const r=t[n-1][1],s=e.sliceStream(r);let i=s.length,a=-1,u=0,l;for(;i--;){const o=s[i];if(typeof o=="string"){for(a=o.length;o.charCodeAt(a-1)===32;)u++,a--;if(a)break;a=-1}else if(o===-2)l=!0,u++;else if(o!==-1){i++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(u=0),u){const o={type:n===t.length||l||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?a:r.start._bufferIndex+a,_index:r.start._index+i,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...o.start},r.start.offset===r.end.offset?Object.assign(r,o):(t.splice(n,0,["enter",o,e],["exit",o,e]),n+=2)}n++}return t}const lg={42:tt,43:tt,45:tt,48:tt,49:tt,50:tt,51:tt,52:tt,53:tt,54:tt,55:tt,56:tt,57:tt,62:Sl},cg={91:p1},dg={[-2]:gs,[-1]:gs,32:gs},fg={35:x1,42:wr,45:[Ka,wr],60:k1,61:Ka,95:wr,96:Xa,126:Xa},hg={38:Rl,92:wl},pg={[-5]:bs,[-4]:bs,[-3]:bs,33:z1,38:Rl,42:Qs,60:[Ym,O1],91:Y1,92:[E1,wl],93:Pi,95:Qs,96:r1},mg={null:[Qs,ig]},gg={null:[42,95]},bg={null:[]},Eg=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:gg,contentInitial:cg,disable:bg,document:lg,flow:fg,flowInitial:dg,insideSpan:mg,string:hg,text:pg},Symbol.toStringTag,{value:"Module"}));function Tg(t,e,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},i=[];let a=[],u=[];const l={attempt:L(R),check:L(I),consume:A,enter:b,exit:w,interrupt:L(I,{interrupt:!0})},o={code:null,containerState:{},defineSkip:_,events:[],now:g,parser:t,previous:null,sliceSerialize:p,sliceStream:h,write:f};let d=e.tokenize.call(o,l);return e.resolveAll&&i.push(e),o;function f(B){return a=ht(a,B),T(),a[a.length-1]!==null?[]:(M(e,0),o.events=Jr(i,o.events,o),o.events)}function p(B,$){return _g(h(B),$)}function h(B){return xg(a,B)}function g(){const{_bufferIndex:B,_index:$,line:X,column:q,offset:U}=r;return{_bufferIndex:B,_index:$,line:X,column:q,offset:U}}function _(B){s[B.line]=B.column,S()}function T(){let B;for(;r._index<a.length;){const $=a[r._index];if(typeof $=="string")for(B=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===B&&r._bufferIndex<$.length;)E($.charCodeAt(r._bufferIndex));else E($)}}function E(B){d=d(B)}function A(B){ee(B)?(r.line++,r.column=1,r.offset+=B===-3?2:1,S()):B!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),o.previous=B}function b(B,$){const X=$||{};return X.type=B,X.start=g(),o.events.push(["enter",X,o]),u.push(X),X}function w(B){const $=u.pop();return $.end=g(),o.events.push(["exit",$,o]),$}function R(B,$){M(B,$.from)}function I(B,$){$.restore()}function L(B,$){return X;function X(q,U,W){let V,K,J,k;return Array.isArray(q)?he(q):"tokenize"in q?he([q]):re(q);function re(fe){return Ge;function Ge(Ie){const Ne=Ie!==null&&fe[Ie],ye=Ie!==null&&fe.null,Fe=[...Array.isArray(Ne)?Ne:Ne?[Ne]:[],...Array.isArray(ye)?ye:ye?[ye]:[]];return he(Fe)(Ie)}}function he(fe){return V=fe,K=0,fe.length===0?W:N(fe[K])}function N(fe){return Ge;function Ge(Ie){return k=P(),J=fe,fe.partial||(o.currentConstruct=fe),fe.name&&o.parser.constructs.disable.null.includes(fe.name)?ve():fe.tokenize.call($?Object.assign(Object.create(o),$):o,l,Ee,ve)(Ie)}}function Ee(fe){return B(J,k),U}function ve(fe){return k.restore(),++K<V.length?N(V[K]):W}}}function M(B,$){B.resolveAll&&!i.includes(B)&&i.push(B),B.resolve&&lt(o.events,$,o.events.length-$,B.resolve(o.events.slice($),o)),B.resolveTo&&(o.events=B.resolveTo(o.events,o))}function P(){const B=g(),$=o.previous,X=o.currentConstruct,q=o.events.length,U=Array.from(u);return{from:q,restore:W};function W(){r=B,o.previous=$,o.currentConstruct=X,o.events.length=q,u=U,S()}}function S(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function xg(t,e){const n=e.start._index,r=e.start._bufferIndex,s=e.end._index,i=e.end._bufferIndex;let a;if(n===s)a=[t[n].slice(r,i)];else{if(a=t.slice(n,s),r>-1){const u=a[0];typeof u=="string"?a[0]=u.slice(r):a.shift()}i>0&&a.push(t[s].slice(0,i))}return a}function _g(t,e){let n=-1;const r=[];let s;for(;++n<t.length;){const i=t[n];let a;if(typeof i=="string")a=i;else switch(i){case-5:{a="\r";break}case-4:{a=`
76
+ Please report this to https://github.com/markedjs/marked.`,t){const r="<p>An error occurred:</p><pre>"+yt(n.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(n);throw n}}},tn=new $p;function ge(t,e){return tn.parse(t,e)}ge.options=ge.setOptions=function(t){return tn.setOptions(t),ge.defaults=tn.defaults,el(ge.defaults),ge};ge.getDefaults=xi;ge.defaults=rn;ge.use=function(...t){return tn.use(...t),ge.defaults=tn.defaults,el(ge.defaults),ge};ge.walkTokens=function(t,e){return tn.walkTokens(t,e)};ge.parseInline=tn.parseInline;ge.Parser=Ot;ge.parser=Ot.parse;ge.Renderer=Mr;ge.TextRenderer=Si;ge.Lexer=Rt;ge.lexer=Rt.lex;ge.Tokenizer=Pr;ge.Hooks=Sr;ge.parse=ge;ge.options;ge.setOptions;ge.use;ge.walkTokens;ge.parseInline;Ot.parse;Rt.lex;function La(t){const e=[],n=String(t||"");let r=n.indexOf(","),s=0,i=!1;for(;!i;){r===-1&&(r=n.length,i=!0);const a=n.slice(s,r).trim();(a||!i)&&e.push(a),s=r+1,r=n.indexOf(",",s)}return e}function dl(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Yp=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,qp=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Vp={};function va(t,e){return(Vp.jsx?qp:Yp).test(t)}const Gp=/[ \t\n\f\r]/g;function Wp(t){return typeof t=="object"?t.type==="text"?Da(t.value):!1:Da(t)}function Da(t){return t.replace(Gp,"")===""}class hr{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}hr.prototype.normal={};hr.prototype.property={};hr.prototype.space=void 0;function fl(t,e){const n={},r={};for(const s of t)Object.assign(n,s.property),Object.assign(r,s.normal);return new hr(n,r,e)}function nr(t){return t.toLowerCase()}class rt{constructor(e,n){this.attribute=n,this.property=e}}rt.prototype.attribute="";rt.prototype.booleanish=!1;rt.prototype.boolean=!1;rt.prototype.commaOrSpaceSeparated=!1;rt.prototype.commaSeparated=!1;rt.prototype.defined=!1;rt.prototype.mustUseProperty=!1;rt.prototype.number=!1;rt.prototype.overloadedBoolean=!1;rt.prototype.property="";rt.prototype.spaceSeparated=!1;rt.prototype.space=void 0;let Qp=0;const ie=sn(),Le=sn(),qs=sn(),z=sn(),_e=sn(),mn=sn(),ot=sn();function sn(){return 2**++Qp}const Vs=Object.freeze(Object.defineProperty({__proto__:null,boolean:ie,booleanish:Le,commaOrSpaceSeparated:ot,commaSeparated:mn,number:z,overloadedBoolean:qs,spaceSeparated:_e},Symbol.toStringTag,{value:"Module"})),hs=Object.keys(Vs);class wi extends rt{constructor(e,n,r,s){let i=-1;if(super(e,n),Pa(this,"space",s),typeof r=="number")for(;++i<hs.length;){const a=hs[i];Pa(this,hs[i],(r&Vs[a])===Vs[a])}}}wi.prototype.defined=!0;function Pa(t,e,n){n&&(t[e]=n)}function kn(t){const e={},n={};for(const[r,s]of Object.entries(t.properties)){const i=new wi(r,t.transform(t.attributes||{},r),s,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),e[r]=i,n[nr(r)]=r,n[nr(i.attribute)]=r}return new hr(e,n,t.space)}const hl=kn({properties:{ariaActiveDescendant:null,ariaAtomic:Le,ariaAutoComplete:null,ariaBusy:Le,ariaChecked:Le,ariaColCount:z,ariaColIndex:z,ariaColSpan:z,ariaControls:_e,ariaCurrent:null,ariaDescribedBy:_e,ariaDetails:null,ariaDisabled:Le,ariaDropEffect:_e,ariaErrorMessage:null,ariaExpanded:Le,ariaFlowTo:_e,ariaGrabbed:Le,ariaHasPopup:null,ariaHidden:Le,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:_e,ariaLevel:z,ariaLive:null,ariaModal:Le,ariaMultiLine:Le,ariaMultiSelectable:Le,ariaOrientation:null,ariaOwns:_e,ariaPlaceholder:null,ariaPosInSet:z,ariaPressed:Le,ariaReadOnly:Le,ariaRelevant:null,ariaRequired:Le,ariaRoleDescription:_e,ariaRowCount:z,ariaRowIndex:z,ariaRowSpan:z,ariaSelected:Le,ariaSetSize:z,ariaSort:null,ariaValueMax:z,ariaValueMin:z,ariaValueNow:z,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function pl(t,e){return e in t?t[e]:e}function ml(t,e){return pl(t,e.toLowerCase())}const Xp=kn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:mn,acceptCharset:_e,accessKey:_e,action:null,allow:null,allowFullScreen:ie,allowPaymentRequest:ie,allowUserMedia:ie,alt:null,as:null,async:ie,autoCapitalize:null,autoComplete:_e,autoFocus:ie,autoPlay:ie,blocking:_e,capture:null,charSet:null,checked:ie,cite:null,className:_e,cols:z,colSpan:null,content:null,contentEditable:Le,controls:ie,controlsList:_e,coords:z|mn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ie,defer:ie,dir:null,dirName:null,disabled:ie,download:qs,draggable:Le,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ie,formTarget:null,headers:_e,height:z,hidden:qs,high:z,href:null,hrefLang:null,htmlFor:_e,httpEquiv:_e,id:null,imageSizes:null,imageSrcSet:null,inert:ie,inputMode:null,integrity:null,is:null,isMap:ie,itemId:null,itemProp:_e,itemRef:_e,itemScope:ie,itemType:_e,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ie,low:z,manifest:null,max:null,maxLength:z,media:null,method:null,min:null,minLength:z,multiple:ie,muted:ie,name:null,nonce:null,noModule:ie,noValidate:ie,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:ie,optimum:z,pattern:null,ping:_e,placeholder:null,playsInline:ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ie,referrerPolicy:null,rel:_e,required:ie,reversed:ie,rows:z,rowSpan:z,sandbox:_e,scope:null,scoped:ie,seamless:ie,selected:ie,shadowRootClonable:ie,shadowRootDelegatesFocus:ie,shadowRootMode:null,shape:null,size:z,sizes:null,slot:null,span:z,spellCheck:Le,src:null,srcDoc:null,srcLang:null,srcSet:null,start:z,step:null,style:null,tabIndex:z,target:null,title:null,translate:null,type:null,typeMustMatch:ie,useMap:null,value:Le,width:z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:_e,axis:null,background:null,bgColor:null,border:z,borderColor:null,bottomMargin:z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ie,declare:ie,event:null,face:null,frame:null,frameBorder:null,hSpace:z,leftMargin:z,link:null,longDesc:null,lowSrc:null,marginHeight:z,marginWidth:z,noResize:ie,noHref:ie,noShade:ie,noWrap:ie,object:null,profile:null,prompt:null,rev:null,rightMargin:z,rules:null,scheme:null,scrolling:Le,standby:null,summary:null,text:null,topMargin:z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:z,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ie,disableRemotePlayback:ie,prefix:null,property:null,results:z,security:null,unselectable:null},space:"html",transform:ml}),Zp=kn({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:ot,accentHeight:z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:z,amplitude:z,arabicForm:null,ascent:z,attributeName:null,attributeType:null,azimuth:z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:z,by:null,calcMode:null,capHeight:z,className:_e,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:z,diffuseConstant:z,direction:null,display:null,dur:null,divisor:z,dominantBaseline:null,download:ie,dx:null,dy:null,edgeMode:null,editable:null,elevation:z,enableBackground:null,end:null,event:null,exponent:z,externalResourcesRequired:null,fill:null,fillOpacity:z,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:mn,g2:mn,glyphName:mn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:z,horizOriginX:z,horizOriginY:z,id:null,ideographic:z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:z,k:z,k1:z,k2:z,k3:z,k4:z,kernelMatrix:ot,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:z,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:z,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:z,overlineThickness:z,paintOrder:null,panose1:null,path:null,pathLength:z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:_e,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:z,pointsAtY:z,pointsAtZ:z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ot,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ot,rev:ot,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ot,requiredFeatures:ot,requiredFonts:ot,requiredFormats:ot,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:z,specularExponent:z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:z,strikethroughThickness:z,string:null,stroke:null,strokeDashArray:ot,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:z,strokeOpacity:z,strokeWidth:null,style:null,surfaceScale:z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ot,tabIndex:z,tableValues:null,target:null,targetX:z,targetY:z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ot,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:z,underlineThickness:z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:z,values:null,vAlphabetic:z,vMathematical:z,vectorEffect:null,vHanging:z,vIdeographic:z,version:null,vertAdvY:z,vertOriginX:z,vertOriginY:z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:pl}),gl=kn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),bl=kn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ml}),El=kn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),Kp={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"},Jp=/[A-Z]/g,Ma=/-[a-z]/g,em=/^data[-\w.:]+$/i;function Xr(t,e){const n=nr(e);let r=e,s=rt;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&em.test(e)){if(e.charAt(4)==="-"){const i=e.slice(5).replace(Ma,nm);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=e.slice(4);if(!Ma.test(i)){let a=i.replace(Jp,tm);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}s=wi}return new s(r,e)}function tm(t){return"-"+t.toLowerCase()}function nm(t){return t.charAt(1).toUpperCase()}const pr=fl([hl,Xp,gl,bl,El],"html"),$t=fl([hl,Zp,gl,bl,El],"svg");function Ba(t){const e=String(t||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function Tl(t){return t.join(" ").trim()}var ln={},ps,Fa;function rm(){if(Fa)return ps;Fa=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,u=/^\s+|\s+$/g,l=`
77
+ `,o="/",d="*",f="",p="comment",h="declaration";function g(T,E){if(typeof T!="string")throw new TypeError("First argument must be a string");if(!T)return[];E=E||{};var A=1,b=1;function w(q){var U=q.match(e);U&&(A+=U.length);var W=q.lastIndexOf(l);b=~W?q.length-W:b+q.length}function R(){var q={line:A,column:b};return function(U){return U.position=new I(q),P(),U}}function I(q){this.start=q,this.end={line:A,column:b},this.source=E.source}I.prototype.content=T;function L(q){var U=new Error(E.source+":"+A+":"+b+": "+q);if(U.reason=q,U.filename=E.source,U.line=A,U.column=b,U.source=T,!E.silent)throw U}function M(q){var U=q.exec(T);if(U){var W=U[0];return w(W),T=T.slice(W.length),U}}function P(){M(n)}function S(q){var U;for(q=q||[];U=B();)U!==!1&&q.push(U);return q}function B(){var q=R();if(!(o!=T.charAt(0)||d!=T.charAt(1))){for(var U=2;f!=T.charAt(U)&&(d!=T.charAt(U)||o!=T.charAt(U+1));)++U;if(U+=2,f===T.charAt(U-1))return L("End of comment missing");var W=T.slice(2,U-2);return b+=2,w(W),T=T.slice(U),b+=2,q({type:p,comment:W})}}function $(){var q=R(),U=M(r);if(U){if(B(),!M(s))return L("property missing ':'");var W=M(i),V=q({type:h,property:_(U[0].replace(t,f)),value:W?_(W[0].replace(t,f)):f});return M(a),V}}function X(){var q=[];S(q);for(var U;U=$();)U!==!1&&(q.push(U),S(q));return q}return P(),X()}function _(T){return T?T.replace(u,f):f}return ps=g,ps}var Ua;function sm(){if(Ua)return ln;Ua=1;var t=ln&&ln.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ln,"__esModule",{value:!0}),ln.default=n;const e=t(rm());function n(r,s){let i=null;if(!r||typeof r!="string")return i;const a=(0,e.default)(r),u=typeof s=="function";return a.forEach(l=>{if(l.type!=="declaration")return;const{property:o,value:d}=l;u?s(o,d,l):d&&(i=i||{},i[o]=d)}),i}return ln}var On={},Ha;function im(){if(Ha)return On;Ha=1,Object.defineProperty(On,"__esModule",{value:!0}),On.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,i=function(o){return!o||n.test(o)||t.test(o)},a=function(o,d){return d.toUpperCase()},u=function(o,d){return"".concat(d,"-")},l=function(o,d){return d===void 0&&(d={}),i(o)?o:(o=o.toLowerCase(),d.reactCompat?o=o.replace(s,u):o=o.replace(r,u),o.replace(e,a))};return On.camelCase=l,On}var Ln,ja;function am(){if(ja)return Ln;ja=1;var t=Ln&&Ln.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},e=t(sm()),n=im();function r(s,i){var a={};return!s||typeof s!="string"||(0,e.default)(s,function(u,l){u&&l&&(a[(0,n.camelCase)(u,i)]=l)}),a}return r.default=r,Ln=r,Ln}var um=am();const om=ai(um),Zr=xl("end"),It=xl("start");function xl(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function lm(t){const e=It(t),n=Zr(t);if(e&&n)return{start:e,end:n}}function $n(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?za(t.position):"start"in t||"end"in t?za(t):"line"in t||"column"in t?Gs(t):""}function Gs(t){return $a(t&&t.line)+":"+$a(t&&t.column)}function za(t){return Gs(t&&t.start)+"-"+Gs(t&&t.end)}function $a(t){return t&&typeof t=="number"?t:1}class qe extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",i={},a=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof e=="string"?s=e:!i.cause&&e&&(a=!0,s=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const u=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=u?u.line:void 0,this.name=$n(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}qe.prototype.file="";qe.prototype.name="";qe.prototype.reason="";qe.prototype.message="";qe.prototype.stack="";qe.prototype.column=void 0;qe.prototype.line=void 0;qe.prototype.ancestors=void 0;qe.prototype.cause=void 0;qe.prototype.fatal=void 0;qe.prototype.place=void 0;qe.prototype.ruleId=void 0;qe.prototype.source=void 0;const Ri={}.hasOwnProperty,cm=new Map,dm=/[A-Z]/g,fm=new Set(["table","tbody","thead","tfoot","tr"]),hm=new Set(["td","th"]),_l="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function pm(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=ym(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=_m(n,e.jsx,e.jsxs)}const s={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?$t:pr,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},i=yl(s,t,void 0);return i&&typeof i!="string"?i:s.create(t,s.Fragment,{children:i||void 0},void 0)}function yl(t,e,n){if(e.type==="element")return mm(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return gm(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return Em(t,e,n);if(e.type==="mdxjsEsm")return bm(t,e);if(e.type==="root")return Tm(t,e,n);if(e.type==="text")return xm(t,e)}function mm(t,e,n){const r=t.schema;let s=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=$t,t.schema=s),t.ancestors.push(e);const i=kl(t,e.tagName,!1),a=Am(t,e);let u=Li(t,e);return fm.has(e.tagName)&&(u=u.filter(function(l){return typeof l=="string"?!Wp(l):!0})),Al(t,a,i,e),Oi(a,u),t.ancestors.pop(),t.schema=r,t.create(e,i,a,n)}function gm(t,e){if(e.data&&e.data.estree&&t.evaluater){const r=e.data.estree.body[0];return r.type,t.evaluater.evaluateExpression(r.expression)}rr(t,e.position)}function bm(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);rr(t,e.position)}function Em(t,e,n){const r=t.schema;let s=r;e.name==="svg"&&r.space==="html"&&(s=$t,t.schema=s),t.ancestors.push(e);const i=e.name===null?t.Fragment:kl(t,e.name,!0),a=km(t,e),u=Li(t,e);return Al(t,a,i,e),Oi(a,u),t.ancestors.pop(),t.schema=r,t.create(e,i,a,n)}function Tm(t,e,n){const r={};return Oi(r,Li(t,e)),t.create(e,t.Fragment,r,n)}function xm(t,e){return e.value}function Al(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function Oi(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function _m(t,e,n){return r;function r(s,i,a,u){const o=Array.isArray(a.children)?n:e;return u?o(i,a,u):o(i,a)}}function ym(t,e){return n;function n(r,s,i,a){const u=Array.isArray(i.children),l=It(r);return e(s,i,a,u,{columnNumber:l?l.column-1:void 0,fileName:t,lineNumber:l?l.line:void 0},void 0)}}function Am(t,e){const n={};let r,s;for(s in e.properties)if(s!=="children"&&Ri.call(e.properties,s)){const i=Cm(t,s,e.properties[s]);if(i){const[a,u]=i;t.tableCellAlignToStyle&&a==="align"&&typeof u=="string"&&hm.has(e.tagName)?r=u:n[a]=u}}if(r){const i=n.style||(n.style={});i[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function km(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const i=r.data.estree.body[0];i.type;const a=i.expression;a.type;const u=a.properties[0];u.type,Object.assign(n,t.evaluater.evaluateExpression(u.argument))}else rr(t,e.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const u=r.value.data.estree.body[0];u.type,i=t.evaluater.evaluateExpression(u.expression)}else rr(t,e.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function Li(t,e){const n=[];let r=-1;const s=t.passKeys?new Map:cm;for(;++r<e.children.length;){const i=e.children[r];let a;if(t.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const o=s.get(l)||0;a=l+"-"+o,s.set(l,o+1)}}const u=yl(t,i,a);u!==void 0&&n.push(u)}return n}function Cm(t,e,n){const r=Xr(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?dl(n):Tl(n)),r.property==="style"){let s=typeof n=="object"?n:Im(t,String(n));return t.stylePropertyNameCase==="css"&&(s=Nm(s)),["style",s]}return[t.elementAttributeNameCase==="react"&&r.space?Kp[r.property]||r.property:r.attribute,n]}}function Im(t,e){try{return om(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const r=n,s=new qe("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=t.filePath||void 0,s.url=_l+"#cannot-parse-style-attribute",s}}function kl(t,e,n){let r;if(!n)r={type:"Literal",value:e};else if(e.includes(".")){const s=e.split(".");let i=-1,a;for(;++i<s.length;){const u=va(s[i])?{type:"Identifier",name:s[i]}:{type:"Literal",value:s[i]};a=a?{type:"MemberExpression",object:a,property:u,computed:!!(i&&u.type==="Literal"),optional:!1}:u}r=a}else r=va(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(r.type==="Literal"){const s=r.value;return Ri.call(t.components,s)?t.components[s]:s}if(t.evaluater)return t.evaluater.evaluateExpression(r);rr(t)}function rr(t,e){const n=new qe("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=_l+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Nm(t){const e={};let n;for(n in t)Ri.call(t,n)&&(e[Sm(n)]=t[n]);return e}function Sm(t){let e=t.replace(dm,wm);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function wm(t){return"-"+t.toLowerCase()}const ms={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Rm={};function vi(t,e){const n=Rm,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Cl(t,r,s)}function Cl(t,e,n){if(Om(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return Ya(t.children,e,n)}return Array.isArray(t)?Ya(t,e,n):""}function Ya(t,e,n){const r=[];let s=-1;for(;++s<t.length;)r[s]=Cl(t[s],e,n);return r.join("")}function Om(t){return!!(t&&typeof t=="object")}const qa=document.createElement("i");function Di(t){const e="&"+t+";";qa.innerHTML=e;const n=qa.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function lt(t,e,n,r){const s=t.length;let i=0,a;if(e<0?e=-e>s?0:s+e:e=e>s?s:e,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(e,n),t.splice(...a);else for(n&&t.splice(e,n);i<r.length;)a=r.slice(i,i+1e4),a.unshift(e,0),t.splice(...a),i+=1e4,e+=1e4}function ht(t,e){return t.length>0?(lt(t,t.length,0,e),t):e}const Va={}.hasOwnProperty;function Il(t){const e={};let n=-1;for(;++n<t.length;)Lm(e,t[n]);return e}function Lm(t,e){let n;for(n in e){const s=(Va.call(t,n)?t[n]:void 0)||(t[n]={}),i=e[n];let a;if(i)for(a in i){Va.call(s,a)||(s[a]=[]);const u=i[a];vm(s[a],Array.isArray(u)?u:u?[u]:[])}}}function vm(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);lt(t,0,0,r)}function Nl(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function bt(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ze=Yt(/[A-Za-z]/),Ye=Yt(/[\dA-Za-z]/),Dm=Yt(/[#-'*+\--9=?A-Z^-~]/);function Br(t){return t!==null&&(t<32||t===127)}const Ws=Yt(/\d/),Pm=Yt(/[\dA-Fa-f]/),Mm=Yt(/[!-/:-@[-`{-~]/);function ee(t){return t!==null&&t<-2}function xe(t){return t!==null&&(t<0||t===32)}function oe(t){return t===-2||t===-1||t===32}const Kr=Yt(new RegExp("\\p{P}|\\p{S}","u")),nn=Yt(/\s/);function Yt(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Cn(t){const e=[];let n=-1,r=0,s=0;for(;++n<t.length;){const i=t.charCodeAt(n);let a="";if(i===37&&Ye(t.charCodeAt(n+1))&&Ye(t.charCodeAt(n+2)))s=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){const u=t.charCodeAt(n+1);i<56320&&u>56319&&u<57344?(a=String.fromCharCode(i,u),s=1):a="�"}else a=String.fromCharCode(i);a&&(e.push(t.slice(r,n),encodeURIComponent(a)),r=n+s+1,a=""),s&&(n+=s,s=0)}return e.join("")+t.slice(r)}function de(t,e,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(l){return oe(l)?(t.enter(n),u(l)):e(l)}function u(l){return oe(l)&&i++<s?(t.consume(l),u):(t.exit(n),e(l))}}const Bm={tokenize:Fm};function Fm(t){const e=t.attempt(this.parser.constructs.contentInitial,r,s);let n;return e;function r(u){if(u===null){t.consume(u);return}return t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),de(t,e,"linePrefix")}function s(u){return t.enter("paragraph"),i(u)}function i(u){const l=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(u)}function a(u){if(u===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(u);return}return ee(u)?(t.consume(u),t.exit("chunkText"),i):(t.consume(u),a)}}const Um={tokenize:Hm},Ga={tokenize:jm};function Hm(t){const e=this,n=[];let r=0,s,i,a;return u;function u(b){if(r<n.length){const w=n[r];return e.containerState=w[1],t.attempt(w[0].continuation,l,o)(b)}return o(b)}function l(b){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,s&&A();const w=e.events.length;let R=w,I;for(;R--;)if(e.events[R][0]==="exit"&&e.events[R][1].type==="chunkFlow"){I=e.events[R][1].end;break}E(r);let L=w;for(;L<e.events.length;)e.events[L][1].end={...I},L++;return lt(e.events,R+1,0,e.events.slice(w)),e.events.length=L,o(b)}return u(b)}function o(b){if(r===n.length){if(!s)return p(b);if(s.currentConstruct&&s.currentConstruct.concrete)return g(b);e.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(Ga,d,f)(b)}function d(b){return s&&A(),E(r),p(b)}function f(b){return e.parser.lazy[e.now().line]=r!==n.length,a=e.now().offset,g(b)}function p(b){return e.containerState={},t.attempt(Ga,h,g)(b)}function h(b){return r++,n.push([e.currentConstruct,e.containerState]),p(b)}function g(b){if(b===null){s&&A(),E(0),t.consume(b);return}return s=s||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:i}),_(b)}function _(b){if(b===null){T(t.exit("chunkFlow"),!0),E(0),t.consume(b);return}return ee(b)?(t.consume(b),T(t.exit("chunkFlow")),r=0,e.interrupt=void 0,u):(t.consume(b),_)}function T(b,w){const R=e.sliceStream(b);if(w&&R.push(null),b.previous=i,i&&(i.next=b),i=b,s.defineSkip(b.start),s.write(R),e.parser.lazy[b.start.line]){let I=s.events.length;for(;I--;)if(s.events[I][1].start.offset<a&&(!s.events[I][1].end||s.events[I][1].end.offset>a))return;const L=e.events.length;let M=L,P,S;for(;M--;)if(e.events[M][0]==="exit"&&e.events[M][1].type==="chunkFlow"){if(P){S=e.events[M][1].end;break}P=!0}for(E(r),I=L;I<e.events.length;)e.events[I][1].end={...S},I++;lt(e.events,M+1,0,e.events.slice(L)),e.events.length=I}}function E(b){let w=n.length;for(;w-- >b;){const R=n[w];e.containerState=R[1],R[0].exit.call(e,t)}n.length=b}function A(){s.write([null]),i=void 0,s=void 0,e.containerState._closeFlow=void 0}}function jm(t,e,n){return de(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function bn(t){if(t===null||xe(t)||nn(t))return 1;if(Kr(t))return 2}function Jr(t,e,n){const r=[];let s=-1;for(;++s<t.length;){const i=t[s].resolveAll;i&&!r.includes(i)&&(e=i(e,n),r.push(i))}return e}const Qs={name:"attention",resolveAll:zm,tokenize:$m};function zm(t,e){let n=-1,r,s,i,a,u,l,o,d;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(r=n;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&e.sliceSerialize(t[r][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[r][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;l=t[r][1].end.offset-t[r][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const f={...t[r][1].end},p={...t[n][1].start};Wa(f,-l),Wa(p,l),a={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...t[r][1].end}},u={type:l>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:p},i={type:l>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},s={type:l>1?"strong":"emphasis",start:{...a.start},end:{...u.end}},t[r][1].end={...a.start},t[n][1].start={...u.end},o=[],t[r][1].end.offset-t[r][1].start.offset&&(o=ht(o,[["enter",t[r][1],e],["exit",t[r][1],e]])),o=ht(o,[["enter",s,e],["enter",a,e],["exit",a,e],["enter",i,e]]),o=ht(o,Jr(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),o=ht(o,[["exit",i,e],["enter",u,e],["exit",u,e],["exit",s,e]]),t[n][1].end.offset-t[n][1].start.offset?(d=2,o=ht(o,[["enter",t[n][1],e],["exit",t[n][1],e]])):d=0,lt(t,r-1,n-r+3,o),n=r+o.length-d-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function $m(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=bn(r);let i;return a;function a(l){return i=l,t.enter("attentionSequence"),u(l)}function u(l){if(l===i)return t.consume(l),u;const o=t.exit("attentionSequence"),d=bn(l),f=!d||d===2&&s||n.includes(l),p=!s||s===2&&d||n.includes(r);return o._open=!!(i===42?f:f&&(s||!p)),o._close=!!(i===42?p:p&&(d||!f)),e(l)}}function Wa(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const Ym={name:"autolink",tokenize:qm};function qm(t,e,n){let r=0;return s;function s(h){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(h),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),i}function i(h){return Ze(h)?(t.consume(h),a):h===64?n(h):o(h)}function a(h){return h===43||h===45||h===46||Ye(h)?(r=1,u(h)):o(h)}function u(h){return h===58?(t.consume(h),r=0,l):(h===43||h===45||h===46||Ye(h))&&r++<32?(t.consume(h),u):(r=0,o(h))}function l(h){return h===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(h),t.exit("autolinkMarker"),t.exit("autolink"),e):h===null||h===32||h===60||Br(h)?n(h):(t.consume(h),l)}function o(h){return h===64?(t.consume(h),d):Dm(h)?(t.consume(h),o):n(h)}function d(h){return Ye(h)?f(h):n(h)}function f(h){return h===46?(t.consume(h),r=0,d):h===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(h),t.exit("autolinkMarker"),t.exit("autolink"),e):p(h)}function p(h){if((h===45||Ye(h))&&r++<63){const g=h===45?p:f;return t.consume(h),g}return n(h)}}const mr={partial:!0,tokenize:Vm};function Vm(t,e,n){return r;function r(i){return oe(i)?de(t,s,"linePrefix")(i):s(i)}function s(i){return i===null||ee(i)?e(i):n(i)}}const Sl={continuation:{tokenize:Wm},exit:Qm,name:"blockQuote",tokenize:Gm};function Gm(t,e,n){const r=this;return s;function s(a){if(a===62){const u=r.containerState;return u.open||(t.enter("blockQuote",{_container:!0}),u.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(a),t.exit("blockQuoteMarker"),i}return n(a)}function i(a){return oe(a)?(t.enter("blockQuotePrefixWhitespace"),t.consume(a),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(a))}}function Wm(t,e,n){const r=this;return s;function s(a){return oe(a)?de(t,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):i(a)}function i(a){return t.attempt(Sl,e,n)(a)}}function Qm(t){t.exit("blockQuote")}const wl={name:"characterEscape",tokenize:Xm};function Xm(t,e,n){return r;function r(i){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(i),t.exit("escapeMarker"),s}function s(i){return Mm(i)?(t.enter("characterEscapeValue"),t.consume(i),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(i)}}const Rl={name:"characterReference",tokenize:Zm};function Zm(t,e,n){const r=this;let s=0,i,a;return u;function u(f){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),l}function l(f){return f===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(f),t.exit("characterReferenceMarkerNumeric"),o):(t.enter("characterReferenceValue"),i=31,a=Ye,d(f))}function o(f){return f===88||f===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(f),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),i=6,a=Pm,d):(t.enter("characterReferenceValue"),i=7,a=Ws,d(f))}function d(f){if(f===59&&s){const p=t.exit("characterReferenceValue");return a===Ye&&!Di(r.sliceSerialize(p))?n(f):(t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return a(f)&&s++<i?(t.consume(f),d):n(f)}}const Qa={partial:!0,tokenize:Jm},Xa={concrete:!0,name:"codeFenced",tokenize:Km};function Km(t,e,n){const r=this,s={partial:!0,tokenize:R};let i=0,a=0,u;return l;function l(I){return o(I)}function o(I){const L=r.events[r.events.length-1];return i=L&&L[1].type==="linePrefix"?L[2].sliceSerialize(L[1],!0).length:0,u=I,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),d(I)}function d(I){return I===u?(a++,t.consume(I),d):a<3?n(I):(t.exit("codeFencedFenceSequence"),oe(I)?de(t,f,"whitespace")(I):f(I))}function f(I){return I===null||ee(I)?(t.exit("codeFencedFence"),r.interrupt?e(I):t.check(Qa,_,w)(I)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),p(I))}function p(I){return I===null||ee(I)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),f(I)):oe(I)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),de(t,h,"whitespace")(I)):I===96&&I===u?n(I):(t.consume(I),p)}function h(I){return I===null||ee(I)?f(I):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),g(I))}function g(I){return I===null||ee(I)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),f(I)):I===96&&I===u?n(I):(t.consume(I),g)}function _(I){return t.attempt(s,w,T)(I)}function T(I){return t.enter("lineEnding"),t.consume(I),t.exit("lineEnding"),E}function E(I){return i>0&&oe(I)?de(t,A,"linePrefix",i+1)(I):A(I)}function A(I){return I===null||ee(I)?t.check(Qa,_,w)(I):(t.enter("codeFlowValue"),b(I))}function b(I){return I===null||ee(I)?(t.exit("codeFlowValue"),A(I)):(t.consume(I),b)}function w(I){return t.exit("codeFenced"),e(I)}function R(I,L,M){let P=0;return S;function S(U){return I.enter("lineEnding"),I.consume(U),I.exit("lineEnding"),B}function B(U){return I.enter("codeFencedFence"),oe(U)?de(I,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):$(U)}function $(U){return U===u?(I.enter("codeFencedFenceSequence"),X(U)):M(U)}function X(U){return U===u?(P++,I.consume(U),X):P>=a?(I.exit("codeFencedFenceSequence"),oe(U)?de(I,q,"whitespace")(U):q(U)):M(U)}function q(U){return U===null||ee(U)?(I.exit("codeFencedFence"),L(U)):M(U)}}}function Jm(t,e,n){const r=this;return s;function s(a){return a===null?n(a):(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}const gs={name:"codeIndented",tokenize:t1},e1={partial:!0,tokenize:n1};function t1(t,e,n){const r=this;return s;function s(o){return t.enter("codeIndented"),de(t,i,"linePrefix",5)(o)}function i(o){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(o):n(o)}function a(o){return o===null?l(o):ee(o)?t.attempt(e1,a,l)(o):(t.enter("codeFlowValue"),u(o))}function u(o){return o===null||ee(o)?(t.exit("codeFlowValue"),a(o)):(t.consume(o),u)}function l(o){return t.exit("codeIndented"),e(o)}}function n1(t,e,n){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?n(a):ee(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s):de(t,i,"linePrefix",5)(a)}function i(a){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?e(a):ee(a)?s(a):n(a)}}const r1={name:"codeText",previous:i1,resolve:s1,tokenize:a1};function s1(t){let e=t.length-4,n=3,r,s;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)s===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(s=r):(r===e||t[r][1].type==="lineEnding")&&(t[s][1].type="codeTextData",r!==s+2&&(t[s][1].end=t[r-1][1].end,t.splice(s+2,r-s-2),e-=r-s-2,r=s+2),s=void 0);return t}function i1(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function a1(t,e,n){let r=0,s,i;return a;function a(f){return t.enter("codeText"),t.enter("codeTextSequence"),u(f)}function u(f){return f===96?(t.consume(f),r++,u):(t.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(t.enter("space"),t.consume(f),t.exit("space"),l):f===96?(i=t.enter("codeTextSequence"),s=0,d(f)):ee(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),l):(t.enter("codeTextData"),o(f))}function o(f){return f===null||f===32||f===96||ee(f)?(t.exit("codeTextData"),l(f)):(t.consume(f),o)}function d(f){return f===96?(t.consume(f),s++,d):s===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(f)):(i.type="codeTextData",o(f))}}class u1{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const s=n||0;this.setCursor(Math.trunc(e));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&vn(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),vn(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),vn(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);vn(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);vn(this.left,n.reverse())}}}function vn(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function Ol(t){const e={};let n=-1,r,s,i,a,u,l,o;const d=new u1(t);for(;++n<d.length;){for(;n in e;)n=e[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,o1(d,n)),n=e[n],o=!0);else if(r[1]._container){for(i=n,s=void 0;i--;)if(a=d.get(i),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(s&&(d.get(s)[1].type="lineEndingBlank"),a[1].type="lineEnding",s=i);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;s&&(r[1].end={...d.get(s)[1].start},u=d.slice(s,n),u.unshift(r),d.splice(s,n-s+1,u))}}return lt(t,0,Number.POSITIVE_INFINITY,d.slice(0)),!o}function o1(t,e){const n=t.get(e)[1],r=t.get(e)[2];let s=e-1;const i=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const u=a.events,l=[],o={};let d,f,p=-1,h=n,g=0,_=0;const T=[_];for(;h;){for(;t.get(++s)[1]!==h;);i.push(s),h._tokenizer||(d=r.sliceStream(h),h.next||d.push(null),f&&a.defineSkip(h.start),h._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(d),h._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),f=h,h=h.next}for(h=n;++p<u.length;)u[p][0]==="exit"&&u[p-1][0]==="enter"&&u[p][1].type===u[p-1][1].type&&u[p][1].start.line!==u[p][1].end.line&&(_=p+1,T.push(_),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(a.events=[],h?(h._tokenizer=void 0,h.previous=void 0):T.pop(),p=T.length;p--;){const E=u.slice(T[p],T[p+1]),A=i.pop();l.push([A,A+E.length-1]),t.splice(A,2,E)}for(l.reverse(),p=-1;++p<l.length;)o[g+l[p][0]]=g+l[p][1],g+=l[p][1]-l[p][0]-1;return o}const l1={resolve:d1,tokenize:f1},c1={partial:!0,tokenize:h1};function d1(t){return Ol(t),t}function f1(t,e){let n;return r;function r(u){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),s(u)}function s(u){return u===null?i(u):ee(u)?t.check(c1,a,i)(u):(t.consume(u),s)}function i(u){return t.exit("chunkContent"),t.exit("content"),e(u)}function a(u){return t.consume(u),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function h1(t,e,n){const r=this;return s;function s(a){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),de(t,i,"linePrefix")}function i(a){if(a===null||ee(a))return n(a);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?e(a):t.interrupt(r.parser.constructs.flow,n,e)(a)}}function Ll(t,e,n,r,s,i,a,u,l){const o=l||Number.POSITIVE_INFINITY;let d=0;return f;function f(E){return E===60?(t.enter(r),t.enter(s),t.enter(i),t.consume(E),t.exit(i),p):E===null||E===32||E===41||Br(E)?n(E):(t.enter(r),t.enter(a),t.enter(u),t.enter("chunkString",{contentType:"string"}),_(E))}function p(E){return E===62?(t.enter(i),t.consume(E),t.exit(i),t.exit(s),t.exit(r),e):(t.enter(u),t.enter("chunkString",{contentType:"string"}),h(E))}function h(E){return E===62?(t.exit("chunkString"),t.exit(u),p(E)):E===null||E===60||ee(E)?n(E):(t.consume(E),E===92?g:h)}function g(E){return E===60||E===62||E===92?(t.consume(E),h):h(E)}function _(E){return!d&&(E===null||E===41||xe(E))?(t.exit("chunkString"),t.exit(u),t.exit(a),t.exit(r),e(E)):d<o&&E===40?(t.consume(E),d++,_):E===41?(t.consume(E),d--,_):E===null||E===32||E===40||Br(E)?n(E):(t.consume(E),E===92?T:_)}function T(E){return E===40||E===41||E===92?(t.consume(E),_):_(E)}}function vl(t,e,n,r,s,i){const a=this;let u=0,l;return o;function o(h){return t.enter(r),t.enter(s),t.consume(h),t.exit(s),t.enter(i),d}function d(h){return u>999||h===null||h===91||h===93&&!l||h===94&&!u&&"_hiddenFootnoteSupport"in a.parser.constructs?n(h):h===93?(t.exit(i),t.enter(s),t.consume(h),t.exit(s),t.exit(r),e):ee(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),d):(t.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||ee(h)||u++>999?(t.exit("chunkString"),d(h)):(t.consume(h),l||(l=!oe(h)),h===92?p:f)}function p(h){return h===91||h===92||h===93?(t.consume(h),u++,f):f(h)}}function Dl(t,e,n,r,s,i){let a;return u;function u(p){return p===34||p===39||p===40?(t.enter(r),t.enter(s),t.consume(p),t.exit(s),a=p===40?41:p,l):n(p)}function l(p){return p===a?(t.enter(s),t.consume(p),t.exit(s),t.exit(r),e):(t.enter(i),o(p))}function o(p){return p===a?(t.exit(i),l(a)):p===null?n(p):ee(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),de(t,o,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===a||p===null||ee(p)?(t.exit("chunkString"),o(p)):(t.consume(p),p===92?f:d)}function f(p){return p===a||p===92?(t.consume(p),d):d(p)}}function Yn(t,e){let n;return r;function r(s){return ee(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),n=!0,r):oe(s)?de(t,r,n?"linePrefix":"lineSuffix")(s):e(s)}}const p1={name:"definition",tokenize:g1},m1={partial:!0,tokenize:b1};function g1(t,e,n){const r=this;let s;return i;function i(h){return t.enter("definition"),a(h)}function a(h){return vl.call(r,t,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function u(h){return s=bt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(t.enter("definitionMarker"),t.consume(h),t.exit("definitionMarker"),l):n(h)}function l(h){return xe(h)?Yn(t,o)(h):o(h)}function o(h){return Ll(t,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function d(h){return t.attempt(m1,f,f)(h)}function f(h){return oe(h)?de(t,p,"whitespace")(h):p(h)}function p(h){return h===null||ee(h)?(t.exit("definition"),r.parser.defined.push(s),e(h)):n(h)}}function b1(t,e,n){return r;function r(u){return xe(u)?Yn(t,s)(u):n(u)}function s(u){return Dl(t,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function i(u){return oe(u)?de(t,a,"whitespace")(u):a(u)}function a(u){return u===null||ee(u)?e(u):n(u)}}const E1={name:"hardBreakEscape",tokenize:T1};function T1(t,e,n){return r;function r(i){return t.enter("hardBreakEscape"),t.consume(i),s}function s(i){return ee(i)?(t.exit("hardBreakEscape"),e(i)):n(i)}}const x1={name:"headingAtx",resolve:_1,tokenize:y1};function _1(t,e){let n=t.length-2,r=3,s,i;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},i={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},lt(t,r,n-r+1,[["enter",s,e],["enter",i,e],["exit",i,e],["exit",s,e]])),t}function y1(t,e,n){let r=0;return s;function s(d){return t.enter("atxHeading"),i(d)}function i(d){return t.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&r++<6?(t.consume(d),a):d===null||xe(d)?(t.exit("atxHeadingSequence"),u(d)):n(d)}function u(d){return d===35?(t.enter("atxHeadingSequence"),l(d)):d===null||ee(d)?(t.exit("atxHeading"),e(d)):oe(d)?de(t,u,"whitespace")(d):(t.enter("atxHeadingText"),o(d))}function l(d){return d===35?(t.consume(d),l):(t.exit("atxHeadingSequence"),u(d))}function o(d){return d===null||d===35||xe(d)?(t.exit("atxHeadingText"),u(d)):(t.consume(d),o)}}const A1=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Za=["pre","script","style","textarea"],k1={concrete:!0,name:"htmlFlow",resolveTo:N1,tokenize:S1},C1={partial:!0,tokenize:R1},I1={partial:!0,tokenize:w1};function N1(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function S1(t,e,n){const r=this;let s,i,a,u,l;return o;function o(N){return d(N)}function d(N){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(N),f}function f(N){return N===33?(t.consume(N),p):N===47?(t.consume(N),i=!0,_):N===63?(t.consume(N),s=3,r.interrupt?e:k):Ze(N)?(t.consume(N),a=String.fromCharCode(N),T):n(N)}function p(N){return N===45?(t.consume(N),s=2,h):N===91?(t.consume(N),s=5,u=0,g):Ze(N)?(t.consume(N),s=4,r.interrupt?e:k):n(N)}function h(N){return N===45?(t.consume(N),r.interrupt?e:k):n(N)}function g(N){const Ee="CDATA[";return N===Ee.charCodeAt(u++)?(t.consume(N),u===Ee.length?r.interrupt?e:$:g):n(N)}function _(N){return Ze(N)?(t.consume(N),a=String.fromCharCode(N),T):n(N)}function T(N){if(N===null||N===47||N===62||xe(N)){const Ee=N===47,ve=a.toLowerCase();return!Ee&&!i&&Za.includes(ve)?(s=1,r.interrupt?e(N):$(N)):A1.includes(a.toLowerCase())?(s=6,Ee?(t.consume(N),E):r.interrupt?e(N):$(N)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):i?A(N):b(N))}return N===45||Ye(N)?(t.consume(N),a+=String.fromCharCode(N),T):n(N)}function E(N){return N===62?(t.consume(N),r.interrupt?e:$):n(N)}function A(N){return oe(N)?(t.consume(N),A):S(N)}function b(N){return N===47?(t.consume(N),S):N===58||N===95||Ze(N)?(t.consume(N),w):oe(N)?(t.consume(N),b):S(N)}function w(N){return N===45||N===46||N===58||N===95||Ye(N)?(t.consume(N),w):R(N)}function R(N){return N===61?(t.consume(N),I):oe(N)?(t.consume(N),R):b(N)}function I(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(t.consume(N),l=N,L):oe(N)?(t.consume(N),I):M(N)}function L(N){return N===l?(t.consume(N),l=null,P):N===null||ee(N)?n(N):(t.consume(N),L)}function M(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||xe(N)?R(N):(t.consume(N),M)}function P(N){return N===47||N===62||oe(N)?b(N):n(N)}function S(N){return N===62?(t.consume(N),B):n(N)}function B(N){return N===null||ee(N)?$(N):oe(N)?(t.consume(N),B):n(N)}function $(N){return N===45&&s===2?(t.consume(N),W):N===60&&s===1?(t.consume(N),V):N===62&&s===4?(t.consume(N),se):N===63&&s===3?(t.consume(N),k):N===93&&s===5?(t.consume(N),J):ee(N)&&(s===6||s===7)?(t.exit("htmlFlowData"),t.check(C1,he,X)(N)):N===null||ee(N)?(t.exit("htmlFlowData"),X(N)):(t.consume(N),$)}function X(N){return t.check(I1,q,he)(N)}function q(N){return t.enter("lineEnding"),t.consume(N),t.exit("lineEnding"),U}function U(N){return N===null||ee(N)?X(N):(t.enter("htmlFlowData"),$(N))}function W(N){return N===45?(t.consume(N),k):$(N)}function V(N){return N===47?(t.consume(N),a="",K):$(N)}function K(N){if(N===62){const Ee=a.toLowerCase();return Za.includes(Ee)?(t.consume(N),se):$(N)}return Ze(N)&&a.length<8?(t.consume(N),a+=String.fromCharCode(N),K):$(N)}function J(N){return N===93?(t.consume(N),k):$(N)}function k(N){return N===62?(t.consume(N),se):N===45&&s===2?(t.consume(N),k):$(N)}function se(N){return N===null||ee(N)?(t.exit("htmlFlowData"),he(N)):(t.consume(N),se)}function he(N){return t.exit("htmlFlow"),e(N)}}function w1(t,e,n){const r=this;return s;function s(a){return ee(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i):n(a)}function i(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}function R1(t,e,n){return r;function r(s){return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),t.attempt(mr,e,n)}}const O1={name:"htmlText",tokenize:L1};function L1(t,e,n){const r=this;let s,i,a;return u;function u(k){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(k),l}function l(k){return k===33?(t.consume(k),o):k===47?(t.consume(k),R):k===63?(t.consume(k),b):Ze(k)?(t.consume(k),M):n(k)}function o(k){return k===45?(t.consume(k),d):k===91?(t.consume(k),i=0,g):Ze(k)?(t.consume(k),A):n(k)}function d(k){return k===45?(t.consume(k),h):n(k)}function f(k){return k===null?n(k):k===45?(t.consume(k),p):ee(k)?(a=f,V(k)):(t.consume(k),f)}function p(k){return k===45?(t.consume(k),h):f(k)}function h(k){return k===62?W(k):k===45?p(k):f(k)}function g(k){const se="CDATA[";return k===se.charCodeAt(i++)?(t.consume(k),i===se.length?_:g):n(k)}function _(k){return k===null?n(k):k===93?(t.consume(k),T):ee(k)?(a=_,V(k)):(t.consume(k),_)}function T(k){return k===93?(t.consume(k),E):_(k)}function E(k){return k===62?W(k):k===93?(t.consume(k),E):_(k)}function A(k){return k===null||k===62?W(k):ee(k)?(a=A,V(k)):(t.consume(k),A)}function b(k){return k===null?n(k):k===63?(t.consume(k),w):ee(k)?(a=b,V(k)):(t.consume(k),b)}function w(k){return k===62?W(k):b(k)}function R(k){return Ze(k)?(t.consume(k),I):n(k)}function I(k){return k===45||Ye(k)?(t.consume(k),I):L(k)}function L(k){return ee(k)?(a=L,V(k)):oe(k)?(t.consume(k),L):W(k)}function M(k){return k===45||Ye(k)?(t.consume(k),M):k===47||k===62||xe(k)?P(k):n(k)}function P(k){return k===47?(t.consume(k),W):k===58||k===95||Ze(k)?(t.consume(k),S):ee(k)?(a=P,V(k)):oe(k)?(t.consume(k),P):W(k)}function S(k){return k===45||k===46||k===58||k===95||Ye(k)?(t.consume(k),S):B(k)}function B(k){return k===61?(t.consume(k),$):ee(k)?(a=B,V(k)):oe(k)?(t.consume(k),B):P(k)}function $(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(t.consume(k),s=k,X):ee(k)?(a=$,V(k)):oe(k)?(t.consume(k),$):(t.consume(k),q)}function X(k){return k===s?(t.consume(k),s=void 0,U):k===null?n(k):ee(k)?(a=X,V(k)):(t.consume(k),X)}function q(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||xe(k)?P(k):(t.consume(k),q)}function U(k){return k===47||k===62||xe(k)?P(k):n(k)}function W(k){return k===62?(t.consume(k),t.exit("htmlTextData"),t.exit("htmlText"),e):n(k)}function V(k){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(k),t.exit("lineEnding"),K}function K(k){return oe(k)?de(t,J,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):J(k)}function J(k){return t.enter("htmlTextData"),a(k)}}const Pi={name:"labelEnd",resolveAll:M1,resolveTo:B1,tokenize:F1},v1={tokenize:U1},D1={tokenize:H1},P1={tokenize:j1};function M1(t){let e=-1;const n=[];for(;++e<t.length;){const r=t[e][1];if(n.push(t[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const s=r.type==="labelImage"?4:2;r.type="data",e+=s}}return t.length!==n.length&&lt(t,0,t.length,n),t}function B1(t,e){let n=t.length,r=0,s,i,a,u;for(;n--;)if(s=t[n][1],i){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;t[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(a){if(t[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(i=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(a=n);const l={type:t[i][1].type==="labelLink"?"link":"image",start:{...t[i][1].start},end:{...t[t.length-1][1].end}},o={type:"label",start:{...t[i][1].start},end:{...t[a][1].end}},d={type:"labelText",start:{...t[i+r+2][1].end},end:{...t[a-2][1].start}};return u=[["enter",l,e],["enter",o,e]],u=ht(u,t.slice(i+1,i+r+3)),u=ht(u,[["enter",d,e]]),u=ht(u,Jr(e.parser.constructs.insideSpan.null,t.slice(i+r+4,a-3),e)),u=ht(u,[["exit",d,e],t[a-2],t[a-1],["exit",o,e]]),u=ht(u,t.slice(a+1)),u=ht(u,[["exit",l,e]]),lt(t,i,t.length,u),t}function F1(t,e,n){const r=this;let s=r.events.length,i,a;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){i=r.events[s][1];break}return u;function u(p){return i?i._inactive?f(p):(a=r.parser.defined.includes(bt(r.sliceSerialize({start:i.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(p),t.exit("labelMarker"),t.exit("labelEnd"),l):n(p)}function l(p){return p===40?t.attempt(v1,d,a?d:f)(p):p===91?t.attempt(D1,d,a?o:f)(p):a?d(p):f(p)}function o(p){return t.attempt(P1,d,f)(p)}function d(p){return e(p)}function f(p){return i._balanced=!0,n(p)}}function U1(t,e,n){return r;function r(f){return t.enter("resource"),t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),s}function s(f){return xe(f)?Yn(t,i)(f):i(f)}function i(f){return f===41?d(f):Ll(t,a,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function a(f){return xe(f)?Yn(t,l)(f):d(f)}function u(f){return n(f)}function l(f){return f===34||f===39||f===40?Dl(t,o,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function o(f){return xe(f)?Yn(t,d)(f):d(f)}function d(f){return f===41?(t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),t.exit("resource"),e):n(f)}}function H1(t,e,n){const r=this;return s;function s(u){return vl.call(r,t,i,a,"reference","referenceMarker","referenceString")(u)}function i(u){return r.parser.defined.includes(bt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(u):n(u)}function a(u){return n(u)}}function j1(t,e,n){return r;function r(i){return t.enter("reference"),t.enter("referenceMarker"),t.consume(i),t.exit("referenceMarker"),s}function s(i){return i===93?(t.enter("referenceMarker"),t.consume(i),t.exit("referenceMarker"),t.exit("reference"),e):n(i)}}const z1={name:"labelStartImage",resolveAll:Pi.resolveAll,tokenize:$1};function $1(t,e,n){const r=this;return s;function s(u){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(u),t.exit("labelImageMarker"),i}function i(u){return u===91?(t.enter("labelMarker"),t.consume(u),t.exit("labelMarker"),t.exit("labelImage"),a):n(u)}function a(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):e(u)}}const Y1={name:"labelStartLink",resolveAll:Pi.resolveAll,tokenize:q1};function q1(t,e,n){const r=this;return s;function s(a){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelLink"),i}function i(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):e(a)}}const bs={name:"lineEnding",tokenize:V1};function V1(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),de(t,e,"linePrefix")}}const wr={name:"thematicBreak",tokenize:G1};function G1(t,e,n){let r=0,s;return i;function i(o){return t.enter("thematicBreak"),a(o)}function a(o){return s=o,u(o)}function u(o){return o===s?(t.enter("thematicBreakSequence"),l(o)):r>=3&&(o===null||ee(o))?(t.exit("thematicBreak"),e(o)):n(o)}function l(o){return o===s?(t.consume(o),r++,l):(t.exit("thematicBreakSequence"),oe(o)?de(t,u,"whitespace")(o):u(o))}}const tt={continuation:{tokenize:Z1},exit:J1,name:"list",tokenize:X1},W1={partial:!0,tokenize:eg},Q1={partial:!0,tokenize:K1};function X1(t,e,n){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return u;function u(h){const g=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:Ws(h)){if(r.containerState.type||(r.containerState.type=g,t.enter(g,{_container:!0})),g==="listUnordered")return t.enter("listItemPrefix"),h===42||h===45?t.check(wr,n,o)(h):o(h);if(!r.interrupt||h===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(h)}return n(h)}function l(h){return Ws(h)&&++a<10?(t.consume(h),l):(!r.interrupt||a<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(t.exit("listItemValue"),o(h)):n(h)}function o(h){return t.enter("listItemMarker"),t.consume(h),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,t.check(mr,r.interrupt?n:d,t.attempt(W1,p,f))}function d(h){return r.containerState.initialBlankLine=!0,i++,p(h)}function f(h){return oe(h)?(t.enter("listItemPrefixWhitespace"),t.consume(h),t.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=i+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(h)}}function Z1(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(mr,s,i);function s(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,de(t,e,"listItemIndent",r.containerState.size+1)(u)}function i(u){return r.containerState.furtherBlankLines||!oe(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(Q1,e,a)(u))}function a(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,de(t,t.attempt(tt,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function K1(t,e,n){const r=this;return de(t,s,"listItemIndent",r.containerState.size+1);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?e(i):n(i)}}function J1(t){t.exit(this.containerState.type)}function eg(t,e,n){const r=this;return de(t,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const a=r.events[r.events.length-1];return!oe(i)&&a&&a[1].type==="listItemPrefixWhitespace"?e(i):n(i)}}const Ka={name:"setextUnderline",resolveTo:tg,tokenize:ng};function tg(t,e){let n=t.length,r,s,i;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(s=n)}else t[n][1].type==="content"&&t.splice(n,1),!i&&t[n][1].type==="definition"&&(i=n);const a={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[s][1].type="setextHeadingText",i?(t.splice(s,0,["enter",a,e]),t.splice(i+1,0,["exit",t[r][1],e]),t[r][1].end={...t[i][1].end}):t[r][1]=a,t.push(["exit",a,e]),t}function ng(t,e,n){const r=this;let s;return i;function i(o){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(t.enter("setextHeadingLine"),s=o,a(o)):n(o)}function a(o){return t.enter("setextHeadingLineSequence"),u(o)}function u(o){return o===s?(t.consume(o),u):(t.exit("setextHeadingLineSequence"),oe(o)?de(t,l,"lineSuffix")(o):l(o))}function l(o){return o===null||ee(o)?(t.exit("setextHeadingLine"),e(o)):n(o)}}const rg={tokenize:sg};function sg(t){const e=this,n=t.attempt(mr,r,t.attempt(this.parser.constructs.flowInitial,s,de(t,t.attempt(this.parser.constructs.flow,s,t.attempt(l1,s)),"linePrefix")));return n;function r(i){if(i===null){t.consume(i);return}return t.enter("lineEndingBlank"),t.consume(i),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function s(i){if(i===null){t.consume(i);return}return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const ig={resolveAll:Ml()},ag=Pl("string"),ug=Pl("text");function Pl(t){return{resolveAll:Ml(t==="text"?og:void 0),tokenize:e};function e(n){const r=this,s=this.parser.constructs[t],i=n.attempt(s,a,u);return a;function a(d){return o(d)?i(d):u(d)}function u(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return o(d)?(n.exit("data"),i(d)):(n.consume(d),l)}function o(d){if(d===null)return!0;const f=s[d];let p=-1;if(f)for(;++p<f.length;){const h=f[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function Ml(t){return e;function e(n,r){let s=-1,i;for(;++s<=n.length;)i===void 0?n[s]&&n[s][1].type==="data"&&(i=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==i+2&&(n[i][1].end=n[s-1][1].end,n.splice(i+2,s-i-2),s=i+2),i=void 0);return t?t(n,r):n}}function og(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const r=t[n-1][1],s=e.sliceStream(r);let i=s.length,a=-1,u=0,l;for(;i--;){const o=s[i];if(typeof o=="string"){for(a=o.length;o.charCodeAt(a-1)===32;)u++,a--;if(a)break;a=-1}else if(o===-2)l=!0,u++;else if(o!==-1){i++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(u=0),u){const o={type:n===t.length||l||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?a:r.start._bufferIndex+a,_index:r.start._index+i,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...o.start},r.start.offset===r.end.offset?Object.assign(r,o):(t.splice(n,0,["enter",o,e],["exit",o,e]),n+=2)}n++}return t}const lg={42:tt,43:tt,45:tt,48:tt,49:tt,50:tt,51:tt,52:tt,53:tt,54:tt,55:tt,56:tt,57:tt,62:Sl},cg={91:p1},dg={[-2]:gs,[-1]:gs,32:gs},fg={35:x1,42:wr,45:[Ka,wr],60:k1,61:Ka,95:wr,96:Xa,126:Xa},hg={38:Rl,92:wl},pg={[-5]:bs,[-4]:bs,[-3]:bs,33:z1,38:Rl,42:Qs,60:[Ym,O1],91:Y1,92:[E1,wl],93:Pi,95:Qs,96:r1},mg={null:[Qs,ig]},gg={null:[42,95]},bg={null:[]},Eg=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:gg,contentInitial:cg,disable:bg,document:lg,flow:fg,flowInitial:dg,insideSpan:mg,string:hg,text:pg},Symbol.toStringTag,{value:"Module"}));function Tg(t,e,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},i=[];let a=[],u=[];const l={attempt:L(R),check:L(I),consume:A,enter:b,exit:w,interrupt:L(I,{interrupt:!0})},o={code:null,containerState:{},defineSkip:_,events:[],now:g,parser:t,previous:null,sliceSerialize:p,sliceStream:h,write:f};let d=e.tokenize.call(o,l);return e.resolveAll&&i.push(e),o;function f(B){return a=ht(a,B),T(),a[a.length-1]!==null?[]:(M(e,0),o.events=Jr(i,o.events,o),o.events)}function p(B,$){return _g(h(B),$)}function h(B){return xg(a,B)}function g(){const{_bufferIndex:B,_index:$,line:X,column:q,offset:U}=r;return{_bufferIndex:B,_index:$,line:X,column:q,offset:U}}function _(B){s[B.line]=B.column,S()}function T(){let B;for(;r._index<a.length;){const $=a[r._index];if(typeof $=="string")for(B=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===B&&r._bufferIndex<$.length;)E($.charCodeAt(r._bufferIndex));else E($)}}function E(B){d=d(B)}function A(B){ee(B)?(r.line++,r.column=1,r.offset+=B===-3?2:1,S()):B!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),o.previous=B}function b(B,$){const X=$||{};return X.type=B,X.start=g(),o.events.push(["enter",X,o]),u.push(X),X}function w(B){const $=u.pop();return $.end=g(),o.events.push(["exit",$,o]),$}function R(B,$){M(B,$.from)}function I(B,$){$.restore()}function L(B,$){return X;function X(q,U,W){let V,K,J,k;return Array.isArray(q)?he(q):"tokenize"in q?he([q]):se(q);function se(fe){return Ge;function Ge(Ie){const Ne=Ie!==null&&fe[Ie],ye=Ie!==null&&fe.null,Fe=[...Array.isArray(Ne)?Ne:Ne?[Ne]:[],...Array.isArray(ye)?ye:ye?[ye]:[]];return he(Fe)(Ie)}}function he(fe){return V=fe,K=0,fe.length===0?W:N(fe[K])}function N(fe){return Ge;function Ge(Ie){return k=P(),J=fe,fe.partial||(o.currentConstruct=fe),fe.name&&o.parser.constructs.disable.null.includes(fe.name)?ve():fe.tokenize.call($?Object.assign(Object.create(o),$):o,l,Ee,ve)(Ie)}}function Ee(fe){return B(J,k),U}function ve(fe){return k.restore(),++K<V.length?N(V[K]):W}}}function M(B,$){B.resolveAll&&!i.includes(B)&&i.push(B),B.resolve&&lt(o.events,$,o.events.length-$,B.resolve(o.events.slice($),o)),B.resolveTo&&(o.events=B.resolveTo(o.events,o))}function P(){const B=g(),$=o.previous,X=o.currentConstruct,q=o.events.length,U=Array.from(u);return{from:q,restore:W};function W(){r=B,o.previous=$,o.currentConstruct=X,o.events.length=q,u=U,S()}}function S(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function xg(t,e){const n=e.start._index,r=e.start._bufferIndex,s=e.end._index,i=e.end._bufferIndex;let a;if(n===s)a=[t[n].slice(r,i)];else{if(a=t.slice(n,s),r>-1){const u=a[0];typeof u=="string"?a[0]=u.slice(r):a.shift()}i>0&&a.push(t[s].slice(0,i))}return a}function _g(t,e){let n=-1;const r=[];let s;for(;++n<t.length;){const i=t[n];let a;if(typeof i=="string")a=i;else switch(i){case-5:{a="\r";break}case-4:{a=`
78
78
  `;break}case-3:{a=`\r
79
- `;break}case-2:{a=e?" ":" ";break}case-1:{if(!e&&s)continue;a=" ";break}default:a=String.fromCharCode(i)}s=i===-2,r.push(a)}return r.join("")}function yg(t){const r={constructs:Il([Eg,...(t||{}).extensions||[]]),content:s(Bm),defined:[],document:s(Um),flow:s(rg),lazy:{},string:s(ag),text:s(ug)};return r;function s(i){return a;function a(u){return Tg(r,i,u)}}}function Ag(t){for(;!Ol(t););return t}const Ja=/[\0\t\n\r]/g;function kg(){let t=1,e="",n=!0,r;return s;function s(i,a,u){const l=[];let o,d,f,p,h;for(i=e+(typeof i=="string"?i.toString():new TextDecoder(a||void 0).decode(i)),f=0,e="",n&&(i.charCodeAt(0)===65279&&f++,n=void 0);f<i.length;){if(Ja.lastIndex=f,o=Ja.exec(i),p=o&&o.index!==void 0?o.index:i.length,h=i.charCodeAt(p),!o){e=i.slice(f);break}if(h===10&&f===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<p&&(l.push(i.slice(f,p)),t+=p-f),h){case 0:{l.push(65533),t++;break}case 9:{for(d=Math.ceil(t/4)*4,l.push(-2);t++<d;)l.push(-1);break}case 10:{l.push(-4),t=1;break}default:r=!0,t=1}f=p+1}return u&&(r&&l.push(-5),e&&l.push(e),l.push(null)),l}}const Cg=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Ig(t){return t.replace(Cg,Ng)}function Ng(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),i=s===120||s===88;return Nl(n.slice(i?2:1),i?16:10)}return Di(n)||t}const Bl={}.hasOwnProperty;function Sg(t,e,n){return typeof e!="string"&&(n=e,e=void 0),wg(n)(Ag(yg(n).document().write(kg()(t,e,!0))))}function wg(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Tt),autolinkProtocol:P,autolinkEmail:P,atxHeading:i(Ue),blockQuote:i(ye),characterEscape:P,characterReference:P,codeFenced:i(Fe),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:i(Fe,a),codeText:i(Re,a),codeTextData:P,data:P,codeFlowValue:P,definition:i(De),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:i(Oe),hardBreakEscape:i(Se),hardBreakTrailing:i(Se),htmlFlow:i(He,a),htmlFlowData:P,htmlText:i(He,a),htmlTextData:P,image:i(We),label:a,link:i(Tt),listItem:i(qt),listItemValue:p,listOrdered:i(Je,f),listUnordered:i(Je),paragraph:i(st),reference:N,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:i(Ue),strong:i(dt),thematicBreak:i(le)},exit:{atxHeading:l(),atxHeadingSequence:R,autolink:l(),autolinkEmail:Ne,autolinkProtocol:Ie,blockQuote:l(),characterEscapeValue:S,characterReferenceMarkerHexadecimal:ve,characterReferenceMarkerNumeric:ve,characterReferenceValue:fe,characterReference:Ge,codeFenced:l(T),codeFencedFence:_,codeFencedFenceInfo:h,codeFencedFenceMeta:g,codeFlowValue:S,codeIndented:l(E),codeText:l(U),codeTextData:S,data:S,definition:l(),definitionDestinationString:w,definitionLabelString:A,definitionTitleString:b,emphasis:l(),hardBreakEscape:l($),hardBreakTrailing:l($),htmlFlow:l(X),htmlFlowData:S,htmlText:l(q),htmlTextData:S,image:l(V),label:J,labelText:K,lineEnding:B,link:l(W),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:Ee,resourceDestinationString:k,resourceTitleString:re,resource:he,setextHeading:l(M),setextHeadingLineSequence:L,setextHeadingText:I,strong:l(),thematicBreak:l()}};Fl(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(D){let Y={type:"root",children:[]};const Z={stack:[Y],tokenStack:[],config:e,enter:u,exit:o,buffer:a,resume:d,data:n},ue=[];let me=-1;for(;++me<D.length;)if(D[me][1].type==="listOrdered"||D[me][1].type==="listUnordered")if(D[me][0]==="enter")ue.push(me);else{const ze=ue.pop();me=s(D,ze,me)}for(me=-1;++me<D.length;){const ze=e[D[me][0]];Bl.call(ze,D[me][1].type)&&ze[D[me][1].type].call(Object.assign({sliceSerialize:D[me][2].sliceSerialize},Z),D[me][1])}if(Z.tokenStack.length>0){const ze=Z.tokenStack[Z.tokenStack.length-1];(ze[1]||eu).call(Z,void 0,ze[0])}for(Y.position={start:Dt(D.length>0?D[0][1].start:{line:1,column:1,offset:0}),end:Dt(D.length>0?D[D.length-2][1].end:{line:1,column:1,offset:0})},me=-1;++me<e.transforms.length;)Y=e.transforms[me](Y)||Y;return Y}function s(D,Y,Z){let ue=Y-1,me=-1,ze=!1,xt,at,vt,Vt;for(;++ue<=Z;){const ut=D[ue];switch(ut[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ut[0]==="enter"?me++:me--,Vt=void 0;break}case"lineEndingBlank":{ut[0]==="enter"&&(xt&&!Vt&&!me&&!vt&&(vt=ue),Vt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Vt=void 0}if(!me&&ut[0]==="enter"&&ut[1].type==="listItemPrefix"||me===-1&&ut[0]==="exit"&&(ut[1].type==="listUnordered"||ut[1].type==="listOrdered")){if(xt){let un=ue;for(at=void 0;un--;){const St=D[un];if(St[1].type==="lineEnding"||St[1].type==="lineEndingBlank"){if(St[0]==="exit")continue;at&&(D[at][1].type="lineEndingBlank",ze=!0),St[1].type="lineEnding",at=un}else if(!(St[1].type==="linePrefix"||St[1].type==="blockQuotePrefix"||St[1].type==="blockQuotePrefixWhitespace"||St[1].type==="blockQuoteMarker"||St[1].type==="listItemIndent"))break}vt&&(!at||vt<at)&&(xt._spread=!0),xt.end=Object.assign({},at?D[at][1].start:ut[1].end),D.splice(at||ue,0,["exit",xt,ut[2]]),ue++,Z++}if(ut[1].type==="listItemPrefix"){const un={type:"listItem",_spread:!1,start:Object.assign({},ut[1].start),end:void 0};xt=un,D.splice(ue,0,["enter",un,ut[2]]),ue++,Z++,vt=void 0,Vt=!0}}}return D[Y][1]._spread=ze,Z}function i(D,Y){return Z;function Z(ue){u.call(this,D(ue),ue),Y&&Y.call(this,ue)}}function a(){this.stack.push({type:"fragment",children:[]})}function u(D,Y,Z){this.stack[this.stack.length-1].children.push(D),this.stack.push(D),this.tokenStack.push([Y,Z||void 0]),D.position={start:Dt(Y.start),end:void 0}}function l(D){return Y;function Y(Z){D&&D.call(this,Z),o.call(this,Z)}}function o(D,Y){const Z=this.stack.pop(),ue=this.tokenStack.pop();if(ue)ue[0].type!==D.type&&(Y?Y.call(this,D,ue[0]):(ue[1]||eu).call(this,D,ue[0]));else throw new Error("Cannot close `"+D.type+"` ("+$n({start:D.start,end:D.end})+"): it’s not open");Z.position.end=Dt(D.end)}function d(){return vi(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(D){if(this.data.expectingFirstListItemValue){const Y=this.stack[this.stack.length-2];Y.start=Number.parseInt(this.sliceSerialize(D),10),this.data.expectingFirstListItemValue=void 0}}function h(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.lang=D}function g(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.meta=D}function _(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function T(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.value=D.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.value=D.replace(/(\r?\n|\r)$/g,"")}function A(D){const Y=this.resume(),Z=this.stack[this.stack.length-1];Z.label=Y,Z.identifier=bt(this.sliceSerialize(D)).toLowerCase()}function b(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.title=D}function w(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.url=D}function R(D){const Y=this.stack[this.stack.length-1];if(!Y.depth){const Z=this.sliceSerialize(D).length;Y.depth=Z}}function I(){this.data.setextHeadingSlurpLineEnding=!0}function L(D){const Y=this.stack[this.stack.length-1];Y.depth=this.sliceSerialize(D).codePointAt(0)===61?1:2}function M(){this.data.setextHeadingSlurpLineEnding=void 0}function P(D){const Z=this.stack[this.stack.length-1].children;let ue=Z[Z.length-1];(!ue||ue.type!=="text")&&(ue=it(),ue.position={start:Dt(D.start),end:void 0},Z.push(ue)),this.stack.push(ue)}function S(D){const Y=this.stack.pop();Y.value+=this.sliceSerialize(D),Y.position.end=Dt(D.end)}function B(D){const Y=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Z=Y.children[Y.children.length-1];Z.position.end=Dt(D.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(Y.type)&&(P.call(this,D),S.call(this,D))}function $(){this.data.atHardBreak=!0}function X(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.value=D}function q(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.value=D}function U(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.value=D}function W(){const D=this.stack[this.stack.length-1];if(this.data.inReference){const Y=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=Y,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function V(){const D=this.stack[this.stack.length-1];if(this.data.inReference){const Y=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=Y,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function K(D){const Y=this.sliceSerialize(D),Z=this.stack[this.stack.length-2];Z.label=Ig(Y),Z.identifier=bt(Y).toLowerCase()}function J(){const D=this.stack[this.stack.length-1],Y=this.resume(),Z=this.stack[this.stack.length-1];if(this.data.inReference=!0,Z.type==="link"){const ue=D.children;Z.children=ue}else Z.alt=Y}function k(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.url=D}function re(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.title=D}function he(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function Ee(D){const Y=this.resume(),Z=this.stack[this.stack.length-1];Z.label=Y,Z.identifier=bt(this.sliceSerialize(D)).toLowerCase(),this.data.referenceType="full"}function ve(D){this.data.characterReferenceType=D.type}function fe(D){const Y=this.sliceSerialize(D),Z=this.data.characterReferenceType;let ue;Z?(ue=Nl(Y,Z==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ue=Di(Y);const me=this.stack[this.stack.length-1];me.value+=ue}function Ge(D){const Y=this.stack.pop();Y.position.end=Dt(D.end)}function Ie(D){S.call(this,D);const Y=this.stack[this.stack.length-1];Y.url=this.sliceSerialize(D)}function Ne(D){S.call(this,D);const Y=this.stack[this.stack.length-1];Y.url="mailto:"+this.sliceSerialize(D)}function ye(){return{type:"blockquote",children:[]}}function Fe(){return{type:"code",lang:null,meta:null,value:""}}function Re(){return{type:"inlineCode",value:""}}function De(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Oe(){return{type:"emphasis",children:[]}}function Ue(){return{type:"heading",depth:0,children:[]}}function Se(){return{type:"break"}}function He(){return{type:"html",value:""}}function We(){return{type:"image",title:null,url:"",alt:null}}function Tt(){return{type:"link",title:null,url:"",children:[]}}function Je(D){return{type:"list",ordered:D.type==="listOrdered",start:null,spread:D._spread,children:[]}}function qt(D){return{type:"listItem",spread:D._spread,checked:null,children:[]}}function st(){return{type:"paragraph",children:[]}}function dt(){return{type:"strong",children:[]}}function it(){return{type:"text",value:""}}function le(){return{type:"thematicBreak"}}}function Dt(t){return{line:t.line,column:t.column,offset:t.offset}}function Fl(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?Fl(t,r):Rg(t,r)}}function Rg(t,e){let n;for(n in e)if(Bl.call(e,n))switch(n){case"canContainEols":{const r=e[n];r&&t[n].push(...r);break}case"transforms":{const r=e[n];r&&t[n].push(...r);break}case"enter":case"exit":{const r=e[n];r&&Object.assign(t[n],r);break}}}function eu(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+$n({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+$n({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+$n({start:e.start,end:e.end})+") is still open")}function Og(t){const e=this;e.parser=n;function n(r){return Sg(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function Lg(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function vg(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
79
+ `;break}case-2:{a=e?" ":" ";break}case-1:{if(!e&&s)continue;a=" ";break}default:a=String.fromCharCode(i)}s=i===-2,r.push(a)}return r.join("")}function yg(t){const r={constructs:Il([Eg,...(t||{}).extensions||[]]),content:s(Bm),defined:[],document:s(Um),flow:s(rg),lazy:{},string:s(ag),text:s(ug)};return r;function s(i){return a;function a(u){return Tg(r,i,u)}}}function Ag(t){for(;!Ol(t););return t}const Ja=/[\0\t\n\r]/g;function kg(){let t=1,e="",n=!0,r;return s;function s(i,a,u){const l=[];let o,d,f,p,h;for(i=e+(typeof i=="string"?i.toString():new TextDecoder(a||void 0).decode(i)),f=0,e="",n&&(i.charCodeAt(0)===65279&&f++,n=void 0);f<i.length;){if(Ja.lastIndex=f,o=Ja.exec(i),p=o&&o.index!==void 0?o.index:i.length,h=i.charCodeAt(p),!o){e=i.slice(f);break}if(h===10&&f===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<p&&(l.push(i.slice(f,p)),t+=p-f),h){case 0:{l.push(65533),t++;break}case 9:{for(d=Math.ceil(t/4)*4,l.push(-2);t++<d;)l.push(-1);break}case 10:{l.push(-4),t=1;break}default:r=!0,t=1}f=p+1}return u&&(r&&l.push(-5),e&&l.push(e),l.push(null)),l}}const Cg=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Ig(t){return t.replace(Cg,Ng)}function Ng(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),i=s===120||s===88;return Nl(n.slice(i?2:1),i?16:10)}return Di(n)||t}const Bl={}.hasOwnProperty;function Sg(t,e,n){return typeof e!="string"&&(n=e,e=void 0),wg(n)(Ag(yg(n).document().write(kg()(t,e,!0))))}function wg(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Tt),autolinkProtocol:P,autolinkEmail:P,atxHeading:i(Ue),blockQuote:i(ye),characterEscape:P,characterReference:P,codeFenced:i(Fe),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:i(Fe,a),codeText:i(Re,a),codeTextData:P,data:P,codeFlowValue:P,definition:i(De),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:i(Oe),hardBreakEscape:i(Se),hardBreakTrailing:i(Se),htmlFlow:i(He,a),htmlFlowData:P,htmlText:i(He,a),htmlTextData:P,image:i(We),label:a,link:i(Tt),listItem:i(qt),listItemValue:p,listOrdered:i(Je,f),listUnordered:i(Je),paragraph:i(st),reference:N,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:i(Ue),strong:i(dt),thematicBreak:i(le)},exit:{atxHeading:l(),atxHeadingSequence:R,autolink:l(),autolinkEmail:Ne,autolinkProtocol:Ie,blockQuote:l(),characterEscapeValue:S,characterReferenceMarkerHexadecimal:ve,characterReferenceMarkerNumeric:ve,characterReferenceValue:fe,characterReference:Ge,codeFenced:l(T),codeFencedFence:_,codeFencedFenceInfo:h,codeFencedFenceMeta:g,codeFlowValue:S,codeIndented:l(E),codeText:l(U),codeTextData:S,data:S,definition:l(),definitionDestinationString:w,definitionLabelString:A,definitionTitleString:b,emphasis:l(),hardBreakEscape:l($),hardBreakTrailing:l($),htmlFlow:l(X),htmlFlowData:S,htmlText:l(q),htmlTextData:S,image:l(V),label:J,labelText:K,lineEnding:B,link:l(W),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:Ee,resourceDestinationString:k,resourceTitleString:se,resource:he,setextHeading:l(M),setextHeadingLineSequence:L,setextHeadingText:I,strong:l(),thematicBreak:l()}};Fl(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(D){let Y={type:"root",children:[]};const Z={stack:[Y],tokenStack:[],config:e,enter:u,exit:o,buffer:a,resume:d,data:n},ue=[];let me=-1;for(;++me<D.length;)if(D[me][1].type==="listOrdered"||D[me][1].type==="listUnordered")if(D[me][0]==="enter")ue.push(me);else{const ze=ue.pop();me=s(D,ze,me)}for(me=-1;++me<D.length;){const ze=e[D[me][0]];Bl.call(ze,D[me][1].type)&&ze[D[me][1].type].call(Object.assign({sliceSerialize:D[me][2].sliceSerialize},Z),D[me][1])}if(Z.tokenStack.length>0){const ze=Z.tokenStack[Z.tokenStack.length-1];(ze[1]||eu).call(Z,void 0,ze[0])}for(Y.position={start:Dt(D.length>0?D[0][1].start:{line:1,column:1,offset:0}),end:Dt(D.length>0?D[D.length-2][1].end:{line:1,column:1,offset:0})},me=-1;++me<e.transforms.length;)Y=e.transforms[me](Y)||Y;return Y}function s(D,Y,Z){let ue=Y-1,me=-1,ze=!1,xt,at,vt,Vt;for(;++ue<=Z;){const ut=D[ue];switch(ut[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ut[0]==="enter"?me++:me--,Vt=void 0;break}case"lineEndingBlank":{ut[0]==="enter"&&(xt&&!Vt&&!me&&!vt&&(vt=ue),Vt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Vt=void 0}if(!me&&ut[0]==="enter"&&ut[1].type==="listItemPrefix"||me===-1&&ut[0]==="exit"&&(ut[1].type==="listUnordered"||ut[1].type==="listOrdered")){if(xt){let un=ue;for(at=void 0;un--;){const St=D[un];if(St[1].type==="lineEnding"||St[1].type==="lineEndingBlank"){if(St[0]==="exit")continue;at&&(D[at][1].type="lineEndingBlank",ze=!0),St[1].type="lineEnding",at=un}else if(!(St[1].type==="linePrefix"||St[1].type==="blockQuotePrefix"||St[1].type==="blockQuotePrefixWhitespace"||St[1].type==="blockQuoteMarker"||St[1].type==="listItemIndent"))break}vt&&(!at||vt<at)&&(xt._spread=!0),xt.end=Object.assign({},at?D[at][1].start:ut[1].end),D.splice(at||ue,0,["exit",xt,ut[2]]),ue++,Z++}if(ut[1].type==="listItemPrefix"){const un={type:"listItem",_spread:!1,start:Object.assign({},ut[1].start),end:void 0};xt=un,D.splice(ue,0,["enter",un,ut[2]]),ue++,Z++,vt=void 0,Vt=!0}}}return D[Y][1]._spread=ze,Z}function i(D,Y){return Z;function Z(ue){u.call(this,D(ue),ue),Y&&Y.call(this,ue)}}function a(){this.stack.push({type:"fragment",children:[]})}function u(D,Y,Z){this.stack[this.stack.length-1].children.push(D),this.stack.push(D),this.tokenStack.push([Y,Z||void 0]),D.position={start:Dt(Y.start),end:void 0}}function l(D){return Y;function Y(Z){D&&D.call(this,Z),o.call(this,Z)}}function o(D,Y){const Z=this.stack.pop(),ue=this.tokenStack.pop();if(ue)ue[0].type!==D.type&&(Y?Y.call(this,D,ue[0]):(ue[1]||eu).call(this,D,ue[0]));else throw new Error("Cannot close `"+D.type+"` ("+$n({start:D.start,end:D.end})+"): it’s not open");Z.position.end=Dt(D.end)}function d(){return vi(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(D){if(this.data.expectingFirstListItemValue){const Y=this.stack[this.stack.length-2];Y.start=Number.parseInt(this.sliceSerialize(D),10),this.data.expectingFirstListItemValue=void 0}}function h(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.lang=D}function g(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.meta=D}function _(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function T(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.value=D.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.value=D.replace(/(\r?\n|\r)$/g,"")}function A(D){const Y=this.resume(),Z=this.stack[this.stack.length-1];Z.label=Y,Z.identifier=bt(this.sliceSerialize(D)).toLowerCase()}function b(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.title=D}function w(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.url=D}function R(D){const Y=this.stack[this.stack.length-1];if(!Y.depth){const Z=this.sliceSerialize(D).length;Y.depth=Z}}function I(){this.data.setextHeadingSlurpLineEnding=!0}function L(D){const Y=this.stack[this.stack.length-1];Y.depth=this.sliceSerialize(D).codePointAt(0)===61?1:2}function M(){this.data.setextHeadingSlurpLineEnding=void 0}function P(D){const Z=this.stack[this.stack.length-1].children;let ue=Z[Z.length-1];(!ue||ue.type!=="text")&&(ue=it(),ue.position={start:Dt(D.start),end:void 0},Z.push(ue)),this.stack.push(ue)}function S(D){const Y=this.stack.pop();Y.value+=this.sliceSerialize(D),Y.position.end=Dt(D.end)}function B(D){const Y=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Z=Y.children[Y.children.length-1];Z.position.end=Dt(D.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(Y.type)&&(P.call(this,D),S.call(this,D))}function $(){this.data.atHardBreak=!0}function X(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.value=D}function q(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.value=D}function U(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.value=D}function W(){const D=this.stack[this.stack.length-1];if(this.data.inReference){const Y=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=Y,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function V(){const D=this.stack[this.stack.length-1];if(this.data.inReference){const Y=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=Y,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function K(D){const Y=this.sliceSerialize(D),Z=this.stack[this.stack.length-2];Z.label=Ig(Y),Z.identifier=bt(Y).toLowerCase()}function J(){const D=this.stack[this.stack.length-1],Y=this.resume(),Z=this.stack[this.stack.length-1];if(this.data.inReference=!0,Z.type==="link"){const ue=D.children;Z.children=ue}else Z.alt=Y}function k(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.url=D}function se(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.title=D}function he(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function Ee(D){const Y=this.resume(),Z=this.stack[this.stack.length-1];Z.label=Y,Z.identifier=bt(this.sliceSerialize(D)).toLowerCase(),this.data.referenceType="full"}function ve(D){this.data.characterReferenceType=D.type}function fe(D){const Y=this.sliceSerialize(D),Z=this.data.characterReferenceType;let ue;Z?(ue=Nl(Y,Z==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ue=Di(Y);const me=this.stack[this.stack.length-1];me.value+=ue}function Ge(D){const Y=this.stack.pop();Y.position.end=Dt(D.end)}function Ie(D){S.call(this,D);const Y=this.stack[this.stack.length-1];Y.url=this.sliceSerialize(D)}function Ne(D){S.call(this,D);const Y=this.stack[this.stack.length-1];Y.url="mailto:"+this.sliceSerialize(D)}function ye(){return{type:"blockquote",children:[]}}function Fe(){return{type:"code",lang:null,meta:null,value:""}}function Re(){return{type:"inlineCode",value:""}}function De(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Oe(){return{type:"emphasis",children:[]}}function Ue(){return{type:"heading",depth:0,children:[]}}function Se(){return{type:"break"}}function He(){return{type:"html",value:""}}function We(){return{type:"image",title:null,url:"",alt:null}}function Tt(){return{type:"link",title:null,url:"",children:[]}}function Je(D){return{type:"list",ordered:D.type==="listOrdered",start:null,spread:D._spread,children:[]}}function qt(D){return{type:"listItem",spread:D._spread,checked:null,children:[]}}function st(){return{type:"paragraph",children:[]}}function dt(){return{type:"strong",children:[]}}function it(){return{type:"text",value:""}}function le(){return{type:"thematicBreak"}}}function Dt(t){return{line:t.line,column:t.column,offset:t.offset}}function Fl(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?Fl(t,r):Rg(t,r)}}function Rg(t,e){let n;for(n in e)if(Bl.call(e,n))switch(n){case"canContainEols":{const r=e[n];r&&t[n].push(...r);break}case"transforms":{const r=e[n];r&&t[n].push(...r);break}case"enter":case"exit":{const r=e[n];r&&Object.assign(t[n],r);break}}}function eu(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+$n({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+$n({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+$n({start:e.start,end:e.end})+") is still open")}function Og(t){const e=this;e.parser=n;function n(r){return Sg(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function Lg(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function vg(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
80
80
  `}]}function Dg(t,e){const n=e.value?e.value+`
81
81
  `:"",r={},s=e.lang?e.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return e.meta&&(i.data={meta:e.meta}),t.patch(e,i),i=t.applyData(e,i),i={type:"element",tagName:"pre",properties:{},children:[i]},t.patch(e,i),i}function Pg(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Mg(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Bg(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=String(e.identifier).toUpperCase(),s=Cn(r.toLowerCase()),i=t.footnoteOrder.indexOf(r);let a,u=t.footnoteCounts.get(r);u===void 0?(u=0,t.footnoteOrder.push(r),a=t.footnoteOrder.length):a=i+1,u+=1,t.footnoteCounts.set(r,u);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};t.patch(e,l);const o={type:"element",tagName:"sup",properties:{},children:[l]};return t.patch(e,o),t.applyData(e,o)}function Fg(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Ug(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function Ul(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const s=t.all(e),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const a=s[s.length-1];return a&&a.type==="text"?a.value+=r:s.push({type:"text",value:r}),s}function Hg(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return Ul(t,e);const s={src:Cn(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return t.patch(e,i),t.applyData(e,i)}function jg(t,e){const n={src:Cn(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function zg(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function $g(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return Ul(t,e);const s={href:Cn(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function Yg(t,e){const n={href:Cn(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function qg(t,e,n){const r=t.all(e),s=n?Vg(n):Hl(e),i={},a=[];if(typeof e.checked=="boolean"){const d=r[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const d=r[u];(s||u!==0||d.type!=="element"||d.tagName!=="p")&&a.push({type:"text",value:`
82
82
  `}),d.type==="element"&&d.tagName==="p"&&!s?a.push(...d.children):a.push(d)}const l=r[r.length-1];l&&(s||l.type!=="element"||l.tagName!=="p")&&a.push({type:"text",value:`
@@ -102,6 +102,6 @@ Please report this to https://github.com/markedjs/marked.`,t){const r="<p>An err
102
102
  `))+1))}const a="#".repeat(s),u=n.enter("headingAtx"),l=n.enter("phrasing");i.move(a+" ");let o=n.containerPhrasing(t,{before:"# ",after:`
103
103
  `,...i.current()});return/^[\t ]/.test(o)&&(o=ir(o.charCodeAt(0))+o.slice(1)),o=o?a+" "+o:a,n.options.closeAtx&&(o+=" "+a),l(),u(),o}Dc.peek=c3;function Dc(t){return t.value||""}function c3(){return"<"}Pc.peek=d3;function Pc(t,e,n,r){const s=Gi(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("image");let u=n.enter("label");const l=n.createTracker(r);let o=l.move("![");return o+=l.move(n.safe(t.alt,{before:o,after:"]",...l.current()})),o+=l.move("]("),u(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(u=n.enter("destinationLiteral"),o+=l.move("<"),o+=l.move(n.safe(t.url,{before:o,after:">",...l.current()})),o+=l.move(">")):(u=n.enter("destinationRaw"),o+=l.move(n.safe(t.url,{before:o,after:t.title?" ":")",...l.current()}))),u(),t.title&&(u=n.enter(`title${i}`),o+=l.move(" "+s),o+=l.move(n.safe(t.title,{before:o,after:s,...l.current()})),o+=l.move(s),u()),o+=l.move(")"),a(),o}function d3(){return"!"}Mc.peek=f3;function Mc(t,e,n,r){const s=t.referenceType,i=n.enter("imageReference");let a=n.enter("label");const u=n.createTracker(r);let l=u.move("![");const o=n.safe(t.alt,{before:l,after:"]",...u.current()});l+=u.move(o+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(t),{before:l,after:"]",...u.current()});return a(),n.stack=d,i(),s==="full"||!o||o!==f?l+=u.move(f+"]"):s==="shortcut"?l=l.slice(0,-1):l+=u.move("]"),l}function f3(){return"!"}Bc.peek=h3;function Bc(t,e,n){let r=t.value||"",s="`",i=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const a=n.unsafe[i],u=n.compilePattern(a);let l;if(a.atBreak)for(;l=u.exec(r);){let o=l.index;r.charCodeAt(o)===10&&r.charCodeAt(o-1)===13&&o--,r=r.slice(0,o)+" "+r.slice(l.index+1)}}return s+r+s}function h3(){return"`"}function Fc(t,e){const n=vi(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}Uc.peek=p3;function Uc(t,e,n,r){const s=Gi(n),i=s==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let u,l;if(Fc(t,n)){const d=n.stack;n.stack=[],u=n.enter("autolink");let f=a.move("<");return f+=a.move(n.containerPhrasing(t,{before:f,after:">",...a.current()})),f+=a.move(">"),u(),n.stack=d,f}u=n.enter("link"),l=n.enter("label");let o=a.move("[");return o+=a.move(n.containerPhrasing(t,{before:o,after:"](",...a.current()})),o+=a.move("]("),l(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(l=n.enter("destinationLiteral"),o+=a.move("<"),o+=a.move(n.safe(t.url,{before:o,after:">",...a.current()})),o+=a.move(">")):(l=n.enter("destinationRaw"),o+=a.move(n.safe(t.url,{before:o,after:t.title?" ":")",...a.current()}))),l(),t.title&&(l=n.enter(`title${i}`),o+=a.move(" "+s),o+=a.move(n.safe(t.title,{before:o,after:s,...a.current()})),o+=a.move(s),l()),o+=a.move(")"),u(),o}function p3(t,e,n){return Fc(t,n)?"<":"["}Hc.peek=m3;function Hc(t,e,n,r){const s=t.referenceType,i=n.enter("linkReference");let a=n.enter("label");const u=n.createTracker(r);let l=u.move("[");const o=n.containerPhrasing(t,{before:l,after:"]",...u.current()});l+=u.move(o+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(t),{before:l,after:"]",...u.current()});return a(),n.stack=d,i(),s==="full"||!o||o!==f?l+=u.move(f+"]"):s==="shortcut"?l=l.slice(0,-1):l+=u.move("]"),l}function m3(){return"["}function Wi(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function g3(t){const e=Wi(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function b3(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function jc(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function E3(t,e,n,r){const s=n.enter("list"),i=n.bulletCurrent;let a=t.ordered?b3(n):Wi(n);const u=t.ordered?a==="."?")":".":g3(n);let l=e&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!t.ordered){const d=t.children?t.children[0]:void 0;if((a==="*"||a==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),jc(n)===a&&d){let f=-1;for(;++f<t.children.length;){const p=t.children[f];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(a=u),n.bulletCurrent=a;const o=n.containerFlow(t,r);return n.bulletLastUsed=a,n.bulletCurrent=i,s(),o}function T3(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function x3(t,e,n,r){const s=T3(n);let i=n.bulletCurrent||Wi(n);e&&e.type==="list"&&e.ordered&&(i=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+i);let a=i.length+1;(s==="tab"||s==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(a=Math.ceil(a/4)*4);const u=n.createTracker(r);u.move(i+" ".repeat(a-i.length)),u.shift(a);const l=n.enter("listItem"),o=n.indentLines(n.containerFlow(t,u.current()),d);return l(),o;function d(f,p,h){return p?(h?"":" ".repeat(a))+f:(h?i:i+" ".repeat(a-i.length))+f}}function _3(t,e,n,r){const s=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(t,r);return i(),s(),a}const y3=ts(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function A3(t,e,n,r){return(t.children.some(function(a){return y3(a)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function k3(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}zc.peek=C3;function zc(t,e,n,r){const s=k3(n),i=n.enter("strong"),a=n.createTracker(r),u=a.move(s+s);let l=a.move(n.containerPhrasing(t,{after:s,before:u,...a.current()}));const o=l.charCodeAt(0),d=zr(r.before.charCodeAt(r.before.length-1),o,s);d.inside&&(l=ir(o)+l.slice(1));const f=l.charCodeAt(l.length-1),p=zr(r.after.charCodeAt(0),f,s);p.inside&&(l=l.slice(0,-1)+ir(f));const h=a.move(s+s);return i(),n.attentionEncodeSurroundingInfo={after:p.outside,before:d.outside},u+l+h}function C3(t,e,n){return n.options.strong||"*"}function I3(t,e,n,r){return n.safe(t.value,r)}function N3(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function S3(t,e,n){const r=(jc(n)+(n.options.ruleSpaces?" ":"")).repeat(N3(n));return n.options.ruleSpaces?r.slice(0,-1):r}const $c={blockquote:Zx,break:Bu,code:r3,definition:i3,emphasis:vc,hardBreak:Bu,heading:l3,html:Dc,image:Pc,imageReference:Mc,inlineCode:Bc,link:Uc,linkReference:Hc,list:E3,listItem:x3,paragraph:_3,root:A3,strong:zc,text:I3,thematicBreak:S3};function w3(){return{enter:{table:R3,tableData:Fu,tableHeader:Fu,tableRow:L3},exit:{codeText:v3,table:O3,tableData:Os,tableHeader:Os,tableRow:Os}}}function R3(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function O3(t){this.exit(t),this.data.inTable=void 0}function L3(t){this.enter({type:"tableRow",children:[]},t)}function Os(t){this.exit(t)}function Fu(t){this.enter({type:"tableCell",children:[]},t)}function v3(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,D3));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function D3(t,e){return e==="|"?e:t}function P3(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,s=e.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
104
104
  `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:a,tableCell:l,tableRow:u}};function a(h,g,_,T){return o(d(h,_,T),h.align)}function u(h,g,_,T){const E=f(h,_,T),A=o([E]);return A.slice(0,A.indexOf(`
105
- `))}function l(h,g,_,T){const E=_.enter("tableCell"),A=_.enter("phrasing"),b=_.containerPhrasing(h,{...T,before:i,after:i});return A(),E(),b}function o(h,g){return Qx(h,{align:g,alignDelimiters:r,padding:n,stringLength:s})}function d(h,g,_){const T=h.children;let E=-1;const A=[],b=g.enter("table");for(;++E<T.length;)A[E]=f(T[E],g,_);return b(),A}function f(h,g,_){const T=h.children;let E=-1;const A=[],b=g.enter("tableRow");for(;++E<T.length;)A[E]=l(T[E],h,g,_);return b(),A}function p(h,g,_){let T=$c.inlineCode(h,g,_);return _.stack.includes("tableCell")&&(T=T.replace(/\|/g,"\\$&")),T}}function M3(){return{exit:{taskListCheckValueChecked:Uu,taskListCheckValueUnchecked:Uu,paragraph:F3}}}function B3(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:U3}}}function Uu(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function F3(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const s=e.children;let i=-1,a;for(;++i<s.length;){const u=s[i];if(u.type==="paragraph"){a=u;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function U3(t,e,n,r){const s=t.children[0],i=typeof t.checked=="boolean"&&s&&s.type==="paragraph",a="["+(t.checked?"x":" ")+"] ",u=n.createTracker(r);i&&u.move(a);let l=$c.listItem(t,e,n,{...r,...u.current()});return i&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,o)),l;function o(d){return d+a}}function H3(){return[Ex(),Ux(),$x(),w3(),M3()]}function j3(t){return{extensions:[Tx(),Hx(t),Yx(),P3(t),B3()]}}const z3={tokenize:W3,partial:!0},Yc={tokenize:Q3,partial:!0},qc={tokenize:X3,partial:!0},Vc={tokenize:Z3,partial:!0},$3={tokenize:K3,partial:!0},Gc={name:"wwwAutolink",tokenize:V3,previous:Qc},Wc={name:"protocolAutolink",tokenize:G3,previous:Xc},Lt={name:"emailAutolink",tokenize:q3,previous:Zc},Nt={};function Y3(){return{text:Nt}}let Wt=48;for(;Wt<123;)Nt[Wt]=Lt,Wt++,Wt===58?Wt=65:Wt===91&&(Wt=97);Nt[43]=Lt;Nt[45]=Lt;Nt[46]=Lt;Nt[95]=Lt;Nt[72]=[Lt,Wc];Nt[104]=[Lt,Wc];Nt[87]=[Lt,Gc];Nt[119]=[Lt,Gc];function q3(t,e,n){const r=this;let s,i;return a;function a(f){return!ii(f)||!Zc.call(r,r.previous)||Qi(r.events)?n(f):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),u(f))}function u(f){return ii(f)?(t.consume(f),u):f===64?(t.consume(f),l):n(f)}function l(f){return f===46?t.check($3,d,o)(f):f===45||f===95||Ye(f)?(i=!0,t.consume(f),l):d(f)}function o(f){return t.consume(f),s=!0,l}function d(f){return i&&s&&Ze(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(f)):n(f)}}function V3(t,e,n){const r=this;return s;function s(a){return a!==87&&a!==119||!Qc.call(r,r.previous)||Qi(r.events)?n(a):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(z3,t.attempt(Yc,t.attempt(qc,i),n),n)(a))}function i(a){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(a)}}function G3(t,e,n){const r=this;let s="",i=!1;return a;function a(f){return(f===72||f===104)&&Xc.call(r,r.previous)&&!Qi(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),s+=String.fromCodePoint(f),t.consume(f),u):n(f)}function u(f){if(Ze(f)&&s.length<5)return s+=String.fromCodePoint(f),t.consume(f),u;if(f===58){const p=s.toLowerCase();if(p==="http"||p==="https")return t.consume(f),l}return n(f)}function l(f){return f===47?(t.consume(f),i?o:(i=!0,l)):n(f)}function o(f){return f===null||Br(f)||xe(f)||nn(f)||Kr(f)?n(f):t.attempt(Yc,t.attempt(qc,d),n)(f)}function d(f){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(f)}}function W3(t,e,n){let r=0;return s;function s(a){return(a===87||a===119)&&r<3?(r++,t.consume(a),s):a===46&&r===3?(t.consume(a),i):n(a)}function i(a){return a===null?n(a):e(a)}}function Q3(t,e,n){let r,s,i;return a;function a(o){return o===46||o===95?t.check(Vc,l,u)(o):o===null||xe(o)||nn(o)||o!==45&&Kr(o)?l(o):(i=!0,t.consume(o),a)}function u(o){return o===95?r=!0:(s=r,r=void 0),t.consume(o),a}function l(o){return s||r||!i?n(o):e(o)}}function X3(t,e){let n=0,r=0;return s;function s(a){return a===40?(n++,t.consume(a),s):a===41&&r<n?i(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?t.check(Vc,e,i)(a):a===null||xe(a)||nn(a)?e(a):(t.consume(a),s)}function i(a){return a===41&&r++,t.consume(a),s}}function Z3(t,e,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(t.consume(u),r):u===38?(t.consume(u),i):u===93?(t.consume(u),s):u===60||u===null||xe(u)||nn(u)?e(u):n(u)}function s(u){return u===null||u===40||u===91||xe(u)||nn(u)?e(u):r(u)}function i(u){return Ze(u)?a(u):n(u)}function a(u){return u===59?(t.consume(u),r):Ze(u)?(t.consume(u),a):n(u)}}function K3(t,e,n){return r;function r(i){return t.consume(i),s}function s(i){return Ye(i)?n(i):e(i)}}function Qc(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||xe(t)}function Xc(t){return!Ze(t)}function Zc(t){return!(t===47||ii(t))}function ii(t){return t===43||t===45||t===46||t===95||Ye(t)}function Qi(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const J3={tokenize:u_,partial:!0};function e_(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:s_,continuation:{tokenize:i_},exit:a_}},text:{91:{name:"gfmFootnoteCall",tokenize:r_},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:t_,resolveTo:n_}}}}function t_(t,e,n){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const l=r.events[s][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return u;function u(l){if(!a||!a._balanced)return n(l);const o=bt(r.sliceSerialize({start:a.end,end:r.now()}));return o.codePointAt(0)!==94||!i.includes(o.slice(1))?n(l):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(l),t.exit("gfmFootnoteCallLabelMarker"),e(l))}}function n_(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},t[t.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},u=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",s,e],["exit",s,e],["enter",i,e],["enter",a,e],["exit",a,e],["exit",i,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...u),t}function r_(t,e,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return u;function u(f){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(t.enter("gfmFootnoteCallMarker"),t.consume(f),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",o)}function o(f){if(i>999||f===93&&!a||f===null||f===91||xe(f))return n(f);if(f===93){t.exit("chunkString");const p=t.exit("gfmFootnoteCallString");return s.includes(bt(r.sliceSerialize(p)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(f)}return xe(f)||(a=!0),i++,t.consume(f),f===92?d:o}function d(f){return f===91||f===92||f===93?(t.consume(f),i++,o):o(f)}}function s_(t,e,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,u;return l;function l(g){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),o}function o(g){return g===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",d):n(g)}function d(g){if(a>999||g===93&&!u||g===null||g===91||xe(g))return n(g);if(g===93){t.exit("chunkString");const _=t.exit("gfmFootnoteDefinitionLabelString");return i=bt(r.sliceSerialize(_)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),p}return xe(g)||(u=!0),a++,t.consume(g),g===92?f:d}function f(g){return g===91||g===92||g===93?(t.consume(g),a++,d):d(g)}function p(g){return g===58?(t.enter("definitionMarker"),t.consume(g),t.exit("definitionMarker"),s.includes(i)||s.push(i),de(t,h,"gfmFootnoteDefinitionWhitespace")):n(g)}function h(g){return e(g)}}function i_(t,e,n){return t.check(mr,e,t.attempt(J3,e,n))}function a_(t){t.exit("gfmFootnoteDefinition")}function u_(t,e,n){const r=this;return de(t,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?e(i):n(i)}}function o_(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,u){let l=-1;for(;++l<a.length;)if(a[l][0]==="enter"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._close){let o=l;for(;o--;)if(a[o][0]==="exit"&&a[o][1].type==="strikethroughSequenceTemporary"&&a[o][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[o][1].end.offset-a[o][1].start.offset){a[l][1].type="strikethroughSequence",a[o][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},a[o][1].start),end:Object.assign({},a[l][1].end)},f={type:"strikethroughText",start:Object.assign({},a[o][1].end),end:Object.assign({},a[l][1].start)},p=[["enter",d,u],["enter",a[o][1],u],["exit",a[o][1],u],["enter",f,u]],h=u.parser.constructs.insideSpan.null;h&&lt(p,p.length,0,Jr(h,a.slice(o+1,l),u)),lt(p,p.length,0,[["exit",f,u],["enter",a[l][1],u],["exit",a[l][1],u],["exit",d,u]]),lt(a,o-1,l-o+3,p),l=o+p.length-2;break}}for(l=-1;++l<a.length;)a[l][1].type==="strikethroughSequenceTemporary"&&(a[l][1].type="data");return a}function i(a,u,l){const o=this.previous,d=this.events;let f=0;return p;function p(g){return o===126&&d[d.length-1][1].type!=="characterEscape"?l(g):(a.enter("strikethroughSequenceTemporary"),h(g))}function h(g){const _=bn(o);if(g===126)return f>1?l(g):(a.consume(g),f++,h);if(f<2&&!n)return l(g);const T=a.exit("strikethroughSequenceTemporary"),E=bn(g);return T._open=!E||E===2&&!!_,T._close=!_||_===2&&!!E,u(g)}}}class l_{constructor(){this.map=[]}add(e,n,r){c_(this,e,n,r)}consume(e){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let s=r.pop();for(;s;){for(const i of s)e.push(i);s=r.pop()}this.map.length=0}}function c_(t,e,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<t.map.length;){if(t.map[s][0]===e){t.map[s][1]+=n,t.map[s][2].push(...r);return}s+=1}t.map.push([e,n,r])}}function d_(t,e){let n=!1;const r=[];for(;e<t.length;){const s=t[e];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function f_(){return{flow:{null:{name:"table",tokenize:h_,resolveAll:p_}}}}function h_(t,e,n){const r=this;let s=0,i=0,a;return u;function u(S){let B=r.events.length-1;for(;B>-1;){const q=r.events[B][1].type;if(q==="lineEnding"||q==="linePrefix")B--;else break}const $=B>-1?r.events[B][1].type:null,X=$==="tableHead"||$==="tableRow"?I:l;return X===I&&r.parser.lazy[r.now().line]?n(S):X(S)}function l(S){return t.enter("tableHead"),t.enter("tableRow"),o(S)}function o(S){return S===124||(a=!0,i+=1),d(S)}function d(S){return S===null?n(S):ee(S)?i>1?(i=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(S),t.exit("lineEnding"),h):n(S):oe(S)?de(t,d,"whitespace")(S):(i+=1,a&&(a=!1,s+=1),S===124?(t.enter("tableCellDivider"),t.consume(S),t.exit("tableCellDivider"),a=!0,d):(t.enter("data"),f(S)))}function f(S){return S===null||S===124||xe(S)?(t.exit("data"),d(S)):(t.consume(S),S===92?p:f)}function p(S){return S===92||S===124?(t.consume(S),f):f(S)}function h(S){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(S):(t.enter("tableDelimiterRow"),a=!1,oe(S)?de(t,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):g(S))}function g(S){return S===45||S===58?T(S):S===124?(a=!0,t.enter("tableCellDivider"),t.consume(S),t.exit("tableCellDivider"),_):R(S)}function _(S){return oe(S)?de(t,T,"whitespace")(S):T(S)}function T(S){return S===58?(i+=1,a=!0,t.enter("tableDelimiterMarker"),t.consume(S),t.exit("tableDelimiterMarker"),E):S===45?(i+=1,E(S)):S===null||ee(S)?w(S):R(S)}function E(S){return S===45?(t.enter("tableDelimiterFiller"),A(S)):R(S)}function A(S){return S===45?(t.consume(S),A):S===58?(a=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(S),t.exit("tableDelimiterMarker"),b):(t.exit("tableDelimiterFiller"),b(S))}function b(S){return oe(S)?de(t,w,"whitespace")(S):w(S)}function w(S){return S===124?g(S):S===null||ee(S)?!a||s!==i?R(S):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(S)):R(S)}function R(S){return n(S)}function I(S){return t.enter("tableRow"),L(S)}function L(S){return S===124?(t.enter("tableCellDivider"),t.consume(S),t.exit("tableCellDivider"),L):S===null||ee(S)?(t.exit("tableRow"),e(S)):oe(S)?de(t,L,"whitespace")(S):(t.enter("data"),M(S))}function M(S){return S===null||S===124||xe(S)?(t.exit("data"),L(S)):(t.consume(S),S===92?P:M)}function P(S){return S===92||S===124?(t.consume(S),M):M(S)}}function p_(t,e){let n=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],u=!1,l=0,o,d,f;const p=new l_;for(;++n<t.length;){const h=t[n],g=h[1];h[0]==="enter"?g.type==="tableHead"?(u=!1,l!==0&&(Hu(p,e,l,o,d),d=void 0,l=0),o={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(n,0,[["enter",o,e]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,f=void 0,i=[0,0,0,0],a=[0,n+1,0,0],u&&(u=!1,d={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(n,0,[["enter",d,e]])),s=g.type==="tableDelimiterRow"?2:d?3:1):s&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(i[1]!==0&&(a[0]=a[1],f=kr(p,e,i,s,void 0,f),i=[0,0,0,0]),a[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(a[0]=a[1],f=kr(p,e,i,s,void 0,f)),i=a,a=[i[1],n,0,0])):g.type==="tableHead"?(u=!0,l=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(l=n,i[1]!==0?(a[0]=a[1],f=kr(p,e,i,s,n,f)):a[1]!==0&&(f=kr(p,e,a,s,n,f)),s=0):s&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&Hu(p,e,l,o,d),p.consume(e.events),n=-1;++n<e.events.length;){const h=e.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=d_(e.events,n))}return t}function kr(t,e,n,r,s,i){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(i.end=Object.assign({},hn(e.events,n[0])),t.add(n[0],0,[["exit",i,e]]));const l=hn(e.events,n[1]);if(i={type:a,start:Object.assign({},l),end:Object.assign({},l)},t.add(n[1],0,[["enter",i,e]]),n[2]!==0){const o=hn(e.events,n[2]),d=hn(e.events,n[3]),f={type:u,start:Object.assign({},o),end:Object.assign({},d)};if(t.add(n[2],0,[["enter",f,e]]),r!==2){const p=e.events[n[2]],h=e.events[n[3]];if(p[1].end=Object.assign({},h[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,_=n[3]-n[2]-1;t.add(g,_,[])}}t.add(n[3]+1,0,[["exit",f,e]])}return s!==void 0&&(i.end=Object.assign({},hn(e.events,s)),t.add(s,0,[["exit",i,e]]),i=void 0),i}function Hu(t,e,n,r,s){const i=[],a=hn(e.events,n);s&&(s.end=Object.assign({},a),i.push(["exit",s,e])),r.end=Object.assign({},a),i.push(["exit",r,e]),t.add(n+1,0,i)}function hn(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const m_={name:"tasklistCheck",tokenize:b_};function g_(){return{text:{91:m_}}}function b_(t,e,n){const r=this;return s;function s(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),i)}function i(l){return xe(l)?(t.enter("taskListCheckValueUnchecked"),t.consume(l),t.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(t.enter("taskListCheckValueChecked"),t.consume(l),t.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),u):n(l)}function u(l){return ee(l)?e(l):oe(l)?t.check({tokenize:E_},e,n)(l):n(l)}}function E_(t,e,n){return de(t,r,"whitespace");function r(s){return s===null?n(s):e(s)}}function T_(t){return Il([Y3(),e_(),o_(t),f_(),g_()])}const x_={};function __(t){const e=this,n=t||x_,r=e.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(T_(n)),i.push(H3()),a.push(j3(n))}const y_=j.lazy(()=>Td(()=>import("./lazy-highlighter-7Ygumnp-.js"),__vite__mapDeps([0,1,2])));function Kc(){const t=Q.c(3),[e,n]=j.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=async a=>{await navigator.clipboard.writeText(a),n(!0),setTimeout(()=>n(!1),2e3)},t[0]=r):r=t[0];const s=r;let i;return t[1]!==e?(i={handleCopy:s,copied:e},t[1]=e,t[2]=i):i=t[2],i}function A_(){const t=Q.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[85,70],t[0]=e):e=t[0];const n=e;let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx("div",{className:"p-4 font-mono text-sm",style:{background:"#2d2d2d",borderRadius:"0 0 0.5rem 0.5rem",overflow:"auto",minHeight:"4rem"},children:n.map(k_)}),t[1]=r):r=t[1],r}function k_(t,e){return m.jsxs("div",{className:"flex gap-2 items-center my-1",children:[e>2&&e<7&&m.jsx("div",{className:"w-4 h-4 rounded-sm opacity-40 animate-pulse",style:{background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.1}s`}}),e%4===0&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"3rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.12}s`}}),e%3===1&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"2.5rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.14}s`}}),m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:`${t}%`,background:"rgba(255, 255, 255, 0.1)",animationDelay:`${e*.1}s`}}),e%5===2&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"4rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.16}s`}})]},e)}function C_(t){const e=Q.c(12),n=j.useRef(null),{handleCopy:r,copied:s}=Kc(),i=I_;let a;e[0]!==r?(a=async()=>{const p=i(n.current);await r(p)},e[0]=r,e[1]=a):a=e[1];const u=a;let l;e[2]!==s?(l=s?m.jsx($r,{size:12}):m.jsx(pi,{size:12}),e[2]=s,e[3]=l):l=e[3];let o;e[4]!==u||e[5]!==l?(o=m.jsx("div",{className:"flex justify-end items-center",children:m.jsxs(Me,{variant:"ghost",onClick:u,"aria-label":"Copy as CSV",className:"text-muted-foreground hover:text-foreground h-6 text-[10px]",type:"button",children:["Copy as CSV",l]})}),e[4]=u,e[5]=l,e[6]=o):o=e[6];let d;e[7]!==t?(d=m.jsx("div",{className:"overflow-x-auto mb-4 rounded-lg border border-border",children:m.jsx("table",{ref:n,...t,className:"min-w-full border-collapse text-sm",children:t.children})}),e[7]=t,e[8]=d):d=e[8];let f;return e[9]!==o||e[10]!==d?(f=m.jsxs(m.Fragment,{children:[o,d]}),e[9]=o,e[10]=d,e[11]=f):f=e[11],f}function I_(t){return t?Array.from(t.querySelectorAll("tr")).map(N_).join(`
106
- `):""}function N_(t){return Array.from(t.querySelectorAll("th,td")).map(S_).join(",")}function S_(t){let e=t.textContent||"";return e=e.replace(/"/g,'""'),e.search(/([",\n])/g)>=0&&(e=`"${e}"`),e}const w_=[__],R_=[fx],O_={p:t=>m.jsx("p",{...t,className:"leading-relaxed text-[15px] mb-2 last:mb-0"}),strong:t=>m.jsx("strong",{...t,className:"font-bold"}),em:t=>m.jsx("em",{...t,className:"italic"}),a:t=>m.jsx("a",{...t,target:"_blank",rel:"noopener noreferrer",className:"text-primary-dark hover:underline break-all font-medium"}),ul:t=>m.jsx("ul",{...t,className:"list-disc ml-6 my-4 space-y-2"}),ol:t=>m.jsx("ol",{...t,className:"list-decimal ml-6 my-4 space-y-2"}),li:t=>m.jsx("li",{...t,className:"leading-relaxed text-[15px]"}),code:t=>m.jsx("code",{...t,className:"px-1 py-0.5 bg-muted rounded text-[15px] font-mono break-all"}),pre:t=>m.jsx("pre",{...t,className:"flex w-full min-w-0 my-4 bg-muted rounded overflow-hidden",children:m.jsx("code",{className:"flex-1 min-w-0 p-4 text-[15px] font-mono whitespace-pre overflow-x-auto",children:t.children})}),table:t=>m.jsx(C_,{...t}),thead:t=>m.jsx("thead",{...t,className:"bg-muted",children:t.children}),tr:t=>m.jsx("tr",{...t,className:"even:bg-muted/50 border-b border-border last:border-0"}),th:t=>m.jsx("th",{...t,className:"px-4 py-2 text-left font-semibold text-muted-foreground border-b border-border"}),td:t=>m.jsx("td",{...t,className:"px-4 py-2 border-b border-border"})},Jc=j.memo(t=>{const e=Q.c(2),{content:n}=t;let r;return e[0]!==n?(r=m.jsx(Xb,{remarkPlugins:w_,rehypePlugins:R_,components:O_,children:n}),e[0]=n,e[1]=r):r=e[1],r},(t,e)=>t.content===e.content);function L_(t){const e=Q.c(20),{language:n,content:r}=t,{handleCopy:s,copied:i}=Kc(),a=n||"text";let u;e[0]!==a?(u=m.jsx("span",{className:"text-xs font-mono uppercase text-muted-foreground tracking-widest select-none",children:a}),e[0]=a,e[1]=u):u=e[1];let l;e[2]!==r||e[3]!==s?(l=()=>s(r),e[2]=r,e[3]=s,e[4]=l):l=e[4];let o;e[5]!==i?(o=i?m.jsx($r,{size:14}):m.jsx(pi,{size:14}),e[5]=i,e[6]=o):o=e[6];let d;e[7]!==l||e[8]!==o?(d=m.jsx(Me,{size:"icon",variant:"ghost",onClick:l,"aria-label":"Copy code",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:o}),e[7]=l,e[8]=o,e[9]=d):d=e[9];let f;e[10]!==u||e[11]!==d?(f=m.jsxs("div",{className:"flex items-center justify-between p-1 pl-4 bg-muted border-b border-border",children:[u,d]}),e[10]=u,e[11]=d,e[12]=f):f=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=m.jsx(A_,{}),e[13]=p):p=e[13];let h;e[14]!==r||e[15]!==n?(h=m.jsx(j.Suspense,{fallback:p,children:m.jsx(y_,{language:n,content:r})}),e[14]=r,e[15]=n,e[16]=h):h=e[16];let g;return e[17]!==f||e[18]!==h?(g=m.jsxs("div",{className:"my-4 rounded-lg bg-muted overflow-hidden border border-border grid min-w-0",children:[f,h]}),e[17]=f,e[18]=h,e[19]=g):g=e[19],g}Jc.displayName="MemoizedMarkdownBlock";const Xi=t=>{const e=Q.c(7),{id:n,text:r}=t;let s;e[0]!==r?(s=ge.lexer(r),e[0]=r,e[1]=s):s=e[1];const i=s;let a;if(e[2]!==i||e[3]!==n){let u;e[5]!==n?(u=(l,o)=>l.type==="code"?m.jsx(L_,{language:l.lang,content:l.text},`${n}-block_${o}`):m.jsx(Jc,{content:l.raw},`${n}-block_${o}`),e[5]=n,e[6]=u):u=e[6],a=i.map(u),e[2]=i,e[3]=n,e[4]=a}else a=e[4];return a};Xi.displayName="MemoizedMarkdown";function ed(t){const e=Q.c(18),{id:n,part:r,copyable:s,extraActions:i,hasToolCallAfter:a}=t,u=s===void 0?!1:s,l=a===void 0?!1:a,{handleCopy:o}=up(),[d,f]=j.useState(!1);let p;e[0]!==o||e[1]!==r.text?(p=async()=>{await o(r.text),f(!0),setTimeout(()=>f(!1),2e3)},e[0]=o,e[1]=r.text,e[2]=p):p=e[2];const h=p,g=u&&i,_=g||i,T=!l&&"mb-2";let E;e[3]!==T?(E=ie("group/part relative",T),e[3]=T,e[4]=E):E=e[4];let A;e[5]!==n||e[6]!==r.text?(A=m.jsx(Xi,{id:n,text:r.text}),e[5]=n,e[6]=r.text,e[7]=A):A=e[7];let b;e[8]!==i||e[9]!==h||e[10]!==d||e[11]!==_||e[12]!==g?(b=_&&m.jsx("div",{className:"flex w-full items-center text-xs text-muted-foreground opacity-0 pointer-events-none transition-all duration-200 group-hover/part:opacity-100 group-hover/part:pointer-events-auto mt-2",children:m.jsxs("div",{className:"flex items-center gap-1",children:[g&&m.jsx(Me,{onClick:h,variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground size-6 whitespace-nowrap",children:d?m.jsx($r,{size:12}):m.jsx(pi,{size:12})}),i]})}),e[8]=i,e[9]=h,e[10]=d,e[11]=_,e[12]=g,e[13]=b):b=e[13];let w;return e[14]!==E||e[15]!==A||e[16]!==b?(w=m.jsxs("div",{className:E,children:[A,b]}),e[14]=E,e[15]=A,e[16]=b,e[17]=w):w=e[17],w}function v_(t){const e=Q.c(4),{output:n}=t;let r;if(e[0]!==n){const a=JSON.stringify(n,null,2);r=a.length>2e3?a.slice(0,2e3)+"...[TRUNCATED]":a,e[0]=n,e[1]=r}else r=e[1];const s=r;let i;return e[2]!==s?(i=m.jsx("div",{className:"h-full",children:m.jsx(Ku,{code:s,language:"json",height:"100%",readOnly:!0})}),e[2]=s,e[3]=i):i=e[3],i}var os="Collapsible",[D_,rA]=xd(os),[P_,Zi]=D_(os),td=j.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:a,...u}=t,[l,o]=Ad({prop:r,defaultProp:s??!1,onChange:a,caller:os});return m.jsx(P_,{scope:n,disabled:i,contentId:kd(),open:l,onOpenToggle:j.useCallback(()=>o(d=>!d),[o]),children:m.jsx(li.div,{"data-state":ta(l),"data-disabled":i?"":void 0,...u,ref:e})})});td.displayName=os;var nd="CollapsibleTrigger",Ki=j.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,s=Zi(nd,n);return m.jsx(li.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":ta(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:e,onClick:_d(t.onClick,s.onOpenToggle)})});Ki.displayName=nd;var Ji="CollapsibleContent",ea=j.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Zi(Ji,t.__scopeCollapsible);return m.jsx(yd,{present:n||s.open,children:({present:i})=>m.jsx(M_,{...r,ref:e,present:i})})});ea.displayName=Ji;var M_=j.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=t,a=Zi(Ji,n),[u,l]=j.useState(r),o=j.useRef(null),d=Cd(e,o),f=j.useRef(0),p=f.current,h=j.useRef(0),g=h.current,_=a.open||u,T=j.useRef(_),E=j.useRef(void 0);return j.useEffect(()=>{const A=requestAnimationFrame(()=>T.current=!1);return()=>cancelAnimationFrame(A)},[]),Id(()=>{const A=o.current;if(A){E.current=E.current||{transitionDuration:A.style.transitionDuration,animationName:A.style.animationName},A.style.transitionDuration="0s",A.style.animationName="none";const b=A.getBoundingClientRect();f.current=b.height,h.current=b.width,T.current||(A.style.transitionDuration=E.current.transitionDuration,A.style.animationName=E.current.animationName),l(r)}},[a.open,r]),m.jsx(li.div,{"data-state":ta(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!_,...i,ref:d,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...t.style},children:_&&s})});function ta(t){return t?"open":"closed"}var B_=td,sA=Ki,iA=ea;function F_(t){const e=Q.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(B_,{"data-slot":"collapsible",...n}),e[2]=n,e[3]=r):r=e[3],r}function U_(t){const e=Q.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(Ki,{"data-slot":"collapsible-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function H_(t){const e=Q.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(ea,{"data-slot":"collapsible-content",...n}),e[2]=n,e[3]=r):r=e[3],r}function j_(t){return t.split(/[_-]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")}function ju(t){const e=Q.c(70),{part:n,isFirstInSequence:r,isLastInSequence:s,hasNextToolCall:i}=t,a=r===void 0?!1:r,u=s===void 0?!1:s,l=i===void 0?!1:i,{state:o}=n;let d;e[0]!==n?(d="toolName"in n?n.toolName:n.type.replace("tool-",""),e[0]=n,e[1]=d):d=e[1];const f=d;let p;e[2]!==f?(p=j_(f),e[2]=f,e[3]=p):p=e[3];const h=p,[g,_]=j.useState(!1),[T]=zd(),E=(o==="input-streaming"||o==="input-available"||o==="output-available")&&!!n.input,A=o==="output-available",b=o==="output-error";if(!T){const ve=o==="input-streaming"||o==="input-available",fe=o==="output-available",Ge=o==="output-error",Ie=a&&"mt-2",Ne=u&&"mb-2";let ye;e[4]!==Ie||e[5]!==Ne?(ye=ie("flex items-center gap-1.5 py-2 opacity-75 relative",Ie,Ne),e[4]=Ie,e[5]=Ne,e[6]=ye):ye=e[6];let Fe;e[7]===Symbol.for("react.memo_cache_sentinel")?(Fe=m.jsx(Ju,{className:"size-4 text-muted-foreground shrink-0"}),e[7]=Fe):Fe=e[7];let Re;e[8]!==l?(Re=l&&m.jsx("div",{className:"absolute left-1/2 top-full w-px bg-border -translate-x-1/2",style:{height:"calc(100% + 1rem)"}}),e[8]=l,e[9]=Re):Re=e[9];let De;e[10]!==Re?(De=m.jsxs("div",{className:"relative shrink-0 flex items-center",children:[Fe,Re]}),e[10]=Re,e[11]=De):De=e[11];let Oe;e[12]!==h||e[13]!==ve?(Oe=ve&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-muted-foreground shimmer",children:"Calling"})," ",m.jsxs("span",{className:"text-muted-foreground/75 shimmer",children:[h,"..."]})]}),e[12]=h,e[13]=ve,e[14]=Oe):Oe=e[14];let Ue;e[15]!==h||e[16]!==fe?(Ue=fe&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-muted-foreground",children:"Called"})," ",m.jsx("span",{className:"text-muted-foreground/75",children:h})]}),e[15]=h,e[16]=fe,e[17]=Ue):Ue=e[17];let Se;e[18]!==h||e[19]!==Ge?(Se=Ge&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-destructive/90",children:"Error calling"})," ",m.jsx("span",{className:"text-destructive/75",children:h})]}),e[18]=h,e[19]=Ge,e[20]=Se):Se=e[20];let He;e[21]!==Oe||e[22]!==Ue||e[23]!==Se?(He=m.jsxs("span",{className:"text-[15px]",children:[Oe,Ue,Se]}),e[21]=Oe,e[22]=Ue,e[23]=Se,e[24]=He):He=e[24];let We;return e[25]!==De||e[26]!==He||e[27]!==ye?(We=m.jsxs("div",{className:ye,children:[De,He]}),e[25]=De,e[26]=He,e[27]=ye,e[28]=We):We=e[28],We}let w;e[29]!==o?(w=o==="output-error"?m.jsx(Gu,{className:"size-4 text-destructive shrink-0"}):m.jsx(af,{className:ie("size-4 text-muted-foreground shrink-0",(o==="input-streaming"||o==="input-available")&&"shimmer")}),e[29]=o,e[30]=w):w=e[30];const R=o==="output-error"&&"text-destructive/90",I=(o==="input-streaming"||o==="input-available")&&"shimmer";let L;e[31]!==R||e[32]!==I?(L=ie("text-[15px] font-medium text-muted-foreground truncate",R,I),e[31]=R,e[32]=I,e[33]=L):L=e[33];const M=o==="input-streaming"&&`Streaming ${f} arguments`,P=o==="input-available"&&`Calling ${f}`,S=o==="output-available"&&`Called ${f}`,B=o==="output-error"&&`Error calling ${f}`;let $;e[34]!==M||e[35]!==P||e[36]!==S||e[37]!==B||e[38]!==L?($=m.jsxs("span",{className:L,children:[M,P,S,B]}),e[34]=M,e[35]=P,e[36]=S,e[37]=B,e[38]=L,e[39]=$):$=e[39];let X;e[40]!==$||e[41]!==w?(X=m.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[w,$]}),e[40]=$,e[41]=w,e[42]=X):X=e[42];const q=g&&"rotate-90";let U;e[43]!==q?(U=ie("size-4 text-muted-foreground transition-transform duration-200",q),e[43]=q,e[44]=U):U=e[44];let W;e[45]!==U?(W=m.jsx("div",{className:"flex items-center gap-2 shrink-0",children:m.jsx(Xu,{className:U})}),e[45]=U,e[46]=W):W=e[46];let V;e[47]!==X||e[48]!==W?(V=m.jsxs(U_,{className:"flex items-center gap-2 w-full cursor-pointer p-3 hover:bg-accent/50 transition-colors",children:[X,W]}),e[47]=X,e[48]=W,e[49]=V):V=e[49];let K;e[50]===Symbol.for("react.memo_cache_sentinel")?(K=m.jsx("div",{className:"w-4 relative shrink-0",children:m.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-0.25 bg-border"})}),e[50]=K):K=e[50];let J;e[51]!==n.input||e[52]!==E?(J=E&&m.jsxs("div",{className:"flex flex-col gap-0.5",children:[m.jsx("div",{className:"px-1 h-5 flex items-center",children:m.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Input"})}),m.jsx("div",{className:"border border-border rounded-lg p-2 h-full max-h-[200px]",children:m.jsx(Ku,{code:JSON.stringify(n.input,null,2),language:"json",foldOnMount:!0,height:"100%",readOnly:!0})})]}),e[51]=n.input,e[52]=E,e[53]=J):J=e[53];let k;e[54]!==n.output||e[55]!==A?(k=A&&m.jsxs("div",{className:"flex flex-col gap-0.5",children:[m.jsx("div",{className:"px-1 h-5 flex items-center",children:m.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Output"})}),m.jsx("div",{className:"border border-border rounded-lg max-h-[200px] overflow-auto p-2 h-full",children:m.jsx(v_,{output:n.output})})]}),e[54]=n.output,e[55]=A,e[56]=k):k=e[56];let re;e[57]!==n||e[58]!==b?(re=b&&m.jsxs("div",{className:"flex flex-col gap-0.5",children:[m.jsx("div",{className:"px-1 h-5 flex items-center",children:m.jsx("span",{className:"text-xs font-medium text-destructive/90",children:"Error"})}),m.jsx("div",{className:"border border-destructive/20 rounded-lg max-h-[200px] overflow-auto p-2 bg-destructive/10",children:m.jsx("pre",{className:"text-xs font-mono text-destructive whitespace-pre-wrap wrap-break-word",children:"errorText"in n&&typeof n.errorText=="string"?n.errorText:"An unknown error occurred"})})]}),e[57]=n,e[58]=b,e[59]=re):re=e[59];let he;e[60]!==J||e[61]!==k||e[62]!==re?(he=m.jsx(H_,{className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden",children:m.jsxs("div",{className:"flex ml-[7px] px-3 pb-3",children:[K,m.jsxs("div",{className:"flex flex-col gap-4 flex-1 min-w-0 pt-2",children:[J,k,re]})]})}),e[60]=J,e[61]=k,e[62]=re,e[63]=he):he=e[63];let N;e[64]!==V||e[65]!==he?(N=m.jsxs("div",{className:"border border-border/75 rounded-lg flex flex-col bg-background w-full min-w-0 overflow-hidden",children:[V,he]}),e[64]=V,e[65]=he,e[66]=N):N=e[66];let Ee;return e[67]!==g||e[68]!==N?(Ee=m.jsx("div",{className:"flex flex-col my-4 w-full min-w-0",children:m.jsx(F_,{open:g,onOpenChange:_,children:N})}),e[67]=g,e[68]=N,e[69]=Ee):Ee=e[69],Ee}const z_={planning:{icon:m.jsx(oo,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Planning next moves"},thinking:{icon:m.jsx(qr,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Thinking"}},$_=1200;function Y_(){const t=Q.c(7),[e,n]=j.useState("planning");let r,s;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const l=setTimeout(()=>{n("thinking")},$_);return()=>{clearTimeout(l)}},s=[],t[0]=r,t[1]=s):(r=t[0],s=t[1]),j.useEffect(r,s);const i=z_[e];let a;t[2]!==i.label?(a=m.jsxs("span",{className:"text-[15px] text-muted-foreground shimmer",children:[i.label,"..."]}),t[2]=i.label,t[3]=a):a=t[3];let u;return t[4]!==i.icon||t[5]!==a?(u=m.jsx("div",{className:"flex items-center gap-1.5 py-2 opacity-60",children:m.jsxs("span",{className:"flex items-center gap-1.5",children:[i.icon,a]})}),t[4]=i.icon,t[5]=a,t[6]=u):u=t[6],u}function q_(t){const e=Q.c(10),{duration:n,parts:r,id:s}=t,i=n/1e3;let a;e[0]!==i?(a=i.toFixed(1),e[0]=i,e[1]=a):a=e[1];const u=a,[l,o]=j.useState(!1),[d,f]=j.useState(!1);let p;if(e[2]!==s||e[3]!==d||e[4]!==l||e[5]!==r||e[6]!==u){const h=r.filter(G_),g=h.some(V_),_=g||d;let T,E;e[8]===Symbol.for("react.memo_cache_sentinel")?(T=()=>o(!0),E=()=>o(!1),e[8]=T,e[9]=E):(T=e[8],E=e[9]),p=m.jsxs("div",{className:"flex flex-col mb-2",children:[m.jsx("button",{type:"button",onClick:()=>!g&&f(!d),onMouseEnter:T,onMouseLeave:E,className:ie("flex items-center gap-1.5 py-2 opacity-60 transition-opacity",!g&&"cursor-pointer hover:opacity-100",g&&"cursor-default"),children:m.jsxs("span",{className:"flex items-center gap-1.5",children:[g?m.jsx(qr,{className:"text-muted-foreground shrink-0 shimmer",size:14}):l?m.jsx(Xu,{className:ie("text-muted-foreground transition-transform shrink-0",d&&"rotate-90"),size:14}):m.jsx(io,{className:"text-muted-foreground shrink-0",size:14}),m.jsx("span",{className:ie("text-[15px] text-muted-foreground",g&&"shimmer"),children:g?"Thinking...":`Thought for ${u}s`})]})}),_&&m.jsx("div",{className:"ml-[6px] border-l-2 pl-4 mt-1 mb-2 max-h-[300px] overflow-y-auto",children:h.map((A,b)=>m.jsx("div",{className:"text-muted-foreground markdown-sm pb-2",children:m.jsx(Xi,{id:`${s}-reasoning-${b}`,text:A.text})},`${s}-reasoning-${b}`))})]}),e[2]=s,e[3]=d,e[4]=l,e[5]=r,e[6]=u,e[7]=p}else p=e[7];return p}function V_(t){return t.state==="streaming"}function G_(t){return t.type==="reasoning"}function W_(t){const e=Q.c(17),{part:n,id:r,usageStats:s,isFollowedByToolCall:i,isFirstToolCallInSequence:a,isLastToolCallInSequence:u,hasNextToolCall:l}=t;switch(n.type){case"dynamic-tool":{let o;return e[0]!==l||e[1]!==r||e[2]!==a||e[3]!==u||e[4]!==n?(o=m.jsx(ju,{part:n,id:r,isFirstInSequence:a,isLastInSequence:u,hasNextToolCall:l}),e[0]=l,e[1]=r,e[2]=a,e[3]=u,e[4]=n,e[5]=o):o=e[5],o}case"text":{let o;return e[6]!==r||e[7]!==i||e[8]!==n||e[9]!==s?(o=m.jsx(ed,{id:r,part:n,extraActions:s,copyable:!0,hasToolCallAfter:i}),e[6]=r,e[7]=i,e[8]=n,e[9]=s,e[10]=o):o=e[10],o}case"reasoning":return null;case"step-start":case"file":case"source-url":case"source-document":return null;default:if(n.type.startsWith("tool-")){const o=n;let d;return e[11]!==l||e[12]!==r||e[13]!==a||e[14]!==u||e[15]!==o?(d=m.jsx(ju,{part:o,id:r,isFirstInSequence:a,isLastInSequence:u,hasNextToolCall:l}),e[11]=l,e[12]=r,e[13]=a,e[14]=u,e[15]=o,e[16]=d):d=e[16],d}}throw new Error(`Unknown part type: ${n.type}`)}function Q_(t){const e=Q.c(24),{message:n,status:r,className:s}=t,{id:i,parts:a}=n,o=r==="streaming"||r==="submitted",d=a.length>0;let f;e[0]!==a?(f=a.some(Z_),e[0]=a,e[1]=f):f=e[1];const p=f;let h;e[2]!==o||e[3]!==a?(h=o&&a.some(X_),e[2]=o,e[3]=a,e[4]=h):h=e[4];const g=h;let _;if(e[5]!==n.metadata){const M=n.metadata?.reasoning_start_at?new Date(n.metadata.reasoning_start_at):null,P=n.metadata?.reasoning_end_at?new Date(n.metadata.reasoning_end_at):null;_=M!==null?(P??new Date).getTime()-M.getTime():null,e[5]=n.metadata,e[6]=_}else _=e[6];const T=_,E=d&&(p||g)&&T!==null;let A;e[7]!==n?(A=m.jsx(Zo,{messages:[n]}),e[7]=n,e[8]=A):A=e[8];const b=A;let w;e[9]!==s?(w=ie("w-full min-w-0 group relative flex items-start gap-4 px-4 z-20 text-foreground flex-row",s),e[9]=s,e[10]=w):w=e[10];let R;e[11]!==T||e[12]!==d||e[13]!==i||e[14]!==o||e[15]!==a||e[16]!==E||e[17]!==b?(R=d?m.jsxs(m.Fragment,{children:[E&&m.jsx(q_,{duration:T,parts:a,id:i}),a.map((M,P)=>{const S=a[P+1],B=a[P-1],$=S&&(S.type==="dynamic-tool"||S.type.startsWith("tool-")),X=M.type==="dynamic-tool"||M.type.startsWith("tool-"),q=B&&(B.type==="dynamic-tool"||B.type.startsWith("tool-")),U=S&&(S.type==="dynamic-tool"||S.type.startsWith("tool-")),W=X&&!q,V=X&&!U,K=X&&U;return m.jsx(W_,{part:M,id:i,usageStats:P===a.length-1?b:void 0,isFollowedByToolCall:$,isFirstToolCallInSequence:W,isLastToolCallInSequence:V,hasNextToolCall:K},`${i}-${P}`)})]}):o?m.jsx(Y_,{}):null,e[11]=T,e[12]=d,e[13]=i,e[14]=o,e[15]=a,e[16]=E,e[17]=b,e[18]=R):R=e[18];let I;e[19]!==R?(I=m.jsx("div",{className:"flex flex-col min-w-0 w-full items-start",children:m.jsx("div",{className:"w-full min-w-0 not-only:rounded-2xl text-[15px] wrap-break-word overflow-wrap-anywhere bg-transparent",children:R})}),e[19]=R,e[20]=I):I=e[20];let L;return e[21]!==w||e[22]!==I?(L=m.jsx("div",{className:w,children:I}),e[21]=w,e[22]=I,e[23]=L):L=e[23],L}function X_(t){return t.type==="reasoning"&&t.state==="streaming"}function Z_(t){return t.type==="reasoning"}const rd=j.createContext(null);function sd(t){const e=Q.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx(m.Fragment,{children:n}),e[0]=n,e[1]=r):r=e[1],r}function K_(t){const e=[];for(let n=0;n<t.length;n++){const r=t[n];if(!j.isValidElement(r))continue;if(r.props?.message?.role==="assistant"){const i=t[n-1],a=j.isValidElement(i)&&i.props?.message?.role,u=i&&j.isValidElement(i)&&a==="user"?i:null;e.push({user:u,assistant:r})}}return e}function J_(t){const e=Q.c(27),{children:n,className:r,minHeightOffset:s}=t,i=j.useRef(null);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=[],e[0]=a):a=e[0];const u=j.useRef(a);let l,o,d,f,p,h,g;if(e[1]!==n||e[2]!==r||e[3]!==s){const A=j.Children.toArray(n),b=A[A.length-1];o=b&&j.isValidElement(b)&&b.type===sd?b:null;const w=o?A.slice(0,-1):A,R=K_(w);let I;e[11]===Symbol.for("react.memo_cache_sentinel")?(I=M=>{const P=u.current[M];if(P&&i.current){const S=i.current.offsetTop,B=P.offsetTop;i.current.scrollTo({top:B-S,behavior:"smooth"})}},e[11]=I):I=e[11];const L=I;l=rd.Provider,e[12]===Symbol.for("react.memo_cache_sentinel")?(g={scrollToPair:L},e[12]=g):g=e[12],p=i,e[13]!==r?(h=ie("w-full min-w-0 max-w-full overflow-y-auto h-full overflow-x-hidden",r),e[13]=r,e[14]=h):h=e[14],d="flex flex-col min-w-0 max-w-2xl mx-auto w-full",f=R.map((M,P)=>{const S=P===R.length-1;return m.jsxs("div",{ref:B=>{u.current[P]=B},className:"flex flex-col pb-2",style:S&&s?{minHeight:`calc(100vh - ${s}px)`}:void 0,children:[m.jsx("div",{className:"sticky top-0 z-50 bg-background w-full h-4"}),m.jsx("div",{className:"sticky mb-3 top-4 z-50",children:M.user&&j.isValidElement(M.user)?j.cloneElement(M.user,{pairIndex:P}):M.user}),M.assistant]},P)}),e[1]=n,e[2]=r,e[3]=s,e[4]=l,e[5]=o,e[6]=d,e[7]=f,e[8]=p,e[9]=h,e[10]=g}else l=e[4],o=e[5],d=e[6],f=e[7],p=e[8],h=e[9],g=e[10];let _;e[15]!==o||e[16]!==d||e[17]!==f?(_=m.jsxs("div",{className:d,children:[f,o]}),e[15]=o,e[16]=d,e[17]=f,e[18]=_):_=e[18];let T;e[19]!==p||e[20]!==h||e[21]!==_?(T=m.jsx("div",{ref:p,className:h,children:_}),e[19]=p,e[20]=h,e[21]=_,e[22]=T):T=e[22];let E;return e[23]!==l||e[24]!==g||e[25]!==T?(E=m.jsx(l,{value:g,children:T}),e[23]=l,e[24]=g,e[25]=T,e[26]=E):E=e[26],E}function ey(t){const e=Q.c(5),{locator:n}=zt(),r=Yo(),s=$o();let i;return e[0]!==n||e[1]!==r||e[2]!==t||e[3]!==s?(i=async(u,l,o)=>{const d=await jo(n,o),f=d.findIndex(T=>T.id===u);if(f===-1){console.warn(`[branch] Message ${u} not found in thread ${o}`);return}const p=d.slice(0,f).filter(ty),h=crypto.randomUUID(),g=new Date().toISOString(),_={id:h,title:"",created_at:g,updated_at:g,hidden:!1};if(await s.insert.mutateAsync(_),p.length>0){const T=p.map(E=>({...E,id:crypto.randomUUID(),metadata:{...E.metadata,thread_id:h,created_at:E.metadata?.created_at||g}}));await r.insertMany.mutateAsync(T)}t(h)},e[0]=n,e[1]=r,e[2]=t,e[3]=s,e[4]=i):i=e[4],i}function ty(t){return t.role!=="system"}function ny(t){const e=Q.c(18),{messageId:n,parts:r}=t,[s,i]=j.useState(!1),{setInputValue:a,startBranch:u,setActiveThreadId:l,activeThreadId:o}=An(),d=ey(l);let f;e[0]!==r?(f=r.filter(sy).map(ry).join(`
107
- `),e[0]=r,e[1]=f):f=e[1];const p=f;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=I=>{I.stopPropagation(),i(!0)},e[2]=h):h=e[2];const g=h;let _;e[3]!==o||e[4]!==d||e[5]!==n||e[6]!==p||e[7]!==a||e[8]!==u?(_=async()=>{await d(n,p,o),a(p),u({originalThreadId:o,originalMessageId:n,originalMessageText:p}),i(!1)},e[3]=o,e[4]=d,e[5]=n,e[6]=p,e[7]=a,e[8]=u,e[9]=_):_=e[9];const T=_;let E;e[10]===Symbol.for("react.memo_cache_sentinel")?(E=m.jsx("div",{className:"flex justify-center items-end px-2 pb-1",children:m.jsxs(yn,{children:[m.jsx(_n,{asChild:!0,children:m.jsx(Me,{onClick:g,variant:"ghost",size:"xs",className:"opacity-0 group-hover:opacity-100 hover:bg-gray-200/70 rounded-md transition-opacity text-muted-foreground hover:text-foreground aspect-square w-6 h-6 p-0",children:m.jsx(so,{size:16,className:"p-0.5"})})}),m.jsx(xn,{side:"bottom",children:"Edit message"})]})}),e[10]=E):E=e[10];let A;e[11]===Symbol.for("react.memo_cache_sentinel")?(A=m.jsxs(uf,{children:[m.jsx(of,{children:"Edit message?"}),m.jsx(lf,{children:"This will create a new conversation branch from this point. The original conversation will remain unchanged."})]}),e[11]=A):A=e[11];let b;e[12]===Symbol.for("react.memo_cache_sentinel")?(b=m.jsx(cf,{children:"Cancel"}),e[12]=b):b=e[12];let w;e[13]!==T?(w=m.jsxs(df,{children:[A,m.jsxs(ff,{children:[b,m.jsx(hf,{onClick:T,children:"Confirm"})]})]}),e[13]=T,e[14]=w):w=e[14];let R;return e[15]!==s||e[16]!==w?(R=m.jsxs(m.Fragment,{children:[E,m.jsx(pf,{open:s,onOpenChange:i,children:w})]}),e[15]=s,e[16]=w,e[17]=R):R=e[17],R}function ry(t){return t.text}function sy(t){return t.type==="text"}function iy(t){const e=Q.c(29),{message:n,className:r,pairIndex:s}=t,{id:i,parts:a}=n,u=j.useContext(rd),[l,o]=j.useState(!1);if(!a||a.length===0)return null;let d;e[0]!==u||e[1]!==s?(d=()=>{o(!0),s!==void 0&&u?.scrollToPair(s)},e[0]=u,e[1]=s,e[2]=d):d=e[2];const f=d;let p;e[3]!==r?(p=ie("message-block w-full min-w-0 group relative flex items-start gap-4 px-2.5 text-foreground flex-row-reverse",r),e[3]=r,e[4]=p):p=e[4];let h,g;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=()=>o(!0),g=()=>o(!1),e[5]=h,e[6]=g):(h=e[5],g=e[6]);const _=l?"overflow-auto opacity-100":"overflow-hidden opacity-99 mask-b-from-1%";let T;e[7]!==_?(T=ie("z-10 px-4 py-2 transition-opacity max-h-[120px] flex-1",_),e[7]=_,e[8]=T):T=e[8];let E;if(e[9]!==i||e[10]!==a){let L;e[12]!==i?(L=(M,P)=>M.type==="text"?m.jsx(ed,{id:i,part:M},`${i}-${P}`):null,e[12]=i,e[13]=L):L=e[13],E=a.map(L),e[9]=i,e[10]=a,e[11]=E}else E=e[11];let A;e[14]!==E?(A=m.jsx("div",{children:E}),e[14]=E,e[15]=A):A=e[15];let b;e[16]!==T||e[17]!==A?(b=m.jsx("div",{className:T,children:A}),e[16]=T,e[17]=A,e[18]=b):b=e[18];let w;e[19]!==i||e[20]!==a?(w=m.jsx(ny,{messageId:i,parts:a}),e[19]=i,e[20]=a,e[21]=w):w=e[21];let R;e[22]!==f||e[23]!==w||e[24]!==b?(R=m.jsxs("div",{tabIndex:0,onClick:f,onFocus:h,onBlur:g,className:"w-full border min-w-0 shadow-xs rounded-lg text-[0.9375rem] wrap-break-word overflow-wrap-anywhere bg-background cursor-pointer transition-colors relative flex outline-none",children:[b,w]}),e[22]=f,e[23]=w,e[24]=b,e[25]=R):R=e[25];let I;return e[26]!==R||e[27]!==p?(I=m.jsx(m.Fragment,{children:m.jsx("div",{className:p,children:R})}),e[26]=R,e[27]=p,e[28]=I):I=e[28],I}function ay({title:t="No model provider connected",description:e="Connect to a model provider to unlock AI-powered features.",org:n}){const[r,s]=j.useState(!1),i=Ud(),a=Vu(),{data:u}=qu.useSession(),l=Wu(),o=u?.user?.id??"",d=()=>{a({to:"/$org/mcps",params:{org:n.slug},search:{action:"create"}})},f=async()=>{if(!n.id||!o){Kn.error("Not authenticated");return}s(!0);try{const p=l?.find(_=>_.connection_url===gf);if(p){a({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:p.id}});return}const h=bf({id:Ef("conn")}),g=await i.create.mutateAsync(h);a({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:g.id}})}catch(p){Kn.error(`Failed to connect OpenRouter: ${p instanceof Error?p.message:String(p)}`)}finally{s(!1)}};return m.jsx(Sd,{image:m.jsx("img",{src:"/empty-state-openrouter.svg",alt:"",width:336,height:320,"aria-hidden":"true",className:"w-xs h-auto mask-radial-[100%_100%] mask-radial-from-20% mask-radial-to-50% mask-radial-at-center"}),title:t,description:e,actions:m.jsxs(m.Fragment,{children:[m.jsxs(Me,{variant:"outline",onClick:f,disabled:r,children:[m.jsx("img",{src:mf,alt:"OpenRouter",className:"size-4"}),r?"Installing...":"Install OpenRouter"]}),m.jsx(Me,{variant:"outline",onClick:d,children:"Install Connection"})]})})}function uy(t){const e=new Date(t),r=new Date().getTime()-e.getTime(),s=Math.floor(r/6e4),i=Math.floor(r/36e5);return s<1?"now":s<60?`${s}m`:`${i}h`}function oy(t){const e=new Date,n=new Date(e.getFullYear(),e.getMonth(),e.getDate()),r=new Date(n.getTime()-864e5),s=new Date(n.getTime()-7*864e5),i=new Date(n.getTime()-30*864e5),a=[],u=[],l=[],o=[],d=[];for(const p of t){const h=new Date(p.updated_at);h>=n?a.push(p):h>=r?u.push(p):h>=s?l.push(p):h>=i?o.push(p):d.push(p)}const f=[];return a.length>0&&f.push({label:"Today",threads:a,showRelativeTime:!0}),u.length>0&&f.push({label:"Yesterday",threads:u,showRelativeTime:!1}),l.length>0&&f.push({label:"7 days ago",threads:l,showRelativeTime:!1}),o.length>0&&f.push({label:"30 days ago",threads:o,showRelativeTime:!1}),d.length>0&&f.push({label:"Older",threads:d,showRelativeTime:!1}),f}function ly(t){const e=Q.c(49),{variant:n}=t,r=n===void 0?"icon":n,{threads:s,refetch:i}=zo(),{activeThreadId:a,setActiveThreadId:u,hideThread:l}=An(),[o,d]=j.useState("");let f,p,h,g,_,T,E,A,b,w,R,I;if(e[0]!==a||e[1]!==l||e[2]!==i||e[3]!==o||e[4]!==u||e[5]!==s||e[6]!==r){const $=o.trim()?s.filter(K=>(K.title||"New chat").toLowerCase().includes(o.toLowerCase())):s,X=oy($);let q;e[19]!==i?(q=K=>{K?i():d("")},e[19]=i,e[20]=q):q=e[20];const U=q;g=hi,h=yn,p=lr,w=U,e[21]!==r?(R=m.jsx(_n,{asChild:!0,children:m.jsx(ur,{asChild:!0,children:r==="outline"?m.jsx(Me,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input","aria-label":"Chat history",children:m.jsx(na,{size:16})}):m.jsx(Me,{type:"button",variant:"ghost",size:"icon",className:"size-6 p-1 hover:bg-transparent","aria-label":"Chat history",children:m.jsx(na,{size:16,className:"text-muted-foreground hover:text-foreground transition-colors"})})})}),e[21]=r,e[22]=R):R=e[22],e[23]===Symbol.for("react.memo_cache_sentinel")?(I=m.jsx(xn,{children:"Chat history"}),e[23]=I):I=e[23],f=or,E="end",A="w-80 p-0";let W;e[24]===Symbol.for("react.memo_cache_sentinel")?(W=m.jsx(Yr,{size:16,className:"text-muted-foreground shrink-0"}),e[24]=W):W=e[24];let V;e[25]===Symbol.for("react.memo_cache_sentinel")?(V=K=>d(K.target.value),e[25]=V):V=e[25],e[26]!==o?(b=m.jsx("div",{className:"border-b",children:m.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 cursor-text",children:[W,m.jsx("input",{type:"text",placeholder:"Search chats...",value:o,onChange:V,className:"flex-1 border-0 shadow-none focus:outline-none px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),e[26]=o,e[27]=b):b=e[27],_="max-h-[300px] overflow-y-auto",T=$.length===0?m.jsx("div",{className:"p-4 text-center text-sm text-muted-foreground",children:o.trim()?"No chats found":"No chats yet"}):X.map((K,J)=>m.jsxs("div",{children:[J>0&&m.jsx("div",{className:"border-t mx-3"}),m.jsx("div",{className:"px-3 py-1",children:m.jsx("span",{className:"text-xs font-medium text-muted-foreground tracking-wide",children:K.label})}),K.threads.map(k=>{const re=k.id===a;return m.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 hover:bg-accent cursor-pointer group ${re?"bg-accent/50":""}`,onClick:()=>u(k.id),children:[m.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[m.jsx("span",{className:"text-sm truncate",children:k.title||"New chat"}),m.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:re?"current":K.showRelativeTime?uy(k.updated_at):null})]}),m.jsx("button",{type:"button",onClick:he=>{he.stopPropagation(),l(k.id)},className:"opacity-0 cursor-pointer group/trash group-hover:opacity-100 p-1 hover:bg-destructive/10 rounded transition-opacity",title:"Remove chat",children:m.jsx(Tf,{size:14,className:"text-muted-foreground group-hover/trash:text-destructive"})})]},k.id)})]},K.label)),e[0]=a,e[1]=l,e[2]=i,e[3]=o,e[4]=u,e[5]=s,e[6]=r,e[7]=f,e[8]=p,e[9]=h,e[10]=g,e[11]=_,e[12]=T,e[13]=E,e[14]=A,e[15]=b,e[16]=w,e[17]=R,e[18]=I}else f=e[7],p=e[8],h=e[9],g=e[10],_=e[11],T=e[12],E=e[13],A=e[14],b=e[15],w=e[16],R=e[17],I=e[18];let L;e[28]!==_||e[29]!==T?(L=m.jsx("div",{className:_,children:T}),e[28]=_,e[29]=T,e[30]=L):L=e[30];let M;e[31]!==f||e[32]!==L||e[33]!==E||e[34]!==A||e[35]!==b?(M=m.jsxs(f,{align:E,className:A,children:[b,L]}),e[31]=f,e[32]=L,e[33]=E,e[34]=A,e[35]=b,e[36]=M):M=e[36];let P;e[37]!==p||e[38]!==M||e[39]!==w||e[40]!==R||e[41]!==I?(P=m.jsxs(p,{onOpenChange:w,children:[R,I,M]}),e[37]=p,e[38]=M,e[39]=w,e[40]=R,e[41]=I,e[42]=P):P=e[42];let S;e[43]!==h||e[44]!==P?(S=m.jsx(h,{children:P}),e[43]=h,e[44]=P,e[45]=S):S=e[45];let B;return e[46]!==g||e[47]!==S?(B=m.jsx(g,{children:S}),e[46]=g,e[47]=S,e[48]=B):B=e[48],B}function cy(){const t=Q.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx("div",{className:"size-6 rounded-lg bg-muted animate-pulse"}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsxs("div",{className:"flex items-center gap-3",children:[e,m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsx("div",{className:"h-3.5 w-28 rounded bg-muted animate-pulse"}),m.jsx("div",{className:"h-3 w-40 rounded bg-muted/60 animate-pulse"})]})]}),t[1]=n):n=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx("div",{className:"flex items-center h-12 flex-none border-b border-border/80 px-4",children:m.jsxs("div",{className:"flex items-center justify-between gap-3 w-full",children:[n,m.jsxs("div",{className:"flex items-end gap-2",children:[m.jsx("div",{className:"h-6 w-6 rounded-full bg-muted animate-pulse"}),m.jsx("div",{className:"h-6 w-6 rounded-lg bg-muted animate-pulse"})]})]})}),t[2]=r):r=t[2];let s;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx("div",{className:"flex-1 overflow-hidden px-4 py-4",children:m.jsxs("div",{className:"mx-auto flex w-full max-w-2xl flex-col gap-4",children:[m.jsx(Cr,{align:"right",width:"w-3/4"}),m.jsx(Cr,{align:"left",width:"w-full",lines:3}),m.jsx(Cr,{align:"right",width:"w-2/3"}),m.jsx(Cr,{align:"left",width:"w-5/6",lines:2})]})}),t[3]=s):s=t[3];let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=m.jsx("div",{className:"relative flex flex-1 flex-col gap-2 p-2.5",children:m.jsx("div",{className:"relative flex-1",children:m.jsxs("div",{className:"space-y-2 p-2",children:[m.jsx("div",{className:"h-3 w-full rounded bg-muted/40 animate-pulse"}),m.jsx("div",{className:"h-3 w-4/5 rounded bg-muted/40 animate-pulse"})]})})}),t[4]=i):i=t[4];let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx("div",{className:"flex items-center gap-1",children:m.jsx("div",{className:"size-8 rounded-full bg-muted/60 animate-pulse"})}),t[5]=a):a=t[5];let u;return t[6]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsxs("div",{className:"flex h-full w-full flex-col bg-sidebar",children:[r,s,m.jsx("div",{className:"px-4 py-4",children:m.jsx("div",{className:"mx-auto w-full max-w-2xl",children:m.jsxs("div",{className:"relative flex min-h-[130px] flex-col rounded-xl border border-border bg-background shadow-sm",children:[i,m.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2.5",children:[a,m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("div",{className:"h-8 w-32 rounded-lg bg-muted/60 animate-pulse"}),m.jsx("div",{className:"size-8 rounded-full bg-muted animate-pulse"})]})]})]})})})]}),t[6]=u):u=t[6],u}function Cr(t){const e=Q.c(22),{align:n,width:r,lines:s}=t,i=r===void 0?"w-full":r,a=s===void 0?1:s,u=n==="right"?"flex-row-reverse":"flex-row";let l;e[0]!==u?(l=ie("flex w-full gap-4 px-4 py-2",u),e[0]=u,e[1]=l):l=e[1];const o=n==="right"?"ml-auto max-w-3/4 items-end":"w-full items-start";let d;e[2]!==o?(d=ie("flex min-w-0 flex-col gap-2",o),e[2]=o,e[3]=d):d=e[3];let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=m.jsx("div",{className:"h-3 w-16 rounded bg-muted/40 animate-pulse"}),e[4]=f):f=e[4];const p=n==="right"?"bg-muted":"bg-transparent border border-border/40";let h;e[5]!==p||e[6]!==i?(h=ie("min-w-0 rounded-2xl p-4",p,i),e[5]=p,e[6]=i,e[7]=h):h=e[7];let g;e[8]!==a?(g=Array.from({length:a}),e[8]=a,e[9]=g):g=e[9];let _;e[10]!==a||e[11]!==g?(_=m.jsx("div",{className:"space-y-2",children:g.map((b,w)=>m.jsx("div",{className:ie("h-3 rounded bg-muted-foreground/20 animate-pulse",w===a-1?"w-3/4":"w-full"),style:{animationDelay:`${w*.1}s`}},w))}),e[10]=a,e[11]=g,e[12]=_):_=e[12];let T;e[13]!==_||e[14]!==h?(T=m.jsx("div",{className:h,children:_}),e[13]=_,e[14]=h,e[15]=T):T=e[15];let E;e[16]!==T||e[17]!==d?(E=m.jsxs("div",{className:d,children:[f,T]}),e[16]=T,e[17]=d,e[18]=E):E=e[18];let A;return e[19]!==E||e[20]!==l?(A=m.jsx("div",{className:l,children:E}),e[19]=E,e[20]=l,e[21]=A):A=e[21],A}function dy({messageCount:t,sentinelRef:e}){const n=j.useRef(t),r=j.useRef(0);t>n.current&&r.current!==t&&queueMicrotask(()=>{e.current?.scrollIntoView({behavior:"smooth",block:"start"}),r.current=t}),n.current=t}function zu(t,e){const n=j.Children.toArray(t);for(const r of n)if(j.isValidElement(r)&&r.type===e)return r;return null}function fy(t){const e=Q.c(5),{className:n,children:r}=t;let s;e[0]!==n?(s=ie("flex flex-col h-full w-full bg-sidebar transform-[translateZ(0)]",n),e[0]=n,e[1]=s):s=e[1];let i;return e[2]!==r||e[3]!==s?(i=m.jsx("div",{className:s,children:r}),e[2]=r,e[3]=s,e[4]=i):i=e[4],i}function hy(t){const e=Q.c(7),{children:n}=t;let r;e[0]!==n?(r=zu(n,id),e[0]=n,e[1]=r):r=e[1];const s=r;let i;e[2]!==n?(i=zu(n,ad),e[2]=n,e[3]=i):i=e[3];const a=i;let u;return e[4]!==s||e[5]!==a?(u=m.jsxs("div",{className:"flex h-12 items-center justify-between gap-4 border-b border-border px-4 flex-none",children:[s,a]}),e[4]=s,e[5]=a,e[6]=u):u=e[6],u}function id(t){const e=Q.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-2 overflow-hidden",children:n}),e[0]=n,e[1]=r):r=e[1],r}function ad(t){const e=Q.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx("div",{className:"flex flex-none items-center gap-1",children:n}),e[0]=n,e[1]=r):r=e[1],r}function py(t){const e=Q.c(5),{children:n,className:r}=t;let s;e[0]!==r?(s=ie("flex-1 min-h-0 overflow-y-auto",r),e[0]=r,e[1]=s):s=e[1];let i;return e[2]!==n||e[3]!==s?(i=m.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=i):i=e[4],i}function my(t){const e=Q.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx("div",{className:"h-full w-full flex items-center justify-center max-w-2xl mx-auto",children:n}),e[0]=n,e[1]=r):r=e[1],r}function gy(t){const e=Q.c(12),{minHeightOffset:n}=t,r=n===void 0?240:n,{messages:s,chatStatus:i}=An(),a=j.useRef(null);let u;e[0]!==s.length?(u={messageCount:s.length,sentinelRef:a},e[0]=s.length,e[1]=u):u=e[1],dy(u);let l;if(e[2]!==s||e[3]!==i){let f;e[5]!==s.length||e[6]!==i?(f=(p,h)=>p.role==="user"?m.jsx(iy,{message:p},p.id):p.role==="assistant"?m.jsx(Q_,{message:p,status:h===s.length-1?i:void 0},p.id):null,e[5]=s.length,e[6]=i,e[7]=f):f=e[7],l=s.map(f),e[2]=s,e[3]=i,e[4]=l}else l=e[4];let o;e[8]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx(sd,{children:m.jsx("div",{ref:a,className:"h-0"})}),e[8]=o):o=e[8];let d;return e[9]!==r||e[10]!==l?(d=m.jsxs(J_,{minHeightOffset:r,children:[l,o]}),e[9]=r,e[10]=l,e[11]=d):d=e[11],d}function by(t){const e=Q.c(5),{children:n,className:r}=t;let s;e[0]!==r?(s=ie("flex-none w-full mx-auto p-2","max-w-2xl min-w-0",r),e[0]=r,e[1]=s):s=e[1];let i;return e[2]!==n||e[3]!==s?(i=m.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=i):i=e[4],i}function Ls(t){const e=Q.c(24),{title:n,description:r,icon:s,variant:i,onDismiss:a,children:u}=t,l=i===void 0?"default":i;let o,d,f,p,h;if(e[0]!==u||e[1]!==r||e[2]!==s||e[3]!==n||e[4]!==l){const b={default:{container:"border-muted-foreground/30 bg-muted/50 hover:bg-muted transition-colors",icon:"text-muted-foreground",title:"text-muted-foreground",description:"text-muted-foreground/70"},danger:{container:"border-destructive/30 bg-destructive/5",icon:"text-destructive",title:"text-destructive font-medium",description:"text-muted-foreground"},warning:{container:"border-amber-500/30 bg-amber-500/5",icon:"text-amber-600 dark:text-amber-500",title:"text-amber-600 dark:text-amber-500 font-medium",description:"text-muted-foreground"}}[l];p=ie("flex items-start gap-2 px-3 py-2.5 rounded-lg border border-dashed text-sm w-full",b.container),h=s&&m.jsx("div",{className:ie("mt-0.5 shrink-0",b.icon),children:s}),o="flex-1 min-w-0",d=n&&m.jsx("div",{className:ie("text-xs mb-1",b.title),children:n}),f=r&&m.jsx("div",{className:ie("text-xs line-clamp-2",b.description,u?"mb-2":""),children:r}),e[0]=u,e[1]=r,e[2]=s,e[3]=n,e[4]=l,e[5]=o,e[6]=d,e[7]=f,e[8]=p,e[9]=h}else o=e[5],d=e[6],f=e[7],p=e[8],h=e[9];let g;e[10]!==u?(g=u&&m.jsx("div",{className:"flex gap-2",children:u}),e[10]=u,e[11]=g):g=e[11];let _;e[12]!==o||e[13]!==d||e[14]!==f||e[15]!==g?(_=m.jsxs("div",{className:o,children:[d,f,g]}),e[12]=o,e[13]=d,e[14]=f,e[15]=g,e[16]=_):_=e[16];let T;e[17]!==a?(T=a&&m.jsx("button",{type:"button",onClick:a,className:"text-muted-foreground hover:text-foreground transition-colors shrink-0",title:"Dismiss",children:m.jsx(Nd,{size:14})}),e[17]=a,e[18]=T):T=e[18];let E;return e[19]!==p||e[20]!==h||e[21]!==_||e[22]!==T?(E=m.jsxs("div",{className:p,children:[h,_,T]}),e[19]=p,e[20]=h,e[21]=_,e[22]=T,e[23]=E):E=e[23],E}const aA=Object.assign(fy,{Header:Object.assign(hy,{Left:id,Right:ad}),Main:py,Messages:gy,EmptyState:my,Footer:by,Input:V0,Provider:M0,Skeleton:cy,IceBreakers:ap,NoLlmBindingEmptyState:ay,ThreadHistoryPopover:ly});export{aA as C,g0 as G,L0 as M,B_ as R,$e as S,sA as T,qo as a,uo as b,rA as c,iA as d,eo as i,An as u};
105
+ `))}function l(h,g,_,T){const E=_.enter("tableCell"),A=_.enter("phrasing"),b=_.containerPhrasing(h,{...T,before:i,after:i});return A(),E(),b}function o(h,g){return Qx(h,{align:g,alignDelimiters:r,padding:n,stringLength:s})}function d(h,g,_){const T=h.children;let E=-1;const A=[],b=g.enter("table");for(;++E<T.length;)A[E]=f(T[E],g,_);return b(),A}function f(h,g,_){const T=h.children;let E=-1;const A=[],b=g.enter("tableRow");for(;++E<T.length;)A[E]=l(T[E],h,g,_);return b(),A}function p(h,g,_){let T=$c.inlineCode(h,g,_);return _.stack.includes("tableCell")&&(T=T.replace(/\|/g,"\\$&")),T}}function M3(){return{exit:{taskListCheckValueChecked:Uu,taskListCheckValueUnchecked:Uu,paragraph:F3}}}function B3(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:U3}}}function Uu(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function F3(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const s=e.children;let i=-1,a;for(;++i<s.length;){const u=s[i];if(u.type==="paragraph"){a=u;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function U3(t,e,n,r){const s=t.children[0],i=typeof t.checked=="boolean"&&s&&s.type==="paragraph",a="["+(t.checked?"x":" ")+"] ",u=n.createTracker(r);i&&u.move(a);let l=$c.listItem(t,e,n,{...r,...u.current()});return i&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,o)),l;function o(d){return d+a}}function H3(){return[Ex(),Ux(),$x(),w3(),M3()]}function j3(t){return{extensions:[Tx(),Hx(t),Yx(),P3(t),B3()]}}const z3={tokenize:W3,partial:!0},Yc={tokenize:Q3,partial:!0},qc={tokenize:X3,partial:!0},Vc={tokenize:Z3,partial:!0},$3={tokenize:K3,partial:!0},Gc={name:"wwwAutolink",tokenize:V3,previous:Qc},Wc={name:"protocolAutolink",tokenize:G3,previous:Xc},Lt={name:"emailAutolink",tokenize:q3,previous:Zc},Nt={};function Y3(){return{text:Nt}}let Wt=48;for(;Wt<123;)Nt[Wt]=Lt,Wt++,Wt===58?Wt=65:Wt===91&&(Wt=97);Nt[43]=Lt;Nt[45]=Lt;Nt[46]=Lt;Nt[95]=Lt;Nt[72]=[Lt,Wc];Nt[104]=[Lt,Wc];Nt[87]=[Lt,Gc];Nt[119]=[Lt,Gc];function q3(t,e,n){const r=this;let s,i;return a;function a(f){return!ii(f)||!Zc.call(r,r.previous)||Qi(r.events)?n(f):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),u(f))}function u(f){return ii(f)?(t.consume(f),u):f===64?(t.consume(f),l):n(f)}function l(f){return f===46?t.check($3,d,o)(f):f===45||f===95||Ye(f)?(i=!0,t.consume(f),l):d(f)}function o(f){return t.consume(f),s=!0,l}function d(f){return i&&s&&Ze(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(f)):n(f)}}function V3(t,e,n){const r=this;return s;function s(a){return a!==87&&a!==119||!Qc.call(r,r.previous)||Qi(r.events)?n(a):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(z3,t.attempt(Yc,t.attempt(qc,i),n),n)(a))}function i(a){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(a)}}function G3(t,e,n){const r=this;let s="",i=!1;return a;function a(f){return(f===72||f===104)&&Xc.call(r,r.previous)&&!Qi(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),s+=String.fromCodePoint(f),t.consume(f),u):n(f)}function u(f){if(Ze(f)&&s.length<5)return s+=String.fromCodePoint(f),t.consume(f),u;if(f===58){const p=s.toLowerCase();if(p==="http"||p==="https")return t.consume(f),l}return n(f)}function l(f){return f===47?(t.consume(f),i?o:(i=!0,l)):n(f)}function o(f){return f===null||Br(f)||xe(f)||nn(f)||Kr(f)?n(f):t.attempt(Yc,t.attempt(qc,d),n)(f)}function d(f){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(f)}}function W3(t,e,n){let r=0;return s;function s(a){return(a===87||a===119)&&r<3?(r++,t.consume(a),s):a===46&&r===3?(t.consume(a),i):n(a)}function i(a){return a===null?n(a):e(a)}}function Q3(t,e,n){let r,s,i;return a;function a(o){return o===46||o===95?t.check(Vc,l,u)(o):o===null||xe(o)||nn(o)||o!==45&&Kr(o)?l(o):(i=!0,t.consume(o),a)}function u(o){return o===95?r=!0:(s=r,r=void 0),t.consume(o),a}function l(o){return s||r||!i?n(o):e(o)}}function X3(t,e){let n=0,r=0;return s;function s(a){return a===40?(n++,t.consume(a),s):a===41&&r<n?i(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?t.check(Vc,e,i)(a):a===null||xe(a)||nn(a)?e(a):(t.consume(a),s)}function i(a){return a===41&&r++,t.consume(a),s}}function Z3(t,e,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(t.consume(u),r):u===38?(t.consume(u),i):u===93?(t.consume(u),s):u===60||u===null||xe(u)||nn(u)?e(u):n(u)}function s(u){return u===null||u===40||u===91||xe(u)||nn(u)?e(u):r(u)}function i(u){return Ze(u)?a(u):n(u)}function a(u){return u===59?(t.consume(u),r):Ze(u)?(t.consume(u),a):n(u)}}function K3(t,e,n){return r;function r(i){return t.consume(i),s}function s(i){return Ye(i)?n(i):e(i)}}function Qc(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||xe(t)}function Xc(t){return!Ze(t)}function Zc(t){return!(t===47||ii(t))}function ii(t){return t===43||t===45||t===46||t===95||Ye(t)}function Qi(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const J3={tokenize:u_,partial:!0};function e_(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:s_,continuation:{tokenize:i_},exit:a_}},text:{91:{name:"gfmFootnoteCall",tokenize:r_},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:t_,resolveTo:n_}}}}function t_(t,e,n){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const l=r.events[s][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return u;function u(l){if(!a||!a._balanced)return n(l);const o=bt(r.sliceSerialize({start:a.end,end:r.now()}));return o.codePointAt(0)!==94||!i.includes(o.slice(1))?n(l):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(l),t.exit("gfmFootnoteCallLabelMarker"),e(l))}}function n_(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},t[t.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},u=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",s,e],["exit",s,e],["enter",i,e],["enter",a,e],["exit",a,e],["exit",i,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...u),t}function r_(t,e,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return u;function u(f){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(t.enter("gfmFootnoteCallMarker"),t.consume(f),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",o)}function o(f){if(i>999||f===93&&!a||f===null||f===91||xe(f))return n(f);if(f===93){t.exit("chunkString");const p=t.exit("gfmFootnoteCallString");return s.includes(bt(r.sliceSerialize(p)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(f)}return xe(f)||(a=!0),i++,t.consume(f),f===92?d:o}function d(f){return f===91||f===92||f===93?(t.consume(f),i++,o):o(f)}}function s_(t,e,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,u;return l;function l(g){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),o}function o(g){return g===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",d):n(g)}function d(g){if(a>999||g===93&&!u||g===null||g===91||xe(g))return n(g);if(g===93){t.exit("chunkString");const _=t.exit("gfmFootnoteDefinitionLabelString");return i=bt(r.sliceSerialize(_)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),p}return xe(g)||(u=!0),a++,t.consume(g),g===92?f:d}function f(g){return g===91||g===92||g===93?(t.consume(g),a++,d):d(g)}function p(g){return g===58?(t.enter("definitionMarker"),t.consume(g),t.exit("definitionMarker"),s.includes(i)||s.push(i),de(t,h,"gfmFootnoteDefinitionWhitespace")):n(g)}function h(g){return e(g)}}function i_(t,e,n){return t.check(mr,e,t.attempt(J3,e,n))}function a_(t){t.exit("gfmFootnoteDefinition")}function u_(t,e,n){const r=this;return de(t,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?e(i):n(i)}}function o_(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,u){let l=-1;for(;++l<a.length;)if(a[l][0]==="enter"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._close){let o=l;for(;o--;)if(a[o][0]==="exit"&&a[o][1].type==="strikethroughSequenceTemporary"&&a[o][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[o][1].end.offset-a[o][1].start.offset){a[l][1].type="strikethroughSequence",a[o][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},a[o][1].start),end:Object.assign({},a[l][1].end)},f={type:"strikethroughText",start:Object.assign({},a[o][1].end),end:Object.assign({},a[l][1].start)},p=[["enter",d,u],["enter",a[o][1],u],["exit",a[o][1],u],["enter",f,u]],h=u.parser.constructs.insideSpan.null;h&&lt(p,p.length,0,Jr(h,a.slice(o+1,l),u)),lt(p,p.length,0,[["exit",f,u],["enter",a[l][1],u],["exit",a[l][1],u],["exit",d,u]]),lt(a,o-1,l-o+3,p),l=o+p.length-2;break}}for(l=-1;++l<a.length;)a[l][1].type==="strikethroughSequenceTemporary"&&(a[l][1].type="data");return a}function i(a,u,l){const o=this.previous,d=this.events;let f=0;return p;function p(g){return o===126&&d[d.length-1][1].type!=="characterEscape"?l(g):(a.enter("strikethroughSequenceTemporary"),h(g))}function h(g){const _=bn(o);if(g===126)return f>1?l(g):(a.consume(g),f++,h);if(f<2&&!n)return l(g);const T=a.exit("strikethroughSequenceTemporary"),E=bn(g);return T._open=!E||E===2&&!!_,T._close=!_||_===2&&!!E,u(g)}}}class l_{constructor(){this.map=[]}add(e,n,r){c_(this,e,n,r)}consume(e){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let s=r.pop();for(;s;){for(const i of s)e.push(i);s=r.pop()}this.map.length=0}}function c_(t,e,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<t.map.length;){if(t.map[s][0]===e){t.map[s][1]+=n,t.map[s][2].push(...r);return}s+=1}t.map.push([e,n,r])}}function d_(t,e){let n=!1;const r=[];for(;e<t.length;){const s=t[e];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function f_(){return{flow:{null:{name:"table",tokenize:h_,resolveAll:p_}}}}function h_(t,e,n){const r=this;let s=0,i=0,a;return u;function u(S){let B=r.events.length-1;for(;B>-1;){const q=r.events[B][1].type;if(q==="lineEnding"||q==="linePrefix")B--;else break}const $=B>-1?r.events[B][1].type:null,X=$==="tableHead"||$==="tableRow"?I:l;return X===I&&r.parser.lazy[r.now().line]?n(S):X(S)}function l(S){return t.enter("tableHead"),t.enter("tableRow"),o(S)}function o(S){return S===124||(a=!0,i+=1),d(S)}function d(S){return S===null?n(S):ee(S)?i>1?(i=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(S),t.exit("lineEnding"),h):n(S):oe(S)?de(t,d,"whitespace")(S):(i+=1,a&&(a=!1,s+=1),S===124?(t.enter("tableCellDivider"),t.consume(S),t.exit("tableCellDivider"),a=!0,d):(t.enter("data"),f(S)))}function f(S){return S===null||S===124||xe(S)?(t.exit("data"),d(S)):(t.consume(S),S===92?p:f)}function p(S){return S===92||S===124?(t.consume(S),f):f(S)}function h(S){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(S):(t.enter("tableDelimiterRow"),a=!1,oe(S)?de(t,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):g(S))}function g(S){return S===45||S===58?T(S):S===124?(a=!0,t.enter("tableCellDivider"),t.consume(S),t.exit("tableCellDivider"),_):R(S)}function _(S){return oe(S)?de(t,T,"whitespace")(S):T(S)}function T(S){return S===58?(i+=1,a=!0,t.enter("tableDelimiterMarker"),t.consume(S),t.exit("tableDelimiterMarker"),E):S===45?(i+=1,E(S)):S===null||ee(S)?w(S):R(S)}function E(S){return S===45?(t.enter("tableDelimiterFiller"),A(S)):R(S)}function A(S){return S===45?(t.consume(S),A):S===58?(a=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(S),t.exit("tableDelimiterMarker"),b):(t.exit("tableDelimiterFiller"),b(S))}function b(S){return oe(S)?de(t,w,"whitespace")(S):w(S)}function w(S){return S===124?g(S):S===null||ee(S)?!a||s!==i?R(S):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(S)):R(S)}function R(S){return n(S)}function I(S){return t.enter("tableRow"),L(S)}function L(S){return S===124?(t.enter("tableCellDivider"),t.consume(S),t.exit("tableCellDivider"),L):S===null||ee(S)?(t.exit("tableRow"),e(S)):oe(S)?de(t,L,"whitespace")(S):(t.enter("data"),M(S))}function M(S){return S===null||S===124||xe(S)?(t.exit("data"),L(S)):(t.consume(S),S===92?P:M)}function P(S){return S===92||S===124?(t.consume(S),M):M(S)}}function p_(t,e){let n=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],u=!1,l=0,o,d,f;const p=new l_;for(;++n<t.length;){const h=t[n],g=h[1];h[0]==="enter"?g.type==="tableHead"?(u=!1,l!==0&&(Hu(p,e,l,o,d),d=void 0,l=0),o={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(n,0,[["enter",o,e]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,f=void 0,i=[0,0,0,0],a=[0,n+1,0,0],u&&(u=!1,d={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(n,0,[["enter",d,e]])),s=g.type==="tableDelimiterRow"?2:d?3:1):s&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(i[1]!==0&&(a[0]=a[1],f=kr(p,e,i,s,void 0,f),i=[0,0,0,0]),a[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(a[0]=a[1],f=kr(p,e,i,s,void 0,f)),i=a,a=[i[1],n,0,0])):g.type==="tableHead"?(u=!0,l=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(l=n,i[1]!==0?(a[0]=a[1],f=kr(p,e,i,s,n,f)):a[1]!==0&&(f=kr(p,e,a,s,n,f)),s=0):s&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&Hu(p,e,l,o,d),p.consume(e.events),n=-1;++n<e.events.length;){const h=e.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=d_(e.events,n))}return t}function kr(t,e,n,r,s,i){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(i.end=Object.assign({},hn(e.events,n[0])),t.add(n[0],0,[["exit",i,e]]));const l=hn(e.events,n[1]);if(i={type:a,start:Object.assign({},l),end:Object.assign({},l)},t.add(n[1],0,[["enter",i,e]]),n[2]!==0){const o=hn(e.events,n[2]),d=hn(e.events,n[3]),f={type:u,start:Object.assign({},o),end:Object.assign({},d)};if(t.add(n[2],0,[["enter",f,e]]),r!==2){const p=e.events[n[2]],h=e.events[n[3]];if(p[1].end=Object.assign({},h[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,_=n[3]-n[2]-1;t.add(g,_,[])}}t.add(n[3]+1,0,[["exit",f,e]])}return s!==void 0&&(i.end=Object.assign({},hn(e.events,s)),t.add(s,0,[["exit",i,e]]),i=void 0),i}function Hu(t,e,n,r,s){const i=[],a=hn(e.events,n);s&&(s.end=Object.assign({},a),i.push(["exit",s,e])),r.end=Object.assign({},a),i.push(["exit",r,e]),t.add(n+1,0,i)}function hn(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const m_={name:"tasklistCheck",tokenize:b_};function g_(){return{text:{91:m_}}}function b_(t,e,n){const r=this;return s;function s(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),i)}function i(l){return xe(l)?(t.enter("taskListCheckValueUnchecked"),t.consume(l),t.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(t.enter("taskListCheckValueChecked"),t.consume(l),t.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),u):n(l)}function u(l){return ee(l)?e(l):oe(l)?t.check({tokenize:E_},e,n)(l):n(l)}}function E_(t,e,n){return de(t,r,"whitespace");function r(s){return s===null?n(s):e(s)}}function T_(t){return Il([Y3(),e_(),o_(t),f_(),g_()])}const x_={};function __(t){const e=this,n=t||x_,r=e.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(T_(n)),i.push(H3()),a.push(j3(n))}const y_=j.lazy(()=>Td(()=>import("./lazy-highlighter-CQ8gN0d3.js"),__vite__mapDeps([0,1,2])));function Kc(){const t=Q.c(3),[e,n]=j.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=async a=>{await navigator.clipboard.writeText(a),n(!0),setTimeout(()=>n(!1),2e3)},t[0]=r):r=t[0];const s=r;let i;return t[1]!==e?(i={handleCopy:s,copied:e},t[1]=e,t[2]=i):i=t[2],i}function A_(){const t=Q.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[85,70],t[0]=e):e=t[0];const n=e;let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx("div",{className:"p-4 font-mono text-sm",style:{background:"#2d2d2d",borderRadius:"0 0 0.5rem 0.5rem",overflow:"auto",minHeight:"4rem"},children:n.map(k_)}),t[1]=r):r=t[1],r}function k_(t,e){return m.jsxs("div",{className:"flex gap-2 items-center my-1",children:[e>2&&e<7&&m.jsx("div",{className:"w-4 h-4 rounded-sm opacity-40 animate-pulse",style:{background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.1}s`}}),e%4===0&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"3rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.12}s`}}),e%3===1&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"2.5rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.14}s`}}),m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:`${t}%`,background:"rgba(255, 255, 255, 0.1)",animationDelay:`${e*.1}s`}}),e%5===2&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"4rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.16}s`}})]},e)}function C_(t){const e=Q.c(12),n=j.useRef(null),{handleCopy:r,copied:s}=Kc(),i=I_;let a;e[0]!==r?(a=async()=>{const p=i(n.current);await r(p)},e[0]=r,e[1]=a):a=e[1];const u=a;let l;e[2]!==s?(l=s?m.jsx($r,{size:12}):m.jsx(pi,{size:12}),e[2]=s,e[3]=l):l=e[3];let o;e[4]!==u||e[5]!==l?(o=m.jsx("div",{className:"flex justify-end items-center",children:m.jsxs(Me,{variant:"ghost",onClick:u,"aria-label":"Copy as CSV",className:"text-muted-foreground hover:text-foreground h-6 text-[10px]",type:"button",children:["Copy as CSV",l]})}),e[4]=u,e[5]=l,e[6]=o):o=e[6];let d;e[7]!==t?(d=m.jsx("div",{className:"overflow-x-auto mb-4 rounded-lg border border-border",children:m.jsx("table",{ref:n,...t,className:"min-w-full border-collapse text-sm",children:t.children})}),e[7]=t,e[8]=d):d=e[8];let f;return e[9]!==o||e[10]!==d?(f=m.jsxs(m.Fragment,{children:[o,d]}),e[9]=o,e[10]=d,e[11]=f):f=e[11],f}function I_(t){return t?Array.from(t.querySelectorAll("tr")).map(N_).join(`
106
+ `):""}function N_(t){return Array.from(t.querySelectorAll("th,td")).map(S_).join(",")}function S_(t){let e=t.textContent||"";return e=e.replace(/"/g,'""'),e.search(/([",\n])/g)>=0&&(e=`"${e}"`),e}const w_=[__],R_=[fx],O_={p:t=>m.jsx("p",{...t,className:"leading-relaxed text-[15px] mb-2 last:mb-0"}),strong:t=>m.jsx("strong",{...t,className:"font-bold"}),em:t=>m.jsx("em",{...t,className:"italic"}),a:t=>m.jsx("a",{...t,target:"_blank",rel:"noopener noreferrer",className:"text-primary-dark hover:underline break-all font-medium"}),ul:t=>m.jsx("ul",{...t,className:"list-disc ml-6 my-4 space-y-2"}),ol:t=>m.jsx("ol",{...t,className:"list-decimal ml-6 my-4 space-y-2"}),li:t=>m.jsx("li",{...t,className:"leading-relaxed text-[15px]"}),code:t=>m.jsx("code",{...t,className:"px-1 py-0.5 bg-muted rounded text-[15px] font-mono break-all"}),pre:t=>m.jsx("pre",{...t,className:"flex w-full min-w-0 my-4 bg-muted rounded overflow-hidden",children:m.jsx("code",{className:"flex-1 min-w-0 p-4 text-[15px] font-mono whitespace-pre overflow-x-auto",children:t.children})}),table:t=>m.jsx(C_,{...t}),thead:t=>m.jsx("thead",{...t,className:"bg-muted",children:t.children}),tr:t=>m.jsx("tr",{...t,className:"even:bg-muted/50 border-b border-border last:border-0"}),th:t=>m.jsx("th",{...t,className:"px-4 py-2 text-left font-semibold text-muted-foreground border-b border-border"}),td:t=>m.jsx("td",{...t,className:"px-4 py-2 border-b border-border"})},Jc=j.memo(t=>{const e=Q.c(2),{content:n}=t;let r;return e[0]!==n?(r=m.jsx(Xb,{remarkPlugins:w_,rehypePlugins:R_,components:O_,children:n}),e[0]=n,e[1]=r):r=e[1],r},(t,e)=>t.content===e.content);function L_(t){const e=Q.c(20),{language:n,content:r}=t,{handleCopy:s,copied:i}=Kc(),a=n||"text";let u;e[0]!==a?(u=m.jsx("span",{className:"text-xs font-mono uppercase text-muted-foreground tracking-widest select-none",children:a}),e[0]=a,e[1]=u):u=e[1];let l;e[2]!==r||e[3]!==s?(l=()=>s(r),e[2]=r,e[3]=s,e[4]=l):l=e[4];let o;e[5]!==i?(o=i?m.jsx($r,{size:14}):m.jsx(pi,{size:14}),e[5]=i,e[6]=o):o=e[6];let d;e[7]!==l||e[8]!==o?(d=m.jsx(Me,{size:"icon",variant:"ghost",onClick:l,"aria-label":"Copy code",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:o}),e[7]=l,e[8]=o,e[9]=d):d=e[9];let f;e[10]!==u||e[11]!==d?(f=m.jsxs("div",{className:"flex items-center justify-between p-1 pl-4 bg-muted border-b border-border",children:[u,d]}),e[10]=u,e[11]=d,e[12]=f):f=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=m.jsx(A_,{}),e[13]=p):p=e[13];let h;e[14]!==r||e[15]!==n?(h=m.jsx(j.Suspense,{fallback:p,children:m.jsx(y_,{language:n,content:r})}),e[14]=r,e[15]=n,e[16]=h):h=e[16];let g;return e[17]!==f||e[18]!==h?(g=m.jsxs("div",{className:"my-4 rounded-lg bg-muted overflow-hidden border border-border grid min-w-0",children:[f,h]}),e[17]=f,e[18]=h,e[19]=g):g=e[19],g}Jc.displayName="MemoizedMarkdownBlock";const Xi=t=>{const e=Q.c(7),{id:n,text:r}=t;let s;e[0]!==r?(s=ge.lexer(r),e[0]=r,e[1]=s):s=e[1];const i=s;let a;if(e[2]!==i||e[3]!==n){let u;e[5]!==n?(u=(l,o)=>l.type==="code"?m.jsx(L_,{language:l.lang,content:l.text},`${n}-block_${o}`):m.jsx(Jc,{content:l.raw},`${n}-block_${o}`),e[5]=n,e[6]=u):u=e[6],a=i.map(u),e[2]=i,e[3]=n,e[4]=a}else a=e[4];return a};Xi.displayName="MemoizedMarkdown";function ed(t){const e=Q.c(18),{id:n,part:r,copyable:s,extraActions:i,hasToolCallAfter:a}=t,u=s===void 0?!1:s,l=a===void 0?!1:a,{handleCopy:o}=up(),[d,f]=j.useState(!1);let p;e[0]!==o||e[1]!==r.text?(p=async()=>{await o(r.text),f(!0),setTimeout(()=>f(!1),2e3)},e[0]=o,e[1]=r.text,e[2]=p):p=e[2];const h=p,g=u&&i,_=g||i,T=!l&&"mb-2";let E;e[3]!==T?(E=re("group/part relative",T),e[3]=T,e[4]=E):E=e[4];let A;e[5]!==n||e[6]!==r.text?(A=m.jsx(Xi,{id:n,text:r.text}),e[5]=n,e[6]=r.text,e[7]=A):A=e[7];let b;e[8]!==i||e[9]!==h||e[10]!==d||e[11]!==_||e[12]!==g?(b=_&&m.jsx("div",{className:"flex w-full items-center text-xs text-muted-foreground opacity-0 pointer-events-none transition-all duration-200 group-hover/part:opacity-100 group-hover/part:pointer-events-auto mt-2",children:m.jsxs("div",{className:"flex items-center gap-1",children:[g&&m.jsx(Me,{onClick:h,variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground size-6 whitespace-nowrap",children:d?m.jsx($r,{size:12}):m.jsx(pi,{size:12})}),i]})}),e[8]=i,e[9]=h,e[10]=d,e[11]=_,e[12]=g,e[13]=b):b=e[13];let w;return e[14]!==E||e[15]!==A||e[16]!==b?(w=m.jsxs("div",{className:E,children:[A,b]}),e[14]=E,e[15]=A,e[16]=b,e[17]=w):w=e[17],w}function v_(t){const e=Q.c(4),{output:n}=t;let r;if(e[0]!==n){const a=JSON.stringify(n,null,2);r=a.length>2e3?a.slice(0,2e3)+"...[TRUNCATED]":a,e[0]=n,e[1]=r}else r=e[1];const s=r;let i;return e[2]!==s?(i=m.jsx("div",{className:"h-full",children:m.jsx(Ku,{code:s,language:"json",height:"100%",readOnly:!0})}),e[2]=s,e[3]=i):i=e[3],i}var os="Collapsible",[D_,rA]=xd(os),[P_,Zi]=D_(os),td=j.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:a,...u}=t,[l,o]=Ad({prop:r,defaultProp:s??!1,onChange:a,caller:os});return m.jsx(P_,{scope:n,disabled:i,contentId:kd(),open:l,onOpenToggle:j.useCallback(()=>o(d=>!d),[o]),children:m.jsx(li.div,{"data-state":ta(l),"data-disabled":i?"":void 0,...u,ref:e})})});td.displayName=os;var nd="CollapsibleTrigger",Ki=j.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,s=Zi(nd,n);return m.jsx(li.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":ta(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:e,onClick:_d(t.onClick,s.onOpenToggle)})});Ki.displayName=nd;var Ji="CollapsibleContent",ea=j.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Zi(Ji,t.__scopeCollapsible);return m.jsx(yd,{present:n||s.open,children:({present:i})=>m.jsx(M_,{...r,ref:e,present:i})})});ea.displayName=Ji;var M_=j.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=t,a=Zi(Ji,n),[u,l]=j.useState(r),o=j.useRef(null),d=Cd(e,o),f=j.useRef(0),p=f.current,h=j.useRef(0),g=h.current,_=a.open||u,T=j.useRef(_),E=j.useRef(void 0);return j.useEffect(()=>{const A=requestAnimationFrame(()=>T.current=!1);return()=>cancelAnimationFrame(A)},[]),Id(()=>{const A=o.current;if(A){E.current=E.current||{transitionDuration:A.style.transitionDuration,animationName:A.style.animationName},A.style.transitionDuration="0s",A.style.animationName="none";const b=A.getBoundingClientRect();f.current=b.height,h.current=b.width,T.current||(A.style.transitionDuration=E.current.transitionDuration,A.style.animationName=E.current.animationName),l(r)}},[a.open,r]),m.jsx(li.div,{"data-state":ta(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!_,...i,ref:d,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...t.style},children:_&&s})});function ta(t){return t?"open":"closed"}var B_=td,sA=Ki,iA=ea;function F_(t){const e=Q.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(B_,{"data-slot":"collapsible",...n}),e[2]=n,e[3]=r):r=e[3],r}function U_(t){const e=Q.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(Ki,{"data-slot":"collapsible-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function H_(t){const e=Q.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(ea,{"data-slot":"collapsible-content",...n}),e[2]=n,e[3]=r):r=e[3],r}function j_(t){return t.split(/[_-]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")}function ju(t){const e=Q.c(70),{part:n,isFirstInSequence:r,isLastInSequence:s,hasNextToolCall:i}=t,a=r===void 0?!1:r,u=s===void 0?!1:s,l=i===void 0?!1:i,{state:o}=n;let d;e[0]!==n?(d="toolName"in n?n.toolName:n.type.replace("tool-",""),e[0]=n,e[1]=d):d=e[1];const f=d;let p;e[2]!==f?(p=j_(f),e[2]=f,e[3]=p):p=e[3];const h=p,[g,_]=j.useState(!1),[T]=zd(),E=(o==="input-streaming"||o==="input-available"||o==="output-available")&&!!n.input,A=o==="output-available",b=o==="output-error";if(!T){const ve=o==="input-streaming"||o==="input-available",fe=o==="output-available",Ge=o==="output-error",Ie=a&&"mt-2",Ne=u&&"mb-2";let ye;e[4]!==Ie||e[5]!==Ne?(ye=re("flex items-center gap-1.5 py-2 opacity-75 relative",Ie,Ne),e[4]=Ie,e[5]=Ne,e[6]=ye):ye=e[6];let Fe;e[7]===Symbol.for("react.memo_cache_sentinel")?(Fe=m.jsx(Ju,{className:"size-4 text-muted-foreground shrink-0"}),e[7]=Fe):Fe=e[7];let Re;e[8]!==l?(Re=l&&m.jsx("div",{className:"absolute left-1/2 top-full w-px bg-border -translate-x-1/2",style:{height:"calc(100% + 1rem)"}}),e[8]=l,e[9]=Re):Re=e[9];let De;e[10]!==Re?(De=m.jsxs("div",{className:"relative shrink-0 flex items-center",children:[Fe,Re]}),e[10]=Re,e[11]=De):De=e[11];let Oe;e[12]!==h||e[13]!==ve?(Oe=ve&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-muted-foreground shimmer",children:"Calling"})," ",m.jsxs("span",{className:"text-muted-foreground/75 shimmer",children:[h,"..."]})]}),e[12]=h,e[13]=ve,e[14]=Oe):Oe=e[14];let Ue;e[15]!==h||e[16]!==fe?(Ue=fe&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-muted-foreground",children:"Called"})," ",m.jsx("span",{className:"text-muted-foreground/75",children:h})]}),e[15]=h,e[16]=fe,e[17]=Ue):Ue=e[17];let Se;e[18]!==h||e[19]!==Ge?(Se=Ge&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-destructive/90",children:"Error calling"})," ",m.jsx("span",{className:"text-destructive/75",children:h})]}),e[18]=h,e[19]=Ge,e[20]=Se):Se=e[20];let He;e[21]!==Oe||e[22]!==Ue||e[23]!==Se?(He=m.jsxs("span",{className:"text-[15px]",children:[Oe,Ue,Se]}),e[21]=Oe,e[22]=Ue,e[23]=Se,e[24]=He):He=e[24];let We;return e[25]!==De||e[26]!==He||e[27]!==ye?(We=m.jsxs("div",{className:ye,children:[De,He]}),e[25]=De,e[26]=He,e[27]=ye,e[28]=We):We=e[28],We}let w;e[29]!==o?(w=o==="output-error"?m.jsx(Gu,{className:"size-4 text-destructive shrink-0"}):m.jsx(af,{className:re("size-4 text-muted-foreground shrink-0",(o==="input-streaming"||o==="input-available")&&"shimmer")}),e[29]=o,e[30]=w):w=e[30];const R=o==="output-error"&&"text-destructive/90",I=(o==="input-streaming"||o==="input-available")&&"shimmer";let L;e[31]!==R||e[32]!==I?(L=re("text-[15px] font-medium text-muted-foreground truncate",R,I),e[31]=R,e[32]=I,e[33]=L):L=e[33];const M=o==="input-streaming"&&`Streaming ${f} arguments`,P=o==="input-available"&&`Calling ${f}`,S=o==="output-available"&&`Called ${f}`,B=o==="output-error"&&`Error calling ${f}`;let $;e[34]!==M||e[35]!==P||e[36]!==S||e[37]!==B||e[38]!==L?($=m.jsxs("span",{className:L,children:[M,P,S,B]}),e[34]=M,e[35]=P,e[36]=S,e[37]=B,e[38]=L,e[39]=$):$=e[39];let X;e[40]!==$||e[41]!==w?(X=m.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[w,$]}),e[40]=$,e[41]=w,e[42]=X):X=e[42];const q=g&&"rotate-90";let U;e[43]!==q?(U=re("size-4 text-muted-foreground transition-transform duration-200",q),e[43]=q,e[44]=U):U=e[44];let W;e[45]!==U?(W=m.jsx("div",{className:"flex items-center gap-2 shrink-0",children:m.jsx(Xu,{className:U})}),e[45]=U,e[46]=W):W=e[46];let V;e[47]!==X||e[48]!==W?(V=m.jsxs(U_,{className:"flex items-center gap-2 w-full cursor-pointer p-3 hover:bg-accent/50 transition-colors",children:[X,W]}),e[47]=X,e[48]=W,e[49]=V):V=e[49];let K;e[50]===Symbol.for("react.memo_cache_sentinel")?(K=m.jsx("div",{className:"w-4 relative shrink-0",children:m.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-0.25 bg-border"})}),e[50]=K):K=e[50];let J;e[51]!==n.input||e[52]!==E?(J=E&&m.jsxs("div",{className:"flex flex-col gap-0.5",children:[m.jsx("div",{className:"px-1 h-5 flex items-center",children:m.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Input"})}),m.jsx("div",{className:"border border-border rounded-lg p-2 h-full max-h-[200px]",children:m.jsx(Ku,{code:JSON.stringify(n.input,null,2),language:"json",foldOnMount:!0,height:"100%",readOnly:!0})})]}),e[51]=n.input,e[52]=E,e[53]=J):J=e[53];let k;e[54]!==n.output||e[55]!==A?(k=A&&m.jsxs("div",{className:"flex flex-col gap-0.5",children:[m.jsx("div",{className:"px-1 h-5 flex items-center",children:m.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Output"})}),m.jsx("div",{className:"border border-border rounded-lg max-h-[200px] overflow-auto p-2 h-full",children:m.jsx(v_,{output:n.output})})]}),e[54]=n.output,e[55]=A,e[56]=k):k=e[56];let se;e[57]!==n||e[58]!==b?(se=b&&m.jsxs("div",{className:"flex flex-col gap-0.5",children:[m.jsx("div",{className:"px-1 h-5 flex items-center",children:m.jsx("span",{className:"text-xs font-medium text-destructive/90",children:"Error"})}),m.jsx("div",{className:"border border-destructive/20 rounded-lg max-h-[200px] overflow-auto p-2 bg-destructive/10",children:m.jsx("pre",{className:"text-xs font-mono text-destructive whitespace-pre-wrap wrap-break-word",children:"errorText"in n&&typeof n.errorText=="string"?n.errorText:"An unknown error occurred"})})]}),e[57]=n,e[58]=b,e[59]=se):se=e[59];let he;e[60]!==J||e[61]!==k||e[62]!==se?(he=m.jsx(H_,{className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden",children:m.jsxs("div",{className:"flex ml-[7px] px-3 pb-3",children:[K,m.jsxs("div",{className:"flex flex-col gap-4 flex-1 min-w-0 pt-2",children:[J,k,se]})]})}),e[60]=J,e[61]=k,e[62]=se,e[63]=he):he=e[63];let N;e[64]!==V||e[65]!==he?(N=m.jsxs("div",{className:"border border-border/75 rounded-lg flex flex-col bg-background w-full min-w-0 overflow-hidden",children:[V,he]}),e[64]=V,e[65]=he,e[66]=N):N=e[66];let Ee;return e[67]!==g||e[68]!==N?(Ee=m.jsx("div",{className:"flex flex-col my-4 w-full min-w-0",children:m.jsx(F_,{open:g,onOpenChange:_,children:N})}),e[67]=g,e[68]=N,e[69]=Ee):Ee=e[69],Ee}const z_={planning:{icon:m.jsx(oo,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Planning next moves"},thinking:{icon:m.jsx(qr,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Thinking"}},$_=1200;function Y_(){const t=Q.c(7),[e,n]=j.useState("planning");let r,s;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const l=setTimeout(()=>{n("thinking")},$_);return()=>{clearTimeout(l)}},s=[],t[0]=r,t[1]=s):(r=t[0],s=t[1]),j.useEffect(r,s);const i=z_[e];let a;t[2]!==i.label?(a=m.jsxs("span",{className:"text-[15px] text-muted-foreground shimmer",children:[i.label,"..."]}),t[2]=i.label,t[3]=a):a=t[3];let u;return t[4]!==i.icon||t[5]!==a?(u=m.jsx("div",{className:"flex items-center gap-1.5 py-2 opacity-60",children:m.jsxs("span",{className:"flex items-center gap-1.5",children:[i.icon,a]})}),t[4]=i.icon,t[5]=a,t[6]=u):u=t[6],u}function q_(t){const e=Q.c(10),{duration:n,parts:r,id:s}=t,i=n/1e3;let a;e[0]!==i?(a=i.toFixed(1),e[0]=i,e[1]=a):a=e[1];const u=a,[l,o]=j.useState(!1),[d,f]=j.useState(!1);let p;if(e[2]!==s||e[3]!==d||e[4]!==l||e[5]!==r||e[6]!==u){const h=r.filter(G_),g=h.some(V_),_=g||d;let T,E;e[8]===Symbol.for("react.memo_cache_sentinel")?(T=()=>o(!0),E=()=>o(!1),e[8]=T,e[9]=E):(T=e[8],E=e[9]),p=m.jsxs("div",{className:"flex flex-col mb-2",children:[m.jsx("button",{type:"button",onClick:()=>!g&&f(!d),onMouseEnter:T,onMouseLeave:E,className:re("flex items-center gap-1.5 py-2 opacity-60 transition-opacity",!g&&"cursor-pointer hover:opacity-100",g&&"cursor-default"),children:m.jsxs("span",{className:"flex items-center gap-1.5",children:[g?m.jsx(qr,{className:"text-muted-foreground shrink-0 shimmer",size:14}):l?m.jsx(Xu,{className:re("text-muted-foreground transition-transform shrink-0",d&&"rotate-90"),size:14}):m.jsx(io,{className:"text-muted-foreground shrink-0",size:14}),m.jsx("span",{className:re("text-[15px] text-muted-foreground",g&&"shimmer"),children:g?"Thinking...":`Thought for ${u}s`})]})}),_&&m.jsx("div",{className:"ml-[6px] border-l-2 pl-4 mt-1 mb-2 max-h-[300px] overflow-y-auto",children:h.map((A,b)=>m.jsx("div",{className:"text-muted-foreground markdown-sm pb-2",children:m.jsx(Xi,{id:`${s}-reasoning-${b}`,text:A.text})},`${s}-reasoning-${b}`))})]}),e[2]=s,e[3]=d,e[4]=l,e[5]=r,e[6]=u,e[7]=p}else p=e[7];return p}function V_(t){return t.state==="streaming"}function G_(t){return t.type==="reasoning"}function W_(t){const e=Q.c(17),{part:n,id:r,usageStats:s,isFollowedByToolCall:i,isFirstToolCallInSequence:a,isLastToolCallInSequence:u,hasNextToolCall:l}=t;switch(n.type){case"dynamic-tool":{let o;return e[0]!==l||e[1]!==r||e[2]!==a||e[3]!==u||e[4]!==n?(o=m.jsx(ju,{part:n,id:r,isFirstInSequence:a,isLastInSequence:u,hasNextToolCall:l}),e[0]=l,e[1]=r,e[2]=a,e[3]=u,e[4]=n,e[5]=o):o=e[5],o}case"text":{let o;return e[6]!==r||e[7]!==i||e[8]!==n||e[9]!==s?(o=m.jsx(ed,{id:r,part:n,extraActions:s,copyable:!0,hasToolCallAfter:i}),e[6]=r,e[7]=i,e[8]=n,e[9]=s,e[10]=o):o=e[10],o}case"reasoning":return null;case"step-start":case"file":case"source-url":case"source-document":return null;default:if(n.type.startsWith("tool-")){const o=n;let d;return e[11]!==l||e[12]!==r||e[13]!==a||e[14]!==u||e[15]!==o?(d=m.jsx(ju,{part:o,id:r,isFirstInSequence:a,isLastInSequence:u,hasNextToolCall:l}),e[11]=l,e[12]=r,e[13]=a,e[14]=u,e[15]=o,e[16]=d):d=e[16],d}}throw new Error(`Unknown part type: ${n.type}`)}function Q_(t){const e=Q.c(24),{message:n,status:r,className:s}=t,{id:i,parts:a}=n,o=r==="streaming"||r==="submitted",d=a.length>0;let f;e[0]!==a?(f=a.some(Z_),e[0]=a,e[1]=f):f=e[1];const p=f;let h;e[2]!==o||e[3]!==a?(h=o&&a.some(X_),e[2]=o,e[3]=a,e[4]=h):h=e[4];const g=h;let _;if(e[5]!==n.metadata){const M=n.metadata?.reasoning_start_at?new Date(n.metadata.reasoning_start_at):null,P=n.metadata?.reasoning_end_at?new Date(n.metadata.reasoning_end_at):null;_=M!==null?(P??new Date).getTime()-M.getTime():null,e[5]=n.metadata,e[6]=_}else _=e[6];const T=_,E=d&&(p||g)&&T!==null;let A;e[7]!==n?(A=m.jsx(Zo,{messages:[n]}),e[7]=n,e[8]=A):A=e[8];const b=A;let w;e[9]!==s?(w=re("w-full min-w-0 group relative flex items-start gap-4 px-4 z-20 text-foreground flex-row",s),e[9]=s,e[10]=w):w=e[10];let R;e[11]!==T||e[12]!==d||e[13]!==i||e[14]!==o||e[15]!==a||e[16]!==E||e[17]!==b?(R=d?m.jsxs(m.Fragment,{children:[E&&m.jsx(q_,{duration:T,parts:a,id:i}),a.map((M,P)=>{const S=a[P+1],B=a[P-1],$=S&&(S.type==="dynamic-tool"||S.type.startsWith("tool-")),X=M.type==="dynamic-tool"||M.type.startsWith("tool-"),q=B&&(B.type==="dynamic-tool"||B.type.startsWith("tool-")),U=S&&(S.type==="dynamic-tool"||S.type.startsWith("tool-")),W=X&&!q,V=X&&!U,K=X&&U;return m.jsx(W_,{part:M,id:i,usageStats:P===a.length-1?b:void 0,isFollowedByToolCall:$,isFirstToolCallInSequence:W,isLastToolCallInSequence:V,hasNextToolCall:K},`${i}-${P}`)})]}):o?m.jsx(Y_,{}):null,e[11]=T,e[12]=d,e[13]=i,e[14]=o,e[15]=a,e[16]=E,e[17]=b,e[18]=R):R=e[18];let I;e[19]!==R?(I=m.jsx("div",{className:"flex flex-col min-w-0 w-full items-start",children:m.jsx("div",{className:"w-full min-w-0 not-only:rounded-2xl text-[15px] wrap-break-word overflow-wrap-anywhere bg-transparent",children:R})}),e[19]=R,e[20]=I):I=e[20];let L;return e[21]!==w||e[22]!==I?(L=m.jsx("div",{className:w,children:I}),e[21]=w,e[22]=I,e[23]=L):L=e[23],L}function X_(t){return t.type==="reasoning"&&t.state==="streaming"}function Z_(t){return t.type==="reasoning"}const rd=j.createContext(null);function sd(t){const e=Q.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx(m.Fragment,{children:n}),e[0]=n,e[1]=r):r=e[1],r}function K_(t){const e=[];for(let n=0;n<t.length;n++){const r=t[n];if(!j.isValidElement(r))continue;if(r.props?.message?.role==="assistant"){const i=t[n-1],a=j.isValidElement(i)&&i.props?.message?.role,u=i&&j.isValidElement(i)&&a==="user"?i:null;e.push({user:u,assistant:r})}}return e}function J_(t){const e=Q.c(27),{children:n,className:r,minHeightOffset:s}=t,i=j.useRef(null);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=[],e[0]=a):a=e[0];const u=j.useRef(a);let l,o,d,f,p,h,g;if(e[1]!==n||e[2]!==r||e[3]!==s){const A=j.Children.toArray(n),b=A[A.length-1];o=b&&j.isValidElement(b)&&b.type===sd?b:null;const w=o?A.slice(0,-1):A,R=K_(w);let I;e[11]===Symbol.for("react.memo_cache_sentinel")?(I=M=>{const P=u.current[M];if(P&&i.current){const S=i.current.offsetTop,B=P.offsetTop;i.current.scrollTo({top:B-S,behavior:"smooth"})}},e[11]=I):I=e[11];const L=I;l=rd.Provider,e[12]===Symbol.for("react.memo_cache_sentinel")?(g={scrollToPair:L},e[12]=g):g=e[12],p=i,e[13]!==r?(h=re("w-full min-w-0 max-w-full overflow-y-auto h-full overflow-x-hidden",r),e[13]=r,e[14]=h):h=e[14],d="flex flex-col min-w-0 max-w-2xl mx-auto w-full",f=R.map((M,P)=>{const S=P===R.length-1;return m.jsxs("div",{ref:B=>{u.current[P]=B},className:"flex flex-col pb-2",style:S&&s?{minHeight:`calc(100vh - ${s}px)`}:void 0,children:[m.jsx("div",{className:"sticky top-0 z-50 bg-background w-full h-4"}),m.jsx("div",{className:"sticky mb-3 top-4 z-50",children:M.user&&j.isValidElement(M.user)?j.cloneElement(M.user,{pairIndex:P}):M.user}),M.assistant]},P)}),e[1]=n,e[2]=r,e[3]=s,e[4]=l,e[5]=o,e[6]=d,e[7]=f,e[8]=p,e[9]=h,e[10]=g}else l=e[4],o=e[5],d=e[6],f=e[7],p=e[8],h=e[9],g=e[10];let _;e[15]!==o||e[16]!==d||e[17]!==f?(_=m.jsxs("div",{className:d,children:[f,o]}),e[15]=o,e[16]=d,e[17]=f,e[18]=_):_=e[18];let T;e[19]!==p||e[20]!==h||e[21]!==_?(T=m.jsx("div",{ref:p,className:h,children:_}),e[19]=p,e[20]=h,e[21]=_,e[22]=T):T=e[22];let E;return e[23]!==l||e[24]!==g||e[25]!==T?(E=m.jsx(l,{value:g,children:T}),e[23]=l,e[24]=g,e[25]=T,e[26]=E):E=e[26],E}function ey(t){const e=Q.c(5),{locator:n}=zt(),r=Yo(),s=$o();let i;return e[0]!==n||e[1]!==r||e[2]!==t||e[3]!==s?(i=async(u,l,o)=>{const d=await jo(n,o),f=d.findIndex(T=>T.id===u);if(f===-1){console.warn(`[branch] Message ${u} not found in thread ${o}`);return}const p=d.slice(0,f).filter(ty),h=crypto.randomUUID(),g=new Date().toISOString(),_={id:h,title:"",created_at:g,updated_at:g,hidden:!1};if(await s.insert.mutateAsync(_),p.length>0){const T=p.map(E=>({...E,id:crypto.randomUUID(),metadata:{...E.metadata,thread_id:h,created_at:E.metadata?.created_at||g}}));await r.insertMany.mutateAsync(T)}t(h)},e[0]=n,e[1]=r,e[2]=t,e[3]=s,e[4]=i):i=e[4],i}function ty(t){return t.role!=="system"}function ny(t){const e=Q.c(18),{messageId:n,parts:r}=t,[s,i]=j.useState(!1),{setInputValue:a,startBranch:u,setActiveThreadId:l,activeThreadId:o}=An(),d=ey(l);let f;e[0]!==r?(f=r.filter(sy).map(ry).join(`
107
+ `),e[0]=r,e[1]=f):f=e[1];const p=f;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=I=>{I.stopPropagation(),i(!0)},e[2]=h):h=e[2];const g=h;let _;e[3]!==o||e[4]!==d||e[5]!==n||e[6]!==p||e[7]!==a||e[8]!==u?(_=async()=>{await d(n,p,o),a(p),u({originalThreadId:o,originalMessageId:n,originalMessageText:p}),i(!1)},e[3]=o,e[4]=d,e[5]=n,e[6]=p,e[7]=a,e[8]=u,e[9]=_):_=e[9];const T=_;let E;e[10]===Symbol.for("react.memo_cache_sentinel")?(E=m.jsx("div",{className:"flex justify-center items-end px-2 pb-1",children:m.jsxs(yn,{children:[m.jsx(_n,{asChild:!0,children:m.jsx(Me,{onClick:g,variant:"ghost",size:"xs",className:"opacity-0 group-hover:opacity-100 hover:bg-gray-200/70 rounded-md transition-opacity text-muted-foreground hover:text-foreground aspect-square w-6 h-6 p-0",children:m.jsx(so,{size:16,className:"p-0.5"})})}),m.jsx(xn,{side:"bottom",children:"Edit message"})]})}),e[10]=E):E=e[10];let A;e[11]===Symbol.for("react.memo_cache_sentinel")?(A=m.jsxs(uf,{children:[m.jsx(of,{children:"Edit message?"}),m.jsx(lf,{children:"This will create a new conversation branch from this point. The original conversation will remain unchanged."})]}),e[11]=A):A=e[11];let b;e[12]===Symbol.for("react.memo_cache_sentinel")?(b=m.jsx(cf,{children:"Cancel"}),e[12]=b):b=e[12];let w;e[13]!==T?(w=m.jsxs(df,{children:[A,m.jsxs(ff,{children:[b,m.jsx(hf,{onClick:T,children:"Confirm"})]})]}),e[13]=T,e[14]=w):w=e[14];let R;return e[15]!==s||e[16]!==w?(R=m.jsxs(m.Fragment,{children:[E,m.jsx(pf,{open:s,onOpenChange:i,children:w})]}),e[15]=s,e[16]=w,e[17]=R):R=e[17],R}function ry(t){return t.text}function sy(t){return t.type==="text"}function iy(t){const e=Q.c(29),{message:n,className:r,pairIndex:s}=t,{id:i,parts:a}=n,u=j.useContext(rd),[l,o]=j.useState(!1);if(!a||a.length===0)return null;let d;e[0]!==u||e[1]!==s?(d=()=>{o(!0),s!==void 0&&u?.scrollToPair(s)},e[0]=u,e[1]=s,e[2]=d):d=e[2];const f=d;let p;e[3]!==r?(p=re("message-block w-full min-w-0 group relative flex items-start gap-4 px-2.5 text-foreground flex-row-reverse",r),e[3]=r,e[4]=p):p=e[4];let h,g;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=()=>o(!0),g=()=>o(!1),e[5]=h,e[6]=g):(h=e[5],g=e[6]);const _=l?"overflow-auto opacity-100":"overflow-hidden opacity-99 mask-b-from-1%";let T;e[7]!==_?(T=re("z-10 px-4 py-2 transition-opacity max-h-[120px] flex-1",_),e[7]=_,e[8]=T):T=e[8];let E;if(e[9]!==i||e[10]!==a){let L;e[12]!==i?(L=(M,P)=>M.type==="text"?m.jsx(ed,{id:i,part:M},`${i}-${P}`):null,e[12]=i,e[13]=L):L=e[13],E=a.map(L),e[9]=i,e[10]=a,e[11]=E}else E=e[11];let A;e[14]!==E?(A=m.jsx("div",{children:E}),e[14]=E,e[15]=A):A=e[15];let b;e[16]!==T||e[17]!==A?(b=m.jsx("div",{className:T,children:A}),e[16]=T,e[17]=A,e[18]=b):b=e[18];let w;e[19]!==i||e[20]!==a?(w=m.jsx(ny,{messageId:i,parts:a}),e[19]=i,e[20]=a,e[21]=w):w=e[21];let R;e[22]!==f||e[23]!==w||e[24]!==b?(R=m.jsxs("div",{tabIndex:0,onClick:f,onFocus:h,onBlur:g,className:"w-full border min-w-0 shadow-xs rounded-lg text-[0.9375rem] wrap-break-word overflow-wrap-anywhere bg-background cursor-pointer transition-colors relative flex outline-none",children:[b,w]}),e[22]=f,e[23]=w,e[24]=b,e[25]=R):R=e[25];let I;return e[26]!==R||e[27]!==p?(I=m.jsx(m.Fragment,{children:m.jsx("div",{className:p,children:R})}),e[26]=R,e[27]=p,e[28]=I):I=e[28],I}function ay({title:t="No model provider connected",description:e="Connect to a model provider to unlock AI-powered features.",org:n}){const[r,s]=j.useState(!1),i=Ud(),a=Vu(),{data:u}=qu.useSession(),l=Wu(),o=u?.user?.id??"",d=()=>{a({to:"/$org/mcps",params:{org:n.slug},search:{action:"create"}})},f=async()=>{if(!n.id||!o){Kn.error("Not authenticated");return}s(!0);try{const p=l?.find(_=>_.connection_url===gf);if(p){a({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:p.id}});return}const h=bf({id:Ef("conn")}),g=await i.create.mutateAsync(h);a({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:g.id}})}catch(p){Kn.error(`Failed to connect OpenRouter: ${p instanceof Error?p.message:String(p)}`)}finally{s(!1)}};return m.jsx(Sd,{image:m.jsx("img",{src:"/empty-state-openrouter.svg",alt:"",width:336,height:320,"aria-hidden":"true",className:"w-xs h-auto mask-radial-[100%_100%] mask-radial-from-20% mask-radial-to-50% mask-radial-at-center"}),title:t,description:e,actions:m.jsxs(m.Fragment,{children:[m.jsxs(Me,{variant:"outline",onClick:f,disabled:r,children:[m.jsx("img",{src:mf,alt:"OpenRouter",className:"size-4"}),r?"Installing...":"Install OpenRouter"]}),m.jsx(Me,{variant:"outline",onClick:d,children:"Install Connection"})]})})}function uy(t){const e=new Date(t),r=new Date().getTime()-e.getTime(),s=Math.floor(r/6e4),i=Math.floor(r/36e5);return s<1?"now":s<60?`${s}m`:`${i}h`}function oy(t){const e=new Date,n=new Date(e.getFullYear(),e.getMonth(),e.getDate()),r=new Date(n.getTime()-864e5),s=new Date(n.getTime()-7*864e5),i=new Date(n.getTime()-30*864e5),a=[],u=[],l=[],o=[],d=[];for(const p of t){const h=new Date(p.updated_at);h>=n?a.push(p):h>=r?u.push(p):h>=s?l.push(p):h>=i?o.push(p):d.push(p)}const f=[];return a.length>0&&f.push({label:"Today",threads:a,showRelativeTime:!0}),u.length>0&&f.push({label:"Yesterday",threads:u,showRelativeTime:!1}),l.length>0&&f.push({label:"7 days ago",threads:l,showRelativeTime:!1}),o.length>0&&f.push({label:"30 days ago",threads:o,showRelativeTime:!1}),d.length>0&&f.push({label:"Older",threads:d,showRelativeTime:!1}),f}function ly(t){const e=Q.c(49),{variant:n}=t,r=n===void 0?"icon":n,{threads:s,refetch:i}=zo(),{activeThreadId:a,setActiveThreadId:u,hideThread:l}=An(),[o,d]=j.useState("");let f,p,h,g,_,T,E,A,b,w,R,I;if(e[0]!==a||e[1]!==l||e[2]!==i||e[3]!==o||e[4]!==u||e[5]!==s||e[6]!==r){const $=o.trim()?s.filter(K=>(K.title||"New chat").toLowerCase().includes(o.toLowerCase())):s,X=oy($);let q;e[19]!==i?(q=K=>{K?i():d("")},e[19]=i,e[20]=q):q=e[20];const U=q;g=hi,h=yn,p=lr,w=U,e[21]!==r?(R=m.jsx(_n,{asChild:!0,children:m.jsx(ur,{asChild:!0,children:r==="outline"?m.jsx(Me,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input","aria-label":"Chat history",children:m.jsx(na,{size:16})}):m.jsx(Me,{type:"button",variant:"ghost",size:"icon",className:"size-6 p-1 hover:bg-transparent","aria-label":"Chat history",children:m.jsx(na,{size:16,className:"text-muted-foreground hover:text-foreground transition-colors"})})})}),e[21]=r,e[22]=R):R=e[22],e[23]===Symbol.for("react.memo_cache_sentinel")?(I=m.jsx(xn,{children:"Chat history"}),e[23]=I):I=e[23],f=or,E="end",A="w-80 p-0";let W;e[24]===Symbol.for("react.memo_cache_sentinel")?(W=m.jsx(Yr,{size:16,className:"text-muted-foreground shrink-0"}),e[24]=W):W=e[24];let V;e[25]===Symbol.for("react.memo_cache_sentinel")?(V=K=>d(K.target.value),e[25]=V):V=e[25],e[26]!==o?(b=m.jsx("div",{className:"border-b",children:m.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 cursor-text",children:[W,m.jsx("input",{type:"text",placeholder:"Search chats...",value:o,onChange:V,className:"flex-1 border-0 shadow-none focus:outline-none px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),e[26]=o,e[27]=b):b=e[27],_="max-h-[300px] overflow-y-auto",T=$.length===0?m.jsx("div",{className:"p-4 text-center text-sm text-muted-foreground",children:o.trim()?"No chats found":"No chats yet"}):X.map((K,J)=>m.jsxs("div",{children:[J>0&&m.jsx("div",{className:"border-t mx-3"}),m.jsx("div",{className:"px-3 py-1",children:m.jsx("span",{className:"text-xs font-medium text-muted-foreground tracking-wide",children:K.label})}),K.threads.map(k=>{const se=k.id===a;return m.jsxs("div",{className:re("flex items-center gap-2 px-3 py-2 hover:bg-accent cursor-pointer group",se&&"bg-accent/50"),onClick:()=>u(k.id),children:[m.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[m.jsx("span",{className:"text-sm truncate",children:k.title||"New chat"}),m.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:se?"current":K.showRelativeTime?uy(k.updated_at):null})]}),m.jsx("button",{type:"button",onClick:he=>{he.stopPropagation(),l(k.id)},className:"opacity-0 cursor-pointer group/trash group-hover:opacity-100 p-1 hover:bg-destructive/10 rounded transition-opacity",title:"Remove chat",children:m.jsx(Tf,{size:14,className:"text-muted-foreground group-hover/trash:text-destructive"})})]},k.id)})]},K.label)),e[0]=a,e[1]=l,e[2]=i,e[3]=o,e[4]=u,e[5]=s,e[6]=r,e[7]=f,e[8]=p,e[9]=h,e[10]=g,e[11]=_,e[12]=T,e[13]=E,e[14]=A,e[15]=b,e[16]=w,e[17]=R,e[18]=I}else f=e[7],p=e[8],h=e[9],g=e[10],_=e[11],T=e[12],E=e[13],A=e[14],b=e[15],w=e[16],R=e[17],I=e[18];let L;e[28]!==_||e[29]!==T?(L=m.jsx("div",{className:_,children:T}),e[28]=_,e[29]=T,e[30]=L):L=e[30];let M;e[31]!==f||e[32]!==L||e[33]!==E||e[34]!==A||e[35]!==b?(M=m.jsxs(f,{align:E,className:A,children:[b,L]}),e[31]=f,e[32]=L,e[33]=E,e[34]=A,e[35]=b,e[36]=M):M=e[36];let P;e[37]!==p||e[38]!==M||e[39]!==w||e[40]!==R||e[41]!==I?(P=m.jsxs(p,{onOpenChange:w,children:[R,I,M]}),e[37]=p,e[38]=M,e[39]=w,e[40]=R,e[41]=I,e[42]=P):P=e[42];let S;e[43]!==h||e[44]!==P?(S=m.jsx(h,{children:P}),e[43]=h,e[44]=P,e[45]=S):S=e[45];let B;return e[46]!==g||e[47]!==S?(B=m.jsx(g,{children:S}),e[46]=g,e[47]=S,e[48]=B):B=e[48],B}function cy(){const t=Q.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx("div",{className:"size-6 rounded-lg bg-muted animate-pulse"}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsxs("div",{className:"flex items-center gap-3",children:[e,m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsx("div",{className:"h-3.5 w-28 rounded bg-muted animate-pulse"}),m.jsx("div",{className:"h-3 w-40 rounded bg-muted/60 animate-pulse"})]})]}),t[1]=n):n=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx("div",{className:"flex items-center h-12 flex-none border-b border-border/80 px-4",children:m.jsxs("div",{className:"flex items-center justify-between gap-3 w-full",children:[n,m.jsxs("div",{className:"flex items-end gap-2",children:[m.jsx("div",{className:"h-6 w-6 rounded-full bg-muted animate-pulse"}),m.jsx("div",{className:"h-6 w-6 rounded-lg bg-muted animate-pulse"})]})]})}),t[2]=r):r=t[2];let s;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx("div",{className:"flex-1 overflow-hidden px-4 py-4",children:m.jsxs("div",{className:"mx-auto flex w-full max-w-2xl flex-col gap-4",children:[m.jsx(Cr,{align:"right",width:"w-3/4"}),m.jsx(Cr,{align:"left",width:"w-full",lines:3}),m.jsx(Cr,{align:"right",width:"w-2/3"}),m.jsx(Cr,{align:"left",width:"w-5/6",lines:2})]})}),t[3]=s):s=t[3];let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=m.jsx("div",{className:"relative flex flex-1 flex-col gap-2 p-2.5",children:m.jsx("div",{className:"relative flex-1",children:m.jsxs("div",{className:"space-y-2 p-2",children:[m.jsx("div",{className:"h-3 w-full rounded bg-muted/40 animate-pulse"}),m.jsx("div",{className:"h-3 w-4/5 rounded bg-muted/40 animate-pulse"})]})})}),t[4]=i):i=t[4];let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx("div",{className:"flex items-center gap-1",children:m.jsx("div",{className:"size-8 rounded-full bg-muted/60 animate-pulse"})}),t[5]=a):a=t[5];let u;return t[6]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsxs("div",{className:"flex h-full w-full flex-col bg-sidebar",children:[r,s,m.jsx("div",{className:"px-4 py-4",children:m.jsx("div",{className:"mx-auto w-full max-w-2xl",children:m.jsxs("div",{className:"relative flex min-h-[130px] flex-col rounded-xl border border-border bg-background shadow-sm",children:[i,m.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2.5",children:[a,m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("div",{className:"h-8 w-32 rounded-lg bg-muted/60 animate-pulse"}),m.jsx("div",{className:"size-8 rounded-full bg-muted animate-pulse"})]})]})]})})})]}),t[6]=u):u=t[6],u}function Cr(t){const e=Q.c(22),{align:n,width:r,lines:s}=t,i=r===void 0?"w-full":r,a=s===void 0?1:s,u=n==="right"?"flex-row-reverse":"flex-row";let l;e[0]!==u?(l=re("flex w-full gap-4 px-4 py-2",u),e[0]=u,e[1]=l):l=e[1];const o=n==="right"?"ml-auto max-w-3/4 items-end":"w-full items-start";let d;e[2]!==o?(d=re("flex min-w-0 flex-col gap-2",o),e[2]=o,e[3]=d):d=e[3];let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=m.jsx("div",{className:"h-3 w-16 rounded bg-muted/40 animate-pulse"}),e[4]=f):f=e[4];const p=n==="right"?"bg-muted":"bg-transparent border border-border/40";let h;e[5]!==p||e[6]!==i?(h=re("min-w-0 rounded-2xl p-4",p,i),e[5]=p,e[6]=i,e[7]=h):h=e[7];let g;e[8]!==a?(g=Array.from({length:a}),e[8]=a,e[9]=g):g=e[9];let _;e[10]!==a||e[11]!==g?(_=m.jsx("div",{className:"space-y-2",children:g.map((b,w)=>m.jsx("div",{className:re("h-3 rounded bg-muted-foreground/20 animate-pulse",w===a-1?"w-3/4":"w-full"),style:{animationDelay:`${w*.1}s`}},w))}),e[10]=a,e[11]=g,e[12]=_):_=e[12];let T;e[13]!==_||e[14]!==h?(T=m.jsx("div",{className:h,children:_}),e[13]=_,e[14]=h,e[15]=T):T=e[15];let E;e[16]!==T||e[17]!==d?(E=m.jsxs("div",{className:d,children:[f,T]}),e[16]=T,e[17]=d,e[18]=E):E=e[18];let A;return e[19]!==E||e[20]!==l?(A=m.jsx("div",{className:l,children:E}),e[19]=E,e[20]=l,e[21]=A):A=e[21],A}function dy({messageCount:t,sentinelRef:e}){const n=j.useRef(t),r=j.useRef(0);t>n.current&&r.current!==t&&queueMicrotask(()=>{e.current?.scrollIntoView({behavior:"smooth",block:"start"}),r.current=t}),n.current=t}function zu(t,e){const n=j.Children.toArray(t);for(const r of n)if(j.isValidElement(r)&&r.type===e)return r;return null}function fy(t){const e=Q.c(5),{className:n,children:r}=t;let s;e[0]!==n?(s=re("flex flex-col h-full w-full bg-sidebar transform-[translateZ(0)]",n),e[0]=n,e[1]=s):s=e[1];let i;return e[2]!==r||e[3]!==s?(i=m.jsx("div",{className:s,children:r}),e[2]=r,e[3]=s,e[4]=i):i=e[4],i}function hy(t){const e=Q.c(7),{children:n}=t;let r;e[0]!==n?(r=zu(n,id),e[0]=n,e[1]=r):r=e[1];const s=r;let i;e[2]!==n?(i=zu(n,ad),e[2]=n,e[3]=i):i=e[3];const a=i;let u;return e[4]!==s||e[5]!==a?(u=m.jsxs("div",{className:"flex h-12 items-center justify-between gap-4 border-b border-border px-4 flex-none",children:[s,a]}),e[4]=s,e[5]=a,e[6]=u):u=e[6],u}function id(t){const e=Q.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-2 overflow-hidden",children:n}),e[0]=n,e[1]=r):r=e[1],r}function ad(t){const e=Q.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx("div",{className:"flex flex-none items-center gap-1",children:n}),e[0]=n,e[1]=r):r=e[1],r}function py(t){const e=Q.c(5),{children:n,className:r}=t;let s;e[0]!==r?(s=re("flex-1 min-h-0 overflow-y-auto",r),e[0]=r,e[1]=s):s=e[1];let i;return e[2]!==n||e[3]!==s?(i=m.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=i):i=e[4],i}function my(t){const e=Q.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx("div",{className:"h-full w-full flex items-center justify-center max-w-2xl mx-auto",children:n}),e[0]=n,e[1]=r):r=e[1],r}function gy(t){const e=Q.c(12),{minHeightOffset:n}=t,r=n===void 0?240:n,{messages:s,chatStatus:i}=An(),a=j.useRef(null);let u;e[0]!==s.length?(u={messageCount:s.length,sentinelRef:a},e[0]=s.length,e[1]=u):u=e[1],dy(u);let l;if(e[2]!==s||e[3]!==i){let f;e[5]!==s.length||e[6]!==i?(f=(p,h)=>p.role==="user"?m.jsx(iy,{message:p},p.id):p.role==="assistant"?m.jsx(Q_,{message:p,status:h===s.length-1?i:void 0},p.id):null,e[5]=s.length,e[6]=i,e[7]=f):f=e[7],l=s.map(f),e[2]=s,e[3]=i,e[4]=l}else l=e[4];let o;e[8]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx(sd,{children:m.jsx("div",{ref:a,className:"h-0"})}),e[8]=o):o=e[8];let d;return e[9]!==r||e[10]!==l?(d=m.jsxs(J_,{minHeightOffset:r,children:[l,o]}),e[9]=r,e[10]=l,e[11]=d):d=e[11],d}function by(t){const e=Q.c(5),{children:n,className:r}=t;let s;e[0]!==r?(s=re("flex-none w-full mx-auto p-2","max-w-2xl min-w-0",r),e[0]=r,e[1]=s):s=e[1];let i;return e[2]!==n||e[3]!==s?(i=m.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=i):i=e[4],i}function Ls(t){const e=Q.c(24),{title:n,description:r,icon:s,variant:i,onDismiss:a,children:u}=t,l=i===void 0?"default":i;let o,d,f,p,h;if(e[0]!==u||e[1]!==r||e[2]!==s||e[3]!==n||e[4]!==l){const b={default:{container:"border-muted-foreground/30 bg-muted/50 hover:bg-muted transition-colors",icon:"text-muted-foreground",title:"text-muted-foreground",description:"text-muted-foreground/70"},danger:{container:"border-destructive/30 bg-destructive/5",icon:"text-destructive",title:"text-destructive font-medium",description:"text-muted-foreground"},warning:{container:"border-amber-500/30 bg-amber-500/5",icon:"text-amber-600 dark:text-amber-500",title:"text-amber-600 dark:text-amber-500 font-medium",description:"text-muted-foreground"}}[l];p=re("flex items-start gap-2 px-3 py-2.5 rounded-lg border border-dashed text-sm w-full",b.container),h=s&&m.jsx("div",{className:re("mt-0.5 shrink-0",b.icon),children:s}),o="flex-1 min-w-0",d=n&&m.jsx("div",{className:re("text-xs mb-1",b.title),children:n}),f=r&&m.jsx("div",{className:re("text-xs line-clamp-2",b.description,u?"mb-2":""),children:r}),e[0]=u,e[1]=r,e[2]=s,e[3]=n,e[4]=l,e[5]=o,e[6]=d,e[7]=f,e[8]=p,e[9]=h}else o=e[5],d=e[6],f=e[7],p=e[8],h=e[9];let g;e[10]!==u?(g=u&&m.jsx("div",{className:"flex gap-2",children:u}),e[10]=u,e[11]=g):g=e[11];let _;e[12]!==o||e[13]!==d||e[14]!==f||e[15]!==g?(_=m.jsxs("div",{className:o,children:[d,f,g]}),e[12]=o,e[13]=d,e[14]=f,e[15]=g,e[16]=_):_=e[16];let T;e[17]!==a?(T=a&&m.jsx("button",{type:"button",onClick:a,className:"text-muted-foreground hover:text-foreground transition-colors shrink-0",title:"Dismiss",children:m.jsx(Nd,{size:14})}),e[17]=a,e[18]=T):T=e[18];let E;return e[19]!==p||e[20]!==h||e[21]!==_||e[22]!==T?(E=m.jsxs("div",{className:p,children:[h,_,T]}),e[19]=p,e[20]=h,e[21]=_,e[22]=T,e[23]=E):E=e[23],E}const aA=Object.assign(fy,{Header:Object.assign(hy,{Left:id,Right:ad}),Main:py,Messages:gy,EmptyState:my,Footer:by,Input:V0,Provider:M0,Skeleton:cy,IceBreakers:ap,NoLlmBindingEmptyState:ay,ThreadHistoryPopover:ly});export{aA as C,g0 as G,L0 as M,B_ as R,$e as S,sA as T,qo as a,uo as b,rA as c,iA as d,eo as i,An as u};