orcaq 1.1.8 → 1.1.9

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 (154) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{BWTTrGtY.js → B-E4SrDA.js} +2 -2
  3. package/.output/public/_nuxt/{BHr4_sbs.js → B-OC4Wzf.js} +1 -1
  4. package/.output/public/_nuxt/{CQFANjzf.js → B-cBPXHS.js} +1 -1
  5. package/.output/public/_nuxt/{D5Oboajo.js → B1ydsdXg.js} +1 -1
  6. package/.output/public/_nuxt/B2Wngdut.js +1 -0
  7. package/.output/public/_nuxt/{soHTUlpn.js → B3ZoiMh5.js} +1 -1
  8. package/.output/public/_nuxt/B3jyHGmo.js +1 -0
  9. package/.output/public/_nuxt/{XjywAggc.js → B6aTbrvX.js} +1 -1
  10. package/.output/public/_nuxt/{DpsqSAMo.js → B9vFZSzU.js} +1 -1
  11. package/.output/public/_nuxt/BFlFdtcI.js +12 -0
  12. package/.output/public/_nuxt/BFxd7ZWZ.js +1 -0
  13. package/.output/public/_nuxt/BI0OYmAG.js +1 -0
  14. package/.output/public/_nuxt/{BQm1mt0O.js → BIYjBgOJ.js} +1 -1
  15. package/.output/public/_nuxt/BMwuBt1W.js +1 -0
  16. package/.output/public/_nuxt/{D8egDyEO.js → BP23Jaxf.js} +1 -1
  17. package/.output/public/_nuxt/BWpduGRB.js +1 -0
  18. package/.output/public/_nuxt/{JxgekUqn.js → BX-NC3FD.js} +1 -1
  19. package/.output/public/_nuxt/{B0gkARnK.js → BY0VC_fp.js} +1 -1
  20. package/.output/public/_nuxt/BZOLz5Xw.js +1 -0
  21. package/.output/public/_nuxt/{7iCr9_qw.js → BblWMS7J.js} +3 -3
  22. package/.output/public/_nuxt/{BRzWRTTF.js → Bc7Kpanq.js} +1 -1
  23. package/.output/public/_nuxt/{DmnufEYq.js → BcbezgEJ.js} +1 -1
  24. package/.output/public/_nuxt/{DJXrgohw.js → BeMg7yb6.js} +2 -2
  25. package/.output/public/_nuxt/Bg0K-n53.js +18 -0
  26. package/.output/public/_nuxt/{7H5y5euK.js → BgFbw5aK.js} +1 -1
  27. package/.output/public/_nuxt/{DBSV6YXN.js → BkHJ3kuB.js} +1 -1
  28. package/.output/public/_nuxt/BlVXGJOG.js +1 -0
  29. package/.output/public/_nuxt/{DwPmcz47.js → BorA7uj6.js} +1 -1
  30. package/.output/public/_nuxt/BqQfmS94.js +1 -0
  31. package/.output/public/_nuxt/{DgxTwFGe.js → Btu3pVWi.js} +2 -2
  32. package/.output/public/_nuxt/{CXbrqQhC.js → C0kVUAwR.js} +1 -1
  33. package/.output/public/_nuxt/C1GKs4YV.js +1 -0
  34. package/.output/public/_nuxt/C4fd0pgB.js +1 -0
  35. package/.output/public/_nuxt/{CuXTA7ZW.js → C4zVAAUp.js} +1 -1
  36. package/.output/public/_nuxt/{B6N_D8QI.js → C6ajLfO0.js} +1 -1
  37. package/.output/public/_nuxt/{CyKRjZZo.js → C9JT2-RE.js} +1 -1
  38. package/.output/public/_nuxt/{BsCPQnkm.js → CAnZNTn6.js} +1 -1
  39. package/.output/public/_nuxt/{vP25tZUh.js → CB2XoHaK.js} +1 -1
  40. package/.output/public/_nuxt/{CAjVwGyz.js → CBy17iCN.js} +1 -1
  41. package/.output/public/_nuxt/{D4DMGxvZ.js → CCwJzmTT.js} +1 -1
  42. package/.output/public/_nuxt/{5450EsIE.js → CGlRJg9T.js} +1 -1
  43. package/.output/public/_nuxt/{Dpkaavgs.js → CH3m0zKs.js} +1 -1
  44. package/.output/public/_nuxt/{BO3FEgXG.js → CHFYZcjC.js} +1 -1
  45. package/.output/public/_nuxt/{LU_a7qLd.js → CM4UzWO5.js} +1 -1
  46. package/.output/public/_nuxt/{CMnjMfEQ.js → CM7fDldV.js} +1 -1
  47. package/.output/public/_nuxt/{Dtry_3Qa.js → CQi4GvAy.js} +1 -1
  48. package/.output/public/_nuxt/{zndqWf9s.js → CRtMS55w.js} +1 -1
  49. package/.output/public/_nuxt/{C0jXhwNq.js → CSIDbD5d.js} +1 -1
  50. package/.output/public/_nuxt/{BuTCm7Bo.js → CT4V-SdE.js} +1 -1
  51. package/.output/public/_nuxt/{CCCJ2fw7.js → CV3uHXW4.js} +1 -1
  52. package/.output/public/_nuxt/{FmHWbXNk.js → CX2dGf8T.js} +1 -1
  53. package/.output/public/_nuxt/{f6XRRKUb.js → Ce00XEKL.js} +1 -1
  54. package/.output/public/_nuxt/{_uLivI44.js → CfglFxLQ.js} +1 -1
  55. package/.output/public/_nuxt/{mcYTISF7.js → Cgc3lXst.js} +1 -1
  56. package/.output/public/_nuxt/{Bu6ybm3Z.js → CiGbpFVs.js} +1 -1
  57. package/.output/public/_nuxt/{DG9CsZCx.js → Cilp0euQ.js} +1 -1
  58. package/.output/public/_nuxt/CjE9xodL.js +1 -0
  59. package/.output/public/_nuxt/{DrkGD_bQ.js → Ck7gJ0Ru.js} +1 -1
  60. package/.output/public/_nuxt/{CKlMKmo6.js → CkVRbNxk.js} +1 -1
  61. package/.output/public/_nuxt/CmROOZW3.js +1 -0
  62. package/.output/public/_nuxt/{BRWis86L.js → CqwK0iC2.js} +1 -1
  63. package/.output/public/_nuxt/{CvbYm0uB.js → CsRqTS8p.js} +1 -1
  64. package/.output/public/_nuxt/{So0hX8V0.js → Cv8aMucD.js} +3 -3
  65. package/.output/public/_nuxt/CvFBHqKj.js +1 -0
  66. package/.output/public/_nuxt/{BzNEuLKx.js → CvrjITPr.js} +1 -1
  67. package/.output/public/_nuxt/CwEAH09c.js +1 -0
  68. package/.output/public/_nuxt/{DXVrM3CN.js → D0TQTmc_.js} +1 -1
  69. package/.output/public/_nuxt/{BRCvv3op.js → D33qa5aT.js} +1 -1
  70. package/.output/public/_nuxt/{vEHvfalB.js → D6FGhPpz.js} +1 -1
  71. package/.output/public/_nuxt/{DCewvWOu.js → D8dLCNO1.js} +1 -1
  72. package/.output/public/_nuxt/DA2L1Ivx.js +1 -0
  73. package/.output/public/_nuxt/{DHXwq7wT.js → DB45HoaN.js} +1 -1
  74. package/.output/public/_nuxt/DBIf1geQ.js +1 -0
  75. package/.output/public/_nuxt/{C6teO48Y.js → DD6NieRw.js} +74 -74
  76. package/.output/public/_nuxt/DDNFAZ6A.js +1 -0
  77. package/.output/public/_nuxt/{D_kY6P5P.js → DDgsZmht.js} +1 -1
  78. package/.output/public/_nuxt/{BNh4NY7v.js → DEBj_roB.js} +1 -1
  79. package/.output/public/_nuxt/{BzqjH2-H.js → DI-I25kb.js} +1 -1
  80. package/.output/public/_nuxt/{Cd_fVKDw.js → DMhhDVL0.js} +1 -1
  81. package/.output/public/_nuxt/{C-e53AuW.js → DNL5Q-iy.js} +1 -1
  82. package/.output/public/_nuxt/DX42Brjy.js +1 -0
  83. package/.output/public/_nuxt/DYBPW385.js +1 -0
  84. package/.output/public/_nuxt/{CU5cwnUW.js → DYFx7Tau.js} +1 -1
  85. package/.output/public/_nuxt/{CXQ2zrsE.js → DZJEpoYA.js} +1 -1
  86. package/.output/public/_nuxt/{DZ4xLzJg.js → D_dxq6Av.js} +1 -1
  87. package/.output/public/_nuxt/{jtwYTq7X.js → DcIKg-oA.js} +25 -25
  88. package/.output/public/_nuxt/Dcf3u1x9.js +1 -0
  89. package/.output/public/_nuxt/{CFi6G8Aj.js → DdjYB9eX.js} +2 -2
  90. package/.output/public/_nuxt/{CCC5u9Ni.js → DeGwWuWf.js} +1 -1
  91. package/.output/public/_nuxt/Dgh1FhxQ.js +1 -0
  92. package/.output/public/_nuxt/{DQRyK9Io.js → DghZRCwT.js} +1 -1
  93. package/.output/public/_nuxt/{CMI-3q_e.js → DngnCd9Q.js} +1 -1
  94. package/.output/public/_nuxt/{BalNYDR1.js → Dpdssse1.js} +1 -1
  95. package/.output/public/_nuxt/{BXMKgn-J.js → DrfFcngk.js} +1 -1
  96. package/.output/public/_nuxt/{BYaoWfSN.js → Ds4LpS8e.js} +1 -1
  97. package/.output/public/_nuxt/{C874itvn.js → DsHltPpv.js} +1 -1
  98. package/.output/public/_nuxt/{C6K-C4_d.js → DuvFgQqu.js} +1 -1
  99. package/.output/public/_nuxt/{BJvJ0Hlu.js → Dzy2Amcc.js} +4 -4
  100. package/.output/public/_nuxt/{R04uZjs6.js → EzQMUIRl.js} +1 -1
  101. package/.output/public/_nuxt/FrxNy5Hb.js +2 -0
  102. package/.output/public/_nuxt/{DkX74xDd.js → ImQ5Dcjp.js} +1 -1
  103. package/.output/public/_nuxt/{CyEOtFwE.js → QZbgg6bx.js} +1 -1
  104. package/.output/public/_nuxt/{Cw1HIv3s.js → RCyqQNC4.js} +1 -1
  105. package/.output/public/_nuxt/{BmfnP4qD.js → RpDfSk0l.js} +1 -1
  106. package/.output/public/_nuxt/UowwUtRH.js +1 -0
  107. package/.output/public/_nuxt/{CMDq7o88.js → V_GiMERb.js} +1 -1
  108. package/.output/public/_nuxt/{LxqkguPP.js → W2el5otm.js} +1 -1
  109. package/.output/public/_nuxt/{Dopm1f4X.js → bJGrilFb.js} +1 -1
  110. package/.output/public/_nuxt/builds/latest.json +1 -1
  111. package/.output/public/_nuxt/builds/meta/657bdee4-fa56-4862-bc13-309345429302.json +1 -0
  112. package/.output/public/_nuxt/entry.CQwtqNMg.css +1 -0
  113. package/.output/public/_nuxt/jgZoykhT.js +1 -0
  114. package/.output/public/_nuxt/{BK-6CJ0A.js → lFU3Ma5J.js} +1 -1
  115. package/.output/public/_nuxt/{WZQ8mcv9.js → lPZuSUw2.js} +1 -1
  116. package/.output/public/_nuxt/{Cqk0ImDE.js → ljX6O69y.js} +1 -1
  117. package/.output/public/_nuxt/{BMVgfiQu.js → mtBjWkj4.js} +1 -1
  118. package/.output/public/_nuxt/ngeX9iiO.js +1 -0
  119. package/.output/public/_nuxt/s10hyhzI.js +1 -0
  120. package/.output/public/_nuxt/{tc7vkD0J.js → w8sha2t6.js} +2 -2
  121. package/.output/public/_nuxt/{WGDY9i_Q.js → yPPOBtqs.js} +1 -1
  122. package/.output/server/chunks/build/client.manifest.mjs +833 -795
  123. package/.output/server/chunks/build/client.manifest.mjs.map +1 -1
  124. package/.output/server/chunks/nitro/nitro.mjs +692 -671
  125. package/.output/server/package.json +1 -1
  126. package/package.json +1 -1
  127. package/.output/public/_nuxt/-7uW7YTy.js +0 -1
  128. package/.output/public/_nuxt/6mVUr42b.js +0 -1
  129. package/.output/public/_nuxt/B21nC2NZ.js +0 -1
  130. package/.output/public/_nuxt/B232GDut.js +0 -2
  131. package/.output/public/_nuxt/B7C8fo37.js +0 -1
  132. package/.output/public/_nuxt/BC82eJHt.js +0 -1
  133. package/.output/public/_nuxt/Bn6_QGSK.js +0 -1
  134. package/.output/public/_nuxt/BuzCyLCh.js +0 -1
  135. package/.output/public/_nuxt/BzNNFvTW.js +0 -1
  136. package/.output/public/_nuxt/C8ZJ2pm_.js +0 -1
  137. package/.output/public/_nuxt/CA3O4M9L.js +0 -1
  138. package/.output/public/_nuxt/CZXyfpHW.js +0 -1
  139. package/.output/public/_nuxt/CZgTP5wX.js +0 -1
  140. package/.output/public/_nuxt/CeXnSKvd.js +0 -1
  141. package/.output/public/_nuxt/Chw5tFzx.js +0 -1
  142. package/.output/public/_nuxt/CkLSGVwV.js +0 -1
  143. package/.output/public/_nuxt/Cv9v5fHN.js +0 -1
  144. package/.output/public/_nuxt/D5GonnbJ.js +0 -1
  145. package/.output/public/_nuxt/DH2V7e8U.js +0 -1
  146. package/.output/public/_nuxt/DZIoL4RO.js +0 -1
  147. package/.output/public/_nuxt/DyjsVMbv.js +0 -1
  148. package/.output/public/_nuxt/KoGK2wLb.js +0 -1
  149. package/.output/public/_nuxt/Q8x88Gcd.js +0 -1
  150. package/.output/public/_nuxt/builds/meta/30582efd-125a-4f88-bd89-20a7b2ba8697.json +0 -1
  151. package/.output/public/_nuxt/eQskTKIU.js +0 -1
  152. package/.output/public/_nuxt/ecWNT6PZ.js +0 -1
  153. package/.output/public/_nuxt/entry.BcHy7sxf.css +0 -1
  154. package/.output/public/_nuxt/mcfKrWU-.js +0 -1
@@ -1,7 +1,7 @@
1
- import{_ as At}from"./DH2V7e8U.js";import{d as G,e as P,m as a,t as h,F as Q,s as X,o as d,k as E,w as i,z as k,bi as de,f as s,A as se,l as F,N as ae,n as me,r as I,am as Z,g as e,bj as ee,_ as He,i as oe,h as Je,bS as We,x as Qe,B as Ge,bf as qt,cE as Ke,bm as Xe,cF as zt,c as g,bk as Ye,bO as Vt,bP as Ot,bQ as Nt,bR as Mt,bH as Ut,bT as jt,bU as Ht,M as Jt,cG as Wt,bs as Qt,H as ye,G as Ze,a6 as et,bz as Gt,V as Kt,a$ as Xt,D as Yt,ae as Zt,Q as Le,aE as Ae,bA as eo,bB as to,bC as oo}from"./C6teO48Y.js";import{_ as tt,a as ot}from"./DQRyK9Io.js";import{_ as st}from"./BC82eJHt.js";import{g as so,a as at}from"./DBSV6YXN.js";import{_ as ao}from"./Cv9v5fHN.js";import{u as no}from"./CyKRjZZo.js";const lo={class:"rounded-lg border bg-muted/20 p-4"},ro={class:"space-y-4"},io={class:"text-sm font-medium"},uo={class:"mt-1 text-xs text-muted-foreground"},co={class:"text-xs text-muted-foreground"},mo={class:"mt-2 flex flex-wrap gap-2"},po={class:"mt-1 text-sm text-muted-foreground"},fo={class:"mt-1 text-sm font-medium"},qe=G({__name:"BackupProfileCard",props:{title:{},description:{},formats:{},toolHint:{},targetName:{},formatsLabel:{default:"Supported Files"}},setup(p){return(l,t)=>{const o=de;return d(),P("div",lo,[a("div",ro,[a("div",null,[a("p",io,h(l.title),1),a("p",uo,h(l.description),1)]),a("div",null,[a("p",co,h(l.formatsLabel),1),a("div",mo,[(d(!0),P(Q,null,X(l.formats,u=>(d(),E(o,{key:u.format,variant:"outline",class:"font-normal"},{default:i(()=>[k(h(u.extension),1)]),_:2},1024))),128))])]),a("div",null,[t[0]||(t[0]=a("p",{class:"text-xs text-muted-foreground"},"Runtime Tools",-1)),a("p",po,h(l.toolHint),1)]),a("div",null,[t[1]||(t[1]=a("p",{class:"text-xs text-muted-foreground"},"Target",-1)),a("p",fo,h(l.targetName),1)])])])}}}),vo={class:"text-muted-foreground"},go={class:"space-y-2 text-xs"},_o={class:"mt-4 pt-2 border-t border-border/40 flex flex-wrap items-center gap-3"},bo=`brew install postgresql # macOS
1
+ import{_ as qt}from"./s10hyhzI.js";import{d as G,c as P,e as a,t as h,F as Q,x as X,o as d,q as E,w as i,f as k,bi as de,a as s,_ as se,b as F,N as ae,n as me,r as I,am as Z,u as e,bj as ee,k as He,l as oe,m as Je,bS as We,z as Qe,B as Ge,bf as zt,cE as Ke,bm as Xe,cF as At,i as g,bk as Ye,bO as Vt,bP as Ot,bQ as Nt,bR as Mt,bH as Ut,bT as jt,bU as Ht,M as Jt,cG as Wt,bs as Qt,H as ye,G as Ze,a6 as et,bz as Gt,V as Kt,a$ as Xt,D as Yt,ae as Zt,Q as Le,aE as qe,bA as eo,bB as to,bC as oo}from"./DD6NieRw.js";import{_ as tt,a as ot}from"./DghZRCwT.js";import{_ as st}from"./CvFBHqKj.js";import{g as so,a as at}from"./BkHJ3kuB.js";import{_ as ao}from"./C1GKs4YV.js";import{u as no}from"./C9JT2-RE.js";const lo={class:"rounded-lg border bg-muted/20 p-4"},ro={class:"space-y-4"},io={class:"text-sm font-medium"},uo={class:"mt-1 text-xs text-muted-foreground"},co={class:"text-xs text-muted-foreground"},mo={class:"mt-2 flex flex-wrap gap-2"},po={class:"mt-1 text-sm text-muted-foreground"},fo={class:"mt-1 text-sm font-medium"},ze=G({__name:"BackupProfileCard",props:{title:{},description:{},formats:{},toolHint:{},targetName:{},formatsLabel:{default:"Supported Files"}},setup(p){return(l,t)=>{const o=de;return d(),P("div",lo,[a("div",ro,[a("div",null,[a("p",io,h(l.title),1),a("p",uo,h(l.description),1)]),a("div",null,[a("p",co,h(l.formatsLabel),1),a("div",mo,[(d(!0),P(Q,null,X(l.formats,u=>(d(),E(o,{key:u.format,variant:"outline",class:"font-normal"},{default:i(()=>[k(h(u.extension),1)]),_:2},1024))),128))])]),a("div",null,[t[0]||(t[0]=a("p",{class:"text-xs text-muted-foreground"},"Runtime Tools",-1)),a("p",po,h(l.toolHint),1)]),a("div",null,[t[1]||(t[1]=a("p",{class:"text-xs text-muted-foreground"},"Target",-1)),a("p",fo,h(l.targetName),1)])])])}}}),vo={class:"text-muted-foreground"},go={class:"space-y-2 text-xs"},_o={class:"mt-4 pt-2 border-t border-border/40 flex flex-wrap items-center gap-3"},bo=`brew install postgresql # macOS
2
2
  apt-get install postgresql-client # Linux
3
3
  # Windows: Download from https://www.postgresql.org/download/windows/`,ho=`brew install mysql # macOS
4
4
  apt-get install mysql-client # Linux
5
5
  # Windows: Download from https://dev.mysql.com/downloads/`,yo=`brew install sqlite # macOS
6
6
  apt-get install sqlite3 # Linux
