db-studio 2.0.0 → 2.1.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 (161) hide show
  1. package/README.md +1 -1
  2. package/dist/index.js +75 -75
  3. package/dist/index.js.map +1 -1
  4. package/dist/web-dist/assets/{_pathlessLayout-BQk5gSGn.js → _pathlessLayout-CUDS1e28.js} +1 -1
  5. package/dist/web-dist/assets/_pathlessLayout-WZkezfN7.js +2 -0
  6. package/dist/web-dist/assets/{_queryId-Buy3oA5p.js → _queryId-CEJb62Vl.js} +1 -1
  7. package/dist/web-dist/assets/{_table-CE0TjrEn.js → _table-6SZEx92j.js} +1 -1
  8. package/dist/web-dist/assets/_table-BUNHOVIK.js +1 -0
  9. package/dist/web-dist/assets/_table-CwyP_2EP.js +1 -0
  10. package/dist/web-dist/assets/{abap-B7CMCXo3.js → abap-B-HzHdT_.js} +1 -1
  11. package/dist/web-dist/assets/{apex-D6pniLV0.js → apex-t5VcK3BF.js} +1 -1
  12. package/dist/web-dist/assets/{azcli-DayXln6N.js → azcli-Ce3iuV2p.js} +1 -1
  13. package/dist/web-dist/assets/{badge-BIuMcm7O.js → badge-COF6gx-2.js} +1 -1
  14. package/dist/web-dist/assets/{bat-knBi4IWo.js → bat-bOBZcLbK.js} +1 -1
  15. package/dist/web-dist/assets/{bicep-CqySwd8I.js → bicep-TSicgsnM.js} +1 -1
  16. package/dist/web-dist/assets/{browser-DQEdJbyz.js → browser-B-fV6CZb.js} +1 -1
  17. package/dist/web-dist/assets/{bundle-mjs-qYDTi1yn.js → bundle-mjs-CZwf2xtr.js} +1 -1
  18. package/dist/web-dist/assets/{cameligo-D1w-uj2C.js → cameligo-D-9xpPXV.js} +1 -1
  19. package/dist/web-dist/assets/{chat-sidebar-CApWlRXq.js → chat-sidebar-DwzCElBd.js} +5 -5
  20. package/dist/web-dist/assets/{clojure-D7bkK2B8.js → clojure-9X3x3csE.js} +1 -1
  21. package/dist/web-dist/assets/{code-editor-Dwq67W-h.js → code-editor-tPwHd3zF.js} +4 -4
  22. package/dist/web-dist/assets/{coffee-Dpij46Wn.js → coffee-anOch8Z-.js} +1 -1
  23. package/dist/web-dist/assets/{connect-B0x9CNlf.js → connect-l3LjAClZ.js} +1 -1
  24. package/dist/web-dist/assets/{constants-BFCsZ8ll.js → constants-CKAehpPm.js} +3 -3
  25. package/dist/web-dist/assets/{cpp-DWDORc6B.js → cpp-oW293AoF.js} +1 -1
  26. package/dist/web-dist/assets/{csharp-FpOMvD_o.js → csharp-BOXMgm5k.js} +1 -1
  27. package/dist/web-dist/assets/{csp-4WiITR2R.js → csp-D67JhNKT.js} +1 -1
  28. package/dist/web-dist/assets/{css-DMOWqvgH.js → css-Bk6H7_K_.js} +1 -1
  29. package/dist/web-dist/assets/{cssMode-DHL98brF.js → cssMode-G6latsS7.js} +1 -1
  30. package/dist/web-dist/assets/{cypher-Byev8hZE.js → cypher-DB0LBjic.js} +1 -1
  31. package/dist/web-dist/assets/{dart--T4f3SxI.js → dart-CS3MbwLP.js} +1 -1
  32. package/dist/web-dist/assets/{database.store-BAbH5Geu.js → database.store-BuqVJMY6.js} +13 -13
  33. package/dist/web-dist/assets/{dist-C_AEsM_Y.js → dist-Bz0qAN0x.js} +1 -1
  34. package/dist/web-dist/assets/{dist-D4lNl-zm.js → dist-Cf0L32Jd.js} +1 -1
  35. package/dist/web-dist/assets/{dockerfile-CTL_qQGw.js → dockerfile-BGz3qsmk.js} +1 -1
  36. package/dist/web-dist/assets/{ecl-D2-VZ5jm.js → ecl-lt3qcklx.js} +1 -1
  37. package/dist/web-dist/assets/{editor.api-DaW7cLxE.js → editor.api-BTIrAcm5.js} +1 -1
  38. package/dist/web-dist/assets/{elixir-C__1cTub.js → elixir-cMyUafed.js} +1 -1
  39. package/dist/web-dist/assets/{esm-DHRCgDAS.js → esm-B-4Q6MuQ.js} +1 -1
  40. package/dist/web-dist/assets/{flow9-U08FhG_o.js → flow9-BI9V6TuS.js} +1 -1
  41. package/dist/web-dist/assets/{format-cell-value-BDXXdObX.js → format-cell-value-CgUtYv8B.js} +1 -1
  42. package/dist/web-dist/assets/{freemarker2-EL1xRRz-.js → freemarker2-mnCFA3xV.js} +1 -1
  43. package/dist/web-dist/assets/{fsharp-BYeUdvUi.js → fsharp-I1kqnt0E.js} +1 -1
  44. package/dist/web-dist/assets/{go-D7V_ae37.js → go-Cg4qMFVj.js} +1 -1
  45. package/dist/web-dist/assets/{graphql-C-zVsbUk.js → graphql-CvtHcP49.js} +1 -1
  46. package/dist/web-dist/assets/{handlebars-BgZpkJkF.js → handlebars-BUcE6Uyy.js} +1 -1
  47. package/dist/web-dist/assets/{hcl-B7_QCGTQ.js → hcl-BkvCdKNu.js} +1 -1
  48. package/dist/web-dist/assets/highlighted-body-OFNGDK62-t8UIAZOZ.js +1 -0
  49. package/dist/web-dist/assets/{html-e4Xrzf8r.js → html-BBqcfykD.js} +1 -1
  50. package/dist/web-dist/assets/{htmlMode-B6WabTqV.js → htmlMode-D8je66Rk.js} +1 -1
  51. package/dist/web-dist/assets/icons-DxFtdMXW.js +1 -0
  52. package/dist/web-dist/assets/index-QVi4Lb9U.css +2 -0
  53. package/dist/web-dist/assets/index-WFVurGCI.js +34 -0
  54. package/dist/web-dist/assets/{indexes-BBz0Je_a.js → indexes-C3Qddb5L.js} +1 -1
  55. package/dist/web-dist/assets/{ini-B8RMyZP2.js → ini-CPc8BCWu.js} +1 -1
  56. package/dist/web-dist/assets/{java-B0bzjGsf.js → java-C9Yie4SH.js} +1 -1
  57. package/dist/web-dist/assets/{javascript-BSAFurIc.js → javascript-CuGq5ydO.js} +1 -1
  58. package/dist/web-dist/assets/{json-editor-DoEopjNh.js → json-editor-Dc1E8Fc-.js} +1 -1
  59. package/dist/web-dist/assets/{jsonMode-CMXGrtoZ.js → jsonMode-BgdTmYik.js} +1 -1
  60. package/dist/web-dist/assets/{julia-Bg58EZ4Y.js → julia--qJGRfN8.js} +1 -1
  61. package/dist/web-dist/assets/{keys-6E3ilH7R.js → keys-Bs0DRbCB.js} +1 -1
  62. package/dist/web-dist/assets/{kotlin-DW9Z0gYb.js → kotlin-C3MSe-0N.js} +1 -1
  63. package/dist/web-dist/assets/{label-Dcwj4aRe.js → label-DzHJlGAx.js} +1 -1
  64. package/dist/web-dist/assets/{less-Bx9gqQ4s.js → less-DOBYgWSY.js} +1 -1
  65. package/dist/web-dist/assets/{lexon-CSuDDXgE.js → lexon-Djd2rGvJ.js} +1 -1
  66. package/dist/web-dist/assets/{liquid-BmNDruwv.js → liquid-DXfHmR66.js} +1 -1
  67. package/dist/web-dist/assets/{logs-BgfXuAGG.js → logs-BortjBc-.js} +1 -1
  68. package/dist/web-dist/assets/{lspLanguageFeatures-CvWt81ki.js → lspLanguageFeatures-C7-iyD6G.js} +1 -1
  69. package/dist/web-dist/assets/{lua-CyCE05f5.js → lua-Ck8vNcPw.js} +1 -1
  70. package/dist/web-dist/assets/{m3-B4TowLdg.js → m3-a6Kl4TV0.js} +1 -1
  71. package/dist/web-dist/assets/{markdown-DUAXYKYX.js → markdown-DkcRBwO0.js} +1 -1
  72. package/dist/web-dist/assets/{mdx-DWKx4rlR.js → mdx-QI5o45qz.js} +1 -1
  73. package/dist/web-dist/assets/{mermaid-GHXKKRXX-Ci1jaQj_.js → mermaid-GHXKKRXX-D35eppUc.js} +1 -1
  74. package/dist/web-dist/assets/{middleware-YebY3a0i.js → middleware-CXk7SlTF.js} +1 -1
  75. package/dist/web-dist/assets/{mips-B8pYMMky.js → mips-Cc1YVI2p.js} +1 -1
  76. package/dist/web-dist/assets/{module-BfdI0fnl.js → module-D_kjbMCc.js} +1 -1
  77. package/dist/web-dist/assets/{monaco-theme-C8nJMjlg.js → monaco-theme-C2k_taVU.js} +4 -4
  78. package/dist/web-dist/assets/{msdax-Dl7lqaqA.js → msdax-Bh41xUoQ.js} +1 -1
  79. package/dist/web-dist/assets/{mysql-CxF1irIT.js → mysql-BZTZMxPa.js} +1 -1
  80. package/dist/web-dist/assets/{objective-c-nxQNwVWR.js → objective-c-CxZIMOHQ.js} +1 -1
  81. package/dist/web-dist/assets/{overlay.store-D93IGU3a.js → overlay.store-DsUdwZjE.js} +1 -1
  82. package/dist/web-dist/assets/{pascal-CJDb1n8F.js → pascal-I-WmLkmD.js} +1 -1
  83. package/dist/web-dist/assets/{pascaligo-DNMesjCc.js → pascaligo-DEZ-6bwf.js} +1 -1
  84. package/dist/web-dist/assets/{perl-Ct14C4yC.js → perl-DfeHQJxJ.js} +1 -1
  85. package/dist/web-dist/assets/{personal-preferences.store-BXE0mRKp.js → personal-preferences.store-DXSnKmVN.js} +1 -1
  86. package/dist/web-dist/assets/{pgsql-B2EenuF0.js → pgsql-OdOoQYPW.js} +1 -1
  87. package/dist/web-dist/assets/{php-D953oiSq.js → php-CF1bUutw.js} +1 -1
  88. package/dist/web-dist/assets/{pla-DTXlQw1d.js → pla-BHZr0GrY.js} +1 -1
  89. package/dist/web-dist/assets/{postiats-JN8Ouz04.js → postiats-BSB6a63H.js} +1 -1
  90. package/dist/web-dist/assets/{powerquery-5V8-uvAS.js → powerquery-Bu0p84Ye.js} +1 -1
  91. package/dist/web-dist/assets/{powershell-CB8eXyFq.js → powershell-Dcq3YM6T.js} +1 -1
  92. package/dist/web-dist/assets/{preload-helper-B3GI5Aqe.js → preload-helper-DF7hIgef.js} +1 -1
  93. package/dist/web-dist/assets/{protobuf-B9TJJ9C4.js → protobuf-CsWrQxqX.js} +1 -1
  94. package/dist/web-dist/assets/{pug-Bm8fNuV-.js → pug-DLQiv3Bp.js} +1 -1
  95. package/dist/web-dist/assets/{python-C5yAejbi.js → python-BvKEpyP9.js} +1 -1
  96. package/dist/web-dist/assets/{qsharp-R8gbdykE.js → qsharp-D8nrRUNu.js} +1 -1
  97. package/dist/web-dist/assets/{queries.store-Qbtkt7ze.js → queries.store-BaeyNA64.js} +1 -1
  98. package/dist/web-dist/assets/query-runner-f473QQSD.js +17 -0
  99. package/dist/web-dist/assets/{r-M-_jtR31.js → r-xhyKpGTk.js} +1 -1
  100. package/dist/web-dist/assets/{radix-ui-41WpuKNR.js → radix-ui-CxCv--D1.js} +2 -2
  101. package/dist/web-dist/assets/{razor-C1QqRako.js → razor-Ceb9S1Rz.js} +1 -1
  102. package/dist/web-dist/assets/react-DEQ0BgTL.js +1 -0
  103. package/dist/web-dist/assets/{react-dom-BmawA5F6.js → react-dom-ITw3Lqwx.js} +1 -1
  104. package/dist/web-dist/assets/{redis-Se45CWCe.js → redis-BnpkEvbr.js} +1 -1
  105. package/dist/web-dist/assets/redis-value-DMk0-Zuc.js +1 -0
  106. package/dist/web-dist/assets/{redshift-6LxiBjWf.js → redshift-BpxVXjAI.js} +1 -1
  107. package/dist/web-dist/assets/{restructuredtext-DQZZ8qkw.js → restructuredtext-5afXtW7D.js} +1 -1
  108. package/dist/web-dist/assets/{rolldown-runtime-CpVMLIgb.js → rolldown-runtime-fzu9RN21.js} +1 -1
  109. package/dist/web-dist/assets/{ruby-CCIHgGuA.js → ruby-CHaoWUHT.js} +1 -1
  110. package/dist/web-dist/assets/{runner-DOkX5y17.js → runner-NsYjzIZs.js} +1 -1
  111. package/dist/web-dist/assets/{rust-DE79jE85.js → rust-Bw0WVsLy.js} +1 -1
  112. package/dist/web-dist/assets/{sb-vTusoyll.js → sb-CEjXmIyG.js} +1 -1
  113. package/dist/web-dist/assets/{scala-BfDNOQ4o.js → scala-BuaCSaU6.js} +1 -1
  114. package/dist/web-dist/assets/schema-CE1yGygf.js +1 -0
  115. package/dist/web-dist/assets/{schema-CgNnxiB7.js → schema-rxLBue8Q.js} +1 -1
  116. package/dist/web-dist/assets/{scheme-07Nz-Ikg.js → scheme-DIKzlmFG.js} +1 -1
  117. package/dist/web-dist/assets/{scss-C2T-BIyo.js → scss-C2_UsWzg.js} +1 -1
  118. package/dist/web-dist/assets/{select-DzeVPveq.js → select-C-nrz7Tx.js} +1 -1
  119. package/dist/web-dist/assets/{separator-3IoeVup6.js → separator-DnB61XAO.js} +1 -1
  120. package/dist/web-dist/assets/{sheet-sidebar-Bne7asEZ.js → sheet-sidebar-BGxJGRbd.js} +1 -1
  121. package/dist/web-dist/assets/{shell-CYk99G96.js → shell-2aEL2EVH.js} +1 -1
  122. package/dist/web-dist/assets/{solidity-DZfw6XST.js → solidity-D-5XfYE1.js} +1 -1
  123. package/dist/web-dist/assets/{sophia-9ELY8Wd6.js → sophia-s4MFSvUF.js} +1 -1
  124. package/dist/web-dist/assets/{sparql-DBCoTLhO.js → sparql-Dkv46wS5.js} +1 -1
  125. package/dist/web-dist/assets/{spinner-Z77kD_hS.js → spinner-CNnB5r0X.js} +1 -1
  126. package/dist/web-dist/assets/{sql-DSSHZrVP.js → sql-Dz9Xhs8s.js} +1 -1
  127. package/dist/web-dist/assets/{st-9goatbhG.js → st-Cbo0XVmr.js} +1 -1
  128. package/dist/web-dist/assets/{swift-C8IWUoth.js → swift-B66X97nW.js} +1 -1
  129. package/dist/web-dist/assets/{systemverilog-DFmMGPsp.js → systemverilog-gGKga8Gf.js} +1 -1
  130. package/dist/web-dist/assets/{table-Cwbi0FDw.js → table-C8WK3uAc.js} +1 -1
  131. package/dist/web-dist/assets/tables-D98Kbmcb.js +16 -0
  132. package/dist/web-dist/assets/{tanstack-BE6ru2gB.js → tanstack-RwHFfmqj.js} +4 -4
  133. package/dist/web-dist/assets/{tcl-9sp6ieFk.js → tcl-BtbeJsUN.js} +1 -1
  134. package/dist/web-dist/assets/{tsMode-BjCfzjtF.js → tsMode-BgtcNcpl.js} +1 -1
  135. package/dist/web-dist/assets/{twig-PTQx-ucO.js → twig-0_nXiuYs.js} +1 -1
  136. package/dist/web-dist/assets/{typescript-BGXEvFAl.js → typescript-Cy_CzC_-.js} +1 -1
  137. package/dist/web-dist/assets/{typespec-k1Hrq-4g.js → typespec-DBO6_WMJ.js} +1 -1
  138. package/dist/web-dist/assets/{use-database-engine-CKCp55rb.js → use-database-engine-DZZj7-4J.js} +1 -1
  139. package/dist/web-dist/assets/{use-theme-CLKCtULg.js → use-theme-DBhPknw6.js} +1 -1
  140. package/dist/web-dist/assets/{utils-Cr2_fSDl.js → utils-EJLOIroS.js} +1 -1
  141. package/dist/web-dist/assets/{vb-BBuEtOk5.js → vb-DFJjBsW2.js} +1 -1
  142. package/dist/web-dist/assets/{visualizer-XPaDmMrd.js → visualizer-CgYlDJ_-.js} +1 -1
  143. package/dist/web-dist/assets/{vscode-jtB6jKBB.js → vscode-wuSgCuZI.js} +1 -1
  144. package/dist/web-dist/assets/{wgsl-MO-DpoEc.js → wgsl-U3RBM2M0.js} +1 -1
  145. package/dist/web-dist/assets/{workers-7JruDoqH.js → workers-ClRH6A2w.js} +1 -1
  146. package/dist/web-dist/assets/{xml-C0nHIB7q.js → xml-D11j3J2_.js} +1 -1
  147. package/dist/web-dist/assets/{yaml-CN9StMra.js → yaml-D7Z_4mnx.js} +1 -1
  148. package/dist/web-dist/index.html +31 -31
  149. package/package.json +2 -3
  150. package/dist/web-dist/assets/_pathlessLayout-WF7WipqP.js +0 -2
  151. package/dist/web-dist/assets/_table-BnMBHUzk.js +0 -1
  152. package/dist/web-dist/assets/_table-CQ2NX0I8.js +0 -1
  153. package/dist/web-dist/assets/highlighted-body-OFNGDK62-D8XE2uMh.js +0 -1
  154. package/dist/web-dist/assets/icons-D72QQyd5.js +0 -1
  155. package/dist/web-dist/assets/index-DlECfzV9.js +0 -34
  156. package/dist/web-dist/assets/index-mbFBVmHb.css +0 -2
  157. package/dist/web-dist/assets/query-runner-DwuQkpxh.js +0 -17
  158. package/dist/web-dist/assets/react-46S5qMHL.js +0 -1
  159. package/dist/web-dist/assets/redis-value-DG_0UKZy.js +0 -1
  160. package/dist/web-dist/assets/schema-B8WxzFU1.js +0 -1
  161. package/dist/web-dist/assets/tables-BPh2zM7Q.js +0 -13
