@decocms/mesh 1.0.8 → 1.0.10

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 (111) hide show
  1. package/dist/client/assets/{AlertCircle-BOdIbqIs.js → AlertCircle-zCOLtXNG.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft--mrEcY9t.js → ArrowLeft-b0UM4Vui.js} +1 -1
  3. package/dist/client/assets/{Calendar-FEvoSB5L.js → Calendar-Cxw5FKll.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-DCY43SXR.js → CheckCircle-U8-nit8x.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-BQbWxkfW.js → ChevronDown-BFYjmmoG.js} +1 -1
  6. package/dist/client/assets/{Clock-B2GhwaAI.js → Clock-qZko4uak.js} +1 -1
  7. package/dist/client/assets/{Copy01-CNQxqLRw.js → Copy01-XN5V21c6.js} +1 -1
  8. package/dist/client/assets/{CpuChip02-BiTasWbD.js → CpuChip02-Nhk4zHXl.js} +1 -1
  9. package/dist/client/assets/{DotsVertical-D0xC4MY4.js → DotsVertical-CcNQsTaW.js} +1 -1
  10. package/dist/client/assets/{File06-CginPRn9.js → File06-DB55FK-Z.js} +1 -1
  11. package/dist/client/assets/{GitBranch01-GzTSxN9T.js → GitBranch01-CM-ab6hS.js} +1 -1
  12. package/dist/client/assets/{Inbox01-D9KmcOy8.js → Inbox01-CIzt2AdR.js} +1 -1
  13. package/dist/client/assets/{InfoCircle-D8mTtKdA.js → InfoCircle-ChxTTkMX.js} +1 -1
  14. package/dist/client/assets/{Key01-e6YzBDTD.js → Key01-DYiMWoz_.js} +1 -1
  15. package/dist/client/assets/{LinkExternal01-NfJeAPv5.js → LinkExternal01-CBZhTXC0.js} +1 -1
  16. package/dist/client/assets/{Loading01-CCRghFAi.js → Loading01-Dtm2TLlA.js} +1 -1
  17. package/dist/client/assets/{Plus-Bu89Xdvq.js → Plus-DF_I5mml.js} +1 -1
  18. package/dist/client/assets/{SearchMd-9OvHwtrD.js → SearchMd-C_ak4ze3.js} +1 -1
  19. package/dist/client/assets/{Terminal-CS-oYY6X.js → Terminal-4DdepWh9.js} +1 -1
  20. package/dist/client/assets/{Trash01-D6Jd-C-A.js → Trash01-FYPMjpVf.js} +1 -1
  21. package/dist/client/assets/{Upload01-p9mtwUJO.js → Upload01-BYeEw9Vy.js} +1 -1
  22. package/dist/client/assets/{X-CPWcGQX-.js → X-BTsWwO_U.js} +1 -1
  23. package/dist/client/assets/{XClose-Bg1dQbEQ.js → XClose-CY6vd_0A.js} +1 -1
  24. package/dist/client/assets/{alert-dialog-C5WdCZb7.js → alert-dialog-DhxQ40TA.js} +2 -2
  25. package/dist/client/assets/auth-CfgXQhXI.js +1 -0
  26. package/dist/client/assets/{auth-catchall-BXbesUXT.js → auth-catchall-CohlC3Pb.js} +1 -1
  27. package/dist/client/assets/{avatar-_r3OideF.js → avatar-CcUZFpwU.js} +1 -1
  28. package/dist/client/assets/{badge-C0Qf1_P5.js → badge-CgUwfcKq.js} +1 -1
  29. package/dist/client/assets/{button-C6Q9i6bB.js → button-DuitHSR8.js} +1 -1
  30. package/dist/client/assets/{card-CkqxLUmD.js → card-DkEpNms8.js} +1 -1
  31. package/dist/client/assets/{checkbox-BrNiXyG6.js → checkbox-DTaSeum9.js} +1 -1
  32. package/dist/client/assets/{collection-detail-D9-8PQpD.js → collection-detail-Dvc6iyHF.js} +2 -2
  33. package/dist/client/assets/{collection-display-button-CapIICNB.js → collection-display-button-DgDdVSTg.js} +1 -1
  34. package/dist/client/assets/{collection-header-xspJxL_F.js → collection-header-D-wXFMG4.js} +1 -1
  35. package/dist/client/assets/{collection-page-BcW_e2hi.js → collection-page-AFIAghtr.js} +1 -1
  36. package/dist/client/assets/{collection-search-BP4aaz_a.js → collection-search-OoKPetka.js} +1 -1
  37. package/dist/client/assets/{collection-table-wrapper-BqYO84av.js → collection-table-wrapper-DEVlTpj8.js} +1 -1
  38. package/dist/client/assets/{connection-card-CVvPIgot.js → connection-card-CVX6Dj6b.js} +1 -1
  39. package/dist/client/assets/{connection-detail-JBGxZxkM.js → connection-detail-C_uPOJ6z.js} +1 -1
  40. package/dist/client/assets/{connections-B74A-ujA.js → connections-DoAE9QhX.js} +1 -1
  41. package/dist/client/assets/{core-CrBooOPa.js → core-BMfBj0bw.js} +1 -1
  42. package/dist/client/assets/{create-organization-dialog-DKjCEIp0.js → create-organization-dialog-C_xVF_Jl.js} +1 -1
  43. package/dist/client/assets/{dialog-wqLP6s8y.js → dialog-Dl9CupEb.js} +1 -1
  44. package/dist/client/assets/{dropdown-menu-Cf1-ucSW.js → dropdown-menu-CPQpNQmn.js} +1 -1
  45. package/dist/client/assets/env-vars-editor-BcyBU5xA.js +1 -0
  46. package/dist/client/assets/{error-boundary-BvHIgIeG.js → error-boundary-DMJQCmxn.js} +1 -1
  47. package/dist/client/assets/extract-connection-data-Bt1_1dQ8.js +1 -0
  48. package/dist/client/assets/{form-eTDr0W4q.js → form-BfiwCHdz.js} +1 -1
  49. package/dist/client/assets/{formatDistanceToNow-BxzU2by2.js → formatDistanceToNow-BmkU67cZ.js} +1 -1
  50. package/dist/client/assets/{gateway-detail-DKkqklk0.js → gateway-detail-ZknLelfM.js} +1 -1
  51. package/dist/client/assets/{gateways-BhKn-EFm.js → gateways-BAQA-e5y.js} +1 -1
  52. package/dist/client/assets/{home-DI8Z0JFU.js → home-BzOK0WeX.js} +1 -1
  53. package/dist/client/assets/index-CCNaUj2A.js +156 -0
  54. package/dist/client/assets/{index-CZhZ_SKX.js → index-DR-B7Y1Z.js} +1 -1
  55. package/dist/client/assets/{index-BWHtrgim.js → index-T7OaHK12.js} +1 -1
  56. package/dist/client/assets/{index-CZLUv0P3.js → index-be58e1VX.js} +3 -3
  57. package/dist/client/assets/{input-CRJkMCdz.js → input-YU6lpVgW.js} +1 -1
  58. package/dist/client/assets/json-BnmF_c7J.js +1 -0
  59. package/dist/client/assets/{json-syntax-highlighter-B03842aR.js → json-syntax-highlighter-Dve1WRV4.js} +2 -2
  60. package/dist/client/assets/{layout-6uTC86JS.js → layout-n40g10Oh.js} +1 -1
  61. package/dist/client/assets/{lazy-highlighter-BSMDGfqn.js → lazy-highlighter-BY_mRZdt.js} +1 -1
  62. package/dist/client/assets/{localstorage-keys-CcQMsGvY.js → localstorage-keys-BphvZ-YX.js} +1 -1
  63. package/dist/client/assets/{login-DGpMcH9O.js → login-CJi6KFGq.js} +1 -1
  64. package/dist/client/assets/mcp-oauth-CvO1Z13d.js +1 -0
  65. package/dist/client/assets/{members-F8i7vdZR.js → members-UHyk3Nn4.js} +1 -1
  66. package/dist/client/assets/{monitoring-C2lb19h6.js → monitoring-65mgE8O0.js} +1 -1
  67. package/dist/client/assets/{oauth-callback-DtKkmmTQ.js → oauth-callback-KqixmXKf.js} +1 -1
  68. package/dist/client/assets/{page-DIUi9KSN.js → page-DmmG4y1n.js} +1 -1
  69. package/dist/client/assets/{popover-Un-VhPfR.js → popover-PTQF8Dbg.js} +1 -1
  70. package/dist/client/assets/prism-light-0RxCg8xt.js +1 -0
  71. package/dist/client/assets/{resizable-Dnzm7-QR.js → resizable-BF9gWgPg.js} +45 -47
  72. package/dist/client/assets/{resource-tabs-BYy3Anud.js → resource-tabs-Dx5v9tHv.js} +1 -1
  73. package/dist/client/assets/{select-7BtgByyw.js → select-C4QWjnSz.js} +1 -1
  74. package/dist/client/assets/{settings-rADjIbaj.js → settings-UndPSfwX.js} +1 -1
  75. package/dist/client/assets/{shell-layout-CvvtwN5U.js → shell-layout-BLjMALRt.js} +1 -1
  76. package/dist/client/assets/{spinner-DveBEBL5.js → spinner-CNb2mD_9.js} +1 -1
  77. package/dist/client/assets/{store-BiC_Wlh-.js → store-CGyOcqhE.js} +1 -1
  78. package/dist/client/assets/{store-app-detail-D_pvzf3Y.js → store-app-detail-BQ4UUaoG.js} +1 -1
  79. package/dist/client/assets/{switch-Bbk1L7Rg.js → switch-BmVnuO_C.js} +1 -1
  80. package/dist/client/assets/{tools-list-CUD0lf51.js → tools-list-BV-qlQqF.js} +1 -1
  81. package/dist/client/assets/{tooltip-CZ2WJBN2.js → tooltip-CqCXb38Z.js} +1 -1
  82. package/dist/client/assets/{types-BqGYxJd7.js → types-Bm46njUN.js} +1 -1
  83. package/dist/client/assets/use-binding-DdwsXkNS.js +34 -0
  84. package/dist/client/assets/{use-connection-B9lcLaJ5.js → use-connection-BbvAiBvg.js} +1 -1
  85. package/dist/client/assets/{use-connection-resources-DixC-5o3.js → use-connection-resources-D-1-SK-8.js} +1 -1
  86. package/dist/client/assets/{use-gateway-t9P_FOn3.js → use-gateway-L1UQyU7-.js} +1 -1
  87. package/dist/client/assets/{use-list-state-BYLR5Bm8.js → use-list-state-DVYCFUpb.js} +1 -1
  88. package/dist/client/assets/{use-mcp-Bi_aHqdL.js → use-mcp-CWOlOW9q.js} +1 -1
  89. package/dist/client/assets/{use-members-DaneJZgJ.js → use-members-Dyh_-7GU.js} +1 -1
  90. package/dist/client/assets/{use-mobile-_A8zw_eW.js → use-mobile-B0xRFGhT.js} +1 -1
  91. package/dist/client/assets/{use-organization-settings-DsAkGjtI.js → use-organization-settings-fWTyw7VB.js} +1 -1
  92. package/dist/client/assets/{use-tool-call-DdkMQUZF.js → use-tool-call-CVPTtLoG.js} +1 -1
  93. package/dist/client/assets/useQuery-C4GPpw7d.js +1 -0
  94. package/dist/client/assets/utils-o1atviYh.js +1 -0
  95. package/dist/client/assets/{view-mode-toggle-DHnvkOqv.js → view-mode-toggle-DOtHoBLN.js} +1 -1
  96. package/dist/client/assets/{well-known-mcp-C4yFJOry.js → well-known-mcp-d1wcdFCF.js} +1 -1
  97. package/dist/client/index.html +1 -1
  98. package/dist/server/cli.js +188 -216
  99. package/dist/server/migrate.js +141 -168
  100. package/dist/server/server.js +185 -213
  101. package/package.json +3 -4
  102. package/dist/client/assets/auth-PBZStuMm.js +0 -26
  103. package/dist/client/assets/env-vars-editor-Clod5sfm.js +0 -1
  104. package/dist/client/assets/extract-connection-data-CbrawrDX.js +0 -1
  105. package/dist/client/assets/index-Cvm_GyUI.js +0 -118
  106. package/dist/client/assets/json-CcI2X6AJ.js +0 -1
  107. package/dist/client/assets/mcp-oauth-DQCyGoJw.js +0 -1
  108. package/dist/client/assets/prism-light-DUBQ6Lm-.js +0 -1
  109. package/dist/client/assets/use-binding-B349nAGS.js +0 -38
  110. package/dist/client/assets/useQuery-DhoA2M5z.js +0 -1
  111. package/dist/client/assets/utils-CYeWJWkG.js +0 -1
