@decocms/mesh 1.0.21 → 1.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/dist/client/assets/{AlertCircle-CkBPRGL_.js → AlertCircle-Du1WT751.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-eDq0PdxL.js → ArrowLeft-D2XEhobZ.js} +1 -1
  3. package/dist/client/assets/{Calendar-GsuMeXnI.js → Calendar-Co6ako3r.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-CqrF2uJ-.js → ChevronDown-BTsoCUlX.js} +1 -1
  5. package/dist/client/assets/{Clock-d43uwP0y.js → Clock-DaV6oMqF.js} +1 -1
  6. package/dist/client/assets/{Copy01-CUqgUCLS.js → Copy01-DK5159Rb.js} +1 -1
  7. package/dist/client/assets/{CpuChip02-CwrVudRE.js → CpuChip02-DG7E5vjX.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-CGWni397.js → DotsVertical-ATvueeDl.js} +1 -1
  9. package/dist/client/assets/{File06-CwcvFGqd.js → File06-CCcPYdcS.js} +1 -1
  10. package/dist/client/assets/{GitBranch01-B0LIL7GO.js → GitBranch01-DdBZ2zon.js} +1 -1
  11. package/dist/client/assets/{Inbox01-De35FSLT.js → Inbox01-FsIho9ps.js} +1 -1
  12. package/dist/client/assets/{InfoCircle-CaOedrxe.js → InfoCircle-z9SmeZ2K.js} +1 -1
  13. package/dist/client/assets/{Key01-BXtnSDND.js → Key01-PJxsN9f2.js} +1 -1
  14. package/dist/client/assets/{LinkExternal01-ClKXW-wQ.js → LinkExternal01-UPDE0V2O.js} +1 -1
  15. package/dist/client/assets/{Loading01-DfUJLT5a.js → Loading01-CH6mw7mn.js} +1 -1
  16. package/dist/client/assets/{Lock01-mcQuD2fk.js → Lock01-DfYPtjUw.js} +1 -1
  17. package/dist/client/assets/{Plus-xQLsl9Xg.js → Plus-D2stpxr4.js} +1 -1
  18. package/dist/client/assets/{SearchMd-BAWY3jJ1.js → SearchMd-CwAqtJqG.js} +1 -1
  19. package/dist/client/assets/{Terminal-CJwUlnBn.js → Terminal-zrKj2_VN.js} +1 -1
  20. package/dist/client/assets/{Trash01-DAwkJNu8.js → Trash01-BRxmwmD1.js} +1 -1
  21. package/dist/client/assets/{Upload01-5z8SDkNm.js → Upload01-CGDUyeg3.js} +1 -1
  22. package/dist/client/assets/{X-SWur-HdE.js → X-E7J_uWRT.js} +1 -1
  23. package/dist/client/assets/{XClose-CAyc7YMv.js → XClose-BGxDstvO.js} +1 -1
  24. package/dist/client/assets/{alert-dialog-dauOR89q.js → alert-dialog-CxYBxRCI.js} +2 -2
  25. package/dist/client/assets/auth-TMT6XsET.js +1 -0
  26. package/dist/client/assets/{auth-catchall-L0DhXNi0.js → auth-catchall-DkkFwJAm.js} +1 -1
  27. package/dist/client/assets/avatar-F70el86e.js +1 -0
  28. package/dist/client/assets/{badge-DBsMMhww.js → badge-BcTlBuEb.js} +1 -1
  29. package/dist/client/assets/{button-UpWqqi7Z.js → button-Dj8ueofv.js} +1 -1
  30. package/dist/client/assets/{card-csaWOT-1.js → card-66QSeiOF.js} +1 -1
  31. package/dist/client/assets/{checkbox-B53QAVdc.js → checkbox-CVcef9O7.js} +1 -1
  32. package/dist/client/assets/{collection-detail-DU4x4vE8.js → collection-detail-D8wVTEqX.js} +1 -1
  33. package/dist/client/assets/{collection-display-button-CJMwmXuc.js → collection-display-button-C193PAy9.js} +1 -1
  34. package/dist/client/assets/{collection-header-BIZLVBPH.js → collection-header-BuFCeK4g.js} +1 -1
  35. package/dist/client/assets/{collection-page-CpTNB-W7.js → collection-page-M_cHcDoQ.js} +1 -1
  36. package/dist/client/assets/{collection-search-xvAQUbQ8.js → collection-search-Vq1GfSWB.js} +1 -1
  37. package/dist/client/assets/{collection-table-wrapper-BLpgESGM.js → collection-table-wrapper-BCXAi-BN.js} +1 -1
  38. package/dist/client/assets/{connection-card-DIVWkbya.js → connection-card-BsnAC2N8.js} +1 -1
  39. package/dist/client/assets/connection-detail-R_iXfPNX.js +1 -0
  40. package/dist/client/assets/connections-DYIPJTN9.js +1 -0
  41. package/dist/client/assets/{core-Cy6-sfQL.js → core-DKy85ot6.js} +1 -1
  42. package/dist/client/assets/{create-organization-dialog-BpD_WYLu.js → create-organization-dialog-Dc45BpM3.js} +1 -1
  43. package/dist/client/assets/{dialog-DQ_m9LgP.js → dialog-Dcux2Ttt.js} +1 -1
  44. package/dist/client/assets/{dropdown-menu-B_pozn9G.js → dropdown-menu-BUANjhM2.js} +1 -1
  45. package/dist/client/assets/env-vars-editor-Cmi8ii-i.js +1 -0
  46. package/dist/client/assets/{error-boundary-07xTy_TK.js → error-boundary-BaDP7Z4Q.js} +1 -1
  47. package/dist/client/assets/{extract-connection-data-DzWc2H-V.js → extract-connection-data-BD7XgNcV.js} +1 -1
  48. package/dist/client/assets/{form-CGaxh2WC.js → form-D1QOQ8Im.js} +1 -1
  49. package/dist/client/assets/{formatDistanceToNow-BzQ8Uo3Q.js → formatDistanceToNow-BZKDch9X.js} +1 -1
  50. package/dist/client/assets/gateway-detail-BruHhfdQ.js +1 -0
  51. package/dist/client/assets/{gateways-B-RGUqRx.js → gateways-MFtOEWry.js} +1 -1
  52. package/dist/client/assets/{home-FzIxjpJt.js → home-CfjYes5U.js} +1 -1
  53. package/dist/client/assets/{index-CB7OHJDJ.js → index-B-Y0sZwN.js} +1 -1
  54. package/dist/client/assets/index-BdkjLo3e.css +1 -0
  55. package/dist/client/assets/{index-Czm7CWjK.js → index-CXfjFAB2.js} +1 -1
  56. package/dist/client/assets/{index-D_TAlzS2.js → index-D7vBid7X.js} +1 -1
  57. package/dist/client/assets/{index-D_9U2egr.js → index-DkE856zJ.js} +3 -3
  58. package/dist/client/assets/{input-DNanPJKs.js → input-C2Ph-V5_.js} +1 -1
  59. package/dist/client/assets/json-DVnNOwmi.js +1 -0
  60. package/dist/client/assets/{json-syntax-highlighter-BgGlXkoS.js → json-syntax-highlighter-B4SQlh57.js} +2 -2
  61. package/dist/client/assets/{layout-Cx9b8Yer.js → layout-DqSCBByW.js} +1 -1
  62. package/dist/client/assets/{lazy-highlighter-B6ffJp-C.js → lazy-highlighter-BZxAEkAn.js} +1 -1
  63. package/dist/client/assets/{localstorage-keys-BkdyiQZF.js → localstorage-keys-BdgFgIfr.js} +1 -1
  64. package/dist/client/assets/{login-C7pFWDVX.js → login-CjvCnOTd.js} +1 -1
  65. package/dist/client/assets/{mcp-oauth-C_ge4NPz.js → mcp-oauth-BRLf6SSt.js} +1 -1
  66. package/dist/client/assets/members-qDc7lURh.js +3 -0
  67. package/dist/client/assets/monitoring-B3MEXlZy.js +1 -0
  68. package/dist/client/assets/{oauth-callback-DVsq0aWr.js → oauth-callback-DRBgoMZ7.js} +1 -1
  69. package/dist/client/assets/{page-lDA0jUjQ.js → page-BQFA7pBB.js} +1 -1
  70. package/dist/client/assets/popover-B5X6Vli5.js +1 -0
  71. package/dist/client/assets/prism-light-BeJZ3zKA.js +1 -0
  72. package/dist/client/assets/{resizable-CjAFAEbu.js → resizable-D_GRD1gk.js} +3 -3
  73. package/dist/client/assets/{resource-tabs-CwnllnxC.js → resource-tabs-BeL7wdCw.js} +1 -1
  74. package/dist/client/assets/select-DIsljPdj.js +1 -0
  75. package/dist/client/assets/{settings-B33ucW8T.js → settings-D0j6CjB5.js} +1 -1
  76. package/dist/client/assets/{shell-layout-D2VG1r1F.js → shell-layout-CdA9l5Mv.js} +1 -1
  77. package/dist/client/assets/{spinner-mwkhkfGn.js → spinner-TVmB-5qD.js} +1 -1
  78. package/dist/client/assets/{store-bCSxhgbO.js → store-Dg8rXQqH.js} +1 -1
  79. package/dist/client/assets/{store-app-detail-MMa90jUl.js → store-app-detail-BaLRva6m.js} +1 -1
  80. package/dist/client/assets/switch-Zc7AToJx.js +1 -0
  81. package/dist/client/assets/{tools-list-ReDr32oC.js → tools-list-D_OD1vn5.js} +1 -1
  82. package/dist/client/assets/tooltip-CNuF1S13.js +1 -0
  83. package/dist/client/assets/{types-C7Od-bBc.js → types-BFTKKK_w.js} +1 -1
  84. package/dist/client/assets/{use-binding-q2q9V0d9.js → use-binding-Dx0VfUue.js} +6 -6
  85. package/dist/client/assets/{use-connection-CCY0Xwwp.js → use-connection-B9P3V0a0.js} +1 -1
  86. package/dist/client/assets/{use-connection-resources-CQX8IZC3.js → use-connection-resources-BzPnvL0L.js} +1 -1
  87. package/dist/client/assets/{use-gateway-6PKj5OoP.js → use-gateway-DynzgasG.js} +1 -1
  88. package/dist/client/assets/{use-list-state-C-sROL5p.js → use-list-state-DLhjJXJo.js} +1 -1
  89. package/dist/client/assets/{use-mcp-W5evRIL-.js → use-mcp-B4HuTx_L.js} +1 -1
  90. package/dist/client/assets/{use-members-DBU71Me9.js → use-members-8RC-uoxQ.js} +1 -1
  91. package/dist/client/assets/{use-mobile-DjZ7nTWx.js → use-mobile-BtxRZpBG.js} +1 -1
  92. package/dist/client/assets/{use-organization-settings-Du1vfsWT.js → use-organization-settings-D16HeZQR.js} +1 -1
  93. package/dist/client/assets/{use-tool-call-DTxbLF2G.js → use-tool-call-Betk01yc.js} +1 -1
  94. package/dist/client/assets/useQuery-BDcaqn5m.js +1 -0
  95. package/dist/client/assets/{useSuspenseInfiniteQuery-6jf87YQF.js → useSuspenseInfiniteQuery-DHmfnsAy.js} +1 -1
  96. package/dist/client/assets/{view-mode-toggle-BWA1OFcI.js → view-mode-toggle-CIqr2uxV.js} +1 -1
  97. package/dist/client/index.html +2 -2
  98. package/dist/server/cli.js +128 -128
  99. package/dist/server/migrate.js +87 -87
  100. package/dist/server/server.js +121 -121
  101. package/package.json +1 -1
  102. package/dist/client/assets/auth-Ds7lWA5K.js +0 -1
  103. package/dist/client/assets/avatar-CB7RLPFt.js +0 -1
  104. package/dist/client/assets/connection-detail-Cdicu8TT.js +0 -1
  105. package/dist/client/assets/connections-BYIPhseC.js +0 -1
  106. package/dist/client/assets/env-vars-editor-DcIkv_3p.js +0 -1
  107. package/dist/client/assets/gateway-detail-DOKwn-_O.js +0 -1
  108. package/dist/client/assets/index-DNC-5MRZ.css +0 -1
  109. package/dist/client/assets/json-rZ-8IzF3.js +0 -1
  110. package/dist/client/assets/members-g3aHOb_a.js +0 -3
  111. package/dist/client/assets/monitoring-B4Jp1FeK.js +0 -1
  112. package/dist/client/assets/popover-BN78TD4M.js +0 -1
  113. package/dist/client/assets/prism-light-B_WmfTLI.js +0 -1
  114. package/dist/client/assets/select-888i9ck2.js +0 -1
  115. package/dist/client/assets/switch-CxdnIT30.js +0 -1
  116. package/dist/client/assets/tooltip-CaoJSXa7.js +0 -1
  117. package/dist/client/assets/useQuery-BTda2D25.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lazy-highlighter-B6ffJp-C.js","assets/index-D_9U2egr.js","assets/index-DNC-5MRZ.css","assets/core-Cy6-sfQL.js","assets/json-BESjz4hO.js"])))=>i.map(i=>d[i]);
