db-studio 1.18.0 → 1.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/README.md +88 -49
  2. package/dist/index.js +126 -90
  3. package/dist/index.js.map +1 -1
  4. package/dist/web-dist/assets/_pathlessLayout-2KoDg70R.js +2 -0
  5. package/dist/web-dist/assets/_pathlessLayout-B9IWhcuu.js +1 -0
  6. package/dist/web-dist/assets/_queryId-Cj11TVS_.js +1 -0
  7. package/dist/web-dist/assets/_table-79-Gj3DB.js +1 -0
  8. package/dist/web-dist/assets/_table-DqwiXW8K.js +1 -0
  9. package/dist/web-dist/assets/_table-wnnWEyoW.js +1 -0
  10. package/dist/web-dist/assets/{abap-Ds2wIDQc.js → abap-CgG5wVNY.js} +1 -1
  11. package/dist/web-dist/assets/{apex-DfqBN11z.js → apex-j_kA3haI.js} +1 -1
  12. package/dist/web-dist/assets/{azcli-COqL1c-b.js → azcli-0Mg388XK.js} +1 -1
  13. package/dist/web-dist/assets/badge-B60VPytI.js +1 -0
  14. package/dist/web-dist/assets/{bat-Nrlrgwbn.js → bat-DASZ2LNG.js} +1 -1
  15. package/dist/web-dist/assets/{bicep-DMqb4xTm.js → bicep-CL7heJBl.js} +1 -1
  16. package/dist/web-dist/assets/browser-CeHHi7P0.js +1 -0
  17. package/dist/web-dist/assets/{bundle-mjs-DfrVkH8G.js → bundle-mjs-CYj7goeC.js} +1 -1
  18. package/dist/web-dist/assets/{cameligo-DQX1RguE.js → cameligo-BsOg99gn.js} +1 -1
  19. package/dist/web-dist/assets/{chat-sidebar-p9xpAAXQ.js → chat-sidebar-DwFbnKXs.js} +9 -9
  20. package/dist/web-dist/assets/{clojure-CmnlCds-.js → clojure-CxO9AHQp.js} +1 -1
  21. package/dist/web-dist/assets/{code-editor-DsRAUGQh.js → code-editor-DOm0leY6.js} +4 -4
  22. package/dist/web-dist/assets/{coffee-CgcM3HWm.js → coffee-BAckyzYj.js} +1 -1
  23. package/dist/web-dist/assets/connect-BpkSEPls.js +1 -0
  24. package/dist/web-dist/assets/constants-BgZGgQU-.js +12 -0
  25. package/dist/web-dist/assets/{cpp-BnqpxZdA.js → cpp-BunR1P49.js} +1 -1
  26. package/dist/web-dist/assets/{csharp-B8V_ECLX.js → csharp-BaO8aYxy.js} +1 -1
  27. package/dist/web-dist/assets/{csp-Dzh7GjET.js → csp-BLTGBZQe.js} +1 -1
  28. package/dist/web-dist/assets/{css-BY0zxVqM.js → css-CF98ZCAA.js} +1 -1
  29. package/dist/web-dist/assets/{cssMode-D_jEABO9.js → cssMode-C5TixMh2.js} +1 -1
  30. package/dist/web-dist/assets/{cypher-D9AVJPko.js → cypher-D4JtjRxz.js} +1 -1
  31. package/dist/web-dist/assets/{dart-vuJN5abD.js → dart-DQ9U8EMP.js} +1 -1
  32. package/dist/web-dist/assets/database.store-CzI49QG8.js +57 -0
  33. package/dist/web-dist/assets/{dist-DmSgBrHs.js → dist-CxVc5ukz.js} +1 -1
  34. package/dist/web-dist/assets/dist-DFHV2Ot7.js +2 -0
  35. package/dist/web-dist/assets/{dockerfile-Du-akT44.js → dockerfile-BrZMt6pR.js} +1 -1
  36. package/dist/web-dist/assets/{ecl-C3XWQlLZ.js → ecl-BJCwcmJ1.js} +1 -1
  37. package/dist/web-dist/assets/{editor.api-VeMVvGYa.js → editor.api-C4TX16wd.js} +1 -1
  38. package/dist/web-dist/assets/{elixir-BzsCBGJ0.js → elixir-DHsCS2On.js} +1 -1
  39. package/dist/web-dist/assets/{esm-D_bQ4AdP.js → esm-B9MwAMFl.js} +1 -1
  40. package/dist/web-dist/assets/{flow9-z5gBTD0L.js → flow9-DGeMNykd.js} +1 -1
  41. package/dist/web-dist/assets/format-cell-value-B8ovgCmo.js +1 -0
  42. package/dist/web-dist/assets/{freemarker2-B9XmkS8x.js → freemarker2-CaCcWbsU.js} +2 -2
  43. package/dist/web-dist/assets/{fsharp-CMq6tChx.js → fsharp-4YY9n89U.js} +1 -1
  44. package/dist/web-dist/assets/{go-ClPsEbRK.js → go-DyNUrTHL.js} +1 -1
  45. package/dist/web-dist/assets/{graphql-7BvkEJ5O.js → graphql-D9bqCG0h.js} +1 -1
  46. package/dist/web-dist/assets/{handlebars-sf8CVwlq.js → handlebars-p4ZPMA_H.js} +1 -1
  47. package/dist/web-dist/assets/{hcl-DN6aCTHV.js → hcl-CFjL6tj1.js} +1 -1
  48. package/dist/web-dist/assets/highlighted-body-OFNGDK62-CGCmu3bn.js +1 -0
  49. package/dist/web-dist/assets/{html-DI5TL_8H.js → html-Nr8D0sMZ.js} +1 -1
  50. package/dist/web-dist/assets/{htmlMode-D_4DT2Lu.js → htmlMode-BM6myHlS.js} +1 -1
  51. package/dist/web-dist/assets/icons-CjWX45lj.js +1 -0
  52. package/dist/web-dist/assets/index-CSMKcupk.js +34 -0
  53. package/dist/web-dist/assets/index-DFMk_Cii.css +2 -0
  54. package/dist/web-dist/assets/indexes-B64ZI_Wn.js +1 -0
  55. package/dist/web-dist/assets/{ini-Ba74TRs3.js → ini-BDn4k5vX.js} +1 -1
  56. package/dist/web-dist/assets/{java-B1OFDleH.js → java-D-YO2VWR.js} +1 -1
  57. package/dist/web-dist/assets/{javascript-Cf3sZaZX.js → javascript-DXRDGeAZ.js} +1 -1
  58. package/dist/web-dist/assets/json-editor-S2xJY2Kx.js +1 -0
  59. package/dist/web-dist/assets/{jsonMode-CQjwhzT5.js → jsonMode-rO2Ftta6.js} +4 -4
  60. package/dist/web-dist/assets/{julia-CMywvhYA.js → julia-B-8U-d1l.js} +1 -1
  61. package/dist/web-dist/assets/keys-BPprzJmP.js +1 -0
  62. package/dist/web-dist/assets/{kotlin-BD6_sIY9.js → kotlin-CmXAhpPa.js} +1 -1
  63. package/dist/web-dist/assets/label-CVNOUqUm.js +1 -0
  64. package/dist/web-dist/assets/{less-BxdK-Aa1.js → less-SOSfAhzX.js} +1 -1
  65. package/dist/web-dist/assets/{lexon-DCaYyeqi.js → lexon-De12xV5T.js} +1 -1
  66. package/dist/web-dist/assets/{liquid-D7tk2apZ.js → liquid-DFx6O1UA.js} +1 -1
  67. package/dist/web-dist/assets/logs-CRFlPvlu.js +1 -0
  68. package/dist/web-dist/assets/{lspLanguageFeatures-DHxnBjVJ.js → lspLanguageFeatures-fx3r8Nlp.js} +3 -3
  69. package/dist/web-dist/assets/{lua-DYwtBF6d.js → lua-BZS2kSaZ.js} +1 -1
  70. package/dist/web-dist/assets/{m3-CogUFTfR.js → m3-BDc8kTWm.js} +1 -1
  71. package/dist/web-dist/assets/{markdown-COKMRj9K.js → markdown-BeZnE8gM.js} +1 -1
  72. package/dist/web-dist/assets/{mdx-H6YCl9d8.js → mdx-BYpfwnmS.js} +1 -1
  73. package/dist/web-dist/assets/mermaid-GHXKKRXX-CF_KGDPe.js +1 -0
  74. package/dist/web-dist/assets/{middleware-CEqbkwLH.js → middleware-DNv5JLGa.js} +1 -1
  75. package/dist/web-dist/assets/{mips-BDOMMsh0.js → mips-CNrGtpRe.js} +1 -1
  76. package/dist/web-dist/assets/{module-CYndhtxW.js → module-CDi4rXzC.js} +1 -1
  77. package/dist/web-dist/assets/{monaco-theme-CyGd7xOU.js → monaco-theme-BqD8Tii6.js} +4 -4
  78. package/dist/web-dist/assets/{msdax-Bt2yooL5.js → msdax-CKWZS4Cj.js} +1 -1
  79. package/dist/web-dist/assets/{mysql-Bs8-d6RT.js → mysql-BZr3Z3DP.js} +1 -1
  80. package/dist/web-dist/assets/{objective-c-DZGYv99U.js → objective-c-hKzp1cvd.js} +1 -1
  81. package/dist/web-dist/assets/{pascal-FvUHIAld.js → pascal-BEkAd_lG.js} +1 -1
  82. package/dist/web-dist/assets/{pascaligo-DEr9uXJO.js → pascaligo-DZTnedDs.js} +1 -1
  83. package/dist/web-dist/assets/{perl-DfX9jvgM.js → perl-BnkE5QAU.js} +1 -1
  84. package/dist/web-dist/assets/{personal-preferences.store-BIcu6qr5.js → personal-preferences.store-BLvzSXGN.js} +1 -1
  85. package/dist/web-dist/assets/{pgsql-B12f-wRt.js → pgsql-DG7pXIvN.js} +1 -1
  86. package/dist/web-dist/assets/{php-MynGtmh0.js → php-8QVKEp8Q.js} +1 -1
  87. package/dist/web-dist/assets/{pla-BSfIEgVT.js → pla-BWA8UBJB.js} +1 -1
  88. package/dist/web-dist/assets/{postiats-wriGJNMc.js → postiats-DqXXSDbr.js} +1 -1
  89. package/dist/web-dist/assets/{powerquery-qTNF5irm.js → powerquery-BhShmvHk.js} +1 -1
  90. package/dist/web-dist/assets/{powershell-Cr0AiP2J.js → powershell-C73oG-kA.js} +1 -1
  91. package/dist/web-dist/assets/{preload-helper-DICoZAvL.js → preload-helper-B_WR4Z6T.js} +1 -1
  92. package/dist/web-dist/assets/{protobuf-B5pCjOfx.js → protobuf-uezV85qf.js} +1 -1
  93. package/dist/web-dist/assets/{pug-BnGzsuEw.js → pug-DKgkwPxK.js} +1 -1
  94. package/dist/web-dist/assets/{python-Bd-J5HMt.js → python-CtKtLi7e.js} +1 -1
  95. package/dist/web-dist/assets/{qsharp-C-Z8Szjm.js → qsharp-QwebvYs2.js} +1 -1
  96. package/dist/web-dist/assets/queries.store-BY1UGAw9.js +1 -0
  97. package/dist/web-dist/assets/query-runner-YYCt8TAF.js +17 -0
  98. package/dist/web-dist/assets/{r-lFEgLDol.js → r-CMjDtWZm.js} +1 -1
  99. package/dist/web-dist/assets/{radix-ui-Bp71_UWp.js → radix-ui-deSt0_b9.js} +7 -7
  100. package/dist/web-dist/assets/{razor-BL-2JJuP.js → razor-CuD2w6HS.js} +1 -1
  101. package/dist/web-dist/assets/react-BH8Cquhy.js +1 -0
  102. package/dist/web-dist/assets/{react-dom-ctQEFzyp.js → react-dom-Cqz4asVS.js} +5 -5
  103. package/dist/web-dist/assets/{redis-CJPiZ1dc.js → redis-BaWLot6X.js} +1 -1
  104. package/dist/web-dist/assets/redis-value-YP_133ws.js +1 -0
  105. package/dist/web-dist/assets/{redshift-D1FKNo6F.js → redshift-Cq-2Y1GO.js} +1 -1
  106. package/dist/web-dist/assets/{restructuredtext-BdtNntNZ.js → restructuredtext-DAg3h1uA.js} +1 -1
  107. package/dist/web-dist/assets/{rolldown-runtime-Ba77kUFP.js → rolldown-runtime-CFc_0XbV.js} +1 -1
  108. package/dist/web-dist/assets/{ruby-C2uUAsPh.js → ruby-gR3Rx_yB.js} +1 -1
  109. package/dist/web-dist/assets/runner-B76n9Lso.js +1 -0
  110. package/dist/web-dist/assets/{rust-B22jVKPi.js → rust-C7v-4s8H.js} +1 -1
  111. package/dist/web-dist/assets/{sb-H5-MsoWu.js → sb-BjQMj6Ck.js} +1 -1
  112. package/dist/web-dist/assets/{scala-JHuRLUuq.js → scala-CDlk2JGU.js} +1 -1
  113. package/dist/web-dist/assets/schema-BtwO4zbG.js +1 -0
  114. package/dist/web-dist/assets/schema-CswsqIrC.js +1 -0
  115. package/dist/web-dist/assets/{scheme-CqKe-_5y.js → scheme-C4uQvWwl.js} +1 -1
  116. package/dist/web-dist/assets/{scss-C9ckl5Lm.js → scss-DR_HbFxm.js} +1 -1
  117. package/dist/web-dist/assets/{select-Cg3fBZqb.js → select-BJvLgK98.js} +1 -1
  118. package/dist/web-dist/assets/{separator-B2Ii4cjw.js → separator-DFU6yRp6.js} +1 -1
  119. package/dist/web-dist/assets/sheet-sidebar-lG9Hd9mf.js +1 -0
  120. package/dist/web-dist/assets/{shell-C9lIrU5P.js → shell-3nbA3ckv.js} +1 -1
  121. package/dist/web-dist/assets/{solidity-BdsCByFb.js → solidity-B22K_RR3.js} +1 -1
  122. package/dist/web-dist/assets/{sophia-BiYQOR15.js → sophia-Szu0pGax.js} +1 -1
  123. package/dist/web-dist/assets/{sparql-CZhOhni4.js → sparql--gEADTS8.js} +1 -1
  124. package/dist/web-dist/assets/spinner-Dihgug3b.js +1 -0
  125. package/dist/web-dist/assets/{sql-DGoEI4nz.js → sql-Bzxx_ZMh.js} +1 -1
  126. package/dist/web-dist/assets/{st-DUBBkXkg.js → st-feo0KJe0.js} +1 -1
  127. package/dist/web-dist/assets/{swift-D_36y0eN.js → swift-cvOE23v2.js} +1 -1
  128. package/dist/web-dist/assets/{systemverilog-BAtlR_WK.js → systemverilog-BvUnJocc.js} +1 -1
  129. package/dist/web-dist/assets/table-BeBhifQ8.js +1 -0
  130. package/dist/web-dist/assets/tables-BPDra69x.js +12 -0
  131. package/dist/web-dist/assets/{tanstack-HxB2LyLp.js → tanstack-BGvcrEX1.js} +4 -4
  132. package/dist/web-dist/assets/{tcl-D05MO8B_.js → tcl-CHfkQ04m.js} +1 -1
  133. package/dist/web-dist/assets/tooltip-Hxe7NIhG.js +1 -0
  134. package/dist/web-dist/assets/{tsMode-4FmdP9_o.js → tsMode-BnlkAORX.js} +1 -1
  135. package/dist/web-dist/assets/{twig-CPq3SV5E.js → twig-aSRp1yim.js} +1 -1
  136. package/dist/web-dist/assets/{typescript-CEcdsK9n.js → typescript-BkyDopbB.js} +1 -1
  137. package/dist/web-dist/assets/{typespec-I6aAHcEc.js → typespec-CzVXGIfQ.js} +1 -1
  138. package/dist/web-dist/assets/use-database-engine-B9THCU8i.js +1 -0
  139. package/dist/web-dist/assets/use-theme-C5b04JBO.js +1 -0
  140. package/dist/web-dist/assets/{utils-CNXzeC6_.js → utils-CshH-ggy.js} +1 -1
  141. package/dist/web-dist/assets/{vb-C6fWMOt8.js → vb-D2DjuDpT.js} +1 -1
  142. package/dist/web-dist/assets/visualizer-CEPsKhJ9.js +1 -0
  143. package/dist/web-dist/assets/vscode-D3Om2tQ2.js +1 -0
  144. package/dist/web-dist/assets/{wgsl-CsswhpkD.js → wgsl-oQCq0OjX.js} +1 -1
  145. package/dist/web-dist/assets/workers-3R2slzS3.js +1 -0
  146. package/dist/web-dist/assets/{xml-Clh3WxEv.js → xml-nigv0Hak.js} +1 -1
  147. package/dist/web-dist/assets/{yaml--Kwp2ruw.js → yaml-DMxBC2Lp.js} +1 -1
  148. package/dist/web-dist/index.html +31 -22
  149. package/package.json +5 -3
  150. package/dist/web-dist/assets/_pathlessLayout-D83hYFIC.js +0 -1
  151. package/dist/web-dist/assets/_pathlessLayout-DYRsUfs6.js +0 -2
  152. package/dist/web-dist/assets/_queryId-DmyRcSX-.js +0 -1
  153. package/dist/web-dist/assets/_table-CXzhHR9S.js +0 -1
  154. package/dist/web-dist/assets/_table-Cwy7lxKk.js +0 -1
  155. package/dist/web-dist/assets/_table-DaqO5XGq.js +0 -1
  156. package/dist/web-dist/assets/badge-Ckwkbv_3.js +0 -1
  157. package/dist/web-dist/assets/browser-dcbfhXDu.js +0 -1
  158. package/dist/web-dist/assets/database.store-C0jTx_DA.js +0 -57
  159. package/dist/web-dist/assets/highlighted-body-OFNGDK62-BU0nMuYA.js +0 -1
  160. package/dist/web-dist/assets/icons-BEkcNqUd.js +0 -1
  161. package/dist/web-dist/assets/index-CK2sj4Xy.css +0 -2
  162. package/dist/web-dist/assets/index-b6Apx1z7.js +0 -39
  163. package/dist/web-dist/assets/indexes-Cv0o_HTj.js +0 -1
  164. package/dist/web-dist/assets/json-editor-C9dFqjTV.js +0 -1
  165. package/dist/web-dist/assets/keys-o03XLuW4.js +0 -1
  166. package/dist/web-dist/assets/logs-Ncb6EFEi.js +0 -1
  167. package/dist/web-dist/assets/mermaid-GHXKKRXX-D3S70ynC.js +0 -1
  168. package/dist/web-dist/assets/queries.store-BbUkkWy1.js +0 -1
  169. package/dist/web-dist/assets/query-runner-DBIufzsZ.js +0 -17
  170. package/dist/web-dist/assets/react-BziCK5DU.js +0 -1
  171. package/dist/web-dist/assets/redis-value-rbj0L_ie.js +0 -1
  172. package/dist/web-dist/assets/runner-WhyDqbco.js +0 -1
  173. package/dist/web-dist/assets/schema-DdnQO20v.js +0 -1
  174. package/dist/web-dist/assets/sheet-sidebar-D8BG4Pf9.js +0 -1
  175. package/dist/web-dist/assets/spinner-gvrX8mkL.js +0 -1
  176. package/dist/web-dist/assets/table-Gq1Nd4WJ.js +0 -1
  177. package/dist/web-dist/assets/tooltip-CIAbgIn7.js +0 -12
  178. package/dist/web-dist/assets/visualizer-Cxu0_nai.js +0 -1
  179. package/dist/web-dist/assets/workers-CH8V5wKq.js +0 -1
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/chat-sidebar-DwFbnKXs.js","assets/rolldown-runtime-CFc_0XbV.js","assets/icons-CjWX45lj.js","assets/radix-ui-deSt0_b9.js","assets/bundle-mjs-CYj7goeC.js","assets/utils-CshH-ggy.js","assets/tooltip-Hxe7NIhG.js","assets/react-BH8Cquhy.js","assets/sheet-sidebar-lG9Hd9mf.js","assets/label-CVNOUqUm.js","assets/constants-BgZGgQU-.js","assets/database.store-CzI49QG8.js","assets/preload-helper-B_WR4Z6T.js","assets/separator-DFU6yRp6.js","assets/index-CSMKcupk.js","assets/tanstack-BGvcrEX1.js","assets/react-dom-Cqz4asVS.js","assets/dist-CxVc5ukz.js","assets/spinner-Dihgug3b.js","assets/dist-DFHV2Ot7.js","assets/schema-BtwO4zbG.js","assets/badge-B60VPytI.js","assets/use-database-engine-B9THCU8i.js","assets/keys-BPprzJmP.js","assets/format-cell-value-B8ovgCmo.js","assets/tables-BPDra69x.js","assets/select-BJvLgK98.js","assets/middleware-DNv5JLGa.js","assets/personal-preferences.store-BLvzSXGN.js","assets/vscode-D3Om2tQ2.js","assets/use-theme-C5b04JBO.js","assets/index-DFMk_Cii.css"])))=>i.map(i=>d[i]);
2
+ import{n as cs,r as ds}from"./rolldown-runtime-CFc_0XbV.js";import{_ as oe,b as he,f as us,g as Be,n as hs,s as se,v as te,w as ms}from"./tanstack-BGvcrEX1.js";import{$ as xs,A as fs,Ct as bs,E as Z,Et as ps,G as gs,H as vs,It as js,N as ys,Ot as Cs,P as He,Q as Ss,R as Ns,T as qe,X as ws,Z as Ue,_ as ks,a as Ts,b as we,bt as Ae,ct as Es,f as _s,g as Ds,k as ke,m as Rs,mt as Is,nt as Os,p as As,r as Fs,rt as Ls,s as Te,tt as Ms,ut as zs,v as Ps,x as $s}from"./icons-CjWX45lj.js";import{a as Ks,i as Qs,jt as Vs,n as Bs,o as Hs,r as qs,t as Us}from"./radix-ui-deSt0_b9.js";import{n as z}from"./dist-CxVc5ukz.js";import{t as T}from"./utils-CshH-ggy.js";import{t as Ws}from"./spinner-Dihgug3b.js";import{n as O}from"./dist-DFHV2Ot7.js";import{C as Gs,G as q,J as U,K as W,S as Ys,W as G,Y,c as We,d as Se,f as Ge,h as Ye,l as Xs,m as Xe,n as Js,p as Je,q as X,s as Ze,u as I,v as Ee}from"./schema-BtwO4zbG.js";import{n as M,t as Fe}from"./label-CVNOUqUm.js";import{a as J,i as _e,n as De,o as S,t as Re}from"./tooltip-Hxe7NIhG.js";import{i as Zs,n as et,s as st,t as tt}from"./sheet-sidebar-lG9Hd9mf.js";import{c as at,d as ee,l as rt,r as nt,s as es,u as lt}from"./tables-BPDra69x.js";import{B as it,r as ot,t as R}from"./constants-BgZGgQU-.js";import{i as ct,t as ss}from"./database.store-CzI49QG8.js";import{t as dt}from"./preload-helper-B_WR4Z6T.js";import{c as ut,d as ht,f as mt,l as xt,o as ft,p as bt,s as pt,t as gt,u as vt}from"./badge-B60VPytI.js";import{a as ae,i as re,n as ne,r as P,t as le}from"./select-BJvLgK98.js";import{t as Q}from"./use-database-engine-B9THCU8i.js";import{t as jt}from"./keys-BPprzJmP.js";import{r as yt,t as Ct}from"./separator-DFU6yRp6.js";import{r as Ie}from"./personal-preferences.store-BLvzSXGN.js";import{t as St}from"./use-theme-C5b04JBO.js";import{C as Nt,S as B,a as wt,b as Le,c as kt,g as Tt,h as Et,l as _t,p as Dt,u as Rt,v as It,x as Ot,y as H}from"./index-CSMKcupk.js";import{t as me}from"./queries.store-BY1UGAw9.js";import{i as At,n as ye,o as Ft,r as Lt,s as Mt}from"./redis-value-YP_133ws.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};s.SENTRY_RELEASE={id:"db-studio@1.20.0"};var t=new s.Error().stack;t&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[t]="91470a05-1213-4bfb-a051-b808ca17b399",s._sentryDebugIdIdentifier="sentry-dbid-91470a05-1213-4bfb-a051-b808ca17b399")}catch{}})();var Me={AUTHOR:"Hüsam 🥑 <husam@ql3.dev>",AUTHOR_NAME:"Hüsam",AUTHOR_AVATAR:"/avocado.png",AUTHOR_USERNAME:"husamql3",AUTHOR_GITHUB_LINK:"https://github.com/husamql3",SITE_DESCRIPTION:"The modern pgAdmin alternative that works with every database.",SITE_KEYWORDS:["pgadmin alternative","database client","database gui","database browser","sql editor","postgresql client","mysql client","table editor","ai sql","er diagram"],SITE_TITLE:"db-studio",SITE_NAME:"dbstudio.sh",SITE_URL:"https://dbstudio.sh",SITE_X_LINK:"https://x.com/dbstudio_sh",SITE_GITHUB_LINK:"https://github.com/husamql3/db-studio",SITE_GITHUB_NEW_ISSUE_LINK:"https://github.com/husamql3/db-studio/issues/new/choose",SITE_DOCS_LINK:"https://dbstudio.sh/docs",SITE_CHANGELOG_LINK:"https://dbstudio.sh/changelog",SITE_ROADMAP_LINK:"https://dbstudio.sh/roadmap",SITE_IMAGE:"https://dbstudio.sh/og-image.png",SITE_IMAGE_WIDTH:"1200",SITE_IMAGE_HEIGHT:"630",SITE_IMAGE_ALT:"dbstudio.sh – Modern database management studio",SITE_COLOR:"#1447e6"},l=ds(js(),1),zt=({enabled:s=!0}={})=>{const{data:t,isLoading:a,error:r,refetch:n}=ms({queryKey:jt.rateLimit(),queryFn:async()=>(await it()).data,enabled:s});return{rateLimit:t,isLoadingRateLimit:a,errorRateLimit:r,refetchRateLimit:n}},ts={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ze=l.createContext&&l.createContext(ts),Pt=["attr","size","title"];function $t(s,t){if(s==null)return{};var a,r,n=Kt(s,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(s);for(r=0;r<i.length;r++)a=i[r],t.indexOf(a)===-1&&{}.propertyIsEnumerable.call(s,a)&&(n[a]=s[a])}return n}function Kt(s,t){if(s==null)return{};var a={};for(var r in s)if({}.hasOwnProperty.call(s,r)){if(t.indexOf(r)!==-1)continue;a[r]=s[r]}return a}function de(){return de=Object.assign?Object.assign.bind():function(s){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(s[r]=a[r])}return s},de.apply(null,arguments)}function Pe(s,t){var a=Object.keys(s);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(s);t&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(s,n).enumerable})),a.push.apply(a,r)}return a}function ue(s){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?Pe(Object(a),!0).forEach(function(r){Qt(s,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(a)):Pe(Object(a)).forEach(function(r){Object.defineProperty(s,r,Object.getOwnPropertyDescriptor(a,r))})}return s}function Qt(s,t,a){return(t=Vt(t))in s?Object.defineProperty(s,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):s[t]=a,s}function Vt(s){var t=Bt(s,"string");return typeof t=="symbol"?t:t+""}function Bt(s,t){if(typeof s!="object"||!s)return s;var a=s[Symbol.toPrimitive];if(a!==void 0){var r=a.call(s,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(s)}function as(s){return s&&s.map((t,a)=>l.createElement(t.tag,ue({key:a},t.attr),as(t.child)))}function Ht(s){return t=>l.createElement(qt,de({attr:ue({},s.attr)},t),as(s.child))}function qt(s){var t=a=>{var{attr:r,size:n,title:i}=s,c=$t(s,Pt),o=n||a.size||"1em",u;return a.className&&(u=a.className),s.className&&(u=(u?u+" ":"")+s.className),l.createElement("svg",de({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},a.attr,r,c,{className:u,style:ue(ue({color:s.color||a.color},a.style),s.style),height:o,width:o,xmlns:"http://www.w3.org/2000/svg"}),i&&l.createElement("title",null,i),s.children)};return ze!==void 0?l.createElement(ze.Consumer,null,a=>t(a)):t(ts)}function Ut(s){return Ht({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"},child:[]},{tag:"path",attr:{d:"M9 18c-4.51 2-5-2-7-2"},child:[]}]})(s)}var e=Vs(),Ne=()=>dt(()=>import("./chat-sidebar-DwFbnKXs.js").then(s=>s.t),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31])),Wt=(0,l.lazy)(()=>Ne().then(s=>({default:s.ChatSidebar}))),Gt=()=>{const{openOverlay:s,isOverlayOpen:t}=J(),[a,r]=(0,l.useState)(!1);t("chat.assistant")&&!a&&r(!0);const{dbType:n}=ss(),{provider:i}=_t(),c=Rt(Dt),o=wt(),u=c.status[i],m=u?.state==="set"||u?.state==="locked",{rateLimit:f,isLoadingRateLimit:p,errorRateLimit:x}=zt({enabled:o&&i==="gemini"&&!m}),{remaining:g=0,limit:h=0}=f??{remaining:0,limit:0},y=m?"bg-emerald-500":p||x?"bg-zinc-500":i!=="gemini"||g===0?"bg-red-500":g<=5?"bg-yellow-500":"bg-emerald-500";return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(Re,{children:[(0,e.jsx)(_e,{asChild:!0,children:(0,e.jsxs)(S,{variant:"ghost",className:"rounded-none size-12 relative text-muted-foreground hover:text-foreground hover:bg-muted/60 transition-colors","aria-label":"Open AI assistant",onPointerEnter:Ne,onFocus:Ne,onClick:()=>{s("chat.assistant"),n&&ct.capture("chat_opened",{db_type:n})},children:[(0,e.jsx)(ks,{className:"size-5"}),(0,e.jsx)("span",{"data-testid":"chat-status-indicator",className:T("absolute top-2 right-2 h-2 w-2 rounded-full ring-2 ring-background",y)})]})}),(0,e.jsx)(De,{side:"right",className:"text-xs",children:m?(0,e.jsxs)("p",{children:["AI Assistant · personal ",i," key"]}):!p&&!x?g>0?(0,e.jsxs)("p",{children:[g,"/",h," messages remaining"]}):(0,e.jsx)("p",{children:"AI Assistant"}):(0,e.jsx)("p",{children:"AI status unavailable"})})]}),a&&(0,e.jsx)(l.Suspense,{children:(0,e.jsx)(Wt,{})})]})},Yt={table:_s,runner:Ds,schema:zs,indexes:Ns,logs:$s,visualizer:Fs,browser:Ss},xe="relative flex size-12 shrink-0 items-center justify-center text-muted-foreground transition-colors hover:bg-muted/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",fe=({label:s,children:t})=>(0,e.jsxs)(Re,{children:[(0,e.jsx)(_e,{asChild:!0,children:t}),(0,e.jsx)(De,{side:"right",children:(0,e.jsx)("p",{className:"capitalize",children:s})})]}),Xt=()=>{const{pathname:s}=se(),t=he({strict:!1}),a=Q(),r=s.split("/")[1]||"table",n=a?.dataModel==="key-value"?["browser","runner","logs"]:ot.filter(o=>(o!=="indexes"||a?.indexes)&&(o!=="logs"||a?.serverLogs)),i=t.table,c=Ee();return n.map(o=>{const u=Yt[o],m=(o==="table"||o==="schema"||o==="indexes")&&i,f=r===o;return(0,e.jsx)(fe,{label:o,children:(0,e.jsx)(Be,{to:m?`/${o}/$table`:`/${o}`,params:m?{table:i}:void 0,search:m?{[R.TABLE_SCHEMA]:c}:void 0,"aria-label":o,"aria-current":f?"page":void 0,className:T(xe,f&&"bg-muted text-foreground"),children:(0,e.jsx)(u,{className:"size-5"})})},o)})},Jt=()=>{const{sidebar:{isOpen:s},setSidebarOpen:t,setSidebarPinned:a}=Ie();return(0,e.jsx)(fe,{label:s?"Hide sidebar":"Show sidebar",children:(0,e.jsx)("button",{type:"button","aria-label":"Toggle sidebar",className:xe,onClick:()=>{t(!s),a(!s)},children:(0,e.jsx)(fs,{className:"size-5"})})})},$e=[{value:"light",label:"Light",icon:As},{value:"dark",label:"Dark",icon:ys},{value:"system",label:"System",icon:He}],Zt=()=>{const{theme:s,setTheme:t}=St(),a=$e.find(r=>r.value===s)?.icon??He;return(0,e.jsxs)(Ze,{children:[(0,e.jsx)(fe,{label:"More",children:(0,e.jsx)(Ye,{asChild:!0,children:(0,e.jsx)("button",{type:"button","aria-label":"More",className:xe,children:(0,e.jsx)(Ms,{className:"size-5"})})})}),(0,e.jsxs)(We,{side:"right",align:"end",sideOffset:8,className:"w-48",children:[(0,e.jsxs)(Ge,{children:[(0,e.jsxs)(Xe,{children:[(0,e.jsx)(a,{}),"Theme"]}),(0,e.jsx)(Je,{children:$e.map(({value:r,label:n,icon:i})=>(0,e.jsxs)(I,{onClick:()=>t(r),children:[(0,e.jsx)(i,{}),n,s===r&&(0,e.jsx)(bs,{className:"ml-auto"})]},r))})]}),(0,e.jsx)(Se,{}),(0,e.jsx)(I,{asChild:!0,children:(0,e.jsxs)("a",{href:Me.SITE_GITHUB_NEW_ISSUE_LINK,target:"_blank",rel:"noopener noreferrer",children:[(0,e.jsx)(ps,{}),"Report a bug"]})}),(0,e.jsx)(I,{asChild:!0,children:(0,e.jsxs)("a",{href:Me.SITE_GITHUB_LINK,target:"_blank",rel:"noopener noreferrer",children:[(0,e.jsx)(Ut,{}),"View on GitHub"]})})]})]})},Ke=()=>(0,e.jsx)("div",{className:"h-px w-full shrink-0 bg-border"}),ea=()=>{const{openOverlay:s}=J();return(0,e.jsxs)("nav",{"aria-label":"Main",className:"flex shrink-0 flex-col border-r border-border bg-background",style:{width:R.RAIL_WIDTH},children:[(0,e.jsx)(Jt,{}),(0,e.jsx)(Ke,{}),(0,e.jsx)(Xt,{}),(0,e.jsxs)("div",{className:"mt-auto flex flex-col",children:[(0,e.jsx)(Ke,{}),(0,e.jsx)(Gt,{}),(0,e.jsx)(fe,{label:"Settings",children:(0,e.jsx)("button",{type:"button","aria-label":"Open settings",className:xe,onClick:()=>s("settings.app"),children:(0,e.jsx)(Ps,{className:"size-5"})})}),(0,e.jsx)(Zt,{})]})]})};function rs({...s}){return(0,e.jsx)(Qs,{"data-slot":"context-menu",...s})}function ns({className:s,...t}){return(0,e.jsx)(Hs,{"data-slot":"context-menu-trigger",className:T("select-none",s),...t})}function ls({className:s,...t}){return(0,e.jsx)(qs,{children:(0,e.jsx)(Us,{"data-slot":"context-menu-content",className:T("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 z-50 max-h-(--radix-context-menu-content-available-height) origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto",s),...t})})}function $({className:s,inset:t,variant:a="default",...r}){return(0,e.jsx)(Bs,{"data-slot":"context-menu-item","data-inset":t,"data-variant":a,className:T("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 group/context-menu-item relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",s),...r})}function Qe({className:s,...t}){return(0,e.jsx)(Ks,{"data-slot":"context-menu-separator",className:T("bg-border/50 -mx-1 my-1 h-px",s),...t})}var Ce=({folderId:s,isExpanded:t,onToggle:a,count:r,name:n,showContextMenu:i=!1})=>{const c=te(),{deleteFolder:o,getQueriesByFolder:u,addQuery:m,updateFolder:f}=me(),[p,x]=(0,l.useState)(!1),[g,h]=(0,l.useState)(""),[v,y]=(0,l.useState)(!1),b=(0,l.useCallback)(()=>{if(s){if(u(s).length>0){y(!0);return}o(s)}},[o,s,u]),w=(0,l.useCallback)(()=>{s&&(o(s),y(!1))},[o,s]),E=(0,l.useCallback)(()=>{const k=m(void 0,s);c({to:"/runner/$queryId",params:{queryId:k}})},[m,s,c]),d=(0,l.useCallback)(()=>{h(n),x(!0)},[n]),j=(0,l.useCallback)(()=>{s&&g.trim()&&(f(s,{name:g.trim()}),x(!1),h(""))},[s,g,f]);return(0,e.jsxs)(e.Fragment,{children:[i?(0,e.jsxs)(rs,{children:[(0,e.jsx)(ns,{asChild:!0,children:(0,e.jsxs)("button",{type:"button",onClick:a,className:T("w-full flex gap-2 px-4 py-2 text-sm transition-colors text-left","hover:bg-sidebar-accent/50 hover:text-sidebar-foreground focus:outline-none focus:bg-sidebar-accent focus:text-sidebar-accent-foreground","text-sidebar-foreground/70 items-center"),children:[(0,e.jsx)(Ae,{className:T("size-4 transition-transform duration-200",t?"rotate-90":"")}),(0,e.jsx)("span",{className:"flex-1",children:n}),(0,e.jsx)(ee,{children:r})]})}),(0,e.jsxs)(ls,{children:[(0,e.jsxs)($,{onClick:E,children:[(0,e.jsx)(Z,{className:"size-4"}),"Add a new query"]}),(0,e.jsxs)($,{onClick:d,children:[(0,e.jsx)(ke,{className:"size-4"}),"Rename folder"]}),(0,e.jsxs)($,{onClick:b,children:[(0,e.jsx)(Te,{className:"size-4"}),"Delete folder"]})]})]}):(0,e.jsxs)("button",{type:"button",onClick:a,className:T("w-full flex gap-2 px-4 py-2 text-sm transition-colors text-left","hover:bg-sidebar-accent/50 hover:text-sidebar-foreground focus:outline-none focus:bg-sidebar-accent focus:text-sidebar-accent-foreground","text-sidebar-foreground/70 items-center"),children:[(0,e.jsx)(Ae,{className:T("size-4 transition-transform duration-200",t?"rotate-90":"")}),(0,e.jsx)("span",{className:"flex-1",children:n}),(0,e.jsx)(ee,{children:r})]}),(0,e.jsx)(G,{open:p,onOpenChange:x,children:(0,e.jsxs)(q,{children:[(0,e.jsxs)(U,{children:[(0,e.jsx)(Y,{children:"Rename Folder"}),(0,e.jsx)(W,{children:"Enter a new name for this folder."})]}),(0,e.jsx)(M,{value:g,onChange:k=>h(k.target.value),placeholder:"Folder name",onKeyDown:k=>{k.key==="Enter"&&j()},autoFocus:!0}),(0,e.jsxs)(X,{children:[(0,e.jsx)(S,{variant:"outline",onClick:()=>{x(!1),h("")},children:"Cancel"}),(0,e.jsx)(S,{onClick:j,disabled:!g.trim(),children:"Rename"})]})]})}),(0,e.jsx)(ft,{open:v,onOpenChange:y,children:(0,e.jsxs)(xt,{children:[(0,e.jsxs)(mt,{children:[(0,e.jsx)(bt,{children:"Delete Folder"}),(0,e.jsxs)(vt,{children:["This folder contains ",r," ",r===1?"query":"queries",". Deleting this folder will also delete all queries inside it. This action cannot be undone."]})]}),(0,e.jsxs)(ht,{children:[(0,e.jsx)(ut,{children:"Cancel"}),(0,e.jsx)(pt,{onClick:w,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Folder"})]})]})})]})},ce=({id:s,tableName:t,isNested:a=!1,showContextMenu:r=!0})=>{const n=te(),{deleteQuery:i,addQuery:c,getQuery:o,toggleFavorite:u,updateQuery:m,moveQuery:f,folders:p,addFolder:x}=me(),{queryId:g}=he({strict:!1}),h=g===s,v=o(s),y=v?.isFavorite??!1,[b,w]=(0,l.useState)(!1),[E,d]=(0,l.useState)(""),[j,k]=(0,l.useState)(!1),[V,A]=(0,l.useState)(void 0),[F,_]=(0,l.useState)(!1),[D,L]=(0,l.useState)(""),ie=(0,l.useCallback)(()=>{n({to:"/runner/$queryId",params:{queryId:s}})},[n,s]),be=(0,l.useCallback)(()=>{i(s),g===s&&n({to:"/runner"}),z.success("Query deleted successfully")},[i,s,n,g]),pe=(0,l.useCallback)(()=>{const C=o(s),os=c(`${C?.name} (Copy)`);n({to:"/runner/$queryId",params:{queryId:os}}),z.success("Query duplicated successfully")},[c,o,n,s]),ge=(0,l.useCallback)(()=>{u(s),z.success("Query favorited successfully")},[u,s]),ve=(0,l.useCallback)(()=>{d(v?.name??""),w(!0)},[v?.name]),N=(0,l.useCallback)(()=>{E.trim()&&(m(s,{name:E.trim()}),w(!1),d(""),z.success("Query renamed successfully"))},[s,E,m]),je=(0,l.useCallback)(()=>{A(v?.folderId),_(!1),L(""),k(!0)},[v?.folderId]),is=(0,l.useCallback)(C=>{C==="__create_new__"?(_(!0),A(void 0)):(_(!1),A(C==="__none__"?void 0:C))},[]),Oe=(0,l.useCallback)(()=>{if(F&&D.trim()){const C=Math.random().toString(36).substring(2,15);x({id:C,name:D.trim(),isExpanded:!0,isFavorite:!1}),f(s,C),z.success("Query moved to new folder successfully")}else F||(f(s,V),z.success("Query moved to selected folder successfully"));k(!1),_(!1),L(""),A(void 0)},[F,D,V,s,x,f]);return(0,e.jsxs)("li",{className:"relative",children:[r?(0,e.jsxs)(rs,{children:[(0,e.jsx)(ns,{asChild:!0,children:(0,e.jsxs)("button",{type:"button",onClick:ie,className:T("w-full flex gap-2 py-2 text-sm transition-colors text-left justify-start items-center focus:outline-none",h?"text-sidebar-accent-foreground bg-sidebar-accent font-medium":"text-sidebar-foreground/70 hover:text-sidebar-foreground hover:bg-sidebar-accent/50 focus:bg-sidebar-accent focus:text-sidebar-accent-foreground",a?"px-4 pl-12":"px-4"),children:[h&&(0,e.jsx)("span",{className:"absolute left-0 top-0 bottom-0 w-1 bg-primary"}),(0,e.jsx)("span",{className:"flex-1",children:t})]})}),(0,e.jsxs)(ls,{children:[(0,e.jsxs)($,{onClick:ve,children:[(0,e.jsx)(ke,{className:"size-4"}),"Rename query"]}),(0,e.jsxs)($,{onClick:pe,children:[(0,e.jsx)(Es,{className:"size-4"}),"Duplicate query"]}),(0,e.jsxs)($,{onClick:ge,children:[(0,e.jsx)(Rs,{className:y?"size-4 fill-current":"size-4"}),y?"Remove from favorites":"Add to favorites"]}),(0,e.jsx)(Qe,{}),(0,e.jsxs)($,{onClick:je,children:[(0,e.jsx)(ws,{className:"size-4"}),"Move to folder"]}),(0,e.jsx)(Qe,{}),(0,e.jsxs)($,{onClick:be,children:[(0,e.jsx)(Te,{className:"size-4"}),"Delete query"]})]})]}):(0,e.jsxs)("button",{type:"button",onClick:ie,className:T("w-full flex gap-2 py-2 text-sm transition-colors text-left justify-start items-center focus:outline-none",h?"text-sidebar-accent-foreground bg-sidebar-accent font-medium":"text-sidebar-foreground/70 hover:text-sidebar-foreground hover:bg-sidebar-accent/50 focus:bg-sidebar-accent focus:text-sidebar-accent-foreground",a?"px-4 pl-12":"px-4"),children:[h&&(0,e.jsx)("span",{className:"absolute left-0 top-0 bottom-0 w-1 bg-primary"}),(0,e.jsx)("span",{className:"flex-1",children:t})]}),(0,e.jsx)(G,{open:b,onOpenChange:w,children:(0,e.jsxs)(q,{children:[(0,e.jsxs)(U,{children:[(0,e.jsx)(Y,{children:"Rename Query"}),(0,e.jsx)(W,{children:"Enter a new name for this query."})]}),(0,e.jsx)(M,{value:E,onChange:C=>d(C.target.value),placeholder:"Query name",onKeyDown:C=>{C.key==="Enter"&&N()},autoFocus:!0}),(0,e.jsxs)(X,{children:[(0,e.jsx)(S,{variant:"outline",onClick:()=>{w(!1),d("")},children:"Cancel"}),(0,e.jsx)(S,{onClick:N,disabled:!E.trim(),children:"Rename"})]})]})}),(0,e.jsx)(G,{open:j,onOpenChange:C=>{k(C),C||(_(!1),L(""),A(void 0))},children:(0,e.jsxs)(q,{children:[(0,e.jsxs)(U,{children:[(0,e.jsx)(Y,{children:"Move to Folder"}),(0,e.jsx)(W,{children:"Select a folder to move this query to."})]}),(0,e.jsx)("div",{className:"space-y-4",children:F?(0,e.jsx)(M,{value:D,onChange:C=>L(C.target.value),placeholder:"Folder name",onKeyDown:C=>{C.key==="Enter"&&D.trim()&&Oe(),C.key==="Escape"&&(_(!1),L(""))},autoFocus:!0}):(0,e.jsxs)(le,{value:V??"__none__",onValueChange:is,children:[(0,e.jsx)(re,{className:"w-full",children:(0,e.jsx)(ae,{placeholder:"Select a folder"})}),(0,e.jsxs)(ne,{children:[(0,e.jsx)(P,{value:"__none__",children:"No folder"}),p.map(C=>(0,e.jsx)(P,{value:C.id,children:C.name},C.id)),(0,e.jsx)(P,{value:"__create_new__",children:(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(Ue,{className:"size-4"}),"Create a new folder"]})})]})]})}),(0,e.jsxs)(X,{children:[(0,e.jsx)(S,{variant:"outline",onClick:()=>{k(!1),_(!1),L(""),A(void 0)},children:"Cancel"}),(0,e.jsx)(S,{onClick:Oe,disabled:F&&!D.trim(),children:F?"Create & Move":"Move"})]})]})})]})},sa=()=>{const[s]=O(R.SIDEBAR_SEARCH,{defaultValue:""}),{folders:t,queries:a,getFavoriteQueries:r,getQueriesByFolder:n,toggleFolder:i}=me(),[c,o]=(0,l.useState)(!0),[u,m]=(0,l.useState)(!0),f=a.filter(h=>!h.isFavorite).length,p=r(),x=p.length,g=a.filter(h=>!h.folderId&&!h.isFavorite);if(s){const h=a.filter(v=>v.name.toLowerCase().includes(s.toLowerCase()));return h.length===0?(0,e.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:"No queries found matching"}):(0,e.jsx)("div",{className:"flex-1 overflow-y-auto",children:h.map(v=>(0,e.jsx)(ce,{id:v.id,tableName:v.name},v.id))})}return(0,e.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[(0,e.jsx)(Ce,{name:"Favorites",isExpanded:c,onToggle:()=>o(!c),count:x}),c&&p.map(h=>(0,e.jsx)(ce,{id:h.id,tableName:h.name},h.id)),(0,e.jsx)(Ct,{className:"bg-sidebar-border"}),(0,e.jsx)(Ce,{name:"Queries",isExpanded:u,onToggle:()=>m(!u),count:f}),u&&(0,e.jsxs)(e.Fragment,{children:[t.map(h=>{const v=n(h.id),y=v.length;return(0,e.jsxs)("div",{children:[(0,e.jsx)(Ce,{folderId:h.id,name:h.name,isExpanded:h.isExpanded,onToggle:()=>i(h.id),count:y,showContextMenu:!0}),h.isExpanded&&v.map(b=>(0,e.jsx)(ce,{id:b.id,tableName:b.name,isNested:!0,showContextMenu:!0},b.id))]},h.id)}),g.map(h=>(0,e.jsx)(ce,{id:h.id,tableName:h.name,showContextMenu:!0},h.id))]})]})},ta=()=>{const{addQuery:s,addFolder:t}=me(),a=te(),r=(0,l.useRef)(null),[n,i]=O(R.SIDEBAR_SEARCH,{defaultValue:""}),c=m=>{i(m.target.value)},o=()=>{const m=s();a({to:"/runner/$queryId",params:{queryId:m}})},u=()=>{const m=Math.random().toString(36).substring(2,15);t({id:m,name:"New Folder",isExpanded:!0,isFavorite:!1})};return(0,e.jsxs)("div",{className:"p-3 space-y-2 border-b border-sidebar-border",children:[(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsxs)(S,{className:"flex-1 justify-start h-8",onClick:o,children:[(0,e.jsx)(Z,{className:"size-4"}),"Add Query"]}),(0,e.jsxs)(S,{className:"flex-1 justify-start h-8",onClick:u,children:[(0,e.jsx)(Ue,{className:"size-4"}),"Add Folder"]})]}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)(we,{className:"absolute left-2 top-1/2 -translate-y-1/2 size-4 text-muted-foreground"}),(0,e.jsx)(M,{ref:r,placeholder:"Search queries",value:n??"",onChange:c,className:"rounded-sm h-8 pl-8 pr-8"}),(0,e.jsx)(ee,{className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs",children:"/"})]})]})},aa=()=>(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ta,{}),(0,e.jsx)(sa,{})]}),ra=({tableName:s,schemaName:t})=>{const a=te(),r=he({strict:!1}),{pathname:n}=se(),i=Ee(),{copyTableSchema:c,isCopyingSchema:o}=Nt(),{exportFile:u,isExportingFile:m}=rt(),{deleteTable:f,forceDeleteTable:p,isDeletingTable:x}=lt(),{renameTable:g,isRenamingTable:h}=at({tableName:s,schemaName:t}),{openOverlay:v,closeOverlay:y,isOverlayOpen:b}=J(),{setEditingTable:w}=Gs(),E=Js(),[d,j]=(0,l.useState)(s),[k,V]=(0,l.useState)([]),A=t?`${t}.${s}`:s,F=`tables.rename-table.${A}`,_=`tables.delete-table.${A}`,D=`tables.force-delete-table.${A}`,L=N=>{N?(j(s),v(F)):y(F)},ie=async()=>{const N=d.trim();if(!(!N||N===s))try{if(await g({newTableName:N,schemaName:t}),L(!1),r.table===s&&i===t){const je=n.startsWith("/schema")?"/schema/$table":n.startsWith("/indexes")?"/indexes/$table":"/table/$table";a({to:je,params:{table:N},search:{[R.TABLE_SCHEMA]:t}})}}catch{}},be=()=>{navigator.clipboard.writeText(s),z.success("Table name copied to clipboard")},pe=async()=>{const N=await f(s,t);N.fkViolation?(V(N.relatedRecords),y(_),v(D)):(y(_),a({to:"/"}))},ge=async()=>{await p(s,t),y(D),a({to:"/"})},ve=()=>{y(D),V([])};return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(Ze,{children:[(0,e.jsx)(Ye,{asChild:!0,children:(0,e.jsx)(S,{variant:"ghost",size:"icon-sm",onClick:N=>{N.stopPropagation(),N.preventDefault()},onPointerDown:N=>{N.stopPropagation()},children:(0,e.jsx)(Os,{})})}),(0,e.jsx)(We,{className:"w-56",align:"start",children:(0,e.jsxs)(Xs,{children:[(0,e.jsxs)(I,{onClick:be,children:[(0,e.jsx)(Is,{className:"size-4"}),"Copy name"]}),(0,e.jsxs)(I,{onClick:()=>c(s,t),disabled:o,children:[(0,e.jsx)(xs,{className:"size-4"}),"Copy table schema"]}),(0,e.jsx)(Se,{}),(0,e.jsxs)(I,{onClick:()=>L(!0),children:[(0,e.jsx)(Ts,{className:"size-4"}),"Rename table"]}),!E&&(0,e.jsxs)(I,{onClick:()=>{w({tableName:s,schemaName:t}),v("schema.edit-table")},children:[(0,e.jsx)(ke,{className:"size-4"}),"Edit table"]}),(0,e.jsxs)(Ge,{children:[(0,e.jsxs)(Xe,{children:[(0,e.jsx)(Ls,{className:"size-4"}),"Export data"]}),(0,e.jsxs)(Je,{children:[(0,e.jsx)(I,{onClick:()=>u({tableName:s,schemaName:t,format:"csv"}),disabled:m,children:"Export as CSV"}),(0,e.jsx)(I,{onClick:()=>u({tableName:s,schemaName:t,format:"json"}),disabled:m,children:"Export as JSON"}),(0,e.jsx)(I,{onClick:()=>u({tableName:s,schemaName:t,format:"xlsx"}),disabled:m,children:"Export as Excel"})]})]}),(0,e.jsx)(Se,{}),(0,e.jsxs)(I,{variant:"destructive",onClick:()=>v(_),children:[(0,e.jsx)(Te,{className:"size-4"}),"Delete table"]})]})})]}),(0,e.jsx)(na,{tableName:s,newTableName:d,setNewTableName:j,isOpen:b(F),onOpenChange:L,onRename:ie,isRenaming:h}),(0,e.jsx)(la,{isOpen:b(_),onOpenChange:N=>{N||y(_)},tableName:s,onDelete:pe,isDeleting:x}),(0,e.jsx)(ia,{isOpen:b(D),onOpenChange:N=>{N||y(D)},tableName:s,relatedRecords:k,onForceDelete:ge,onCancel:ve,isDeleting:x})]})},na=({tableName:s,newTableName:t,setNewTableName:a,isOpen:r,onOpenChange:n,onRename:i,isRenaming:c})=>{const o=t.trim(),u=!o||o===s;return(0,e.jsx)(G,{open:r,onOpenChange:n,children:(0,e.jsxs)(q,{className:"max-w-md",children:[(0,e.jsxs)(U,{children:[(0,e.jsx)(Y,{children:"Rename Table"}),(0,e.jsx)(W,{children:"Update the table name while keeping all data and schema unchanged."})]}),(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(Fe,{htmlFor:"current-table-name",children:"Current name"}),(0,e.jsx)(M,{id:"current-table-name",value:s,readOnly:!0,disabled:!0})]}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(Fe,{htmlFor:"new-table-name",children:"New name"}),(0,e.jsx)(M,{id:"new-table-name",value:t,onChange:m=>a(m.target.value),placeholder:"table_name",autoFocus:!0,disabled:c,onKeyDown:m=>{m.key==="Enter"&&!u&&!c&&i()}})]})]}),(0,e.jsxs)(X,{className:"gap-2",children:[(0,e.jsx)(S,{variant:"outline",onClick:()=>n(!1),disabled:c,children:"Cancel"}),(0,e.jsx)(S,{onClick:i,disabled:u||c,children:c?"Renaming...":"Rename Table"})]})]})})},la=({isOpen:s,onOpenChange:t,tableName:a,onDelete:r,isDeleting:n})=>(0,e.jsx)(G,{open:s,onOpenChange:t,children:(0,e.jsxs)(q,{className:"max-w-md",children:[(0,e.jsxs)(U,{children:[(0,e.jsx)(Y,{children:"Delete Table"}),(0,e.jsxs)(W,{children:["Are you sure you want to delete the table"," ",(0,e.jsxs)("span",{className:"font-semibold text-foreground",children:['"',a,'"']}),"? This action cannot be undone and all data will be permanently lost."]})]}),(0,e.jsxs)(X,{className:"gap-2",children:[(0,e.jsx)(S,{variant:"outline",onClick:()=>t(!1),disabled:n,children:"Cancel"}),(0,e.jsx)(S,{variant:"destructive",onClick:r,disabled:n,children:n?"Deleting...":"Delete Table"})]})]})}),ia=({isOpen:s,onOpenChange:t,tableName:a,relatedRecords:r,onForceDelete:n,onCancel:i,isDeleting:c})=>(0,e.jsx)(G,{open:s,onOpenChange:t,children:(0,e.jsxs)(q,{className:"max-w-xl! max-h-[calc(100vh-1rem)]!",children:[(0,e.jsxs)(U,{children:[(0,e.jsx)(Y,{children:"Cannot Delete - Foreign Key Constraint"}),(0,e.jsxs)(W,{children:["The table ",(0,e.jsxs)("span",{className:"font-semibold text-foreground",children:['"',a,'"']})," ","cannot be deleted because it is referenced by records in other tables. You can either cancel the operation or force delete, which will also delete all related records."]})]}),(0,e.jsx)("div",{className:"space-y-4 max-h-64 overflow-y-auto",children:r.map((o,u)=>(0,e.jsxs)("div",{className:"border border-border rounded-md p-3",children:[(0,e.jsxs)("div",{className:"font-medium text-sm mb-2",children:["Table: ",(0,e.jsx)("span",{className:"text-primary",children:o.tableName}),(0,e.jsxs)("span",{className:"text-muted-foreground ml-2",children:["(",o.records.length," record",o.records.length!==1?"s":"",")"]})]}),(0,e.jsxs)("div",{className:"text-xs text-muted-foreground mb-2",children:["References column: ",o.columnName]}),(0,e.jsx)("div",{className:"bg-muted rounded p-2 text-xs overflow-x-auto",children:(0,e.jsxs)("pre",{className:"whitespace-pre-wrap",children:[JSON.stringify(o.records.slice(0,5),null,2),o.records.length>5&&(0,e.jsxs)("div",{className:"text-muted-foreground mt-2",children:["... and ",o.records.length-5," more"]})]})})]},`${o.tableName}-${o.columnName}-${u}`))}),(0,e.jsxs)(X,{className:"gap-2",children:[(0,e.jsx)(S,{variant:"outline",onClick:i,disabled:c,children:"Cancel"}),(0,e.jsx)(S,{variant:"destructive",onClick:n,disabled:c,children:c?"Deleting...":"Force Delete All"})]})]})}),oa=({tableName:s,rowCount:t,rowCountEstimated:a,schemaName:r})=>{const n=he({strict:!1}),{pathname:i}=se(),c=n.table,[o,u]=O(R.ACTIVE_TABLE),m=i.startsWith("/visualizer"),f=It({schemaName:r,tableName:s}),p=Ee(),x=m?o===f:c===s&&(p===void 0||p===r),g=i.startsWith("/schema")?"/schema/$table":i.startsWith("/indexes")?"/indexes/$table":"/table/$table",h=(0,e.jsxs)("span",{className:"flex-1 truncate",children:[r&&r!=="public"?`${r}.`:"",s]});return(0,e.jsxs)("li",{className:"relative group",children:[x&&(0,e.jsx)("span",{className:"absolute left-0 top-0 bottom-0 w-1 bg-primary z-10"}),(0,e.jsxs)("div",{className:T("w-full flex gap-0.5 pl-4 pr-2 py-1.5 text-sm transition-colors text-left justify-start items-center focus:outline-none",x?"text-sidebar-accent-foreground bg-sidebar-accent font-medium":"text-sidebar-foreground/70 hover:text-sidebar-foreground hover:bg-sidebar-accent/50 focus:bg-sidebar-accent focus:text-sidebar-accent-foreground"),children:[m?(0,e.jsx)("button",{type:"button",onClick:()=>{u(f)},className:"flex-1 flex items-center gap-1 min-w-0 text-left focus:outline-none",children:h}):(0,e.jsx)(Be,{to:g,params:{table:s},search:{[R.TABLE_SCHEMA]:r},className:"flex-1 flex items-center gap-1 min-w-0 focus:outline-none",children:h}),(0,e.jsxs)("div",{className:"flex items-center gap-1 h-5 shrink-0",children:[(0,e.jsx)("div",{className:T(x?"opacity-100":"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),children:(0,e.jsx)(ra,{tableName:s,schemaName:r})}),(0,e.jsxs)(ee,{children:[a&&"~",t]})]})]})]})},ca=()=>{const[s]=O(R.SIDEBAR_SEARCH,{defaultValue:""}),[t,a]=O(R.ACTIVE_SCHEMA,{defaultValue:"all"}),r=Q(),{tablesList:n=[],isLoadingTablesList:i,errorTablesList:c}=es(),o=(0,l.useMemo)(()=>Array.from(new Set(n.reduce((f,p)=>(p.schemaName&&f.push(p.schemaName),f),[]))).sort(),[n]),u=(r?.schemaSelector??!1)&&o.length>1,m=n?.filter(f=>{const p=t==="all"||f.schemaName===t,x=f.tableName.toLowerCase().includes(s.toLowerCase());return p&&x});return(0,l.useEffect)(()=>{!u||t==="all"||o.includes(t)||a("all")},[o,t,a,u]),i?(0,e.jsx)("div",{className:"flex-1 h-full overflow-y-auto pb-3 flex items-center justify-center",children:(0,e.jsx)(Ws,{size:"size-6"})}):c?(0,e.jsxs)("div",{className:"flex-1 overflow-y-auto pb-3 h-full flex items-center justify-center",children:["Error: ",c.message]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"flex-1 overflow-y-auto pb-3",children:m&&m.length>0?(0,e.jsx)("ul",{children:m?.map(f=>(0,e.jsx)(oa,{schemaName:f.schemaName,tableName:f.tableName,rowCount:f.rowCount,rowCountEstimated:f.rowCountEstimated},f.schemaName?`${f.schemaName}.${f.tableName}`:f.tableName))}):s?(0,e.jsx)("div",{className:"flex-1 overflow-y-auto pb-3 h-full flex items-center justify-center",children:"No tables found matching"}):(0,e.jsx)("div",{className:"flex-1 overflow-y-auto pb-3 h-full flex items-center justify-center",children:"No tables available"})}),(0,e.jsx)(Ys,{})]})},da=()=>{const s=(0,l.useRef)(null),[t,a]=O(R.SIDEBAR_SEARCH,{defaultValue:""}),{openOverlay:r}=J(),n=Q();return nt("/",i=>{i.preventDefault(),s.current&&s.current.focus()},{preventDefault:!0}),(0,e.jsx)("div",{className:"px-3 pb-3 pt-2 space-y-2",children:(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsxs)("div",{className:"relative min-w-0 flex-1",children:[(0,e.jsx)(we,{className:"absolute left-2 top-1/2 -translate-y-1/2 size-4 text-muted-foreground"}),(0,e.jsx)(M,{ref:s,variant:"outline",placeholder:"Search tables",value:t??"",onChange:i=>a(i.target.value.trim()),className:"rounded-sm h-8 pl-8 pr-8"}),(0,e.jsx)(ee,{className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs",children:"/"})]}),n?.dataModel!=="document"&&(0,e.jsx)(S,{size:"icon-lg",className:"shrink-0 rounded-sm",onClick:()=>r("table-builder.create-table"),"aria-label":"Add table",children:(0,e.jsx)(Z,{className:"size-4"})})]})})},ua=()=>{const[s,t]=O(R.ACTIVE_SCHEMA,{defaultValue:"all"}),a=Q(),{tablesList:r=[]}=es(),n=(0,l.useMemo)(()=>Array.from(new Set(r.reduce((i,c)=>(c.schemaName&&i.push(c.schemaName),i),[]))).sort(),[r]);return(a?.schemaSelector??!1)&&n.length>1?(0,e.jsx)("div",{className:"px-3 pt-3",children:(0,e.jsxs)(le,{value:s,onValueChange:t,children:[(0,e.jsx)(re,{variant:"outline",className:"h-8! w-full justify-between rounded-sm",children:(0,e.jsx)(ae,{placeholder:"Select schema"})}),(0,e.jsxs)(ne,{children:[(0,e.jsx)(P,{value:"all",children:"All schemas"}),n.map(i=>(0,e.jsx)(P,{value:i,children:i},i))]})]})}):null},Ve=()=>(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ua,{}),(0,e.jsx)(da,{}),(0,e.jsx)(yt,{className:"flex-1 overflow-y-auto pb-3 block h-full w-full",children:(0,e.jsx)(ca,{})})]});function ha(){const{databases:s,isLoadingDatabases:t,refetchDatabases:a,isRefetchingDatabases:r}=Tt(),{selectedDatabase:n,setSelectedDatabase:i}=ss(),c=Q(),o=te(),u=t||r,m=p=>{i(p),o({to:c?.dataModel==="key-value"?"/browser":"/table",search:{}})},f=async()=>{await a(),z.success("Databases refreshed")};return(0,e.jsxs)("div",{className:"mt-auto flex h-11 items-center gap-0.5 border-t border-sidebar-border bg-sidebar px-2 text-sidebar-foreground",children:[(0,e.jsx)(Et,{databasesCount:s?.length??0}),(0,e.jsx)("span",{"aria-hidden":!0,className:"text-xs text-muted-foreground/50",children:"/"}),(0,e.jsxs)(le,{value:n||"",onValueChange:m,children:[(0,e.jsx)(re,{variant:"outline","aria-label":"Database",disabled:u,className:"h-7 min-w-0 flex-1 border-0 px-2 font-mono shadow-none hover:bg-muted/60",children:(0,e.jsx)(ae,{placeholder:"Select database…"})}),(0,e.jsx)(ne,{children:s?.map(p=>(0,e.jsx)(P,{value:p.name,className:"font-mono text-xs",children:p.name},p.name))})]}),(0,e.jsxs)(Re,{children:[(0,e.jsx)(_e,{asChild:!0,children:(0,e.jsx)(S,{variant:"ghost",size:"icon-sm","aria-label":"Refresh databases",onClick:f,disabled:u,children:(0,e.jsx)(qe,{className:T(u&&"animate-spin")})})}),(0,e.jsx)(De,{children:"Refresh databases"})]})]})}var ma=({children:s})=>{const{sidebar:{width:t,isOpen:a,isPinned:r},setSidebarWidth:n,setSidebarOpen:i}=Ie(),c=(0,l.useRef)(!1),o=(0,l.useRef)(0),u=(0,l.useRef)(0),m=(0,l.useRef)(null),f=(0,l.useRef)(d=>{}),p=(0,l.useRef)(()=>{}),x=(0,l.useRef)(()=>{}),g=(0,l.useRef)(()=>{}),h=(0,l.useCallback)(d=>{c.current&&requestAnimationFrame(()=>{const j=d.clientX-o.current,k=u.current+j;n(k)})},[n]),v=(0,l.useCallback)(()=>{c.current=!1,Object.assign(document.body.style,{cursor:"",userSelect:""});const d=document.getElementById("resize-overlay");d&&d.remove()},[]),y=(0,l.useCallback)(d=>{d.preventDefault(),c.current=!0,o.current=d.clientX,u.current=t,Object.assign(document.body.style,{cursor:"col-resize",userSelect:"none"});const j=document.createElement("div");j.id="resize-overlay",j.style.cssText="position:fixed;inset:0;z-index:9999;cursor:col-resize;",document.body.appendChild(j)},[t]),b=(0,l.useCallback)(()=>{r||i(!0)},[r,i]),w=(0,l.useCallback)(()=>{r||i(!1)},[r,i]);f.current=h,p.current=v,x.current=b,g.current=w;const E=d=>{r||i(d)};return(0,l.useEffect)(()=>{const d=k=>f.current(k),j=()=>p.current();return document.addEventListener("mousemove",d),document.addEventListener("mouseup",j),()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",j)}},[]),(0,l.useEffect)(()=>{const d=m.current;if(!d)return;const j=()=>x.current(),k=()=>g.current();return d.addEventListener("mouseenter",j),d.addEventListener("mouseleave",k),()=>{d.removeEventListener("mouseenter",j),d.removeEventListener("mouseleave",k)}},[]),(0,e.jsxs)(et,{open:a,onOpenChange:E,modal:!1,children:[(0,e.jsx)(st,{className:"sr-only",children:"Open Sidebar"}),(0,e.jsx)(Zs,{ref:m,side:"left",showCloseButton:!1,isPinned:r,className:"sidebar-behind-rail bg-sidebar border-r border-sidebar-border text-sidebar-foreground p-0",style:{width:`${t}px`,left:`${R.RAIL_WIDTH}px`},onOpenAutoFocus:d=>d.preventDefault(),children:(0,e.jsxs)("div",{className:"relative h-full flex flex-col",children:[s,(0,e.jsx)("div",{role:"button",tabIndex:0,onMouseDown:y,className:T("absolute inset-y-0 -right-1.5 w-3 cursor-col-resize z-50 outline-none","after:absolute after:inset-y-0 after:left-1/2 after:w-px after:transition-colors","hover:after:bg-blue-400/70 active:after:bg-blue-400/70 focus-visible:after:bg-blue-400/70"),title:"Drag to resize sidebar"})]})})]})},xa=["string","hash","list","set","zset","stream"],K=At(""),fa=()=>{const{closeOverlay:s,isOverlayOpen:t}=J(),[a,r]=(0,l.useState)(K),[n,i]=(0,l.useState)("string"),[c,o]=(0,l.useState)(K),[u,m]=(0,l.useState)(K),[f,p]=(0,l.useState)("0"),[x,g]=(0,l.useState)(""),{createKey:h,isPending:v}=Ft(),y=t("redis-browser.create-key"),b=n==="hash"||n==="stream",w=a===null||c===null||b&&u===null,E=async()=>{const d=b?u:K;if(a===null||c===null||d===null)return;let j;switch(n){case"string":j={kind:"string",value:c};break;case"hash":j={kind:"hash",entries:[{field:c,value:d}]};break;case"list":j={kind:"list",entries:[c]};break;case"set":j={kind:"set",members:[c]};break;case"zset":j={kind:"zset",entries:[{member:c,score:Number(f)}]};break;case"stream":j={kind:"stream",id:"*",fields:[{field:c,value:d}]}}await h({key:a,type:n,value:j,ttlMs:x?Number(x)*1e3:null}),r(K),i("string"),o(K),m(K),p("0"),g(""),s("redis-browser.create-key")};return(0,e.jsxs)(tt,{title:"Create Redis key",description:"Creates the key atomically and never overwrites an existing key.",open:y,onOpenChange:d=>{d||s("redis-browser.create-key")},size:"sm:max-w-md!",headerClassName:"border-b border-border p-4",titleClassName:"text-sm font-medium",contentClassName:"space-y-4 px-4 py-4",children:[(0,e.jsxs)(Ot,{className:"gap-4",children:[(0,e.jsxs)(H,{children:[(0,e.jsx)(B,{htmlFor:"redis-key-name",children:"Key"}),(0,e.jsx)(ye,{id:"redis-key-name",value:a,onChange:r,className:"h-8",placeholder:"cache:user:42"}),(0,e.jsx)(Le,{children:"Text, hexadecimal, and Base64 keys are supported."})]}),(0,e.jsxs)(H,{children:[(0,e.jsx)(B,{htmlFor:"redis-key-type",children:"Type"}),(0,e.jsxs)(le,{value:n,onValueChange:d=>i(d),children:[(0,e.jsx)(re,{id:"redis-key-type",className:"h-8!",children:(0,e.jsx)(ae,{})}),(0,e.jsx)(ne,{children:xa.map(d=>(0,e.jsx)(P,{value:d,children:d},d))})]})]}),(0,e.jsxs)(H,{children:[(0,e.jsx)(B,{htmlFor:"redis-key-first-value",children:n==="hash"||n==="stream"?"Initial field":n==="zset"?"Initial member":"Initial value"}),(0,e.jsx)(ye,{id:"redis-key-first-value",value:c,onChange:o})]}),(n==="hash"||n==="stream")&&(0,e.jsxs)(H,{children:[(0,e.jsx)(B,{htmlFor:"redis-key-second-value",children:"Initial value"}),(0,e.jsx)(ye,{id:"redis-key-second-value",value:u,onChange:m})]}),n==="zset"&&(0,e.jsxs)(H,{children:[(0,e.jsx)(B,{htmlFor:"redis-key-score",children:"Score"}),(0,e.jsx)(M,{id:"redis-key-score",type:"number",value:f,onChange:d=>p(d.target.value),className:"font-mono"})]}),(0,e.jsxs)(H,{children:[(0,e.jsx)(B,{htmlFor:"redis-key-ttl",children:"TTL in seconds"}),(0,e.jsx)(M,{id:"redis-key-ttl",type:"number",min:1,value:x,onChange:d=>g(d.target.value),placeholder:"Persistent",className:"font-mono h-8"}),(0,e.jsx)(Le,{children:"Leave empty to create a persistent key."})]})]}),(0,e.jsxs)("div",{className:"flex justify-end gap-2 border-t border-border pt-4",children:[(0,e.jsx)(S,{variant:"outline",onClick:()=>s("redis-browser.create-key"),children:"Cancel"}),(0,e.jsx)(S,{disabled:v||w,onClick:E,children:"Create key"})]})]})},ba=["string","hash","list","set","zset","stream"],pa={string:"STR",hash:"HASH",list:"LIST",set:"SET",zset:"ZSET",stream:"XSTR"},ga=s=>s===-1?"∞":s<0?"gone":s<1e3?`${s}ms`:s<6e4?`${Math.ceil(s/1e3)}s`:s<36e5?`${Math.ceil(s/6e4)}m`:`${Math.ceil(s/36e5)}h`,va=s=>s===null?"—":s<1024?`${s} B`:`${(s/1024).toFixed(1)} KiB`,ja=(s,t)=>t!==void 0?t||"(empty key)":`0x${Array.from(Lt(s),a=>a.toString(16).padStart(2,"0")).join("")}`,ya=()=>{const{openOverlay:s}=J(),[t,a]=O("key"),[r,n]=O("search",{defaultValue:""}),[i,c]=(0,l.useState)(r),[o,u]=O("type",{defaultValue:""}),[m,f]=O("glob",{defaultValue:"false"}),p=m==="true",x=Mt({search:i,type:o,exactPattern:p}),g=(0,l.useMemo)(()=>x.data?.pages.flatMap(b=>b.keys)??[],[x.data]),h=(0,l.useRef)(null),v=hs({count:g.length,getScrollElement:()=>h.current,estimateSize:()=>33,overscan:10}),y=v.getVirtualItems();return(0,l.useEffect)(()=>{const b=window.setTimeout(()=>c(r),250);return()=>window.clearTimeout(b)},[r]),(0,l.useEffect)(()=>{const b=y.at(-1);b&&b.index>=g.length-5&&x.hasNextPage&&!x.isFetchingNextPage&&x.fetchNextPage()},[y,g.length,x.hasNextPage,x.isFetchingNextPage,x.fetchNextPage]),(0,e.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col bg-background font-mono",children:[(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"space-y-2 px-3 pb-3 pt-2",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsxs)("div",{className:"relative min-w-0 flex-1",children:[(0,e.jsx)(we,{className:"absolute left-2 top-1/2 -translate-y-1/2 size-4 text-muted-foreground"}),(0,e.jsx)(M,{variant:"outline",value:r,onChange:b=>n(b.target.value),placeholder:p?"Redis glob pattern":"Find keys","aria-label":"Find Redis keys",className:"h-8 rounded-sm pl-8"})]}),(0,e.jsx)(S,{variant:"outline",size:"icon-lg",className:"shrink-0 rounded-sm",onClick:()=>z.promise(x.refetch({throwOnError:!0}),{loading:"Refreshing Redis keys...",success:"Redis keys refreshed",error:"Failed to refresh Redis keys"}),disabled:x.isFetching,"aria-label":"Refresh Redis keys",children:(0,e.jsx)(qe,{className:T(x.isFetching&&"animate-spin")})}),(0,e.jsx)(S,{size:"icon-lg",className:"shrink-0 rounded-sm",onClick:()=>s("redis-browser.create-key"),"aria-label":"Create Redis key",children:(0,e.jsx)(Z,{})})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsxs)(le,{value:o||"all",onValueChange:b=>u(b==="all"?"":b),children:[(0,e.jsx)(re,{variant:"outline","aria-label":"Filter Redis key type",className:"h-8! min-w-0 flex-1 justify-between rounded-sm",children:(0,e.jsx)(ae,{})}),(0,e.jsxs)(ne,{children:[(0,e.jsx)(P,{value:"all",children:"All types"}),ba.map(b=>(0,e.jsx)(P,{value:b,children:b},b))]})]}),(0,e.jsxs)(kt,{variant:"outline",size:"lg",pressed:p,onPressedChange:b=>f(b?"true":"false"),className:"shrink-0 rounded-sm px-2 text-xs/relaxed uppercase","aria-label":"Use Redis glob pattern",children:[(0,e.jsx)(Cs,{className:"size-4"})," Glob"]})]})]}),(0,e.jsxs)("div",{className:"flex h-6 items-center justify-between px-4 text-[9px] uppercase tracking-wider text-muted-foreground",children:[(0,e.jsxs)("span",{children:[g.length," loaded"]}),(0,e.jsx)("span",{children:x.dataUpdatedAt>0?new Date(x.dataUpdatedAt).toLocaleTimeString():"not scanned"})]})]}),(0,e.jsxs)("div",{ref:h,className:"min-h-0 flex-1 overflow-auto",children:[x.isLoading?(0,e.jsx)("div",{className:"px-3 py-4 text-xs text-muted-foreground",children:"Scanning keyspace…"}):g.length===0?(0,e.jsxs)("div",{className:"flex min-h-32 flex-col items-center justify-center gap-2 px-4 text-center text-muted-foreground",children:[(0,e.jsx)(vs,{className:"size-4"}),(0,e.jsx)("span",{className:"text-xs",children:"No keys in this scan."}),(0,e.jsxs)(S,{variant:"outline",size:"sm",onClick:()=>s("redis-browser.create-key"),children:[(0,e.jsx)(Z,{})," Create key"]})]}):(0,e.jsx)("div",{className:"relative w-full",style:{height:`${v.getTotalSize()}px`},children:y.map(b=>{const w=g[b.index],E=w.key.base64||"-",d=ja(w.key.base64,w.key.utf8);return(0,e.jsxs)(S,{variant:"ghost",onClick:()=>a(E),className:T("absolute left-0 top-0 h-auto w-full justify-start gap-2 rounded-none px-4 py-1.5 text-sm font-normal transition-colors",t===E?"bg-sidebar-accent text-sidebar-accent-foreground font-medium before:absolute before:inset-y-0 before:left-0 before:w-1 before:bg-primary":"text-sidebar-foreground/70 hover:bg-sidebar-accent/50 hover:text-sidebar-foreground"),style:{transform:`translateY(${b.start}px)`},title:d,children:[(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate text-left text-current",children:d}),(0,e.jsx)(gt,{variant:"outline",className:"h-4 w-10 shrink-0 justify-center rounded-sm px-1 text-[8px] font-normal text-muted-foreground",children:pa[w.type]??"?"}),(0,e.jsxs)("span",{className:"shrink-0 text-[9px] text-muted-foreground",children:[va(w.memoryBytes)," ·"," ",w.ttlMs===-1?(0,e.jsx)(gs,{className:"inline size-3 align-[-2px]","aria-label":"No expiry"}):ga(w.ttlMs)]})]},`${E}-${b.index}`)})}),x.isFetchingNextPage&&(0,e.jsx)("div",{className:"px-2 py-1 text-center text-[10px] text-muted-foreground",children:"Scanning more…"})]}),(0,e.jsx)(fa,{})]})},Ca=()=>{const{pathname:s}=se(),t=s.split("/")[1],a=Q()?.dataModel==="key-value",r=(0,l.useMemo)(()=>{if(a&&t!=="runner")return(0,e.jsx)(ya,{});switch(t){case"":case"table":case"schema":case"indexes":return(0,e.jsx)(Ve,{});case"runner":return(0,e.jsx)(aa,{});default:return(0,e.jsx)(Ve,{})}},[a,t]);return(0,e.jsxs)(ma,{children:[r,(0,e.jsx)(ha,{})]})},Ya=cs({component:()=>Sa});function Sa(){const s=Q(),t=s?.dataModel==="key-value",{pathname:a}=se(),r=a.split("/")[1],{sidebar:{isPinned:n,width:i}}=Ie();return t&&r!=="browser"&&r!=="runner"&&r!=="logs"?(0,e.jsx)(oe,{to:"/browser"}):!t&&r==="browser"?(0,e.jsx)(oe,{to:"/"}):s&&!s.indexes&&r==="indexes"?(0,e.jsx)(oe,{to:"/table"}):s&&!s.serverLogs&&r==="logs"?(0,e.jsx)(oe,{to:"/table"}):(0,e.jsxs)("div",{className:"bg-background text-foreground w-dvw flex h-dvh max-h-dvh overflow-hidden relative",children:[(0,e.jsx)(ea,{}),(0,e.jsx)(Ca,{}),(0,e.jsx)("div",{className:"rail-content relative flex-1 flex flex-col h-full overflow-hidden",style:{marginLeft:n?`${i}px`:"0"},children:(0,e.jsx)(us,{})})]})}export{Sa as component,zt as n,Ya as t};
@@ -0,0 +1 @@
1
+ import{_ as n}from"./tanstack-BGvcrEX1.js";import{jt as a}from"./radix-ui-deSt0_b9.js";import{t as o}from"./use-database-engine-B9THCU8i.js";import"./index-CSMKcupk.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"db-studio@1.20.0"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a4ba724e-d30b-4f65-830b-f89adc4095de",e._sentryDebugIdIdentifier="sentry-dbid-a4ba724e-d30b-4f65-830b-f89adc4095de")}catch{}})();var r=a();function b(){return o()?.dataModel==="key-value"?(0,r.jsx)(n,{to:"/browser"}):(0,r.jsx)("main",{className:"flex-1 flex items-center justify-center",children:"Select a tab to get started"})}export{b as component};
@@ -0,0 +1 @@
1
+ import{jt as r}from"./radix-ui-deSt0_b9.js";import{n as t}from"./index-CSMKcupk.js";import{t as o}from"./query-runner-YYCt8TAF.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"db-studio@1.20.0"};var n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="69eb2631-2aee-477c-bd29-7a26b3141d45",e._sentryDebugIdIdentifier="sentry-dbid-69eb2631-2aee-477c-bd29-7a26b3141d45")}catch{}})();var d=r();function b(){const{queryId:e}=t.useParams();return(0,d.jsx)(o,{queryId:e})}export{b as component};
@@ -0,0 +1 @@
1
+ import{jt as o}from"./radix-ui-deSt0_b9.js";import{t as d}from"./schema-BtwO4zbG.js";import{t as r}from"./index-CSMKcupk.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"db-studio@1.20.0"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d1f764d0-86a8-4a06-99d9-622ba7e77d00",e._sentryDebugIdIdentifier="sentry-dbid-d1f764d0-86a8-4a06-99d9-622ba7e77d00")}catch{}})();var n=o();function l(){const{table:e}=r.useParams();return(0,n.jsx)("main",{className:"flex-1 flex flex-col overflow-hidden",children:(0,n.jsx)(d,{tableName:e})})}export{l as component};
@@ -0,0 +1 @@
1
+ import{r as Y}from"./rolldown-runtime-CFc_0XbV.js";import{C as $,E,g as H,w as J}from"./tanstack-BGvcrEX1.js";import{E as L,I as W,It as X,T as Z,f as ee,o as se,s as ne}from"./icons-CjWX45lj.js";import{jt as te}from"./radix-ui-deSt0_b9.js";import{n as R}from"./dist-CxVc5ukz.js";import{t as ae}from"./utils-CshH-ggy.js";import{t as P}from"./spinner-Dihgug3b.js";import{G as re,J as ie,K as de,M as oe,O as le,W as ce,Y as xe,_ as F,b as me,k as O,q as ue,v as I,w as he,y as fe}from"./schema-BtwO4zbG.js";import{n as A,t as g}from"./label-CVNOUqUm.js";import{a as f,i as pe,n as ge,o as u,t as je}from"./tooltip-Hxe7NIhG.js";import{t as be}from"./sheet-sidebar-lG9Hd9mf.js";import"./tables-BPDra69x.js";import{t as ye}from"./react-BH8Cquhy.js";import{h as ve,o as Ne,u as Ie}from"./constants-BgZGgQU-.js";import{o as Ce,t as C}from"./database.store-CzI49QG8.js";import{t as b}from"./badge-B60VPytI.js";import{a as Se,i as De,n as Te,r as ze,t as ke}from"./select-BJvLgK98.js";import{t as we}from"./use-database-engine-B9THCU8i.js";import{i as S}from"./keys-BPprzJmP.js";import{i as qe}from"./index-CSMKcupk.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};s.SENTRY_RELEASE={id:"db-studio@1.20.0"};var a=new s.Error().stack;a&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[a]="4d186159-02e1-47ac-b0d0-6ec8e88ceef7",s._sentryDebugIdIdentifier="sentry-dbid-4d186159-02e1-47ac-b0d0-6ec8e88ceef7")}catch{}})();var N=Y(X(),1),_e=({tableName:s,schemaName:a})=>{const r=E(),{closeOverlay:i}=f(),{selectedDatabase:o}=C(),{mutateAsync:x,isPending:l}=$({mutationFn:async d=>(await Ne({tableName:s,schemaName:a,data:d,db:o})).data.data,onSuccess:async()=>{await r.invalidateQueries({queryKey:S.byTable(s),exact:!1}),i("indexes.create-index")}});return{createIndex:async d=>R.promise(x(d),{loading:"Creating index...",success:n=>n||"Index created successfully",error:n=>typeof n.details=="string"&&n.details||n.message||"Failed to create index"}),isCreatingIndex:l}},e=te(),Fe=({tableName:s})=>{const{closeOverlay:a}=f(),r=I(),{createIndex:i,isCreatingIndex:o}=_e({tableName:s,schemaName:r}),{tableCols:x,isLoadingTableCols:l}=he({tableName:s,schemaName:r}),m=we(),d=m?.indexes||null,n=d?.methods??[],{control:h,register:K,handleSubmit:U,setValue:D,watch:V,formState:{errors:y,dirtyFields:B,isSubmitted:T}}=oe({mode:"onSubmit",defaultValues:{indexName:"",columns:[],isUnique:!1,method:n[0]},resolver:le(Ce)}),p=V("columns"),Q=m?.dataModel==="document",[z,G]=(0,N.useState)([]),[v,k]=(0,N.useState)(""),w=[...new Set([...x?.map(({columnName:t})=>t)??[],...z])],q=t=>{const c=p.includes(t)?p.filter(j=>j!==t):[...p,t];D("columns",c,{shouldValidate:T}),B.indexName||D("indexName",c.length?`${s}_${c.join("_").replaceAll(".","_")}_idx`:"",{shouldValidate:T})},_=()=>{const t=v.trim();t&&(w.includes(t)||G([...z,t]),p.includes(t)||q(t),k(""))};return(0,e.jsxs)("form",{onSubmit:U(t=>i(t)),className:"space-y-6",children:[(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(g,{className:"text-xs",children:"Columns, in index order"}),l?(0,e.jsx)(P,{size:"size-5"}):(0,e.jsx)("div",{className:"space-y-1",children:w.map(t=>{const c=p.indexOf(t),j=`create-index-column-${t}`;return(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(F,{id:j,checked:c!==-1,onCheckedChange:()=>q(t)}),(0,e.jsx)(g,{htmlFor:j,className:"font-mono font-normal cursor-pointer",children:t}),c!==-1&&(0,e.jsxs)("span",{className:"text-xs text-muted-foreground",children:["#",c+1]})]},t)})}),Q&&(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(A,{value:v,onChange:t=>k(t.target.value),onKeyDown:t=>{t.key==="Enter"&&(t.preventDefault(),_())},placeholder:"Add field path, e.g. address.city","aria-label":"Add field path",className:"font-mono"}),(0,e.jsx)(u,{type:"button",variant:"outline",onClick:_,disabled:!v.trim(),children:"Add"})]}),y.columns&&(0,e.jsx)("p",{className:"text-xs text-destructive",children:"Select at least one column."})]}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(g,{htmlFor:"create-index-name",className:"text-xs",children:"Name"}),(0,e.jsx)(A,{id:"create-index-name",...K("indexName"),placeholder:`${s}_column_idx`,className:ae("font-mono",y.indexName&&"border-destructive ring-destructive ring-1")}),y.indexName&&(0,e.jsx)("p",{className:"text-xs text-destructive",children:"Enter an index name."})]}),(0,e.jsxs)("div",{className:"flex items-center gap-6",children:[(0,e.jsx)(O,{control:h,name:"isUnique",render:({field:t})=>(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(F,{id:"create-index-unique",checked:t.value,onCheckedChange:c=>t.onChange(c===!0)}),(0,e.jsx)(g,{htmlFor:"create-index-unique",className:"cursor-pointer",children:"Unique"})]})}),n.length>0&&(0,e.jsx)(O,{control:h,name:"method",render:({field:t})=>(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(g,{htmlFor:"create-index-method",children:"Method"}),(0,e.jsxs)(ke,{value:t.value,onValueChange:t.onChange,children:[(0,e.jsx)(De,{id:"create-index-method",className:"font-mono",children:(0,e.jsx)(Se,{})}),(0,e.jsx)(Te,{children:n.map(c=>(0,e.jsx)(ze,{value:c,className:"font-mono",children:c},c))})]})]})})]}),d?.createNote&&(0,e.jsxs)("p",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,e.jsx)(se,{className:"size-3.5 shrink-0"}),d.createNote]}),(0,e.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,e.jsx)(u,{type:"button",variant:"outline",size:"lg",onClick:()=>a("indexes.create-index"),disabled:o,children:"Cancel"}),(0,e.jsx)(u,{type:"submit",variant:"default",size:"lg",disabled:o,children:o?"Creating...":"Create index"})]})]})},Oe=({tableName:s})=>{const{closeOverlay:a,isOverlayOpen:r}=f();return(0,e.jsx)(be,{title:"Create index",description:`Create an index on "${s}".`,open:r("indexes.create-index"),onOpenChange:i=>{i||a("indexes.create-index")},children:(0,e.jsx)(Fe,{tableName:s})})},Ae=({tableName:s,schemaName:a})=>{const r=E(),{closeOverlay:i}=f(),{selectedDatabase:o}=C(),{mutateAsync:x,isPending:l}=$({mutationFn:async d=>(await Ie({tableName:s,schemaName:a,indexName:d,db:o})).data.data,onSuccess:async()=>{await r.invalidateQueries({queryKey:S.byTable(s),exact:!1}),i("indexes.drop-index")}});return{dropIndex:async d=>R.promise(x(d),{loading:"Dropping index...",success:n=>n||"Index dropped successfully",error:n=>typeof n.details=="string"&&n.details||n.message||"Failed to drop index"}),isDroppingIndex:l}},M=ye()(s=>({droppingIndex:null,setDroppingIndex:a=>s({droppingIndex:a})})),$e=({tableName:s})=>{const{closeOverlay:a,isOverlayOpen:r}=f(),{droppingIndex:i}=M(),o=I(),{dropIndex:x,isDroppingIndex:l}=Ae({tableName:s,schemaName:o});return i?(0,e.jsx)(ce,{open:r("indexes.drop-index"),onOpenChange:m=>{m||a("indexes.drop-index")},children:(0,e.jsxs)(re,{className:"max-w-md",children:[(0,e.jsxs)(ie,{children:[(0,e.jsx)(xe,{children:"Drop Index"}),(0,e.jsxs)(de,{children:["Drop the index"," ",(0,e.jsxs)("span",{className:"font-semibold text-foreground",children:['"',i.indexName,'"']})," ","from table ",(0,e.jsxs)("span",{className:"font-semibold text-foreground",children:['"',s,'"']}),"? No rows are deleted, but queries that rely on this index may get slower."]})]}),(0,e.jsxs)(ue,{className:"gap-2",children:[(0,e.jsx)(u,{variant:"outline",onClick:()=>a("indexes.drop-index"),disabled:l,children:"Cancel"}),(0,e.jsx)(u,{variant:"destructive",onClick:()=>x(i.indexName),disabled:l,children:l?"Dropping...":"Drop Index"})]})]})}):null},Ee=({index:s})=>{const{openOverlay:a}=f(),{setDroppingIndex:r}=M();return s.kind!=="index"?(0,e.jsxs)(je,{children:[(0,e.jsx)(pe,{asChild:!0,children:(0,e.jsx)("span",{className:"inline-flex text-muted-foreground/40",children:(0,e.jsx)(W,{className:"size-3.5"})})}),(0,e.jsx)(ge,{side:"left",children:(0,e.jsx)("p",{children:"Backs a constraint. Drop the constraint to remove it."})})]}):(0,e.jsx)(u,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground hover:text-destructive","aria-label":`Drop index ${s.indexName}`,onClick:()=>{r(s),a("indexes.drop-index")},children:(0,e.jsx)(ne,{className:"size-3.5"})})},Le=({tableName:s,refetch:a,isRefetching:r=!1})=>{const{openOverlay:i}=f();return(0,e.jsxs)("header",{className:"max-h-8 overflow-hidden border-b border-border w-full flex items-center bg-background text-foreground sticky top-0 left-0 right-0 z-0",children:[(0,e.jsx)(u,{type:"button",variant:"ghost",className:"size-8! aspect-square border-x-0 border-y-0 border-border rounded-none text-muted-foreground hover:text-foreground hover:bg-muted/60 transition-colors",onClick:()=>{a()},"aria-label":`Refetch indexes for ${s}`,disabled:r,children:(0,e.jsx)(Z,{className:"size-4"})}),(0,e.jsx)(u,{variant:"ghost",asChild:!0,className:"h-8! border-l border-y-0 border-r-0 border-border rounded-none flex items-center gap-2 text-muted-foreground hover:text-foreground",children:(0,e.jsxs)(H,{to:"/table/$table",params:{table:s},"aria-label":`View data for ${s}`,children:[(0,e.jsx)(ee,{className:"size-4"}),"View data"]})}),(0,e.jsxs)(u,{type:"button",variant:"default",className:"h-8! border-l border-y-0 border-r-0 border-border rounded-none flex items-center gap-2",onClick:()=>i("indexes.create-index"),children:[(0,e.jsx)(L,{className:"size-4"}),"Create Index"]})]})},Re=({tableName:s,schemaName:a})=>{const{selectedDatabase:r}=C(),{data:i,isLoading:o,isRefetching:x,error:l,refetch:m}=J({queryKey:S.table(s,r,a),queryFn:()=>ve(s,r,a),select:d=>d.data.data,enabled:!!s&&!!r});return{tableIndexes:i,isLoadingTableIndexes:o,isRefetchingTableIndexes:x,errorTableIndexes:l,refetchTableIndexes:m}},Pe={primary:"Primary","unique-constraint":"Unique constraint",index:null},Me=({tableName:s})=>{const{tableIndexes:a,isLoadingTableIndexes:r,isRefetchingTableIndexes:i,errorTableIndexes:o,refetchTableIndexes:x}=Re({tableName:s,schemaName:I()}),{openOverlay:l}=f(),m=!!a?.some(n=>n.method!==null),d=(0,N.useMemo)(()=>[{id:"indexName",header:"Name",accessorKey:"indexName",cell:({row:n})=>{const h=Pe[n.original.kind];return(0,e.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,e.jsx)("span",{className:"font-mono text-foreground font-medium truncate",children:n.original.indexName}),h&&(0,e.jsx)(b,{variant:"secondary",className:"text-[0.6rem] px-1.5 shrink-0",children:h}),n.original.isSparse&&(0,e.jsx)(b,{variant:"secondary",className:"text-[0.6rem] px-1.5 shrink-0",children:"Sparse"}),n.original.expireAfterSeconds!==void 0&&(0,e.jsxs)(b,{variant:"secondary",className:"text-[0.6rem] px-1.5 shrink-0",children:["TTL (",n.original.expireAfterSeconds,"s)"]})]})},size:340,minSize:160},{id:"columns",header:"Columns",accessorFn:n=>n.columns.join(", "),cell:({getValue:n})=>(0,e.jsx)("span",{className:"font-mono text-xs text-muted-foreground truncate",children:n()}),size:220,minSize:120},{id:"isUnique",header:"Unique",cell:({row:n})=>n.original.isUnique?(0,e.jsx)(b,{variant:"secondary",className:"text-[0.6rem] px-1.5",children:"Unique"}):(0,e.jsx)("span",{className:"text-xs text-muted-foreground/50",children:"no"}),size:90,minSize:80},...m?[{id:"method",header:"Method",cell:({row:n})=>(0,e.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:n.original.method}),size:100,minSize:80}]:[],{id:"definition",header:"Definition",accessorKey:"definition",cell:({getValue:n})=>{const h=n();return h?(0,e.jsx)("span",{className:"font-mono text-xs text-muted-foreground truncate",children:h}):(0,e.jsx)("span",{className:"text-muted-foreground/50",children:"—"})},size:360,minSize:120},{id:"actions",header:"",cell:({row:n})=>(0,e.jsx)("div",{className:"flex flex-1 justify-center items-center",children:(0,e.jsx)(Ee,{index:n.original})}),size:50,enableResizing:!1}],[m]);return r?(0,e.jsx)("div",{className:"size-full flex items-center justify-center",children:(0,e.jsx)(P,{size:"size-7"})}):o?(0,e.jsxs)("div",{className:"size-full flex flex-col items-center justify-center gap-2",children:[(0,e.jsx)("div",{className:"text-sm font-medium",children:"Failed to load indexes"}),(0,e.jsx)("div",{className:"text-sm text-muted-foreground",children:o.message})]}):(0,e.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden",children:[(0,e.jsx)(Le,{tableName:s,refetch:x,isRefetching:i}),a?.length?(0,e.jsx)(me,{columns:d,data:a,renderCellAccessory:n=>(0,e.jsx)(fe,{value:n})}):(0,e.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center gap-3",children:[(0,e.jsx)("div",{className:"text-sm text-muted-foreground",children:"This table has no indexes yet."}),(0,e.jsxs)(u,{type:"button",onClick:()=>l("indexes.create-index"),children:[(0,e.jsx)(L,{className:"size-4"}),"Create index"]})]}),(0,e.jsx)(Oe,{tableName:s}),(0,e.jsx)($e,{tableName:s})]})};function os(){const{table:s}=qe.useParams();return(0,e.jsx)("main",{className:"flex-1 flex flex-col overflow-hidden",children:(0,e.jsx)(Me,{tableName:s})})}export{os as component};
@@ -0,0 +1 @@
1
+ import{jt as n}from"./radix-ui-deSt0_b9.js";import{n as a,t as o}from"./tables-BPDra69x.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"db-studio@1.20.0"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1f90e252-45fe-4ac0-9caa-0861976ed6a5",e._sentryDebugIdIdentifier="sentry-dbid-1f90e252-45fe-4ac0-9caa-0861976ed6a5")}catch{}})();var r=n();function f(){const{table:e}=a.useParams();return(0,r.jsx)(o,{tableName:e})}export{f as component};
@@ -1 +1 @@
1
- (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"db-studio@1.18.0"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3c39b1bc-0997-4627-b32e-a588be4711ba",e._sentryDebugIdIdentifier="sentry-dbid-3c39b1bc-0997-4627-b32e-a588be4711ba")}catch{}})();var i={comments:{lineComment:"*"},brackets:[["[","]"],["(",")"]]},s={defaultToken:"invalid",ignoreCase:!0,tokenPostfix:".abap",keywords:["abap-source","abbreviated","abstract","accept","accepting","according","activation","actual","add","add-corresponding","adjacent","after","alias","aliases","align","all","allocate","alpha","analysis","analyzer","and","append","appendage","appending","application","archive","area","arithmetic","as","ascending","aspect","assert","assign","assigned","assigning","association","asynchronous","at","attributes","authority","authority-check","avg","back","background","backup","backward","badi","base","before","begin","between","big","binary","bintohex","bit","black","blank","blanks","blob","block","blocks","blue","bound","boundaries","bounds","boxed","break-point","buffer","by","bypassing","byte","byte-order","call","calling","case","cast","casting","catch","center","centered","chain","chain-input","chain-request","change","changing","channels","character","char-to-hex","check","checkbox","ci_","circular","class","class-coding","class-data","class-events","class-methods","class-pool","cleanup","clear","client","clob","clock","close","coalesce","code","coding","col_background","col_group","col_heading","col_key","col_negative","col_normal","col_positive","col_total","collect","color","column","columns","comment","comments","commit","common","communication","comparing","component","components","compression","compute","concat","concat_with_space","concatenate","cond","condense","condition","connect","connection","constants","context","contexts","continue","control","controls","conv","conversion","convert","copies","copy","corresponding","country","cover","cpi","create","creating","critical","currency","currency_conversion","current","cursor","cursor-selection","customer","customer-function","dangerous","data","database","datainfo","dataset","date","dats_add_days","dats_add_months","dats_days_between","dats_is_valid","daylight","dd/mm/yy","dd/mm/yyyy","ddmmyy","deallocate","decimal_shift","decimals","declarations","deep","default","deferred","define","defining","definition","delete","deleting","demand","department","descending","describe","destination","detail","dialog","directory","disconnect","display","display-mode","distinct","divide","divide-corresponding","division","do","dummy","duplicate","duplicates","duration","during","dynamic","dynpro","edit","editor-call","else","elseif","empty","enabled","enabling","encoding","end","endat","endcase","endcatch","endchain","endclass","enddo","endenhancement","end-enhancement-section","endexec","endform","endfunction","endian","endif","ending","endinterface","end-lines","endloop","endmethod","endmodule","end-of-definition","end-of-editing","end-of-file","end-of-page","end-of-selection","endon","endprovide","endselect","end-test-injection","end-test-seam","endtry","endwhile","endwith","engineering","enhancement","enhancement-point","enhancements","enhancement-section","entries","entry","enum","environment","equiv","errormessage","errors","escaping","event","events","exact","except","exception","exceptions","exception-table","exclude","excluding","exec","execute","exists","exit","exit-command","expand","expanding","expiration","explicit","exponent","export","exporting","extend","extended","extension","extract","fail","fetch","field","field-groups","fields","field-symbol","field-symbols","file","filter","filters","filter-table","final","find","first","first-line","fixed-point","fkeq","fkge","flush","font","for","form","format","forward","found","frame","frames","free","friends","from","function","functionality","function-pool","further","gaps","generate","get","giving","gkeq","gkge","global","grant","green","group","groups","handle","handler","harmless","hashed","having","hdb","header","headers","heading","head-lines","help-id","help-request","hextobin","hide","high","hint","hold","hotspot","icon","id","identification","identifier","ids","if","ignore","ignoring","immediately","implementation","implementations","implemented","implicit","import","importing","in","inactive","incl","include","includes","including","increment","index","index-line","infotypes","inheriting","init","initial","initialization","inner","inout","input","insert","instance","instances","instr","intensified","interface","interface-pool","interfaces","internal","intervals","into","inverse","inverted-date","is","iso","job","join","keep","keeping","kernel","key","keys","keywords","kind","language","last","late","layout","leading","leave","left","left-justified","leftplus","leftspace","legacy","length","let","level","levels","like","line","lines","line-count","linefeed","line-selection","line-size","list","listbox","list-processing","little","llang","load","load-of-program","lob","local","locale","locator","logfile","logical","log-point","long","loop","low","lower","lpad","lpi","ltrim","mail","main","major-id","mapping","margin","mark","mask","match","matchcode","max","maximum","medium","members","memory","mesh","message","message-id","messages","messaging","method","methods","min","minimum","minor-id","mm/dd/yy","mm/dd/yyyy","mmddyy","mode","modif","modifier","modify","module","move","move-corresponding","multiply","multiply-corresponding","name","nametab","native","nested","nesting","new","new-line","new-page","new-section","next","no","no-display","no-extension","no-gap","no-gaps","no-grouping","no-heading","no-scrolling","no-sign","no-title","no-topofpage","no-zero","node","nodes","non-unicode","non-unique","not","null","number","object","objects","obligatory","occurrence","occurrences","occurs","of","off","offset","ole","on","only","open","option","optional","options","or","order","other","others","out","outer","output","output-length","overflow","overlay","pack","package","pad","padding","page","pages","parameter","parameters","parameter-table","part","partially","pattern","percentage","perform","performing","person","pf1","pf10","pf11","pf12","pf13","pf14","pf15","pf2","pf3","pf4","pf5","pf6","pf7","pf8","pf9","pf-status","pink","places","pool","pos_high","pos_low","position","pragmas","precompiled","preferred","preserving","primary","print","print-control","priority","private","procedure","process","program","property","protected","provide","public","push","pushbutton","put","queue-only","quickinfo","radiobutton","raise","raising","range","ranges","read","reader","read-only","receive","received","receiver","receiving","red","redefinition","reduce","reduced","ref","reference","refresh","regex","reject","remote","renaming","replace","replacement","replacing","report","request","requested","reserve","reset","resolution","respecting","responsible","result","results","resumable","resume","retry","return","returncode","returning","returns","right","right-justified","rightplus","rightspace","risk","rmc_communication_failure","rmc_invalid_status","rmc_system_failure","role","rollback","rows","rpad","rtrim","run","sap","sap-spool","saving","scale_preserving","scale_preserving_scientific","scan","scientific","scientific_with_leading_zero","scroll","scroll-boundary","scrolling","search","secondary","seconds","section","select","selection","selections","selection-screen","selection-set","selection-sets","selection-table","select-options","send","separate","separated","set","shared","shift","short","shortdump-id","sign_as_postfix","single","size","skip","skipping","smart","some","sort","sortable","sorted","source","specified","split","spool","spots","sql","sqlscript","stable","stamp","standard","starting","start-of-editing","start-of-selection","state","statement","statements","static","statics","statusinfo","step-loop","stop","structure","structures","style","subkey","submatches","submit","subroutine","subscreen","subtract","subtract-corresponding","suffix","sum","summary","summing","supplied","supply","suppress","switch","switchstates","symbol","syncpoints","syntax","syntax-check","syntax-trace","system-call","system-exceptions","system-exit","tab","tabbed","table","tables","tableview","tabstrip","target","task","tasks","test","testing","test-injection","test-seam","text","textpool","then","throw","time","times","timestamp","timezone","tims_is_valid","title","titlebar","title-lines","to","tokenization","tokens","top-lines","top-of-page","trace-file","trace-table","trailing","transaction","transfer","transformation","translate","transporting","trmac","truncate","truncation","try","tstmp_add_seconds","tstmp_current_utctimestamp","tstmp_is_valid","tstmp_seconds_between","type","type-pool","type-pools","types","uline","unassign","under","unicode","union","unique","unit_conversion","unix","unpack","until","unwind","up","update","upper","user","user-command","using","utf-8","valid","value","value-request","values","vary","varying","verification-message","version","via","view","visible","wait","warning","when","whenever","where","while","width","window","windows","with","with-heading","without","with-title","word","work","write","writer","xml","xsd","yellow","yes","yymmdd","zero","zone","abap_system_timezone","abap_user_timezone","access","action","adabas","adjust_numbers","allow_precision_loss","allowed","amdp","applicationuser","as_geo_json","as400","associations","balance","behavior","breakup","bulk","cds","cds_client","check_before_save","child","clients","corr","corr_spearman","cross","cycles","datn_add_days","datn_add_months","datn_days_between","dats_from_datn","dats_tims_to_tstmp","dats_to_datn","db2","db6","ddl","dense_rank","depth","deterministic","discarding","entities","entity","error","failed","finalize","first_value","fltp_to_dec","following","fractional","full","graph","grouping","hierarchy","hierarchy_ancestors","hierarchy_ancestors_aggregate","hierarchy_descendants","hierarchy_descendants_aggregate","hierarchy_siblings","incremental","indicators","lag","last_value","lead","leaves","like_regexpr","link","locale_sap","lock","locks","many","mapped","matched","measures","median","mssqlnt","multiple","nodetype","ntile","nulls","occurrences_regexpr","one","operations","oracle","orphans","over","parent","parents","partition","pcre","period","pfcg_mapping","preceding","privileged","product","projection","rank","redirected","replace_regexpr","reported","response","responses","root","row","row_number","sap_system_date","save","schema","session","sets","shortdump","siblings","spantree","start","stddev","string_agg","subtotal","sybase","tims_from_timn","tims_to_timn","to_blob","to_clob","total","trace-entry","tstmp_to_dats","tstmp_to_dst","tstmp_to_tims","tstmpl_from_utcl","tstmpl_to_utcl","unbounded","utcl_add_seconds","utcl_current","utcl_seconds_between","uuid","var","verbatim"],builtinFunctions:["abs","acos","asin","atan","bit-set","boolc","boolx","ceil","char_off","charlen","cmax","cmin","concat_lines_of","contains","contains_any_not_of","contains_any_of","cos","cosh","count","count_any_not_of","count_any_of","dbmaxlen","distance","escape","exp","find_any_not_of","find_any_of","find_end","floor","frac","from_mixed","ipow","line_exists","line_index","log","log10","matches","nmax","nmin","numofchar","repeat","rescale","reverse","round","segment","shift_left","shift_right","sign","sin","sinh","sqrt","strlen","substring","substring_after","substring_before","substring_from","substring_to","tan","tanh","to_lower","to_mixed","to_upper","trunc","utclong_add","utclong_current","utclong_diff","xsdbool","xstrlen"],typeKeywords:["b","c","d","decfloat16","decfloat34","f","i","int8","n","p","s","string","t","utclong","x","xstring","any","clike","csequence","decfloat","numeric","simple","xsequence","accp","char","clnt","cuky","curr","datn","dats","d16d","d16n","d16r","d34d","d34n","d34r","dec","df16_dec","df16_raw","df34_dec","df34_raw","fltp","geom_ewkb","int1","int2","int4","lang","lchr","lraw","numc","quan","raw","rawstring","sstring","timn","tims","unit","utcl","df16_scl","df34_scl","prec","varc","abap_bool","abap_false","abap_true","abap_undefined","me","screen","space","super","sy","syst","table_line","*sys*"],builtinMethods:["class_constructor","constructor"],derivedTypes:["%CID","%CID_REF","%CONTROL","%DATA","%ELEMENT","%FAIL","%KEY","%MSG","%PARAM","%PID","%PID_ASSOC","%PID_PARENT","%_HINTS"],cdsLanguage:["@AbapAnnotation","@AbapCatalog","@AccessControl","@API","@ClientDependent","@ClientHandling","@CompatibilityContract","@DataAging","@EndUserText","@Environment","@LanguageDependency","@MappingRole","@Metadata","@MetadataExtension","@ObjectModel","@Scope","@Semantics","$EXTENSION","$SELF"],selectors:["->","->*","=>","~","~*"],operators:[" +"," -","/","*","**","div","mod","=","#","@","+=","-=","*=","/=","**=","&&=","?=","&","&&","bit-and","bit-not","bit-or","bit-xor","m","o","z","<"," >","<=",">=","<>","><","=<","=>","bt","byte-ca","byte-cn","byte-co","byte-cs","byte-na","byte-ns","ca","cn","co","cp","cs","eq","ge","gt","le","lt","na","nb","ne","np","ns","*/","*:","--","/*","//"],symbols:/[=><!~?&+\-*\/\^%#@]+/,tokenizer:{root:[[/[a-z_\/$%@]([\w\/$%]|-(?!>))*/,{cases:{"@typeKeywords":"type","@keywords":"keyword","@cdsLanguage":"annotation","@derivedTypes":"type","@builtinFunctions":"type","@builtinMethods":"type","@operators":"key","@default":"identifier"}}],[/<[\w]+>/,"identifier"],[/##[\w|_]+/,"comment"],{include:"@whitespace"},[/[:,.]/,"delimiter"],[/[{}()\[\]]/,"@brackets"],[/@symbols/,{cases:{"@selectors":"tag","@operators":"key","@default":""}}],[/'/,{token:"string",bracket:"@open",next:"@stringquote"}],[/`/,{token:"string",bracket:"@open",next:"@stringping"}],[/\|/,{token:"string",bracket:"@open",next:"@stringtemplate"}],[/\d+/,"number"]],stringtemplate:[[/[^\\\|]+/,"string"],[/\\\|/,"string"],[/\|/,{token:"string",bracket:"@close",next:"@pop"}]],stringping:[[/[^\\`]+/,"string"],[/`/,{token:"string",bracket:"@close",next:"@pop"}]],stringquote:[[/[^\\']+/,"string"],[/'/,{token:"string",bracket:"@close",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,""],[/^\*.*$/,"comment"],[/\".*$/,"comment"]]}};export{i as conf,s as language};
1
+ (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"db-studio@1.20.0"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3c39b1bc-0997-4627-b32e-a588be4711ba",e._sentryDebugIdIdentifier="sentry-dbid-3c39b1bc-0997-4627-b32e-a588be4711ba")}catch{}})();var i={comments:{lineComment:"*"},brackets:[["[","]"],["(",")"]]},s={defaultToken:"invalid",ignoreCase:!0,tokenPostfix:".abap",keywords:["abap-source","abbreviated","abstract","accept","accepting","according","activation","actual","add","add-corresponding","adjacent","after","alias","aliases","align","all","allocate","alpha","analysis","analyzer","and","append","appendage","appending","application","archive","area","arithmetic","as","ascending","aspect","assert","assign","assigned","assigning","association","asynchronous","at","attributes","authority","authority-check","avg","back","background","backup","backward","badi","base","before","begin","between","big","binary","bintohex","bit","black","blank","blanks","blob","block","blocks","blue","bound","boundaries","bounds","boxed","break-point","buffer","by","bypassing","byte","byte-order","call","calling","case","cast","casting","catch","center","centered","chain","chain-input","chain-request","change","changing","channels","character","char-to-hex","check","checkbox","ci_","circular","class","class-coding","class-data","class-events","class-methods","class-pool","cleanup","clear","client","clob","clock","close","coalesce","code","coding","col_background","col_group","col_heading","col_key","col_negative","col_normal","col_positive","col_total","collect","color","column","columns","comment","comments","commit","common","communication","comparing","component","components","compression","compute","concat","concat_with_space","concatenate","cond","condense","condition","connect","connection","constants","context","contexts","continue","control","controls","conv","conversion","convert","copies","copy","corresponding","country","cover","cpi","create","creating","critical","currency","currency_conversion","current","cursor","cursor-selection","customer","customer-function","dangerous","data","database","datainfo","dataset","date","dats_add_days","dats_add_months","dats_days_between","dats_is_valid","daylight","dd/mm/yy","dd/mm/yyyy","ddmmyy","deallocate","decimal_shift","decimals","declarations","deep","default","deferred","define","defining","definition","delete","deleting","demand","department","descending","describe","destination","detail","dialog","directory","disconnect","display","display-mode","distinct","divide","divide-corresponding","division","do","dummy","duplicate","duplicates","duration","during","dynamic","dynpro","edit","editor-call","else","elseif","empty","enabled","enabling","encoding","end","endat","endcase","endcatch","endchain","endclass","enddo","endenhancement","end-enhancement-section","endexec","endform","endfunction","endian","endif","ending","endinterface","end-lines","endloop","endmethod","endmodule","end-of-definition","end-of-editing","end-of-file","end-of-page","end-of-selection","endon","endprovide","endselect","end-test-injection","end-test-seam","endtry","endwhile","endwith","engineering","enhancement","enhancement-point","enhancements","enhancement-section","entries","entry","enum","environment","equiv","errormessage","errors","escaping","event","events","exact","except","exception","exceptions","exception-table","exclude","excluding","exec","execute","exists","exit","exit-command","expand","expanding","expiration","explicit","exponent","export","exporting","extend","extended","extension","extract","fail","fetch","field","field-groups","fields","field-symbol","field-symbols","file","filter","filters","filter-table","final","find","first","first-line","fixed-point","fkeq","fkge","flush","font","for","form","format","forward","found","frame","frames","free","friends","from","function","functionality","function-pool","further","gaps","generate","get","giving","gkeq","gkge","global","grant","green","group","groups","handle","handler","harmless","hashed","having","hdb","header","headers","heading","head-lines","help-id","help-request","hextobin","hide","high","hint","hold","hotspot","icon","id","identification","identifier","ids","if","ignore","ignoring","immediately","implementation","implementations","implemented","implicit","import","importing","in","inactive","incl","include","includes","including","increment","index","index-line","infotypes","inheriting","init","initial","initialization","inner","inout","input","insert","instance","instances","instr","intensified","interface","interface-pool","interfaces","internal","intervals","into","inverse","inverted-date","is","iso","job","join","keep","keeping","kernel","key","keys","keywords","kind","language","last","late","layout","leading","leave","left","left-justified","leftplus","leftspace","legacy","length","let","level","levels","like","line","lines","line-count","linefeed","line-selection","line-size","list","listbox","list-processing","little","llang","load","load-of-program","lob","local","locale","locator","logfile","logical","log-point","long","loop","low","lower","lpad","lpi","ltrim","mail","main","major-id","mapping","margin","mark","mask","match","matchcode","max","maximum","medium","members","memory","mesh","message","message-id","messages","messaging","method","methods","min","minimum","minor-id","mm/dd/yy","mm/dd/yyyy","mmddyy","mode","modif","modifier","modify","module","move","move-corresponding","multiply","multiply-corresponding","name","nametab","native","nested","nesting","new","new-line","new-page","new-section","next","no","no-display","no-extension","no-gap","no-gaps","no-grouping","no-heading","no-scrolling","no-sign","no-title","no-topofpage","no-zero","node","nodes","non-unicode","non-unique","not","null","number","object","objects","obligatory","occurrence","occurrences","occurs","of","off","offset","ole","on","only","open","option","optional","options","or","order","other","others","out","outer","output","output-length","overflow","overlay","pack","package","pad","padding","page","pages","parameter","parameters","parameter-table","part","partially","pattern","percentage","perform","performing","person","pf1","pf10","pf11","pf12","pf13","pf14","pf15","pf2","pf3","pf4","pf5","pf6","pf7","pf8","pf9","pf-status","pink","places","pool","pos_high","pos_low","position","pragmas","precompiled","preferred","preserving","primary","print","print-control","priority","private","procedure","process","program","property","protected","provide","public","push","pushbutton","put","queue-only","quickinfo","radiobutton","raise","raising","range","ranges","read","reader","read-only","receive","received","receiver","receiving","red","redefinition","reduce","reduced","ref","reference","refresh","regex","reject","remote","renaming","replace","replacement","replacing","report","request","requested","reserve","reset","resolution","respecting","responsible","result","results","resumable","resume","retry","return","returncode","returning","returns","right","right-justified","rightplus","rightspace","risk","rmc_communication_failure","rmc_invalid_status","rmc_system_failure","role","rollback","rows","rpad","rtrim","run","sap","sap-spool","saving","scale_preserving","scale_preserving_scientific","scan","scientific","scientific_with_leading_zero","scroll","scroll-boundary","scrolling","search","secondary","seconds","section","select","selection","selections","selection-screen","selection-set","selection-sets","selection-table","select-options","send","separate","separated","set","shared","shift","short","shortdump-id","sign_as_postfix","single","size","skip","skipping","smart","some","sort","sortable","sorted","source","specified","split","spool","spots","sql","sqlscript","stable","stamp","standard","starting","start-of-editing","start-of-selection","state","statement","statements","static","statics","statusinfo","step-loop","stop","structure","structures","style","subkey","submatches","submit","subroutine","subscreen","subtract","subtract-corresponding","suffix","sum","summary","summing","supplied","supply","suppress","switch","switchstates","symbol","syncpoints","syntax","syntax-check","syntax-trace","system-call","system-exceptions","system-exit","tab","tabbed","table","tables","tableview","tabstrip","target","task","tasks","test","testing","test-injection","test-seam","text","textpool","then","throw","time","times","timestamp","timezone","tims_is_valid","title","titlebar","title-lines","to","tokenization","tokens","top-lines","top-of-page","trace-file","trace-table","trailing","transaction","transfer","transformation","translate","transporting","trmac","truncate","truncation","try","tstmp_add_seconds","tstmp_current_utctimestamp","tstmp_is_valid","tstmp_seconds_between","type","type-pool","type-pools","types","uline","unassign","under","unicode","union","unique","unit_conversion","unix","unpack","until","unwind","up","update","upper","user","user-command","using","utf-8","valid","value","value-request","values","vary","varying","verification-message","version","via","view","visible","wait","warning","when","whenever","where","while","width","window","windows","with","with-heading","without","with-title","word","work","write","writer","xml","xsd","yellow","yes","yymmdd","zero","zone","abap_system_timezone","abap_user_timezone","access","action","adabas","adjust_numbers","allow_precision_loss","allowed","amdp","applicationuser","as_geo_json","as400","associations","balance","behavior","breakup","bulk","cds","cds_client","check_before_save","child","clients","corr","corr_spearman","cross","cycles","datn_add_days","datn_add_months","datn_days_between","dats_from_datn","dats_tims_to_tstmp","dats_to_datn","db2","db6","ddl","dense_rank","depth","deterministic","discarding","entities","entity","error","failed","finalize","first_value","fltp_to_dec","following","fractional","full","graph","grouping","hierarchy","hierarchy_ancestors","hierarchy_ancestors_aggregate","hierarchy_descendants","hierarchy_descendants_aggregate","hierarchy_siblings","incremental","indicators","lag","last_value","lead","leaves","like_regexpr","link","locale_sap","lock","locks","many","mapped","matched","measures","median","mssqlnt","multiple","nodetype","ntile","nulls","occurrences_regexpr","one","operations","oracle","orphans","over","parent","parents","partition","pcre","period","pfcg_mapping","preceding","privileged","product","projection","rank","redirected","replace_regexpr","reported","response","responses","root","row","row_number","sap_system_date","save","schema","session","sets","shortdump","siblings","spantree","start","stddev","string_agg","subtotal","sybase","tims_from_timn","tims_to_timn","to_blob","to_clob","total","trace-entry","tstmp_to_dats","tstmp_to_dst","tstmp_to_tims","tstmpl_from_utcl","tstmpl_to_utcl","unbounded","utcl_add_seconds","utcl_current","utcl_seconds_between","uuid","var","verbatim"],builtinFunctions:["abs","acos","asin","atan","bit-set","boolc","boolx","ceil","char_off","charlen","cmax","cmin","concat_lines_of","contains","contains_any_not_of","contains_any_of","cos","cosh","count","count_any_not_of","count_any_of","dbmaxlen","distance","escape","exp","find_any_not_of","find_any_of","find_end","floor","frac","from_mixed","ipow","line_exists","line_index","log","log10","matches","nmax","nmin","numofchar","repeat","rescale","reverse","round","segment","shift_left","shift_right","sign","sin","sinh","sqrt","strlen","substring","substring_after","substring_before","substring_from","substring_to","tan","tanh","to_lower","to_mixed","to_upper","trunc","utclong_add","utclong_current","utclong_diff","xsdbool","xstrlen"],typeKeywords:["b","c","d","decfloat16","decfloat34","f","i","int8","n","p","s","string","t","utclong","x","xstring","any","clike","csequence","decfloat","numeric","simple","xsequence","accp","char","clnt","cuky","curr","datn","dats","d16d","d16n","d16r","d34d","d34n","d34r","dec","df16_dec","df16_raw","df34_dec","df34_raw","fltp","geom_ewkb","int1","int2","int4","lang","lchr","lraw","numc","quan","raw","rawstring","sstring","timn","tims","unit","utcl","df16_scl","df34_scl","prec","varc","abap_bool","abap_false","abap_true","abap_undefined","me","screen","space","super","sy","syst","table_line","*sys*"],builtinMethods:["class_constructor","constructor"],derivedTypes:["%CID","%CID_REF","%CONTROL","%DATA","%ELEMENT","%FAIL","%KEY","%MSG","%PARAM","%PID","%PID_ASSOC","%PID_PARENT","%_HINTS"],cdsLanguage:["@AbapAnnotation","@AbapCatalog","@AccessControl","@API","@ClientDependent","@ClientHandling","@CompatibilityContract","@DataAging","@EndUserText","@Environment","@LanguageDependency","@MappingRole","@Metadata","@MetadataExtension","@ObjectModel","@Scope","@Semantics","$EXTENSION","$SELF"],selectors:["->","->*","=>","~","~*"],operators:[" +"," -","/","*","**","div","mod","=","#","@","+=","-=","*=","/=","**=","&&=","?=","&","&&","bit-and","bit-not","bit-or","bit-xor","m","o","z","<"," >","<=",">=","<>","><","=<","=>","bt","byte-ca","byte-cn","byte-co","byte-cs","byte-na","byte-ns","ca","cn","co","cp","cs","eq","ge","gt","le","lt","na","nb","ne","np","ns","*/","*:","--","/*","//"],symbols:/[=><!~?&+\-*\/\^%#@]+/,tokenizer:{root:[[/[a-z_\/$%@]([\w\/$%]|-(?!>))*/,{cases:{"@typeKeywords":"type","@keywords":"keyword","@cdsLanguage":"annotation","@derivedTypes":"type","@builtinFunctions":"type","@builtinMethods":"type","@operators":"key","@default":"identifier"}}],[/<[\w]+>/,"identifier"],[/##[\w|_]+/,"comment"],{include:"@whitespace"},[/[:,.]/,"delimiter"],[/[{}()\[\]]/,"@brackets"],[/@symbols/,{cases:{"@selectors":"tag","@operators":"key","@default":""}}],[/'/,{token:"string",bracket:"@open",next:"@stringquote"}],[/`/,{token:"string",bracket:"@open",next:"@stringping"}],[/\|/,{token:"string",bracket:"@open",next:"@stringtemplate"}],[/\d+/,"number"]],stringtemplate:[[/[^\\\|]+/,"string"],[/\\\|/,"string"],[/\|/,{token:"string",bracket:"@close",next:"@pop"}]],stringping:[[/[^\\`]+/,"string"],[/`/,{token:"string",bracket:"@close",next:"@pop"}]],stringquote:[[/[^\\']+/,"string"],[/'/,{token:"string",bracket:"@close",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,""],[/^\*.*$/,"comment"],[/\".*$/,"comment"]]}};export{i as conf,s as language};
@@ -1 +1 @@
1
- (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"db-studio@1.18.0"};var s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="b63b13e9-254d-4208-948c-98ef9dce408e",e._sentryDebugIdIdentifier="sentry-dbid-b63b13e9-254d-4208-948c-98ef9dce408e")}catch{}})();var r={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"}],folding:{markers:{start:new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))"),end:new RegExp("^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))")}}},n=["abstract","activate","and","any","array","as","asc","assert","autonomous","begin","bigdecimal","blob","boolean","break","bulk","by","case","cast","catch","char","class","collect","commit","const","continue","convertcurrency","decimal","default","delete","desc","do","double","else","end","enum","exception","exit","export","extends","false","final","finally","float","for","from","future","get","global","goto","group","having","hint","if","implements","import","in","inner","insert","instanceof","int","interface","into","join","last_90_days","last_month","last_n_days","last_week","like","limit","list","long","loop","map","merge","native","new","next_90_days","next_month","next_n_days","next_week","not","null","nulls","number","object","of","on","or","outer","override","package","parallel","pragma","private","protected","public","retrieve","return","returning","rollback","savepoint","search","select","set","short","sort","stat","static","strictfp","super","switch","synchronized","system","testmethod","then","this","this_month","this_week","throw","throws","today","tolabel","tomorrow","transaction","transient","trigger","true","try","type","undelete","update","upsert","using","virtual","void","volatile","webservice","when","where","while","yesterday"],o=e=>e.charAt(0).toUpperCase()+e.substr(1),t=[];n.forEach(e=>{t.push(e),t.push(e.toUpperCase()),t.push(o(e))});var a={defaultToken:"",tokenPostfix:".apex",keywords:t,operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,digits:/\d+(_+\d+)*/,octaldigits:/[0-7]+(_+[0-7]+)*/,binarydigits:/[0-1]+(_+[0-1]+)*/,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,tokenizer:{root:[[/[a-z_$][\w$]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],[/[A-Z][\w\$]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"type.identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/@\s*[a-zA-Z_\$][\w\$]*/,"annotation"],[/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/,"number.float"],[/(@digits)[fFdD]/,"number.float"],[/(@digits)[lL]?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string",'@string."'],[/'/,"string","@string.'"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@apexdoc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],apexdoc:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]]}};export{r as conf,a as language};
1
+ (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"db-studio@1.20.0"};var s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="b63b13e9-254d-4208-948c-98ef9dce408e",e._sentryDebugIdIdentifier="sentry-dbid-b63b13e9-254d-4208-948c-98ef9dce408e")}catch{}})();var r={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"}],folding:{markers:{start:new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))"),end:new RegExp("^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))")}}},n=["abstract","activate","and","any","array","as","asc","assert","autonomous","begin","bigdecimal","blob","boolean","break","bulk","by","case","cast","catch","char","class","collect","commit","const","continue","convertcurrency","decimal","default","delete","desc","do","double","else","end","enum","exception","exit","export","extends","false","final","finally","float","for","from","future","get","global","goto","group","having","hint","if","implements","import","in","inner","insert","instanceof","int","interface","into","join","last_90_days","last_month","last_n_days","last_week","like","limit","list","long","loop","map","merge","native","new","next_90_days","next_month","next_n_days","next_week","not","null","nulls","number","object","of","on","or","outer","override","package","parallel","pragma","private","protected","public","retrieve","return","returning","rollback","savepoint","search","select","set","short","sort","stat","static","strictfp","super","switch","synchronized","system","testmethod","then","this","this_month","this_week","throw","throws","today","tolabel","tomorrow","transaction","transient","trigger","true","try","type","undelete","update","upsert","using","virtual","void","volatile","webservice","when","where","while","yesterday"],o=e=>e.charAt(0).toUpperCase()+e.substr(1),t=[];n.forEach(e=>{t.push(e),t.push(e.toUpperCase()),t.push(o(e))});var a={defaultToken:"",tokenPostfix:".apex",keywords:t,operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,digits:/\d+(_+\d+)*/,octaldigits:/[0-7]+(_+[0-7]+)*/,binarydigits:/[0-1]+(_+[0-1]+)*/,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,tokenizer:{root:[[/[a-z_$][\w$]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],[/[A-Z][\w\$]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"type.identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/@\s*[a-zA-Z_\$][\w\$]*/,"annotation"],[/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/,"number.float"],[/(@digits)[fFdD]/,"number.float"],[/(@digits)[lL]?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string",'@string."'],[/'/,"string","@string.'"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@apexdoc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],apexdoc:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]]}};export{r as conf,a as language};
@@ -1 +1 @@
1
- (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"db-studio@1.18.0"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="bf9ae677-ef2b-449e-b821-9b20d55f8b83",e._sentryDebugIdIdentifier="sentry-dbid-bf9ae677-ef2b-449e-b821-9b20d55f8b83")}catch{}})();var o={comments:{lineComment:"#"}},s={defaultToken:"keyword",ignoreCase:!0,tokenPostfix:".azcli",str:/[^#\s]/,tokenizer:{root:[{include:"@comment"},[/\s-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":{token:"key.identifier",next:"@type"}}}],[/^-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":{token:"key.identifier",next:"@type"}}}]],type:[{include:"@comment"},[/-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":"key.identifier"}}],[/@str+\s*/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}]],comment:[[/#.*$/,{cases:{"@eos":{token:"comment",next:"@popall"}}}]]}};export{o as conf,s as language};
1
+ (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"db-studio@1.20.0"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="bf9ae677-ef2b-449e-b821-9b20d55f8b83",e._sentryDebugIdIdentifier="sentry-dbid-bf9ae677-ef2b-449e-b821-9b20d55f8b83")}catch{}})();var o={comments:{lineComment:"#"}},s={defaultToken:"keyword",ignoreCase:!0,tokenPostfix:".azcli",str:/[^#\s]/,tokenizer:{root:[{include:"@comment"},[/\s-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":{token:"key.identifier",next:"@type"}}}],[/^-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":{token:"key.identifier",next:"@type"}}}]],type:[{include:"@comment"},[/-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":"key.identifier"}}],[/@str+\s*/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}]],comment:[[/#.*$/,{cases:{"@eos":{token:"comment",next:"@popall"}}}]]}};export{o as conf,s as language};
@@ -0,0 +1 @@
1
+ import{W as l,gt as u,ht as c,o as g}from"./icons-CjWX45lj.js";import{$ as f,G as m,J as p,K as x,Q as b,X as v,Y as h,Z as j,et as y,jt as C,nt as w,q as z,rt as A,tt as D,vt as k}from"./radix-ui-deSt0_b9.js";import{t as o}from"./utils-CshH-ggy.js";import{i as N}from"./label-CVNOUqUm.js";import{c as _,o as s}from"./tooltip-Hxe7NIhG.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"db-studio@1.20.0"};var a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="df2df275-5520-45ba-8c51-bea7aec917f7",e._sentryDebugIdIdentifier="sentry-dbid-df2df275-5520-45ba-8c51-bea7aec917f7")}catch{}})();var t=C(),T={info:{icon:l,containerClass:"border-blue-500/50 bg-blue-50/50 text-blue-600 dark:bg-blue-950/20",iconClass:"text-blue-500"},warning:{icon:g,containerClass:"border-amber-500/50 bg-amber-50/50 text-amber-600 dark:bg-amber-950/20",iconClass:"text-amber-500"},error:{icon:u,containerClass:"border-red-500/50 bg-red-50/50 text-red-600 dark:bg-red-950/20",iconClass:"text-red-500"},success:{icon:c,containerClass:"border-emerald-500/50 bg-emerald-50/50 text-emerald-600 dark:bg-emerald-950/20",iconClass:"text-emerald-500"}},O=({variant:e,title:a,message:r,className:i})=>{const n=T[e],d=n.icon;return(0,t.jsxs)("div",{className:o("rounded-md border px-4 py-3",n.containerClass,i),children:[(0,t.jsxs)("p",{className:o("text-sm flex items-center gap-2",r?"mb-1":""),children:[(0,t.jsx)(d,{"aria-hidden":"true",className:o("-mt-0.5 inline-flex opacity-80",n.iconClass),size:16}),(0,t.jsx)("span",{className:"font-medium",children:a})]}),r&&(0,t.jsx)("p",{className:"text-xs opacity-90 ml-7",children:r})]})};function V({...e}){return(0,t.jsx)(w,{"data-slot":"alert-dialog",...e})}function I({...e}){return(0,t.jsx)(D,{"data-slot":"alert-dialog-portal",...e})}function P({className:e,...a}){return(0,t.jsx)(y,{"data-slot":"alert-dialog-overlay",className:o("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50",e),...a})}function Y({className:e,size:a="default",...r}){return(0,t.jsxs)(I,{children:[(0,t.jsx)(P,{}),(0,t.jsx)(b,{"data-slot":"alert-dialog-content","data-size":a,className:o("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 bg-background ring-foreground/10 gap-3 rounded-xl p-4 ring-1 duration-100 data-[size=default]:max-w-xs data-[size=sm]:max-w-64 data-[size=default]:sm:max-w-sm group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 outline-none",e),...r})]})}function F({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-header",className:o("grid grid-rows-[auto_1fr] place-items-center gap-1 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...a})}function G({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-footer",className:o("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...a})}function H({className:e,...a}){return(0,t.jsx)(A,{"data-slot":"alert-dialog-title",className:o("text-sm font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...a})}function J({className:e,...a}){return(0,t.jsx)(f,{"data-slot":"alert-dialog-description",className:o("text-muted-foreground *:[a]:hover:text-foreground text-xs/relaxed text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3",e),...a})}function K({className:e,variant:a="default",size:r="default",...i}){return(0,t.jsx)(s,{variant:a,size:r,asChild:!0,children:(0,t.jsx)(v,{"data-slot":"alert-dialog-action",className:o(e),...i})})}function L({className:e,variant:a="outline",size:r="default",...i}){return(0,t.jsx)(s,{variant:a,size:r,asChild:!0,children:(0,t.jsx)(j,{"data-slot":"alert-dialog-cancel",className:o(e),...i})})}function Q({modal:e,...a}){const r=N();return(0,t.jsx)(p,{"data-slot":"popover",modal:e??(r?!0:void 0),...a})}function W({...e}){return(0,t.jsx)(h,{"data-slot":"popover-trigger",...e})}function X({className:e,align:a="center",sideOffset:r=4,...i}){return(0,t.jsx)(z,{children:(0,t.jsx)(x,{"data-slot":"popover-content",align:a,sideOffset:r,className:o("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 flex flex-col gap-4 rounded-lg p-2.5 text-xs shadow-md ring-1 duration-100 z-50 w-72 origin-(--radix-popover-content-transform-origin) outline-hidden",e),...i})})}function Z({...e}){return(0,t.jsx)(m,{"data-slot":"popover-anchor",...e})}var E=_("h-5 gap-1 rounded-full border border-transparent px-2 py-0.5 text-[0.625rem] font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-2.5! inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-colors overflow-hidden group/badge",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground bg-input/20 dark:bg-input/30",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function M({className:e,variant:a="default",asChild:r=!1,...i}){return(0,t.jsx)(r?k:"span",{"data-slot":"badge","data-variant":a,className:o(E({variant:a}),e),...i})}export{W as a,L as c,G as d,F as f,X as i,Y as l,O as m,Q as n,V as o,H as p,Z as r,K as s,M as t,J as u};
@@ -1 +1 @@
1
- (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"db-studio@1.18.0"};var s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="249f5ce5-b92e-40d9-8b24-1d5a7cdcea72",e._sentryDebugIdIdentifier="sentry-dbid-249f5ce5-b92e-40d9-8b24-1d5a7cdcea72")}catch{}})();var t={comments:{lineComment:"REM"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],surroundingPairs:[{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],folding:{markers:{start:new RegExp("^\\s*(::\\s*|REM\\s+)#region"),end:new RegExp("^\\s*(::\\s*|REM\\s+)#endregion")}}},n={defaultToken:"",ignoreCase:!0,tokenPostfix:".bat",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"}],keywords:/call|defined|echo|errorlevel|exist|for|goto|if|pause|set|shift|start|title|not|pushd|popd/,symbols:/[=><!~?&|+\-*\/\^;\.,]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/^(\s*)(rem(?:\s.*|))$/,["","comment"]],[/(\@?)(@keywords)(?!\w)/,[{token:"keyword"},{token:"keyword.$2"}]],[/[ \t\r\n]+/,""],[/setlocal(?!\w)/,"keyword.tag-setlocal"],[/endlocal(?!\w)/,"keyword.tag-setlocal"],[/[a-zA-Z_]\w*/,""],[/:\w*/,"metatag"],[/%[^%]+%/,"variable"],[/%%[\w]+(?!\w)/,"variable"],[/[{}()\[\]]/,"@brackets"],[/@symbols/,"delimiter"],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F_]*[0-9a-fA-F]/,"number.hex"],[/\d+/,"number"],[/[;,.]/,"delimiter"],[/"/,"string",'@string."'],[/'/,"string","@string.'"]],string:[[/[^\\"'%]+/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/%[\w ]+%/,"variable"],[/%%[\w]+(?!\w)/,"variable"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}],[/$/,"string","@popall"]]}};export{t as conf,n as language};
1
+ (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"db-studio@1.20.0"};var s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="249f5ce5-b92e-40d9-8b24-1d5a7cdcea72",e._sentryDebugIdIdentifier="sentry-dbid-249f5ce5-b92e-40d9-8b24-1d5a7cdcea72")}catch{}})();var t={comments:{lineComment:"REM"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],surroundingPairs:[{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],folding:{markers:{start:new RegExp("^\\s*(::\\s*|REM\\s+)#region"),end:new RegExp("^\\s*(::\\s*|REM\\s+)#endregion")}}},n={defaultToken:"",ignoreCase:!0,tokenPostfix:".bat",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"}],keywords:/call|defined|echo|errorlevel|exist|for|goto|if|pause|set|shift|start|title|not|pushd|popd/,symbols:/[=><!~?&|+\-*\/\^;\.,]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/^(\s*)(rem(?:\s.*|))$/,["","comment"]],[/(\@?)(@keywords)(?!\w)/,[{token:"keyword"},{token:"keyword.$2"}]],[/[ \t\r\n]+/,""],[/setlocal(?!\w)/,"keyword.tag-setlocal"],[/endlocal(?!\w)/,"keyword.tag-setlocal"],[/[a-zA-Z_]\w*/,""],[/:\w*/,"metatag"],[/%[^%]+%/,"variable"],[/%%[\w]+(?!\w)/,"variable"],[/[{}()\[\]]/,"@brackets"],[/@symbols/,"delimiter"],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F_]*[0-9a-fA-F]/,"number.hex"],[/\d+/,"number"],[/[;,.]/,"delimiter"],[/"/,"string",'@string."'],[/'/,"string","@string.'"]],string:[[/[^\\"'%]+/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/%[\w ]+%/,"variable"],[/%%[\w]+(?!\w)/,"variable"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}],[/$/,"string","@popall"]]}};export{t as conf,n as language};
@@ -1,2 +1,2 @@
1
- (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"db-studio@1.18.0"};var n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="6f8aa1b6-e914-4261-b615-33cc7f55ccba",e._sentryDebugIdIdentifier="sentry-dbid-6f8aa1b6-e914-4261-b615-33cc7f55ccba")}catch{}})();var t=e=>`\\b${e}\\b`,o=t("[_a-zA-Z][_a-zA-Z0-9]*"),r=["targetScope","resource","module","param","var","output","for","in","if","existing"],i=["true","false","null"],a="[ \\t\\r\\n]",s="[0-9]+",g={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'"},{open:"'''",close:"'''"}],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:"'''",close:"'''",notIn:["string","comment"]}],autoCloseBefore:`:.,=}])'
1
+ (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"db-studio@1.20.0"};var n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="6f8aa1b6-e914-4261-b615-33cc7f55ccba",e._sentryDebugIdIdentifier="sentry-dbid-6f8aa1b6-e914-4261-b615-33cc7f55ccba")}catch{}})();var t=e=>`\\b${e}\\b`,o=t("[_a-zA-Z][_a-zA-Z0-9]*"),r=["targetScope","resource","module","param","var","output","for","in","if","existing"],i=["true","false","null"],a="[ \\t\\r\\n]",s="[0-9]+",g={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'"},{open:"'''",close:"'''"}],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:"'''",close:"'''",notIn:["string","comment"]}],autoCloseBefore:`:.,=}])'
2
2
  `,indentationRules:{increaseIndentPattern:new RegExp("^((?!\\/\\/).)*(\\{[^}\"'`]*|\\([^)\"'`]*|\\[[^\\]\"'`]*)$"),decreaseIndentPattern:new RegExp("^((?!.*?\\/\\*).*\\*/)?\\s*[\\}\\]].*$")}},l={defaultToken:"",tokenPostfix:".bicep",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],symbols:/[=><!~?:&|+\-*/^%]+/,keywords:r,namedLiterals:i,escapes:"\\\\(u{[0-9A-Fa-f]+}|n|r|t|\\\\|'|\\${)",tokenizer:{root:[{include:"@expression"},{include:"@whitespace"}],stringVerbatim:[{regex:"(|'|'')[^']",action:{token:"string"}},{regex:"'''",action:{token:"string.quote",next:"@pop"}}],stringLiteral:[{regex:"\\${",action:{token:"delimiter.bracket",next:"@bracketCounting"}},{regex:"[^\\\\'$]+",action:{token:"string"}},{regex:"@escapes",action:{token:"string.escape"}},{regex:"\\\\.",action:{token:"string.escape.invalid"}},{regex:"'",action:{token:"string",next:"@pop"}}],bracketCounting:[{regex:"{",action:{token:"delimiter.bracket",next:"@bracketCounting"}},{regex:"}",action:{token:"delimiter.bracket",next:"@pop"}},{include:"expression"}],comment:[{regex:"[^\\*]+",action:{token:"comment"}},{regex:"\\*\\/",action:{token:"comment",next:"@pop"}},{regex:"[\\/*]",action:{token:"comment"}}],whitespace:[{regex:a},{regex:"\\/\\*",action:{token:"comment",next:"@comment"}},{regex:"\\/\\/.*$",action:{token:"comment"}}],expression:[{regex:"'''",action:{token:"string.quote",next:"@stringVerbatim"}},{regex:"'",action:{token:"string.quote",next:"@stringLiteral"}},{regex:s,action:{token:"number"}},{regex:o,action:{cases:{"@keywords":{token:"keyword"},"@namedLiterals":{token:"keyword"},"@default":{token:"identifier"}}}}]}};export{g as conf,l as language};
@@ -0,0 +1 @@
1
+ import{r as me}from"./rolldown-runtime-CFc_0XbV.js";import{v as he}from"./tanstack-BGvcrEX1.js";import{Ct as xe,E as ee,It as fe,Mt as be,S as B,T as pe,at as ge,b as ve,ct as je,k as ye,s as M,u as Ne}from"./icons-CjWX45lj.js";import{jt as ke}from"./radix-ui-deSt0_b9.js";import{n as we}from"./dist-CxVc5ukz.js";import{t as q}from"./utils-CshH-ggy.js";import{t as Se}from"./spinner-Dihgug3b.js";import{n as Ce}from"./dist-DFHV2Ot7.js";import{n as J}from"./label-CVNOUqUm.js";import{a as Re,i as Z,n as Q,o as m,t as W}from"./tooltip-Hxe7NIhG.js";import{w as De}from"./constants-BgZGgQU-.js";import{t as Me}from"./database.store-CzI49QG8.js";import{a as Le,c as _e,d as Te,f as Ee,i as $e,l as Fe,m as P,n as Oe,o as Ae,p as ze,s as Ie,t as Pe,u as Be}from"./badge-B60VPytI.js";import{S as Y,b as Je,o as Ke,s as ie,x as Ue,y as X}from"./index-CSMKcupk.js";import{t as Ge}from"./queries.store-BY1UGAw9.js";import{a as He,i as Ve,n as S,o as qe,r as Ze,t as D}from"./redis-value-YP_133ws.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};s.SENTRY_RELEASE={id:"db-studio@1.20.0"};var r=new s.Error().stack;r&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[r]="f1e49534-eb48-480d-8420-9139b7060291",s._sentryDebugIdIdentifier="sentry-dbid-f1e49534-eb48-480d-8420-9139b7060291")}catch{}})();var p=me(fe(),1),e=ke(),oe=({text:s,label:r,className:t})=>{const[a,i]=(0,p.useState)(!1);return(0,e.jsxs)(W,{children:[(0,e.jsx)(Z,{asChild:!0,children:(0,e.jsx)(m,{variant:"ghost",size:"icon-sm",className:t,onClick:async()=>{await navigator.clipboard.writeText(typeof s=="function"?s():s),i(!0),window.setTimeout(()=>i(!1),1200)},"aria-label":r,children:a?(0,e.jsx)(xe,{}):(0,e.jsx)(je,{})})}),(0,e.jsx)(Q,{children:a?"Copied":r})]})},Qe=[{label:"60s",ttlMs:6e4},{label:"10m",ttlMs:6e5},{label:"1h",ttlMs:36e5},{label:"1d",ttlMs:864e5},{label:"7d",ttlMs:6048e5}],We=s=>s===null?"—":s<1024?`${s} B`:s<1048576?`${(s/1024).toFixed(1)} KiB`:`${(s/1048576).toFixed(1)} MiB`,Ye=s=>{const r=Math.max(0,Math.ceil(s/1e3));if(r<60)return`${r}s`;const t=Math.floor(r/60);if(t<60)return`${t}m ${r%60}s`;const a=Math.floor(t/60);return a<24?`${a}h ${t%60}m`:`${Math.floor(a/24)}d ${a%24}h`},Xe=s=>{const[,r]=(0,p.useReducer)(t=>t+1,0);(0,p.useEffect)(()=>{if(!s)return;const t=window.setInterval(r,1e3);return()=>window.clearInterval(t)},[s])},es=({detail:s,label:r,loadedCount:t,fetchedAt:a,isFetching:i,pending:n,command:o,act:l,onRefresh:d,onOpenRunner:h,onDelete:c})=>{const[b,u]=(0,p.useState)(s.key),[L,U]=(0,p.useState)("");Xe(s.ttlMs>0);const C=s.ttlMs>0?s.ttlMs-(Date.now()-a):s.ttlMs,N=s.ttlMs===-1,x=!N&&C<=0,z=[{name:"TTL",value:N?"∞":x?"expired":Ye(C),hint:N?"No expiry — the key persists until deleted.":x?"The TTL elapsed; Redis has evicted or is about to evict this key.":`Expires ${new Date(a+s.ttlMs).toLocaleString()}`,alert:x},{name:"MEM",value:We(s.memoryBytes),hint:"Approximate memory usage reported by MEMORY USAGE."},{name:"LEN",value:s.length?.toLocaleString()??"—",hint:t!==null&&s.length!==null?`${t.toLocaleString()} of ${s.length.toLocaleString()} entries loaded in this view.`:"Length reported by Redis (entries, or bytes for strings)."},{name:"REV",value:s.revision.slice(0,8),hint:"Optimistic-lock revision. Writes are rejected when the key changed since this fetch."},{name:"AT",value:new Date(a).toLocaleTimeString(),hint:"When this snapshot was fetched from Redis."}];return(0,e.jsx)("header",{className:"border-b border-border",children:(0,e.jsxs)("div",{className:"flex min-h-10 items-stretch justify-between",children:[(0,e.jsxs)("div",{className:"flex min-w-0 flex-1 items-stretch overflow-x-auto",children:[(0,e.jsxs)("div",{className:"flex min-w-0 max-w-[min(36rem,45vw)] shrink items-center gap-1 px-3 py-1.5",children:[(0,e.jsx)("code",{className:"min-w-0 truncate text-sm text-foreground",title:r,children:r||"(empty key)"}),(0,e.jsx)(oe,{text:s.key.utf8??s.key.base64,label:"Copy key name",className:"shrink-0 text-muted-foreground"}),(0,e.jsx)(Pe,{variant:"outline",className:"h-4 shrink-0 rounded-sm px-1.5 text-[8px] font-normal uppercase text-muted-foreground",children:s.type})]}),z.map(({name:v,value:I,hint:_,alert:T},E)=>(0,e.jsxs)(W,{children:[(0,e.jsx)(Z,{asChild:!0,children:(0,e.jsxs)("div",{className:q("flex shrink-0 cursor-default items-center gap-1.5 border-s border-border px-2 text-[10px]",E===z.length-1&&"border-e"),children:[(0,e.jsx)("span",{className:"text-muted-foreground",children:v}),(0,e.jsx)("span",{className:q("tabular-nums",T?"text-destructive":"text-foreground"),children:I})]})}),(0,e.jsx)(Q,{side:"bottom",children:_})]},v))]}),(0,e.jsxs)("div",{className:"flex shrink-0 items-stretch",children:[(0,e.jsxs)(m,{variant:"ghost",size:"sm",className:"h-auto rounded-none border-y-0 border-s border-e-0 border-border px-2",onClick:d,disabled:i,children:[(0,e.jsx)(pe,{className:q(i&&"animate-spin")})," Refresh"]}),o&&(0,e.jsxs)(W,{children:[(0,e.jsx)(Z,{asChild:!0,children:(0,e.jsxs)(m,{variant:"ghost",size:"sm",className:"h-auto rounded-none border-y-0 border-s border-e-0 border-border px-2",onClick:h,children:[(0,e.jsx)(Ne,{})," Runner"]})}),(0,e.jsxs)(Q,{side:"bottom",children:["Open in the query runner as ",(0,e.jsx)("code",{className:"font-mono",children:o})]})]}),(0,e.jsxs)(Oe,{children:[(0,e.jsx)(Le,{asChild:!0,children:(0,e.jsxs)(m,{variant:"ghost",size:"sm",className:"h-auto rounded-none border-y-0 border-s border-e-0 border-border px-2",children:[(0,e.jsx)(ye,{})," Edit"]})}),(0,e.jsx)($e,{align:"end",className:"w-72 rounded-sm p-3 font-mono",children:(0,e.jsxs)(Ue,{className:"gap-4",children:[(0,e.jsxs)(X,{className:"gap-1.5",children:[(0,e.jsx)(Y,{htmlFor:"redis-key-rename",children:"Rename key"}),(0,e.jsxs)("form",{className:"flex",onSubmit:v=>{v.preventDefault(),!(b===null||b.base64===s.key.base64||n)&&l({action:"rename",newKey:b})},children:[(0,e.jsx)(S,{id:"redis-key-rename",value:b,onChange:u,className:"rounded-e-none font-mono"}),(0,e.jsx)(m,{type:"submit",size:"icon",className:"h-auto self-stretch rounded-s-none border-0 bg-clip-border",disabled:b===null||b.base64===s.key.base64||n,"aria-label":"Rename key",children:(0,e.jsx)(be,{})})]})]}),(0,e.jsxs)(X,{className:"gap-1.5",children:[(0,e.jsx)(Y,{htmlFor:"redis-key-ttl-operation",children:"TTL in seconds"}),(0,e.jsxs)("form",{className:"flex",onSubmit:v=>{v.preventDefault(),!n&&l({action:"setTtl",ttlMs:L?Number(L)*1e3:null})},children:[(0,e.jsx)(J,{id:"redis-key-ttl-operation",type:"number",min:1,value:L,onChange:v=>U(v.target.value),placeholder:s.ttlMs>0?String(Math.ceil(s.ttlMs/1e3)):"Persistent",className:"rounded-e-none font-mono"}),(0,e.jsx)(m,{type:"submit",className:"h-auto self-stretch rounded-s-none border-0 bg-clip-border",disabled:n,children:"Apply"})]}),(0,e.jsxs)("div",{className:"flex flex-wrap gap-1",children:[Qe.map(v=>(0,e.jsx)(m,{type:"button",variant:"outline",size:"xs",disabled:n,onClick:()=>l({action:"setTtl",ttlMs:v.ttlMs}),children:v.label},v.label)),(0,e.jsx)(m,{type:"button",variant:"outline",size:"xs",disabled:n||N,onClick:()=>l({action:"setTtl",ttlMs:null}),children:"Persist"})]}),(0,e.jsx)(Je,{children:"Leave empty to persist the key."})]})]})})]}),(0,e.jsxs)(m,{variant:"destructive",size:"sm",className:"h-auto rounded-none border-y-0 border-s border-e-0 border-border px-2",disabled:n,onClick:c,children:[(0,e.jsx)(M,{})," Delete"]})]})]})})},w=Ve(""),j=s=>s.utf8??`base64:${s.base64}`,$=(s,...r)=>r.some(t=>String(t).toLowerCase().includes(s)),F=s=>{switch(s.kind){case"string":return JSON.stringify(j(s.value),null,2);case"hash":return JSON.stringify(Object.fromEntries(s.entries.map(r=>[j(r.field),j(r.value)])),null,2);case"list":return JSON.stringify(s.entries.map(r=>j(r.value)),null,2);case"set":return JSON.stringify(s.members.map(j),null,2);case"zset":return JSON.stringify(s.entries.map(r=>({member:j(r.member),score:r.score})),null,2);case"stream":return JSON.stringify(s.entries.map(r=>({id:r.id,fields:Object.fromEntries(r.fields.map(t=>[j(t.field),j(t.value)]))})),null,2);default:return""}},K=(s,r)=>{const[t,a]=(0,p.useState)(s),[i,n]=(0,p.useState)(r);return i!==r&&(n(r),a(s)),[t,a]},O=({filtered:s})=>(0,e.jsx)("div",{className:"flex h-10 items-center justify-center px-2 text-xs text-muted-foreground",children:s?"No loaded entries match the filter.":"No entries loaded."}),A=({filter:s,onFilterChange:r,shownCount:t,loadedCount:a,totalCount:i,copyJson:n,extra:o,header:l,children:d,footer:h})=>(0,e.jsxs)("div",{className:"overflow-hidden border border-border",children:[(0,e.jsxs)("div",{className:"flex h-8 items-center gap-1 border-b border-border bg-muted/10 px-1",children:[(0,e.jsx)(ve,{className:"ms-1 size-3 shrink-0 text-muted-foreground"}),(0,e.jsx)(J,{variant:"outline",value:s,onChange:c=>r(c.target.value),placeholder:"Filter loaded entries","aria-label":"Filter loaded entries",className:"h-6 flex-1 rounded-none border-none px-1 font-mono focus-visible:ring-0"}),o,(0,e.jsx)("span",{className:"shrink-0 px-1 text-[10px] tabular-nums text-muted-foreground",children:s?`${t} / ${a}`:i!==null&&i>a?`${a.toLocaleString()} of ${i.toLocaleString()}`:a.toLocaleString()}),(0,e.jsx)(oe,{text:n,label:"Copy loaded entries as JSON"})]}),l,d,h]}),se=({labels:s,onSave:r,pending:t,score:a=!1})=>{const[i,n]=(0,p.useState)(w),[o,l]=(0,p.useState)(w),[d,h]=(0,p.useState)("0"),c=i===null||!a&&o===null,b=async u=>{u.preventDefault(),!(i===null||o===null)&&await r(i,a?Number(d):o)&&(n(w),l(w),h("0"))};return(0,e.jsxs)("form",{onSubmit:b,className:"grid grid-cols-[1fr_1fr_auto] items-center gap-2 border-t border-border bg-muted/10 p-2",children:[(0,e.jsx)(S,{value:i,onChange:n,placeholder:s[0]}),a?(0,e.jsx)(J,{type:"number",step:"any",value:d,onChange:u=>h(u.target.value),placeholder:s[1],className:"font-mono"}):(0,e.jsx)(S,{value:o,onChange:l,placeholder:s[1]}),(0,e.jsxs)(m,{type:"submit",disabled:t||c,children:[(0,e.jsx)(ee,{})," Add"]})]})},ss=({value:s,truncated:r,act:t,pending:a,onLoadFull:i,onDownload:n})=>{const[o,l]=K(s,s.base64),d=o!==null&&o.base64!==s.base64;return(0,e.jsxs)("div",{className:"space-y-3",children:[r&&(0,e.jsxs)("div",{className:"grid gap-2 border-b border-border pb-3 sm:grid-cols-[1fr_auto] sm:items-center",children:[(0,e.jsx)(P,{variant:"warning",title:"Preview truncated",message:"Load the full value before editing (up to the 8 MiB response cap).",className:"rounded-sm"}),(0,e.jsx)(m,{variant:"outline",onClick:i,children:"Load full"})]}),(0,e.jsx)(D,{value:s,onDownload:n}),(0,e.jsxs)("form",{onSubmit:h=>{h.preventDefault(),o!==null&&d&&t({action:"setString",value:o})},className:"border border-border p-3",children:[(0,e.jsxs)(X,{className:"gap-1.5",children:[(0,e.jsx)(Y,{htmlFor:"redis-string-value",children:"Replace value"}),(0,e.jsx)(S,{id:"redis-string-value",value:o,onChange:l})]}),(0,e.jsxs)(m,{type:"submit",className:"mt-3",disabled:r||a||!d,children:[(0,e.jsx)(B,{})," Save value"]})]})]})},rs=({field:s,value:r,act:t,pending:a})=>{const[i,n]=K(r,r.base64),o=i!==null&&i.base64!==r.base64;return(0,e.jsxs)("div",{className:"grid min-h-8 grid-cols-[minmax(10rem,0.7fr)_1fr_5rem] items-center gap-2 border-b border-border px-2 py-1",children:[(0,e.jsx)(D,{value:s,compact:!0}),(0,e.jsx)(S,{value:i,onChange:n}),(0,e.jsxs)("div",{className:"flex",children:[(0,e.jsx)(m,{variant:"ghost",size:"icon-sm",className:o?"text-primary":void 0,disabled:a||!o,onClick:()=>i!==null&&t({action:"upsertHash",field:s,value:i}),"aria-label":"Save hash value",children:(0,e.jsx)(B,{})}),(0,e.jsx)(m,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground hover:text-destructive",disabled:a,onClick:()=>t({action:"deleteHash",field:s}),"aria-label":"Delete hash field",children:(0,e.jsx)(M,{})})]})]})},ts=({value:s,total:r,act:t,pending:a})=>{const[i,n]=(0,p.useState)(""),o=i.trim().toLowerCase(),l=o?s.entries.filter(d=>$(o,j(d.field),j(d.value))):s.entries;return(0,e.jsx)(A,{filter:i,onFilterChange:n,shownCount:l.length,loadedCount:s.entries.length,totalCount:r,copyJson:()=>F(s),header:(0,e.jsxs)("div",{className:"grid h-8 grid-cols-[minmax(10rem,0.7fr)_1fr_5rem] items-center border-b border-border bg-muted/20 px-2 text-[10px] uppercase tracking-wider text-muted-foreground",children:[(0,e.jsx)("span",{children:"Field"}),(0,e.jsx)("span",{children:"Value"}),(0,e.jsx)("span",{})]}),footer:(0,e.jsx)(se,{labels:["field","value"],pending:a,onSave:(d,h)=>t({action:"upsertHash",field:d,value:h})}),children:l.length===0?(0,e.jsx)(O,{filtered:o.length>0}):l.map(d=>(0,e.jsx)(rs,{field:d.field,value:d.value,act:t,pending:a},d.field.base64))})},as=({index:s,value:r,revision:t,act:a,pending:i})=>{const[n,o]=K(r,`${t}:${r.base64}`),l=n!==null&&n.base64!==r.base64;return(0,e.jsxs)("div",{className:"grid min-h-8 grid-cols-[3rem_1fr_5rem] items-center gap-2 border-b border-border px-2 py-1",children:[(0,e.jsx)("code",{className:"text-xs text-muted-foreground",children:s}),(0,e.jsx)(S,{value:n,onChange:o}),(0,e.jsxs)("div",{className:"flex",children:[(0,e.jsx)(m,{variant:"ghost",size:"icon-sm",className:l?"text-primary":void 0,disabled:i||!l,onClick:()=>n!==null&&a({action:"setList",index:s,value:n}),"aria-label":`Save list item ${s}`,children:(0,e.jsx)(B,{})}),(0,e.jsx)(m,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground hover:text-destructive",disabled:i,onClick:()=>a({action:"deleteList",index:s}),"aria-label":`Delete list item ${s}`,children:(0,e.jsx)(M,{})})]})]})},ns=({value:s,revision:r,total:t,act:a,pending:i})=>{const[n,o]=(0,p.useState)(""),[l,d]=(0,p.useState)(w),h=n.trim().toLowerCase(),c=h?s.entries.filter(u=>$(h,u.index,j(u.value))):s.entries,b=async u=>{l!==null&&await a({action:"pushList",side:u,value:l})&&d(w)};return(0,e.jsx)(A,{filter:n,onFilterChange:o,shownCount:c.length,loadedCount:s.entries.length,totalCount:t,copyJson:()=>F(s),header:(0,e.jsxs)("div",{className:"grid h-8 grid-cols-[3rem_1fr_5rem] items-center border-b border-border bg-muted/20 px-2 text-[10px] uppercase tracking-wider text-muted-foreground",children:[(0,e.jsx)("span",{children:"Index"}),(0,e.jsx)("span",{children:"Value"}),(0,e.jsx)("span",{})]}),footer:(0,e.jsxs)("form",{onSubmit:u=>{u.preventDefault(),b("right")},className:"grid grid-cols-[1fr_auto_auto] items-center gap-2 border-t border-border bg-muted/10 p-2",children:[(0,e.jsx)(S,{value:l,onChange:d,placeholder:"new item"}),(0,e.jsx)(m,{type:"button",variant:"outline",disabled:i||l===null,onClick:()=>b("left"),children:"Push left"}),(0,e.jsx)(m,{type:"submit",disabled:i||l===null,children:"Push right"})]}),children:c.length===0?(0,e.jsx)(O,{filtered:h.length>0}):c.map(u=>(0,e.jsx)(as,{index:u.index,value:u.value,revision:r,act:a,pending:i},u.index))})},is=({value:s,total:r,act:t,pending:a})=>{const[i,n]=(0,p.useState)(""),[o,l]=(0,p.useState)(w),d=i.trim().toLowerCase(),h=d?s.members.filter(c=>$(d,j(c))):s.members;return(0,e.jsx)(A,{filter:i,onFilterChange:n,shownCount:h.length,loadedCount:s.members.length,totalCount:r,copyJson:()=>F(s),header:(0,e.jsxs)("div",{className:"grid h-8 grid-cols-[1fr_2rem] items-center border-b border-border bg-muted/20 px-2 text-[10px] uppercase tracking-wider text-muted-foreground",children:[(0,e.jsx)("span",{children:"Member"}),(0,e.jsx)("span",{})]}),footer:(0,e.jsxs)("form",{onSubmit:async c=>{c.preventDefault(),o!==null&&await t({action:"addSet",member:o})&&l(w)},className:"grid grid-cols-[1fr_auto] items-center gap-2 border-t border-border bg-muted/10 p-2",children:[(0,e.jsx)(S,{value:o,onChange:l,placeholder:"new member"}),(0,e.jsxs)(m,{type:"submit",disabled:a||o===null,children:[(0,e.jsx)(ee,{})," Add member"]})]}),children:h.length===0?(0,e.jsx)(O,{filtered:d.length>0}):h.map(c=>(0,e.jsxs)("div",{className:"flex min-h-8 items-center gap-2 border-b border-border px-2 py-1",children:[(0,e.jsx)("span",{className:"min-w-0 flex-1",children:(0,e.jsx)(D,{value:c,compact:!0})}),(0,e.jsx)(m,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground hover:text-destructive",disabled:a,onClick:()=>t({action:"removeSet",member:c}),"aria-label":"Remove set member",children:(0,e.jsx)(M,{})})]},c.base64))})},os=({member:s,score:r,act:t,pending:a})=>{const[i,n]=K(String(r),String(r)),o=Number(i),l=i!==String(r);return(0,e.jsxs)("div",{className:"grid min-h-8 grid-cols-[1fr_8rem_5rem] items-center gap-2 border-b border-border px-2 py-1",children:[(0,e.jsx)(D,{value:s,compact:!0}),(0,e.jsx)(J,{inputMode:"decimal",value:i,onChange:d=>n(d.target.value),"aria-label":"Sorted set score",className:"font-mono"}),(0,e.jsxs)("div",{className:"flex",children:[(0,e.jsx)(m,{variant:"ghost",size:"icon-sm",className:l?"text-primary":void 0,disabled:a||!l||!Number.isFinite(o),onClick:()=>t({action:"upsertZset",member:s,score:o}),"aria-label":"Save sorted set score",children:(0,e.jsx)(B,{})}),(0,e.jsx)(m,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground hover:text-destructive",disabled:a,onClick:()=>t({action:"removeZset",member:s}),"aria-label":"Remove sorted set member",children:(0,e.jsx)(M,{})})]})]})},ls=({value:s,total:r,act:t,pending:a})=>{const[i,n]=(0,p.useState)(""),o=i.trim().toLowerCase(),l=o?s.entries.filter(d=>$(o,j(d.member),d.score)):s.entries;return(0,e.jsx)(A,{filter:i,onFilterChange:n,shownCount:l.length,loadedCount:s.entries.length,totalCount:r,copyJson:()=>F(s),header:(0,e.jsxs)("div",{className:"grid h-8 grid-cols-[1fr_8rem_5rem] items-center border-b border-border bg-muted/20 px-2 text-[10px] uppercase tracking-wider text-muted-foreground",children:[(0,e.jsx)("span",{children:"Member"}),(0,e.jsx)("span",{children:"Score"}),(0,e.jsx)("span",{})]}),footer:(0,e.jsx)(se,{score:!0,labels:["member","score"],pending:a,onSave:(d,h)=>t({action:"upsertZset",member:d,score:h})}),children:l.length===0?(0,e.jsx)(O,{filtered:o.length>0}):l.map(d=>(0,e.jsx)(os,{member:d.member,score:d.score,act:t,pending:a},d.member.base64))})},ds=({value:s,total:r,act:t,pending:a,direction:i,onDirectionChange:n})=>{const[o,l]=(0,p.useState)(""),d=o.trim().toLowerCase(),h=d?s.entries.filter(c=>$(d,c.id,...c.fields.flatMap(b=>[j(b.field),j(b.value)]))):s.entries;return(0,e.jsx)(A,{filter:o,onFilterChange:l,shownCount:h.length,loadedCount:s.entries.length,totalCount:r,copyJson:()=>F(s),extra:(0,e.jsxs)(Ke,{type:"single",variant:"ghost",size:"sm",value:i,onValueChange:c=>c&&n(c),"aria-label":"Stream order",className:"shrink-0 rounded-none",children:[(0,e.jsx)(ie,{value:"forward",className:"h-6 rounded-none px-2 text-[10px]",children:"Oldest first"}),(0,e.jsx)(ie,{value:"backward",className:"h-6 rounded-none px-2 text-[10px]",children:"Newest first"})]}),header:(0,e.jsxs)("div",{className:"grid h-8 grid-cols-[10rem_1fr_2rem] items-center border-b border-border bg-muted/20 px-2 text-[10px] uppercase tracking-wider text-muted-foreground",children:[(0,e.jsx)("span",{children:"Entry ID"}),(0,e.jsx)("span",{children:"Fields"}),(0,e.jsx)("span",{})]}),footer:(0,e.jsx)(se,{labels:["field","value"],pending:a,onSave:(c,b)=>t({action:"appendStream",id:"*",fields:[{field:c,value:b}]})}),children:h.length===0?(0,e.jsx)(O,{filtered:d.length>0}):h.map(c=>(0,e.jsxs)("div",{className:"grid grid-cols-[10rem_1fr_2rem] border-b border-border",children:[(0,e.jsx)("code",{className:"border-e border-border px-2 py-1.5 text-xs text-primary",children:c.id}),(0,e.jsx)("div",{className:"grid gap-1 px-2 py-1.5",children:c.fields.map(b=>(0,e.jsxs)("div",{className:"grid grid-cols-[minmax(8rem,0.4fr)_1fr] gap-3",children:[(0,e.jsx)(D,{value:b.field,compact:!0}),(0,e.jsx)(D,{value:b.value,compact:!0})]},b.field.base64))}),(0,e.jsx)(m,{variant:"ghost",size:"icon-sm",className:"rounded-none text-muted-foreground hover:text-destructive",disabled:a,onClick:()=>t({action:"deleteStream",id:c.id}),"aria-label":`Delete stream entry ${c.id}`,children:(0,e.jsx)(M,{})})]},c.id))})},cs=({detail:s,act:r,pending:t,onLoadFull:a,onDownload:i,streamDirection:n,onStreamDirectionChange:o})=>{const l=s.value;switch(l.kind){case"string":return(0,e.jsx)(ss,{value:l.value,truncated:l.truncated,act:r,pending:t,onLoadFull:a,onDownload:i});case"hash":return(0,e.jsx)(ts,{value:l,total:s.length,act:r,pending:t});case"list":return(0,e.jsx)(ns,{value:l,revision:s.revision,total:s.length,act:r,pending:t});case"set":return(0,e.jsx)(is,{value:l,total:s.length,act:r,pending:t});case"zset":return(0,e.jsx)(ls,{value:l,total:s.length,act:r,pending:t});case"stream":return(0,e.jsx)(ds,{value:l,total:s.length,act:r,pending:t,direction:n,onDirectionChange:o});default:return(0,e.jsx)(P,{variant:"info",title:"Metadata only",message:"This Redis module type cannot be edited in this release.",className:"rounded-sm"})}},us=s=>{if(s.key.utf8===void 0)return null;const r=JSON.stringify(s.key.utf8);switch(s.type){case"string":return`GET ${r}`;case"hash":return`HGETALL ${r}`;case"list":return`LRANGE ${r} 0 -1`;case"set":return`SMEMBERS ${r}`;case"zset":return`ZRANGE ${r} 0 -1 WITHSCORES`;case"stream":return`XRANGE ${r} - + COUNT 100`;default:return null}},ms=s=>{switch(s.value.kind){case"hash":case"list":case"zset":case"stream":return s.value.entries.length;case"set":return s.value.members.length;default:return null}},hs=()=>{const s=he(),{selectedDatabase:r}=Me(),{openOverlay:t}=Re(),{addQuery:a,updateQuery:i}=Ge(),[n,o]=Ce("key"),[l,d]=(0,p.useState)(null),[h,c]=(0,p.useState)(null),b=h===n?"backward":"forward",u=He(n,l===n,b),{applyAction:L,deleteKey:U,isPending:C}=qe(),N=u.data?.pages,x=N?.[0],[z,v]=(0,p.useState)(!1),[I,_]=(0,p.useState)(null),T=x?.key.utf8??(x?`binary:${x.key.base64}`:""),E=x?us(x):null,R=(0,p.useMemo)(()=>{if(!x||!N||N.length===1)return x;const f=structuredClone(x);for(const g of N.slice(1))f.value.kind==="hash"&&g.value.kind==="hash"&&f.value.entries.push(...g.value.entries),f.value.kind==="list"&&g.value.kind==="list"&&f.value.entries.push(...g.value.entries),f.value.kind==="set"&&g.value.kind==="set"&&f.value.members.push(...g.value.members),f.value.kind==="zset"&&g.value.kind==="zset"&&f.value.entries.push(...g.value.entries),f.value.kind==="stream"&&g.value.kind==="stream"&&f.value.entries.push(...g.value.entries);return f},[x,N]),G=R?ms(R):null,H=async(f,g=!1)=>{if(!n||!x)return!1;try{const k=await L(n,{expectedRevision:x.revision,force:g,operation:f});return _(null),k.deleted?o(null):(k.key.base64||"-")!==n&&o(k.key.base64||"-"),!0}catch(k){return k.status===409&&_(f),!1}},le=()=>{if(!E)return;const f=a(`redis: ${T.slice(0,40)}`);i(f,{query:E}),s({to:"/runner/$queryId",params:{queryId:f}})},de=async()=>{if(!n||!x||x.type!=="string")return;const f=[];let g=0,k=!0;for(;k;){const y=(await De({db:r??"",key:n,offset:g,expectedRevision:x.revision})).data.data;if(f.push(Ze(y.chunk.base64)),k=y.hasMore,y.hasMore&&(y.nextOffset===null||y.nextOffset<=g))throw new Error("Redis download made no forward progress");g=y.nextOffset??g}const ce=f.reduce((y,ue)=>y+ue.length,0),te=new Uint8Array(ce);let ae=0;for(const y of f)te.set(y,ae),ae+=y.length;const ne=URL.createObjectURL(new Blob([te.buffer])),V=document.createElement("a");V.href=ne,V.download=`${x.key.utf8?.replaceAll(/[^\w.-]+/g,"_")||"redis-value"}.bin`,V.click(),URL.revokeObjectURL(ne)};if(!n)return(0,e.jsx)("main",{className:"flex flex-1 items-center justify-center bg-background font-mono",children:(0,e.jsxs)("div",{className:"max-w-sm text-center",children:[(0,e.jsx)(ge,{className:"mx-auto mb-3 size-5 text-muted-foreground"}),(0,e.jsx)("h1",{className:"text-sm font-medium text-foreground",children:"No key selected"}),(0,e.jsx)("p",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:"Select a key from the navigator or create one to inspect its value."}),(0,e.jsxs)(m,{variant:"outline",className:"mt-3",onClick:()=>t("redis-browser.create-key"),children:[(0,e.jsx)(ee,{})," Create key"]})]})});if(u.isLoading)return(0,e.jsx)("main",{className:"flex flex-1 items-center justify-center",children:(0,e.jsx)(Se,{})});if(u.error||!x||!R)return(0,e.jsx)("main",{className:"flex flex-1 items-center justify-center bg-background p-4",children:(0,e.jsxs)("div",{className:"w-full max-w-md text-center",children:[(0,e.jsx)(P,{variant:"error",title:"Unable to load key",message:u.error?.message??"The key no longer exists.",className:"rounded-sm text-start"}),(0,e.jsx)(m,{variant:"outline",className:"mt-4",onClick:()=>o(null),children:"Back to keyspace"})]})});const re=R.length!==null&&G!==null?Math.max(0,R.length-G):null;return(0,e.jsxs)("main",{className:"flex min-h-0 flex-1 flex-col bg-background font-mono",children:[(0,e.jsx)(es,{detail:x,label:T,loadedCount:G,fetchedAt:u.dataUpdatedAt,isFetching:u.isFetching,pending:C,command:E,act:H,onRefresh:()=>u.refetch(),onOpenRunner:le,onDelete:()=>v(!0)},x.key.base64),(0,e.jsx)(Ae,{open:z,onOpenChange:v,children:(0,e.jsxs)(Fe,{children:[(0,e.jsxs)(Ee,{children:[(0,e.jsx)(ze,{children:"Delete key"}),(0,e.jsxs)(Be,{children:["Are you sure you want to delete"," ",(0,e.jsx)("code",{className:"break-all text-foreground",children:T||"(empty key)"}),"? This action cannot be undone."]})]}),(0,e.jsxs)(Te,{children:[(0,e.jsx)(_e,{children:"Cancel"}),(0,e.jsx)(Ie,{variant:"destructive",onClick:async()=>{v(!1);try{await U(n,x.revision),o(null)}catch{}},children:"Delete"})]})]})}),I&&(0,e.jsxs)("div",{className:"grid gap-2 border-b border-border p-2 sm:grid-cols-[1fr_auto] sm:items-center",children:[(0,e.jsx)(P,{variant:"warning",title:"Revision conflict",message:"This key changed on the server. Reload it or overwrite with the pending change.",className:"rounded-sm py-2"}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(m,{variant:"outline",onClick:()=>{_(null),u.refetch()},children:"Reload"}),(0,e.jsx)(m,{disabled:C,onClick:()=>H(I,!0),children:"Overwrite"})]})]}),(0,e.jsx)("div",{className:"min-h-0 flex-1 overflow-auto",children:(0,e.jsxs)("section",{className:"p-3",children:[(0,e.jsx)(cs,{detail:R,act:H,pending:C,onLoadFull:()=>d(n),onDownload:()=>{we.promise(de(),{loading:"Downloading original Redis bytes…",success:"Redis value downloaded",error:f=>f.message||"Download failed"})},streamDirection:b,onStreamDirectionChange:f=>c(f==="backward"?n:null)},x.key.base64),u.hasNextPage&&(0,e.jsx)(m,{variant:"outline",className:"mt-3 w-full",onClick:()=>u.fetchNextPage(),disabled:u.isFetchingNextPage,children:u.isFetchingNextPage?"Loading…":x.type==="stream"&&b==="backward"?"Load 100 older entries":`Load next 100${re!==null?` (${re.toLocaleString()} remaining)`:""}`})]})})]})},Ls=hs;export{Ls as component};