7
- # Windows: Download from https://www.sqlite.org/download.html`,xo=G({__name:"BackupRestoreUnsupportedAlert",props:{supportMessage:{},connectionType:{},isLoading:{type:Boolean}},emits:["reload"],setup(p,{emit:l}){const t=l;return(o,u)=>{const m=se,y=st,b=ao,r=ae,f=ot,x=tt;return d(),E(x,null,{default:i(()=>[s(y,{class:"flex items-center font-medium gap-1"},{default:i(()=>[s(m,{name:"hugeicons:alert-circle",class:"size-4"}),u[1]||(u[1]=k(" Native Tools Required"))]),_:1}),s(f,{class:"space-y-3"},{default:i(()=>[a("p",vo,h(o.supportMessage),1),a("div",go,[u[2]||(u[2]=a("p",{class:"font-medium"},"Installation instructions:",-1)),o.connectionType==="postgres"?(d(),E(b,{key:0,code:bo,language:"bash"})):o.connectionType==="mysql"||o.connectionType==="mariadb"?(d(),E(b,{key:1,code:ho,language:"bash"})):o.connectionType==="sqlite3"?(d(),E(b,{key:2,code:yo,language:"bash"})):F("",!0)]),a("div",_o,[s(r,{size:"sm",variant:"outline",class:"cursor-pointer transition-all duration-300 hover:bg-accent hover:text-accent-foreground active:scale-95 group",disabled:o.isLoading,onClick:u[0]||(u[0]=_=>t("reload"))},{default:i(()=>[s(m,{name:"hugeicons:refresh",class:me(["size-4 mr-2 shrink-0",o.isLoading?"animate-spin":"transition-transform duration-500 group-hover:rotate-180"])},null,8,["class"]),k(" "+h(o.isLoading?"Checking...":"Check Again"),1)]),_:1},8,["disabled"]),u[3]||(u[3]=a("span",{class:"text-[11px] text-muted-foreground"}," Installed the tools? Click check again to re-detect capabilities and enable Backup & Restore. ",-1))])]),_:1})]),_:1})}}}),ko={class:"space-y-4"},wo={class:"space-y-2"},$o={class:"grid gap-2 sm:grid-cols-2"},Co=["onClick"],So={class:"flex items-center justify-between gap-2"},Po={class:"text-sm font-medium"},To={class:"mt-1 text-xs text-muted-foreground"},Do={class:"space-y-2"},Bo={key:0,class:"space-y-2"},Eo={key:0,class:"flex flex-wrap gap-2 max-h-32 overflow-y-auto p-2 border rounded-md"},Io={key:1,class:"text-xs text-destructive"},Fo={key:2,class:"text-xs text-muted-foreground"},Ro={key:3,class:"text-xs text-muted-foreground"},ze="plain",Lo=G({__name:"ExportOptionsForm",props:{schemas:{},schemaLoading:{type:Boolean},schemaError:{},loading:{type:Boolean},disabled:{type:Boolean},formatOptions:{},defaultFormat:{},toolHint:{}},emits:["submit"],setup(p,{emit:l}){var f;const t=p,o=l,u=I("full"),m=I(t.defaultFormat||((f=t.formatOptions[0])==null?void 0:f.format)||ze),y=I([]);Z([()=>t.formatOptions,()=>t.defaultFormat],([x,_])=>{var w;x.some(D=>D.format===m.value)||(m.value=((w=x[0])==null?void 0:w.format)||_||ze)},{immediate:!0});const b=[{value:"full",label:"Full (schema + data)"},{value:"schema-only",label:"Schema only (no data)"},{value:"data-only",label:"Data only (no schema)"}],r=()=>{const x={format:m.value,scope:u.value};x.schemas=y.value.length>0?y.value:t.schemas,o("submit",x)};return(x,_)=>{const w=We,D=Je,v=Ge,T=Qe,B=He,R=se,A=ae;return d(),P("div",ko,[a("div",wo,[s(e(ee),null,{default:i(()=>_[1]||(_[1]=[k("Backup Format")])),_:1}),a("div",$o,[(d(!0),P(Q,null,X(x.formatOptions,C=>(d(),P("button",{key:C.format,type:"button",class:me(["rounded-lg border p-3 text-left transition-colors",e(m)===C.format?"border-primary bg-primary/5":"hover:border-primary/40 hover:bg-muted/20"]),onClick:H=>m.value=C.format},[a("div",So,[a("p",Po,h(C.label),1),s(e(de),{variant:"secondary",class:"font-normal"},{default:i(()=>[k(h(C.extension),1)]),_:2},1024)]),a("p",To," Runtime uses "+h(t.toolHint||"Native database tools")+". ",1)],10,Co))),128))])]),a("div",Do,[s(e(ee),null,{default:i(()=>_[2]||(_[2]=[k("Export Scope")])),_:1}),s(B,{modelValue:e(u),"onUpdate:modelValue":_[0]||(_[0]=C=>oe(u)?u.value=C:null),size:"xs"},{default:i(()=>[s(D,null,{default:i(()=>[s(w,{placeholder:"Select scope"})]),_:1}),s(T,null,{default:i(()=>[(d(),P(Q,null,X(b,C=>s(v,{key:C.value,value:C.value},{default:i(()=>[k(h(C.label),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["modelValue"])]),x.schemaLoading||x.schemaError||x.schemas.length>0?(d(),P("div",Bo,[s(e(ee),null,{default:i(()=>_[3]||(_[3]=[k("Schemas (optional)")])),_:1}),x.schemas.length>0?(d(),P("div",Eo,[(d(!0),P(Q,null,X(x.schemas,C=>(d(),E(e(de),{key:C,variant:e(y).includes(C)?"default":"outline",class:"cursor-pointer",onClick:()=>e(y).includes(C)?y.value=e(y).filter(H=>H!==C):e(y).push(C)},{default:i(()=>[k(h(C),1)]),_:2},1032,["variant","onClick"]))),128))])):F("",!0),x.schemaError?(d(),P("p",Io,h(x.schemaError),1)):x.schemaLoading?(d(),P("p",Fo," Loading schemas... ")):(d(),P("p",Ro,h(e(y).length?`${e(y).length} selected`:"All visible schemas"),1))])):F("",!0),s(A,{class:"w-full",disabled:x.loading||x.disabled,onClick:r},{default:i(()=>[x.loading?(d(),E(R,{key:0,name:"hugeicons:loading-03",class:"size-4 mr-2 animate-spin"})):(d(),E(R,{key:1,name:"lucide:download",class:"size-4 mr-2"})),k(" "+h(x.loading?"Creating Backup...":"Create Backup"),1)]),_:1},8,["disabled"])])}}}),Ao={class:"relative mt-2 cursor-pointer rounded-lg border-2 border-dashed p-6 text-center transition-colors hover:border-primary/50"},qo=["accept"],zo={key:0,class:"text-muted-foreground pointer-events-none"},Vo={class:"text-xs mt-1"},Oo={key:1,class:"flex items-center justify-center gap-3"},No={class:"text-left"},Mo={class:"text-sm font-medium"},Uo={class:"text-xs text-muted-foreground"},jo=G({__name:"ImportFileDropzone",props:{selectedFile:{},accept:{},extensionSummary:{}},emits:["change","clear"],setup(p){const l=t=>t<1024?`${t} B`:t<1048576?`${(t/1024).toFixed(1)} KB`:`${(t/1048576).toFixed(1)} MB`;return(t,o)=>{const u=ee,m=se,y=ae;return d(),P("div",null,[s(u,{class:"text-sm font-medium"},{default:i(()=>o[2]||(o[2]=[k("Backup File")])),_:1}),a("div",Ao,[a("input",{type:"file",accept:t.accept,class:"absolute inset-0 w-full h-full opacity-0 cursor-pointer",onChange:o[0]||(o[0]=b=>t.$emit("change",b))},null,40,qo),t.selectedFile?(d(),P("div",Oo,[s(m,{name:"hugeicons:file-01",class:"size-8 text-primary"}),a("div",No,[a("p",Mo,h(t.selectedFile.name),1),a("p",Uo,h(l(t.selectedFile.size)),1)]),s(y,{variant:"ghost",size:"icon",class:"ml-2 relative z-10",type:"button",onClick:o[1]||(o[1]=qt(b=>t.$emit("clear"),["stop"]))},{default:i(()=>[s(m,{name:"hugeicons:x-close",class:"size-4"})]),_:1})])):(d(),P("div",zo,[s(m,{name:"hugeicons:upload-cloud-01",class:"size-10 mx-auto mb-2 opacity-50"}),o[3]||(o[3]=a("p",{class:"text-sm font-medium"},"Click to select a file",-1)),a("p",Vo,"Supports "+h(t.extensionSummary)+" backups",1)]))])])}}}),Ho={class:"space-y-3"},Jo={class:"grid grid-cols-2 gap-4"},Wo=G({__name:"ImportOptionsForm",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(p){const l=Ke(p,"modelValue"),t=(u,m)=>{l.value[u]=m},o=[{key:"clean",label:"Drop Objects First",id:"import-clean"},{key:"dataOnly",label:"Data Only",id:"import-data-only"},{key:"schemaOnly",label:"Schema Only",id:"import-schema-only"},{key:"exitOnError",label:"Exit on Error",id:"import-exit-on-error"}];return(u,m)=>{const y=ee,b=Xe;return d(),P("div",Ho,[s(y,{class:"text-sm font-medium"},{default:i(()=>m[0]||(m[0]=[k("Options")])),_:1}),a("div",Jo,[(d(),P(Q,null,X(o,r=>a("div",{key:r.key,class:"flex items-center space-x-2"},[s(b,{id:r.id,"model-value":l.value[r.key],"onUpdate:modelValue":f=>t(r.key,f)},null,8,["id","model-value","onUpdate:modelValue"]),s(y,{for:r.id,class:"text-sm"},{default:i(()=>[k(h(r.label),1)]),_:2},1032,["for"])])),64))])])}}}),Qo={class:"space-y-3 rounded-lg border border-dashed p-3"},Go={class:"flex items-start justify-between gap-3"},Ko={class:"space-y-1"},Xo={key:0,class:"text-xs text-muted-foreground"},Yo={key:0,class:"space-y-2"},Zo={key:1,class:"flex items-start justify-between gap-3 rounded-md bg-muted/40 px-3 py-2"},es={key:2,class:"text-xs text-muted-foreground"},ts={key:3,class:"grid gap-3 md:grid-cols-[180px_minmax(0,1fr)]"},os={class:"space-y-1"},ss={class:"space-y-1"},Ve=G({__name:"NativeToolSelector",props:zt({title:{},description:{},detectedPaths:{},toolChoices:{},disabled:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(p){const l=p,t=Ke(p,"modelValue"),o=g(()=>l.detectedPaths.length>0),u=g(()=>t.value.useCustomPath||!o.value),m=g(()=>l.detectedPaths.length===1?"1 executable found":`${l.detectedPaths.length} executables found`),y=g(()=>{switch(t.value.customTool||l.toolChoices[0]){case"pg_dump":return"/Applications/Postgres.app/.../bin/pg_dump";case"pg_restore":return"/Applications/Postgres.app/.../bin/pg_restore";case"psql":return"/Applications/Postgres.app/.../bin/psql";case"mysqldump":return"/opt/homebrew/Cellar/mysql/.../bin/mysqldump";case"mysqlpump":return"/opt/homebrew/Cellar/mysql/.../bin/mysqlpump";case"mysql":return"/opt/homebrew/Cellar/mysql/.../bin/mysql";case"sqlite3":return"/usr/local/bin/sqlite3";default:return"/usr/local/bin/native-tool"}}),b=_=>{t.value.selectedPath=_},r=_=>{t.value.customTool=_},f=_=>{t.value.useCustomPath=o.value?_:!0},x=_=>`${_.tool} • ${_.path}`;return(_,w)=>{const D=ee,v=de,T=We,B=Je,R=Ge,A=Qe,C=He,H=Xe,S=Ye;return d(),P("div",Qo,[a("div",Go,[a("div",Ko,[s(D,{class:"text-sm font-medium"},{default:i(()=>[k(h(_.title),1)]),_:1}),_.description?(d(),P("p",Xo,h(_.description),1)):F("",!0)]),e(o)?(d(),E(v,{key:0,variant:"secondary",class:"shrink-0"},{default:i(()=>[k(h(e(m)),1)]),_:1})):F("",!0)]),e(o)&&!t.value.useCustomPath?(d(),P("div",Yo,[s(D,{class:"text-xs font-medium text-muted-foreground"},{default:i(()=>w[4]||(w[4]=[k(" Detected Executable ")])),_:1}),s(C,{"model-value":t.value.selectedPath,disabled:_.disabled,size:"xs","onUpdate:modelValue":w[0]||(w[0]=$=>b(String($)))},{default:i(()=>[s(B,null,{default:i(()=>[s(T,{placeholder:"Choose a native tool"})]),_:1}),s(A,null,{default:i(()=>[(d(!0),P(Q,null,X(_.detectedPaths,$=>(d(),E(R,{key:$.path,value:$.path},{default:i(()=>[k(h(x($)),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["model-value","disabled"])])):F("",!0),e(o)?(d(),P("div",Zo,[w[5]||(w[5]=a("div",{class:"space-y-1"},[a("p",{class:"text-sm font-medium"},"Use custom executable path"),a("p",{class:"text-xs text-muted-foreground"}," Point HeraQ to a specific binary when you need a different version. ")],-1)),s(H,{"model-value":t.value.useCustomPath,disabled:_.disabled,"onUpdate:modelValue":w[1]||(w[1]=$=>f(!!$))},null,8,["model-value","disabled"])])):(d(),P("p",es," No executable was detected automatically. Enter the full path to the driver you want to run. ")),e(u)?(d(),P("div",ts,[a("div",os,[s(D,{class:"text-xs font-medium text-muted-foreground"},{default:i(()=>w[6]||(w[6]=[k(" Tool ")])),_:1}),s(C,{"model-value":t.value.customTool||_.toolChoices[0],disabled:_.disabled,size:"sm","onUpdate:modelValue":w[2]||(w[2]=$=>r(String($)))},{default:i(()=>[s(B,null,{default:i(()=>[s(T,{placeholder:"Choose a tool"})]),_:1}),s(A,null,{default:i(()=>[(d(!0),P(Q,null,X(_.toolChoices,$=>(d(),E(R,{key:$,value:$},{default:i(()=>[k(h($),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["model-value","disabled"])]),a("div",ss,[s(D,{class:"text-xs font-medium text-muted-foreground"},{default:i(()=>w[7]||(w[7]=[k(" Executable Path ")])),_:1}),s(S,{modelValue:t.value.customPath,"onUpdate:modelValue":w[3]||(w[3]=$=>t.value.customPath=$),disabled:_.disabled,placeholder:e(y),class:"h-8!",autocomplete:"off",spellcheck:"false"},null,8,["modelValue","disabled","placeholder"]),w[8]||(w[8]=a("p",{class:"text-xs text-muted-foreground"}," Enter the absolute path to the binary you want HeraQ to execute. ",-1))])])):F("",!0)])}}}),as={class:"space-y-3 py-1"},xe="restore backup",ns=G({__name:"RestoreConfirmDialog",props:{open:{type:Boolean}},emits:["confirm","cancel"],setup(p,{emit:l}){const t=p,o=l,u=I("");Z(()=>t.open,b=>{b&&(u.value="")});const m=g(()=>u.value===xe),y=()=>{m.value&&o("confirm")};return(b,r)=>{const f=se,x=Nt,_=Mt,w=Ot,D=ee,v=Ye,T=ae,B=jt,R=Ht,A=Vt;return d(),E(A,{open:b.open,"onUpdate:open":r[2]||(r[2]=C=>!C&&b.$emit("cancel"))},{default:i(()=>[s(R,{class:"max-w-sm"},{default:i(()=>[s(w,null,{default:i(()=>[s(x,{class:"flex items-center gap-2 text-destructive"},{default:i(()=>[s(f,{name:"hugeicons:alert-02",class:"size-5"}),r[3]||(r[3]=k(" Confirm Restore "))]),_:1}),s(_,null,{default:i(()=>r[4]||(r[4]=[k(" This will overwrite existing data in the target database. This action cannot be undone. ")])),_:1})]),_:1}),a("div",as,[s(D,{for:"restore-confirm-input"},{default:i(()=>[r[5]||(r[5]=k(" Type ")),a("code",{class:"rounded bg-muted px-1 py-0.5 text-xs font-mono"},h(xe)),r[6]||(r[6]=k(" to continue: "))]),_:1}),s(v,{id:"restore-confirm-input",modelValue:e(u),"onUpdate:modelValue":r[0]||(r[0]=C=>oe(u)?u.value=C:null),placeholder:xe,autocomplete:"off",onKeydown:Ut(y,["enter"])},null,8,["modelValue"])]),s(B,null,{default:i(()=>[s(T,{variant:"outline",onClick:r[1]||(r[1]=C=>b.$emit("cancel"))},{default:i(()=>r[7]||(r[7]=[k("Cancel")])),_:1}),s(T,{variant:"destructive",disabled:!e(m),onClick:y},{default:i(()=>r[8]||(r[8]=[k(" Restore ")])),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["open"])}}}),ls={class:"rounded-lg border bg-muted/30 p-4"},rs={class:"flex items-center justify-between gap-4"},is={class:"text-sm font-medium"},us={class:"text-xs text-muted-foreground"},cs={class:"flex shrink-0 items-center gap-2"},ds={class:"text-sm font-medium"},ms={class:"mt-3 h-2 overflow-hidden rounded-full bg-border/60"},Oe=G({__name:"TransferProgressCard",props:{tool:{},stage:{},statusMessage:{},progress:{},isRunning:{type:Boolean},progressClass:{default:"bg-primary"},actionLabel:{default:void 0},actionDisabled:{type:Boolean,default:!1}},emits:["action"],setup(p,{emit:l}){const t=l;return(o,u)=>{const m=se,y=ae;return d(),P("div",ls,[a("div",rs,[a("div",null,[a("p",is,h(o.tool)+" · "+h(o.stage),1),a("p",us,h(o.statusMessage||"Preparing job..."),1)]),a("div",cs,[o.actionLabel?(d(),E(y,{key:0,type:"button",variant:"outline",size:"sm",disabled:o.actionDisabled,onClick:u[0]||(u[0]=b=>t("action"))},{default:i(()=>[s(m,{name:"lucide:folder-open",class:"size-4 mr-2"}),k(" "+h(o.actionLabel),1)]),_:1},8,["disabled"])):F("",!0),a("span",ds,h(o.progress)+"%",1)])]),a("div",ms,[a("div",{class:me(["h-full rounded-full transition-all duration-300",o.progressClass]),style:Jt({width:`${Math.max(o.progress,o.isRunning?8:0)}%`})},null,6)])])}}});function Ne(p){return!!(p&&(p.status==="completed"||p.status==="error"))}const nt=()=>{const p=I(null),l=I(null),t=I(null),o=I(!1);let u=null,m=null;const y=v=>{u==null||u(v),u=null,m=null},b=v=>{m==null||m(v),u=null,m=null},r=async()=>{if(!t.value)throw new Error("Backup job status URL is missing.");if(o.value){if(p.value)return p.value;throw new Error("Backup job refresh is already in progress.")}o.value=!0;try{const v=await $fetch(t.value);return p.value=v,v.status==="error"&&(l.value=v.error||v.message),Ne(v)&&(f(),y(v)),v}catch(v){const T=v instanceof Error?v:new Error("Failed to refresh backup job status.");throw l.value=T.message,f(),b(T),T}finally{o.value=!1}},{pause:f,resume:x,isActive:_}=Wt(()=>{r()},1e3,{immediate:!1,immediateCallback:!1}),w=async v=>{t.value=v,l.value=null;const T=await r();return Ne(T)?T:(x(),await new Promise((B,R)=>{u=B,m=R}))},D=()=>{f(),t.value=null,p.value=null,l.value=null,o.value=!1,u=null,m=null};return Qt(()=>{f()}),{job:p,error:l,isRefreshing:o,isPolling:_,progress:g(()=>{var v;return((v=p.value)==null?void 0:v.progress)??0}),message:g(()=>{var v;return((v=p.value)==null?void 0:v.message)??null}),stage:g(()=>{var v;return((v=p.value)==null?void 0:v.stage)??"queued"}),status:g(()=>{var v;return((v=p.value)==null?void 0:v.status)??"queued"}),isRunning:g(()=>{var v,T;return((v=p.value)==null?void 0:v.status)==="queued"||((T=p.value)==null?void 0:T.status)==="running"}),monitorJob:w,refresh:r,reset:D}},ps=p=>(p||"database").trim().replace(/[\\/:*?"<>|]+/g,"-").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")||"database",fs=()=>new Date().toISOString().replace(/[:.]/g,"-"),vs=(p,l)=>`${p.replace(/[\\/]$/,"")}/${l}`,Me=p=>!Number.isFinite(p)||p<=0?"0.0s":`${(p/1e3).toFixed(1)}s`,gs=(p,l)=>{const t=I(null),o=I(null),u=nt(),{downloadStream:m,isDownloading:y,downloadedBytes:b}=no(),r=g(()=>u.isRunning.value||y.value),f=g(()=>o.value||y.value?100:u.progress.value),x=g(()=>o.value?`Backup is ready. ${ye(o.value.size)} generated in ${Me(o.value.duration)}.`:y.value?`Saving backup artifact (${ye(b.value)})...`:u.message.value),_=g(()=>u.job.value),w=async(T,B)=>{var H,S,$,M,z,W;if(!p.value)return t.value="No database connection provided",!1;const{options:R,runtime:A,promptForSaveLocation:C}=B;if(l!=null&&l.value&&!l.value.exportAvailable&&!((H=A==null?void 0:A.executablePath)!=null&&H.trim()))return t.value=l.value.exportMessage,!1;t.value=null,o.value=null;try{let L=((S=B.saveDirectoryPath)==null?void 0:S.trim())||void 0,V=(($=B.saveFilePath)==null?void 0:$.trim())||void 0;const K=`${ps(T)}_backup_${fs()}${D((M=p.value)==null?void 0:M.type,R.format)}`;if(!L&&!V&&C&&((z=window.electronAPI)!=null&&z.window.pickDirectory)){const q=await window.electronAPI.window.pickDirectory();if(!q)return t.value="No save location was selected.",!1;L=q}!V&&L&&(V=vs(L,K));const J=await $fetch("/api/database-export/export-database",{method:"POST",body:{...Ze(p.value),databaseName:T,options:R,runtime:A}}),j=await u.monitorJob(J.statusUrl);if(j.status==="error")return t.value=j.error||j.message,!1;if(!j.downloadUrl||!j.downloadFileName)return t.value="Export finished but no download artifact was returned.",!1;const te=await m({url:j.downloadUrl,method:"GET",filename:V?K:j.downloadFileName||K,saveFilePath:V,openPath:L,successTitle:"Backup is ready",getSuccessDescription:q=>`${ye(q)} generated in ${Me(j.duration||0)}.`});return te.success?(o.value={fileName:V?K:j.downloadFileName,duration:j.duration||0,size:te.size||0,saveDirectoryPath:L,saveFilePath:V},!0):(t.value=((W=te.error)==null?void 0:W.message)||"Download failed.",!1)}catch(L){return t.value=L instanceof Error?L.message:"Export failed. Check the connection and backup configuration.",console.error("Export error:",L),!1}},D=(T,B)=>so(T,B);return{isExporting:r,progress:f,error:t,lastExport:o,currentJob:_,statusMessage:x,exportDatabase:w,reset:()=>{u.reset(),t.value=null,o.value=null}}},_s=(p,l)=>{const t=nt(),o=g(()=>t.isRunning.value),u=g(()=>t.progress.value),m=g(()=>t.message.value),y=g(()=>t.job.value),b=I(null),r=I(null),f=I(null),x=I(null),_=I({clean:!1,dataOnly:!1,schemaOnly:!1,exitOnError:!0}),w=g(()=>{var S;return(S=p.value)==null?void 0:S.type}),D=g(()=>{var S;return((S=l.value)==null?void 0:S.formatOptions)||[]}),v=g(()=>at(w.value)),T=g(()=>{var S;return((S=l.value)==null?void 0:S.acceptExtensions)||D.value.map($=>$.extension).join(" / ")||".sql"}),B=()=>{f.value=null,x.value&&(x.value.value="")};return{isImporting:o,progress:u,statusMessage:m,currentJob:y,error:b,success:r,selectedFile:f,fileInputRef:x,options:_,extensionSummary:T,clearSelectedFile:B,openFilePicker:()=>{var S;(S=x.value)==null||S.click()},onFileSelect:S=>{var W;const $=S.target;if(!((W=$.files)!=null&&W.length))return;const M=$.files[0];if(!D.value.some(L=>M.name.toLowerCase().endsWith(L.extension.toLowerCase()))){B(),b.value=`Unsupported file type. Use ${T.value} for ${v.value}.`,r.value=null;return}f.value=M,b.value=null,r.value=null},importDatabase:async S=>{var $,M;if(!(!f.value||!p.value)){if(l.value&&!l.value.importAvailable&&!(($=S==null?void 0:S.executablePath)!=null&&$.trim())){b.value=l.value.importMessage,r.value=null;return}b.value=null,r.value=null;try{const z=new FormData;z.append("file",f.value);const W=Ze(p.value);Object.entries(W).forEach(([K,J])=>{J!==void 0&&z.append(K,typeof J=="object"?JSON.stringify(J):String(J))}),z.append("options",JSON.stringify(_.value)),(M=S==null?void 0:S.executablePath)!=null&&M.trim()&&z.append("runtime",JSON.stringify(S));const L=await $fetch("/api/database-import/import-database",{method:"POST",body:z}),V=await t.monitorJob(L.statusUrl);if(V.status==="completed"){r.value=V.message||"Database imported successfully",B();return}b.value=V.error||V.message||"Import failed"}catch(z){b.value=z instanceof Error?z.message:"Import failed. Check the backup file and connection compatibility.",console.error("Import error:",z)}}},reset:()=>{t.reset(),b.value=null,r.value=null,B()}}},bs=p=>{const l=I(null),t=I(!1),o=I(null);let u=0;const m=async()=>{const y=p.value,b=++u;if(!y){l.value=null,o.value=null,t.value=!1;return}t.value=!0,o.value=null;try{const r=await $fetch("/api/database-backup/capability",{query:{type:y,discoverAll:et()}});if(b!==u)return;l.value=r}catch(r){if(b!==u)return;l.value=null,o.value=r instanceof Error?r.message:"Unable to detect native backup tools."}finally{b===u&&(t.value=!1)}};return Z(p,()=>{m()},{immediate:!0}),{capability:l,isLoading:t,error:o,refresh:m}};function Ue(){return{useCustomPath:!1,selectedPath:"",customPath:"",customTool:""}}const je=(p,l,t)=>{const o=I(Ue()),u=g(()=>{const r=new Set(l.value);return p.value.filter(f=>r.size===0||r.has(f.tool))}),m=g(()=>u.value.find(r=>r.path===o.value.selectedPath)||null);Z([u,l,t],([r,f,x])=>{var _;if(!x){o.value=Ue();return}if(f.includes(o.value.customTool)||(o.value.customTool=f[0]||""),r.some(w=>w.path===o.value.selectedPath)||(o.value.selectedPath=((_=r[0])==null?void 0:_.path)||""),!r.length){o.value.useCustomPath=!0;return}o.value.useCustomPath&&!o.value.customPath.trim()&&(o.value.useCustomPath=!1)},{immediate:!0});const y=g(()=>{if(t.value){if(o.value.useCustomPath){const r=o.value.customPath.trim(),f=o.value.customTool;return!r||!f?void 0:{tool:f,executablePath:r}}if(m.value)return{tool:m.value.tool,executablePath:m.value.path}}}),b=g(()=>!t.value||!!y.value);return{selection:o,filteredToolPaths:u,runtimeSelection:y,canSubmit:b}},hs={class:"flex flex-col h-full gap-3 overflow-hidden p-3"},ys={class:"font-medium text-foreground"},xs={class:"text-muted-foreground/60"},ks={class:"flex items-center justify-between gap-2"},ws={class:"text-xs text-muted-foreground"},$s={class:"relative flex-1 overflow-y-auto rounded-lg border bg-background p-4"},Cs={class:"space-y-4"},Ss={class:"flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between"},Ps={class:"mt-1 text-sm text-muted-foreground"},Ts={class:"grid gap-4 xl:grid-cols-[minmax(0,1fr)_280px]"},Ds={class:"rounded-lg border p-4 space-y-4"},Bs={class:"space-y-4"},Es={class:"flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between"},Is={class:"mt-1 text-sm text-muted-foreground"},Fs={class:"grid gap-4 xl:grid-cols-[minmax(0,1fr)_280px]"},Rs={class:"rounded-lg border p-4 space-y-4"},Ls={class:"text-muted-foreground text-xs inline-flex items-center gap-0.5"},As={class:"text-destructive gap-0.5 items-center inline-flex"},Hs=G({__name:"BackupRestoreContainer",props:{connectionId:{},initialTab:{}},setup(p){const l=p,{workspaceId:t}=Gt(),o=Kt(),u=Xt(),m=g(()=>{if(l.connectionId)return o.connections.find(n=>n.id===l.connectionId)}),y=g(()=>{var n;return(n=m.value)==null?void 0:n.type}),b=g(()=>{var n,c;return((n=m.value)==null?void 0:n.database)||((c=m.value)==null?void 0:c.name)||"database"}),r=g(()=>at(y.value)),{capability:f,isLoading:x,error:_,refresh:w}=bs(y),D=I(!1),v=g(()=>et()),T=async()=>{D.value=!0;try{await w()}finally{D.value=!1}},B=g(()=>{var n;return((n=f.value)==null?void 0:n.supported)??!1}),R=g(()=>{var n;return((n=f.value)==null?void 0:n.exportAvailable)??!1}),A=g(()=>{var n;return((n=f.value)==null?void 0:n.importAvailable)??!1}),C=g(()=>B.value&&(R.value||v.value)),H=g(()=>B.value&&(A.value||v.value)),S=g(()=>_.value?_.value:f.value?f.value.supportMessage:y.value?`Checking ${r.value} native tools...`:"Select a connection to open database tools."),$=g(()=>{var n;return((n=f.value)==null?void 0:n.toolHint)||"Native database tools"}),M=g(()=>{var n;return((n=f.value)==null?void 0:n.formatOptions)||[]}),z=g(()=>{var n;return((n=f.value)==null?void 0:n.acceptExtensions)||".sql"}),W=g(()=>M.value.map(n=>n.extension).join(" / ")||".sql"),L=g(()=>{var n,c;return x.value||!B.value||R.value&&A.value?null:[R.value?null:(n=f.value)==null?void 0:n.exportMessage,A.value?null:(c=f.value)==null?void 0:c.importMessage].filter(Boolean).join(" ")}),V=g(()=>{var c;if(!l.connectionId)return[];const n=t.value||((c=m.value)==null?void 0:c.workspaceId);return(u.schemas[l.connectionId]||[]).filter(U=>U.connectionId===l.connectionId&&(!n||U.workspaceId===n)).map(U=>U.name)}),K=g(()=>u.loading[l.connectionId]||!1),J=I(null),j=async()=>{const n=m.value,c=t.value||(n==null?void 0:n.workspaceId);if(!l.connectionId||!c||!n)return;if((u.schemas[l.connectionId]||[]).some(O=>O.connectionId===l.connectionId&&O.workspaceId===c)){J.value=null;return}try{J.value=null,await u.fetchSchemas({connectionId:l.connectionId,workspaceId:c,connection:n})}catch(O){J.value=O instanceof Error?O.message:"Failed to load schemas."}};Z([m,()=>t.value],()=>{j()},{immediate:!0});const te=[{id:"export",tabLabel:"Create Backup",subtitle:"Generate native backup artifacts for the current connection.",icon:"hugeicons:download-01"},{id:"import",tabLabel:"Restore Backup",subtitle:"Apply a native backup artifact back into this connection.",icon:"hugeicons:upload-01"}],q=I(l.initialTab),lt=g(()=>te.find(n=>n.id===q.value));Z(()=>l.initialTab,n=>{q.value=n}),Z([q,C,H],([n,c,U])=>{if(n==="export"&&!c&&U){q.value="import";return}n==="import"&&!U&&c&&(q.value="export")},{immediate:!0});const rt=n=>{q.value=n},{isExporting:ne,progress:it,error:ke,lastExport:we,currentJob:pe,statusMessage:ut,exportDatabase:ct,reset:dt}=gs(m,f),$e=(n=[],c=[])=>[...new Set([...n,...c])],Ce=g(()=>{var n,c;return $e(((n=f.value)==null?void 0:n.availableExportTools)||[],((c=f.value)==null?void 0:c.missingExportTools)||[])}),mt=g(()=>{var n;return((n=f.value)==null?void 0:n.availableExportToolPaths)||[]}),{selection:fe,filteredToolPaths:pt,runtimeSelection:ft,canSubmit:vt}=je(mt,Ce,v),gt=async()=>{var c,U;const n=(c=we.value)==null?void 0:c.saveDirectoryPath;!n||!((U=window.electronAPI)!=null&&U.window.openPath)||await window.electronAPI.window.openPath(n)},_t=async n=>{await ct(b.value,{options:n,runtime:ft.value,promptForSaveLocation:v.value,saveDirectoryPath:void 0})},{isImporting:Y,progress:bt,statusMessage:ht,currentJob:ve,error:Se,success:Pe,selectedFile:ue,options:ge,extensionSummary:yt,onFileSelect:xt,clearSelectedFile:kt,importDatabase:wt,reset:$t}=_s(m,f),Ct=g(()=>{var n,c;return $e(((n=f.value)==null?void 0:n.availableImportTools)||[],((c=f.value)==null?void 0:c.missingImportTools)||[])}),_e=g(()=>{var n;return y.value!==Yt.POSTGRES||!((n=ue.value)!=null&&n.name)?Ct.value:[ue.value.name.toLowerCase().endsWith(".dump")?"pg_restore":"psql"]}),St=g(()=>{var n;return(((n=f.value)==null?void 0:n.availableImportToolPaths)||[]).filter(c=>_e.value.includes(c.tool))}),{selection:be,filteredToolPaths:Pt,runtimeSelection:Tt,canSubmit:Dt}=je(St,_e,v),ce=I(!1),Bt=()=>{ce.value=!0},Et=async()=>{ce.value=!1,await wt(Tt.value)},It=()=>{ce.value=!1};return(n,c)=>{var Te,De,Be,Ee,Ie,Fe,Re;const U=At,O=se,Ft=oo,Rt=to,Lt=eo,le=st,re=ot,ie=tt,he=ae;return d(),P("div",hs,[s(ns,{open:e(ce),onConfirm:Et,onCancel:It},null,8,["open"]),s(U,{icon:"hugeicons:database-import",title:"Backup & Restore"},{context:i(()=>[a("span",ys,h(e(b)),1),a("span",xs,"· "+h(e(r)),1)]),_:1}),a("div",ks,[s(Lt,{modelValue:e(q),"onUpdate:modelValue":c[0]||(c[0]=N=>oe(q)?q.value=N:null),class:"min-w-0 flex-1 gap-0"},{default:i(()=>[s(Rt,{size:"sm",class:"max-w-full justify-start! overflow-x-auto"},{default:i(()=>[(d(),P(Q,null,X(te,N=>s(Ft,{size:"xs",key:N.id,value:N.id,class:"min-w-fit shrink-0 cursor-pointer rounded-sm",disabled:e(x)||(N.id==="export"?!e(C):!e(H)),onClick:qs=>rt(N.id)},{default:i(()=>[s(O,{name:N.icon,class:"shrink-0 size-3.5"},null,8,["name"]),k(" "+h(N.tabLabel),1)]),_:2},1032,["value","disabled","onClick"])),64))]),_:1})]),_:1},8,["modelValue"]),a("div",ws,h((Te=e(lt))==null?void 0:Te.subtitle),1)]),a("div",$s,[e(x)&&!e(D)?(d(),E(Zt,{key:0,visible:""})):F("",!0),(!e(x)||e(D))&&e(_)?(d(),E(ie,{key:1,variant:"destructive"},{default:i(()=>[s(O,{name:"hugeicons:alert-circle",class:"size-4"}),s(le,null,{default:i(()=>c[4]||(c[4]=[k("Capability Check Failed")])),_:1}),s(re,null,{default:i(()=>[k(h(e(S)),1)]),_:1})]),_:1})):(!e(x)||e(D))&&!e(B)?(d(),E(xo,{key:2,"support-message":e(S),"connection-type":e(y),"is-loading":e(D),onReload:T},null,8,["support-message","connection-type","is-loading"])):!e(x)&&!e(D)?(d(),P(Q,{key:3},[e(L)?(d(),E(ie,{key:0},{default:i(()=>[s(O,{name:"hugeicons:alert-circle",class:"size-4"}),s(le,null,{default:i(()=>c[5]||(c[5]=[k("Partial Native Tool Support")])),_:1}),s(re,null,{default:i(()=>[k(h(e(L)),1)]),_:1})]),_:1})):F("",!0),Le(a("div",Cs,[a("div",Ss,[a("div",null,[c[6]||(c[6]=a("h3",{class:"text-base font-medium"},"Create Backup",-1)),a("p",Ps," Export "+h(e(b))+" using "+h(e($))+". ",1)])]),e(ke)?(d(),E(ie,{key:0,variant:"destructive"},{default:i(()=>[s(O,{name:"hugeicons:alert-circle",class:"size-4"}),s(le,null,{default:i(()=>c[7]||(c[7]=[k("Backup Failed")])),_:1}),s(re,null,{default:i(()=>[k(h(e(ke)),1)]),_:1}),s(he,{size:"sm",variant:"outline",class:"mt-2",onClick:e(dt)},{default:i(()=>c[8]||(c[8]=[k(" Try Again ")])),_:1},8,["onClick"])]),_:1})):F("",!0),e(ne)||e(pe)?(d(),E(Oe,{key:1,tool:((De=e(pe))==null?void 0:De.tool)||e($),stage:((Be=e(pe))==null?void 0:Be.stage)||"queued","status-message":e(ut)||"",progress:e(it),"is-running":e(ne),"action-label":(Ee=e(we))!=null&&Ee.saveDirectoryPath&&!e(ne)?"Open":void 0,onAction:gt},null,8,["tool","stage","status-message","progress","is-running","action-label"])):F("",!0),a("div",Ts,[a("div",Ds,[e(v)?(d(),E(Ve,{key:0,modelValue:e(fe),"onUpdate:modelValue":c[1]||(c[1]=N=>oe(fe)?fe.value=N:null),title:"Backup Driver",description:"Choose the exact executable OrcaQ should run for this backup job.","detected-paths":e(pt),"tool-choices":e(Ce),disabled:e(ne)},null,8,["modelValue","detected-paths","tool-choices","disabled"])):F("",!0),s(Lo,{schemas:e(V),"schema-loading":e(K),"schema-error":e(J),loading:e(ne),disabled:e(v)&&!e(vt),"format-options":e(M),"default-format":(Ie=e(f))==null?void 0:Ie.defaultExportFormat,"tool-hint":e($),onSubmit:_t},null,8,["schemas","schema-loading","schema-error","loading","disabled","format-options","default-format","tool-hint"])]),s(qe,{title:"Backup Profile",description:"Exports run on the local runtime host and stream the artifact directly into a downloadable file.",formats:e(M),"tool-hint":e($),"target-name":e(b),"formats-label":"Supported Files"},null,8,["formats","tool-hint","target-name"])])],512),[[Ae,e(q)==="export"]]),Le(a("div",Bs,[a("div",Es,[a("div",null,[c[9]||(c[9]=a("h3",{class:"text-base font-medium"},"Restore Backup",-1)),a("p",Is," Restore a "+h(e(W))+" backup into "+h(e(b))+". ",1)])]),e(Se)?(d(),E(ie,{key:0,variant:"destructive"},{default:i(()=>[s(O,{name:"hugeicons:alert-circle",class:"size-4"}),s(le,null,{default:i(()=>c[10]||(c[10]=[k("Import Failed")])),_:1}),s(re,null,{default:i(()=>[k(h(e(Se)),1)]),_:1}),s(he,{size:"sm",variant:"outline",class:"mt-2",onClick:e($t)},{default:i(()=>c[11]||(c[11]=[k(" Try Again ")])),_:1},8,["onClick"])]),_:1})):F("",!0),e(Pe)?(d(),E(ie,{key:1},{default:i(()=>[s(O,{name:"hugeicons:checkmark-circle-02",class:"size-4 text-green-500"}),s(le,null,{default:i(()=>c[12]||(c[12]=[k("Import Complete")])),_:1}),s(re,null,{default:i(()=>[k(h(e(Pe)),1)]),_:1})]),_:1})):F("",!0),e(Y)||e(ve)?(d(),E(Oe,{key:2,tool:((Fe=e(ve))==null?void 0:Fe.tool)||e($),stage:((Re=e(ve))==null?void 0:Re.stage)||"queued","status-message":e(ht)||"",progress:e(bt),"is-running":e(Y),"progress-class":"bg-emerald-500"},null,8,["tool","stage","status-message","progress","is-running"])):F("",!0),a("div",Fs,[a("div",Rs,[s(jo,{"selected-file":e(ue),accept:e(z),"extension-summary":e(yt),onChange:e(xt),onClear:e(kt)},null,8,["selected-file","accept","extension-summary","onChange","onClear"]),e(v)?(d(),E(Ve,{key:0,modelValue:e(be),"onUpdate:modelValue":c[2]||(c[2]=N=>oe(be)?be.value=N:null),title:"Restore Driver",description:"Choose the executable HeraQ should use to restore this backup artifact.","detected-paths":e(Pt),"tool-choices":e(_e),disabled:e(Y)},null,8,["modelValue","detected-paths","tool-choices","disabled"])):F("",!0),s(Wo,{modelValue:e(ge),"onUpdate:modelValue":c[3]||(c[3]=N=>oe(ge)?ge.value=N:null)},null,8,["modelValue"]),s(he,{class:"w-full",disabled:!e(ue)||e(Y)||e(v)&&!e(Dt),onClick:Bt},{default:i(()=>[s(O,{name:e(Y)?"hugeicons:loading-03":"hugeicons:upload-01",class:me(["size-4 mr-2",e(Y)&&"animate-spin"])},null,8,["name","class"]),k(" "+h(e(Y)?"Restoring...":"Restore Backup"),1)]),_:1},8,["disabled"]),a("p",Ls,[a("polyline",As,[s(O,{name:"hugeicons:alert-circle",class:"size-4 text-destructive"}),c[13]||(c[13]=k(" Warning: "))]),c[14]||(c[14]=k(" Importing a database can overwrite existing data. Make sure you have a backup before proceeding. "))])]),s(qe,{title:"Restore Profile",description:"Use a backup file produced for the same database family and runtime toolchain.",formats:e(M),"tool-hint":e($),"target-name":e(b),"formats-label":"Accepted Files"},null,8,["formats","tool-hint","target-name"])])],512),[[Ae,e(q)==="import"]])],64)):F("",!0)])])}}});export{Hs as _};
7
+ # Windows: Download from https://www.sqlite.org/download.html`,xo=G({__name:"BackupRestoreUnsupportedAlert",props:{supportMessage:{},connectionType:{},isLoading:{type:Boolean}},emits:["reload"],setup(p,{emit:l}){const t=l;return(o,u)=>{const m=se,y=st,b=ao,r=ae,f=ot,x=tt;return d(),E(x,null,{default:i(()=>[s(y,{class:"flex items-center font-medium gap-1"},{default:i(()=>[s(m,{name:"hugeicons:alert-circle",class:"size-4"}),u[1]||(u[1]=k(" Native Tools Required"))]),_:1}),s(f,{class:"space-y-3"},{default:i(()=>[a("p",vo,h(o.supportMessage),1),a("div",go,[u[2]||(u[2]=a("p",{class:"font-medium"},"Installation instructions:",-1)),o.connectionType==="postgres"?(d(),E(b,{key:0,code:bo,language:"bash"})):o.connectionType==="mysql"||o.connectionType==="mariadb"?(d(),E(b,{key:1,code:ho,language:"bash"})):o.connectionType==="sqlite3"?(d(),E(b,{key:2,code:yo,language:"bash"})):F("",!0)]),a("div",_o,[s(r,{size:"sm",variant:"outline",class:"cursor-pointer transition-all duration-300 hover:bg-accent hover:text-accent-foreground active:scale-95 group",disabled:o.isLoading,onClick:u[0]||(u[0]=_=>t("reload"))},{default:i(()=>[s(m,{name:"hugeicons:refresh",class:me(["size-4 mr-2 shrink-0",o.isLoading?"animate-spin":"transition-transform duration-500 group-hover:rotate-180"])},null,8,["class"]),k(" "+h(o.isLoading?"Checking...":"Check Again"),1)]),_:1},8,["disabled"]),u[3]||(u[3]=a("span",{class:"text-[11px] text-muted-foreground"}," Installed the tools? Click check again to re-detect capabilities and enable Backup & Restore. ",-1))])]),_:1})]),_:1})}}}),ko={class:"space-y-4"},wo={class:"space-y-2"},$o={class:"grid gap-2 sm:grid-cols-2"},Co=["onClick"],So={class:"flex items-center justify-between gap-2"},Po={class:"text-sm font-medium"},To={class:"mt-1 text-xs text-muted-foreground"},Do={class:"space-y-2"},Bo={key:0,class:"space-y-2"},Eo={key:0,class:"flex flex-wrap gap-2 max-h-32 overflow-y-auto p-2 border rounded-md"},Io={key:1,class:"text-xs text-destructive"},Fo={key:2,class:"text-xs text-muted-foreground"},Ro={key:3,class:"text-xs text-muted-foreground"},Ae="plain",Lo=G({__name:"ExportOptionsForm",props:{schemas:{},schemaLoading:{type:Boolean},schemaError:{},loading:{type:Boolean},disabled:{type:Boolean},formatOptions:{},defaultFormat:{},toolHint:{}},emits:["submit"],setup(p,{emit:l}){var f;const t=p,o=l,u=I("full"),m=I(t.defaultFormat||((f=t.formatOptions[0])==null?void 0:f.format)||Ae),y=I([]);Z([()=>t.formatOptions,()=>t.defaultFormat],([x,_])=>{var w;x.some(D=>D.format===m.value)||(m.value=((w=x[0])==null?void 0:w.format)||_||Ae)},{immediate:!0});const b=[{value:"full",label:"Full (schema + data)"},{value:"schema-only",label:"Schema only (no data)"},{value:"data-only",label:"Data only (no schema)"}],r=()=>{const x={format:m.value,scope:u.value};x.schemas=y.value.length>0?y.value:t.schemas,o("submit",x)};return(x,_)=>{const w=We,D=Je,v=Ge,T=Qe,B=He,R=se,q=ae;return d(),P("div",ko,[a("div",wo,[s(e(ee),null,{default:i(()=>_[1]||(_[1]=[k("Backup Format")])),_:1}),a("div",$o,[(d(!0),P(Q,null,X(x.formatOptions,C=>(d(),P("button",{key:C.format,type:"button",class:me(["rounded-lg border p-3 text-left transition-colors",e(m)===C.format?"border-primary bg-primary/5":"hover:border-primary/40 hover:bg-muted/20"]),onClick:H=>m.value=C.format},[a("div",So,[a("p",Po,h(C.label),1),s(e(de),{variant:"secondary",class:"font-normal"},{default:i(()=>[k(h(C.extension),1)]),_:2},1024)]),a("p",To," Runtime uses "+h(t.toolHint||"Native database tools")+". ",1)],10,Co))),128))])]),a("div",Do,[s(e(ee),null,{default:i(()=>_[2]||(_[2]=[k("Export Scope")])),_:1}),s(B,{modelValue:e(u),"onUpdate:modelValue":_[0]||(_[0]=C=>oe(u)?u.value=C:null),size:"xs"},{default:i(()=>[s(D,null,{default:i(()=>[s(w,{placeholder:"Select scope"})]),_:1}),s(T,null,{default:i(()=>[(d(),P(Q,null,X(b,C=>s(v,{key:C.value,value:C.value},{default:i(()=>[k(h(C.label),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["modelValue"])]),x.schemaLoading||x.schemaError||x.schemas.length>0?(d(),P("div",Bo,[s(e(ee),null,{default:i(()=>_[3]||(_[3]=[k("Schemas (optional)")])),_:1}),x.schemas.length>0?(d(),P("div",Eo,[(d(!0),P(Q,null,X(x.schemas,C=>(d(),E(e(de),{key:C,variant:e(y).includes(C)?"default":"outline",class:"cursor-pointer",onClick:()=>e(y).includes(C)?y.value=e(y).filter(H=>H!==C):e(y).push(C)},{default:i(()=>[k(h(C),1)]),_:2},1032,["variant","onClick"]))),128))])):F("",!0),x.schemaError?(d(),P("p",Io,h(x.schemaError),1)):x.schemaLoading?(d(),P("p",Fo," Loading schemas... ")):(d(),P("p",Ro,h(e(y).length?`${e(y).length} selected`:"All visible schemas"),1))])):F("",!0),s(q,{class:"w-full",disabled:x.loading||x.disabled,onClick:r},{default:i(()=>[x.loading?(d(),E(R,{key:0,name:"hugeicons:loading-03",class:"size-4 mr-2 animate-spin"})):(d(),E(R,{key:1,name:"lucide:download",class:"size-4 mr-2"})),k(" "+h(x.loading?"Creating Backup...":"Create Backup"),1)]),_:1},8,["disabled"])])}}}),qo={class:"relative mt-2 cursor-pointer rounded-lg border-2 border-dashed p-6 text-center transition-colors hover:border-primary/50"},zo=["accept"],Ao={key:0,class:"text-muted-foreground pointer-events-none"},Vo={class:"text-xs mt-1"},Oo={key:1,class:"flex items-center justify-center gap-3"},No={class:"text-left"},Mo={class:"text-sm font-medium"},Uo={class:"text-xs text-muted-foreground"},jo=G({__name:"ImportFileDropzone",props:{selectedFile:{},accept:{},extensionSummary:{}},emits:["change","clear"],setup(p){const l=t=>t<1024?`${t} B`:t<1048576?`${(t/1024).toFixed(1)} KB`:`${(t/1048576).toFixed(1)} MB`;return(t,o)=>{const u=ee,m=se,y=ae;return d(),P("div",null,[s(u,{class:"text-sm font-medium"},{default:i(()=>o[2]||(o[2]=[k("Backup File")])),_:1}),a("div",qo,[a("input",{type:"file",accept:t.accept,class:"absolute inset-0 w-full h-full opacity-0 cursor-pointer",onChange:o[0]||(o[0]=b=>t.$emit("change",b))},null,40,zo),t.selectedFile?(d(),P("div",Oo,[s(m,{name:"hugeicons:file-01",class:"size-8 text-primary"}),a("div",No,[a("p",Mo,h(t.selectedFile.name),1),a("p",Uo,h(l(t.selectedFile.size)),1)]),s(y,{variant:"ghost",size:"icon",class:"ml-2 relative z-10",type:"button",onClick:o[1]||(o[1]=zt(b=>t.$emit("clear"),["stop"]))},{default:i(()=>[s(m,{name:"hugeicons:x-close",class:"size-4"})]),_:1})])):(d(),P("div",Ao,[s(m,{name:"hugeicons:upload-cloud-01",class:"size-10 mx-auto mb-2 opacity-50"}),o[3]||(o[3]=a("p",{class:"text-sm font-medium"},"Click to select a file",-1)),a("p",Vo,"Supports "+h(t.extensionSummary)+" backups",1)]))])])}}}),Ho={class:"space-y-3"},Jo={class:"grid grid-cols-2 gap-4"},Wo=G({__name:"ImportOptionsForm",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(p){const l=Ke(p,"modelValue"),t=(u,m)=>{l.value[u]=m},o=[{key:"clean",label:"Drop Objects First",id:"import-clean"},{key:"dataOnly",label:"Data Only",id:"import-data-only"},{key:"schemaOnly",label:"Schema Only",id:"import-schema-only"},{key:"exitOnError",label:"Exit on Error",id:"import-exit-on-error"}];return(u,m)=>{const y=ee,b=Xe;return d(),P("div",Ho,[s(y,{class:"text-sm font-medium"},{default:i(()=>m[0]||(m[0]=[k("Options")])),_:1}),a("div",Jo,[(d(),P(Q,null,X(o,r=>a("div",{key:r.key,class:"flex items-center space-x-2"},[s(b,{id:r.id,"model-value":l.value[r.key],"onUpdate:modelValue":f=>t(r.key,f)},null,8,["id","model-value","onUpdate:modelValue"]),s(y,{for:r.id,class:"text-sm"},{default:i(()=>[k(h(r.label),1)]),_:2},1032,["for"])])),64))])])}}}),Qo={class:"space-y-3 rounded-lg border border-dashed p-3"},Go={class:"flex items-start justify-between gap-3"},Ko={class:"space-y-1"},Xo={key:0,class:"text-xs text-muted-foreground"},Yo={key:0,class:"space-y-2"},Zo={key:1,class:"flex items-start justify-between gap-3 rounded-md bg-muted/40 px-3 py-2"},es={key:2,class:"text-xs text-muted-foreground"},ts={key:3,class:"grid gap-3 md:grid-cols-[180px_minmax(0,1fr)]"},os={class:"space-y-1"},ss={class:"space-y-1"},Ve=G({__name:"NativeToolSelector",props:At({title:{},description:{},detectedPaths:{},toolChoices:{},disabled:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(p){const l=p,t=Ke(p,"modelValue"),o=g(()=>l.detectedPaths.length>0),u=g(()=>t.value.useCustomPath||!o.value),m=g(()=>l.detectedPaths.length===1?"1 executable found":`${l.detectedPaths.length} executables found`),y=g(()=>{switch(t.value.customTool||l.toolChoices[0]){case"pg_dump":return"/Applications/Postgres.app/.../bin/pg_dump";case"pg_restore":return"/Applications/Postgres.app/.../bin/pg_restore";case"psql":return"/Applications/Postgres.app/.../bin/psql";case"mysqldump":return"/opt/homebrew/Cellar/mysql/.../bin/mysqldump";case"mysqlpump":return"/opt/homebrew/Cellar/mysql/.../bin/mysqlpump";case"mysql":return"/opt/homebrew/Cellar/mysql/.../bin/mysql";case"sqlite3":return"/usr/local/bin/sqlite3";default:return"/usr/local/bin/native-tool"}}),b=_=>{t.value.selectedPath=_},r=_=>{t.value.customTool=_},f=_=>{t.value.useCustomPath=o.value?_:!0},x=_=>`${_.tool} • ${_.path}`;return(_,w)=>{const D=ee,v=de,T=We,B=Je,R=Ge,q=Qe,C=He,H=Xe,S=Ye;return d(),P("div",Qo,[a("div",Go,[a("div",Ko,[s(D,{class:"text-sm font-medium"},{default:i(()=>[k(h(_.title),1)]),_:1}),_.description?(d(),P("p",Xo,h(_.description),1)):F("",!0)]),e(o)?(d(),E(v,{key:0,variant:"secondary",class:"shrink-0"},{default:i(()=>[k(h(e(m)),1)]),_:1})):F("",!0)]),e(o)&&!t.value.useCustomPath?(d(),P("div",Yo,[s(D,{class:"text-xs font-medium text-muted-foreground"},{default:i(()=>w[4]||(w[4]=[k(" Detected Executable ")])),_:1}),s(C,{"model-value":t.value.selectedPath,disabled:_.disabled,size:"xs","onUpdate:modelValue":w[0]||(w[0]=$=>b(String($)))},{default:i(()=>[s(B,null,{default:i(()=>[s(T,{placeholder:"Choose a native tool"})]),_:1}),s(q,null,{default:i(()=>[(d(!0),P(Q,null,X(_.detectedPaths,$=>(d(),E(R,{key:$.path,value:$.path},{default:i(()=>[k(h(x($)),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["model-value","disabled"])])):F("",!0),e(o)?(d(),P("div",Zo,[w[5]||(w[5]=a("div",{class:"space-y-1"},[a("p",{class:"text-sm font-medium"},"Use custom executable path"),a("p",{class:"text-xs text-muted-foreground"}," Point HeraQ to a specific binary when you need a different version. ")],-1)),s(H,{"model-value":t.value.useCustomPath,disabled:_.disabled,"onUpdate:modelValue":w[1]||(w[1]=$=>f(!!$))},null,8,["model-value","disabled"])])):(d(),P("p",es," No executable was detected automatically. Enter the full path to the driver you want to run. ")),e(u)?(d(),P("div",ts,[a("div",os,[s(D,{class:"text-xs font-medium text-muted-foreground"},{default:i(()=>w[6]||(w[6]=[k(" Tool ")])),_:1}),s(C,{"model-value":t.value.customTool||_.toolChoices[0],disabled:_.disabled,size:"sm","onUpdate:modelValue":w[2]||(w[2]=$=>r(String($)))},{default:i(()=>[s(B,null,{default:i(()=>[s(T,{placeholder:"Choose a tool"})]),_:1}),s(q,null,{default:i(()=>[(d(!0),P(Q,null,X(_.toolChoices,$=>(d(),E(R,{key:$,value:$},{default:i(()=>[k(h($),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["model-value","disabled"])]),a("div",ss,[s(D,{class:"text-xs font-medium text-muted-foreground"},{default:i(()=>w[7]||(w[7]=[k(" Executable Path ")])),_:1}),s(S,{modelValue:t.value.customPath,"onUpdate:modelValue":w[3]||(w[3]=$=>t.value.customPath=$),disabled:_.disabled,placeholder:e(y),class:"h-8!",autocomplete:"off",spellcheck:"false"},null,8,["modelValue","disabled","placeholder"]),w[8]||(w[8]=a("p",{class:"text-xs text-muted-foreground"}," Enter the absolute path to the binary you want HeraQ to execute. ",-1))])])):F("",!0)])}}}),as={class:"space-y-3 py-1"},xe="restore backup",ns=G({__name:"RestoreConfirmDialog",props:{open:{type:Boolean}},emits:["confirm","cancel"],setup(p,{emit:l}){const t=p,o=l,u=I("");Z(()=>t.open,b=>{b&&(u.value="")});const m=g(()=>u.value===xe),y=()=>{m.value&&o("confirm")};return(b,r)=>{const f=se,x=Nt,_=Mt,w=Ot,D=ee,v=Ye,T=ae,B=jt,R=Ht,q=Vt;return d(),E(q,{open:b.open,"onUpdate:open":r[2]||(r[2]=C=>!C&&b.$emit("cancel"))},{default:i(()=>[s(R,{class:"max-w-sm"},{default:i(()=>[s(w,null,{default:i(()=>[s(x,{class:"flex items-center gap-2 text-destructive"},{default:i(()=>[s(f,{name:"hugeicons:alert-02",class:"size-5"}),r[3]||(r[3]=k(" Confirm Restore "))]),_:1}),s(_,null,{default:i(()=>r[4]||(r[4]=[k(" This will overwrite existing data in the target database. This action cannot be undone. ")])),_:1})]),_:1}),a("div",as,[s(D,{for:"restore-confirm-input"},{default:i(()=>[r[5]||(r[5]=k(" Type ")),a("code",{class:"rounded bg-muted px-1 py-0.5 text-xs font-mono"},h(xe)),r[6]||(r[6]=k(" to continue: "))]),_:1}),s(v,{id:"restore-confirm-input",modelValue:e(u),"onUpdate:modelValue":r[0]||(r[0]=C=>oe(u)?u.value=C:null),placeholder:xe,autocomplete:"off",onKeydown:Ut(y,["enter"])},null,8,["modelValue"])]),s(B,null,{default:i(()=>[s(T,{variant:"outline",onClick:r[1]||(r[1]=C=>b.$emit("cancel"))},{default:i(()=>r[7]||(r[7]=[k("Cancel")])),_:1}),s(T,{variant:"destructive",disabled:!e(m),onClick:y},{default:i(()=>r[8]||(r[8]=[k(" Restore ")])),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["open"])}}}),ls={class:"rounded-lg border bg-muted/30 p-4"},rs={class:"flex items-center justify-between gap-4"},is={class:"text-sm font-medium"},us={class:"text-xs text-muted-foreground"},cs={class:"flex shrink-0 items-center gap-2"},ds={class:"text-sm font-medium"},ms={class:"mt-3 h-2 overflow-hidden rounded-full bg-border/60"},Oe=G({__name:"TransferProgressCard",props:{tool:{},stage:{},statusMessage:{},progress:{},isRunning:{type:Boolean},progressClass:{default:"bg-primary"},actionLabel:{default:void 0},actionDisabled:{type:Boolean,default:!1}},emits:["action"],setup(p,{emit:l}){const t=l;return(o,u)=>{const m=se,y=ae;return d(),P("div",ls,[a("div",rs,[a("div",null,[a("p",is,h(o.tool)+" · "+h(o.stage),1),a("p",us,h(o.statusMessage||"Preparing job..."),1)]),a("div",cs,[o.actionLabel?(d(),E(y,{key:0,type:"button",variant:"outline",size:"sm",disabled:o.actionDisabled,onClick:u[0]||(u[0]=b=>t("action"))},{default:i(()=>[s(m,{name:"lucide:folder-open",class:"size-4 mr-2"}),k(" "+h(o.actionLabel),1)]),_:1},8,["disabled"])):F("",!0),a("span",ds,h(o.progress)+"%",1)])]),a("div",ms,[a("div",{class:me(["h-full rounded-full transition-all duration-300",o.progressClass]),style:Jt({width:`${Math.max(o.progress,o.isRunning?8:0)}%`})},null,6)])])}}});function Ne(p){return!!(p&&(p.status==="completed"||p.status==="error"))}const nt=()=>{const p=I(null),l=I(null),t=I(null),o=I(!1);let u=null,m=null;const y=v=>{u==null||u(v),u=null,m=null},b=v=>{m==null||m(v),u=null,m=null},r=async()=>{if(!t.value)throw new Error("Backup job status URL is missing.");if(o.value){if(p.value)return p.value;throw new Error("Backup job refresh is already in progress.")}o.value=!0;try{const v=await $fetch(t.value);return p.value=v,v.status==="error"&&(l.value=v.error||v.message),Ne(v)&&(f(),y(v)),v}catch(v){const T=v instanceof Error?v:new Error("Failed to refresh backup job status.");throw l.value=T.message,f(),b(T),T}finally{o.value=!1}},{pause:f,resume:x,isActive:_}=Wt(()=>{r()},1e3,{immediate:!1,immediateCallback:!1}),w=async v=>{t.value=v,l.value=null;const T=await r();return Ne(T)?T:(x(),await new Promise((B,R)=>{u=B,m=R}))},D=()=>{f(),t.value=null,p.value=null,l.value=null,o.value=!1,u=null,m=null};return Qt(()=>{f()}),{job:p,error:l,isRefreshing:o,isPolling:_,progress:g(()=>{var v;return((v=p.value)==null?void 0:v.progress)??0}),message:g(()=>{var v;return((v=p.value)==null?void 0:v.message)??null}),stage:g(()=>{var v;return((v=p.value)==null?void 0:v.stage)??"queued"}),status:g(()=>{var v;return((v=p.value)==null?void 0:v.status)??"queued"}),isRunning:g(()=>{var v,T;return((v=p.value)==null?void 0:v.status)==="queued"||((T=p.value)==null?void 0:T.status)==="running"}),monitorJob:w,refresh:r,reset:D}},ps=p=>(p||"database").trim().replace(/[\\/:*?"<>|]+/g,"-").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")||"database",fs=()=>new Date().toISOString().replace(/[:.]/g,"-"),vs=(p,l)=>`${p.replace(/[\\/]$/,"")}/${l}`,Me=p=>!Number.isFinite(p)||p<=0?"0.0s":`${(p/1e3).toFixed(1)}s`,gs=(p,l)=>{const t=I(null),o=I(null),u=nt(),{downloadStream:m,isDownloading:y,downloadedBytes:b}=no(),r=g(()=>u.isRunning.value||y.value),f=g(()=>o.value||y.value?100:u.progress.value),x=g(()=>o.value?`Backup is ready. ${ye(o.value.size)} generated in ${Me(o.value.duration)}.`:y.value?`Saving backup artifact (${ye(b.value)})...`:u.message.value),_=g(()=>u.job.value),w=async(T,B)=>{var H,S,$,M,A,W;if(!p.value)return t.value="No database connection provided",!1;const{options:R,runtime:q,promptForSaveLocation:C}=B;if(l!=null&&l.value&&!l.value.exportAvailable&&!((H=q==null?void 0:q.executablePath)!=null&&H.trim()))return t.value=l.value.exportMessage,!1;t.value=null,o.value=null;try{let L=((S=B.saveDirectoryPath)==null?void 0:S.trim())||void 0,V=(($=B.saveFilePath)==null?void 0:$.trim())||void 0;const K=`${ps(T)}_backup_${fs()}${D((M=p.value)==null?void 0:M.type,R.format)}`;if(!L&&!V&&C&&((A=window.electronAPI)!=null&&A.window.pickDirectory)){const z=await window.electronAPI.window.pickDirectory();if(!z)return t.value="No save location was selected.",!1;L=z}!V&&L&&(V=vs(L,K));const J=await $fetch("/api/database-export/export-database",{method:"POST",body:{...Ze(p.value),databaseName:T,options:R,runtime:q}}),j=await u.monitorJob(J.statusUrl);if(j.status==="error")return t.value=j.error||j.message,!1;if(!j.downloadUrl||!j.downloadFileName)return t.value="Export finished but no download artifact was returned.",!1;const te=await m({url:j.downloadUrl,method:"GET",filename:V?K:j.downloadFileName||K,saveFilePath:V,openPath:L,successTitle:"Backup is ready",getSuccessDescription:z=>`${ye(z)} generated in ${Me(j.duration||0)}.`});return te.success?(o.value={fileName:V?K:j.downloadFileName,duration:j.duration||0,size:te.size||0,saveDirectoryPath:L,saveFilePath:V},!0):(t.value=((W=te.error)==null?void 0:W.message)||"Download failed.",!1)}catch(L){return t.value=L instanceof Error?L.message:"Export failed. Check the connection and backup configuration.",console.error("Export error:",L),!1}},D=(T,B)=>so(T,B);return{isExporting:r,progress:f,error:t,lastExport:o,currentJob:_,statusMessage:x,exportDatabase:w,reset:()=>{u.reset(),t.value=null,o.value=null}}},_s=(p,l)=>{const t=nt(),o=g(()=>t.isRunning.value),u=g(()=>t.progress.value),m=g(()=>t.message.value),y=g(()=>t.job.value),b=I(null),r=I(null),f=I(null),x=I(null),_=I({clean:!1,dataOnly:!1,schemaOnly:!1,exitOnError:!0}),w=g(()=>{var S;return(S=p.value)==null?void 0:S.type}),D=g(()=>{var S;return((S=l.value)==null?void 0:S.formatOptions)||[]}),v=g(()=>at(w.value)),T=g(()=>{var S;return((S=l.value)==null?void 0:S.acceptExtensions)||D.value.map($=>$.extension).join(" / ")||".sql"}),B=()=>{f.value=null,x.value&&(x.value.value="")};return{isImporting:o,progress:u,statusMessage:m,currentJob:y,error:b,success:r,selectedFile:f,fileInputRef:x,options:_,extensionSummary:T,clearSelectedFile:B,openFilePicker:()=>{var S;(S=x.value)==null||S.click()},onFileSelect:S=>{var W;const $=S.target;if(!((W=$.files)!=null&&W.length))return;const M=$.files[0];if(!D.value.some(L=>M.name.toLowerCase().endsWith(L.extension.toLowerCase()))){B(),b.value=`Unsupported file type. Use ${T.value} for ${v.value}.`,r.value=null;return}f.value=M,b.value=null,r.value=null},importDatabase:async S=>{var $,M;if(!(!f.value||!p.value)){if(l.value&&!l.value.importAvailable&&!(($=S==null?void 0:S.executablePath)!=null&&$.trim())){b.value=l.value.importMessage,r.value=null;return}b.value=null,r.value=null;try{const A=new FormData;A.append("file",f.value);const W=Ze(p.value);Object.entries(W).forEach(([K,J])=>{J!==void 0&&A.append(K,typeof J=="object"?JSON.stringify(J):String(J))}),A.append("options",JSON.stringify(_.value)),(M=S==null?void 0:S.executablePath)!=null&&M.trim()&&A.append("runtime",JSON.stringify(S));const L=await $fetch("/api/database-import/import-database",{method:"POST",body:A}),V=await t.monitorJob(L.statusUrl);if(V.status==="completed"){r.value=V.message||"Database imported successfully",B();return}b.value=V.error||V.message||"Import failed"}catch(A){b.value=A instanceof Error?A.message:"Import failed. Check the backup file and connection compatibility.",console.error("Import error:",A)}}},reset:()=>{t.reset(),b.value=null,r.value=null,B()}}},bs=p=>{const l=I(null),t=I(!1),o=I(null);let u=0;const m=async()=>{const y=p.value,b=++u;if(!y){l.value=null,o.value=null,t.value=!1;return}t.value=!0,o.value=null;try{const r=await $fetch("/api/database-backup/capability",{query:{type:y,discoverAll:et()}});if(b!==u)return;l.value=r}catch(r){if(b!==u)return;l.value=null,o.value=r instanceof Error?r.message:"Unable to detect native backup tools."}finally{b===u&&(t.value=!1)}};return Z(p,()=>{m()},{immediate:!0}),{capability:l,isLoading:t,error:o,refresh:m}};function Ue(){return{useCustomPath:!1,selectedPath:"",customPath:"",customTool:""}}const je=(p,l,t)=>{const o=I(Ue()),u=g(()=>{const r=new Set(l.value);return p.value.filter(f=>r.size===0||r.has(f.tool))}),m=g(()=>u.value.find(r=>r.path===o.value.selectedPath)||null);Z([u,l,t],([r,f,x])=>{var _;if(!x){o.value=Ue();return}if(f.includes(o.value.customTool)||(o.value.customTool=f[0]||""),r.some(w=>w.path===o.value.selectedPath)||(o.value.selectedPath=((_=r[0])==null?void 0:_.path)||""),!r.length){o.value.useCustomPath=!0;return}o.value.useCustomPath&&!o.value.customPath.trim()&&(o.value.useCustomPath=!1)},{immediate:!0});const y=g(()=>{if(t.value){if(o.value.useCustomPath){const r=o.value.customPath.trim(),f=o.value.customTool;return!r||!f?void 0:{tool:f,executablePath:r}}if(m.value)return{tool:m.value.tool,executablePath:m.value.path}}}),b=g(()=>!t.value||!!y.value);return{selection:o,filteredToolPaths:u,runtimeSelection:y,canSubmit:b}},hs={class:"flex flex-col h-full gap-3 overflow-hidden p-3"},ys={class:"font-medium text-foreground"},xs={class:"text-muted-foreground/60"},ks={class:"flex items-center justify-between gap-2"},ws={class:"text-xs text-muted-foreground"},$s={class:"relative flex-1 overflow-y-auto rounded-lg border bg-background p-4"},Cs={class:"space-y-4"},Ss={class:"flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between"},Ps={class:"mt-1 text-sm text-muted-foreground"},Ts={class:"grid gap-4 xl:grid-cols-[minmax(0,1fr)_280px]"},Ds={class:"rounded-lg border p-4 space-y-4"},Bs={class:"space-y-4"},Es={class:"flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between"},Is={class:"mt-1 text-sm text-muted-foreground"},Fs={class:"grid gap-4 xl:grid-cols-[minmax(0,1fr)_280px]"},Rs={class:"rounded-lg border p-4 space-y-4"},Ls={class:"text-muted-foreground text-xs inline-flex items-center gap-0.5"},qs={class:"text-destructive gap-0.5 items-center inline-flex"},Hs=G({__name:"BackupRestoreContainer",props:{connectionId:{},initialTab:{}},setup(p){const l=p,{workspaceId:t}=Gt(),o=Kt(),u=Xt(),m=g(()=>{if(l.connectionId)return o.connections.find(n=>n.id===l.connectionId)}),y=g(()=>{var n;return(n=m.value)==null?void 0:n.type}),b=g(()=>{var n,c;return((n=m.value)==null?void 0:n.database)||((c=m.value)==null?void 0:c.name)||"database"}),r=g(()=>at(y.value)),{capability:f,isLoading:x,error:_,refresh:w}=bs(y),D=I(!1),v=g(()=>et()),T=async()=>{D.value=!0;try{await w()}finally{D.value=!1}},B=g(()=>{var n;return((n=f.value)==null?void 0:n.supported)??!1}),R=g(()=>{var n;return((n=f.value)==null?void 0:n.exportAvailable)??!1}),q=g(()=>{var n;return((n=f.value)==null?void 0:n.importAvailable)??!1}),C=g(()=>B.value&&(R.value||v.value)),H=g(()=>B.value&&(q.value||v.value)),S=g(()=>_.value?_.value:f.value?f.value.supportMessage:y.value?`Checking ${r.value} native tools...`:"Select a connection to open database tools."),$=g(()=>{var n;return((n=f.value)==null?void 0:n.toolHint)||"Native database tools"}),M=g(()=>{var n;return((n=f.value)==null?void 0:n.formatOptions)||[]}),A=g(()=>{var n;return((n=f.value)==null?void 0:n.acceptExtensions)||".sql"}),W=g(()=>M.value.map(n=>n.extension).join(" / ")||".sql"),L=g(()=>{var n,c;return x.value||!B.value||R.value&&q.value?null:[R.value?null:(n=f.value)==null?void 0:n.exportMessage,q.value?null:(c=f.value)==null?void 0:c.importMessage].filter(Boolean).join(" ")}),V=g(()=>{var c;if(!l.connectionId)return[];const n=t.value||((c=m.value)==null?void 0:c.workspaceId);return(u.schemas[l.connectionId]||[]).filter(U=>U.connectionId===l.connectionId&&(!n||U.workspaceId===n)).map(U=>U.name)}),K=g(()=>u.loading[l.connectionId]||!1),J=I(null),j=async()=>{const n=m.value,c=t.value||(n==null?void 0:n.workspaceId);if(!l.connectionId||!c||!n)return;if((u.schemas[l.connectionId]||[]).some(O=>O.connectionId===l.connectionId&&O.workspaceId===c)){J.value=null;return}try{J.value=null,await u.fetchSchemas({connectionId:l.connectionId,workspaceId:c,connection:n})}catch(O){J.value=O instanceof Error?O.message:"Failed to load schemas."}};Z([m,()=>t.value],()=>{j()},{immediate:!0});const te=[{id:"export",tabLabel:"Create Backup",subtitle:"Generate native backup artifacts for the current connection.",icon:"hugeicons:download-01"},{id:"import",tabLabel:"Restore Backup",subtitle:"Apply a native backup artifact back into this connection.",icon:"hugeicons:upload-01"}],z=I(l.initialTab),lt=g(()=>te.find(n=>n.id===z.value));Z(()=>l.initialTab,n=>{z.value=n}),Z([z,C,H],([n,c,U])=>{if(n==="export"&&!c&&U){z.value="import";return}n==="import"&&!U&&c&&(z.value="export")},{immediate:!0});const rt=n=>{z.value=n},{isExporting:ne,progress:it,error:ke,lastExport:we,currentJob:pe,statusMessage:ut,exportDatabase:ct,reset:dt}=gs(m,f),$e=(n=[],c=[])=>[...new Set([...n,...c])],Ce=g(()=>{var n,c;return $e(((n=f.value)==null?void 0:n.availableExportTools)||[],((c=f.value)==null?void 0:c.missingExportTools)||[])}),mt=g(()=>{var n;return((n=f.value)==null?void 0:n.availableExportToolPaths)||[]}),{selection:fe,filteredToolPaths:pt,runtimeSelection:ft,canSubmit:vt}=je(mt,Ce,v),gt=async()=>{var c,U;const n=(c=we.value)==null?void 0:c.saveDirectoryPath;!n||!((U=window.electronAPI)!=null&&U.window.openPath)||await window.electronAPI.window.openPath(n)},_t=async n=>{await ct(b.value,{options:n,runtime:ft.value,promptForSaveLocation:v.value,saveDirectoryPath:void 0})},{isImporting:Y,progress:bt,statusMessage:ht,currentJob:ve,error:Se,success:Pe,selectedFile:ue,options:ge,extensionSummary:yt,onFileSelect:xt,clearSelectedFile:kt,importDatabase:wt,reset:$t}=_s(m,f),Ct=g(()=>{var n,c;return $e(((n=f.value)==null?void 0:n.availableImportTools)||[],((c=f.value)==null?void 0:c.missingImportTools)||[])}),_e=g(()=>{var n;return y.value!==Yt.POSTGRES||!((n=ue.value)!=null&&n.name)?Ct.value:[ue.value.name.toLowerCase().endsWith(".dump")?"pg_restore":"psql"]}),St=g(()=>{var n;return(((n=f.value)==null?void 0:n.availableImportToolPaths)||[]).filter(c=>_e.value.includes(c.tool))}),{selection:be,filteredToolPaths:Pt,runtimeSelection:Tt,canSubmit:Dt}=je(St,_e,v),ce=I(!1),Bt=()=>{ce.value=!0},Et=async()=>{ce.value=!1,await wt(Tt.value)},It=()=>{ce.value=!1};return(n,c)=>{var Te,De,Be,Ee,Ie,Fe,Re;const U=qt,O=se,Ft=oo,Rt=to,Lt=eo,le=st,re=ot,ie=tt,he=ae;return d(),P("div",hs,[s(ns,{open:e(ce),onConfirm:Et,onCancel:It},null,8,["open"]),s(U,{icon:"hugeicons:database-import",title:"Backup & Restore"},{context:i(()=>[a("span",ys,h(e(b)),1),a("span",xs,"· "+h(e(r)),1)]),_:1}),a("div",ks,[s(Lt,{modelValue:e(z),"onUpdate:modelValue":c[0]||(c[0]=N=>oe(z)?z.value=N:null),class:"min-w-0 flex-1 gap-0"},{default:i(()=>[s(Rt,{size:"sm",class:"max-w-full justify-start! overflow-x-auto"},{default:i(()=>[(d(),P(Q,null,X(te,N=>s(Ft,{size:"xs",key:N.id,value:N.id,class:"min-w-fit shrink-0 cursor-pointer rounded-sm",disabled:e(x)||(N.id==="export"?!e(C):!e(H)),onClick:zs=>rt(N.id)},{default:i(()=>[s(O,{name:N.icon,class:"shrink-0 size-3.5"},null,8,["name"]),k(" "+h(N.tabLabel),1)]),_:2},1032,["value","disabled","onClick"])),64))]),_:1})]),_:1},8,["modelValue"]),a("div",ws,h((Te=e(lt))==null?void 0:Te.subtitle),1)]),a("div",$s,[e(x)&&!e(D)?(d(),E(Zt,{key:0,visible:""})):F("",!0),(!e(x)||e(D))&&e(_)?(d(),E(ie,{key:1,variant:"destructive"},{default:i(()=>[s(O,{name:"hugeicons:alert-circle",class:"size-4"}),s(le,null,{default:i(()=>c[4]||(c[4]=[k("Capability Check Failed")])),_:1}),s(re,null,{default:i(()=>[k(h(e(S)),1)]),_:1})]),_:1})):(!e(x)||e(D))&&!e(B)?(d(),E(xo,{key:2,"support-message":e(S),"connection-type":e(y),"is-loading":e(D),onReload:T},null,8,["support-message","connection-type","is-loading"])):!e(x)&&!e(D)?(d(),P(Q,{key:3},[e(L)?(d(),E(ie,{key:0},{default:i(()=>[s(O,{name:"hugeicons:alert-circle",class:"size-4"}),s(le,null,{default:i(()=>c[5]||(c[5]=[k("Partial Native Tool Support")])),_:1}),s(re,null,{default:i(()=>[k(h(e(L)),1)]),_:1})]),_:1})):F("",!0),Le(a("div",Cs,[a("div",Ss,[a("div",null,[c[6]||(c[6]=a("h3",{class:"text-base font-medium"},"Create Backup",-1)),a("p",Ps," Export "+h(e(b))+" using "+h(e($))+". ",1)])]),e(ke)?(d(),E(ie,{key:0,variant:"destructive"},{default:i(()=>[s(O,{name:"hugeicons:alert-circle",class:"size-4"}),s(le,null,{default:i(()=>c[7]||(c[7]=[k("Backup Failed")])),_:1}),s(re,null,{default:i(()=>[k(h(e(ke)),1)]),_:1}),s(he,{size:"sm",variant:"outline",class:"mt-2",onClick:e(dt)},{default:i(()=>c[8]||(c[8]=[k(" Try Again ")])),_:1},8,["onClick"])]),_:1})):F("",!0),e(ne)||e(pe)?(d(),E(Oe,{key:1,tool:((De=e(pe))==null?void 0:De.tool)||e($),stage:((Be=e(pe))==null?void 0:Be.stage)||"queued","status-message":e(ut)||"",progress:e(it),"is-running":e(ne),"action-label":(Ee=e(we))!=null&&Ee.saveDirectoryPath&&!e(ne)?"Open":void 0,onAction:gt},null,8,["tool","stage","status-message","progress","is-running","action-label"])):F("",!0),a("div",Ts,[a("div",Ds,[e(v)?(d(),E(Ve,{key:0,modelValue:e(fe),"onUpdate:modelValue":c[1]||(c[1]=N=>oe(fe)?fe.value=N:null),title:"Backup Driver",description:"Choose the exact executable OrcaQ should run for this backup job.","detected-paths":e(pt),"tool-choices":e(Ce),disabled:e(ne)},null,8,["modelValue","detected-paths","tool-choices","disabled"])):F("",!0),s(Lo,{schemas:e(V),"schema-loading":e(K),"schema-error":e(J),loading:e(ne),disabled:e(v)&&!e(vt),"format-options":e(M),"default-format":(Ie=e(f))==null?void 0:Ie.defaultExportFormat,"tool-hint":e($),onSubmit:_t},null,8,["schemas","schema-loading","schema-error","loading","disabled","format-options","default-format","tool-hint"])]),s(ze,{title:"Backup Profile",description:"Exports run on the local runtime host and stream the artifact directly into a downloadable file.",formats:e(M),"tool-hint":e($),"target-name":e(b),"formats-label":"Supported Files"},null,8,["formats","tool-hint","target-name"])])],512),[[qe,e(z)==="export"]]),Le(a("div",Bs,[a("div",Es,[a("div",null,[c[9]||(c[9]=a("h3",{class:"text-base font-medium"},"Restore Backup",-1)),a("p",Is," Restore a "+h(e(W))+" backup into "+h(e(b))+". ",1)])]),e(Se)?(d(),E(ie,{key:0,variant:"destructive"},{default:i(()=>[s(O,{name:"hugeicons:alert-circle",class:"size-4"}),s(le,null,{default:i(()=>c[10]||(c[10]=[k("Import Failed")])),_:1}),s(re,null,{default:i(()=>[k(h(e(Se)),1)]),_:1}),s(he,{size:"sm",variant:"outline",class:"mt-2",onClick:e($t)},{default:i(()=>c[11]||(c[11]=[k(" Try Again ")])),_:1},8,["onClick"])]),_:1})):F("",!0),e(Pe)?(d(),E(ie,{key:1},{default:i(()=>[s(O,{name:"hugeicons:checkmark-circle-02",class:"size-4 text-green-500"}),s(le,null,{default:i(()=>c[12]||(c[12]=[k("Import Complete")])),_:1}),s(re,null,{default:i(()=>[k(h(e(Pe)),1)]),_:1})]),_:1})):F("",!0),e(Y)||e(ve)?(d(),E(Oe,{key:2,tool:((Fe=e(ve))==null?void 0:Fe.tool)||e($),stage:((Re=e(ve))==null?void 0:Re.stage)||"queued","status-message":e(ht)||"",progress:e(bt),"is-running":e(Y),"progress-class":"bg-emerald-500"},null,8,["tool","stage","status-message","progress","is-running"])):F("",!0),a("div",Fs,[a("div",Rs,[s(jo,{"selected-file":e(ue),accept:e(A),"extension-summary":e(yt),onChange:e(xt),onClear:e(kt)},null,8,["selected-file","accept","extension-summary","onChange","onClear"]),e(v)?(d(),E(Ve,{key:0,modelValue:e(be),"onUpdate:modelValue":c[2]||(c[2]=N=>oe(be)?be.value=N:null),title:"Restore Driver",description:"Choose the executable HeraQ should use to restore this backup artifact.","detected-paths":e(Pt),"tool-choices":e(_e),disabled:e(Y)},null,8,["modelValue","detected-paths","tool-choices","disabled"])):F("",!0),s(Wo,{modelValue:e(ge),"onUpdate:modelValue":c[3]||(c[3]=N=>oe(ge)?ge.value=N:null)},null,8,["modelValue"]),s(he,{class:"w-full",disabled:!e(ue)||e(Y)||e(v)&&!e(Dt),onClick:Bt},{default:i(()=>[s(O,{name:e(Y)?"hugeicons:loading-03":"hugeicons:upload-01",class:me(["size-4 mr-2",e(Y)&&"animate-spin"])},null,8,["name","class"]),k(" "+h(e(Y)?"Restoring...":"Restore Backup"),1)]),_:1},8,["disabled"]),a("p",Ls,[a("polyline",qs,[s(O,{name:"hugeicons:alert-circle",class:"size-4 text-destructive"}),c[13]||(c[13]=k(" Warning: "))]),c[14]||(c[14]=k(" Importing a database can overwrite existing data. Make sure you have a backup before proceeding. "))])]),s(ze,{title:"Restore Profile",description:"Use a backup file produced for the same database family and runtime toolchain.",formats:e(M),"tool-hint":e($),"target-name":e(b),"formats-label":"Accepted Files"},null,8,["formats","tool-hint","target-name"])])],512),[[qe,e(z)==="import"]])],64)):F("",!0)])])}}});export{Hs as _};
@@ -1,4 +1,4 @@
1
- import{_ as o,s as _e,g as Ae,t as ie,q as ke,a as Fe,b as Pe,c as wt,l as At,d as zt,e as ve,A as Ce,I as D,a1 as Le,i as Ee}from"./BJvJ0Hlu.js";import{l as ee}from"./DrkGD_bQ.js";import"./C6teO48Y.js";import"./Gi6I4Gst.js";import"./DX6XiGOO.js";var Vt=function(){var t=o(function(j,r,l,g){for(l=l||{},g=j.length;g--;l[j[g]]=r);return l},"o"),n=[1,3],u=[1,4],c=[1,5],h=[1,6],p=[1,7],y=[1,4,5,10,12,13,14,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],S=[1,4,5,10,12,13,14,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],a=[55,56,57],A=[2,36],d=[1,37],T=[1,36],q=[1,38],m=[1,35],b=[1,43],x=[1,41],O=[1,14],Y=[1,23],G=[1,18],yt=[1,19],Tt=[1,20],dt=[1,21],Ft=[1,22],ut=[1,24],xt=[1,25],ft=[1,26],gt=[1,27],i=[1,28],Bt=[1,29],W=[1,32],U=[1,33],k=[1,34],F=[1,39],P=[1,40],v=[1,42],C=[1,44],H=[1,62],X=[1,61],L=[4,5,8,10,12,13,14,18,44,47,49,55,56,57,63,64,65,66,67],Rt=[1,65],Nt=[1,66],Wt=[1,67],Ut=[1,68],Qt=[1,69],Ot=[1,70],Ht=[1,71],Xt=[1,72],Mt=[1,73],Yt=[1,74],jt=[1,75],Gt=[1,76],I=[4,5,6,7,8,9,10,11,12,13,14,15,18],J=[1,90],$=[1,91],tt=[1,92],et=[1,99],it=[1,93],at=[1,96],nt=[1,94],st=[1,95],rt=[1,97],ot=[1,98],Pt=[1,102],Kt=[10,55,56,57],R=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],vt={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:o(function(r,l,g,f,_,e,pt){var s=e.length-1;switch(_){case 23:this.$=e[s];break;case 24:this.$=e[s-1]+""+e[s];break;case 26:this.$=e[s-1]+e[s];break;case 27:this.$=[e[s].trim()];break;case 28:e[s-2].push(e[s].trim()),this.$=e[s-2];break;case 29:this.$=e[s-4],f.addClass(e[s-2],e[s]);break;case 37:this.$=[];break;case 42:this.$=e[s].trim(),f.setDiagramTitle(this.$);break;case 43:this.$=e[s].trim(),f.setAccTitle(this.$);break;case 44:case 45:this.$=e[s].trim(),f.setAccDescription(this.$);break;case 46:f.addSection(e[s].substr(8)),this.$=e[s].substr(8);break;case 47:f.addPoint(e[s-3],"",e[s-1],e[s],[]);break;case 48:f.addPoint(e[s-4],e[s-3],e[s-1],e[s],[]);break;case 49:f.addPoint(e[s-4],"",e[s-2],e[s-1],e[s]);break;case 50:f.addPoint(e[s-5],e[s-4],e[s-2],e[s-1],e[s]);break;case 51:f.setXAxisLeftText(e[s-2]),f.setXAxisRightText(e[s]);break;case 52:e[s-1].text+=" ⟶ ",f.setXAxisLeftText(e[s-1]);break;case 53:f.setXAxisLeftText(e[s]);break;case 54:f.setYAxisBottomText(e[s-2]),f.setYAxisTopText(e[s]);break;case 55:e[s-1].text+=" ⟶ ",f.setYAxisBottomText(e[s-1]);break;case 56:f.setYAxisBottomText(e[s]);break;case 57:f.setQuadrant1Text(e[s]);break;case 58:f.setQuadrant2Text(e[s]);break;case 59:f.setQuadrant3Text(e[s]);break;case 60:f.setQuadrant4Text(e[s]);break;case 64:this.$={text:e[s],type:"text"};break;case 65:this.$={text:e[s-1].text+""+e[s],type:e[s-1].type};break;case 66:this.$={text:e[s],type:"text"};break;case 67:this.$={text:e[s],type:"markdown"};break;case 68:this.$=e[s];break;case 69:this.$=e[s-1]+""+e[s];break}},"anonymous"),table:[{18:n,26:1,27:2,28:u,55:c,56:h,57:p},{1:[3]},{18:n,26:8,27:2,28:u,55:c,56:h,57:p},{18:n,26:9,27:2,28:u,55:c,56:h,57:p},t(y,[2,33],{29:10}),t(S,[2,61]),t(S,[2,62]),t(S,[2,63]),{1:[2,30]},{1:[2,31]},t(a,A,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:d,5:T,10:q,12:m,13:b,14:x,18:O,25:Y,35:G,37:yt,39:Tt,41:dt,42:Ft,48:ut,50:xt,51:ft,52:gt,53:i,54:Bt,60:W,61:U,63:k,64:F,65:P,66:v,67:C}),t(y,[2,34]),{27:45,55:c,56:h,57:p},t(a,[2,37]),t(a,A,{24:13,32:15,33:16,34:17,43:30,58:31,31:46,4:d,5:T,10:q,12:m,13:b,14:x,18:O,25:Y,35:G,37:yt,39:Tt,41:dt,42:Ft,48:ut,50:xt,51:ft,52:gt,53:i,54:Bt,60:W,61:U,63:k,64:F,65:P,66:v,67:C}),t(a,[2,39]),t(a,[2,40]),t(a,[2,41]),{36:[1,47]},{38:[1,48]},{40:[1,49]},t(a,[2,45]),t(a,[2,46]),{18:[1,50]},{4:d,5:T,10:q,12:m,13:b,14:x,43:51,58:31,60:W,61:U,63:k,64:F,65:P,66:v,67:C},{4:d,5:T,10:q,12:m,13:b,14:x,43:52,58:31,60:W,61:U,63:k,64:F,65:P,66:v,67:C},{4:d,5:T,10:q,12:m,13:b,14:x,43:53,58:31,60:W,61:U,63:k,64:F,65:P,66:v,67:C},{4:d,5:T,10:q,12:m,13:b,14:x,43:54,58:31,60:W,61:U,63:k,64:F,65:P,66:v,67:C},{4:d,5:T,10:q,12:m,13:b,14:x,43:55,58:31,60:W,61:U,63:k,64:F,65:P,66:v,67:C},{4:d,5:T,10:q,12:m,13:b,14:x,43:56,58:31,60:W,61:U,63:k,64:F,65:P,66:v,67:C},{4:d,5:T,8:H,10:q,12:m,13:b,14:x,18:X,44:[1,57],47:[1,58],58:60,59:59,63:k,64:F,65:P,66:v,67:C},t(L,[2,64]),t(L,[2,66]),t(L,[2,67]),t(L,[2,70]),t(L,[2,71]),t(L,[2,72]),t(L,[2,73]),t(L,[2,74]),t(L,[2,75]),t(L,[2,76]),t(L,[2,77]),t(L,[2,78]),t(L,[2,79]),t(L,[2,80]),t(y,[2,35]),t(a,[2,38]),t(a,[2,42]),t(a,[2,43]),t(a,[2,44]),{3:64,4:Rt,5:Nt,6:Wt,7:Ut,8:Qt,9:Ot,10:Ht,11:Xt,12:Mt,13:Yt,14:jt,15:Gt,21:63},t(a,[2,53],{59:59,58:60,4:d,5:T,8:H,10:q,12:m,13:b,14:x,18:X,49:[1,77],63:k,64:F,65:P,66:v,67:C}),t(a,[2,56],{59:59,58:60,4:d,5:T,8:H,10:q,12:m,13:b,14:x,18:X,49:[1,78],63:k,64:F,65:P,66:v,67:C}),t(a,[2,57],{59:59,58:60,4:d,5:T,8:H,10:q,12:m,13:b,14:x,18:X,63:k,64:F,65:P,66:v,67:C}),t(a,[2,58],{59:59,58:60,4:d,5:T,8:H,10:q,12:m,13:b,14:x,18:X,63:k,64:F,65:P,66:v,67:C}),t(a,[2,59],{59:59,58:60,4:d,5:T,8:H,10:q,12:m,13:b,14:x,18:X,63:k,64:F,65:P,66:v,67:C}),t(a,[2,60],{59:59,58:60,4:d,5:T,8:H,10:q,12:m,13:b,14:x,18:X,63:k,64:F,65:P,66:v,67:C}),{45:[1,79]},{44:[1,80]},t(L,[2,65]),t(L,[2,81]),t(L,[2,82]),t(L,[2,83]),{3:82,4:Rt,5:Nt,6:Wt,7:Ut,8:Qt,9:Ot,10:Ht,11:Xt,12:Mt,13:Yt,14:jt,15:Gt,18:[1,81]},t(I,[2,23]),t(I,[2,1]),t(I,[2,2]),t(I,[2,3]),t(I,[2,4]),t(I,[2,5]),t(I,[2,6]),t(I,[2,7]),t(I,[2,8]),t(I,[2,9]),t(I,[2,10]),t(I,[2,11]),t(I,[2,12]),t(a,[2,52],{58:31,43:83,4:d,5:T,10:q,12:m,13:b,14:x,60:W,61:U,63:k,64:F,65:P,66:v,67:C}),t(a,[2,55],{58:31,43:84,4:d,5:T,10:q,12:m,13:b,14:x,60:W,61:U,63:k,64:F,65:P,66:v,67:C}),{46:[1,85]},{45:[1,86]},{4:J,5:$,6:tt,8:et,11:it,13:at,16:89,17:nt,18:st,19:rt,20:ot,22:88,23:87},t(I,[2,24]),t(a,[2,51],{59:59,58:60,4:d,5:T,8:H,10:q,12:m,13:b,14:x,18:X,63:k,64:F,65:P,66:v,67:C}),t(a,[2,54],{59:59,58:60,4:d,5:T,8:H,10:q,12:m,13:b,14:x,18:X,63:k,64:F,65:P,66:v,67:C}),t(a,[2,47],{22:88,16:89,23:100,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot}),{46:[1,101]},t(a,[2,29],{10:Pt}),t(Kt,[2,27],{16:103,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot}),t(R,[2,25]),t(R,[2,13]),t(R,[2,14]),t(R,[2,15]),t(R,[2,16]),t(R,[2,17]),t(R,[2,18]),t(R,[2,19]),t(R,[2,20]),t(R,[2,21]),t(R,[2,22]),t(a,[2,49],{10:Pt}),t(a,[2,48],{22:88,16:89,23:104,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot}),{4:J,5:$,6:tt,8:et,11:it,13:at,16:89,17:nt,18:st,19:rt,20:ot,22:105},t(R,[2,26]),t(a,[2,50],{10:Pt}),t(Kt,[2,28],{16:103,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot})],defaultActions:{8:[2,30],9:[2,31]},parseError:o(function(r,l){if(l.recoverable)this.trace(r);else{var g=new Error(r);throw g.hash=l,g}},"parseError"),parse:o(function(r){var l=this,g=[0],f=[],_=[null],e=[],pt=this.table,s="",mt=0,Zt=0,qe=2,Jt=1,me=e.slice.call(arguments,1),E=Object.create(this.lexer),K={yy:{}};for(var Ct in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ct)&&(K.yy[Ct]=this.yy[Ct]);E.setInput(r,K.yy),K.yy.lexer=E,K.yy.parser=this,typeof E.yylloc>"u"&&(E.yylloc={});var Lt=E.yylloc;e.push(Lt);var be=E.options&&E.options.ranges;typeof K.yy.parseError=="function"?this.parseError=K.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Se(B){g.length=g.length-2*B,_.length=_.length-B,e.length=e.length-B}o(Se,"popStack");function $t(){var B;return B=f.pop()||E.lex()||Jt,typeof B!="number"&&(B instanceof Array&&(f=B,B=f.pop()),B=l.symbols_[B]||B),B}o($t,"lex");for(var w,Z,N,Et,lt={},bt,M,te,St;;){if(Z=g[g.length-1],this.defaultActions[Z]?N=this.defaultActions[Z]:((w===null||typeof w>"u")&&(w=$t()),N=pt[Z]&&pt[Z][w]),typeof N>"u"||!N.length||!N[0]){var Dt="";St=[];for(bt in pt[Z])this.terminals_[bt]&&bt>qe&&St.push("'"+this.terminals_[bt]+"'");E.showPosition?Dt="Parse error on line "+(mt+1)+`:
1
+ import{_ as o,s as _e,g as Ae,t as ie,q as ke,a as Fe,b as Pe,c as wt,l as At,d as zt,e as ve,A as Ce,I as D,a1 as Le,i as Ee}from"./Dzy2Amcc.js";import{l as ee}from"./Ck7gJ0Ru.js";import"./DD6NieRw.js";import"./Gi6I4Gst.js";import"./DX6XiGOO.js";var Vt=function(){var t=o(function(j,r,l,g){for(l=l||{},g=j.length;g--;l[j[g]]=r);return l},"o"),n=[1,3],u=[1,4],c=[1,5],h=[1,6],p=[1,7],y=[1,4,5,10,12,13,14,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],S=[1,4,5,10,12,13,14,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],a=[55,56,57],A=[2,36],d=[1,37],T=[1,36],q=[1,38],m=[1,35],b=[1,43],x=[1,41],O=[1,14],Y=[1,23],G=[1,18],yt=[1,19],Tt=[1,20],dt=[1,21],Ft=[1,22],ut=[1,24],xt=[1,25],ft=[1,26],gt=[1,27],i=[1,28],Bt=[1,29],W=[1,32],U=[1,33],k=[1,34],F=[1,39],P=[1,40],v=[1,42],C=[1,44],H=[1,62],X=[1,61],L=[4,5,8,10,12,13,14,18,44,47,49,55,56,57,63,64,65,66,67],Rt=[1,65],Nt=[1,66],Wt=[1,67],Ut=[1,68],Qt=[1,69],Ot=[1,70],Ht=[1,71],Xt=[1,72],Mt=[1,73],Yt=[1,74],jt=[1,75],Gt=[1,76],I=[4,5,6,7,8,9,10,11,12,13,14,15,18],J=[1,90],$=[1,91],tt=[1,92],et=[1,99],it=[1,93],at=[1,96],nt=[1,94],st=[1,95],rt=[1,97],ot=[1,98],Pt=[1,102],Kt=[10,55,56,57],R=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],vt={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:o(function(r,l,g,f,_,e,pt){var s=e.length-1;switch(_){case 23:this.$=e[s];break;case 24:this.$=e[s-1]+""+e[s];break;case 26:this.$=e[s-1]+e[s];break;case 27:this.$=[e[s].trim()];break;case 28:e[s-2].push(e[s].trim()),this.$=e[s-2];break;case 29:this.$=e[s-4],f.addClass(e[s-2],e[s]);break;case 37:this.$=[];break;case 42:this.$=e[s].trim(),f.setDiagramTitle(this.$);break;case 43:this.$=e[s].trim(),f.setAccTitle(this.$);break;case 44:case 45:this.$=e[s].trim(),f.setAccDescription(this.$);break;case 46:f.addSection(e[s].substr(8)),this.$=e[s].substr(8);break;case 47:f.addPoint(e[s-3],"",e[s-1],e[s],[]);break;case 48:f.addPoint(e[s-4],e[s-3],e[s-1],e[s],[]);break;case 49:f.addPoint(e[s-4],"",e[s-2],e[s-1],e[s]);break;case 50:f.addPoint(e[s-5],e[s-4],e[s-2],e[s-1],e[s]);break;case 51:f.setXAxisLeftText(e[s-2]),f.setXAxisRightText(e[s]);break;case 52:e[s-1].text+=" ⟶ ",f.setXAxisLeftText(e[s-1]);break;case 53:f.setXAxisLeftText(e[s]);break;case 54:f.setYAxisBottomText(e[s-2]),f.setYAxisTopText(e[s]);break;case 55:e[s-1].text+=" ⟶ ",f.setYAxisBottomText(e[s-1]);break;case 56:f.setYAxisBottomText(e[s]);break;case 57:f.setQuadrant1Text(e[s]);break;case 58:f.setQuadrant2Text(e[s]);break;case 59:f.setQuadrant3Text(e[s]);break;case 60:f.setQuadrant4Text(e[s]);break;case 64:this.$={text:e[s],type:"text"};break;case 65:this.$={text:e[s-1].text+""+e[s],type:e[s-1].type};break;case 66:this.$={text:e[s],type:"text"};break;case 67:this.$={text:e[s],type:"markdown"};break;case 68:this.$=e[s];break;case 69:this.$=e[s-1]+""+e[s];break}},"anonymous"),table:[{18:n,26:1,27:2,28:u,55:c,56:h,57:p},{1:[3]},{18:n,26:8,27:2,28:u,55:c,56:h,57:p},{18:n,26:9,27:2,28:u,55:c,56:h,57:p},t(y,[2,33],{29:10}),t(S,[2,61]),t(S,[2,62]),t(S,[2,63]),{1:[2,30]},{1:[2,31]},t(a,A,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:d,5:T,10:q,12:m,13:b,14:x,18:O,25:Y,35:G,37:yt,39:Tt,41:dt,42:Ft,48:ut,50:xt,51:ft,52:gt,53:i,54:Bt,60:W,61:U,63:k,64:F,65:P,66:v,67:C}),t(y,[2,34]),{27:45,55:c,56:h,57:p},t(a,[2,37]),t(a,A,{24:13,32:15,33:16,34:17,43:30,58:31,31:46,4:d,5:T,10:q,12:m,13:b,14:x,18:O,25:Y,35:G,37:yt,39:Tt,41:dt,42:Ft,48:ut,50:xt,51:ft,52:gt,53:i,54:Bt,60:W,61:U,63:k,64:F,65:P,66:v,67:C}),t(a,[2,39]),t(a,[2,40]),t(a,[2,41]),{36:[1,47]},{38:[1,48]},{40:[1,49]},t(a,[2,45]),t(a,[2,46]),{18:[1,50]},{4:d,5:T,10:q,12:m,13:b,14:x,43:51,58:31,60:W,61:U,63:k,64:F,65:P,66:v,67:C},{4:d,5:T,10:q,12:m,13:b,14:x,43:52,58:31,60:W,61:U,63:k,64:F,65:P,66:v,67:C},{4:d,5:T,10:q,12:m,13:b,14:x,43:53,58:31,60:W,61:U,63:k,64:F,65:P,66:v,67:C},{4:d,5:T,10:q,12:m,13:b,14:x,43:54,58:31,60:W,61:U,63:k,64:F,65:P,66:v,67:C},{4:d,5:T,10:q,12:m,13:b,14:x,43:55,58:31,60:W,61:U,63:k,64:F,65:P,66:v,67:C},{4:d,5:T,10:q,12:m,13:b,14:x,43:56,58:31,60:W,61:U,63:k,64:F,65:P,66:v,67:C},{4:d,5:T,8:H,10:q,12:m,13:b,14:x,18:X,44:[1,57],47:[1,58],58:60,59:59,63:k,64:F,65:P,66:v,67:C},t(L,[2,64]),t(L,[2,66]),t(L,[2,67]),t(L,[2,70]),t(L,[2,71]),t(L,[2,72]),t(L,[2,73]),t(L,[2,74]),t(L,[2,75]),t(L,[2,76]),t(L,[2,77]),t(L,[2,78]),t(L,[2,79]),t(L,[2,80]),t(y,[2,35]),t(a,[2,38]),t(a,[2,42]),t(a,[2,43]),t(a,[2,44]),{3:64,4:Rt,5:Nt,6:Wt,7:Ut,8:Qt,9:Ot,10:Ht,11:Xt,12:Mt,13:Yt,14:jt,15:Gt,21:63},t(a,[2,53],{59:59,58:60,4:d,5:T,8:H,10:q,12:m,13:b,14:x,18:X,49:[1,77],63:k,64:F,65:P,66:v,67:C}),t(a,[2,56],{59:59,58:60,4:d,5:T,8:H,10:q,12:m,13:b,14:x,18:X,49:[1,78],63:k,64:F,65:P,66:v,67:C}),t(a,[2,57],{59:59,58:60,4:d,5:T,8:H,10:q,12:m,13:b,14:x,18:X,63:k,64:F,65:P,66:v,67:C}),t(a,[2,58],{59:59,58:60,4:d,5:T,8:H,10:q,12:m,13:b,14:x,18:X,63:k,64:F,65:P,66:v,67:C}),t(a,[2,59],{59:59,58:60,4:d,5:T,8:H,10:q,12:m,13:b,14:x,18:X,63:k,64:F,65:P,66:v,67:C}),t(a,[2,60],{59:59,58:60,4:d,5:T,8:H,10:q,12:m,13:b,14:x,18:X,63:k,64:F,65:P,66:v,67:C}),{45:[1,79]},{44:[1,80]},t(L,[2,65]),t(L,[2,81]),t(L,[2,82]),t(L,[2,83]),{3:82,4:Rt,5:Nt,6:Wt,7:Ut,8:Qt,9:Ot,10:Ht,11:Xt,12:Mt,13:Yt,14:jt,15:Gt,18:[1,81]},t(I,[2,23]),t(I,[2,1]),t(I,[2,2]),t(I,[2,3]),t(I,[2,4]),t(I,[2,5]),t(I,[2,6]),t(I,[2,7]),t(I,[2,8]),t(I,[2,9]),t(I,[2,10]),t(I,[2,11]),t(I,[2,12]),t(a,[2,52],{58:31,43:83,4:d,5:T,10:q,12:m,13:b,14:x,60:W,61:U,63:k,64:F,65:P,66:v,67:C}),t(a,[2,55],{58:31,43:84,4:d,5:T,10:q,12:m,13:b,14:x,60:W,61:U,63:k,64:F,65:P,66:v,67:C}),{46:[1,85]},{45:[1,86]},{4:J,5:$,6:tt,8:et,11:it,13:at,16:89,17:nt,18:st,19:rt,20:ot,22:88,23:87},t(I,[2,24]),t(a,[2,51],{59:59,58:60,4:d,5:T,8:H,10:q,12:m,13:b,14:x,18:X,63:k,64:F,65:P,66:v,67:C}),t(a,[2,54],{59:59,58:60,4:d,5:T,8:H,10:q,12:m,13:b,14:x,18:X,63:k,64:F,65:P,66:v,67:C}),t(a,[2,47],{22:88,16:89,23:100,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot}),{46:[1,101]},t(a,[2,29],{10:Pt}),t(Kt,[2,27],{16:103,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot}),t(R,[2,25]),t(R,[2,13]),t(R,[2,14]),t(R,[2,15]),t(R,[2,16]),t(R,[2,17]),t(R,[2,18]),t(R,[2,19]),t(R,[2,20]),t(R,[2,21]),t(R,[2,22]),t(a,[2,49],{10:Pt}),t(a,[2,48],{22:88,16:89,23:104,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot}),{4:J,5:$,6:tt,8:et,11:it,13:at,16:89,17:nt,18:st,19:rt,20:ot,22:105},t(R,[2,26]),t(a,[2,50],{10:Pt}),t(Kt,[2,28],{16:103,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot})],defaultActions:{8:[2,30],9:[2,31]},parseError:o(function(r,l){if(l.recoverable)this.trace(r);else{var g=new Error(r);throw g.hash=l,g}},"parseError"),parse:o(function(r){var l=this,g=[0],f=[],_=[null],e=[],pt=this.table,s="",mt=0,Zt=0,qe=2,Jt=1,me=e.slice.call(arguments,1),E=Object.create(this.lexer),K={yy:{}};for(var Ct in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ct)&&(K.yy[Ct]=this.yy[Ct]);E.setInput(r,K.yy),K.yy.lexer=E,K.yy.parser=this,typeof E.yylloc>"u"&&(E.yylloc={});var Lt=E.yylloc;e.push(Lt);var be=E.options&&E.options.ranges;typeof K.yy.parseError=="function"?this.parseError=K.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Se(B){g.length=g.length-2*B,_.length=_.length-B,e.length=e.length-B}o(Se,"popStack");function $t(){var B;return B=f.pop()||E.lex()||Jt,typeof B!="number"&&(B instanceof Array&&(f=B,B=f.pop()),B=l.symbols_[B]||B),B}o($t,"lex");for(var w,Z,N,Et,lt={},bt,M,te,St;;){if(Z=g[g.length-1],this.defaultActions[Z]?N=this.defaultActions[Z]:((w===null||typeof w>"u")&&(w=$t()),N=pt[Z]&&pt[Z][w]),typeof N>"u"||!N.length||!N[0]){var Dt="";St=[];for(bt in pt[Z])this.terminals_[bt]&&bt>qe&&St.push("'"+this.terminals_[bt]+"'");E.showPosition?Dt="Parse error on line "+(mt+1)+`:
2
2
  `+E.showPosition()+`
3
3
  Expecting `+St.join(", ")+", got '"+(this.terminals_[w]||w)+"'":Dt="Parse error on line "+(mt+1)+": Unexpected "+(w==Jt?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(Dt,{text:E.match,token:this.terminals_[w]||w,line:E.yylineno,loc:Lt,expected:St})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Z+", token: "+w);switch(N[0]){case 1:g.push(w),_.push(E.yytext),e.push(E.yylloc),g.push(N[1]),w=null,Zt=E.yyleng,s=E.yytext,mt=E.yylineno,Lt=E.yylloc;break;case 2:if(M=this.productions_[N[1]][1],lt.$=_[_.length-M],lt._$={first_line:e[e.length-(M||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(M||1)].first_column,last_column:e[e.length-1].last_column},be&&(lt._$.range=[e[e.length-(M||1)].range[0],e[e.length-1].range[1]]),Et=this.performAction.apply(lt,[s,Zt,mt,K.yy,N[1],_,e].concat(me)),typeof Et<"u")return Et;M&&(g=g.slice(0,-1*M*2),_=_.slice(0,-1*M),e=e.slice(0,-1*M)),g.push(this.productions_[N[1]][0]),_.push(lt.$),e.push(lt._$),te=pt[g[g.length-2]][g[g.length-1]],g.push(te);break;case 3:return!0}}return!0},"parse")},Te=function(){var j={EOF:1,parseError:o(function(l,g){if(this.yy.parser)this.yy.parser.parseError(l,g);else throw new Error(l)},"parseError"),setInput:o(function(r,l){return this.yy=l||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var l=r.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:o(function(r){var l=r.length,g=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var f=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===f.length?this.yylloc.first_column:0)+f[f.length-g.length].length-g[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(r){this.unput(this.match.slice(r))},"less"),pastInput:o(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var r=this.pastInput(),l=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
@@ -0,0 +1 @@
1
+ import{r as x,d as B,i as m,c as i,e as l,a as f,t as g,u as t,O as I,w as d,M as z,o as s,J as L,q as v,b as w,_ as N,n as b,N as S,L as $}from"./DD6NieRw.js";import{c as k}from"./B-OC4Wzf.js";import{u as V}from"./CT4V-SdE.js";function j(c=2e3){const e=x(!1),n=x({});return{copied:e,handleCopy:async o=>{await k(o),e.value=!0,setTimeout(()=>{e.value=!1},c)},copiedStates:n,handleCopyWithKey:async(o,r)=>{await k(r),n.value[o]=!0,setTimeout(()=>{n.value[o]=!1},c)},isCopied:o=>n.value[o]??!1,getCopyIcon:(o=e.value)=>o?"hugeicons:tick-02":"hugeicons:copy-01",getCopyIconClass:(o=e.value)=>o?"text-primary":"",getCopyTooltip:(o=e.value,r="Copy")=>o?"Copied!":r}}const q={class:"rounded-lg border border-border/60 bg-muted/30 overflow-hidden shadow-sm"},K={class:"flex items-center justify-between px-3 py-1 border-b border-border/40 bg-muted/50"},M={class:"text-xxs font-semibold tracking-widest uppercase text-muted-foreground select-none"},W={class:"flex items-center gap-1 justify-center"},E=["innerHTML"],J={key:1,class:"p-3 font-mono whitespace-pre leading-relaxed text-foreground/80 m-0 w-fit min-w-full chat-code-text"},Y=B({__name:"CodeHighlightPreview",props:{code:{},language:{default:"sql"},showCopyButton:{type:Boolean,default:!0},maxHeight:{default:void 0},decorations:{default:()=>[]}},setup(c){const e=c,{highlight:n}=V(),p=m(()=>e.code?n(e.code,e.language,{decorations:e.decorations}):null),h=m(()=>e.maxHeight?{maxHeight:e.maxHeight,overflowY:"auto",overflowX:"auto"}:{}),{copied:a,handleCopy:y,getCopyIcon:C,getCopyIconClass:u,getCopyTooltip:o}=j(),r=async()=>{e.code&&await y(e.code)},T=m(()=>e.language.toUpperCase());return(_,O)=>{const H=N;return s(),i("div",q,[l("div",K,[l("span",M,g(T.value),1),f(t(I),null,{default:d(()=>[f(t(L),{"as-child":""},{default:d(()=>[_.showCopyButton?(s(),v(t(S),{key:0,variant:"ghost",size:"xxs",onClick:r},{default:d(()=>[l("span",W,[(s(),v(H,{key:t(a)?"tick":"copy",name:t(C)(t(a)),class:b(["size-3.5",t(u)(t(a))])},null,8,["name","class"])),t(a)?(s(),i("span",{key:0,class:b(["text-xxs font-medium leading-none",t(u)(t(a))])},"Copied",2)):w("",!0)])]),_:1})):w("",!0)]),_:1}),f(t($),null,{default:d(()=>[l("p",null,g(t(o)(t(a),"Copy code")),1)]),_:1})]),_:1})]),l("div",{style:z(h.value)},[p.value?(s(),i("div",{key:0,class:"[&>pre]:p-3 [&>pre]:font-mono [&>pre]:whitespace-pre [&>pre]:leading-relaxed [&>pre]:m-0 [&>pre]:w-fit [&>pre]:min-w-full [&>pre]:rounded-none chat-code-text",innerHTML:p.value},null,8,E)):(s(),i("pre",J,g(_.code),1))],4)])}}});export{Y as _,j as u};
@@ -0,0 +1 @@
1
+ import{d as ie,aH as me,r as _,i as g,am as M,aI as fe,c,a as d,e as s,w as b,F as U,x as L,u as a,b as N,l as D,f as m,Q as ue,R as ge,bi as Z,q as I,ai as xe,N as he,bj as ye,bk as _e,o as i,_ as we,t as x,bl as ke,ae as Ie,n as Se,bm as Re,bn as Te,ah as be,Z as Ce,U as Ve,V as Pe,ad as Ke}from"./DD6NieRw.js";import{_ as ze}from"./s10hyhzI.js";import{_ as Ee,u as Ne}from"./DDNFAZ6A.js";import{_ as Ue,a as Le}from"./DghZRCwT.js";import{i as Oe}from"./DeGwWuWf.js";import{g as Be,a as Ae}from"./CCwJzmTT.js";const je={class:"flex h-full flex-col gap-4 overflow-hidden p-4"},Me={class:"flex flex-wrap items-center gap-2"},De={class:"grid min-h-0 flex-1 gap-4 grid-cols-5"},Fe={class:"flex min-h-0 flex-col gap-4 col-span-2"},He={class:"rounded-lg border bg-background p-4 space-y-4"},Je={class:"space-y-3"},qe={class:"space-y-2"},We={class:"flex flex-wrap gap-2"},Qe={key:0,class:"space-y-2"},Ze={class:"space-y-2"},Ge={class:"min-w-0"},Xe={class:"truncate text-sm font-medium"},Ye={class:"text-xs text-muted-foreground"},et={class:"rounded-lg border bg-background p-4 space-y-4"},tt={class:"space-y-2"},st={class:"space-y-2"},at={class:"flex justify-end"},nt={class:"flex min-h-0 flex-col overflow-hidden rounded-lg border bg-background col-span-3"},lt={class:"border-b px-4 py-3"},ot={class:"flex flex-wrap items-center gap-2"},it={class:"min-h-0 flex-1 overflow-auto p-4"},dt={key:1,class:"space-y-3"},rt={class:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground"},ut={class:"mt-2 overflow-auto rounded-md border bg-background p-3 text-xs"},ct=ie({__name:"RedisPubSubPanel",props:{connection:{},databaseIndex:{},databases:{}},emits:["update:databaseIndex"],setup(F,{emit:T}){const t=F,P=T,f=me(null),h=_([]),y=_(""),r=_(""),w=_(""),p=_(null),k=_(!1),O=_(!1),S=_(!1);let $=null;const H=g(()=>{var o;return((o=f.value)==null?void 0:o.subscription)??{sessionId:p.value,target:null,mode:null,targets:[]}}),K=g(()=>H.value.targets??[]),J=g(()=>{var o,n;return[{label:`${((o=f.value)==null?void 0:o.channels.length)??0} channels`},{label:`${((n=f.value)==null?void 0:n.patternCount)??0} patterns`},{label:K.value.length?`${K.value.length} active target${K.value.length===1?"":"s"}`:"Not subscribed"}]}),B=g(()=>h.value.slice().reverse()),G=o=>({method:o.method,stringConnection:o.connectionString,host:o.host,port:o.port,username:o.username,password:o.password,database:o.database,ssl:o.ssl,ssh:o.ssh}),q=async()=>{if(!t.connection){f.value=null;return}k.value=!0;try{f.value=await $fetch("/api/redis/pubsub/overview",{method:"POST",body:{...G(t.connection),databaseIndex:t.databaseIndex,sessionId:p.value}})}finally{k.value=!1}},de=async()=>{if(!p.value){h.value=[];return}const o=await $fetch("/api/redis/pubsub/messages",{method:"POST",body:{sessionId:p.value}});h.value=o.messages,f.value&&(f.value={...f.value,subscription:o.subscription})},A=async()=>{await Promise.all([q(),de()])},z=()=>{$&&(clearInterval($),$=null)},ae=()=>{z(),$=ke(()=>{A()},2e3)},re=async()=>{if(!(!t.connection||!y.value.trim())){O.value=!0;try{const o=await $fetch("/api/redis/pubsub/subscribe",{method:"POST",body:{...G(t.connection),databaseIndex:t.databaseIndex,target:y.value.trim(),sessionId:p.value}});p.value=o.subscription.sessionId,h.value=o.messages,y.value="";const n=o.subscription.targets.find(C=>C.mode==="channel");!r.value&&n&&(r.value=n.target),await q(),ae()}finally{O.value=!1}}},X=async o=>{var V;if(!p.value)return;const n=p.value,C=await $fetch("/api/redis/pubsub/unsubscribe",{method:"POST",body:{sessionId:n,target:o??null}});if(!o||C.closed){p.value=null,h.value=[],z(),await q();return}await A(),(((V=f.value)==null?void 0:V.subscription.targets.length)??0)===0&&(p.value=null,h.value=[],z())},ne=async()=>{if(!(!t.connection||!r.value.trim())){S.value=!0;try{await $fetch("/api/redis/pubsub/publish",{method:"POST",body:{...G(t.connection),databaseIndex:t.databaseIndex,channel:r.value.trim(),payload:w.value}}),w.value="",await A()}finally{S.value=!1}}};return M(()=>{var o;return(o=f.value)==null?void 0:o.subscription.sessionId},o=>{p.value=o??null}),M(K,o=>{if(o.length===0){p.value&&z();return}if(!r.value){const n=o.find(C=>C.mode==="channel");n&&(r.value=n.target)}},{immediate:!0}),M(p,o=>{if(o){ae();return}z()}),M(()=>{var o;return[(o=t.connection)==null?void 0:o.id,t.databaseIndex]},async()=>{if(z(),p.value){await X();return}h.value=[],await q()},{immediate:!0}),fe(()=>{z(),p.value&&$fetch("/api/redis/pubsub/unsubscribe",{method:"POST",body:{sessionId:p.value,target:null}}).catch(()=>{})}),(o,n)=>{const C=we,V=he,le=ze,Y=ye,j=_e,ee=xe;return i(),c("div",je,[d(le,{icon:"hugeicons:radio",title:"Pub/Sub",description:"Subscribe to a channel or pattern, publish test events, and watch live messages without leaving the detail flow."},{context:b(()=>n[5]||(n[5]=[])),actions:b(()=>[d(Ee,{compact:"","trigger-id":"redis-pubsub-db-index","trigger-class":"bg-background",databases:o.databases,"database-index":o.databaseIndex,"onUpdate:databaseIndex":n[0]||(n[0]=v=>P("update:databaseIndex",v))},null,8,["databases","database-index"]),d(V,{variant:"outline",size:"xxs",disabled:a(k),onClick:A},{default:b(()=>[d(C,{name:"hugeicons:redo",class:"size-3.5! min-w-3.5"}),n[6]||(n[6]=m(" Refresh "))]),_:1},8,["disabled"])]),_:1}),s("div",Me,[(i(!0),c(U,null,L(a(J),v=>(i(),I(a(Z),{key:v.label,variant:"outline",class:"h-6 px-2 text-[11px] font-normal"},{default:b(()=>[m(x(v.label),1)]),_:2},1024))),128))]),s("div",De,[s("div",Fe,[s("div",He,[s("div",Je,[n[12]||(n[12]=s("div",null,[s("div",null,[s("div",{class:"text-sm font-medium"},"Subscription"),s("p",{class:"text-xs text-muted-foreground"}," Add channels or wildcard patterns to the same live session. Pattern detection is automatic. ")])],-1)),s("div",qe,[d(Y,{for:"redis-pubsub-target"},{default:b(()=>n[7]||(n[7]=[m("Target")])),_:1}),d(j,{size:"sm",id:"redis-pubsub-target",modelValue:a(y),"onUpdate:modelValue":n[1]||(n[1]=v=>D(y)?y.value=v:null),placeholder:"orders.events or orders.*"},null,8,["modelValue"]),n[8]||(n[8]=s("p",{class:"text-xs text-muted-foreground"},[m(" Use a plain channel name or include wildcard characters like "),s("span",{class:"font-mono"},"*"),m(" and "),s("span",{class:"font-mono"},"?"),m(" for patterns. ")],-1))]),s("div",We,[d(V,{size:"xs",disabled:a(O),onClick:re},{default:b(()=>n[9]||(n[9]=[m(" Add target ")])),_:1},8,["disabled"]),d(V,{size:"xs",variant:"outline",disabled:!a(p),onClick:n[2]||(n[2]=v=>X(void 0))},{default:b(()=>n[10]||(n[10]=[m(" Clear all ")])),_:1},8,["disabled"])]),a(K).length?(i(),c("div",Qe,[n[11]||(n[11]=s("div",{class:"text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground"}," Active targets ",-1)),s("div",Ze,[(i(!0),c(U,null,L(a(K),v=>(i(),c("div",{key:v.target,class:"flex items-center justify-between gap-3 rounded-lg border bg-muted/10 px-3 py-2"},[s("div",Ge,[s("div",Xe,x(v.target),1),s("div",Ye,x(v.mode==="pattern"?"Pattern detected automatically":"Channel detected automatically"),1)]),d(V,{size:"iconSm",variant:"ghost","aria-label":`Remove ${v.target}`,onClick:e=>X(v.target)},{default:b(()=>[d(C,{name:"hugeicons:cancel-01",class:"size-4! min-w-4"})]),_:2},1032,["aria-label","onClick"])]))),128))])])):N("",!0)])]),s("div",et,[n[16]||(n[16]=s("div",null,[s("div",{class:"text-sm font-medium"},"Publish"),s("p",{class:"text-xs text-muted-foreground"}," Send a quick payload to a channel and inspect the response stream on the right. ")],-1)),s("div",tt,[d(Y,{for:"redis-pubsub-channel"},{default:b(()=>n[13]||(n[13]=[m("Channel")])),_:1}),d(j,{size:"sm",id:"redis-pubsub-channel",modelValue:a(r),"onUpdate:modelValue":n[3]||(n[3]=v=>D(r)?r.value=v:null),placeholder:"orders.events"},null,8,["modelValue"])]),s("div",st,[d(Y,{for:"redis-pubsub-payload"},{default:b(()=>n[14]||(n[14]=[m("Payload")])),_:1}),ue(s("textarea",{id:"redis-pubsub-payload","onUpdate:modelValue":n[4]||(n[4]=v=>D(w)?w.value=v:null),class:"min-h-[140px] w-full rounded-lg border bg-background px-3 py-2 text-sm font-mono",placeholder:'{"event":"order.created"}'},null,512),[[ge,a(w)]])]),s("div",at,[d(V,{size:"sm",disabled:a(S),onClick:ne},{default:b(()=>n[15]||(n[15]=[m(" Publish ")])),_:1},8,["disabled"])])])]),s("div",nt,[s("div",lt,[s("div",ot,[n[18]||(n[18]=s("div",{class:"text-sm font-medium"},"Live Messages",-1)),d(a(Z),{variant:"outline",class:"h-5 px-1.5 text-xxs font-normal"},{default:b(()=>[m(x(a(B).length)+" messages ",1)]),_:1}),d(a(Z),{variant:"outline",class:"h-5 px-1.5 text-xxs font-normal"},{default:b(()=>n[17]||(n[17]=[m(" Polling 2s ")])),_:1})]),n[19]||(n[19]=s("div",{class:"mt-1 text-xs text-muted-foreground"}," Message polling stays active while the current subscription session is connected. ",-1))]),s("div",it,[a(B).length===0?(i(),I(ee,{key:0,title:"No Pub/Sub messages yet",desc:"Subscribe to a channel or pattern, then publish an event to watch it appear here."})):(i(),c("div",dt,[(i(!0),c(U,null,L(a(B),v=>(i(),c("div",{key:v.id,class:"rounded-lg border bg-muted/10 p-3"},[s("div",rt,[d(a(Z),{variant:"outline",class:"h-5 px-1.5 text-xxs font-normal text-foreground"},{default:b(()=>[m(x(v.channel),1)]),_:2},1024),v.pattern?(i(),I(a(Z),{key:0,variant:"outline",class:"h-5 px-1.5 text-xxs font-normal"},{default:b(()=>[m(" Pattern "+x(v.pattern),1)]),_:2},1024)):N("",!0),s("span",null,x(new Date(v.receivedAt).toLocaleTimeString()),1)]),s("pre",ut,[s("code",null,x(v.payload),1)])]))),128))]))])])])])}}}),pt={class:"h-full flex flex-col gap-3 p-4 overflow-auto"},vt={key:0,class:"relative min-h-[240px] overflow-hidden rounded-lg border bg-background"},bt={key:3,class:"space-y-4"},mt={class:"flex flex-col gap-1"},ft={class:"flex items-start gap-2"},gt={class:"text-sm font-semibold break-all"},xt={class:"text-xs text-muted-foreground"},ht={class:"flex flex-wrap items-center gap-2"},yt={class:"ml-auto flex items-center gap-2"},_t=["value"],wt={class:"grid gap-3 md:grid-cols-[220px_1fr] items-start"},kt={class:"space-y-1"},$t={class:"flex items-center gap-2"},It={class:"text-xs text-muted-foreground"},St={key:0,class:"text-xs text-destructive"},Rt={key:1,class:"space-y-3"},Tt=["readonly"],Ct={key:2,class:"min-h-[360px] overflow-hidden rounded-lg border"},Vt={key:3,class:"space-y-3"},Pt={class:"flex justify-end"},Kt={class:"overflow-hidden rounded-lg border"},zt={class:"w-full text-sm"},Et={class:"bg-muted/30 text-left"},Nt={key:1},Ut={class:"px-3 py-2 text-right"},Lt={key:0},Ot=["colspan"],Bt={key:4,class:"min-h-[320px] overflow-auto rounded-lg border bg-muted/20 p-3 text-xs"},At={class:"flex justify-end"},jt=ie({__name:"RedisValueEditor",props:{detail:{},loading:{type:Boolean},saving:{type:Boolean},canEdit:{type:Boolean},unavailableReason:{}},emits:["save","refresh"],setup(F,{emit:T}){const t=F,P=T,f=_(""),h=me(null),y=_("tree"),r=_([]),w=_(""),p=_(!1),k=_(5),O=[5,10,30],S=e=>e==null?e:JSON.parse(JSON.stringify(e)),$=(e,l)=>JSON.stringify(e)===JSON.stringify(l);M(()=>t.detail,e=>{f.value=(e==null?void 0:e.previewKind)==="text"?String(e.value??""):"",h.value=(e==null?void 0:e.previewKind)==="json"?S(e.value):null,r.value=e!=null&&e.tableRows?S(e.tableRows):[],w.value=(e==null?void 0:e.ttl)!==void 0&&e.ttl>=0?`${e.ttl}`:""},{immediate:!0});const H=g(()=>t.detail?typeof t.detail.value=="string"?t.detail.value:JSON.stringify(t.detail.value,null,2):""),K=g(()=>{var e;return t.unavailableReason?t.unavailableReason:((e=t.detail)==null?void 0:e.previewKind)==="readonly"?"Value editing is unavailable for this Redis type. TTL changes can still be saved.":""}),J=g(()=>{const e=w.value.trim();if(!e)return"";const l=Number.parseInt(e,10);return!Number.isFinite(l)||l<0?"TTL must be empty or a non-negative integer.":""}),B=g(()=>{if(!t.detail)return;const e=w.value.trim(),l=t.detail.ttl>=0?`${t.detail.ttl}`:"";if(e===l)return;if(!e)return null;const R=Number.parseInt(e,10);return Number.isFinite(R)&&R>=0?R:void 0}),G=g(()=>t.detail?[{label:`DB ${t.detail.databaseIndex}`},{label:t.detail.type},{label:`TTL ${t.detail.ttlLabel}`},{label:`Size ${t.detail.memoryUsageHuman??"n/a"}`},{label:t.detail.length!==null&&t.detail.length!==void 0?`Length ${t.detail.length}`:"Length n/a"},{label:`Encoding ${t.detail.encoding??"n/a"}`}]:[]),q=g(()=>!t.detail||t.detail.type==="none"?"hugeicons:database-02":Be(t.detail.type)),de=g(()=>!t.detail||t.detail.type==="none"?"text-primary":Ae(t.detail.type)),A=g(()=>!t.detail||!t.canEdit||J.value||t.saving?!1:B.value!==void 0),z=g(()=>"Update TTL"),ae=g(()=>{var e;return t.canEdit&&((e=t.detail)==null?void 0:e.previewKind)==="table"}),re=g(()=>{if(!t.detail)return!1;switch(t.detail.previewKind){case"text":return f.value!==String(t.detail.value??"");case"json":return!$(h.value,t.detail.value);case"table":return!$(r.value,t.detail.tableRows??[]);default:return!1}}),X=g(()=>re.value||B.value!==void 0),ne=g(()=>!t.detail||!t.canEdit||J.value?!1:X.value),o=(e,l,R)=>{var E,oe;const te=r.value.find(se=>se.id===e);if(!te)return;const W=(oe=(E=t.detail)==null?void 0:E.tableColumns)==null?void 0:oe.find(se=>se.key===l);te[l]=(W==null?void 0:W.type)==="number"?Number(R||0):R},n=()=>{var e;((e=t.detail)==null?void 0:e.tableKind)==="list"&&(r.value=r.value.map((l,R)=>({...l,index:R})))},C=()=>{var l;if(!((l=t.detail)!=null&&l.tableKind))return;const e=`row-${Date.now()}-${r.value.length}`;switch(t.detail.tableKind){case"hash":r.value.push({id:e,field:"",value:""});break;case"list":r.value.push({id:e,index:r.value.length,value:""});break;case"set":r.value.push({id:e,value:""});break;case"zset":r.value.push({id:e,value:"",score:0});break}},V=e=>{r.value=r.value.filter(l=>l.id!==e),n()},le=()=>{if(!t.detail||!ne.value)return;const e={previewKind:t.detail.previewKind,stringFormat:t.detail.stringFormat,tableKind:t.detail.tableKind,ttlSeconds:B.value,value:t.detail.value};t.detail.previewKind==="text"&&(e.value=f.value),t.detail.previewKind==="json"&&(e.value=h.value),t.detail.previewKind==="table"&&(e.value=S(r.value)),P("save",e)},Y=()=>{A.value&&le()};let j=null;const ee=()=>{j!==null&&(clearInterval(j),j=null)};return M([p,k,()=>{var e;return(e=t.detail)==null?void 0:e.key}],()=>{ee(),!(!p.value||!t.detail)&&(j=ke(()=>{!t.detail||t.loading||t.saving||P("refresh")},k.value*1e3))},{immediate:!0}),M(()=>t.detail,e=>{e||ee()}),fe(()=>{ee()}),(e,l)=>{var pe,ve;const R=xe,te=we,W=ye,E=he,oe=Le,se=Ue,ce=_e;return i(),c("div",pt,[e.loading&&!e.detail?(i(),c("div",vt,[l[7]||(l[7]=s("div",{class:"flex h-full min-h-[240px] items-center justify-center px-4 text-sm text-muted-foreground"}," Loading Redis key detail... ",-1)),d(a(Ie),{visible:!0})])):!e.detail&&!e.loading?(i(),I(R,{key:1,title:"Select a Redis key",desc:"Choose a key from the Redis browser to inspect its value and metadata."})):((pe=e.detail)==null?void 0:pe.type)==="none"?(i(),I(R,{key:2,icon:"icons:404",title:"Key not found",desc:"This key no longer exists. It may have expired or been deleted."})):e.detail?(i(),c("div",bt,[s("div",mt,[s("div",ft,[d(te,{name:a(q),class:Se(["mt-0.5 size-4 min-w-4",a(de)])},null,8,["name","class"]),s("div",gt,x(e.detail.key),1)]),s("div",xt,x(e.detail.type)+" key preview ",1)]),s("div",ht,[(i(!0),c(U,null,L(a(G),u=>(i(),I(a(Z),{key:u.label,variant:"outline",class:"h-6 px-2 text-[11px] font-normal"},{default:b(()=>[m(x(u.label),1)]),_:2},1024))),128)),s("div",yt,[d(a(Re),{id:"redis-auto-refresh",checked:a(p),"onUpdate:checked":l[0]||(l[0]=u=>D(p)?p.value=u:null)},null,8,["checked"]),d(W,{for:"redis-auto-refresh",class:"text-xs font-medium"},{default:b(()=>l[8]||(l[8]=[m(" Auto refresh ")])),_:1}),d(E,{variant:"ghost",size:"sm",class:"h-7 px-2 text-xs","aria-label":"Refresh key detail",disabled:e.loading||e.saving,onClick:l[1]||(l[1]=u=>P("refresh"))},{default:b(()=>[d(te,{name:"hugeicons:redo",class:"size-3.5! min-w-3.5"}),l[9]||(l[9]=m(" Refresh "))]),_:1},8,["disabled"]),a(p)?ue((i(),c("select",{key:0,"onUpdate:modelValue":l[2]||(l[2]=u=>D(k)?k.value=u:null),class:"h-7 rounded-md border bg-background px-2 text-xs","aria-label":"Auto refresh interval"},[(i(),c(U,null,L(O,u=>s("option",{key:u,value:u},x(u)+"s ",9,_t)),64))],512)),[[Te,a(k)]]):N("",!0)])]),a(K)?(i(),I(se,{key:0,class:"border-border bg-muted/20"},{default:b(()=>[d(oe,{class:"text-muted-foreground"},{default:b(()=>[m(x(a(K)),1)]),_:1})]),_:1})):N("",!0),s("div",wt,[s("div",kt,[d(W,{for:"redis-ttl-input"},{default:b(()=>l[10]||(l[10]=[m("TTL (seconds)")])),_:1}),s("div",$t,[d(ce,{id:"redis-ttl-input",size:"sm","model-value":a(w),disabled:!e.canEdit,placeholder:"Leave empty to persist","onUpdate:modelValue":l[3]||(l[3]=u=>w.value=String(u||""))},null,8,["model-value","disabled"]),d(E,{variant:"outline",size:"xs",disabled:!a(A),onClick:Y},{default:b(()=>[m(x(a(z)),1)]),_:1},8,["disabled"])]),s("p",It," Current: "+x(e.detail.ttlLabel),1),a(J)?(i(),c("p",St,x(a(J)),1)):N("",!0)])]),e.detail.previewKind==="text"?(i(),c("div",Rt,[ue(s("textarea",{"onUpdate:modelValue":l[4]||(l[4]=u=>D(f)?f.value=u:null),readonly:!e.canEdit,class:"min-h-[320px] w-full rounded-lg border bg-background px-3 py-2 text-sm font-mono"},null,8,Tt),[[ge,a(f)]])])):e.detail.previewKind==="json"?(i(),c("div",Ct,[d(a(Oe),{modelValue:a(h),"onUpdate:modelValue":l[5]||(l[5]=u=>D(h)?h.value=u:null),class:"h-[360px]",mode:a(y),navigationBar:!1,readOnly:!e.canEdit,onModeChange:l[6]||(l[6]=u=>y.value=u)},null,8,["modelValue","mode","readOnly"])])):e.detail.previewKind==="table"?(i(),c("div",Vt,[s("div",Pt,[a(ae)?(i(),I(E,{key:0,variant:"outline",size:"sm",onClick:C},{default:b(()=>l[11]||(l[11]=[m(" Add Row ")])),_:1})):N("",!0)]),s("div",Kt,[s("table",zt,[s("thead",Et,[s("tr",null,[(i(!0),c(U,null,L(e.detail.tableColumns,u=>(i(),c("th",{key:u.key,class:"px-3 py-2 font-medium"},x(u.label),1))),128)),l[12]||(l[12]=s("th",{class:"w-16 px-3 py-2 font-medium"},null,-1))])]),s("tbody",null,[(i(!0),c(U,null,L(a(r),u=>(i(),c("tr",{key:u.id,class:"border-t align-top"},[(i(!0),c(U,null,L(e.detail.tableColumns,Q=>(i(),c("td",{key:Q.key,class:"px-3 py-2"},[Q.editable?(i(),I(ce,{key:0,size:"sm","model-value":`${u[Q.key]??""}`,disabled:!e.canEdit,"onUpdate:modelValue":$e=>o(u.id,Q.key,String($e||""))},null,8,["model-value","disabled","onUpdate:modelValue"])):(i(),c("span",Nt,x(u[Q.key]),1))]))),128)),s("td",Ut,[d(E,{variant:"ghost",size:"sm",disabled:!e.canEdit,onClick:Q=>V(u.id)},{default:b(()=>l[13]||(l[13]=[m(" Remove ")])),_:2},1032,["disabled","onClick"])])]))),128)),a(r).length===0?(i(),c("tr",Lt,[s("td",{colspan:(((ve=e.detail.tableColumns)==null?void 0:ve.length)||0)+1,class:"px-3 py-6 text-center text-sm text-muted-foreground"}," No rows available. ",8,Ot)])):N("",!0)])])])])):(i(),c("pre",Bt,[s("code",null,x(a(H)),1)])),s("div",At,[d(E,{size:"sm",disabled:e.saving||!a(ne),onClick:le},{default:b(()=>l[14]||(l[14]=[m(" Save Changes ")])),_:1},8,["disabled"])])])):N("",!0)])}}}),Mt=ie({__name:"RedisWorkspace",props:{connection:{},tabInfo:{}},setup(F){const T=F,t=Ne({connection:()=>T.connection,tabInfo:()=>T.tabInfo}),{canEditSelectedValue:P,databases:f,editUnavailableReason:h,loadingKeys:y,loadingSelectedKeyDetail:r,savingValue:w,selectedDatabaseIndex:p,selectedKeyDetail:k}=t,O=g(()=>{var S;return((S=T.tabInfo)==null?void 0:S.type)||be.RedisBrowser});return(S,$)=>a(O)===a(be).RedisPubSub?(i(),I(ct,{key:0,connection:T.connection,"database-index":a(p),databases:a(f),"onUpdate:databaseIndex":$[0]||($[0]=H=>a(t).selectedDatabaseIndex.value=H)},null,8,["connection","database-index","databases"])):(i(),I(jt,{key:1,detail:a(k),loading:a(y)||a(r),saving:a(w),"can-edit":a(P),"unavailable-reason":a(h),onSave:a(t).saveSelectedValue,onRefresh:$[1]||($[1]=H=>a(k)&&a(t).focusKey(a(k).key))},null,8,["detail","loading","saving","can-edit","unavailable-reason","onSave"]))}}),Qt=ie({__name:"[tabViewId]",setup(F){const T=Ce(),t=Ve(),P=Pe(),{tabViews:f}=Ke(t),h=g(()=>f.value.find(y=>y.id===T.params.tabViewId));return(y,r)=>(i(),I(Mt,{connection:a(P).selectedConnection,"tab-info":a(h)},null,8,["connection","tab-info"]))}});export{Qt as default};
@@ -1,4 +1,4 @@
1
- import{g as le}from"./BsCPQnkm.js";import{s as he}from"./BO3FEgXG.js";import{_ as l,l as C,p as de,r as ge,I as j,c as X,i as F,ay as ue,ad as pe,ae as fe,af as ye}from"./BJvJ0Hlu.js";import"./C6teO48Y.js";const E=[];for(let t=0;t<256;++t)E.push((t+256).toString(16).slice(1));function me(t,e=0){return(E[t[e+0]]+E[t[e+1]]+E[t[e+2]]+E[t[e+3]]+"-"+E[t[e+4]]+E[t[e+5]]+"-"+E[t[e+6]]+E[t[e+7]]+"-"+E[t[e+8]]+E[t[e+9]]+"-"+E[t[e+10]]+E[t[e+11]]+E[t[e+12]]+E[t[e+13]]+E[t[e+14]]+E[t[e+15]]).toLowerCase()}let Y;const Ee=new Uint8Array(16);function _e(){if(!Y){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Y=crypto.getRandomValues.bind(crypto)}return Y(Ee)}const be=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ne={randomUUID:be};function Se(t,e,n){var u;if(ne.randomUUID&&!t)return ne.randomUUID();t=t||{};const c=t.random??((u=t.rng)==null?void 0:u.call(t))??_e();if(c.length<16)throw new Error("Random bytes length must be >= 16");return c[6]=c[6]&15|64,c[8]=c[8]&63|128,me(c)}var q=function(){var t=l(function(v,s,i,a){for(i=i||{},a=v.length;a--;i[v[a]]=s);return i},"o"),e=[1,4],n=[1,13],c=[1,12],u=[1,15],h=[1,16],p=[1,20],y=[1,19],_=[6,7,8],b=[1,26],m=[1,24],w=[1,25],N=[6,7,11],J=[1,6,13,15,16,19,22],K=[1,33],Q=[1,34],A=[1,6,7,11,13,15,16,19,22],G={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:l(function(s,i,a,o,g,r,U){var d=r.length-1;switch(g){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",r[d].id),o.addNode(r[d-1].length,r[d].id,r[d].descr,r[d].type);break;case 16:o.getLogger().trace("Icon: ",r[d]),o.decorateNode({icon:r[d]});break;case 17:case 21:o.decorateNode({class:r[d]});break;case 18:o.getLogger().trace("SPACELIST");break;case 19:o.getLogger().trace("Node: ",r[d].id),o.addNode(0,r[d].id,r[d].descr,r[d].type);break;case 20:o.decorateNode({icon:r[d]});break;case 25:o.getLogger().trace("node found ..",r[d-2]),this.$={id:r[d-1],descr:r[d-1],type:o.getType(r[d-2],r[d])};break;case 26:this.$={id:r[d],descr:r[d],type:o.nodeType.DEFAULT};break;case 27:o.getLogger().trace("node found ..",r[d-3]),this.$={id:r[d-3],descr:r[d-1],type:o.getType(r[d-2],r[d])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:n,7:[1,10],9:9,12:11,13:c,14:14,15:u,16:h,17:17,18:18,19:p,22:y},t(_,[2,3]),{1:[2,2]},t(_,[2,4]),t(_,[2,5]),{1:[2,6],6:n,12:21,13:c,14:14,15:u,16:h,17:17,18:18,19:p,22:y},{6:n,9:22,12:11,13:c,14:14,15:u,16:h,17:17,18:18,19:p,22:y},{6:b,7:m,10:23,11:w},t(N,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:p,22:y}),t(N,[2,18]),t(N,[2,19]),t(N,[2,20]),t(N,[2,21]),t(N,[2,23]),t(N,[2,24]),t(N,[2,26],{19:[1,30]}),{20:[1,31]},{6:b,7:m,10:32,11:w},{1:[2,7],6:n,12:21,13:c,14:14,15:u,16:h,17:17,18:18,19:p,22:y},t(J,[2,14],{7:K,11:Q}),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(N,[2,15]),t(N,[2,16]),t(N,[2,17]),{20:[1,35]},{21:[1,36]},t(J,[2,13],{7:K,11:Q}),t(A,[2,11]),t(A,[2,12]),{21:[1,37]},t(N,[2,25]),t(N,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:l(function(s,i){if(i.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=i,a}},"parseError"),parse:l(function(s){var i=this,a=[0],o=[],g=[null],r=[],U=this.table,d="",M=0,Z=0,re=2,ee=1,ae=r.slice.call(arguments,1),f=Object.create(this.lexer),T={yy:{}};for(var H in this.yy)Object.prototype.hasOwnProperty.call(this.yy,H)&&(T.yy[H]=this.yy[H]);f.setInput(s,T.yy),T.yy.lexer=f,T.yy.parser=this,typeof f.yylloc>"u"&&(f.yylloc={});var $=f.yylloc;r.push($);var oe=f.options&&f.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ce(D){a.length=a.length-2*D,g.length=g.length-D,r.length=r.length-D}l(ce,"popStack");function te(){var D;return D=o.pop()||f.lex()||ee,typeof D!="number"&&(D instanceof Array&&(o=D,D=o.pop()),D=i.symbols_[D]||D),D}l(te,"lex");for(var S,O,k,z,I={},V,L,ie,B;;){if(O=a[a.length-1],this.defaultActions[O]?k=this.defaultActions[O]:((S===null||typeof S>"u")&&(S=te()),k=U[O]&&U[O][S]),typeof k>"u"||!k.length||!k[0]){var W="";B=[];for(V in U[O])this.terminals_[V]&&V>re&&B.push("'"+this.terminals_[V]+"'");f.showPosition?W="Parse error on line "+(M+1)+`:
1
+ import{g as le}from"./CAnZNTn6.js";import{s as he}from"./CHFYZcjC.js";import{_ as l,l as C,p as de,r as ge,I as j,c as X,i as F,ay as ue,ad as pe,ae as fe,af as ye}from"./Dzy2Amcc.js";import"./DD6NieRw.js";const E=[];for(let t=0;t<256;++t)E.push((t+256).toString(16).slice(1));function me(t,e=0){return(E[t[e+0]]+E[t[e+1]]+E[t[e+2]]+E[t[e+3]]+"-"+E[t[e+4]]+E[t[e+5]]+"-"+E[t[e+6]]+E[t[e+7]]+"-"+E[t[e+8]]+E[t[e+9]]+"-"+E[t[e+10]]+E[t[e+11]]+E[t[e+12]]+E[t[e+13]]+E[t[e+14]]+E[t[e+15]]).toLowerCase()}let Y;const Ee=new Uint8Array(16);function _e(){if(!Y){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Y=crypto.getRandomValues.bind(crypto)}return Y(Ee)}const be=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ne={randomUUID:be};function Se(t,e,n){var u;if(ne.randomUUID&&!t)return ne.randomUUID();t=t||{};const c=t.random??((u=t.rng)==null?void 0:u.call(t))??_e();if(c.length<16)throw new Error("Random bytes length must be >= 16");return c[6]=c[6]&15|64,c[8]=c[8]&63|128,me(c)}var q=function(){var t=l(function(v,s,i,a){for(i=i||{},a=v.length;a--;i[v[a]]=s);return i},"o"),e=[1,4],n=[1,13],c=[1,12],u=[1,15],h=[1,16],p=[1,20],y=[1,19],_=[6,7,8],b=[1,26],m=[1,24],w=[1,25],N=[6,7,11],J=[1,6,13,15,16,19,22],K=[1,33],Q=[1,34],A=[1,6,7,11,13,15,16,19,22],G={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:l(function(s,i,a,o,g,r,U){var d=r.length-1;switch(g){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",r[d].id),o.addNode(r[d-1].length,r[d].id,r[d].descr,r[d].type);break;case 16:o.getLogger().trace("Icon: ",r[d]),o.decorateNode({icon:r[d]});break;case 17:case 21:o.decorateNode({class:r[d]});break;case 18:o.getLogger().trace("SPACELIST");break;case 19:o.getLogger().trace("Node: ",r[d].id),o.addNode(0,r[d].id,r[d].descr,r[d].type);break;case 20:o.decorateNode({icon:r[d]});break;case 25:o.getLogger().trace("node found ..",r[d-2]),this.$={id:r[d-1],descr:r[d-1],type:o.getType(r[d-2],r[d])};break;case 26:this.$={id:r[d],descr:r[d],type:o.nodeType.DEFAULT};break;case 27:o.getLogger().trace("node found ..",r[d-3]),this.$={id:r[d-3],descr:r[d-1],type:o.getType(r[d-2],r[d])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:n,7:[1,10],9:9,12:11,13:c,14:14,15:u,16:h,17:17,18:18,19:p,22:y},t(_,[2,3]),{1:[2,2]},t(_,[2,4]),t(_,[2,5]),{1:[2,6],6:n,12:21,13:c,14:14,15:u,16:h,17:17,18:18,19:p,22:y},{6:n,9:22,12:11,13:c,14:14,15:u,16:h,17:17,18:18,19:p,22:y},{6:b,7:m,10:23,11:w},t(N,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:p,22:y}),t(N,[2,18]),t(N,[2,19]),t(N,[2,20]),t(N,[2,21]),t(N,[2,23]),t(N,[2,24]),t(N,[2,26],{19:[1,30]}),{20:[1,31]},{6:b,7:m,10:32,11:w},{1:[2,7],6:n,12:21,13:c,14:14,15:u,16:h,17:17,18:18,19:p,22:y},t(J,[2,14],{7:K,11:Q}),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(N,[2,15]),t(N,[2,16]),t(N,[2,17]),{20:[1,35]},{21:[1,36]},t(J,[2,13],{7:K,11:Q}),t(A,[2,11]),t(A,[2,12]),{21:[1,37]},t(N,[2,25]),t(N,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:l(function(s,i){if(i.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=i,a}},"parseError"),parse:l(function(s){var i=this,a=[0],o=[],g=[null],r=[],U=this.table,d="",M=0,Z=0,re=2,ee=1,ae=r.slice.call(arguments,1),f=Object.create(this.lexer),T={yy:{}};for(var H in this.yy)Object.prototype.hasOwnProperty.call(this.yy,H)&&(T.yy[H]=this.yy[H]);f.setInput(s,T.yy),T.yy.lexer=f,T.yy.parser=this,typeof f.yylloc>"u"&&(f.yylloc={});var $=f.yylloc;r.push($);var oe=f.options&&f.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ce(D){a.length=a.length-2*D,g.length=g.length-D,r.length=r.length-D}l(ce,"popStack");function te(){var D;return D=o.pop()||f.lex()||ee,typeof D!="number"&&(D instanceof Array&&(o=D,D=o.pop()),D=i.symbols_[D]||D),D}l(te,"lex");for(var S,O,k,z,I={},V,L,ie,B;;){if(O=a[a.length-1],this.defaultActions[O]?k=this.defaultActions[O]:((S===null||typeof S>"u")&&(S=te()),k=U[O]&&U[O][S]),typeof k>"u"||!k.length||!k[0]){var W="";B=[];for(V in U[O])this.terminals_[V]&&V>re&&B.push("'"+this.terminals_[V]+"'");f.showPosition?W="Parse error on line "+(M+1)+`:
2
2
  `+f.showPosition()+`
3
3
  Expecting `+B.join(", ")+", got '"+(this.terminals_[S]||S)+"'":W="Parse error on line "+(M+1)+": Unexpected "+(S==ee?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(W,{text:f.match,token:this.terminals_[S]||S,line:f.yylineno,loc:$,expected:B})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+O+", token: "+S);switch(k[0]){case 1:a.push(S),g.push(f.yytext),r.push(f.yylloc),a.push(k[1]),S=null,Z=f.yyleng,d=f.yytext,M=f.yylineno,$=f.yylloc;break;case 2:if(L=this.productions_[k[1]][1],I.$=g[g.length-L],I._$={first_line:r[r.length-(L||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(L||1)].first_column,last_column:r[r.length-1].last_column},oe&&(I._$.range=[r[r.length-(L||1)].range[0],r[r.length-1].range[1]]),z=this.performAction.apply(I,[d,Z,M,T.yy,k[1],g,r].concat(ae)),typeof z<"u")return z;L&&(a=a.slice(0,-1*L*2),g=g.slice(0,-1*L),r=r.slice(0,-1*L)),a.push(this.productions_[k[1]][0]),g.push(I.$),r.push(I._$),ie=U[a[a.length-2]][a[a.length-1]],a.push(ie);break;case 3:return!0}}return!0},"parse")},se=function(){var v={EOF:1,parseError:l(function(i,a){if(this.yy.parser)this.yy.parser.parseError(i,a);else throw new Error(i)},"parseError"),setInput:l(function(s,i){return this.yy=i||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:l(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var i=s.match(/(?:\r\n?|\n).*/g);return i?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:l(function(s){var i=s.length,a=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var o=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var g=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===o.length?this.yylloc.first_column:0)+o[o.length-a.length].length-a[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[g[0],g[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:l(function(s){this.unput(this.match.slice(s))},"less"),pastInput:l(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var s=this.pastInput(),i=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- import{g as Ht}from"./CMnjMfEQ.js";import{_ as m,o as Mt,l as t1,c as b1,d as O1,p as Xt,r as Qt,u as rt,b as Jt,s as Zt,q as $t,a as te,g as ee,t as se,k as ie,v as re,J as ae,x as ne,y as it,z as ue,A as oe,B as le,C as ce}from"./BJvJ0Hlu.js";import{c as he}from"./JxgekUqn.js";import{g as de}from"./BsCPQnkm.js";import{s as pe}from"./BO3FEgXG.js";import{c as fe}from"./CZgTP5wX.js";import"./C6teO48Y.js";var ge="flowchart-",G1,be=(G1=class{constructor(){this.vertexCounter=0,this.config=b1(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=Jt,this.setAccDescription=Zt,this.setDiagramTitle=$t,this.getAccTitle=te,this.getAccDescription=ee,this.getDiagramTitle=se,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(i){return ie.sanitizeText(i,this.config)}sanitizeNodeLabelType(i){switch(i){case"markdown":case"string":case"text":return i;default:return"markdown"}}lookUpDomId(i){for(const n of this.vertices.values())if(n.id===i)return n.domId;return i}addVertex(i,n,a,u,o,f,c={},A){var L,C;if(!i||i.trim().length===0)return;let r;if(A!==void 0){let d;A.includes(`
1
+ import{g as Ht}from"./CM7fDldV.js";import{_ as m,o as Mt,l as t1,c as b1,d as O1,p as Xt,r as Qt,u as rt,b as Jt,s as Zt,q as $t,a as te,g as ee,t as se,k as ie,v as re,J as ae,x as ne,y as it,z as ue,A as oe,B as le,C as ce}from"./Dzy2Amcc.js";import{c as he}from"./BX-NC3FD.js";import{g as de}from"./CAnZNTn6.js";import{s as pe}from"./CHFYZcjC.js";import{c as fe}from"./DX42Brjy.js";import"./DD6NieRw.js";var ge="flowchart-",G1,be=(G1=class{constructor(){this.vertexCounter=0,this.config=b1(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=Jt,this.setAccDescription=Zt,this.setDiagramTitle=$t,this.getAccTitle=te,this.getAccDescription=ee,this.getDiagramTitle=se,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(i){return ie.sanitizeText(i,this.config)}sanitizeNodeLabelType(i){switch(i){case"markdown":case"string":case"text":return i;default:return"markdown"}}lookUpDomId(i){for(const n of this.vertices.values())if(n.id===i)return n.domId;return i}addVertex(i,n,a,u,o,f,c={},A){var L,C;if(!i||i.trim().length===0)return;let r;if(A!==void 0){let d;A.includes(`
2
2
  `)?d=A+`
3
3
  `:d=`{
4
4
  `+A+`
@@ -1 +1 @@
1
- import{r as g,K as u,H as x}from"./C6teO48Y.js";function L(){const p=g(!1),f=g(0),h=g(null),C=(w,m)=>{const l=new Uint8Array(m);let i=0;return w.forEach(t=>{l.set(t,i),i+=t.length}),l};return{isDownloading:p,downloadedBytes:f,error:h,downloadStream:async w=>{var E;const{url:m,method:l="POST",body:i,filename:t,contentType:P,saveFilePath:c,openPath:v,successTitle:R,getSuccessDescription:y}=w;p.value=!0,f.value=0,h.value=null;const b=u.loading(`Exporting ${t}...`,{description:"Starting download..."});try{const o=await fetch(m,{method:l,headers:{"Content-Type":"application/json"},body:i?JSON.stringify(i):void 0});if(!o.ok){let r="Export failed";try{r=(await o.json()).message||r}catch{}throw new Error(r)}if(!o.body)throw new Error("Response body is not available for streaming");const d=o.body.getReader(),B=[];let n=0;for(;;){const{done:r,value:s}=await d.read();if(r)break;B.push(s),n+=s.length,f.value=n;const a=x(n);u.loading(`Exporting ${t}...`,{id:b,description:`Downloaded ${a}`,position:"bottom-right"})}const $=C(B,n),e=typeof window<"u"?(E=window.electronAPI)==null?void 0:E.window:void 0;if(c&&(e!=null&&e.writeFile))await e.writeFile(c,$);else{const r=new Blob([$],{type:P||o.headers.get("Content-Type")||"application/octet-stream"}),s=URL.createObjectURL(r),a=document.createElement("a");a.href=s,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(s)}const k=x(n);return u.success(R||`Exported ${t}`,{id:b,description:(y==null?void 0:y(n))||(c?`${k} saved to ${c}`:`${k} downloaded`),position:"bottom-right",action:v&&(e!=null&&e.openPath)?{label:"Open",onClick:()=>{e.openPath(v)}}:void 0}),{success:!0,size:n}}catch(o){const d=o;return h.value=d,u.error("Export failed",{id:b,description:d.message,position:"bottom-right"}),{success:!1,error:d}}finally{p.value=!1}}}}export{L as u};
1
+ import{r as g,K as u,H as x}from"./DD6NieRw.js";function L(){const p=g(!1),f=g(0),h=g(null),C=(w,m)=>{const l=new Uint8Array(m);let i=0;return w.forEach(t=>{l.set(t,i),i+=t.length}),l};return{isDownloading:p,downloadedBytes:f,error:h,downloadStream:async w=>{var E;const{url:m,method:l="POST",body:i,filename:t,contentType:P,saveFilePath:c,openPath:v,successTitle:R,getSuccessDescription:y}=w;p.value=!0,f.value=0,h.value=null;const b=u.loading(`Exporting ${t}...`,{description:"Starting download..."});try{const o=await fetch(m,{method:l,headers:{"Content-Type":"application/json"},body:i?JSON.stringify(i):void 0});if(!o.ok){let r="Export failed";try{r=(await o.json()).message||r}catch{}throw new Error(r)}if(!o.body)throw new Error("Response body is not available for streaming");const d=o.body.getReader(),B=[];let n=0;for(;;){const{done:r,value:s}=await d.read();if(r)break;B.push(s),n+=s.length,f.value=n;const a=x(n);u.loading(`Exporting ${t}...`,{id:b,description:`Downloaded ${a}`,position:"bottom-right"})}const $=C(B,n),e=typeof window<"u"?(E=window.electronAPI)==null?void 0:E.window:void 0;if(c&&(e!=null&&e.writeFile))await e.writeFile(c,$);else{const r=new Blob([$],{type:P||o.headers.get("Content-Type")||"application/octet-stream"}),s=URL.createObjectURL(r),a=document.createElement("a");a.href=s,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(s)}const k=x(n);return u.success(R||`Exported ${t}`,{id:b,description:(y==null?void 0:y(n))||(c?`${k} saved to ${c}`:`${k} downloaded`),position:"bottom-right",action:v&&(e!=null&&e.openPath)?{label:"Open",onClick:()=>{e.openPath(v)}}:void 0}),{success:!0,size:n}}catch(o){const d=o;return h.value=d,u.error("Export failed",{id:b,description:d.message,position:"bottom-right"}),{success:!1,error:d}}finally{p.value=!1}}}}export{L as u};
@@ -1 +1 @@
1
- import{_ as a,d as o}from"./BJvJ0Hlu.js";var d=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{d as g};
1
+ import{_ as a,d as o}from"./Dzy2Amcc.js";var d=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{d as g};