@@ -0,0 +1 @@
1
+ import{r as Pa}from"./rolldown-runtime-fzu9RN21.js";import{C as Ze,E as et,a as $a,g as La,i as Ua,n as Lr,r as Ur,w as Ba,y as qa}from"./tanstack-RwHFfmqj.js";import{A as Ka,Ct as Ga,D as Ha,E as Wa,Et as tt,Ft as xr,H as Br,Tt as Qa,U as Ya,W as Ja,c as Xa,it as Za,n as es,o as ts,p as rs,ut as as,x as ss,y as ns,zt as is}from"./icons-DxFtdMXW.js";import{A as ls,D as os,E as ds,F as us,I as cs,L as ms,M as fs,N as hs,O as gs,Ot as Pe,P as vs,R as ps,T as ys,_t as qr,dt as ke,gt as Kr,ht as xs,j as bs,jt as Cs,k as js,kt as Ye,mt as Gr,pt as Hr,vt as Wr,yt as ws}from"./radix-ui-CxCv--D1.js";import{n as rt}from"./dist-Cf0L32Jd.js";import{t as U}from"./utils-EJLOIroS.js";import{t as _s}from"./spinner-CNnB5r0X.js";import{a as Qr,c as Yr,n as ne,o as Jr,t as Ve}from"./overlay.store-DsUdwZjE.js";import{n as Le,r as Ns,t as ge}from"./label-DzHJlGAx.js";import{c as Ss,l as As,t as Ht}from"./sheet-sidebar-BGxJGRbd.js";import{t as ks}from"./react-DEQ0BgTL.js";import{a as Xr,c as Vs,i as Fs,p as Ds,t as br,v as Zr}from"./constants-CKAehpPm.js";import{C as Es,S as Ts,_ as je,b as Je,g as Rs,i as Is,p as Cr,t as Be,u as jr,v as Ue,w as zs,x as ea}from"./database.store-BuqVJMY6.js";import{a as Os,c as Ms,d as Ps,f as $s,i as Ls,l as Us,m as Bs,n as qs,o as Ks,p as Gs,s as Hs,t as Xe,u as Ws}from"./badge-COF6gx-2.js";import{t as Wt}from"./use-database-engine-DZZj7-4J.js";import{s as xe}from"./keys-Bs0DRbCB.js";import{t as Qs}from"./format-cell-value-CgUtYv8B.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@2.1.0"};var r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="02c52009-0057-4d12-adb2-a340371182a0",e._sentryDebugIdIdentifier="sentry-dbid-02c52009-0057-4d12-adb2-a340371182a0")}catch{}})();var f=Pa(is(),1),wr=1,Ys=.9,Js=.8,Xs=.17,jt=.1,wt=.999,Zs=.9999,en=.99,tn=/[\\\/_+.#"@\[\(\{&]/,rn=/[\\\/_+.#"@\[\(\{&]/g,an=/[\s-]/,ta=/[\s-]/g;function Mt(e,r,t,a,i,n,l){if(n===r.length)return i===e.length?wr:en;var d=`${i},${n}`;if(l[d]!==void 0)return l[d];for(var m=a.charAt(n),h=t.indexOf(m,i),v=0,g,S,w,R;h>=0;)g=Mt(e,r,t,a,h+1,n+1,l),g>v&&(h===i?g*=wr:tn.test(e.charAt(h-1))?(g*=Js,w=e.slice(i,h-1).match(rn),w&&i>0&&(g*=Math.pow(wt,w.length))):an.test(e.charAt(h-1))?(g*=Ys,R=e.slice(i,h-1).match(ta),R&&i>0&&(g*=Math.pow(wt,R.length))):(g*=Xs,i>0&&(g*=Math.pow(wt,h-i))),e.charAt(h)!==r.charAt(n)&&(g*=Zs)),(g<jt&&t.charAt(h-1)===a.charAt(n+1)||a.charAt(n+1)===a.charAt(n)&&t.charAt(h-1)!==a.charAt(n))&&(S=Mt(e,r,t,a,h+1,n+2,l),S*jt>g&&(g=S*jt)),g>v&&(v=g),h=t.indexOf(m,h+1);return l[d]=v,v}function _r(e){return e.toLowerCase().replace(ta," ")}function sn(e,r,t){return e=t&&t.length>0?`${e+" "+t.join(" ")}`:e,Mt(e,r,_r(e),_r(r),0,0,{})}var Ge='[cmdk-group=""]',_t='[cmdk-group-items=""]',nn='[cmdk-group-heading=""]',ra='[cmdk-item=""]',Nr=`${ra}:not([aria-disabled="true"])`,Pt="cmdk-item-select",ze="data-value",ln=(e,r,t)=>sn(e,r,t),aa=f.createContext(void 0),at=()=>f.useContext(aa),sa=f.createContext(void 0),Qt=()=>f.useContext(sa),na=f.createContext(void 0),ia=f.forwardRef((e,r)=>{let t=Oe(()=>{var y,D;return{search:"",value:(D=(y=e.value)!=null?y:e.defaultValue)!=null?D:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),a=Oe(()=>new Set),i=Oe(()=>new Map),n=Oe(()=>new Map),l=Oe(()=>new Set),d=la(e),{label:m,children:h,value:v,onValueChange:g,filter:S,shouldFilter:w,loop:R,disablePointerSelection:z=!1,vimBindings:I=!0,...P}=e,A=Pe(),M=Pe(),j=Pe(),b=f.useRef(null),p=yn();De(()=>{if(v!==void 0){let y=v.trim();t.current.value=y,F.emit()}},[v]),De(()=>{p(6,W)},[]);let F=f.useMemo(()=>({subscribe:y=>(l.current.add(y),()=>l.current.delete(y)),snapshot:()=>t.current,setState:(y,D,O)=>{var V,B,H,te;if(!Object.is(t.current[y],D)){if(t.current[y]=D,y==="search")T(),ve(),p(1,Ce);else if(y==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let re=document.getElementById(j);re?re.focus():(V=document.getElementById(A))==null||V.focus()}if(p(7,()=>{var re;t.current.selectedItemId=(re=$())==null?void 0:re.id,F.emit()}),O||p(5,W),((B=d.current)==null?void 0:B.value)!==void 0){let re=D??"";(te=(H=d.current).onValueChange)==null||te.call(H,re);return}}F.emit()}},emit:()=>{l.current.forEach(y=>y())}}),[]),X=f.useMemo(()=>({value:(y,D,O)=>{var V;D!==((V=n.current.get(y))==null?void 0:V.value)&&(n.current.set(y,{value:D,keywords:O}),t.current.filtered.items.set(y,ee(D,O)),p(2,()=>{ve(),F.emit()}))},item:(y,D)=>(a.current.add(y),D&&(i.current.has(D)?i.current.get(D).add(y):i.current.set(D,new Set([y]))),p(3,()=>{T(),ve(),t.current.value||Ce(),F.emit()}),()=>{n.current.delete(y),a.current.delete(y),t.current.filtered.items.delete(y);let O=$();p(4,()=>{T(),O?.getAttribute("id")===y&&Ce(),F.emit()})}),group:y=>(i.current.has(y)||i.current.set(y,new Set),()=>{n.current.delete(y),i.current.delete(y)}),filter:()=>d.current.shouldFilter,label:m||e["aria-label"],getDisablePointerSelection:()=>d.current.disablePointerSelection,listId:A,inputId:j,labelId:M,listInnerRef:b}),[]);function ee(y,D){var O,V;let B=(V=(O=d.current)==null?void 0:O.filter)!=null?V:ln;return y?B(y,t.current.search,D):0}function ve(){if(!t.current.search||d.current.shouldFilter===!1)return;let y=t.current.filtered.items,D=[];t.current.filtered.groups.forEach(V=>{let B=i.current.get(V),H=0;B.forEach(te=>{let re=y.get(te);H=Math.max(re,H)}),D.push([V,H])});let O=b.current;Q().sort((V,B)=>{var H,te;let re=V.getAttribute("id"),vt=B.getAttribute("id");return((H=y.get(vt))!=null?H:0)-((te=y.get(re))!=null?te:0)}).forEach(V=>{let B=V.closest(_t);B?B.appendChild(V.parentElement===B?V:V.closest(`${_t} > *`)):O.appendChild(V.parentElement===O?V:V.closest(`${_t} > *`))}),D.sort((V,B)=>B[1]-V[1]).forEach(V=>{var B;let H=(B=b.current)==null?void 0:B.querySelector(`${Ge}[${ze}="${encodeURIComponent(V[0])}"]`);H?.parentElement.appendChild(H)})}function Ce(){let y=Q().find(O=>O.getAttribute("aria-disabled")!=="true"),D=y?.getAttribute(ze);F.setState("value",D||void 0)}function T(){var y,D,O,V;if(!t.current.search||d.current.shouldFilter===!1){t.current.filtered.count=a.current.size;return}t.current.filtered.groups=new Set;let B=0;for(let H of a.current){let te=ee((D=(y=n.current.get(H))==null?void 0:y.value)!=null?D:"",(V=(O=n.current.get(H))==null?void 0:O.keywords)!=null?V:[]);t.current.filtered.items.set(H,te),te>0&&B++}for(let[H,te]of i.current)for(let re of te)if(t.current.filtered.items.get(re)>0){t.current.filtered.groups.add(H);break}t.current.filtered.count=B}function W(){var y,D,O;let V=$();V&&(((y=V.parentElement)==null?void 0:y.firstChild)===V&&((O=(D=V.closest(Ge))==null?void 0:D.querySelector(nn))==null||O.scrollIntoView({block:"nearest"})),V.scrollIntoView({block:"nearest"}))}function $(){var y;return(y=b.current)==null?void 0:y.querySelector(`${ra}[aria-selected="true"]`)}function Q(){var y;return Array.from(((y=b.current)==null?void 0:y.querySelectorAll(Nr))||[])}function de(y){let D=Q()[y];D&&F.setState("value",D.getAttribute(ze))}function ie(y){var D;let O=$(),V=Q(),B=V.findIndex(te=>te===O),H=V[B+y];(D=d.current)!=null&&D.loop&&(H=B+y<0?V[V.length-1]:B+y===V.length?V[0]:V[B+y]),H&&F.setState("value",H.getAttribute(ze))}function we(y){let D=$(),O=D?.closest(Ge),V;for(;O&&!V;)O=y>0?vn(O,Ge):pn(O,Ge),V=O?.querySelector(Nr);V?F.setState("value",V.getAttribute(ze)):ie(y)}let pe=()=>de(Q().length-1),Re=y=>{y.preventDefault(),y.metaKey?pe():y.altKey?we(1):ie(1)},Ke=y=>{y.preventDefault(),y.metaKey?de(0):y.altKey?we(-1):ie(-1)};return f.createElement(ke.div,{ref:r,tabIndex:-1,...P,"cmdk-root":"",onKeyDown:y=>{var D;(D=P.onKeyDown)==null||D.call(P,y);let O=y.nativeEvent.isComposing||y.keyCode===229;if(!(y.defaultPrevented||O))switch(y.key){case"n":case"j":I&&y.ctrlKey&&Re(y);break;case"ArrowDown":Re(y);break;case"p":case"k":I&&y.ctrlKey&&Ke(y);break;case"ArrowUp":Ke(y);break;case"Home":y.preventDefault(),de(0);break;case"End":y.preventDefault(),pe();break;case"Enter":{y.preventDefault();let V=$();if(V){let B=new Event(Pt);V.dispatchEvent(B)}}}}},f.createElement("label",{"cmdk-label":"",htmlFor:X.inputId,id:X.labelId,style:bn},m),ot(e,y=>f.createElement(sa.Provider,{value:F},f.createElement(aa.Provider,{value:X},y))))}),on=f.forwardRef((e,r)=>{var t,a;let i=Pe(),n=f.useRef(null),l=f.useContext(na),d=at(),m=la(e),h=(a=(t=m.current)==null?void 0:t.forceMount)!=null?a:l?.forceMount;De(()=>{if(!h)return d.item(i,l?.id)},[h]);let v=oa(i,n,[e.value,e.children,n],e.keywords),g=Qt(),S=Ae(p=>p.value&&p.value===v.current),w=Ae(p=>h||d.filter()===!1?!0:p.search?p.filtered.items.get(i)>0:!0);f.useEffect(()=>{let p=n.current;if(!(!p||e.disabled))return p.addEventListener(Pt,R),()=>p.removeEventListener(Pt,R)},[w,e.onSelect,e.disabled]);function R(){var p,F;z(),(F=(p=m.current).onSelect)==null||F.call(p,v.current)}function z(){g.setState("value",v.current,!0)}if(!w)return null;let{disabled:I,value:P,onSelect:A,forceMount:M,keywords:j,...b}=e;return f.createElement(ke.div,{ref:Ye(n,r),...b,id:i,"cmdk-item":"",role:"option","aria-disabled":!!I,"aria-selected":!!S,"data-disabled":!!I,"data-selected":!!S,onPointerMove:I||d.getDisablePointerSelection()?void 0:z,onClick:I?void 0:R},e.children)}),dn=f.forwardRef((e,r)=>{let{heading:t,children:a,forceMount:i,...n}=e,l=Pe(),d=f.useRef(null),m=f.useRef(null),h=Pe(),v=at(),g=Ae(w=>i||v.filter()===!1?!0:w.search?w.filtered.groups.has(l):!0);De(()=>v.group(l),[]),oa(l,d,[e.value,e.heading,m]);let S=f.useMemo(()=>({id:l,forceMount:i}),[i]);return f.createElement(ke.div,{ref:Ye(d,r),...n,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},t&&f.createElement("div",{ref:m,"cmdk-group-heading":"","aria-hidden":!0,id:h},t),ot(e,w=>f.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":t?h:void 0},f.createElement(na.Provider,{value:S},w))))}),un=f.forwardRef((e,r)=>{let{alwaysRender:t,...a}=e,i=f.useRef(null),n=Ae(l=>!l.search);return!t&&!n?null:f.createElement(ke.div,{ref:Ye(i,r),...a,"cmdk-separator":"",role:"separator"})}),cn=f.forwardRef((e,r)=>{let{onValueChange:t,...a}=e,i=e.value!=null,n=Qt(),l=Ae(h=>h.search),d=Ae(h=>h.selectedItemId),m=at();return f.useEffect(()=>{e.value!=null&&n.setState("search",e.value)},[e.value]),f.createElement(ke.input,{ref:r,...a,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":m.listId,"aria-labelledby":m.labelId,"aria-activedescendant":d,id:m.inputId,type:"text",value:i?e.value:l,onChange:h=>{i||n.setState("search",h.target.value),t?.(h.target.value)}})}),mn=f.forwardRef((e,r)=>{let{children:t,label:a="Suggestions",...i}=e,n=f.useRef(null),l=f.useRef(null),d=Ae(h=>h.selectedItemId),m=at();return f.useEffect(()=>{if(l.current&&n.current){let h=l.current,v=n.current,g,S=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let w=h.offsetHeight;v.style.setProperty("--cmdk-list-height",w.toFixed(1)+"px")})});return S.observe(h),()=>{cancelAnimationFrame(g),S.unobserve(h)}}},[]),f.createElement(ke.div,{ref:Ye(n,r),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":d,"aria-label":a,id:m.listId},ot(e,h=>f.createElement("div",{ref:Ye(l,m.listInnerRef),"cmdk-list-sizer":""},h)))}),fn=f.forwardRef((e,r)=>{let{open:t,onOpenChange:a,overlayClassName:i,contentClassName:n,container:l,...d}=e;return f.createElement(Wr,{open:t,onOpenChange:a},f.createElement(qr,{container:l},f.createElement(Kr,{"cmdk-overlay":"",className:i}),f.createElement(Gr,{"aria-label":e.label,"cmdk-dialog":"",className:n},f.createElement(ia,{ref:r,...d}))))}),hn=f.forwardRef((e,r)=>Ae(t=>t.filtered.count===0)?f.createElement(ke.div,{ref:r,...e,"cmdk-empty":"",role:"presentation"}):null),gn=f.forwardRef((e,r)=>{let{progress:t,children:a,label:i="Loading...",...n}=e;return f.createElement(ke.div,{ref:r,...n,"cmdk-loading":"",role:"progressbar","aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},ot(e,l=>f.createElement("div",{"aria-hidden":!0},l)))}),Ee=Object.assign(ia,{List:mn,Item:on,Input:cn,Group:dn,Separator:un,Dialog:fn,Empty:hn,Loading:gn});function vn(e,r){let t=e.nextElementSibling;for(;t;){if(t.matches(r))return t;t=t.nextElementSibling}}function pn(e,r){let t=e.previousElementSibling;for(;t;){if(t.matches(r))return t;t=t.previousElementSibling}}function la(e){let r=f.useRef(e);return De(()=>{r.current=e}),r}var De=typeof window>"u"?f.useEffect:f.useLayoutEffect;function Oe(e){let r=f.useRef();return r.current===void 0&&(r.current=e()),r}function Ae(e){let r=Qt(),t=()=>e(r.snapshot());return f.useSyncExternalStore(r.subscribe,t,t)}function oa(e,r,t,a=[]){let i=f.useRef(),n=at();return De(()=>{var l;let d=(()=>{var h;for(let v of t){if(typeof v=="string")return v.trim();if(typeof v=="object"&&"current"in v)return v.current?(h=v.current.textContent)==null?void 0:h.trim():i.current}})(),m=a.map(h=>h.trim());n.value(e,d,m),(l=r.current)==null||l.setAttribute(ze,d),i.current=d}),i}var yn=()=>{let[e,r]=f.useState(),t=Oe(()=>new Map);return De(()=>{t.current.forEach(a=>a()),t.current=new Map},[e]),(a,i)=>{t.current.set(a,i),r({})}};function xn(e){let r=e.type;return typeof r=="function"?r(e.props):"render"in r?r.render(e.props):e}function ot({asChild:e,children:r},t){return e&&f.isValidElement(r)?f.cloneElement(xn(r),{ref:r.ref},t(r.props.children)):t(r)}var bn={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"},s=Cs();function Yt({...e}){return(0,s.jsx)(Wr,{"data-slot":"dialog",...e})}function Cn({...e}){return(0,s.jsx)(qr,{"data-slot":"dialog-portal",...e})}function jn({className:e,...r}){return(0,s.jsx)(Kr,{"data-slot":"dialog-overlay",className:U("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 isolate z-50",e),...r})}function Jt({className:e,children:r,showCloseButton:t=!0,animated:a=!0,...i}){const n=!a&&"data-open:animate-none data-closed:animate-none";return(0,s.jsxs)(Cn,{children:[(0,s.jsx)(jn,{className:U(n)}),(0,s.jsxs)(Gr,{"data-slot":"dialog-content",className:U("bg-background 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 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-xs/relaxed ring-1 duration-150 data-closed:duration-100 ease-out sm:max-w-sm fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2",n,e),...i,children:[(0,s.jsx)(Ns.Provider,{value:!0,children:r}),t&&(0,s.jsx)(Hr,{"data-slot":"dialog-close",asChild:!0,children:(0,s.jsxs)(ne,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm",children:[(0,s.jsx)(es,{}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})})]})]})}function Xt({className:e,...r}){return(0,s.jsx)("div",{"data-slot":"dialog-header",className:U("gap-1 flex flex-col",e),...r})}function da({className:e,showCloseButton:r=!1,children:t,...a}){return(0,s.jsxs)("div",{"data-slot":"dialog-footer",className:U("gap-2 flex flex-col-reverse sm:flex-row sm:justify-end",e),...a,children:[t,r&&(0,s.jsx)(Hr,{asChild:!0,children:(0,s.jsx)(ne,{variant:"outline",children:"Close"})})]})}function Zt({className:e,...r}){return(0,s.jsx)(ws,{"data-slot":"dialog-title",className:U("text-sm font-medium",e),...r})}function er({className:e,...r}){return(0,s.jsx)(xs,{"data-slot":"dialog-description",className:U("text-muted-foreground *:[a]:hover:text-foreground text-xs/relaxed *:[a]:underline *:[a]:underline-offset-3",e),...r})}function ua({className:e,...r}){return(0,s.jsx)(Ee,{"data-slot":"command",className:U("bg-popover text-popover-foreground rounded-xl flex size-full flex-col overflow-hidden",e),...r})}function Wi({title:e="Command Palette",description:r="Search for a command to run...",children:t,className:a,showCloseButton:i=!1,...n}){return(0,s.jsxs)(Yt,{...n,children:[(0,s.jsxs)(Xt,{className:"sr-only",children:[(0,s.jsx)(Zt,{children:e}),(0,s.jsx)(er,{children:r})]}),(0,s.jsx)(Jt,{className:U("rounded-xl! p-0 overflow-hidden",a),showCloseButton:i,animated:!1,children:(0,s.jsx)(ua,{className:"[&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-2 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:t})})]})}function wn({className:e,...r}){return(0,s.jsx)("div",{"data-slot":"command-input-wrapper",className:"p-2 w-full",children:(0,s.jsxs)(Ss,{className:"bg-input/20 dark:bg-input/30 h-8!",children:[(0,s.jsx)(Ee.Input,{"data-slot":"command-input",className:U("w-full text-xs/relaxed outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...r}),(0,s.jsx)(As,{children:(0,s.jsx)(ss,{className:"size-3.5 shrink-0 opacity-50"})})]})})}function _n({className:e,...r}){return(0,s.jsx)(Ee.List,{"data-slot":"command-list",className:U("max-h-72 scroll-py-1 outline-none overflow-x-hidden overflow-y-auto",e),...r})}function Nn({className:e,...r}){return(0,s.jsx)(Ee.Empty,{"data-slot":"command-empty",className:U("py-6 text-center text-xs/relaxed",e),...r})}function Sn({className:e,...r}){return(0,s.jsx)(Ee.Group,{"data-slot":"command-group",className:U("text-foreground **:[[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2.5 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...r})}function Qi({className:e,...r}){return(0,s.jsx)(Ee.Separator,{"data-slot":"command-separator",className:U("bg-border/50 -mx-1 my-1 h-px",e),...r})}function An({className:e,children:r,...t}){return(0,s.jsxs)(Ee.Item,{"data-slot":"command-item",className:U("data-selected:bg-muted data-selected:text-foreground data-selected:*:[svg]:text-foreground relative flex min-h-3 cursor-default items-center gap-2 rounded-sm px-2.5 py-1.5 text-xs/relaxed outline-hidden select-none [&_svg:not([class*='size-'])]:size-3.5 [[data-slot=dialog-content]_&]:rounded-md group/command-item data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...t,children:[r,(0,s.jsx)(tt,{className:"ml-auto opacity-0 group-has-[[data-slot=command-shortcut]]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"})]})}function Yi({className:e,...r}){return(0,s.jsx)("span",{"data-slot":"command-shortcut",className:U("text-muted-foreground group-data-selected/command-item:text-foreground ml-auto text-[0.625rem] tracking-widest",e),...r})}var st=e=>e.type==="checkbox",Fe=e=>e instanceof Date,oe=e=>e==null,ca=e=>typeof e=="object",Y=e=>!oe(e)&&!Array.isArray(e)&&ca(e)&&!Fe(e),ma=e=>Y(e)&&e.target?st(e.target)?e.target.checked:e.target.value:e,fa=(e,r)=>r.split(".").some((t,a,i)=>!isNaN(Number(t))&&e.has(i.slice(0,a).join("."))),kn=e=>{const r=e.constructor&&e.constructor.prototype;return Y(r)&&r.hasOwnProperty("isPrototypeOf")},tr=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function G(e){if(e instanceof Date)return new Date(e);const r=typeof FileList<"u"&&e instanceof FileList;if(tr&&(e instanceof Blob||r))return e;const t=Array.isArray(e);if(!t&&!(Y(e)&&kn(e)))return e;const a=t?[]:Object.create(Object.getPrototypeOf(e));for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(a[i]=G(e[i]));return a}var dt=e=>/^\w*$/.test(e),q=e=>e===void 0,ut=e=>Array.isArray(e)?e.filter(Boolean):[],rr=e=>ut(e.replace(/["|']|\]/g,"").split(/\.|\[/)),x=(e,r,t)=>{if(!r||!Y(e))return t;const a=(dt(r)?[r]:rr(r)).reduce((i,n)=>oe(i)?void 0:i[n],e);return q(a)||a===e?q(e[r])?t:e[r]:a},me=e=>typeof e=="boolean",ae=e=>typeof e=="function",L=(e,r,t)=>{let a=-1;const i=dt(r)?[r]:rr(r),n=i.length,l=n-1;for(;++a<n;){const d=i[a];let m=t;if(a!==l){const h=e[d];m=Y(h)||Array.isArray(h)?h:isNaN(+i[a+1])?{}:[]}if(d==="__proto__"||d==="constructor"||d==="prototype")return;e[d]=m,e=e[d]}},Ne={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},he={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ye={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Nt="form",ha="root",ar=f.createContext(null);ar.displayName="HookFormControlContext";var ct=()=>f.useContext(ar),ga=(e,r,t,a=!0)=>{const i={};for(const n in e)Object.defineProperty(i,n,{get:()=>{const l=n;return r._proxyFormState[l]!==he.all&&(r._proxyFormState[l]=!a||he.all),t&&(t[l]=!0),e[l]}});return i},mt=typeof window<"u"?f.useLayoutEffect:f.useEffect;function Vn(e){const r=ct(),{control:t=r,disabled:a,name:i,exact:n}=e||{},[l,d]=f.useState(()=>({...t._formState,defaultValues:t._defaultValues})),m=f.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return mt(()=>t._subscribe({name:i,formState:m.current,exact:n,callback:h=>{!a&&d({...t._formState,...h,defaultValues:t._defaultValues})}}),[i,a,n]),f.useEffect(()=>{m.current.isValid&&t._setValid(!0)},[t]),f.useMemo(()=>ga(l,t,m.current,!1),[l,t])}var se=e=>typeof e=="string",$t=(e,r,t,a,i)=>se(e)?(a&&r.watch.add(e),x(t,e,i)):Array.isArray(e)?e.map(n=>(a&&r.watch.add(n),x(t,n))):(a&&(r.watchAll=!0),t),Lt=e=>oe(e)||!ca(e);function fe(e,r,t=new WeakSet){if(e===r)return!0;if(Lt(e)||Lt(r))return Object.is(e,r);if(Fe(e)&&Fe(r))return Object.is(e.getTime(),r.getTime());const a=Object.keys(e),i=Object.keys(r);if(a.length!==i.length)return!1;if(t.has(e)||t.has(r))return!0;t.add(e),t.add(r);for(const n of a){const l=e[n];if(!(n in r))return!1;if(n!=="ref"){const d=r[n];if(Fe(l)&&Fe(d)||(Y(l)||Array.isArray(l))&&(Y(d)||Array.isArray(d))?!fe(l,d,t):!Object.is(l,d))return!1}}return!0}function Se(e){const r=ct(),{control:t=r,name:a,defaultValue:i,disabled:n,exact:l,compute:d}=e||{},m=f.useRef(i),h=f.useRef(d),v=f.useRef(void 0),g=f.useRef(t),S=f.useRef(a);h.current=d;const[w,R]=f.useState(()=>{const j=t._getWatch(a,m.current);return h.current?h.current(j):j}),z=f.useCallback(j=>{const b=$t(a,t._names,j||t._formValues,!1,m.current);return h.current?h.current(b):b},[t._formValues,t._names,a]),I=f.useCallback(j=>{if(!n){const b=$t(a,t._names,j||t._formValues,!1,m.current);if(h.current){const p=h.current(b);fe(p,v.current)||(R(p),v.current=p)}else R(b)}},[t._formValues,t._names,n,a]);mt(()=>((g.current!==t||!fe(S.current,a))&&(g.current=t,S.current=a,I()),t._subscribe({name:a,formState:{values:!0},exact:l,callback:j=>{I(j.values)}})),[t,l,a,I]),f.useEffect(()=>t._removeUnmounted());const P=g.current!==t,A=S.current,M=f.useMemo(()=>{if(n)return null;const j=!P&&!fe(A,a);return P||j?z():null},[n,P,a,A,z]);return M!==null?M:w}function Fn(e){const r=ct(),{name:t,disabled:a,control:i=r,shouldUnregister:n,defaultValue:l,exact:d=!0}=e,m=fa(i._names.array,t),h=Se({control:i,name:t,defaultValue:f.useMemo(()=>x(i._formValues,t,x(i._defaultValues,t,l)),[i,t,l]),exact:d}),v=Vn({control:i,name:t,exact:d}),g=f.useRef(e),S=f.useRef(i.register(t,{...e.rules,value:h,...me(e.disabled)?{disabled:e.disabled}:{}}));g.current=e;const w=f.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!x(v.errors,t)},isDirty:{enumerable:!0,get:()=>!!x(v.dirtyFields,t)},isTouched:{enumerable:!0,get:()=>!!x(v.touchedFields,t)},isValidating:{enumerable:!0,get:()=>!!x(v.validatingFields,t)},error:{enumerable:!0,get:()=>x(v.errors,t)}}),[v,t]),R=f.useCallback(A=>S.current.onChange({target:{value:ma(A),name:t},type:Ne.CHANGE}),[t]),z=f.useCallback(()=>S.current.onBlur({target:{value:x(i._formValues,t),name:t},type:Ne.BLUR}),[t,i._formValues]),I=f.useCallback(A=>{const M=x(i._fields,t);M&&M._f&&A&&(M._f.ref={focus:()=>ae(A.focus)&&A.focus(),select:()=>ae(A.select)&&A.select(),setCustomValidity:j=>ae(A.setCustomValidity)&&A.setCustomValidity(j),reportValidity:()=>ae(A.reportValidity)&&A.reportValidity()})},[i._fields,t]),P=f.useMemo(()=>({name:t,value:h,...me(a)||v.disabled?{disabled:v.disabled||a}:{},onChange:R,onBlur:z,ref:I}),[t,a,v.disabled,R,z,I,h]);return f.useEffect(()=>{const A=i._options.shouldUnregister||n;i.register(t,{...g.current.rules,...me(g.current.disabled)?{disabled:g.current.disabled}:{}});const M=(j,b)=>{const p=x(i._fields,j);p&&p._f&&(p._f.mount=b)};if(M(t,!0),A){const j=G(x(i._options.defaultValues,t,g.current.defaultValue));L(i._defaultValues,t,j),q(x(i._formValues,t))&&L(i._formValues,t,j)}return!m&&i.register(t),()=>{(m?A&&!i._state.action:A)?i.unregister(t):M(t,!1)}},[t,i,m,n]),f.useEffect(()=>{i._setDisabledField({disabled:a,name:t})},[a,t,i]),f.useMemo(()=>({field:P,formState:v,fieldState:w}),[P,v,w])}var qe=e=>e.render(Fn(e)),sr=f.createContext(null);sr.displayName="HookFormContext";var Te=()=>f.useContext(sr),nr=e=>{const{children:r,watch:t,getValues:a,getFieldState:i,setError:n,clearErrors:l,setValue:d,setValues:m,trigger:h,formState:v,resetField:g,reset:S,handleSubmit:w,unregister:R,control:z,register:I,setFocus:P,subscribe:A}=e,M=f.useMemo(()=>({watch:t,getValues:a,getFieldState:i,setError:n,clearErrors:l,setValue:d,setValues:m,trigger:h,formState:v,resetField:g,reset:S,handleSubmit:w,unregister:R,control:z,register:I,setFocus:P,subscribe:A}),[l,z,v,i,a,w,I,S,g,n,P,d,m,A,h,R,t]);return f.createElement(sr.Provider,{value:M},f.createElement(ar.Provider,{value:M.control},r))},ir=(e,r,t,a,i)=>r?{...t[e],types:{...t[e]&&t[e].types?t[e].types:{},[a]:i||!0}}:{},ce=e=>Array.isArray(e)?e:[e],Sr=()=>{let e=[];return{get observers(){return e},next:i=>{for(const n of e)n.next&&n.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(n=>n!==i)}}),unsubscribe:()=>{e=[]}}};function va(e,r){const t={};for(const a in e)if(e.hasOwnProperty(a)){const i=e[a],n=r[a];if(i&&Y(i)&&n){const l=va(i,n);Y(l)&&(t[a]=l)}else e[a]&&(t[a]=n)}return t}var Z=e=>Y(e)&&!Object.keys(e).length,lr=e=>e.type==="file",it=e=>{if(!tr)return!1;const r=e?e.ownerDocument:0;return e instanceof(r&&r.defaultView?r.defaultView.HTMLElement:HTMLElement)},pa=e=>e.type==="select-multiple",or=e=>e.type==="radio",Dn=e=>or(e)||st(e),St=e=>it(e)&&e.isConnected;function En(e,r){const t=r.slice(0,-1).length;let a=0;for(;a<t;){if(oe(e)){e=void 0;break}e=e[r[a]],a++}return e}function Tn(e){for(const r in e)if(e.hasOwnProperty(r)&&!q(e[r]))return!1;return!0}function J(e,r){if(se(r)&&Object.prototype.hasOwnProperty.call(e,r))return delete e[r],e;const t=Array.isArray(r)?r:dt(r)?[r]:rr(r),a=t.length===1?e:En(e,t),i=t.length-1,n=t[i];return a&&delete a[n],i!==0&&(Y(a)&&Z(a)||Array.isArray(a)&&Tn(a))&&J(e,t.slice(0,-1)),e}var Rn=e=>{for(const r in e)if(ae(e[r]))return!0;return!1};function ya(e){return Array.isArray(e)||Y(e)&&!Rn(e)}function Ut(e,r={}){for(const t in e){const a=e[t];ya(a)?(r[t]=Array.isArray(a)?[]:{},Ut(a,r[t])):q(a)||(r[t]=!0)}return r}function Bt(e){if(e!==!1){if(e===!0)return!0;if(Array.isArray(e)){const r=e.map(t=>Bt(t));return r.some(t=>t!==void 0)?r:void 0}if(Y(e)){const r={};for(const t in e){const a=Bt(e[t]);q(a)||(r[t]=a)}return Object.keys(r).length?r:void 0}}}function Qe(e,r,t){t||(t=Ut(r));for(const a in e){const i=e[a];if(ya(i))q(r)||Lt(t[a])?t[a]=Ut(i,Array.isArray(i)?[]:{}):Qe(i,oe(r)?{}:r[a],t[a]);else{const n=r[a];t[a]=!fe(i,n)}}return Bt(t)||{}}var Ar={value:!1,isValid:!1},kr={value:!0,isValid:!0},xa=e=>{if(Array.isArray(e)){if(e.length>1){const r=e.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:r,isValid:!!r.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!q(e[0].attributes.value)?q(e[0].value)||e[0].value===""?kr:{value:e[0].value,isValid:!0}:kr:Ar}return Ar},ba=(e,{valueAsNumber:r,valueAsDate:t,setValueAs:a})=>q(e)?e:r?e===""?NaN:e&&+e:t&&se(e)?new Date(e):a?a(e):e,Vr={isValid:!1,value:null},Ca=e=>Array.isArray(e)?e.reduce((r,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:r,Vr):Vr;function Fr(e){const r=e.ref;return lr(r)?r.files:or(r)?Ca(e.refs).value:pa(r)?[...r.selectedOptions].map(({value:t})=>t):st(r)?xa(e.refs).value:ba(q(r.value)?e.ref.value:r.value,e)}var In=(e,r,t,a)=>{const i={};for(const n of e){const l=x(r,n);l&&L(i,n,l._f)}return{criteriaMode:t,names:[...e],fields:i,shouldUseNativeValidation:a}},lt=e=>e instanceof RegExp,He=e=>q(e)?e:lt(e)?e.source:Y(e)?lt(e.value)?e.value.source:e.value:e,Me=e=>({isOnSubmit:!e||e===he.onSubmit,isOnBlur:e===he.onBlur,isOnChange:e===he.onChange,isOnAll:e===he.all,isOnTouch:e===he.onTouched}),Dr="AsyncFunction",zn=e=>!!e&&!!e.validate&&!!(ae(e.validate)&&e.validate.constructor.name===Dr||Y(e.validate)&&Object.values(e.validate).find(r=>r.constructor.name===Dr)),On=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),qt=(e,r,t)=>!t&&(r.watchAll||r.watch.has(e)||[...r.watch].some(a=>e.startsWith(a)&&/^\.\w+/.test(e.slice(a.length)))),$e=(e,r,t,a)=>{for(const i of t||Object.keys(e)){const n=x(e,i);if(n){const{_f:l,...d}=n;if(l){if(l.refs&&l.refs[0]&&r(l.refs[0],i)&&!a)return!0;if(l.ref&&r(l.ref,l.name)&&!a)return!0;if($e(d,r))break}else if(Y(d)&&$e(d,r))break}}};function Er(e,r,t){const a=x(e,t);if(a||dt(t))return{error:a,name:t};const i=t.split(".");for(;i.length;){const n=i.join("."),l=x(r,n),d=x(e,n);if(l&&!Array.isArray(l)&&t!==n)return{name:t};if(d&&d.type)return{name:n,error:d};if(d&&d.root&&d.root.type)return{name:`${n}.root`,error:d.root};i.pop()}return{name:t}}var Mn=(e,r,t,a)=>{t(e);const{name:i,...n}=e;return Z(n)||a&&Object.keys(n).length>=Object.keys(r).length||Object.keys(n).find(l=>r[l]===(!a||he.all))},Pn=(e,r,t)=>!e||!r||e===r||ce(e).some(a=>a&&(t?a===r:a.startsWith(r)||r.startsWith(a))),$n=(e,r,t,a,i)=>i.isOnAll?!1:!t&&i.isOnTouch?!(r||e):(t?a.isOnBlur:i.isOnBlur)?!e:(t?a.isOnChange:i.isOnChange)?e:!0,Ln=(e,r)=>!ut(x(e,r)).length&&J(e,r),ja=(e,r,t)=>{const a=ce(x(e,t));return L(a,ha,r[t]),L(e,t,a),e};function Tr(e,r,t="validate"){if(se(e)||Array.isArray(e)&&e.every(se)||me(e)&&!e)return{type:t,message:se(e)?e:"",ref:r}}var Ie=e=>Y(e)&&!lt(e)?e:{value:e,message:""},Kt=async(e,r,t,a,i,n)=>{const{ref:l,refs:d,required:m,maxLength:h,minLength:v,min:g,max:S,pattern:w,validate:R,name:z,valueAsNumber:I,mount:P}=e._f,A=x(t,z);if(!P||r.has(z))return{};const M=d?d[0]:l,j=T=>{i&&M.reportValidity&&(M.setCustomValidity(me(T)?"":T||""),M.reportValidity())},b={},p=or(l),F=st(l),X=p||F,ee=(I||lr(l))&&q(l.value)&&q(A)||it(l)&&l.value===""||A===""||Array.isArray(A)&&!A.length||I&&typeof A=="number"&&isNaN(A),ve=ir.bind(null,z,a,b),Ce=(T,W,$,Q=ye.maxLength,de=ye.minLength)=>{const ie=T?W:$;b[z]={type:T?Q:de,message:ie,ref:l,...ve(T?Q:de,ie)}};if(n?!Array.isArray(A)||!A.length:m&&(!X&&(ee||oe(A))||me(A)&&!A||F&&!xa(d).isValid||p&&!Ca(d).isValid)){const{value:T,message:W}=se(m)?{value:!!m,message:m}:Ie(m);if(T&&(b[z]={type:ye.required,message:W,ref:M,...ve(ye.required,W)},!a))return j(W),b}if(!ee&&(!oe(g)||!oe(S))){let T,W;const $=Ie(S),Q=Ie(g);if(!oe(A)&&!isNaN(A)){const de=l.valueAsNumber||A&&+A;oe($.value)||(T=de>$.value),oe(Q.value)||(W=de<Q.value)}else{const de=l.valueAsDate||new Date(A),ie=Re=>new Date(new Date().toDateString()+" "+Re),we=l.type=="time",pe=l.type=="week";se($.value)&&A&&(T=we?ie(A)>ie($.value):pe?A>$.value:de>new Date($.value)),se(Q.value)&&A&&(W=we?ie(A)<ie(Q.value):pe?A<Q.value:de<new Date(Q.value))}if((T||W)&&(Ce(!!T,$.message,Q.message,ye.max,ye.min),!a))return j(b[z].message),b}if((h||v)&&!ee&&(se(A)||n&&Array.isArray(A))){const T=Ie(h),W=Ie(v),$=!oe(T.value)&&A.length>+T.value,Q=!oe(W.value)&&A.length<+W.value;if(($||Q)&&(Ce($,T.message,W.message),!a))return j(b[z].message),b}if(w&&!ee&&se(A)){const{value:T,message:W}=Ie(w);if(lt(T)&&!A.match(T)&&(b[z]={type:ye.pattern,message:W,ref:l,...ve(ye.pattern,W)},!a))return j(W),b}if(R){if(ae(R)){const T=Tr(await R(A,t),M);if(T&&(b[z]={...T,...ve(ye.validate,T.message)},!a))return j(T.message),b}else if(Y(R)){let T={};for(const W in R){if(!Z(T)&&!a)break;const $=Tr(await R[W](A,t),M,W);$&&(T={...$,...ve(W,$.message)},j($.message),a&&(b[z]=T))}if(!Z(T)&&(b[z]={ref:M,...T},!a))return b}}return j(!0),b},Un={mode:he.onSubmit,reValidateMode:he.onChange,shouldFocusError:!0},wa={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function Bn(e={}){let r={...Un,...e},t={...G(wa),isLoading:ae(r.defaultValues),errors:r.errors||{},disabled:r.disabled||!1},a={},i=Y(r.defaultValues)||Y(r.values)?G(r.defaultValues||r.values)||{}:{},n=r.shouldUnregister?{}:G(i),l={action:!1,mount:!1,watch:!1,keepIsValid:!1},d={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},m,h=0;const v={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},g={...v};let S={...g};const w={array:Sr(),state:Sr()},R=r.criteriaMode===he.all,z=o=>u=>{clearTimeout(h),h=setTimeout(o,u)},I=async o=>{if(!l.keepIsValid&&!r.disabled&&(g.isValid||S.isValid||o)){let u;r.resolver?(u=Z((await ee()).errors),P()):u=await T({fields:a,onlyCheckValid:!0,eventType:Ne.VALID}),u!==t.isValid&&w.state.next({isValid:u})}},P=(o,u)=>{!r.disabled&&(g.isValidating||g.validatingFields||S.isValidating||S.validatingFields)&&((o||Array.from(d.mount)).forEach(c=>{c&&(u?L(t.validatingFields,c,u):J(t.validatingFields,c))}),w.state.next({validatingFields:t.validatingFields,isValidating:!Z(t.validatingFields)}))},A=()=>{t.dirtyFields=Qe(i,n)},M=(o,u=[],c,_,N=!0,C=!0)=>{if(_&&c&&!r.disabled){if(l.action=!0,C&&Array.isArray(x(a,o))){const k=c(x(a,o),_.argA,_.argB);N&&L(a,o,k)}if(C&&Array.isArray(x(t.errors,o))){const k=c(x(t.errors,o),_.argA,_.argB);N&&L(t.errors,o,k),Ln(t.errors,o)}if((g.touchedFields||S.touchedFields)&&C&&Array.isArray(x(t.touchedFields,o))){const k=c(x(t.touchedFields,o),_.argA,_.argB);N&&L(t.touchedFields,o,k)}(g.dirtyFields||S.dirtyFields)&&A(),w.state.next({name:o,isDirty:$(o,u),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else L(n,o,u)},j=(o,u)=>{L(t.errors,o,u),w.state.next({errors:t.errors})},b=o=>{t.errors=o,w.state.next({errors:t.errors,isValid:!1})},p=(o,u,c,_)=>{const N=x(a,o);if(N){const C=q(x(n,o)),k=x(n,o,q(c)?x(i,o):c);q(k)||_&&_.defaultChecked||u?L(n,o,u?k:Fr(N._f)):ie(o,k),l.mount&&!l.action&&(I(),C&&t.isDirty&&(g.isDirty||S.isDirty)&&($()||(t.isDirty=!1,w.state.next({...t}))))}},F=(o,u,c,_,N)=>{let C=!1,k=!1;const E={name:o};if(!r.disabled){if(!c||_){(g.isDirty||S.isDirty)&&(k=t.isDirty,t.isDirty=E.isDirty=$(),C=k!==E.isDirty);const K=fe(x(i,o),u);k=!!x(t.dirtyFields,o),K?J(t.dirtyFields,o):L(t.dirtyFields,o,!0),E.dirtyFields=t.dirtyFields,C=C||(g.dirtyFields||S.dirtyFields)&&k!==!K}if(c){const K=x(t.touchedFields,o);K||(L(t.touchedFields,o,c),E.touchedFields=t.touchedFields,C=C||(g.touchedFields||S.touchedFields)&&K!==c)}C&&N&&w.state.next(E)}return C?E:{}},X=(o,u,c,_)=>{const N=x(t.errors,o),C=(g.isValid||S.isValid)&&me(u)&&t.isValid!==u;if(r.delayError&&c?(m=z(()=>j(o,c)),m(r.delayError)):(clearTimeout(h),m=null,c?L(t.errors,o,c):J(t.errors,o)),(c?!fe(N,c):N)||!Z(_)||C){const k={..._,...C&&me(u)?{isValid:u}:{},errors:t.errors,name:o};t={...t,...k},w.state.next(k)}},ee=async o=>(P(o,!0),await r.resolver(n,r.context,In(o||d.mount,a,r.criteriaMode,r.shouldUseNativeValidation))),ve=async o=>{const{errors:u}=await ee(o);if(P(o),o)for(const c of o){const _=x(u,c);_?L(t.errors,c,_):J(t.errors,c)}else t.errors=u;return u},Ce=async({name:o,eventType:u})=>{if(e.validate){const c=await e.validate({formValues:n,formState:t,name:o,eventType:u});if(Y(c))for(const _ in c)c[_]&&H(`${Nt}.${_}`,{message:se(c.message)?c.message:"",type:ye.validate});else se(c)||!c?H(Nt,{message:c||"",type:ye.validate}):B(Nt);return c}return!0},T=async({fields:o,onlyCheckValid:u,name:c,eventType:_,context:N={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(N.runRootValidation=!0,!await Ce({name:c,eventType:_})&&(N.valid=!1,u)))return N.valid;for(const C in o){const k=o[C];if(k){const{_f:E,...K}=k;if(E){const le=d.array.has(E.name),be=k._f&&zn(k._f);be&&g.validatingFields&&P([E.name],!0);const ue=await Kt(k,d.disabled,n,R,r.shouldUseNativeValidation&&!u,le);if(be&&g.validatingFields&&P([E.name]),ue[E.name]&&(N.valid=!1,u)||(!u&&(x(ue,E.name)?le?ja(t.errors,ue,E.name):L(t.errors,E.name,ue[E.name]):J(t.errors,E.name)),e.shouldUseNativeValidation&&ue[E.name]))break}!Z(K)&&await T({context:N,onlyCheckValid:u,fields:K,name:C,eventType:_})}}return N.valid},W=()=>{for(const o of d.unMount){const u=x(a,o);u&&(u._f.refs?u._f.refs.every(c=>!St(c)):!St(u._f.ref))&&pt(o)}d.unMount=new Set},$=(o,u)=>!r.disabled&&(o&&u&&L(n,o,u),!fe(O(),i)),Q=(o,u,c)=>$t(o,d,{...l.mount?n:q(u)?i:se(o)?{[o]:u}:u},c,u),de=o=>ut(x(l.mount?n:i,o,r.shouldUnregister?x(i,o,[]):[])),ie=(o,u,c={})=>{const _=x(a,o);let N=u;if(_){const C=_._f;C&&(!C.disabled&&L(n,o,ba(u,C)),N=it(C.ref)&&oe(u)?"":u,pa(C.ref)?[...C.ref.options].forEach(k=>k.selected=N.includes(k.value)):C.refs?st(C.ref)?C.refs.forEach(k=>{(!k.defaultChecked||!k.disabled)&&(Array.isArray(N)?k.checked=!!N.find(E=>E===k.value):k.checked=N===k.value||!!N)}):C.refs.forEach(k=>k.checked=k.value===N):lr(C.ref)?C.ref.value="":(C.ref.value=N,C.ref.type||w.state.next({name:o,values:G(n)})))}(c.shouldDirty||c.shouldTouch)&&F(o,N,c.shouldTouch,c.shouldDirty,!0),c.shouldValidate&&D(o)},we=(o,u,c)=>{for(const _ in u){if(!u.hasOwnProperty(_))return;const N=u[_],C=o+"."+_,k=x(a,C);(d.array.has(o)||Y(N)||k&&!k._f)&&!Fe(N)?we(C,N,c):ie(C,N,c)}},pe=(o,u,c={})=>{const _=x(a,o),N=d.array.has(o),C=G(u),k=fe(x(n,o),C);if(L(n,o,C),N)w.array.next({name:o,values:G(n)}),(g.isDirty||g.dirtyFields||S.isDirty||S.dirtyFields)&&c.shouldDirty&&(A(),w.state.next({name:o,dirtyFields:t.dirtyFields,isDirty:$(o,C)}));else{const E=Array.isArray(C)&&!C.length||Z(C);!_||_._f||oe(C)||E?ie(o,C,c):we(o,C,c)}if(!k){const E=qt(o,d);w.state.next({...E&&t,name:l.mount||E?o:void 0,values:G(n)})}},Re=o=>{const u=ae(o)?o(n):o;fe(n,u)||(n={...n,...u},w.state.next({...t,values:n}))},Ke=async o=>{l.mount=!0;const u=o.target;let c=u.name,_=!0;const N=x(a,c),C=K=>{_=Number.isNaN(K)||Fe(K)&&isNaN(K.getTime())||fe(K,x(n,c,K))},k=Me(r.mode),E=Me(r.reValidateMode);if(N){let K,le;const be=u.type?Fr(N._f):ma(o),ue=o.type===Ne.BLUR||o.type===Ne.FOCUS_OUT,za=!On(N._f)&&!e.validate&&!r.resolver&&!x(t.errors,c)&&!N._f.deps||$n(ue,x(t.touchedFields,c),t.isSubmitted,E,k),bt=qt(c,d,ue);L(n,c,be),ue?(!u||!u.readOnly)&&(N._f.onBlur&&N._f.onBlur(o),m&&m(0)):N._f.onChange&&N._f.onChange(o);const Ct=F(c,be,ue),Oa=!Z(Ct)||bt;if(!ue&&w.state.next({name:c,type:o.type,values:G(n)}),za)return(g.isValid||S.isValid)&&(r.mode==="onBlur"?ue&&I():ue||I()),Oa&&w.state.next({name:c,...bt?{}:Ct});if(!r.resolver&&e.validate&&await Ce({name:c,eventType:o.type}),!ue&&bt&&w.state.next({...t}),r.resolver){const{errors:pr}=await ee([c]);if(P([c]),C(be),_){const Ma=Er(t.errors,a,c),yr=Er(pr,a,Ma.name||c);K=yr.error,c=yr.name,le=Z(pr)}}else P([c],!0),K=(await Kt(N,d.disabled,n,R,r.shouldUseNativeValidation))[c],P([c]),C(be),_&&(K?le=!1:(g.isValid||S.isValid)&&(le=await T({fields:a,onlyCheckValid:!0,name:c,eventType:o.type})));_&&(N._f.deps&&(!Array.isArray(N._f.deps)||N._f.deps.length>0)&&D(N._f.deps),X(c,le,K,Ct))}},y=(o,u)=>{if(x(t.errors,u)&&o.focus)return o.focus(),1},D=async(o,u={})=>{let c,_;const N=ce(o);if(r.resolver){const C=await ve(q(o)?o:N);c=Z(C),_=o?!N.some(k=>x(C,k)):c}else o?(_=(await Promise.all(N.map(async C=>{const k=x(a,C);return await T({fields:k&&k._f?{[C]:k}:k,eventType:Ne.TRIGGER})}))).every(Boolean),!(!_&&!t.isValid)&&I()):_=c=await T({fields:a,name:o,eventType:Ne.TRIGGER});return w.state.next({...!se(o)||(g.isValid||S.isValid)&&c!==t.isValid?{}:{name:o},...r.resolver||!o?{isValid:c}:{},errors:t.errors}),u.shouldFocus&&!_&&$e(a,y,o?N:d.mount),_},O=(o,u)=>{let c={...l.mount?n:i};return u&&(c=va(u.dirtyFields?t.dirtyFields:t.touchedFields,c)),q(o)?c:se(o)?x(c,o):o.map(_=>x(c,_))},V=(o,u)=>({invalid:!!x((u||t).errors,o),isDirty:!!x((u||t).dirtyFields,o),error:x((u||t).errors,o),isValidating:!!x(t.validatingFields,o),isTouched:!!x((u||t).touchedFields,o)}),B=o=>{const u=o?ce(o):void 0;u?.forEach(c=>J(t.errors,c)),u?u.forEach(c=>{w.state.next({name:c,errors:t.errors})}):w.state.next({errors:{}})},H=(o,u,c)=>{const _=(x(a,o,{_f:{}})._f||{}).ref,{ref:N,message:C,type:k,...E}=x(t.errors,o)||{};L(t.errors,o,{...E,...u,ref:_}),w.state.next({name:o,errors:t.errors,isValid:!1}),c&&c.shouldFocus&&_&&_.focus&&_.focus()},te=(o,u)=>ae(o)?w.state.subscribe({next:c=>"values"in c&&o(c.values||Q(void 0,u),c)}):Q(o,u,!0),re=o=>w.state.subscribe({next:u=>{if(Pn(o.name,u.name,o.exact)&&Mn(u,o.formState||g,Ia,o.reRenderRoot)){const c={...n};o.callback({values:c,...t,...u,defaultValues:i})}}}).unsubscribe,vt=o=>(l.mount=!0,S={...S,...o.formState},re({...o,formState:{...v,...o.formState}})),pt=(o,u={})=>{for(const c of o?ce(o):d.mount)d.mount.delete(c),d.array.delete(c),u.keepValue||(J(a,c),J(n,c)),!u.keepError&&J(t.errors,c),!u.keepDirty&&J(t.dirtyFields,c),!u.keepTouched&&J(t.touchedFields,c),!u.keepIsValidating&&J(t.validatingFields,c),!r.shouldUnregister&&!u.keepDefaultValue&&J(i,c);w.state.next({values:G(n)}),w.state.next({...t,...u.keepDirty?{isDirty:$()}:{}}),!u.keepIsValid&&I()},mr=({disabled:o,name:u})=>{if(me(o)&&l.mount||o||d.disabled.has(u)){const c=d.disabled.has(u)!==!!o;o?d.disabled.add(u):d.disabled.delete(u),c&&l.mount&&!l.action&&I()}},yt=(o,u={})=>{let c=x(a,o);const _=me(u.disabled)||me(r.disabled),N=!d.registerName.has(o)&&c&&c._f&&!c._f.mount;return L(a,o,{...c||{},_f:{...c&&c._f?c._f:{ref:{name:o}},name:o,mount:!0,...u}}),d.mount.add(o),c&&!N?mr({disabled:me(u.disabled)?u.disabled:r.disabled,name:o}):p(o,!0,u.value),{..._?{disabled:u.disabled||r.disabled}:{},...r.progressive?{required:!!u.required,min:He(u.min),max:He(u.max),minLength:He(u.minLength),maxLength:He(u.maxLength),pattern:He(u.pattern)}:{},name:o,onChange:Ke,onBlur:Ke,ref:C=>{if(C){d.registerName.add(o),yt(o,u),d.registerName.delete(o),c=x(a,o);const k=q(C.value)&&C.querySelectorAll&&C.querySelectorAll("input,select,textarea")[0]||C,E=Dn(k),K=c._f.refs||[];if(E?K.find(le=>le===k):k===c._f.ref)return;L(a,o,{_f:{...c._f,...E?{refs:[...K.filter(St),k,...Array.isArray(x(i,o))?[{}]:[]],ref:{type:k.type,name:o}}:{ref:k}}}),p(o,!1,void 0,k)}else c=x(a,o,{}),c._f&&(c._f.mount=!1),(r.shouldUnregister||u.shouldUnregister)&&!(fa(d.array,o)&&l.action)&&d.unMount.add(o)}}},xt=()=>r.shouldFocusError&&$e(a,y,d.mount),Ea=o=>{me(o)&&(w.state.next({disabled:o}),$e(a,(u,c)=>{const _=x(a,c);_&&(u.disabled=_._f.disabled||o,Array.isArray(_._f.refs)&&_._f.refs.forEach(N=>{N.disabled=_._f.disabled||o}))},0,!1))},fr=(o,u)=>async c=>{let _;c&&(c.preventDefault&&c.preventDefault(),c.persist&&c.persist());let N=G(n);if(w.state.next({isSubmitting:!0}),r.resolver){const{errors:C,values:k}=await ee();P(),t.errors=C,N=G(k)}else await T({fields:a,eventType:Ne.SUBMIT});if(d.disabled.size)for(const C of d.disabled)J(N,C);if(J(t.errors,ha),Z(t.errors)){w.state.next({errors:{}});try{await o(N,c)}catch(C){_=C}}else u&&await u({...t.errors},c),xt(),setTimeout(xt);if(w.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Z(t.errors)&&!_,submitCount:t.submitCount+1,errors:t.errors}),_)throw _},Ta=(o,u={})=>{x(a,o)&&(q(u.defaultValue)?pe(o,G(x(i,o))):(pe(o,u.defaultValue),L(i,o,G(u.defaultValue))),u.keepTouched||J(t.touchedFields,o),u.keepDirty||(J(t.dirtyFields,o),t.isDirty=u.defaultValue?$(o,G(x(i,o))):$()),u.keepError||(J(t.errors,o),g.isValid&&I()),w.state.next({...t}))},hr=(o,u={})=>{const c=o?G(o):i,_=G(c),N=Z(o),C=N?i:_;if(u.keepDefaultValues||(i=c),!u.keepValues){if(u.keepDirtyValues){const k=new Set([...d.mount,...Object.keys(Qe(i,n))]);for(const E of Array.from(k)){const K=x(t.dirtyFields,E),le=x(n,E),be=x(C,E);K&&!q(le)?L(C,E,le):!K&&!q(be)&&pe(E,be)}}else{if(tr&&q(o))for(const k of d.mount){const E=x(a,k);if(E&&E._f){const K=Array.isArray(E._f.refs)?E._f.refs[0]:E._f.ref;if(it(K)){const le=K.closest("form");if(le){le.reset();break}}}}if(u.keepFieldsRef)for(const k of d.mount)pe(k,x(C,k));else a={}}n=r.shouldUnregister?u.keepDefaultValues?G(i):{}:G(C),w.array.next({values:{...C}}),w.state.next({values:{...C}})}d={mount:u.keepDirtyValues?d.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},l.mount=!g.isValid||!!u.keepIsValid||!!u.keepDirtyValues||!r.shouldUnregister&&!Z(C),l.watch=!!r.shouldUnregister,l.keepIsValid=!!u.keepIsValid,l.action=!1,u.keepErrors||(t.errors={}),w.state.next({submitCount:u.keepSubmitCount?t.submitCount:0,isDirty:N?!1:u.keepDirty?t.isDirty:!!(u.keepDefaultValues&&!fe(o,i)),isSubmitted:u.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:N?{}:u.keepDirtyValues?u.keepDefaultValues&&n?Qe(i,n):t.dirtyFields:u.keepDefaultValues&&o?Qe(i,o):u.keepDirty?t.dirtyFields:{},touchedFields:u.keepTouched?t.touchedFields:{},errors:u.keepErrors?t.errors:{},isSubmitSuccessful:u.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},gr=(o,u)=>hr(ae(o)?o(n):o,{...r.resetOptions,...u}),Ra=(o,u={})=>{const c=x(a,o),_=c&&c._f;if(_){const N=_.refs?_.refs[0]:_.ref;N.focus&&setTimeout(()=>{N.focus(),u.shouldSelect&&ae(N.select)&&N.select()})}},Ia=o=>{t={...t,...o}},vr={control:{register:yt,unregister:pt,getFieldState:V,handleSubmit:fr,setError:H,_subscribe:re,_runSchema:ee,_updateIsValidating:P,_focusError:xt,_getWatch:Q,_getDirty:$,_setValid:I,_setFieldArray:M,_setDisabledField:mr,_setErrors:b,_getFieldArray:de,_reset:hr,_resetDefaultValues:()=>ae(r.defaultValues)&&r.defaultValues().then(o=>{gr(o,r.resetOptions),w.state.next({isLoading:!1})}),_removeUnmounted:W,_disableForm:Ea,_subjects:w,_proxyFormState:g,get _fields(){return a},get _formValues(){return n},get _state(){return l},set _state(o){l=o},get _defaultValues(){return i},get _names(){return d},set _names(o){d=o},get _formState(){return t},get _options(){return r},set _options(o){r={...r,...o}}},subscribe:vt,trigger:D,register:yt,handleSubmit:fr,watch:te,setValue:pe,setValues:Re,getValues:O,reset:gr,resetField:Ta,clearErrors:B,unregister:pt,setError:H,setFocus:Ra,getFieldState:V};return{...vr,formControl:vr}}var _e=()=>{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{const t=(Math.random()*16+e)%16|0;return(r=="x"?t:t&3|8).toString(16)})},At=(e,r,t={})=>t.shouldFocus||q(t.shouldFocus)?t.focusName||`${e}.${q(t.focusIndex)?r:t.focusIndex}.`:"",kt=(e,r)=>[...e,...ce(r)],Vt=e=>Array.isArray(e)?e.map(()=>{}):void 0;function Ft(e,r,t){return[...e.slice(0,r),...ce(t),...e.slice(r)]}var Dt=(e,r,t)=>Array.isArray(e)?(q(e[t])&&(e[t]=void 0),e.splice(t,0,e.splice(r,1)[0]),e):[],Et=(e,r)=>[...ce(r),...ce(e)];function qn(e,r){let t=0;const a=[...e];for(const i of r)a.splice(i-t,1),t++;return ut(a).length?a:[]}var Tt=(e,r)=>q(r)?[]:qn(e,ce(r).sort((t,a)=>t-a)),Rt=(e,r,t)=>{[e[r],e[t]]=[e[t],e[r]]},Rr=(e,r,t)=>(e[r]=t,e);function Ji(e){const r=ct(),{control:t=r,name:a,keyName:i="id",shouldUnregister:n,rules:l}=e,[d,m]=f.useState(t._getFieldArray(a)),h=f.useRef(t._getFieldArray(a).map(_e)),v=f.useRef(!1);t._names.array.add(a),f.useMemo(()=>l&&d.length>=0&&t.register(a,l),[t,a,d.length,l]),mt(()=>t._subjects.array.subscribe({next:({values:j,name:b})=>{if(b===a||!b){const p=x(j,a);Array.isArray(p)&&(m(p),h.current=p.map(_e))}}}).unsubscribe,[t,a]);const g=f.useCallback(j=>{v.current=!0,t._setFieldArray(a,j)},[t,a]),S=(j,b)=>{const p=ce(G(j)),F=kt(t._getFieldArray(a),p);t._names.focus=At(a,F.length-1,b),h.current=kt(h.current,p.map(_e)),g(F),m(F),t._setFieldArray(a,F,kt,{argA:Vt(j)})},w=(j,b)=>{const p=ce(G(j)),F=Et(t._getFieldArray(a),p);t._names.focus=At(a,0,b),h.current=Et(h.current,p.map(_e)),g(F),m(F),t._setFieldArray(a,F,Et,{argA:Vt(j)})},R=j=>{const b=Tt(t._getFieldArray(a),j);h.current=Tt(h.current,j),g(b),m(b),!Array.isArray(x(t._fields,a))&&L(t._fields,a,void 0),t._setFieldArray(a,b,Tt,{argA:j})},z=(j,b,p)=>{const F=ce(G(b)),X=Ft(t._getFieldArray(a),j,F);t._names.focus=At(a,j,p),h.current=Ft(h.current,j,F.map(_e)),g(X),m(X),t._setFieldArray(a,X,Ft,{argA:j,argB:Vt(b)})},I=(j,b)=>{const p=t._getFieldArray(a);Rt(p,j,b),Rt(h.current,j,b),g(p),m(p),t._setFieldArray(a,p,Rt,{argA:j,argB:b},!1)},P=(j,b)=>{const p=t._getFieldArray(a);Dt(p,j,b),Dt(h.current,j,b),g(p),m(p),t._setFieldArray(a,p,Dt,{argA:j,argB:b},!1)},A=(j,b)=>{const p=G(b),F=Rr(t._getFieldArray(a),j,p);h.current=[...F].map((X,ee)=>!X||ee===j?_e():h.current[ee]),g(F),m([...F]),t._setFieldArray(a,F,Rr,{argA:j,argB:p},!0,!1)},M=j=>{const b=ce(G(j));h.current=b.map(_e),g([...b]),m([...b]),t._setFieldArray(a,[...b],p=>p,{},!0,!1)};return f.useEffect(()=>{t._state.action=!1,qt(a,t._names)&&t._subjects.state.next({...t._formState});const j=Me(t._options.mode);if(v.current&&(!j.isOnSubmit||t._formState.isSubmitted)&&!Me(t._options.reValidateMode).isOnSubmit&&!j.isOnBlur)if(t._options.resolver)t._runSchema([a]).then(b=>{t._updateIsValidating([a]);const p=x(b.errors,a),F=x(t._formState.errors,a);(F?!p&&F.type||p&&(F.type!==p.type||F.message!==p.message):p&&p.type)&&(p?L(t._formState.errors,a,p):J(t._formState.errors,a),t._subjects.state.next({errors:t._formState.errors}))});else{const b=x(t._fields,a);b&&b._f&&!(Me(t._options.reValidateMode).isOnSubmit&&Me(t._options.mode).isOnSubmit)&&Kt(b,t._names.disabled,t._formValues,t._options.criteriaMode===he.all,t._options.shouldUseNativeValidation,!0).then(p=>!Z(p)&&t._subjects.state.next({errors:ja(t._formState.errors,p,a)}))}t._subjects.state.next({name:a,values:G(t._formValues)}),t._names.focus&&$e(t._fields,(b,p)=>{if(t._names.focus&&p.startsWith(t._names.focus)&&b.focus)return b.focus(),1}),t._names.focus="",t._setValid(),v.current=!1},[d,a,t]),f.useEffect(()=>(!x(t._formValues,a)&&t._setFieldArray(a),()=>{const j=!(t._options.shouldUnregister||n),b=(p,F)=>{const X=x(t._fields,p);X&&X._f&&(X._f.mount=F)};v.current&&j&&t._subjects.state.next({name:a,values:G(t._formValues)}),j?b(a,!1):t.unregister(a)}),[a,t,i,n]),{swap:f.useCallback(I,[g,a,t]),move:f.useCallback(P,[g,a,t]),prepend:f.useCallback(w,[g,a,t]),append:f.useCallback(S,[g,a,t]),remove:f.useCallback(R,[g,a,t]),insert:f.useCallback(z,[g,a,t]),update:f.useCallback(A,[g,a,t]),replace:f.useCallback(M,[g,a,t]),fields:f.useMemo(()=>d.map((j,b)=>({...j,[i]:h.current[b]||_e()})),[d,i])}}function dr(e={}){const r=f.useRef(void 0),t=f.useRef(void 0),[a,i]=f.useState(()=>({...G(wa),isLoading:ae(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:ae(e.defaultValues)?void 0:e.defaultValues}));if(!r.current)if(e.formControl)r.current={...e.formControl,formState:a},e.defaultValues&&!ae(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:l,...d}=Bn(e);r.current={...d,formState:a}}const n=r.current.control;return n._options=e,mt(()=>{const l=n._subscribe({formState:n._proxyFormState,callback:()=>i({...n._formState}),reRenderRoot:!0});return i(d=>({...d,isReady:!0})),n._formState.isReady=!0,l},[n]),f.useEffect(()=>n._disableForm(e.disabled),[n,e.disabled]),f.useEffect(()=>{e.mode&&(n._options.mode=e.mode),e.reValidateMode&&(n._options.reValidateMode=e.reValidateMode)},[n,e.mode,e.reValidateMode]),f.useEffect(()=>{e.errors&&(n._setErrors(e.errors),n._focusError())},[n,e.errors]),f.useEffect(()=>{e.shouldUnregister&&n._subjects.state.next({values:n._getWatch()})},[n,e.shouldUnregister]),f.useEffect(()=>{if(n._proxyFormState.isDirty){const l=n._getDirty();l!==a.isDirty&&n._subjects.state.next({isDirty:l})}},[n,a.isDirty]),f.useEffect(()=>{var l;e.values&&!fe(e.values,t.current)?(n._reset(e.values,{keepFieldsRef:!0,...n._options.resetOptions}),!((l=n._options.resetOptions)===null||l===void 0)&&l.keepIsValid||n._setValid(),t.current=e.values,i(d=>({...d}))):n._resetDefaultValues()},[n,e.values]),f.useEffect(()=>{n._state.mount||(n._setValid(),n._state.mount=!0),n._state.watch&&(n._state.watch=!1,n._subjects.state.next({...n._formState})),n._removeUnmounted()}),r.current.formState=f.useMemo(()=>ga(a,n),[n,a]),r.current}var Ir=(e,r,t)=>{if(e&&"reportValidity"in e){const a=x(t,r);e.setCustomValidity(a&&a.message||""),e.reportValidity()}},Gt=(e,r)=>{for(const t in r.fields){const a=r.fields[t];a&&a.ref&&"reportValidity"in a.ref?Ir(a.ref,t,e):a&&a.refs&&a.refs.forEach(i=>Ir(i,t,e))}},zr=(e,r)=>{r.shouldUseNativeValidation&&Gt(e,r);const t={};for(const a in e){const i=x(r.fields,a),n=Object.assign(e[a]||{},{ref:i&&i.ref});if(Kn(r.names||Object.keys(e),a)){const l=Object.assign({},x(t,a));L(l,"root",n),L(t,a,l)}else L(t,a,n)}return t},Kn=(e,r)=>{const t=Or(r);return e.some(a=>Or(a).match(`^${t}\\.\\d+`))};function Or(e){return e.replace(/\]|\[/g,"")}function Mr(e,r){try{var t=e()}catch(a){return r(a)}return t&&t.then?t.then(void 0,r):t}function Gn(e,r){for(var t={};e.length;){var a=e[0],i=a.code,n=a.message,l=a.path.join(".");if(!t[l])if("unionErrors"in a){var d=a.unionErrors[0].errors[0];t[l]={message:d.message,type:d.code}}else t[l]={message:n,type:i};if("unionErrors"in a&&a.unionErrors.forEach(function(v){return v.errors.forEach(function(g){return e.push(g)})}),r){var m=t[l].types,h=m&&m[a.code];t[l]=ir(l,r,t,i,h?[].concat(h,a.message):a.message)}e.shift()}return t}function Hn(e,r){for(var t={};e.length;){var a=e[0],i=a.code,n=a.message,l=a.path.join(".");if(!t[l])if(a.code==="invalid_union"&&a.errors.length>0){var d=a.errors[0][0];t[l]={message:d.message,type:d.code}}else t[l]={message:n,type:i};if(a.code==="invalid_union"&&a.errors.forEach(function(v){return v.forEach(function(g){return e.push(g)})}),r){var m=t[l].types,h=m&&m[a.code];t[l]=ir(l,r,t,i,h?[].concat(h,a.message):a.message)}e.shift()}return t}function ur(e,r,t){if(t===void 0&&(t={}),(function(a){return"_def"in a&&typeof a._def=="object"&&"typeName"in a._def})(e))return function(a,i,n){try{return Promise.resolve(Mr(function(){return Promise.resolve(e[t.mode==="sync"?"parse":"parseAsync"](a,r)).then(function(l){return n.shouldUseNativeValidation&&Gt({},n),{errors:{},values:t.raw?Object.assign({},a):l}})},function(l){if((function(d){return Array.isArray(d?.issues)})(l))return{values:{},errors:zr(Gn(l.errors,!n.shouldUseNativeValidation&&n.criteriaMode==="all"),n)};throw l}))}catch(l){return Promise.reject(l)}};if((function(a){return"_zod"in a&&typeof a._zod=="object"})(e))return function(a,i,n){try{return Promise.resolve(Mr(function(){return Promise.resolve((t.mode==="sync"?Ts:Es)(e,a,r)).then(function(l){return n.shouldUseNativeValidation&&Gt({},n),{errors:{},values:t.raw?Object.assign({},a):l}})},function(l){if((function(d){return d instanceof zs})(l))return{values:{},errors:zr(Hn(l.issues,!n.shouldUseNativeValidation&&n.criteriaMode==="all"),n)};throw l}))}catch(l){return Promise.reject(l)}};throw new Error("Invalid input: not a Zod schema")}var _a=({onCancel:e,isLoading:r})=>(0,s.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,s.jsx)(ne,{type:"button",variant:"outline",size:"lg",onClick:e,disabled:r,children:"Cancel"}),(0,s.jsx)(ne,{type:"submit",variant:"default",size:"lg",disabled:r,children:"Save"})]}),Wn={numeric:[{value:"int2",label:"int2",description:"Signed two-byte integer"},{value:"int4",label:"int4",description:"Signed four-byte integer"},{value:"int8",label:"int8",description:"Signed eight-byte integer"},{value:"float4",label:"float4",description:"Single precision floating-point number (4 bytes)"},{value:"float8",label:"float8",description:"Double precision floating-point number (8 bytes)"},{value:"numeric",label:"numeric",description:"Exact numeric of selectable precision"},{value:"serial",label:"serial",description:"Auto-incrementing four-byte integer"},{value:"bigserial",label:"bigserial",description:"Auto-incrementing eight-byte integer"}],text:[{value:"text",label:"text",description:"Variable-length character string"},{value:"varchar",label:"varchar",description:"Variable-length character string"},{value:"char",label:"char",description:"Fixed-length character string"},{value:"uuid",label:"uuid",description:"Universally unique identifier"}],boolean:[{value:"boolean",label:"boolean",description:"Logical boolean (true/false)"}],datetime:[{value:"date",label:"date",description:"Calendar date (year, month, day)"},{value:"time",label:"time",description:"Time of day (no time zone)"},{value:"timestamp",label:"timestamp",description:"Date and time (no time zone)"},{value:"timestamptz",label:"timestamptz",description:"Date and time with time zone"},{value:"interval",label:"interval",description:"Time span"}],json:[{value:"json",label:"json",description:"Textual JSON data"},{value:"jsonb",label:"jsonb",description:"Binary JSON data, decomposed"}],binary:[{value:"bytea",label:"bytea",description:'Binary data ("byte array")'}],network:[{value:"inet",label:"inet",description:"IPv4 or IPv6 host address"},{value:"cidr",label:"cidr",description:"IPv4 or IPv6 network address"},{value:"macaddr",label:"macaddr",description:"MAC (Media Access Control) address"},{value:"macaddr8",label:"macaddr8",description:"MAC address (EUI-64 format)"}],geometric:[{value:"point",label:"point",description:"Geometric point on a plane"},{value:"line",label:"line",description:"Infinite line on a plane"},{value:"polygon",label:"polygon",description:"Closed geometric path on a plane"}],other:[{value:"xml",label:"xml",description:"XML data"}]},Qn={numeric:[{value:"double",label:"double",description:"64-bit floating point number"},{value:"int",label:"int",description:"32-bit signed integer"},{value:"long",label:"long",description:"64-bit signed integer"},{value:"decimal",label:"decimal",description:"128-bit decimal value"}],text:[{value:"string",label:"string",description:"UTF-8 string"},{value:"javascript",label:"javascript",description:"JavaScript code"},{value:"javascriptWithScope",label:"javascriptWithScope",description:"JavaScript code with scope"},{value:"symbol",label:"symbol",description:"Symbol (deprecated)"}],boolean:[{value:"bool",label:"bool",description:"Boolean true/false"}],datetime:[{value:"date",label:"date",description:"UTC datetime"},{value:"timestamp",label:"timestamp",description:"MongoDB timestamp"}],document:[{value:"object",label:"object",description:"Embedded document"},{value:"array",label:"array",description:"Array value"},{value:"objectId",label:"objectId",description:"ObjectId value"}],binary:[{value:"binData",label:"binData",description:"Binary data"},{value:"regex",label:"regex",description:"Regular expression"}],legacy:[{value:"undefined",label:"undefined",description:"Undefined (deprecated)"},{value:"dbPointer",label:"dbPointer",description:"DB pointer (deprecated)"}],special:[{value:"null",label:"null",description:"Null value"},{value:"minKey",label:"minKey",description:"Minimum BSON value"},{value:"maxKey",label:"maxKey",description:"Maximum BSON value"}]},Na=["serial","bigserial"],Sa=["int2","int4","int8","float4","float8","numeric","text","varchar","char","uuid","boolean","date","time","timestamp","timestamptz","interval","json","jsonb","bytea","inet","cidr","macaddr","macaddr8"],Pr=[{name:"isNullable",label:"Is Nullable",description:"Specify if the column can assume a NULL value if no value is provided"},{name:"isUnique",label:"Is Unique",description:"Enforce if values in the column should be unique across rows"},{name:"isIdentity",label:"Is Identity",description:"Automatically assign a sequential unique number to the column"},{name:"isArray",label:"Define as Array",description:"Define your column as a variable-length multidimensional array"}],Xi=[{value:"NO ACTION",label:"No action"},{value:"RESTRICT",label:"Restrict"},{value:"CASCADE",label:"Cascade"},{value:"SET NULL",label:"Set null"},{value:"SET DEFAULT",label:"Set default"}],cr=({index:e})=>{const[r,t]=(0,f.useState)(!1),a=Wt()?.dataModel==="document",i=a?Qn:Wn,{control:n,setValue:l,formState:{errors:d}}=Te();return(0,s.jsx)(qe,{control:n,name:`fields.${e}.columnType`,render:({field:m})=>(0,s.jsxs)(qs,{modal:!0,open:r,onOpenChange:t,children:[(0,s.jsx)(Os,{asChild:!0,children:(0,s.jsxs)(ne,{id:`columnType-${e}`,role:"combobox","aria-expanded":r,"aria-controls":`columnType-${e}-listbox`,variant:"outline",className:U("w-full justify-between border-input bg-background px-3 font-normal hover:bg-background",d?.fields?.[e]?.columnType?"border-destructive ring-destructive ring-1":""),children:[m.value||"Select type",(0,s.jsx)(Qa,{"aria-hidden":"true",className:"-me-1 opacity-60",size:16})]})}),(0,s.jsx)(Ls,{id:`columnType-${e}-listbox`,align:"start",className:"w-full min-w-[--radix-popper-anchor-width] border-input p-0",children:(0,s.jsxs)(ua,{children:[(0,s.jsx)(wn,{placeholder:"Search type..."}),(0,s.jsxs)(_n,{children:[(0,s.jsx)(Nn,{children:"No type found."}),Object.entries(i).map(([h,v])=>(0,s.jsx)(Sn,{heading:h,children:v.map(g=>(0,s.jsxs)(An,{value:`${g.label} ${g.description}`,onSelect:()=>{m.onChange(g.value),!a&&Na.includes(g.value)&&l(`fields.${e}.isIdentity`,!1),!a&&g.value&&!Sa.includes(g.value)&&l(`fields.${e}.isArray`,!1),t(!1)},children:[(0,s.jsxs)("div",{className:"flex flex-col gap-1 items-start flex-1",children:[(0,s.jsx)("p",{className:"font-medium",children:g.label}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:g.description})]}),m.value===g.value&&(0,s.jsx)(tt,{className:"ml-auto shrink-0",size:16})]},g.value))},h))]})]})})]})})},$r=(e,r)=>e.flatMap((t,a)=>{const i=r.fields[a];if(!i)return[];const n=i.columnType!==t.dataTypeLabel?{columnType:i.columnType,isNullable:t.isNullable,defaultValue:t.columnDefault}:void 0,l=i.columnName.trim(),d=l!==t.columnName?l:void 0;return n||d!==void 0?[{columnName:t.columnName,alter:n,newColumnName:d}]:[]}),Yn=({tableName:e,schemaName:r})=>{const t=et(),{selectedDatabase:a}=Be(),{mutateAsync:i,isPending:n}=Ze({mutationFn:async d=>{for(const{columnName:m,alter:h,newColumnName:v}of d)h&&await Xr({tableName:e,schemaName:r,columnName:m,data:h,db:a}),v!==void 0&&await Zr({tableName:e,schemaName:r,columnName:m,data:{newColumnName:v},db:a});return d.length},onSettled:async()=>{await Promise.all([t.invalidateQueries({queryKey:xe.columnsByTable(e),exact:!1}),t.invalidateQueries({queryKey:xe.dataByTable(e),exact:!1})])}});return{editTable:d=>rt.promise(i(d),{loading:"Saving table changes...",success:m=>`Updated ${m} ${m===1?"column":"columns"}`,error:m=>typeof m.details=="string"&&m.details||m.message||"Failed to update table"}).unwrap(),isEditingTable:n}},Aa=({tableName:e,schemaName:r})=>{const{selectedDatabase:t}=Be(),{data:a,isLoading:i,isRefetching:n,error:l,refetch:d}=Ba({queryKey:xe.columns(e,t,r),queryFn:()=>Ds(e,t,r),select:m=>m.data.data,enabled:!!e&&!!t});return{tableCols:a,isLoadingTableCols:i,isRefetchingTableCols:n,errorTableCols:l,refetchTableCols:d}},ft=ks()(e=>({editingColumn:null,setEditingColumn:r=>e({editingColumn:r}),editingTable:null,setEditingTable:r=>e({editingTable:r})})),Jn=Ue({fields:Rs(Ue({columnName:Je().trim().min(1,"Column name is required"),columnType:Je()})).superRefine((e,r)=>{const t=new Set;e.forEach((a,i)=>{const n=a.columnName.toLowerCase();t.has(n)&&r.addIssue({code:"custom",message:"Column name must be unique",path:[i,"columnName"]}),t.add(n)})})}),It=e=>({fields:e.map(r=>({columnName:r.columnName,columnType:r.dataTypeLabel}))}),Zi=()=>{const{editingTable:e}=ft();return(0,s.jsx)(Xn,{tableName:e?.tableName??"",schemaName:e?.schemaName},e?`${e.schemaName}.${e.tableName}`:"")},Xn=({tableName:e,schemaName:r})=>{const{openOverlay:t,closeOverlay:a,isOverlayOpen:i}=Ve(),{tableCols:n,isLoadingTableCols:l}=Aa({tableName:e,schemaName:r}),{editTable:d,isEditingTable:m}=Yn({tableName:e,schemaName:r}),h=dr({mode:"onSubmit",defaultValues:It(n??[]),resolver:ur(Jn)}),{handleSubmit:v,watch:g,reset:S}=h;(0,f.useEffect)(()=>{n&&S(It(n),{keepDirtyValues:!0})},[n,S]);const w=g("fields"),R=n!==void 0&&w.length===n.length,z=R?$r(n,{fields:w}):[],I=z.length>0,P=new Map(z.map(p=>[p.columnName,p])),A=()=>a("schema.edit-table"),M=()=>{m||(I?t("schema.edit-table-discard-changes"):A())},j=()=>{S(It(n??[])),a("schema.edit-table-discard-changes"),A()},b=async p=>{if(!n)return;const F=$r(n,p);if(F.length!==0)try{await d(F),S(p),A()}catch{}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Ht,{title:"Edit table",description:e,open:i("schema.edit-table"),onOpenChange:p=>{p||M()},children:n&&n.length>0&&R?(0,s.jsx)(nr,{...h,children:(0,s.jsxs)("form",{onSubmit:v(b),className:"flex flex-col h-full",children:[(0,s.jsx)("div",{className:"-mx-5 -mt-6 divide-y divide-border",children:n.map((p,F)=>(0,s.jsx)(Zn,{col:p,index:F,change:P.get(p.columnName),newColumnName:w[F]?.columnName.trim()??""},p.columnName))}),(0,s.jsxs)("div",{className:"sticky -bottom-6 -mx-5 -mb-6 flex items-center justify-between gap-2 border-t border-border bg-background px-5 py-4",children:[(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:I?`${z.length} ${z.length===1?"column":"columns"} changed`:"No changes"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(ne,{type:"button",variant:"outline",size:"lg",disabled:m,onClick:M,children:"Close"}),(0,s.jsx)(ne,{type:"submit",size:"lg",disabled:m||!I,children:"Save changes"})]})]})]})}):(0,s.jsx)("div",{className:"flex flex-col h-full",children:(0,s.jsx)("div",{className:"space-y-6",children:l||n&&n.length>0?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading columns..."}):(0,s.jsx)(Bs,{variant:"info",title:"No columns found",message:"This table has no columns to edit."})})})}),(0,s.jsx)(Ks,{open:i("schema.edit-table-discard-changes"),onOpenChange:p=>{p||a("schema.edit-table-discard-changes")},children:(0,s.jsxs)(Us,{children:[(0,s.jsxs)($s,{children:[(0,s.jsx)(Gs,{children:"Discard unsaved changes?"}),(0,s.jsx)(Ws,{children:"This table has unsaved column changes. Discard them and close?"})]}),(0,s.jsxs)(Ps,{children:[(0,s.jsx)(Ms,{children:"Keep editing"}),(0,s.jsx)(Hs,{onClick:j,children:"Discard changes"})]})]})})]})},We=({children:e,className:r,title:t})=>(0,s.jsx)("span",{title:t,className:U("truncate rounded border border-border bg-muted/40 px-1.5 font-mono text-[10px] leading-4 text-muted-foreground",r),children:e}),Zn=({col:e,index:r,change:t,newColumnName:a})=>{const{register:i,formState:n}=Te(),l=n.errors.fields?.[r]?.columnName?.message;return(0,s.jsxs)("div",{className:U("grid grid-cols-3 gap-4 px-5 py-3",t&&"bg-primary/5"),children:[(0,s.jsxs)("div",{className:"col-span-1 flex min-w-0 flex-col gap-1.5",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1.5",children:[e.isPrimaryKey?(0,s.jsx)(Ja,{"aria-label":"Primary key",className:"size-3.5 shrink-0 text-amber-500"}):e.isForeignKey?(0,s.jsx)(Ya,{"aria-label":`References ${e.referencedTable}.${e.referencedColumn}`,className:"size-3.5 shrink-0 text-sky-500"}):(0,s.jsx)("span",{className:"size-3.5 shrink-0"}),(0,s.jsx)("span",{className:"truncate font-mono text-sm font-medium",children:e.columnName})]}),(0,s.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-1 pl-5",children:[t?.alter?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(We,{className:"line-through",children:e.dataTypeLabel}),(0,s.jsx)(xr,{className:"size-3 text-muted-foreground"}),(0,s.jsx)(We,{className:"border-primary/40 text-primary",children:t.alter.columnType})]}):(0,s.jsx)(We,{children:e.dataTypeLabel}),!e.isNullable&&(0,s.jsx)(We,{children:"not null"}),e.columnDefault&&(0,s.jsxs)(We,{title:e.columnDefault,className:"max-w-full",children:["default ",e.columnDefault]})]}),t?.newColumnName!==void 0&&(0,s.jsxs)("span",{className:"flex min-w-0 items-center gap-1 pl-5 font-mono text-[11px] text-primary",children:[(0,s.jsx)(xr,{className:"size-3 shrink-0"}),(0,s.jsx)("span",{className:"truncate",children:a})]})]}),(0,s.jsxs)("div",{className:"col-span-2 grid grid-cols-2 items-start gap-2",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)(Le,{"aria-label":`Name of ${e.columnName}`,"aria-invalid":l?!0:void 0,className:"font-mono",...i(`fields.${r}.columnName`)}),l&&(0,s.jsx)("span",{className:"text-xs text-destructive",children:l})]}),(0,s.jsx)(cr,{index:r})]})]})},ei=()=>{const e=et(),{selectedDatabase:r}=Be(),{mutateAsync:t,isPending:a}=Ze({mutationFn:async({tableName:n,schemaName:l,columnName:d,cascade:m})=>(await Vs({tableName:n,schemaName:l,columnName:d,cascade:m,db:r??""})).data.data,onSuccess:async(n,l)=>{await Promise.all([e.invalidateQueries({queryKey:xe.columnsByTable(l.tableName),exact:!1}),e.invalidateQueries({queryKey:xe.dataByTable(l.tableName),exact:!1}),e.invalidateQueries({queryKey:xe.lists(),exact:!1})])}});return{deleteColumn:async({tableName:n,schemaName:l,columnName:d,cascade:m})=>rt.promise(t({tableName:n,schemaName:l,columnName:d,cascade:m,db:""}),{loading:"Deleting column...",success:h=>h||"Column deleted successfully",error:h=>h.message||"Failed to delete column"}),isDeletingColumn:a}},ti=({columnVirtualizer:e,renderCellAccessory:r,row:t,rowVirtualizer:a,virtualPaddingLeft:i,virtualPaddingRight:n,virtualRow:l})=>{const d=t.getVisibleCells(),m=e.getVirtualItems();return(0,s.jsxs)("tr",{"data-index":l.index,ref:h=>a.measureElement(h),className:"flex absolute w-fit border-b items-center text-sm hover:bg-accent/20 data-[state=open]:bg-accent/40 [&_svg]:size-4",style:{transform:`translateY(${l.start}px)`},children:[i?(0,s.jsx)("td",{style:{display:"flex",width:i}}):null,m.map(h=>{const v=d[h.index];return(0,s.jsxs)("td",{className:"group relative flex border-r border-border h-8 items-center px-3 truncate",style:{width:v.column.getSize()},children:[Ur(v.column.columnDef.cell,v.getContext()),r?.(v.getValue())]},v.id)}),n?(0,s.jsx)("td",{style:{display:"flex",width:n}}):null]},t.id)},ri=({columnVirtualizer:e,renderCellAccessory:r,table:t,tableContainerRef:a,virtualPaddingLeft:i,virtualPaddingRight:n})=>{const{rows:l}=t.getRowModel(),d=Lr({count:l.length,estimateSize:()=>33,getScrollElement:()=>a.current,measureElement:typeof window<"u"&&navigator.userAgent.indexOf("Firefox")===-1?h=>h?.getBoundingClientRect().height:void 0,overscan:5}),m=d.getVirtualItems();return(0,s.jsx)("tbody",{style:{display:"grid",height:`${d.getTotalSize()}px`,position:"relative"},children:m.map(h=>{const v=l[h.index];return(0,s.jsx)(ti,{columnVirtualizer:e,renderCellAccessory:r,row:v,rowVirtualizer:d,virtualPaddingLeft:i,virtualPaddingRight:n,virtualRow:h},v.id)})})};function ai({header:e,table:r,label:t}){const a=r._getDefaultColumnDef(),i=(0,f.useCallback)(()=>{r.setColumnSizing(n=>{const l={...n};return delete l[e.column.id],l})},[e.column.id,r]);return(0,s.jsx)("div",{role:"separator","aria-orientation":"vertical","aria-label":`Resize ${t} column`,"aria-valuenow":e.column.getSize(),"aria-valuemin":a.minSize,"aria-valuemax":a.maxSize,tabIndex:0,className:U("after:-translate-x-1/2 -right-px absolute top-0 z-50 h-full w-0.5 cursor-ew-resize touch-none select-none bg-border transition-opacity after:absolute after:inset-y-0 after:left-1/2 after:h-full after:w-[18px] after:content-[''] hover:bg-primary focus:bg-primary focus:outline-none",e.column.getIsResizing()?"bg-primary":"opacity-0 hover:opacity-100"),onDoubleClick:i,onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler()})}var si=(0,f.memo)(ai,(e,r)=>{const t=e.header.column,a=r.header.column;return!(t.getIsResizing()!==a.getIsResizing()||t.getSize()!==a.getSize()||e.label!==r.label)}),ni=({columnVirtualizer:e,table:r,virtualPaddingLeft:t,virtualPaddingRight:a})=>{const i=e.getVirtualItems(),n=r.getState().columnSizingInfo.isResizingColumn;return(0,s.jsx)("thead",{className:"h-9 grid sticky top-0 z-10 supports-backdrop-filter:backdrop-blur-sm",children:r.getHeaderGroups().map(l=>(0,s.jsxs)("tr",{className:U("flex w-fit bg-muted/40 border-b border-border items-center text-sm [&_svg]:size-4",n&&"pointer-events-none"),children:[t?(0,s.jsx)("th",{style:{display:"flex",width:t}}):null,i.map(d=>{const m=l.headers[d.index];return(0,s.jsxs)("th",{className:"relative h-full flex items-center border-r border-border text-xs font-medium text-muted-foreground",style:{width:m.getSize()},children:[(0,s.jsx)("div",{className:"flex w-full h-full items-center px-3",children:Ur(m.column.columnDef.header,m.getContext())}),m.column.getCanResize()&&(0,s.jsx)(si,{header:m,table:r,label:m.column.id})]},m.id)}),a?(0,s.jsx)("th",{style:{display:"flex",width:a}}):null]},l.id))})},ii=({table:e,renderCellAccessory:r})=>{const t=e.getVisibleLeafColumns(),a=(0,f.useRef)(null),i=Lr({count:t.length,estimateSize:m=>t[m].getSize(),getScrollElement:()=>a.current,horizontal:!0,overscan:3}),n=i.getVirtualItems();let l,d;return i&&n?.length&&(l=n[0]?.start??0,d=i.getTotalSize()-(n[n.length-1]?.end??0)),(0,s.jsx)("div",{className:"w-full flex-1 overflow-auto",ref:a,style:{position:"relative"},children:(0,s.jsxs)("table",{style:{display:"grid"},children:[(0,s.jsx)(ni,{columnVirtualizer:i,table:e,virtualPaddingLeft:l,virtualPaddingRight:d}),(0,s.jsx)(ri,{columnVirtualizer:i,renderCellAccessory:r,table:e,tableContainerRef:a,virtualPaddingLeft:l,virtualPaddingRight:d})]})})},li=({columns:e,data:r,renderCellAccessory:t})=>{const a=Ua({data:r,columns:e,getCoreRowModel:$a(),enableColumnResizing:!0,columnResizeMode:"onChange"});return(0,s.jsx)(ii,{table:a,renderCellAccessory:t})},oi=({value:e,className:r})=>{const[t,a]=(0,f.useState)(!1),i=(0,f.useRef)(null);(0,f.useEffect)(()=>()=>{i.current&&window.clearTimeout(i.current)},[]);const n=Qs(e),l=(0,f.useCallback)(async d=>{d.stopPropagation();try{await navigator.clipboard.writeText(n),a(!0)}catch(m){console.error("Failed to copy cell value:",m);return}i.current&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>{a(!1)},1200)},[n]);return n?(0,s.jsx)("button",{type:"button",className:U("absolute right-0.5 top-1/2 inline-flex size-5 -translate-y-1/2 items-center justify-center","text-muted-foreground opacity-0 transition-opacity","hover:text-foreground focus-visible:opacity-100 focus-visible:outline-none","group-hover:opacity-100",r),onClick:l,"aria-label":t?"Copied":"Copy",children:t?(0,s.jsx)(tt,{className:"size-3.5"}):(0,s.jsx)(as,{className:"size-3.5"})}):null},ht=()=>{const e=qa({strict:!1}),r=br.TABLE_SCHEMA in e&&e[br.TABLE_SCHEMA];return typeof r=="string"?r:void 0};function gt({className:e,...r}){return(0,s.jsx)(ms,{"data-slot":"checkbox",className:U("border-input dark:bg-input/20 dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 flex size-4 items-center justify-center rounded-[4px] border transition-shadow group-has-disabled/field:opacity-50 focus-visible:ring-[2px] aria-invalid:ring-[2px] peer relative shrink-0 outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50",e),...r,children:(0,s.jsx)(ps,{"data-slot":"checkbox-indicator",className:"[&>svg]:size-3.5 grid place-content-center text-current transition-none",children:(0,s.jsx)(tt,{})})})}function ka({...e}){return(0,s.jsx)(bs,{"data-slot":"dropdown-menu",...e})}function Va({...e}){return(0,s.jsx)(cs,{"data-slot":"dropdown-menu-trigger",...e})}function Fa({className:e,align:r="start",sideOffset:t=4,...a}){return(0,s.jsx)(ls,{children:(0,s.jsx)(ds,{"data-slot":"dropdown-menu-content",sideOffset:t,align:r,className:U("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-150 data-closed:duration-100 ease-out z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto data-[state=closed]:overflow-hidden",e),...a})})}function di({...e}){return(0,s.jsx)(os,{"data-slot":"dropdown-menu-group",...e})}function zt({className:e,inset:r,variant:t="default",...a}){return(0,s.jsx)(gs,{"data-slot":"dropdown-menu-item","data-inset":r,"data-variant":t,className:U("focus:bg-accent cursor-pointer 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-sm px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 group/dropdown-menu-item relative flex 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",e),...a})}function el({className:e,children:r,checked:t,...a}){return(0,s.jsxs)(ys,{"data-slot":"dropdown-menu-checkbox-item",className:U("focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground min-h-7 gap-2 rounded-sm py-1.5 pr-8 pl-2 text-xs [&_svg:not([class*='size-'])]:size-3.5 relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),checked:t,...a,children:[(0,s.jsx)("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center pointer-events-none","data-slot":"dropdown-menu-checkbox-item-indicator",children:(0,s.jsx)(js,{children:(0,s.jsx)(tt,{})})}),r]})}function ui({className:e,...r}){return(0,s.jsx)(fs,{"data-slot":"dropdown-menu-separator",className:U("bg-border/50 -mx-1 my-1 h-px",e),...r})}function tl({...e}){return(0,s.jsx)(hs,{"data-slot":"dropdown-menu-sub",...e})}function rl({className:e,inset:r,children:t,...a}){return(0,s.jsxs)(us,{"data-slot":"dropdown-menu-sub-trigger","data-inset":r,className:U("focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-sm px-2 py-1 text-xs [&_svg:not([class*='size-'])]:size-3.5 flex cursor-default items-center outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...a,children:[t,(0,s.jsx)(Ga,{className:"ml-auto"})]})}function al({className:e,...r}){return(0,s.jsx)(vs,{"data-slot":"dropdown-menu-sub-content",className:U("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-150 data-closed:duration-100 ease-out z-50 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden",e),...r})}var ci=({index:e,isDisabled:r})=>{const{control:t}=Te(),a=Wt()?.dataModel==="document",i=Se({control:t,name:`fields.${e}.columnType`}),n=Se({control:t,name:`fields.${e}.isPrimaryKey`}),l=Se({control:t,name:`fields.${e}.isNullable`}),d=Se({control:t,name:`fields.${e}.isUnique`}),m=Se({control:t,name:`fields.${e}.isIdentity`}),h=Se({control:t,name:`fields.${e}.isArray`}),v=(0,f.useCallback)(S=>{if(a)switch(S){case"isIdentity":return!1;case"isArray":return!!i&&i!=="array";default:return!0}switch(S){case"isNullable":return!n;case"isIdentity":return!Na.includes(i);case"isArray":return Sa.includes(i);default:return!0}},[a,n,i]),g=(0,f.useMemo)(()=>{const S={isNullable:l,isUnique:d,isIdentity:m,isArray:h};return Pr.filter(w=>v(w.name)?!!S[w.name]:!1).length},[l,d,m,h,v]);return(0,s.jsx)("div",{className:"flex items-end justify-end",children:(0,s.jsxs)(ka,{children:[(0,s.jsx)(Va,{asChild:!0,children:(0,s.jsxs)(ne,{"aria-label":"Advanced options",type:"button",variant:"ghost",size:"icon",disabled:r,className:"size-9 relative",children:[(0,s.jsx)(ns,{className:"size-4"}),g>0&&(0,s.jsx)(Xe,{className:"absolute -top-2 leading-0! left-full -translate-x-1/2 size-5 flex items-center justify-center text-xs",children:g>99?"99+":g})]})}),(0,s.jsx)(Fa,{className:"w-96 space-y-1",side:"bottom",align:"end",children:Pr.map(S=>v(S.name)?(0,s.jsx)(qe,{control:t,name:`fields.${e}.${S.name}`,render:({field:w})=>(0,s.jsxs)(ge,{htmlFor:`${S.name}-${e}`,className:"flex items-start gap-3 rounded-lg p-3 cursor-pointer hover:bg-accent/50 has-checked:bg-primary-foreground has-checked:border-blue-600",children:[(0,s.jsx)(gt,{id:`${S.name}-${e}`,checked:!!w.value,onCheckedChange:R=>w.onChange(!!R),className:"data-[state=checked]:bg-blue-600 data-[state=checked]:border-blue-600",type:"button"}),(0,s.jsxs)("div",{className:"grid gap-1.5 font-normal",children:[(0,s.jsx)("p",{className:"text-sm leading-none font-medium",children:S.label}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:S.description})]})]})},S.name):null)})]})})},mi=({index:e,showForeignKeyButton:r=!0})=>{const{openOverlay:t}=Ve(),{control:a,register:i,formState:{errors:n},watch:l}=Te(),d=r?l(`foreignKeys.${e}.referencedTable`):void 0,m=()=>{t(`table-builder.add-foreign-key-${e}`)};return(0,s.jsx)(qe,{control:a,name:`fields.${e}.columnName`,render:()=>(0,s.jsxs)("div",{className:"flex",children:[(0,s.jsx)(Le,{id:`fields.${e}.columnName`,...i(`fields.${e}.columnName`,{required:"Column name is required"}),placeholder:"column_name",className:U(r?"-me-px flex-1 rounded-e-none shadow-none focus-visible:z-10":"flex-1",n?.fields?.[e]?.columnName?"border-destructive ring-destructive ring-1":"")}),r&&(0,s.jsx)("button",{"aria-label":"Generate column name",className:U("inline-flex w-7 h-7 items-center justify-center rounded-e-md border border-input bg-background text-muted-foreground/80 text-sm outline-none transition-[color,box-shadow] hover:text-accent-foreground focus:z-10 focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",d?"":"border-dashed"),type:"button",onClick:m,children:(0,s.jsx)(Br,{"aria-hidden":"true",className:"size-3"})})]})})},Da=({index:e,isRequired:r=!0})=>{const{control:t,register:a,formState:{errors:i}}=Te();return(0,s.jsx)(qe,{control:t,name:`fields.${e}.defaultValue`,render:()=>(0,s.jsx)("div",{className:"flex flex-col gap-2",children:(0,s.jsx)(Le,{id:`fields.${e}.defaultValue`,...a(`fields.${e}.defaultValue`,r?{required:"Default value is required"}:void 0),placeholder:"NULL",className:i?.fields?.[e]?.defaultValue?"border-destructive ring-destructive ring-1":""})})})},fi=({index:e})=>{const{watch:r,control:t,register:a,setValue:i}=Te(),n=r(`fields.${e}.isPrimaryKey`);return(0,s.jsx)(qe,{control:t,name:`fields.${e}.isPrimaryKey`,render:()=>(0,s.jsx)("div",{className:"flex flex-1 items-center justify-start",children:(0,s.jsx)(gt,{id:`fields.${e}.isPrimaryKey`,...a(`fields.${e}.isPrimaryKey`),onCheckedChange:l=>{i(`fields.${e}.isPrimaryKey`,!!l),i(`fields.${e}.isNullable`,!1)},checked:n,className:"size-5"})})})},hi=e=>({...e,defaultValue:e.defaultValue?.trim()?e.defaultValue.trim():void 0}),gi=({tableName:e,schemaName:r})=>{const t=et(),{closeOverlay:a}=Ve(),{selectedDatabase:i,dbType:n}=Be(),{mutateAsync:l,isPending:d}=Ze({mutationFn:async h=>(await Fs({tableName:e,schemaName:r,data:hi(h),db:i})).data.data,onSuccess:async()=>{await Promise.all([t.invalidateQueries({queryKey:xe.columnsByTable(e),exact:!1}),t.invalidateQueries({queryKey:xe.dataByTable(e),exact:!1})]),a("schema.add-column"),n&&Is.capture("column_added",{db_type:n})}});return{addColumn:async(h,v)=>rt.promise(l(h,v),{loading:"Adding column...",success:g=>g||"Column added successfully",error:g=>typeof g.details=="string"&&g.details||g.message||"Failed to add column"}),isAddingColumn:d}},vi=Ue({fields:ea([Ue({columnName:Cr.shape.columnName,columnType:Cr.shape.columnType,defaultValue:Je(),isPrimaryKey:je(),isNullable:je(),isUnique:je(),isIdentity:je(),isArray:je()})])}),Ot={fields:[{columnName:"",columnType:"",defaultValue:"",isPrimaryKey:!1,isNullable:!0,isUnique:!1,isIdentity:!1,isArray:!1}]},pi=()=>{const e=Te(),r=Se({control:e.control,name:"fields.0.isPrimaryKey"});return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"grid grid-cols-4 px-2",children:[(0,s.jsx)(ge,{className:"text-xs",children:"Column Name"}),(0,s.jsx)(ge,{className:"text-xs",children:"Column Type"}),(0,s.jsx)(ge,{className:"text-xs",children:"Default Value"}),(0,s.jsx)(ge,{className:"text-xs",children:"Primary"})]}),(0,s.jsx)("div",{className:"px-2 py-3",children:(0,s.jsxs)("div",{className:"grid grid-cols-4 gap-4",children:[(0,s.jsx)(mi,{index:0,showForeignKeyButton:!1}),(0,s.jsx)(cr,{index:0}),(0,s.jsx)(Da,{index:0,isRequired:!1}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(fi,{index:0}),(0,s.jsx)(ci,{index:0,isDisabled:!!r})]})]})})]})},yi=({tableName:e})=>{const{closeOverlay:r,isOverlayOpen:t}=Ve(),{addColumn:a,isAddingColumn:i}=gi({tableName:e,schemaName:ht()}),n=dr({mode:"onSubmit",defaultValues:Ot,resolver:ur(vi)}),l=()=>{n.reset(Ot),r("schema.add-column")},d=async m=>{await a(m.fields[0]),n.reset(Ot)};return(0,s.jsx)(Ht,{title:"Add column",description:`Add a new column to "${e}".`,open:t("schema.add-column"),onOpenChange:m=>{m||l()},children:(0,s.jsx)(nr,{...n,children:(0,s.jsxs)("form",{onSubmit:n.handleSubmit(d),className:"space-y-6",children:[(0,s.jsx)(pi,{}),(0,s.jsx)(_a,{onCancel:l,isLoading:i})]})})})},xi=e=>({...e,defaultValue:e.defaultValue?.trim()?e.defaultValue.trim():null}),bi=({tableName:e,schemaName:r,columnName:t})=>{const a=et(),{closeOverlay:i}=Ve(),{setEditingColumn:n}=ft(),{selectedDatabase:l}=Be(),{mutateAsync:d,isPending:m}=Ze({mutationFn:async v=>(await Xr({tableName:e,schemaName:r,columnName:t,data:xi(v),db:l})).data.data,onSuccess:async()=>{await a.invalidateQueries({queryKey:xe.columnsByTable(e),exact:!1}),n(null),i("schema.edit-column")}});return{alterColumn:async(v,g)=>rt.promise(d(v,g),{loading:"Updating column...",success:S=>S||"Column updated successfully",error:S=>typeof S.details=="string"&&S.details||S.message||"Failed to update column"}),isAlteringColumn:m}},Ci=Ue({fields:ea([Ue({columnName:Je(),columnType:jr.shape.columnType,defaultValue:Je(),isPrimaryKey:je(),isNullable:jr.shape.isNullable,isUnique:je(),isIdentity:je(),isArray:je()})])}),nt=e=>({fields:[{columnName:e?.columnName??"",columnType:e?.dataTypeLabel??"",defaultValue:e?.columnDefault??"",isPrimaryKey:!1,isNullable:e?.isNullable??!0,isUnique:!1,isIdentity:!1,isArray:e?.dataType==="array"}]}),ji=({tableName:e})=>{const{closeOverlay:r,isOverlayOpen:t}=Ve(),{editingColumn:a,setEditingColumn:i}=ft(),n=dr({mode:"onSubmit",defaultValues:nt(null),resolver:ur(Ci)}),{alterColumn:l,isAlteringColumn:d}=bi({tableName:e,schemaName:ht(),columnName:a?.columnName??""});(0,f.useEffect)(()=>{n.reset(nt(a))},[a,n]);const m=()=>{i(null),n.reset(nt(null)),r("schema.edit-column")},h=async v=>{await l({columnType:v.fields[0].columnType,isNullable:v.fields[0].isNullable,defaultValue:v.fields[0].defaultValue}),n.reset(nt(null))};return(0,s.jsx)(Ht,{title:a?`Edit ${a.columnName}`:"Edit column",description:a?`Update the type, nullability, and default value for "${a.columnName}".`:"Update the selected column.",open:t("schema.edit-column"),onOpenChange:v=>{v||m()},children:(0,s.jsx)(nr,{...n,children:(0,s.jsxs)("form",{onSubmit:n.handleSubmit(h),className:"space-y-6",children:[(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(ge,{htmlFor:"edit-column-name",children:"Column name"}),(0,s.jsx)(Le,{id:"edit-column-name",value:a?.columnName??"",readOnly:!0,disabled:!0})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(ge,{children:"Column type"}),(0,s.jsx)(cr,{index:0})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(ge,{children:"Default value"}),(0,s.jsx)(Da,{index:0,isRequired:!1})]}),(0,s.jsx)(qe,{control:n.control,name:"fields.0.isNullable",render:({field:v})=>(0,s.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border p-3",children:[(0,s.jsx)(gt,{id:"edit-column-nullable",checked:!!v.value,onCheckedChange:g=>v.onChange(g===!0)}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)(ge,{htmlFor:"edit-column-nullable",className:"cursor-pointer",children:"Nullable"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Allow this column to store NULL values."})]})]})})]}),(0,s.jsx)(_a,{onCancel:m,isLoading:d})]})})})},wi=({tableName:e,schemaName:r,columnName:t})=>{const a=et(),{selectedDatabase:i}=Be(),{mutateAsync:n,isPending:l}=Ze({mutationFn:async m=>(await Zr({tableName:e,schemaName:r,columnName:t,data:m,db:i})).data.data,onSuccess:async()=>{await Promise.all([a.invalidateQueries({queryKey:xe.columnsByTable(e),exact:!1}),a.invalidateQueries({queryKey:xe.dataByTable(e),exact:!1})])}});return{renameColumn:async(m,h)=>rt.promise(n(m,h),{loading:"Renaming column...",success:v=>v||"Column renamed successfully",error:v=>typeof v.details=="string"&&v.details||v.message||"Failed to rename column"}),isRenamingColumn:l}},_i=({col:e,tableName:r})=>{const{openOverlay:t}=Ve(),{setEditingColumn:a}=ft(),i=ht(),{renameColumn:n,isRenamingColumn:l}=wi({tableName:r,schemaName:i,columnName:e.columnName}),{deleteColumn:d,isDeletingColumn:m}=ei(),[h,v]=(0,f.useState)(!1),[g,S]=(0,f.useState)(!1),[w,R]=(0,f.useState)(e.columnName),[z,I]=(0,f.useState)(!1),P=()=>{a(e),t("schema.edit-column")},A=p=>{v(p),p||R(e.columnName)},M=p=>{S(p),p||I(!1)},j=async()=>{await n({newColumnName:w.trim()}),A(!1)},b=async()=>{await d({db:"",tableName:r,schemaName:i,columnName:e.columnName,cascade:z}),M(!1)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(ka,{children:[(0,s.jsx)(Va,{asChild:!0,children:(0,s.jsx)(ne,{variant:"ghost",size:"icon-sm",children:(0,s.jsx)(Za,{className:"size-4"})})}),(0,s.jsx)(Fa,{align:"end",className:"w-48",children:(0,s.jsxs)(di,{children:[(0,s.jsxs)(zt,{onClick:P,children:[(0,s.jsx)(Ka,{className:"size-4"}),"Edit Column"]}),(0,s.jsxs)(zt,{onClick:()=>A(!0),children:[(0,s.jsx)(ts,{className:"size-4"}),"Rename Column"]}),(0,s.jsx)(ui,{}),(0,s.jsxs)(zt,{variant:"destructive",onClick:()=>M(!0),children:[(0,s.jsx)(Xa,{className:"size-4"}),"Drop Column"]})]})})]}),(0,s.jsx)(Ni,{columnName:e.columnName,newColumnName:w,setNewColumnName:R,isOpen:h,onOpenChange:A,onRename:j,isRenaming:l}),(0,s.jsx)(Si,{columnName:e.columnName,isOpen:g,onOpenChange:M,cascadeDelete:z,setCascadeDelete:I,onDrop:b,isDropping:m})]})},Ni=({columnName:e,newColumnName:r,setNewColumnName:t,isOpen:a,onOpenChange:i,onRename:n,isRenaming:l})=>{const d=!r.trim()||r.trim()===e;return(0,s.jsx)(Yt,{open:a,onOpenChange:i,children:(0,s.jsxs)(Jt,{className:"max-w-md",children:[(0,s.jsxs)(Xt,{children:[(0,s.jsx)(Zt,{children:"Rename Column"}),(0,s.jsx)(er,{children:"Update the column name while keeping the rest of the schema unchanged."})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(ge,{htmlFor:"current-column-name",children:"Current name"}),(0,s.jsx)(Le,{id:"current-column-name",value:e,readOnly:!0,disabled:!0})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(ge,{htmlFor:"new-column-name",children:"New name"}),(0,s.jsx)(Le,{id:"new-column-name",value:r,onChange:m=>t(m.target.value),placeholder:"column_name",autoFocus:!0})]})]}),(0,s.jsxs)(da,{className:"gap-2",children:[(0,s.jsx)(ne,{variant:"outline",onClick:()=>i(!1),disabled:l,children:"Cancel"}),(0,s.jsx)(ne,{onClick:n,disabled:d||l,children:l?"Renaming...":"Rename Column"})]})]})})},Si=({columnName:e,isOpen:r,onOpenChange:t,cascadeDelete:a,setCascadeDelete:i,onDrop:n,isDropping:l})=>(0,s.jsx)(Yt,{open:r,onOpenChange:t,children:(0,s.jsxs)(Jt,{className:"max-w-md",children:[(0,s.jsxs)(Xt,{children:[(0,s.jsx)(Zt,{children:"Drop Column"}),(0,s.jsxs)(er,{children:["Are you sure you want to drop the column"," ",(0,s.jsxs)("span",{className:"font-semibold text-foreground",children:['"',e,'"']}),"? This action cannot be undone and permanently removes the data stored in it."]})]}),(0,s.jsxs)("div",{className:"flex gap-3 rounded-lg border border-border p-3",children:[(0,s.jsx)(gt,{id:`drop-column-cascade-${e}`,checked:a,onCheckedChange:d=>i(d===!0)}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)(ge,{htmlFor:`drop-column-cascade-${e}`,className:"cursor-pointer",children:"Drop with CASCADE"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Also remove dependent indexes, constraints, and foreign key references."})]})]}),(0,s.jsxs)(da,{className:"gap-2",children:[(0,s.jsx)(ne,{variant:"outline",onClick:()=>t(!1),disabled:l,children:"Cancel"}),(0,s.jsx)(ne,{variant:"destructive",onClick:n,disabled:l,children:l?"Dropping...":"Drop Column"})]})]})}),Ai=()=>{const e=Wt();return e!==void 0&&e.dataModel!=="relational"},ki=({tableName:e,refetch:r,isRefetching:t=!1})=>{const{openOverlay:a}=Ve(),i=Ai();return(0,s.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,s.jsx)(ne,{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:()=>{r()},"aria-label":`Refetch schema for ${e}`,disabled:t,children:(0,s.jsx)(Wa,{className:"size-4"})}),(0,s.jsx)(ne,{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,s.jsxs)(La,{to:"/table/$table",params:{table:e},"aria-label":`View data for ${e}`,children:[(0,s.jsx)(rs,{className:"size-4"}),"View data"]})}),!i&&(0,s.jsxs)(ne,{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:()=>a("schema.add-column"),children:[(0,s.jsx)(Ha,{className:"size-4"}),"Add Column"]})]})},Vi=({col:e})=>e.dataTypeLabel==="enum"&&e.enumValues&&e.enumValues.length>0?(0,s.jsxs)(Qr,{children:[(0,s.jsx)(Yr,{asChild:!0,children:(0,s.jsx)(Xe,{variant:"outline",className:"font-mono cursor-default truncate",children:e.dataTypeLabel})}),(0,s.jsx)(Jr,{side:"right",children:(0,s.jsxs)("div",{className:"text-xs space-y-0.5",children:[(0,s.jsx)("p",{className:"text-muted-foreground mb-1",children:"Enum values:"}),e.enumValues.map(r=>(0,s.jsx)("p",{className:"font-mono",children:r},r))]})})]}):(0,s.jsx)(Xe,{variant:"outline",className:"font-mono",children:e.dataTypeLabel}),sl=({tableName:e})=>{const{tableCols:r,isLoadingTableCols:t,isRefetchingTableCols:a,errorTableCols:i,refetchTableCols:n}=Aa({tableName:e,schemaName:ht()}),l=(0,f.useMemo)(()=>[{id:"index",header:"",cell:({row:d})=>(0,s.jsx)("span",{className:"text-xs text-muted-foreground/60",children:d.index+1}),size:47,minSize:47,enableResizing:!1},{id:"columnName",header:"Name",accessorKey:"columnName",cell:({getValue:d})=>(0,s.jsx)("span",{className:"font-mono text-foreground font-medium truncate",children:d()}),minSize:100,size:200},{id:"dataTypeLabel",header:"Type",cell:({row:d})=>(0,s.jsx)(Vi,{col:d.original}),size:100,minSize:100},{id:"columnDefault",header:"Default",accessorKey:"columnDefault",cell:({getValue:d})=>{const m=d();return m?(0,s.jsx)("span",{className:"font-mono text-xs text-muted-foreground truncate",children:m}):(0,s.jsx)("span",{className:"text-muted-foreground/50",children:"—"})},minSize:100,size:180},{id:"isNullable",header:"Nullable",accessorKey:"isNullable",cell:({getValue:d})=>d()?(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:"yes"}):(0,s.jsx)("span",{className:"text-xs text-muted-foreground/50",children:"no"}),minSize:100},{id:"key",header:"Key",cell:({row:d})=>{const{isPrimaryKey:m,isForeignKey:h}=d.original;return(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[m&&(0,s.jsx)(Xe,{variant:"default",className:"text-[0.6rem] px-1.5",children:"PK"}),h&&(0,s.jsx)(Xe,{variant:"secondary",className:"text-[0.6rem] px-1.5",children:"FK"})]})},minSize:100,size:90},{id:"references",header:"References",cell:({row:d})=>{const{isForeignKey:m,referencedTable:h,referencedColumn:v}=d.original;return!m||!h||!v?(0,s.jsx)("span",{className:"text-muted-foreground/50",children:"—"}):(0,s.jsxs)(Qr,{children:[(0,s.jsx)(Yr,{asChild:!0,children:(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground cursor-default",children:[(0,s.jsx)(Br,{className:"size-3 text-muted-foreground/70"}),(0,s.jsxs)("span",{className:"font-mono",children:[h,".",v]})]})}),(0,s.jsx)(Jr,{side:"left",children:(0,s.jsxs)("p",{children:["References"," ",(0,s.jsxs)("span",{className:"font-mono font-medium",children:[h,".",v]})]})})]})},size:160,minSize:100},{id:"actions",header:"",cell:({row:d})=>(0,s.jsx)("div",{className:"flex justify-center items-center",children:(0,s.jsx)(_i,{col:d.original,tableName:e})}),size:50,enableResizing:!1}],[e]);return t?(0,s.jsx)("div",{className:"size-full flex items-center justify-center",children:(0,s.jsx)(_s,{size:"size-7"})}):i?(0,s.jsxs)("div",{className:"size-full flex flex-col items-center justify-center gap-2",children:[(0,s.jsx)("div",{className:"text-sm font-medium",children:"Failed to load schema"}),(0,s.jsx)("div",{className:"text-sm text-muted-foreground",children:i.message})]}):(0,s.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden",children:[(0,s.jsx)(ki,{tableName:e,refetch:n,isRefetching:a}),(0,s.jsx)(li,{columns:l,data:r??[],renderCellAccessory:d=>(0,s.jsx)(oi,{value:d})}),(0,s.jsx)(yi,{tableName:e}),(0,s.jsx)(ji,{tableName:e})]})};export{nr as A,An as B,ft as C,_a as D,Xi as E,ua as F,Jt as G,Qi as H,Wi as I,Xt as J,er as K,Nn as L,dr as M,Te as N,ur as O,Se as P,Sn as R,Zi as S,cr as T,Yi as U,_n as V,Yt as W,Zt as Y,gt as _,mi as a,li as b,Fa as c,ui as d,tl as f,el as g,Va as h,Da as i,Ji as j,qe as k,di as l,rl as m,Ai as n,ci as o,al as p,da as q,fi as r,ka as s,sl as t,zt as u,ht as v,Aa as w,ei as x,oi as y,wn as z};
@@ -1 +1 @@
1
- import{jt as n}from"./radix-ui-41WpuKNR.js";import"./index-DlECfzV9.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@2.0.0"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d0b8c0fa-68b2-4d09-81e2-f78883fde663",e._sentryDebugIdIdentifier="sentry-dbid-d0b8c0fa-68b2-4d09-81e2-f78883fde663")}catch{}})();var d=n();function s(){return(0,d.jsx)("main",{className:"flex-1 flex items-center justify-center",children:"Select a table to view its schema"})}export{s as component};
1
+ import{jt as n}from"./radix-ui-CxCv--D1.js";import"./index-WFVurGCI.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@2.1.0"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d0b8c0fa-68b2-4d09-81e2-f78883fde663",e._sentryDebugIdIdentifier="sentry-dbid-d0b8c0fa-68b2-4d09-81e2-f78883fde663")}catch{}})();var d=n();function s(){return(0,d.jsx)("main",{className:"flex-1 flex items-center justify-center",children:"Select a table to view its schema"})}export{s 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@2.0.0"};var o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="62a5a8e7-1465-4492-988f-c0e1e6de8317",e._sentryDebugIdIdentifier="sentry-dbid-62a5a8e7-1465-4492-988f-c0e1e6de8317")}catch{}})();var t={comments:{lineComment:";",blockComment:["#|","|#"]},brackets:[["(",")"],["{","}"],["[","]"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}]},s={defaultToken:"",ignoreCase:!0,tokenPostfix:".scheme",brackets:[{open:"(",close:")",token:"delimiter.parenthesis"},{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"}],keywords:["case","do","let","loop","if","else","when","cons","car","cdr","cond","lambda","lambda*","syntax-rules","format","set!","quote","eval","append","list","list?","member?","load"],constants:["#t","#f"],operators:["eq?","eqv?","equal?","and","or","not","null?"],tokenizer:{root:[[/#[xXoObB][0-9a-fA-F]+/,"number.hex"],[/[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?/,"number.float"],[/(?:\b(?:(define|define-syntax|define-macro))\b)(\s+)((?:\w|\-|\!|\?)*)/,["keyword","white","variable"]],{include:"@whitespace"},{include:"@strings"},[/[a-zA-Z_#][a-zA-Z0-9_\-\?\!\*]*/,{cases:{"@keywords":"keyword","@constants":"constant","@operators":"operators","@default":"identifier"}}]],comment:[[/[^\|#]+/,"comment"],[/#\|/,"comment","@push"],[/\|#/,"comment","@pop"],[/[\|#]/,"comment"]],whitespace:[[/[ \t\r\n]+/,"white"],[/#\|/,"comment","@comment"],[/;.*$/,"comment"]],strings:[[/"$/,"string","@popall"],[/"(?=.)/,"string","@multiLineString"]],multiLineString:[[/[^\\"]+$/,"string","@popall"],[/[^\\"]+/,"string"],[/\\./,"string.escape"],[/"/,"string","@popall"],[/\\$/,"string"]]}};export{t 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@2.1.0"};var o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="62a5a8e7-1465-4492-988f-c0e1e6de8317",e._sentryDebugIdIdentifier="sentry-dbid-62a5a8e7-1465-4492-988f-c0e1e6de8317")}catch{}})();var t={comments:{lineComment:";",blockComment:["#|","|#"]},brackets:[["(",")"],["{","}"],["[","]"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}]},s={defaultToken:"",ignoreCase:!0,tokenPostfix:".scheme",brackets:[{open:"(",close:")",token:"delimiter.parenthesis"},{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"}],keywords:["case","do","let","loop","if","else","when","cons","car","cdr","cond","lambda","lambda*","syntax-rules","format","set!","quote","eval","append","list","list?","member?","load"],constants:["#t","#f"],operators:["eq?","eqv?","equal?","and","or","not","null?"],tokenizer:{root:[[/#[xXoObB][0-9a-fA-F]+/,"number.hex"],[/[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?/,"number.float"],[/(?:\b(?:(define|define-syntax|define-macro))\b)(\s+)((?:\w|\-|\!|\?)*)/,["keyword","white","variable"]],{include:"@whitespace"},{include:"@strings"},[/[a-zA-Z_#][a-zA-Z0-9_\-\?\!\*]*/,{cases:{"@keywords":"keyword","@constants":"constant","@operators":"operators","@default":"identifier"}}]],comment:[[/[^\|#]+/,"comment"],[/#\|/,"comment","@push"],[/\|#/,"comment","@pop"],[/[\|#]/,"comment"]],whitespace:[[/[ \t\r\n]+/,"white"],[/#\|/,"comment","@comment"],[/;.*$/,"comment"]],strings:[[/"$/,"string","@popall"],[/"(?=.)/,"string","@multiLineString"]],multiLineString:[[/[^\\"]+$/,"string","@popall"],[/[^\\"]+/,"string"],[/\\./,"string.escape"],[/"/,"string","@popall"],[/\\$/,"string"]]}};export{t as conf,s as language};
@@ -1,3 +1,3 @@
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@2.0.0"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9a4d2056-d92f-453a-ad9c-56c36fef6b66",e._sentryDebugIdIdentifier="sentry-dbid-9a4d2056-d92f-453a-ad9c-56c36fef6b66")}catch{}})();var o={wordPattern:/(#?-?\d*\.\d\w*%?)|([@$#!.:]?[\w-?]+%?)|[@#!.]/g,comments:{blockComment:["/*","*/"],lineComment:"//"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}",notIn:["string","comment"]},{open:"[",close:"]",notIn:["string","comment"]},{open:"(",close:")",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/"),end:new RegExp("^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/")}}},i={defaultToken:"",tokenPostfix:".scss",ws:`[
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@2.1.0"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9a4d2056-d92f-453a-ad9c-56c36fef6b66",e._sentryDebugIdIdentifier="sentry-dbid-9a4d2056-d92f-453a-ad9c-56c36fef6b66")}catch{}})();var o={wordPattern:/(#?-?\d*\.\d\w*%?)|([@$#!.:]?[\w-?]+%?)|[@#!.]/g,comments:{blockComment:["/*","*/"],lineComment:"//"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}",notIn:["string","comment"]},{open:"[",close:"]",notIn:["string","comment"]},{open:"(",close:")",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/"),end:new RegExp("^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/")}}},i={defaultToken:"",tokenPostfix:".scss",ws:`[
2
2
  \r\f]*`,identifier:"-?-?([a-zA-Z]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))([\\w\\-]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))*",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.bracket"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],tokenizer:{root:[{include:"@selector"}],selector:[{include:"@comments"},{include:"@import"},{include:"@variabledeclaration"},{include:"@warndebug"},["[@](include)",{token:"keyword",next:"@includedeclaration"}],["[@](keyframes|-webkit-keyframes|-moz-keyframes|-o-keyframes)",{token:"keyword",next:"@keyframedeclaration"}],["[@](page|content|font-face|-moz-document)",{token:"keyword"}],["[@](charset|namespace)",{token:"keyword",next:"@declarationbody"}],["[@](function)",{token:"keyword",next:"@functiondeclaration"}],["[@](mixin)",{token:"keyword",next:"@mixindeclaration"}],["url(\\-prefix)?\\(",{token:"meta",next:"@urldeclaration"}],{include:"@controlstatement"},{include:"@selectorname"},["[&\\*]","tag"],["[>\\+,]","delimiter"],["\\[",{token:"delimiter.bracket",next:"@selectorattribute"}],["{",{token:"delimiter.curly",next:"@selectorbody"}]],selectorbody:[["[*_]?@identifier@ws:(?=(\\s|\\d|[^{;}]*[;}]))","attribute.name","@rulevalue"],{include:"@selector"},["[@](extend)",{token:"keyword",next:"@extendbody"}],["[@](return)",{token:"keyword",next:"@declarationbody"}],["}",{token:"delimiter.curly",next:"@pop"}]],selectorname:[["#{",{token:"meta",next:"@variableinterpolation"}],["(\\.|#(?=[^{])|%|(@identifier)|:)+","tag"]],selectorattribute:[{include:"@term"},["]",{token:"delimiter.bracket",next:"@pop"}]],term:[{include:"@comments"},["url(\\-prefix)?\\(",{token:"meta",next:"@urldeclaration"}],{include:"@functioninvocation"},{include:"@numbers"},{include:"@strings"},{include:"@variablereference"},["(and\\b|or\\b|not\\b)","operator"],{include:"@name"},["([<>=\\+\\-\\*\\/\\^\\|\\~,])","operator"],[",","delimiter"],["!default","literal"],["\\(",{token:"delimiter.parenthesis",next:"@parenthizedterm"}]],rulevalue:[{include:"@term"},["!important","literal"],[";","delimiter","@pop"],["{",{token:"delimiter.curly",switchTo:"@nestedproperty"}],["(?=})",{token:"",next:"@pop"}]],nestedproperty:[["[*_]?@identifier@ws:","attribute.name","@rulevalue"],{include:"@comments"},["}",{token:"delimiter.curly",next:"@pop"}]],warndebug:[["[@](warn|debug)",{token:"keyword",next:"@declarationbody"}]],import:[["[@](import)",{token:"keyword",next:"@declarationbody"}]],variabledeclaration:[["\\$@identifier@ws:","variable.decl","@declarationbody"]],urldeclaration:[{include:"@strings"},[`[^)\r
3
3
  ]+`,"string"],["\\)",{token:"meta",next:"@pop"}]],parenthizedterm:[{include:"@term"},["\\)",{token:"delimiter.parenthesis",next:"@pop"}]],declarationbody:[{include:"@term"},[";","delimiter","@pop"],["(?=})",{token:"",next:"@pop"}]],extendbody:[{include:"@selectorname"},["!optional","literal"],[";","delimiter","@pop"],["(?=})",{token:"",next:"@pop"}]],variablereference:[["\\$@identifier","variable.ref"],["\\.\\.\\.","operator"],["#{",{token:"meta",next:"@variableinterpolation"}]],variableinterpolation:[{include:"@variablereference"},["}",{token:"meta",next:"@pop"}]],comments:[["\\/\\*","comment","@comment"],["\\/\\/+.*","comment"]],comment:[["\\*\\/","comment","@pop"],[".","comment"]],name:[["@identifier","attribute.value"]],numbers:[["(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?",{token:"number",next:"@units"}],["#[0-9a-fA-F_]+(?!\\w)","number.hex"]],units:[["(em|ex|ch|rem|fr|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?","number","@pop"]],functiondeclaration:[["@identifier@ws\\(",{token:"meta",next:"@parameterdeclaration"}],["{",{token:"delimiter.curly",switchTo:"@functionbody"}]],mixindeclaration:[["@identifier@ws\\(",{token:"meta",next:"@parameterdeclaration"}],["@identifier","meta"],["{",{token:"delimiter.curly",switchTo:"@selectorbody"}]],parameterdeclaration:[["\\$@identifier@ws:","variable.decl"],["\\.\\.\\.","operator"],[",","delimiter"],{include:"@term"},["\\)",{token:"meta",next:"@pop"}]],includedeclaration:[{include:"@functioninvocation"},["@identifier","meta"],[";","delimiter","@pop"],["(?=})",{token:"",next:"@pop"}],["{",{token:"delimiter.curly",switchTo:"@selectorbody"}]],keyframedeclaration:[["@identifier","meta"],["{",{token:"delimiter.curly",switchTo:"@keyframebody"}]],keyframebody:[{include:"@term"},["{",{token:"delimiter.curly",next:"@selectorbody"}],["}",{token:"delimiter.curly",next:"@pop"}]],controlstatement:[["[@](if|else|for|while|each|media)",{token:"keyword.flow",next:"@controlstatementdeclaration"}]],controlstatementdeclaration:[["(in|from|through|if|to)\\b",{token:"keyword.flow"}],{include:"@term"},["{",{token:"delimiter.curly",switchTo:"@selectorbody"}]],functionbody:[["[@](return)",{token:"keyword"}],{include:"@variabledeclaration"},{include:"@term"},{include:"@controlstatement"},[";","delimiter"],["}",{token:"delimiter.curly",next:"@pop"}]],functioninvocation:[["@identifier\\(",{token:"meta",next:"@functionarguments"}]],functionarguments:[["\\$@identifier@ws:","attribute.name"],["[,]","delimiter"],{include:"@term"},["\\)",{token:"meta",next:"@pop"}]],strings:[['~?"',{token:"string.delimiter",next:"@stringenddoublequote"}],["~?'",{token:"string.delimiter",next:"@stringendquote"}]],stringenddoublequote:[["\\\\.","string"],['"',{token:"string.delimiter",next:"@pop"}],[".","string"]],stringendquote:[["\\\\.","string"],["'",{token:"string.delimiter",next:"@pop"}],[".","string"]]}};export{o as conf,i as language};
@@ -1 +1 @@
1
- import{Ct as i,St as d,_t as l,yt as c}from"./icons-D72QQyd5.js";import{$ as u,Q as f,at as p,ct as g,et as m,it as x,jt as v,lt as b,nt as h,ot as j,rt as w,st as y,tt as _}from"./radix-ui-41WpuKNR.js";import{t as n}from"./utils-Cr2_fSDl.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@2.0.0"};var a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="adad8fb6-e14c-49ff-beeb-21c71cf73d4f",e._sentryDebugIdIdentifier="sentry-dbid-adad8fb6-e14c-49ff-beeb-21c71cf73d4f")}catch{}})();var t=v();function C({...e}){return(0,t.jsx)(x,{"data-slot":"select",...e})}function D({...e}){return(0,t.jsx)(g,{"data-slot":"select-value",...e})}function T({className:e,size:a="default",variant:s="default",children:r,...o}){return(0,t.jsxs)(y,{"data-slot":"select-trigger","data-size":a,"data-variant":s,className:n("border-input data-[placeholder]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-sm border px-2 py-1.5 text-xs/relaxed transition-colors focus-visible:ring-[2px] aria-invalid:ring-[2px] data-[size=default]:h-7 data-[size=sm]:h-6 *:data-[slot=select-value]:flex *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-3.5 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0",s==="default"&&"bg-input/20 dark:bg-input/30 dark:hover:bg-input/50",s==="outline"&&"bg-transparent",e),...o,children:[r,(0,t.jsx)(u,{asChild:!0,children:(0,t.jsx)(l,{className:"text-muted-foreground size-3.5 pointer-events-none"})})]})}function E({className:e,children:a,position:s="item-aligned",align:r="center",...o}){return(0,t.jsx)(w,{children:(0,t.jsxs)(f,{"data-slot":"select-content",className:n("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 min-w-32 rounded-lg shadow-md ring-1 duration-150 data-closed:duration-100 ease-out relative z-50 max-h-(--radix-select-content-available-height) origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto",s==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:s,align:r,...o,children:[(0,t.jsx)(z,{}),(0,t.jsx)(b,{"data-position":s,className:n("data-[position=popper]:h-[var(--radix-select-trigger-height)] data-[position=popper]:w-full data-[position=popper]:min-w-[var(--radix-select-trigger-width)]",s==="popper"&&""),children:a}),(0,t.jsx)(S,{})]})})}function B({className:e,children:a,...s}){return(0,t.jsxs)(m,{"data-slot":"select-item",className:n("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-sm px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...s,children:[(0,t.jsx)("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center",children:(0,t.jsx)(_,{children:(0,t.jsx)(i,{className:"pointer-events-none"})})}),(0,t.jsx)(h,{children:a})]})}function z({className:e,...a}){return(0,t.jsx)(j,{"data-slot":"select-scroll-up-button",className:n("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-3.5",e),...a,children:(0,t.jsx)(c,{})})}function S({className:e,...a}){return(0,t.jsx)(p,{"data-slot":"select-scroll-down-button",className:n("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-3.5",e),...a,children:(0,t.jsx)(d,{})})}export{D as a,T as i,E as n,B as r,C as t};
1
+ import{Et as i,St as d,Tt as l,bt as c}from"./icons-DxFtdMXW.js";import{$ as u,Q as p,at as f,ct as g,et as m,it as x,jt as v,lt as b,nt as h,ot as j,rt as w,st as y,tt as z}from"./radix-ui-CxCv--D1.js";import{t as n}from"./utils-EJLOIroS.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@2.1.0"};var a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="3c3a92d1-379b-463a-a23d-bff5bcefd89a",e._sentryDebugIdIdentifier="sentry-dbid-3c3a92d1-379b-463a-a23d-bff5bcefd89a")}catch{}})();var t=v();function D({...e}){return(0,t.jsx)(x,{"data-slot":"select",...e})}function C({...e}){return(0,t.jsx)(g,{"data-slot":"select-value",...e})}function T({className:e,size:a="default",variant:s="default",children:r,...o}){return(0,t.jsxs)(y,{"data-slot":"select-trigger","data-size":a,"data-variant":s,className:n("border-input data-[placeholder]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-sm border px-2 py-1.5 text-xs/relaxed transition-colors focus-visible:ring-[2px] aria-invalid:ring-[2px] data-[size=default]:h-7 data-[size=sm]:h-6 *:data-[slot=select-value]:flex *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-3.5 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0",s==="default"&&"bg-input/20 dark:bg-input/30 dark:hover:bg-input/50",s==="outline"&&"bg-transparent",e),...o,children:[r,(0,t.jsx)(u,{asChild:!0,children:(0,t.jsx)(c,{className:"text-muted-foreground size-3.5 pointer-events-none"})})]})}function E({className:e,children:a,position:s="item-aligned",align:r="center",...o}){return(0,t.jsx)(w,{children:(0,t.jsxs)(p,{"data-slot":"select-content",className:n("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 min-w-32 rounded-lg shadow-md ring-1 duration-150 data-closed:duration-100 ease-out relative z-50 max-h-(--radix-select-content-available-height) origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto",s==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:s,align:r,...o,children:[(0,t.jsx)(_,{}),(0,t.jsx)(b,{"data-position":s,className:n("data-[position=popper]:h-[var(--radix-select-trigger-height)] data-[position=popper]:w-full data-[position=popper]:min-w-[var(--radix-select-trigger-width)]",s==="popper"&&""),children:a}),(0,t.jsx)(S,{})]})})}function B({className:e,children:a,...s}){return(0,t.jsxs)(m,{"data-slot":"select-item",className:n("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-sm px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...s,children:[(0,t.jsx)("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center",children:(0,t.jsx)(z,{children:(0,t.jsx)(i,{className:"pointer-events-none"})})}),(0,t.jsx)(h,{children:a})]})}function _({className:e,...a}){return(0,t.jsx)(j,{"data-slot":"select-scroll-up-button",className:n("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-3.5",e),...a,children:(0,t.jsx)(d,{})})}function S({className:e,...a}){return(0,t.jsx)(f,{"data-slot":"select-scroll-down-button",className:n("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-3.5",e),...a,children:(0,t.jsx)(l,{})})}export{C as a,T as i,E as n,B as r,D as t};
@@ -1 +1 @@
1
- import{C as o,S as l,b as n,jt as d,p as c,v as u,w as b,x as f,y as h}from"./radix-ui-41WpuKNR.js";import{t as s}from"./utils-Cr2_fSDl.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};a.SENTRY_RELEASE={id:"db-studio@2.0.0"};var e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="d0af9f82-5784-4ee8-881a-d509c7628d1e",a._sentryDebugIdIdentifier="sentry-dbid-d0af9f82-5784-4ee8-881a-d509c7628d1e")}catch{}})();var r=d();function v({className:a,children:e,...t}){return(0,r.jsxs)(f,{"data-slot":"scroll-area",className:s("relative",a),...t,children:[(0,r.jsx)(b,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:e}),(0,r.jsx)(p,{}),(0,r.jsx)(n,{})]})}function p({className:a,orientation:e="vertical",...t}){return(0,r.jsx)(l,{"data-slot":"scroll-area-scrollbar",orientation:e,className:s("flex touch-none p-px transition-colors select-none",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",a),...t,children:(0,r.jsx)(o,{"data-slot":"scroll-area-thumb",className:"bg-(--scrollbar-thumb) hover:bg-(--scrollbar-thumb-hover) relative flex-1 rounded-full"})})}function m({className:a,size:e="default",...t}){return(0,r.jsx)(u,{"data-slot":"switch","data-size":e,className:s("data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent focus-visible:ring-[2px] aria-invalid:ring-[2px] data-[size=default]:h-[16.6px] data-[size=default]:w-[28px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50",a),...t,children:(0,r.jsx)(h,{"data-slot":"switch-thumb",className:"bg-background dark:data-unchecked:bg-foreground dark:data-checked:bg-primary-foreground rounded-full group-data-[size=default]/switch:size-3.5 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 pointer-events-none block ring-0 transition-transform"})})}function w({className:a,orientation:e="horizontal",decorative:t=!0,...i}){return(0,r.jsx)(c,{"data-slot":"separator",decorative:t,orientation:e,className:s("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch",a),...i})}export{p as i,m as n,v as r,w as t};
1
+ import{C as o,S as l,b as n,jt as d,p as c,v as u,w as b,x as f,y as h}from"./radix-ui-CxCv--D1.js";import{t as s}from"./utils-EJLOIroS.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};a.SENTRY_RELEASE={id:"db-studio@2.1.0"};var e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="d0af9f82-5784-4ee8-881a-d509c7628d1e",a._sentryDebugIdIdentifier="sentry-dbid-d0af9f82-5784-4ee8-881a-d509c7628d1e")}catch{}})();var r=d();function v({className:a,children:e,...t}){return(0,r.jsxs)(f,{"data-slot":"scroll-area",className:s("relative",a),...t,children:[(0,r.jsx)(b,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:e}),(0,r.jsx)(p,{}),(0,r.jsx)(n,{})]})}function p({className:a,orientation:e="vertical",...t}){return(0,r.jsx)(l,{"data-slot":"scroll-area-scrollbar",orientation:e,className:s("flex touch-none p-px transition-colors select-none",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",a),...t,children:(0,r.jsx)(o,{"data-slot":"scroll-area-thumb",className:"bg-(--scrollbar-thumb) hover:bg-(--scrollbar-thumb-hover) relative flex-1 rounded-full"})})}function m({className:a,size:e="default",...t}){return(0,r.jsx)(u,{"data-slot":"switch","data-size":e,className:s("data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent focus-visible:ring-[2px] aria-invalid:ring-[2px] data-[size=default]:h-[16.6px] data-[size=default]:w-[28px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50",a),...t,children:(0,r.jsx)(h,{"data-slot":"switch-thumb",className:"bg-background dark:data-unchecked:bg-foreground dark:data-checked:bg-primary-foreground rounded-full group-data-[size=default]/switch:size-3.5 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 pointer-events-none block ring-0 transition-transform"})})}function w({className:a,orientation:e="horizontal",decorative:t=!0,...i}){return(0,r.jsx)(c,{"data-slot":"separator",decorative:t,orientation:e,className:s("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch",a),...i})}export{p as i,m as n,v as r,w as t};
@@ -1 +1 @@
1
- import{n as y}from"./icons-D72QQyd5.js";import{_t as j,bt as k,gt as w,ht as N,jt as S,mt as z,pt as u,vt as _,yt as T}from"./radix-ui-41WpuKNR.js";import{t as r}from"./utils-Cr2_fSDl.js";import{i as p,n as c}from"./overlay.store-D93IGU3a.js";import{r as C}from"./label-Dcwj4aRe.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"db-studio@2.0.0"};var a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="fbaff66d-0253-402b-8028-895223e41131",t._sentryDebugIdIdentifier="sentry-dbid-fbaff66d-0253-402b-8028-895223e41131")}catch{}})();var e=S();function I({className:t,...a}){return(0,e.jsx)("textarea",{"data-slot":"textarea",className:r("border-input bg-input/20 dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 resize-none rounded-sm border px-2 py-2 text-sm transition-colors focus-visible:ring-[2px] aria-invalid:ring-[2px] md:text-xs/relaxed placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed disabled:opacity-50",t),...a})}function Y({className:t,...a}){return(0,e.jsx)("div",{"data-slot":"input-group",role:"group",className:r("border-input bg-input/20 dark:bg-input/30 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 h-7 rounded-sm border transition-colors has-data-[align=block-end]:rounded-sm has-data-[align=block-start]:rounded-sm has-[[data-slot=input-group-control]:focus-visible]:ring-[2px] has-[[data-slot][aria-invalid=true]]:ring-[2px] has-[textarea]:rounded-sm has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5 [[data-slot=combobox-content]_&]:focus-within:border-inherit [[data-slot=combobox-content]_&]:focus-within:ring-0 group/input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto",t),...a})}var D=p("text-muted-foreground **:data-[slot=kbd]:bg-muted-foreground/10 h-auto gap-1 py-2 text-xs/relaxed font-medium group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5 flex cursor-text items-center justify-center select-none",{variants:{align:{"inline-start":"pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem] order-first","inline-end":"pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem] order-last","block-start":"px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2 order-first w-full justify-start","block-end":"px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start"}},defaultVariants:{align:"inline-start"}});function F({className:t,align:a="inline-start",...o}){return(0,e.jsx)("div",{role:"group","data-slot":"input-group-addon","data-align":a,className:r(D({align:a}),t),onClick:s=>{s.target.closest("button")||s.currentTarget.parentElement?.querySelector("input")?.focus()},onKeyDown:s=>{if(s.key==="Enter"||s.key===" "){if(s.target.closest("button"))return;s.currentTarget.parentElement?.querySelector("input")?.focus()}},...o})}var E=p("gap-2 rounded-sm text-xs/relaxed shadow-none flex items-center",{variants:{size:{xs:"h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3",sm:"","icon-xs":"size-6 p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function J({className:t,type:a="button",variant:o="ghost",size:s="xs",...i}){return(0,e.jsx)(c,{type:a,"data-size":s,variant:o,className:r(E({size:s}),t),...i})}function M({className:t,...a}){return(0,e.jsx)(I,{"data-slot":"input-group-control",className:r("rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent flex-1 resize-none",t),...a})}function G({...t}){return(0,e.jsx)(_,{"data-slot":"sheet",...t})}function Q({...t}){return(0,e.jsx)(k,{"data-slot":"sheet-trigger",...t})}function U({...t}){return(0,e.jsx)(u,{"data-slot":"sheet-close",...t})}function B({...t}){return(0,e.jsx)(j,{"data-slot":"sheet-portal",...t})}function V({className:t,...a}){return(0,e.jsx)(w,{"data-slot":"sheet-overlay",className:r("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/80 duration-100 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50",t),...a})}function q({className:t,children:a,side:o="right",showCloseButton:s=!0,isPinned:i=!1,showOverlay:n=!0,...d}){return(0,e.jsxs)(B,{children:[!i&&n&&(0,e.jsx)(V,{}),(0,e.jsxs)(z,{"data-slot":"sheet-content","data-side":o,className:r("bg-background data-open:animate-in data-closed:animate-out data-[side=right]:data-closed:slide-out-to-right-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=top]:data-closed:slide-out-to-top-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:fade-out-0 data-open:fade-in-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=bottom]:data-open:slide-in-from-bottom-10 z-50 flex flex-col bg-clip-padding text-xs/relaxed shadow-lg transition duration-250 data-closed:duration-200 ease-drawer data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-none data-[side=right]:sm:max-w-sm",i?"absolute":"fixed",t),...d,children:[(0,e.jsx)(C.Provider,{value:!0,children:a}),s&&(0,e.jsx)(u,{"data-slot":"sheet-close",asChild:!0,children:(0,e.jsxs)(c,{variant:"ghost",className:"absolute top-4 right-4",size:"icon-sm",children:[(0,e.jsx)(y,{}),(0,e.jsx)("span",{className:"sr-only",children:"Close"})]})})]})]})}function A({className:t,...a}){return(0,e.jsx)("div",{"data-slot":"sheet-header",className:r("gap-1.5 p-6 flex flex-col",t),...a})}function O({className:t,...a}){return(0,e.jsx)(T,{"data-slot":"sheet-title",className:r("text-foreground text-sm font-medium",t),...a})}function R({className:t,...a}){return(0,e.jsx)(N,{"data-slot":"sheet-description",className:r("text-muted-foreground text-xs/relaxed",t),...a})}var W=({title:t,description:a,side:o="right",children:s,size:i="sm:max-w-2xl!",headerClassName:n="p-0 border-b border-border p-3",titleClassName:d="text-lg font-semibold",contentClassName:g="px-5 py-6 space-y-6",open:f,onOpenChange:b,cta:x,closeButton:h=!0,modal:l=!0,onFocusOutside:m,onPointerDownOutside:v})=>(0,e.jsx)(G,{open:f,onOpenChange:b,modal:l,children:(0,e.jsxs)(q,{side:o,className:i,showCloseButton:h,showOverlay:l,onFocusOutside:m,onPointerDownOutside:v,children:[(0,e.jsxs)(A,{className:n,children:[(0,e.jsxs)(O,{className:r(d,"flex justify-between items-center"),children:[t,x]}),a&&(0,e.jsx)(R,{className:"text-xs/relaxed text-muted-foreground",children:a})]}),(0,e.jsx)("div",{className:r(g,"overflow-y-auto"),children:s})]})});export{A as a,Y as c,M as d,I as f,q as i,F as l,G as n,O as o,U as r,Q as s,W as t,J as u};
1
+ import{n as y}from"./icons-DxFtdMXW.js";import{_t as j,bt as k,gt as w,ht as N,jt as S,mt as z,pt as u,vt as _,yt as T}from"./radix-ui-CxCv--D1.js";import{t as r}from"./utils-EJLOIroS.js";import{i as p,n as c}from"./overlay.store-DsUdwZjE.js";import{r as C}from"./label-DzHJlGAx.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"db-studio@2.1.0"};var a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="fbaff66d-0253-402b-8028-895223e41131",t._sentryDebugIdIdentifier="sentry-dbid-fbaff66d-0253-402b-8028-895223e41131")}catch{}})();var e=S();function I({className:t,...a}){return(0,e.jsx)("textarea",{"data-slot":"textarea",className:r("border-input bg-input/20 dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 resize-none rounded-sm border px-2 py-2 text-sm transition-colors focus-visible:ring-[2px] aria-invalid:ring-[2px] md:text-xs/relaxed placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed disabled:opacity-50",t),...a})}function Y({className:t,...a}){return(0,e.jsx)("div",{"data-slot":"input-group",role:"group",className:r("border-input bg-input/20 dark:bg-input/30 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 h-7 rounded-sm border transition-colors has-data-[align=block-end]:rounded-sm has-data-[align=block-start]:rounded-sm has-[[data-slot=input-group-control]:focus-visible]:ring-[2px] has-[[data-slot][aria-invalid=true]]:ring-[2px] has-[textarea]:rounded-sm has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5 [[data-slot=combobox-content]_&]:focus-within:border-inherit [[data-slot=combobox-content]_&]:focus-within:ring-0 group/input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto",t),...a})}var D=p("text-muted-foreground **:data-[slot=kbd]:bg-muted-foreground/10 h-auto gap-1 py-2 text-xs/relaxed font-medium group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5 flex cursor-text items-center justify-center select-none",{variants:{align:{"inline-start":"pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem] order-first","inline-end":"pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem] order-last","block-start":"px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2 order-first w-full justify-start","block-end":"px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start"}},defaultVariants:{align:"inline-start"}});function F({className:t,align:a="inline-start",...o}){return(0,e.jsx)("div",{role:"group","data-slot":"input-group-addon","data-align":a,className:r(D({align:a}),t),onClick:s=>{s.target.closest("button")||s.currentTarget.parentElement?.querySelector("input")?.focus()},onKeyDown:s=>{if(s.key==="Enter"||s.key===" "){if(s.target.closest("button"))return;s.currentTarget.parentElement?.querySelector("input")?.focus()}},...o})}var E=p("gap-2 rounded-sm text-xs/relaxed shadow-none flex items-center",{variants:{size:{xs:"h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3",sm:"","icon-xs":"size-6 p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function J({className:t,type:a="button",variant:o="ghost",size:s="xs",...i}){return(0,e.jsx)(c,{type:a,"data-size":s,variant:o,className:r(E({size:s}),t),...i})}function M({className:t,...a}){return(0,e.jsx)(I,{"data-slot":"input-group-control",className:r("rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent flex-1 resize-none",t),...a})}function G({...t}){return(0,e.jsx)(_,{"data-slot":"sheet",...t})}function Q({...t}){return(0,e.jsx)(k,{"data-slot":"sheet-trigger",...t})}function U({...t}){return(0,e.jsx)(u,{"data-slot":"sheet-close",...t})}function B({...t}){return(0,e.jsx)(j,{"data-slot":"sheet-portal",...t})}function V({className:t,...a}){return(0,e.jsx)(w,{"data-slot":"sheet-overlay",className:r("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/80 duration-100 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50",t),...a})}function q({className:t,children:a,side:o="right",showCloseButton:s=!0,isPinned:i=!1,showOverlay:n=!0,...d}){return(0,e.jsxs)(B,{children:[!i&&n&&(0,e.jsx)(V,{}),(0,e.jsxs)(z,{"data-slot":"sheet-content","data-side":o,className:r("bg-background data-open:animate-in data-closed:animate-out data-[side=right]:data-closed:slide-out-to-right-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=top]:data-closed:slide-out-to-top-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:fade-out-0 data-open:fade-in-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=bottom]:data-open:slide-in-from-bottom-10 z-50 flex flex-col bg-clip-padding text-xs/relaxed shadow-lg transition duration-250 data-closed:duration-200 ease-drawer data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-none data-[side=right]:sm:max-w-sm",i?"absolute":"fixed",t),...d,children:[(0,e.jsx)(C.Provider,{value:!0,children:a}),s&&(0,e.jsx)(u,{"data-slot":"sheet-close",asChild:!0,children:(0,e.jsxs)(c,{variant:"ghost",className:"absolute top-4 right-4",size:"icon-sm",children:[(0,e.jsx)(y,{}),(0,e.jsx)("span",{className:"sr-only",children:"Close"})]})})]})]})}function A({className:t,...a}){return(0,e.jsx)("div",{"data-slot":"sheet-header",className:r("gap-1.5 p-6 flex flex-col",t),...a})}function O({className:t,...a}){return(0,e.jsx)(T,{"data-slot":"sheet-title",className:r("text-foreground text-sm font-medium",t),...a})}function R({className:t,...a}){return(0,e.jsx)(N,{"data-slot":"sheet-description",className:r("text-muted-foreground text-xs/relaxed",t),...a})}var W=({title:t,description:a,side:o="right",children:s,size:i="sm:max-w-2xl!",headerClassName:n="p-0 border-b border-border p-3",titleClassName:d="text-lg font-semibold",contentClassName:g="px-5 py-6 space-y-6",open:f,onOpenChange:b,cta:x,closeButton:h=!0,modal:l=!0,onFocusOutside:m,onPointerDownOutside:v})=>(0,e.jsx)(G,{open:f,onOpenChange:b,modal:l,children:(0,e.jsxs)(q,{side:o,className:i,showCloseButton:h,showOverlay:l,onFocusOutside:m,onPointerDownOutside:v,children:[(0,e.jsxs)(A,{className:n,children:[(0,e.jsxs)(O,{className:r(d,"flex justify-between items-center"),children:[t,x]}),a&&(0,e.jsx)(R,{className:"text-xs/relaxed text-muted-foreground",children:a})]}),(0,e.jsx)("div",{className:r(g,"overflow-y-auto"),children:s})]})});export{A as a,Y as c,M as d,I as f,q as i,F as l,G as n,O as o,U as r,Q as s,W 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@2.0.0"};var r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="e3f3f0ec-0f2f-46ea-9c50-9172e850bc8f",e._sentryDebugIdIdentifier="sentry-dbid-e3f3f0ec-0f2f-46ea-9c50-9172e850bc8f")}catch{}})();var i={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}]},s={defaultToken:"",ignoreCase:!0,tokenPostfix:".shell",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"}],keywords:["if","then","do","else","elif","while","until","for","in","esac","fi","fin","fil","done","exit","set","unset","export","function"],builtins:["ab","awk","bash","beep","cat","cc","cd","chown","chmod","chroot","clear","cp","curl","cut","diff","echo","find","gawk","gcc","get","git","grep","hg","kill","killall","ln","ls","make","mkdir","openssl","mv","nc","node","npm","ping","ps","restart","rm","rmdir","sed","service","sh","shopt","shred","source","sort","sleep","ssh","start","stop","su","sudo","svn","tee","telnet","top","touch","vi","vim","wall","wc","wget","who","write","yes","zsh"],startingWithDash:/\-+\w+/,identifiersWithDashes:/[a-zA-Z]\w+(?:@startingWithDash)+/,symbols:/[=><!~?&|+\-*\/\^;\.,]+/,tokenizer:{root:[[/@identifiersWithDashes/,""],[/(\s)((?:@startingWithDash)+)/,["white","attribute.name"]],[/[a-zA-Z]\w*/,{cases:{"@keywords":"keyword","@builtins":"type.identifier","@default":""}}],{include:"@whitespace"},{include:"@strings"},{include:"@parameters"},{include:"@heredoc"},[/[{}\[\]()]/,"@brackets"],[/@symbols/,"delimiter"],{include:"@numbers"},[/[,;]/,"delimiter"]],whitespace:[[/\s+/,"white"],[/(^#!.*$)/,"metatag"],[/(^#.*$)/,"comment"]],numbers:[[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F_]*[0-9a-fA-F]/,"number.hex"],[/\d+/,"number"]],strings:[[/'/,"string","@stringBody"],[/"/,"string","@dblStringBody"]],stringBody:[[/'/,"string","@popall"],[/./,"string"]],dblStringBody:[[/"/,"string","@popall"],[/./,"string"]],heredoc:[[/(<<[-<]?)(\s*)(['"`]?)([\w\-]+)(['"`]?)/,["constants","white","string.heredoc.delimiter","string.heredoc","string.heredoc.delimiter"]]],parameters:[[/\$\d+/,"variable.predefined"],[/\$\w+/,"variable"],[/\$[*@#?\-$!0_]/,"variable"],[/\$'/,"variable","@parameterBodyQuote"],[/\$"/,"variable","@parameterBodyDoubleQuote"],[/\$\(/,"variable","@parameterBodyParen"],[/\$\{/,"variable","@parameterBodyCurlyBrace"]],parameterBodyQuote:[[/[^#:%*@\-!_']+/,"variable"],[/[#:%*@\-!_]/,"delimiter"],[/[']/,"variable","@pop"]],parameterBodyDoubleQuote:[[/[^#:%*@\-!_"]+/,"variable"],[/[#:%*@\-!_]/,"delimiter"],[/["]/,"variable","@pop"]],parameterBodyParen:[[/[^#:%*@\-!_)]+/,"variable"],[/[#:%*@\-!_]/,"delimiter"],[/[)]/,"variable","@pop"]],parameterBodyCurlyBrace:[[/[^#:%*@\-!_}]+/,"variable"],[/[#:%*@\-!_]/,"delimiter"],[/[}]/,"variable","@pop"]]}};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@2.1.0"};var r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="e3f3f0ec-0f2f-46ea-9c50-9172e850bc8f",e._sentryDebugIdIdentifier="sentry-dbid-e3f3f0ec-0f2f-46ea-9c50-9172e850bc8f")}catch{}})();var i={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}]},s={defaultToken:"",ignoreCase:!0,tokenPostfix:".shell",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"}],keywords:["if","then","do","else","elif","while","until","for","in","esac","fi","fin","fil","done","exit","set","unset","export","function"],builtins:["ab","awk","bash","beep","cat","cc","cd","chown","chmod","chroot","clear","cp","curl","cut","diff","echo","find","gawk","gcc","get","git","grep","hg","kill","killall","ln","ls","make","mkdir","openssl","mv","nc","node","npm","ping","ps","restart","rm","rmdir","sed","service","sh","shopt","shred","source","sort","sleep","ssh","start","stop","su","sudo","svn","tee","telnet","top","touch","vi","vim","wall","wc","wget","who","write","yes","zsh"],startingWithDash:/\-+\w+/,identifiersWithDashes:/[a-zA-Z]\w+(?:@startingWithDash)+/,symbols:/[=><!~?&|+\-*\/\^;\.,]+/,tokenizer:{root:[[/@identifiersWithDashes/,""],[/(\s)((?:@startingWithDash)+)/,["white","attribute.name"]],[/[a-zA-Z]\w*/,{cases:{"@keywords":"keyword","@builtins":"type.identifier","@default":""}}],{include:"@whitespace"},{include:"@strings"},{include:"@parameters"},{include:"@heredoc"},[/[{}\[\]()]/,"@brackets"],[/@symbols/,"delimiter"],{include:"@numbers"},[/[,;]/,"delimiter"]],whitespace:[[/\s+/,"white"],[/(^#!.*$)/,"metatag"],[/(^#.*$)/,"comment"]],numbers:[[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F_]*[0-9a-fA-F]/,"number.hex"],[/\d+/,"number"]],strings:[[/'/,"string","@stringBody"],[/"/,"string","@dblStringBody"]],stringBody:[[/'/,"string","@popall"],[/./,"string"]],dblStringBody:[[/"/,"string","@popall"],[/./,"string"]],heredoc:[[/(<<[-<]?)(\s*)(['"`]?)([\w\-]+)(['"`]?)/,["constants","white","string.heredoc.delimiter","string.heredoc","string.heredoc.delimiter"]]],parameters:[[/\$\d+/,"variable.predefined"],[/\$\w+/,"variable"],[/\$[*@#?\-$!0_]/,"variable"],[/\$'/,"variable","@parameterBodyQuote"],[/\$"/,"variable","@parameterBodyDoubleQuote"],[/\$\(/,"variable","@parameterBodyParen"],[/\$\{/,"variable","@parameterBodyCurlyBrace"]],parameterBodyQuote:[[/[^#:%*@\-!_']+/,"variable"],[/[#:%*@\-!_]/,"delimiter"],[/[']/,"variable","@pop"]],parameterBodyDoubleQuote:[[/[^#:%*@\-!_"]+/,"variable"],[/[#:%*@\-!_]/,"delimiter"],[/["]/,"variable","@pop"]],parameterBodyParen:[[/[^#:%*@\-!_)]+/,"variable"],[/[#:%*@\-!_]/,"delimiter"],[/[)]/,"variable","@pop"]],parameterBodyCurlyBrace:[[/[^#:%*@\-!_}]+/,"variable"],[/[#:%*@\-!_]/,"delimiter"],[/[}]/,"variable","@pop"]]}};export{i as conf,s as language};