@decocms/mesh 1.1.0 → 1.1.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 (105) hide show
  1. package/dist/client/assets/{AlertCircle-CRDUE68O.js → AlertCircle-Chhij1Oy.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-Iy4pjcqu.js → ArrowLeft-D6tnGfBt.js} +1 -1
  3. package/dist/client/assets/{ChevronDown-Dj0YzNJ5.js → ChevronDown-CgQNiJkO.js} +1 -1
  4. package/dist/client/assets/{Clock-BGo4abZy.js → Clock-DCYkShqR.js} +1 -1
  5. package/dist/client/assets/{Code01-C2mtSXCH.js → Code01-C94CaYep.js} +1 -1
  6. package/dist/client/assets/{Copy01-08G580G9.js → Copy01-D_Mdx0Pg.js} +1 -1
  7. package/dist/client/assets/{CpuChip02-vo-KC-ou.js → CpuChip02-CPlOIGho.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-CDfNa7KY.js → DotsVertical-Cno9u2p2.js} +1 -1
  9. package/dist/client/assets/{File06-BwkobN1x.js → File06-Aynv5CgR.js} +1 -1
  10. package/dist/client/assets/{GitBranch01-Dus6D2gU.js → GitBranch01-ry350bue.js} +1 -1
  11. package/dist/client/assets/{Inbox01-DrIFHYCY.js → Inbox01-CVa4M8_i.js} +1 -1
  12. package/dist/client/assets/{InfoCircle-B76kcv1L.js → InfoCircle-Bdc1UZh_.js} +1 -1
  13. package/dist/client/assets/{Key01-RxQv3BJR.js → Key01-hqP79at_.js} +1 -1
  14. package/dist/client/assets/{LinkExternal01-BdHgX43H.js → LinkExternal01-DnJp4-3N.js} +1 -1
  15. package/dist/client/assets/{Loading01-BtznjYdD.js → Loading01-ijJ9WBV1.js} +1 -1
  16. package/dist/client/assets/{Lock01-DGk0NR9v.js → Lock01-Dh0vU2Wh.js} +1 -1
  17. package/dist/client/assets/{Play-D_dkbQEF.js → Play-BhKKPmQz.js} +1 -1
  18. package/dist/client/assets/{Plus-Cmmt6kdX.js → Plus-Bx5vW5Pw.js} +1 -1
  19. package/dist/client/assets/{SearchMd-Csv5Q_gT.js → SearchMd-6q3Womqs.js} +1 -1
  20. package/dist/client/assets/{Terminal-mFLPBz-Y.js → Terminal-CScId5Gm.js} +1 -1
  21. package/dist/client/assets/{Trash01-ZjdY9Thx.js → Trash01-Dpne-hH8.js} +1 -1
  22. package/dist/client/assets/{Upload01-BL_smb86.js → Upload01-DiOTIeUO.js} +1 -1
  23. package/dist/client/assets/{X-DBHfQHAW.js → X-o0W9skNS.js} +1 -1
  24. package/dist/client/assets/{XClose-BjfF1u26.js → XClose-Hf5x2fDm.js} +1 -1
  25. package/dist/client/assets/{alert-dialog-CLKrwazh.js → alert-dialog-lIrOrUAe.js} +1 -1
  26. package/dist/client/assets/{auth-xselgzK2.js → auth-CX8buOs4.js} +1 -1
  27. package/dist/client/assets/{auth-catchall-L5hNy_48.js → auth-catchall-BkwZtj8t.js} +1 -1
  28. package/dist/client/assets/{avatar-D3l3SwY5.js → avatar-DYWiwzHT.js} +1 -1
  29. package/dist/client/assets/{badge-6daA1Xk-.js → badge-DadBZYFc.js} +1 -1
  30. package/dist/client/assets/{button-CFHFP204.js → button-Cr6E3Zah.js} +1 -1
  31. package/dist/client/assets/{card-DhbXb2hL.js → card-C2NrvtqW.js} +1 -1
  32. package/dist/client/assets/{checkbox-BUzjaLuN.js → checkbox-CzTPuzXG.js} +1 -1
  33. package/dist/client/assets/{collection-detail-D-1rhDCF.js → collection-detail-Cw-0Ldlz.js} +46 -46
  34. package/dist/client/assets/{collection-display-button-s533wXMW.js → collection-display-button-B7qSJRi3.js} +1 -1
  35. package/dist/client/assets/{collection-header-BTy0NEKS.js → collection-header-B_d7_qHc.js} +1 -1
  36. package/dist/client/assets/{collection-page-CVrAS9E8.js → collection-page-DABLhXqe.js} +1 -1
  37. package/dist/client/assets/{collection-search-CF2FAa9j.js → collection-search-r3DNZn4l.js} +1 -1
  38. package/dist/client/assets/{collection-table-wrapper-CIM6pfWy.js → collection-table-wrapper-DFQTmAIE.js} +1 -1
  39. package/dist/client/assets/{connection-card-CoYgiSAy.js → connection-card-BXlOCQh2.js} +1 -1
  40. package/dist/client/assets/{connection-detail-D9Nx3j__.js → connection-detail-Co23Kme7.js} +1 -1
  41. package/dist/client/assets/{connections-DwXpLEQ7.js → connections-DYkeAsVf.js} +1 -1
  42. package/dist/client/assets/{core-UzwkWBsa.js → core-D4OhC65v.js} +1 -1
  43. package/dist/client/assets/{create-organization-dialog-DPCOgwS8.js → create-organization-dialog-nBQd-tjn.js} +1 -1
  44. package/dist/client/assets/{dialog-DDJjJiXv.js → dialog-BwdAucXJ.js} +1 -1
  45. package/dist/client/assets/{dropdown-menu-BVDy9llW.js → dropdown-menu-DRM8ajGJ.js} +1 -1
  46. package/dist/client/assets/{env-vars-editor-CSYlB5et.js → env-vars-editor-C11wezQg.js} +1 -1
  47. package/dist/client/assets/{error-boundary-BxGgxrSw.js → error-boundary-BxBuLeJo.js} +1 -1
  48. package/dist/client/assets/{extract-connection-data-DYIo3urs.js → extract-connection-data-C_UXf1JR.js} +1 -1
  49. package/dist/client/assets/{form-O3ENwuWy.js → form-0XqB8VkL.js} +1 -1
  50. package/dist/client/assets/{formatDistanceToNow-DbTeYEPs.js → formatDistanceToNow-DDVdovHq.js} +1 -1
  51. package/dist/client/assets/{gateway-detail-4NLA7mwB.js → gateway-detail-DelDQ-Rq.js} +1 -1
  52. package/dist/client/assets/{gateways-Chp0OiTi.js → gateways-fhY3rI63.js} +1 -1
  53. package/dist/client/assets/{home-C7yAtry6.js → home-DhfzoKnv.js} +1 -1
  54. package/dist/client/assets/{index-CiPLnea-.js → index-BAX9m6md.js} +2 -2
  55. package/dist/client/assets/{index-DIWvfi3d.js → index-Di9rheM6.js} +1 -1
  56. package/dist/client/assets/{index-B9tJom0a.js → index-OQXTfZYS.js} +1 -1
  57. package/dist/client/assets/{index-C6fnPeNc.js → index-lbScTdWB.js} +1 -1
  58. package/dist/client/assets/{index-BFYCiRaa.css → index-rESQzSL0.css} +1 -1
  59. package/dist/client/assets/{input-iugRl47V.js → input-BJZKhFPd.js} +1 -1
  60. package/dist/client/assets/json-CFlNQcLh.js +1 -0
  61. package/dist/client/assets/{json-syntax-highlighter-o9Q8Bpjl.js → json-syntax-highlighter-nU-euVt8.js} +2 -2
  62. package/dist/client/assets/{layout-pV-LEIdm.js → layout-CH_UUP18.js} +1 -1
  63. package/dist/client/assets/{lazy-highlighter-Czs-NOYe.js → lazy-highlighter-CKbv8kMY.js} +1 -1
  64. package/dist/client/assets/{localstorage-keys-0rhjy_fp.js → localstorage-keys-CH6-Ca8T.js} +1 -1
  65. package/dist/client/assets/{login-CwJiA9wL.js → login-D-0oUGsc.js} +1 -1
  66. package/dist/client/assets/{mcp-oauth-BKyHMwxJ.js → mcp-oauth-Dfazq7Kn.js} +1 -1
  67. package/dist/client/assets/{members-tsvd98Wp.js → members-Bvg9zof-.js} +1 -1
  68. package/dist/client/assets/{monitoring-DqS96I2Z.js → monitoring-DTZjVL1E.js} +1 -1
  69. package/dist/client/assets/{oauth-callback-DrBJtf1G.js → oauth-callback-6FTqNUKF.js} +1 -1
  70. package/dist/client/assets/{page-CIddjpQi.js → page-DNSGoiXc.js} +1 -1
  71. package/dist/client/assets/{popover-B_NyiW1Q.js → popover-DXIVGBua.js} +1 -1
  72. package/dist/client/assets/prism-light-DCXldjmj.js +1 -0
  73. package/dist/client/assets/{resizable-DR6TRvc0.js → resizable-CgllqzTc.js} +3 -3
  74. package/dist/client/assets/{resource-tabs-tnRJokpH.js → resource-tabs-BygE97ua.js} +1 -1
  75. package/dist/client/assets/{select-DfammiWD.js → select-ykoytU3x.js} +1 -1
  76. package/dist/client/assets/{settings-eYWaSfqs.js → settings-CxGxapUp.js} +1 -1
  77. package/dist/client/assets/{shell-layout-CuchTujm.js → shell-layout-BIudK5Ys.js} +1 -1
  78. package/dist/client/assets/{spinner-D4EsgSmE.js → spinner-BD7dyC65.js} +1 -1
  79. package/dist/client/assets/{store-BbbKGxbw.js → store-CeL_Jp7-.js} +1 -1
  80. package/dist/client/assets/{store-app-detail-N830c_Ks.js → store-app-detail-DXVTQgPU.js} +1 -1
  81. package/dist/client/assets/{switch-BXWlo3EE.js → switch-DRJZ0tTj.js} +1 -1
  82. package/dist/client/assets/{textarea-D1hQDzao.js → textarea-DCD8uj7C.js} +1 -1
  83. package/dist/client/assets/{tools-list-Bwj-fDqE.js → tools-list-CIaSVZ31.js} +1 -1
  84. package/dist/client/assets/{tooltip-BsevTbJB.js → tooltip-ft1RTR-v.js} +1 -1
  85. package/dist/client/assets/{types-j-TFLOzi.js → types-BV5sQ6JF.js} +1 -1
  86. package/dist/client/assets/{use-binding-CXIqq1bv.js → use-binding-D3xBye9L.js} +2 -2
  87. package/dist/client/assets/{use-connection-jCRGwpV6.js → use-connection-C7xrQrun.js} +1 -1
  88. package/dist/client/assets/{use-connection-resources-DJbpQoWM.js → use-connection-resources-Bqlxdfto.js} +1 -1
  89. package/dist/client/assets/{use-gateway-J9ygFzp4.js → use-gateway-CFo4NnYE.js} +1 -1
  90. package/dist/client/assets/{use-list-state-BGC5b0Pz.js → use-list-state-C_2Sj-cw.js} +1 -1
  91. package/dist/client/assets/{use-mcp-xRGeWjGX.js → use-mcp-nC4pIWOp.js} +1 -1
  92. package/dist/client/assets/{use-members-D3_MeK6r.js → use-members-CnIFz8X5.js} +1 -1
  93. package/dist/client/assets/{use-mobile-zZh9WHEY.js → use-mobile-iQFQFevV.js} +1 -1
  94. package/dist/client/assets/{use-organization-settings-_KK3dEko.js → use-organization-settings-CNoBVLFc.js} +1 -1
  95. package/dist/client/assets/{use-tool-call-Bukcla53.js → use-tool-call-DfCZUQ8y.js} +1 -1
  96. package/dist/client/assets/useQuery-DJsYPxOW.js +1 -0
  97. package/dist/client/assets/{useSuspenseInfiniteQuery-Cdb8QUCh.js → useSuspenseInfiniteQuery-CNo9dG89.js} +1 -1
  98. package/dist/client/assets/{view-mode-toggle-CCJ4Oh3w.js → view-mode-toggle-CLU-iE2c.js} +1 -1
  99. package/dist/client/index.html +2 -2
  100. package/dist/server/cli.js +41 -41
  101. package/dist/server/server.js +43 -43
  102. package/package.json +1 -1
  103. package/dist/client/assets/json-BJR-gxzf.js +0 -1
  104. package/dist/client/assets/prism-light-CEisnFKn.js +0 -1
  105. package/dist/client/assets/useQuery-DDngHzZ8.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lazy-highlighter-Czs-NOYe.js","assets/index-CiPLnea-.js","assets/index-BFYCiRaa.css","assets/core-UzwkWBsa.js","assets/json-BESjz4hO.js"])))=>i.map(i=>d[i]);