@@ -1,10 +1,10 @@
1
- import{aw as Tt,r as N,c as L,d as Mn,j as p,av as Fi,w as op,x as Gc,s as ip,v as wo,h as lp,b as ap,t as li,E as Y,M as cp,ax as So,ay as Yc,al as up,ak as dp,az as fp,F as Vi,a5 as Xc,a8 as hp,z as On,B as ze,a2 as Hi,a9 as pp,y as Fs,a6 as mp,a1 as Wi,af as gp,ag as yp,ah as xp,aA as qi,aB as bp,a7 as Qc,a4 as vp,aC as kp,J as wp,aD as Sp,aE as Cp}from"./index-Cvm_GyUI.js";import{U as Ke,f as Ui,d as Ki,c as Mt,b as Ji,I as Vs,u as Np,n as Ep}from"./use-connection-B9lcLaJ5.js";import{d as Tp,C as an,e as Mp,I as Op,l as ta,G as Zc,M as Ap,m as Ip,R as na,k as jp}from"./resizable-Dnzm7-QR.js";import{E as Hs,i as Rp}from"./SearchMd-9OvHwtrD.js";import{E as nr}from"./error-boundary-BvHIgIeG.js";import{u as Dp,L as Pp}from"./localstorage-keys-CcQMsGvY.js";import{u as Lp,a as eu,c as tu,b as nu,T as ru,i as Gi}from"./tooltip-CZ2WJBN2.js";import{B as ie}from"./button-C6Q9i6bB.js";import{F as nt,a as su,b as Ot,c as mr,d as An}from"./form-eTDr0W4q.js";import{I as In}from"./input-CRJkMCdz.js";import{T as Ur,D as $p,a as _p,b as zp,f as Bp,c as Fp,d as Vp}from"./dialog-wqLP6s8y.js";import{c as G}from"./utils-CYeWJWkG.js";import{A as Hp,D as Wp,u as qp}from"./use-binding-B349nAGS.js";import{i as Ct}from"./Loading01-CCRghFAi.js";import{s as Yi}from"./Plus-Bu89Xdvq.js";import{i as Up}from"./Upload01-p9mtwUJO.js";import{V as Xi,b as Kr,a as ou}from"./layout-6uTC86JS.js";import{i as Kp}from"./AlertCircle-BOdIbqIs.js";import{s as Jp}from"./Clock-B2GhwaAI.js";import{a as Gp}from"./Copy01-CNQxqLRw.js";import{i as Qi,J as Yp}from"./json-syntax-highlighter-B03842aR.js";import{s as Zi,i as iu}from"./XClose-Bg1dQbEQ.js";import{u as Xp,O as Qp,M as Zp,P as em,F as tm,v as nm,E as rm}from"./index-CZLUv0P3.js";import{u as el}from"./use-mcp-Bi_aHqdL.js";import{S as Yt}from"./spinner-DveBEBL5.js";import{a as lu,b as sm}from"./use-tool-call-DdkMQUZF.js";import{V as om}from"./view-mode-toggle-DHnvkOqv.js";import{i as im}from"./ArrowLeft--mrEcY9t.js";import{i as lm}from"./GitBranch01-GzTSxN9T.js";import"./index-CZhZ_SKX.js";import{n as am}from"./Calendar-FEvoSB5L.js";import{b as cm,D as um,a as dm,d as ra,i as fm}from"./dropdown-menu-Cf1-ucSW.js";import{B as cn}from"./badge-C0Qf1_P5.js";import{i as au}from"./X-CPWcGQX-.js";import"./CpuChip02-BiTasWbD.js";import"./select-7BtgByyw.js";import"./ChevronDown-BQbWxkfW.js";import"./use-mobile-_A8zw_eW.js";import"./use-gateway-t9P_FOn3.js";import"./Terminal-CS-oYY6X.js";import"./connection-card-CVvPIgot.js";import"./card-CkqxLUmD.js";import"./LinkExternal01-NfJeAPv5.js";import"./File06-CginPRn9.js";import"./InfoCircle-D8mTtKdA.js";import"./auth-PBZStuMm.js";import"./useQuery-DhoA2M5z.js";import"./mcp-oauth-DQCyGoJw.js";import"./use-organization-settings-DsAkGjtI.js";import"./env-vars-editor-Clod5sfm.js";import"./Trash01-D6Jd-C-A.js";import"./Key01-e6YzBDTD.js";import"./formatDistanceToNow-BxzU2by2.js";import"./extract-connection-data-CbrawrDX.js";import"./registry-utils-ulDDT0d8.js";import"./generate-id-Dyweu44Y.js";import"./index-BWHtrgim.js";const cu=Tt("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const uu=Tt("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const hm=Tt("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const pm=Tt("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const du=Tt("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const fu=Tt("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const hu=Tt("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const pu=Tt("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]),tl=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"M12 8v4m0 4h.01M2 8.523v6.954c0 .245 0 .367.028.482a1 1 0 0 0 .12.29c.061.1.148.187.32.36l4.923 4.922c.173.173.26.26.36.322.09.054.188.095.29.12.115.027.237.027.482.027h6.954c.245 0 .367 0 .482-.028a.998.998 0 0 0 .29-.12c.1-.061.187-.148.36-.32l4.922-4.923c.173-.173.26-.26.322-.36a.998.998 0 0 0 .12-.29c.027-.115.027-.237.027-.482V8.523c0-.245 0-.367-.028-.482a.998.998 0 0 0-.12-.29c-.061-.1-.148-.187-.32-.36L16.608 2.47c-.173-.173-.26-.26-.36-.322a1 1 0 0 0-.29-.12C15.844 2 15.722 2 15.477 2H8.523c-.245 0-.367 0-.482.028a1 1 0 0 0-.29.12c-.1.061-.187.148-.36.32L2.47 7.392c-.173.173-.26.26-.322.36a1 1 0 0 0-.12.29C2 8.156 2 8.278 2 8.523Z"}));tl.displayName="AlertOctagon";const mu=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"M20.5 8v8.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.22 21 17.38 21 15.7 21H8.3c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3.5 18.72 3.5 17.88 3.5 16.2V8m.1-5h16.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C22 3.76 22 4.04 22 4.6v1.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C21.24 8 20.96 8 20.4 8H3.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C2 7.24 2 6.96 2 6.4V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C2.76 3 3.04 3 3.6 3Zm6 8.5h4.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C16 12.26 16 12.54 16 13.1v.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437c-.214.109-.494.109-1.054.109H9.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C8 14.74 8 14.46 8 13.9v-.8c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C8.76 11.5 9.04 11.5 9.6 11.5Z"}));mu.displayName="Box";const gu=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"m22.7 11.5-2 2-2-2m2.245 1.5A9 9 0 1 0 19 17.657M12 7v5l3 2"}));gu.displayName="ClockFastForward";const yu=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"m16 18 6-6-6-6M8 6l-6 6 6 6"}));yu.displayName="Code01";const xu=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"m17 17 5-5-5-5M7 7l-5 5 5 5m7-14-4 18"}));xu.displayName="Code02";const bu=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"M12 17a5 5 0 1 0 10 0 5 5 0 0 0-10 0Zm0 0c0-1.126.372-2.165 1-3V5m-1 12c0 .825.2 1.604.554 2.29-.842.712-2.788 1.21-5.054 1.21-3.038 0-5.5-.895-5.5-2V5m11 0c0 1.105-2.462 2-5.5 2S2 6.105 2 5m11 0c0-1.105-2.462-2-5.5-2S2 3.895 2 5m0 9c0 1.105 2.462 2 5.5 2 2.189 0 4.08-.465 4.965-1.138M13 9.5c0 1.105-2.462 2-5.5 2S2 10.605 2 9.5"}));bu.displayName="CoinsStacked01";const zr=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"M6.8 3h-.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C3 4.52 3 5.08 3 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21h.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C10 19.48 10 18.92 10 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C8.48 3 7.92 3 6.8 3Zm11 0h-.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C14 4.52 14 5.08 14 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C15.52 21 16.08 21 17.2 21h.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C19.48 3 18.92 3 17.8 3Z"}));zr.displayName="Columns01";const vu=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"M4 4v1.4c0 3.36 0 5.04.654 6.324a6 6 0 0 0 2.622 2.622C8.56 15 10.24 15 13.6 15H20m0 0-5-5m5 5-5 5"}));vu.displayName="CornerDownRight";const ku=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"M21 5c0 1.657-4.03 3-9 3S3 6.657 3 5m18 0c0-1.657-4.03-3-9-3S3 3.343 3 5m18 0v14c0 1.66-4 3-9 3s-9-1.34-9-3V5m18 7c0 1.66-4 3-9 3s-9-1.34-9-3"}));ku.displayName="Database01";const wu=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"M11 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 6.28 2 7.12 2 8.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 22 5.12 22 6.8 22h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C20 19.72 20 18.88 20 17.2V13M8 16h1.675c.489 0 .733 0 .963-.055.204-.05.4-.13.579-.24.201-.123.374-.296.72-.642L21.5 5.5a2.121 2.121 0 0 0-3-3l-9.563 9.563c-.346.346-.519.519-.642.72a2 2 0 0 0-.24.579c-.055.23-.055.474-.055.963V16Z"}));wu.displayName="Edit05";const Su=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"M3 9h13.5a4.5 4.5 0 1 1 0 9H12M3 9l4-4M3 9l4 4"}));Su.displayName="FlipBackward";const Cu=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"m13 22-3-3m0 0 3-3m-3 3h5a7 7 0 0 0 3-13.326M6 18.326A7 7 0 0 1 9 5h5m0 0-3-3m3 3-3 3"}));Cu.displayName="Repeat03";const Nu=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"M15 8H8.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C7 7.24 7 6.96 7 6.4V3m10 18v-6.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C16.24 13 15.96 13 15.4 13H8.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C7 13.76 7 14.04 7 14.6V21M21 9.325V16.2c0 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.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h6.875c.489 0 .733 0 .963.055.204.05.4.13.579.24.201.123.374.296.72.642l3.126 3.126c.346.346.519.519.642.72.11.18.19.374.24.579.055.23.055.474.055.963Z"}));Nu.displayName="Save02";const Eu=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"M15.631 7.631c-.396-.396-.594-.594-.668-.822a1 1 0 0 1 0-.618c.074-.228.272-.426.668-.822L18.47 2.53a6 6 0 0 0-8.3 6.895c.12.49.179.734.168.888a.849.849 0 0 1-.11.392c-.07.138-.207.274-.48.547L3.5 17.5a2.121 2.121 0 0 0 3 3l6.248-6.248c.273-.273.41-.41.547-.48a.849.849 0 0 1 .392-.11c.154-.011.399.049.888.168a6 6 0 0 0 6.895-8.3l-2.84 2.84c-.396.396-.594.594-.822.668a1 1 0 0 1-.618 0c-.228-.074-.426-.272-.822-.668l-.738-.738Z"}));Eu.displayName="Tool01";const Ws=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"M16 3.468a4.5 4.5 0 0 1 0 8.064m2 5.234c1.512.684 2.872 1.799 4 3.234M2 20c1.946-2.477 4.59-4 7.5-4s5.553 1.523 7.5 4M14 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));Ws.displayName="Users02";const{getOwnPropertyNames:mm,getOwnPropertySymbols:gm}=Object,{hasOwnProperty:ym}=Object.prototype;function Co(n,e){return function(r,s,o){return n(r,s,o)&&e(r,s,o)}}function Cr(n){return function(t,r,s){if(!t||!r||typeof t!="object"||typeof r!="object")return n(t,r,s);const{cache:o}=s,i=o.get(t),l=o.get(r);if(i&&l)return i===r&&l===t;o.set(t,r),o.set(r,t);const a=n(t,r,s);return o.delete(t),o.delete(r),a}}function xm(n){return n?.[Symbol.toStringTag]}function sa(n){return mm(n).concat(gm(n))}const bm=Object.hasOwn||((n,e)=>ym.call(n,e));function Xt(n,e){return n===e||!n&&!e&&n!==n&&e!==e}const vm="__v",km="__o",wm="_owner",{getOwnPropertyDescriptor:oa,keys:ia}=Object;function Sm(n,e){return n.byteLength===e.byteLength&&Jr(new Uint8Array(n),new Uint8Array(e))}function Cm(n,e,t){let r=n.length;if(e.length!==r)return!1;for(;r-- >0;)if(!t.equals(n[r],e[r],r,r,n,e,t))return!1;return!0}function Nm(n,e){return n.byteLength===e.byteLength&&Jr(new Uint8Array(n.buffer,n.byteOffset,n.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function Em(n,e){return Xt(n.getTime(),e.getTime())}function Tm(n,e){return n.name===e.name&&n.message===e.message&&n.cause===e.cause&&n.stack===e.stack}function Mm(n,e){return n===e}function la(n,e,t){const r=n.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),o=n.entries();let i,l,a=0;for(;(i=o.next())&&!i.done;){const c=e.entries();let u=!1,d=0;for(;(l=c.next())&&!l.done;){if(s[d]){d++;continue}const f=i.value,h=l.value;if(t.equals(f[0],h[0],a,d,n,e,t)&&t.equals(f[1],h[1],f[0],h[0],n,e,t)){u=s[d]=!0;break}d++}if(!u)return!1;a++}return!0}const Om=Xt;function Am(n,e,t){const r=ia(n);let s=r.length;if(ia(e).length!==s)return!1;for(;s-- >0;)if(!Tu(n,e,t,r[s]))return!1;return!0}function $n(n,e,t){const r=sa(n);let s=r.length;if(sa(e).length!==s)return!1;let o,i,l;for(;s-- >0;)if(o=r[s],!Tu(n,e,t,o)||(i=oa(n,o),l=oa(e,o),(i||l)&&(!i||!l||i.configurable!==l.configurable||i.enumerable!==l.enumerable||i.writable!==l.writable)))return!1;return!0}function Im(n,e){return Xt(n.valueOf(),e.valueOf())}function jm(n,e){return n.source===e.source&&n.flags===e.flags}function aa(n,e,t){const r=n.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),o=n.values();let i,l;for(;(i=o.next())&&!i.done;){const a=e.values();let c=!1,u=0;for(;(l=a.next())&&!l.done;){if(!s[u]&&t.equals(i.value,l.value,i.value,l.value,n,e,t)){c=s[u]=!0;break}u++}if(!c)return!1}return!0}function Jr(n,e){let t=n.byteLength;if(e.byteLength!==t||n.byteOffset!==e.byteOffset)return!1;for(;t-- >0;)if(n[t]!==e[t])return!1;return!0}function Rm(n,e){return n.hostname===e.hostname&&n.pathname===e.pathname&&n.protocol===e.protocol&&n.port===e.port&&n.hash===e.hash&&n.username===e.username&&n.password===e.password}function Tu(n,e,t,r){return(r===wm||r===km||r===vm)&&(n.$$typeof||e.$$typeof)?!0:bm(e,r)&&t.equals(n[r],e[r],r,r,n,e,t)}const Dm="[object ArrayBuffer]",Pm="[object Arguments]",Lm="[object Boolean]",$m="[object DataView]",_m="[object Date]",zm="[object Error]",Bm="[object Map]",Fm="[object Number]",Vm="[object Object]",Hm="[object RegExp]",Wm="[object Set]",qm="[object String]",Um={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},Km="[object URL]",Jm=Object.prototype.toString;function Gm({areArrayBuffersEqual:n,areArraysEqual:e,areDataViewsEqual:t,areDatesEqual:r,areErrorsEqual:s,areFunctionsEqual:o,areMapsEqual:i,areNumbersEqual:l,areObjectsEqual:a,arePrimitiveWrappersEqual:c,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:h,unknownTagComparators:m}){return function(y,x,b){if(y===x)return!0;if(y==null||x==null)return!1;const k=typeof y;if(k!==typeof x)return!1;if(k!=="object")return k==="number"?l(y,x,b):k==="function"?o(y,x,b):!1;const C=y.constructor;if(C!==x.constructor)return!1;if(C===Object)return a(y,x,b);if(Array.isArray(y))return e(y,x,b);if(C===Date)return r(y,x,b);if(C===RegExp)return u(y,x,b);if(C===Map)return i(y,x,b);if(C===Set)return d(y,x,b);const v=Jm.call(y);if(v===_m)return r(y,x,b);if(v===Hm)return u(y,x,b);if(v===Bm)return i(y,x,b);if(v===Wm)return d(y,x,b);if(v===Vm)return typeof y.then!="function"&&typeof x.then!="function"&&a(y,x,b);if(v===Km)return h(y,x,b);if(v===zm)return s(y,x,b);if(v===Pm)return a(y,x,b);if(Um[v])return f(y,x,b);if(v===Dm)return n(y,x,b);if(v===$m)return t(y,x,b);if(v===Lm||v===Fm||v===qm)return c(y,x,b);if(m){let w=m[v];if(!w){const S=xm(y);S&&(w=m[S])}if(w)return w(y,x,b)}return!1}}function Ym({circular:n,createCustomConfig:e,strict:t}){let r={areArrayBuffersEqual:Sm,areArraysEqual:t?$n:Cm,areDataViewsEqual:Nm,areDatesEqual:Em,areErrorsEqual:Tm,areFunctionsEqual:Mm,areMapsEqual:t?Co(la,$n):la,areNumbersEqual:Om,areObjectsEqual:t?$n:Am,arePrimitiveWrappersEqual:Im,areRegExpsEqual:jm,areSetsEqual:t?Co(aa,$n):aa,areTypedArraysEqual:t?Co(Jr,$n):Jr,areUrlsEqual:Rm,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),n){const s=Cr(r.areArraysEqual),o=Cr(r.areMapsEqual),i=Cr(r.areObjectsEqual),l=Cr(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:s,areMapsEqual:o,areObjectsEqual:i,areSetsEqual:l})}return r}function Xm(n){return function(e,t,r,s,o,i,l){return n(e,t,l)}}function Qm({circular:n,comparator:e,createState:t,equals:r,strict:s}){if(t)return function(l,a){const{cache:c=n?new WeakMap:void 0,meta:u}=t();return e(l,a,{cache:c,equals:r,meta:u,strict:s})};if(n)return function(l,a){return e(l,a,{cache:new WeakMap,equals:r,meta:void 0,strict:s})};const o={cache:void 0,equals:r,meta:void 0,strict:s};return function(l,a){return e(l,a,o)}}const Zm=At();At({strict:!0});At({circular:!0});At({circular:!0,strict:!0});At({createInternalComparator:()=>Xt});At({strict:!0,createInternalComparator:()=>Xt});At({circular:!0,createInternalComparator:()=>Xt});At({circular:!0,createInternalComparator:()=>Xt,strict:!0});function At(n={}){const{circular:e=!1,createInternalComparator:t,createState:r,strict:s=!1}=n,o=Ym(n),i=Gm(o),l=t?t(i):Xm(i);return Qm({circular:e,comparator:i,createState:r,equals:l,strict:s})}function eg(n){const e=L.c(3),{gatewayId:t,onSelect:r}=n,{data:s}=Mp(t);if(s.length===0)return null;let o;return e[0]!==r||e[1]!==s?(o=p.jsx(Op,{prompts:s,onSelect:r,className:"mt-6"}),e[0]=r,e[1]=s,e[2]=o):o=e[2],o}function tg(n){const e=L.c(20),{form:t}=n;let r;e[0]!==t?(r=d=>{const{field:f}=d;return p.jsx(cg,{size:"md",value:f.value,onChange:f.onChange,alt:t.watch("title")})},e[0]=t,e[1]=r):r=e[1];let s;e[2]!==t.control||e[3]!==r?(s=p.jsx(nt,{control:t.control,name:"avatar",render:r}),e[2]=t.control,e[3]=r,e[4]=s):s=e[4];let o;e[5]!==t.control?(o=p.jsxs("div",{className:"flex flex-col gap-3 flex-1 min-w-0",children:[p.jsx(nt,{control:t.control,name:"title",render:ig}),p.jsx(nt,{control:t.control,name:"description",render:og})]}),e[5]=t.control,e[6]=o):o=e[6];let i;e[7]!==s||e[8]!==o?(i=p.jsxs("div",{className:"flex gap-4 items-start",children:[s,o]}),e[7]=s,e[8]=o,e[9]=i):i=e[9];let l,a;e[10]!==t.control?(l=p.jsxs("div",{className:"flex gap-4",children:[p.jsx(nt,{control:t.control,name:"gateway_id",render:sg}),p.jsx(nt,{control:t.control,name:"model",render:rg})]}),a=p.jsx(nt,{control:t.control,name:"system_prompt",render:ng}),e[10]=t.control,e[11]=l,e[12]=a):(l=e[11],a=e[12]);let c;e[13]!==i||e[14]!==l||e[15]!==a?(c=p.jsxs("div",{className:"h-full py-6 flex flex-col max-w-2xl mx-auto w-full min-w-0 gap-6 overflow-y-auto",children:[i,l,a]}),e[13]=i,e[14]=l,e[15]=a,e[16]=c):c=e[16];let u;return e[17]!==t||e[18]!==c?(u=p.jsx(su,{...t,children:c}),e[17]=t,e[18]=c,e[19]=u):u=e[19],u}function ng(n){const{field:e}=n;return p.jsxs(Ot,{className:"flex-1 flex flex-col min-h-0",children:[p.jsx(mr,{className:"text-xs text-muted-foreground",children:"System prompt"}),p.jsx(An,{children:p.jsx(Ur,{...e,placeholder:"You are a helpful assistant...",className:"flex-1 min-h-[200px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})]})}function rg(n){const{field:e}=n;return p.jsxs(Ot,{className:"flex-1",children:[p.jsx(mr,{className:"text-xs text-muted-foreground",children:"Model"}),p.jsx(Ap,{selectedModel:e.value?{id:e.value.id,connectionId:e.value.connectionId}:void 0,onModelChange:t=>e.onChange({id:t.id,connectionId:t.connectionId}),placeholder:"Select model",variant:"bordered",className:"w-full"})]})}function sg(n){const{field:e}=n;return p.jsxs(Ot,{className:"flex-1",children:[p.jsx(mr,{className:"text-xs text-muted-foreground",children:"Gateway"}),p.jsx(Zc,{selectedGatewayId:e.value,onGatewayChange:e.onChange,placeholder:"Select gateway",variant:"bordered",className:"w-full"})]})}function og(n){const{field:e}=n;return p.jsxs(Ot,{children:[p.jsx(mr,{className:"text-xs text-muted-foreground",children:"Description"}),p.jsx(An,{children:p.jsx(In,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function ig(n){const{field:e}=n;return p.jsxs(Ot,{children:[p.jsx(mr,{className:"text-xs text-muted-foreground",children:"Name"}),p.jsx(An,{children:p.jsx(In,{...e,placeholder:"Untitled assistant",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function lg(n){const e=L.c(62),{activeThreadId:t,mode:r,assistant:s,form:o}=n;let i;e[0]!==t||e[1]!==s.system_prompt?(i={threadId:t,systemPrompt:s.system_prompt},e[0]=t,e[1]=s.system_prompt,e[2]=i):i=e[2];const l=Tp(i),a=!!s.gateway_id&&!!s.model?.id&&!!s.model?.connectionId;let c;e[3]!==t||e[4]!==s.gateway_id||e[5]!==s.model||e[6]!==l||e[7]!==a?(c=async H=>{if(!a)return;const X={created_at:new Date().toISOString(),thread_id:t,model:{id:s.model.id,connectionId:s.model.connectionId},gateway:{id:s.gateway_id??""},user:{name:"you"}};await l.sendMessage(H,X)},e[3]=t,e[4]=s.gateway_id,e[5]=s.model,e[6]=l,e[7]=a,e[8]=c):c=e[8];const u=c;let d;e[9]!==s.avatar||e[10]!==s.title?(d=s.avatar?p.jsx("div",{className:"size-[60px] rounded-[18px] border border-border shrink-0 overflow-hidden",children:p.jsx("img",{src:s.avatar,alt:s.title,className:"h-full w-full object-cover"})}):p.jsx("div",{className:"size-[60px] rounded-[18px] border border-border shrink-0 overflow-hidden bg-muted/20 flex items-center justify-center",children:p.jsx(Ws,{size:28,className:"text-muted-foreground"})}),e[9]=s.avatar,e[10]=s.title,e[11]=d):d=e[11];let f;e[12]!==s.title?(f=p.jsx("h3",{className:"text-xl font-medium text-foreground",children:s.title}),e[12]=s.title,e[13]=f):f=e[13];let h;e[14]!==s.description?(h=s.description?p.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:s.description}):null,e[14]=s.description,e[15]=h):h=e[15];let m;e[16]!==d||e[17]!==f||e[18]!==h?(m=p.jsxs("div",{className:"flex flex-col items-center gap-4",children:[d,f,h]}),e[16]=d,e[17]=f,e[18]=h,e[19]=m):m=e[19];let g;e[20]!==s.gateway_id||e[21]!==u?(g=s.gateway_id&&p.jsx(nr,{fallback:null,children:p.jsx(N.Suspense,{fallback:p.jsx("div",{className:"flex justify-center mt-6",children:p.jsx(Ct,{size:20,className:"animate-spin text-muted-foreground"})}),children:p.jsx(eg,{gatewayId:s.gateway_id,onSelect:H=>{u(H.description??H.name)}})})}),e[20]=s.gateway_id,e[21]=u,e[22]=g):g=e[22];let y;e[23]!==m||e[24]!==g?(y=p.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-4 text-center",children:[m,g]}),e[23]=m,e[24]=g,e[25]=y):y=e[25];const x=y;let b;e[26]!==l.messages?(b=l.messages.filter(ag),e[26]=l.messages,e[27]=b):b=e[27];const k=b,C=r==="edit",v=C?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none";let w;e[28]!==v?(w=G("absolute inset-0 px-2 transition-opacity duration-200 ease-out",v),e[28]=v,e[29]=w):w=e[29];let S;e[30]!==o?(S=p.jsx(tg,{form:o}),e[30]=o,e[31]=S):S=e[31];let E;e[32]!==w||e[33]!==S?(E=p.jsx("div",{className:w,children:S}),e[32]=w,e[33]=S,e[34]=E):E=e[34];const M=C?"opacity-0 pointer-events-none":"opacity-100";let T;e[35]!==M?(T=G("h-full transition-opacity duration-200 ease-out",M),e[35]=M,e[36]=T):T=e[36];let R;e[37]!==l.messages||e[38]!==l.status||e[39]!==x||e[40]!==k.length?(R=k.length===0?p.jsx(an.EmptyState,{children:x}):p.jsx(an.Messages,{messages:l.messages,status:l.status,minHeightOffset:240}),e[37]=l.messages,e[38]=l.status,e[39]=x,e[40]=k.length,e[41]=R):R=e[41];let P;e[42]!==T||e[43]!==R?(P=p.jsx("div",{className:T,children:R}),e[42]=T,e[43]=R,e[44]=P):P=e[44];let _;e[45]!==E||e[46]!==P?(_=p.jsxs(an.Main,{className:"h-full relative overflow-hidden",children:[E,P]}),e[45]=E,e[46]=P,e[47]=_):_=e[47];const I=C?"translate-y-full":"translate-y-0";let O;e[48]!==I?(O=G("transition-transform duration-300 ease-out",I),e[48]=I,e[49]=O):O=e[49];const D=!a,z=l.status==="submitted"||l.status==="streaming";let U;e[50]!==l.messages||e[51]!==l.stop||e[52]!==u||e[53]!==D||e[54]!==z?(U=p.jsx(an.Footer,{children:p.jsx("div",{className:"max-w-2xl mx-auto w-full min-w-0",children:p.jsx(an.Input,{onSubmit:u,onStop:l.stop,disabled:D,isStreaming:z,placeholder:"Ask anything or @ for context",usageMessages:l.messages})})}),e[50]=l.messages,e[51]=l.stop,e[52]=u,e[53]=D,e[54]=z,e[55]=U):U=e[55];let J;e[56]!==O||e[57]!==U?(J=p.jsx("div",{className:O,children:U}),e[56]=O,e[57]=U,e[58]=J):J=e[58];let K;return e[59]!==_||e[60]!==J?(K=p.jsxs(an,{children:[_,J]}),e[59]=_,e[60]=J,e[61]=K):K=e[61],K}function ag(n){return n.role!=="system"}function cg(n){const e=L.c(18),{value:t,onChange:r,alt:s,size:o}=n,i=o===void 0?"md":o,l=N.useRef(null),a=i==="xs"?"h-6 w-6":i==="sm"?"h-8 w-8":"h-16 w-16",c=i==="xs"?"h-3 w-3":i==="sm"?"h-4 w-4":"h-6 w-6",u=i==="xs"?"h-3 w-3":i==="sm"?"h-3.5 w-3.5":"h-5 w-5";let d;e[0]!==r?(d=w=>{const S=w.target.files?.[0];if(!S)return;const E=new FileReader;E.onloadend=()=>{const M=E.result;r(M)},E.readAsDataURL(S)},e[0]=r,e[1]=d):d=e[1];const f=d;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{l.current?.click()},e[2]=h):h=e[2];const m=h,g=`relative ${a} shrink-0 cursor-pointer group`;let y;e[3]!==f?(y=p.jsx("input",{type:"file",ref:l,className:"hidden",accept:"image/*",onChange:f}),e[3]=f,e[4]=y):y=e[4];let x;e[5]!==s||e[6]!==c||e[7]!==t?(x=t?p.jsx("img",{src:t,alt:s||"Avatar",className:"w-full h-full object-cover"}):p.jsx("div",{className:"w-full h-full flex items-center justify-center text-muted-foreground",children:p.jsx(Ws,{className:c})}),e[5]=s,e[6]=c,e[7]=t,e[8]=x):x=e[8];const b=`${u} text-white`;let k;e[9]!==b?(k=p.jsx("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center rounded-xl",children:p.jsx(Up,{className:b})}),e[9]=b,e[10]=k):k=e[10];let C;e[11]!==x||e[12]!==k?(C=p.jsxs("div",{className:"h-full w-full rounded-xl border border-border bg-muted/20 overflow-hidden relative",children:[x,k]}),e[11]=x,e[12]=k,e[13]=C):C=e[13];let v;return e[14]!==g||e[15]!==y||e[16]!==C?(v=p.jsxs("div",{className:g,onClick:m,children:[y,C]}),e[14]=g,e[15]=y,e[16]=C,e[17]=v):v=e[17],v}function ug(n){const e=L.c(49),{providerId:t,assistantId:r,onBack:s}=n,o=Fi();let i;e[0]!==s||e[1]!==o?(i=s??(()=>o.history.back()),e[0]=s,e[1]=o,e[2]=i):i=e[2];const l=i,{locator:a}=Lp();let c;e[3]!==r||e[4]!==a?(c=Pp.assistantChatActiveThread(a,r),e[3]=r,e[4]=a,e[5]=c):c=e[5];const[u,d]=Dp(c,dg),f=t||Ke;let h;e[6]!==f?(h=Mt(f),e[6]=f,e[7]=h):h=e[7];const m=h,g=Ui(t,"ASSISTANT",r,m),y=Ki(t,"ASSISTANT",m),x=y.update.isPending,[b,k]=N.useState(g?.model.id&&g?.gateway_id?"chat":"edit");let C;e[8]===Symbol.for("react.memo_cache_sentinel")?(C=op(Hp),e[8]=C):C=e[8];const v=g??void 0;let w;e[9]!==v?(w={resolver:C,values:v},e[9]=v,e[10]=w):w=e[10];const S=Gc(w);let E;e[11]!==y.update||e[12]!==r||e[13]!==S?(E=S.handleSubmit(async J=>{const K=await y.update.mutateAsync({id:r,data:J});S.reset(K),k("chat")}),e[11]=y.update,e[12]=r,e[13]=S,e[14]=E):E=e[14];const M=E;if(!g){let J;e[15]===Symbol.for("react.memo_cache_sentinel")?(J=p.jsx(ta,{}),e[15]=J):J=e[15];let K;e[16]===Symbol.for("react.memo_cache_sentinel")?(K=p.jsx("div",{className:"flex h-full w-full bg-background",children:p.jsx(Hs,{title:"Assistant not found",description:"This assistant may have been deleted or you may not have access to it."})}),e[16]=K):K=e[16];let H;return e[17]!==l?(H=p.jsx(nr,{children:p.jsx(N.Suspense,{fallback:J,children:p.jsx(Kr,{onBack:l,children:K})})}),e[17]=l,e[18]=H):H=e[18],H}let T;e[19]===Symbol.for("react.memo_cache_sentinel")?(T=p.jsx(ta,{}),e[19]=T):T=e[19];let R;e[20]!==g.avatar||e[21]!==g.title?(R=p.jsx("div",{className:"h-6 w-6 min-w-6 rounded-lg border border-border bg-muted/20 overflow-hidden shrink-0",children:g.avatar?p.jsx("img",{src:g.avatar,alt:g.title,className:"h-full w-full object-cover"}):p.jsx("div",{className:"h-full w-full flex items-center justify-center text-muted-foreground",children:p.jsx(Ws,{size:12,className:"text-muted-foreground"})})}),e[20]=g.avatar,e[21]=g.title,e[22]=R):R=e[22];let P;e[23]!==g.title?(P=p.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:g.title}),e[23]=g.title,e[24]=P):P=e[24];let _;e[25]!==g.description?(_=g.description?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),p.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:g.description})]}):null,e[25]=g.description,e[26]=_):_=e[26];let I;e[27]!==P||e[28]!==_?(I=p.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[P,_]}),e[27]=P,e[28]=_,e[29]=I):I=e[29];let O;e[30]!==R||e[31]!==I?(O=p.jsx(ou,{children:p.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[R,I]})}),e[30]=R,e[31]=I,e[32]=O):O=e[32];let D;e[33]!==S.formState.isDirty||e[34]!==x||e[35]!==b||e[36]!==M||e[37]!==d?(D=p.jsx(Xi,{children:b==="chat"?p.jsxs(p.Fragment,{children:[p.jsx("button",{type:"button",onClick:()=>d(crypto.randomUUID()),title:"New thread",className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",children:p.jsx(Yi,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})}),p.jsx("button",{type:"button",onClick:()=>k("edit"),title:"Edit",className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",children:p.jsx(wu,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})})]}):p.jsxs(p.Fragment,{children:[p.jsx(ie,{variant:"ghost",size:"sm",className:"h-7 gap-1.5",disabled:x,onClick:()=>k("chat"),children:"Cancel"}),p.jsx(ie,{variant:"default",size:"sm",className:"h-7 gap-1.5",disabled:!S.formState.isDirty||x,onClick:()=>{M()},children:x?p.jsxs(p.Fragment,{children:[p.jsx(Ct,{size:14,className:"animate-spin"}),"Saving..."]}):"Save"})]})}),e[33]=S.formState.isDirty,e[34]=x,e[35]=b,e[36]=M,e[37]=d,e[38]=D):D=e[38];let z;e[39]!==u||e[40]!==g||e[41]!==S||e[42]!==b?(z=p.jsx("div",{className:"h-full",children:p.jsx(lg,{activeThreadId:u,mode:b,assistant:g,form:S},S.formState.submitCount)}),e[39]=u,e[40]=g,e[41]=S,e[42]=b,e[43]=z):z=e[43];let U;return e[44]!==l||e[45]!==O||e[46]!==D||e[47]!==z?(U=p.jsx(nr,{children:p.jsx(N.Suspense,{fallback:T,children:p.jsxs(Kr,{onBack:l,children:[O,D,z]})})}),e[44]=l,e[45]=O,e[46]=D,e[47]=z,e[48]=U):U=e[48],U}function dg(n){return n||crypto.randomUUID()}function fg(n){const e=L.c(6),{itemId:t,onBack:r}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},e[0]=s):s=e[0];const i=Mn(s).connectionId??Ke;if(!i||i===Ke){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=p.jsx("div",{className:"flex h-full w-full bg-background",children:p.jsx(Hs,{title:"Assistant not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let l;return e[2]!==i||e[3]!==t||e[4]!==r?(l=p.jsx(ug,{providerId:i,assistantId:t,onBack:r}),e[2]=i,e[3]=t,e[4]=r,e[5]=l):l=e[5],l}ip({title:wo().min(1),description:wo().nullable(),body:wo()});function No(n){for(const e of n.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function hg(){const n=window.location.pathname.split("/").filter(Boolean),e=n.findIndex(r=>r==="mcps"),t=e>=0?n[e+1]:void 0;return t?decodeURIComponent(t):void 0}function pg(n){const e=L.c(13),{form:t}=n;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=p.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=r):r=e[0];let s;e[1]!==t.control?(s=p.jsxs("div",{className:"flex flex-col gap-4",children:[r,p.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[p.jsx(nt,{control:t.control,name:"title",render:yg}),p.jsx(nt,{control:t.control,name:"description",render:gg})]})]}),e[1]=t.control,e[2]=s):s=e[2];let o,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=p.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),i=p.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=o,e[4]=i):(o=e[3],i=e[4]);let l;e[5]!==t.control?(l=p.jsxs("div",{className:"flex flex-col gap-2",children:[o,i,p.jsx(nt,{control:t.control,name:"body",render:mg})]}),e[5]=t.control,e[6]=l):l=e[6];let a;e[7]!==s||e[8]!==l?(a=p.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[s,l]}),e[7]=s,e[8]=l,e[9]=a):a=e[9];let c;return e[10]!==t||e[11]!==a?(c=p.jsx(su,{...t,children:a}),e[10]=t,e[11]=a,e[12]=c):c=e[12],c}function mg(n){const{field:e}=n;return p.jsx(Ot,{children:p.jsx(An,{children:p.jsx(Ur,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function gg(n){const{field:e}=n;return p.jsxs(Ot,{children:[p.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),p.jsx(An,{children:p.jsx(In,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function yg(n){const{field:e}=n;return p.jsxs(Ot,{children:[p.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),p.jsx(An,{children:p.jsx(In,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function xg(n){const e=L.c(42),{providerId:t,promptId:r,onBack:s}=n,o=t||Ke;let i;e[0]!==o?(i=Mt(o),e[0]=o,e[1]=i):i=e[1];const l=i,a=Ui(t,"PROMPT",r,l),c=Ki(t,"PROMPT",l),u=c.update.isPending;let d;e[2]!==a?(d=a?{title:a.title,description:a.description??null,body:No(a)}:void 0,e[2]=a,e[3]=d):d=e[3];let f;e[4]!==d?(f={values:d},e[4]=d,e[5]=f):f=e[5];const h=Gc(f);let m;e[6]!==h||e[7]!==a?(m=()=>{a&&h.reset({title:a.title,description:a.description??null,body:No(a)})},e[6]=h,e[7]=a,e[8]=m):m=e[8];const g=m;let y;e[9]!==c.update||e[10]!==h||e[11]!==r?(y=h.handleSubmit(async I=>{const O=await c.update.mutateAsync({id:r,data:{title:I.title,description:I.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:I.body}}]}});h.reset({title:O.title,description:O.description??null,body:No(O)})}),e[9]=c.update,e[10]=h,e[11]=r,e[12]=y):y=e[12];const x=y;if(!a){let I;return e[13]===Symbol.for("react.memo_cache_sentinel")?(I=p.jsx("div",{className:"flex h-full w-full bg-background",children:p.jsx(Hs,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[13]=I):I=e[13],I}let b;e[14]!==a.title?(b=p.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:a.title}),e[14]=a.title,e[15]=b):b=e[15];let k;e[16]!==a.description?(k=a.description?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),p.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:a.description})]}):null,e[16]=a.description,e[17]=k):k=e[17];let C;e[18]!==b||e[19]!==k?(C=p.jsx(ou,{children:p.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[b,k]})}),e[18]=b,e[19]=k,e[20]=C):C=e[20];const v=!h.formState.isDirty||u;let w;e[21]!==g||e[22]!==v?(w=p.jsx(ie,{variant:"ghost",size:"sm",className:"h-7 gap-1.5",disabled:v,onClick:g,children:"Cancel"}),e[21]=g,e[22]=v,e[23]=w):w=e[23];const S=!h.formState.isDirty||u;let E;e[24]!==x?(E=()=>{x()},e[24]=x,e[25]=E):E=e[25];let M;e[26]!==u?(M=u?p.jsxs(p.Fragment,{children:[p.jsx(Ct,{size:14,className:"animate-spin"}),"Saving..."]}):"Save",e[26]=u,e[27]=M):M=e[27];let T;e[28]!==S||e[29]!==E||e[30]!==M?(T=p.jsx(ie,{variant:"default",size:"sm",className:"h-7 gap-1.5",disabled:S,onClick:E,children:M}),e[28]=S,e[29]=E,e[30]=M,e[31]=T):T=e[31];let R;e[32]!==w||e[33]!==T?(R=p.jsxs(Xi,{children:[w,T]}),e[32]=w,e[33]=T,e[34]=R):R=e[34];let P;e[35]!==h?(P=p.jsx("div",{className:"h-full",children:p.jsx(pg,{form:h})}),e[35]=h,e[36]=P):P=e[36];let _;return e[37]!==s||e[38]!==R||e[39]!==P||e[40]!==C?(_=p.jsxs(Kr,{onBack:s,children:[C,R,P]}),e[37]=s,e[38]=R,e[39]=P,e[40]=C,e[41]=_):_=e[41],_}function bg(n){const e=L.c(5),{itemId:t,onBack:r}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=hg()??Ke,e[0]=s):s=e[0];const o=s;if(!o||o===Ke){let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=p.jsx("div",{className:"flex h-full w-full bg-background",children:p.jsx(Hs,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=l):l=e[1],l}let i;return e[2]!==t||e[3]!==r?(i=p.jsx(nr,{children:p.jsx(N.Suspense,{fallback:null,children:p.jsx(xg,{providerId:o,promptId:t,onBack:r})})}),e[2]=t,e[3]=r,e[4]=i):i=e[4],i}const vg=lp("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function kg(n){const e=L.c(10);let t,r,s;e[0]!==n?({className:t,variant:s,...r}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=s):(t=e[1],r=e[2],s=e[3]);let o;e[4]!==t||e[5]!==s?(o=G(vg({variant:s}),t),e[4]=t,e[5]=s,e[6]=o):o=e[6];let i;return e[7]!==r||e[8]!==o?(i=p.jsx("div",{"data-slot":"alert",role:"alert",className:o,...r}),e[7]=r,e[8]=o,e[9]=i):i=e[9],i}function wg(n){const e=L.c(8);let t,r;e[0]!==n?({className:t,...r}=n,e[0]=n,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=G("line-clamp-1 min-h-4 font-medium tracking-tight",t),e[3]=t,e[4]=s):s=e[4];let o;return e[5]!==r||e[6]!==s?(o=p.jsx("div",{"data-slot":"alert-title",className:s,...r}),e[5]=r,e[6]=s,e[7]=o):o=e[7],o}function Sg(n){const e=L.c(8);let t,r;e[0]!==n?({className:t,...r}=n,e[0]=n,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=G("text-muted-foreground leading-relaxed",t),e[3]=t,e[4]=s):s=e[4];let o;return e[5]!==r||e[6]!==s?(o=p.jsx("div",{"data-slot":"alert-description",className:s,...r}),e[5]=r,e[6]=s,e[7]=o):o=e[7],o}const Cg=n=>n.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ng(n){const e=L.c(13),{toolName:t,connectionId:r,onBack:s}=n,o=`/mcp/${r}`;let i;e[0]!==o?(i=new URL(o,window.location.origin),e[0]=o,e[1]=i):i=e[1];const l=i;let a;e[2]!==r?(a={connectionId:r},e[2]=r,e[3]=a):a=e[3];const c=Xp(a);if(!c.isAuthenticated){let f;return e[4]!==c.supportsOAuth||e[5]!==s?(f=p.jsx("div",{className:"flex h-full items-center justify-center",children:c.supportsOAuth?p.jsx(Qp,{onAuthenticate:()=>s(),buttonText:"Go back to authenticate"}):p.jsx(Zp,{hasReadme:!1})}),e[4]=c.supportsOAuth,e[5]=s,e[6]=f):f=e[6],f}const u=`${r}:${t}`;let d;return e[7]!==r||e[8]!==l||e[9]!==s||e[10]!==u||e[11]!==t?(d=p.jsx(Eg,{toolName:t,connectionId:r,mcpProxyUrl:l,onBack:s},u),e[7]=r,e[8]=l,e[9]=s,e[10]=u,e[11]=t,e[12]=d):d=e[12],d}function Eg({toolName:n,connectionId:e,mcpProxyUrl:t,onBack:r}){const{replayId:s}=ap({strict:!1}),o=(()=>{if(!s)return null;const I=`replay-${s}`,O=sessionStorage.getItem(I);if(!O)return null;sessionStorage.removeItem(I);try{return JSON.parse(O)}catch{return null}})(),i=(()=>{if(!o)return null;const I={};for(const[O,D]of Object.entries(o))D!==null&&typeof D=="object"?I[O]=JSON.stringify(D,null,2):I[O]=D;return I})(),[l,a]=N.useState(i??{}),[c,u]=N.useState(o?JSON.stringify(o,null,2):"{}"),[d,f]=N.useState(null),[h,m]=N.useState(null),[g,y]=N.useState(!1),[x,b]=N.useState(null),k=Ji(e),C=el({url:t.href});N.useEffect(()=>{C.error&&console.error("MCP Error:",C.error)},[C.error]);const v=C.tools?.find(I=>I.name===n),w=v?.inputSchema?.properties,S=w?Object.keys(w):[],E=S.length>0,M={};if(E&&v?.inputSchema?.properties)for(const I of S)M[I]=v.inputSchema.required?.includes(I)?"":void 0;const T=I=>Object.prototype.hasOwnProperty.call(l,I),R=async()=>{y(!0),m(null),f(null),b(null);const I=performance.now(),O=Mt(e);try{const D=E?{...M,...l}:(()=>{const X=c.trim();if(!X)return{};const de=JSON.parse(X);if(de&&typeof de=="object")return de;throw new Error("Raw JSON input must be an object.")})();E&&v?.inputSchema?.properties&&Object.entries(v.inputSchema.properties).forEach(([X,de])=>{if((de.type==="object"||de.type==="array")&&typeof D[X]=="string")try{D[X]=JSON.parse(D[X])}catch{}});const z=await O(n,D),U=performance.now(),J=Math.round(U-I);f(z);const K=JSON.stringify(z),H=new TextEncoder().encode(K).length;b({duration:`${J}ms`,bytes:`${H} bytes`,tokens:`~${Math.ceil(H/4)} tokens`,cost:"$0.0000"})}catch(D){const z=D instanceof Error?D.message:String(D);m(z||"Unknown error occurred");const U=performance.now();b({duration:`${Math.round(U-I)}ms`})}finally{y(!1)}},P=(I,O)=>{a(D=>({...D,[I]:O}))},_=()=>{f(null),m(null),b(null)};return p.jsxs(Kr,{onBack:r,children:[p.jsx(Xi,{children:p.jsx(em,{connectionId:e,title:v?.name??Cg(n),icon:"build"})}),p.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 h-full",children:[p.jsx("div",{className:"flex flex-col border-r border-border overflow-hidden",children:p.jsxs("div",{className:"flex-1 overflow-auto",children:[p.jsx("div",{className:"flex flex-col gap-4 p-6 border-b border-border min-h-28",children:p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(Vs,{icon:k?.icon||null,name:k?.title||n,size:"sm",className:"shadow-sm shrink-0"}),p.jsx("h1",{className:"text-lg font-medium text-foreground leading-none",children:n}),p.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit",children:[C.state==="ready"?p.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):C.state==="connecting"?p.jsx(Ct,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):p.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),p.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:C.state.replace("_"," ")})]})]}),p.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:v?.description||"No description available"})]})}),p.jsxs("div",{className:"flex flex-col p-6 gap-4",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),v?.inputSchema?.required&&v.inputSchema.required.length>0&&p.jsxs("span",{className:"text-xs text-muted-foreground",children:[p.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),p.jsx("div",{className:"space-y-4",children:E&&v?.inputSchema?.properties?Object.entries(v.inputSchema.properties).map(([I,O])=>p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[I,v.inputSchema?.required?.includes(I)&&p.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),p.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:O.type})]}),O.description&&p.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:O.description}),O.type==="object"||O.type==="array"?p.jsx(Ur,{className:"font-mono text-xs",value:T(I)?l[I]??"":M[I]??"",onChange:D=>P(I,D.target.value),placeholder:`Enter ${I} as JSON...`,rows:3}):p.jsx(In,{value:T(I)?l[I]??"":M[I]??"",onChange:D=>P(I,D.target.value),placeholder:`Enter ${I}...`})]},I)):v?.inputSchema&&!E?p.jsxs("div",{className:"space-y-2",children:[p.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),p.jsx(Ur,{className:"font-mono text-xs min-h-[120px]",value:c,onChange:I=>u(I.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):p.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:p.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})})]})]})}),p.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[p.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-t lg:border-t-0 border-b border-border bg-background",children:[p.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),x&&p.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(Jp,{className:"h-3 w-3 text-muted-foreground"}),p.jsx("span",{className:"font-mono text-foreground",children:x.duration})]}),x.tokens&&p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(mu,{className:"h-3 w-3 text-muted-foreground"}),p.jsx("span",{className:"font-mono text-foreground",children:x.tokens})]}),x.bytes&&p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(ku,{className:"h-3 w-3 text-muted-foreground"}),p.jsx("span",{className:"font-mono text-foreground",children:x.bytes})]}),x.cost&&p.jsx("div",{className:"flex items-center gap-1.5",children:p.jsx("span",{className:"font-mono text-foreground",children:x.cost})})]})]}),p.jsx("div",{className:"flex items-center justify-end lg:justify-between px-4 h-14 border-b border-border bg-background",children:p.jsxs("div",{className:"flex items-center gap-2 w-full lg:w-auto",children:[p.jsx(ie,{size:"sm",variant:"default",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:R,disabled:g,children:g?p.jsxs(p.Fragment,{children:[p.jsx(Ct,{size:14,className:"animate-spin"}),"Executing..."]}):p.jsxs(p.Fragment,{children:[p.jsx(Qi,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})}),p.jsx(eu,{children:p.jsxs(tu,{children:[p.jsx(nu,{asChild:!0,children:p.jsx(ie,{size:"icon",variant:"outline",className:"h-8 w-8 shrink-0",onClick:_,disabled:!d&&!h,children:p.jsx(Zi,{size:14})})}),p.jsx(ru,{children:p.jsx("p",{children:"Clear results"})})]})})]})}),h&&p.jsx("div",{className:"px-6 py-4 bg-background",children:p.jsx(kg,{variant:"destructive",children:p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Kp,{className:"h-4 w-4"}),p.jsx(wg,{className:"mb-0",children:"Execution Failed"})]}),p.jsx(Sg,{className:"text-xs text-destructive",children:h})]})})}),p.jsx("div",{className:"relative flex-1 overflow-auto bg-muted/50",children:d?p.jsxs(p.Fragment,{children:[p.jsx(Yp,{jsonString:JSON.stringify(d,null,2),padding:"1.5rem"}),p.jsx(ie,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(d,null,2)),li.success("Copied to clipboard")},children:p.jsx(Gp,{className:"h-3.5 w-3.5"})})]}):p.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[p.jsx(yu,{className:"h-12 w-12 mb-3 opacity-40"}),p.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]})]})]})}function Tg(n){const e=L.c(7),{itemId:t,onBack:r}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},e[0]=s):s=e[0];const i=Mn(s).connectionId??Ke;if(!Ji(i)){let u;return e[1]===Symbol.for("react.memo_cache_sentinel")?(u=p.jsx("div",{className:"flex h-full items-center justify-center",children:p.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[p.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),p.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[1]=u):u=e[1],u}let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=p.jsx("div",{className:"flex h-full items-center justify-center",children:p.jsx(Ct,{size:32,className:"animate-spin text-muted-foreground"})}),e[2]=a):a=e[2];let c;return e[3]!==i||e[4]!==r||e[5]!==t?(c=p.jsx(N.Suspense,{fallback:a,children:p.jsx(Ng,{toolName:t,connectionId:i,onBack:r})}),e[3]=i,e[4]=r,e[5]=t,e[6]=c):c=e[6],c}const ca=n=>{let e;const t=new Set,r=(c,u)=>{const d=typeof c=="function"?c(e):c;if(!Object.is(d,e)){const f=e;e=u??(typeof d!="object"||d===null)?d:Object.assign({},e,d),t.forEach(h=>h(e,f))}},s=()=>e,l={setState:r,getState:s,getInitialState:()=>a,subscribe:c=>(t.add(c),()=>t.delete(c))},a=e=n(r,s,l);return l},nl=(n=>n?ca(n):ca),Mg=n=>n;function ai(n,e=Mg){const t=Y.useSyncExternalStore(n.subscribe,Y.useCallback(()=>e(n.getState()),[n,e]),Y.useCallback(()=>e(n.getInitialState()),[n,e]));return Y.useDebugValue(t),t}const Og=n=>{const e=nl(n),t=r=>ai(e,r);return Object.assign(t,e),t},Ag=(n=>Og);function Mu(n,e){let t;try{t=n()}catch{return}return{getItem:s=>{var o;const i=a=>a===null?null:JSON.parse(a,void 0),l=(o=t.getItem(s))!=null?o:null;return l instanceof Promise?l.then(i):i(l)},setItem:(s,o)=>t.setItem(s,JSON.stringify(o,void 0)),removeItem:s=>t.removeItem(s)}}const ci=n=>e=>{try{const t=n(e);return t instanceof Promise?t:{then(r){return ci(r)(t)},catch(r){return this}}}catch(t){return{then(r){return this},catch(r){return ci(r)(t)}}}},Ig=(n,e)=>(t,r,s)=>{let o={storage:Mu(()=>localStorage),partialize:g=>g,version:0,merge:(g,y)=>({...y,...g}),...e},i=!1;const l=new Set,a=new Set;let c=o.storage;if(!c)return n((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),t(...g)},r,s);const u=()=>{const g=o.partialize({...r()});return c.setItem(o.name,{state:g,version:o.version})},d=s.setState;s.setState=(g,y)=>(d(g,y),u());const f=n((...g)=>(t(...g),u()),r,s);s.getInitialState=()=>f;let h;const m=()=>{var g,y;if(!c)return;i=!1,l.forEach(b=>{var k;return b((k=r())!=null?k:f)});const x=((y=o.onRehydrateStorage)==null?void 0:y.call(o,(g=r())!=null?g:f))||void 0;return ci(c.getItem.bind(c))(o.name).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==o.version){if(o.migrate){const k=o.migrate(b.state,b.version);return k instanceof Promise?k.then(C=>[!0,C]):[!0,k]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,b.state];return[!1,void 0]}).then(b=>{var k;const[C,v]=b;if(h=o.merge(v,(k=r())!=null?k:f),t(h,!0),C)return u()}).then(()=>{x?.(h,void 0),h=r(),i=!0,a.forEach(b=>b(h))}).catch(b=>{x?.(void 0,b)})};return s.persist={setOptions:g=>{o={...o,...g},g.storage&&(c=g.storage)},clearStorage:()=>{c?.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>i,onHydrate:g=>(l.add(g),()=>{l.delete(g)}),onFinishHydration:g=>(a.add(g),()=>{a.delete(g)})},o.skipHydration||m(),h||f},Ou=Ig,{useSyncExternalStoreWithSelector:jg}=cp,Rg=n=>n;function Dg(n,e=Rg,t){const r=jg(n.subscribe,n.getState,n.getInitialState,e,t);return Y.useDebugValue(r),r}const ua=n=>Symbol.iterator in n,da=n=>"entries"in n,fa=(n,e)=>{const t=n instanceof Map?n:new Map(n.entries()),r=e instanceof Map?e:new Map(e.entries());if(t.size!==r.size)return!1;for(const[s,o]of t)if(!r.has(s)||!Object.is(o,r.get(s)))return!1;return!0},Pg=(n,e)=>{const t=n[Symbol.iterator](),r=e[Symbol.iterator]();let s=t.next(),o=r.next();for(;!s.done&&!o.done;){if(!Object.is(s.value,o.value))return!1;s=t.next(),o=r.next()}return!!s.done&&!!o.done};function Lg(n,e){return Object.is(n,e)?!0:typeof n!="object"||n===null||typeof e!="object"||e===null||Object.getPrototypeOf(n)!==Object.getPrototypeOf(e)?!1:ua(n)&&ua(e)?da(n)&&da(e)?fa(n,e):Pg(n,e):fa({entries:()=>Object.entries(n)},{entries:()=>Object.entries(e)})}function $g(n,e="Output"){if(!n)return`interface ${e} {}`;function t(o){if(!o||typeof o!="object")return"unknown";const i=o.type;if(Array.isArray(i))return i.map(l=>r(l)).join(" | ");switch(i){case"string":return o.enum?o.enum.map(l=>`"${l}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const l=o.items;return l?`${t(l)}[]`:"unknown[]"}case"object":return s(o);default:return o.anyOf?o.anyOf.map(t).join(" | "):o.oneOf?o.oneOf.map(t).join(" | "):o.allOf?o.allOf.map(t).join(" & "):"unknown"}}function r(o){switch(o){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function s(o){const i=o.properties;if(!i)return"Record<string, unknown>";const l=new Set(o.required||[]);return`{
1
+ import{aw as Tt,r as N,c as L,d as Mn,j as p,av as Fi,w as op,x as Gc,s as ip,v as wo,h as lp,b as ap,t as li,E as Y,M as cp,ax as So,ay as Yc,al as up,ak as dp,az as fp,F as Vi,a5 as Xc,a8 as hp,z as On,B as ze,a2 as Hi,a9 as pp,y as Fs,a6 as mp,a1 as Wi,af as gp,ag as yp,ah as xp,aA as qi,aB as bp,a7 as Qc,a4 as vp,aC as kp,J as wp,aD as Sp,aE as Cp}from"./index-CCNaUj2A.js";import{U as Ke,f as Ui,d as Ki,c as Mt,b as Ji,I as Vs,u as Np,n as Ep}from"./use-connection-BbvAiBvg.js";import{d as Tp,C as an,e as Mp,I as Op,l as ta,G as Zc,M as Ap,m as Ip,R as na,k as jp}from"./resizable-BF9gWgPg.js";import{E as Hs,i as Rp}from"./SearchMd-C_ak4ze3.js";import{E as nr}from"./error-boundary-DMJQCmxn.js";import{u as Dp,L as Pp}from"./localstorage-keys-BphvZ-YX.js";import{u as Lp,a as eu,c as tu,b as nu,T as ru,i as Gi}from"./tooltip-CqCXb38Z.js";import{B as ie}from"./button-DuitHSR8.js";import{F as nt,a as su,b as Ot,c as mr,d as An}from"./form-BfiwCHdz.js";import{I as In}from"./input-YU6lpVgW.js";import{T as Ur,D as $p,a as _p,b as zp,f as Bp,c as Fp,d as Vp}from"./dialog-Dl9CupEb.js";import{c as G}from"./utils-o1atviYh.js";import{A as Hp,D as Wp,u as qp}from"./use-binding-DdwsXkNS.js";import{i as Ct}from"./Loading01-Dtm2TLlA.js";import{s as Yi}from"./Plus-DF_I5mml.js";import{i as Up}from"./Upload01-BYeEw9Vy.js";import{V as Xi,b as Kr,a as ou}from"./layout-n40g10Oh.js";import{i as Kp}from"./AlertCircle-zCOLtXNG.js";import{s as Jp}from"./Clock-qZko4uak.js";import{a as Gp}from"./Copy01-XN5V21c6.js";import{i as Qi,J as Yp}from"./json-syntax-highlighter-Dve1WRV4.js";import{s as Zi,i as iu}from"./XClose-CY6vd_0A.js";import{u as Xp,O as Qp,M as Zp,P as em,F as tm,v as nm,E as rm}from"./index-be58e1VX.js";import{u as el}from"./use-mcp-CWOlOW9q.js";import{S as Yt}from"./spinner-CNb2mD_9.js";import{a as lu,b as sm}from"./use-tool-call-CVPTtLoG.js";import{V as om}from"./view-mode-toggle-DOtHoBLN.js";import{i as im}from"./ArrowLeft-b0UM4Vui.js";import{i as lm}from"./GitBranch01-CM-ab6hS.js";import"./index-DR-B7Y1Z.js";import{n as am}from"./Calendar-Cxw5FKll.js";import{b as cm,D as um,a as dm,d as ra,i as fm}from"./dropdown-menu-CPQpNQmn.js";import{B as cn}from"./badge-CgUwfcKq.js";import{i as au}from"./X-BTsWwO_U.js";import"./CpuChip02-Nhk4zHXl.js";import"./select-C4QWjnSz.js";import"./ChevronDown-BFYjmmoG.js";import"./use-mobile-B0xRFGhT.js";import"./use-gateway-L1UQyU7-.js";import"./Terminal-4DdepWh9.js";import"./connection-card-CVX6Dj6b.js";import"./card-DkEpNms8.js";import"./LinkExternal01-CBZhTXC0.js";import"./File06-DB55FK-Z.js";import"./InfoCircle-ChxTTkMX.js";import"./useQuery-C4GPpw7d.js";import"./auth-CfgXQhXI.js";import"./mcp-oauth-CvO1Z13d.js";import"./use-organization-settings-fWTyw7VB.js";import"./env-vars-editor-BcyBU5xA.js";import"./Trash01-FYPMjpVf.js";import"./Key01-DYiMWoz_.js";import"./formatDistanceToNow-BmkU67cZ.js";import"./extract-connection-data-Bt1_1dQ8.js";import"./registry-utils-ulDDT0d8.js";import"./generate-id-Dyweu44Y.js";import"./index-T7OaHK12.js";const cu=Tt("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const uu=Tt("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const hm=Tt("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const pm=Tt("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const du=Tt("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const fu=Tt("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const hu=Tt("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const pu=Tt("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]),tl=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"M12 8v4m0 4h.01M2 8.523v6.954c0 .245 0 .367.028.482a1 1 0 0 0 .12.29c.061.1.148.187.32.36l4.923 4.922c.173.173.26.26.36.322.09.054.188.095.29.12.115.027.237.027.482.027h6.954c.245 0 .367 0 .482-.028a.998.998 0 0 0 .29-.12c.1-.061.187-.148.36-.32l4.922-4.923c.173-.173.26-.26.322-.36a.998.998 0 0 0 .12-.29c.027-.115.027-.237.027-.482V8.523c0-.245 0-.367-.028-.482a.998.998 0 0 0-.12-.29c-.061-.1-.148-.187-.32-.36L16.608 2.47c-.173-.173-.26-.26-.36-.322a1 1 0 0 0-.29-.12C15.844 2 15.722 2 15.477 2H8.523c-.245 0-.367 0-.482.028a1 1 0 0 0-.29.12c-.1.061-.187.148-.36.32L2.47 7.392c-.173.173-.26.26-.322.36a1 1 0 0 0-.12.29C2 8.156 2 8.278 2 8.523Z"}));tl.displayName="AlertOctagon";const mu=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"M20.5 8v8.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.22 21 17.38 21 15.7 21H8.3c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3.5 18.72 3.5 17.88 3.5 16.2V8m.1-5h16.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C22 3.76 22 4.04 22 4.6v1.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C21.24 8 20.96 8 20.4 8H3.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C2 7.24 2 6.96 2 6.4V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C2.76 3 3.04 3 3.6 3Zm6 8.5h4.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C16 12.26 16 12.54 16 13.1v.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437c-.214.109-.494.109-1.054.109H9.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C8 14.74 8 14.46 8 13.9v-.8c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C8.76 11.5 9.04 11.5 9.6 11.5Z"}));mu.displayName="Box";const gu=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"m22.7 11.5-2 2-2-2m2.245 1.5A9 9 0 1 0 19 17.657M12 7v5l3 2"}));gu.displayName="ClockFastForward";const yu=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"m16 18 6-6-6-6M8 6l-6 6 6 6"}));yu.displayName="Code01";const xu=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"m17 17 5-5-5-5M7 7l-5 5 5 5m7-14-4 18"}));xu.displayName="Code02";const bu=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"M12 17a5 5 0 1 0 10 0 5 5 0 0 0-10 0Zm0 0c0-1.126.372-2.165 1-3V5m-1 12c0 .825.2 1.604.554 2.29-.842.712-2.788 1.21-5.054 1.21-3.038 0-5.5-.895-5.5-2V5m11 0c0 1.105-2.462 2-5.5 2S2 6.105 2 5m11 0c0-1.105-2.462-2-5.5-2S2 3.895 2 5m0 9c0 1.105 2.462 2 5.5 2 2.189 0 4.08-.465 4.965-1.138M13 9.5c0 1.105-2.462 2-5.5 2S2 10.605 2 9.5"}));bu.displayName="CoinsStacked01";const zr=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"M6.8 3h-.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C3 4.52 3 5.08 3 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21h.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C10 19.48 10 18.92 10 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C8.48 3 7.92 3 6.8 3Zm11 0h-.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C14 4.52 14 5.08 14 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C15.52 21 16.08 21 17.2 21h.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C19.48 3 18.92 3 17.8 3Z"}));zr.displayName="Columns01";const vu=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"M4 4v1.4c0 3.36 0 5.04.654 6.324a6 6 0 0 0 2.622 2.622C8.56 15 10.24 15 13.6 15H20m0 0-5-5m5 5-5 5"}));vu.displayName="CornerDownRight";const ku=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"M21 5c0 1.657-4.03 3-9 3S3 6.657 3 5m18 0c0-1.657-4.03-3-9-3S3 3.343 3 5m18 0v14c0 1.66-4 3-9 3s-9-1.34-9-3V5m18 7c0 1.66-4 3-9 3s-9-1.34-9-3"}));ku.displayName="Database01";const wu=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"M11 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 6.28 2 7.12 2 8.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 22 5.12 22 6.8 22h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C20 19.72 20 18.88 20 17.2V13M8 16h1.675c.489 0 .733 0 .963-.055.204-.05.4-.13.579-.24.201-.123.374-.296.72-.642L21.5 5.5a2.121 2.121 0 0 0-3-3l-9.563 9.563c-.346.346-.519.519-.642.72a2 2 0 0 0-.24.579c-.055.23-.055.474-.055.963V16Z"}));wu.displayName="Edit05";const Su=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"M3 9h13.5a4.5 4.5 0 1 1 0 9H12M3 9l4-4M3 9l4 4"}));Su.displayName="FlipBackward";const Cu=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"m13 22-3-3m0 0 3-3m-3 3h5a7 7 0 0 0 3-13.326M6 18.326A7 7 0 0 1 9 5h5m0 0-3-3m3 3-3 3"}));Cu.displayName="Repeat03";const Nu=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"M15 8H8.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C7 7.24 7 6.96 7 6.4V3m10 18v-6.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C16.24 13 15.96 13 15.4 13H8.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C7 13.76 7 14.04 7 14.6V21M21 9.325V16.2c0 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.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h6.875c.489 0 .733 0 .963.055.204.05.4.13.579.24.201.123.374.296.72.642l3.126 3.126c.346.346.519.519.642.72.11.18.19.374.24.579.055.23.055.474.055.963Z"}));Nu.displayName="Save02";const Eu=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"M15.631 7.631c-.396-.396-.594-.594-.668-.822a1 1 0 0 1 0-.618c.074-.228.272-.426.668-.822L18.47 2.53a6 6 0 0 0-8.3 6.895c.12.49.179.734.168.888a.849.849 0 0 1-.11.392c-.07.138-.207.274-.48.547L3.5 17.5a2.121 2.121 0 0 0 3 3l6.248-6.248c.273-.273.41-.41.547-.48a.849.849 0 0 1 .392-.11c.154-.011.399.049.888.168a6 6 0 0 0 6.895-8.3l-2.84 2.84c-.396.396-.594.594-.822.668a1 1 0 0 1-.618 0c-.228-.074-.426-.272-.822-.668l-.738-.738Z"}));Eu.displayName="Tool01";const Ws=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"M16 3.468a4.5 4.5 0 0 1 0 8.064m2 5.234c1.512.684 2.872 1.799 4 3.234M2 20c1.946-2.477 4.59-4 7.5-4s5.553 1.523 7.5 4M14 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));Ws.displayName="Users02";const{getOwnPropertyNames:mm,getOwnPropertySymbols:gm}=Object,{hasOwnProperty:ym}=Object.prototype;function Co(n,e){return function(r,s,o){return n(r,s,o)&&e(r,s,o)}}function Cr(n){return function(t,r,s){if(!t||!r||typeof t!="object"||typeof r!="object")return n(t,r,s);const{cache:o}=s,i=o.get(t),l=o.get(r);if(i&&l)return i===r&&l===t;o.set(t,r),o.set(r,t);const a=n(t,r,s);return o.delete(t),o.delete(r),a}}function xm(n){return n?.[Symbol.toStringTag]}function sa(n){return mm(n).concat(gm(n))}const bm=Object.hasOwn||((n,e)=>ym.call(n,e));function Xt(n,e){return n===e||!n&&!e&&n!==n&&e!==e}const vm="__v",km="__o",wm="_owner",{getOwnPropertyDescriptor:oa,keys:ia}=Object;function Sm(n,e){return n.byteLength===e.byteLength&&Jr(new Uint8Array(n),new Uint8Array(e))}function Cm(n,e,t){let r=n.length;if(e.length!==r)return!1;for(;r-- >0;)if(!t.equals(n[r],e[r],r,r,n,e,t))return!1;return!0}function Nm(n,e){return n.byteLength===e.byteLength&&Jr(new Uint8Array(n.buffer,n.byteOffset,n.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function Em(n,e){return Xt(n.getTime(),e.getTime())}function Tm(n,e){return n.name===e.name&&n.message===e.message&&n.cause===e.cause&&n.stack===e.stack}function Mm(n,e){return n===e}function la(n,e,t){const r=n.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),o=n.entries();let i,l,a=0;for(;(i=o.next())&&!i.done;){const c=e.entries();let u=!1,d=0;for(;(l=c.next())&&!l.done;){if(s[d]){d++;continue}const f=i.value,h=l.value;if(t.equals(f[0],h[0],a,d,n,e,t)&&t.equals(f[1],h[1],f[0],h[0],n,e,t)){u=s[d]=!0;break}d++}if(!u)return!1;a++}return!0}const Om=Xt;function Am(n,e,t){const r=ia(n);let s=r.length;if(ia(e).length!==s)return!1;for(;s-- >0;)if(!Tu(n,e,t,r[s]))return!1;return!0}function $n(n,e,t){const r=sa(n);let s=r.length;if(sa(e).length!==s)return!1;let o,i,l;for(;s-- >0;)if(o=r[s],!Tu(n,e,t,o)||(i=oa(n,o),l=oa(e,o),(i||l)&&(!i||!l||i.configurable!==l.configurable||i.enumerable!==l.enumerable||i.writable!==l.writable)))return!1;return!0}function Im(n,e){return Xt(n.valueOf(),e.valueOf())}function jm(n,e){return n.source===e.source&&n.flags===e.flags}function aa(n,e,t){const r=n.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),o=n.values();let i,l;for(;(i=o.next())&&!i.done;){const a=e.values();let c=!1,u=0;for(;(l=a.next())&&!l.done;){if(!s[u]&&t.equals(i.value,l.value,i.value,l.value,n,e,t)){c=s[u]=!0;break}u++}if(!c)return!1}return!0}function Jr(n,e){let t=n.byteLength;if(e.byteLength!==t||n.byteOffset!==e.byteOffset)return!1;for(;t-- >0;)if(n[t]!==e[t])return!1;return!0}function Rm(n,e){return n.hostname===e.hostname&&n.pathname===e.pathname&&n.protocol===e.protocol&&n.port===e.port&&n.hash===e.hash&&n.username===e.username&&n.password===e.password}function Tu(n,e,t,r){return(r===wm||r===km||r===vm)&&(n.$$typeof||e.$$typeof)?!0:bm(e,r)&&t.equals(n[r],e[r],r,r,n,e,t)}const Dm="[object ArrayBuffer]",Pm="[object Arguments]",Lm="[object Boolean]",$m="[object DataView]",_m="[object Date]",zm="[object Error]",Bm="[object Map]",Fm="[object Number]",Vm="[object Object]",Hm="[object RegExp]",Wm="[object Set]",qm="[object String]",Um={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},Km="[object URL]",Jm=Object.prototype.toString;function Gm({areArrayBuffersEqual:n,areArraysEqual:e,areDataViewsEqual:t,areDatesEqual:r,areErrorsEqual:s,areFunctionsEqual:o,areMapsEqual:i,areNumbersEqual:l,areObjectsEqual:a,arePrimitiveWrappersEqual:c,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:h,unknownTagComparators:m}){return function(y,x,b){if(y===x)return!0;if(y==null||x==null)return!1;const k=typeof y;if(k!==typeof x)return!1;if(k!=="object")return k==="number"?l(y,x,b):k==="function"?o(y,x,b):!1;const C=y.constructor;if(C!==x.constructor)return!1;if(C===Object)return a(y,x,b);if(Array.isArray(y))return e(y,x,b);if(C===Date)return r(y,x,b);if(C===RegExp)return u(y,x,b);if(C===Map)return i(y,x,b);if(C===Set)return d(y,x,b);const v=Jm.call(y);if(v===_m)return r(y,x,b);if(v===Hm)return u(y,x,b);if(v===Bm)return i(y,x,b);if(v===Wm)return d(y,x,b);if(v===Vm)return typeof y.then!="function"&&typeof x.then!="function"&&a(y,x,b);if(v===Km)return h(y,x,b);if(v===zm)return s(y,x,b);if(v===Pm)return a(y,x,b);if(Um[v])return f(y,x,b);if(v===Dm)return n(y,x,b);if(v===$m)return t(y,x,b);if(v===Lm||v===Fm||v===qm)return c(y,x,b);if(m){let w=m[v];if(!w){const S=xm(y);S&&(w=m[S])}if(w)return w(y,x,b)}return!1}}function Ym({circular:n,createCustomConfig:e,strict:t}){let r={areArrayBuffersEqual:Sm,areArraysEqual:t?$n:Cm,areDataViewsEqual:Nm,areDatesEqual:Em,areErrorsEqual:Tm,areFunctionsEqual:Mm,areMapsEqual:t?Co(la,$n):la,areNumbersEqual:Om,areObjectsEqual:t?$n:Am,arePrimitiveWrappersEqual:Im,areRegExpsEqual:jm,areSetsEqual:t?Co(aa,$n):aa,areTypedArraysEqual:t?Co(Jr,$n):Jr,areUrlsEqual:Rm,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),n){const s=Cr(r.areArraysEqual),o=Cr(r.areMapsEqual),i=Cr(r.areObjectsEqual),l=Cr(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:s,areMapsEqual:o,areObjectsEqual:i,areSetsEqual:l})}return r}function Xm(n){return function(e,t,r,s,o,i,l){return n(e,t,l)}}function Qm({circular:n,comparator:e,createState:t,equals:r,strict:s}){if(t)return function(l,a){const{cache:c=n?new WeakMap:void 0,meta:u}=t();return e(l,a,{cache:c,equals:r,meta:u,strict:s})};if(n)return function(l,a){return e(l,a,{cache:new WeakMap,equals:r,meta:void 0,strict:s})};const o={cache:void 0,equals:r,meta:void 0,strict:s};return function(l,a){return e(l,a,o)}}const Zm=At();At({strict:!0});At({circular:!0});At({circular:!0,strict:!0});At({createInternalComparator:()=>Xt});At({strict:!0,createInternalComparator:()=>Xt});At({circular:!0,createInternalComparator:()=>Xt});At({circular:!0,createInternalComparator:()=>Xt,strict:!0});function At(n={}){const{circular:e=!1,createInternalComparator:t,createState:r,strict:s=!1}=n,o=Ym(n),i=Gm(o),l=t?t(i):Xm(i);return Qm({circular:e,comparator:i,createState:r,equals:l,strict:s})}function eg(n){const e=L.c(3),{gatewayId:t,onSelect:r}=n,{data:s}=Mp(t);if(s.length===0)return null;let o;return e[0]!==r||e[1]!==s?(o=p.jsx(Op,{prompts:s,onSelect:r,className:"mt-6"}),e[0]=r,e[1]=s,e[2]=o):o=e[2],o}function tg(n){const e=L.c(20),{form:t}=n;let r;e[0]!==t?(r=d=>{const{field:f}=d;return p.jsx(cg,{size:"md",value:f.value,onChange:f.onChange,alt:t.watch("title")})},e[0]=t,e[1]=r):r=e[1];let s;e[2]!==t.control||e[3]!==r?(s=p.jsx(nt,{control:t.control,name:"avatar",render:r}),e[2]=t.control,e[3]=r,e[4]=s):s=e[4];let o;e[5]!==t.control?(o=p.jsxs("div",{className:"flex flex-col gap-3 flex-1 min-w-0",children:[p.jsx(nt,{control:t.control,name:"title",render:ig}),p.jsx(nt,{control:t.control,name:"description",render:og})]}),e[5]=t.control,e[6]=o):o=e[6];let i;e[7]!==s||e[8]!==o?(i=p.jsxs("div",{className:"flex gap-4 items-start",children:[s,o]}),e[7]=s,e[8]=o,e[9]=i):i=e[9];let l,a;e[10]!==t.control?(l=p.jsxs("div",{className:"flex gap-4",children:[p.jsx(nt,{control:t.control,name:"gateway_id",render:sg}),p.jsx(nt,{control:t.control,name:"model",render:rg})]}),a=p.jsx(nt,{control:t.control,name:"system_prompt",render:ng}),e[10]=t.control,e[11]=l,e[12]=a):(l=e[11],a=e[12]);let c;e[13]!==i||e[14]!==l||e[15]!==a?(c=p.jsxs("div",{className:"h-full py-6 flex flex-col max-w-2xl mx-auto w-full min-w-0 gap-6 overflow-y-auto",children:[i,l,a]}),e[13]=i,e[14]=l,e[15]=a,e[16]=c):c=e[16];let u;return e[17]!==t||e[18]!==c?(u=p.jsx(su,{...t,children:c}),e[17]=t,e[18]=c,e[19]=u):u=e[19],u}function ng(n){const{field:e}=n;return p.jsxs(Ot,{className:"flex-1 flex flex-col min-h-0",children:[p.jsx(mr,{className:"text-xs text-muted-foreground",children:"System prompt"}),p.jsx(An,{children:p.jsx(Ur,{...e,placeholder:"You are a helpful assistant...",className:"flex-1 min-h-[200px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})]})}function rg(n){const{field:e}=n;return p.jsxs(Ot,{className:"flex-1",children:[p.jsx(mr,{className:"text-xs text-muted-foreground",children:"Model"}),p.jsx(Ap,{selectedModel:e.value?{id:e.value.id,connectionId:e.value.connectionId}:void 0,onModelChange:t=>e.onChange({id:t.id,connectionId:t.connectionId}),placeholder:"Select model",variant:"bordered",className:"w-full"})]})}function sg(n){const{field:e}=n;return p.jsxs(Ot,{className:"flex-1",children:[p.jsx(mr,{className:"text-xs text-muted-foreground",children:"Gateway"}),p.jsx(Zc,{selectedGatewayId:e.value,onGatewayChange:e.onChange,placeholder:"Select gateway",variant:"bordered",className:"w-full"})]})}function og(n){const{field:e}=n;return p.jsxs(Ot,{children:[p.jsx(mr,{className:"text-xs text-muted-foreground",children:"Description"}),p.jsx(An,{children:p.jsx(In,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function ig(n){const{field:e}=n;return p.jsxs(Ot,{children:[p.jsx(mr,{className:"text-xs text-muted-foreground",children:"Name"}),p.jsx(An,{children:p.jsx(In,{...e,placeholder:"Untitled assistant",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function lg(n){const e=L.c(62),{activeThreadId:t,mode:r,assistant:s,form:o}=n;let i;e[0]!==t||e[1]!==s.system_prompt?(i={threadId:t,systemPrompt:s.system_prompt},e[0]=t,e[1]=s.system_prompt,e[2]=i):i=e[2];const l=Tp(i),a=!!s.gateway_id&&!!s.model?.id&&!!s.model?.connectionId;let c;e[3]!==t||e[4]!==s.gateway_id||e[5]!==s.model||e[6]!==l||e[7]!==a?(c=async H=>{if(!a)return;const X={created_at:new Date().toISOString(),thread_id:t,model:{id:s.model.id,connectionId:s.model.connectionId},gateway:{id:s.gateway_id??""},user:{name:"you"}};await l.sendMessage(H,X)},e[3]=t,e[4]=s.gateway_id,e[5]=s.model,e[6]=l,e[7]=a,e[8]=c):c=e[8];const u=c;let d;e[9]!==s.avatar||e[10]!==s.title?(d=s.avatar?p.jsx("div",{className:"size-[60px] rounded-[18px] border border-border shrink-0 overflow-hidden",children:p.jsx("img",{src:s.avatar,alt:s.title,className:"h-full w-full object-cover"})}):p.jsx("div",{className:"size-[60px] rounded-[18px] border border-border shrink-0 overflow-hidden bg-muted/20 flex items-center justify-center",children:p.jsx(Ws,{size:28,className:"text-muted-foreground"})}),e[9]=s.avatar,e[10]=s.title,e[11]=d):d=e[11];let f;e[12]!==s.title?(f=p.jsx("h3",{className:"text-xl font-medium text-foreground",children:s.title}),e[12]=s.title,e[13]=f):f=e[13];let h;e[14]!==s.description?(h=s.description?p.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:s.description}):null,e[14]=s.description,e[15]=h):h=e[15];let m;e[16]!==d||e[17]!==f||e[18]!==h?(m=p.jsxs("div",{className:"flex flex-col items-center gap-4",children:[d,f,h]}),e[16]=d,e[17]=f,e[18]=h,e[19]=m):m=e[19];let g;e[20]!==s.gateway_id||e[21]!==u?(g=s.gateway_id&&p.jsx(nr,{fallback:null,children:p.jsx(N.Suspense,{fallback:p.jsx("div",{className:"flex justify-center mt-6",children:p.jsx(Ct,{size:20,className:"animate-spin text-muted-foreground"})}),children:p.jsx(eg,{gatewayId:s.gateway_id,onSelect:H=>{u(H.description??H.name)}})})}),e[20]=s.gateway_id,e[21]=u,e[22]=g):g=e[22];let y;e[23]!==m||e[24]!==g?(y=p.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-4 text-center",children:[m,g]}),e[23]=m,e[24]=g,e[25]=y):y=e[25];const x=y;let b;e[26]!==l.messages?(b=l.messages.filter(ag),e[26]=l.messages,e[27]=b):b=e[27];const k=b,C=r==="edit",v=C?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none";let w;e[28]!==v?(w=G("absolute inset-0 px-2 transition-opacity duration-200 ease-out",v),e[28]=v,e[29]=w):w=e[29];let S;e[30]!==o?(S=p.jsx(tg,{form:o}),e[30]=o,e[31]=S):S=e[31];let E;e[32]!==w||e[33]!==S?(E=p.jsx("div",{className:w,children:S}),e[32]=w,e[33]=S,e[34]=E):E=e[34];const M=C?"opacity-0 pointer-events-none":"opacity-100";let T;e[35]!==M?(T=G("h-full transition-opacity duration-200 ease-out",M),e[35]=M,e[36]=T):T=e[36];let R;e[37]!==l.messages||e[38]!==l.status||e[39]!==x||e[40]!==k.length?(R=k.length===0?p.jsx(an.EmptyState,{children:x}):p.jsx(an.Messages,{messages:l.messages,status:l.status,minHeightOffset:240}),e[37]=l.messages,e[38]=l.status,e[39]=x,e[40]=k.length,e[41]=R):R=e[41];let P;e[42]!==T||e[43]!==R?(P=p.jsx("div",{className:T,children:R}),e[42]=T,e[43]=R,e[44]=P):P=e[44];let _;e[45]!==E||e[46]!==P?(_=p.jsxs(an.Main,{className:"h-full relative overflow-hidden",children:[E,P]}),e[45]=E,e[46]=P,e[47]=_):_=e[47];const I=C?"translate-y-full":"translate-y-0";let O;e[48]!==I?(O=G("transition-transform duration-300 ease-out",I),e[48]=I,e[49]=O):O=e[49];const D=!a,z=l.status==="submitted"||l.status==="streaming";let U;e[50]!==l.messages||e[51]!==l.stop||e[52]!==u||e[53]!==D||e[54]!==z?(U=p.jsx(an.Footer,{children:p.jsx("div",{className:"max-w-2xl mx-auto w-full min-w-0",children:p.jsx(an.Input,{onSubmit:u,onStop:l.stop,disabled:D,isStreaming:z,placeholder:"Ask anything or @ for context",usageMessages:l.messages})})}),e[50]=l.messages,e[51]=l.stop,e[52]=u,e[53]=D,e[54]=z,e[55]=U):U=e[55];let J;e[56]!==O||e[57]!==U?(J=p.jsx("div",{className:O,children:U}),e[56]=O,e[57]=U,e[58]=J):J=e[58];let K;return e[59]!==_||e[60]!==J?(K=p.jsxs(an,{children:[_,J]}),e[59]=_,e[60]=J,e[61]=K):K=e[61],K}function ag(n){return n.role!=="system"}function cg(n){const e=L.c(18),{value:t,onChange:r,alt:s,size:o}=n,i=o===void 0?"md":o,l=N.useRef(null),a=i==="xs"?"h-6 w-6":i==="sm"?"h-8 w-8":"h-16 w-16",c=i==="xs"?"h-3 w-3":i==="sm"?"h-4 w-4":"h-6 w-6",u=i==="xs"?"h-3 w-3":i==="sm"?"h-3.5 w-3.5":"h-5 w-5";let d;e[0]!==r?(d=w=>{const S=w.target.files?.[0];if(!S)return;const E=new FileReader;E.onloadend=()=>{const M=E.result;r(M)},E.readAsDataURL(S)},e[0]=r,e[1]=d):d=e[1];const f=d;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{l.current?.click()},e[2]=h):h=e[2];const m=h,g=`relative ${a} shrink-0 cursor-pointer group`;let y;e[3]!==f?(y=p.jsx("input",{type:"file",ref:l,className:"hidden",accept:"image/*",onChange:f}),e[3]=f,e[4]=y):y=e[4];let x;e[5]!==s||e[6]!==c||e[7]!==t?(x=t?p.jsx("img",{src:t,alt:s||"Avatar",className:"w-full h-full object-cover"}):p.jsx("div",{className:"w-full h-full flex items-center justify-center text-muted-foreground",children:p.jsx(Ws,{className:c})}),e[5]=s,e[6]=c,e[7]=t,e[8]=x):x=e[8];const b=`${u} text-white`;let k;e[9]!==b?(k=p.jsx("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center rounded-xl",children:p.jsx(Up,{className:b})}),e[9]=b,e[10]=k):k=e[10];let C;e[11]!==x||e[12]!==k?(C=p.jsxs("div",{className:"h-full w-full rounded-xl border border-border bg-muted/20 overflow-hidden relative",children:[x,k]}),e[11]=x,e[12]=k,e[13]=C):C=e[13];let v;return e[14]!==g||e[15]!==y||e[16]!==C?(v=p.jsxs("div",{className:g,onClick:m,children:[y,C]}),e[14]=g,e[15]=y,e[16]=C,e[17]=v):v=e[17],v}function ug(n){const e=L.c(49),{providerId:t,assistantId:r,onBack:s}=n,o=Fi();let i;e[0]!==s||e[1]!==o?(i=s??(()=>o.history.back()),e[0]=s,e[1]=o,e[2]=i):i=e[2];const l=i,{locator:a}=Lp();let c;e[3]!==r||e[4]!==a?(c=Pp.assistantChatActiveThread(a,r),e[3]=r,e[4]=a,e[5]=c):c=e[5];const[u,d]=Dp(c,dg),f=t||Ke;let h;e[6]!==f?(h=Mt(f),e[6]=f,e[7]=h):h=e[7];const m=h,g=Ui(t,"ASSISTANT",r,m),y=Ki(t,"ASSISTANT",m),x=y.update.isPending,[b,k]=N.useState(g?.model.id&&g?.gateway_id?"chat":"edit");let C;e[8]===Symbol.for("react.memo_cache_sentinel")?(C=op(Hp),e[8]=C):C=e[8];const v=g??void 0;let w;e[9]!==v?(w={resolver:C,values:v},e[9]=v,e[10]=w):w=e[10];const S=Gc(w);let E;e[11]!==y.update||e[12]!==r||e[13]!==S?(E=S.handleSubmit(async J=>{const K=await y.update.mutateAsync({id:r,data:J});S.reset(K),k("chat")}),e[11]=y.update,e[12]=r,e[13]=S,e[14]=E):E=e[14];const M=E;if(!g){let J;e[15]===Symbol.for("react.memo_cache_sentinel")?(J=p.jsx(ta,{}),e[15]=J):J=e[15];let K;e[16]===Symbol.for("react.memo_cache_sentinel")?(K=p.jsx("div",{className:"flex h-full w-full bg-background",children:p.jsx(Hs,{title:"Assistant not found",description:"This assistant may have been deleted or you may not have access to it."})}),e[16]=K):K=e[16];let H;return e[17]!==l?(H=p.jsx(nr,{children:p.jsx(N.Suspense,{fallback:J,children:p.jsx(Kr,{onBack:l,children:K})})}),e[17]=l,e[18]=H):H=e[18],H}let T;e[19]===Symbol.for("react.memo_cache_sentinel")?(T=p.jsx(ta,{}),e[19]=T):T=e[19];let R;e[20]!==g.avatar||e[21]!==g.title?(R=p.jsx("div",{className:"h-6 w-6 min-w-6 rounded-lg border border-border bg-muted/20 overflow-hidden shrink-0",children:g.avatar?p.jsx("img",{src:g.avatar,alt:g.title,className:"h-full w-full object-cover"}):p.jsx("div",{className:"h-full w-full flex items-center justify-center text-muted-foreground",children:p.jsx(Ws,{size:12,className:"text-muted-foreground"})})}),e[20]=g.avatar,e[21]=g.title,e[22]=R):R=e[22];let P;e[23]!==g.title?(P=p.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:g.title}),e[23]=g.title,e[24]=P):P=e[24];let _;e[25]!==g.description?(_=g.description?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),p.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:g.description})]}):null,e[25]=g.description,e[26]=_):_=e[26];let I;e[27]!==P||e[28]!==_?(I=p.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[P,_]}),e[27]=P,e[28]=_,e[29]=I):I=e[29];let O;e[30]!==R||e[31]!==I?(O=p.jsx(ou,{children:p.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[R,I]})}),e[30]=R,e[31]=I,e[32]=O):O=e[32];let D;e[33]!==S.formState.isDirty||e[34]!==x||e[35]!==b||e[36]!==M||e[37]!==d?(D=p.jsx(Xi,{children:b==="chat"?p.jsxs(p.Fragment,{children:[p.jsx("button",{type:"button",onClick:()=>d(crypto.randomUUID()),title:"New thread",className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",children:p.jsx(Yi,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})}),p.jsx("button",{type:"button",onClick:()=>k("edit"),title:"Edit",className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",children:p.jsx(wu,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})})]}):p.jsxs(p.Fragment,{children:[p.jsx(ie,{variant:"ghost",size:"sm",className:"h-7 gap-1.5",disabled:x,onClick:()=>k("chat"),children:"Cancel"}),p.jsx(ie,{variant:"default",size:"sm",className:"h-7 gap-1.5",disabled:!S.formState.isDirty||x,onClick:()=>{M()},children:x?p.jsxs(p.Fragment,{children:[p.jsx(Ct,{size:14,className:"animate-spin"}),"Saving..."]}):"Save"})]})}),e[33]=S.formState.isDirty,e[34]=x,e[35]=b,e[36]=M,e[37]=d,e[38]=D):D=e[38];let z;e[39]!==u||e[40]!==g||e[41]!==S||e[42]!==b?(z=p.jsx("div",{className:"h-full",children:p.jsx(lg,{activeThreadId:u,mode:b,assistant:g,form:S},S.formState.submitCount)}),e[39]=u,e[40]=g,e[41]=S,e[42]=b,e[43]=z):z=e[43];let U;return e[44]!==l||e[45]!==O||e[46]!==D||e[47]!==z?(U=p.jsx(nr,{children:p.jsx(N.Suspense,{fallback:T,children:p.jsxs(Kr,{onBack:l,children:[O,D,z]})})}),e[44]=l,e[45]=O,e[46]=D,e[47]=z,e[48]=U):U=e[48],U}function dg(n){return n||crypto.randomUUID()}function fg(n){const e=L.c(6),{itemId:t,onBack:r}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},e[0]=s):s=e[0];const i=Mn(s).connectionId??Ke;if(!i||i===Ke){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=p.jsx("div",{className:"flex h-full w-full bg-background",children:p.jsx(Hs,{title:"Assistant not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let l;return e[2]!==i||e[3]!==t||e[4]!==r?(l=p.jsx(ug,{providerId:i,assistantId:t,onBack:r}),e[2]=i,e[3]=t,e[4]=r,e[5]=l):l=e[5],l}ip({title:wo().min(1),description:wo().nullable(),body:wo()});function No(n){for(const e of n.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function hg(){const n=window.location.pathname.split("/").filter(Boolean),e=n.findIndex(r=>r==="mcps"),t=e>=0?n[e+1]:void 0;return t?decodeURIComponent(t):void 0}function pg(n){const e=L.c(13),{form:t}=n;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=p.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=r):r=e[0];let s;e[1]!==t.control?(s=p.jsxs("div",{className:"flex flex-col gap-4",children:[r,p.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[p.jsx(nt,{control:t.control,name:"title",render:yg}),p.jsx(nt,{control:t.control,name:"description",render:gg})]})]}),e[1]=t.control,e[2]=s):s=e[2];let o,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=p.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),i=p.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=o,e[4]=i):(o=e[3],i=e[4]);let l;e[5]!==t.control?(l=p.jsxs("div",{className:"flex flex-col gap-2",children:[o,i,p.jsx(nt,{control:t.control,name:"body",render:mg})]}),e[5]=t.control,e[6]=l):l=e[6];let a;e[7]!==s||e[8]!==l?(a=p.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[s,l]}),e[7]=s,e[8]=l,e[9]=a):a=e[9];let c;return e[10]!==t||e[11]!==a?(c=p.jsx(su,{...t,children:a}),e[10]=t,e[11]=a,e[12]=c):c=e[12],c}function mg(n){const{field:e}=n;return p.jsx(Ot,{children:p.jsx(An,{children:p.jsx(Ur,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function gg(n){const{field:e}=n;return p.jsxs(Ot,{children:[p.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),p.jsx(An,{children:p.jsx(In,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function yg(n){const{field:e}=n;return p.jsxs(Ot,{children:[p.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),p.jsx(An,{children:p.jsx(In,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function xg(n){const e=L.c(42),{providerId:t,promptId:r,onBack:s}=n,o=t||Ke;let i;e[0]!==o?(i=Mt(o),e[0]=o,e[1]=i):i=e[1];const l=i,a=Ui(t,"PROMPT",r,l),c=Ki(t,"PROMPT",l),u=c.update.isPending;let d;e[2]!==a?(d=a?{title:a.title,description:a.description??null,body:No(a)}:void 0,e[2]=a,e[3]=d):d=e[3];let f;e[4]!==d?(f={values:d},e[4]=d,e[5]=f):f=e[5];const h=Gc(f);let m;e[6]!==h||e[7]!==a?(m=()=>{a&&h.reset({title:a.title,description:a.description??null,body:No(a)})},e[6]=h,e[7]=a,e[8]=m):m=e[8];const g=m;let y;e[9]!==c.update||e[10]!==h||e[11]!==r?(y=h.handleSubmit(async I=>{const O=await c.update.mutateAsync({id:r,data:{title:I.title,description:I.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:I.body}}]}});h.reset({title:O.title,description:O.description??null,body:No(O)})}),e[9]=c.update,e[10]=h,e[11]=r,e[12]=y):y=e[12];const x=y;if(!a){let I;return e[13]===Symbol.for("react.memo_cache_sentinel")?(I=p.jsx("div",{className:"flex h-full w-full bg-background",children:p.jsx(Hs,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[13]=I):I=e[13],I}let b;e[14]!==a.title?(b=p.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:a.title}),e[14]=a.title,e[15]=b):b=e[15];let k;e[16]!==a.description?(k=a.description?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),p.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:a.description})]}):null,e[16]=a.description,e[17]=k):k=e[17];let C;e[18]!==b||e[19]!==k?(C=p.jsx(ou,{children:p.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[b,k]})}),e[18]=b,e[19]=k,e[20]=C):C=e[20];const v=!h.formState.isDirty||u;let w;e[21]!==g||e[22]!==v?(w=p.jsx(ie,{variant:"ghost",size:"sm",className:"h-7 gap-1.5",disabled:v,onClick:g,children:"Cancel"}),e[21]=g,e[22]=v,e[23]=w):w=e[23];const S=!h.formState.isDirty||u;let E;e[24]!==x?(E=()=>{x()},e[24]=x,e[25]=E):E=e[25];let M;e[26]!==u?(M=u?p.jsxs(p.Fragment,{children:[p.jsx(Ct,{size:14,className:"animate-spin"}),"Saving..."]}):"Save",e[26]=u,e[27]=M):M=e[27];let T;e[28]!==S||e[29]!==E||e[30]!==M?(T=p.jsx(ie,{variant:"default",size:"sm",className:"h-7 gap-1.5",disabled:S,onClick:E,children:M}),e[28]=S,e[29]=E,e[30]=M,e[31]=T):T=e[31];let R;e[32]!==w||e[33]!==T?(R=p.jsxs(Xi,{children:[w,T]}),e[32]=w,e[33]=T,e[34]=R):R=e[34];let P;e[35]!==h?(P=p.jsx("div",{className:"h-full",children:p.jsx(pg,{form:h})}),e[35]=h,e[36]=P):P=e[36];let _;return e[37]!==s||e[38]!==R||e[39]!==P||e[40]!==C?(_=p.jsxs(Kr,{onBack:s,children:[C,R,P]}),e[37]=s,e[38]=R,e[39]=P,e[40]=C,e[41]=_):_=e[41],_}function bg(n){const e=L.c(5),{itemId:t,onBack:r}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=hg()??Ke,e[0]=s):s=e[0];const o=s;if(!o||o===Ke){let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=p.jsx("div",{className:"flex h-full w-full bg-background",children:p.jsx(Hs,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=l):l=e[1],l}let i;return e[2]!==t||e[3]!==r?(i=p.jsx(nr,{children:p.jsx(N.Suspense,{fallback:null,children:p.jsx(xg,{providerId:o,promptId:t,onBack:r})})}),e[2]=t,e[3]=r,e[4]=i):i=e[4],i}const vg=lp("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function kg(n){const e=L.c(10);let t,r,s;e[0]!==n?({className:t,variant:s,...r}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=s):(t=e[1],r=e[2],s=e[3]);let o;e[4]!==t||e[5]!==s?(o=G(vg({variant:s}),t),e[4]=t,e[5]=s,e[6]=o):o=e[6];let i;return e[7]!==r||e[8]!==o?(i=p.jsx("div",{"data-slot":"alert",role:"alert",className:o,...r}),e[7]=r,e[8]=o,e[9]=i):i=e[9],i}function wg(n){const e=L.c(8);let t,r;e[0]!==n?({className:t,...r}=n,e[0]=n,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=G("line-clamp-1 min-h-4 font-medium tracking-tight",t),e[3]=t,e[4]=s):s=e[4];let o;return e[5]!==r||e[6]!==s?(o=p.jsx("div",{"data-slot":"alert-title",className:s,...r}),e[5]=r,e[6]=s,e[7]=o):o=e[7],o}function Sg(n){const e=L.c(8);let t,r;e[0]!==n?({className:t,...r}=n,e[0]=n,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=G("text-muted-foreground leading-relaxed",t),e[3]=t,e[4]=s):s=e[4];let o;return e[5]!==r||e[6]!==s?(o=p.jsx("div",{"data-slot":"alert-description",className:s,...r}),e[5]=r,e[6]=s,e[7]=o):o=e[7],o}const Cg=n=>n.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ng(n){const e=L.c(13),{toolName:t,connectionId:r,onBack:s}=n,o=`/mcp/${r}`;let i;e[0]!==o?(i=new URL(o,window.location.origin),e[0]=o,e[1]=i):i=e[1];const l=i;let a;e[2]!==r?(a={connectionId:r},e[2]=r,e[3]=a):a=e[3];const c=Xp(a);if(!c.isAuthenticated){let f;return e[4]!==c.supportsOAuth||e[5]!==s?(f=p.jsx("div",{className:"flex h-full items-center justify-center",children:c.supportsOAuth?p.jsx(Qp,{onAuthenticate:()=>s(),buttonText:"Go back to authenticate"}):p.jsx(Zp,{hasReadme:!1})}),e[4]=c.supportsOAuth,e[5]=s,e[6]=f):f=e[6],f}const u=`${r}:${t}`;let d;return e[7]!==r||e[8]!==l||e[9]!==s||e[10]!==u||e[11]!==t?(d=p.jsx(Eg,{toolName:t,connectionId:r,mcpProxyUrl:l,onBack:s},u),e[7]=r,e[8]=l,e[9]=s,e[10]=u,e[11]=t,e[12]=d):d=e[12],d}function Eg({toolName:n,connectionId:e,mcpProxyUrl:t,onBack:r}){const{replayId:s}=ap({strict:!1}),o=(()=>{if(!s)return null;const I=`replay-${s}`,O=sessionStorage.getItem(I);if(!O)return null;sessionStorage.removeItem(I);try{return JSON.parse(O)}catch{return null}})(),i=(()=>{if(!o)return null;const I={};for(const[O,D]of Object.entries(o))D!==null&&typeof D=="object"?I[O]=JSON.stringify(D,null,2):I[O]=D;return I})(),[l,a]=N.useState(i??{}),[c,u]=N.useState(o?JSON.stringify(o,null,2):"{}"),[d,f]=N.useState(null),[h,m]=N.useState(null),[g,y]=N.useState(!1),[x,b]=N.useState(null),k=Ji(e),C=el({url:t.href});N.useEffect(()=>{C.error&&console.error("MCP Error:",C.error)},[C.error]);const v=C.tools?.find(I=>I.name===n),w=v?.inputSchema?.properties,S=w?Object.keys(w):[],E=S.length>0,M={};if(E&&v?.inputSchema?.properties)for(const I of S)M[I]=v.inputSchema.required?.includes(I)?"":void 0;const T=I=>Object.prototype.hasOwnProperty.call(l,I),R=async()=>{y(!0),m(null),f(null),b(null);const I=performance.now(),O=Mt(e);try{const D=E?{...M,...l}:(()=>{const X=c.trim();if(!X)return{};const de=JSON.parse(X);if(de&&typeof de=="object")return de;throw new Error("Raw JSON input must be an object.")})();E&&v?.inputSchema?.properties&&Object.entries(v.inputSchema.properties).forEach(([X,de])=>{if((de.type==="object"||de.type==="array")&&typeof D[X]=="string")try{D[X]=JSON.parse(D[X])}catch{}});const z=await O(n,D),U=performance.now(),J=Math.round(U-I);f(z);const K=JSON.stringify(z),H=new TextEncoder().encode(K).length;b({duration:`${J}ms`,bytes:`${H} bytes`,tokens:`~${Math.ceil(H/4)} tokens`,cost:"$0.0000"})}catch(D){const z=D instanceof Error?D.message:String(D);m(z||"Unknown error occurred");const U=performance.now();b({duration:`${Math.round(U-I)}ms`})}finally{y(!1)}},P=(I,O)=>{a(D=>({...D,[I]:O}))},_=()=>{f(null),m(null),b(null)};return p.jsxs(Kr,{onBack:r,children:[p.jsx(Xi,{children:p.jsx(em,{connectionId:e,title:v?.name??Cg(n),icon:"build"})}),p.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 h-full",children:[p.jsx("div",{className:"flex flex-col border-r border-border overflow-hidden",children:p.jsxs("div",{className:"flex-1 overflow-auto",children:[p.jsx("div",{className:"flex flex-col gap-4 p-6 border-b border-border min-h-28",children:p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(Vs,{icon:k?.icon||null,name:k?.title||n,size:"sm",className:"shadow-sm shrink-0"}),p.jsx("h1",{className:"text-lg font-medium text-foreground leading-none",children:n}),p.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit",children:[C.state==="ready"?p.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):C.state==="connecting"?p.jsx(Ct,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):p.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),p.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:C.state.replace("_"," ")})]})]}),p.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:v?.description||"No description available"})]})}),p.jsxs("div",{className:"flex flex-col p-6 gap-4",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),v?.inputSchema?.required&&v.inputSchema.required.length>0&&p.jsxs("span",{className:"text-xs text-muted-foreground",children:[p.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),p.jsx("div",{className:"space-y-4",children:E&&v?.inputSchema?.properties?Object.entries(v.inputSchema.properties).map(([I,O])=>p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[I,v.inputSchema?.required?.includes(I)&&p.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),p.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:O.type})]}),O.description&&p.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:O.description}),O.type==="object"||O.type==="array"?p.jsx(Ur,{className:"font-mono text-xs",value:T(I)?l[I]??"":M[I]??"",onChange:D=>P(I,D.target.value),placeholder:`Enter ${I} as JSON...`,rows:3}):p.jsx(In,{value:T(I)?l[I]??"":M[I]??"",onChange:D=>P(I,D.target.value),placeholder:`Enter ${I}...`})]},I)):v?.inputSchema&&!E?p.jsxs("div",{className:"space-y-2",children:[p.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),p.jsx(Ur,{className:"font-mono text-xs min-h-[120px]",value:c,onChange:I=>u(I.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):p.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:p.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})})]})]})}),p.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[p.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-t lg:border-t-0 border-b border-border bg-background",children:[p.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),x&&p.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(Jp,{className:"h-3 w-3 text-muted-foreground"}),p.jsx("span",{className:"font-mono text-foreground",children:x.duration})]}),x.tokens&&p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(mu,{className:"h-3 w-3 text-muted-foreground"}),p.jsx("span",{className:"font-mono text-foreground",children:x.tokens})]}),x.bytes&&p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(ku,{className:"h-3 w-3 text-muted-foreground"}),p.jsx("span",{className:"font-mono text-foreground",children:x.bytes})]}),x.cost&&p.jsx("div",{className:"flex items-center gap-1.5",children:p.jsx("span",{className:"font-mono text-foreground",children:x.cost})})]})]}),p.jsx("div",{className:"flex items-center justify-end lg:justify-between px-4 h-14 border-b border-border bg-background",children:p.jsxs("div",{className:"flex items-center gap-2 w-full lg:w-auto",children:[p.jsx(ie,{size:"sm",variant:"default",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:R,disabled:g,children:g?p.jsxs(p.Fragment,{children:[p.jsx(Ct,{size:14,className:"animate-spin"}),"Executing..."]}):p.jsxs(p.Fragment,{children:[p.jsx(Qi,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})}),p.jsx(eu,{children:p.jsxs(tu,{children:[p.jsx(nu,{asChild:!0,children:p.jsx(ie,{size:"icon",variant:"outline",className:"h-8 w-8 shrink-0",onClick:_,disabled:!d&&!h,children:p.jsx(Zi,{size:14})})}),p.jsx(ru,{children:p.jsx("p",{children:"Clear results"})})]})})]})}),h&&p.jsx("div",{className:"px-6 py-4 bg-background",children:p.jsx(kg,{variant:"destructive",children:p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Kp,{className:"h-4 w-4"}),p.jsx(wg,{className:"mb-0",children:"Execution Failed"})]}),p.jsx(Sg,{className:"text-xs text-destructive",children:h})]})})}),p.jsx("div",{className:"relative flex-1 overflow-auto bg-muted/50",children:d?p.jsxs(p.Fragment,{children:[p.jsx(Yp,{jsonString:JSON.stringify(d,null,2),padding:"1.5rem"}),p.jsx(ie,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(d,null,2)),li.success("Copied to clipboard")},children:p.jsx(Gp,{className:"h-3.5 w-3.5"})})]}):p.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[p.jsx(yu,{className:"h-12 w-12 mb-3 opacity-40"}),p.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]})]})]})}function Tg(n){const e=L.c(7),{itemId:t,onBack:r}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},e[0]=s):s=e[0];const i=Mn(s).connectionId??Ke;if(!Ji(i)){let u;return e[1]===Symbol.for("react.memo_cache_sentinel")?(u=p.jsx("div",{className:"flex h-full items-center justify-center",children:p.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[p.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),p.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[1]=u):u=e[1],u}let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=p.jsx("div",{className:"flex h-full items-center justify-center",children:p.jsx(Ct,{size:32,className:"animate-spin text-muted-foreground"})}),e[2]=a):a=e[2];let c;return e[3]!==i||e[4]!==r||e[5]!==t?(c=p.jsx(N.Suspense,{fallback:a,children:p.jsx(Ng,{toolName:t,connectionId:i,onBack:r})}),e[3]=i,e[4]=r,e[5]=t,e[6]=c):c=e[6],c}const ca=n=>{let e;const t=new Set,r=(c,u)=>{const d=typeof c=="function"?c(e):c;if(!Object.is(d,e)){const f=e;e=u??(typeof d!="object"||d===null)?d:Object.assign({},e,d),t.forEach(h=>h(e,f))}},s=()=>e,l={setState:r,getState:s,getInitialState:()=>a,subscribe:c=>(t.add(c),()=>t.delete(c))},a=e=n(r,s,l);return l},nl=(n=>n?ca(n):ca),Mg=n=>n;function ai(n,e=Mg){const t=Y.useSyncExternalStore(n.subscribe,Y.useCallback(()=>e(n.getState()),[n,e]),Y.useCallback(()=>e(n.getInitialState()),[n,e]));return Y.useDebugValue(t),t}const Og=n=>{const e=nl(n),t=r=>ai(e,r);return Object.assign(t,e),t},Ag=(n=>Og);function Mu(n,e){let t;try{t=n()}catch{return}return{getItem:s=>{var o;const i=a=>a===null?null:JSON.parse(a,void 0),l=(o=t.getItem(s))!=null?o:null;return l instanceof Promise?l.then(i):i(l)},setItem:(s,o)=>t.setItem(s,JSON.stringify(o,void 0)),removeItem:s=>t.removeItem(s)}}const ci=n=>e=>{try{const t=n(e);return t instanceof Promise?t:{then(r){return ci(r)(t)},catch(r){return this}}}catch(t){return{then(r){return this},catch(r){return ci(r)(t)}}}},Ig=(n,e)=>(t,r,s)=>{let o={storage:Mu(()=>localStorage),partialize:g=>g,version:0,merge:(g,y)=>({...y,...g}),...e},i=!1;const l=new Set,a=new Set;let c=o.storage;if(!c)return n((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),t(...g)},r,s);const u=()=>{const g=o.partialize({...r()});return c.setItem(o.name,{state:g,version:o.version})},d=s.setState;s.setState=(g,y)=>(d(g,y),u());const f=n((...g)=>(t(...g),u()),r,s);s.getInitialState=()=>f;let h;const m=()=>{var g,y;if(!c)return;i=!1,l.forEach(b=>{var k;return b((k=r())!=null?k:f)});const x=((y=o.onRehydrateStorage)==null?void 0:y.call(o,(g=r())!=null?g:f))||void 0;return ci(c.getItem.bind(c))(o.name).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==o.version){if(o.migrate){const k=o.migrate(b.state,b.version);return k instanceof Promise?k.then(C=>[!0,C]):[!0,k]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,b.state];return[!1,void 0]}).then(b=>{var k;const[C,v]=b;if(h=o.merge(v,(k=r())!=null?k:f),t(h,!0),C)return u()}).then(()=>{x?.(h,void 0),h=r(),i=!0,a.forEach(b=>b(h))}).catch(b=>{x?.(void 0,b)})};return s.persist={setOptions:g=>{o={...o,...g},g.storage&&(c=g.storage)},clearStorage:()=>{c?.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>i,onHydrate:g=>(l.add(g),()=>{l.delete(g)}),onFinishHydration:g=>(a.add(g),()=>{a.delete(g)})},o.skipHydration||m(),h||f},Ou=Ig,{useSyncExternalStoreWithSelector:jg}=cp,Rg=n=>n;function Dg(n,e=Rg,t){const r=jg(n.subscribe,n.getState,n.getInitialState,e,t);return Y.useDebugValue(r),r}const ua=n=>Symbol.iterator in n,da=n=>"entries"in n,fa=(n,e)=>{const t=n instanceof Map?n:new Map(n.entries()),r=e instanceof Map?e:new Map(e.entries());if(t.size!==r.size)return!1;for(const[s,o]of t)if(!r.has(s)||!Object.is(o,r.get(s)))return!1;return!0},Pg=(n,e)=>{const t=n[Symbol.iterator](),r=e[Symbol.iterator]();let s=t.next(),o=r.next();for(;!s.done&&!o.done;){if(!Object.is(s.value,o.value))return!1;s=t.next(),o=r.next()}return!!s.done&&!!o.done};function Lg(n,e){return Object.is(n,e)?!0:typeof n!="object"||n===null||typeof e!="object"||e===null||Object.getPrototypeOf(n)!==Object.getPrototypeOf(e)?!1:ua(n)&&ua(e)?da(n)&&da(e)?fa(n,e):Pg(n,e):fa({entries:()=>Object.entries(n)},{entries:()=>Object.entries(e)})}function $g(n,e="Output"){if(!n)return`interface ${e} {}`;function t(o){if(!o||typeof o!="object")return"unknown";const i=o.type;if(Array.isArray(i))return i.map(l=>r(l)).join(" | ");switch(i){case"string":return o.enum?o.enum.map(l=>`"${l}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const l=o.items;return l?`${t(l)}[]`:"unknown[]"}case"object":return s(o);default:return o.anyOf?o.anyOf.map(t).join(" | "):o.oneOf?o.oneOf.map(t).join(" | "):o.allOf?o.allOf.map(t).join(" & "):"unknown"}}function r(o){switch(o){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function s(o){const i=o.properties;if(!i)return"Record<string, unknown>";const l=new Set(o.required||[]);return`{
2
2
  ${Object.entries(i).map(([c,u])=>{const d=l.has(c)?"":"?";return`${u.description?` /** ${u.description} */
3
3
  `:""} ${c}${d}: ${t(u)};`}).join(`
4
4
  `)}
5
5
  }`}return`interface ${e} ${t(n)}`}function Eo(n,e){const t=n.trim();return e.some(s=>s.name.toLowerCase()===t.toLowerCase())?`${t}_${Math.random().toString(36).substring(2,6)}`:t}function _g(n,e){const t=n.match(/interface\s+Input\s*\{/);if(!t||t.index===void 0)return`${e}
6
6
 
7
- ${n.trimStart()}`;const r=t.index,s=r+t[0].length-1;let o=1,i=s+1;for(;i<n.length&&o>0;)n[i]==="{"?o++:n[i]==="}"&&o--,i++;return n.slice(0,r)+e+n.slice(i)}function To(n,e){switch(n){case"tool":return{input:{},action:{toolName:""},outputSchema:{},name:`Step_${e+1}`};case"code":return{...Wp,name:`Step_${e+1}`};default:throw new Error(`Invalid step type: ${n}`)}}const Au=N.createContext(null),zg=n=>nl()(Ou(e=>({...n,actions:{setIsAddingStep:t=>e(r=>({...r,isAddingStep:t})),setCurrentStepTab:t=>e(r=>({...r,currentStepTab:t})),setToolAction:t=>e(r=>({workflow:{...r.workflow,steps:r.workflow.steps.map(s=>"toolName"in s.action&&s.action.toolName===t.toolName?{...s,action:t}:s)}})),appendStep:({step:t,type:r})=>e(s=>{const o=t??To(r,s.workflow.steps.length),i=s.workflow.steps.find(a=>a.name===o.name),l=i?`${o.name} ${parseInt(i.name.split(" ").pop()??Math.random().toString(36).substring(2,15))+1}`:o.name;return{workflow:{...s.workflow,steps:[...s.workflow.steps,{...o,name:l}]}}}),deleteStep:t=>e(r=>({workflow:{...r.workflow,steps:r.workflow.steps.filter(s=>s.name!==t)}})),duplicateStep:t=>e(r=>{const s=r.workflow.steps.findIndex(a=>a.name===t);if(s===-1)return r;const o=r.workflow.steps[s];if(!o)return r;const i={...o,name:Eo(o.name,r.workflow.steps)},l=[...r.workflow.steps];return l.splice(s+1,0,i),{workflow:{...r.workflow,steps:l},currentStepName:i.name}}),setCurrentStepName:t=>e(r=>({...r,currentStepName:t})),updateStep:(t,r)=>e(s=>({...s,workflow:{...s.workflow,steps:s.workflow.steps.map(o=>o.name===t?{...o,...r}:o)}})),setTrackingExecutionId:t=>e(r=>({...r,trackingExecutionId:t})),resetToOriginalWorkflow:()=>e(t=>({...t,workflow:t.originalWorkflow})),startAddingStep:t=>e(r=>({...r,isAddingStep:!0,addingStepType:t})),cancelAddingStep:()=>e(t=>({...t,isAddingStep:!1,addingStepType:null,selectedParentSteps:[]})),toggleParentStepSelection:t=>e(r=>{const s=r.selectedParentSteps.includes(t);return{...r,selectedParentSteps:s?r.selectedParentSteps.filter(o=>o!==t):[...r.selectedParentSteps,t]}}),confirmAddCodeStep:()=>e(t=>{const{selectedParentSteps:r,addingStepType:s,workflow:o}=t;if(s!=="code"||r.length===0)return t;const i={};for(const d of r)i[d]=`@${d}`;const l={};for(const d of r){const f=o.steps.find(h=>h.name===d);f?.outputSchema&&(l[d]=f.outputSchema)}const a=Object.keys(l).length>0?{type:"object",properties:l,required:Object.keys(l)}:void 0;let c=To("code",Number((Math.random()*1e6).toFixed(0)));if(c={...c,input:i},a){const d=$g(a,"Input"),f=c.action,h=_g(f.code,d);c={...c,action:{...f,code:h}}}const u=Eo(c.name,o.steps);return{...t,isAddingStep:!1,addingStepType:null,selectedParentSteps:[],workflow:{...o,steps:[...o.steps,{...c,name:u}]},currentStepName:u}}),addToolStep:()=>e(t=>{let r=To("tool",Number((Math.random()*1e6).toFixed(0)));const s=Eo(r.name,t.workflow.steps);return{...t,isAddingStep:!1,addingStepType:null,workflow:{...t.workflow,steps:[...t.workflow.steps,{...r,name:s}]},currentStepName:s}}),setOriginalWorkflow:t=>e(r=>({...r,originalWorkflow:t})),setWorkflow:t=>e(r=>({...r,workflow:t})),startReplacingTool:t=>e(r=>({...r,replacingToolInfo:{toolName:t}})),cancelReplacingTool:()=>e(t=>({...t,replacingToolInfo:null})),setSelectedGatewayId:t=>e(r=>({...r,selectedGatewayId:t}))}}),{name:`workflow-store-${encodeURIComponent(n.workflow.id).slice(0,200)}`,storage:Mu(()=>localStorage),partialize:e=>({workflow:e.workflow,trackingExecutionId:e.trackingExecutionId,currentStepName:e.currentStepName,currentStepTab:e.currentStepTab,originalWorkflow:e.originalWorkflow,isAddingStep:e.isAddingStep,addingStepType:e.addingStepType,selectedParentSteps:e.selectedParentSteps,replacingToolInfo:e.replacingToolInfo,selectedGatewayId:e.selectedGatewayId})}));function Bg(n){const e=L.c(6),{children:t,workflow:r,trackingExecutionId:s}=n;let o;e[0]!==s||e[1]!==r?(o=()=>zg({originalWorkflow:r,workflow:r,isAddingStep:!1,addingStepType:null,selectedParentSteps:[],replacingToolInfo:null,currentStepName:void 0,trackingExecutionId:s,currentStepTab:"input",selectedGatewayId:void 0}),e[0]=s,e[1]=r,e[2]=o):o=e[2];const[i]=N.useState(o);let l;return e[3]!==t||e[4]!==i?(l=p.jsx(Au.Provider,{value:i,children:t}),e[3]=t,e[4]=i,e[5]=l):l=e[5],l}function jn(n,e){const t=N.useContext(Au);if(!t)throw new Error("Missing WorkflowStoreProvider - refresh the page. If the error persists, please contact support.");return Dg(t,n,Lg)}function Rn(){return jn(Fg)}function Fg(n){return n.workflow}function Ve(){return jn(Vg)}function Vg(n){return n.actions}function Iu(){const n=gr();return jn(Hg)??n[0]?.name}function Hg(n){return n.currentStepName}function qs(){const n=L.c(5),e=Iu(),t=gr();let r;if(n[0]!==e||n[1]!==t){let o;n[3]!==e?(o=i=>i.name===e,n[3]=e,n[4]=o):o=n[4],r=t.find(o),n[0]=e,n[1]=t,n[2]=r}else r=n[2];const s=r;return s||t[0]}function gr(){return Rn().steps}function ju(){const n=L.c(4),e=Rn(),t=jn(Wg);let r;n[0]!==e?(r=JSON.stringify(e),n[0]=e,n[1]=r):r=n[1];let s;return n[2]!==t?(s=JSON.stringify(t),n[2]=t,n[3]=s):s=n[3],r!==s}function Wg(n){return n.originalWorkflow}function It(){return jn(qg)}function qg(n){return n.trackingExecutionId}function Dn(){return jn(Ug)}function Ug(n){return n.selectedGatewayId}function rl(){const n=L.c(2),e=Np();let t;n[0]!==e?(t={connections:e,binding:"WORKFLOW"},n[0]=e,n[1]=t):t=n[1];const r=qp(t);if(!r||r.length===0||!r[0])throw new Error("No workflow connection found");return r[0]}function Kg(n){const e=L.c(9);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const{connectionId:r}=Mn(t),s=r??Ke;let o;e[1]!==s?(o=Mt(s),e[1]=s,e[2]=o):o=e[2];const i=o,l=Ui(r??Ke,"workflow",n,i);let a;e[3]!==n||e[4]!==i?(a=u=>{i("COLLECTION_WORKFLOW_UPDATE",{id:n,data:u})},e[3]=n,e[4]=i,e[5]=a):a=e[5];let c;return e[6]!==l||e[7]!==a?(c={item:l,update:a},e[6]=l,e[7]=a,e[8]=c):c=e[8],c}function yr(n){const e=L.c(14),t=rl();let r;e[0]!==t.id?(r=Mt(t.id),e[0]=t.id,e[1]=r):r=e[1];const s=r;let o;e[2]!==n?(o={id:n},e[2]=n,e[3]=o):o=e[3];const i=!!n,l=n?Jg:!1;let a;e[4]!==t.id||e[5]!==o||e[6]!==i||e[7]!==l||e[8]!==s?(a={toolCaller:s,toolName:"COLLECTION_WORKFLOW_EXECUTION_GET",toolInputParams:o,scope:t.id,enabled:i,refetchInterval:l},e[4]=t.id,e[5]=o,e[6]=i,e[7]=l,e[8]=s,e[9]=a):a=e[9];const{data:c,isLoading:u}=lu(a),d=c?.item,f=c?.step_results;let h;return e[10]!==u||e[11]!==d||e[12]!==f?(h={item:d,step_results:f,isLoading:u},e[10]=u,e[11]=d,e[12]=f,e[13]=h):h=e[13],h}function Jg(n){const e=n.state?.data?.item?.status;return e==="running"||e==="enqueued"?2e3:!1}function Gg(){const n=L.c(19),e=rl(),t=Rn();let r;n[0]!==e.id?(r=Mt(e.id),n[0]=e.id,n[1]=r):r=n[1];const s=r;let o;n[2]===Symbol.for("react.memo_cache_sentinel")?(o=["workflow"],n[2]=o):o=n[2];let i;n[3]!==t.id?(i={field:o,operator:"eq",value:t.id},n[3]=t.id,n[4]=i):i=n[4];let l;n[5]===Symbol.for("react.memo_cache_sentinel")?(l=[{field:["created_at"],direction:"desc"}],n[5]=l):l=n[5];let a;n[6]!==i?(a={where:i,orderBy:l,limit:100},n[6]=i,n[7]=a):a=n[7];const c=`${e.id}-executions-${t.id}`,u=!!t.id;let d;n[8]!==a||n[9]!==c||n[10]!==u||n[11]!==s?(d={toolCaller:s,toolName:"COLLECTION_WORKFLOW_EXECUTION_LIST",toolInputParams:a,scope:c,enabled:u,staleTime:5e3},n[8]=a,n[9]=c,n[10]=u,n[11]=s,n[12]=d):d=n[12];const{data:f,isLoading:h,refetch:m}=lu(d),g=f;let y;n[13]!==g?.items?(y=g?.items??[],n[13]=g?.items,n[14]=y):y=n[14];let x;return n[15]!==h||n[16]!==m||n[17]!==y?(x={executions:y,isLoading:h,refetch:m},n[15]=h,n[16]=m,n[17]=y,n[18]=x):x=n[18],x}function Ru(n){const e=[];function t(r){if(typeof r=="string"){const s=r.match(/@input(?:\.(\w+(?:\.\w+)*))?/g);if(s)for(const o of s)if(o==="@input")e.push("__entire_input__");else{const i=o.replace("@input.","");e.push(i)}}else Array.isArray(r)?r.forEach(t):typeof r=="object"&&r!==null&&Object.values(r).forEach(t)}return t(n),[...new Set(e)]}function Yg(n){const e=[];for(const t of n){const r=Ru(t.input);e.push(...r)}return[...new Set(e)].filter(t=>t!=="__entire_input__")}function Xg(n){for(const e of n)if(Ru(e.input).includes("__entire_input__"))return!0;return!1}function Qg(n){const e=Yg(n);if(e.length===0)return Xg(n)?{type:"object",additionalProperties:!0,description:"Workflow input data"}:null;const t={},r=[];for(const s of e){const o=s.split(".");if(o.length===1)t[s]={type:"string",description:`Input field: ${s}`},r.push(s);else{const i=o[0];i&&!t[i]&&(t[i]={type:"object",description:`Input object: ${i}`,additionalProperties:!0},r.push(i))}}return{type:"object",properties:t,required:r,description:"Workflow execution input"}}function Zg(){const n=L.c(2),e=Rn();let t;return n[0]!==e.steps?(t=Qg(e.steps),n[0]=e.steps,n[1]=t):t=n[1],t}function e1(){const n=L.c(14),{id:e}=rl(),{setTrackingExecutionId:t}=Ve();let r;n[0]!==e?(r=Mt(e),n[0]=e,n[1]=r):r=n[1];const s=r,o=Rn(),i=Dn(),l=Zg();let a;n[2]!==s?(a={toolCaller:s,toolName:"COLLECTION_WORKFLOW_EXECUTION_CREATE"},n[2]=s,n[3]=a):a=n[3];const{mutateAsync:c,isPending:u}=sm(a);let d;n[4]!==i||n[5]!==t||n[6]!==c||n[7]!==o?(d=async g=>{const y=g===void 0?{}:g;if(!i)throw new Error("Please select a gateway before running the workflow");const x=Date.now(),b=await c({steps:o.steps,input:y,gateway_id:i,start_at_epoch_ms:x,timeout_ms:3e4}),k=b.id??b.structuredContent.id;return t(k),k},n[4]=i,n[5]=t,n[6]=c,n[7]=o,n[8]=d):d=n[8];const f=d,h=l!==null;let m;return n[9]!==f||n[10]!==l||n[11]!==u||n[12]!==h?(m={handleRunWorkflow:f,isPending:u,requiresInput:h,inputSchema:l},n[9]=f,n[10]=l,n[11]=u,n[12]=h,n[13]=m):m=n[13],m}function t1(){const n=L.c(4),e=It(),{step_results:t,item:r}=yr(e);let s;return n[0]!==r||n[1]!==t||n[2]!==e?(s=e&&t?(()=>{const i={};r?.input&&(i.input=r.input);for(const l of t)l.step_id&&l.output!==void 0&&(i[l.step_id]=l.output);return i})():void 0,n[0]=r,n[1]=t,n[2]=e,n[3]=s):s=n[3],s}function n1(n,e,t,r){if(!e)return[...n].sort(r);const s=t(e);return[...n].sort((o,i)=>{const l=t(o),a=t(i);return l===s?-1:a===s?1:r?r(o,i):0})}var r1=(n,e,t,r,s,o,i,l)=>{let a=document.documentElement,c=["light","dark"];function u(h){(Array.isArray(n)?n:[n]).forEach(m=>{let g=m==="class",y=g&&o?s.map(x=>o[x]||x):s;g?(a.classList.remove(...y),a.classList.add(o&&o[h]?o[h]:h)):a.setAttribute(m,h)}),d(h)}function d(h){l&&c.includes(h)&&(a.style.colorScheme=h)}function f(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)u(r);else try{let h=localStorage.getItem(e)||t,m=i&&h==="system"?f():h;u(m)}catch{}};N.createContext(void 0);N.memo(({forcedTheme:n,storageKey:e,attribute:t,enableSystem:r,enableColorScheme:s,defaultTheme:o,value:i,themes:l,nonce:a,scriptProps:c})=>{let u=JSON.stringify([t,e,o,n,l,i,r,s]).slice(1,-1);return N.createElement("script",{...c,suppressHydrationWarning:!0,nonce:typeof window>"u"?a:"",dangerouslySetInnerHTML:{__html:`(${r1.toString()})(${u})`}})});function ha(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function s1(n){if(Array.isArray(n))return n}function o1(n,e,t){return(e=f1(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function i1(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,s,o,i,l=[],a=!0,c=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(a=(r=o.call(t)).done)&&(l.push(r.value),l.length!==e);a=!0);}catch(u){c=!0,s=u}finally{try{if(!a&&t.return!=null&&(i=t.return(),Object(i)!==i))return}finally{if(c)throw s}}return l}}function l1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
7
+ ${n.trimStart()}`;const r=t.index,s=r+t[0].length-1;let o=1,i=s+1;for(;i<n.length&&o>0;)n[i]==="{"?o++:n[i]==="}"&&o--,i++;return n.slice(0,r)+e+n.slice(i)}function To(n,e){switch(n){case"tool":return{input:{},action:{toolName:""},outputSchema:{},name:`Step_${e+1}`};case"code":return{...Wp,name:`Step_${e+1}`};default:throw new Error(`Invalid step type: ${n}`)}}const Au=N.createContext(null),zg=n=>nl()(Ou(e=>({...n,actions:{setIsAddingStep:t=>e(r=>({...r,isAddingStep:t})),setCurrentStepTab:t=>e(r=>({...r,currentStepTab:t})),setToolAction:t=>e(r=>({workflow:{...r.workflow,steps:r.workflow.steps.map(s=>"toolName"in s.action&&s.action.toolName===t.toolName?{...s,action:t}:s)}})),appendStep:({step:t,type:r})=>e(s=>{const o=t??To(r,s.workflow.steps.length),i=s.workflow.steps.find(a=>a.name===o.name),l=i?`${o.name} ${parseInt(i.name.split(" ").pop()??Math.random().toString(36).substring(2,15))+1}`:o.name;return{workflow:{...s.workflow,steps:[...s.workflow.steps,{...o,name:l}]}}}),deleteStep:t=>e(r=>({workflow:{...r.workflow,steps:r.workflow.steps.filter(s=>s.name!==t)}})),duplicateStep:t=>e(r=>{const s=r.workflow.steps.findIndex(a=>a.name===t);if(s===-1)return r;const o=r.workflow.steps[s];if(!o)return r;const i={...o,name:Eo(o.name,r.workflow.steps)},l=[...r.workflow.steps];return l.splice(s+1,0,i),{workflow:{...r.workflow,steps:l},currentStepName:i.name}}),setCurrentStepName:t=>e(r=>({...r,currentStepName:t})),updateStep:(t,r)=>e(s=>({...s,workflow:{...s.workflow,steps:s.workflow.steps.map(o=>o.name===t?{...o,...r}:o)}})),setTrackingExecutionId:t=>e(r=>({...r,trackingExecutionId:t})),resetToOriginalWorkflow:()=>e(t=>({...t,workflow:t.originalWorkflow})),startAddingStep:t=>e(r=>({...r,isAddingStep:!0,addingStepType:t})),cancelAddingStep:()=>e(t=>({...t,isAddingStep:!1,addingStepType:null,selectedParentSteps:[]})),toggleParentStepSelection:t=>e(r=>{const s=r.selectedParentSteps.includes(t);return{...r,selectedParentSteps:s?r.selectedParentSteps.filter(o=>o!==t):[...r.selectedParentSteps,t]}}),confirmAddCodeStep:()=>e(t=>{const{selectedParentSteps:r,addingStepType:s,workflow:o}=t;if(s!=="code"||r.length===0)return t;const i={};for(const d of r)i[d]=`@${d}`;const l={};for(const d of r){const f=o.steps.find(h=>h.name===d);f?.outputSchema&&(l[d]=f.outputSchema)}const a=Object.keys(l).length>0?{type:"object",properties:l,required:Object.keys(l)}:void 0;let c=To("code",Number((Math.random()*1e6).toFixed(0)));if(c={...c,input:i},a){const d=$g(a,"Input"),f=c.action,h=_g(f.code,d);c={...c,action:{...f,code:h}}}const u=Eo(c.name,o.steps);return{...t,isAddingStep:!1,addingStepType:null,selectedParentSteps:[],workflow:{...o,steps:[...o.steps,{...c,name:u}]},currentStepName:u}}),addToolStep:()=>e(t=>{let r=To("tool",Number((Math.random()*1e6).toFixed(0)));const s=Eo(r.name,t.workflow.steps);return{...t,isAddingStep:!1,addingStepType:null,workflow:{...t.workflow,steps:[...t.workflow.steps,{...r,name:s}]},currentStepName:s}}),setOriginalWorkflow:t=>e(r=>({...r,originalWorkflow:t})),setWorkflow:t=>e(r=>({...r,workflow:t})),startReplacingTool:t=>e(r=>({...r,replacingToolInfo:{toolName:t}})),cancelReplacingTool:()=>e(t=>({...t,replacingToolInfo:null})),setSelectedGatewayId:t=>e(r=>({...r,selectedGatewayId:t}))}}),{name:`workflow-store-${encodeURIComponent(n.workflow.id).slice(0,200)}`,storage:Mu(()=>localStorage),partialize:e=>({workflow:e.workflow,trackingExecutionId:e.trackingExecutionId,currentStepName:e.currentStepName,currentStepTab:e.currentStepTab,originalWorkflow:e.originalWorkflow,isAddingStep:e.isAddingStep,addingStepType:e.addingStepType,selectedParentSteps:e.selectedParentSteps,replacingToolInfo:e.replacingToolInfo,selectedGatewayId:e.selectedGatewayId})}));function Bg(n){const e=L.c(6),{children:t,workflow:r,trackingExecutionId:s}=n;let o;e[0]!==s||e[1]!==r?(o=()=>zg({originalWorkflow:r,workflow:r,isAddingStep:!1,addingStepType:null,selectedParentSteps:[],replacingToolInfo:null,currentStepName:void 0,trackingExecutionId:s,currentStepTab:"input",selectedGatewayId:void 0}),e[0]=s,e[1]=r,e[2]=o):o=e[2];const[i]=N.useState(o);let l;return e[3]!==t||e[4]!==i?(l=p.jsx(Au.Provider,{value:i,children:t}),e[3]=t,e[4]=i,e[5]=l):l=e[5],l}function jn(n,e){const t=N.useContext(Au);if(!t)throw new Error("Missing WorkflowStoreProvider - refresh the page. If the error persists, please contact support.");return Dg(t,n,Lg)}function Rn(){return jn(Fg)}function Fg(n){return n.workflow}function Ve(){return jn(Vg)}function Vg(n){return n.actions}function Iu(){const n=gr();return jn(Hg)??n[0]?.name}function Hg(n){return n.currentStepName}function qs(){const n=L.c(5),e=Iu(),t=gr();let r;if(n[0]!==e||n[1]!==t){let o;n[3]!==e?(o=i=>i.name===e,n[3]=e,n[4]=o):o=n[4],r=t.find(o),n[0]=e,n[1]=t,n[2]=r}else r=n[2];const s=r;return s||t[0]}function gr(){return Rn().steps}function ju(){const n=L.c(4),e=Rn(),t=jn(Wg);let r;n[0]!==e?(r=JSON.stringify(e),n[0]=e,n[1]=r):r=n[1];let s;return n[2]!==t?(s=JSON.stringify(t),n[2]=t,n[3]=s):s=n[3],r!==s}function Wg(n){return n.originalWorkflow}function It(){return jn(qg)}function qg(n){return n.trackingExecutionId}function Dn(){return jn(Ug)}function Ug(n){return n.selectedGatewayId}function rl(){const n=L.c(2),e=Np();let t;n[0]!==e?(t={connections:e,binding:"WORKFLOW"},n[0]=e,n[1]=t):t=n[1];const r=qp(t);if(!r||r.length===0||!r[0])throw new Error("No workflow connection found");return r[0]}function Kg(n){const e=L.c(9);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const{connectionId:r}=Mn(t),s=r??Ke;let o;e[1]!==s?(o=Mt(s),e[1]=s,e[2]=o):o=e[2];const i=o,l=Ui(r??Ke,"workflow",n,i);let a;e[3]!==n||e[4]!==i?(a=u=>{i("COLLECTION_WORKFLOW_UPDATE",{id:n,data:u})},e[3]=n,e[4]=i,e[5]=a):a=e[5];let c;return e[6]!==l||e[7]!==a?(c={item:l,update:a},e[6]=l,e[7]=a,e[8]=c):c=e[8],c}function yr(n){const e=L.c(14),t=rl();let r;e[0]!==t.id?(r=Mt(t.id),e[0]=t.id,e[1]=r):r=e[1];const s=r;let o;e[2]!==n?(o={id:n},e[2]=n,e[3]=o):o=e[3];const i=!!n,l=n?Jg:!1;let a;e[4]!==t.id||e[5]!==o||e[6]!==i||e[7]!==l||e[8]!==s?(a={toolCaller:s,toolName:"COLLECTION_WORKFLOW_EXECUTION_GET",toolInputParams:o,scope:t.id,enabled:i,refetchInterval:l},e[4]=t.id,e[5]=o,e[6]=i,e[7]=l,e[8]=s,e[9]=a):a=e[9];const{data:c,isLoading:u}=lu(a),d=c?.item,f=c?.step_results;let h;return e[10]!==u||e[11]!==d||e[12]!==f?(h={item:d,step_results:f,isLoading:u},e[10]=u,e[11]=d,e[12]=f,e[13]=h):h=e[13],h}function Jg(n){const e=n.state?.data?.item?.status;return e==="running"||e==="enqueued"?2e3:!1}function Gg(){const n=L.c(19),e=rl(),t=Rn();let r;n[0]!==e.id?(r=Mt(e.id),n[0]=e.id,n[1]=r):r=n[1];const s=r;let o;n[2]===Symbol.for("react.memo_cache_sentinel")?(o=["workflow"],n[2]=o):o=n[2];let i;n[3]!==t.id?(i={field:o,operator:"eq",value:t.id},n[3]=t.id,n[4]=i):i=n[4];let l;n[5]===Symbol.for("react.memo_cache_sentinel")?(l=[{field:["created_at"],direction:"desc"}],n[5]=l):l=n[5];let a;n[6]!==i?(a={where:i,orderBy:l,limit:100},n[6]=i,n[7]=a):a=n[7];const c=`${e.id}-executions-${t.id}`,u=!!t.id;let d;n[8]!==a||n[9]!==c||n[10]!==u||n[11]!==s?(d={toolCaller:s,toolName:"COLLECTION_WORKFLOW_EXECUTION_LIST",toolInputParams:a,scope:c,enabled:u,staleTime:5e3},n[8]=a,n[9]=c,n[10]=u,n[11]=s,n[12]=d):d=n[12];const{data:f,isLoading:h,refetch:m}=lu(d),g=f;let y;n[13]!==g?.items?(y=g?.items??[],n[13]=g?.items,n[14]=y):y=n[14];let x;return n[15]!==h||n[16]!==m||n[17]!==y?(x={executions:y,isLoading:h,refetch:m},n[15]=h,n[16]=m,n[17]=y,n[18]=x):x=n[18],x}function Ru(n){const e=[];function t(r){if(typeof r=="string"){const s=r.match(/@input(?:\.(\w+(?:\.\w+)*))?/g);if(s)for(const o of s)if(o==="@input")e.push("__entire_input__");else{const i=o.replace("@input.","");e.push(i)}}else Array.isArray(r)?r.forEach(t):typeof r=="object"&&r!==null&&Object.values(r).forEach(t)}return t(n),[...new Set(e)]}function Yg(n){const e=[];for(const t of n){const r=Ru(t.input);e.push(...r)}return[...new Set(e)].filter(t=>t!=="__entire_input__")}function Xg(n){for(const e of n)if(Ru(e.input).includes("__entire_input__"))return!0;return!1}function Qg(n){const e=Yg(n);if(e.length===0)return Xg(n)?{type:"object",additionalProperties:!0,description:"Workflow input data"}:null;const t={},r=[];for(const s of e){const o=s.split(".");if(o.length===1)t[s]={type:"string",description:`Input field: ${s}`},r.push(s);else{const i=o[0];i&&!t[i]&&(t[i]={type:"object",description:`Input object: ${i}`,additionalProperties:!0},r.push(i))}}return{type:"object",properties:t,required:r,description:"Workflow execution input"}}function Zg(){const n=L.c(2),e=Rn();let t;return n[0]!==e.steps?(t=Qg(e.steps),n[0]=e.steps,n[1]=t):t=n[1],t}function e1(){const n=L.c(14),{id:e}=rl(),{setTrackingExecutionId:t}=Ve();let r;n[0]!==e?(r=Mt(e),n[0]=e,n[1]=r):r=n[1];const s=r,o=Rn(),i=Dn(),l=Zg();let a;n[2]!==s?(a={toolCaller:s,toolName:"COLLECTION_WORKFLOW_EXECUTION_CREATE"},n[2]=s,n[3]=a):a=n[3];const{mutateAsync:c,isPending:u}=sm(a);let d;n[4]!==i||n[5]!==t||n[6]!==c||n[7]!==o?(d=async g=>{const y=g===void 0?{}:g;if(!i)throw new Error("Please select a gateway before running the workflow");const x=Date.now(),b=await c({steps:o.steps,input:y,gateway_id:i,start_at_epoch_ms:x,workflow_collection_id:o.id,timeout_ms:3e4}),k=b.id??b.structuredContent.id;return t(k),k},n[4]=i,n[5]=t,n[6]=c,n[7]=o,n[8]=d):d=n[8];const f=d,h=l!==null;let m;return n[9]!==f||n[10]!==l||n[11]!==u||n[12]!==h?(m={handleRunWorkflow:f,isPending:u,requiresInput:h,inputSchema:l},n[9]=f,n[10]=l,n[11]=u,n[12]=h,n[13]=m):m=n[13],m}function t1(){const n=L.c(4),e=It(),{step_results:t,item:r}=yr(e);let s;return n[0]!==r||n[1]!==t||n[2]!==e?(s=e&&t?(()=>{const i={};r?.input&&(i.input=r.input);for(const l of t)l.step_id&&l.output!==void 0&&(i[l.step_id]=l.output);return i})():void 0,n[0]=r,n[1]=t,n[2]=e,n[3]=s):s=n[3],s}function n1(n,e,t,r){if(!e)return[...n].sort(r);const s=t(e);return[...n].sort((o,i)=>{const l=t(o),a=t(i);return l===s?-1:a===s?1:r?r(o,i):0})}var r1=(n,e,t,r,s,o,i,l)=>{let a=document.documentElement,c=["light","dark"];function u(h){(Array.isArray(n)?n:[n]).forEach(m=>{let g=m==="class",y=g&&o?s.map(x=>o[x]||x):s;g?(a.classList.remove(...y),a.classList.add(o&&o[h]?o[h]:h)):a.setAttribute(m,h)}),d(h)}function d(h){l&&c.includes(h)&&(a.style.colorScheme=h)}function f(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)u(r);else try{let h=localStorage.getItem(e)||t,m=i&&h==="system"?f():h;u(m)}catch{}};N.createContext(void 0);N.memo(({forcedTheme:n,storageKey:e,attribute:t,enableSystem:r,enableColorScheme:s,defaultTheme:o,value:i,themes:l,nonce:a,scriptProps:c})=>{let u=JSON.stringify([t,e,o,n,l,i,r,s]).slice(1,-1);return N.createElement("script",{...c,suppressHydrationWarning:!0,nonce:typeof window>"u"?a:"",dangerouslySetInnerHTML:{__html:`(${r1.toString()})(${u})`}})});function ha(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function s1(n){if(Array.isArray(n))return n}function o1(n,e,t){return(e=f1(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function i1(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,s,o,i,l=[],a=!0,c=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(a=(r=o.call(t)).done)&&(l.push(r.value),l.length!==e);a=!0);}catch(u){c=!0,s=u}finally{try{if(!a&&t.return!=null&&(i=t.return(),Object(i)!==i))return}finally{if(c)throw s}}return l}}function l1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
8
8
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pa(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function ma(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?pa(Object(t),!0).forEach(function(r){o1(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):pa(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function a1(n,e){if(n==null)return{};var t,r,s=c1(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(s[t]=n[t])}return s}function c1(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}function u1(n,e){return s1(n)||i1(n,e)||h1(n,e)||l1()}function d1(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function f1(n){var e=d1(n,"string");return typeof e=="symbol"?e:e+""}function h1(n,e){if(n){if(typeof n=="string")return ha(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ha(n,e):void 0}}function p1(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ga(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function ya(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ga(Object(t),!0).forEach(function(r){p1(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ga(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function m1(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return function(r){return e.reduceRight(function(s,o){return o(s)},r)}}function Bn(n){return function e(){for(var t=this,r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return s.length>=n.length?n.apply(this,s):function(){for(var i=arguments.length,l=new Array(i),a=0;a<i;a++)l[a]=arguments[a];return e.apply(t,[].concat(s,l))}}}function Gr(n){return{}.toString.call(n).includes("Object")}function g1(n){return!Object.keys(n).length}function rr(n){return typeof n=="function"}function y1(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function x1(n,e){return Gr(e)||bt("changeType"),Object.keys(e).some(function(t){return!y1(n,t)})&&bt("changeField"),e}function b1(n){rr(n)||bt("selectorType")}function v1(n){rr(n)||Gr(n)||bt("handlerType"),Gr(n)&&Object.values(n).some(function(e){return!rr(e)})&&bt("handlersType")}function k1(n){n||bt("initialIsRequired"),Gr(n)||bt("initialType"),g1(n)&&bt("initialContent")}function w1(n,e){throw new Error(n[e]||n.default)}var S1={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},bt=Bn(w1)(S1),Nr={changes:x1,selector:b1,handler:v1,initial:k1};function C1(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Nr.initial(n),Nr.handler(e);var t={current:n},r=Bn(T1)(t,e),s=Bn(E1)(t),o=Bn(Nr.changes)(n),i=Bn(N1)(t);function l(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(u){return u};return Nr.selector(c),c(t.current)}function a(c){m1(r,s,o,i)(c)}return[l,a]}function N1(n,e){return rr(e)?e(n.current):e}function E1(n,e){return n.current=ya(ya({},n.current),e),e}function T1(n,e,t){return rr(e)?e(n.current):Object.keys(t).forEach(function(r){var s;return(s=e[r])===null||s===void 0?void 0:s.call(e,n.current[r])}),t}var M1={create:C1},O1={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function A1(n){return function e(){for(var t=this,r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return s.length>=n.length?n.apply(this,s):function(){for(var i=arguments.length,l=new Array(i),a=0;a<i;a++)l[a]=arguments[a];return e.apply(t,[].concat(s,l))}}}function I1(n){return{}.toString.call(n).includes("Object")}function j1(n){return n||xa("configIsRequired"),I1(n)||xa("configType"),n.urls?(R1(),{paths:{vs:n.urls.monacoBase}}):n}function R1(){console.warn(Du.deprecation)}function D1(n,e){throw new Error(n[e]||n.default)}var Du={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
9
9
  You are using deprecated way of configuration.
10
10
 
@@ -1 +1 @@
1
- import{r as n,c as N,j as s}from"./index-Cvm_GyUI.js";import{B as C}from"./button-C6Q9i6bB.js";import{d as y,j as M,D as z,c as E,b as D,a as S}from"./dropdown-menu-Cf1-ucSW.js";import{i as T,a as L,c as V,b as B,T as _}from"./tooltip-CZ2WJBN2.js";import{V as W}from"./view-mode-toggle-DHnvkOqv.js";import{c as $}from"./utils-CYeWJWkG.js";const w=({size:t=24,color:e="currentColor",...r})=>n.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},n.createElement("path",{d:"M12 5v14m0 0 7-7m-7 7-7-7"}));w.displayName="ArrowDown";const k=({size:t=24,color:e="currentColor",...r})=>n.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},n.createElement("path",{d:"M21 12H9m12-6H9m12 12H9m-4-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0 12a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"}));k.displayName="List";const b=({size:t=24,color:e="currentColor",...r})=>n.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},n.createElement("path",{d:"M5 21v-7m0-4V3m7 18v-9m0-4V3m7 18v-5m0-4V3M2 14h6m1-6h6m1 8h6"}));b.displayName="Sliders01";function K(t){const e=N.c(16),{viewMode:r,onViewModeChange:g,sortKey:v,sortDirection:a,onSort:l,sortOptions:c}=t;let d;e[0]!==c?(d=c===void 0?[]:c,e[0]=c,e[1]=d):d=e[1];const m=d;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(L,{children:s.jsxs(V,{children:[s.jsx(B,{asChild:!0,children:s.jsx(z,{asChild:!0,children:s.jsx(C,{variant:"outline",size:"icon",className:"size-7 border border-input",children:s.jsx(b,{size:16})})})}),s.jsx(_,{children:"Search filters"})]})}),e[2]=h):h=e[2];let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p={value:"table",icon:s.jsx(k,{})},e[3]=p):p=e[3];let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=[p,{value:"cards",icon:s.jsx(E,{})}],e[4]=x):x=e[4];let o;e[5]!==g||e[6]!==r?(o=s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(W,{value:r,onValueChange:g,fullWidth:!0,options:x})}),e[5]=g,e[6]=r,e[7]=o):o=e[7];let i;e[8]!==l||e[9]!==a||e[10]!==v||e[11]!==m?(i=m.length>0&&l&&s.jsxs("div",{className:"p-2",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),m.map(f=>{const j=v===f.id;return s.jsx(y,{onClick:()=>l(f.id),className:$("h-8 px-2 py-0 cursor-pointer",j&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[j&&s.jsx(T,{size:16,className:"text-foreground shrink-0"}),!j&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:f.label}),j&&a&&(a==="asc"?s.jsx(M,{size:16,className:"text-foreground shrink-0"}):s.jsx(w,{size:16,className:"text-foreground shrink-0"}))]})},f.id)})]}),e[8]=l,e[9]=a,e[10]=v,e[11]=m,e[12]=i):i=e[12];let u;return e[13]!==o||e[14]!==i?(u=s.jsxs(D,{children:[h,s.jsxs(S,{align:"end",className:"w-[200px] p-0 gap-0",children:[o,i]})]}),e[13]=o,e[14]=i,e[15]=u):u=e[15],u}export{K as C,w as n};
1
+ import{r as n,c as N,j as s}from"./index-CCNaUj2A.js";import{B as C}from"./button-DuitHSR8.js";import{d as y,j as M,D as z,c as E,b as D,a as S}from"./dropdown-menu-CPQpNQmn.js";import{i as T,a as L,c as V,b as B,T as _}from"./tooltip-CqCXb38Z.js";import{V as W}from"./view-mode-toggle-DOtHoBLN.js";import{c as $}from"./utils-o1atviYh.js";const w=({size:t=24,color:e="currentColor",...r})=>n.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},n.createElement("path",{d:"M12 5v14m0 0 7-7m-7 7-7-7"}));w.displayName="ArrowDown";const k=({size:t=24,color:e="currentColor",...r})=>n.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},n.createElement("path",{d:"M21 12H9m12-6H9m12 12H9m-4-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0 12a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"}));k.displayName="List";const b=({size:t=24,color:e="currentColor",...r})=>n.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},n.createElement("path",{d:"M5 21v-7m0-4V3m7 18v-9m0-4V3m7 18v-5m0-4V3M2 14h6m1-6h6m1 8h6"}));b.displayName="Sliders01";function K(t){const e=N.c(16),{viewMode:r,onViewModeChange:g,sortKey:v,sortDirection:a,onSort:l,sortOptions:c}=t;let d;e[0]!==c?(d=c===void 0?[]:c,e[0]=c,e[1]=d):d=e[1];const m=d;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(L,{children:s.jsxs(V,{children:[s.jsx(B,{asChild:!0,children:s.jsx(z,{asChild:!0,children:s.jsx(C,{variant:"outline",size:"icon",className:"size-7 border border-input",children:s.jsx(b,{size:16})})})}),s.jsx(_,{children:"Search filters"})]})}),e[2]=h):h=e[2];let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p={value:"table",icon:s.jsx(k,{})},e[3]=p):p=e[3];let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=[p,{value:"cards",icon:s.jsx(E,{})}],e[4]=x):x=e[4];let o;e[5]!==g||e[6]!==r?(o=s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(W,{value:r,onValueChange:g,fullWidth:!0,options:x})}),e[5]=g,e[6]=r,e[7]=o):o=e[7];let i;e[8]!==l||e[9]!==a||e[10]!==v||e[11]!==m?(i=m.length>0&&l&&s.jsxs("div",{className:"p-2",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),m.map(f=>{const j=v===f.id;return s.jsx(y,{onClick:()=>l(f.id),className:$("h-8 px-2 py-0 cursor-pointer",j&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[j&&s.jsx(T,{size:16,className:"text-foreground shrink-0"}),!j&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:f.label}),j&&a&&(a==="asc"?s.jsx(M,{size:16,className:"text-foreground shrink-0"}):s.jsx(w,{size:16,className:"text-foreground shrink-0"}))]})},f.id)})]}),e[8]=l,e[9]=a,e[10]=v,e[11]=m,e[12]=i):i=e[12];let u;return e[13]!==o||e[14]!==i?(u=s.jsxs(D,{children:[h,s.jsxs(S,{align:"end",className:"w-[200px] p-0 gap-0",children:[o,i]})]}),e[13]=o,e[14]=i,e[15]=u):u=e[15],u}export{K as C,w as n};
@@ -1 +1 @@
1
- import{c as j,j as i}from"./index-Cvm_GyUI.js";import{C as b}from"./collection-display-button-CapIICNB.js";function g(h){const e=j.c(17),{title:d,viewMode:r,onViewModeChange:l,sortKey:m,sortDirection:f,onSort:x,sortOptions:n,ctaButton:p}=h;let c;e[0]!==n?(c=n===void 0?[]:n,e[0]=n,e[1]=c):c=e[1];const u=c;let t;e[2]!==d?(t=i.jsx("h1",{className:"text-sm font-medium text-foreground",children:d}),e[2]=d,e[3]=t):t=e[3];let s;e[4]!==x||e[5]!==l||e[6]!==f||e[7]!==m||e[8]!==u||e[9]!==r?(s=r&&l&&i.jsx(b,{viewMode:r,onViewModeChange:l,sortKey:m,sortDirection:f,onSort:x,sortOptions:u}),e[4]=x,e[5]=l,e[6]=f,e[7]=m,e[8]=u,e[9]=r,e[10]=s):s=e[10];let o;e[11]!==p||e[12]!==s?(o=i.jsxs("div",{className:"flex items-center gap-2",children:[s,p]}),e[11]=p,e[12]=s,e[13]=o):o=e[13];let a;return e[14]!==t||e[15]!==o?(a=i.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:i.jsxs("div",{className:"flex items-center justify-between gap-3 h-12 px-4",children:[t,o]})}),e[14]=t,e[15]=o,e[16]=a):a=e[16],a}export{g as C};
1
+ import{c as j,j as i}from"./index-CCNaUj2A.js";import{C as b}from"./collection-display-button-DgDdVSTg.js";function g(h){const e=j.c(17),{title:d,viewMode:r,onViewModeChange:l,sortKey:m,sortDirection:f,onSort:x,sortOptions:n,ctaButton:p}=h;let c;e[0]!==n?(c=n===void 0?[]:n,e[0]=n,e[1]=c):c=e[1];const u=c;let t;e[2]!==d?(t=i.jsx("h1",{className:"text-sm font-medium text-foreground",children:d}),e[2]=d,e[3]=t):t=e[3];let s;e[4]!==x||e[5]!==l||e[6]!==f||e[7]!==m||e[8]!==u||e[9]!==r?(s=r&&l&&i.jsx(b,{viewMode:r,onViewModeChange:l,sortKey:m,sortDirection:f,onSort:x,sortOptions:u}),e[4]=x,e[5]=l,e[6]=f,e[7]=m,e[8]=u,e[9]=r,e[10]=s):s=e[10];let o;e[11]!==p||e[12]!==s?(o=i.jsxs("div",{className:"flex items-center gap-2",children:[s,p]}),e[11]=p,e[12]=s,e[13]=o):o=e[13];let a;return e[14]!==t||e[15]!==o?(a=i.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:i.jsxs("div",{className:"flex items-center justify-between gap-3 h-12 px-4",children:[t,o]})}),e[14]=t,e[15]=o,e[16]=a):a=e[16],a}export{g as C};
@@ -1 +1 @@
1
- import{c as s,j as c}from"./index-Cvm_GyUI.js";function r(t){const e=s.c(2),{children:l}=t;let o;return e[0]!==l?(o=c.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden",children:l}),e[0]=l,e[1]=o):o=e[1],o}export{r as C};
1
+ import{c as s,j as c}from"./index-CCNaUj2A.js";function r(t){const e=s.c(2),{children:l}=t;let o;return e[0]!==l?(o=c.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden",children:l}),e[0]=l,e[1]=o):o=e[1],o}export{r as C};
@@ -1 +1 @@
1
- import{c as x,j as a}from"./index-Cvm_GyUI.js";import{i as u}from"./SearchMd-9OvHwtrD.js";import{I as b}from"./input-CRJkMCdz.js";import{c as g}from"./utils-CYeWJWkG.js";function w(h){const e=x.c(13),{value:n,onChange:c,placeholder:d,onKeyDown:i,className:m}=h,f=d===void 0?"Search...":d;let t;e[0]!==m?(t=g("shrink-0 w-full border-b border-border h-12",m),e[0]=m,e[1]=t):t=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(u,{size:16,className:"text-muted-foreground shrink-0"}),e[2]=o):o=e[2];let r;e[3]!==c?(r=p=>c(p.target.value),e[3]=c,e[4]=r):r=e[4];let s;e[5]!==i||e[6]!==f||e[7]!==r||e[8]!==n?(s=a.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 cursor-text",children:[o,a.jsx(b,{value:n,onChange:r,onKeyDown:i,placeholder:f,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]}),e[5]=i,e[6]=f,e[7]=r,e[8]=n,e[9]=s):s=e[9];let l;return e[10]!==t||e[11]!==s?(l=a.jsx("div",{className:t,children:s}),e[10]=t,e[11]=s,e[12]=l):l=e[12],l}export{w as C};
1
+ import{c as x,j as a}from"./index-CCNaUj2A.js";import{i as u}from"./SearchMd-C_ak4ze3.js";import{I as b}from"./input-YU6lpVgW.js";import{c as g}from"./utils-o1atviYh.js";function w(h){const e=x.c(13),{value:n,onChange:c,placeholder:d,onKeyDown:i,className:m}=h,f=d===void 0?"Search...":d;let t;e[0]!==m?(t=g("shrink-0 w-full border-b border-border h-12",m),e[0]=m,e[1]=t):t=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(u,{size:16,className:"text-muted-foreground shrink-0"}),e[2]=o):o=e[2];let r;e[3]!==c?(r=p=>c(p.target.value),e[3]=c,e[4]=r):r=e[4];let s;e[5]!==i||e[6]!==f||e[7]!==r||e[8]!==n?(s=a.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 cursor-text",children:[o,a.jsx(b,{value:n,onChange:r,onKeyDown:i,placeholder:f,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]}),e[5]=i,e[6]=f,e[7]=r,e[8]=n,e[9]=s):s=e[9];let l;return e[10]!==t||e[11]!==s?(l=a.jsx("div",{className:t,children:s}),e[10]=t,e[11]=s,e[12]=l):l=e[12],l}export{w as C};
@@ -1 +1 @@
1
- import{c as g,j as o}from"./index-Cvm_GyUI.js";import{c as u}from"./utils-CYeWJWkG.js";import{n as T}from"./collection-display-button-CapIICNB.js";import{j as $}from"./dropdown-menu-Cf1-ucSW.js";function R(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("w-full caption-bottom text-sm min-w-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("div",{"data-slot":"table-container",className:"relative w-full min-w-0",children:o.jsx("table",{"data-slot":"table",className:l,...s})}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function H(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("[&_tr]:border-b",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("thead",{"data-slot":"table-header",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function L(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("[&_tr:last-child]:border-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("tbody",{"data-slot":"table-body",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function S(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("data-[state=selected]:bg-muted border-b transition-colors",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("tr",{"data-slot":"table-row",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function z(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("th",{"data-slot":"table-head",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function D(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("td",{"data-slot":"table-cell",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function E(a){const e=g.c(29),{columns:t,data:s,sortKey:l,sortDirection:r,onSort:f,onRowClick:c,rowClassName:x}=a;let h;e[0]!==r?(h=function(n,N){return o.jsx("div",{className:"w-4 flex items-center justify-center",children:N&&r&&(r==="asc"?o.jsx($,{size:16,className:"text-muted-foreground transition-colors"}):o.jsx(T,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=r,e[1]=h):h=e[1];const w=h;let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=function(n,N){let C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider";return n===N-1&&(C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider w-8"),C},e[2]=p):p=e[2];const i=p;let d;if(e[3]!==t||e[4]!==f||e[5]!==w||e[6]!==l){let m;e[8]!==t.length||e[9]!==f||e[10]!==w||e[11]!==l?(m=(n,N)=>{const C=l===n.id;return o.jsx(z,{className:u(i(N,t.length),"group transition-colors select-none",n.sortable&&"hover:bg-accent cursor-pointer",n.rowClassName,n.cellClassName),onClick:n.sortable&&f?()=>f(n.id):void 0,children:o.jsxs("span",{className:"flex items-center gap-1",children:[n.header,n.sortable&&w(n.id,C)]})},n.id)},e[8]=t.length,e[9]=f,e[10]=w,e[11]=l,e[12]=m):m=e[12],d=t.map(m),e[3]=t,e[4]=f,e[5]=w,e[6]=l,e[7]=d}else d=e[7];let j;e[13]!==d?(j=o.jsx(H,{className:"sticky top-0 z-10 border-b-0 bg-muted/30",children:o.jsx(S,{className:"h-9 hover:bg-transparent border-b border-border",children:d})}),e[13]=d,e[14]=j):j=e[14];let v;if(e[15]!==t||e[16]!==s||e[17]!==c||e[18]!==x){let m;e[20]!==t||e[21]!==c||e[22]!==x?(m=(n,N)=>{const C=x?.(n);return o.jsx(S,{"data-row-index":N,className:u("group/data-row transition-colors border-b-0 hover:bg-accent/50",c?"cursor-pointer":"",C),onClick:c?()=>c(n):void 0,children:t.map(b=>o.jsx(D,{className:u("px-5 py-4 h-16 align-middle text-sm text-foreground",b.cellClassName,b.wrap?"whitespace-normal wrap-break-word":""),children:o.jsx("div",{className:u(b.wrap?"w-full":"min-w-0 w-full",!b.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:b.render?b.render(n):b.accessor?b.accessor(n):null})},b.id))},N)},e[20]=t,e[21]=c,e[22]=x,e[23]=m):m=e[23],v=s.map(m),e[15]=t,e[16]=s,e[17]=c,e[18]=x,e[19]=v}else v=e[19];let y;e[24]!==v?(y=o.jsx(L,{children:v}),e[24]=v,e[25]=y):y=e[25];let k;return e[26]!==j||e[27]!==y?(k=o.jsx("div",{className:"w-full bg-background min-w-0",children:o.jsxs(R,{className:"w-full border-collapse",children:[j,y]})}),e[26]=j,e[27]=y,e[28]=k):k=e[28],k}function W(a){const e=g.c(12),{columns:t,data:s,isLoading:l,sortKey:r,sortDirection:f,onSort:c,onRowClick:x,emptyState:h}=a;if(l===void 0?!1:l){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=i):i=e[0],i}if(s.length===0){let i;e[1]!==h?(i=h||o.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=h,e[2]=i):i=e[2];let d;return e[3]!==i?(d=o.jsx("div",{className:"flex items-center justify-center h-full",children:i}),e[3]=i,e[4]=d):d=e[4],d}let p;return e[5]!==t||e[6]!==s||e[7]!==x||e[8]!==c||e[9]!==f||e[10]!==r?(p=o.jsx("div",{className:"flex-1 overflow-auto",children:o.jsx(E,{columns:t,data:s,sortKey:r,sortDirection:f,onSort:c,onRowClick:x})}),e[5]=t,e[6]=s,e[7]=x,e[8]=c,e[9]=f,e[10]=r,e[11]=p):p=e[11],p}export{W as C};
1
+ import{c as g,j as o}from"./index-CCNaUj2A.js";import{c as u}from"./utils-o1atviYh.js";import{n as T}from"./collection-display-button-DgDdVSTg.js";import{j as $}from"./dropdown-menu-CPQpNQmn.js";function R(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("w-full caption-bottom text-sm min-w-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("div",{"data-slot":"table-container",className:"relative w-full min-w-0",children:o.jsx("table",{"data-slot":"table",className:l,...s})}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function H(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("[&_tr]:border-b",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("thead",{"data-slot":"table-header",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function L(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("[&_tr:last-child]:border-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("tbody",{"data-slot":"table-body",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function S(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("data-[state=selected]:bg-muted border-b transition-colors",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("tr",{"data-slot":"table-row",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function z(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("th",{"data-slot":"table-head",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function D(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("td",{"data-slot":"table-cell",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function E(a){const e=g.c(29),{columns:t,data:s,sortKey:l,sortDirection:r,onSort:f,onRowClick:c,rowClassName:x}=a;let h;e[0]!==r?(h=function(n,N){return o.jsx("div",{className:"w-4 flex items-center justify-center",children:N&&r&&(r==="asc"?o.jsx($,{size:16,className:"text-muted-foreground transition-colors"}):o.jsx(T,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=r,e[1]=h):h=e[1];const w=h;let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=function(n,N){let C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider";return n===N-1&&(C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider w-8"),C},e[2]=p):p=e[2];const i=p;let d;if(e[3]!==t||e[4]!==f||e[5]!==w||e[6]!==l){let m;e[8]!==t.length||e[9]!==f||e[10]!==w||e[11]!==l?(m=(n,N)=>{const C=l===n.id;return o.jsx(z,{className:u(i(N,t.length),"group transition-colors select-none",n.sortable&&"hover:bg-accent cursor-pointer",n.rowClassName,n.cellClassName),onClick:n.sortable&&f?()=>f(n.id):void 0,children:o.jsxs("span",{className:"flex items-center gap-1",children:[n.header,n.sortable&&w(n.id,C)]})},n.id)},e[8]=t.length,e[9]=f,e[10]=w,e[11]=l,e[12]=m):m=e[12],d=t.map(m),e[3]=t,e[4]=f,e[5]=w,e[6]=l,e[7]=d}else d=e[7];let j;e[13]!==d?(j=o.jsx(H,{className:"sticky top-0 z-10 border-b-0 bg-muted/30",children:o.jsx(S,{className:"h-9 hover:bg-transparent border-b border-border",children:d})}),e[13]=d,e[14]=j):j=e[14];let v;if(e[15]!==t||e[16]!==s||e[17]!==c||e[18]!==x){let m;e[20]!==t||e[21]!==c||e[22]!==x?(m=(n,N)=>{const C=x?.(n);return o.jsx(S,{"data-row-index":N,className:u("group/data-row transition-colors border-b-0 hover:bg-accent/50",c?"cursor-pointer":"",C),onClick:c?()=>c(n):void 0,children:t.map(b=>o.jsx(D,{className:u("px-5 py-4 h-16 align-middle text-sm text-foreground",b.cellClassName,b.wrap?"whitespace-normal wrap-break-word":""),children:o.jsx("div",{className:u(b.wrap?"w-full":"min-w-0 w-full",!b.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:b.render?b.render(n):b.accessor?b.accessor(n):null})},b.id))},N)},e[20]=t,e[21]=c,e[22]=x,e[23]=m):m=e[23],v=s.map(m),e[15]=t,e[16]=s,e[17]=c,e[18]=x,e[19]=v}else v=e[19];let y;e[24]!==v?(y=o.jsx(L,{children:v}),e[24]=v,e[25]=y):y=e[25];let k;return e[26]!==j||e[27]!==y?(k=o.jsx("div",{className:"w-full bg-background min-w-0",children:o.jsxs(R,{className:"w-full border-collapse",children:[j,y]})}),e[26]=j,e[27]=y,e[28]=k):k=e[28],k}function W(a){const e=g.c(12),{columns:t,data:s,isLoading:l,sortKey:r,sortDirection:f,onSort:c,onRowClick:x,emptyState:h}=a;if(l===void 0?!1:l){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=i):i=e[0],i}if(s.length===0){let i;e[1]!==h?(i=h||o.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=h,e[2]=i):i=e[2];let d;return e[3]!==i?(d=o.jsx("div",{className:"flex items-center justify-center h-full",children:i}),e[3]=i,e[4]=d):d=e[4],d}let p;return e[5]!==t||e[6]!==s||e[7]!==x||e[8]!==c||e[9]!==f||e[10]!==r?(p=o.jsx("div",{className:"flex-1 overflow-auto",children:o.jsx(E,{columns:t,data:s,sortKey:r,sortDirection:f,onSort:c,onRowClick:x})}),e[5]=t,e[6]=s,e[7]=x,e[8]=c,e[9]=f,e[10]=r,e[11]=p):p=e[11],p}export{W as C};
@@ -1 +1 @@
1
- import{c as S,j as s}from"./index-Cvm_GyUI.js";import{C as _}from"./card-CkqxLUmD.js";import{c as j}from"./utils-CYeWJWkG.js";import{I as A}from"./use-connection-B9lcLaJ5.js";function H(h){const e=S.c(40),{connection:t,onClick:g,headerActions:v,footer:C,className:k,size:R,fallbackIcon:z}=h,b=R===void 0?"md":R,y=b==="sm"?"p-4":"p-6",I=b==="sm"?"text-sm":"text-base",w=b==="sm"?"text-xs":"text-sm",E=g&&"hover:bg-muted/50";let i;e[0]!==k||e[1]!==E?(i=j("cursor-pointer transition-colors group",E,k),e[0]=k,e[1]=E,e[2]=i):i=e[2];let l;e[3]!==y?(l=j("flex flex-col gap-4 relative",y),e[3]=y,e[4]=l):l=e[4];let o;e[5]!==t.icon||e[6]!==t.title||e[7]!==z?(o=s.jsx(A,{icon:t.icon,name:t.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:z}),e[5]=t.icon,e[6]=t.title,e[7]=z,e[8]=o):o=e[8];let n;e[9]!==v?(n=v&&s.jsx("div",{className:j("transition-opacity","opacity-0 group-hover:opacity-100"),onClick:q,children:v}),e[9]=v,e[10]=n):n=e[10];let c;e[11]!==n?(c=s.jsx("div",{className:"relative",children:n}),e[11]=n,e[12]=c):c=e[12];let r;e[13]!==o||e[14]!==c?(r=s.jsxs("div",{className:"flex items-start justify-between",children:[o,c]}),e[13]=o,e[14]=c,e[15]=r):r=e[15];let a;e[16]!==I?(a=j("font-medium text-foreground truncate",I),e[16]=I,e[17]=a):a=e[17];let m;e[18]!==t.title||e[19]!==a?(m=s.jsx("h3",{className:a,children:t.title}),e[18]=t.title,e[19]=a,e[20]=m):m=e[20];let d;e[21]!==w?(d=j("text-muted-foreground line-clamp-2",w),e[21]=w,e[22]=d):d=e[22];const P=t.description||"No description";let f;e[23]!==d||e[24]!==P?(f=s.jsx("p",{className:d,children:P}),e[23]=d,e[24]=P,e[25]=f):f=e[25];let p;e[26]!==m||e[27]!==f?(p=s.jsxs("div",{className:"flex flex-col gap-0",children:[m,f]}),e[26]=m,e[27]=f,e[28]=p):p=e[28];let x;e[29]!==C?(x=C&&s.jsx("div",{onClick:$,children:C}),e[29]=C,e[30]=x):x=e[30];let u;e[31]!==p||e[32]!==x||e[33]!==l||e[34]!==r?(u=s.jsxs("div",{className:l,children:[r,p,x]}),e[31]=p,e[32]=x,e[33]=l,e[34]=r,e[35]=u):u=e[35];let N;return e[36]!==g||e[37]!==u||e[38]!==i?(N=s.jsx(_,{className:i,onClick:g,children:u}),e[36]=g,e[37]=u,e[38]=i,e[39]=N):N=e[39],N}function $(h){return h.stopPropagation()}function q(h){return h.stopPropagation()}export{H as C};
1
+ import{c as S,j as s}from"./index-CCNaUj2A.js";import{C as _}from"./card-DkEpNms8.js";import{c as j}from"./utils-o1atviYh.js";import{I as A}from"./use-connection-BbvAiBvg.js";function H(h){const e=S.c(40),{connection:t,onClick:g,headerActions:v,footer:C,className:k,size:R,fallbackIcon:z}=h,b=R===void 0?"md":R,y=b==="sm"?"p-4":"p-6",I=b==="sm"?"text-sm":"text-base",w=b==="sm"?"text-xs":"text-sm",E=g&&"hover:bg-muted/50";let i;e[0]!==k||e[1]!==E?(i=j("cursor-pointer transition-colors group",E,k),e[0]=k,e[1]=E,e[2]=i):i=e[2];let l;e[3]!==y?(l=j("flex flex-col gap-4 relative",y),e[3]=y,e[4]=l):l=e[4];let o;e[5]!==t.icon||e[6]!==t.title||e[7]!==z?(o=s.jsx(A,{icon:t.icon,name:t.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:z}),e[5]=t.icon,e[6]=t.title,e[7]=z,e[8]=o):o=e[8];let n;e[9]!==v?(n=v&&s.jsx("div",{className:j("transition-opacity","opacity-0 group-hover:opacity-100"),onClick:q,children:v}),e[9]=v,e[10]=n):n=e[10];let c;e[11]!==n?(c=s.jsx("div",{className:"relative",children:n}),e[11]=n,e[12]=c):c=e[12];let r;e[13]!==o||e[14]!==c?(r=s.jsxs("div",{className:"flex items-start justify-between",children:[o,c]}),e[13]=o,e[14]=c,e[15]=r):r=e[15];let a;e[16]!==I?(a=j("font-medium text-foreground truncate",I),e[16]=I,e[17]=a):a=e[17];let m;e[18]!==t.title||e[19]!==a?(m=s.jsx("h3",{className:a,children:t.title}),e[18]=t.title,e[19]=a,e[20]=m):m=e[20];let d;e[21]!==w?(d=j("text-muted-foreground line-clamp-2",w),e[21]=w,e[22]=d):d=e[22];const P=t.description||"No description";let f;e[23]!==d||e[24]!==P?(f=s.jsx("p",{className:d,children:P}),e[23]=d,e[24]=P,e[25]=f):f=e[25];let p;e[26]!==m||e[27]!==f?(p=s.jsxs("div",{className:"flex flex-col gap-0",children:[m,f]}),e[26]=m,e[27]=f,e[28]=p):p=e[28];let x;e[29]!==C?(x=C&&s.jsx("div",{onClick:$,children:C}),e[29]=C,e[30]=x):x=e[30];let u;e[31]!==p||e[32]!==x||e[33]!==l||e[34]!==r?(u=s.jsxs("div",{className:l,children:[r,p,x]}),e[31]=p,e[32]=x,e[33]=l,e[34]=r,e[35]=u):u=e[35];let N;return e[36]!==g||e[37]!==u||e[38]!==i?(N=s.jsx(_,{className:i,onClick:g,children:u}),e[36]=g,e[37]=u,e[38]=i,e[39]=N):N=e[39],N}function $(h){return h.stopPropagation()}function q(h){return h.stopPropagation()}export{H as C};