2
- import{r as v,aF as Fd,aG as Hd,aH as Xe,w as G,aI as jr,aJ as fo,aK as Ud,aL as zd,aM as jd,Y as Ye,X as rr,W as hr,v as ke,aN as re,aO as Nt,aP as $d,aQ as Ne,a0 as Yd,aj as Na,c as X,e as ho,K as Qe,q as wa,j as m,aR as An,a3 as po,ax as qd,f as Vd,t as vr,am as Wd}from"./index-D_9U2egr.js";import{i as Gd}from"./X-SWur-HdE.js";import{E as Qd,u as Xd}from"./use-binding-q2q9V0d9.js";import{u as Cn,i as Xt,c as Ra,b as La,T as Oa}from"./tooltip-CaoJSXa7.js";import{u as Vt,c as ue,B as Ct}from"./button-UpWqqi7Z.js";import{j as Zd,c as Kd}from"./dropdown-menu-B_pozn9G.js";import{T as Jd}from"./dialog-DQ_m9LgP.js";import{i as va}from"./CpuChip02-CwrVudRE.js";import{i as mo}from"./SearchMd-BAWY3jJ1.js";import{I as go,b as ef,U as tf,e as nf,c as rf,u as af}from"./use-connection-CCY0Xwwp.js";import{b as sf,a as uf,c as of,S as lf,n as cf}from"./select-888i9ck2.js";import{u as df}from"./use-mobile-DjZ7nTWx.js";import{u as ff}from"./use-gateway-6PKj5OoP.js";import{t as bo}from"./ChevronDown-CqrF2uJ-.js";import{a as ni}from"./Copy01-CUqgUCLS.js";import{i as hf}from"./AlertCircle-CkBPRGL_.js";import{i as pf}from"./Terminal-CJwUlnBn.js";import{C as mf}from"./connection-card-DIVWkbya.js";import{n as gf}from"./LinkExternal01-ClKXW-wQ.js";import{S as bf}from"./spinner-mwkhkfGn.js";import{b as Ef,c as Tf,d as xf,A as _f,a as yf,e as Af,g as Cf,f as kf}from"./alert-dialog-dauOR89q.js";import{i as Sf}from"./File06-CwcvFGqd.js";import{i as If}from"./InfoCircle-CaOedrxe.js";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:"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"}));Eo.displayName="Coins01";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:"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"}));To.displayName="CornerUpLeft";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:"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"}));xo.displayName="CurrencyDollar";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:"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"}));_o.displayName="DotsGrid";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 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:"M4 7h10a6 6 0 0 1 0 12H4M4 7l4-4M4 7l4 4"}));So.displayName="ReverseLeft";const ri=({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"}));ri.displayName="Stars01";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:"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"}));Io.displayName="Stop";const No=({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"}));No.displayName="Target04";var ir;(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})(ir||(ir={}));var Es;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Es||(Es={}));ir.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);ir.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,ir.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 Ts;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Ts||(Ts={}));var se;(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"})(se||(se={}));var wo="vercel.ai.error",Nf=Symbol.for(wo),xs,_s,Mt=class Ro extends(_s=Error,xs=Nf,_s){constructor({name:e,message:n,cause:r}){super(n),this[xs]=!0,this.name=e,this.cause=r}static isInstance(e){return Ro.hasMarker(e,wo)}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 Lo(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Oo="AI_InvalidArgumentError",vo=`vercel.ai.error.${Oo}`,wf=Symbol.for(vo),ys,As,Rf=class extends(As=Mt,ys=wf,As){constructor({message:t,cause:e,argument:n}){super({name:Oo,message:t,cause:e}),this[ys]=!0,this.argument=n}static isInstance(t){return Mt.hasMarker(t,vo)}},Do="AI_JSONParseError",Po=`vercel.ai.error.${Do}`,Lf=Symbol.for(Po),Cs,ks,Ss=class extends(ks=Mt,Cs=Lf,ks){constructor({text:t,cause:e}){super({name:Do,message:`JSON parsing failed: Text: ${t}.
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lazy-highlighter-BZxAEkAn.js","assets/index-DkE856zJ.js","assets/index-BdkjLo3e.css","assets/core-DKy85ot6.js","assets/json-BESjz4hO.js"])))=>i.map(i=>d[i]);
2
+ import{r as v,aF as Fd,aG as Hd,aH as Xe,w as G,aI as jr,aJ as fo,aK as Ud,aL as zd,aM as jd,Y as Ye,X as rr,W as hr,v as ke,aN as re,aO as Nt,aP as $d,aQ as Ne,_ as Yd,ag as Na,c as X,e as ho,K as Qe,q as wa,j as m,aR as An,a0 as po,ax as qd,f as Vd,t as vr,aj as Wd}from"./index-DkE856zJ.js";import{i as Gd}from"./X-E7J_uWRT.js";import{E as Qd,u as Xd}from"./use-binding-Dx0VfUue.js";import{u as Cn,i as Xt,c as Ra,b as La,T as Oa}from"./tooltip-CNuF1S13.js";import{u as Vt,c as ue,B as Ct}from"./button-Dj8ueofv.js";import{j as Zd,c as Kd}from"./dropdown-menu-BUANjhM2.js";import{T as Jd}from"./dialog-Dcux2Ttt.js";import{i as va}from"./CpuChip02-DG7E5vjX.js";import{i as mo}from"./SearchMd-CwAqtJqG.js";import{I as go,b as ef,U as tf,e as nf,c as rf,u as af}from"./use-connection-B9P3V0a0.js";import{b as sf,a as uf,c as of,S as lf,n as cf}from"./select-DIsljPdj.js";import{u as df}from"./use-mobile-BtxRZpBG.js";import{u as ff}from"./use-gateway-DynzgasG.js";import{t as bo}from"./ChevronDown-BTsoCUlX.js";import{a as ni}from"./Copy01-DK5159Rb.js";import{i as hf}from"./AlertCircle-Du1WT751.js";import{i as pf}from"./Terminal-zrKj2_VN.js";import{C as mf}from"./connection-card-BsnAC2N8.js";import{n as gf}from"./LinkExternal01-UPDE0V2O.js";import{S as bf}from"./spinner-TVmB-5qD.js";import{b as Ef,c as Tf,d as xf,A as _f,a as yf,e as Af,g as Cf,f as kf}from"./alert-dialog-CxYBxRCI.js";import{i as Sf}from"./File06-CCcPYdcS.js";import{i as If}from"./InfoCircle-z9SmeZ2K.js";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:"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"}));Eo.displayName="Coins01";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:"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"}));To.displayName="CornerUpLeft";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:"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"}));xo.displayName="CurrencyDollar";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:"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"}));_o.displayName="DotsGrid";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 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:"M4 7h10a6 6 0 0 1 0 12H4M4 7l4-4M4 7l4 4"}));So.displayName="ReverseLeft";const ri=({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"}));ri.displayName="Stars01";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:"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"}));Io.displayName="Stop";const No=({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"}));No.displayName="Target04";var ir;(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})(ir||(ir={}));var Es;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Es||(Es={}));ir.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);ir.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,ir.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 Ts;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Ts||(Ts={}));var se;(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"})(se||(se={}));var wo="vercel.ai.error",Nf=Symbol.for(wo),xs,_s,Mt=class Ro extends(_s=Error,xs=Nf,_s){constructor({name:e,message:n,cause:r}){super(n),this[xs]=!0,this.name=e,this.cause=r}static isInstance(e){return Ro.hasMarker(e,wo)}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 Lo(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Oo="AI_InvalidArgumentError",vo=`vercel.ai.error.${Oo}`,wf=Symbol.for(vo),ys,As,Rf=class extends(As=Mt,ys=wf,As){constructor({message:t,cause:e,argument:n}){super({name:Oo,message:t,cause:e}),this[ys]=!0,this.argument=n}static isInstance(t){return Mt.hasMarker(t,vo)}},Do="AI_JSONParseError",Po=`vercel.ai.error.${Do}`,Lf=Symbol.for(Po),Cs,ks,Ss=class extends(ks=Mt,Cs=Lf,ks){constructor({text:t,cause:e}){super({name:Do,message:`JSON parsing failed: Text: ${t}.
3
3
  Error message: ${Lo(e)}`,cause:e}),this[Cs]=!0,this.text=t}static isInstance(t){return Mt.hasMarker(t,Po)}},Mo="AI_TypeValidationError",Bo=`vercel.ai.error.${Mo}`,Of=Symbol.for(Bo),Is,Ns,Tn=class ea extends(Ns=Mt,Is=Of,Ns){constructor({value:e,cause:n}){super({name:Mo,message:`Type validation failed: Value: ${JSON.stringify(e)}.
4
4
  Error message: ${Lo(n)}`,cause:n}),this[Is]=!0,this.value=e}static isInstance(e){return Mt.hasMarker(e,Bo)}static wrap({value:e,cause:n}){return ea.isInstance(n)&&n.value===e?n:new ea({value:e,cause:n})}},pr=({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 Rf({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${t}${r}${i()}`},vf=pr();function ws(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 Yt(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 Rs(t,...e){const n=new Headers(Yt(t)),r=n.get("user-agent")||"";return n.set("user-agent",[r,...e].filter(Boolean).join(" ")),Object.fromEntries(n.entries())}var Df=/"__proto__"\s*:/,Pf=/"constructor"\s*:/;function Ls(t){const e=JSON.parse(t);return e===null||typeof e!="object"||Df.test(t)===!1&&Pf.test(t)===!1?e:Mf(e)}function Mf(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 Bf(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return Ls(t)}try{return Ls(t)}finally{Error.stackTraceLimit=e}}function Dr(t){if(t.type==="object"){t.additionalProperties=!1;const e=t.properties;if(e!=null)for(const n in e)e[n]=Dr(e[n])}return t.type==="array"&&t.items!=null&&(Array.isArray(t.items)?t.items=t.items.map(e=>Dr(e)):t.items=Dr(t.items)),t}var Ff=Symbol("Let zodToJsonSchema decide on which parser to use"),Os={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"},Hf=t=>typeof t=="string"?{...Os,name:t}:{...Os,...t};function nt(){return{}}function Uf(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)!==se.ZodAny&&(a.items=Ae(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 zf(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 jf(){return{type:"boolean"}}function Fo(t,e){return Ae(t.type._def,e)}var $f=(t,e)=>Ae(t.innerType._def,e);function Ho(t,e,n){const r=n??e.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((i,a)=>Ho(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 Yf(t)}}var Yf=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 qf(t,e){return{...Ae(t.innerType._def,e),default:t.defaultValue()}}function Vf(t,e){return e.effectStrategy==="input"?Ae(t.schema._def,e):nt()}function Wf(t){return{type:"string",enum:Array.from(t.values)}}var Gf=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function Qf(t,e){const n=[Ae(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),Ae(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(i=>!!i),r=[];return n.forEach(i=>{if(Gf(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 Xf(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 Uo(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":$e(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":$e(n,r.regex,r.message,e);break;case"cuid":$e(n,ut.cuid,r.message,e);break;case"cuid2":$e(n,ut.cuid2,r.message,e);break;case"startsWith":$e(n,RegExp(`^${Ii(r.value,e)}`),r.message,e);break;case"endsWith":$e(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":{$e(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":$e(n,ut.base64url,r.message,e);break;case"jwt":$e(n,ut.jwt,r.message,e);break;case"cidr":{r.version!=="v6"&&$e(n,ut.ipv4Cidr,r.message,e),r.version!=="v4"&&$e(n,ut.ipv6Cidr,r.message,e);break}case"emoji":$e(n,ut.emoji(),r.message,e);break;case"ulid":{$e(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":{$e(n,ut.base64,r.message,e);break}}break}case"nanoid":$e(n,ut.nanoid,r.message,e)}return n}function Ii(t,e){return e.patternStrategy==="escape"?Kf(t):t}var Zf=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Kf(t){let e="";for(let n=0;n<t.length;n++)Zf.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 $e(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:vs(e,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):t.pattern=vs(e,r)}function vs(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=cr(l.charCodeAt(0))+l.slice(1)),l=l?s+" "+l:s,n.options.closeAtx&&(l+=" "+s),o(),u(),l}jc.peek=qx;function jc(t){return t.value||""}function qx(){return"<"}$c.peek=Vx;function $c(t,e,n,r){const i=cs(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 Vx(){return"!"}Yc.peek=Wx;function Yc(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 d=n.stack;n.stack=[],s=n.enter("reference");const f=n.safe(n.associationId(t),{before:o,after:"]",...u.current()});return s(),n.stack=d,a(),i==="full"||!l||l!==f?o+=u.move(f+"]"):i==="shortcut"?o=o.slice(0,-1):o+=u.move("]"),o}function Wx(){return"!"}qc.peek=Gx;function qc(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 Gx(){return"`"}function Vc(t,e){const n=Xa(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))}Wc.peek=Qx;function Wc(t,e,n,r){const i=cs(n),a=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let u,o;if(Vc(t,n)){const d=n.stack;n.stack=[],u=n.enter("autolink");let f=s.move("<");return f+=s.move(n.containerPhrasing(t,{before:f,after:">",...s.current()})),f+=s.move(">"),u(),n.stack=d,f}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 Qx(t,e,n){return Vc(t,n)?"<":"["}Gc.peek=Xx;function Gc(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 d=n.stack;n.stack=[],s=n.enter("reference");const f=n.safe(n.associationId(t),{before:o,after:"]",...u.current()});return s(),n.stack=d,a(),i==="full"||!l||l!==f?o+=u.move(f+"]"):i==="shortcut"?o=o.slice(0,-1):o+=u.move("]"),o}function Xx(){return"["}function ds(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 Zx(t){const e=ds(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 Kx(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 Qc(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?Kx(n):ds(n);const u=t.ordered?s==="."?")":".":Zx(n);let o=e&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!t.ordered){const d=t.children?t.children[0]:void 0;if((s==="*"||s==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(o=!0),Qc(n)===s&&d){let f=-1;for(;++f<t.children.length;){const p=t.children[f];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){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 e3(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 t3(t,e,n,r){const i=e3(n);let a=n.bulletCurrent||ds(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()),d);return o(),l;function d(f,p,h){return p?(h?"":" ".repeat(s))+f:(h?a:a+" ".repeat(s-a.length))+f}}function n3(t,e,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),s=n.containerPhrasing(t,r);return a(),i(),s}const r3=pi(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function i3(t,e,n,r){return(t.children.some(function(s){return r3(s)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function a3(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}Xc.peek=s3;function Xc(t,e,n,r){const i=a3(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),d=Kr(r.before.charCodeAt(r.before.length-1),l,i);d.inside&&(o=cr(l)+o.slice(1));const f=o.charCodeAt(o.length-1),p=Kr(r.after.charCodeAt(0),f,i);p.inside&&(o=o.slice(0,-1)+cr(f));const h=s.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:p.outside,before:d.outside},u+o+h}function s3(t,e,n){return n.options.strong||"*"}function u3(t,e,n,r){return n.safe(t.value,r)}function o3(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 l3(t,e,n){const r=(Qc(n)+(n.options.ruleSpaces?" ":"")).repeat(o3(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Zc={blockquote:Ox,break:Xu,code:Fx,definition:Ux,emphasis:zc,hardBreak:Xu,heading:Yx,html:jc,image:$c,imageReference:Yc,inlineCode:qc,link:Wc,linkReference:Gc,list:Jx,listItem:t3,paragraph:n3,root:i3,strong:Xc,text:u3,thematicBreak:l3};function c3(){return{enter:{table:d3,tableData:Zu,tableHeader:Zu,tableRow:h3},exit:{codeText:p3,table:f3,tableData:Gi,tableHeader:Gi,tableRow:Gi}}}function d3(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 f3(t){this.exit(t),this.data.inTable=void 0}function h3(t){this.enter({type:"tableRow",children:[]},t)}function Gi(t){this.exit(t)}function Zu(t){this.enter({type:"tableCell",children:[]},t)}function p3(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,m3));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function m3(t,e){return e==="|"?e:t}function g3(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:p,table:s,tableCell:o,tableRow:u}};function s(h,g,x,A){return l(d(h,x,A),h.align)}function u(h,g,x,A){const E=f(h,x,A),I=l([E]);return I.slice(0,I.indexOf(`
96
- `))}function o(h,g,x,A){const E=x.enter("tableCell"),I=x.enter("phrasing"),b=x.containerPhrasing(h,{...A,before:a,after:a});return I(),E(),b}function l(h,g){return Rx(h,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function d(h,g,x){const A=h.children;let E=-1;const I=[],b=g.enter("table");for(;++E<A.length;)I[E]=f(A[E],g,x);return b(),I}function f(h,g,x){const A=h.children;let E=-1;const I=[],b=g.enter("tableRow");for(;++E<A.length;)I[E]=o(A[E],h,g,x);return b(),I}function p(h,g,x){let A=Zc.inlineCode(h,g,x);return x.stack.includes("tableCell")&&(A=A.replace(/\|/g,"\\$&")),A}}function b3(){return{exit:{taskListCheckValueChecked:Ku,taskListCheckValueUnchecked:Ku,paragraph:T3}}}function E3(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:x3}}}function Ku(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function T3(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 x3(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=Zc.listItem(t,e,n,{...r,...u.current()});return a&&(o=o.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),o;function l(d){return d+s}}function _3(){return[JT(),xx(),Cx(),c3(),b3()]}function y3(t){return{extensions:[ex(),_x(t),kx(),g3(t),E3()]}}const A3={tokenize:w3,partial:!0},Kc={tokenize:R3,partial:!0},Jc={tokenize:L3,partial:!0},ed={tokenize:O3,partial:!0},C3={tokenize:v3,partial:!0},td={name:"wwwAutolink",tokenize:I3,previous:rd},nd={name:"protocolAutolink",tokenize:N3,previous:id},kt={name:"emailAutolink",tokenize:S3,previous:ad},bt={};function k3(){return{text:bt}}let jt=48;for(;jt<123;)bt[jt]=kt,jt++,jt===58?jt=65:jt===91&&(jt=97);bt[43]=kt;bt[45]=kt;bt[46]=kt;bt[95]=kt;bt[72]=[kt,nd];bt[104]=[kt,nd];bt[87]=[kt,td];bt[119]=[kt,td];function S3(t,e,n){const r=this;let i,a;return s;function s(f){return!Ca(f)||!ad.call(r,r.previous)||fs(r.events)?n(f):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),u(f))}function u(f){return Ca(f)?(t.consume(f),u):f===64?(t.consume(f),o):n(f)}function o(f){return f===46?t.check(C3,d,l)(f):f===45||f===95||Ue(f)?(a=!0,t.consume(f),o):d(f)}function l(f){return t.consume(f),i=!0,o}function d(f){return a&&i&&qe(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(f)):n(f)}}function I3(t,e,n){const r=this;return i;function i(s){return s!==87&&s!==119||!rd.call(r,r.previous)||fs(r.events)?n(s):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(A3,t.attempt(Kc,t.attempt(Jc,a),n),n)(s))}function a(s){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(s)}}function N3(t,e,n){const r=this;let i="",a=!1;return s;function s(f){return(f===72||f===104)&&id.call(r,r.previous)&&!fs(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),t.consume(f),u):n(f)}function u(f){if(qe(f)&&i.length<5)return i+=String.fromCodePoint(f),t.consume(f),u;if(f===58){const p=i.toLowerCase();if(p==="http"||p==="https")return t.consume(f),o}return n(f)}function o(f){return f===47?(t.consume(f),a?l:(a=!0,o)):n(f)}function l(f){return f===null||Wr(f)||Se(f)||en(f)||di(f)?n(f):t.attempt(Kc,t.attempt(Jc,d),n)(f)}function d(f){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(f)}}function w3(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 R3(t,e,n){let r,i,a;return s;function s(l){return l===46||l===95?t.check(ed,o,u)(l):l===null||Se(l)||en(l)||l!==45&&di(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 L3(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(ed,e,a)(s):s===null||Se(s)||en(s)?e(s):(t.consume(s),i)}function a(s){return s===41&&r++,t.consume(s),i}}function O3(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)||en(u)?e(u):n(u)}function i(u){return u===null||u===40||u===91||Se(u)||en(u)?e(u):r(u)}function a(u){return qe(u)?s(u):n(u)}function s(u){return u===59?(t.consume(u),r):qe(u)?(t.consume(u),s):n(u)}}function v3(t,e,n){return r;function r(a){return t.consume(a),i}function i(a){return Ue(a)?n(a):e(a)}}function rd(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||Se(t)}function id(t){return!qe(t)}function ad(t){return!(t===47||Ca(t))}function Ca(t){return t===43||t===45||t===46||t===95||Ue(t)}function fs(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 D3={tokenize:j3,partial:!0};function P3(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:H3,continuation:{tokenize:U3},exit:z3}},text:{91:{name:"gfmFootnoteCall",tokenize:F3},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:M3,resolveTo:B3}}}}function M3(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 B3(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 F3(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,s;return u;function u(f){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),o}function o(f){return f!==94?n(f):(t.enter("gfmFootnoteCallMarker"),t.consume(f),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",l)}function l(f){if(a>999||f===93&&!s||f===null||f===91||Se(f))return n(f);if(f===93){t.exit("chunkString");const p=t.exit("gfmFootnoteCallString");return i.includes(lt(r.sliceSerialize(p)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(f)}return Se(f)||(s=!0),a++,t.consume(f),f===92?d:l}function d(f){return f===91||f===92||f===93?(t.consume(f),a++,l):l(f)}}function H3(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",d):n(g)}function d(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"),p}return Se(g)||(u=!0),s++,t.consume(g),g===92?f:d}function f(g){return g===91||g===92||g===93?(t.consume(g),s++,d):d(g)}function p(g){return g===58?(t.enter("definitionMarker"),t.consume(g),t.exit("definitionMarker"),i.includes(a)||i.push(a),Te(t,h,"gfmFootnoteDefinitionWhitespace")):n(g)}function h(g){return e(g)}}function U3(t,e,n){return t.check(Tr,e,t.attempt(D3,e,n))}function z3(t){t.exit("gfmFootnoteDefinition")}function j3(t,e,n){const r=this;return Te(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 $3(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 d={type:"strikethrough",start:Object.assign({},s[l][1].start),end:Object.assign({},s[o][1].end)},f={type:"strikethroughText",start:Object.assign({},s[l][1].end),end:Object.assign({},s[o][1].start)},p=[["enter",d,u],["enter",s[l][1],u],["exit",s[l][1],u],["enter",f,u]],h=u.parser.constructs.insideSpan.null;h&&tt(p,p.length,0,fi(h,s.slice(l+1,o),u)),tt(p,p.length,0,[["exit",f,u],["enter",s[o][1],u],["exit",s[o][1],u],["exit",d,u]]),tt(s,l-1,o-l+3,p),o=l+p.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,d=this.events;let f=0;return p;function p(g){return l===126&&d[d.length-1][1].type!=="characterEscape"?o(g):(s.enter("strikethroughSequenceTemporary"),h(g))}function h(g){const x=xn(l);if(g===126)return f>1?o(g):(s.consume(g),f++,h);if(f<2&&!n)return o(g);const A=s.exit("strikethroughSequenceTemporary"),E=xn(g);return A._open=!E||E===2&&!!x,A._close=!x||x===2&&!!E,u(g)}}}class Y3{constructor(){this.map=[]}add(e,n,r){q3(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 q3(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 V3(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 W3(){return{flow:{null:{name:"table",tokenize:G3,resolveAll:Q3}}}}function G3(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 j=r.events[P][1].type;if(j==="lineEnding"||j==="linePrefix")P--;else break}const M=P>-1?r.events[P][1].type:null,Z=M==="tableHead"||M==="tableRow"?C:o;return Z===C&&r.parser.lazy[r.now().line]?n(N):Z(N)}function o(N){return t.enter("tableHead"),t.enter("tableRow"),l(N)}function l(N){return N===124||(s=!0,a+=1),d(N)}function d(N){return N===null?n(N):ne(N)?a>1?(a=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(N),t.exit("lineEnding"),h):n(N):fe(N)?Te(t,d,"whitespace")(N):(a+=1,s&&(s=!1,i+=1),N===124?(t.enter("tableCellDivider"),t.consume(N),t.exit("tableCellDivider"),s=!0,d):(t.enter("data"),f(N)))}function f(N){return N===null||N===124||Se(N)?(t.exit("data"),d(N)):(t.consume(N),N===92?p:f)}function p(N){return N===92||N===124?(t.consume(N),f):f(N)}function h(N){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(N):(t.enter("tableDelimiterRow"),s=!1,fe(N)?Te(t,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):g(N))}function g(N){return N===45||N===58?A(N):N===124?(s=!0,t.enter("tableCellDivider"),t.consume(N),t.exit("tableCellDivider"),x):L(N)}function x(N){return fe(N)?Te(t,A,"whitespace")(N):A(N)}function A(N){return N===58?(a+=1,s=!0,t.enter("tableDelimiterMarker"),t.consume(N),t.exit("tableDelimiterMarker"),E):N===45?(a+=1,E(N)):N===null||ne(N)?w(N):L(N)}function E(N){return N===45?(t.enter("tableDelimiterFiller"),I(N)):L(N)}function I(N){return N===45?(t.consume(N),I):N===58?(s=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(N),t.exit("tableDelimiterMarker"),b):(t.exit("tableDelimiterFiller"),b(N))}function b(N){return fe(N)?Te(t,w,"whitespace")(N):w(N)}function w(N){return N===124?g(N):N===null||ne(N)?!s||i!==a?L(N):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(N)):L(N)}function L(N){return n(N)}function C(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||ne(N)?(t.exit("tableRow"),e(N)):fe(N)?Te(t,O,"whitespace")(N):(t.enter("data"),H(N))}function H(N){return N===null||N===124||Se(N)?(t.exit("data"),O(N)):(t.consume(N),N===92?z:H)}function z(N){return N===92||N===124?(t.consume(N),H):H(N)}}function Q3(t,e){let n=-1,r=!0,i=0,a=[0,0,0,0],s=[0,0,0,0],u=!1,o=0,l,d,f;const p=new Y3;for(;++n<t.length;){const h=t[n],g=h[1];h[0]==="enter"?g.type==="tableHead"?(u=!1,o!==0&&(Ju(p,e,o,l,d),d=void 0,o=0),l={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(n,0,[["enter",l,e]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,f=void 0,a=[0,0,0,0],s=[0,n+1,0,0],u&&(u=!1,d={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(n,0,[["enter",d,e]])),i=g.type==="tableDelimiterRow"?2:d?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(a[1]!==0&&(s[0]=s[1],f=Rr(p,e,a,i,void 0,f),a=[0,0,0,0]),s[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(s[0]=s[1],f=Rr(p,e,a,i,void 0,f)),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],f=Rr(p,e,a,i,n,f)):s[1]!==0&&(f=Rr(p,e,s,i,n,f)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(s[3]=n)}for(o!==0&&Ju(p,e,o,l,d),p.consume(e.events),n=-1;++n<e.events.length;){const h=e.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=V3(e.events,n))}return t}function Rr(t,e,n,r,i,a){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(a.end=Object.assign({},hn(e.events,n[0])),t.add(n[0],0,[["exit",a,e]]));const o=hn(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=hn(e.events,n[2]),d=hn(e.events,n[3]),f={type:u,start:Object.assign({},l),end:Object.assign({},d)};if(t.add(n[2],0,[["enter",f,e]]),r!==2){const p=e.events[n[2]],h=e.events[n[3]];if(p[1].end=Object.assign({},h[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,x=n[3]-n[2]-1;t.add(g,x,[])}}t.add(n[3]+1,0,[["exit",f,e]])}return i!==void 0&&(a.end=Object.assign({},hn(e.events,i)),t.add(i,0,[["exit",a,e]]),a=void 0),a}function Ju(t,e,n,r,i){const a=[],s=hn(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 hn(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const X3={name:"tasklistCheck",tokenize:K3};function Z3(){return{text:{91:X3}}}function K3(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 ne(o)?e(o):fe(o)?t.check({tokenize:J3},e,n)(o):n(o)}}function J3(t,e,n){return Te(t,r,"whitespace");function r(i){return i===null?n(i):e(i)}}function e_(t){return Dl([k3(),P3(),$3(t),W3(),Z3()])}const t_={};function n_(t){const e=this,n=t||t_,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(e_(n)),a.push(_3()),s.push(y3(n))}const r_=v.lazy(()=>qd(()=>import("./lazy-highlighter-B6ffJp-C.js"),__vite__mapDeps([0,1,2,3,4])));function sd(){const t=X.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 i_(){const t=X.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(a_)}),t[1]=r):r=t[1],r}function a_(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 s_(t){const e=X.c(12),n=v.useRef(null),{handleCopy:r,copied:i}=sd(),a=u_;let s;e[0]!==r?(s=async()=>{const p=a(n.current);await r(p)},e[0]=r,e[1]=s):s=e[1];const u=s;let o;e[2]!==i?(o=i?m.jsx(Xt,{size:12}):m.jsx(ni,{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(Ct,{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 d;e[7]!==t?(d=m.jsx("div",{className:"overflow-x-auto mb-4 rounded-lg border border-border",children:m.jsx("table",{ref:n,...t,className:"min-w-full border-collapse text-sm",children:t.children})}),e[7]=t,e[8]=d):d=e[8];let f;return e[9]!==l||e[10]!==d?(f=m.jsxs(m.Fragment,{children:[l,d]}),e[9]=l,e[10]=d,e[11]=f):f=e[11],f}function u_(t){return t?Array.from(t.querySelectorAll("tr")).map(o_).join(`
96
+ `))}function o(h,g,x,A){const E=x.enter("tableCell"),I=x.enter("phrasing"),b=x.containerPhrasing(h,{...A,before:a,after:a});return I(),E(),b}function l(h,g){return Rx(h,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function d(h,g,x){const A=h.children;let E=-1;const I=[],b=g.enter("table");for(;++E<A.length;)I[E]=f(A[E],g,x);return b(),I}function f(h,g,x){const A=h.children;let E=-1;const I=[],b=g.enter("tableRow");for(;++E<A.length;)I[E]=o(A[E],h,g,x);return b(),I}function p(h,g,x){let A=Zc.inlineCode(h,g,x);return x.stack.includes("tableCell")&&(A=A.replace(/\|/g,"\\$&")),A}}function b3(){return{exit:{taskListCheckValueChecked:Ku,taskListCheckValueUnchecked:Ku,paragraph:T3}}}function E3(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:x3}}}function Ku(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function T3(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 x3(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=Zc.listItem(t,e,n,{...r,...u.current()});return a&&(o=o.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),o;function l(d){return d+s}}function _3(){return[JT(),xx(),Cx(),c3(),b3()]}function y3(t){return{extensions:[ex(),_x(t),kx(),g3(t),E3()]}}const A3={tokenize:w3,partial:!0},Kc={tokenize:R3,partial:!0},Jc={tokenize:L3,partial:!0},ed={tokenize:O3,partial:!0},C3={tokenize:v3,partial:!0},td={name:"wwwAutolink",tokenize:I3,previous:rd},nd={name:"protocolAutolink",tokenize:N3,previous:id},kt={name:"emailAutolink",tokenize:S3,previous:ad},bt={};function k3(){return{text:bt}}let jt=48;for(;jt<123;)bt[jt]=kt,jt++,jt===58?jt=65:jt===91&&(jt=97);bt[43]=kt;bt[45]=kt;bt[46]=kt;bt[95]=kt;bt[72]=[kt,nd];bt[104]=[kt,nd];bt[87]=[kt,td];bt[119]=[kt,td];function S3(t,e,n){const r=this;let i,a;return s;function s(f){return!Ca(f)||!ad.call(r,r.previous)||fs(r.events)?n(f):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),u(f))}function u(f){return Ca(f)?(t.consume(f),u):f===64?(t.consume(f),o):n(f)}function o(f){return f===46?t.check(C3,d,l)(f):f===45||f===95||Ue(f)?(a=!0,t.consume(f),o):d(f)}function l(f){return t.consume(f),i=!0,o}function d(f){return a&&i&&qe(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(f)):n(f)}}function I3(t,e,n){const r=this;return i;function i(s){return s!==87&&s!==119||!rd.call(r,r.previous)||fs(r.events)?n(s):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(A3,t.attempt(Kc,t.attempt(Jc,a),n),n)(s))}function a(s){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(s)}}function N3(t,e,n){const r=this;let i="",a=!1;return s;function s(f){return(f===72||f===104)&&id.call(r,r.previous)&&!fs(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),t.consume(f),u):n(f)}function u(f){if(qe(f)&&i.length<5)return i+=String.fromCodePoint(f),t.consume(f),u;if(f===58){const p=i.toLowerCase();if(p==="http"||p==="https")return t.consume(f),o}return n(f)}function o(f){return f===47?(t.consume(f),a?l:(a=!0,o)):n(f)}function l(f){return f===null||Wr(f)||Se(f)||en(f)||di(f)?n(f):t.attempt(Kc,t.attempt(Jc,d),n)(f)}function d(f){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(f)}}function w3(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 R3(t,e,n){let r,i,a;return s;function s(l){return l===46||l===95?t.check(ed,o,u)(l):l===null||Se(l)||en(l)||l!==45&&di(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 L3(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(ed,e,a)(s):s===null||Se(s)||en(s)?e(s):(t.consume(s),i)}function a(s){return s===41&&r++,t.consume(s),i}}function O3(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)||en(u)?e(u):n(u)}function i(u){return u===null||u===40||u===91||Se(u)||en(u)?e(u):r(u)}function a(u){return qe(u)?s(u):n(u)}function s(u){return u===59?(t.consume(u),r):qe(u)?(t.consume(u),s):n(u)}}function v3(t,e,n){return r;function r(a){return t.consume(a),i}function i(a){return Ue(a)?n(a):e(a)}}function rd(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||Se(t)}function id(t){return!qe(t)}function ad(t){return!(t===47||Ca(t))}function Ca(t){return t===43||t===45||t===46||t===95||Ue(t)}function fs(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 D3={tokenize:j3,partial:!0};function P3(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:H3,continuation:{tokenize:U3},exit:z3}},text:{91:{name:"gfmFootnoteCall",tokenize:F3},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:M3,resolveTo:B3}}}}function M3(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 B3(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 F3(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,s;return u;function u(f){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),o}function o(f){return f!==94?n(f):(t.enter("gfmFootnoteCallMarker"),t.consume(f),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",l)}function l(f){if(a>999||f===93&&!s||f===null||f===91||Se(f))return n(f);if(f===93){t.exit("chunkString");const p=t.exit("gfmFootnoteCallString");return i.includes(lt(r.sliceSerialize(p)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(f)}return Se(f)||(s=!0),a++,t.consume(f),f===92?d:l}function d(f){return f===91||f===92||f===93?(t.consume(f),a++,l):l(f)}}function H3(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",d):n(g)}function d(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"),p}return Se(g)||(u=!0),s++,t.consume(g),g===92?f:d}function f(g){return g===91||g===92||g===93?(t.consume(g),s++,d):d(g)}function p(g){return g===58?(t.enter("definitionMarker"),t.consume(g),t.exit("definitionMarker"),i.includes(a)||i.push(a),Te(t,h,"gfmFootnoteDefinitionWhitespace")):n(g)}function h(g){return e(g)}}function U3(t,e,n){return t.check(Tr,e,t.attempt(D3,e,n))}function z3(t){t.exit("gfmFootnoteDefinition")}function j3(t,e,n){const r=this;return Te(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 $3(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 d={type:"strikethrough",start:Object.assign({},s[l][1].start),end:Object.assign({},s[o][1].end)},f={type:"strikethroughText",start:Object.assign({},s[l][1].end),end:Object.assign({},s[o][1].start)},p=[["enter",d,u],["enter",s[l][1],u],["exit",s[l][1],u],["enter",f,u]],h=u.parser.constructs.insideSpan.null;h&&tt(p,p.length,0,fi(h,s.slice(l+1,o),u)),tt(p,p.length,0,[["exit",f,u],["enter",s[o][1],u],["exit",s[o][1],u],["exit",d,u]]),tt(s,l-1,o-l+3,p),o=l+p.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,d=this.events;let f=0;return p;function p(g){return l===126&&d[d.length-1][1].type!=="characterEscape"?o(g):(s.enter("strikethroughSequenceTemporary"),h(g))}function h(g){const x=xn(l);if(g===126)return f>1?o(g):(s.consume(g),f++,h);if(f<2&&!n)return o(g);const A=s.exit("strikethroughSequenceTemporary"),E=xn(g);return A._open=!E||E===2&&!!x,A._close=!x||x===2&&!!E,u(g)}}}class Y3{constructor(){this.map=[]}add(e,n,r){q3(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 q3(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 V3(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 W3(){return{flow:{null:{name:"table",tokenize:G3,resolveAll:Q3}}}}function G3(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 j=r.events[P][1].type;if(j==="lineEnding"||j==="linePrefix")P--;else break}const M=P>-1?r.events[P][1].type:null,Z=M==="tableHead"||M==="tableRow"?C:o;return Z===C&&r.parser.lazy[r.now().line]?n(N):Z(N)}function o(N){return t.enter("tableHead"),t.enter("tableRow"),l(N)}function l(N){return N===124||(s=!0,a+=1),d(N)}function d(N){return N===null?n(N):ne(N)?a>1?(a=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(N),t.exit("lineEnding"),h):n(N):fe(N)?Te(t,d,"whitespace")(N):(a+=1,s&&(s=!1,i+=1),N===124?(t.enter("tableCellDivider"),t.consume(N),t.exit("tableCellDivider"),s=!0,d):(t.enter("data"),f(N)))}function f(N){return N===null||N===124||Se(N)?(t.exit("data"),d(N)):(t.consume(N),N===92?p:f)}function p(N){return N===92||N===124?(t.consume(N),f):f(N)}function h(N){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(N):(t.enter("tableDelimiterRow"),s=!1,fe(N)?Te(t,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):g(N))}function g(N){return N===45||N===58?A(N):N===124?(s=!0,t.enter("tableCellDivider"),t.consume(N),t.exit("tableCellDivider"),x):L(N)}function x(N){return fe(N)?Te(t,A,"whitespace")(N):A(N)}function A(N){return N===58?(a+=1,s=!0,t.enter("tableDelimiterMarker"),t.consume(N),t.exit("tableDelimiterMarker"),E):N===45?(a+=1,E(N)):N===null||ne(N)?w(N):L(N)}function E(N){return N===45?(t.enter("tableDelimiterFiller"),I(N)):L(N)}function I(N){return N===45?(t.consume(N),I):N===58?(s=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(N),t.exit("tableDelimiterMarker"),b):(t.exit("tableDelimiterFiller"),b(N))}function b(N){return fe(N)?Te(t,w,"whitespace")(N):w(N)}function w(N){return N===124?g(N):N===null||ne(N)?!s||i!==a?L(N):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(N)):L(N)}function L(N){return n(N)}function C(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||ne(N)?(t.exit("tableRow"),e(N)):fe(N)?Te(t,O,"whitespace")(N):(t.enter("data"),H(N))}function H(N){return N===null||N===124||Se(N)?(t.exit("data"),O(N)):(t.consume(N),N===92?z:H)}function z(N){return N===92||N===124?(t.consume(N),H):H(N)}}function Q3(t,e){let n=-1,r=!0,i=0,a=[0,0,0,0],s=[0,0,0,0],u=!1,o=0,l,d,f;const p=new Y3;for(;++n<t.length;){const h=t[n],g=h[1];h[0]==="enter"?g.type==="tableHead"?(u=!1,o!==0&&(Ju(p,e,o,l,d),d=void 0,o=0),l={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(n,0,[["enter",l,e]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,f=void 0,a=[0,0,0,0],s=[0,n+1,0,0],u&&(u=!1,d={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(n,0,[["enter",d,e]])),i=g.type==="tableDelimiterRow"?2:d?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(a[1]!==0&&(s[0]=s[1],f=Rr(p,e,a,i,void 0,f),a=[0,0,0,0]),s[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(s[0]=s[1],f=Rr(p,e,a,i,void 0,f)),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],f=Rr(p,e,a,i,n,f)):s[1]!==0&&(f=Rr(p,e,s,i,n,f)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(s[3]=n)}for(o!==0&&Ju(p,e,o,l,d),p.consume(e.events),n=-1;++n<e.events.length;){const h=e.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=V3(e.events,n))}return t}function Rr(t,e,n,r,i,a){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(a.end=Object.assign({},hn(e.events,n[0])),t.add(n[0],0,[["exit",a,e]]));const o=hn(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=hn(e.events,n[2]),d=hn(e.events,n[3]),f={type:u,start:Object.assign({},l),end:Object.assign({},d)};if(t.add(n[2],0,[["enter",f,e]]),r!==2){const p=e.events[n[2]],h=e.events[n[3]];if(p[1].end=Object.assign({},h[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,x=n[3]-n[2]-1;t.add(g,x,[])}}t.add(n[3]+1,0,[["exit",f,e]])}return i!==void 0&&(a.end=Object.assign({},hn(e.events,i)),t.add(i,0,[["exit",a,e]]),a=void 0),a}function Ju(t,e,n,r,i){const a=[],s=hn(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 hn(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const X3={name:"tasklistCheck",tokenize:K3};function Z3(){return{text:{91:X3}}}function K3(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 ne(o)?e(o):fe(o)?t.check({tokenize:J3},e,n)(o):n(o)}}function J3(t,e,n){return Te(t,r,"whitespace");function r(i){return i===null?n(i):e(i)}}function e_(t){return Dl([k3(),P3(),$3(t),W3(),Z3()])}const t_={};function n_(t){const e=this,n=t||t_,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(e_(n)),a.push(_3()),s.push(y3(n))}const r_=v.lazy(()=>qd(()=>import("./lazy-highlighter-BZxAEkAn.js"),__vite__mapDeps([0,1,2,3,4])));function sd(){const t=X.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 i_(){const t=X.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(a_)}),t[1]=r):r=t[1],r}function a_(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 s_(t){const e=X.c(12),n=v.useRef(null),{handleCopy:r,copied:i}=sd(),a=u_;let s;e[0]!==r?(s=async()=>{const p=a(n.current);await r(p)},e[0]=r,e[1]=s):s=e[1];const u=s;let o;e[2]!==i?(o=i?m.jsx(Xt,{size:12}):m.jsx(ni,{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(Ct,{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 d;e[7]!==t?(d=m.jsx("div",{className:"overflow-x-auto mb-4 rounded-lg border border-border",children:m.jsx("table",{ref:n,...t,className:"min-w-full border-collapse text-sm",children:t.children})}),e[7]=t,e[8]=d):d=e[8];let f;return e[9]!==l||e[10]!==d?(f=m.jsxs(m.Fragment,{children:[l,d]}),e[9]=l,e[10]=d,e[11]=f):f=e[11],f}function u_(t){return t?Array.from(t.querySelectorAll("tr")).map(o_).join(`
97
97
  `):""}function o_(t){return Array.from(t.querySelectorAll("th,td")).map(l_).join(",")}function l_(t){let e=t.textContent||"";return e=e.replace(/"/g,'""'),e.search(/([",\n])/g)>=0&&(e=`"${e}"`),e}const c_=[n_],d_=[WT],f_={p:t=>m.jsx("p",{...t,className:"leading-relaxed text-sm"}),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(s_,{...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"})},ud=v.memo(t=>{const e=X.c(2),{content:n}=t;let r;return e[0]!==n?(r=m.jsx(Lb,{remarkPlugins:c_,rehypePlugins:d_,components:f_,children:n}),e[0]=n,e[1]=r):r=e[1],r},(t,e)=>t.content===e.content);function h_(t){const e=X.c(20),{language:n,content:r}=t,{handleCopy:i,copied:a}=sd(),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(Xt,{size:14}):m.jsx(ni,{size:14}),e[5]=a,e[6]=l):l=e[6];let d;e[7]!==o||e[8]!==l?(d=m.jsx(Ct,{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]=d):d=e[9];let f;e[10]!==u||e[11]!==d?(f=m.jsxs("div",{className:"flex items-center justify-between p-1 pl-4 bg-muted border-b border-border",children:[u,d]}),e[10]=u,e[11]=d,e[12]=f):f=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=m.jsx(i_,{}),e[13]=p):p=e[13];let h;e[14]!==r||e[15]!==n?(h=m.jsx(v.Suspense,{fallback:p,children:m.jsx(r_,{language:n,content:r})}),e[14]=r,e[15]=n,e[16]=h):h=e[16];let g;return e[17]!==f||e[18]!==h?(g=m.jsxs("div",{className:"my-4 rounded-lg bg-muted overflow-hidden border border-border grid min-w-0",children:[f,h]}),e[17]=f,e[18]=h,e[19]=g):g=e[19],g}ud.displayName="MemoizedMarkdownBlock";const hs=t=>{const e=X.c(7),{id:n,text:r}=t;let i;e[0]!==r?(i=ye.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(h_,{language:o.lang,content:o.text},`${n}-block_${l}`):m.jsx(ud,{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};hs.displayName="MemoizedMarkdown";function p_(t,e){switch(e.type){case"TOGGLE":return{isExpanded:!t.isExpanded,wasManuallyToggled:!0};case"SET_EXPANDED":return t.wasManuallyToggled?t:{...t,isExpanded:e.payload};default:return t}}function m_(t){const e=X.c(38),{part:n,id:r}=t,{state:i}=n,a=i==="streaming";let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={isExpanded:!1,wasManuallyToggled:!1},e[0]=s):s=e[0];const[u,o]=v.useReducer(p_,s),{isExpanded:l}=u;let d,f;e[1]!==a?(d=()=>{o({type:"SET_EXPANDED",payload:a})},f=[a],e[1]=a,e[2]=d,e[3]=f):(d=e[2],f=e[3]),v.useEffect(d,f);let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=()=>{o({type:"TOGGLE"})},e[4]=p):p=e[4];const h=p,g=a&&"animate-pulse";let x;e[5]!==g?(x=ue("text-muted-foreground transition-opacity",g),e[5]=g,e[6]=x):x=e[6];let A;e[7]!==x?(A=m.jsx(ri,{className:x}),e[7]=x,e[8]=A):A=e[8];const E=a&&"text-shimmer";let I;e[9]!==E?(I=ue("text-sm font-medium text-muted-foreground",E),e[9]=E,e[10]=I):I=e[10];let b;e[11]!==I?(b=m.jsx("span",{className:I,children:"Agent thinking"}),e[11]=I,e[12]=b):b=e[12];const w=l?"rotate-180":"";let L;e[13]!==w?(L=ue("text-muted-foreground transition-transform duration-200",w),e[13]=w,e[14]=L):L=e[14];let C;e[15]!==L?(C=m.jsx(bo,{className:L}),e[15]=L,e[16]=C):C=e[16];let O;e[17]!==b||e[18]!==C||e[19]!==A?(O=m.jsxs("button",{type:"button",onClick:h,className:"flex items-center gap-2 py-2 transition-colors cursor-pointer",children:[A,b,C]}),e[17]=b,e[18]=C,e[19]=A,e[20]=O):O=e[20];const H=l?a?"max-h-[400px] opacity-100":"max-h-[200px] opacity-80":"max-h-0 opacity-0 overflow-hidden";let z;e[21]!==H?(z=ue("transition-all duration-200 ease-in-out",H),e[21]=H,e[22]=z):z=e[22];const N=a?"max-h-[400px]":"max-h-[200px]";let P;e[23]!==N?(P=ue("border-l-2 pl-4 overflow-y-auto",N),e[23]=N,e[24]=P):P=e[24];let M;e[25]===Symbol.for("react.memo_cache_sentinel")?(M=ue("text-muted-foreground markdown-sm pb-2"),e[25]=M):M=e[25];let Z;e[26]!==r||e[27]!==n.text?(Z=m.jsx("div",{className:M,children:m.jsx(hs,{id:r,text:n.text})}),e[26]=r,e[27]=n.text,e[28]=Z):Z=e[28];let j;e[29]!==P||e[30]!==Z?(j=m.jsx("div",{className:P,children:Z}),e[29]=P,e[30]=Z,e[31]=j):j=e[31];let B;e[32]!==z||e[33]!==j?(B=m.jsx("div",{className:z,children:j}),e[32]=z,e[33]=j,e[34]=B):B=e[34];let W;return e[35]!==O||e[36]!==B?(W=m.jsxs("div",{className:"flex flex-col",children:[O,B]}),e[35]=O,e[36]=B,e[37]=W):W=e[37],W}function g_(){const t=X.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 od(t){const e=X.c(15),{id:n,part:r,copyable:i,extraActions:a}=t,s=i===void 0?!1:i,{handleCopy:u}=g_(),[o,l]=v.useState(!1);let d;e[0]!==u||e[1]!==r.text?(d=async()=>{await u(r.text),l(!0),setTimeout(()=>l(!1),2e3)},e[0]=u,e[1]=r.text,e[2]=d):d=e[2];const f=d,p=s||a;let h;e[3]!==n||e[4]!==r.text?(h=m.jsx(hs,{id:n,text:r.text}),e[3]=n,e[4]=r.text,e[5]=h):h=e[5];let g;e[6]!==s||e[7]!==a||e[8]!==f||e[9]!==o||e[10]!==p?(g=p&&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:[s&&m.jsx(Ct,{onClick:f,variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground size-6 whitespace-nowrap",children:o?m.jsx(Xt,{size:12}):m.jsx(ni,{size:12})}),a]})}),e[6]=s,e[7]=a,e[8]=f,e[9]=o,e[10]=p,e[11]=g):g=e[11];let x;return e[12]!==h||e[13]!==g?(x=m.jsxs("div",{className:"group/part relative",children:[h,g]}),e[12]=h,e[13]=g,e[14]=x):x=e[14],x}function b_(t){const e=X.c(28),{toolName:n,input:r,output:i,isError:a}=t;let s;if(e[0]!==i){const l=JSON.stringify(i,null,2);s=l.length>2e3?l.slice(0,2e3)+"...[TRUNCATED]":l,e[0]=i,e[1]=s}else s=e[1];const u=s;if(n==="READ_MCP_TOOLS"){const l=r?.id;if(l){let d;return e[2]!==l?(d=m.jsx(eo,{connectionId:l}),e[2]=l,e[3]=d):d=e[3],d}}if(n==="CALL_MCP_TOOL"){const l=r?.connectionId;let d;e[4]!==l?(d=l&&m.jsx(eo,{connectionId:l,compact:!0}),e[4]=l,e[5]=d):d=e[5];let f;e[6]!==i?(f=JSON.stringify(i,null,2),e[6]=i,e[7]=f):f=e[7];let p;e[8]!==f?(p=m.jsx("div",{className:"absolute top-1 right-1 z-10",children:m.jsx(E_,{text:f})}),e[8]=f,e[9]=p):p=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",children:"Input"}),e[10]=h):h=e[10];let g;e[11]!==r?(g=JSON.stringify(r,null,2),e[11]=r,e[12]=g):g=e[12];let x;e[13]!==g?(x=m.jsx("pre",{className:"whitespace-pre-wrap break-all text-muted-foreground mb-2",children:g}),e[13]=g,e[14]=x):x=e[14];let A;e[15]===Symbol.for("react.memo_cache_sentinel")?(A=m.jsx("div",{className:"font-semibold text-muted-foreground mb-0.5 text-[10px] uppercase tracking-wider",children:"Output"}),e[15]=A):A=e[15];const E=`whitespace-pre-wrap break-all ${a?"text-destructive":"text-foreground"}`;let I;e[16]!==u||e[17]!==E?(I=m.jsx("pre",{className:E,children:u}),e[16]=u,e[17]=E,e[18]=I):I=e[18];let b;e[19]!==I||e[20]!==p||e[21]!==x?(b=m.jsxs("div",{className:"relative bg-muted rounded-md p-2 text-xs font-mono overflow-auto max-h-[200px]",children:[p,h,x,A,I]}),e[19]=I,e[20]=p,e[21]=x,e[22]=b):b=e[22];let w;return e[23]!==b||e[24]!==d?(w=m.jsxs("div",{className:"flex flex-col gap-2",children:[d,b]}),e[23]=b,e[24]=d,e[25]=w):w=e[25],w}let o;return e[26]!==u?(o=m.jsx("div",{className:"bg-muted rounded-md p-2 text-xs font-mono overflow-auto max-h-[200px]",children:m.jsx("pre",{className:"whitespace-pre-wrap break-all",children:u})}),e[26]=u,e[27]=o):o=e[27],o}function eo(t){const e=X.c(15),{connectionId:n,compact:r}=t,i=ef(n),{org:a}=Cn(),{slug:s}=a,u=Vd();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 f;e[4]!==i.title?(f=m.jsx("span",{className:"font-medium text-foreground",children:i.title}),e[4]=i.title,e[5]=f):f=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=m.jsx(gf,{size:12}),e[6]=p):p=e[6];let h;e[7]!==l?(h=m.jsx("button",{type:"button",onClick:l,className:"hover:text-foreground transition-colors",title:"Open connection",children:p}),e[7]=l,e[8]=h):h=e[8];let g;return e[9]!==f||e[10]!==h?(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:[f,h]}),e[9]=f,e[10]=h,e[11]=g):g=e[11],g}let d;return e[12]!==i||e[13]!==l?(d=m.jsx(mf,{connection:i,onClick:l}),e[12]=i,e[13]=l,e[14]=d):d=e[14],d}function E_({text:t}){const e=async()=>{try{if(navigator.clipboard)await navigator.clipboard.writeText(t),vr.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)vr.success("Copied to clipboard");else throw new Error("Fallback copy failed")}catch(r){console.error("Copy failed",n,r),vr.error("Failed to copy to clipboard")}}};return m.jsx(Ct,{size:"icon",variant:"ghost",className:"h-5 w-5 hover:bg-background/50",onClick:e,children:m.jsx(ni,{size:12})})}function to(t){const e=X.c(39),{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;let s;e[2]!==r?(s=r==="output-error"?m.jsx(hf,{className:"h-3.5 w-3.5 text-destructive"}):m.jsx(pf,{className:"h-3.5 w-3.5"}),e[2]=r,e[3]=s):s=e[3];const u=r==="output-error"&&"text-destructive/90";let o;e[4]!==u?(o=ue(u),e[4]=u,e[5]=o):o=e[5];const l=r==="input-streaming"&&`Streaming ${a} arguments`,d=r==="input-available"&&`Calling ${a}`,f=r==="output-available"&&`Called ${a}`,p=r==="output-error"&&`Error calling ${a}`;let h;e[6]!==o||e[7]!==l||e[8]!==d||e[9]!==f||e[10]!==p?(h=m.jsxs("span",{className:o,children:[l,d,f,p]}),e[6]=o,e[7]=l,e[8]=d,e[9]=f,e[10]=p,e[11]=h):h=e[11];let g;e[12]!==r?(g=(r==="input-streaming"||r==="input-available")&&m.jsx("span",{className:"animate-spin",children:m.jsx(bf,{size:"xs"})}),e[12]=r,e[13]=g):g=e[13];let x;e[14]!==g||e[15]!==s||e[16]!==h?(x=m.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground",children:[s,h,g]}),e[14]=g,e[15]=s,e[16]=h,e[17]=x):x=e[17];const A=r==="output-error"?"border-destructive/50":"border-border";let E;e[18]!==A?(E=ue("transition-all duration-200 ease-in-out","border-l-2 pl-3",A),e[18]=A,e[19]=E):E=e[19];let I;e[20]!==n.input||e[21]!==r?(I=(r==="input-streaming"||r==="input-available")&&!!n.input&&m.jsx("div",{className:"text-xs font-mono text-muted-foreground bg-muted/30 p-2 rounded",children:JSON.stringify(n.input,null,2)}),e[20]=n.input,e[21]=r,e[22]=I):I=e[22];let b;e[23]!==n.input||e[24]!==n.output||e[25]!==r||e[26]!==a?(b=r==="output-available"&&m.jsx(b_,{toolName:a,input:n.input,output:n.output}),e[23]=n.input,e[24]=n.output,e[25]=r,e[26]=a,e[27]=b):b=e[27];let w;e[28]!==n||e[29]!==r?(w=r==="output-error"&&m.jsx("div",{className:"text-xs font-mono bg-destructive/10 text-destructive p-2 rounded border border-destructive/20",children:"errorText"in n&&typeof n.errorText=="string"?n.errorText:"An unknown error occurred"}),e[28]=n,e[29]=r,e[30]=w):w=e[30];let L;e[31]!==E||e[32]!==I||e[33]!==b||e[34]!==w?(L=m.jsxs("div",{className:E,children:[I,b,w]}),e[31]=E,e[32]=I,e[33]=b,e[34]=w,e[35]=L):L=e[35];let C;return e[36]!==x||e[37]!==L?(C=m.jsxs("div",{className:"flex flex-col gap-1.5 py-1",children:[x,L]}),e[36]=x,e[37]=L,e[38]=C):C=e[38],C}const T_={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 x_(t){if(!t?.providerMetadata)return null;for(const e of Object.values(T_)){const n=e(t.providerMetadata);if(n!==null)return n}return null}function __(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+(x_(r)??0)}:e},{inputTokens:0,outputTokens:0,totalTokens:0,cost:0})}function ld(t){const e=X.c(38),{messages:n}=t;let r,i,a,s,u,o,l,d,f,p,h,g;if(e[0]!==n){g=Symbol.for("react.early_return_sentinel");e:{const w=__(n);if(!w){g=null;break e}const{totalTokens:L,inputTokens:C,outputTokens:O,cost:H}=w;if(a=H,!L&&!C&&!O){g=null;break e}i=Ra;let z;e[13]===Symbol.for("react.memo_cache_sentinel")?(z=m.jsx(Eo,{size:12}),e[13]=z):z=e[13];const N=m.jsxs(Ct,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground pl-1! h-6 gap-1 whitespace-nowrap",children:[z,m.jsx("span",{className:"text-[10px] font-mono tabular-nums",children:L.toLocaleString()})]});e[14]!==N?(h=m.jsx(La,{asChild:!0,children:N}),e[14]=N,e[15]=h):h=e[15],r=Oa,f="top",p="font-mono text-[11px]",u="grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",e[16]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx("span",{className:"text-muted",children:"in"}),e[16]=o):o=e[16],l=m.jsx("span",{children:C.toLocaleString()}),e[17]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsx("span",{className:"text-muted",children:"out"}),e[17]=d):d=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]=d,e[9]=f,e[10]=p,e[11]=h,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],d=e[8],f=e[9],p=e[10],h=e[11],g=e[12];if(g!==Symbol.for("react.early_return_sentinel"))return g;let x;e[18]!==s?(x=m.jsx("span",{children:s}),e[18]=s,e[19]=x):x=e[19];let A;e[20]!==a?(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]=A):A=e[21];let E;e[22]!==x||e[23]!==A||e[24]!==u||e[25]!==o||e[26]!==l||e[27]!==d?(E=m.jsxs("div",{className:u,children:[o,l,d,x,A]}),e[22]=x,e[23]=A,e[24]=u,e[25]=o,e[26]=l,e[27]=d,e[28]=E):E=e[28];let I;e[29]!==r||e[30]!==E||e[31]!==f||e[32]!==p?(I=m.jsx(r,{side:f,className:p,children:E}),e[29]=r,e[30]=E,e[31]=f,e[32]=p,e[33]=I):I=e[33];let b;return e[34]!==i||e[35]!==I||e[36]!==h?(b=m.jsxs(i,{children:[h,I]}),e[34]=i,e[35]=I,e[36]=h,e[37]=b):b=e[37],b}const y_={planning:{icon:m.jsx(No,{className:"text-muted-foreground animate-pulse",size:20}),label:"Planning next moves"},thinking:{icon:m.jsx(ri,{className:"text-muted-foreground animate-pulse",size:20}),label:"Thinking"}},A_=1200;function C_(){const t=X.c(7),[e,n]=v.useState("planning");let r,i;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const o=setTimeout(()=>{n("thinking")},A_);return()=>{clearTimeout(o)}},i=[],t[0]=r,t[1]=i):(r=t[0],i=t[1]),v.useEffect(r,i);const a=y_[e];let s;t[2]!==a.label?(s=m.jsxs("span",{className:"text-sm font-medium text-muted-foreground text-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.jsxs("div",{className:"flex items-center gap-2 py-2",children:[a.icon,s]}),t[4]=a.icon,t[5]=s,t[6]=u):u=t[6],u}function k_(t){const e=X.c(5),{duration:n}=t,r=n/1e3;let i;e[0]!==r?(i=r.toFixed(1),e[0]=r,e[1]=i):i=e[1];const a=i;let s;e[2]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx(Ao,{className:"text-muted-foreground",size:16}),e[2]=s):s=e[2];let u;return e[3]!==a?(u=m.jsxs("div",{className:"flex items-center gap-2 py-2 opacity-60",children:[s,m.jsxs("span",{className:"text-xs text-muted-foreground",children:["Thought · ",a,"s"]})]}),e[3]=a,e[4]=u):u=e[4],u}function S_(t){const e=X.c(13),{part:n,id:r,usageStats:i}=t;switch(n.type){case"dynamic-tool":{let a;return e[0]!==r||e[1]!==n?(a=m.jsx(to,{part:n,id:r}),e[0]=r,e[1]=n,e[2]=a):a=e[2],a}case"text":{let a;return e[3]!==r||e[4]!==n||e[5]!==i?(a=m.jsx(od,{id:r,part:n,extraActions:i,copyable:!0}),e[3]=r,e[4]=n,e[5]=i,e[6]=a):a=e[6],a}case"reasoning":{let a;return e[7]!==r||e[8]!==n?(a=m.jsx(m_,{part:n,id:r}),e[7]=r,e[8]=n,e[9]=a):a=e[9],a}case"step-start":case"file":case"source-url":case"source-document":return null;default:if(n.type.startsWith("tool-")){const a=n;let s;return e[10]!==r||e[11]!==a?(s=m.jsx(to,{part:a,id:r}),e[10]=r,e[11]=a,e[12]=s):s=e[12],s}}throw new Error(`Unknown part type: ${n.type}`)}function I_(t){const e=X.c(27),{message:n,status:r,className:i}=t,{id:a,parts:s}=n,l=r==="streaming"||r==="submitted",d=v.useRef(null);let f;e[0]!==a?(f=()=>{const N=localStorage.getItem(`msg-duration-${a}`);return N?Number(N):null},e[0]=a,e[1]=f):f=e[1];const[p,h]=v.useState(f);let g,x;e[2]!==l?(g=()=>{l&&d.current===null&&(d.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 A,E;e[5]!==p||e[6]!==a||e[7]!==s.length?(A=()=>{if(s.length>0&&p===null&&d.current!==null){const N=Date.now()-d.current;h(N),localStorage.setItem(`msg-duration-${a}`,N.toString())}},E=[s.length,p,a],e[5]=p,e[6]=a,e[7]=s.length,e[8]=A,e[9]=E):(A=e[8],E=e[9]),v.useEffect(A,E);const I=s.length>0,b=I&&!l&&p!==null;let w;e[10]!==n?(w=m.jsx(ld,{messages:[n]}),e[10]=n,e[11]=w):w=e[11];const L=w;let C;e[12]!==i?(C=ue("w-full min-w-0 group relative flex items-start gap-4 px-4 z-20 text-foreground flex-row",i),e[12]=i,e[13]=C):C=e[13];let O;e[14]!==p||e[15]!==I||e[16]!==a||e[17]!==l||e[18]!==s||e[19]!==b||e[20]!==L?(O=I?m.jsxs(m.Fragment,{children:[b&&m.jsx(k_,{duration:p}),s.map((N,P)=>m.jsx(S_,{part:N,id:a,usageStats:P===s.length-1?L:void 0},`${a}-${P}`))]}):l?m.jsx(C_,{}):null,e[14]=p,e[15]=I,e[16]=a,e[17]=l,e[18]=s,e[19]=b,e[20]=L,e[21]=O):O=e[21];let H;e[22]!==O?(H=m.jsx("div",{className:"flex flex-col gap-2 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:O})}),e[22]=O,e[23]=H):H=e[23];let z;return e[24]!==C||e[25]!==H?(z=m.jsx("div",{className:C,children:H}),e[24]=C,e[25]=H,e[26]=z):z=e[26],z}const cd=v.createContext(null);function dd(t){const e=X.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 N_(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 w_(t){const e=X.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,d,f,p,h,g;if(e[1]!==n||e[2]!==r||e[3]!==i){const I=v.Children.toArray(n),b=I[I.length-1];l=b&&v.isValidElement(b)&&b.type===dd?b:null;const w=l?I.slice(0,-1):I,L=N_(w);let C;e[11]===Symbol.for("react.memo_cache_sentinel")?(C=H=>{const z=u.current[H];if(z&&a.current){const N=a.current.offsetTop,P=z.offsetTop;a.current.scrollTo({top:P-N,behavior:"smooth"})}},e[11]=C):C=e[11];const O=C;o=cd.Provider,e[12]===Symbol.for("react.memo_cache_sentinel")?(g={scrollToPair:O},e[12]=g):g=e[12],p=a,e[13]!==r?(h=ue("w-full min-w-0 max-w-full overflow-y-auto h-full overflow-x-hidden",r),e[13]=r,e[14]=h):h=e[14],d="flex flex-col min-w-0 max-w-2xl mx-auto w-full",f=L.map((H,z)=>{const N=z===L.length-1;return m.jsxs("div",{ref:P=>{u.current[z]=P},className:"flex flex-col gap-2 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 top-4 z-50",children:H.user&&v.isValidElement(H.user)?v.cloneElement(H.user,{pairIndex:z}):H.user}),H.assistant]},z)}),e[1]=n,e[2]=r,e[3]=i,e[4]=o,e[5]=l,e[6]=d,e[7]=f,e[8]=p,e[9]=h,e[10]=g}else o=e[4],l=e[5],d=e[6],f=e[7],p=e[8],h=e[9],g=e[10];let x;e[15]!==l||e[16]!==d||e[17]!==f?(x=m.jsxs("div",{className:d,children:[f,l]}),e[15]=l,e[16]=d,e[17]=f,e[18]=x):x=e[18];let A;e[19]!==p||e[20]!==h||e[21]!==x?(A=m.jsx("div",{ref:p,className:h,children:x}),e[19]=p,e[20]=h,e[21]=x,e[22]=A):A=e[22];let E;return e[23]!==o||e[24]!==g||e[25]!==A?(E=m.jsx(o,{value:g,children:A}),e[23]=o,e[24]=g,e[25]=A,e[26]=E):E=e[26],E}function R_(t){const e=X.c(49),{message:n,className:r,pairIndex:i,onBranchFromMessage:a}=t,{id:s,parts:u}=n,o=v.useRef(null),l=v.useContext(cd),[d,f]=v.useState(!1),[p,h]=v.useState(!1);if(!u||u.length===0)return null;const x=u.reduce(v_,0)>60;let A;e[0]!==u?(A=u.filter(O_).map(L_).join(`
98
98
  `),e[0]=u,e[1]=A):A=e[1];const E=A;let I;e[2]!==l||e[3]!==i?(I=()=>{i!==void 0&&l?.scrollToPair(i)},e[2]=l,e[3]=i,e[4]=I):I=e[4];const b=I;let w;e[5]===Symbol.for("react.memo_cache_sentinel")?(w=q=>{q.stopPropagation(),h(!0)},e[5]=w):w=e[5];const L=w;let C;e[6]!==s||e[7]!==E||e[8]!==a?(C=()=>{h(!1),a?.(s,E)},e[6]=s,e[7]=E,e[8]=a,e[9]=C):C=e[9];const O=C,H=!!a;let z;e[10]!==r?(z=ue("message-block w-full min-w-0 group relative flex items-start gap-4 px-2 text-foreground flex-row-reverse",r),e[10]=r,e[11]=z):z=e[11];const N=x&&!d&&"overflow-hidden relative max-h-[60px]";let P;e[12]!==N?(P=ue(N),e[12]=N,e[13]=P):P=e[13];let M;if(e[14]!==s||e[15]!==u){let q;e[17]!==s?(q=(K,Q)=>K.type==="text"?m.jsx(od,{id:s,part:K},`${s}-${Q}`):null,e[17]=s,e[18]=q):q=e[18],M=u.map(q),e[14]=s,e[15]=u,e[16]=M}else M=e[16];let Z;e[19]!==d||e[20]!==x?(Z=x&&!d&&m.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-12 bg-linear-to-t from-muted to-transparent pointer-events-none"}),e[19]=d,e[20]=x,e[21]=Z):Z=e[21];let j;e[22]!==P||e[23]!==M||e[24]!==Z?(j=m.jsxs("div",{className:P,children:[M,Z]}),e[22]=P,e[23]=M,e[24]=Z,e[25]=j):j=e[25];let B;e[26]!==d||e[27]!==x?(B=x&&m.jsx("div",{className:"flex justify-center",children:m.jsx(Ct,{onClick:q=>{q.stopPropagation(),f(!d)},variant:"ghost",size:"xs",className:"text-xs w-full text-muted-foreground hover:text-foreground",children:d?m.jsx(cf,{className:"text-sm"}):m.jsx(bo,{className:"text-sm"})})}),e[26]=d,e[27]=x,e[28]=B):B=e[28];let W;e[29]!==H?(W=H&&m.jsx("div",{className:"flex justify-end",children:m.jsxs(Ra,{children:[m.jsx(La,{asChild:!0,children:m.jsx(Ct,{onClick:L,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",children:m.jsx(So,{size:16,className:"p-0.5"})})}),m.jsx(Oa,{side:"bottom",children:"Edit from here"})]})}),e[29]=H,e[30]=W):W=e[30];let te;e[31]!==b||e[32]!==j||e[33]!==B||e[34]!==W?(te=m.jsxs("div",{onClick:b,className:"w-full border min-w-0 shadow-[0_3px_6px_-1px_rgba(0,0,0,0.1)] rounded-lg text-[0.9375rem] wrap-break-word overflow-wrap-anywhere bg-muted px-4 py-2 cursor-pointer transition-colors",children:[j,B,W]}),e[31]=b,e[32]=j,e[33]=B,e[34]=W,e[35]=te):te=e[35];let ie;e[36]!==te||e[37]!==z?(ie=m.jsxs("div",{ref:o,className:z,children:[" ",te]}),e[36]=te,e[37]=z,e[38]=ie):ie=e[38];let me;e[39]===Symbol.for("react.memo_cache_sentinel")?(me=m.jsxs(Ef,{children:[m.jsx(Tf,{children:"Edit from here?"}),m.jsx(xf,{children:"This will create a new conversation branch from this point. The original conversation will remain unchanged."})]}),e[39]=me):me=e[39];let S;e[40]===Symbol.for("react.memo_cache_sentinel")?(S=m.jsx(_f,{children:"Cancel"}),e[40]=S):S=e[40];let he;e[41]!==O?(he=m.jsxs(yf,{children:[me,m.jsxs(Af,{children:[S,m.jsx(Cf,{onClick:O,children:"Confirm"})]})]}),e[41]=O,e[42]=he):he=e[42];let pe;e[43]!==p||e[44]!==he?(pe=m.jsx(kf,{open:p,onOpenChange:h,children:he}),e[43]=p,e[44]=he,e[45]=pe):pe=e[45];let _;return e[46]!==ie||e[47]!==pe?(_=m.jsxs(m.Fragment,{children:[ie,pe]}),e[46]=ie,e[47]=pe,e[48]=_):_=e[48],_}function L_(t){return t.text}function O_(t){return t.type==="text"}function v_(t,e){return e.type==="text"?t+e.text.length:t}function D_(t,e){const n=X.c(4);let r;n[0]!==e?(r={},n[0]=e,n[1]=r):r=n[1];const i=r,a=t??tf;let s;return n[2]!==a?(s=rf(a),n[2]=a,n[3]=s):s=n[3],nf(a,"LLM",s,i)}function P_(){const t=X.c(8),e=af();let n;t[0]!==e?(n={connections:e,binding:"LLMS"},t[0]=e,t[1]=n):n=t[1];const[r]=Xd(n),i=D_(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(M_),t[3]=r,t[4]=i,t[5]=a}else a=t[5];return a}function M_(t,e){return t.name.localeCompare(e.name)}const B_={reasoning:{icon:m.jsx(ri,{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(Sf,{className:"size-4"}),bg:"bg-blue-100",text:"text-blue-700",label:"Can analyze files"},"web-search":{icon:m.jsx(mo,{className:"size-4"}),bg:"bg-amber-100",text:"text-amber-700",label:"Can search the web to answer questions"}},fd=v.memo(function(e){const n=X.c(11),{capability:r}=e,i=B_[r];let a;n[0]!==r||n[1]!==i?(a=i||{icon:m.jsx(Xt,{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(La,{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(Oa,{children:m.jsx("p",{children:s.label})}),n[6]=s.label,n[7]=l):l=n[7];let d;return n[8]!==o||n[9]!==l?(d=m.jsxs(Ra,{children:[o,l]}),n[8]=o,n[9]=l,n[10]=d):d=n[10],d}),no=v.memo(function(e){const n=X.c(54),{model:r,compact:i}=e,a=i===void 0?!1:i;if(!r){let E;return n[0]===Symbol.for("react.memo_cache_sentinel")?(E=m.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),n[0]=E):E=n[0],E}const s=r.contextWindow||r.inputCost||r.outputCost||r.outputLimit;if(!s&&!a){let E;n[1]!==r.logo||n[2]!==r.name?(E=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]=E):E=n[3];let I;n[4]!==r.name?(I=m.jsx("p",{className:"text-lg font-medium leading-7",children:r.name}),n[4]=r.name,n[5]=I):I=n[5];let b;n[6]!==E||n[7]!==I?(b=m.jsxs("div",{className:"flex items-center gap-3 py-2 px-0",children:[E,I]}),n[6]=E,n[7]=I,n[8]=b):b=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 L;return n[11]!==b||n[12]!==w?(L=m.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[b,w]}),n[11]=b,n[12]=w,n[13]=L):L=n[13],L}if(!s&&a)return null;if(a){let E;n[14]!==r.contextWindow?(E=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]=E):E=n[15];let I;n[16]!==r.inputCost?(I=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]=I):I=n[17];let b;n[18]!==r.outputCost?(b=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]=b):b=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 L;return n[22]!==E||n[23]!==I||n[24]!==b||n[25]!==w?(L=m.jsxs("div",{className:"flex flex-col gap-2.5 pt-3 pb-3 px-3 rounded-b-xl text-xs",children:[E,I,b,w]}),n[22]=E,n[23]=I,n[24]=b,n[25]=w,n[26]=L):L=n[26],L}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 d;n[35]!==r.capabilities?(d=r.capabilities&&r.capabilities.length>0&&m.jsx("div",{className:"flex items-center gap-2",children:r.capabilities.map(z_)}),n[35]=r.capabilities,n[36]=d):d=n[36];let f;n[37]!==l||n[38]!==d?(f=m.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[l,d]}),n[37]=l,n[38]=d,n[39]=f):f=n[39];let p;n[40]!==r.contextWindow?(p=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(Kd,{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]=p):p=n[41];let h;n[42]!==r.inputCost||n[43]!==r.outputCost?(h=(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(xo,{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]=h):h=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]!==p||n[48]!==h||n[49]!==g?(x=m.jsxs("div",{className:"flex flex-col gap-4",children:[p,h,g]}),n[47]=p,n[48]=h,n[49]=g,n[50]=x):x=n[50];let A;return n[51]!==x||n[52]!==f?(A=m.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[f,x]}),n[51]=x,n[52]=f,n[53]=A):A=n[53],A}),F_=v.memo(function(e){const n=X.c(27),{model:r,onHover:i,isSelected:a,hasExpandedInfo:s}=e,u=s?"rounded-t-xl":"rounded-xl";let o;n[0]!==u?(o=ue("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 d;n[5]!==r.logo||n[6]!==r.name?(d=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]=d):d=n[7];let f;n[8]!==r.name?(f=m.jsx("span",{className:"text-sm text-foreground",children:r.name}),n[8]=r.name,n[9]=f):f=n[9];let p;n[10]!==s||n[11]!==r.capabilities?(p=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(j_)}),n[10]=s,n[11]=r.capabilities,n[12]=p):p=n[12];let h;n[13]!==s||n[14]!==a?(h=a&&!s&&m.jsx(Xt,{className:"w-4 h-4 text-foreground ml-auto"}),n[13]=s,n[14]=a,n[15]=h):h=n[15];let g;n[16]!==s||n[17]!==a?(g=a&&s&&m.jsx(Xt,{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]!==d||n[22]!==f||n[23]!==p||n[24]!==h||n[25]!==g?(x=m.jsxs("div",{className:o,onMouseEnter:l,children:[d,f,p,h,g]}),n[19]=o,n[20]=l,n[21]=d,n[22]=f,n[23]=p,n[24]=h,n[25]=g,n[26]=x):x=n[26],x});function H_(t){const e=X.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-4 h-4",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",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",children:[r,i]}),e[6]=r,e[7]=i,e[8]=a):a=e[8],a}function U_(t){const e=X.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,d]=v.useState(!1),[f,p]=v.useState(null),[h,g]=v.useState(!1),x=P_();let A;e[0]!==x||e[1]!==n?(A=n?x.find(q=>q.id===n.id&&q.connectionId===n.connectionId)?.id:void 0,e[0]=x,e[1]=n,e[2]=A):A=e[2];const E=A;let I;if(e[3]!==x||e[4]!==E){let q;e[6]!==E?(q=K=>K.id===E,e[6]=E,e[7]=q):q=e[7],I=x.find(q),e[3]=x,e[4]=E,e[5]=I}else I=e[5];const b=I;let w;e[8]!==x||e[9]!==r?(w=q=>{const K=x.find(Q=>Q.id===q);K&&(r({id:K.id,connectionId:K.connectionId,provider:K.provider??void 0}),d(!1))},e[8]=x,e[9]=r,e[10]=w):w=e[10];const L=w;if(x.length===0)return null;const C=E||"",O=u==="borderless"&&"md:border-none";let H;e[11]!==a||e[12]!==O?(H=ue("h-8! text-sm hover:bg-accent rounded-lg py-1 px-2 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0",O,a),e[11]=a,e[12]=O,e[13]=H):H=e[13];let z;e[14]!==b?(z=m.jsx(H_,{model:b}),e[14]=b,e[15]=z):z=e[15];let N;e[16]!==o||e[17]!==z?(N=m.jsx(ul,{placeholder:o,children:z}),e[16]=o,e[17]=z,e[18]=N):N=e[18];let P;e[19]!==N||e[20]!==H?(P=m.jsx(sl,{className:H,children:N}),e[19]=N,e[20]=H,e[21]=P):P=e[21];let M;e[22]!==h?(M=()=>g(!h),e[22]=h,e[23]=M):M=e[23];const Z=h?"text-foreground":"text-muted-foreground";let j;e[24]!==Z?(j=ue("w-5 h-5 transition-colors",Z),e[24]=Z,e[25]=j):j=e[25];let B;e[26]!==j?(B=m.jsx(If,{className:j}),e[26]=j,e[27]=B):B=e[27];let W;e[28]!==M||e[29]!==B?(W=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:B}),e[28]=M,e[29]=B,e[30]=W):W=e[30];let te;if(e[31]!==L||e[32]!==x||e[33]!==E||e[34]!==h){let q;e[36]!==L||e[37]!==E||e[38]!==h?(q=K=>m.jsxs("div",{onClick:()=>L(K.id),className:ue("rounded-xl mb-1",K.id===E&&"bg-accent"),children:[m.jsx(F_,{model:K,onHover:p,isSelected:K.id===E,hasExpandedInfo:h}),h&&m.jsx("div",{className:"md:hidden",children:m.jsx(no,{model:K,compact:!0})})]},K.id),e[36]=L,e[37]=E,e[38]=h,e[39]=q):q=e[39],te=x.map(q),e[31]=L,e[32]=x,e[33]=E,e[34]=h,e[35]=te}else te=e[35];let ie;e[40]!==te?(ie=m.jsx("div",{className:"flex-1 overflow-y-auto px-0.5 md:border-r",children:te}),e[40]=te,e[41]=ie):ie=e[41];const me=f||b||null;let S;e[42]!==me?(S=m.jsx("div",{className:"hidden md:block md:w-[300px] p-3",children:m.jsx(no,{model:me})}),e[42]=me,e[43]=S):S=e[43];let he;e[44]!==ie||e[45]!==S?(he=m.jsxs("div",{className:"flex flex-col md:flex-row h-[350px]",children:[ie,S]}),e[44]=ie,e[45]=S,e[46]=he):he=e[46];let pe;e[47]!==o||e[48]!==W||e[49]!==he?(pe=m.jsx(al,{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:W,children:he}),e[47]=o,e[48]=W,e[49]=he,e[50]=pe):pe=e[50];let _;return e[51]!==L||e[52]!==l||e[53]!==P||e[54]!==pe||e[55]!==C?(_=m.jsxs(il,{open:l,onOpenChange:d,value:C,onValueChange:L,children:[P,pe]}),e[51]=L,e[52]=l,e[53]=P,e[54]=pe,e[55]=C,e[56]=_):_=e[56],_}function z_(t){return m.jsx(fd,{capability:t},t)}function j_(t){return m.jsx(fd,{capability:t},t)}function $_({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 Jr(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 Y_(t,e){return v.Children.toArray(t).filter(n=>v.isValidElement(n)?!e.includes(n.type):!0)}function q_(t){const e=X.c(5),{className:n,children:r}=t;let i;e[0]!==n?(i=ue("h-full",n),e[0]=n,e[1]=i):i=e[1];let a;return e[2]!==r||e[3]!==i?(a=m.jsx(si,{className:i,children:r}),e[2]=r,e[3]=i,e[4]=a):a=e[4],a}function V_(t){const e=X.c(11),{children:n}=t;let r;e[0]!==n?(r=Jr(n,hd),e[0]=n,e[1]=r):r=e[1];const i=r;let a;e[2]!==n?(a=Jr(n,pd),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 d;e[6]!==l?(d=m.jsx("div",{className:"flex items-center gap-1",children:l}),e[6]=l,e[7]=d):d=e[7];let f;return e[8]!==o||e[9]!==d?(f=m.jsxs(si.Header,{children:[o,d]}),e[8]=o,e[9]=d,e[10]=f):f=e[10],f}function hd(t){const e=X.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 pd(t){const e=X.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 W_(t){const e=X.c(3),{children:n,className:r}=t;let i;return e[0]!==n||e[1]!==r?(i=m.jsx(si.Content,{className:r,children:n}),e[0]=n,e[1]=r,e[2]=i):i=e[2],i}function G_(t){const e=X.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 Q_(t){const e=X.c(14),{messages:n,status:r,minHeightOffset:i,onBranchFromMessage:a}=t,s=i===void 0?240:i,u=v.useRef(null);let o;e[0]!==n.length?(o={messageCount:n.length,sentinelRef:u},e[0]=n.length,e[1]=o):o=e[1],$_(o);let l;if(e[2]!==n||e[3]!==a||e[4]!==r){let p;e[6]!==n.length||e[7]!==a||e[8]!==r?(p=(h,g)=>h.role==="user"?m.jsx(R_,{onBranchFromMessage:a,message:h},h.id):h.role==="assistant"?m.jsx(I_,{message:h,status:g===n.length-1?r:void 0},h.id):null,e[6]=n.length,e[7]=a,e[8]=r,e[9]=p):p=e[9],l=n.map(p),e[2]=n,e[3]=a,e[4]=r,e[5]=l}else l=e[5];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsx(dd,{children:m.jsx("div",{ref:u,className:"h-0"})}),e[10]=d):d=e[10];let f;return e[11]!==s||e[12]!==l?(f=m.jsxs(w_,{minHeightOffset:s,children:[l,d]}),e[11]=s,e[12]=l,e[13]=f):f=e[13],f}function X_(t){const e=X.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx(si.Footer,{className:"max-w-2xl mx-auto w-full min-w-0",children:n}),e[0]=n,e[1]=r):r=e[1],r}function ka(t){return null}function Sa(t){return null}function Z_({onSubmit:t,onStop:e,disabled:n,isStreaming:r,placeholder:i,usageMessages:a,children:s,value:u,onValueChange:o}){const l=Jr(s,ka),d=Jr(s,Sa),f=Y_(s,[ka,Sa]),p=async g=>{if(g?.preventDefault(),!u?.trim()||r)return;const x=u.trim();try{await t(x),o?.("")}catch(A){console.error("Failed to send message:",A);const E=A instanceof Error?A.message:"Failed to send message";vr.error(E)}},h=m.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d?m.jsx("div",{className:ue("flex items-center gap-2 flex-wrap min-w-0",d.props.disabled&&"pointer-events-none opacity-60"),children:m.jsx(j0,{selectedGatewayId:d.props.selectedGatewayId,onGatewayChange:d.props.onGatewayChange,placeholder:"Gateway",variant:"bordered",className:d.props.className})}):null,l?m.jsx("div",{className:ue("flex items-center gap-2 flex-wrap min-w-0",l.props.disabled&&"pointer-events-none opacity-60"),children:m.jsx(U_,{selectedModel:l.props.selectedModel,onModelChange:l.props.onModelChange,placeholder:"Model",variant:"borderless",className:l.props.className})}):null,f,a?m.jsx(ld,{messages:a}):null]});return m.jsx(w0,{value:u??"",onChange:o??(()=>{}),onSubmit:p,onStop:e,disabled:n,isStreaming:r,placeholder:i,leftActions:h})}const tA=Object.assign(q_,{Header:Object.assign(V_,{Left:hd,Right:pd}),Main:W_,Messages:Q_,EmptyState:G_,Footer:X_,Input:Object.assign(Z_,{ModelSelector:ka,GatewaySelector:Sa})});function nA(t){const e=X.c(19),{prompts:n,onSelect:r,className:i}=t;if(n.length===0)return null;let a,s,u,o;if(e[0]!==i||e[1]!==r||e[2]!==n){const f=n.slice(0,4);e[7]!==i?(u=ue("flex flex-col gap-3 flex-1",i),e[7]=i,e[8]=u):u=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Try asking"}),e[9]=o):o=e[9],a="grid grid-cols-1 sm:grid-cols-2 gap-2";let p;e[10]!==r?(p=h=>m.jsxs("button",{type:"button",onClick:()=>r(h),className:ue("flex items-start gap-3 p-3 rounded-xl","bg-muted/50 hover:bg-muted transition-colors","text-left cursor-pointer group","border border-transparent hover:border-border"),children:[m.jsx("div",{className:"shrink-0 mt-0.5",children:m.jsx(ko,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})}),m.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0 flex-1",children:[m.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:(h.title??h.name).replace(/_/g," ")}),h.description&&m.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:h.description})]})]},h.name),e[10]=r,e[11]=p):p=e[11],s=f.map(p),e[0]=i,e[1]=r,e[2]=n,e[3]=a,e[4]=s,e[5]=u,e[6]=o}else a=e[3],s=e[4],u=e[5],o=e[6];let l;e[12]!==a||e[13]!==s?(l=m.jsx("div",{className:a,children:s}),e[12]=a,e[13]=s,e[14]=l):l=e[14];let d;return e[15]!==u||e[16]!==o||e[17]!==l?(d=m.jsxs("div",{className:u,children:[o,l]}),e[15]=u,e[16]=o,e[17]=l,e[18]=d):d=e[18],d}function rA(){const t=X.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(Lr,{align:"right",width:"w-3/4"}),m.jsx(Lr,{align:"left",width:"w-full",lines:3}),m.jsx(Lr,{align:"right",width:"w-2/3"}),m.jsx(Lr,{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 Lr(t){const e=X.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=ue("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 d;e[2]!==l?(d=ue("flex min-w-0 flex-col gap-2",l),e[2]=l,e[3]=d):d=e[3];let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=m.jsx("div",{className:"h-3 w-16 rounded bg-muted/40 animate-pulse"}),e[4]=f):f=e[4];const p=n==="right"?"bg-muted":"bg-transparent border border-border/40";let h;e[5]!==p||e[6]!==a?(h=ue("min-w-0 rounded-2xl p-4",p,a),e[5]=p,e[6]=a,e[7]=h):h=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((b,w)=>m.jsx("div",{className:ue("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 A;e[13]!==x||e[14]!==h?(A=m.jsx("div",{className:h,children:x}),e[13]=x,e[14]=h,e[15]=A):A=e[15];let E;e[16]!==A||e[17]!==d?(E=m.jsxs("div",{className:d,children:[f,A]}),e[16]=A,e[17]=d,e[18]=E):E=e[18];let I;return e[19]!==E||e[20]!==o?(I=m.jsx("div",{className:o,children:E}),e[19]=E,e[20]=o,e[21]=I):I=e[21],I}const _i=v.createContext(null);_i.displayName="PanelGroupContext";const ve={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"},ps=10,Qt=v.useLayoutEffect,ro=Wd.useId,K_=typeof ro=="function"?ro:()=>null;let J_=0;function ms(t=null){const e=K_(),n=v.useRef(t||e||null);return n.current===null&&(n.current=""+J_++),t??n.current}function md({children:t,className:e="",collapsedSize:n,collapsible:r,defaultSize:i,forwardedRef:a,id:s,maxSize:u,minSize:o,onCollapse:l,onExpand:d,onResize:f,order:p,style:h,tagName:g="div",...x}){const A=v.useContext(_i);if(A===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:E,expandPanel:I,getPanelSize:b,getPanelStyle:w,groupId:L,isPanelCollapsed:C,reevaluatePanelConstraints:O,registerPanel:H,resizePanel:z,unregisterPanel:N}=A,P=ms(s),M=v.useRef({callbacks:{onCollapse:l,onExpand:d,onResize:f},constraints:{collapsedSize:n,collapsible:r,defaultSize:i,maxSize:u,minSize:o},id:P,idIsFromProps:s!==void 0,order:p});v.useRef({didLogMissingDefaultSizeWarning:!1}),Qt(()=>{const{callbacks:j,constraints:B}=M.current,W={...B};M.current.id=P,M.current.idIsFromProps=s!==void 0,M.current.order=p,j.onCollapse=l,j.onExpand=d,j.onResize=f,B.collapsedSize=n,B.collapsible=r,B.defaultSize=i,B.maxSize=u,B.minSize=o,(W.collapsedSize!==B.collapsedSize||W.collapsible!==B.collapsible||W.maxSize!==B.maxSize||W.minSize!==B.minSize)&&O(M.current,W)}),Qt(()=>{const j=M.current;return H(j),()=>{N(j)}},[p,P,H,N]),v.useImperativeHandle(a,()=>({collapse:()=>{E(M.current)},expand:j=>{I(M.current,j)},getId(){return P},getSize(){return b(M.current)},isCollapsed(){return C(M.current)},isExpanded(){return!C(M.current)},resize:j=>{z(M.current,j)}}),[E,I,b,C,P,z]);const Z=w(M.current,i);return v.createElement(g,{...x,children:t,className:e,id:P,style:{...Z,...h},[ve.groupId]:L,[ve.panel]:"",[ve.panelCollapsible]:r||void 0,[ve.panelId]:P,[ve.panelSize]:parseFloat(""+Z.flexGrow).toFixed(1)})}const gd=v.forwardRef((t,e)=>v.createElement(md,{...t,forwardedRef:e}));md.displayName="Panel";gd.displayName="forwardRef(Panel)";let Ia=null,zr=-1,vt=null;function ey(t,e){if(e){const n=(e&_d)!==0,r=(e&yd)!==0,i=(e&Ad)!==0,a=(e&Cd)!==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 ty(){vt!==null&&(document.head.removeChild(vt),Ia=null,vt=null,zr=-1)}function Qi(t,e){var n,r;const i=ey(t,e);if(Ia!==i){if(Ia=i,vt===null&&(vt=document.createElement("style"),document.head.appendChild(vt)),zr>=0){var a;(a=vt.sheet)===null||a===void 0||a.removeRule(zr)}zr=(n=(r=vt.sheet)===null||r===void 0?void 0:r.insertRule(`*{cursor: ${i} !important;}`))!==null&&n!==void 0?n:-1}}function bd(t){return t.type==="keydown"}function Ed(t){return t.type.startsWith("pointer")}function Td(t){return t.type.startsWith("mouse")}function yi(t){if(Ed(t)){if(t.isPrimary)return{x:t.clientX,y:t.clientY}}else if(Td(t))return{x:t.clientX,y:t.clientY};return{x:1/0,y:1/0}}function ny(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function ry(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 iy(t,e){if(t===e)throw new Error("Cannot compare node with itself");const n={a:so(t),b:so(e)};let r;for(;n.a.at(-1)===n.b.at(-1);)t=n.a.pop(),e=n.b.pop(),r=t;ce(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:ao(io(n.a)),b:ao(io(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 ay=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function sy(t){var e;const n=getComputedStyle((e=xd(t))!==null&&e!==void 0?e:t).display;return n==="flex"||n==="inline-flex"}function uy(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||sy(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"||ay.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function io(t){let e=t.length;for(;e--;){const n=t[e];if(ce(n,"Missing node"),uy(n))return n}return null}function ao(t){return t&&Number(getComputedStyle(t).zIndex)||0}function so(t){const e=[];for(;t;)e.push(t),t=xd(t);return e}function xd(t){const{parentNode:e}=t;return e&&e instanceof ShadowRoot?e.host:e}const _d=1,yd=2,Ad=4,Cd=8,oy=ny()==="coarse";let ct=[],En=!1,qt=new Map,Ai=new Map;const dr=new Set;function ly(t,e,n,r,i){var a;const{ownerDocument:s}=e,u={direction:n,element:e,hitAreaMargins:r,setResizeHandlerState:i},o=(a=qt.get(s))!==null&&a!==void 0?a:0;return qt.set(s,o+1),dr.add(u),ei(),function(){var d;Ai.delete(t),dr.delete(u);const f=(d=qt.get(s))!==null&&d!==void 0?d:1;if(qt.set(s,f-1),ei(),f===1&&qt.delete(s),ct.includes(u)){const p=ct.indexOf(u);p>=0&&ct.splice(p,1),bs(),i("up",!0,null)}}}function cy(t){const{target:e}=t,{x:n,y:r}=yi(t);En=!0,gs({target:e,x:n,y:r}),ei(),ct.length>0&&(ti("down",t),t.preventDefault(),kd(e)||t.stopImmediatePropagation())}function Xi(t){const{x:e,y:n}=yi(t);if(En&&t.buttons===0&&(En=!1,ti("up",t)),!En){const{target:r}=t;gs({target:r,x:e,y:n})}ti("move",t),bs(),ct.length>0&&t.preventDefault()}function Zi(t){const{target:e}=t,{x:n,y:r}=yi(t);Ai.clear(),En=!1,ct.length>0&&(t.preventDefault(),kd(e)||t.stopImmediatePropagation()),ti("up",t),gs({target:e,x:n,y:r}),bs(),ei()}function kd(t){let e=t;for(;e;){if(e.hasAttribute(ve.resizeHandle))return!0;e=e.parentElement}return!1}function gs({target:t,x:e,y:n}){ct.splice(0);let r=null;(t instanceof HTMLElement||t instanceof SVGElement)&&(r=t),dr.forEach(i=>{const{element:a,hitAreaMargins:s}=i,u=a.getBoundingClientRect(),{bottom:o,left:l,right:d,top:f}=u,p=oy?s.coarse:s.fine;if(e>=l-p&&e<=d+p&&n>=f-p&&n<=o+p){if(r!==null&&document.contains(r)&&a!==r&&!a.contains(r)&&!r.contains(a)&&iy(r,a)>0){let g=r,x=!1;for(;g&&!g.contains(a);){if(ry(g.getBoundingClientRect(),u)){x=!0;break}g=g.parentElement}if(x)return}ct.push(i)}})}function Ki(t,e){Ai.set(t,e)}function bs(){let t=!1,e=!1;ct.forEach(r=>{const{direction:i}=r;i==="horizontal"?t=!0:e=!0});let n=0;Ai.forEach(r=>{n|=r}),t&&e?Qi("intersection",n):t?Qi("horizontal",n):e?Qi("vertical",n):ty()}let Ji=new AbortController;function ei(){Ji.abort(),Ji=new AbortController;const t={capture:!0,signal:Ji.signal};dr.size&&(En?(ct.length>0&&qt.forEach((e,n)=>{const{body:r}=n;e>0&&(r.addEventListener("contextmenu",Zi,t),r.addEventListener("pointerleave",Xi,t),r.addEventListener("pointermove",Xi,t))}),window.addEventListener("pointerup",Zi,t),window.addEventListener("pointercancel",Zi,t)):qt.forEach((e,n)=>{const{body:r}=n;e>0&&(r.addEventListener("pointerdown",cy,t),r.addEventListener("pointermove",Xi,t))}))}function ti(t,e){dr.forEach(n=>{const{setResizeHandlerState:r}=n,i=ct.includes(n);r(t,i,e)})}function dy(){const[t,e]=v.useState(0);return v.useCallback(()=>e(n=>n+1),[])}function ce(t,e){if(!t)throw console.error(e),Error(e)}function tn(t,e,n=ps){return t.toFixed(n)===e.toFixed(n)?0:t>e?1:-1}function _t(t,e,n=ps){return tn(t,e,n)===0}function et(t,e,n){return tn(t,e,n)===0}function fy(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 gn({panelConstraints:t,panelIndex:e,size:n}){const r=t[e];ce(r!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:i=0,collapsible:a,maxSize:s=100,minSize:u=0}=r;if(tn(n,u)<0)if(a){const o=(i+u)/2;tn(n,o)<0?n=i:n=u}else n=u;return n=Math.min(s,n),n=parseFloat(n.toFixed(ps)),n}function qn({delta:t,initialLayout:e,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(et(t,0))return e;const s=[...e],[u,o]=r;ce(u!=null,"Invalid first pivot index"),ce(o!=null,"Invalid second pivot index");let l=0;if(a==="keyboard"){{const f=t<0?o:u,p=n[f];ce(p,`Panel constraints not found for index ${f}`);const{collapsedSize:h=0,collapsible:g,minSize:x=0}=p;if(g){const A=e[f];if(ce(A!=null,`Previous layout not found for panel index ${f}`),et(A,h)){const E=x-A;tn(E,Math.abs(t))>0&&(t=t<0?0-E:E)}}}{const f=t<0?u:o,p=n[f];ce(p,`No panel constraints found for index ${f}`);const{collapsedSize:h=0,collapsible:g,minSize:x=0}=p;if(g){const A=e[f];if(ce(A!=null,`Previous layout not found for panel index ${f}`),et(A,x)){const E=A-h;tn(E,Math.abs(t))>0&&(t=t<0?0-E:E)}}}}{const f=t<0?1:-1;let p=t<0?o:u,h=0;for(;;){const x=e[p];ce(x!=null,`Previous layout not found for panel index ${p}`);const E=gn({panelConstraints:n,panelIndex:p,size:100})-x;if(h+=E,p+=f,p<0||p>=n.length)break}const g=Math.min(Math.abs(t),Math.abs(h));t=t<0?0-g:g}{let p=t<0?u:o;for(;p>=0&&p<n.length;){const h=Math.abs(t)-Math.abs(l),g=e[p];ce(g!=null,`Previous layout not found for panel index ${p}`);const x=g-h,A=gn({panelConstraints:n,panelIndex:p,size:x});if(!et(g,A)&&(l+=g-A,s[p]=A,l.toPrecision(3).localeCompare(Math.abs(t).toPrecision(3),void 0,{numeric:!0})>=0))break;t<0?p--:p++}}if(fy(i,s))return i;{const f=t<0?o:u,p=e[f];ce(p!=null,`Previous layout not found for panel index ${f}`);const h=p+l,g=gn({panelConstraints:n,panelIndex:f,size:h});if(s[f]=g,!et(g,h)){let x=h-g,E=t<0?o:u;for(;E>=0&&E<n.length;){const I=s[E];ce(I!=null,`Previous layout not found for panel index ${E}`);const b=I+x,w=gn({panelConstraints:n,panelIndex:E,size:b});if(et(I,w)||(x-=w-I,s[E]=w),et(x,0))break;t>0?E--:E++}}}const d=s.reduce((f,p)=>p+f,0);return et(d,100)?s:i}function hy({layout:t,panelsArray:e,pivotIndices:n}){let r=0,i=100,a=0,s=0;const u=n[0];ce(u!=null,"No pivot index found"),e.forEach((f,p)=>{const{constraints:h}=f,{maxSize:g=100,minSize:x=0}=h;p===u?(r=x,i=g):(a+=x,s+=g)});const o=Math.min(i,100-a),l=Math.max(r,100-s),d=t[u];return{valueMax:o,valueMin:l,valueNow:d}}function fr(t,e=document){return Array.from(e.querySelectorAll(`[${ve.resizeHandleId}][data-panel-group-id="${t}"]`))}function Sd(t,e,n=document){const i=fr(t,n).findIndex(a=>a.getAttribute(ve.resizeHandleId)===e);return i??null}function Id(t,e,n){const r=Sd(t,e,n);return r!=null?[r,r+1]:[-1,-1]}function Nd(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 Ci(t,e=document){const n=e.querySelector(`[${ve.resizeHandleId}="${t}"]`);return n||null}function py(t,e,n,r=document){var i,a,s,u;const o=Ci(e,r),l=fr(t,r),d=o?l.indexOf(o):-1,f=(i=(a=n[d])===null||a===void 0?void 0:a.id)!==null&&i!==void 0?i:null,p=(s=(u=n[d+1])===null||u===void 0?void 0:u.id)!==null&&s!==void 0?s:null;return[f,p]}function my({committedValuesRef:t,eagerValuesRef:e,groupId:n,layout:r,panelDataArray:i,panelGroupElement:a,setLayout:s}){v.useRef({didWarnAboutMissingResizeHandle:!1}),Qt(()=>{if(!a)return;const u=fr(n,a);for(let o=0;o<i.length-1;o++){const{valueMax:l,valueMin:d,valueNow:f}=hy({layout:r,panelsArray:i,pivotIndices:[o,o+1]}),p=u[o];if(p!=null){const h=i[o];ce(h,`No panel data found for index "${o}"`),p.setAttribute("aria-controls",h.id),p.setAttribute("aria-valuemax",""+Math.round(l)),p.setAttribute("aria-valuemin",""+Math.round(d)),p.setAttribute("aria-valuenow",f!=null?""+Math.round(f):"")}}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;ce(u,"Eager values not found");const{panelDataArray:o}=u,l=Nd(n,a);ce(l!=null,`No group found for id "${n}"`);const d=fr(n,a);ce(d,`No resize handles found for group id "${n}"`);const f=d.map(p=>{const h=p.getAttribute(ve.resizeHandleId);ce(h,"Resize handle element has no handle id attribute");const[g,x]=py(n,h,o,a);if(g==null||x==null)return()=>{};const A=E=>{if(!E.defaultPrevented)switch(E.key){case"Enter":{E.preventDefault();const I=o.findIndex(b=>b.id===g);if(I>=0){const b=o[I];ce(b,`No panel data found for index ${I}`);const w=r[I],{collapsedSize:L=0,collapsible:C,minSize:O=0}=b.constraints;if(w!=null&&C){const H=qn({delta:et(w,L)?O-L:L-w,initialLayout:r,panelConstraints:o.map(z=>z.constraints),pivotIndices:Id(n,h,a),prevLayout:r,trigger:"keyboard"});r!==H&&s(H)}}break}}};return p.addEventListener("keydown",A),()=>{p.removeEventListener("keydown",A)}});return()=>{f.forEach(p=>p())}},[a,t,e,n,r,i,s])}function uo(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 wd(t,e){const n=t==="horizontal",{x:r,y:i}=yi(e);return n?r:i}function gy(t,e,n,r,i){const a=n==="horizontal",s=Ci(e,i);ce(s,`No resize handle element found for id "${e}"`);const u=s.getAttribute(ve.groupId);ce(u,"Resize handle element has no group id attribute");let{initialCursorPosition:o}=r;const l=wd(n,t),d=Nd(u,i);ce(d,`No group element found for id "${u}"`);const f=d.getBoundingClientRect(),p=a?f.width:f.height;return(l-o)/p*100}function by(t,e,n,r,i,a){if(bd(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:gy(t,e,n,r,a)}function Ey({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];ce(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];ce(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 cn(t,e,n){e.forEach((r,i)=>{const a=t[i];ce(a,`Panel data not found for index ${i}`);const{callbacks:s,constraints:u,id:o}=a,{collapsedSize:l=0,collapsible:d}=u,f=n[o];if(f==null||r!==f){n[o]=r;const{onCollapse:p,onExpand:h,onResize:g}=s;g&&g(r,f),d&&(p||h)&&(h&&(f==null||_t(f,l))&&!_t(r,l)&&h(),p&&(f==null||!_t(f,l))&&_t(r,l)&&p())}})}function Or(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 Ty({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 xy(t,e=10){let n=null;return(...i)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{t(...i)},e)}}function oo(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 Rd(t){return`react-resizable-panels:${t}`}function Ld(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 Od(t,e){try{const n=Rd(t),r=e.getItem(n);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function _y(t,e,n){var r,i;const a=(r=Od(t,n))!==null&&r!==void 0?r:{},s=Ld(e);return(i=a[s])!==null&&i!==void 0?i:null}function yy(t,e,n,r,i){var a;const s=Rd(t),u=Ld(e),o=(a=Od(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 lo({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];ce(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];ce(s!=null,`No layout data found for index ${a}`);const u=gn({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];ce(s!=null,`No layout data found for index ${a}`);const u=s+i,o=gn({panelConstraints:e,panelIndex:a,size:u});if(s!==o&&(i-=o-s,n[a]=o,et(i,0)))break}return n}const Ay=100,Vn={getItem:t=>(oo(Vn),Vn.getItem(t)),setItem:(t,e)=>{oo(Vn),Vn.setItem(t,e)}},co={};function vd({autoSaveId:t=null,children:e,className:n="",direction:r,forwardedRef:i,id:a=null,onLayout:s=null,keyboardResizeBy:u=null,storage:o=Vn,style:l,tagName:d="div",...f}){const p=ms(a),h=v.useRef(null),[g,x]=v.useState(null),[A,E]=v.useState([]),I=dy(),b=v.useRef({}),w=v.useRef(new Map),L=v.useRef(0),C=v.useRef({autoSaveId:t,direction:r,dragState:g,id:p,keyboardResizeBy:u,onLayout:s,storage:o}),O=v.useRef({layout:A,panelDataArray:[],panelDataArrayChanged:!1});v.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),v.useImperativeHandle(i,()=>({getId:()=>C.current.id,getLayout:()=>{const{layout:_}=O.current;return _},setLayout:_=>{const{onLayout:q}=C.current,{layout:K,panelDataArray:Q}=O.current,J=lo({layout:_,panelConstraints:Q.map(ee=>ee.constraints)});uo(K,J)||(E(J),O.current.layout=J,q&&q(J),cn(Q,J,b.current))}}),[]),Qt(()=>{C.current.autoSaveId=t,C.current.direction=r,C.current.dragState=g,C.current.id=p,C.current.onLayout=s,C.current.storage=o}),my({committedValuesRef:C,eagerValuesRef:O,groupId:p,layout:A,panelDataArray:O.current.panelDataArray,setLayout:E,panelGroupElement:h.current}),v.useEffect(()=>{const{panelDataArray:_}=O.current;if(t){if(A.length===0||A.length!==_.length)return;let q=co[t];q==null&&(q=xy(yy,Ay),co[t]=q);const K=[..._],Q=new Map(w.current);q(t,K,Q,A,o)}},[t,A,o]),v.useEffect(()=>{});const H=v.useCallback(_=>{const{onLayout:q}=C.current,{layout:K,panelDataArray:Q}=O.current;if(_.constraints.collapsible){const J=Q.map(Oe=>Oe.constraints),{collapsedSize:ee=0,panelSize:oe,pivotIndices:be}=$t(Q,_,K);if(ce(oe!=null,`Panel size not found for panel "${_.id}"`),!_t(oe,ee)){w.current.set(_.id,oe);const Me=pn(Q,_)===Q.length-1?oe-ee:ee-oe,_e=qn({delta:Me,initialLayout:K,panelConstraints:J,pivotIndices:be,prevLayout:K,trigger:"imperative-api"});Or(K,_e)||(E(_e),O.current.layout=_e,q&&q(_e),cn(Q,_e,b.current))}}},[]),z=v.useCallback((_,q)=>{const{onLayout:K}=C.current,{layout:Q,panelDataArray:J}=O.current;if(_.constraints.collapsible){const ee=J.map(Re=>Re.constraints),{collapsedSize:oe=0,panelSize:be=0,minSize:Oe=0,pivotIndices:Me}=$t(J,_,Q),_e=q??Oe;if(_t(be,oe)){const Re=w.current.get(_.id),St=Re!=null&&Re>=_e?Re:_e,sn=pn(J,_)===J.length-1?be-St:St-be,He=qn({delta:sn,initialLayout:Q,panelConstraints:ee,pivotIndices:Me,prevLayout:Q,trigger:"imperative-api"});Or(Q,He)||(E(He),O.current.layout=He,K&&K(He),cn(J,He,b.current))}}},[]),N=v.useCallback(_=>{const{layout:q,panelDataArray:K}=O.current,{panelSize:Q}=$t(K,_,q);return ce(Q!=null,`Panel size not found for panel "${_.id}"`),Q},[]),P=v.useCallback((_,q)=>{const{panelDataArray:K}=O.current,Q=pn(K,_);return Ty({defaultSize:q,dragState:g,layout:A,panelData:K,panelIndex:Q})},[g,A]),M=v.useCallback(_=>{const{layout:q,panelDataArray:K}=O.current,{collapsedSize:Q=0,collapsible:J,panelSize:ee}=$t(K,_,q);return ce(ee!=null,`Panel size not found for panel "${_.id}"`),J===!0&&_t(ee,Q)},[]),Z=v.useCallback(_=>{const{layout:q,panelDataArray:K}=O.current,{collapsedSize:Q=0,collapsible:J,panelSize:ee}=$t(K,_,q);return ce(ee!=null,`Panel size not found for panel "${_.id}"`),!J||tn(ee,Q)>0},[]),j=v.useCallback(_=>{const{panelDataArray:q}=O.current;q.push(_),q.sort((K,Q)=>{const J=K.order,ee=Q.order;return J==null&&ee==null?0:J==null?-1:ee==null?1:J-ee}),O.current.panelDataArrayChanged=!0,I()},[I]);Qt(()=>{if(O.current.panelDataArrayChanged){O.current.panelDataArrayChanged=!1;const{autoSaveId:_,onLayout:q,storage:K}=C.current,{layout:Q,panelDataArray:J}=O.current;let ee=null;if(_){const be=_y(_,J,K);be&&(w.current=new Map(Object.entries(be.expandToSizes)),ee=be.layout)}ee==null&&(ee=Ey({panelDataArray:J}));const oe=lo({layout:ee,panelConstraints:J.map(be=>be.constraints)});uo(Q,oe)||(E(oe),O.current.layout=oe,q&&q(oe),cn(J,oe,b.current))}}),Qt(()=>{const _=O.current;return()=>{_.layout=[]}},[]);const B=v.useCallback(_=>{let q=!1;const K=h.current;return K&&window.getComputedStyle(K,null).getPropertyValue("direction")==="rtl"&&(q=!0),function(J){J.preventDefault();const ee=h.current;if(!ee)return()=>null;const{direction:oe,dragState:be,id:Oe,keyboardResizeBy:Me,onLayout:_e}=C.current,{layout:Re,panelDataArray:St}=O.current,{initialLayout:Ht}=be??{},sn=Id(Oe,_,ee);let He=by(J,_,oe,be,Me,ee);const Rn=oe==="horizontal";Rn&&q&&(He=-He);const Ar=St.map(ki=>ki.constraints),Ut=qn({delta:He,initialLayout:Ht??Re,panelConstraints:Ar,pivotIndices:sn,prevLayout:Re,trigger:bd(J)?"keyboard":"mouse-or-touch"}),Cr=!Or(Re,Ut);(Ed(J)||Td(J))&&L.current!=He&&(L.current=He,!Cr&&He!==0?Rn?Ki(_,He<0?_d:yd):Ki(_,He<0?Ad:Cd):Ki(_,0)),Cr&&(E(Ut),O.current.layout=Ut,_e&&_e(Ut),cn(St,Ut,b.current))}},[]),W=v.useCallback((_,q)=>{const{onLayout:K}=C.current,{layout:Q,panelDataArray:J}=O.current,ee=J.map(Re=>Re.constraints),{panelSize:oe,pivotIndices:be}=$t(J,_,Q);ce(oe!=null,`Panel size not found for panel "${_.id}"`);const Me=pn(J,_)===J.length-1?oe-q:q-oe,_e=qn({delta:Me,initialLayout:Q,panelConstraints:ee,pivotIndices:be,prevLayout:Q,trigger:"imperative-api"});Or(Q,_e)||(E(_e),O.current.layout=_e,K&&K(_e),cn(J,_e,b.current))},[]),te=v.useCallback((_,q)=>{const{layout:K,panelDataArray:Q}=O.current,{collapsedSize:J=0,collapsible:ee}=q,{collapsedSize:oe=0,collapsible:be,maxSize:Oe=100,minSize:Me=0}=_.constraints,{panelSize:_e}=$t(Q,_,K);_e!=null&&(ee&&be&&_t(_e,J)?_t(J,oe)||W(_,oe):_e<Me?W(_,Me):_e>Oe&&W(_,Oe))},[W]),ie=v.useCallback((_,q)=>{const{direction:K}=C.current,{layout:Q}=O.current;if(!h.current)return;const J=Ci(_,h.current);ce(J,`Drag handle element not found for id "${_}"`);const ee=wd(K,q);x({dragHandleId:_,dragHandleRect:J.getBoundingClientRect(),initialCursorPosition:ee,initialLayout:Q})},[]),me=v.useCallback(()=>{x(null)},[]),S=v.useCallback(_=>{const{panelDataArray:q}=O.current,K=pn(q,_);K>=0&&(q.splice(K,1),delete b.current[_.id],O.current.panelDataArrayChanged=!0,I())},[I]),he=v.useMemo(()=>({collapsePanel:H,direction:r,dragState:g,expandPanel:z,getPanelSize:N,getPanelStyle:P,groupId:p,isPanelCollapsed:M,isPanelExpanded:Z,reevaluatePanelConstraints:te,registerPanel:j,registerResizeHandle:B,resizePanel:W,startDragging:ie,stopDragging:me,unregisterPanel:S,panelGroupElement:h.current}),[H,g,r,z,N,P,p,M,Z,te,j,B,W,ie,me,S]),pe={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return v.createElement(_i.Provider,{value:he},v.createElement(d,{...f,children:e,className:n,id:a,ref:h,style:{...pe,...l},[ve.group]:"",[ve.groupDirection]:r,[ve.groupId]:p}))}const Dd=v.forwardRef((t,e)=>v.createElement(vd,{...t,forwardedRef:e}));vd.displayName="PanelGroup";Dd.displayName="forwardRef(PanelGroup)";function pn(t,e){return t.findIndex(n=>n===e||n.id===e.id)}function $t(t,e,n){const r=pn(t,e),a=r===t.length-1?[r-1,r]:[r,r+1],s=n[r];return{...e.constraints,panelSize:s,pivotIndices:a}}function Cy({disabled:t,handleId:e,resizeHandler:n,panelGroupElement:r}){v.useEffect(()=>{if(t||n==null||r==null)return;const i=Ci(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(ve.groupId);ce(u,`No group element found for id "${u}"`);const o=fr(u,r),l=Sd(u,e,r);ce(l!==null,`No resize element found for id "${e}"`);const d=s.shiftKey?l>0?l-1:o.length-1:l+1<o.length?l+1:0;o[d].focus();break}}};return i.addEventListener("keydown",a),()=>{i.removeEventListener("keydown",a)}},[r,t,e,n])}function Pd({children:t=null,className:e="",disabled:n=!1,hitAreaMargins:r,id:i,onBlur:a,onClick:s,onDragging:u,onFocus:o,onPointerDown:l,onPointerUp:d,style:f={},tabIndex:p=0,tagName:h="div",...g}){var x,A;const E=v.useRef(null),I=v.useRef({onClick:s,onDragging:u,onPointerDown:l,onPointerUp:d});v.useEffect(()=>{I.current.onClick=s,I.current.onDragging=u,I.current.onPointerDown=l,I.current.onPointerUp=d});const b=v.useContext(_i);if(b===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:w,groupId:L,registerResizeHandle:C,startDragging:O,stopDragging:H,panelGroupElement:z}=b,N=ms(i),[P,M]=v.useState("inactive"),[Z,j]=v.useState(!1),[B,W]=v.useState(null),te=v.useRef({state:P});Qt(()=>{te.current.state=P}),v.useEffect(()=>{if(n)W(null);else{const he=C(N);W(()=>he)}},[n,N,C]);const ie=(x=r?.coarse)!==null&&x!==void 0?x:15,me=(A=r?.fine)!==null&&A!==void 0?A:5;v.useEffect(()=>{if(n||B==null)return;const he=E.current;ce(he,"Element ref not attached");let pe=!1;return ly(N,he,w,{coarse:ie,fine:me},(q,K,Q)=>{if(!K){M("inactive");return}switch(q){case"down":{M("drag"),pe=!1,ce(Q,'Expected event to be defined for "down" action'),O(N,Q);const{onDragging:J,onPointerDown:ee}=I.current;J?.(!0),ee?.();break}case"move":{const{state:J}=te.current;pe=!0,J!=="drag"&&M("hover"),ce(Q,'Expected event to be defined for "move" action'),B(Q);break}case"up":{M("hover"),H();const{onClick:J,onDragging:ee,onPointerUp:oe}=I.current;ee?.(!1),oe?.(),pe||J?.();break}}})},[ie,w,n,me,C,N,B,O,H]),Cy({disabled:n,handleId:N,resizeHandler:B,panelGroupElement:z});const S={touchAction:"none",userSelect:"none"};return v.createElement(h,{...g,children:t,className:e,id:i,onBlur:()=>{j(!1),a?.()},onFocus:()=>{j(!0),o?.()},ref:E,role:"separator",style:{...S,...f},tabIndex:p,[ve.groupDirection]:w,[ve.groupId]:L,[ve.resizeHandle]:"",[ve.resizeHandleActive]:P==="drag"?"pointer":Z?"keyboard":void 0,[ve.resizeHandleEnabled]:!n,[ve.resizeHandleId]:N,[ve.resizeHandleState]:P})}Pd.displayName="PanelResizeHandle";function iA(t){const e=X.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=ue("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(Dd,{"data-slot":"resizable-panel-group",className:i,...r}),e[5]=r,e[6]=i,e[7]=a):a=e[7],a}function aA(t){const e=X.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(gd,{"data-slot":"resizable-panel",...n}),e[2]=n,e[3]=r):r=e[3],r}function sA(t){const e=X.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=ue("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(_o,{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(Pd,{"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{Ky as B,tA as C,L0 as D,j0 as G,nA as I,U_ as M,aA as R,Qy as a,F0 as b,P_ as c,Xy as d,Zy as e,eA as f,Jy as g,D0 as h,P0 as i,M0 as j,Hs as k,R0 as l,sA as m,rA as n,iA as o,T0 as u};
@@ -1 +1 @@
1
- import{c as x,j as u}from"./index-D_9U2egr.js";import{c,B as p}from"./button-UpWqqi7Z.js";import{B as g}from"./badge-DBsMMhww.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-DkE856zJ.js";import{c,B as p}from"./button-Dj8ueofv.js";import{B as g}from"./badge-BcTlBuEb.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};
@@ -0,0 +1 @@
1
+ import{r as c,a2 as Pe,L as rt,z as _e,j as d,a3 as st,H as lt,a4 as be,aC as at,Z as k,a5 as it,B as j,E as N,a1 as $,a6 as ct,ai as Ee,aZ as dt,a0 as ut,a7 as pt,aa as ft,a8 as mt,a9 as ht,ab as vt,ac as gt,ad as xt,ae as St,c as ee}from"./index-DkE856zJ.js";import{V as wt,i as Ct}from"./tooltip-CNuF1S13.js";import{t as Re}from"./ChevronDown-BTsoCUlX.js";import{c as oe}from"./button-Dj8ueofv.js";function Ne(n,[e,t]){return Math.min(t,Math.max(e,n))}var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,bt]=at(J),[ne]=lt(J,[bt,Pe]),pe=Pe(),[Tt,G]=ne(J),[_t,Nt]=ne(J),je=n=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:r,onOpenChange:i,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:w,required:C,form:S}=n,p=pe(e),[v,y]=c.useState(null),[m,x]=c.useState(null),[U,M]=c.useState(!1),re=rt(u),[P,O]=_e({prop:o,defaultProp:r??!1,onChange:i,caller:J}),[F,Z]=_e({prop:s,defaultProp:l,onChange:a,caller:J}),L=c.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=c.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(st,{...p,children:d.jsxs(Tt,{required:C,scope:e,trigger:v,onTriggerChange:y,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:U,onValueNodeHasChildrenChange:M,contentId:be(),value:F,onValueChange:Z,open:P,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:w,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(_t,{scope:n.__scopeSelect,onNativeOptionAdd:c.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:c.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Qe,{"aria-hidden":!0,required:C,tabIndex:-1,name:h,autoComplete:g,value:F,onChange:E=>Z(E.target.value),disabled:w,form:S,children:[F===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=J;var Me="SelectTrigger",Ae=c.forwardRef((n,e)=>{const{__scopeSelect:t,disabled:o=!1,...r}=n,i=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=c.useRef("touch"),[g,w,C]=tt(p=>{const v=u().filter(x=>!x.disabled),y=v.find(x=>x.value===s.value),m=ot(v,p,y);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),C()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(it,{asChild:!0,...i,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...r,ref:a,onClick:N(r.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:N(r.onPointerDown,p=>{h.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:N(r.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&w(p.key),!(v&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=c.forwardRef((n,e)=>{const{__scopeSelect:t,className:o,style:r,children:i,placeholder:s="",...l}=n,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=i!==void 0,g=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):i})});De.displayName=Oe;var Pt="SelectIcon",ke=c.forwardRef((n,e)=>{const{__scopeSelect:t,children:o,...r}=n;return d.jsx(j.span,{"aria-hidden":!0,...r,ref:e,children:o||"▼"})});ke.displayName=Pt;var Et="SelectPortal",Le=n=>d.jsx(ct,{asChild:!0,...n});Le.displayName=Et;var Q="SelectContent",Be=c.forwardRef((n,e)=>{const t=G(Q,n.__scopeSelect),[o,r]=c.useState();if($(()=>{r(new DocumentFragment)},[]),!t.open){const i=o;return i?Ee.createPortal(d.jsx(Ve,{scope:n.__scopeSelect,children:d.jsx(de.Slot,{scope:n.__scopeSelect,children:d.jsx("div",{children:n.children})})}),i):null}return d.jsx(He,{...n,ref:e})});Be.displayName=Q;var A=10,[Ve,Y]=ne(Q),Rt="SelectContentImpl",jt=ht("SelectContent.RemoveScroll"),He=c.forwardRef((n,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:w,collisionPadding:C,sticky:S,hideWhenDetached:p,avoidCollisions:v,...y}=n,m=G(Q,t),[x,U]=c.useState(null),[M,re]=c.useState(null),P=k(e,f=>U(f)),[O,F]=c.useState(null),[Z,L]=c.useState(null),B=ue(t),[W,V]=c.useState(!1),H=c.useRef(!1);c.useEffect(()=>{if(x)return pt(x)},[x]),ft();const E=c.useCallback(f=>{const[T,...R]=B().map(_=>_.ref.current),[I]=R.slice(-1),b=document.activeElement;for(const _ of f)if(_===b||(_?.scrollIntoView({block:"nearest"}),_===T&&M&&(M.scrollTop=0),_===I&&M&&(M.scrollTop=M.scrollHeight),_?.focus(),document.activeElement!==b))return},[B,M]),D=c.useCallback(()=>E([O,x]),[E,O,x]);c.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;c.useEffect(()=>{if(x){let f={x:0,y:0};const T=I=>{f={x:Math.abs(Math.round(I.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(I.pageY)-(K.current?.y??0))}},R=I=>{f.x<=10&&f.y<=10?I.preventDefault():x.contains(I.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),c.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(b=>!b.disabled),R=T.find(b=>b.ref.current===document.activeElement),I=ot(T,f,R);I&&setTimeout(()=>I.ref.current.focus())}),me=c.useCallback((f,T,R)=>{const I=!H.current&&!R;(m.value!==void 0&&m.value===T||I)&&(F(f),I&&(H.current=!0))},[m.value]),he=c.useCallback(()=>x?.focus(),[x]),te=c.useCallback((f,T,R)=>{const I=!H.current&&!R;(m.value!==void 0&&m.value===T||I)&&L(f)},[m.value]),ie=o==="popper"?Se:ze,se=ie===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:w,collisionPadding:C,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return d.jsx(Ve,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:Z,position:o,isPositioned:W,searchRef:fe,children:d.jsx(mt,{as:jt,allowPinchZoom:!0,children:d.jsx(vt,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:N(r,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(gt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ie,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...y,...se,onPlaced:()=>V(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:N(y.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let I=B().filter(b=>!b.disabled).map(b=>b.ref.current);if(["ArrowUp","End"].includes(f.key)&&(I=I.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const b=f.target,_=I.indexOf(b);I=I.slice(_+1)}setTimeout(()=>E(I)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=c.forwardRef((n,e)=>{const{__scopeSelect:t,onPlaced:o,...r}=n,i=G(Q,t),s=Y(Q,t),[l,a]=c.useState(null),[u,h]=c.useState(null),g=k(e,P=>h(P)),w=ue(t),C=c.useRef(!1),S=c.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:y,focusSelectedItem:m}=s,x=c.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&u&&p&&v&&y){const P=i.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),F=i.valueNode.getBoundingClientRect(),Z=y.getBoundingClientRect();if(i.dir!=="rtl"){const b=Z.left-O.left,_=F.left-b,q=P.left-_,X=P.width+q,ve=Math.max(X,O.width),ge=window.innerWidth-A,xe=Ne(_,[A,Math.max(A,ge-ve)]);l.style.minWidth=X+"px",l.style.left=xe+"px"}else{const b=O.right-Z.right,_=window.innerWidth-F.right-b,q=window.innerWidth-P.right-_,X=P.width+q,ve=Math.max(X,O.width),ge=window.innerWidth-A,xe=Ne(_,[A,Math.max(A,ge-ve)]);l.style.minWidth=X+"px",l.style.right=xe+"px"}const L=w(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=P.top+P.height/2-A,ie=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const b=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const _=u.clientHeight-p.offsetTop-p.offsetHeight,q=Math.max(ie,se+(b?he:0)+_+D),X=T+q;l.style.height=X+"px"}else{const b=L.length>0&&v===L[0].ref.current;l.style.top="0px";const q=Math.max(te,H+p.offsetTop+(b?me:0)+se)+R;l.style.height=q+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>C.current=!0)}},[w,i.trigger,i.valueNode,l,u,p,v,y,i.dir,o]);$(()=>x(),[x]);const[U,M]=c.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=c.useCallback(P=>{P&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:C,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:U},children:d.jsx(j.div,{...r,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=c.forwardRef((n,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:r=A,...i}=n,s=pe(t);return d.jsx(xt,{...s,...i,ref:e,align:o,collisionPadding:r,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=At;var[Ot,Te]=ne(Q,{}),we="SelectViewport",Ue=c.forwardRef((n,e)=>{const{__scopeSelect:t,nonce:o,...r}=n,i=Y(we,t),s=Te(we,t),l=k(e,i.onViewportChange),a=c.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:N(r.onScroll,u=>{const h=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:w}=s;if(w?.current&&g){const C=Math.abs(a.current-h.scrollTop);if(C>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),y=Math.max(p,v);if(y<S){const m=y+C,x=Math.min(S,m),U=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=U>0?U:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Ue.displayName=we;var Fe="SelectGroup",[Dt,kt]=ne(Fe),Lt=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n,r=be();return d.jsx(Dt,{scope:t,id:r,children:d.jsx(j.div,{role:"group","aria-labelledby":r,...o,ref:e})})});Lt.displayName=Fe;var We="SelectLabel",Bt=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n,r=kt(We,t);return d.jsx(j.div,{id:r.id,...o,ref:e})});Bt.displayName=We;var ce="SelectItem",[Vt,Ke]=ne(ce),$e=c.forwardRef((n,e)=>{const{__scopeSelect:t,value:o,disabled:r=!1,textValue:i,...s}=n,l=G(ce,t),a=Y(ce,t),u=l.value===o,[h,g]=c.useState(i??""),[w,C]=c.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,r)),p=be(),v=c.useRef("touch"),y=()=>{r||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Vt,{scope:t,value:o,disabled:r,textId:p,isSelected:u,onItemTextChange:c.useCallback(m=>{g(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:r,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":w?"":void 0,"aria-selected":u&&w,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...s,ref:S,onFocus:N(s.onFocus,()=>C(!0)),onBlur:N(s.onBlur,()=>C(!1)),onClick:N(s.onClick,()=>{v.current!=="mouse"&&y()}),onPointerUp:N(s.onPointerUp,()=>{v.current==="mouse"&&y()}),onPointerDown:N(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:N(s.onPointerMove,m=>{v.current=m.pointerType,r?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:N(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(It.includes(m.key)&&y(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ce;var le="SelectItemText",Ge=c.forwardRef((n,e)=>{const{__scopeSelect:t,className:o,style:r,...i}=n,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=Nt(le,t),[h,g]=c.useState(null),w=k(e,y=>g(y),a.onItemTextChange,y=>l.itemTextRefCallback?.(y,a.value,a.disabled)),C=h?.textContent,S=c.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:C},a.value),[a.disabled,a.value,C]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...i,ref:w}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ee.createPortal(i.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",Ze=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});Ze.displayName=Ye;var Ce="SelectScrollUpButton",qe=c.forwardRef((n,e)=>{const t=Y(Ce,n.__scopeSelect),o=Te(Ce,n.__scopeSelect),[r,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;i(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),r?d.jsx(Je,{...n,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});qe.displayName=Ce;var ye="SelectScrollDownButton",Xe=c.forwardRef((n,e)=>{const t=Y(ye,n.__scopeSelect),o=Te(ye,n.__scopeSelect),[r,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;i(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),r?d.jsx(Je,{...n,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Xe.displayName=ye;var Je=c.forwardRef((n,e)=>{const{__scopeSelect:t,onAutoScroll:o,...r}=n,i=Y("SelectScrollButton",t),s=c.useRef(null),l=ue(t),a=c.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return c.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...r,ref:e,style:{flexShrink:0,...r.style},onPointerDown:N(r.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:N(r.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:N(r.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var Ie="SelectArrow",Ut=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n,r=pe(t),i=G(Ie,t),s=Y(Ie,t);return i.open&&s.position==="popper"?d.jsx(St,{...r,...o,ref:e}):null});Ut.displayName=Ie;var Ft="SelectBubbleInput",Qe=c.forwardRef(({__scopeSelect:n,value:e,...t},o)=>{const r=c.useRef(null),i=k(o,r),s=dt(e);return c.useEffect(()=>{const l=r.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const g=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(j.select,{...t,style:{...wt,...t.style},ref:i,defaultValue:e})});Qe.displayName=Ft;function et(n){return n===""||n===void 0}function tt(n){const e=ut(n),t=c.useRef(""),o=c.useRef(0),r=c.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),i=c.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return c.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,r,i]}function ot(n,e,t){const r=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=t?n.indexOf(t):-1;let s=Wt(n,Math.max(i,0));r.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return a!==t?a:void 0}function Wt(n,e){return n.map((t,o)=>n[(e+o)%n.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,Zt=Le,qt=Be,Xt=Ue,Jt=$e,Qt=Ge,eo=Ze,to=qe,oo=Xe;const nt=({size:n=24,color:e="currentColor",...t})=>c.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},c.createElement("path",{d:"m18 15-6-6-6 6"}));nt.displayName="ChevronUp";function co(n){const e=ee.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(n){const e=ee.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(n){const e=ee.c(13);let t,o,r,i;e[0]!==n?({className:o,size:i,children:t,...r}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=r,e[4]=i):(t=e[1],o=e[2],r=e[3],i=e[4]);const s=i===void 0?"default":i;let l;e[5]!==o?(l=oe("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-xl border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-10 data-[size=sm]:h-8 data-[size=xs]:h-7 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...r,children:[t,a]}),e[8]=t,e[9]=r,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function fo(n){const e=ee.c(20);let t,o,r,i;e[0]!==n?({className:o,children:t,position:i,...r}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=r,e[4]=i):(t=e[1],o=e[2],r=e[3],i=e[4]);const s=i===void 0?"popper":i,l=s==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let a;e[5]!==o||e[6]!==l?(a=oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-xl border shadow-md",l,o),e[5]=o,e[6]=l,e[7]=a):a=e[7];let u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=d.jsx(no,{}),e[8]=u):u=e[8];const h=s==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let g;e[9]!==h?(g=oe("p-1",h),e[9]=h,e[10]=g):g=e[10];let w;e[11]!==t||e[12]!==g?(w=d.jsx(Xt,{className:g,children:t}),e[11]=t,e[12]=g,e[13]=w):w=e[13];let C;e[14]===Symbol.for("react.memo_cache_sentinel")?(C=d.jsx(ro,{}),e[14]=C):C=e[14];let S;return e[15]!==s||e[16]!==r||e[17]!==a||e[18]!==w?(S=d.jsx(Zt,{children:d.jsxs(qt,{"data-slot":"select-content",className:a,position:s,...r,children:[u,w,C]})}),e[15]=s,e[16]=r,e[17]=a,e[18]=w,e[19]=S):S=e[19],S}function mo(n){const e=ee.c(16);let t,o,r,i;e[0]!==n?({className:o,children:t,hideCheck:i,...r}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=r,e[4]=i):(t=e[1],o=e[2],r=e[3],i=e[4]);const s=i===void 0?!1:i;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-xl py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(Ct,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Qt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==r||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Jt,{"data-slot":"select-item",className:l,...r,children:[a,u]}),e[11]=r,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(n){const e=ee.c(9);let t,o;e[0]!==n?({className:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let r;e[3]!==t?(r=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=r):r=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(nt,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==r?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:r,...o,children:i}),e[6]=o,e[7]=r,e[8]=s):s=e[8],s}function ro(n){const e=ee.c(9);let t,o;e[0]!==n?({className:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let r;e[3]!==t?(r=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=r):r=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Re,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==r?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:r,...o,children:i}),e[6]=o,e[7]=r,e[8]=s):s=e[8],s}export{co as S,po as a,uo as b,fo as c,mo as d,Ne as e,nt as n};
@@ -1 +1 @@
1
- import{f as q,e as D,r as U,y as B,x as K,j as s,v as P,c as $,t as y,K as I,a as Q,w as F}from"./index-D_9U2egr.js";import{C as A}from"./collection-header-BIZLVBPH.js";import{C as H}from"./collection-page-CpTNB-W7.js";import{u as Y}from"./tooltip-CaoJSXa7.js";import{u as G,B as N}from"./button-UpWqqi7Z.js";import{a as J,F as R,b as O,c as E,d as L,f as k,e as T}from"./form-CGaxh2WC.js";import{I as M}from"./input-DNanPJKs.js";import{i as V}from"./Upload01-5z8SDkNm.js";import{i as W}from"./X-SWur-HdE.js";import"./collection-display-button-CJMwmXuc.js";import"./dropdown-menu-B_pozn9G.js";import"./view-mode-toggle-BWA1OFcI.js";const X=P({name:F().min(1,"Name is required").max(255,"Name is too long"),slug:F().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:F().optional()});function Z(C){const e=$.c(24),{value:n,onChange:o,name:d}=C,a=U.useRef(null);let m;e[0]!==o?(m=w=>{const z=w.target.files?.[0];if(z){if(z.size>2097152){y.error("Image must be smaller than 2MB");return}const c=new FileReader;c.onerror=()=>{const b=c.error;console.error("FileReader error:",b),y.error(b?.message||"Failed to read image file. Please try again."),a.current&&(a.current.value="")},c.onloadend=()=>{if(c.readyState===FileReader.DONE&&c.result){const b=c.result;o(b)}},c.readAsDataURL(z)}},e[0]=o,e[1]=m):m=e[1];const p=m;let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=()=>{a.current?.click()},e[2]=i):i=e[2];const t=i;let l;e[3]!==o?(l=w=>{w.stopPropagation(),o("")},e[3]=o,e[4]=l):l=e[4];const r=l;let u;e[5]!==p?(u=s.jsx("input",{type:"file",ref:a,className:"hidden",accept:"image/*",onChange:p}),e[5]=p,e[6]=u):u=e[6];let g;e[7]!==r||e[8]!==d||e[9]!==n?(g=n?s.jsxs("div",{className:"relative group",children:[s.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:s.jsx("img",{src:n,alt:d||"Organization logo",className:"w-full h-full object-cover"})}),s.jsx("button",{type:"button",onClick:r,className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:s.jsx(W,{className:"h-3 w-3"})})]}):s.jsxs("button",{type:"button",onClick:t,className:"h-20 w-20 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-1 text-muted-foreground hover:text-foreground",children:[s.jsx(V,{className:"h-5 w-5"}),s.jsx("span",{className:"text-xs",children:"Upload"})]}),e[7]=r,e[8]=d,e[9]=n,e[10]=g):g=e[10];const S=n?"Change Logo":"Upload Logo";let x;e[11]!==S?(x=s.jsx(N,{type:"button",variant:"outline",size:"sm",onClick:t,className:"mb-2",children:S}),e[11]=S,e[12]=x):x=e[12];let h;e[13]!==r||e[14]!==n?(h=n&&s.jsx(N,{type:"button",variant:"ghost",size:"sm",onClick:r,className:"ml-2",children:"Remove"}),e[13]=r,e[14]=n,e[15]=h):h=e[15];let j;e[16]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),e[16]=j):j=e[16];let f;e[17]!==x||e[18]!==h?(f=s.jsxs("div",{className:"flex-1",children:[x,h,j]}),e[17]=x,e[18]=h,e[19]=f):f=e[19];let v;return e[20]!==f||e[21]!==u||e[22]!==g?(v=s.jsxs("div",{className:"flex items-start gap-4",children:[u,g,f]}),e[20]=f,e[21]=u,e[22]=g,e[23]=v):v=e[23],v}function me(){const C=q(),{org:e}=Y(),n=D(),[o,d]=U.useState(!1),a=B({resolver:K(X),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),m=G({mutationFn:async t=>{const l={name:t.name,slug:t.slug};t.logo&&(l.logo=t.logo);const r=await Q.organization.update({organizationId:e.id,data:l});if(r?.error)throw new Error(r.error.message||"Failed to update organization");return r},onSuccess:t=>{n.invalidateQueries({queryKey:I.organizations()}),n.invalidateQueries({queryKey:I.activeOrganization(e.slug)}),y.success("Organization settings updated successfully"),t?.data?.slug&&t.data.slug!==e.slug&&C({to:"/$org/settings",params:{org:t.data.slug}})},onError:t=>{y.error(t instanceof Error?t.message:"Failed to update organization")},onSettled:()=>{d(!1)}}),p=t=>{d(!0),m.mutate(t)},i=a.formState.isDirty;return s.jsxs(H,{children:[s.jsx(A,{title:"Settings"}),s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx("div",{className:"p-5 max-w-2xl",children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Organization"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Update your organization's name, slug, and logo."})]}),s.jsx(J,{...a,children:s.jsxs("form",{onSubmit:a.handleSubmit(p),className:"space-y-6",children:[s.jsx(R,{control:a.control,name:"name",render:({field:t})=>s.jsxs(O,{children:[s.jsx(E,{children:"Organization Name"}),s.jsx(L,{children:s.jsx(M,{placeholder:"My Organization",...t,disabled:o})}),s.jsx(k,{})]})}),s.jsx(R,{control:a.control,name:"slug",render:({field:t})=>s.jsxs(O,{children:[s.jsx(E,{children:"Organization Slug"}),s.jsx(L,{children:s.jsx(M,{placeholder:"my-organization",...t,disabled:o,onChange:l=>{const r=l.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");t.onChange(r)}})}),s.jsx(T,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),s.jsx(k,{})]})}),s.jsx(R,{control:a.control,name:"logo",render:({field:t})=>s.jsxs(O,{children:[s.jsx(E,{children:"Logo"}),s.jsx(L,{children:s.jsx(Z,{value:t.value,onChange:t.onChange,name:a.watch("name")})}),s.jsx(k,{})]})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(N,{type:"submit",disabled:!i||o,className:"min-w-24",children:o?"Saving...":"Save Changes"}),i&&s.jsx(N,{type:"button",variant:"outline",onClick:()=>a.reset(),disabled:o,children:"Cancel"})]})]})})]})})})})})]})}export{me as default};
1
+ import{f as q,e as D,r as U,y as B,x as K,j as s,v as P,c as $,t as y,K as I,a as Q,w as F}from"./index-DkE856zJ.js";import{C as A}from"./collection-header-BuFCeK4g.js";import{C as H}from"./collection-page-M_cHcDoQ.js";import{u as Y}from"./tooltip-CNuF1S13.js";import{u as G,B as N}from"./button-Dj8ueofv.js";import{a as J,F as R,b as O,c as E,d as L,f as k,e as T}from"./form-D1QOQ8Im.js";import{I as M}from"./input-C2Ph-V5_.js";import{i as V}from"./Upload01-CGDUyeg3.js";import{i as W}from"./X-E7J_uWRT.js";import"./collection-display-button-C193PAy9.js";import"./dropdown-menu-BUANjhM2.js";import"./view-mode-toggle-CIqr2uxV.js";const X=P({name:F().min(1,"Name is required").max(255,"Name is too long"),slug:F().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:F().optional()});function Z(C){const e=$.c(24),{value:n,onChange:o,name:d}=C,a=U.useRef(null);let m;e[0]!==o?(m=w=>{const z=w.target.files?.[0];if(z){if(z.size>2097152){y.error("Image must be smaller than 2MB");return}const c=new FileReader;c.onerror=()=>{const b=c.error;console.error("FileReader error:",b),y.error(b?.message||"Failed to read image file. Please try again."),a.current&&(a.current.value="")},c.onloadend=()=>{if(c.readyState===FileReader.DONE&&c.result){const b=c.result;o(b)}},c.readAsDataURL(z)}},e[0]=o,e[1]=m):m=e[1];const p=m;let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=()=>{a.current?.click()},e[2]=i):i=e[2];const t=i;let l;e[3]!==o?(l=w=>{w.stopPropagation(),o("")},e[3]=o,e[4]=l):l=e[4];const r=l;let u;e[5]!==p?(u=s.jsx("input",{type:"file",ref:a,className:"hidden",accept:"image/*",onChange:p}),e[5]=p,e[6]=u):u=e[6];let g;e[7]!==r||e[8]!==d||e[9]!==n?(g=n?s.jsxs("div",{className:"relative group",children:[s.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:s.jsx("img",{src:n,alt:d||"Organization logo",className:"w-full h-full object-cover"})}),s.jsx("button",{type:"button",onClick:r,className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:s.jsx(W,{className:"h-3 w-3"})})]}):s.jsxs("button",{type:"button",onClick:t,className:"h-20 w-20 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-1 text-muted-foreground hover:text-foreground",children:[s.jsx(V,{className:"h-5 w-5"}),s.jsx("span",{className:"text-xs",children:"Upload"})]}),e[7]=r,e[8]=d,e[9]=n,e[10]=g):g=e[10];const S=n?"Change Logo":"Upload Logo";let x;e[11]!==S?(x=s.jsx(N,{type:"button",variant:"outline",size:"sm",onClick:t,className:"mb-2",children:S}),e[11]=S,e[12]=x):x=e[12];let h;e[13]!==r||e[14]!==n?(h=n&&s.jsx(N,{type:"button",variant:"ghost",size:"sm",onClick:r,className:"ml-2",children:"Remove"}),e[13]=r,e[14]=n,e[15]=h):h=e[15];let j;e[16]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),e[16]=j):j=e[16];let f;e[17]!==x||e[18]!==h?(f=s.jsxs("div",{className:"flex-1",children:[x,h,j]}),e[17]=x,e[18]=h,e[19]=f):f=e[19];let v;return e[20]!==f||e[21]!==u||e[22]!==g?(v=s.jsxs("div",{className:"flex items-start gap-4",children:[u,g,f]}),e[20]=f,e[21]=u,e[22]=g,e[23]=v):v=e[23],v}function me(){const C=q(),{org:e}=Y(),n=D(),[o,d]=U.useState(!1),a=B({resolver:K(X),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),m=G({mutationFn:async t=>{const l={name:t.name,slug:t.slug};t.logo&&(l.logo=t.logo);const r=await Q.organization.update({organizationId:e.id,data:l});if(r?.error)throw new Error(r.error.message||"Failed to update organization");return r},onSuccess:t=>{n.invalidateQueries({queryKey:I.organizations()}),n.invalidateQueries({queryKey:I.activeOrganization(e.slug)}),y.success("Organization settings updated successfully"),t?.data?.slug&&t.data.slug!==e.slug&&C({to:"/$org/settings",params:{org:t.data.slug}})},onError:t=>{y.error(t instanceof Error?t.message:"Failed to update organization")},onSettled:()=>{d(!1)}}),p=t=>{d(!0),m.mutate(t)},i=a.formState.isDirty;return s.jsxs(H,{children:[s.jsx(A,{title:"Settings"}),s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx("div",{className:"p-5 max-w-2xl",children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Organization"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Update your organization's name, slug, and logo."})]}),s.jsx(J,{...a,children:s.jsxs("form",{onSubmit:a.handleSubmit(p),className:"space-y-6",children:[s.jsx(R,{control:a.control,name:"name",render:({field:t})=>s.jsxs(O,{children:[s.jsx(E,{children:"Organization Name"}),s.jsx(L,{children:s.jsx(M,{placeholder:"My Organization",...t,disabled:o})}),s.jsx(k,{})]})}),s.jsx(R,{control:a.control,name:"slug",render:({field:t})=>s.jsxs(O,{children:[s.jsx(E,{children:"Organization Slug"}),s.jsx(L,{children:s.jsx(M,{placeholder:"my-organization",...t,disabled:o,onChange:l=>{const r=l.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");t.onChange(r)}})}),s.jsx(T,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),s.jsx(k,{})]})}),s.jsx(R,{control:a.control,name:"logo",render:({field:t})=>s.jsxs(O,{children:[s.jsx(E,{children:"Logo"}),s.jsx(L,{children:s.jsx(Z,{value:t.value,onChange:t.onChange,name:a.watch("name")})}),s.jsx(k,{})]})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(N,{type:"submit",disabled:!i||o,className:"min-w-24",children:o?"Saving...":"Save Changes"}),i&&s.jsx(N,{type:"button",variant:"outline",onClick:()=>a.reset(),disabled:o,children:"Cancel"})]})]})})]})})})})})]})}export{me as default};