2
- import{r as v,c as K,e as co,K as Ge,q as ka,aF as Ud,aG as zd,aH as Qe,w as W,aI as jr,aJ as fo,aK as jd,aL as $d,aM as Yd,Y as $e,X as ir,W as pr,v as ke,aN as ne,aO as It,aP as qd,aQ as Ne,_ as Vd,a3 as Sa,j as m,ax as Wd,f as Gd,t as Ci,aR as kn,a0 as ho,a6 as Qd}from"./index-CiPLnea-.js";import{E as Xd,u as Zd}from"./use-binding-CXIqq1bv.js";import{u as Mt,i as Kt,c as Ia,b as Na,T as wa}from"./tooltip-BsevTbJB.js";import{u as Gt,c as ce,B as Bt}from"./button-CFHFP204.js";import{i as Ra}from"./CpuChip02-vo-KC-ou.js";import{i as po}from"./SearchMd-Csv5Q_gT.js";import{b as Kd,I as mo,U as Jd,e as ef,c as tf,u as nf}from"./use-connection-jCRGwpV6.js";import{u as rf}from"./use-gateway-J9ygFzp4.js";import{i as af}from"./X-DBHfQHAW.js";import{j as sf,i as go,c as uf}from"./dropdown-menu-BVDy9llW.js";import{T as of}from"./textarea-D1hQDzao.js";import{u as lf,L as cf}from"./localstorage-keys-0rhjy_fp.js";import{a as ti}from"./Copy01-08G580G9.js";import{i as df}from"./AlertCircle-CRDUE68O.js";import{i as ff}from"./Terminal-mFLPBz-Y.js";import{C as hf}from"./connection-card-CoYgiSAy.js";import{n as pf}from"./LinkExternal01-BdHgX43H.js";import{J as Dr}from"./json-syntax-highlighter-o9Q8Bpjl.js";import{b as mf,c as gf,d as bf,A as Ef,a as Tf,e as xf,g as _f,f as yf}from"./alert-dialog-CLKrwazh.js";import{b as Af,a as Cf,c as kf,S as Sf}from"./select-DfammiWD.js";import{u as If}from"./use-mobile-zZh9WHEY.js";import{i as Nf}from"./File06-BwkobN1x.js";import{i as wf}from"./InfoCircle-B76kcv1L.js";const bo=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"M15.938 15.938A7.001 7.001 0 0 0 15 2a7.001 7.001 0 0 0-6.938 6.062M16 15a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));bo.displayName="Coins01";const Eo=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"M9 14 4 9m0 0 5-5M4 9h6.4c3.36 0 5.04 0 6.324.654a6 6 0 0 1 2.622 2.622C20 13.56 20 15.24 20 18.6V20"}));Eo.displayName="CornerUpLeft";const To=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"M6 16a4 4 0 0 0 4 4h4a4 4 0 0 0 0-8h-4a4 4 0 0 1 0-8h4a4 4 0 0 1 4 4m-6-6v20"}));To.displayName="CurrencyDollar";const xo=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"M12 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm7-14a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM5 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"}));xo.displayName="DotsGrid";const _o=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"m18 10-4-4M2.5 21.5l3.384-.376c.414-.046.62-.069.814-.131a2 2 0 0 0 .485-.234c.17-.111.317-.259.61-.553L21 7a2.828 2.828 0 1 0-4-4L3.794 16.206c-.294.294-.442.442-.553.611a2 2 0 0 0-.234.485c-.062.193-.085.4-.131.814L2.5 21.5Z"}));_o.displayName="Edit02";const yo=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"M16.2 21H6.931c-.605 0-.908 0-1.049-.12a.5.5 0 0 1-.173-.42c.014-.183.228-.397.657-.826l8.503-8.503c.396-.396.594-.594.822-.668a1 1 0 0 1 .618 0c.228.074.426.272.822.668L21 15v1.2M16.2 21c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C21 18.72 21 17.88 21 16.2M16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4M10.5 8.5a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z"}));yo.displayName="Image01";const Ao=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"M15 16.5V19c0 .932 0 1.398-.152 1.765a2 2 0 0 1-1.083 1.083C13.398 22 12.932 22 12 22c-.932 0-1.398 0-1.765-.152a2 2 0 0 1-1.083-1.083C9 20.398 9 19.932 9 19v-2.5m6 0c2.649-1.157 4.5-3.925 4.5-7a7.5 7.5 0 0 0-15 0c0 3.075 1.851 5.843 4.5 7m6 0H9"}));Ao.displayName="Lightbulb01";const Co=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"m18 8 4 4m0 0-4 4m4-4H9m6-7.796A8.383 8.383 0 0 0 10.667 3C5.88 3 2 7.03 2 12s3.88 9 8.667 9A8.384 8.384 0 0 0 15 19.796"}));Co.displayName="LogOut04";const ko=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"m10 15-3.075 3.114c-.43.434-.644.651-.828.666a.5.5 0 0 1-.421-.172c-.12-.14-.12-.446-.12-1.056v-1.56c0-.548-.449-.944-.99-1.024v0a3 3 0 0 1-2.534-2.533C2 12.219 2 11.96 2 11.445V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C4.28 2 5.12 2 6.8 2h7.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C19 4.28 19 5.12 19 6.8V11m0 11-2.176-1.513c-.306-.213-.46-.32-.626-.395a2.002 2.002 0 0 0-.462-.145c-.18-.033-.367-.033-.74-.033H13.2c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874C10 18.394 10 17.834 10 16.714V14.2c0-1.12 0-1.68.218-2.108a2 2 0 0 1 .874-.874C11.52 11 12.08 11 13.2 11h5.6c1.12 0 1.68 0 2.108.218a2 2 0 0 1 .874.874C22 12.52 22 13.08 22 14.2v2.714c0 .932 0 1.398-.152 1.766a2 2 0 0 1-1.083 1.082c-.367.152-.833.152-1.765.152V22Z"}));ko.displayName="MessageChatSquare";const ni=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"m6.5 13 .784 1.569c.266.53.399.796.576 1.026a3 3 0 0 0 .545.545c.23.177.495.31 1.026.575L11 17.5l-1.569.785c-.53.265-.796.398-1.026.575a3 3 0 0 0-.545.545c-.177.23-.31.495-.576 1.026L6.5 22l-.784-1.569c-.266-.53-.399-.796-.576-1.026a3 3 0 0 0-.545-.545c-.23-.177-.495-.31-1.026-.575L2 17.5l1.569-.785c.53-.265.796-.398 1.026-.575a3 3 0 0 0 .545-.545c.177-.23.31-.495.576-1.026L6.5 13ZM15 2l1.179 3.064c.282.734.423 1.1.642 1.409a3 3 0 0 0 .706.706c.309.22.675.36 1.409.642L22 9l-3.064 1.179c-.734.282-1.1.423-1.409.642a3 3 0 0 0-.706.706c-.22.309-.36.675-.642 1.409L15 16l-1.179-3.064c-.282-.734-.423-1.1-.642-1.409a3 3 0 0 0-.706-.706c-.309-.22-.675-.36-1.409-.642L8 9l3.064-1.179c.734-.282 1.1-.423 1.409-.642a3 3 0 0 0 .706-.706c.22-.309.36-.675.642-1.409L15 2Z"}));ni.displayName="Stars01";const So=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"}));So.displayName="Stop";const Io=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"M16 8V5l3-3 1 2 2 1-3 3h-3Zm0 0-4 4m10 0c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2m5 10a5 5 0 1 1-5-5"}));Io.displayName="Target04";var ar;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const a={};for(const s of i)a[s]=s;return a},t.getValidEnumValues=i=>{const a=t.objectKeys(i).filter(u=>typeof i[i[u]]!="number"),s={};for(const u of a)s[u]=i[u];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(a){return i[a]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&a.push(s);return a},t.find=(i,a)=>{for(const s of i)if(a(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,a=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(a)}t.joinValues=r,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(ar||(ar={}));var gs;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(gs||(gs={}));ar.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);ar.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class $r extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(a){return a.message},r={_errors:[]},i=a=>{for(const s of a.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let u=r,o=0;for(;o<s.path.length;){const l=s.path[o];o===s.path.length-1?(u[l]=u[l]||{_errors:[]},u[l]._errors.push(n(s))):u[l]=u[l]||{_errors:[]},u=u[l],o++}}};return i(this),r}static assert(e){if(!(e instanceof $r))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ar.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n=Object.create(null),r=[];for(const i of this.issues)if(i.path.length>0){const a=i.path[0];n[a]=n[a]||[],n[a].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}$r.create=t=>new $r(t);var bs;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(bs||(bs={}));var ae;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ae||(ae={}));function Jt(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}function Rf(t,e){let n;const r=()=>{if(n)return n;const i=indexedDB.open(t);return i.onupgradeneeded=()=>i.result.createObjectStore(e),n=Jt(i),n.then(a=>{a.onclose=()=>n=void 0},()=>{}),n};return(i,a)=>r().then(s=>a(s.transaction(e,i).objectStore(e)))}let ki;function ri(){return ki||(ki=Rf("keyval-store","keyval")),ki}function La(t,e=ri()){return e("readonly",n=>Jt(n.get(t)))}function Gn(t,e,n=ri()){return n("readwrite",r=>(r.put(e,t),Jt(r.transaction)))}function No(t,e=ri()){return e("readwrite",n=>(n.delete(t),Jt(n.transaction)))}function Lf(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},Jt(t.transaction)}function wo(t=ri()){return t("readonly",e=>{if(e.getAll&&e.getAllKeys)return Promise.all([Jt(e.getAllKeys()),Jt(e.getAll())]).then(([r,i])=>r.map((a,s)=>[a,i[s]]));const n=[];return t("readonly",r=>Lf(r,i=>n.push([i.key,i.value])).then(()=>n))})}async function Of(t,e){const n=`${t}:threads:${e}`;return await La(n)??null}async function vf(t){const e=`${t}:threads:`;return(await wo()).filter(([i])=>typeof i=="string"&&i.startsWith(e)).map(([,i])=>i).filter(i=>!i.hidden).sort((i,a)=>String(a.updated_at).localeCompare(String(i.updated_at)))}function Ro(t,e){const n=`${t}:messages:`;return wo().then(r=>r.filter(([a])=>typeof a=="string"&&a.startsWith(n)).map(([,a])=>a).filter(a=>a.metadata?.thread_id===e||a.threadId===e).sort((a,s)=>{const u=a.metadata?.created_at||a.createdAt||"",o=s.metadata?.created_at||s.createdAt||"";return String(u).localeCompare(String(o))}))}function Zy(){const t=K.c(12),{locator:e}=Mt();let n;t[0]!==e?(n=Ge.threads(e),t[0]=e,t[1]=n):n=t[1];let r;t[2]!==e?(r=()=>vf(e),t[2]=e,t[3]=r):r=t[3];let i;t[4]!==n||t[5]!==r?(i={queryKey:n,queryFn:r,staleTime:3e4},t[4]=n,t[5]=r,t[6]=i):i=t[6];const{data:a,refetch:s}=ka(i);let u;t[7]!==a?(u=a??[],t[7]=a,t[8]=u):u=t[8];let o;return t[9]!==s||t[10]!==u?(o={threads:u,refetch:s},t[9]=s,t[10]=u,t[11]=o):o=t[11],o}function Df(t){const e=K.c(11),{locator:n}=Mt();let r;e[0]!==n||e[1]!==t?(r=Ge.threadMessages(n,t),e[0]=n,e[1]=t,e[2]=r):r=e[2];let i;e[3]!==n||e[4]!==t?(i=()=>Ro(n,t),e[3]=n,e[4]=t,e[5]=i):i=e[5];let a;e[6]!==r||e[7]!==i?(a={queryKey:r,queryFn:i,staleTime:3e4},e[6]=r,e[7]=i,e[8]=a):a=e[8];const{data:s}=ka(a);let u;return e[9]!==s?(u=s??[],e[9]=s,e[10]=u):u=e[10],u}function Oa(){const t=K.c(28),{locator:e}=Mt(),n=co();let r;t[0]!==e?(r=async _=>{const b=`${e}:threads:${_.id}`;return await Gn(b,_),_},t[0]=e,t[1]=r):r=t[1];let i;t[2]!==e||t[3]!==n?(i=()=>{n.invalidateQueries({queryKey:Ge.threads(e)})},t[2]=e,t[3]=n,t[4]=i):i=t[4];let a;t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7];const s=Gt(a);let u;t[8]!==e?(u=async _=>{const{id:b,updates:k}=_,E=`${e}:threads:${b}`,w=await La(E);if(!w)throw new Error(`Thread ${b} not found`);const R={...w,...k};return await Gn(E,R),R},t[8]=e,t[9]=u):u=t[9];let o;t[10]!==e||t[11]!==n?(o=_=>{n.invalidateQueries({queryKey:Ge.threads(e)}),n.invalidateQueries({queryKey:Ge.thread(e,_.id)})},t[10]=e,t[11]=n,t[12]=o):o=t[12];let l;t[13]!==u||t[14]!==o?(l={mutationFn:u,onSuccess:o},t[13]=u,t[14]=o,t[15]=l):l=t[15];const f=Gt(l);let d;t[16]!==e?(d=async _=>{const b=`${e}:threads:${_}`;return await No(b),_},t[16]=e,t[17]=d):d=t[17];let h;t[18]!==e||t[19]!==n?(h=()=>{n.invalidateQueries({queryKey:Ge.threads(e)})},t[18]=e,t[19]=n,t[20]=h):h=t[20];let p;t[21]!==d||t[22]!==h?(p={mutationFn:d,onSuccess:h},t[21]=d,t[22]=h,t[23]=p):p=t[23];const g=Gt(p);let x;return t[24]!==g||t[25]!==s||t[26]!==f?(x={insert:s,update:f,delete:g},t[24]=g,t[25]=s,t[26]=f,t[27]=x):x=t[27],x}function Lo(){const t=K.c(37),{locator:e}=Mt(),n=co();let r;t[0]!==e?(r=async w=>{const R=`${e}:messages:${w.id}`;return await Gn(R,w),w},t[0]=e,t[1]=r):r=t[1];let i;t[2]!==e||t[3]!==n?(i=w=>{const R=w.metadata?.thread_id||w.threadId;R&&n.invalidateQueries({queryKey:Ge.threadMessages(e,R)}),n.invalidateQueries({queryKey:Ge.messages(e)})},t[2]=e,t[3]=n,t[4]=i):i=t[4];let a;t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7];const s=Gt(a);let u;t[8]!==e?(u=async w=>(await Promise.all(w.map(R=>{const S=`${e}:messages:${R.id}`;return Gn(S,R)})),w),t[8]=e,t[9]=u):u=t[9];let o;t[10]!==e||t[11]!==n?(o=w=>{const R=new Set;for(const S of w){const O=S.metadata?.thread_id||S.threadId;O&&R.add(O)}for(const S of R)n.invalidateQueries({queryKey:Ge.threadMessages(e,S)});n.invalidateQueries({queryKey:Ge.messages(e)})},t[10]=e,t[11]=n,t[12]=o):o=t[12];let l;t[13]!==u||t[14]!==o?(l={mutationFn:u,onSuccess:o},t[13]=u,t[14]=o,t[15]=l):l=t[15];const f=Gt(l);let d;t[16]!==e?(d=async w=>{const{id:R,updates:S}=w,O=`${e}:messages:${R}`,F=await La(O);if(!F)throw new Error(`Message ${R} not found`);const j={...F,...S};return await Gn(O,j),j},t[16]=e,t[17]=d):d=t[17];let h;t[18]!==e||t[19]!==n?(h=w=>{const R=w.metadata?.thread_id||w.threadId;R&&n.invalidateQueries({queryKey:Ge.threadMessages(e,R)}),n.invalidateQueries({queryKey:Ge.messages(e)})},t[18]=e,t[19]=n,t[20]=h):h=t[20];let p;t[21]!==d||t[22]!==h?(p={mutationFn:d,onSuccess:h},t[21]=d,t[22]=h,t[23]=p):p=t[23];const g=Gt(p);let x;t[24]!==e?(x=async w=>{const R=`${e}:messages:${w}`;return await No(R),w},t[24]=e,t[25]=x):x=t[25];let _;t[26]!==e||t[27]!==n?(_=()=>{n.invalidateQueries({queryKey:Ge.messages(e)})},t[26]=e,t[27]=n,t[28]=_):_=t[28];let b;t[29]!==_||t[30]!==x?(b={mutationFn:x,onSuccess:_},t[29]=_,t[30]=x,t[31]=b):b=t[31];const k=Gt(b);let E;return t[32]!==k||t[33]!==s||t[34]!==f||t[35]!==g?(E={insert:s,insertMany:f,update:g,delete:k},t[32]=k,t[33]=s,t[34]=f,t[35]=g,t[36]=E):E=t[36],E}async function Pf(t){const e=`/mcp/gateway/${t}`,n={"Content-Type":"application/json",Accept:"application/json, text/event-stream"};try{const r=await fetch(e,{method:"POST",headers:n,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"mesh-chat",version:"1.0.0"}}})});if(!r.ok)return[];if((await r.json()).error)return[];const a=await fetch(e,{method:"POST",headers:n,body:JSON.stringify({jsonrpc:"2.0",id:2,method:"prompts/list",params:{}})});if(!a.ok)return[];const s=await a.json();return s.error?[]:s.result?.prompts||[]}catch{return[]}}function Ky(t){const e=K.c(7);let n;e[0]!==t?(n=Ge.gatewayPrompts(t),e[0]=t,e[1]=n):n=e[1];let r;e[2]!==t?(r=()=>Pf(t),e[2]=t,e[3]=r):r=e[3];let i;return e[4]!==n||e[5]!==r?(i={queryKey:n,queryFn:r,staleTime:6e4,retry:!1},e[4]=n,e[5]=r,e[6]=i):i=e[6],ka(i)}var Oo="vercel.ai.error",Mf=Symbol.for(Oo),Es,Ts,Pt=class vo extends(Ts=Error,Es=Mf,Ts){constructor({name:e,message:n,cause:r}){super(n),this[Es]=!0,this.name=e,this.cause=r}static isInstance(e){return vo.hasMarker(e,Oo)}static hasMarker(e,n){const r=Symbol.for(n);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function Do(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Po="AI_InvalidArgumentError",Mo=`vercel.ai.error.${Po}`,Bf=Symbol.for(Mo),xs,_s,Ff=class extends(_s=Pt,xs=Bf,_s){constructor({message:t,cause:e,argument:n}){super({name:Po,message:t,cause:e}),this[xs]=!0,this.argument=n}static isInstance(t){return Pt.hasMarker(t,Mo)}},Bo="AI_JSONParseError",Fo=`vercel.ai.error.${Bo}`,Hf=Symbol.for(Fo),ys,As,Cs=class extends(As=Pt,ys=Hf,As){constructor({text:t,cause:e}){super({name:Bo,message:`JSON parsing failed: Text: ${t}.
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lazy-highlighter-CKbv8kMY.js","assets/index-BAX9m6md.js","assets/index-rESQzSL0.css","assets/core-D4OhC65v.js","assets/json-BESjz4hO.js"])))=>i.map(i=>d[i]);
2
+ import{r as v,c as K,e as co,K as Ge,q as ka,aF as Ud,aG as zd,aH as Qe,w as W,aI as jr,aJ as fo,aK as jd,aL as $d,aM as Yd,Y as $e,X as ir,W as pr,v as ke,aN as ne,aO as It,aP as qd,aQ as Ne,_ as Vd,a3 as Sa,j as m,ax as Wd,f as Gd,t as Ci,aR as kn,a0 as ho,a6 as Qd}from"./index-BAX9m6md.js";import{E as Xd,u as Zd}from"./use-binding-D3xBye9L.js";import{u as Mt,i as Kt,c as Ia,b as Na,T as wa}from"./tooltip-ft1RTR-v.js";import{u as Gt,c as ce,B as Bt}from"./button-Cr6E3Zah.js";import{i as Ra}from"./CpuChip02-CPlOIGho.js";import{i as po}from"./SearchMd-6q3Womqs.js";import{b as Kd,I as mo,U as Jd,e as ef,c as tf,u as nf}from"./use-connection-C7xrQrun.js";import{u as rf}from"./use-gateway-CFo4NnYE.js";import{i as af}from"./X-o0W9skNS.js";import{j as sf,i as go,c as uf}from"./dropdown-menu-DRM8ajGJ.js";import{T as of}from"./textarea-DCD8uj7C.js";import{u as lf,L as cf}from"./localstorage-keys-CH6-Ca8T.js";import{a as ti}from"./Copy01-D_Mdx0Pg.js";import{i as df}from"./AlertCircle-Chhij1Oy.js";import{i as ff}from"./Terminal-CScId5Gm.js";import{C as hf}from"./connection-card-BXlOCQh2.js";import{n as pf}from"./LinkExternal01-DnJp4-3N.js";import{J as Dr}from"./json-syntax-highlighter-nU-euVt8.js";import{b as mf,c as gf,d as bf,A as Ef,a as Tf,e as xf,g as _f,f as yf}from"./alert-dialog-lIrOrUAe.js";import{b as Af,a as Cf,c as kf,S as Sf}from"./select-ykoytU3x.js";import{u as If}from"./use-mobile-iQFQFevV.js";import{i as Nf}from"./File06-Aynv5CgR.js";import{i as wf}from"./InfoCircle-Bdc1UZh_.js";const bo=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"M15.938 15.938A7.001 7.001 0 0 0 15 2a7.001 7.001 0 0 0-6.938 6.062M16 15a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));bo.displayName="Coins01";const Eo=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"M9 14 4 9m0 0 5-5M4 9h6.4c3.36 0 5.04 0 6.324.654a6 6 0 0 1 2.622 2.622C20 13.56 20 15.24 20 18.6V20"}));Eo.displayName="CornerUpLeft";const To=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"M6 16a4 4 0 0 0 4 4h4a4 4 0 0 0 0-8h-4a4 4 0 0 1 0-8h4a4 4 0 0 1 4 4m-6-6v20"}));To.displayName="CurrencyDollar";const xo=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"M12 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm7-14a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM5 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"}));xo.displayName="DotsGrid";const _o=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"m18 10-4-4M2.5 21.5l3.384-.376c.414-.046.62-.069.814-.131a2 2 0 0 0 .485-.234c.17-.111.317-.259.61-.553L21 7a2.828 2.828 0 1 0-4-4L3.794 16.206c-.294.294-.442.442-.553.611a2 2 0 0 0-.234.485c-.062.193-.085.4-.131.814L2.5 21.5Z"}));_o.displayName="Edit02";const yo=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"M16.2 21H6.931c-.605 0-.908 0-1.049-.12a.5.5 0 0 1-.173-.42c.014-.183.228-.397.657-.826l8.503-8.503c.396-.396.594-.594.822-.668a1 1 0 0 1 .618 0c.228.074.426.272.822.668L21 15v1.2M16.2 21c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C21 18.72 21 17.88 21 16.2M16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4M10.5 8.5a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z"}));yo.displayName="Image01";const Ao=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"M15 16.5V19c0 .932 0 1.398-.152 1.765a2 2 0 0 1-1.083 1.083C13.398 22 12.932 22 12 22c-.932 0-1.398 0-1.765-.152a2 2 0 0 1-1.083-1.083C9 20.398 9 19.932 9 19v-2.5m6 0c2.649-1.157 4.5-3.925 4.5-7a7.5 7.5 0 0 0-15 0c0 3.075 1.851 5.843 4.5 7m6 0H9"}));Ao.displayName="Lightbulb01";const Co=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"m18 8 4 4m0 0-4 4m4-4H9m6-7.796A8.383 8.383 0 0 0 10.667 3C5.88 3 2 7.03 2 12s3.88 9 8.667 9A8.384 8.384 0 0 0 15 19.796"}));Co.displayName="LogOut04";const ko=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"m10 15-3.075 3.114c-.43.434-.644.651-.828.666a.5.5 0 0 1-.421-.172c-.12-.14-.12-.446-.12-1.056v-1.56c0-.548-.449-.944-.99-1.024v0a3 3 0 0 1-2.534-2.533C2 12.219 2 11.96 2 11.445V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C4.28 2 5.12 2 6.8 2h7.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C19 4.28 19 5.12 19 6.8V11m0 11-2.176-1.513c-.306-.213-.46-.32-.626-.395a2.002 2.002 0 0 0-.462-.145c-.18-.033-.367-.033-.74-.033H13.2c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874C10 18.394 10 17.834 10 16.714V14.2c0-1.12 0-1.68.218-2.108a2 2 0 0 1 .874-.874C11.52 11 12.08 11 13.2 11h5.6c1.12 0 1.68 0 2.108.218a2 2 0 0 1 .874.874C22 12.52 22 13.08 22 14.2v2.714c0 .932 0 1.398-.152 1.766a2 2 0 0 1-1.083 1.082c-.367.152-.833.152-1.765.152V22Z"}));ko.displayName="MessageChatSquare";const ni=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"m6.5 13 .784 1.569c.266.53.399.796.576 1.026a3 3 0 0 0 .545.545c.23.177.495.31 1.026.575L11 17.5l-1.569.785c-.53.265-.796.398-1.026.575a3 3 0 0 0-.545.545c-.177.23-.31.495-.576 1.026L6.5 22l-.784-1.569c-.266-.53-.399-.796-.576-1.026a3 3 0 0 0-.545-.545c-.23-.177-.495-.31-1.026-.575L2 17.5l1.569-.785c.53-.265.796-.398 1.026-.575a3 3 0 0 0 .545-.545c.177-.23.31-.495.576-1.026L6.5 13ZM15 2l1.179 3.064c.282.734.423 1.1.642 1.409a3 3 0 0 0 .706.706c.309.22.675.36 1.409.642L22 9l-3.064 1.179c-.734.282-1.1.423-1.409.642a3 3 0 0 0-.706.706c-.22.309-.36.675-.642 1.409L15 16l-1.179-3.064c-.282-.734-.423-1.1-.642-1.409a3 3 0 0 0-.706-.706c-.309-.22-.675-.36-1.409-.642L8 9l3.064-1.179c.734-.282 1.1-.423 1.409-.642a3 3 0 0 0 .706-.706c.22-.309.36-.675.642-1.409L15 2Z"}));ni.displayName="Stars01";const So=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"}));So.displayName="Stop";const Io=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"M16 8V5l3-3 1 2 2 1-3 3h-3Zm0 0-4 4m10 0c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2m5 10a5 5 0 1 1-5-5"}));Io.displayName="Target04";var ar;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const a={};for(const s of i)a[s]=s;return a},t.getValidEnumValues=i=>{const a=t.objectKeys(i).filter(u=>typeof i[i[u]]!="number"),s={};for(const u of a)s[u]=i[u];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(a){return i[a]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&a.push(s);return a},t.find=(i,a)=>{for(const s of i)if(a(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,a=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(a)}t.joinValues=r,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(ar||(ar={}));var gs;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(gs||(gs={}));ar.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);ar.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class $r extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(a){return a.message},r={_errors:[]},i=a=>{for(const s of a.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let u=r,o=0;for(;o<s.path.length;){const l=s.path[o];o===s.path.length-1?(u[l]=u[l]||{_errors:[]},u[l]._errors.push(n(s))):u[l]=u[l]||{_errors:[]},u=u[l],o++}}};return i(this),r}static assert(e){if(!(e instanceof $r))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ar.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n=Object.create(null),r=[];for(const i of this.issues)if(i.path.length>0){const a=i.path[0];n[a]=n[a]||[],n[a].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}$r.create=t=>new $r(t);var bs;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(bs||(bs={}));var ae;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ae||(ae={}));function Jt(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}function Rf(t,e){let n;const r=()=>{if(n)return n;const i=indexedDB.open(t);return i.onupgradeneeded=()=>i.result.createObjectStore(e),n=Jt(i),n.then(a=>{a.onclose=()=>n=void 0},()=>{}),n};return(i,a)=>r().then(s=>a(s.transaction(e,i).objectStore(e)))}let ki;function ri(){return ki||(ki=Rf("keyval-store","keyval")),ki}function La(t,e=ri()){return e("readonly",n=>Jt(n.get(t)))}function Gn(t,e,n=ri()){return n("readwrite",r=>(r.put(e,t),Jt(r.transaction)))}function No(t,e=ri()){return e("readwrite",n=>(n.delete(t),Jt(n.transaction)))}function Lf(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},Jt(t.transaction)}function wo(t=ri()){return t("readonly",e=>{if(e.getAll&&e.getAllKeys)return Promise.all([Jt(e.getAllKeys()),Jt(e.getAll())]).then(([r,i])=>r.map((a,s)=>[a,i[s]]));const n=[];return t("readonly",r=>Lf(r,i=>n.push([i.key,i.value])).then(()=>n))})}async function Of(t,e){const n=`${t}:threads:${e}`;return await La(n)??null}async function vf(t){const e=`${t}:threads:`;return(await wo()).filter(([i])=>typeof i=="string"&&i.startsWith(e)).map(([,i])=>i).filter(i=>!i.hidden).sort((i,a)=>String(a.updated_at).localeCompare(String(i.updated_at)))}function Ro(t,e){const n=`${t}:messages:`;return wo().then(r=>r.filter(([a])=>typeof a=="string"&&a.startsWith(n)).map(([,a])=>a).filter(a=>a.metadata?.thread_id===e||a.threadId===e).sort((a,s)=>{const u=a.metadata?.created_at||a.createdAt||"",o=s.metadata?.created_at||s.createdAt||"";return String(u).localeCompare(String(o))}))}function Zy(){const t=K.c(12),{locator:e}=Mt();let n;t[0]!==e?(n=Ge.threads(e),t[0]=e,t[1]=n):n=t[1];let r;t[2]!==e?(r=()=>vf(e),t[2]=e,t[3]=r):r=t[3];let i;t[4]!==n||t[5]!==r?(i={queryKey:n,queryFn:r,staleTime:3e4},t[4]=n,t[5]=r,t[6]=i):i=t[6];const{data:a,refetch:s}=ka(i);let u;t[7]!==a?(u=a??[],t[7]=a,t[8]=u):u=t[8];let o;return t[9]!==s||t[10]!==u?(o={threads:u,refetch:s},t[9]=s,t[10]=u,t[11]=o):o=t[11],o}function Df(t){const e=K.c(11),{locator:n}=Mt();let r;e[0]!==n||e[1]!==t?(r=Ge.threadMessages(n,t),e[0]=n,e[1]=t,e[2]=r):r=e[2];let i;e[3]!==n||e[4]!==t?(i=()=>Ro(n,t),e[3]=n,e[4]=t,e[5]=i):i=e[5];let a;e[6]!==r||e[7]!==i?(a={queryKey:r,queryFn:i,staleTime:3e4},e[6]=r,e[7]=i,e[8]=a):a=e[8];const{data:s}=ka(a);let u;return e[9]!==s?(u=s??[],e[9]=s,e[10]=u):u=e[10],u}function Oa(){const t=K.c(28),{locator:e}=Mt(),n=co();let r;t[0]!==e?(r=async _=>{const b=`${e}:threads:${_.id}`;return await Gn(b,_),_},t[0]=e,t[1]=r):r=t[1];let i;t[2]!==e||t[3]!==n?(i=()=>{n.invalidateQueries({queryKey:Ge.threads(e)})},t[2]=e,t[3]=n,t[4]=i):i=t[4];let a;t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7];const s=Gt(a);let u;t[8]!==e?(u=async _=>{const{id:b,updates:k}=_,E=`${e}:threads:${b}`,w=await La(E);if(!w)throw new Error(`Thread ${b} not found`);const R={...w,...k};return await Gn(E,R),R},t[8]=e,t[9]=u):u=t[9];let o;t[10]!==e||t[11]!==n?(o=_=>{n.invalidateQueries({queryKey:Ge.threads(e)}),n.invalidateQueries({queryKey:Ge.thread(e,_.id)})},t[10]=e,t[11]=n,t[12]=o):o=t[12];let l;t[13]!==u||t[14]!==o?(l={mutationFn:u,onSuccess:o},t[13]=u,t[14]=o,t[15]=l):l=t[15];const f=Gt(l);let d;t[16]!==e?(d=async _=>{const b=`${e}:threads:${_}`;return await No(b),_},t[16]=e,t[17]=d):d=t[17];let h;t[18]!==e||t[19]!==n?(h=()=>{n.invalidateQueries({queryKey:Ge.threads(e)})},t[18]=e,t[19]=n,t[20]=h):h=t[20];let p;t[21]!==d||t[22]!==h?(p={mutationFn:d,onSuccess:h},t[21]=d,t[22]=h,t[23]=p):p=t[23];const g=Gt(p);let x;return t[24]!==g||t[25]!==s||t[26]!==f?(x={insert:s,update:f,delete:g},t[24]=g,t[25]=s,t[26]=f,t[27]=x):x=t[27],x}function Lo(){const t=K.c(37),{locator:e}=Mt(),n=co();let r;t[0]!==e?(r=async w=>{const R=`${e}:messages:${w.id}`;return await Gn(R,w),w},t[0]=e,t[1]=r):r=t[1];let i;t[2]!==e||t[3]!==n?(i=w=>{const R=w.metadata?.thread_id||w.threadId;R&&n.invalidateQueries({queryKey:Ge.threadMessages(e,R)}),n.invalidateQueries({queryKey:Ge.messages(e)})},t[2]=e,t[3]=n,t[4]=i):i=t[4];let a;t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7];const s=Gt(a);let u;t[8]!==e?(u=async w=>(await Promise.all(w.map(R=>{const S=`${e}:messages:${R.id}`;return Gn(S,R)})),w),t[8]=e,t[9]=u):u=t[9];let o;t[10]!==e||t[11]!==n?(o=w=>{const R=new Set;for(const S of w){const O=S.metadata?.thread_id||S.threadId;O&&R.add(O)}for(const S of R)n.invalidateQueries({queryKey:Ge.threadMessages(e,S)});n.invalidateQueries({queryKey:Ge.messages(e)})},t[10]=e,t[11]=n,t[12]=o):o=t[12];let l;t[13]!==u||t[14]!==o?(l={mutationFn:u,onSuccess:o},t[13]=u,t[14]=o,t[15]=l):l=t[15];const f=Gt(l);let d;t[16]!==e?(d=async w=>{const{id:R,updates:S}=w,O=`${e}:messages:${R}`,F=await La(O);if(!F)throw new Error(`Message ${R} not found`);const j={...F,...S};return await Gn(O,j),j},t[16]=e,t[17]=d):d=t[17];let h;t[18]!==e||t[19]!==n?(h=w=>{const R=w.metadata?.thread_id||w.threadId;R&&n.invalidateQueries({queryKey:Ge.threadMessages(e,R)}),n.invalidateQueries({queryKey:Ge.messages(e)})},t[18]=e,t[19]=n,t[20]=h):h=t[20];let p;t[21]!==d||t[22]!==h?(p={mutationFn:d,onSuccess:h},t[21]=d,t[22]=h,t[23]=p):p=t[23];const g=Gt(p);let x;t[24]!==e?(x=async w=>{const R=`${e}:messages:${w}`;return await No(R),w},t[24]=e,t[25]=x):x=t[25];let _;t[26]!==e||t[27]!==n?(_=()=>{n.invalidateQueries({queryKey:Ge.messages(e)})},t[26]=e,t[27]=n,t[28]=_):_=t[28];let b;t[29]!==_||t[30]!==x?(b={mutationFn:x,onSuccess:_},t[29]=_,t[30]=x,t[31]=b):b=t[31];const k=Gt(b);let E;return t[32]!==k||t[33]!==s||t[34]!==f||t[35]!==g?(E={insert:s,insertMany:f,update:g,delete:k},t[32]=k,t[33]=s,t[34]=f,t[35]=g,t[36]=E):E=t[36],E}async function Pf(t){const e=`/mcp/gateway/${t}`,n={"Content-Type":"application/json",Accept:"application/json, text/event-stream"};try{const r=await fetch(e,{method:"POST",headers:n,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"mesh-chat",version:"1.0.0"}}})});if(!r.ok)return[];if((await r.json()).error)return[];const a=await fetch(e,{method:"POST",headers:n,body:JSON.stringify({jsonrpc:"2.0",id:2,method:"prompts/list",params:{}})});if(!a.ok)return[];const s=await a.json();return s.error?[]:s.result?.prompts||[]}catch{return[]}}function Ky(t){const e=K.c(7);let n;e[0]!==t?(n=Ge.gatewayPrompts(t),e[0]=t,e[1]=n):n=e[1];let r;e[2]!==t?(r=()=>Pf(t),e[2]=t,e[3]=r):r=e[3];let i;return e[4]!==n||e[5]!==r?(i={queryKey:n,queryFn:r,staleTime:6e4,retry:!1},e[4]=n,e[5]=r,e[6]=i):i=e[6],ka(i)}var Oo="vercel.ai.error",Mf=Symbol.for(Oo),Es,Ts,Pt=class vo extends(Ts=Error,Es=Mf,Ts){constructor({name:e,message:n,cause:r}){super(n),this[Es]=!0,this.name=e,this.cause=r}static isInstance(e){return vo.hasMarker(e,Oo)}static hasMarker(e,n){const r=Symbol.for(n);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function Do(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Po="AI_InvalidArgumentError",Mo=`vercel.ai.error.${Po}`,Bf=Symbol.for(Mo),xs,_s,Ff=class extends(_s=Pt,xs=Bf,_s){constructor({message:t,cause:e,argument:n}){super({name:Po,message:t,cause:e}),this[xs]=!0,this.argument=n}static isInstance(t){return Pt.hasMarker(t,Mo)}},Bo="AI_JSONParseError",Fo=`vercel.ai.error.${Bo}`,Hf=Symbol.for(Fo),ys,As,Cs=class extends(As=Pt,ys=Hf,As){constructor({text:t,cause:e}){super({name:Bo,message:`JSON parsing failed: Text: ${t}.
3
3
  Error message: ${Do(e)}`,cause:e}),this[ys]=!0,this.text=t}static isInstance(t){return Pt.hasMarker(t,Fo)}},Ho="AI_TypeValidationError",Uo=`vercel.ai.error.${Ho}`,Uf=Symbol.for(Uo),ks,Ss,_n=class Ji extends(Ss=Pt,ks=Uf,Ss){constructor({value:e,cause:n}){super({name:Ho,message:`Type validation failed: Value: ${JSON.stringify(e)}.
4
4
  Error message: ${Do(n)}`,cause:n}),this[ks]=!0,this.value=e}static isInstance(e){return Pt.hasMarker(e,Uo)}static wrap({value:e,cause:n}){return Ji.isInstance(n)&&n.value===e?n:new Ji({value:e,cause:n})}},mr=({prefix:t,size:e=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const i=()=>{const a=n.length,s=new Array(e);for(let u=0;u<e;u++)s[u]=n[Math.random()*a|0];return s.join("")};if(t==null)return i;if(n.includes(r))throw new Ff({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${t}${r}${i()}`},zf=mr();function Is(t=globalThis){var e,n,r;return t.window?"runtime/browser":(e=t.navigator)!=null&&e.userAgent?`runtime/${t.navigator.userAgent.toLowerCase()}`:(r=(n=t.process)==null?void 0:n.versions)!=null&&r.node?`runtime/node.js/${t.process.version.substring(0)}`:t.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function Vt(t){if(t==null)return{};const e={};if(t instanceof Headers)t.forEach((n,r)=>{e[r.toLowerCase()]=n});else{Array.isArray(t)||(t=Object.entries(t));for(const[n,r]of t)r!=null&&(e[n.toLowerCase()]=r)}return e}function Ns(t,...e){const n=new Headers(Vt(t)),r=n.get("user-agent")||"";return n.set("user-agent",[r,...e].filter(Boolean).join(" ")),Object.fromEntries(n.entries())}var jf=/"__proto__"\s*:/,$f=/"constructor"\s*:/;function ws(t){const e=JSON.parse(t);return e===null||typeof e!="object"||jf.test(t)===!1&&$f.test(t)===!1?e:Yf(e)}function Yf(t){let e=[t];for(;e.length;){const n=e;e=[];for(const r of n){if(Object.prototype.hasOwnProperty.call(r,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(r,"constructor")&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const i in r){const a=r[i];a&&typeof a=="object"&&e.push(a)}}}return t}function qf(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return ws(t)}try{return ws(t)}finally{Error.stackTraceLimit=e}}function zo(t){if(t.type==="object"||Array.isArray(t.type)&&t.type.includes("object")){t.additionalProperties=!1;const{properties:n}=t;if(n!=null)for(const r of Object.keys(n))n[r]=$t(n[r])}t.items!=null&&(t.items=Array.isArray(t.items)?t.items.map($t):$t(t.items)),t.anyOf!=null&&(t.anyOf=t.anyOf.map($t)),t.allOf!=null&&(t.allOf=t.allOf.map($t)),t.oneOf!=null&&(t.oneOf=t.oneOf.map($t));const{definitions:e}=t;if(e!=null)for(const n of Object.keys(e))e[n]=$t(e[n]);return t}function $t(t){return typeof t=="boolean"?t:zo(t)}var Vf=Symbol("Let zodToJsonSchema decide on which parser to use"),Rs={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},Wf=t=>typeof t=="string"?{...Rs,name:t}:{...Rs,...t};function nt(){return{}}function Gf(t,e){var n,r,i;const a={type:"array"};return(n=t.type)!=null&&n._def&&((i=(r=t.type)==null?void 0:r._def)==null?void 0:i.typeName)!==ae.ZodAny&&(a.items=ye(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(a.minItems=t.minLength.value),t.maxLength&&(a.maxItems=t.maxLength.value),t.exactLength&&(a.minItems=t.exactLength.value,a.maxItems=t.exactLength.value),a}function Qf(t){const e={type:"integer",format:"int64"};if(!t.checks)return e;for(const n of t.checks)switch(n.kind){case"min":n.inclusive?e.minimum=n.value:e.exclusiveMinimum=n.value;break;case"max":n.inclusive?e.maximum=n.value:e.exclusiveMaximum=n.value;break;case"multipleOf":e.multipleOf=n.value;break}return e}function Xf(){return{type:"boolean"}}function jo(t,e){return ye(t.type._def,e)}var Zf=(t,e)=>ye(t.innerType._def,e);function $o(t,e,n){const r=n??e.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((i,a)=>$o(t,e,i))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Kf(t)}}var Kf=t=>{const e={type:"integer",format:"unix-time"};for(const n of t.checks)switch(n.kind){case"min":e.minimum=n.value;break;case"max":e.maximum=n.value;break}return e};function Jf(t,e){return{...ye(t.innerType._def,e),default:t.defaultValue()}}function eh(t,e){return e.effectStrategy==="input"?ye(t.schema._def,e):nt()}function th(t){return{type:"string",enum:Array.from(t.values)}}var nh=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function rh(t,e){const n=[ye(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),ye(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(i=>!!i),r=[];return n.forEach(i=>{if(nh(i))r.push(...i.allOf);else{let a=i;if("additionalProperties"in i&&i.additionalProperties===!1){const{additionalProperties:s,...u}=i;a=u}r.push(a)}}),r.length?{allOf:r}:void 0}function ih(t){const e=typeof t.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(t.value)?"array":"object"}:{type:e==="bigint"?"integer":e,const:t.value}}var Si=void 0,ut={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Si===void 0&&(Si=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Si),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function Yo(t,e){const n={type:"string"};if(t.checks)for(const r of t.checks)switch(r.kind){case"min":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value;break;case"max":n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"email":switch(e.emailStrategy){case"format:email":ot(n,"email",r.message,e);break;case"format:idn-email":ot(n,"idn-email",r.message,e);break;case"pattern:zod":je(n,ut.email,r.message,e);break}break;case"url":ot(n,"uri",r.message,e);break;case"uuid":ot(n,"uuid",r.message,e);break;case"regex":je(n,r.regex,r.message,e);break;case"cuid":je(n,ut.cuid,r.message,e);break;case"cuid2":je(n,ut.cuid2,r.message,e);break;case"startsWith":je(n,RegExp(`^${Ii(r.value,e)}`),r.message,e);break;case"endsWith":je(n,RegExp(`${Ii(r.value,e)}$`),r.message,e);break;case"datetime":ot(n,"date-time",r.message,e);break;case"date":ot(n,"date",r.message,e);break;case"time":ot(n,"time",r.message,e);break;case"duration":ot(n,"duration",r.message,e);break;case"length":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value,n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"includes":{je(n,RegExp(Ii(r.value,e)),r.message,e);break}case"ip":{r.version!=="v6"&&ot(n,"ipv4",r.message,e),r.version!=="v4"&&ot(n,"ipv6",r.message,e);break}case"base64url":je(n,ut.base64url,r.message,e);break;case"jwt":je(n,ut.jwt,r.message,e);break;case"cidr":{r.version!=="v6"&&je(n,ut.ipv4Cidr,r.message,e),r.version!=="v4"&&je(n,ut.ipv6Cidr,r.message,e);break}case"emoji":je(n,ut.emoji(),r.message,e);break;case"ulid":{je(n,ut.ulid,r.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{ot(n,"binary",r.message,e);break}case"contentEncoding:base64":{n.contentEncoding="base64";break}case"pattern:zod":{je(n,ut.base64,r.message,e);break}}break}case"nanoid":je(n,ut.nanoid,r.message,e)}return n}function Ii(t,e){return e.patternStrategy==="escape"?sh(t):t}var ah=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function sh(t){let e="";for(let n=0;n<t.length;n++)ah.has(t[n])||(e+="\\"),e+=t[n];return e}function ot(t,e,n,r){var i;t.format||(i=t.anyOf)!=null&&i.some(a=>a.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format}),delete t.format),t.anyOf.push({format:e,...n&&r.errorMessages&&{errorMessage:{format:n}}})):t.format=e}function je(t,e,n,r){var i;t.pattern||(i=t.allOf)!=null&&i.some(a=>a.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:Ls(e,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):t.pattern=Ls(e,r)}function Ls(t,e){var n;if(!e.applyRegexFlags||!t.flags)return t.source;const r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},i=r.i?t.source.toLowerCase():t.source;let a="",s=!1,u=!1,o=!1;for(let l=0;l<i.length;l++){if(s){a+=i[l],s=!1;continue}if(r.i){if(u){if(i[l].match(/[a-z]/)){o?(a+=i[l],a+=`${i[l-2]}-${i[l]}`.toUpperCase(),o=!1):i[l+1]==="-"&&((n=i[l+2])!=null&&n.match(/[a-z]/))?(a+=i[l],o=!0):a+=`${i[l]}${i[l].toUpperCase()}`;continue}}else if(i[l].match(/[a-z]/)){a+=`[${i[l]}${i[l].toUpperCase()}]`;continue}}if(r.m){if(i[l]==="^"){a+=`(^|(?<=[\r
5
5
  ]))`;continue}else if(i[l]==="$"){a+=`($|(?=[\r
@@ -93,6 +93,6 @@ Please report this to https://github.com/markedjs/marked.`,t){const r="<p>An err
93
93
  `))+1))}const s="#".repeat(i),u=n.enter("headingAtx"),o=n.enter("phrasing");a.move(s+" ");let l=n.containerPhrasing(t,{before:"# ",after:`
94
94
  `,...a.current()});return/^[\t ]/.test(l)&&(l=dr(l.charCodeAt(0))+l.slice(1)),l=l?s+" "+l:s,n.options.closeAtx&&(l+=" "+s),o(),u(),l}Uc.peek=Dx;function Uc(t){return t.value||""}function Dx(){return"<"}zc.peek=Px;function zc(t,e,n,r){const i=us(n),a=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let u=n.enter("label");const o=n.createTracker(r);let l=o.move("![");return l+=o.move(n.safe(t.alt,{before:l,after:"]",...o.current()})),l+=o.move("]("),u(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(u=n.enter("destinationLiteral"),l+=o.move("<"),l+=o.move(n.safe(t.url,{before:l,after:">",...o.current()})),l+=o.move(">")):(u=n.enter("destinationRaw"),l+=o.move(n.safe(t.url,{before:l,after:t.title?" ":")",...o.current()}))),u(),t.title&&(u=n.enter(`title${a}`),l+=o.move(" "+i),l+=o.move(n.safe(t.title,{before:l,after:i,...o.current()})),l+=o.move(i),u()),l+=o.move(")"),s(),l}function Px(){return"!"}jc.peek=Mx;function jc(t,e,n,r){const i=t.referenceType,a=n.enter("imageReference");let s=n.enter("label");const u=n.createTracker(r);let o=u.move("![");const l=n.safe(t.alt,{before:o,after:"]",...u.current()});o+=u.move(l+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const d=n.safe(n.associationId(t),{before:o,after:"]",...u.current()});return s(),n.stack=f,a(),i==="full"||!l||l!==d?o+=u.move(d+"]"):i==="shortcut"?o=o.slice(0,-1):o+=u.move("]"),o}function Mx(){return"!"}$c.peek=Bx;function $c(t,e,n){let r=t.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const s=n.unsafe[a],u=n.compilePattern(s);let o;if(s.atBreak)for(;o=u.exec(r);){let l=o.index;r.charCodeAt(l)===10&&r.charCodeAt(l-1)===13&&l--,r=r.slice(0,l)+" "+r.slice(o.index+1)}}return i+r+i}function Bx(){return"`"}function Yc(t,e){const n=Wa(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}qc.peek=Fx;function qc(t,e,n,r){const i=us(n),a=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let u,o;if(Yc(t,n)){const f=n.stack;n.stack=[],u=n.enter("autolink");let d=s.move("<");return d+=s.move(n.containerPhrasing(t,{before:d,after:">",...s.current()})),d+=s.move(">"),u(),n.stack=f,d}u=n.enter("link"),o=n.enter("label");let l=s.move("[");return l+=s.move(n.containerPhrasing(t,{before:l,after:"](",...s.current()})),l+=s.move("]("),o(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(o=n.enter("destinationLiteral"),l+=s.move("<"),l+=s.move(n.safe(t.url,{before:l,after:">",...s.current()})),l+=s.move(">")):(o=n.enter("destinationRaw"),l+=s.move(n.safe(t.url,{before:l,after:t.title?" ":")",...s.current()}))),o(),t.title&&(o=n.enter(`title${a}`),l+=s.move(" "+i),l+=s.move(n.safe(t.title,{before:l,after:i,...s.current()})),l+=s.move(i),o()),l+=s.move(")"),u(),l}function Fx(t,e,n){return Yc(t,n)?"<":"["}Vc.peek=Hx;function Vc(t,e,n,r){const i=t.referenceType,a=n.enter("linkReference");let s=n.enter("label");const u=n.createTracker(r);let o=u.move("[");const l=n.containerPhrasing(t,{before:o,after:"]",...u.current()});o+=u.move(l+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const d=n.safe(n.associationId(t),{before:o,after:"]",...u.current()});return s(),n.stack=f,a(),i==="full"||!l||l!==d?o+=u.move(d+"]"):i==="shortcut"?o=o.slice(0,-1):o+=u.move("]"),o}function Hx(){return"["}function os(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function Ux(t){const e=os(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function zx(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function Wc(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function jx(t,e,n,r){const i=n.enter("list"),a=n.bulletCurrent;let s=t.ordered?zx(n):os(n);const u=t.ordered?s==="."?")":".":Ux(n);let o=e&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!t.ordered){const f=t.children?t.children[0]:void 0;if((s==="*"||s==="-")&&f&&(!f.children||!f.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(o=!0),Wc(n)===s&&f){let d=-1;for(;++d<t.children.length;){const h=t.children[d];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){o=!0;break}}}}o&&(s=u),n.bulletCurrent=s;const l=n.containerFlow(t,r);return n.bulletLastUsed=s,n.bulletCurrent=a,i(),l}function $x(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function Yx(t,e,n,r){const i=$x(n);let a=n.bulletCurrent||os(n);e&&e.type==="list"&&e.ordered&&(a=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+a);let s=a.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(s=Math.ceil(s/4)*4);const u=n.createTracker(r);u.move(a+" ".repeat(s-a.length)),u.shift(s);const o=n.enter("listItem"),l=n.indentLines(n.containerFlow(t,u.current()),f);return o(),l;function f(d,h,p){return h?(p?"":" ".repeat(s))+d:(p?a:a+" ".repeat(s-a.length))+d}}function qx(t,e,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),s=n.containerPhrasing(t,r);return a(),i(),s}const Vx=fi(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Wx(t,e,n,r){return(t.children.some(function(s){return Vx(s)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function Gx(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}Gc.peek=Qx;function Gc(t,e,n,r){const i=Gx(n),a=n.enter("strong"),s=n.createTracker(r),u=s.move(i+i);let o=s.move(n.containerPhrasing(t,{after:i,before:u,...s.current()}));const l=o.charCodeAt(0),f=Kr(r.before.charCodeAt(r.before.length-1),l,i);f.inside&&(o=dr(l)+o.slice(1));const d=o.charCodeAt(o.length-1),h=Kr(r.after.charCodeAt(0),d,i);h.inside&&(o=o.slice(0,-1)+dr(d));const p=s.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:h.outside,before:f.outside},u+o+p}function Qx(t,e,n){return n.options.strong||"*"}function Xx(t,e,n,r){return n.safe(t.value,r)}function Zx(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function Kx(t,e,n){const r=(Wc(n)+(n.options.ruleSpaces?" ":"")).repeat(Zx(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Qc={blockquote:_x,break:Wu,code:Ix,definition:wx,emphasis:Hc,hardBreak:Wu,heading:vx,html:Uc,image:zc,imageReference:jc,inlineCode:$c,link:qc,linkReference:Vc,list:jx,listItem:Yx,paragraph:qx,root:Wx,strong:Gc,text:Xx,thematicBreak:Kx};function Jx(){return{enter:{table:e3,tableData:Gu,tableHeader:Gu,tableRow:n3},exit:{codeText:r3,table:t3,tableData:Wi,tableHeader:Wi,tableRow:Wi}}}function e3(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function t3(t){this.exit(t),this.data.inTable=void 0}function n3(t){this.enter({type:"tableRow",children:[]},t)}function Wi(t){this.exit(t)}function Gu(t){this.enter({type:"tableCell",children:[]},t)}function r3(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,i3));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function i3(t,e){return e==="|"?e:t}function a3(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,i=e.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
95
95
  `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:s,tableCell:o,tableRow:u}};function s(p,g,x,_){return l(f(p,x,_),p.align)}function u(p,g,x,_){const b=d(p,x,_),k=l([b]);return k.slice(0,k.indexOf(`
96
- `))}function o(p,g,x,_){const b=x.enter("tableCell"),k=x.enter("phrasing"),E=x.containerPhrasing(p,{..._,before:a,after:a});return k(),b(),E}function l(p,g){return Tx(p,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function f(p,g,x){const _=p.children;let b=-1;const k=[],E=g.enter("table");for(;++b<_.length;)k[b]=d(_[b],g,x);return E(),k}function d(p,g,x){const _=p.children;let b=-1;const k=[],E=g.enter("tableRow");for(;++b<_.length;)k[b]=o(_[b],p,g,x);return E(),k}function h(p,g,x){let _=Qc.inlineCode(p,g,x);return x.stack.includes("tableCell")&&(_=_.replace(/\|/g,"\\$&")),_}}function s3(){return{exit:{taskListCheckValueChecked:Qu,taskListCheckValueUnchecked:Qu,paragraph:o3}}}function u3(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:l3}}}function Qu(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function o3(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=e.children;let a=-1,s;for(;++a<i.length;){const u=i[a];if(u.type==="paragraph"){s=u;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function l3(t,e,n,r){const i=t.children[0],a=typeof t.checked=="boolean"&&i&&i.type==="paragraph",s="["+(t.checked?"x":" ")+"] ",u=n.createTracker(r);a&&u.move(s);let o=Qc.listItem(t,e,n,{...r,...u.current()});return a&&(o=o.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),o;function l(f){return f+s}}function c3(){return[jT(),lx(),hx(),Jx(),s3()]}function d3(t){return{extensions:[$T(),cx(t),px(),a3(t),u3()]}}const f3={tokenize:E3,partial:!0},Xc={tokenize:T3,partial:!0},Zc={tokenize:x3,partial:!0},Kc={tokenize:_3,partial:!0},h3={tokenize:y3,partial:!0},Jc={name:"wwwAutolink",tokenize:g3,previous:td},ed={name:"protocolAutolink",tokenize:b3,previous:nd},Ct={name:"emailAutolink",tokenize:m3,previous:rd},bt={};function p3(){return{text:bt}}let Yt=48;for(;Yt<123;)bt[Yt]=Ct,Yt++,Yt===58?Yt=65:Yt===91&&(Yt=97);bt[43]=Ct;bt[45]=Ct;bt[46]=Ct;bt[95]=Ct;bt[72]=[Ct,ed];bt[104]=[Ct,ed];bt[87]=[Ct,Jc];bt[119]=[Ct,Jc];function m3(t,e,n){const r=this;let i,a;return s;function s(d){return!Aa(d)||!rd.call(r,r.previous)||ls(r.events)?n(d):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),u(d))}function u(d){return Aa(d)?(t.consume(d),u):d===64?(t.consume(d),o):n(d)}function o(d){return d===46?t.check(h3,f,l)(d):d===45||d===95||He(d)?(a=!0,t.consume(d),o):f(d)}function l(d){return t.consume(d),i=!0,o}function f(d){return a&&i&&Ye(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(d)):n(d)}}function g3(t,e,n){const r=this;return i;function i(s){return s!==87&&s!==119||!td.call(r,r.previous)||ls(r.events)?n(s):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(f3,t.attempt(Xc,t.attempt(Zc,a),n),n)(s))}function a(s){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(s)}}function b3(t,e,n){const r=this;let i="",a=!1;return s;function s(d){return(d===72||d===104)&&nd.call(r,r.previous)&&!ls(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),t.consume(d),u):n(d)}function u(d){if(Ye(d)&&i.length<5)return i+=String.fromCodePoint(d),t.consume(d),u;if(d===58){const h=i.toLowerCase();if(h==="http"||h==="https")return t.consume(d),o}return n(d)}function o(d){return d===47?(t.consume(d),a?l:(a=!0,o)):n(d)}function l(d){return d===null||Wr(d)||Se(d)||nn(d)||li(d)?n(d):t.attempt(Xc,t.attempt(Zc,f),n)(d)}function f(d){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(d)}}function E3(t,e,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,t.consume(s),i):s===46&&r===3?(t.consume(s),a):n(s)}function a(s){return s===null?n(s):e(s)}}function T3(t,e,n){let r,i,a;return s;function s(l){return l===46||l===95?t.check(Kc,o,u)(l):l===null||Se(l)||nn(l)||l!==45&&li(l)?o(l):(a=!0,t.consume(l),s)}function u(l){return l===95?r=!0:(i=r,r=void 0),t.consume(l),s}function o(l){return i||r||!a?n(l):e(l)}}function x3(t,e){let n=0,r=0;return i;function i(s){return s===40?(n++,t.consume(s),i):s===41&&r<n?a(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?t.check(Kc,e,a)(s):s===null||Se(s)||nn(s)?e(s):(t.consume(s),i)}function a(s){return s===41&&r++,t.consume(s),i}}function _3(t,e,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(t.consume(u),r):u===38?(t.consume(u),a):u===93?(t.consume(u),i):u===60||u===null||Se(u)||nn(u)?e(u):n(u)}function i(u){return u===null||u===40||u===91||Se(u)||nn(u)?e(u):r(u)}function a(u){return Ye(u)?s(u):n(u)}function s(u){return u===59?(t.consume(u),r):Ye(u)?(t.consume(u),s):n(u)}}function y3(t,e,n){return r;function r(a){return t.consume(a),i}function i(a){return He(a)?n(a):e(a)}}function td(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||Se(t)}function nd(t){return!Ye(t)}function rd(t){return!(t===47||Aa(t))}function Aa(t){return t===43||t===45||t===46||t===95||He(t)}function ls(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const A3={tokenize:L3,partial:!0};function C3(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:N3,continuation:{tokenize:w3},exit:R3}},text:{91:{name:"gfmFootnoteCall",tokenize:I3},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:k3,resolveTo:S3}}}}function k3(t,e,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const o=r.events[i][1];if(o.type==="labelImage"){s=o;break}if(o.type==="gfmFootnoteCall"||o.type==="labelLink"||o.type==="label"||o.type==="image"||o.type==="link")break}return u;function u(o){if(!s||!s._balanced)return n(o);const l=lt(r.sliceSerialize({start:s.end,end:r.now()}));return l.codePointAt(0)!==94||!a.includes(l.slice(1))?n(o):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(o),t.exit("gfmFootnoteCallLabelMarker"),e(o))}}function S3(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},t[t.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},u=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",i,e],["exit",i,e],["enter",a,e],["enter",s,e],["exit",s,e],["exit",a,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...u),t}function I3(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,s;return u;function u(d){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(d),t.exit("gfmFootnoteCallLabelMarker"),o}function o(d){return d!==94?n(d):(t.enter("gfmFootnoteCallMarker"),t.consume(d),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",l)}function l(d){if(a>999||d===93&&!s||d===null||d===91||Se(d))return n(d);if(d===93){t.exit("chunkString");const h=t.exit("gfmFootnoteCallString");return i.includes(lt(r.sliceSerialize(h)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(d),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(d)}return Se(d)||(s=!0),a++,t.consume(d),d===92?f:l}function f(d){return d===91||d===92||d===93?(t.consume(d),a++,l):l(d)}}function N3(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,s=0,u;return o;function o(g){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(g){return g===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",f):n(g)}function f(g){if(s>999||g===93&&!u||g===null||g===91||Se(g))return n(g);if(g===93){t.exit("chunkString");const x=t.exit("gfmFootnoteDefinitionLabelString");return a=lt(r.sliceSerialize(x)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),h}return Se(g)||(u=!0),s++,t.consume(g),g===92?d:f}function d(g){return g===91||g===92||g===93?(t.consume(g),s++,f):f(g)}function h(g){return g===58?(t.enter("definitionMarker"),t.consume(g),t.exit("definitionMarker"),i.includes(a)||i.push(a),Ee(t,p,"gfmFootnoteDefinitionWhitespace")):n(g)}function p(g){return e(g)}}function w3(t,e,n){return t.check(xr,e,t.attempt(A3,e,n))}function R3(t){t.exit("gfmFootnoteDefinition")}function L3(t,e,n){const r=this;return Ee(t,i,"gfmFootnoteDefinitionIndent",5);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?e(a):n(a)}}function O3(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,u){let o=-1;for(;++o<s.length;)if(s[o][0]==="enter"&&s[o][1].type==="strikethroughSequenceTemporary"&&s[o][1]._close){let l=o;for(;l--;)if(s[l][0]==="exit"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._open&&s[o][1].end.offset-s[o][1].start.offset===s[l][1].end.offset-s[l][1].start.offset){s[o][1].type="strikethroughSequence",s[l][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},s[l][1].start),end:Object.assign({},s[o][1].end)},d={type:"strikethroughText",start:Object.assign({},s[l][1].end),end:Object.assign({},s[o][1].start)},h=[["enter",f,u],["enter",s[l][1],u],["exit",s[l][1],u],["enter",d,u]],p=u.parser.constructs.insideSpan.null;p&&tt(h,h.length,0,ci(p,s.slice(l+1,o),u)),tt(h,h.length,0,[["exit",d,u],["enter",s[o][1],u],["exit",s[o][1],u],["exit",f,u]]),tt(s,l-1,o-l+3,h),o=l+h.length-2;break}}for(o=-1;++o<s.length;)s[o][1].type==="strikethroughSequenceTemporary"&&(s[o][1].type="data");return s}function a(s,u,o){const l=this.previous,f=this.events;let d=0;return h;function h(g){return l===126&&f[f.length-1][1].type!=="characterEscape"?o(g):(s.enter("strikethroughSequenceTemporary"),p(g))}function p(g){const x=yn(l);if(g===126)return d>1?o(g):(s.consume(g),d++,p);if(d<2&&!n)return o(g);const _=s.exit("strikethroughSequenceTemporary"),b=yn(g);return _._open=!b||b===2&&!!x,_._close=!x||x===2&&!!b,u(g)}}}class v3{constructor(){this.map=[]}add(e,n,r){D3(this,e,n,r)}consume(e){if(this.map.sort(function(a,s){return a[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let i=r.pop();for(;i;){for(const a of i)e.push(a);i=r.pop()}this.map.length=0}}function D3(t,e,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<t.map.length;){if(t.map[i][0]===e){t.map[i][1]+=n,t.map[i][2].push(...r);return}i+=1}t.map.push([e,n,r])}}function P3(t,e){let n=!1;const r=[];for(;e<t.length;){const i=t[e];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function M3(){return{flow:{null:{name:"table",tokenize:B3,resolveAll:F3}}}}function B3(t,e,n){const r=this;let i=0,a=0,s;return u;function u(N){let P=r.events.length-1;for(;P>-1;){const z=r.events[P][1].type;if(z==="lineEnding"||z==="linePrefix")P--;else break}const M=P>-1?r.events[P][1].type:null,J=M==="tableHead"||M==="tableRow"?S:o;return J===S&&r.parser.lazy[r.now().line]?n(N):J(N)}function o(N){return t.enter("tableHead"),t.enter("tableRow"),l(N)}function l(N){return N===124||(s=!0,a+=1),f(N)}function f(N){return N===null?n(N):te(N)?a>1?(a=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(N),t.exit("lineEnding"),p):n(N):fe(N)?Ee(t,f,"whitespace")(N):(a+=1,s&&(s=!1,i+=1),N===124?(t.enter("tableCellDivider"),t.consume(N),t.exit("tableCellDivider"),s=!0,f):(t.enter("data"),d(N)))}function d(N){return N===null||N===124||Se(N)?(t.exit("data"),f(N)):(t.consume(N),N===92?h:d)}function h(N){return N===92||N===124?(t.consume(N),d):d(N)}function p(N){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(N):(t.enter("tableDelimiterRow"),s=!1,fe(N)?Ee(t,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):g(N))}function g(N){return N===45||N===58?_(N):N===124?(s=!0,t.enter("tableCellDivider"),t.consume(N),t.exit("tableCellDivider"),x):R(N)}function x(N){return fe(N)?Ee(t,_,"whitespace")(N):_(N)}function _(N){return N===58?(a+=1,s=!0,t.enter("tableDelimiterMarker"),t.consume(N),t.exit("tableDelimiterMarker"),b):N===45?(a+=1,b(N)):N===null||te(N)?w(N):R(N)}function b(N){return N===45?(t.enter("tableDelimiterFiller"),k(N)):R(N)}function k(N){return N===45?(t.consume(N),k):N===58?(s=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(N),t.exit("tableDelimiterMarker"),E):(t.exit("tableDelimiterFiller"),E(N))}function E(N){return fe(N)?Ee(t,w,"whitespace")(N):w(N)}function w(N){return N===124?g(N):N===null||te(N)?!s||i!==a?R(N):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(N)):R(N)}function R(N){return n(N)}function S(N){return t.enter("tableRow"),O(N)}function O(N){return N===124?(t.enter("tableCellDivider"),t.consume(N),t.exit("tableCellDivider"),O):N===null||te(N)?(t.exit("tableRow"),e(N)):fe(N)?Ee(t,O,"whitespace")(N):(t.enter("data"),F(N))}function F(N){return N===null||N===124||Se(N)?(t.exit("data"),O(N)):(t.consume(N),N===92?j:F)}function j(N){return N===92||N===124?(t.consume(N),F):F(N)}}function F3(t,e){let n=-1,r=!0,i=0,a=[0,0,0,0],s=[0,0,0,0],u=!1,o=0,l,f,d;const h=new v3;for(;++n<t.length;){const p=t[n],g=p[1];p[0]==="enter"?g.type==="tableHead"?(u=!1,o!==0&&(Xu(h,e,o,l,f),f=void 0,o=0),l={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",l,e]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,d=void 0,a=[0,0,0,0],s=[0,n+1,0,0],u&&(u=!1,f={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",f,e]])),i=g.type==="tableDelimiterRow"?2:f?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(a[1]!==0&&(s[0]=s[1],d=Lr(h,e,a,i,void 0,d),a=[0,0,0,0]),s[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(s[0]=s[1],d=Lr(h,e,a,i,void 0,d)),a=s,s=[a[1],n,0,0])):g.type==="tableHead"?(u=!0,o=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(o=n,a[1]!==0?(s[0]=s[1],d=Lr(h,e,a,i,n,d)):s[1]!==0&&(d=Lr(h,e,s,i,n,d)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(s[3]=n)}for(o!==0&&Xu(h,e,o,l,f),h.consume(e.events),n=-1;++n<e.events.length;){const p=e.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=P3(e.events,n))}return t}function Lr(t,e,n,r,i,a){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(a.end=Object.assign({},mn(e.events,n[0])),t.add(n[0],0,[["exit",a,e]]));const o=mn(e.events,n[1]);if(a={type:s,start:Object.assign({},o),end:Object.assign({},o)},t.add(n[1],0,[["enter",a,e]]),n[2]!==0){const l=mn(e.events,n[2]),f=mn(e.events,n[3]),d={type:u,start:Object.assign({},l),end:Object.assign({},f)};if(t.add(n[2],0,[["enter",d,e]]),r!==2){const h=e.events[n[2]],p=e.events[n[3]];if(h[1].end=Object.assign({},p[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,x=n[3]-n[2]-1;t.add(g,x,[])}}t.add(n[3]+1,0,[["exit",d,e]])}return i!==void 0&&(a.end=Object.assign({},mn(e.events,i)),t.add(i,0,[["exit",a,e]]),a=void 0),a}function Xu(t,e,n,r,i){const a=[],s=mn(e.events,n);i&&(i.end=Object.assign({},s),a.push(["exit",i,e])),r.end=Object.assign({},s),a.push(["exit",r,e]),t.add(n+1,0,a)}function mn(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const H3={name:"tasklistCheck",tokenize:z3};function U3(){return{text:{91:H3}}}function z3(t,e,n){const r=this;return i;function i(o){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(o):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(o),t.exit("taskListCheckMarker"),a)}function a(o){return Se(o)?(t.enter("taskListCheckValueUnchecked"),t.consume(o),t.exit("taskListCheckValueUnchecked"),s):o===88||o===120?(t.enter("taskListCheckValueChecked"),t.consume(o),t.exit("taskListCheckValueChecked"),s):n(o)}function s(o){return o===93?(t.enter("taskListCheckMarker"),t.consume(o),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),u):n(o)}function u(o){return te(o)?e(o):fe(o)?t.check({tokenize:j3},e,n)(o):n(o)}}function j3(t,e,n){return Ee(t,r,"whitespace");function r(i){return i===null?n(i):e(i)}}function $3(t){return Ol([p3(),C3(),O3(t),M3(),U3()])}const Y3={};function q3(t){const e=this,n=t||Y3,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push($3(n)),a.push(c3()),s.push(d3(n))}const V3=v.lazy(()=>Wd(()=>import("./lazy-highlighter-Czs-NOYe.js"),__vite__mapDeps([0,1,2,3,4])));function id(){const t=K.c(3),[e,n]=v.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=async s=>{await navigator.clipboard.writeText(s),n(!0),setTimeout(()=>n(!1),2e3)},t[0]=r):r=t[0];const i=r;let a;return t[1]!==e?(a={handleCopy:i,copied:e},t[1]=e,t[2]=a):a=t[2],a}function W3(){const t=K.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[85,70],t[0]=e):e=t[0];const n=e;let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx("div",{className:"p-4 font-mono text-sm",style:{background:"#2d2d2d",borderRadius:"0 0 0.5rem 0.5rem",overflow:"auto",minHeight:"4rem"},children:n.map(G3)}),t[1]=r):r=t[1],r}function G3(t,e){return m.jsxs("div",{className:"flex gap-2 items-center my-1",children:[e>2&&e<7&&m.jsx("div",{className:"w-4 h-4 rounded-sm opacity-40 animate-pulse",style:{background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.1}s`}}),e%4===0&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"3rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.12}s`}}),e%3===1&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"2.5rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.14}s`}}),m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:`${t}%`,background:"rgba(255, 255, 255, 0.1)",animationDelay:`${e*.1}s`}}),e%5===2&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"4rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.16}s`}})]},e)}function Q3(t){const e=K.c(12),n=v.useRef(null),{handleCopy:r,copied:i}=id(),a=X3;let s;e[0]!==r?(s=async()=>{const h=a(n.current);await r(h)},e[0]=r,e[1]=s):s=e[1];const u=s;let o;e[2]!==i?(o=i?m.jsx(Kt,{size:12}):m.jsx(ti,{size:12}),e[2]=i,e[3]=o):o=e[3];let l;e[4]!==u||e[5]!==o?(l=m.jsx("div",{className:"flex justify-end items-center",children:m.jsxs(Bt,{variant:"ghost",onClick:u,"aria-label":"Copy as CSV",className:"text-muted-foreground hover:text-foreground h-6 text-[10px]",type:"button",children:["Copy as CSV",o]})}),e[4]=u,e[5]=o,e[6]=l):l=e[6];let f;e[7]!==t?(f=m.jsx("div",{className:"overflow-x-auto mb-4 rounded-lg border border-border",children:m.jsx("table",{ref:n,...t,className:"min-w-full border-collapse text-sm",children:t.children})}),e[7]=t,e[8]=f):f=e[8];let d;return e[9]!==l||e[10]!==f?(d=m.jsxs(m.Fragment,{children:[l,f]}),e[9]=l,e[10]=f,e[11]=d):d=e[11],d}function X3(t){return t?Array.from(t.querySelectorAll("tr")).map(Z3).join(`
96
+ `))}function o(p,g,x,_){const b=x.enter("tableCell"),k=x.enter("phrasing"),E=x.containerPhrasing(p,{..._,before:a,after:a});return k(),b(),E}function l(p,g){return Tx(p,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function f(p,g,x){const _=p.children;let b=-1;const k=[],E=g.enter("table");for(;++b<_.length;)k[b]=d(_[b],g,x);return E(),k}function d(p,g,x){const _=p.children;let b=-1;const k=[],E=g.enter("tableRow");for(;++b<_.length;)k[b]=o(_[b],p,g,x);return E(),k}function h(p,g,x){let _=Qc.inlineCode(p,g,x);return x.stack.includes("tableCell")&&(_=_.replace(/\|/g,"\\$&")),_}}function s3(){return{exit:{taskListCheckValueChecked:Qu,taskListCheckValueUnchecked:Qu,paragraph:o3}}}function u3(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:l3}}}function Qu(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function o3(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=e.children;let a=-1,s;for(;++a<i.length;){const u=i[a];if(u.type==="paragraph"){s=u;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function l3(t,e,n,r){const i=t.children[0],a=typeof t.checked=="boolean"&&i&&i.type==="paragraph",s="["+(t.checked?"x":" ")+"] ",u=n.createTracker(r);a&&u.move(s);let o=Qc.listItem(t,e,n,{...r,...u.current()});return a&&(o=o.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),o;function l(f){return f+s}}function c3(){return[jT(),lx(),hx(),Jx(),s3()]}function d3(t){return{extensions:[$T(),cx(t),px(),a3(t),u3()]}}const f3={tokenize:E3,partial:!0},Xc={tokenize:T3,partial:!0},Zc={tokenize:x3,partial:!0},Kc={tokenize:_3,partial:!0},h3={tokenize:y3,partial:!0},Jc={name:"wwwAutolink",tokenize:g3,previous:td},ed={name:"protocolAutolink",tokenize:b3,previous:nd},Ct={name:"emailAutolink",tokenize:m3,previous:rd},bt={};function p3(){return{text:bt}}let Yt=48;for(;Yt<123;)bt[Yt]=Ct,Yt++,Yt===58?Yt=65:Yt===91&&(Yt=97);bt[43]=Ct;bt[45]=Ct;bt[46]=Ct;bt[95]=Ct;bt[72]=[Ct,ed];bt[104]=[Ct,ed];bt[87]=[Ct,Jc];bt[119]=[Ct,Jc];function m3(t,e,n){const r=this;let i,a;return s;function s(d){return!Aa(d)||!rd.call(r,r.previous)||ls(r.events)?n(d):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),u(d))}function u(d){return Aa(d)?(t.consume(d),u):d===64?(t.consume(d),o):n(d)}function o(d){return d===46?t.check(h3,f,l)(d):d===45||d===95||He(d)?(a=!0,t.consume(d),o):f(d)}function l(d){return t.consume(d),i=!0,o}function f(d){return a&&i&&Ye(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(d)):n(d)}}function g3(t,e,n){const r=this;return i;function i(s){return s!==87&&s!==119||!td.call(r,r.previous)||ls(r.events)?n(s):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(f3,t.attempt(Xc,t.attempt(Zc,a),n),n)(s))}function a(s){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(s)}}function b3(t,e,n){const r=this;let i="",a=!1;return s;function s(d){return(d===72||d===104)&&nd.call(r,r.previous)&&!ls(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),t.consume(d),u):n(d)}function u(d){if(Ye(d)&&i.length<5)return i+=String.fromCodePoint(d),t.consume(d),u;if(d===58){const h=i.toLowerCase();if(h==="http"||h==="https")return t.consume(d),o}return n(d)}function o(d){return d===47?(t.consume(d),a?l:(a=!0,o)):n(d)}function l(d){return d===null||Wr(d)||Se(d)||nn(d)||li(d)?n(d):t.attempt(Xc,t.attempt(Zc,f),n)(d)}function f(d){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(d)}}function E3(t,e,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,t.consume(s),i):s===46&&r===3?(t.consume(s),a):n(s)}function a(s){return s===null?n(s):e(s)}}function T3(t,e,n){let r,i,a;return s;function s(l){return l===46||l===95?t.check(Kc,o,u)(l):l===null||Se(l)||nn(l)||l!==45&&li(l)?o(l):(a=!0,t.consume(l),s)}function u(l){return l===95?r=!0:(i=r,r=void 0),t.consume(l),s}function o(l){return i||r||!a?n(l):e(l)}}function x3(t,e){let n=0,r=0;return i;function i(s){return s===40?(n++,t.consume(s),i):s===41&&r<n?a(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?t.check(Kc,e,a)(s):s===null||Se(s)||nn(s)?e(s):(t.consume(s),i)}function a(s){return s===41&&r++,t.consume(s),i}}function _3(t,e,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(t.consume(u),r):u===38?(t.consume(u),a):u===93?(t.consume(u),i):u===60||u===null||Se(u)||nn(u)?e(u):n(u)}function i(u){return u===null||u===40||u===91||Se(u)||nn(u)?e(u):r(u)}function a(u){return Ye(u)?s(u):n(u)}function s(u){return u===59?(t.consume(u),r):Ye(u)?(t.consume(u),s):n(u)}}function y3(t,e,n){return r;function r(a){return t.consume(a),i}function i(a){return He(a)?n(a):e(a)}}function td(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||Se(t)}function nd(t){return!Ye(t)}function rd(t){return!(t===47||Aa(t))}function Aa(t){return t===43||t===45||t===46||t===95||He(t)}function ls(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const A3={tokenize:L3,partial:!0};function C3(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:N3,continuation:{tokenize:w3},exit:R3}},text:{91:{name:"gfmFootnoteCall",tokenize:I3},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:k3,resolveTo:S3}}}}function k3(t,e,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const o=r.events[i][1];if(o.type==="labelImage"){s=o;break}if(o.type==="gfmFootnoteCall"||o.type==="labelLink"||o.type==="label"||o.type==="image"||o.type==="link")break}return u;function u(o){if(!s||!s._balanced)return n(o);const l=lt(r.sliceSerialize({start:s.end,end:r.now()}));return l.codePointAt(0)!==94||!a.includes(l.slice(1))?n(o):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(o),t.exit("gfmFootnoteCallLabelMarker"),e(o))}}function S3(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},t[t.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},u=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",i,e],["exit",i,e],["enter",a,e],["enter",s,e],["exit",s,e],["exit",a,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...u),t}function I3(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,s;return u;function u(d){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(d),t.exit("gfmFootnoteCallLabelMarker"),o}function o(d){return d!==94?n(d):(t.enter("gfmFootnoteCallMarker"),t.consume(d),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",l)}function l(d){if(a>999||d===93&&!s||d===null||d===91||Se(d))return n(d);if(d===93){t.exit("chunkString");const h=t.exit("gfmFootnoteCallString");return i.includes(lt(r.sliceSerialize(h)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(d),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(d)}return Se(d)||(s=!0),a++,t.consume(d),d===92?f:l}function f(d){return d===91||d===92||d===93?(t.consume(d),a++,l):l(d)}}function N3(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,s=0,u;return o;function o(g){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(g){return g===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",f):n(g)}function f(g){if(s>999||g===93&&!u||g===null||g===91||Se(g))return n(g);if(g===93){t.exit("chunkString");const x=t.exit("gfmFootnoteDefinitionLabelString");return a=lt(r.sliceSerialize(x)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),h}return Se(g)||(u=!0),s++,t.consume(g),g===92?d:f}function d(g){return g===91||g===92||g===93?(t.consume(g),s++,f):f(g)}function h(g){return g===58?(t.enter("definitionMarker"),t.consume(g),t.exit("definitionMarker"),i.includes(a)||i.push(a),Ee(t,p,"gfmFootnoteDefinitionWhitespace")):n(g)}function p(g){return e(g)}}function w3(t,e,n){return t.check(xr,e,t.attempt(A3,e,n))}function R3(t){t.exit("gfmFootnoteDefinition")}function L3(t,e,n){const r=this;return Ee(t,i,"gfmFootnoteDefinitionIndent",5);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?e(a):n(a)}}function O3(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,u){let o=-1;for(;++o<s.length;)if(s[o][0]==="enter"&&s[o][1].type==="strikethroughSequenceTemporary"&&s[o][1]._close){let l=o;for(;l--;)if(s[l][0]==="exit"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._open&&s[o][1].end.offset-s[o][1].start.offset===s[l][1].end.offset-s[l][1].start.offset){s[o][1].type="strikethroughSequence",s[l][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},s[l][1].start),end:Object.assign({},s[o][1].end)},d={type:"strikethroughText",start:Object.assign({},s[l][1].end),end:Object.assign({},s[o][1].start)},h=[["enter",f,u],["enter",s[l][1],u],["exit",s[l][1],u],["enter",d,u]],p=u.parser.constructs.insideSpan.null;p&&tt(h,h.length,0,ci(p,s.slice(l+1,o),u)),tt(h,h.length,0,[["exit",d,u],["enter",s[o][1],u],["exit",s[o][1],u],["exit",f,u]]),tt(s,l-1,o-l+3,h),o=l+h.length-2;break}}for(o=-1;++o<s.length;)s[o][1].type==="strikethroughSequenceTemporary"&&(s[o][1].type="data");return s}function a(s,u,o){const l=this.previous,f=this.events;let d=0;return h;function h(g){return l===126&&f[f.length-1][1].type!=="characterEscape"?o(g):(s.enter("strikethroughSequenceTemporary"),p(g))}function p(g){const x=yn(l);if(g===126)return d>1?o(g):(s.consume(g),d++,p);if(d<2&&!n)return o(g);const _=s.exit("strikethroughSequenceTemporary"),b=yn(g);return _._open=!b||b===2&&!!x,_._close=!x||x===2&&!!b,u(g)}}}class v3{constructor(){this.map=[]}add(e,n,r){D3(this,e,n,r)}consume(e){if(this.map.sort(function(a,s){return a[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let i=r.pop();for(;i;){for(const a of i)e.push(a);i=r.pop()}this.map.length=0}}function D3(t,e,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<t.map.length;){if(t.map[i][0]===e){t.map[i][1]+=n,t.map[i][2].push(...r);return}i+=1}t.map.push([e,n,r])}}function P3(t,e){let n=!1;const r=[];for(;e<t.length;){const i=t[e];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function M3(){return{flow:{null:{name:"table",tokenize:B3,resolveAll:F3}}}}function B3(t,e,n){const r=this;let i=0,a=0,s;return u;function u(N){let P=r.events.length-1;for(;P>-1;){const z=r.events[P][1].type;if(z==="lineEnding"||z==="linePrefix")P--;else break}const M=P>-1?r.events[P][1].type:null,J=M==="tableHead"||M==="tableRow"?S:o;return J===S&&r.parser.lazy[r.now().line]?n(N):J(N)}function o(N){return t.enter("tableHead"),t.enter("tableRow"),l(N)}function l(N){return N===124||(s=!0,a+=1),f(N)}function f(N){return N===null?n(N):te(N)?a>1?(a=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(N),t.exit("lineEnding"),p):n(N):fe(N)?Ee(t,f,"whitespace")(N):(a+=1,s&&(s=!1,i+=1),N===124?(t.enter("tableCellDivider"),t.consume(N),t.exit("tableCellDivider"),s=!0,f):(t.enter("data"),d(N)))}function d(N){return N===null||N===124||Se(N)?(t.exit("data"),f(N)):(t.consume(N),N===92?h:d)}function h(N){return N===92||N===124?(t.consume(N),d):d(N)}function p(N){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(N):(t.enter("tableDelimiterRow"),s=!1,fe(N)?Ee(t,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):g(N))}function g(N){return N===45||N===58?_(N):N===124?(s=!0,t.enter("tableCellDivider"),t.consume(N),t.exit("tableCellDivider"),x):R(N)}function x(N){return fe(N)?Ee(t,_,"whitespace")(N):_(N)}function _(N){return N===58?(a+=1,s=!0,t.enter("tableDelimiterMarker"),t.consume(N),t.exit("tableDelimiterMarker"),b):N===45?(a+=1,b(N)):N===null||te(N)?w(N):R(N)}function b(N){return N===45?(t.enter("tableDelimiterFiller"),k(N)):R(N)}function k(N){return N===45?(t.consume(N),k):N===58?(s=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(N),t.exit("tableDelimiterMarker"),E):(t.exit("tableDelimiterFiller"),E(N))}function E(N){return fe(N)?Ee(t,w,"whitespace")(N):w(N)}function w(N){return N===124?g(N):N===null||te(N)?!s||i!==a?R(N):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(N)):R(N)}function R(N){return n(N)}function S(N){return t.enter("tableRow"),O(N)}function O(N){return N===124?(t.enter("tableCellDivider"),t.consume(N),t.exit("tableCellDivider"),O):N===null||te(N)?(t.exit("tableRow"),e(N)):fe(N)?Ee(t,O,"whitespace")(N):(t.enter("data"),F(N))}function F(N){return N===null||N===124||Se(N)?(t.exit("data"),O(N)):(t.consume(N),N===92?j:F)}function j(N){return N===92||N===124?(t.consume(N),F):F(N)}}function F3(t,e){let n=-1,r=!0,i=0,a=[0,0,0,0],s=[0,0,0,0],u=!1,o=0,l,f,d;const h=new v3;for(;++n<t.length;){const p=t[n],g=p[1];p[0]==="enter"?g.type==="tableHead"?(u=!1,o!==0&&(Xu(h,e,o,l,f),f=void 0,o=0),l={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",l,e]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,d=void 0,a=[0,0,0,0],s=[0,n+1,0,0],u&&(u=!1,f={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",f,e]])),i=g.type==="tableDelimiterRow"?2:f?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(a[1]!==0&&(s[0]=s[1],d=Lr(h,e,a,i,void 0,d),a=[0,0,0,0]),s[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(s[0]=s[1],d=Lr(h,e,a,i,void 0,d)),a=s,s=[a[1],n,0,0])):g.type==="tableHead"?(u=!0,o=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(o=n,a[1]!==0?(s[0]=s[1],d=Lr(h,e,a,i,n,d)):s[1]!==0&&(d=Lr(h,e,s,i,n,d)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(s[3]=n)}for(o!==0&&Xu(h,e,o,l,f),h.consume(e.events),n=-1;++n<e.events.length;){const p=e.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=P3(e.events,n))}return t}function Lr(t,e,n,r,i,a){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(a.end=Object.assign({},mn(e.events,n[0])),t.add(n[0],0,[["exit",a,e]]));const o=mn(e.events,n[1]);if(a={type:s,start:Object.assign({},o),end:Object.assign({},o)},t.add(n[1],0,[["enter",a,e]]),n[2]!==0){const l=mn(e.events,n[2]),f=mn(e.events,n[3]),d={type:u,start:Object.assign({},l),end:Object.assign({},f)};if(t.add(n[2],0,[["enter",d,e]]),r!==2){const h=e.events[n[2]],p=e.events[n[3]];if(h[1].end=Object.assign({},p[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,x=n[3]-n[2]-1;t.add(g,x,[])}}t.add(n[3]+1,0,[["exit",d,e]])}return i!==void 0&&(a.end=Object.assign({},mn(e.events,i)),t.add(i,0,[["exit",a,e]]),a=void 0),a}function Xu(t,e,n,r,i){const a=[],s=mn(e.events,n);i&&(i.end=Object.assign({},s),a.push(["exit",i,e])),r.end=Object.assign({},s),a.push(["exit",r,e]),t.add(n+1,0,a)}function mn(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const H3={name:"tasklistCheck",tokenize:z3};function U3(){return{text:{91:H3}}}function z3(t,e,n){const r=this;return i;function i(o){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(o):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(o),t.exit("taskListCheckMarker"),a)}function a(o){return Se(o)?(t.enter("taskListCheckValueUnchecked"),t.consume(o),t.exit("taskListCheckValueUnchecked"),s):o===88||o===120?(t.enter("taskListCheckValueChecked"),t.consume(o),t.exit("taskListCheckValueChecked"),s):n(o)}function s(o){return o===93?(t.enter("taskListCheckMarker"),t.consume(o),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),u):n(o)}function u(o){return te(o)?e(o):fe(o)?t.check({tokenize:j3},e,n)(o):n(o)}}function j3(t,e,n){return Ee(t,r,"whitespace");function r(i){return i===null?n(i):e(i)}}function $3(t){return Ol([p3(),C3(),O3(t),M3(),U3()])}const Y3={};function q3(t){const e=this,n=t||Y3,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push($3(n)),a.push(c3()),s.push(d3(n))}const V3=v.lazy(()=>Wd(()=>import("./lazy-highlighter-CKbv8kMY.js"),__vite__mapDeps([0,1,2,3,4])));function id(){const t=K.c(3),[e,n]=v.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=async s=>{await navigator.clipboard.writeText(s),n(!0),setTimeout(()=>n(!1),2e3)},t[0]=r):r=t[0];const i=r;let a;return t[1]!==e?(a={handleCopy:i,copied:e},t[1]=e,t[2]=a):a=t[2],a}function W3(){const t=K.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[85,70],t[0]=e):e=t[0];const n=e;let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx("div",{className:"p-4 font-mono text-sm",style:{background:"#2d2d2d",borderRadius:"0 0 0.5rem 0.5rem",overflow:"auto",minHeight:"4rem"},children:n.map(G3)}),t[1]=r):r=t[1],r}function G3(t,e){return m.jsxs("div",{className:"flex gap-2 items-center my-1",children:[e>2&&e<7&&m.jsx("div",{className:"w-4 h-4 rounded-sm opacity-40 animate-pulse",style:{background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.1}s`}}),e%4===0&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"3rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.12}s`}}),e%3===1&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"2.5rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.14}s`}}),m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:`${t}%`,background:"rgba(255, 255, 255, 0.1)",animationDelay:`${e*.1}s`}}),e%5===2&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"4rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.16}s`}})]},e)}function Q3(t){const e=K.c(12),n=v.useRef(null),{handleCopy:r,copied:i}=id(),a=X3;let s;e[0]!==r?(s=async()=>{const h=a(n.current);await r(h)},e[0]=r,e[1]=s):s=e[1];const u=s;let o;e[2]!==i?(o=i?m.jsx(Kt,{size:12}):m.jsx(ti,{size:12}),e[2]=i,e[3]=o):o=e[3];let l;e[4]!==u||e[5]!==o?(l=m.jsx("div",{className:"flex justify-end items-center",children:m.jsxs(Bt,{variant:"ghost",onClick:u,"aria-label":"Copy as CSV",className:"text-muted-foreground hover:text-foreground h-6 text-[10px]",type:"button",children:["Copy as CSV",o]})}),e[4]=u,e[5]=o,e[6]=l):l=e[6];let f;e[7]!==t?(f=m.jsx("div",{className:"overflow-x-auto mb-4 rounded-lg border border-border",children:m.jsx("table",{ref:n,...t,className:"min-w-full border-collapse text-sm",children:t.children})}),e[7]=t,e[8]=f):f=e[8];let d;return e[9]!==l||e[10]!==f?(d=m.jsxs(m.Fragment,{children:[l,f]}),e[9]=l,e[10]=f,e[11]=d):d=e[11],d}function X3(t){return t?Array.from(t.querySelectorAll("tr")).map(Z3).join(`
97
97
  `):""}function Z3(t){return Array.from(t.querySelectorAll("th,td")).map(K3).join(",")}function K3(t){let e=t.textContent||"";return e=e.replace(/"/g,'""'),e.search(/([",\n])/g)>=0&&(e=`"${e}"`),e}const J3=[q3],e_=[MT],t_={p:t=>m.jsx("p",{...t,className:"leading-relaxed text-sm mb-2 last:mb-0"}),strong:t=>m.jsx("strong",{...t,className:"font-bold"}),em:t=>m.jsx("em",{...t,className:"italic"}),a:t=>m.jsx("a",{...t,target:"_blank",rel:"noopener noreferrer",className:"text-primary-dark hover:underline break-all font-medium"}),ul:t=>m.jsx("ul",{...t,className:"list-disc ml-6 my-4 space-y-2"}),ol:t=>m.jsx("ol",{...t,className:"list-decimal ml-6 my-4 space-y-2"}),li:t=>m.jsx("li",{...t,className:"leading-relaxed text-sm"}),code:t=>m.jsx("code",{...t,className:"px-1 py-0.5 bg-muted rounded text-sm font-mono break-all"}),pre:t=>m.jsx("pre",{...t,className:"flex w-full min-w-0 my-4 bg-muted rounded overflow-hidden",children:m.jsx("code",{className:"flex-1 min-w-0 p-4 text-sm font-mono whitespace-pre overflow-x-auto",children:t.children})}),table:t=>m.jsx(Q3,{...t}),thead:t=>m.jsx("thead",{...t,className:"bg-muted",children:t.children}),tr:t=>m.jsx("tr",{...t,className:"even:bg-muted/50 border-b border-border last:border-0"}),th:t=>m.jsx("th",{...t,className:"px-4 py-2 text-left font-semibold text-muted-foreground border-b border-border"}),td:t=>m.jsx("td",{...t,className:"px-4 py-2 border-b border-border"})},ad=v.memo(t=>{const e=K.c(2),{content:n}=t;let r;return e[0]!==n?(r=m.jsx(xb,{remarkPlugins:J3,rehypePlugins:e_,components:t_,children:n}),e[0]=n,e[1]=r):r=e[1],r},(t,e)=>t.content===e.content);function n_(t){const e=K.c(20),{language:n,content:r}=t,{handleCopy:i,copied:a}=id(),s=n||"text";let u;e[0]!==s?(u=m.jsx("span",{className:"text-xs font-mono uppercase text-muted-foreground tracking-widest select-none",children:s}),e[0]=s,e[1]=u):u=e[1];let o;e[2]!==r||e[3]!==i?(o=()=>i(r),e[2]=r,e[3]=i,e[4]=o):o=e[4];let l;e[5]!==a?(l=a?m.jsx(Kt,{size:14}):m.jsx(ti,{size:14}),e[5]=a,e[6]=l):l=e[6];let f;e[7]!==o||e[8]!==l?(f=m.jsx(Bt,{size:"icon",variant:"ghost",onClick:o,"aria-label":"Copy code",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:l}),e[7]=o,e[8]=l,e[9]=f):f=e[9];let d;e[10]!==u||e[11]!==f?(d=m.jsxs("div",{className:"flex items-center justify-between p-1 pl-4 bg-muted border-b border-border",children:[u,f]}),e[10]=u,e[11]=f,e[12]=d):d=e[12];let h;e[13]===Symbol.for("react.memo_cache_sentinel")?(h=m.jsx(W3,{}),e[13]=h):h=e[13];let p;e[14]!==r||e[15]!==n?(p=m.jsx(v.Suspense,{fallback:h,children:m.jsx(V3,{language:n,content:r})}),e[14]=r,e[15]=n,e[16]=p):p=e[16];let g;return e[17]!==d||e[18]!==p?(g=m.jsxs("div",{className:"my-4 rounded-lg bg-muted overflow-hidden border border-border grid min-w-0",children:[d,p]}),e[17]=d,e[18]=p,e[19]=g):g=e[19],g}ad.displayName="MemoizedMarkdownBlock";const cs=t=>{const e=K.c(7),{id:n,text:r}=t;let i;e[0]!==r?(i=_e.lexer(r),e[0]=r,e[1]=i):i=e[1];const a=i;let s;if(e[2]!==a||e[3]!==n){let u;e[5]!==n?(u=(o,l)=>o.type==="code"?m.jsx(n_,{language:o.lang,content:o.text},`${n}-block_${l}`):m.jsx(ad,{content:o.raw},`${n}-block_${l}`),e[5]=n,e[6]=u):u=e[6],s=a.map(u),e[2]=a,e[3]=n,e[4]=s}else s=e[4];return s};cs.displayName="MemoizedMarkdown";function sd(t){const e=K.c(18),{id:n,part:r,copyable:i,extraActions:a,hasToolCallAfter:s}=t,u=i===void 0?!1:i,o=s===void 0?!1:s,{handleCopy:l}=L0(),[f,d]=v.useState(!1);let h;e[0]!==l||e[1]!==r.text?(h=async()=>{await l(r.text),d(!0),setTimeout(()=>d(!1),2e3)},e[0]=l,e[1]=r.text,e[2]=h):h=e[2];const p=h,g=u&&a,x=g||a,_=!o&&"mb-2";let b;e[3]!==_?(b=ce("group/part relative",_),e[3]=_,e[4]=b):b=e[4];let k;e[5]!==n||e[6]!==r.text?(k=m.jsx(cs,{id:n,text:r.text}),e[5]=n,e[6]=r.text,e[7]=k):k=e[7];let E;e[8]!==a||e[9]!==p||e[10]!==f||e[11]!==x||e[12]!==g?(E=x&&m.jsx("div",{className:"flex w-full items-center text-xs text-muted-foreground opacity-0 pointer-events-none transition-all duration-200 group-hover/part:opacity-100 group-hover/part:pointer-events-auto mt-2",children:m.jsxs("div",{className:"flex items-center gap-1",children:[g&&m.jsx(Bt,{onClick:p,variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground size-6 whitespace-nowrap",children:f?m.jsx(Kt,{size:12}):m.jsx(ti,{size:12})}),a]})}),e[8]=a,e[9]=p,e[10]=f,e[11]=x,e[12]=g,e[13]=E):E=e[13];let w;return e[14]!==b||e[15]!==k||e[16]!==E?(w=m.jsxs("div",{className:b,children:[k,E]}),e[14]=b,e[15]=k,e[16]=E,e[17]=w):w=e[17],w}function r_(t){const e=K.c(27),{toolName:n,input:r,output:i}=t;let a;if(e[0]!==i){const o=JSON.stringify(i,null,2);a=o.length>2e3?o.slice(0,2e3)+"...[TRUNCATED]":o,e[0]=i,e[1]=a}else a=e[1];const s=a;if(n==="READ_MCP_TOOLS"){const o=r?.id;if(o){let l;return e[2]!==o?(l=m.jsx(Zu,{connectionId:o}),e[2]=o,e[3]=l):l=e[3],l}}if(n==="CALL_MCP_TOOL"){const o=r?.connectionId;let l;e[4]!==o?(l=o&&m.jsx(Zu,{connectionId:o,compact:!0}),e[4]=o,e[5]=l):l=e[5];let f;e[6]!==i?(f=JSON.stringify(i,null,2),e[6]=i,e[7]=f):f=e[7];let d;e[8]!==f?(d=m.jsx("div",{className:"absolute top-1 right-1 z-10",children:m.jsx(i_,{text:f})}),e[8]=f,e[9]=d):d=e[9];let h;e[10]===Symbol.for("react.memo_cache_sentinel")?(h=m.jsx("div",{className:"font-semibold text-muted-foreground mb-0.5 text-[10px] uppercase tracking-wider px-2 pt-2",children:"Input"}),e[10]=h):h=e[10];let p;e[11]!==r?(p=JSON.stringify(r,null,2),e[11]=r,e[12]=p):p=e[12];let g;e[13]!==p?(g=m.jsx("div",{className:"mb-2",children:m.jsx(Dr,{jsonString:p,padding:"0.5rem"})}),e[13]=p,e[14]=g):g=e[14];let x;e[15]===Symbol.for("react.memo_cache_sentinel")?(x=m.jsx("div",{className:"font-semibold text-muted-foreground mb-0.5 text-[10px] uppercase tracking-wider px-2",children:"Output"}),e[15]=x):x=e[15];let _;e[16]!==s?(_=m.jsx("div",{children:m.jsx(Dr,{jsonString:s,padding:"0.5rem"})}),e[16]=s,e[17]=_):_=e[17];let b;e[18]!==d||e[19]!==g||e[20]!==_?(b=m.jsxs("div",{className:"relative bg-muted rounded-md overflow-auto max-h-[200px]",children:[d,h,g,x,_]}),e[18]=d,e[19]=g,e[20]=_,e[21]=b):b=e[21];let k;return e[22]!==b||e[23]!==l?(k=m.jsxs("div",{className:"flex flex-col gap-2",children:[l,b]}),e[22]=b,e[23]=l,e[24]=k):k=e[24],k}let u;return e[25]!==s?(u=m.jsx(Dr,{jsonString:s,padding:"0"}),e[25]=s,e[26]=u):u=e[26],u}function Zu(t){const e=K.c(15),{connectionId:n,compact:r}=t,i=Kd(n),{org:a}=Mt(),{slug:s}=a,u=Gd();if(!i)return null;let o;e[0]!==i.id||e[1]!==u||e[2]!==s?(o=()=>{u({to:"/$org/mcps/$connectionId",params:{org:s,connectionId:i.id}})},e[0]=i.id,e[1]=u,e[2]=s,e[3]=o):o=e[3];const l=o;if(r){let d;e[4]!==i.title?(d=m.jsx("span",{className:"font-medium text-foreground",children:i.title}),e[4]=i.title,e[5]=d):d=e[5];let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=m.jsx(pf,{size:12}),e[6]=h):h=e[6];let p;e[7]!==l?(p=m.jsx("button",{type:"button",onClick:l,className:"hover:text-foreground transition-colors",title:"Open connection",children:h}),e[7]=l,e[8]=p):p=e[8];let g;return e[9]!==d||e[10]!==p?(g=m.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-muted/50 px-2 py-1 rounded-md w-fit",children:[d,p]}),e[9]=d,e[10]=p,e[11]=g):g=e[11],g}let f;return e[12]!==i||e[13]!==l?(f=m.jsx(hf,{connection:i,onClick:l}),e[12]=i,e[13]=l,e[14]=f):f=e[14],f}function i_({text:t}){const e=async()=>{try{if(navigator.clipboard)await navigator.clipboard.writeText(t),Ci.success("Copied to clipboard");else throw new Error("Clipboard API unavailable")}catch(n){try{const r=document.createElement("textarea");r.value=t,r.style.position="fixed",r.style.left="-9999px",r.style.top="0",document.body.appendChild(r),r.focus(),r.select();const i=document.execCommand("copy");if(document.body.removeChild(r),i)Ci.success("Copied to clipboard");else throw new Error("Fallback copy failed")}catch(r){console.error("Copy failed",n,r),Ci.error("Failed to copy to clipboard")}}};return m.jsx(Bt,{size:"icon",variant:"ghost",className:"h-5 w-5 hover:bg-background/50",onClick:e,children:m.jsx(ti,{size:12})})}function Ku(t){const e=K.c(50),{part:n}=t,{state:r}=n;let i;e[0]!==n?(i="toolName"in n?n.toolName:n.type.replace("tool-",""),e[0]=n,e[1]=i):i=e[1];const a=i,[s,u]=v.useState(!1);let o;e[2]!==s?(o=()=>u(!s),e[2]=s,e[3]=o):o=e[3];let l;e[4]!==r?(l=r==="output-error"?m.jsx(df,{className:"size-4 text-destructive shrink-0"}):m.jsx(ff,{className:ce("size-4 text-muted-foreground shrink-0",(r==="input-streaming"||r==="input-available")&&"shimmer")}),e[4]=r,e[5]=l):l=e[5];const f=r==="output-error"&&"text-destructive/90",d=(r==="input-streaming"||r==="input-available")&&"shimmer";let h;e[6]!==f||e[7]!==d?(h=ce("text-xs font-medium text-muted-foreground truncate",f,d),e[6]=f,e[7]=d,e[8]=h):h=e[8];const p=r==="input-streaming"&&`Streaming ${a} arguments`,g=r==="input-available"&&`Calling ${a}`,x=r==="output-available"&&`Called ${a}`,_=r==="output-error"&&`Error calling ${a}`;let b;e[9]!==_||e[10]!==h||e[11]!==p||e[12]!==g||e[13]!==x?(b=m.jsxs("span",{className:h,children:[p,g,x,_]}),e[9]=_,e[10]=h,e[11]=p,e[12]=g,e[13]=x,e[14]=b):b=e[14];let k;e[15]!==b||e[16]!==l?(k=m.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[l,b]}),e[15]=b,e[16]=l,e[17]=k):k=e[17];const E=s&&"rotate-90";let w;e[18]!==E?(w=ce("size-4 text-muted-foreground transition-transform",E),e[18]=E,e[19]=w):w=e[19];let R;e[20]!==w?(R=m.jsx("div",{className:"flex items-center gap-2 shrink-0",children:m.jsx(go,{className:w})}),e[20]=w,e[21]=R):R=e[21];let S;e[22]!==k||e[23]!==R||e[24]!==o?(S=m.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-2 w-full cursor-pointer p-3",children:[k,R]}),e[22]=k,e[23]=R,e[24]=o,e[25]=S):S=e[25];const O=s?"max-h-[1000px] opacity-100":"max-h-0 opacity-0";let F;e[26]!==O?(F=ce("transition-all duration-200 ease-in-out overflow-hidden",O),e[26]=O,e[27]=F):F=e[27];let j;e[28]===Symbol.for("react.memo_cache_sentinel")?(j=m.jsx("div",{className:"w-4 relative shrink-0",children:m.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-0.25 bg-border"})}),e[28]=j):j=e[28];let N;e[29]!==n.input||e[30]!==r?(N=(r==="input-streaming"||r==="input-available"||r==="output-available")&&!!n.input&&m.jsxs("div",{className:"flex flex-col gap-0.5",children:[m.jsx("div",{className:"px-1 h-5 flex items-center",children:m.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Input"})}),m.jsx("div",{className:"border border-border rounded-lg max-h-[200px] overflow-auto p-2",children:m.jsx(Dr,{jsonString:JSON.stringify(n.input,null,2),padding:"0"})})]}),e[29]=n.input,e[30]=r,e[31]=N):N=e[31];let P;e[32]!==n.input||e[33]!==n.output||e[34]!==r||e[35]!==a?(P=r==="output-available"&&m.jsxs("div",{className:"flex flex-col gap-0.5",children:[m.jsx("div",{className:"px-1 h-5 flex items-center",children:m.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Output"})}),m.jsx("div",{className:"border border-border rounded-lg max-h-[200px] overflow-auto p-2",children:m.jsx(r_,{toolName:a,input:n.input,output:n.output})})]}),e[32]=n.input,e[33]=n.output,e[34]=r,e[35]=a,e[36]=P):P=e[36];let M;e[37]!==n||e[38]!==r?(M=r==="output-error"&&m.jsxs("div",{className:"flex flex-col gap-0.5",children:[m.jsx("div",{className:"px-1 h-5 flex items-center",children:m.jsx("span",{className:"text-xs font-medium text-destructive/90",children:"Error"})}),m.jsx("div",{className:"border border-destructive/20 rounded-lg max-h-[200px] overflow-auto p-2 bg-destructive/10",children:m.jsx("pre",{className:"text-xs font-mono text-destructive whitespace-pre-wrap wrap-break-word",children:"errorText"in n&&typeof n.errorText=="string"?n.errorText:"An unknown error occurred"})})]}),e[37]=n,e[38]=r,e[39]=M):M=e[39];let J;e[40]!==N||e[41]!==P||e[42]!==M?(J=m.jsxs("div",{className:"flex ml-[7px] px-3 pb-3",children:[j,m.jsxs("div",{className:"flex flex-col gap-4 flex-1 min-w-0 pt-2",children:[N,P,M]})]}),e[40]=N,e[41]=P,e[42]=M,e[43]=J):J=e[43];let z;e[44]!==F||e[45]!==J?(z=m.jsx("div",{className:F,children:J}),e[44]=F,e[45]=J,e[46]=z):z=e[46];let H;return e[47]!==S||e[48]!==z?(H=m.jsx("div",{className:"flex flex-col my-4 w-full min-w-0",children:m.jsxs("div",{className:"border border-border/75 rounded-lg flex flex-col bg-background w-full min-w-0 overflow-hidden",children:[S,z]})}),e[47]=S,e[48]=z,e[49]=H):H=e[49],H}const a_={openrouter:t=>{const e=t?.openrouter;return typeof e=="object"&&e!==null&&"usage"in e&&typeof e.usage=="object"&&e.usage!==null&&"cost"in e.usage&&typeof e.usage.cost=="number"?e.usage.cost:null}};function s_(t){if(!t?.providerMetadata)return null;for(const e of Object.values(a_)){const n=e(t.providerMetadata);if(n!==null)return n}return null}function u_(t){return t.reduce((e,n)=>{const r=n.metadata?.usage;return r?{inputTokens:e.inputTokens+(r.inputTokens??0),outputTokens:e.outputTokens+(r.outputTokens??0),totalTokens:e.totalTokens+(r.totalTokens??0),cost:e.cost+(s_(r)??0)}:e},{inputTokens:0,outputTokens:0,totalTokens:0,cost:0})}function o_(t){const e=K.c(38),{messages:n}=t;let r,i,a,s,u,o,l,f,d,h,p,g;if(e[0]!==n){g=Symbol.for("react.early_return_sentinel");e:{const w=u_(n);if(!w){g=null;break e}const{totalTokens:R,inputTokens:S,outputTokens:O,cost:F}=w;if(a=F,!R&&!S&&!O){g=null;break e}i=Ia;let j;e[13]===Symbol.for("react.memo_cache_sentinel")?(j=m.jsx(bo,{size:12}),e[13]=j):j=e[13];const N=m.jsxs(Bt,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground pl-1! h-6 gap-1 whitespace-nowrap",children:[j,m.jsx("span",{className:"text-[10px] font-mono tabular-nums",children:R.toLocaleString()})]});e[14]!==N?(p=m.jsx(Na,{asChild:!0,children:N}),e[14]=N,e[15]=p):p=e[15],r=wa,d="top",h="font-mono text-[11px]",u="grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",e[16]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx("span",{className:"text-muted",children:"in"}),e[16]=o):o=e[16],l=m.jsx("span",{children:S.toLocaleString()}),e[17]===Symbol.for("react.memo_cache_sentinel")?(f=m.jsx("span",{className:"text-muted",children:"out"}),e[17]=f):f=e[17],s=O.toLocaleString()}e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=s,e[5]=u,e[6]=o,e[7]=l,e[8]=f,e[9]=d,e[10]=h,e[11]=p,e[12]=g}else r=e[1],i=e[2],a=e[3],s=e[4],u=e[5],o=e[6],l=e[7],f=e[8],d=e[9],h=e[10],p=e[11],g=e[12];if(g!==Symbol.for("react.early_return_sentinel"))return g;let x;e[18]!==s?(x=m.jsx("span",{children:s}),e[18]=s,e[19]=x):x=e[19];let _;e[20]!==a?(_=a>0&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-muted",children:"cost"}),m.jsxs("span",{children:["$",a.toFixed(4)]})]}),e[20]=a,e[21]=_):_=e[21];let b;e[22]!==x||e[23]!==_||e[24]!==u||e[25]!==o||e[26]!==l||e[27]!==f?(b=m.jsxs("div",{className:u,children:[o,l,f,x,_]}),e[22]=x,e[23]=_,e[24]=u,e[25]=o,e[26]=l,e[27]=f,e[28]=b):b=e[28];let k;e[29]!==r||e[30]!==b||e[31]!==d||e[32]!==h?(k=m.jsx(r,{side:d,className:h,children:b}),e[29]=r,e[30]=b,e[31]=d,e[32]=h,e[33]=k):k=e[33];let E;return e[34]!==i||e[35]!==k||e[36]!==p?(E=m.jsxs(i,{children:[p,k]}),e[34]=i,e[35]=k,e[36]=p,e[37]=E):E=e[37],E}const l_={planning:{icon:m.jsx(Io,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Planning next moves"},thinking:{icon:m.jsx(ni,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Thinking"}},c_=1200;function d_(){const t=K.c(7),[e,n]=v.useState("planning");let r,i;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const o=setTimeout(()=>{n("thinking")},c_);return()=>{clearTimeout(o)}},i=[],t[0]=r,t[1]=i):(r=t[0],i=t[1]),v.useEffect(r,i);const a=l_[e];let s;t[2]!==a.label?(s=m.jsxs("span",{className:"text-xs text-muted-foreground shimmer",children:[a.label,"..."]}),t[2]=a.label,t[3]=s):s=t[3];let u;return t[4]!==a.icon||t[5]!==s?(u=m.jsx("div",{className:"flex items-center gap-1.5 py-2 opacity-60",children:m.jsxs("span",{className:"flex items-center gap-1.5",children:[a.icon,s]})}),t[4]=a.icon,t[5]=s,t[6]=u):u=t[6],u}function f_(t){const e=K.c(10),{duration:n,parts:r,id:i}=t,a=n/1e3;let s;e[0]!==a?(s=a.toFixed(1),e[0]=a,e[1]=s):s=e[1];const u=s,[o,l]=v.useState(!1),[f,d]=v.useState(!1);let h;if(e[2]!==i||e[3]!==f||e[4]!==o||e[5]!==r||e[6]!==u){const p=r.filter(p_),g=p.some(h_),x=g||f;let _,b;e[8]===Symbol.for("react.memo_cache_sentinel")?(_=()=>l(!0),b=()=>l(!1),e[8]=_,e[9]=b):(_=e[8],b=e[9]),h=m.jsxs("div",{className:"flex flex-col mb-2",children:[m.jsx("button",{type:"button",onClick:()=>!g&&d(!f),onMouseEnter:_,onMouseLeave:b,className:ce("flex items-center gap-1.5 py-2 opacity-60 transition-opacity",!g&&"cursor-pointer hover:opacity-100",g&&"cursor-default"),children:m.jsxs("span",{className:"flex items-center gap-1.5",children:[g?m.jsx(ni,{className:"text-muted-foreground shrink-0 shimmer",size:14}):o?m.jsx(go,{className:ce("text-muted-foreground transition-transform shrink-0",f&&"rotate-90"),size:14}):m.jsx(Ao,{className:"text-muted-foreground shrink-0",size:14}),m.jsx("span",{className:ce("text-xs text-muted-foreground",g&&"shimmer"),children:g?"Thinking...":`Thought for ${u}s`})]})}),x&&m.jsx("div",{className:"ml-[6px] border-l-2 pl-4 mt-1 mb-2 max-h-[300px] overflow-y-auto",children:p.map((k,E)=>m.jsx("div",{className:"text-muted-foreground markdown-sm pb-2",children:m.jsx(cs,{id:`${i}-reasoning-${E}`,text:k.text})},`${i}-reasoning-${E}`))})]}),e[2]=i,e[3]=f,e[4]=o,e[5]=r,e[6]=u,e[7]=h}else h=e[7];return h}function h_(t){return t.state==="streaming"}function p_(t){return t.type==="reasoning"}function m_(t){const e=K.c(11),{part:n,id:r,usageStats:i,isFollowedByToolCall:a}=t;switch(n.type){case"dynamic-tool":{let s;return e[0]!==r||e[1]!==n?(s=m.jsx(Ku,{part:n,id:r}),e[0]=r,e[1]=n,e[2]=s):s=e[2],s}case"text":{let s;return e[3]!==r||e[4]!==a||e[5]!==n||e[6]!==i?(s=m.jsx(sd,{id:r,part:n,extraActions:i,copyable:!0,hasToolCallAfter:a}),e[3]=r,e[4]=a,e[5]=n,e[6]=i,e[7]=s):s=e[7],s}case"reasoning":return null;case"step-start":case"file":case"source-url":case"source-document":return null;default:if(n.type.startsWith("tool-")){const s=n;let u;return e[8]!==r||e[9]!==s?(u=m.jsx(Ku,{part:s,id:r}),e[8]=r,e[9]=s,e[10]=u):u=e[10],u}}throw new Error(`Unknown part type: ${n.type}`)}function g_(t){const e=K.c(32),{message:n,status:r,className:i}=t,{id:a,parts:s}=n,l=r==="streaming"||r==="submitted",f=v.useRef(null);let d;e[0]!==a?(d=()=>{const z=localStorage.getItem(`msg-duration-${a}`);return z?Number(z):null},e[0]=a,e[1]=d):d=e[1];const[h,p]=v.useState(d);let g,x;e[2]!==l?(g=()=>{l&&f.current===null&&(f.current=Date.now())},x=[l],e[2]=l,e[3]=g,e[4]=x):(g=e[3],x=e[4]),v.useEffect(g,x);let _,b;e[5]!==h||e[6]!==a||e[7]!==s.length?(_=()=>{if(s.length>0&&h===null&&f.current!==null){const z=Date.now()-f.current;p(z),localStorage.setItem(`msg-duration-${a}`,z.toString())}},b=[s.length,h,a],e[5]=h,e[6]=a,e[7]=s.length,e[8]=_,e[9]=b):(_=e[8],b=e[9]),v.useEffect(_,b);const k=s.length>0;let E;e[10]!==s?(E=s.some(E_),e[10]=s,e[11]=E):E=e[11];const w=E;let R;e[12]!==l||e[13]!==s?(R=l&&s.some(b_),e[12]=l,e[13]=s,e[14]=R):R=e[14];const O=k&&(w||R)&&h!==null;let F;e[15]!==n?(F=m.jsx(o_,{messages:[n]}),e[15]=n,e[16]=F):F=e[16];const j=F;let N;e[17]!==i?(N=ce("w-full min-w-0 group relative flex items-start gap-4 px-4 z-20 text-foreground flex-row",i),e[17]=i,e[18]=N):N=e[18];let P;e[19]!==h||e[20]!==k||e[21]!==a||e[22]!==l||e[23]!==s||e[24]!==O||e[25]!==j?(P=k?m.jsxs(m.Fragment,{children:[O&&m.jsx(f_,{duration:h,parts:s,id:a}),s.map((z,H)=>{const Z=s[H+1],re=Z&&(Z.type==="dynamic-tool"||Z.type.startsWith("tool-"));return m.jsx(m_,{part:z,id:a,usageStats:H===s.length-1?j:void 0,isFollowedByToolCall:re},`${a}-${H}`)})]}):l?m.jsx(d_,{}):null,e[19]=h,e[20]=k,e[21]=a,e[22]=l,e[23]=s,e[24]=O,e[25]=j,e[26]=P):P=e[26];let M;e[27]!==P?(M=m.jsx("div",{className:"flex flex-col min-w-0 w-full items-start",children:m.jsx("div",{className:"w-full min-w-0 not-only:rounded-2xl text-sm wrap-break-word overflow-wrap-anywhere bg-transparent",children:P})}),e[27]=P,e[28]=M):M=e[28];let J;return e[29]!==M||e[30]!==N?(J=m.jsx("div",{className:N,children:M}),e[29]=M,e[30]=N,e[31]=J):J=e[31],J}function b_(t){return t.type==="reasoning"&&t.state==="streaming"}function E_(t){return t.type==="reasoning"}const ud=v.createContext(null);function od(t){const e=K.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx(m.Fragment,{children:n}),e[0]=n,e[1]=r):r=e[1],r}function T_(t){const e=[];for(let n=0;n<t.length;n++){const r=t[n];if(!v.isValidElement(r))continue;if(r.props?.message?.role==="assistant"){const a=t[n-1],s=v.isValidElement(a)&&a.props?.message?.role,u=a&&v.isValidElement(a)&&s==="user"?a:null;e.push({user:u,assistant:r})}}return e}function x_(t){const e=K.c(27),{children:n,className:r,minHeightOffset:i}=t,a=v.useRef(null);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],e[0]=s):s=e[0];const u=v.useRef(s);let o,l,f,d,h,p,g;if(e[1]!==n||e[2]!==r||e[3]!==i){const k=v.Children.toArray(n),E=k[k.length-1];l=E&&v.isValidElement(E)&&E.type===od?E:null;const w=l?k.slice(0,-1):k,R=T_(w);let S;e[11]===Symbol.for("react.memo_cache_sentinel")?(S=F=>{const j=u.current[F];if(j&&a.current){const N=a.current.offsetTop,P=j.offsetTop;a.current.scrollTo({top:P-N,behavior:"smooth"})}},e[11]=S):S=e[11];const O=S;o=ud.Provider,e[12]===Symbol.for("react.memo_cache_sentinel")?(g={scrollToPair:O},e[12]=g):g=e[12],h=a,e[13]!==r?(p=ce("w-full min-w-0 max-w-full overflow-y-auto h-full overflow-x-hidden",r),e[13]=r,e[14]=p):p=e[14],f="flex flex-col min-w-0 max-w-2xl mx-auto w-full",d=R.map((F,j)=>{const N=j===R.length-1;return m.jsxs("div",{ref:P=>{u.current[j]=P},className:"flex flex-col pb-2",style:N&&i?{minHeight:`calc(100vh - ${i}px)`}:void 0,children:[m.jsx("div",{className:"sticky top-0 z-50 bg-background w-full h-4"}),m.jsx("div",{className:"sticky mb-3 top-4 z-50",children:F.user&&v.isValidElement(F.user)?v.cloneElement(F.user,{pairIndex:j}):F.user}),F.assistant]},j)}),e[1]=n,e[2]=r,e[3]=i,e[4]=o,e[5]=l,e[6]=f,e[7]=d,e[8]=h,e[9]=p,e[10]=g}else o=e[4],l=e[5],f=e[6],d=e[7],h=e[8],p=e[9],g=e[10];let x;e[15]!==l||e[16]!==f||e[17]!==d?(x=m.jsxs("div",{className:f,children:[d,l]}),e[15]=l,e[16]=f,e[17]=d,e[18]=x):x=e[18];let _;e[19]!==h||e[20]!==p||e[21]!==x?(_=m.jsx("div",{ref:h,className:p,children:x}),e[19]=h,e[20]=p,e[21]=x,e[22]=_):_=e[22];let b;return e[23]!==o||e[24]!==g||e[25]!==_?(b=m.jsx(o,{value:g,children:_}),e[23]=o,e[24]=g,e[25]=_,e[26]=b):b=e[26],b}function __(t){const e=K.c(5),{locator:n}=Mt(),r=Lo(),i=Oa();let a;return e[0]!==n||e[1]!==r||e[2]!==t||e[3]!==i?(a=async(u,o,l)=>{const f=await Ro(n,l),d=f.findIndex(_=>_.id===u);if(d===-1){console.warn(`[branch] Message ${u} not found in thread ${l}`);return}const h=f.slice(0,d).filter(y_),p=crypto.randomUUID(),g=new Date().toISOString(),x={id:p,title:"",created_at:g,updated_at:g,hidden:!1};if(await i.insert.mutateAsync(x),h.length>0){const _=h.map(b=>({...b,id:crypto.randomUUID(),metadata:{...b.metadata,thread_id:p,created_at:b.metadata?.created_at||g}}));await r.insertMany.mutateAsync(_)}t(p)},e[0]=n,e[1]=r,e[2]=t,e[3]=i,e[4]=a):a=e[4],a}function y_(t){return t.role!=="system"}function A_(t){const e=K.c(18),{messageId:n,parts:r}=t,[i,a]=v.useState(!1),{setInputValue:s,startBranch:u,setActiveThreadId:o,activeThreadId:l}=w0(),f=__(o);let d;e[0]!==r?(d=r.filter(k_).map(C_).join(`
98
98
  `),e[0]=r,e[1]=d):d=e[1];const h=d;let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=S=>{S.stopPropagation(),a(!0)},e[2]=p):p=e[2];const g=p;let x;e[3]!==l||e[4]!==f||e[5]!==n||e[6]!==h||e[7]!==s||e[8]!==u?(x=async()=>{await f(n,h,l),s(h),u({originalThreadId:l,originalMessageId:n,originalMessageText:h}),a(!1)},e[3]=l,e[4]=f,e[5]=n,e[6]=h,e[7]=s,e[8]=u,e[9]=x):x=e[9];const _=x;let b;e[10]===Symbol.for("react.memo_cache_sentinel")?(b=m.jsx("div",{className:"flex justify-center items-end px-2 pb-1",children:m.jsxs(Ia,{children:[m.jsx(Na,{asChild:!0,children:m.jsx(Bt,{onClick:g,variant:"ghost",size:"xs",className:"opacity-0 group-hover:opacity-100 hover:bg-gray-200/70 rounded-md transition-opacity text-muted-foreground hover:text-foreground aspect-square w-6 h-6 p-0",children:m.jsx(_o,{size:16,className:"p-0.5"})})}),m.jsx(wa,{side:"bottom",children:"Edit message"})]})}),e[10]=b):b=e[10];let k;e[11]===Symbol.for("react.memo_cache_sentinel")?(k=m.jsxs(mf,{children:[m.jsx(gf,{children:"Edit message?"}),m.jsx(bf,{children:"This will create a new conversation branch from this point. The original conversation will remain unchanged."})]}),e[11]=k):k=e[11];let E;e[12]===Symbol.for("react.memo_cache_sentinel")?(E=m.jsx(Ef,{children:"Cancel"}),e[12]=E):E=e[12];let w;e[13]!==_?(w=m.jsxs(Tf,{children:[k,m.jsxs(xf,{children:[E,m.jsx(_f,{onClick:_,children:"Confirm"})]})]}),e[13]=_,e[14]=w):w=e[14];let R;return e[15]!==i||e[16]!==w?(R=m.jsxs(m.Fragment,{children:[b,m.jsx(yf,{open:i,onOpenChange:a,children:w})]}),e[15]=i,e[16]=w,e[17]=R):R=e[17],R}function C_(t){return t.text}function k_(t){return t.type==="text"}function S_(t){const e=K.c(29),{message:n,className:r,pairIndex:i}=t,{id:a,parts:s}=n,u=v.useContext(ud),[o,l]=v.useState(!1);if(!s||s.length===0)return null;let f;e[0]!==u||e[1]!==i?(f=()=>{l(!0),i!==void 0&&u?.scrollToPair(i)},e[0]=u,e[1]=i,e[2]=f):f=e[2];const d=f;let h;e[3]!==r?(h=ce("message-block w-full min-w-0 group relative flex items-start gap-4 px-2.5 text-foreground flex-row-reverse",r),e[3]=r,e[4]=h):h=e[4];let p,g;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=()=>l(!0),g=()=>l(!1),e[5]=p,e[6]=g):(p=e[5],g=e[6]);const x=o?"overflow-auto opacity-100":"overflow-hidden opacity-99 mask-b-from-1%";let _;e[7]!==x?(_=ce("z-10 px-4 py-2 transition-opacity max-h-[120px] flex-1",x),e[7]=x,e[8]=_):_=e[8];let b;if(e[9]!==a||e[10]!==s){let O;e[12]!==a?(O=(F,j)=>F.type==="text"?m.jsx(sd,{id:a,part:F},`${a}-${j}`):null,e[12]=a,e[13]=O):O=e[13],b=s.map(O),e[9]=a,e[10]=s,e[11]=b}else b=e[11];let k;e[14]!==b?(k=m.jsx("div",{children:b}),e[14]=b,e[15]=k):k=e[15];let E;e[16]!==_||e[17]!==k?(E=m.jsx("div",{className:_,children:k}),e[16]=_,e[17]=k,e[18]=E):E=e[18];let w;e[19]!==a||e[20]!==s?(w=m.jsx(A_,{messageId:a,parts:s}),e[19]=a,e[20]=s,e[21]=w):w=e[21];let R;e[22]!==d||e[23]!==w||e[24]!==E?(R=m.jsxs("div",{tabIndex:0,onClick:d,onFocus:p,onBlur:g,className:"w-full border min-w-0 shadow-xs rounded-lg text-[0.9375rem] wrap-break-word overflow-wrap-anywhere bg-background cursor-pointer transition-colors relative flex outline-none",children:[E,w]}),e[22]=d,e[23]=w,e[24]=E,e[25]=R):R=e[25];let S;return e[26]!==R||e[27]!==h?(S=m.jsx(m.Fragment,{children:m.jsx("div",{className:h,children:R})}),e[26]=R,e[27]=h,e[28]=S):S=e[28],S}function I_(t){const e=K.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(kn.Root,{"data-slot":"drawer",...n}),e[2]=n,e[3]=r):r=e[3],r}function N_(t){const e=K.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(kn.Trigger,{"data-slot":"drawer-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function w_(t){const e=K.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(kn.Portal,{"data-slot":"drawer-portal",...n}),e[2]=n,e[3]=r):r=e[3],r}function R_(t){const e=K.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=ce("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",n),e[3]=n,e[4]=i):i=e[4];let a;return e[5]!==r||e[6]!==i?(a=m.jsx(kn.Overlay,{"data-slot":"drawer-overlay",className:i,...r}),e[5]=r,e[6]=i,e[7]=a):a=e[7],a}function L_(t){const e=K.c(12);let n,r,i;e[0]!==t?({className:r,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx(R_,{}),e[4]=a):a=e[4];let s;e[5]!==r?(s=ce("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",r),e[5]=r,e[6]=s):s=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=u):u=e[7];let o;return e[8]!==n||e[9]!==i||e[10]!==s?(o=m.jsxs(w_,{"data-slot":"drawer-portal",children:[a,m.jsxs(kn.Content,{"data-slot":"drawer-content",className:s,...i,children:[u,n]})]}),e[8]=n,e[9]=i,e[10]=s,e[11]=o):o=e[11],o}function O_(t){const e=K.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=ce("flex flex-col gap-1.5 px-4 py-2",n),e[3]=n,e[4]=i):i=e[4];let a;return e[5]!==r||e[6]!==i?(a=m.jsx("div",{"data-slot":"drawer-header",className:i,...r}),e[5]=r,e[6]=i,e[7]=a):a=e[7],a}function v_(t){const e=K.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=ce("text-foreground font-semibold",n),e[3]=n,e[4]=i):i=e[4];let a;return e[5]!==r||e[6]!==i?(a=m.jsx(kn.Title,{"data-slot":"drawer-title",className:i,...r}),e[5]=r,e[6]=i,e[7]=a):a=e[7],a}function Ju({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,i]=D_({defaultProp:e,onChange:n}),a=t!==void 0,s=a?t:r,u=ho(n),o=v.useCallback(l=>{if(a){const d=typeof l=="function"?l(t):l;d!==t&&u(d)}else i(l)},[a,t,i,u]);return[s,o]}function D_({defaultProp:t,onChange:e}){const n=v.useState(t),[r]=n,i=v.useRef(r),a=ho(e);return v.useEffect(()=>{i.current!==r&&(a(r),i.current=r)},[r,i,a]),n}const ld=v.createContext({isMobile:!1,setValue:()=>{}}),ds=()=>v.useContext(ld),cd=t=>{const e=K.c(37);let n,r,i,a,s,u,o,l;e[0]!==t?({children:n,defaultOpen:r,open:u,onOpenChange:a,defaultValue:i,value:l,onValueChange:s,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=a,e[5]=s,e[6]=u,e[7]=o,e[8]=l):(n=e[1],r=e[2],i=e[3],a=e[4],s=e[5],u=e[6],o=e[7],l=e[8]);const f=If(),d=r??!1;let h;e[9]!==a||e[10]!==u||e[11]!==d?(h={prop:u,defaultProp:d,onChange:a},e[9]=a,e[10]=u,e[11]=d,e[12]=h):h=e[12];const[p,g]=Ju(h);let x;e[13]!==i||e[14]!==s||e[15]!==l?(x={prop:l,defaultProp:i,onChange:s},e[13]=i,e[14]=s,e[15]=l,e[16]=x):x=e[16];const[_,b]=Ju(x);let k;e[17]!==b?(k=F=>{F&&b(F)},e[17]=b,e[18]=k):k=e[18];const E=k;let w;e[19]!==f||e[20]!==E?(w={isMobile:f,setValue:E},e[19]=f,e[20]=E,e[21]=w):w=e[21];let R;e[22]!==n||e[23]!==p||e[24]!==o||e[25]!==g?(R=m.jsx(I_,{open:p,onOpenChange:g,...o,children:n}),e[22]=n,e[23]=p,e[24]=o,e[25]=g,e[26]=R):R=e[26];let S;e[27]!==p||e[28]!==o||e[29]!==g||e[30]!==E||e[31]!==R||e[32]!==_?(S=m.jsx(Sf,{open:p,onOpenChange:g,value:_,onValueChange:E,...o,children:R}),e[27]=p,e[28]=o,e[29]=g,e[30]=E,e[31]=R,e[32]=_,e[33]=S):S=e[33];let O;return e[34]!==w||e[35]!==S?(O=m.jsx(ld.Provider,{value:w,children:S}),e[34]=w,e[35]=S,e[36]=O):O=e[36],O},dd=t=>{const{children:e,title:n,headerActions:r,...i}=t,{isMobile:a}=ds(),{className:s,...u}=i;return a?m.jsxs(L_,{...u,children:[m.jsxs(O_,{className:ce(r?"flex flex-row items-center justify-between":"hidden"),children:[m.jsx(v_,{children:n}),r]}),m.jsx("div",{className:ce("flex flex-col gap-2 p-2 py-4",s),children:e})]}):m.jsx(kf,{...i,children:e})},fd=t=>{const e=K.c(7);let n,r;e[0]!==t?({children:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);const{isMobile:i}=ds();let a;return e[3]!==n||e[4]!==i||e[5]!==r?(a=i?m.jsx(N_,{asChild:!0,children:m.jsx(Bt,{variant:"outline",...r,children:n})}):m.jsx(Cf,{...r,children:n}),e[3]=n,e[4]=i,e[5]=r,e[6]=a):a=e[6],a},hd=t=>{const e=K.c(7);let n,r;e[0]!==t?({children:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);const{isMobile:i}=ds();let a;return e[3]!==n||e[4]!==i||e[5]!==r?(a=i?m.jsx("span",{...r,children:n}):m.jsx(Af,{...r,children:n}),e[3]=n,e[4]=i,e[5]=r,e[6]=a):a=e[6],a};function P_(){const t=K.c(4),e=rf();let n;t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1];let r;return t[2]!==n?(r=n.map(M_),t[2]=n,t[3]=r):r=t[3],r}function M_(t){return{id:t.id,title:t.title,description:t.description??null,icon:t.icon??null,fallbackIcon:m.jsx(Ra,{})}}function B_(t){const e=K.c(24),{gateway:n,isSelected:r}=t,i=r&&"bg-accent";let a;e[0]!==i?(a=ce("flex items-start gap-3 py-3 px-3 hover:bg-accent cursor-pointer rounded-lg",i),e[0]=i,e[1]=a):a=e[1];let s;e[2]!==n.fallbackIcon?(s=n.fallbackIcon??m.jsx(Ra,{}),e[2]=n.fallbackIcon,e[3]=s):s=e[3];let u;e[4]!==n.icon||e[5]!==n.title||e[6]!==s?(u=m.jsx(mo,{icon:n.icon,name:n.title,size:"sm",fallbackIcon:s,className:"size-10"}),e[4]=n.icon,e[5]=n.title,e[6]=s,e[7]=u):u=e[7];let o;e[8]!==n.title?(o=m.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=o):o=e[9];let l;e[10]!==r?(l=r&&m.jsx(Kt,{size:16,className:"text-foreground shrink-0"}),e[10]=r,e[11]=l):l=e[11];let f;e[12]!==o||e[13]!==l?(f=m.jsxs("div",{className:"flex items-center justify-between",children:[o,l]}),e[12]=o,e[13]=l,e[14]=f):f=e[14];let d;e[15]!==n.description?(d=n.description&&m.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1 leading-relaxed",children:n.description}),e[15]=n.description,e[16]=d):d=e[16];let h;e[17]!==f||e[18]!==d?(h=m.jsxs("div",{className:"flex flex-col flex-1 min-w-0 gap-0.5",children:[f,d]}),e[17]=f,e[18]=d,e[19]=h):h=e[19];let p;return e[20]!==a||e[21]!==u||e[22]!==h?(p=m.jsxs("div",{className:a,children:[u,h]}),e[20]=a,e[21]=u,e[22]=h,e[23]=p):p=e[23],p}function F_(t){const e=K.c(12),{gateway:n}=t;if(!n){let u;return e[0]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx("span",{className:"text-sm text-muted-foreground",children:"Select gateway"}),e[0]=u):u=e[0],u}let r;e[1]!==n.fallbackIcon?(r=n.fallbackIcon??m.jsx(Ra,{}),e[1]=n.fallbackIcon,e[2]=r):r=e[2];let i;e[3]!==n.icon||e[4]!==n.title||e[5]!==r?(i=m.jsx(mo,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:r,className:"w-5! h-5! min-w-5! shrink-0 rounded-sm"}),e[3]=n.icon,e[4]=n.title,e[5]=r,e[6]=i):i=e[6];let a;e[7]!==n.title?(a=m.jsx("span",{className:"text-sm text-muted-foreground group-hover:text-foreground transition-colors truncate min-w-0 max-w-[200px] hidden sm:inline-block",children:n.title}),e[7]=n.title,e[8]=a):a=e[8];let s;return e[9]!==i||e[10]!==a?(s=m.jsxs("div",{className:"flex items-center gap-2 min-w-0 max-w-full",children:[i,a]}),e[9]=i,e[10]=a,e[11]=s):s=e[11],s}function nA(t){const e=K.c(37),{selectedGatewayId:n,onGatewayChange:r,variant:i,className:a,placeholder:s}=t,u=i===void 0?"bordered":i,o=s===void 0?"Select gateway":s,[l,f]=v.useState(!1),d=P_();let h;if(e[0]!==d||e[1]!==n){let P;e[3]!==n?(P=M=>M.id===n,e[3]=n,e[4]=P):P=e[4],h=d.find(P),e[0]=d,e[1]=n,e[2]=h}else h=e[2];const p=h;let g;e[5]!==r?(g=P=>{r(P),f(!1)},e[5]=r,e[6]=g):g=e[6];const x=g,_=n||"",b=u==="borderless"&&"border-0 md:border-none";let k;e[7]!==a||e[8]!==b?(k=ce("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 max-w-full",b,a),e[7]=a,e[8]=b,e[9]=k):k=e[9];let E;e[10]!==p?(E=m.jsx(F_,{gateway:p}),e[10]=p,e[11]=E):E=e[11];let w;e[12]!==o||e[13]!==E?(w=m.jsx(hd,{placeholder:o,className:"min-w-0 max-w-full",children:E}),e[12]=o,e[13]=E,e[14]=w):w=e[14];let R;e[15]!==k||e[16]!==w?(R=m.jsx(fd,{size:"sm",className:k,children:w}),e[15]=k,e[16]=w,e[17]=R):R=e[17];let S;e[18]===Symbol.for("react.memo_cache_sentinel")?(S=m.jsx("div",{className:"border-b px-4 py-3 bg-background/95 backdrop-blur sticky top-0 z-10",children:m.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[m.jsx(po,{size:16}),m.jsx("span",{className:"text-sm",children:"Search for a gateway..."})]})}),e[18]=S):S=e[18];let O;if(e[19]!==d||e[20]!==x||e[21]!==n){let P;e[23]!==x||e[24]!==n?(P=M=>m.jsx("div",{onClick:()=>x(M.id),className:"outline-none",children:m.jsx(B_,{gateway:M,isSelected:M.id===n})},M.id),e[23]=x,e[24]=n,e[25]=P):P=e[25],O=d.map(P),e[19]=d,e[20]=x,e[21]=n,e[22]=O}else O=e[22];let F;e[26]!==O?(F=m.jsxs("div",{className:"flex flex-col max-h-[400px]",children:[S,m.jsx("div",{className:"overflow-y-auto p-2 flex flex-col gap-1",children:O})]}),e[26]=O,e[27]=F):F=e[27];let j;e[28]!==o||e[29]!==F?(j=m.jsx(dd,{title:o,className:"w-full md:w-[400px] p-0",children:F}),e[28]=o,e[29]=F,e[30]=j):j=e[30];let N;return e[31]!==x||e[32]!==l||e[33]!==R||e[34]!==j||e[35]!==_?(N=m.jsxs(cd,{open:l,onOpenChange:f,value:_,onValueChange:x,children:[R,j]}),e[31]=x,e[32]=l,e[33]=R,e[34]=j,e[35]=_,e[36]=N):N=e[36],N}function H_(t,e){const n=K.c(4);let r;n[0]!==e?(r={},n[0]=e,n[1]=r):r=n[1];const i=r,a=t??Jd;let s;return n[2]!==a?(s=tf(a),n[2]=a,n[3]=s):s=n[3],ef(a,"LLM",s,i)}function U_(){const t=K.c(8),e=nf();let n;t[0]!==e?(n={connections:e,binding:"LLMS"},t[0]=e,t[1]=n):n=t[1];const[r]=Zd(n),i=H_(r?.id);if(!i||!r){let s;return t[2]===Symbol.for("react.memo_cache_sentinel")?(s=[],t[2]=s):s=t[2],s}let a;if(t[3]!==r||t[4]!==i){let s;t[6]!==r?(s=u=>({...u,name:u.title,contextWindow:u.limits?.contextWindow,outputLimit:u.limits?.maxOutputTokens,inputCost:u.costs?.input,outputCost:u.costs?.output,provider:u.provider,connectionId:r.id,connectionName:r.title}),t[6]=r,t[7]=s):s=t[7],a=i.map(s).sort(z_),t[3]=r,t[4]=i,t[5]=a}else a=t[5];return a}function z_(t,e){return t.name.localeCompare(e.name)}const j_={reasoning:{icon:m.jsx(ni,{className:"size-4"}),bg:"bg-purple-100",text:"text-purple-700",label:"Reasoning"},"image-upload":{icon:m.jsx(yo,{className:"size-4"}),bg:"bg-teal-100",text:"text-teal-700",label:"Can analyze images"},"file-upload":{icon:m.jsx(Nf,{className:"size-4"}),bg:"bg-blue-100",text:"text-blue-700",label:"Can analyze files"},"web-search":{icon:m.jsx(po,{className:"size-4"}),bg:"bg-amber-100",text:"text-amber-700",label:"Can search the web to answer questions"}},pd=v.memo(function(e){const n=K.c(11),{capability:r}=e,i=j_[r];let a;n[0]!==r||n[1]!==i?(a=i||{icon:m.jsx(Kt,{className:"size-4"}),bg:"bg-slate-200",text:"text-slate-700",label:r},n[0]=r,n[1]=i,n[2]=a):a=n[2];const s=a,u=`flex items-center justify-center h-6 w-6 rounded-sm ${s.bg} ${s.text}`;let o;n[3]!==s.icon||n[4]!==u?(o=m.jsx(Na,{asChild:!0,children:m.jsx("div",{className:u,children:s.icon})}),n[3]=s.icon,n[4]=u,n[5]=o):o=n[5];let l;n[6]!==s.label?(l=m.jsx(wa,{children:m.jsx("p",{children:s.label})}),n[6]=s.label,n[7]=l):l=n[7];let f;return n[8]!==o||n[9]!==l?(f=m.jsxs(Ia,{children:[o,l]}),n[8]=o,n[9]=l,n[10]=f):f=n[10],f}),eo=v.memo(function(e){const n=K.c(54),{model:r,compact:i}=e,a=i===void 0?!1:i;if(!r){let b;return n[0]===Symbol.for("react.memo_cache_sentinel")?(b=m.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),n[0]=b):b=n[0],b}const s=r.contextWindow||r.inputCost||r.outputCost||r.outputLimit;if(!s&&!a){let b;n[1]!==r.logo||n[2]!==r.name?(b=r.logo&&m.jsx("img",{src:r.logo,className:"w-6 h-6",alt:r.name}),n[1]=r.logo,n[2]=r.name,n[3]=b):b=n[3];let k;n[4]!==r.name?(k=m.jsx("p",{className:"text-lg font-medium leading-7",children:r.name}),n[4]=r.name,n[5]=k):k=n[5];let E;n[6]!==b||n[7]!==k?(E=m.jsxs("div",{className:"flex items-center gap-3 py-2 px-0",children:[b,k]}),n[6]=b,n[7]=k,n[8]=E):E=n[8];let w;n[9]!==r.description?(w=r.description&&m.jsx("p",{className:"text-sm text-muted-foreground",children:r.description}),n[9]=r.description,n[10]=w):w=n[10];let R;return n[11]!==E||n[12]!==w?(R=m.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[E,w]}),n[11]=E,n[12]=w,n[13]=R):R=n[13],R}if(!s&&a)return null;if(a){let b;n[14]!==r.contextWindow?(b=r.contextWindow&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Context"}),m.jsxs("span",{className:"text-foreground font-medium",children:[r.contextWindow.toLocaleString()," tokens"]})]}),n[14]=r.contextWindow,n[15]=b):b=n[15];let k;n[16]!==r.inputCost?(k=r.inputCost&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Input cost"}),m.jsxs("span",{className:"text-foreground font-medium",children:["$",r.inputCost.toFixed(2)," / 1M"]})]}),n[16]=r.inputCost,n[17]=k):k=n[17];let E;n[18]!==r.outputCost?(E=r.outputCost&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Output cost"}),m.jsxs("span",{className:"text-foreground font-medium",children:["$",r.outputCost.toFixed(2)," / 1M"]})]}),n[18]=r.outputCost,n[19]=E):E=n[19];let w;n[20]!==r.outputLimit?(w=r.outputLimit&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Output limit"}),m.jsxs("span",{className:"text-foreground font-medium",children:[r.outputLimit.toLocaleString()," tokens"]})]}),n[20]=r.outputLimit,n[21]=w):w=n[21];let R;return n[22]!==b||n[23]!==k||n[24]!==E||n[25]!==w?(R=m.jsxs("div",{className:"flex flex-col gap-2.5 pt-3 pb-3 px-3 rounded-b-lg text-xs",children:[b,k,E,w]}),n[22]=b,n[23]=k,n[24]=E,n[25]=w,n[26]=R):R=n[26],R}let u;n[27]!==r.logo||n[28]!==r.name?(u=r.logo&&m.jsx("img",{src:r.logo,className:"w-6 h-6",alt:r.name}),n[27]=r.logo,n[28]=r.name,n[29]=u):u=n[29];let o;n[30]!==r.name?(o=m.jsx("p",{className:"text-lg font-medium leading-7",children:r.name}),n[30]=r.name,n[31]=o):o=n[31];let l;n[32]!==u||n[33]!==o?(l=m.jsxs("div",{className:"flex items-center gap-3",children:[u,o]}),n[32]=u,n[33]=o,n[34]=l):l=n[34];let f;n[35]!==r.capabilities?(f=r.capabilities&&r.capabilities.length>0&&m.jsx("div",{className:"flex items-center gap-2",children:r.capabilities.map(q_)}),n[35]=r.capabilities,n[36]=f):f=n[36];let d;n[37]!==l||n[38]!==f?(d=m.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[l,f]}),n[37]=l,n[38]=f,n[39]=d):d=n[39];let h;n[40]!==r.contextWindow?(h=r.contextWindow&&m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(uf,{className:"w-3.5 h-3.5 text-muted-foreground"}),m.jsx("p",{className:"text-sm text-foreground",children:"Context window"})]}),m.jsxs("p",{className:"text-sm text-muted-foreground",children:[r.contextWindow.toLocaleString()," tokens"]})]}),n[40]=r.contextWindow,n[41]=h):h=n[41];let p;n[42]!==r.inputCost||n[43]!==r.outputCost?(p=(r.inputCost||r.outputCost)&&m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(To,{className:"w-3.5 h-3.5 text-muted-foreground"}),m.jsx("p",{className:"text-sm text-foreground",children:"Costs"})]}),m.jsxs("div",{className:"flex flex-col gap-0.5",children:[r.inputCost!==null&&r.inputCost!==void 0&&m.jsxs("p",{className:"text-sm text-muted-foreground",children:["$",r.inputCost.toFixed(2)," / 1M tokens (input)"]}),r.outputCost!==null&&r.outputCost!==void 0&&m.jsxs("p",{className:"text-sm text-muted-foreground",children:["$",r.outputCost.toFixed(2)," / 1M tokens (output)"]})]})]}),n[42]=r.inputCost,n[43]=r.outputCost,n[44]=p):p=n[44];let g;n[45]!==r.outputLimit?(g=r.outputLimit&&m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(Co,{className:"w-4.5 h-4.5 text-muted-foreground/70"}),m.jsx("p",{className:"text-sm text-foreground",children:"Output limit"})]}),m.jsxs("p",{className:"text-sm text-muted-foreground",children:[r.outputLimit.toLocaleString()," token limit"]})]}),n[45]=r.outputLimit,n[46]=g):g=n[46];let x;n[47]!==h||n[48]!==p||n[49]!==g?(x=m.jsxs("div",{className:"flex flex-col gap-4",children:[h,p,g]}),n[47]=h,n[48]=p,n[49]=g,n[50]=x):x=n[50];let _;return n[51]!==x||n[52]!==d?(_=m.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[d,x]}),n[51]=x,n[52]=d,n[53]=_):_=n[53],_}),$_=v.memo(function(e){const n=K.c(27),{model:r,onHover:i,isSelected:a,hasExpandedInfo:s}=e,u=s?"rounded-t-lg":"rounded-lg";let o;n[0]!==u?(o=ce("flex items-center gap-2 h-10 py-4 px-3 hover:bg-accent cursor-pointer",u),n[0]=u,n[1]=o):o=n[1];let l;n[2]!==r||n[3]!==i?(l=()=>i(r),n[2]=r,n[3]=i,n[4]=l):l=n[4];let f;n[5]!==r.logo||n[6]!==r.name?(f=r.logo&&m.jsx("img",{src:r.logo,className:"w-5 h-5 shrink-0",alt:r.name}),n[5]=r.logo,n[6]=r.name,n[7]=f):f=n[7];let d;n[8]!==r.name?(d=m.jsx("span",{className:"text-sm text-foreground",children:r.name}),n[8]=r.name,n[9]=d):d=n[9];let h;n[10]!==s||n[11]!==r.capabilities?(h=s&&r.capabilities&&r.capabilities.length>0&&m.jsx("div",{className:"md:hidden flex items-center gap-1.5 ml-auto",children:r.capabilities.map(V_)}),n[10]=s,n[11]=r.capabilities,n[12]=h):h=n[12];let p;n[13]!==s||n[14]!==a?(p=a&&!s&&m.jsx(Kt,{className:"w-4 h-4 text-foreground ml-auto"}),n[13]=s,n[14]=a,n[15]=p):p=n[15];let g;n[16]!==s||n[17]!==a?(g=a&&s&&m.jsx(Kt,{className:"w-4 h-4 text-foreground ml-2 shrink-0"}),n[16]=s,n[17]=a,n[18]=g):g=n[18];let x;return n[19]!==o||n[20]!==l||n[21]!==f||n[22]!==d||n[23]!==h||n[24]!==p||n[25]!==g?(x=m.jsxs("div",{className:o,onMouseEnter:l,children:[f,d,h,p,g]}),n[19]=o,n[20]=l,n[21]=f,n[22]=d,n[23]=h,n[24]=p,n[25]=g,n[26]=x):x=n[26],x});function Y_(t){const e=K.c(9),{model:n}=t;if(!n){let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx("span",{className:"text-sm text-muted-foreground",children:"Select model"}),e[0]=s):s=e[0],s}let r;e[1]!==n.logo||e[2]!==n.name?(r=n.logo&&m.jsx("img",{src:n.logo,className:"w-5 h-5 shrink-0 rounded-sm",alt:n.name}),e[1]=n.logo,e[2]=n.name,e[3]=r):r=e[3];let i;e[4]!==n.name?(i=m.jsx("span",{className:"text-sm text-muted-foreground group-hover:text-foreground transition-colors truncate min-w-0 max-w-[200px] hidden sm:inline-block",children:n.name}),e[4]=n.name,e[5]=i):i=e[5];let a;return e[6]!==r||e[7]!==i?(a=m.jsxs("div",{className:"flex items-center gap-2 min-w-0 max-w-full",children:[r,i]}),e[6]=r,e[7]=i,e[8]=a):a=e[8],a}function rA(t){const e=K.c(57),{selectedModel:n,onModelChange:r,variant:i,className:a,placeholder:s}=t,u=i===void 0?"borderless":i,o=s===void 0?"Select model":s,[l,f]=v.useState(!1),[d,h]=v.useState(null),[p,g]=v.useState(!1),x=U_();let _;e[0]!==x||e[1]!==n?(_=n?x.find(V=>V.id===n.id&&V.connectionId===n.connectionId)?.id:void 0,e[0]=x,e[1]=n,e[2]=_):_=e[2];const b=_;let k;if(e[3]!==x||e[4]!==b){let V;e[6]!==b?(V=G=>G.id===b,e[6]=b,e[7]=V):V=e[7],k=x.find(V),e[3]=x,e[4]=b,e[5]=k}else k=e[5];const E=k;let w;e[8]!==x||e[9]!==r?(w=V=>{const G=x.find(Q=>Q.id===V);G&&(r({id:G.id,connectionId:G.connectionId,provider:G.provider??void 0}),f(!1))},e[8]=x,e[9]=r,e[10]=w):w=e[10];const R=w;if(x.length===0)return null;const S=b||"",O=u==="borderless"&&"md:border-none";let F;e[11]!==a||e[12]!==O?(F=ce("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 max-w-full",O,a),e[11]=a,e[12]=O,e[13]=F):F=e[13];let j;e[14]!==E?(j=m.jsx(Y_,{model:E}),e[14]=E,e[15]=j):j=e[15];let N;e[16]!==o||e[17]!==j?(N=m.jsx(hd,{placeholder:o,className:"min-w-0 max-w-full",children:j}),e[16]=o,e[17]=j,e[18]=N):N=e[18];let P;e[19]!==N||e[20]!==F?(P=m.jsx(fd,{size:"sm",className:F,children:N}),e[19]=N,e[20]=F,e[21]=P):P=e[21];let M;e[22]!==p?(M=()=>g(!p),e[22]=p,e[23]=M):M=e[23];const J=p?"text-foreground":"text-muted-foreground";let z;e[24]!==J?(z=ce("w-5 h-5 transition-colors",J),e[24]=J,e[25]=z):z=e[25];let H;e[26]!==z?(H=m.jsx(wf,{className:z}),e[26]=z,e[27]=H):H=e[27];let Z;e[28]!==M||e[29]!==H?(Z=m.jsx("button",{type:"button",onClick:M,className:"md:hidden flex items-center justify-center h-8 w-8 rounded-lg hover:bg-accent transition-colors","aria-label":"Toggle model info",children:H}),e[28]=M,e[29]=H,e[30]=Z):Z=e[30];let re;if(e[31]!==R||e[32]!==x||e[33]!==b||e[34]!==p){let V;e[36]!==R||e[37]!==b||e[38]!==p?(V=G=>m.jsxs("div",{onClick:()=>R(G.id),className:ce("rounded-lg mb-1",G.id===b&&"bg-accent"),children:[m.jsx($_,{model:G,onHover:h,isSelected:G.id===b,hasExpandedInfo:p}),p&&m.jsx("div",{className:"md:hidden",children:m.jsx(eo,{model:G,compact:!0})})]},G.id),e[36]=R,e[37]=b,e[38]=p,e[39]=V):V=e[39],re=x.map(V),e[31]=R,e[32]=x,e[33]=b,e[34]=p,e[35]=re}else re=e[35];let le;e[40]!==re?(le=m.jsx("div",{className:"flex-1 overflow-y-auto px-0.5 md:border-r",children:re}),e[40]=re,e[41]=le):le=e[41];const Te=d||E||null;let I;e[42]!==Te?(I=m.jsx("div",{className:"hidden md:block md:w-[300px] p-3",children:m.jsx(eo,{model:Te})}),e[42]=Te,e[43]=I):I=e[43];let me;e[44]!==le||e[45]!==I?(me=m.jsxs("div",{className:"flex flex-col md:flex-row h-[350px]",children:[le,I]}),e[44]=le,e[45]=I,e[46]=me):me=e[46];let Ae;e[47]!==o||e[48]!==Z||e[49]!==me?(Ae=m.jsx(dd,{title:o,className:"w-full md:w-auto md:min-w-[600px] [&_button[aria-label='Scroll down']]:!hidden [&_button[aria-label='Scroll up']]:!hidden",headerActions:Z,children:me}),e[47]=o,e[48]=Z,e[49]=me,e[50]=Ae):Ae=e[50];let y;return e[51]!==R||e[52]!==l||e[53]!==P||e[54]!==Ae||e[55]!==S?(y=m.jsxs(cd,{open:l,onOpenChange:f,value:S,onValueChange:R,children:[P,Ae]}),e[51]=R,e[52]=l,e[53]=P,e[54]=Ae,e[55]=S,e[56]=y):y=e[56],y}function q_(t){return m.jsx(pd,{capability:t},t)}function V_(t){return m.jsx(pd,{capability:t},t)}function W_({messageCount:t,sentinelRef:e}){const n=v.useRef(t),r=v.useRef(0);t>n.current&&r.current!==t&&queueMicrotask(()=>{e.current?.scrollIntoView({behavior:"smooth",block:"start"}),r.current=t}),n.current=t}function to(t,e){const n=v.Children.toArray(t);for(const r of n)if(v.isValidElement(r)&&r.type===e)return r;return null}function G_(t){const e=K.c(5),{className:n,children:r}=t;let i;e[0]!==n?(i=ce("flex flex-col h-full w-full bg-sidebar transform-[translateZ(0)]",n),e[0]=n,e[1]=i):i=e[1];let a;return e[2]!==r||e[3]!==i?(a=m.jsx("div",{className:i,children:r}),e[2]=r,e[3]=i,e[4]=a):a=e[4],a}function Q_(t){const e=K.c(11),{children:n}=t;let r;e[0]!==n?(r=to(n,md),e[0]=n,e[1]=r):r=e[1];const i=r;let a;e[2]!==n?(a=to(n,gd),e[2]=n,e[3]=a):a=e[3];const s=a,u=i?.props.children;let o;e[4]!==u?(o=m.jsx("div",{className:"flex items-center gap-2",children:u}),e[4]=u,e[5]=o):o=e[5];const l=s?.props.children;let f;e[6]!==l?(f=m.jsx("div",{className:"flex items-center gap-1",children:l}),e[6]=l,e[7]=f):f=e[7];let d;return e[8]!==o||e[9]!==f?(d=m.jsxs("div",{className:"flex h-12 items-center justify-between border-b border-border px-4 flex-none",children:[o,f]}),e[8]=o,e[9]=f,e[10]=d):d=e[10],d}function md(t){const e=K.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx(m.Fragment,{children:n}),e[0]=n,e[1]=r):r=e[1],r}function gd(t){const e=K.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx(m.Fragment,{children:n}),e[0]=n,e[1]=r):r=e[1],r}function X_(t){const e=K.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=ce("flex-1 min-h-0 overflow-y-auto",r),e[0]=r,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=m.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function Z_(t){const e=K.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx("div",{className:"h-full w-full flex items-center justify-center max-w-2xl mx-auto",children:n}),e[0]=n,e[1]=r):r=e[1],r}function K_(t){const e=K.c(12),{messages:n,status:r,minHeightOffset:i}=t,a=i===void 0?240:i,s=v.useRef(null);let u;e[0]!==n.length?(u={messageCount:n.length,sentinelRef:s},e[0]=n.length,e[1]=u):u=e[1],W_(u);let o;if(e[2]!==n||e[3]!==r){let d;e[5]!==n.length||e[6]!==r?(d=(h,p)=>h.role==="user"?m.jsx(S_,{message:h},h.id):h.role==="assistant"?m.jsx(g_,{message:h,status:p===n.length-1?r:void 0},h.id):null,e[5]=n.length,e[6]=r,e[7]=d):d=e[7],o=n.map(d),e[2]=n,e[3]=r,e[4]=o}else o=e[4];let l;e[8]===Symbol.for("react.memo_cache_sentinel")?(l=m.jsx(od,{children:m.jsx("div",{ref:s,className:"h-0"})}),e[8]=l):l=e[8];let f;return e[9]!==a||e[10]!==o?(f=m.jsxs(x_,{minHeightOffset:a,children:[o,l]}),e[9]=a,e[10]=o,e[11]=f):f=e[11],f}function J_(t){const e=K.c(3),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=ce("flex-none w-full mx-auto p-2","max-w-2xl min-w-0"),e[0]=r):r=e[0];let i;return e[1]!==n?(i=m.jsx("div",{className:r,children:n}),e[1]=n,e[2]=i):i=e[2],i}function ey(t){const e=K.c(16),{branchContext:n,clearBranchContext:r,onGoToOriginalMessage:i,setInputValue:a}=t;if(!n)return null;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx(Eo,{size:14,className:"text-muted-foreground mt-0.5 shrink-0"}),e[0]=s):s=e[0];let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Editing message (click to view original):"}),e[1]=u):u=e[1];let o;e[2]!==n.originalMessageText?(o=m.jsxs("div",{className:"flex-1 min-w-0",children:[u,m.jsx("div",{className:"text-muted-foreground/70 line-clamp-2",children:n.originalMessageText})]}),e[2]=n.originalMessageText,e[3]=o):o=e[3];let l,f;e[4]!==r||e[5]!==a?(l=g=>{g.stopPropagation(),r(),a("")},f=g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(),a(""))},e[4]=r,e[5]=a,e[6]=l,e[7]=f):(l=e[6],f=e[7]);let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsx(af,{size:14}),e[8]=d):d=e[8];let h;e[9]!==l||e[10]!==f?(h=m.jsx("span",{role:"button",tabIndex:0,onClick:l,onKeyDown:f,className:"text-muted-foreground hover:text-foreground transition-colors shrink-0",title:"Cancel editing",children:d}),e[9]=l,e[10]=f,e[11]=h):h=e[11];let p;return e[12]!==i||e[13]!==o||e[14]!==h?(p=m.jsxs("button",{type:"button",onClick:i,className:"flex items-start gap-2 px-2 py-2 rounded-lg border border-dashed border-muted-foreground/30 bg-muted/50 text-sm hover:bg-muted transition-colors cursor-pointer text-left w-full",title:"Click to view original message",children:[s,o,h]}),e[12]=i,e[13]=o,e[14]=h,e[15]=p):p=e[15],p}const iA=Object.assign(G_,{Header:Object.assign(Q_,{Left:md,Right:gd}),Main:X_,Messages:K_,EmptyState:Z_,Footer:J_,Input:R0,BranchPreview:ey,Provider:I0});function aA(){const t=K.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx("div",{className:"size-6 rounded-lg bg-muted animate-pulse"}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsxs("div",{className:"flex items-center gap-3",children:[e,m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsx("div",{className:"h-3.5 w-28 rounded bg-muted animate-pulse"}),m.jsx("div",{className:"h-3 w-40 rounded bg-muted/60 animate-pulse"})]})]}),t[1]=n):n=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx("div",{className:"flex items-center h-12 flex-none border-b border-border/80 px-4",children:m.jsxs("div",{className:"flex items-center justify-between gap-3 w-full",children:[n,m.jsxs("div",{className:"flex items-end gap-2",children:[m.jsx("div",{className:"h-6 w-6 rounded-full bg-muted animate-pulse"}),m.jsx("div",{className:"h-6 w-6 rounded-lg bg-muted animate-pulse"})]})]})}),t[2]=r):r=t[2];let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=m.jsx("div",{className:"flex-1 overflow-hidden px-4 py-4",children:m.jsxs("div",{className:"mx-auto flex w-full max-w-2xl flex-col gap-4",children:[m.jsx(Or,{align:"right",width:"w-3/4"}),m.jsx(Or,{align:"left",width:"w-full",lines:3}),m.jsx(Or,{align:"right",width:"w-2/3"}),m.jsx(Or,{align:"left",width:"w-5/6",lines:2})]})}),t[3]=i):i=t[3];let a;t[4]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx("div",{className:"relative flex flex-1 flex-col gap-2 p-2.5",children:m.jsx("div",{className:"relative flex-1",children:m.jsxs("div",{className:"space-y-2 p-2",children:[m.jsx("div",{className:"h-3 w-full rounded bg-muted/40 animate-pulse"}),m.jsx("div",{className:"h-3 w-4/5 rounded bg-muted/40 animate-pulse"})]})})}),t[4]=a):a=t[4];let s;t[5]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx("div",{className:"flex items-center gap-1",children:m.jsx("div",{className:"size-8 rounded-full bg-muted/60 animate-pulse"})}),t[5]=s):s=t[5];let u;return t[6]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsxs("div",{className:"flex h-full w-full flex-col bg-sidebar",children:[r,i,m.jsx("div",{className:"px-4 py-4",children:m.jsx("div",{className:"mx-auto w-full max-w-2xl",children:m.jsxs("div",{className:"relative flex min-h-[130px] flex-col rounded-xl border border-border bg-background shadow-sm",children:[a,m.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2.5",children:[s,m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("div",{className:"h-8 w-32 rounded-lg bg-muted/60 animate-pulse"}),m.jsx("div",{className:"size-8 rounded-full bg-muted animate-pulse"})]})]})]})})})]}),t[6]=u):u=t[6],u}function Or(t){const e=K.c(22),{align:n,width:r,lines:i}=t,a=r===void 0?"w-full":r,s=i===void 0?1:i,u=n==="right"?"flex-row-reverse":"flex-row";let o;e[0]!==u?(o=ce("flex w-full gap-4 px-4 py-2",u),e[0]=u,e[1]=o):o=e[1];const l=n==="right"?"ml-auto max-w-3/4 items-end":"w-full items-start";let f;e[2]!==l?(f=ce("flex min-w-0 flex-col gap-2",l),e[2]=l,e[3]=f):f=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsx("div",{className:"h-3 w-16 rounded bg-muted/40 animate-pulse"}),e[4]=d):d=e[4];const h=n==="right"?"bg-muted":"bg-transparent border border-border/40";let p;e[5]!==h||e[6]!==a?(p=ce("min-w-0 rounded-2xl p-4",h,a),e[5]=h,e[6]=a,e[7]=p):p=e[7];let g;e[8]!==s?(g=Array.from({length:s}),e[8]=s,e[9]=g):g=e[9];let x;e[10]!==s||e[11]!==g?(x=m.jsx("div",{className:"space-y-2",children:g.map((E,w)=>m.jsx("div",{className:ce("h-3 rounded bg-muted-foreground/20 animate-pulse",w===s-1?"w-3/4":"w-full"),style:{animationDelay:`${w*.1}s`}},w))}),e[10]=s,e[11]=g,e[12]=x):x=e[12];let _;e[13]!==x||e[14]!==p?(_=m.jsx("div",{className:p,children:x}),e[13]=x,e[14]=p,e[15]=_):_=e[15];let b;e[16]!==_||e[17]!==f?(b=m.jsxs("div",{className:f,children:[d,_]}),e[16]=_,e[17]=f,e[18]=b):b=e[18];let k;return e[19]!==b||e[20]!==o?(k=m.jsx("div",{className:o,children:b}),e[19]=b,e[20]=o,e[21]=k):k=e[21],k}const Ti=v.createContext(null);Ti.displayName="PanelGroupContext";const Oe={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},fs=10,Zt=v.useLayoutEffect,no=Qd.useId,ty=typeof no=="function"?no:()=>null;let ny=0;function hs(t=null){const e=ty(),n=v.useRef(t||e||null);return n.current===null&&(n.current=""+ny++),t??n.current}function bd({children:t,className:e="",collapsedSize:n,collapsible:r,defaultSize:i,forwardedRef:a,id:s,maxSize:u,minSize:o,onCollapse:l,onExpand:f,onResize:d,order:h,style:p,tagName:g="div",...x}){const _=v.useContext(Ti);if(_===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:b,expandPanel:k,getPanelSize:E,getPanelStyle:w,groupId:R,isPanelCollapsed:S,reevaluatePanelConstraints:O,registerPanel:F,resizePanel:j,unregisterPanel:N}=_,P=hs(s),M=v.useRef({callbacks:{onCollapse:l,onExpand:f,onResize:d},constraints:{collapsedSize:n,collapsible:r,defaultSize:i,maxSize:u,minSize:o},id:P,idIsFromProps:s!==void 0,order:h});v.useRef({didLogMissingDefaultSizeWarning:!1}),Zt(()=>{const{callbacks:z,constraints:H}=M.current,Z={...H};M.current.id=P,M.current.idIsFromProps=s!==void 0,M.current.order=h,z.onCollapse=l,z.onExpand=f,z.onResize=d,H.collapsedSize=n,H.collapsible=r,H.defaultSize=i,H.maxSize=u,H.minSize=o,(Z.collapsedSize!==H.collapsedSize||Z.collapsible!==H.collapsible||Z.maxSize!==H.maxSize||Z.minSize!==H.minSize)&&O(M.current,Z)}),Zt(()=>{const z=M.current;return F(z),()=>{N(z)}},[h,P,F,N]),v.useImperativeHandle(a,()=>({collapse:()=>{b(M.current)},expand:z=>{k(M.current,z)},getId(){return P},getSize(){return E(M.current)},isCollapsed(){return S(M.current)},isExpanded(){return!S(M.current)},resize:z=>{j(M.current,z)}}),[b,k,E,S,P,j]);const J=w(M.current,i);return v.createElement(g,{...x,children:t,className:e,id:P,style:{...J,...p},[Oe.groupId]:R,[Oe.panel]:"",[Oe.panelCollapsible]:r||void 0,[Oe.panelId]:P,[Oe.panelSize]:parseFloat(""+J.flexGrow).toFixed(1)})}const Ed=v.forwardRef((t,e)=>v.createElement(bd,{...t,forwardedRef:e}));bd.displayName="Panel";Ed.displayName="forwardRef(Panel)";let Ca=null,zr=-1,Ot=null;function ry(t,e){if(e){const n=(e&Ad)!==0,r=(e&Cd)!==0,i=(e&kd)!==0,a=(e&Sd)!==0;if(n)return i?"se-resize":a?"ne-resize":"e-resize";if(r)return i?"sw-resize":a?"nw-resize":"w-resize";if(i)return"s-resize";if(a)return"n-resize"}switch(t){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function iy(){Ot!==null&&(document.head.removeChild(Ot),Ca=null,Ot=null,zr=-1)}function Gi(t,e){var n,r;const i=ry(t,e);if(Ca!==i){if(Ca=i,Ot===null&&(Ot=document.createElement("style"),document.head.appendChild(Ot)),zr>=0){var a;(a=Ot.sheet)===null||a===void 0||a.removeRule(zr)}zr=(n=(r=Ot.sheet)===null||r===void 0?void 0:r.insertRule(`*{cursor: ${i} !important;}`))!==null&&n!==void 0?n:-1}}function Td(t){return t.type==="keydown"}function xd(t){return t.type.startsWith("pointer")}function _d(t){return t.type.startsWith("mouse")}function xi(t){if(xd(t)){if(t.isPrimary)return{x:t.clientX,y:t.clientY}}else if(_d(t))return{x:t.clientX,y:t.clientY};return{x:1/0,y:1/0}}function ay(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function sy(t,e,n){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}function uy(t,e){if(t===e)throw new Error("Cannot compare node with itself");const n={a:ao(t),b:ao(e)};let r;for(;n.a.at(-1)===n.b.at(-1);)t=n.a.pop(),e=n.b.pop(),r=t;oe(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:io(ro(n.a)),b:io(ro(n.b))};if(i.a===i.b){const a=r.childNodes,s={a:n.a.at(-1),b:n.b.at(-1)};let u=a.length;for(;u--;){const o=a[u];if(o===s.a)return 1;if(o===s.b)return-1}}return Math.sign(i.a-i.b)}const oy=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function ly(t){var e;const n=getComputedStyle((e=yd(t))!==null&&e!==void 0?e:t).display;return n==="flex"||n==="inline-flex"}function cy(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||ly(t))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||oy.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function ro(t){let e=t.length;for(;e--;){const n=t[e];if(oe(n,"Missing node"),cy(n))return n}return null}function io(t){return t&&Number(getComputedStyle(t).zIndex)||0}function ao(t){const e=[];for(;t;)e.push(t),t=yd(t);return e}function yd(t){const{parentNode:e}=t;return e&&e instanceof ShadowRoot?e.host:e}const Ad=1,Cd=2,kd=4,Sd=8,dy=ay()==="coarse";let ct=[],xn=!1,Wt=new Map,_i=new Map;const fr=new Set;function fy(t,e,n,r,i){var a;const{ownerDocument:s}=e,u={direction:n,element:e,hitAreaMargins:r,setResizeHandlerState:i},o=(a=Wt.get(s))!==null&&a!==void 0?a:0;return Wt.set(s,o+1),fr.add(u),Jr(),function(){var f;_i.delete(t),fr.delete(u);const d=(f=Wt.get(s))!==null&&f!==void 0?f:1;if(Wt.set(s,d-1),Jr(),d===1&&Wt.delete(s),ct.includes(u)){const h=ct.indexOf(u);h>=0&&ct.splice(h,1),ms(),i("up",!0,null)}}}function hy(t){const{target:e}=t,{x:n,y:r}=xi(t);xn=!0,ps({target:e,x:n,y:r}),Jr(),ct.length>0&&(ei("down",t),t.preventDefault(),Id(e)||t.stopImmediatePropagation())}function Qi(t){const{x:e,y:n}=xi(t);if(xn&&t.buttons===0&&(xn=!1,ei("up",t)),!xn){const{target:r}=t;ps({target:r,x:e,y:n})}ei("move",t),ms(),ct.length>0&&t.preventDefault()}function Xi(t){const{target:e}=t,{x:n,y:r}=xi(t);_i.clear(),xn=!1,ct.length>0&&(t.preventDefault(),Id(e)||t.stopImmediatePropagation()),ei("up",t),ps({target:e,x:n,y:r}),ms(),Jr()}function Id(t){let e=t;for(;e;){if(e.hasAttribute(Oe.resizeHandle))return!0;e=e.parentElement}return!1}function ps({target:t,x:e,y:n}){ct.splice(0);let r=null;(t instanceof HTMLElement||t instanceof SVGElement)&&(r=t),fr.forEach(i=>{const{element:a,hitAreaMargins:s}=i,u=a.getBoundingClientRect(),{bottom:o,left:l,right:f,top:d}=u,h=dy?s.coarse:s.fine;if(e>=l-h&&e<=f+h&&n>=d-h&&n<=o+h){if(r!==null&&document.contains(r)&&a!==r&&!a.contains(r)&&!r.contains(a)&&uy(r,a)>0){let g=r,x=!1;for(;g&&!g.contains(a);){if(sy(g.getBoundingClientRect(),u)){x=!0;break}g=g.parentElement}if(x)return}ct.push(i)}})}function Zi(t,e){_i.set(t,e)}function ms(){let t=!1,e=!1;ct.forEach(r=>{const{direction:i}=r;i==="horizontal"?t=!0:e=!0});let n=0;_i.forEach(r=>{n|=r}),t&&e?Gi("intersection",n):t?Gi("horizontal",n):e?Gi("vertical",n):iy()}let Ki=new AbortController;function Jr(){Ki.abort(),Ki=new AbortController;const t={capture:!0,signal:Ki.signal};fr.size&&(xn?(ct.length>0&&Wt.forEach((e,n)=>{const{body:r}=n;e>0&&(r.addEventListener("contextmenu",Xi,t),r.addEventListener("pointerleave",Qi,t),r.addEventListener("pointermove",Qi,t))}),window.addEventListener("pointerup",Xi,t),window.addEventListener("pointercancel",Xi,t)):Wt.forEach((e,n)=>{const{body:r}=n;e>0&&(r.addEventListener("pointerdown",hy,t),r.addEventListener("pointermove",Qi,t))}))}function ei(t,e){fr.forEach(n=>{const{setResizeHandlerState:r}=n,i=ct.includes(n);r(t,i,e)})}function py(){const[t,e]=v.useState(0);return v.useCallback(()=>e(n=>n+1),[])}function oe(t,e){if(!t)throw console.error(e),Error(e)}function rn(t,e,n=fs){return t.toFixed(n)===e.toFixed(n)?0:t>e?1:-1}function _t(t,e,n=fs){return rn(t,e,n)===0}function et(t,e,n){return rn(t,e,n)===0}function my(t,e,n){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++){const i=t[r],a=e[r];if(!et(i,a,n))return!1}return!0}function En({panelConstraints:t,panelIndex:e,size:n}){const r=t[e];oe(r!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:i=0,collapsible:a,maxSize:s=100,minSize:u=0}=r;if(rn(n,u)<0)if(a){const o=(i+u)/2;rn(n,o)<0?n=i:n=u}else n=u;return n=Math.min(s,n),n=parseFloat(n.toFixed(fs)),n}function Vn({delta:t,initialLayout:e,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(et(t,0))return e;const s=[...e],[u,o]=r;oe(u!=null,"Invalid first pivot index"),oe(o!=null,"Invalid second pivot index");let l=0;if(a==="keyboard"){{const d=t<0?o:u,h=n[d];oe(h,`Panel constraints not found for index ${d}`);const{collapsedSize:p=0,collapsible:g,minSize:x=0}=h;if(g){const _=e[d];if(oe(_!=null,`Previous layout not found for panel index ${d}`),et(_,p)){const b=x-_;rn(b,Math.abs(t))>0&&(t=t<0?0-b:b)}}}{const d=t<0?u:o,h=n[d];oe(h,`No panel constraints found for index ${d}`);const{collapsedSize:p=0,collapsible:g,minSize:x=0}=h;if(g){const _=e[d];if(oe(_!=null,`Previous layout not found for panel index ${d}`),et(_,x)){const b=_-p;rn(b,Math.abs(t))>0&&(t=t<0?0-b:b)}}}}{const d=t<0?1:-1;let h=t<0?o:u,p=0;for(;;){const x=e[h];oe(x!=null,`Previous layout not found for panel index ${h}`);const b=En({panelConstraints:n,panelIndex:h,size:100})-x;if(p+=b,h+=d,h<0||h>=n.length)break}const g=Math.min(Math.abs(t),Math.abs(p));t=t<0?0-g:g}{let h=t<0?u:o;for(;h>=0&&h<n.length;){const p=Math.abs(t)-Math.abs(l),g=e[h];oe(g!=null,`Previous layout not found for panel index ${h}`);const x=g-p,_=En({panelConstraints:n,panelIndex:h,size:x});if(!et(g,_)&&(l+=g-_,s[h]=_,l.toPrecision(3).localeCompare(Math.abs(t).toPrecision(3),void 0,{numeric:!0})>=0))break;t<0?h--:h++}}if(my(i,s))return i;{const d=t<0?o:u,h=e[d];oe(h!=null,`Previous layout not found for panel index ${d}`);const p=h+l,g=En({panelConstraints:n,panelIndex:d,size:p});if(s[d]=g,!et(g,p)){let x=p-g,b=t<0?o:u;for(;b>=0&&b<n.length;){const k=s[b];oe(k!=null,`Previous layout not found for panel index ${b}`);const E=k+x,w=En({panelConstraints:n,panelIndex:b,size:E});if(et(k,w)||(x-=w-k,s[b]=w),et(x,0))break;t>0?b--:b++}}}const f=s.reduce((d,h)=>h+d,0);return et(f,100)?s:i}function gy({layout:t,panelsArray:e,pivotIndices:n}){let r=0,i=100,a=0,s=0;const u=n[0];oe(u!=null,"No pivot index found"),e.forEach((d,h)=>{const{constraints:p}=d,{maxSize:g=100,minSize:x=0}=p;h===u?(r=x,i=g):(a+=x,s+=g)});const o=Math.min(i,100-a),l=Math.max(r,100-s),f=t[u];return{valueMax:o,valueMin:l,valueNow:f}}function hr(t,e=document){return Array.from(e.querySelectorAll(`[${Oe.resizeHandleId}][data-panel-group-id="${t}"]`))}function Nd(t,e,n=document){const i=hr(t,n).findIndex(a=>a.getAttribute(Oe.resizeHandleId)===e);return i??null}function wd(t,e,n){const r=Nd(t,e,n);return r!=null?[r,r+1]:[-1,-1]}function Rd(t,e=document){var n;if(e instanceof HTMLElement&&(e==null||(n=e.dataset)===null||n===void 0?void 0:n.panelGroupId)==t)return e;const r=e.querySelector(`[data-panel-group][data-panel-group-id="${t}"]`);return r||null}function yi(t,e=document){const n=e.querySelector(`[${Oe.resizeHandleId}="${t}"]`);return n||null}function by(t,e,n,r=document){var i,a,s,u;const o=yi(e,r),l=hr(t,r),f=o?l.indexOf(o):-1,d=(i=(a=n[f])===null||a===void 0?void 0:a.id)!==null&&i!==void 0?i:null,h=(s=(u=n[f+1])===null||u===void 0?void 0:u.id)!==null&&s!==void 0?s:null;return[d,h]}function Ey({committedValuesRef:t,eagerValuesRef:e,groupId:n,layout:r,panelDataArray:i,panelGroupElement:a,setLayout:s}){v.useRef({didWarnAboutMissingResizeHandle:!1}),Zt(()=>{if(!a)return;const u=hr(n,a);for(let o=0;o<i.length-1;o++){const{valueMax:l,valueMin:f,valueNow:d}=gy({layout:r,panelsArray:i,pivotIndices:[o,o+1]}),h=u[o];if(h!=null){const p=i[o];oe(p,`No panel data found for index "${o}"`),h.setAttribute("aria-controls",p.id),h.setAttribute("aria-valuemax",""+Math.round(l)),h.setAttribute("aria-valuemin",""+Math.round(f)),h.setAttribute("aria-valuenow",d!=null?""+Math.round(d):"")}}return()=>{u.forEach((o,l)=>{o.removeAttribute("aria-controls"),o.removeAttribute("aria-valuemax"),o.removeAttribute("aria-valuemin"),o.removeAttribute("aria-valuenow")})}},[n,r,i,a]),v.useEffect(()=>{if(!a)return;const u=e.current;oe(u,"Eager values not found");const{panelDataArray:o}=u,l=Rd(n,a);oe(l!=null,`No group found for id "${n}"`);const f=hr(n,a);oe(f,`No resize handles found for group id "${n}"`);const d=f.map(h=>{const p=h.getAttribute(Oe.resizeHandleId);oe(p,"Resize handle element has no handle id attribute");const[g,x]=by(n,p,o,a);if(g==null||x==null)return()=>{};const _=b=>{if(!b.defaultPrevented)switch(b.key){case"Enter":{b.preventDefault();const k=o.findIndex(E=>E.id===g);if(k>=0){const E=o[k];oe(E,`No panel data found for index ${k}`);const w=r[k],{collapsedSize:R=0,collapsible:S,minSize:O=0}=E.constraints;if(w!=null&&S){const F=Vn({delta:et(w,R)?O-R:R-w,initialLayout:r,panelConstraints:o.map(j=>j.constraints),pivotIndices:wd(n,p,a),prevLayout:r,trigger:"keyboard"});r!==F&&s(F)}}break}}};return h.addEventListener("keydown",_),()=>{h.removeEventListener("keydown",_)}});return()=>{d.forEach(h=>h())}},[a,t,e,n,r,i,s])}function so(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function Ld(t,e){const n=t==="horizontal",{x:r,y:i}=xi(e);return n?r:i}function Ty(t,e,n,r,i){const a=n==="horizontal",s=yi(e,i);oe(s,`No resize handle element found for id "${e}"`);const u=s.getAttribute(Oe.groupId);oe(u,"Resize handle element has no group id attribute");let{initialCursorPosition:o}=r;const l=Ld(n,t),f=Rd(u,i);oe(f,`No group element found for id "${u}"`);const d=f.getBoundingClientRect(),h=a?d.width:d.height;return(l-o)/h*100}function xy(t,e,n,r,i,a){if(Td(t)){const s=n==="horizontal";let u=0;t.shiftKey?u=100:i!=null?u=i:u=10;let o=0;switch(t.key){case"ArrowDown":o=s?0:u;break;case"ArrowLeft":o=s?-u:0;break;case"ArrowRight":o=s?u:0;break;case"ArrowUp":o=s?0:-u;break;case"End":o=100;break;case"Home":o=-100;break}return o}else return r==null?0:Ty(t,e,n,r,a)}function _y({panelDataArray:t}){const e=Array(t.length),n=t.map(a=>a.constraints);let r=0,i=100;for(let a=0;a<t.length;a++){const s=n[a];oe(s,`Panel constraints not found for index ${a}`);const{defaultSize:u}=s;u!=null&&(r++,e[a]=u,i-=u)}for(let a=0;a<t.length;a++){const s=n[a];oe(s,`Panel constraints not found for index ${a}`);const{defaultSize:u}=s;if(u!=null)continue;const o=t.length-r,l=i/o;r++,e[a]=l,i-=l}return e}function fn(t,e,n){e.forEach((r,i)=>{const a=t[i];oe(a,`Panel data not found for index ${i}`);const{callbacks:s,constraints:u,id:o}=a,{collapsedSize:l=0,collapsible:f}=u,d=n[o];if(d==null||r!==d){n[o]=r;const{onCollapse:h,onExpand:p,onResize:g}=s;g&&g(r,d),f&&(h||p)&&(p&&(d==null||_t(d,l))&&!_t(r,l)&&p(),h&&(d==null||!_t(d,l))&&_t(r,l)&&h())}})}function vr(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n])return!1;return!0}function yy({defaultSize:t,dragState:e,layout:n,panelData:r,panelIndex:i,precision:a=3}){const s=n[i];let u;return s==null?u=t!=null?t.toPrecision(a):"1":r.length===1?u="1":u=s.toPrecision(a),{flexBasis:0,flexGrow:u,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function Ay(t,e=10){let n=null;return(...i)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{t(...i)},e)}}function uo(t){try{if(typeof localStorage<"u")t.getItem=e=>localStorage.getItem(e),t.setItem=(e,n)=>{localStorage.setItem(e,n)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),t.getItem=()=>null,t.setItem=()=>{}}}function Od(t){return`react-resizable-panels:${t}`}function vd(t){return t.map(e=>{const{constraints:n,id:r,idIsFromProps:i,order:a}=e;return i?r:a?`${a}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((e,n)=>e.localeCompare(n)).join(",")}function Dd(t,e){try{const n=Od(t),r=e.getItem(n);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function Cy(t,e,n){var r,i;const a=(r=Dd(t,n))!==null&&r!==void 0?r:{},s=vd(e);return(i=a[s])!==null&&i!==void 0?i:null}function ky(t,e,n,r,i){var a;const s=Od(t),u=vd(e),o=(a=Dd(t,i))!==null&&a!==void 0?a:{};o[u]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{i.setItem(s,JSON.stringify(o))}catch(l){console.error(l)}}function oo({layout:t,panelConstraints:e}){const n=[...t],r=n.reduce((a,s)=>a+s,0);if(n.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${n.map(a=>`${a}%`).join(", ")}`);if(!et(r,100)&&n.length>0)for(let a=0;a<e.length;a++){const s=n[a];oe(s!=null,`No layout data found for index ${a}`);const u=100/r*s;n[a]=u}let i=0;for(let a=0;a<e.length;a++){const s=n[a];oe(s!=null,`No layout data found for index ${a}`);const u=En({panelConstraints:e,panelIndex:a,size:s});s!=u&&(i+=s-u,n[a]=u)}if(!et(i,0))for(let a=0;a<e.length;a++){const s=n[a];oe(s!=null,`No layout data found for index ${a}`);const u=s+i,o=En({panelConstraints:e,panelIndex:a,size:u});if(s!==o&&(i-=o-s,n[a]=o,et(i,0)))break}return n}const Sy=100,Wn={getItem:t=>(uo(Wn),Wn.getItem(t)),setItem:(t,e)=>{uo(Wn),Wn.setItem(t,e)}},lo={};function Pd({autoSaveId:t=null,children:e,className:n="",direction:r,forwardedRef:i,id:a=null,onLayout:s=null,keyboardResizeBy:u=null,storage:o=Wn,style:l,tagName:f="div",...d}){const h=hs(a),p=v.useRef(null),[g,x]=v.useState(null),[_,b]=v.useState([]),k=py(),E=v.useRef({}),w=v.useRef(new Map),R=v.useRef(0),S=v.useRef({autoSaveId:t,direction:r,dragState:g,id:h,keyboardResizeBy:u,onLayout:s,storage:o}),O=v.useRef({layout:_,panelDataArray:[],panelDataArrayChanged:!1});v.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),v.useImperativeHandle(i,()=>({getId:()=>S.current.id,getLayout:()=>{const{layout:y}=O.current;return y},setLayout:y=>{const{onLayout:V}=S.current,{layout:G,panelDataArray:Q}=O.current,X=oo({layout:y,panelConstraints:Q.map(ee=>ee.constraints)});so(G,X)||(b(X),O.current.layout=X,V&&V(X),fn(Q,X,E.current))}}),[]),Zt(()=>{S.current.autoSaveId=t,S.current.direction=r,S.current.dragState=g,S.current.id=h,S.current.onLayout=s,S.current.storage=o}),Ey({committedValuesRef:S,eagerValuesRef:O,groupId:h,layout:_,panelDataArray:O.current.panelDataArray,setLayout:b,panelGroupElement:p.current}),v.useEffect(()=>{const{panelDataArray:y}=O.current;if(t){if(_.length===0||_.length!==y.length)return;let V=lo[t];V==null&&(V=Ay(ky,Sy),lo[t]=V);const G=[...y],Q=new Map(w.current);V(t,G,Q,_,o)}},[t,_,o]),v.useEffect(()=>{});const F=v.useCallback(y=>{const{onLayout:V}=S.current,{layout:G,panelDataArray:Q}=O.current;if(y.constraints.collapsible){const X=Q.map(Le=>Le.constraints),{collapsedSize:ee=0,panelSize:se,pivotIndices:ge}=qt(Q,y,G);if(oe(se!=null,`Panel size not found for panel "${y.id}"`),!_t(se,ee)){w.current.set(y.id,se);const Be=gn(Q,y)===Q.length-1?se-ee:ee-se,he=Vn({delta:Be,initialLayout:G,panelConstraints:X,pivotIndices:ge,prevLayout:G,trigger:"imperative-api"});vr(G,he)||(b(he),O.current.layout=he,V&&V(he),fn(Q,he,E.current))}}},[]),j=v.useCallback((y,V)=>{const{onLayout:G}=S.current,{layout:Q,panelDataArray:X}=O.current;if(y.constraints.collapsible){const ee=X.map(Ze=>Ze.constraints),{collapsedSize:se=0,panelSize:ge=0,minSize:Le=0,pivotIndices:Be}=qt(X,y,Q),he=V??Le;if(_t(ge,se)){const Ze=w.current.get(y.id),kt=Ze!=null&&Ze>=he?Ze:he,on=gn(X,y)===X.length-1?ge-kt:kt-ge,Fe=Vn({delta:on,initialLayout:Q,panelConstraints:ee,pivotIndices:Be,prevLayout:Q,trigger:"imperative-api"});vr(Q,Fe)||(b(Fe),O.current.layout=Fe,G&&G(Fe),fn(X,Fe,E.current))}}},[]),N=v.useCallback(y=>{const{layout:V,panelDataArray:G}=O.current,{panelSize:Q}=qt(G,y,V);return oe(Q!=null,`Panel size not found for panel "${y.id}"`),Q},[]),P=v.useCallback((y,V)=>{const{panelDataArray:G}=O.current,Q=gn(G,y);return yy({defaultSize:V,dragState:g,layout:_,panelData:G,panelIndex:Q})},[g,_]),M=v.useCallback(y=>{const{layout:V,panelDataArray:G}=O.current,{collapsedSize:Q=0,collapsible:X,panelSize:ee}=qt(G,y,V);return oe(ee!=null,`Panel size not found for panel "${y.id}"`),X===!0&&_t(ee,Q)},[]),J=v.useCallback(y=>{const{layout:V,panelDataArray:G}=O.current,{collapsedSize:Q=0,collapsible:X,panelSize:ee}=qt(G,y,V);return oe(ee!=null,`Panel size not found for panel "${y.id}"`),!X||rn(ee,Q)>0},[]),z=v.useCallback(y=>{const{panelDataArray:V}=O.current;V.push(y),V.sort((G,Q)=>{const X=G.order,ee=Q.order;return X==null&&ee==null?0:X==null?-1:ee==null?1:X-ee}),O.current.panelDataArrayChanged=!0,k()},[k]);Zt(()=>{if(O.current.panelDataArrayChanged){O.current.panelDataArrayChanged=!1;const{autoSaveId:y,onLayout:V,storage:G}=S.current,{layout:Q,panelDataArray:X}=O.current;let ee=null;if(y){const ge=Cy(y,X,G);ge&&(w.current=new Map(Object.entries(ge.expandToSizes)),ee=ge.layout)}ee==null&&(ee=_y({panelDataArray:X}));const se=oo({layout:ee,panelConstraints:X.map(ge=>ge.constraints)});so(Q,se)||(b(se),O.current.layout=se,V&&V(se),fn(X,se,E.current))}}),Zt(()=>{const y=O.current;return()=>{y.layout=[]}},[]);const H=v.useCallback(y=>{let V=!1;const G=p.current;return G&&window.getComputedStyle(G,null).getPropertyValue("direction")==="rtl"&&(V=!0),function(X){X.preventDefault();const ee=p.current;if(!ee)return()=>null;const{direction:se,dragState:ge,id:Le,keyboardResizeBy:Be,onLayout:he}=S.current,{layout:Ze,panelDataArray:kt}=O.current,{initialLayout:Ut}=ge??{},on=wd(Le,y,ee);let Fe=xy(X,y,se,ge,Be,ee);const Ln=se==="horizontal";Ln&&V&&(Fe=-Fe);const Cr=kt.map(Ai=>Ai.constraints),zt=Vn({delta:Fe,initialLayout:Ut??Ze,panelConstraints:Cr,pivotIndices:on,prevLayout:Ze,trigger:Td(X)?"keyboard":"mouse-or-touch"}),kr=!vr(Ze,zt);(xd(X)||_d(X))&&R.current!=Fe&&(R.current=Fe,!kr&&Fe!==0?Ln?Zi(y,Fe<0?Ad:Cd):Zi(y,Fe<0?kd:Sd):Zi(y,0)),kr&&(b(zt),O.current.layout=zt,he&&he(zt),fn(kt,zt,E.current))}},[]),Z=v.useCallback((y,V)=>{const{onLayout:G}=S.current,{layout:Q,panelDataArray:X}=O.current,ee=X.map(Ze=>Ze.constraints),{panelSize:se,pivotIndices:ge}=qt(X,y,Q);oe(se!=null,`Panel size not found for panel "${y.id}"`);const Be=gn(X,y)===X.length-1?se-V:V-se,he=Vn({delta:Be,initialLayout:Q,panelConstraints:ee,pivotIndices:ge,prevLayout:Q,trigger:"imperative-api"});vr(Q,he)||(b(he),O.current.layout=he,G&&G(he),fn(X,he,E.current))},[]),re=v.useCallback((y,V)=>{const{layout:G,panelDataArray:Q}=O.current,{collapsedSize:X=0,collapsible:ee}=V,{collapsedSize:se=0,collapsible:ge,maxSize:Le=100,minSize:Be=0}=y.constraints,{panelSize:he}=qt(Q,y,G);he!=null&&(ee&&ge&&_t(he,X)?_t(X,se)||Z(y,se):he<Be?Z(y,Be):he>Le&&Z(y,Le))},[Z]),le=v.useCallback((y,V)=>{const{direction:G}=S.current,{layout:Q}=O.current;if(!p.current)return;const X=yi(y,p.current);oe(X,`Drag handle element not found for id "${y}"`);const ee=Ld(G,V);x({dragHandleId:y,dragHandleRect:X.getBoundingClientRect(),initialCursorPosition:ee,initialLayout:Q})},[]),Te=v.useCallback(()=>{x(null)},[]),I=v.useCallback(y=>{const{panelDataArray:V}=O.current,G=gn(V,y);G>=0&&(V.splice(G,1),delete E.current[y.id],O.current.panelDataArrayChanged=!0,k())},[k]),me=v.useMemo(()=>({collapsePanel:F,direction:r,dragState:g,expandPanel:j,getPanelSize:N,getPanelStyle:P,groupId:h,isPanelCollapsed:M,isPanelExpanded:J,reevaluatePanelConstraints:re,registerPanel:z,registerResizeHandle:H,resizePanel:Z,startDragging:le,stopDragging:Te,unregisterPanel:I,panelGroupElement:p.current}),[F,g,r,j,N,P,h,M,J,re,z,H,Z,le,Te,I]),Ae={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return v.createElement(Ti.Provider,{value:me},v.createElement(f,{...d,children:e,className:n,id:a,ref:p,style:{...Ae,...l},[Oe.group]:"",[Oe.groupDirection]:r,[Oe.groupId]:h}))}const Md=v.forwardRef((t,e)=>v.createElement(Pd,{...t,forwardedRef:e}));Pd.displayName="PanelGroup";Md.displayName="forwardRef(PanelGroup)";function gn(t,e){return t.findIndex(n=>n===e||n.id===e.id)}function qt(t,e,n){const r=gn(t,e),a=r===t.length-1?[r-1,r]:[r,r+1],s=n[r];return{...e.constraints,panelSize:s,pivotIndices:a}}function Iy({disabled:t,handleId:e,resizeHandler:n,panelGroupElement:r}){v.useEffect(()=>{if(t||n==null||r==null)return;const i=yi(e,r);if(i==null)return;const a=s=>{if(!s.defaultPrevented)switch(s.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{s.preventDefault(),n(s);break}case"F6":{s.preventDefault();const u=i.getAttribute(Oe.groupId);oe(u,`No group element found for id "${u}"`);const o=hr(u,r),l=Nd(u,e,r);oe(l!==null,`No resize element found for id "${e}"`);const f=s.shiftKey?l>0?l-1:o.length-1:l+1<o.length?l+1:0;o[f].focus();break}}};return i.addEventListener("keydown",a),()=>{i.removeEventListener("keydown",a)}},[r,t,e,n])}function Bd({children:t=null,className:e="",disabled:n=!1,hitAreaMargins:r,id:i,onBlur:a,onClick:s,onDragging:u,onFocus:o,onPointerDown:l,onPointerUp:f,style:d={},tabIndex:h=0,tagName:p="div",...g}){var x,_;const b=v.useRef(null),k=v.useRef({onClick:s,onDragging:u,onPointerDown:l,onPointerUp:f});v.useEffect(()=>{k.current.onClick=s,k.current.onDragging=u,k.current.onPointerDown=l,k.current.onPointerUp=f});const E=v.useContext(Ti);if(E===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:w,groupId:R,registerResizeHandle:S,startDragging:O,stopDragging:F,panelGroupElement:j}=E,N=hs(i),[P,M]=v.useState("inactive"),[J,z]=v.useState(!1),[H,Z]=v.useState(null),re=v.useRef({state:P});Zt(()=>{re.current.state=P}),v.useEffect(()=>{if(n)Z(null);else{const me=S(N);Z(()=>me)}},[n,N,S]);const le=(x=r?.coarse)!==null&&x!==void 0?x:15,Te=(_=r?.fine)!==null&&_!==void 0?_:5;v.useEffect(()=>{if(n||H==null)return;const me=b.current;oe(me,"Element ref not attached");let Ae=!1;return fy(N,me,w,{coarse:le,fine:Te},(V,G,Q)=>{if(!G){M("inactive");return}switch(V){case"down":{M("drag"),Ae=!1,oe(Q,'Expected event to be defined for "down" action'),O(N,Q);const{onDragging:X,onPointerDown:ee}=k.current;X?.(!0),ee?.();break}case"move":{const{state:X}=re.current;Ae=!0,X!=="drag"&&M("hover"),oe(Q,'Expected event to be defined for "move" action'),H(Q);break}case"up":{M("hover"),F();const{onClick:X,onDragging:ee,onPointerUp:se}=k.current;ee?.(!1),se?.(),Ae||X?.();break}}})},[le,w,n,Te,S,N,H,O,F]),Iy({disabled:n,handleId:N,resizeHandler:H,panelGroupElement:j});const I={touchAction:"none",userSelect:"none"};return v.createElement(p,{...g,children:t,className:e,id:i,onBlur:()=>{z(!1),a?.()},onFocus:()=>{z(!0),o?.()},ref:b,role:"separator",style:{...I,...d},tabIndex:h,[Oe.groupDirection]:w,[Oe.groupId]:R,[Oe.resizeHandle]:"",[Oe.resizeHandleActive]:P==="drag"?"pointer":J?"keyboard":void 0,[Oe.resizeHandleEnabled]:!n,[Oe.resizeHandleId]:N,[Oe.resizeHandleState]:P})}Bd.displayName="PanelResizeHandle";function sA(t){const e=K.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=ce("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",n),e[3]=n,e[4]=i):i=e[4];let a;return e[5]!==r||e[6]!==i?(a=m.jsx(Md,{"data-slot":"resizable-panel-group",className:i,...r}),e[5]=r,e[6]=i,e[7]=a):a=e[7],a}function uA(t){const e=K.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(Ed,{"data-slot":"resizable-panel",...n}),e[2]=n,e[3]=r):r=e[3],r}function oA(t){const e=K.c(12);let n,r,i;e[0]!==t?({withHandle:i,className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);let a;e[4]!==n?(a=ce("bg-border focus-visible:ring-ring relative flex w-[0.5px] items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",n),e[4]=n,e[5]=a):a=e[5];let s;e[6]!==i?(s=i&&m.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:m.jsx(xo,{className:"size-2.5"})}),e[6]=i,e[7]=s):s=e[7];let u;return e[8]!==r||e[9]!==a||e[10]!==s?(u=m.jsx(Bd,{"data-slot":"resizable-handle",className:a,...r,children:s}),e[8]=r,e[9]=a,e[10]=s,e[11]=u):u=e[11],u}export{iA as C,N_ as D,nA as G,tA as I,rA as M,uA as R,o_ as U,Zy as a,P_ as b,U_ as c,eA as d,Ky as e,L_ as f,O_ as g,v_ as h,Ju as i,I_ as j,oA as k,aA as l,sA as m,So as n,w0 as u};
@@ -1 +1 @@
1
- import{c as x,j as u}from"./index-CiPLnea-.js";import{c,B as p}from"./button-CFHFP204.js";import{B as g}from"./badge-6daA1Xk-.js";function j(f){const e=x.c(12),{tabs:d,activeTab:n,onTabChange:s,className:l}=f;let t;e[0]!==l?(t=c("flex items-center gap-2 overflow-x-auto no-scrollbar",l),e[0]=l,e[1]=t):t=e[1];let o;if(e[2]!==n||e[3]!==s||e[4]!==d){let i;e[6]!==n||e[7]!==s?(i=r=>{const m=n===r.id;return u.jsxs(p,{variant:"outline",size:"sm",onClick:()=>s(r.id),className:c("h-8 rounded-lg border border-transparent bg-transparent px-3 py-1 hover:bg-muted",m&&"bg-muted border-input text-foreground font-medium",!m&&"text-muted-foreground font-normal"),children:[r.label,r.count!==void 0&&u.jsx(g,{variant:"secondary",className:c("ml-2 h-5 min-w-5 px-1 rounded-full text-[10px] font-mono",m?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:r.count})]},r.id)},e[6]=n,e[7]=s,e[8]=i):i=e[8],o=d.map(i),e[2]=n,e[3]=s,e[4]=d,e[5]=o}else o=e[5];let a;return e[9]!==t||e[10]!==o?(a=u.jsx("div",{className:t,children:o}),e[9]=t,e[10]=o,e[11]=a):a=e[11],a}export{j as R};
1
+ import{c as x,j as u}from"./index-BAX9m6md.js";import{c,B as p}from"./button-Cr6E3Zah.js";import{B as g}from"./badge-DadBZYFc.js";function j(f){const e=x.c(12),{tabs:d,activeTab:n,onTabChange:s,className:l}=f;let t;e[0]!==l?(t=c("flex items-center gap-2 overflow-x-auto no-scrollbar",l),e[0]=l,e[1]=t):t=e[1];let o;if(e[2]!==n||e[3]!==s||e[4]!==d){let i;e[6]!==n||e[7]!==s?(i=r=>{const m=n===r.id;return u.jsxs(p,{variant:"outline",size:"sm",onClick:()=>s(r.id),className:c("h-8 rounded-lg border border-transparent bg-transparent px-3 py-1 hover:bg-muted",m&&"bg-muted border-input text-foreground font-medium",!m&&"text-muted-foreground font-normal"),children:[r.label,r.count!==void 0&&u.jsx(g,{variant:"secondary",className:c("ml-2 h-5 min-w-5 px-1 rounded-full text-[10px] font-mono",m?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:r.count})]},r.id)},e[6]=n,e[7]=s,e[8]=i):i=e[8],o=d.map(i),e[2]=n,e[3]=s,e[4]=d,e[5]=o}else o=e[5];let a;return e[9]!==t||e[10]!==o?(a=u.jsx("div",{className:t,children:o}),e[9]=t,e[10]=o,e[11]=a):a=e[11],a}export{j as R};