orcaq 1.1.2 → 1.1.3

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 (127) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{BJCrbji-.js → 5oARMrld.js} +1 -1
  3. package/.output/public/_nuxt/{kvtnkChG.js → 9sDqz0uT.js} +1 -1
  4. package/.output/public/_nuxt/{Bmgr9uz4.js → B-4cXhNx.js} +1 -1
  5. package/.output/public/_nuxt/{DpT8FO1Q.js → BC6CdfCG.js} +1 -1
  6. package/.output/public/_nuxt/{Ca0KO9Xq.js → BCAMWuzu.js} +1 -1
  7. package/.output/public/_nuxt/{Bq47tjcm.js → BG-rJefG.js} +1 -1
  8. package/.output/public/_nuxt/{BpvGVfME.js → BKFPmrcv.js} +1 -1
  9. package/.output/public/_nuxt/{COHOh4Oe.js → BMLhg7hE.js} +1 -1
  10. package/.output/public/_nuxt/{atdCACH-.js → BYOPXIhP.js} +1 -1
  11. package/.output/public/_nuxt/{B46blMXm.js → BYxQJ0gE.js} +1 -1
  12. package/.output/public/_nuxt/{BrNfge84.js → BZ4ThSRp.js} +1 -1
  13. package/.output/public/_nuxt/{Dq1JM9WZ.js → BZmDBfmV.js} +1 -1
  14. package/.output/public/_nuxt/{DHAL8jJG.js → B_ERKujF.js} +4 -4
  15. package/.output/public/_nuxt/{CycELG5y.js → BccuQbKA.js} +1 -1
  16. package/.output/public/_nuxt/{B6MkNyZd.js → BcyZ-eCi.js} +1 -1
  17. package/.output/public/_nuxt/{63YtjFEq.js → BdZsZgcB.js} +1 -1
  18. package/.output/public/_nuxt/{S1qa1a4x.js → BigePTMZ.js} +1 -1
  19. package/.output/public/_nuxt/{BL__uYa3.js → BkN-uAef.js} +1 -1
  20. package/.output/public/_nuxt/{BWZ7atse.js → BmAp-sfn.js} +1 -1
  21. package/.output/public/_nuxt/{BogEzQi9.js → BqHKqsJ5.js} +3 -3
  22. package/.output/public/_nuxt/{DpEV6S2O.js → BseVuOZ1.js} +1 -1
  23. package/.output/public/_nuxt/{B2IKcIj2.js → BtuY54_l.js} +1 -1
  24. package/.output/public/_nuxt/{B8TrrBEb.js → Buh0pI3n.js} +1 -1
  25. package/.output/public/_nuxt/{CAnr3OhD.js → BzVvHKKC.js} +1 -1
  26. package/.output/public/_nuxt/{DuCDilAk.js → BzywwPw6.js} +1 -1
  27. package/.output/public/_nuxt/BzzgEvr9.js +7 -0
  28. package/.output/public/_nuxt/{AymhMj9v.js → C-I81xfB.js} +1 -1
  29. package/.output/public/_nuxt/{DAr5YiBT.js → C-Pa1rIR.js} +1 -1
  30. package/.output/public/_nuxt/{CMkzSwnO.js → C-pX1zRI.js} +1 -1
  31. package/.output/public/_nuxt/{ioXB9E2w.js → C0vscAQB.js} +1 -1
  32. package/.output/public/_nuxt/C4FrpL8k.js +1 -0
  33. package/.output/public/_nuxt/{Cq-MDPLE.js → C4zYnWdF.js} +1 -1
  34. package/.output/public/_nuxt/{C_7gtl40.js → C9kgALYc.js} +1 -1
  35. package/.output/public/_nuxt/{Oe2GG0Lt.js → CCmd8DpQ.js} +1 -1
  36. package/.output/public/_nuxt/{DsmBazLf.js → CGq9Twnj.js} +1 -1
  37. package/.output/public/_nuxt/{BEyCol50.js → CHMlsxJw.js} +1 -1
  38. package/.output/public/_nuxt/{Y1gXUmjt.js → CLQzuV82.js} +1 -1
  39. package/.output/public/_nuxt/{BJVPtt2X.js → CL_1HDtg.js} +1 -1
  40. package/.output/public/_nuxt/{DVnDb6ua.js → CRqiHVA4.js} +1 -1
  41. package/.output/public/_nuxt/{ByibjLZn.js → CS4EJV3B.js} +1 -1
  42. package/.output/public/_nuxt/{Bf6Q3Zl5.js → CSExCj8O.js} +1 -1
  43. package/.output/public/_nuxt/{MeLWmO7R.js → CY_CG0AU.js} +1 -1
  44. package/.output/public/_nuxt/{D-9vaM6z.js → CbHZwHBV.js} +1 -1
  45. package/.output/public/_nuxt/{MW5K_zef.js → Cbo6GmdE.js} +1 -1
  46. package/.output/public/_nuxt/{dWu56FdP.js → Cf460dGA.js} +1 -1
  47. package/.output/public/_nuxt/{DcCF9IZB.js → CfseWBL0.js} +1 -1
  48. package/.output/public/_nuxt/{qzrMNYut.js → Ch0I4juX.js} +1 -1
  49. package/.output/public/_nuxt/Chvs1m1n.js +1 -0
  50. package/.output/public/_nuxt/{CHEpbbGc.js → Chx1IK9D.js} +1 -1
  51. package/.output/public/_nuxt/{ByiJDSw8.js → CjpXgncp.js} +1 -1
  52. package/.output/public/_nuxt/{BpUSbMUb.js → CkjXKCQH.js} +1 -1
  53. package/.output/public/_nuxt/{C3ZBsVV_.js → Ckry8tuC.js} +2 -2
  54. package/.output/public/_nuxt/{CsRSZpa6.js → CmOZ0DCP.js} +1 -1
  55. package/.output/public/_nuxt/{Bq7OeLM1.js → CmjR7OTc.js} +1 -1
  56. package/.output/public/_nuxt/{CDJKw_ak.js → Co7e2XML.js} +1 -1
  57. package/.output/public/_nuxt/{BzvSm28k.js → CqkctA6I.js} +1 -1
  58. package/.output/public/_nuxt/{DEZMnZ2r.js → CtB2-SFY.js} +1 -1
  59. package/.output/public/_nuxt/{dNPwafbq.js → CtCx-4nJ.js} +1 -1
  60. package/.output/public/_nuxt/{xOD4Ev56.js → CtkhwZY7.js} +1 -1
  61. package/.output/public/_nuxt/Cty7uMrC.js +1 -0
  62. package/.output/public/_nuxt/{C2XHqDOf.js → CvFjsYJZ.js} +1 -1
  63. package/.output/public/_nuxt/{D4pAW_0T.js → Czr647QE.js} +1 -1
  64. package/.output/public/_nuxt/{BcsKoAPU.js → D0lW43G8.js} +28 -28
  65. package/.output/public/_nuxt/{DDebxXP-.js → D28ykMUi.js} +1 -1
  66. package/.output/public/_nuxt/{Ci5B19-c.js → DA4Xn6lm.js} +1 -1
  67. package/.output/public/_nuxt/{BWebIWit.js → DChDHsIe.js} +1 -1
  68. package/.output/public/_nuxt/{DSaBCmOg.js → DJBO_9pO.js} +1 -1
  69. package/.output/public/_nuxt/{DPIEiNwW.js → DJXB1Li8.js} +1 -1
  70. package/.output/public/_nuxt/{DJH-4SVI.js → DKLk0T0H.js} +1 -1
  71. package/.output/public/_nuxt/{C6dIAdHr.js → DLBsdU7G.js} +1 -1
  72. package/.output/public/_nuxt/{BtyzMl9p.js → DOAixkpJ.js} +1 -1
  73. package/.output/public/_nuxt/{BoMjapT5.js → DPq8O9CC.js} +1 -1
  74. package/.output/public/_nuxt/{Bmx1kTaZ.js → DQdA5Twt.js} +1 -1
  75. package/.output/public/_nuxt/{DGvAu532.js → DRh-06Hb.js} +1 -1
  76. package/.output/public/_nuxt/{JOg_XIAv.js → DTvJImVU.js} +1 -1
  77. package/.output/public/_nuxt/{C7BQpy74.js → DVkCRFXi.js} +1 -1
  78. package/.output/public/_nuxt/{BjqbQLK3.js → DX8ecA59.js} +1 -1
  79. package/.output/public/_nuxt/DakKehZj.js +1 -0
  80. package/.output/public/_nuxt/{BoIj4dtd.js → Db3rTgnd.js} +1 -1
  81. package/.output/public/_nuxt/{BRFPdiIh.js → DfyynWBR.js} +1 -1
  82. package/.output/public/_nuxt/{B5WGo5x7.js → DgJOougY.js} +1 -1
  83. package/.output/public/_nuxt/DkQCknMw.js +1 -0
  84. package/.output/public/_nuxt/{Sf02B6Pt.js → DpBeiFQV.js} +1 -1
  85. package/.output/public/_nuxt/{sk7V7xQl.js → DrdbRRXx.js} +1 -1
  86. package/.output/public/_nuxt/{CS9hqyP3.js → Dtl3qje7.js} +1 -1
  87. package/.output/public/_nuxt/{DNoTlUiY.js → Du5Ka6uI.js} +1 -1
  88. package/.output/public/_nuxt/{B73IHAoF.js → Dunt8-TF.js} +1 -1
  89. package/.output/public/_nuxt/{CrNLwdoE.js → DvWEWtFg.js} +1 -1
  90. package/.output/public/_nuxt/{DkD29_YA.js → KynNdNgX.js} +1 -1
  91. package/.output/public/_nuxt/{BqU89KuH.js → MWrJVKEf.js} +2 -2
  92. package/.output/public/_nuxt/{DMmjWR_K.js → NYpsF1lW.js} +1 -1
  93. package/.output/public/_nuxt/{L2I3LmpB.js → Nof0nVJ6.js} +1 -1
  94. package/.output/public/_nuxt/{BTYBVtfa.js → Ohrg3hU7.js} +1 -1
  95. package/.output/public/_nuxt/{CerLmMsC.js → Rrce0BXL.js} +3 -3
  96. package/.output/public/_nuxt/{xp7rFxcm.js → VNOocds9.js} +1 -1
  97. package/.output/public/_nuxt/Y-MEKhtd.js +1 -0
  98. package/.output/public/_nuxt/{CSQ0xnqv.js → YdOCcCRS.js} +1 -1
  99. package/.output/public/_nuxt/bYQCSC5-.js +1 -0
  100. package/.output/public/_nuxt/{vhkvHdfO.js → bkzIFcLw.js} +1 -1
  101. package/.output/public/_nuxt/builds/latest.json +1 -1
  102. package/.output/public/_nuxt/builds/meta/ad11b978-8fdd-4bb2-9b38-1d6fe93f994e.json +1 -0
  103. package/.output/public/_nuxt/{FDw04QOj.js → eOeO5uM0.js} +1 -1
  104. package/.output/public/_nuxt/{BPACuoI0.js → g9ZMnTLJ.js} +1 -1
  105. package/.output/public/_nuxt/{Cnfx1zWl.js → hIbRoJ89.js} +1 -1
  106. package/.output/public/_nuxt/{8tyEaimf.js → j23gQsG7.js} +1 -1
  107. package/.output/public/_nuxt/klVlxnpt.js +1 -0
  108. package/.output/public/_nuxt/{DWqOZJe7.js → qRiDKEr7.js} +1 -1
  109. package/.output/public/_nuxt/{iNy-Nl0_.js → syq5mCJi.js} +1 -1
  110. package/.output/public/_nuxt/{COq7mAG7.js → v41yYOa9.js} +1 -1
  111. package/.output/public/_nuxt/{B9uki8o2.js → vaJvtND9.js} +1 -1
  112. package/.output/public/_nuxt/{wRAs0MDn.js → wodl4bLW.js} +1 -1
  113. package/.output/server/chunks/build/client.manifest.mjs +675 -675
  114. package/.output/server/chunks/build/client.manifest.mjs.map +1 -1
  115. package/.output/server/chunks/nitro/nitro.mjs +635 -635
  116. package/.output/server/package.json +1 -1
  117. package/package.json +1 -1
  118. package/.output/public/_nuxt/BS-LtKx4.js +0 -1
  119. package/.output/public/_nuxt/BTheloyh.js +0 -1
  120. package/.output/public/_nuxt/Bj7ctTfH.js +0 -1
  121. package/.output/public/_nuxt/BpLDGvqy.js +0 -1
  122. package/.output/public/_nuxt/CtWq1MER.js +0 -7
  123. package/.output/public/_nuxt/Cww9dXBK.js +0 -1
  124. package/.output/public/_nuxt/DfNTLojg.js +0 -1
  125. package/.output/public/_nuxt/M6bBaUHa.js +0 -1
  126. package/.output/public/_nuxt/_qKPTuua.js +0 -1
  127. package/.output/public/_nuxt/builds/meta/7c171291-8bbd-4c4c-8904-0afae065b82e.json +0 -1
@@ -1,4 +1,4 @@
1
- import{_ as p,q as _t,t as xt,s as vt,g as bt,b as wt,a as St,c as lt,B as Lt,d as H,ac as Et,A as At,k as Tt}from"./DHAL8jJG.js";import{o as Mt}from"./CmKTTxBW.js";import"./BcsKoAPU.js";import"./Gi6I4Gst.js";function Nt(t){for(var e=t.length/6|0,i=new Array(e),a=0;a<e;)i[a]="#"+t.slice(a*6,++a*6);return i}const It=Nt("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function ct(t,e){let i;if(e===void 0)for(const a of t)a!=null&&(i<a||i===void 0&&a>=a)&&(i=a);else{let a=-1;for(let h of t)(h=e(h,++a,t))!=null&&(i<h||i===void 0&&h>=h)&&(i=h)}return i}function pt(t,e){let i;if(e===void 0)for(const a of t)a!=null&&(i>a||i===void 0&&a>=a)&&(i=a);else{let a=-1;for(let h of t)(h=e(h,++a,t))!=null&&(i>h||i===void 0&&h>=h)&&(i=h)}return i}function nt(t,e){let i=0;if(e===void 0)for(let a of t)(a=+a)&&(i+=a);else{let a=-1;for(let h of t)(h=+e(h,++a,t))&&(i+=h)}return i}function Pt(t){return t.target.depth}function Ct(t){return t.depth}function Ot(t,e){return e-1-t.height}function mt(t,e){return t.sourceLinks.length?t.depth:e-1}function Dt(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?pt(t.sourceLinks,Pt)-1:0}function X(t){return function(){return t}}function ut(t,e){return Q(t.source,e.source)||t.index-e.index}function ht(t,e){return Q(t.target,e.target)||t.index-e.index}function Q(t,e){return t.y0-e.y0}function it(t){return t.value}function $t(t){return t.index}function zt(t){return t.nodes}function jt(t){return t.links}function ft(t,e){const i=t.get(e);if(!i)throw new Error("missing: "+e);return i}function yt({nodes:t}){for(const e of t){let i=e.y0,a=i;for(const h of e.sourceLinks)h.y0=i+h.width/2,i+=h.width;for(const h of e.targetLinks)h.y1=a+h.width/2,a+=h.width}}function Bt(){let t=0,e=0,i=1,a=1,h=24,d=8,m,_=$t,s=mt,o,l,x=zt,v=jt,y=6;function b(){const n={nodes:x.apply(null,arguments),links:v.apply(null,arguments)};return M(n),T(n),N(n),C(n),S(n),yt(n),n}b.update=function(n){return yt(n),n},b.nodeId=function(n){return arguments.length?(_=typeof n=="function"?n:X(n),b):_},b.nodeAlign=function(n){return arguments.length?(s=typeof n=="function"?n:X(n),b):s},b.nodeSort=function(n){return arguments.length?(o=n,b):o},b.nodeWidth=function(n){return arguments.length?(h=+n,b):h},b.nodePadding=function(n){return arguments.length?(d=m=+n,b):d},b.nodes=function(n){return arguments.length?(x=typeof n=="function"?n:X(n),b):x},b.links=function(n){return arguments.length?(v=typeof n=="function"?n:X(n),b):v},b.linkSort=function(n){return arguments.length?(l=n,b):l},b.size=function(n){return arguments.length?(t=e=0,i=+n[0],a=+n[1],b):[i-t,a-e]},b.extent=function(n){return arguments.length?(t=+n[0][0],i=+n[1][0],e=+n[0][1],a=+n[1][1],b):[[t,e],[i,a]]},b.iterations=function(n){return arguments.length?(y=+n,b):y};function M({nodes:n,links:f}){for(const[c,r]of n.entries())r.index=c,r.sourceLinks=[],r.targetLinks=[];const u=new Map(n.map((c,r)=>[_(c,r,n),c]));for(const[c,r]of f.entries()){r.index=c;let{source:k,target:w}=r;typeof k!="object"&&(k=r.source=ft(u,k)),typeof w!="object"&&(w=r.target=ft(u,w)),k.sourceLinks.push(r),w.targetLinks.push(r)}if(l!=null)for(const{sourceLinks:c,targetLinks:r}of n)c.sort(l),r.sort(l)}function T({nodes:n}){for(const f of n)f.value=f.fixedValue===void 0?Math.max(nt(f.sourceLinks,it),nt(f.targetLinks,it)):f.fixedValue}function N({nodes:n}){const f=n.length;let u=new Set(n),c=new Set,r=0;for(;u.size;){for(const k of u){k.depth=r;for(const{target:w}of k.sourceLinks)c.add(w)}if(++r>f)throw new Error("circular link");u=c,c=new Set}}function C({nodes:n}){const f=n.length;let u=new Set(n),c=new Set,r=0;for(;u.size;){for(const k of u){k.height=r;for(const{source:w}of k.targetLinks)c.add(w)}if(++r>f)throw new Error("circular link");u=c,c=new Set}}function $({nodes:n}){const f=ct(n,r=>r.depth)+1,u=(i-t-h)/(f-1),c=new Array(f);for(const r of n){const k=Math.max(0,Math.min(f-1,Math.floor(s.call(null,r,f))));r.layer=k,r.x0=t+k*u,r.x1=r.x0+h,c[k]?c[k].push(r):c[k]=[r]}if(o)for(const r of c)r.sort(o);return c}function R(n){const f=pt(n,u=>(a-e-(u.length-1)*m)/nt(u,it));for(const u of n){let c=e;for(const r of u){r.y0=c,r.y1=c+r.value*f,c=r.y1+m;for(const k of r.sourceLinks)k.width=k.value*f}c=(a-c+m)/(u.length+1);for(let r=0;r<u.length;++r){const k=u[r];k.y0+=c*(r+1),k.y1+=c*(r+1)}A(u)}}function S(n){const f=$(n);m=Math.min(d,(a-e)/(ct(f,u=>u.length)-1)),R(f);for(let u=0;u<y;++u){const c=Math.pow(.99,u),r=Math.max(1-c,(u+1)/y);B(f,c,r),P(f,c,r)}}function P(n,f,u){for(let c=1,r=n.length;c<r;++c){const k=n[c];for(const w of k){let L=0,F=0;for(const{source:Y,value:et}of w.targetLinks){let q=et*(w.layer-Y.layer);L+=z(Y,w)*q,F+=q}if(!(F>0))continue;let G=(L/F-w.y0)*f;w.y0+=G,w.y1+=G,E(w)}o===void 0&&k.sort(Q),O(k,u)}}function B(n,f,u){for(let c=n.length,r=c-2;r>=0;--r){const k=n[r];for(const w of k){let L=0,F=0;for(const{target:Y,value:et}of w.sourceLinks){let q=et*(Y.layer-w.layer);L+=I(w,Y)*q,F+=q}if(!(F>0))continue;let G=(L/F-w.y0)*f;w.y0+=G,w.y1+=G,E(w)}o===void 0&&k.sort(Q),O(k,u)}}function O(n,f){const u=n.length>>1,c=n[u];g(n,c.y0-m,u-1,f),D(n,c.y1+m,u+1,f),g(n,a,n.length-1,f),D(n,e,0,f)}function D(n,f,u,c){for(;u<n.length;++u){const r=n[u],k=(f-r.y0)*c;k>1e-6&&(r.y0+=k,r.y1+=k),f=r.y1+m}}function g(n,f,u,c){for(;u>=0;--u){const r=n[u],k=(r.y1-f)*c;k>1e-6&&(r.y0-=k,r.y1-=k),f=r.y0-m}}function E({sourceLinks:n,targetLinks:f}){if(l===void 0){for(const{source:{sourceLinks:u}}of f)u.sort(ht);for(const{target:{targetLinks:u}}of n)u.sort(ut)}}function A(n){if(l===void 0)for(const{sourceLinks:f,targetLinks:u}of n)f.sort(ht),u.sort(ut)}function z(n,f){let u=n.y0-(n.sourceLinks.length-1)*m/2;for(const{target:c,width:r}of n.sourceLinks){if(c===f)break;u+=r+m}for(const{source:c,width:r}of f.targetLinks){if(c===n)break;u-=r}return u}function I(n,f){let u=f.y0-(f.targetLinks.length-1)*m/2;for(const{source:c,width:r}of f.targetLinks){if(c===n)break;u+=r+m}for(const{target:c,width:r}of n.sourceLinks){if(c===f)break;u-=r}return u}return b}var st=Math.PI,rt=2*st,V=1e-6,Rt=rt-V;function ot(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function kt(){return new ot}ot.prototype=kt.prototype={constructor:ot,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,i,a){this._+="Q"+ +t+","+ +e+","+(this._x1=+i)+","+(this._y1=+a)},bezierCurveTo:function(t,e,i,a,h,d){this._+="C"+ +t+","+ +e+","+ +i+","+ +a+","+(this._x1=+h)+","+(this._y1=+d)},arcTo:function(t,e,i,a,h){t=+t,e=+e,i=+i,a=+a,h=+h;var d=this._x1,m=this._y1,_=i-t,s=a-e,o=d-t,l=m-e,x=o*o+l*l;if(h<0)throw new Error("negative radius: "+h);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(x>V)if(!(Math.abs(l*_-s*o)>V)||!h)this._+="L"+(this._x1=t)+","+(this._y1=e);else{var v=i-d,y=a-m,b=_*_+s*s,M=v*v+y*y,T=Math.sqrt(b),N=Math.sqrt(x),C=h*Math.tan((st-Math.acos((b+x-M)/(2*T*N)))/2),$=C/N,R=C/T;Math.abs($-1)>V&&(this._+="L"+(t+$*o)+","+(e+$*l)),this._+="A"+h+","+h+",0,0,"+ +(l*v>o*y)+","+(this._x1=t+R*_)+","+(this._y1=e+R*s)}},arc:function(t,e,i,a,h,d){t=+t,e=+e,i=+i,d=!!d;var m=i*Math.cos(a),_=i*Math.sin(a),s=t+m,o=e+_,l=1^d,x=d?a-h:h-a;if(i<0)throw new Error("negative radius: "+i);this._x1===null?this._+="M"+s+","+o:(Math.abs(this._x1-s)>V||Math.abs(this._y1-o)>V)&&(this._+="L"+s+","+o),i&&(x<0&&(x=x%rt+rt),x>Rt?this._+="A"+i+","+i+",0,1,"+l+","+(t-m)+","+(e-_)+"A"+i+","+i+",0,1,"+l+","+(this._x1=s)+","+(this._y1=o):x>V&&(this._+="A"+i+","+i+",0,"+ +(x>=st)+","+l+","+(this._x1=t+i*Math.cos(h))+","+(this._y1=e+i*Math.sin(h))))},rect:function(t,e,i,a){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +i+"v"+ +a+"h"+-i+"Z"},toString:function(){return this._}};function dt(t){return function(){return t}}function Ft(t){return t[0]}function Vt(t){return t[1]}var Wt=Array.prototype.slice;function Ut(t){return t.source}function Gt(t){return t.target}function Yt(t){var e=Ut,i=Gt,a=Ft,h=Vt,d=null;function m(){var _,s=Wt.call(arguments),o=e.apply(this,s),l=i.apply(this,s);if(d||(d=_=kt()),t(d,+a.apply(this,(s[0]=o,s)),+h.apply(this,s),+a.apply(this,(s[0]=l,s)),+h.apply(this,s)),_)return d=null,_+""||null}return m.source=function(_){return arguments.length?(e=_,m):e},m.target=function(_){return arguments.length?(i=_,m):i},m.x=function(_){return arguments.length?(a=typeof _=="function"?_:dt(+_),m):a},m.y=function(_){return arguments.length?(h=typeof _=="function"?_:dt(+_),m):h},m.context=function(_){return arguments.length?(d=_??null,m):d},m}function qt(t,e,i,a,h){t.moveTo(e,i),t.bezierCurveTo(e=(e+a)/2,i,e,h,a,h)}function Ht(){return Yt(qt)}function Xt(t){return[t.source.x1,t.y0]}function Qt(t){return[t.target.x0,t.y1]}function Kt(){return Ht().source(Xt).target(Qt)}var at=function(){var t=p(function(_,s,o,l){for(o=o||{},l=_.length;l--;o[_[l]]=s);return o},"o"),e=[1,9],i=[1,10],a=[1,5,10,12],h={trace:p(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:p(function(s,o,l,x,v,y,b){var M=y.length-1;switch(v){case 7:const T=x.findOrCreateNode(y[M-4].trim().replaceAll('""','"')),N=x.findOrCreateNode(y[M-2].trim().replaceAll('""','"')),C=parseFloat(y[M].trim());x.addLink(T,N,C);break;case 8:case 9:case 11:this.$=y[M];break;case 10:this.$=y[M-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:e,20:i},{1:[2,6],7:11,10:[1,12]},t(i,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(a,[2,8]),t(a,[2,9]),{19:[1,16]},t(a,[2,11]),{1:[2,1]},{1:[2,5]},t(i,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:e,20:i},{15:18,16:7,17:8,18:e,20:i},{18:[1,19]},t(i,[2,3]),{12:[1,20]},t(a,[2,10]),{15:21,16:7,17:8,18:e,20:i},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:p(function(s,o){if(o.recoverable)this.trace(s);else{var l=new Error(s);throw l.hash=o,l}},"parseError"),parse:p(function(s){var o=this,l=[0],x=[],v=[null],y=[],b=this.table,M="",T=0,N=0,C=2,$=1,R=y.slice.call(arguments,1),S=Object.create(this.lexer),P={yy:{}};for(var B in this.yy)Object.prototype.hasOwnProperty.call(this.yy,B)&&(P.yy[B]=this.yy[B]);S.setInput(s,P.yy),P.yy.lexer=S,P.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var O=S.yylloc;y.push(O);var D=S.options&&S.options.ranges;typeof P.yy.parseError=="function"?this.parseError=P.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function g(L){l.length=l.length-2*L,v.length=v.length-L,y.length=y.length-L}p(g,"popStack");function E(){var L;return L=x.pop()||S.lex()||$,typeof L!="number"&&(L instanceof Array&&(x=L,L=x.pop()),L=o.symbols_[L]||L),L}p(E,"lex");for(var A,z,I,n,f={},u,c,r,k;;){if(z=l[l.length-1],this.defaultActions[z]?I=this.defaultActions[z]:((A===null||typeof A>"u")&&(A=E()),I=b[z]&&b[z][A]),typeof I>"u"||!I.length||!I[0]){var w="";k=[];for(u in b[z])this.terminals_[u]&&u>C&&k.push("'"+this.terminals_[u]+"'");S.showPosition?w="Parse error on line "+(T+1)+`:
1
+ import{_ as p,q as _t,t as xt,s as vt,g as bt,b as wt,a as St,c as lt,B as Lt,d as H,ac as Et,A as At,k as Tt}from"./B_ERKujF.js";import{o as Mt}from"./CmKTTxBW.js";import"./D0lW43G8.js";import"./Gi6I4Gst.js";function Nt(t){for(var e=t.length/6|0,i=new Array(e),a=0;a<e;)i[a]="#"+t.slice(a*6,++a*6);return i}const It=Nt("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function ct(t,e){let i;if(e===void 0)for(const a of t)a!=null&&(i<a||i===void 0&&a>=a)&&(i=a);else{let a=-1;for(let h of t)(h=e(h,++a,t))!=null&&(i<h||i===void 0&&h>=h)&&(i=h)}return i}function pt(t,e){let i;if(e===void 0)for(const a of t)a!=null&&(i>a||i===void 0&&a>=a)&&(i=a);else{let a=-1;for(let h of t)(h=e(h,++a,t))!=null&&(i>h||i===void 0&&h>=h)&&(i=h)}return i}function nt(t,e){let i=0;if(e===void 0)for(let a of t)(a=+a)&&(i+=a);else{let a=-1;for(let h of t)(h=+e(h,++a,t))&&(i+=h)}return i}function Pt(t){return t.target.depth}function Ct(t){return t.depth}function Ot(t,e){return e-1-t.height}function mt(t,e){return t.sourceLinks.length?t.depth:e-1}function Dt(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?pt(t.sourceLinks,Pt)-1:0}function X(t){return function(){return t}}function ut(t,e){return Q(t.source,e.source)||t.index-e.index}function ht(t,e){return Q(t.target,e.target)||t.index-e.index}function Q(t,e){return t.y0-e.y0}function it(t){return t.value}function $t(t){return t.index}function zt(t){return t.nodes}function jt(t){return t.links}function ft(t,e){const i=t.get(e);if(!i)throw new Error("missing: "+e);return i}function yt({nodes:t}){for(const e of t){let i=e.y0,a=i;for(const h of e.sourceLinks)h.y0=i+h.width/2,i+=h.width;for(const h of e.targetLinks)h.y1=a+h.width/2,a+=h.width}}function Bt(){let t=0,e=0,i=1,a=1,h=24,d=8,m,_=$t,s=mt,o,l,x=zt,v=jt,y=6;function b(){const n={nodes:x.apply(null,arguments),links:v.apply(null,arguments)};return M(n),T(n),N(n),C(n),S(n),yt(n),n}b.update=function(n){return yt(n),n},b.nodeId=function(n){return arguments.length?(_=typeof n=="function"?n:X(n),b):_},b.nodeAlign=function(n){return arguments.length?(s=typeof n=="function"?n:X(n),b):s},b.nodeSort=function(n){return arguments.length?(o=n,b):o},b.nodeWidth=function(n){return arguments.length?(h=+n,b):h},b.nodePadding=function(n){return arguments.length?(d=m=+n,b):d},b.nodes=function(n){return arguments.length?(x=typeof n=="function"?n:X(n),b):x},b.links=function(n){return arguments.length?(v=typeof n=="function"?n:X(n),b):v},b.linkSort=function(n){return arguments.length?(l=n,b):l},b.size=function(n){return arguments.length?(t=e=0,i=+n[0],a=+n[1],b):[i-t,a-e]},b.extent=function(n){return arguments.length?(t=+n[0][0],i=+n[1][0],e=+n[0][1],a=+n[1][1],b):[[t,e],[i,a]]},b.iterations=function(n){return arguments.length?(y=+n,b):y};function M({nodes:n,links:f}){for(const[c,r]of n.entries())r.index=c,r.sourceLinks=[],r.targetLinks=[];const u=new Map(n.map((c,r)=>[_(c,r,n),c]));for(const[c,r]of f.entries()){r.index=c;let{source:k,target:w}=r;typeof k!="object"&&(k=r.source=ft(u,k)),typeof w!="object"&&(w=r.target=ft(u,w)),k.sourceLinks.push(r),w.targetLinks.push(r)}if(l!=null)for(const{sourceLinks:c,targetLinks:r}of n)c.sort(l),r.sort(l)}function T({nodes:n}){for(const f of n)f.value=f.fixedValue===void 0?Math.max(nt(f.sourceLinks,it),nt(f.targetLinks,it)):f.fixedValue}function N({nodes:n}){const f=n.length;let u=new Set(n),c=new Set,r=0;for(;u.size;){for(const k of u){k.depth=r;for(const{target:w}of k.sourceLinks)c.add(w)}if(++r>f)throw new Error("circular link");u=c,c=new Set}}function C({nodes:n}){const f=n.length;let u=new Set(n),c=new Set,r=0;for(;u.size;){for(const k of u){k.height=r;for(const{source:w}of k.targetLinks)c.add(w)}if(++r>f)throw new Error("circular link");u=c,c=new Set}}function $({nodes:n}){const f=ct(n,r=>r.depth)+1,u=(i-t-h)/(f-1),c=new Array(f);for(const r of n){const k=Math.max(0,Math.min(f-1,Math.floor(s.call(null,r,f))));r.layer=k,r.x0=t+k*u,r.x1=r.x0+h,c[k]?c[k].push(r):c[k]=[r]}if(o)for(const r of c)r.sort(o);return c}function R(n){const f=pt(n,u=>(a-e-(u.length-1)*m)/nt(u,it));for(const u of n){let c=e;for(const r of u){r.y0=c,r.y1=c+r.value*f,c=r.y1+m;for(const k of r.sourceLinks)k.width=k.value*f}c=(a-c+m)/(u.length+1);for(let r=0;r<u.length;++r){const k=u[r];k.y0+=c*(r+1),k.y1+=c*(r+1)}A(u)}}function S(n){const f=$(n);m=Math.min(d,(a-e)/(ct(f,u=>u.length)-1)),R(f);for(let u=0;u<y;++u){const c=Math.pow(.99,u),r=Math.max(1-c,(u+1)/y);B(f,c,r),P(f,c,r)}}function P(n,f,u){for(let c=1,r=n.length;c<r;++c){const k=n[c];for(const w of k){let L=0,F=0;for(const{source:Y,value:et}of w.targetLinks){let q=et*(w.layer-Y.layer);L+=z(Y,w)*q,F+=q}if(!(F>0))continue;let G=(L/F-w.y0)*f;w.y0+=G,w.y1+=G,E(w)}o===void 0&&k.sort(Q),O(k,u)}}function B(n,f,u){for(let c=n.length,r=c-2;r>=0;--r){const k=n[r];for(const w of k){let L=0,F=0;for(const{target:Y,value:et}of w.sourceLinks){let q=et*(Y.layer-w.layer);L+=I(w,Y)*q,F+=q}if(!(F>0))continue;let G=(L/F-w.y0)*f;w.y0+=G,w.y1+=G,E(w)}o===void 0&&k.sort(Q),O(k,u)}}function O(n,f){const u=n.length>>1,c=n[u];g(n,c.y0-m,u-1,f),D(n,c.y1+m,u+1,f),g(n,a,n.length-1,f),D(n,e,0,f)}function D(n,f,u,c){for(;u<n.length;++u){const r=n[u],k=(f-r.y0)*c;k>1e-6&&(r.y0+=k,r.y1+=k),f=r.y1+m}}function g(n,f,u,c){for(;u>=0;--u){const r=n[u],k=(r.y1-f)*c;k>1e-6&&(r.y0-=k,r.y1-=k),f=r.y0-m}}function E({sourceLinks:n,targetLinks:f}){if(l===void 0){for(const{source:{sourceLinks:u}}of f)u.sort(ht);for(const{target:{targetLinks:u}}of n)u.sort(ut)}}function A(n){if(l===void 0)for(const{sourceLinks:f,targetLinks:u}of n)f.sort(ht),u.sort(ut)}function z(n,f){let u=n.y0-(n.sourceLinks.length-1)*m/2;for(const{target:c,width:r}of n.sourceLinks){if(c===f)break;u+=r+m}for(const{source:c,width:r}of f.targetLinks){if(c===n)break;u-=r}return u}function I(n,f){let u=f.y0-(f.targetLinks.length-1)*m/2;for(const{source:c,width:r}of f.targetLinks){if(c===n)break;u+=r+m}for(const{target:c,width:r}of n.sourceLinks){if(c===f)break;u-=r}return u}return b}var st=Math.PI,rt=2*st,V=1e-6,Rt=rt-V;function ot(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function kt(){return new ot}ot.prototype=kt.prototype={constructor:ot,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,i,a){this._+="Q"+ +t+","+ +e+","+(this._x1=+i)+","+(this._y1=+a)},bezierCurveTo:function(t,e,i,a,h,d){this._+="C"+ +t+","+ +e+","+ +i+","+ +a+","+(this._x1=+h)+","+(this._y1=+d)},arcTo:function(t,e,i,a,h){t=+t,e=+e,i=+i,a=+a,h=+h;var d=this._x1,m=this._y1,_=i-t,s=a-e,o=d-t,l=m-e,x=o*o+l*l;if(h<0)throw new Error("negative radius: "+h);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(x>V)if(!(Math.abs(l*_-s*o)>V)||!h)this._+="L"+(this._x1=t)+","+(this._y1=e);else{var v=i-d,y=a-m,b=_*_+s*s,M=v*v+y*y,T=Math.sqrt(b),N=Math.sqrt(x),C=h*Math.tan((st-Math.acos((b+x-M)/(2*T*N)))/2),$=C/N,R=C/T;Math.abs($-1)>V&&(this._+="L"+(t+$*o)+","+(e+$*l)),this._+="A"+h+","+h+",0,0,"+ +(l*v>o*y)+","+(this._x1=t+R*_)+","+(this._y1=e+R*s)}},arc:function(t,e,i,a,h,d){t=+t,e=+e,i=+i,d=!!d;var m=i*Math.cos(a),_=i*Math.sin(a),s=t+m,o=e+_,l=1^d,x=d?a-h:h-a;if(i<0)throw new Error("negative radius: "+i);this._x1===null?this._+="M"+s+","+o:(Math.abs(this._x1-s)>V||Math.abs(this._y1-o)>V)&&(this._+="L"+s+","+o),i&&(x<0&&(x=x%rt+rt),x>Rt?this._+="A"+i+","+i+",0,1,"+l+","+(t-m)+","+(e-_)+"A"+i+","+i+",0,1,"+l+","+(this._x1=s)+","+(this._y1=o):x>V&&(this._+="A"+i+","+i+",0,"+ +(x>=st)+","+l+","+(this._x1=t+i*Math.cos(h))+","+(this._y1=e+i*Math.sin(h))))},rect:function(t,e,i,a){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +i+"v"+ +a+"h"+-i+"Z"},toString:function(){return this._}};function dt(t){return function(){return t}}function Ft(t){return t[0]}function Vt(t){return t[1]}var Wt=Array.prototype.slice;function Ut(t){return t.source}function Gt(t){return t.target}function Yt(t){var e=Ut,i=Gt,a=Ft,h=Vt,d=null;function m(){var _,s=Wt.call(arguments),o=e.apply(this,s),l=i.apply(this,s);if(d||(d=_=kt()),t(d,+a.apply(this,(s[0]=o,s)),+h.apply(this,s),+a.apply(this,(s[0]=l,s)),+h.apply(this,s)),_)return d=null,_+""||null}return m.source=function(_){return arguments.length?(e=_,m):e},m.target=function(_){return arguments.length?(i=_,m):i},m.x=function(_){return arguments.length?(a=typeof _=="function"?_:dt(+_),m):a},m.y=function(_){return arguments.length?(h=typeof _=="function"?_:dt(+_),m):h},m.context=function(_){return arguments.length?(d=_??null,m):d},m}function qt(t,e,i,a,h){t.moveTo(e,i),t.bezierCurveTo(e=(e+a)/2,i,e,h,a,h)}function Ht(){return Yt(qt)}function Xt(t){return[t.source.x1,t.y0]}function Qt(t){return[t.target.x0,t.y1]}function Kt(){return Ht().source(Xt).target(Qt)}var at=function(){var t=p(function(_,s,o,l){for(o=o||{},l=_.length;l--;o[_[l]]=s);return o},"o"),e=[1,9],i=[1,10],a=[1,5,10,12],h={trace:p(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:p(function(s,o,l,x,v,y,b){var M=y.length-1;switch(v){case 7:const T=x.findOrCreateNode(y[M-4].trim().replaceAll('""','"')),N=x.findOrCreateNode(y[M-2].trim().replaceAll('""','"')),C=parseFloat(y[M].trim());x.addLink(T,N,C);break;case 8:case 9:case 11:this.$=y[M];break;case 10:this.$=y[M-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:e,20:i},{1:[2,6],7:11,10:[1,12]},t(i,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(a,[2,8]),t(a,[2,9]),{19:[1,16]},t(a,[2,11]),{1:[2,1]},{1:[2,5]},t(i,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:e,20:i},{15:18,16:7,17:8,18:e,20:i},{18:[1,19]},t(i,[2,3]),{12:[1,20]},t(a,[2,10]),{15:21,16:7,17:8,18:e,20:i},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:p(function(s,o){if(o.recoverable)this.trace(s);else{var l=new Error(s);throw l.hash=o,l}},"parseError"),parse:p(function(s){var o=this,l=[0],x=[],v=[null],y=[],b=this.table,M="",T=0,N=0,C=2,$=1,R=y.slice.call(arguments,1),S=Object.create(this.lexer),P={yy:{}};for(var B in this.yy)Object.prototype.hasOwnProperty.call(this.yy,B)&&(P.yy[B]=this.yy[B]);S.setInput(s,P.yy),P.yy.lexer=S,P.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var O=S.yylloc;y.push(O);var D=S.options&&S.options.ranges;typeof P.yy.parseError=="function"?this.parseError=P.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function g(L){l.length=l.length-2*L,v.length=v.length-L,y.length=y.length-L}p(g,"popStack");function E(){var L;return L=x.pop()||S.lex()||$,typeof L!="number"&&(L instanceof Array&&(x=L,L=x.pop()),L=o.symbols_[L]||L),L}p(E,"lex");for(var A,z,I,n,f={},u,c,r,k;;){if(z=l[l.length-1],this.defaultActions[z]?I=this.defaultActions[z]:((A===null||typeof A>"u")&&(A=E()),I=b[z]&&b[z][A]),typeof I>"u"||!I.length||!I[0]){var w="";k=[];for(u in b[z])this.terminals_[u]&&u>C&&k.push("'"+this.terminals_[u]+"'");S.showPosition?w="Parse error on line "+(T+1)+`:
2
2
  `+S.showPosition()+`
3
3
  Expecting `+k.join(", ")+", got '"+(this.terminals_[A]||A)+"'":w="Parse error on line "+(T+1)+": Unexpected "+(A==$?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(w,{text:S.match,token:this.terminals_[A]||A,line:S.yylineno,loc:O,expected:k})}if(I[0]instanceof Array&&I.length>1)throw new Error("Parse Error: multiple actions possible at state: "+z+", token: "+A);switch(I[0]){case 1:l.push(A),v.push(S.yytext),y.push(S.yylloc),l.push(I[1]),A=null,N=S.yyleng,M=S.yytext,T=S.yylineno,O=S.yylloc;break;case 2:if(c=this.productions_[I[1]][1],f.$=v[v.length-c],f._$={first_line:y[y.length-(c||1)].first_line,last_line:y[y.length-1].last_line,first_column:y[y.length-(c||1)].first_column,last_column:y[y.length-1].last_column},D&&(f._$.range=[y[y.length-(c||1)].range[0],y[y.length-1].range[1]]),n=this.performAction.apply(f,[M,N,T,P.yy,I[1],v,y].concat(R)),typeof n<"u")return n;c&&(l=l.slice(0,-1*c*2),v=v.slice(0,-1*c),y=y.slice(0,-1*c)),l.push(this.productions_[I[1]][0]),v.push(f.$),y.push(f._$),r=b[l[l.length-2]][l[l.length-1]],l.push(r);break;case 3:return!0}}return!0},"parse")},d=function(){var _={EOF:1,parseError:p(function(o,l){if(this.yy.parser)this.yy.parser.parseError(o,l);else throw new Error(o)},"parseError"),setInput:p(function(s,o){return this.yy=o||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:p(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var o=s.match(/(?:\r\n?|\n).*/g);return o?(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:p(function(s){var o=s.length,l=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o),this.offset-=o;var x=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),l.length-1&&(this.yylineno-=l.length-1);var v=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:l?(l.length===x.length?this.yylloc.first_column:0)+x[x.length-l.length].length-l[0].length:this.yylloc.first_column-o},this.options.ranges&&(this.yylloc.range=[v[0],v[0]+this.yyleng-o]),this.yyleng=this.yytext.length,this},"unput"),more:p(function(){return this._more=!0,this},"more"),reject:p(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:p(function(s){this.unput(this.match.slice(s))},"less"),pastInput:p(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:p(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:p(function(){var s=this.pastInput(),o=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- import{Q as S,T as z,ax as j,_ as p,g as q,s as Q,a as Z,b as H,t as J,q as K,l as F,c as X,G as Y,L as ee,a4 as te,e as ae,A as re,I as ne}from"./DHAL8jJG.js";import{p as ie}from"./DJH-4SVI.js";import{p as se}from"./MeLWmO7R.js";import{d as P}from"./C6dIAdHr.js";import{o as le}from"./CmKTTxBW.js";import"./BcsKoAPU.js";import"./Gi6I4Gst.js";function oe(e,a){return a<e?-1:a>e?1:a>=e?0:NaN}function ce(e){return e}function ue(){var e=ce,a=oe,f=null,x=S(0),s=S(z),o=S(0);function l(t){var n,c=(t=j(t)).length,g,y,m=0,u=new Array(c),i=new Array(c),v=+x.apply(this,arguments),A=Math.min(z,Math.max(-z,s.apply(this,arguments)-v)),h,C=Math.min(Math.abs(A)/c,o.apply(this,arguments)),$=C*(A<0?-1:1),d;for(n=0;n<c;++n)(d=i[u[n]=n]=+e(t[n],n,t))>0&&(m+=d);for(a!=null?u.sort(function(w,D){return a(i[w],i[D])}):f!=null&&u.sort(function(w,D){return f(t[w],t[D])}),n=0,y=m?(A-c*$)/m:0;n<c;++n,v=h)g=u[n],d=i[g],h=v+(d>0?d*y:0)+$,i[g]={data:t[g],index:n,value:d,startAngle:v,endAngle:h,padAngle:C};return i}return l.value=function(t){return arguments.length?(e=typeof t=="function"?t:S(+t),l):e},l.sortValues=function(t){return arguments.length?(a=t,f=null,l):a},l.sort=function(t){return arguments.length?(f=t,a=null,l):f},l.startAngle=function(t){return arguments.length?(x=typeof t=="function"?t:S(+t),l):x},l.endAngle=function(t){return arguments.length?(s=typeof t=="function"?t:S(+t),l):s},l.padAngle=function(t){return arguments.length?(o=typeof t=="function"?t:S(+t),l):o},l}var pe=ne.pie,G={sections:new Map,showData:!1},T=G.sections,N=G.showData,ge=structuredClone(pe),de=p(()=>structuredClone(ge),"getConfig"),fe=p(()=>{T=new Map,N=G.showData,re()},"clear"),he=p(({label:e,value:a})=>{if(a<0)throw new Error(`"${e}" has invalid value: ${a}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);T.has(e)||(T.set(e,a),F.debug(`added new section: ${e}, with value: ${a}`))},"addSection"),me=p(()=>T,"getSections"),ve=p(e=>{N=e},"setShowData"),Se=p(()=>N,"getShowData"),R={getConfig:de,clear:fe,setDiagramTitle:K,getDiagramTitle:J,setAccTitle:H,getAccTitle:Z,setAccDescription:Q,getAccDescription:q,addSection:he,getSections:me,setShowData:ve,getShowData:Se},xe=p((e,a)=>{ie(e,a),a.setShowData(e.showData),e.sections.map(a.addSection)},"populateDb"),ye={parse:p(async e=>{const a=await se("pie",e);F.debug(a),xe(a,R)},"parse")},Ae=p(e=>`
1
+ import{Q as S,T as z,ax as j,_ as p,g as q,s as Q,a as Z,b as H,t as J,q as K,l as F,c as X,G as Y,L as ee,a4 as te,e as ae,A as re,I as ne}from"./B_ERKujF.js";import{p as ie}from"./DKLk0T0H.js";import{p as se}from"./CY_CG0AU.js";import{d as P}from"./DLBsdU7G.js";import{o as le}from"./CmKTTxBW.js";import"./D0lW43G8.js";import"./Gi6I4Gst.js";function oe(e,a){return a<e?-1:a>e?1:a>=e?0:NaN}function ce(e){return e}function ue(){var e=ce,a=oe,f=null,x=S(0),s=S(z),o=S(0);function l(t){var n,c=(t=j(t)).length,g,y,m=0,u=new Array(c),i=new Array(c),v=+x.apply(this,arguments),A=Math.min(z,Math.max(-z,s.apply(this,arguments)-v)),h,C=Math.min(Math.abs(A)/c,o.apply(this,arguments)),$=C*(A<0?-1:1),d;for(n=0;n<c;++n)(d=i[u[n]=n]=+e(t[n],n,t))>0&&(m+=d);for(a!=null?u.sort(function(w,D){return a(i[w],i[D])}):f!=null&&u.sort(function(w,D){return f(t[w],t[D])}),n=0,y=m?(A-c*$)/m:0;n<c;++n,v=h)g=u[n],d=i[g],h=v+(d>0?d*y:0)+$,i[g]={data:t[g],index:n,value:d,startAngle:v,endAngle:h,padAngle:C};return i}return l.value=function(t){return arguments.length?(e=typeof t=="function"?t:S(+t),l):e},l.sortValues=function(t){return arguments.length?(a=t,f=null,l):a},l.sort=function(t){return arguments.length?(f=t,a=null,l):f},l.startAngle=function(t){return arguments.length?(x=typeof t=="function"?t:S(+t),l):x},l.endAngle=function(t){return arguments.length?(s=typeof t=="function"?t:S(+t),l):s},l.padAngle=function(t){return arguments.length?(o=typeof t=="function"?t:S(+t),l):o},l}var pe=ne.pie,G={sections:new Map,showData:!1},T=G.sections,N=G.showData,ge=structuredClone(pe),de=p(()=>structuredClone(ge),"getConfig"),fe=p(()=>{T=new Map,N=G.showData,re()},"clear"),he=p(({label:e,value:a})=>{if(a<0)throw new Error(`"${e}" has invalid value: ${a}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);T.has(e)||(T.set(e,a),F.debug(`added new section: ${e}, with value: ${a}`))},"addSection"),me=p(()=>T,"getSections"),ve=p(e=>{N=e},"setShowData"),Se=p(()=>N,"getShowData"),R={getConfig:de,clear:fe,setDiagramTitle:K,getDiagramTitle:J,setAccTitle:H,getAccTitle:Z,setAccDescription:Q,getAccDescription:q,addSection:he,getSections:me,setShowData:ve,getShowData:Se},xe=p((e,a)=>{ie(e,a),a.setShowData(e.showData),e.sections.map(a.addSection)},"populateDb"),ye={parse:p(async e=>{const a=await se("pie",e);F.debug(a),xe(a,R)},"parse")},Ae=p(e=>`
2
2
  .pieCircle{
3
3
  stroke: ${e.pieStrokeColor};
4
4
  stroke-width : ${e.pieStrokeWidth};
@@ -0,0 +1 @@
1
+ import{s as e,b as r,a,S as s}from"./DPq8O9CC.js";import{_ as i}from"./B_ERKujF.js";import"./9sDqz0uT.js";import"./DRh-06Hb.js";import"./D0lW43G8.js";var p={parser:a,get db(){return new s(2)},renderer:r,styles:e,init:i(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{p as diagram};
@@ -1 +1 @@
1
- import{_ as g}from"./63YtjFEq.js";import{_}from"./xOD4Ev56.js";import{d as x,a3 as b,c as d,a4 as v,a5 as C,a6 as y,a7 as S,e as N,f as t,m as o,w as i,t as m,g as n,z as s,o as T,A as h}from"./BcsKoAPU.js";import{_ as r}from"./AymhMj9v.js";const k={class:"p-2 flex flex-col items-center justify-center h-full"},w={class:"font-medium text-xl pt-2"},B={class:"text-muted-foreground text-sm"},E={class:"flex items-center pt-3 text-muted-foreground gap-0.5 text-sm"},R={class:"flex items-center pt-1 text-muted-foreground gap-0.5 text-sm"},I={class:"flex items-center pt-1 text-muted-foreground gap-0.5 text-sm"},z={class:"flex items-center pt-1 text-muted-foreground gap-0.5 text-sm"},$=x({__name:"index",setup(A){const c=b(),p=d(()=>v(c.selectedConnection??{type:y.POSTGRES,method:C.STRING})),l=d(()=>p.value===S.REDIS?{title:"No Redis workspace tab is open",description:"Open a Redis key browser or tools tab from the sidebar to begin."}:{title:"No table is open",description:"Click on a database table from the sidebar to begin"});return(D,e)=>{const u=_,f=g,a=h;return T(),N("div",k,[t(f,{class:"rounded-2xl size-40"},{default:i(()=>[t(u,{src:"/logo.png",alt:"@unovue"})]),_:1}),o("div",w,m(n(l).title),1),o("div",B,[s(m(n(l).description)+" ",1),t(a,{name:"hugeicons:artificial-intelligence-08",class:"size-4 min-w-4"})]),o("div",E,[t(a,{name:"hugeicons:settings-01"}),e[1]||(e[1]=s(" Open setting ")),t(n(r),{class:"pl-2"},{default:i(()=>e[0]||(e[0]=[s("(⌘,)")])),_:1})]),o("div",R,[t(a,{name:"hugeicons:command"}),e[3]||(e[3]=s(" Command Palette ")),t(n(r),{class:"pl-2"},{default:i(()=>e[2]||(e[2]=[s("(⌘K or ⌘P)")])),_:1})]),o("div",I,[t(a,{name:"hugeicons:sidebar-left"}),e[5]||(e[5]=s(" Toggle left sidebar ")),t(n(r),{class:"pl-2"},{default:i(()=>e[4]||(e[4]=[s("(⌘B)")])),_:1})]),o("div",z,[t(a,{name:"hugeicons:sidebar-right"}),e[7]||(e[7]=s(" Toggle right sidebar ")),t(n(r),{class:"pl-2"},{default:i(()=>e[6]||(e[6]=[s("(⇧⌘B)")])),_:1})])])}}});export{$ as default};
1
+ import{_ as g}from"./BdZsZgcB.js";import{_}from"./CtkhwZY7.js";import{d as x,a3 as b,c as d,a4 as v,a5 as C,a6 as y,a7 as S,e as N,f as t,m as o,w as i,t as m,g as n,z as s,o as T,A as h}from"./D0lW43G8.js";import{_ as r}from"./C-I81xfB.js";const k={class:"p-2 flex flex-col items-center justify-center h-full"},w={class:"font-medium text-xl pt-2"},B={class:"text-muted-foreground text-sm"},E={class:"flex items-center pt-3 text-muted-foreground gap-0.5 text-sm"},R={class:"flex items-center pt-1 text-muted-foreground gap-0.5 text-sm"},I={class:"flex items-center pt-1 text-muted-foreground gap-0.5 text-sm"},z={class:"flex items-center pt-1 text-muted-foreground gap-0.5 text-sm"},$=x({__name:"index",setup(A){const c=b(),p=d(()=>v(c.selectedConnection??{type:y.POSTGRES,method:C.STRING})),l=d(()=>p.value===S.REDIS?{title:"No Redis workspace tab is open",description:"Open a Redis key browser or tools tab from the sidebar to begin."}:{title:"No table is open",description:"Click on a database table from the sidebar to begin"});return(D,e)=>{const u=_,f=g,a=h;return T(),N("div",k,[t(f,{class:"rounded-2xl size-40"},{default:i(()=>[t(u,{src:"/logo.png",alt:"@unovue"})]),_:1}),o("div",w,m(n(l).title),1),o("div",B,[s(m(n(l).description)+" ",1),t(a,{name:"hugeicons:artificial-intelligence-08",class:"size-4 min-w-4"})]),o("div",E,[t(a,{name:"hugeicons:settings-01"}),e[1]||(e[1]=s(" Open setting ")),t(n(r),{class:"pl-2"},{default:i(()=>e[0]||(e[0]=[s("(⌘,)")])),_:1})]),o("div",R,[t(a,{name:"hugeicons:command"}),e[3]||(e[3]=s(" Command Palette ")),t(n(r),{class:"pl-2"},{default:i(()=>e[2]||(e[2]=[s("(⌘K or ⌘P)")])),_:1})]),o("div",I,[t(a,{name:"hugeicons:sidebar-left"}),e[5]||(e[5]=s(" Toggle left sidebar ")),t(n(r),{class:"pl-2"},{default:i(()=>e[4]||(e[4]=[s("(⌘B)")])),_:1})]),o("div",z,[t(a,{name:"hugeicons:sidebar-right"}),e[7]||(e[7]=s(" Toggle right sidebar ")),t(n(r),{class:"pl-2"},{default:i(()=>e[6]||(e[6]=[s("(⇧⌘B)")])),_:1})])])}}});export{$ as default};
@@ -1 +1 @@
1
- import{d as r,a8 as m,c as a,e as c,k as p,g as o,f as l,m as u,o as e,A as _}from"./BcsKoAPU.js";import"./BWZ7atse.js";import{_ as d}from"./BL__uYa3.js";import"./C_7gtl40.js";import"./dNPwafbq.js";import"./MW5K_zef.js";import"./CHEpbbGc.js";import"./DcCF9IZB.js";import"./DVnDb6ua.js";import"./BoIj4dtd.js";import"./DAr5YiBT.js";import"./COHOh4Oe.js";import"./Ca0KO9Xq.js";import"./CS5akSNT.js";import"./D4pAW_0T.js";const f={class:"h-full"},x={key:0,class:"h-full p-4 flex flex-col items-center justify-center text-muted-foreground"},R=r({__name:"index",setup(k){const s=m(),t=a(()=>String(s.params.connectionId||""));return(g,n)=>{const i=_;return e(),c("div",f,[o(t)?(e(),p(o(d),{key:1,"source-connection-id":o(t)},null,8,["source-connection-id"])):(e(),c("div",x,[l(i,{name:"hugeicons:plug-socket",class:"size-12 mb-2 opacity-50"}),n[0]||(n[0]=u("p",{class:"text-sm"},"Select a connection to open Schema Diff",-1))]))])}}});export{R as default};
1
+ import{d as r,a8 as m,c as a,e as c,k as p,g as o,f as l,m as u,o as e,A as _}from"./D0lW43G8.js";import"./BmAp-sfn.js";import{_ as d}from"./BkN-uAef.js";import"./C9kgALYc.js";import"./CtCx-4nJ.js";import"./Cbo6GmdE.js";import"./Chx1IK9D.js";import"./CfseWBL0.js";import"./CRqiHVA4.js";import"./Db3rTgnd.js";import"./C-Pa1rIR.js";import"./BMLhg7hE.js";import"./BCAMWuzu.js";import"./CS5akSNT.js";import"./Czr647QE.js";const f={class:"h-full"},x={key:0,class:"h-full p-4 flex flex-col items-center justify-center text-muted-foreground"},R=r({__name:"index",setup(k){const s=m(),t=a(()=>String(s.params.connectionId||""));return(g,n)=>{const i=_;return e(),c("div",f,[o(t)?(e(),p(o(d),{key:1,"source-connection-id":o(t)},null,8,["source-connection-id"])):(e(),c("div",x,[l(i,{name:"hugeicons:plug-socket",class:"size-12 mb-2 opacity-50"}),n[0]||(n[0]=u("p",{class:"text-sm"},"Select a connection to open Schema Diff",-1))]))])}}});export{R as default};
@@ -1,4 +1,4 @@
1
- import{b1 as po,bD as fo,r as P,au as Fe,aH as pt,aG as vo,d$ as yo,e0 as go,e1 as ho,e2 as bo,e3 as _o,a3 as $e,c as C,d as Y,aK as Tn,e as x,o as h,f as o,w as m,m as y,t as B,g as e,k as D,l as U,aq as Pe,F as fe,s as ke,n as De,A as le,a6 as ye,e4 as Rt,cz as Rn,e5 as ut,e6 as W,e7 as ft,e8 as wo,cu as xt,cB as an,ct as Co,cG as So,cF as xo,ci as yt,aC as sn,e9 as kt,ea as ln,eb as rn,ec as No,G as we,dL as $n,ed as To,ay as Be,K as Je,ba as Qe,am as Mt,ap as Nt,J as qe,aM as Ze,aP as Ro,dg as $o,i as Ee,bo as lt,aY as he,a_ as be,a0 as Ce,z as A,a$ as _e,bn as cn,bL as dt,b9 as vt,aZ as Ae,df as Io,ee as un,bE as Lt,bF as Bt,bG as Ut,ef as ko,eg as Oo,eh as dn,ei as mn,_ as Vt,h as Kt,bS as qt,x as Qt,y as zt,bk as Xe,C as In,B as jt,ej as Eo,d9 as Ao,bY as pn,bW as Fo,bZ as Ht,D as Do,co as Po,cp as Mo,cq as kn,P as Oe,bm as $t,aB as Tt,b2 as On,c9 as fn,ek as En,a1 as Lo,X as Bo,Z as Uo,el as Vo,em as Ko,en as vn,eo as qo,ep as Qo,q as zo,p as jo,W as Ho,eq as Wo,dq as Go,bx as Yo,av as Jo,dh as Xo,er as yn}from"./BcsKoAPU.js";import{e as An,c as Fn,d as Zo,_ as Dn,a as Pn,b as Mn}from"./DVnDb6ua.js";import{u as xe,r as ze}from"./ioXB9E2w.js";import{d as ea}from"./dWu56FdP.js";import{_ as Ln}from"./Bq7OeLM1.js";import{_ as Bn}from"./BPACuoI0.js";import{_ as Un}from"./Y1gXUmjt.js";import{H as mt,c as ta,d as na,e as oa}from"./CS5akSNT.js";import{c as Vn,u as aa,a as sa,b as la,d as ra,F as ia,e as ca,_ as et}from"./CS9hqyP3.js";import{d as ua,t as da,e as ma}from"./Oe2GG0Lt.js";import{_ as pa}from"./COHOh4Oe.js";import{_ as fa,a as va,b as gn}from"./vhkvHdfO.js";import{_ as Wt}from"./AymhMj9v.js";import{_ as ya,j as ga,k as ha}from"./B73IHAoF.js";import{_ as ba,a as _a,C as j,b as wa}from"./C7BQpy74.js";import{_ as Ca}from"./BoIj4dtd.js";import{_ as Dt,c as hn,a as Ft,e as bn,b as _n}from"./Ca0KO9Xq.js";import{f as wn,a as Sa}from"./DsmBazLf.js";import{b as tt,a as nt}from"./BVmBXPoG.js";import{_ as je,a as He}from"./dNPwafbq.js";import{c as xa,a as Na,p as Ta,b as Ra}from"./D4pAW_0T.js";import{a as $a}from"./-lZvfnzr.js";import"./BWebIWit.js";import"./CSQ0xnqv.js";const Ia=c=>{if(!Array.isArray(c)||c.length===0)return;let t="";c.forEach((r,n)=>{const s=Object.entries(r).map(([v,d])=>`${d}`).join(" ");t+=s,n<c.length-1&&(t+=`
1
+ import{b1 as po,bD as fo,r as P,au as Fe,aH as pt,aG as vo,d$ as yo,e0 as go,e1 as ho,e2 as bo,e3 as _o,a3 as $e,c as C,d as Y,aK as Tn,e as x,o as h,f as o,w as m,m as y,t as B,g as e,k as D,l as U,aq as Pe,F as fe,s as ke,n as De,A as le,a6 as ye,e4 as Rt,cz as Rn,e5 as ut,e6 as W,e7 as ft,e8 as wo,cu as xt,cB as an,ct as Co,cG as So,cF as xo,ci as yt,aC as sn,e9 as kt,ea as ln,eb as rn,ec as No,G as we,dL as $n,ed as To,ay as Be,K as Je,ba as Qe,am as Mt,ap as Nt,J as qe,aM as Ze,aP as Ro,dg as $o,i as Ee,bo as lt,aY as he,a_ as be,a0 as Ce,z as A,a$ as _e,bn as cn,bL as dt,b9 as vt,aZ as Ae,df as Io,ee as un,bE as Lt,bF as Bt,bG as Ut,ef as ko,eg as Oo,eh as dn,ei as mn,_ as Vt,h as Kt,bS as qt,x as Qt,y as zt,bk as Xe,C as In,B as jt,ej as Eo,d9 as Ao,bY as pn,bW as Fo,bZ as Ht,D as Do,co as Po,cp as Mo,cq as kn,P as Oe,bm as $t,aB as Tt,b2 as On,c9 as fn,ek as En,a1 as Lo,X as Bo,Z as Uo,el as Vo,em as Ko,en as vn,eo as qo,ep as Qo,q as zo,p as jo,W as Ho,eq as Wo,dq as Go,bx as Yo,av as Jo,dh as Xo,er as yn}from"./D0lW43G8.js";import{e as An,c as Fn,d as Zo,_ as Dn,a as Pn,b as Mn}from"./CRqiHVA4.js";import{u as xe,r as ze}from"./C0vscAQB.js";import{d as ea}from"./Cf460dGA.js";import{_ as Ln}from"./CmjR7OTc.js";import{_ as Bn}from"./g9ZMnTLJ.js";import{_ as Un}from"./CLQzuV82.js";import{H as mt,c as ta,d as na,e as oa}from"./CS5akSNT.js";import{c as Vn,u as aa,a as sa,b as la,d as ra,F as ia,e as ca,_ as et}from"./Dtl3qje7.js";import{d as ua,t as da,e as ma}from"./CCmd8DpQ.js";import{_ as pa}from"./BMLhg7hE.js";import{_ as fa,a as va,b as gn}from"./bkzIFcLw.js";import{_ as Wt}from"./C-I81xfB.js";import{_ as ya,j as ga,k as ha}from"./Dunt8-TF.js";import{_ as ba,a as _a,C as j,b as wa}from"./DVkCRFXi.js";import{_ as Ca}from"./Db3rTgnd.js";import{_ as Dt,c as hn,a as Ft,e as bn,b as _n}from"./BCAMWuzu.js";import{f as wn,a as Sa}from"./CGq9Twnj.js";import{b as tt,a as nt}from"./BVmBXPoG.js";import{_ as je,a as He}from"./CtCx-4nJ.js";import{c as xa,a as Na,p as Ta,b as Ra}from"./Czr647QE.js";import{a as $a}from"./-lZvfnzr.js";import"./DChDHsIe.js";import"./YdOCcCRS.js";const Ia=c=>{if(!Array.isArray(c)||c.length===0)return;let t="";c.forEach((r,n)=>{const s=Object.entries(r).map(([v,d])=>`${d}`).join(" ");t+=s,n<c.length-1&&(t+=`
2
2
  `)}),navigator.clipboard.writeText(t).catch(r=>{console.error("Failed to copy: ",r)})},Kn=po("quick-query-logs",()=>{const c=yo(),{workspaceId:t,connectionId:r}=fo(),n=P([]),s=({tableName:l,schemaName:_})=>n.value.filter(b=>b.tableName===l&&b.schemaName===_&&b.connectionId===r.value),v=async l=>{if(!r.value||!t.value){console.error("connectionId or schemaId not found");return}let _=`
3
3
  ${l.logs}`;l.errorMessage&&(_+=`
4
4
  -- Error: ${l.errorMessage}`);const b={...l,logs:_,connectionId:r.value,workspaceId:t.value,createdAt:vo().toISOString(),id:pt()};await c.quickQueryLogStorage.create(b),n.value.push(b)},d=async({tableName:l,schemaName:_})=>{if(!r.value){console.error("connectionId or schemaId not found");return}await c.quickQueryLogStorage.delete({connectionId:r.value,tableName:l,schemaName:_}),await p(r.value)},i=async()=>{if(!r.value){console.error("connectionId not found");return}await c.quickQueryLogStorage.delete({connectionId:r.value}),await p(r.value)},p=async l=>{const _=await c.quickQueryLogStorage.getByContext({connectionId:l});n.value=_};return Fe(()=>[r.value],async()=>{if(!r.value){console.error("connectionId not found");return}await p(r.value)},{deep:!0,immediate:!0}),{qqLogs:n,getLogsByTableId:s,deleteAllLogs:i,deleteLogsOfTable:d,createLog:v}},{persist:!1});function ka(c){return ho(bo,c)}function Oa(c){return go(_o,c)}const Ea=({tableName:c,schemaName:t})=>{var d;const r=$e(),{data:n,status:s}=xe("/api/tables/size",{method:"POST",body:{tableName:c,dbConnectionString:(d=r.selectedConnection)==null?void 0:d.connectionString,schema:t},key:`table-size-${c}-${t}`},"$1Ta2y3cNQa");return{tableSize:C(()=>n.value||{}),status:s}},Aa={class:"gap-0 flex flex-col h-full w-full p-2"},Fa={class:"flex flex-col gap-y-1"},Da={class:"flex items-center justify-between w-full"},Pa={class:"text-xs opacity-75"},Ma={class:"flex items-center justify-between gap-4"},La={class:"text-xs opacity-75"},Ba={class:"flex items-center justify-between gap-4"},Ua={class:"text-xs opacity-75"},Va=["onClick"],Ka={class:"flex justify-between text-xs w-full overflow-hidden"},qa=["title"],Qa={class:"opacity-50 w-1/4 min-w-[100px] text-right"},za=Y({__name:"QuickQueryTableSummary",props:{tableName:{},schemaName:{},columns:{},selectedColumnFieldId:{},handleSelectColumn:{type:Function},columnTypes:{}},emits:["resetSelectedCol"],setup(c,{emit:t}){const r=t,{tableSize:n}=Ea({tableName:c.tableName,schemaName:c.schemaName}),s=C(()=>{var d;return(((d=c.columns)==null?void 0:d.map(i=>{var l;const p=(l=c.columnTypes)==null?void 0:l.find(_=>_.name===i.field&&_.name);return p?{...i,type:(p==null?void 0:p.type)||""}:i}))||[]).slice(1)}),v=d=>d==="timestamp without time zone"?"timestamp":d||"";return Tn(d=>{d(()=>{c.selectedColumnFieldId!==void 0&&r("resetSelectedCol")})}),(d,i)=>{const p=An,l=Fn,_=Pe,b=le;return h(),x("div",Aa,[o(l,{class:"py-1 rounded-md"},{default:m(()=>[o(p,{class:"px-2"},{default:m(()=>[y("div",Fa,[y("div",Da,[i[0]||(i[0]=y("span",{class:"text-xs font-medium"},"Table Size:",-1)),y("span",Pa,B(e(n).tableSize),1)]),y("div",Ma,[i[1]||(i[1]=y("span",{class:"text-xs font-medium"},"Data Size:",-1)),y("span",La,B(e(n).dataSize),1)]),y("div",Ba,[i[2]||(i[2]=y("span",{class:"text-xs font-medium"},"Index Size:",-1)),y("span",Ua,B(e(n).indexSize),1)])])]),_:1})]),_:1}),o(l,{class:"mt-1 py-2 px-1 h-full overflow-y-auto custom-scrollbar rounded-md"},{default:m(()=>[o(p,{class:"px-0"},{default:m(()=>[e(s).length===0?(h(),D(_,{key:0,title:"No columns",desc:"This table has no columns to display."})):U("",!0),(h(!0),x(fe,null,ke(e(s),f=>(h(),x("div",{key:f==null?void 0:f.field,class:De(["cursor-pointer hover:bg-accent/50 rounded-sm",e(Zo)(d.selectedColumnFieldId===(f==null?void 0:f.field)&&"bg-accent/90")])},[y("div",{class:"flex items-center gap-2 justify-start p-1",onClick:w=>d.handleSelectColumn(f==null?void 0:f.field)},[o(b,{name:"hugeicons:layout-3-column",class:"size-4 min-w-3"}),y("div",Ka,[y("span",{class:"w-3/4 truncate max-w-[220px] overflow-hidden text-ellipsis whitespace-nowrap inline-block",title:f==null?void 0:f.headerName},B((f==null?void 0:f.headerName)||""),9,qa),y("span",Qa,B(v(Array.isArray(f==null?void 0:f.type)?f==null?void 0:f.type.join(", "):f==null?void 0:f.type)),1)])],8,Va)],2))),128))]),_:1})]),_:1})])}}}),ja=Rn({isSelect:an().optional(),fieldName:xt(),operator:xt().optional(),search:wo(c=>qn(c),Co([xt(),So(),an(),xo()])).optional()}),qn=c=>{if(c!==void 0)return c===null||typeof c=="string"||typeof c=="number"||typeof c=="boolean"?c:typeof c=="bigint"?c.toString():JSON.stringify(c)},Gt=c=>c==null?"":String(c),Ha=c=>t=>c===ye.POSTGRES?`$${t}`:"?",Qn=c=>t=>c===ye.POSTGRES||c===ye.ORACLE?`"${t}"`:`\`${t}\``,Cn=({col:c,op:t})=>({where:`${c} ${t}`,params:[]}),Sn=({col:c,op:t,search:r,nextPlaceholder:n})=>{const s=Gt(r).split(",").map(d=>d.trim()).filter(Boolean);if(!s.length)return{where:"",params:[]};const v=s.map(()=>n()).join(", ");return{where:`${c} ${t} (${v})`,params:s}},xn=({col:c,op:t,search:r})=>({where:`${c} ${t} ${Gt(r)}`,params:[]}),Te=({col:c,op:t,search:r,db:n,nextPlaceholder:s})=>{const v=t.toUpperCase().startsWith("NOT"),d=t.toUpperCase().startsWith("ILIKE"),i=n===ye.POSTGRES&&d?"ILIKE":"LIKE";let p=Gt(r);return t.endsWith("%VALUE%")?p=`%${r}%`:t.endsWith("%VALUE")?p=`%${r}`:t.endsWith("VALUE%")&&(p=`${r}%`),{where:`${n===ye.POSTGRES?`${c}::TEXT`:c} ${v?" NOT ":" "}${i} ${s()}`,params:[p]}},st=({col:c,op:t,search:r,nextPlaceholder:n})=>({where:`${c} ${t} ${n()}`,params:[r]}),zn={[W.IS_NULL]:Cn,[W.IS_NOT_NULL]:Cn,[W.IN]:Sn,[W.NOT_IN]:Sn,[W.BETWEEN]:xn,[W.NOT_BETWEEN]:xn,[W.LIKE]:Te,[W.ILIKE]:Te,[W.LIKE_CONTAINS]:Te,[W.LIKE_PREFIX]:Te,[W.LIKE_SUFFIX]:Te,[W.ILIKE_CONTAINS]:Te,[W.ILIKE_PREFIX]:Te,[W.ILIKE_SUFFIX]:Te,[W.NOT_LIKE_CONTAINS]:Te,[W.NOT_LIKE_PREFIX]:Te,[W.NOT_LIKE_SUFFIX]:Te,[W.NOT_ILIKE_CONTAINS]:Te,[W.NOT_ILIKE_PREFIX]:Te,[W.NOT_ILIKE_SUFFIX]:Te,[W.EQUAL]:st,[W.NOT_EQUAL]:st,[W.LESS]:st,[W.GREATER]:st,[W.LESS_EQUAL]:st,[W.GREATER_EQUAL]:st};function Wa({search:c,columns:t,db:r,op:n,nextPlaceholder:s}){const v=Qn(r),d=zn[n],i=[],p=[];return t.forEach(l=>{const _=v(l),b=d({col:_,op:n,search:c,db:r,nextPlaceholder:s});b.where&&(i.push(b.where),p.push(...b.params))}),{where:i.length?`(${i.join(" OR ")})`:"",params:p}}function Ga({filters:c,db:t,columns:r=[],composeWith:n=ft.AND}){const s=[],v=[];let d=1;const i=Ha(t),p=()=>i(d++),l=Qn(t),_=({where:f,params:w})=>{f&&(s.push(f),v.push(...w))},b=new Set((Rt[t]??Rt[ye.MYSQL]??[]).map(f=>f.value.toUpperCase()));return c.forEach(f=>{if(!(f!=null&&f.isSelect))return;const w=ja.parse(f);if(w.fieldName===ut.AnyField){const S=Wa({search:w.search??"",columns:r,db:t,op:w.operator,nextPlaceholder:p});S.where&&(s.push(S.where),v.push(...S.params));return}if(w.fieldName===ut.RawQuery){if(!w.search)return;s.push(`(${w.search})`);return}const a=l(w.fieldName),g=(w.operator??W.LIKE_CONTAINS).toUpperCase(),u=b.has(g)?g:W.LIKE_CONTAINS;_(zn[u]({col:a,op:u,search:w.search??"",db:t,nextPlaceholder:p}))}),{where:s.length?`WHERE ${s.join(` ${n} `)}`:"",params:v}}function Pt({filters:c,db:t,columns:r=[],composeWith:n}){const{where:s,params:v}=Ga({filters:c,db:t,columns:r,composeWith:n});if(!s)return"";const d=i=>i===null?"NULL":typeof i=="boolean"?i?"TRUE":"FALSE":typeof i=="number"?String(i):`'${String(i).replace(/'/g,"''")}'`;if(t===ye.POSTGRES){let i=s;return v.forEach((p,l)=>{i=i.replace(new RegExp(`\\$${l+1}\\b`,"g"),d(p))}),i}else{let i=0;return s.replace(/\?/g,()=>d(v[i++]))}}function Ya(c){const t=c.toUpperCase().trim();return t==="IS NULL"||t==="IS NOT NULL"?"":t==="IN"||t==="NOT IN"?"value1,value2,value3":t==="BETWEEN"||t==="NOT BETWEEN"?"value1 AND value2":t.includes("LIKE")?t.endsWith("%VALUE%")?"contains":t.endsWith("VALUE%")?"prefix*":t.endsWith("%VALUE")?"*suffix":"pattern":"value"}function Ja(c){return[ye.MYSQL,ye.MYSQL2,ye.MARIADB].includes(c)}function Ke(c,t){return Ja(t)?`\`${c.replace(/`/g,"``")}\``:`"${c.replace(/"/g,'""')}"`}function It({schemaName:c,tableName:t,dbType:r}){const n=Ke(t,r);return c?`${Ke(c,r)}.${n}`:n}function Xa({schemaName:c,tableName:t,pKeys:r,update:n,pKeyValue:s,dbType:v}){if(!t||!(r!=null&&r.length)||!n||!Object.keys(n).length)throw new Error("Invalid input: tableName, pKeys, and update object are required");const d=Object.entries(n).map(([l,_])=>_===null?`${Ke(l,v)} = NULL`:typeof _=="string"?`${Ke(l,v)} = '${_.replace(/'/g,"''")}'`:`${Ke(l,v)} = ${_}`).join(", "),i=r.map(l=>`${Ke(l,v)} = '${s[l]}'`).join(" AND ");return`UPDATE ${It({schemaName:c,tableName:t,dbType:v})} SET ${d} WHERE ${i}`}function Za({schemaName:c,tableName:t,pKeys:r,pKeyValue:n,dbType:s}){if(!t||!(r!=null&&r.length))throw new Error("Invalid input: tableName and pKeys are required");const v=r.map(i=>`${Ke(i,s)} = '${n[i]}'`).join(" AND ");return`DELETE FROM ${It({schemaName:c,tableName:t,dbType:s})} WHERE ${v}`}function es({schemaName:c,tableName:t,insertData:r,dbType:n}){if(!t||!r)throw new Error("Invalid input: tableName, insertData object are required");if(!Object.keys(r).length)return`INSERT INTO ${It({schemaName:c,tableName:t,dbType:n})} DEFAULT VALUES`;const s=Object.entries(r).map(([i])=>Ke(i,n)).join(", "),v=Object.values(r).map(i=>i===null?"NULL":typeof i=="string"?`'${i.replace(/'/g,"''")}'`:i).join(", ");return`INSERT INTO ${It({schemaName:c,tableName:t,dbType:n})} (${s}) VALUES (${v})`}function jn(c){const t=c.toLowerCase();if(t.startsWith("_"))return`${jn(t.substring(1))}[]`;switch(t){case"char":case"varchar":case"text":case"uuid":case"citext":case"money":case"inet":case"cidr":case"macaddr":case"macaddr8":case"tsvector":case"tsquery":case"xml":case"bytea":return"string";case"int2":case"int4":case"int8":case"numeric":case"float4":case"float8":case"decimal":case"oid":return"number";case"bool":case"boolean":return"boolean";case"json":case"jsonb":return"any";case"date":case"timestamp":case"timestamptz":case"time":case"timetz":case"interval":return"string";case"bit":case"varbit":return"string";default:return"unknown"}}const Hn=({tableName:c,connection:t,primaryKeys:r,columns:n,isPersist:s=!0,schemaName:v,workspaceId:d,connectionId:i,initFilters:p,initComposeWith:l})=>{const _=yt(),b=Kn(),f=P(!1),w=P(""),a=sn({limit:kt,offset:0}),g=P([]),u=sn({}),S=P(!1),N=P(ft.AND),Z=C(()=>{var q;const k=_.tableAppearanceConfigs.nullOrderPreference,L=(q=t.value)==null?void 0:q.type;return k===ln.Unset||L!==ye.POSTGRES&&L!==ye.ORACLE?"":k===ln.NullsFirst?"NULLS FIRST":"NULLS LAST"}),ie=C(()=>{var L;const k=(L=t.value)==null?void 0:L.type;return k===ye.MYSQL||k===ye.MYSQL2||k===ye.MARIADB?q=>`\`${q}\``:q=>`"${q}"`}),J=C(()=>{const k=ie.value;return`${rn} ${k(v)}.${k(c)}`}),ue=C(()=>{var k;return S.value?Pt({columns:n.value,db:((k=t.value)==null?void 0:k.type)||ye.POSTGRES,filters:g.value,composeWith:N.value}):""}),me=C(()=>{let k="";const L=(u==null?void 0:u.order)||"ASC",q=(u==null?void 0:u.columnName)||r.value[0]||n.value[0],te=ie.value;q&&(k=`ORDER BY ${te(q)} ${L}`,Z.value&&(k=`${k} ${Z.value}`));const Ie=`LIMIT ${a.limit}`,Se=`OFFSET ${a.offset}`;return`${rn} ${te(v)}.${te(c)} ${ue.value||""} ${k} ${Ie} ${Se}`}),pe=C(()=>{const k=ie.value;return`${No} ${k(v)}.${k(c)} ${ue.value||""}`}),oe=(k,L=0,q,te)=>{b.createLog({tableName:c,schemaName:v,logs:k,queryTime:L,error:q,errorMessage:te})},{data:de,status:Ne,refresh:T}=xe("/api/query/execute",{method:"POST",body:{query:me,...we(t.value)},watch:!1,immediate:!1,key:c,cache:"default",onResponseError:k=>{var q,te,Ie,Se;const L=(te=(q=k.response)==null?void 0:q._data)==null?void 0:te.data;f.value=!0,w.value=((Se=(Ie=k.response)==null?void 0:Ie._data)==null?void 0:Se.message)||"",oe(me.value,0,L,w.value)},onResponse:({response:k})=>{var L;k.ok&&oe(me.value,(L=k._data)==null?void 0:L.queryTime)}},"$CR5sijiGqB"),{refresh:E,data:H,status:I}=xe("/api/query/execute",{method:"POST",body:{query:pe,...we(t.value)},watch:!1,immediate:!1,key:`${c}-count`,cache:"default",onResponse:({response:k})=>{var L;k.ok&&oe(pe.value,(L=k._data)==null?void 0:L.queryTime)}},"$2oQhQUxDSL"),V=C(()=>{var k,L,q;return Number(((q=(L=(k=H.value)==null?void 0:k.result)==null?void 0:L[0])==null?void 0:q.count)||0)}),K=C(()=>a.offset+a.limit<V.value),R=C(()=>a.offset>0),$=({limit:k,offset:L})=>{k<=0||L<0||(a.limit=k,a.offset=L,T())},F=({columnName:k,order:L})=>{u.columnName=k,u.order=L,T()},M=()=>{K&&(a.offset+=a.limit,T())},O=()=>{if(!R)return;const k=a.offset-a.limit;k<0?a.offset=0:a.offset=k,T()},Q=k=>{N.value=k,a.offset=0,T(),E()},ae=()=>{a.offset=0,T(),E()},ne=()=>To.queryBuilderKey((d==null?void 0:d.value)??"",(i==null?void 0:i.value)??"",v,c);Fe([g,a,u,S,N],ea(()=>{if(!s)return;const k=ne();localStorage.setItem(k,JSON.stringify({filters:g.value,pagination:{...a},orderBy:{...u},isShowFilters:S.value,composeWith:N.value}))},$n),{deep:!0}),(()=>{if(!s){p&&(g.value=p,S.value=!0),l&&(N.value=l);return}const k=ne(),L=localStorage.getItem(k),q=L?JSON.parse(L):null;if(q){const{filters:te,pagination:Ie,orderBy:Se,isShowFilters:Ge,composeWith:Me}=q;Se&&(u.columnName=Se.columnName,u.order=Se.order),Ie&&(a.limit=Ie.limit,a.offset=Ie.offset),te&&(g.value=te),Me&&(N.value=Me),S.value=!!Ge}})();const ce=C(()=>Ne.value==="pending"),ge=C(()=>{var k;return((k=de.value)==null?void 0:k.result)||[]});return{whereClauses:ue,pagination:a,queryString:me,onUpdatePagination:$,isAllowNextPage:K,isAllowPreviousPage:R,onNextPage:M,onPreviousPage:O,queryCountString:pe,data:ge,isFetchingTableData:ce,refreshTableData:T,refreshCount:E,totalRows:V,onApplyNewFilter:ae,baseQueryString:J,openErrorModal:f,onUpdateOrderBy:F,orderBy:u,errorMessage:w,filters:g,addHistoryLog:oe,isShowFilters:S,onChangeComposeWith:Q,composeWith:N}};var re=(c=>(c.Data="Data",c.Structure="Structure",c.Erd="Erd",c))(re||{});const Wn=()=>{const c=P(),t=P(),r=P([]),n=P(void 0),s=P(!1);return{quickQueryFilterRef:c,quickQueryTableRef:t,selectedRows:r,isMutating:s,focusedCell:n}},ts=({columnName:c,cellValue:t})=>c?{fieldName:c,isSelect:!0,operator:W.EQUAL,search:qn(t)}:null,Gn=({quickQueryFilterRef:c,quickQueryTableRef:t,filters:r,onApplyNewFilter:n})=>{const s=d=>{r.value=[...r.value,d]};return{appendFilter:s,onAddFilterByContextCell:async()=>{var p,l;const d=(p=t.value)==null?void 0:p.cellContextMenu;if(!d)return;const i=ts({columnName:d.colDef.field,cellValue:d.value});i&&(s(i),await Be(),(l=c.value)==null||l.onShowSearch(),n())}}};function Yn(c){const{tableName:t,schemaName:r,primaryKeys:n,columnNames:s,data:v,selectedRows:d,pagination:i,addHistoryLog:p,refreshTableData:l,refreshCount:_,openErrorModal:b,errorMessage:f,quickQueryTableRef:w,focusedCell:a,safeModeEnabled:g,onRequestSafeModeConfirm:u,connection:S}=c,N=P(!1),Z=async()=>{var $;const R=($=w.value)==null?void 0:$.gridApi;R&&(R==null||R.deselectAll(),R==null||R.clearFocusedCell(),_(),l())},ie=R=>{d.value=R},J=R=>{a&&(a.value=R)},ue=()=>{var R;return((R=w.value)==null?void 0:R.editedCells)??[]},me=()=>ue().filter(R=>R.isNewRow||Object.keys(R.changedData).length>0),pe=async()=>{var F;const R=me();if(!v.value||!R.length){Je.info("No changes to save.");return}const $=[];if(R.forEach(M=>{var ee,ce,ge;const O=!!Object.keys(M.changedData).length,Q=(ee=v.value)==null?void 0:ee[M.rowId],ae=O&&Q&&!M.isNewRow,ne=M.isNewRow||!Q&&O;if(ae){const k=Xa({tableName:t,schemaName:r,update:M.changedData,pKeys:n.value,pKeyValue:Q,dbType:(ce=S.value)==null?void 0:ce.type});$.push(k)}else if(ne){const k=es({tableName:t,schemaName:r,insertData:M.changedData,dbType:(ge=S.value)==null?void 0:ge.type});$.push(k)}}),!$.length){Je.info("No valid changes to save.");return}if(!(g!=null&&g.value&&u&&!await u($.join(`
@@ -1 +1 @@
1
- import{_ as s}from"./DHAL8jJG.js";var t,e=(t=class{constructor(i){this.init=i,this.records=this.init()}reset(){this.records=this.init()}},s(t,"ImperativeState"),t);export{e as I};
1
+ import{_ as s}from"./B_ERKujF.js";var t,e=(t=class{constructor(i){this.init=i,this.records=this.init()}reset(){this.records=this.init()}},s(t,"ImperativeState"),t);export{e as I};
@@ -1,2 +1,2 @@
1
- import{d as D,aa as ht,r as O,aK as _t,k as A,l as V,g as o,o as S,w as l,D as R,ak as kt,aJ as yt,e as B,m as I,n as j,j as z,u as Ie,a as je,dT as Ve,az as bt,A as L,c as oe,b as We,aq as Ke,f as i,a0 as F,z as W,F as Y,s as ne,q as Ye,t as U,aY as Ct,a_ as xt,a$ as $t,v as Ge,N as St,O as Et,Q as Tt,R as It,S as Wt,T as Mt,U as At,V as Bt,a5 as ge,dU as Dt,a6 as Lt,a3 as Me,a1 as ve,W as we,p as $e,aS as Ne,dV as Nt,at as Pt,aT as Ot,bn as Rt,aN as Ht,cz as Ft,cu as he,dW as Ae,K as Pe,aG as Q,aH as Qe,X as Be,Y as De,bo as Xe,$ as Ze,dX as zt,bt as qt,Z as Ut,i as te,_ as jt,bk as Vt,x as Kt,y as Yt,C as Gt,B as Qt,dY as Xt,dZ as Zt,d_ as Jt,aP as eo,dg as to,dL as oo}from"./BcsKoAPU.js";import{i as Je,g as et,a as se}from"./CHEpbbGc.js";import{_ as tt}from"./DcCF9IZB.js";import{i as no,_ as Se}from"./63YtjFEq.js";import{F as so,u as ro,a as io,b as ao,c as lo,E as co,d as uo,t as po,e as _e}from"./Oe2GG0Lt.js";import{_ as mo,a as fo,b as vo,e as wo,c as go}from"./DVnDb6ua.js";import{_ as ho}from"./COHOh4Oe.js";import{_ as _o,j as ko,k as yo}from"./B73IHAoF.js";import{_ as bo}from"./BpUSbMUb.js";import"./BoIj4dtd.js";import"./DAr5YiBT.js";var Co=D({__name:"AvatarFallback",props:{delayMs:{type:Number,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(e){const t=e,s=no();ht();const r=O(t.delayMs===void 0);return _t(n=>{if(t.delayMs&&yt){const a=window.setTimeout(()=>{r.value=!0},t.delayMs);n(()=>{window.clearTimeout(a)})}}),(n,a)=>r.value&&o(s).imageLoadingStatus.value!=="loaded"?(S(),A(o(kt),{key:0,"as-child":n.asChild,as:n.as},{default:l(()=>[R(n.$slots,"default")]),_:3},8,["as-child","as"])):V("v-if",!0)}}),xo=Co;const $o={"data-slot":"table-container",class:"relative w-full overflow-auto"},So=D({__name:"Table",props:{class:{}},setup(e){const t=e;return(s,r)=>(S(),B("div",$o,[I("table",{"data-slot":"table",class:j(o(z)("w-full caption-bottom text-sm",t.class))},[R(s.$slots,"default")],2)]))}}),Eo=D({__name:"TableBody",props:{class:{}},setup(e){const t=e;return(s,r)=>(S(),B("tbody",{"data-slot":"table-body",class:j(o(z)("[&_tr:last-child]:border-0",t.class))},[R(s.$slots,"default")],2))}}),ae=D({__name:"TableCell",props:{class:{}},setup(e){const t=e;return(s,r)=>(S(),B("td",{"data-slot":"table-cell",class:j(o(z)("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t.class))},[R(s.$slots,"default")],2))}}),Oe=D({__name:"TableRow",props:{class:{}},setup(e){const t=e;return(s,r)=>(S(),B("tr",{"data-slot":"table-row",class:j(o(z)("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",t.class))},[R(s.$slots,"default")],2))}}),le=D({__name:"TableHead",props:{class:{}},setup(e){const t=e;return(s,r)=>(S(),B("th",{"data-slot":"table-head",class:j(o(z)("text-muted-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t.class))},[R(s.$slots,"default")],2))}}),To=D({__name:"TableHeader",props:{class:{}},setup(e){const t=e;return(s,r)=>(S(),B("thead",{"data-slot":"table-header",class:j(o(z)("[&_tr]:border-b",t.class))},[R(s.$slots,"default")],2))}}),Io={key:1,class:"rounded-md border border-border w-full"},Wo={class:"flex items-center gap-2 truncate"},Mo={class:"w-80"},Ao={class:"text-muted-foreground truncate"},Bo={class:"flex flex-wrap gap-1"},Do={class:"flex items-center justify-end gap-1"},Lo=D({__name:"ConnectionsList",props:{connections:{}},emits:["edit","delete","create"],setup(e,{emit:t}){const{openWorkspaceWithConnection:s}=Ie(),r=je(),{checkAndConfirm:n}=Ve(),a=We(),v=e,w=t,u=O(null),d=bt(L,{name:"hugeicons:database"}),c=oe(()=>Je(a.public.sqlite3ConnectionsEnabled)),E=_=>{if(_.method!==ge.STRING||!_.connectionString)return null;try{return Dt(_.connectionString)}catch{return null}},p=_=>_.type===Lt.ORACLE?_.serviceName:_.database,g=_=>{if(_.method===ge.FILE){const k=_.filePath||"SQLite file not selected";return{summary:k,tooltip:k}}if(_.method===ge.STRING){const k=E(_),T=_.connectionString||"Invalid connection string";return k?{summary:`${k.host}${k.database?`:${k.database}`:""}`,tooltip:`${k.host}${k.port?`:${k.port}`:""}${k.database?`/${k.database}`:""}`}:{summary:T,tooltip:T}}const m=_.host||"Host not set",x=p(_);return{summary:`${m}${x?`:${x}`:""}`,tooltip:`${m}${_.port?`:${_.port}`:""}${x?`/${x}`:""}`}},f=oe(()=>v.connections.map(_=>{var m;return{connection:_,details:g(_),icon:((m=et(_.type))==null?void 0:m.icon)??d}})),$=_=>{u.value=_},b=()=>{u.value&&(w("delete",u.value),u.value=null)},C=async _=>{se(_,c.value)||!await n(_)||s({connId:_.id,wsId:_.workspaceId})};return(_,m)=>{const x=Ke;return v.connections.length===0?(S(),A(x,{key:0,title:"No connections yet",desc:"Click Add Connection to create your first database connection."},{default:l(()=>[i(o(F),{size:"sm",variant:"outline",onClick:m[0]||(m[0]=k=>w("create"))},{default:l(()=>[i(o(L),{name:"hugeicons:plus-sign",class:"size-4!"}),m[3]||(m[3]=W(" Add Connection "))]),_:1})]),_:1})):(S(),B("div",Io,[i(o(So),null,{default:l(()=>[i(o(To),null,{default:l(()=>[i(o(Oe),{class:"hover:bg-transparent"},{default:l(()=>[i(o(le),null,{default:l(()=>m[4]||(m[4]=[W("Name")])),_:1}),i(o(le),null,{default:l(()=>m[5]||(m[5]=[W("Connection Details")])),_:1}),i(o(le),null,{default:l(()=>m[6]||(m[6]=[W("Tag Envs")])),_:1}),i(o(le),{class:"text-right"},{default:l(()=>m[7]||(m[7]=[W("Actions")])),_:1})]),_:1})]),_:1}),i(o(Eo),null,{default:l(()=>[(S(!0),B(Y,null,ne(f.value,k=>(S(),A(o(Oe),{key:k.connection.id,class:"hover:bg-muted/30 w-full"},{default:l(()=>[i(o(ae),null,{default:l(()=>[I("div",Wo,[(S(),A(Ye(k.icon),{class:"size-5!"})),W(" "+U(k.connection.name),1)])]),_:2},1024),i(o(ae),null,{default:l(()=>[i(o(Ct),null,{default:l(()=>[i(o(xt),{"as-child":""},{default:l(()=>[I("div",Mo,[I("div",Ao,U(k.details.summary),1)])]),_:2},1024),i(o($t),null,{default:l(()=>[I("p",null,U(k.details.tooltip),1)]),_:2},1024)]),_:2},1024)]),_:2},1024),i(o(ae),null,{default:l(()=>[I("div",Bo,[(S(!0),B(Y,null,ne(o(r).getTagsByIds(k.connection.tagIds??[]),T=>(S(),A(o(Ge),{key:T.id,tag:T},null,8,["tag"]))),128))])]),_:2},1024),i(o(ae),{class:"text-right"},{default:l(()=>[I("div",Do,[i(o(F),{variant:"outline",size:"iconMd",onClick:T=>_.$emit("edit",k.connection)},{default:l(()=>[i(o(L),{name:"hugeicons:edit-02"})]),_:2},1032,["onClick"]),i(o(F),{variant:"outline",size:"iconMd",onClick:T=>$(k.connection.id)},{default:l(()=>[i(o(L),{name:"hugeicons:delete-02"})]),_:2},1032,["onClick"]),i(o(F),{variant:"default",size:"sm",disabled:o(se)(k.connection,c.value),onClick:T=>C(k.connection)},{default:l(()=>[i(o(L),{name:"hugeicons:square-arrow-up-right"}),W(" "+U(o(se)(k.connection,c.value)?"Disabled":"Connect"),1)]),_:2},1032,["disabled","onClick"])])]),_:2},1024)]),_:2},1024))),128))]),_:1})]),_:1}),i(o(St),{open:!!u.value,"onUpdate:open":m[2]||(m[2]=k=>!k)},{default:l(()=>[i(o(Et),{class:"border"},{default:l(()=>[i(o(Tt),null,{default:l(()=>[i(o(It),null,{default:l(()=>m[8]||(m[8]=[W("Are you sure?")])),_:1}),i(o(Wt),null,{default:l(()=>m[9]||(m[9]=[W(" This will permanently delete this database connection. This action cannot be undone. ")])),_:1})]),_:1}),i(o(Mt),null,{default:l(()=>[i(o(At),{class:"border",onClick:m[1]||(m[1]=k=>u.value=null)},{default:l(()=>m[10]||(m[10]=[W("Cancel")])),_:1}),i(o(Bt),{class:"border bg-red-600 hover:bg-red-700",onClick:b},{default:l(()=>m[11]||(m[11]=[W(" Delete ")])),_:1})]),_:1})]),_:1})]),_:1},8,["open"])]))}}}),No=D({__name:"CardFooter",props:{class:{}},setup(e){const t=e;return(s,r)=>(S(),B("div",{"data-slot":"card-footer",class:j(o(z)("flex items-center px-6 [.border-t]:pt-6",t.class))},[R(s.$slots,"default")],2))}}),Po=D({__name:"CardHeader",props:{class:{}},setup(e){const t=e;return(s,r)=>(S(),B("div",{"data-slot":"card-header",class:j(o(z)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t.class))},[R(s.$slots,"default")],2))}}),Oo=D({__name:"CardTitle",props:{class:{}},setup(e){const t=e;return(s,r)=>(S(),B("h3",{"data-slot":"card-title",class:j(o(z)("leading-none font-semibold",t.class))},[R(s.$slots,"default")],2))}}),Ro={class:"flex flex-col items-center"},Ho={class:"w-full"},Fo={class:"flex items-center justify-between rounded-md bg-card py-4"},zo=D({__name:"ManagementConnection",props:{connections:{},workspaceId:{}},setup(e){const t=O(!1),{createConnection:s}=Ie(),r=Me(),n=O(null),a=()=>{n.value=null,t.value=!0},v=c=>{s(c)},w=c=>{r.updateConnection(c)},u=c=>{n.value=c,t.value=!0},d=c=>{r.onDeleteConnection(c)};return(c,E)=>{const p=L;return S(),B("div",Ro,[I("div",Ho,[I("div",Fo,[E[2]||(E[2]=I("div",null,[I("h1",{class:"text-xl font-medium"},"Management Connections"),I("p",{class:"text-muted-foreground"}," Manage your database connections in one place ")],-1)),i(o(F),{id:"tour-add-connection-btn",size:"sm",variant:"outline",onClick:a},{default:l(()=>[i(p,{name:"lucide:plus",class:"size-4!"}),E[1]||(E[1]=W(" Add Connection "))]),_:1})]),i(Lo,{connections:c.connections,onEdit:u,onDelete:d,onCreate:a},null,8,["connections"]),i(tt,{open:t.value,"editing-connection":n.value,"onUpdate:open":E[0]||(E[0]=g=>t.value=g),onAddNew:v,onUpdate:w,workspaceId:c.workspaceId},null,8,["open","editing-connection","workspaceId"])])])}}}),qo={class:"w-full overflow-x-auto"},Uo=D({__name:"ManagementConnectionModal",props:{open:{},connections:{},workspaceId:{}},emits:["update:open"],setup(e,{emit:t}){const s=t;return(r,n)=>(S(),A(o(ve),{open:!!r.open,"onUpdate:open":n[0]||(n[0]=a=>s("update:open",a))},{default:l(()=>[i(o(we),{class:"w-[95vw]! max-w-[55vw]!"},{default:l(()=>[I("div",qo,[i(zo,{connections:r.connections,"workspace-id":r.workspaceId},null,8,["connections","workspace-id"])])]),_:1})]),_:1},8,["open"]))}}),Ee=D({__name:"AvatarFallback",props:{delayMs:{},asChild:{type:Boolean},as:{},class:{}},setup(e){const t=e,s=oe(()=>{const{class:r,...n}=t;return n});return(r,n)=>(S(),A(o(xo),$e({"data-slot":"avatar-fallback"},s.value,{class:o(z)("bg-muted flex size-full items-center justify-center rounded-full",t.class)}),{default:l(()=>[R(r.$slots,"default")]),_:3},16,["class"]))}}),ot=Symbol();function Le(){const e=Ne(so),t=Ne(ot);if(!e)throw new Error("useFormField should be used within <FormField>");const{name:s}=e,r=t,n={valid:lo(s),isDirty:ao(s),isTouched:io(s),error:ro(s)};return{id:r,name:s,formItemId:`${r}-form-item`,formDescriptionId:`${r}-form-item-description`,formMessageId:`${r}-form-item-message`,...n}}const ke=D({__name:"FormControl",setup(e){const{error:t,formItemId:s,formDescriptionId:r,formMessageId:n}=Le();return(a,v)=>(S(),A(o(Nt),{id:o(s),"data-slot":"form-control","aria-describedby":o(t)?`${o(r)} ${o(n)}`:`${o(r)}`,"aria-invalid":!!o(t)},{default:l(()=>[R(a.$slots,"default")]),_:3},8,["id","aria-describedby","aria-invalid"]))}}),ye=D({__name:"FormItem",props:{class:{}},setup(e){const t=e,s=Pt();return Ot(ot,s),(r,n)=>(S(),B("div",{"data-slot":"form-item",class:j(o(z)("grid gap-2",t.class))},[R(r.$slots,"default")],2))}}),be=D({__name:"FormLabel",props:{for:{},asChild:{type:Boolean},as:{},class:{}},setup(e){const t=e,{error:s,formItemId:r}=Le();return(n,a)=>(S(),A(o(Rt),{"data-slot":"form-label","data-error":!!o(s),class:j(o(z)("data-[error=true]:text-destructive-foreground",t.class)),for:o(r)},{default:l(()=>[R(n.$slots,"default")]),_:3},8,["data-error","class","for"]))}}),Ce=D({__name:"FormMessage",props:{class:{}},setup(e){const t=e,{name:s,formMessageId:r}=Le();return(n,a)=>(S(),A(o(co),{id:o(r),"data-slot":"form-message",as:"p",name:Ht(o(s)),class:j(o(z)("text-destructive-foreground text-sm",t.class))},null,8,["id","name","class"]))}}),nt=["lucide:badge","lucide:building-2","lucide:bone","lucide:book","hugeicons:ai-brain-05","lucide:circle-dashed","lucide:chess-bishop","lucide:chess-king","lucide:chess-pawn","lucide:chess-queen","lucide:chess-rook","lucide:fan","lucide:skull","lucide:ship-wheel","lucide:bug","lucide:hamburger"],pe=nt[0],jo=Ft({name:he({message:"Workspace name is required."}),desc:he().optional(),icon:he().default(pe)});function Vo(e){const t=Ae(),s=uo({validationSchema:po(jo),initialValues:e.workspace?{name:e.workspace.name,desc:e.workspace.desc,icon:e.workspace.icon||pe}:{name:`My workspace ${(e==null?void 0:e.workspaceSeq)||0}`,icon:pe},name:"workspace-form"}),r=s.handleSubmit(n=>{!!e.workspace?(t.updateWorkspace({...e.workspace,desc:(n==null?void 0:n.desc)||void 0,name:n.name,icon:n.icon}),Pe("Workspace has been updated",{description:Q().toString()})):(t.createWorkspace({desc:(n==null?void 0:n.desc)||void 0,id:Qe(),name:n.name,icon:n.icon,createdAt:Q().toISOString()}),Pe("Workspace has been created",{description:Q().toString()})),e.onClose()});return{form:s,onSubmit:r}}const Ko={class:"grid grid-cols-8 gap-2"},st=D({__name:"CreateWorkspaceModal",props:{open:{},workspace:{},workspaceSeq:{}},emits:["update:open"],setup(e,{emit:t}){const s=e,r=t,n=()=>{r("update:open",!1)},{onSubmit:a}=Vo({workspace:s.workspace,workspaceSeq:s.workspaceSeq,onClose:n});return(v,w)=>{const u=L;return S(),A(o(ve),{open:!!v.open,"onUpdate:open":w[1]||(w[1]=d=>r("update:open",d))},{default:l(()=>[i(o(we),null,{default:l(()=>[i(o(Be),null,{default:l(()=>[i(o(De),null,{default:l(()=>[W(U(v.workspace?"Update workspace":"New workspace"),1)]),_:1})]),_:1}),I("form",{class:"space-y-4",onSubmit:w[0]||(w[0]=(...d)=>o(a)&&o(a)(...d))},[i(o(_e),{name:"icon"},{default:l(({componentField:d})=>[i(o(ye),null,{default:l(()=>[i(o(be),null,{default:l(()=>w[2]||(w[2]=[W("Icon")])),_:1}),i(o(ke),null,{default:l(()=>[i(o(mo),null,{default:l(()=>[i(o(fo),{"as-child":""},{default:l(()=>[i(o(Se),{id:"tour-workspace-icon",class:"cursor-pointer focus:ring-2 focus:ring-primary focus:outline-none",tabindex:"0",role:"button","aria-label":"Select workspace icon"},{default:l(()=>[i(o(Ee),null,{default:l(()=>[i(u,{name:d.modelValue||"hugeicons:folder-01",class:"size-5!"},null,8,["name"])]),_:2},1024)]),_:2},1024)]),_:2},1024),i(o(vo),{class:"w-full p-4"},{default:l(()=>[I("div",Ko,[(S(!0),B(Y,null,ne(o(nt),c=>(S(),A(o(Se),{onClick:E=>d.onChange(c),key:c,class:"cursor-pointer"},{default:l(()=>[i(o(Ee),null,{default:l(()=>[i(u,{name:c,class:"size-5!"},null,8,["name"])]),_:2},1024)]),_:2},1032,["onClick"]))),128))])]),_:2},1024)]),_:2},1024)]),_:2},1024),i(o(Ce))]),_:2},1024)]),_:1}),i(o(_e),{name:"name"},{default:l(({componentField:d})=>[i(o(ye),null,{default:l(()=>[i(o(be),{class:"gap-1"},{default:l(()=>w[3]||(w[3]=[W("Name "),I("span",{class:"text-red-500"},"*",-1)])),_:1}),i(o(ke),null,{default:l(()=>[i(o(Xe),$e({id:"tour-workspace-name",type:"text",placeholder:"Workspace name"},d),null,16)]),_:2},1024),i(o(Ce))]),_:2},1024)]),_:1}),i(o(_e),{name:"desc"},{default:l(({componentField:d})=>[i(o(ye),null,{default:l(()=>[i(o(be),null,{default:l(()=>w[4]||(w[4]=[W("Description")])),_:1}),i(o(ke),null,{default:l(()=>[i(o(ho),$e({id:"tour-workspace-desc",placeholder:"Workspace description ..."},d),null,16)]),_:2},1024),i(o(Ce))]),_:2},1024)]),_:1}),i(o(Ze),{class:"mt-4"},{default:l(()=>[i(o(F),{id:"tour-workspace-create",type:"submit"},{default:l(()=>[W(U(v.workspace?"Update":"Create"),1)]),_:1})]),_:1})],32)]),_:1})]),_:1},8,["open"])}}}),Yo=D({__name:"RestoreDataModal",props:{open:{type:Boolean}},emits:["update:open"],setup(e,{emit:t}){const s=t,r=O(null),n=()=>{var a;r.value&&!r.value.canClose()||((a=r.value)==null||a.resetState(),s("update:open",!1))};return(a,v)=>{const w=L;return S(),A(o(ve),{open:a.open,"onUpdate:open":n},{default:l(()=>[i(o(we),{class:"sm:max-w-2xl flex flex-col"},{default:l(()=>[i(o(Be),null,{default:l(()=>[i(o(De),{class:"flex items-center gap-2"},{default:l(()=>[i(w,{name:"hugeicons:file-download",class:"size-4!"}),v[0]||(v[0]=W(" Restore Data "))]),_:1})]),_:1}),i(o(zt),{ref_key:"importPanelRef",ref:r,layout:"modal","success-action-label":"Close","success-action-mode":"emit",onSuccessAction:n},null,512)]),_:1})]),_:1},8,["open"])}}});var ue={exports:{}},Go=ue.exports,Re;function Qo(){return Re||(Re=1,function(e,t){(function(s,r){e.exports=r()})(Go,function(){return function(s,r,n){s=s||{};var a=r.prototype,v={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function w(d,c,E,p){return a.fromToBase(d,c,E,p)}n.en.relativeTime=v,a.fromToBase=function(d,c,E,p,g){for(var f,$,b,C=E.$locale().relativeTime||v,_=s.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],m=_.length,x=0;x<m;x+=1){var k=_[x];k.d&&(f=p?n(d).diff(E,k.d,!0):E.diff(d,k.d,!0));var T=(s.rounding||Math.round)(Math.abs(f));if(b=f>0,T<=k.r||!k.r){T<=1&&x>0&&(k=_[x-1]);var P=C[k.l];g&&(T=g(""+T)),$=typeof P=="string"?P.replace("%d",T):P(T,c,k.l,b);break}}if(c)return $;var q=b?C.future:C.past;return typeof q=="function"?q($):q.replace("%s",$)},a.to=function(d,c){return w(d,c,this,!0)},a.from=function(d,c){return w(d,c,this)};var u=function(d){return d.$u?n.utc():n()};a.toNow=function(d){return this.to(u(this),d)},a.fromNow=function(d){return this.from(u(this),d)}}})}(ue)),ue.exports}var Xo=Qo();const Zo=qt(Xo);function Jo(e){const{createConnection:t,openWorkspaceWithConnection:s}=Ie(),r=Ae(),n=Me(),{checkAndConfirm:a}=Ve(),v=O(!1),w=O(!1),u=O(!1),d=O(),c=O(!1),E=()=>{w.value=!1,r.deleteWorkspace(e.workspace.id)},p=oe(()=>n.getConnectionsByWorkspaceId(e.workspace.id));return{workspaceStore:r,isOpenEditModal:v,isOpenDeleteModal:w,isOpenConnectionSelector:u,dropdownTriggerRef:d,isModalCreateConnectionOpen:c,connections:p,onConfirmDelete:E,onOpenWorkspace:()=>{var C;(C=e.onSelectWorkspace)==null||C.call(e,e.workspace.id)},onOpenConnectionSelector:()=>{u.value=!0},onOpenWorkspaceWithConnection:async C=>{u.value=!1;const _=p.value.find(m=>m.id===C);_&&!await a(_)||await s({connId:C,wsId:e.workspace.id})},handleAddConnection:C=>{t(C)}}}const en=D({__name:"DeleteWorkspaceModal",props:{open:{},onConfirm:{type:Function}},emits:["update:open"],setup(e,{emit:t}){const s=t;return(r,n)=>{const a=F,v=we;return S(),A(o(ve),{open:!!r.open,"onUpdate:open":n[0]||(n[0]=w=>s("update:open",w))},{default:l(()=>[i(v,null,{default:l(()=>[i(o(Be),null,{default:l(()=>[i(o(De),null,{default:l(()=>n[1]||(n[1]=[W("Delete workspace")])),_:1}),i(o(Ut),null,{default:l(()=>n[2]||(n[2]=[W(" Are you sure you want to delete this workspace? "),I("br",null,null,-1),W(" All data will be permanently deleted this action cannot be undone. ")])),_:1})]),_:1}),i(o(Ze),null,{default:l(()=>[i(a,{type:"submit",onClick:r.onConfirm,variant:"default"},{default:l(()=>n[3]||(n[3]=[W(" Delete ")])),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1},8,["open"])}}}),tn={class:"flex items-center space-x-2"},on={class:"space-y-1"},nn={class:"text-sm line-clamp-2 break-words break-all text-left"},sn={class:"flex items-center pt-2"},rn={class:"text-xs text-muted-foreground"},an={class:"flex items-center pt-2"},ln={key:0,class:"text-xs text-muted-foreground"},cn={key:1,class:"text-xs text-muted-foreground"},dn={class:"flex items-center pt-2"},un={class:"text-xs text-muted-foreground"},pn={class:"flex items-center gap-1"},mn={class:"flex items-center gap-2 min-w-0"},fn={class:"truncate"},vn={key:0,class:"flex items-center gap-1 ml-auto flex-shrink-0"},wn={key:1,class:"ml-auto text-xs text-muted-foreground"},gn=D({__name:"WorkspaceCard",props:{workspace:{},onOpenWorkspace:{type:Function}},emits:["onSelectWorkspace"],setup(e,{emit:t}){Q.extend(Zo);const s=je(),r=We(),n=oe(()=>Je(r.public.sqlite3ConnectionsEnabled)),a=e,v=t,{workspaceStore:w,isOpenEditModal:u,isOpenDeleteModal:d,isOpenConnectionSelector:c,dropdownTriggerRef:E,isModalCreateConnectionOpen:p,connections:g,onConfirmDelete:f,onOpenWorkspace:$,onOpenConnectionSelector:b,onOpenWorkspaceWithConnection:C,handleAddConnection:_}=Jo({workspace:a.workspace,onSelectWorkspace:m=>v("onSelectWorkspace",m)});return(m,x)=>{const k=Ee,T=Se,P=ko,q=bo,Z=yo,J=_o,G=Gt,ee=Yt;return S(),B(Y,null,[o(p)?(S(),A(o(tt),{key:0,open:o(p),"editing-connection":null,"onUpdate:open":x[0]||(x[0]=M=>p.value=M),onAddNew:o(_),workspaceId:m.workspace.id},null,8,["open","onAddNew","workspaceId"])):V("",!0),o(u)?(S(),A(st,{key:1,open:o(u),"onUpdate:open":x[1]||(x[1]=M=>te(u)?u.value=M:null),workspace:m.workspace,workspaceSeq:o(w).workspaces.length},null,8,["open","workspace","workspaceSeq"])):V("",!0),o(d)?(S(),A(en,{key:2,open:o(d),"onUpdate:open":x[2]||(x[2]=M=>te(d)?d.value=M:null),onConfirm:o(f)},null,8,["open","onConfirm"])):V("",!0),i(o(go),{class:"gap-4 justify-between!"},{default:l(()=>[i(o(Po),{class:"flex justify-between px-4"},{default:l(()=>[I("div",tn,[i(T,null,{default:l(()=>[i(k,null,{default:l(()=>[i(o(L),{name:m.workspace.icon,class:"size-5!"},null,8,["name"])]),_:1})]),_:1}),I("div",null,[i(o(Oo),{class:"line-clamp-1"},{default:l(()=>[W(U(m.workspace.name),1)]),_:1})])]),i(J,null,{default:l(()=>[i(P,null,{default:l(()=>[i(o(F),{size:"icon",variant:"ghost"},{default:l(()=>[i(o(L),{name:"hugeicons:more-vertical-circle-01",class:"size-4!"})]),_:1})]),_:1}),i(Z,null,{default:l(()=>[i(q,{class:"cursor-pointer flex items-center",onClick:x[3]||(x[3]=M=>u.value=!0)},{default:l(()=>[i(o(L),{name:"hugeicons:pencil-edit-02",class:"size-4! min-w-4"}),x[9]||(x[9]=W(" Edit workspace "))]),_:1}),i(q,{class:"cursor-pointer flex items-center",disabled:""},{default:l(()=>[i(o(L),{name:"hugeicons:link-04",class:"size-4! min-w-4"}),x[10]||(x[10]=W(" Invite "))]),_:1}),i(q,{class:"cursor-pointer flex items-center",onClick:x[4]||(x[4]=M=>d.value=!0)},{default:l(()=>[i(o(L),{name:"hugeicons:delete-02",class:"size-4! min-w-4"}),x[11]||(x[11]=W(" Delete workspace "))]),_:1})]),_:1})]),_:1})]),_:1}),i(o(wo),{class:"grid gap-4 overflow-hidden px-4"},{default:l(()=>[I("div",on,[I("p",nn,U(m.workspace.desc),1),I("div",sn,[i(o(L),{name:"hugeicons:connect",class:"mr-2 h-4 w-4 opacity-70"}),I("span",rn," Connection : "+U(o(g).length),1)]),I("div",an,[i(o(L),{name:"hugeicons:clock-05",class:"mr-2 h-4 w-4 opacity-70"}),m.workspace.lastOpened?(S(),B("span",ln," Last opened : "+U(o(Q)(m.workspace.lastOpened).fromNow()),1)):(S(),B("span",cn," Last opened : -/- "))]),I("div",dn,[i(o(L),{name:"hugeicons:clock-01",class:"mr-2 h-4 w-4 opacity-70"}),I("span",un," Created : "+U(o(Q)(m.workspace.createdAt).fromNow()),1)])])]),_:1}),i(o(No),{class:"px-4"},{default:l(()=>[i(o(jt),{open:o(c),"onUpdate:open":x[8]||(x[8]=M=>te(c)?c.value=M:null)},{default:l(()=>[i(o(F),{id:`tour-open-workspace-${m.workspace.id}`,ref_key:"dropdownTriggerRef",ref:E,variant:"default",class:"w-full flex items-center justify-between",onClick:x[6]||(x[6]=M=>o($)()),size:"sm"},{default:l(()=>[I("div",pn,[i(o(L),{name:"hugeicons:square-arrow-up-right",class:"h-4 w-4"}),x[12]||(x[12]=W(" Open workspace "))]),i(o(F),{size:"iconSm",variant:"ghost",onClick:x[5]||(x[5]=Vt(M=>o(b)(),["stop"]))},{default:l(()=>[i(o(L),{name:"hugeicons:arrow-down-01",class:"size-5!"})]),_:1})]),_:1},8,["id"]),i(o(Kt),{reference:o(E)},{default:l(()=>[i(ee,null,{default:l(()=>[I("div",{class:"flex px-2 py-0.5 h-8 hover:bg-muted rounded-md font-normal text-sm items-center gap-1 cursor-pointer",onClick:x[7]||(x[7]=M=>p.value=!0)},[i(o(L),{name:"hugeicons:plus-sign"}),x[13]||(x[13]=W(" Add new connection "))]),o(g).length?(S(),A(G,{key:0})):V("",!0),(S(!0),B(Y,null,ne(o(g),M=>(S(),A(o(Qt),{class:"cursor-pointer",value:M.id,key:M.id,disabled:o(se)(M,o(n)),onSelect:K=>o(C)(M.id)},{default:l(()=>{var K;return[I("div",mn,[(S(),A(Ye((K=o(et)(M.type))==null?void 0:K.icon),{class:"size-4! shrink-0"})),I("span",fn,U(M.name),1),(M.tagIds??[]).length?(S(),B("div",vn,[(S(!0),B(Y,null,ne(o(s).getTagsByIds(M.tagIds??[]),ie=>(S(),A(o(Ge),{key:ie.id,tag:ie},null,8,["tag"]))),128))])):V("",!0),o(se)(M,o(n))?(S(),B("span",wn," Disabled ")):V("",!0)])]}),_:2},1032,["value","disabled","onSelect"]))),128))]),_:1})]),_:1},8,["reference"])]),_:1},8,["open"])]),_:1})]),_:1})],64)}}}),hn={class:"flex items-center justify-between mt-2"},_n={class:"container flex flex-col items-start gap-1 py-2"},kn={class:"text-3xl flex items-center gap-2 font-bold leading-tight tracking-tighter lg:leading-[1.1]"},yn={class:"flex items-center gap-2 shrink-0"},bn=D({__name:"WorkspaceHeader",props:{isShowButtonCreate:{type:Boolean},isShowButtonRestore:{type:Boolean}},emits:["create","restore"],setup(e,{emit:t}){const s=t;return(r,n)=>{const a=L;return S(),B("div",hn,[I("div",_n,[I("h1",kn,[n[2]||(n[2]=W(" Hello ")),i(a,{name:"hugeicons:waving-hand-01"})]),n[3]||(n[3]=I("p",{class:"max-w-2xl text-lg font-light text-foreground"}," Welcome to your workspaces ",-1))]),I("div",yn,[r.isShowButtonRestore?(S(),A(o(F),{key:0,type:"button",variant:"outline",size:"sm",onClick:n[0]||(n[0]=v=>s("restore"))},{default:l(()=>[i(a,{name:"lucide:upload"}),n[4]||(n[4]=W(" Restore Data "))]),_:1})):V("",!0),r.isShowButtonCreate?(S(),A(o(F),{key:1,id:"tour-new-workspace-btn",variant:"outline",size:"sm",onClick:n[1]||(n[1]=v=>s("create"))},{default:l(()=>[i(a,{name:"lucide:plus"}),n[5]||(n[5]=W(" New Workspace "))]),_:1})):V("",!0)])])}}});let Te={},rt;function xe(e={}){Te={animate:!0,allowClose:!0,overlayClickBehavior:"close",overlayOpacity:.7,smoothScroll:!1,disableActiveInteraction:!1,showProgress:!1,stagePadding:10,stageRadius:5,popoverOffset:10,showButtons:["next","previous","close"],disableButtons:[],overlayColor:"#000",...e}}function h(e){return e?Te[e]:Te}function Cn(e){rt=e}function H(){return rt}let me={};function ce(e,t){me[e]=t}function X(e){var t;(t=me[e])==null||t.call(me)}function xn(){me={}}function de(e,t,s,r){return(e/=r/2)<1?s/2*e*e+t:-s/2*(--e*(e-2)-1)+t}function it(e){const t='a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])';return e.flatMap(s=>{const r=s.matches(t),n=Array.from(s.querySelectorAll(t));return[...r?[s]:[],...n]}).filter(s=>getComputedStyle(s).pointerEvents!=="none"&&En(s))}function at(e){if(!e||Sn(e))return;const t=h("smoothScroll"),s=e.offsetHeight>window.innerHeight;e.scrollIntoView({behavior:!t||$n(e)?"auto":"smooth",inline:"center",block:s?"start":"center"})}function $n(e){if(!e||!e.parentElement)return;const t=e.parentElement;return t.scrollHeight>t.clientHeight}function Sn(e){const t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}function En(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}let fe={};function N(e,t){fe[e]=t}function y(e){return e?fe[e]:fe}function He(){fe={}}function Tn(e,t,s,r){let n=y("__activeStagePosition");const a=n||s.getBoundingClientRect(),v=r.getBoundingClientRect(),w=de(e,a.x,v.x-a.x,t),u=de(e,a.y,v.y-a.y,t),d=de(e,a.width,v.width-a.width,t),c=de(e,a.height,v.height-a.height,t);n={x:w,y:u,width:d,height:c},ct(n),N("__activeStagePosition",n)}function lt(e){if(!e)return;const t=e.getBoundingClientRect(),s={x:t.x,y:t.y,width:t.width,height:t.height};N("__activeStagePosition",s),ct(s)}function In(){const e=y("__activeStagePosition"),t=y("__overlaySvg");if(!e)return;if(!t){console.warn("No stage svg found.");return}const s=window.innerWidth,r=window.innerHeight;t.setAttribute("viewBox",`0 0 ${s} ${r}`)}function Wn(e){const t=Mn(e);document.body.appendChild(t),pt(t,s=>{s.target.tagName==="path"&&X("overlayClick")}),N("__overlaySvg",t)}function ct(e){const t=y("__overlaySvg");if(!t){Wn(e);return}const s=t.firstElementChild;if((s==null?void 0:s.tagName)!=="path")throw new Error("no path element found in stage svg");s.setAttribute("d",dt(e))}function Mn(e){const t=window.innerWidth,s=window.innerHeight,r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.classList.add("driver-overlay","driver-overlay-animated"),r.setAttribute("viewBox",`0 0 ${t} ${s}`),r.setAttribute("xmlSpace","preserve"),r.setAttribute("xmlnsXlink","http://www.w3.org/1999/xlink"),r.setAttribute("version","1.1"),r.setAttribute("preserveAspectRatio","xMinYMin slice"),r.style.fillRule="evenodd",r.style.clipRule="evenodd",r.style.strokeLinejoin="round",r.style.strokeMiterlimit="2",r.style.zIndex="10000",r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.width="100%",r.style.height="100%";const n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttribute("d",dt(e)),n.style.fill=h("overlayColor")||"rgb(0,0,0)",n.style.opacity=`${h("overlayOpacity")}`,n.style.pointerEvents="auto",n.style.cursor="auto",r.appendChild(n),r}function dt(e){const t=window.innerWidth,s=window.innerHeight,r=h("stagePadding")||0,n=h("stageRadius")||0,a=e.width+r*2,v=e.height+r*2,w=Math.min(n,a/2,v/2),u=Math.floor(Math.max(w,0)),d=e.x-r+u,c=e.y-r,E=a-u*2,p=v-u*2;return`M${t},0L0,0L0,${s}L${t},${s}L${t},0Z
1
+ import{d as D,aa as ht,r as O,aK as _t,k as A,l as V,g as o,o as S,w as l,D as R,ak as kt,aJ as yt,e as B,m as I,n as j,j as z,u as Ie,a as je,dT as Ve,az as bt,A as L,c as oe,b as We,aq as Ke,f as i,a0 as F,z as W,F as Y,s as ne,q as Ye,t as U,aY as Ct,a_ as xt,a$ as $t,v as Ge,N as St,O as Et,Q as Tt,R as It,S as Wt,T as Mt,U as At,V as Bt,a5 as ge,dU as Dt,a6 as Lt,a3 as Me,a1 as ve,W as we,p as $e,aS as Ne,dV as Nt,at as Pt,aT as Ot,bn as Rt,aN as Ht,cz as Ft,cu as he,dW as Ae,K as Pe,aG as Q,aH as Qe,X as Be,Y as De,bo as Xe,$ as Ze,dX as zt,bt as qt,Z as Ut,i as te,_ as jt,bk as Vt,x as Kt,y as Yt,C as Gt,B as Qt,dY as Xt,dZ as Zt,d_ as Jt,aP as eo,dg as to,dL as oo}from"./D0lW43G8.js";import{i as Je,g as et,a as se}from"./Chx1IK9D.js";import{_ as tt}from"./CfseWBL0.js";import{i as no,_ as Se}from"./BdZsZgcB.js";import{F as so,u as ro,a as io,b as ao,c as lo,E as co,d as uo,t as po,e as _e}from"./CCmd8DpQ.js";import{_ as mo,a as fo,b as vo,e as wo,c as go}from"./CRqiHVA4.js";import{_ as ho}from"./BMLhg7hE.js";import{_ as _o,j as ko,k as yo}from"./Dunt8-TF.js";import{_ as bo}from"./CkjXKCQH.js";import"./Db3rTgnd.js";import"./C-Pa1rIR.js";var Co=D({__name:"AvatarFallback",props:{delayMs:{type:Number,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(e){const t=e,s=no();ht();const r=O(t.delayMs===void 0);return _t(n=>{if(t.delayMs&&yt){const a=window.setTimeout(()=>{r.value=!0},t.delayMs);n(()=>{window.clearTimeout(a)})}}),(n,a)=>r.value&&o(s).imageLoadingStatus.value!=="loaded"?(S(),A(o(kt),{key:0,"as-child":n.asChild,as:n.as},{default:l(()=>[R(n.$slots,"default")]),_:3},8,["as-child","as"])):V("v-if",!0)}}),xo=Co;const $o={"data-slot":"table-container",class:"relative w-full overflow-auto"},So=D({__name:"Table",props:{class:{}},setup(e){const t=e;return(s,r)=>(S(),B("div",$o,[I("table",{"data-slot":"table",class:j(o(z)("w-full caption-bottom text-sm",t.class))},[R(s.$slots,"default")],2)]))}}),Eo=D({__name:"TableBody",props:{class:{}},setup(e){const t=e;return(s,r)=>(S(),B("tbody",{"data-slot":"table-body",class:j(o(z)("[&_tr:last-child]:border-0",t.class))},[R(s.$slots,"default")],2))}}),ae=D({__name:"TableCell",props:{class:{}},setup(e){const t=e;return(s,r)=>(S(),B("td",{"data-slot":"table-cell",class:j(o(z)("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t.class))},[R(s.$slots,"default")],2))}}),Oe=D({__name:"TableRow",props:{class:{}},setup(e){const t=e;return(s,r)=>(S(),B("tr",{"data-slot":"table-row",class:j(o(z)("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",t.class))},[R(s.$slots,"default")],2))}}),le=D({__name:"TableHead",props:{class:{}},setup(e){const t=e;return(s,r)=>(S(),B("th",{"data-slot":"table-head",class:j(o(z)("text-muted-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t.class))},[R(s.$slots,"default")],2))}}),To=D({__name:"TableHeader",props:{class:{}},setup(e){const t=e;return(s,r)=>(S(),B("thead",{"data-slot":"table-header",class:j(o(z)("[&_tr]:border-b",t.class))},[R(s.$slots,"default")],2))}}),Io={key:1,class:"rounded-md border border-border w-full"},Wo={class:"flex items-center gap-2 truncate"},Mo={class:"w-80"},Ao={class:"text-muted-foreground truncate"},Bo={class:"flex flex-wrap gap-1"},Do={class:"flex items-center justify-end gap-1"},Lo=D({__name:"ConnectionsList",props:{connections:{}},emits:["edit","delete","create"],setup(e,{emit:t}){const{openWorkspaceWithConnection:s}=Ie(),r=je(),{checkAndConfirm:n}=Ve(),a=We(),v=e,w=t,u=O(null),d=bt(L,{name:"hugeicons:database"}),c=oe(()=>Je(a.public.sqlite3ConnectionsEnabled)),E=_=>{if(_.method!==ge.STRING||!_.connectionString)return null;try{return Dt(_.connectionString)}catch{return null}},p=_=>_.type===Lt.ORACLE?_.serviceName:_.database,g=_=>{if(_.method===ge.FILE){const k=_.filePath||"SQLite file not selected";return{summary:k,tooltip:k}}if(_.method===ge.STRING){const k=E(_),T=_.connectionString||"Invalid connection string";return k?{summary:`${k.host}${k.database?`:${k.database}`:""}`,tooltip:`${k.host}${k.port?`:${k.port}`:""}${k.database?`/${k.database}`:""}`}:{summary:T,tooltip:T}}const m=_.host||"Host not set",x=p(_);return{summary:`${m}${x?`:${x}`:""}`,tooltip:`${m}${_.port?`:${_.port}`:""}${x?`/${x}`:""}`}},f=oe(()=>v.connections.map(_=>{var m;return{connection:_,details:g(_),icon:((m=et(_.type))==null?void 0:m.icon)??d}})),$=_=>{u.value=_},b=()=>{u.value&&(w("delete",u.value),u.value=null)},C=async _=>{se(_,c.value)||!await n(_)||s({connId:_.id,wsId:_.workspaceId})};return(_,m)=>{const x=Ke;return v.connections.length===0?(S(),A(x,{key:0,title:"No connections yet",desc:"Click Add Connection to create your first database connection."},{default:l(()=>[i(o(F),{size:"sm",variant:"outline",onClick:m[0]||(m[0]=k=>w("create"))},{default:l(()=>[i(o(L),{name:"hugeicons:plus-sign",class:"size-4!"}),m[3]||(m[3]=W(" Add Connection "))]),_:1})]),_:1})):(S(),B("div",Io,[i(o(So),null,{default:l(()=>[i(o(To),null,{default:l(()=>[i(o(Oe),{class:"hover:bg-transparent"},{default:l(()=>[i(o(le),null,{default:l(()=>m[4]||(m[4]=[W("Name")])),_:1}),i(o(le),null,{default:l(()=>m[5]||(m[5]=[W("Connection Details")])),_:1}),i(o(le),null,{default:l(()=>m[6]||(m[6]=[W("Tag Envs")])),_:1}),i(o(le),{class:"text-right"},{default:l(()=>m[7]||(m[7]=[W("Actions")])),_:1})]),_:1})]),_:1}),i(o(Eo),null,{default:l(()=>[(S(!0),B(Y,null,ne(f.value,k=>(S(),A(o(Oe),{key:k.connection.id,class:"hover:bg-muted/30 w-full"},{default:l(()=>[i(o(ae),null,{default:l(()=>[I("div",Wo,[(S(),A(Ye(k.icon),{class:"size-5!"})),W(" "+U(k.connection.name),1)])]),_:2},1024),i(o(ae),null,{default:l(()=>[i(o(Ct),null,{default:l(()=>[i(o(xt),{"as-child":""},{default:l(()=>[I("div",Mo,[I("div",Ao,U(k.details.summary),1)])]),_:2},1024),i(o($t),null,{default:l(()=>[I("p",null,U(k.details.tooltip),1)]),_:2},1024)]),_:2},1024)]),_:2},1024),i(o(ae),null,{default:l(()=>[I("div",Bo,[(S(!0),B(Y,null,ne(o(r).getTagsByIds(k.connection.tagIds??[]),T=>(S(),A(o(Ge),{key:T.id,tag:T},null,8,["tag"]))),128))])]),_:2},1024),i(o(ae),{class:"text-right"},{default:l(()=>[I("div",Do,[i(o(F),{variant:"outline",size:"iconMd",onClick:T=>_.$emit("edit",k.connection)},{default:l(()=>[i(o(L),{name:"hugeicons:edit-02"})]),_:2},1032,["onClick"]),i(o(F),{variant:"outline",size:"iconMd",onClick:T=>$(k.connection.id)},{default:l(()=>[i(o(L),{name:"hugeicons:delete-02"})]),_:2},1032,["onClick"]),i(o(F),{variant:"default",size:"sm",disabled:o(se)(k.connection,c.value),onClick:T=>C(k.connection)},{default:l(()=>[i(o(L),{name:"hugeicons:square-arrow-up-right"}),W(" "+U(o(se)(k.connection,c.value)?"Disabled":"Connect"),1)]),_:2},1032,["disabled","onClick"])])]),_:2},1024)]),_:2},1024))),128))]),_:1})]),_:1}),i(o(St),{open:!!u.value,"onUpdate:open":m[2]||(m[2]=k=>!k)},{default:l(()=>[i(o(Et),{class:"border"},{default:l(()=>[i(o(Tt),null,{default:l(()=>[i(o(It),null,{default:l(()=>m[8]||(m[8]=[W("Are you sure?")])),_:1}),i(o(Wt),null,{default:l(()=>m[9]||(m[9]=[W(" This will permanently delete this database connection. This action cannot be undone. ")])),_:1})]),_:1}),i(o(Mt),null,{default:l(()=>[i(o(At),{class:"border",onClick:m[1]||(m[1]=k=>u.value=null)},{default:l(()=>m[10]||(m[10]=[W("Cancel")])),_:1}),i(o(Bt),{class:"border bg-red-600 hover:bg-red-700",onClick:b},{default:l(()=>m[11]||(m[11]=[W(" Delete ")])),_:1})]),_:1})]),_:1})]),_:1},8,["open"])]))}}}),No=D({__name:"CardFooter",props:{class:{}},setup(e){const t=e;return(s,r)=>(S(),B("div",{"data-slot":"card-footer",class:j(o(z)("flex items-center px-6 [.border-t]:pt-6",t.class))},[R(s.$slots,"default")],2))}}),Po=D({__name:"CardHeader",props:{class:{}},setup(e){const t=e;return(s,r)=>(S(),B("div",{"data-slot":"card-header",class:j(o(z)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t.class))},[R(s.$slots,"default")],2))}}),Oo=D({__name:"CardTitle",props:{class:{}},setup(e){const t=e;return(s,r)=>(S(),B("h3",{"data-slot":"card-title",class:j(o(z)("leading-none font-semibold",t.class))},[R(s.$slots,"default")],2))}}),Ro={class:"flex flex-col items-center"},Ho={class:"w-full"},Fo={class:"flex items-center justify-between rounded-md bg-card py-4"},zo=D({__name:"ManagementConnection",props:{connections:{},workspaceId:{}},setup(e){const t=O(!1),{createConnection:s}=Ie(),r=Me(),n=O(null),a=()=>{n.value=null,t.value=!0},v=c=>{s(c)},w=c=>{r.updateConnection(c)},u=c=>{n.value=c,t.value=!0},d=c=>{r.onDeleteConnection(c)};return(c,E)=>{const p=L;return S(),B("div",Ro,[I("div",Ho,[I("div",Fo,[E[2]||(E[2]=I("div",null,[I("h1",{class:"text-xl font-medium"},"Management Connections"),I("p",{class:"text-muted-foreground"}," Manage your database connections in one place ")],-1)),i(o(F),{id:"tour-add-connection-btn",size:"sm",variant:"outline",onClick:a},{default:l(()=>[i(p,{name:"lucide:plus",class:"size-4!"}),E[1]||(E[1]=W(" Add Connection "))]),_:1})]),i(Lo,{connections:c.connections,onEdit:u,onDelete:d,onCreate:a},null,8,["connections"]),i(tt,{open:t.value,"editing-connection":n.value,"onUpdate:open":E[0]||(E[0]=g=>t.value=g),onAddNew:v,onUpdate:w,workspaceId:c.workspaceId},null,8,["open","editing-connection","workspaceId"])])])}}}),qo={class:"w-full overflow-x-auto"},Uo=D({__name:"ManagementConnectionModal",props:{open:{},connections:{},workspaceId:{}},emits:["update:open"],setup(e,{emit:t}){const s=t;return(r,n)=>(S(),A(o(ve),{open:!!r.open,"onUpdate:open":n[0]||(n[0]=a=>s("update:open",a))},{default:l(()=>[i(o(we),{class:"w-[95vw]! max-w-[55vw]!"},{default:l(()=>[I("div",qo,[i(zo,{connections:r.connections,"workspace-id":r.workspaceId},null,8,["connections","workspace-id"])])]),_:1})]),_:1},8,["open"]))}}),Ee=D({__name:"AvatarFallback",props:{delayMs:{},asChild:{type:Boolean},as:{},class:{}},setup(e){const t=e,s=oe(()=>{const{class:r,...n}=t;return n});return(r,n)=>(S(),A(o(xo),$e({"data-slot":"avatar-fallback"},s.value,{class:o(z)("bg-muted flex size-full items-center justify-center rounded-full",t.class)}),{default:l(()=>[R(r.$slots,"default")]),_:3},16,["class"]))}}),ot=Symbol();function Le(){const e=Ne(so),t=Ne(ot);if(!e)throw new Error("useFormField should be used within <FormField>");const{name:s}=e,r=t,n={valid:lo(s),isDirty:ao(s),isTouched:io(s),error:ro(s)};return{id:r,name:s,formItemId:`${r}-form-item`,formDescriptionId:`${r}-form-item-description`,formMessageId:`${r}-form-item-message`,...n}}const ke=D({__name:"FormControl",setup(e){const{error:t,formItemId:s,formDescriptionId:r,formMessageId:n}=Le();return(a,v)=>(S(),A(o(Nt),{id:o(s),"data-slot":"form-control","aria-describedby":o(t)?`${o(r)} ${o(n)}`:`${o(r)}`,"aria-invalid":!!o(t)},{default:l(()=>[R(a.$slots,"default")]),_:3},8,["id","aria-describedby","aria-invalid"]))}}),ye=D({__name:"FormItem",props:{class:{}},setup(e){const t=e,s=Pt();return Ot(ot,s),(r,n)=>(S(),B("div",{"data-slot":"form-item",class:j(o(z)("grid gap-2",t.class))},[R(r.$slots,"default")],2))}}),be=D({__name:"FormLabel",props:{for:{},asChild:{type:Boolean},as:{},class:{}},setup(e){const t=e,{error:s,formItemId:r}=Le();return(n,a)=>(S(),A(o(Rt),{"data-slot":"form-label","data-error":!!o(s),class:j(o(z)("data-[error=true]:text-destructive-foreground",t.class)),for:o(r)},{default:l(()=>[R(n.$slots,"default")]),_:3},8,["data-error","class","for"]))}}),Ce=D({__name:"FormMessage",props:{class:{}},setup(e){const t=e,{name:s,formMessageId:r}=Le();return(n,a)=>(S(),A(o(co),{id:o(r),"data-slot":"form-message",as:"p",name:Ht(o(s)),class:j(o(z)("text-destructive-foreground text-sm",t.class))},null,8,["id","name","class"]))}}),nt=["lucide:badge","lucide:building-2","lucide:bone","lucide:book","hugeicons:ai-brain-05","lucide:circle-dashed","lucide:chess-bishop","lucide:chess-king","lucide:chess-pawn","lucide:chess-queen","lucide:chess-rook","lucide:fan","lucide:skull","lucide:ship-wheel","lucide:bug","lucide:hamburger"],pe=nt[0],jo=Ft({name:he({message:"Workspace name is required."}),desc:he().optional(),icon:he().default(pe)});function Vo(e){const t=Ae(),s=uo({validationSchema:po(jo),initialValues:e.workspace?{name:e.workspace.name,desc:e.workspace.desc,icon:e.workspace.icon||pe}:{name:`My workspace ${(e==null?void 0:e.workspaceSeq)||0}`,icon:pe},name:"workspace-form"}),r=s.handleSubmit(n=>{!!e.workspace?(t.updateWorkspace({...e.workspace,desc:(n==null?void 0:n.desc)||void 0,name:n.name,icon:n.icon}),Pe("Workspace has been updated",{description:Q().toString()})):(t.createWorkspace({desc:(n==null?void 0:n.desc)||void 0,id:Qe(),name:n.name,icon:n.icon,createdAt:Q().toISOString()}),Pe("Workspace has been created",{description:Q().toString()})),e.onClose()});return{form:s,onSubmit:r}}const Ko={class:"grid grid-cols-8 gap-2"},st=D({__name:"CreateWorkspaceModal",props:{open:{},workspace:{},workspaceSeq:{}},emits:["update:open"],setup(e,{emit:t}){const s=e,r=t,n=()=>{r("update:open",!1)},{onSubmit:a}=Vo({workspace:s.workspace,workspaceSeq:s.workspaceSeq,onClose:n});return(v,w)=>{const u=L;return S(),A(o(ve),{open:!!v.open,"onUpdate:open":w[1]||(w[1]=d=>r("update:open",d))},{default:l(()=>[i(o(we),null,{default:l(()=>[i(o(Be),null,{default:l(()=>[i(o(De),null,{default:l(()=>[W(U(v.workspace?"Update workspace":"New workspace"),1)]),_:1})]),_:1}),I("form",{class:"space-y-4",onSubmit:w[0]||(w[0]=(...d)=>o(a)&&o(a)(...d))},[i(o(_e),{name:"icon"},{default:l(({componentField:d})=>[i(o(ye),null,{default:l(()=>[i(o(be),null,{default:l(()=>w[2]||(w[2]=[W("Icon")])),_:1}),i(o(ke),null,{default:l(()=>[i(o(mo),null,{default:l(()=>[i(o(fo),{"as-child":""},{default:l(()=>[i(o(Se),{id:"tour-workspace-icon",class:"cursor-pointer focus:ring-2 focus:ring-primary focus:outline-none",tabindex:"0",role:"button","aria-label":"Select workspace icon"},{default:l(()=>[i(o(Ee),null,{default:l(()=>[i(u,{name:d.modelValue||"hugeicons:folder-01",class:"size-5!"},null,8,["name"])]),_:2},1024)]),_:2},1024)]),_:2},1024),i(o(vo),{class:"w-full p-4"},{default:l(()=>[I("div",Ko,[(S(!0),B(Y,null,ne(o(nt),c=>(S(),A(o(Se),{onClick:E=>d.onChange(c),key:c,class:"cursor-pointer"},{default:l(()=>[i(o(Ee),null,{default:l(()=>[i(u,{name:c,class:"size-5!"},null,8,["name"])]),_:2},1024)]),_:2},1032,["onClick"]))),128))])]),_:2},1024)]),_:2},1024)]),_:2},1024),i(o(Ce))]),_:2},1024)]),_:1}),i(o(_e),{name:"name"},{default:l(({componentField:d})=>[i(o(ye),null,{default:l(()=>[i(o(be),{class:"gap-1"},{default:l(()=>w[3]||(w[3]=[W("Name "),I("span",{class:"text-red-500"},"*",-1)])),_:1}),i(o(ke),null,{default:l(()=>[i(o(Xe),$e({id:"tour-workspace-name",type:"text",placeholder:"Workspace name"},d),null,16)]),_:2},1024),i(o(Ce))]),_:2},1024)]),_:1}),i(o(_e),{name:"desc"},{default:l(({componentField:d})=>[i(o(ye),null,{default:l(()=>[i(o(be),null,{default:l(()=>w[4]||(w[4]=[W("Description")])),_:1}),i(o(ke),null,{default:l(()=>[i(o(ho),$e({id:"tour-workspace-desc",placeholder:"Workspace description ..."},d),null,16)]),_:2},1024),i(o(Ce))]),_:2},1024)]),_:1}),i(o(Ze),{class:"mt-4"},{default:l(()=>[i(o(F),{id:"tour-workspace-create",type:"submit"},{default:l(()=>[W(U(v.workspace?"Update":"Create"),1)]),_:1})]),_:1})],32)]),_:1})]),_:1},8,["open"])}}}),Yo=D({__name:"RestoreDataModal",props:{open:{type:Boolean}},emits:["update:open"],setup(e,{emit:t}){const s=t,r=O(null),n=()=>{var a;r.value&&!r.value.canClose()||((a=r.value)==null||a.resetState(),s("update:open",!1))};return(a,v)=>{const w=L;return S(),A(o(ve),{open:a.open,"onUpdate:open":n},{default:l(()=>[i(o(we),{class:"sm:max-w-2xl flex flex-col"},{default:l(()=>[i(o(Be),null,{default:l(()=>[i(o(De),{class:"flex items-center gap-2"},{default:l(()=>[i(w,{name:"hugeicons:file-download",class:"size-4!"}),v[0]||(v[0]=W(" Restore Data "))]),_:1})]),_:1}),i(o(zt),{ref_key:"importPanelRef",ref:r,layout:"modal","success-action-label":"Close","success-action-mode":"emit",onSuccessAction:n},null,512)]),_:1})]),_:1},8,["open"])}}});var ue={exports:{}},Go=ue.exports,Re;function Qo(){return Re||(Re=1,function(e,t){(function(s,r){e.exports=r()})(Go,function(){return function(s,r,n){s=s||{};var a=r.prototype,v={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function w(d,c,E,p){return a.fromToBase(d,c,E,p)}n.en.relativeTime=v,a.fromToBase=function(d,c,E,p,g){for(var f,$,b,C=E.$locale().relativeTime||v,_=s.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],m=_.length,x=0;x<m;x+=1){var k=_[x];k.d&&(f=p?n(d).diff(E,k.d,!0):E.diff(d,k.d,!0));var T=(s.rounding||Math.round)(Math.abs(f));if(b=f>0,T<=k.r||!k.r){T<=1&&x>0&&(k=_[x-1]);var P=C[k.l];g&&(T=g(""+T)),$=typeof P=="string"?P.replace("%d",T):P(T,c,k.l,b);break}}if(c)return $;var q=b?C.future:C.past;return typeof q=="function"?q($):q.replace("%s",$)},a.to=function(d,c){return w(d,c,this,!0)},a.from=function(d,c){return w(d,c,this)};var u=function(d){return d.$u?n.utc():n()};a.toNow=function(d){return this.to(u(this),d)},a.fromNow=function(d){return this.from(u(this),d)}}})}(ue)),ue.exports}var Xo=Qo();const Zo=qt(Xo);function Jo(e){const{createConnection:t,openWorkspaceWithConnection:s}=Ie(),r=Ae(),n=Me(),{checkAndConfirm:a}=Ve(),v=O(!1),w=O(!1),u=O(!1),d=O(),c=O(!1),E=()=>{w.value=!1,r.deleteWorkspace(e.workspace.id)},p=oe(()=>n.getConnectionsByWorkspaceId(e.workspace.id));return{workspaceStore:r,isOpenEditModal:v,isOpenDeleteModal:w,isOpenConnectionSelector:u,dropdownTriggerRef:d,isModalCreateConnectionOpen:c,connections:p,onConfirmDelete:E,onOpenWorkspace:()=>{var C;(C=e.onSelectWorkspace)==null||C.call(e,e.workspace.id)},onOpenConnectionSelector:()=>{u.value=!0},onOpenWorkspaceWithConnection:async C=>{u.value=!1;const _=p.value.find(m=>m.id===C);_&&!await a(_)||await s({connId:C,wsId:e.workspace.id})},handleAddConnection:C=>{t(C)}}}const en=D({__name:"DeleteWorkspaceModal",props:{open:{},onConfirm:{type:Function}},emits:["update:open"],setup(e,{emit:t}){const s=t;return(r,n)=>{const a=F,v=we;return S(),A(o(ve),{open:!!r.open,"onUpdate:open":n[0]||(n[0]=w=>s("update:open",w))},{default:l(()=>[i(v,null,{default:l(()=>[i(o(Be),null,{default:l(()=>[i(o(De),null,{default:l(()=>n[1]||(n[1]=[W("Delete workspace")])),_:1}),i(o(Ut),null,{default:l(()=>n[2]||(n[2]=[W(" Are you sure you want to delete this workspace? "),I("br",null,null,-1),W(" All data will be permanently deleted this action cannot be undone. ")])),_:1})]),_:1}),i(o(Ze),null,{default:l(()=>[i(a,{type:"submit",onClick:r.onConfirm,variant:"default"},{default:l(()=>n[3]||(n[3]=[W(" Delete ")])),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1},8,["open"])}}}),tn={class:"flex items-center space-x-2"},on={class:"space-y-1"},nn={class:"text-sm line-clamp-2 break-words break-all text-left"},sn={class:"flex items-center pt-2"},rn={class:"text-xs text-muted-foreground"},an={class:"flex items-center pt-2"},ln={key:0,class:"text-xs text-muted-foreground"},cn={key:1,class:"text-xs text-muted-foreground"},dn={class:"flex items-center pt-2"},un={class:"text-xs text-muted-foreground"},pn={class:"flex items-center gap-1"},mn={class:"flex items-center gap-2 min-w-0"},fn={class:"truncate"},vn={key:0,class:"flex items-center gap-1 ml-auto flex-shrink-0"},wn={key:1,class:"ml-auto text-xs text-muted-foreground"},gn=D({__name:"WorkspaceCard",props:{workspace:{},onOpenWorkspace:{type:Function}},emits:["onSelectWorkspace"],setup(e,{emit:t}){Q.extend(Zo);const s=je(),r=We(),n=oe(()=>Je(r.public.sqlite3ConnectionsEnabled)),a=e,v=t,{workspaceStore:w,isOpenEditModal:u,isOpenDeleteModal:d,isOpenConnectionSelector:c,dropdownTriggerRef:E,isModalCreateConnectionOpen:p,connections:g,onConfirmDelete:f,onOpenWorkspace:$,onOpenConnectionSelector:b,onOpenWorkspaceWithConnection:C,handleAddConnection:_}=Jo({workspace:a.workspace,onSelectWorkspace:m=>v("onSelectWorkspace",m)});return(m,x)=>{const k=Ee,T=Se,P=ko,q=bo,Z=yo,J=_o,G=Gt,ee=Yt;return S(),B(Y,null,[o(p)?(S(),A(o(tt),{key:0,open:o(p),"editing-connection":null,"onUpdate:open":x[0]||(x[0]=M=>p.value=M),onAddNew:o(_),workspaceId:m.workspace.id},null,8,["open","onAddNew","workspaceId"])):V("",!0),o(u)?(S(),A(st,{key:1,open:o(u),"onUpdate:open":x[1]||(x[1]=M=>te(u)?u.value=M:null),workspace:m.workspace,workspaceSeq:o(w).workspaces.length},null,8,["open","workspace","workspaceSeq"])):V("",!0),o(d)?(S(),A(en,{key:2,open:o(d),"onUpdate:open":x[2]||(x[2]=M=>te(d)?d.value=M:null),onConfirm:o(f)},null,8,["open","onConfirm"])):V("",!0),i(o(go),{class:"gap-4 justify-between!"},{default:l(()=>[i(o(Po),{class:"flex justify-between px-4"},{default:l(()=>[I("div",tn,[i(T,null,{default:l(()=>[i(k,null,{default:l(()=>[i(o(L),{name:m.workspace.icon,class:"size-5!"},null,8,["name"])]),_:1})]),_:1}),I("div",null,[i(o(Oo),{class:"line-clamp-1"},{default:l(()=>[W(U(m.workspace.name),1)]),_:1})])]),i(J,null,{default:l(()=>[i(P,null,{default:l(()=>[i(o(F),{size:"icon",variant:"ghost"},{default:l(()=>[i(o(L),{name:"hugeicons:more-vertical-circle-01",class:"size-4!"})]),_:1})]),_:1}),i(Z,null,{default:l(()=>[i(q,{class:"cursor-pointer flex items-center",onClick:x[3]||(x[3]=M=>u.value=!0)},{default:l(()=>[i(o(L),{name:"hugeicons:pencil-edit-02",class:"size-4! min-w-4"}),x[9]||(x[9]=W(" Edit workspace "))]),_:1}),i(q,{class:"cursor-pointer flex items-center",disabled:""},{default:l(()=>[i(o(L),{name:"hugeicons:link-04",class:"size-4! min-w-4"}),x[10]||(x[10]=W(" Invite "))]),_:1}),i(q,{class:"cursor-pointer flex items-center",onClick:x[4]||(x[4]=M=>d.value=!0)},{default:l(()=>[i(o(L),{name:"hugeicons:delete-02",class:"size-4! min-w-4"}),x[11]||(x[11]=W(" Delete workspace "))]),_:1})]),_:1})]),_:1})]),_:1}),i(o(wo),{class:"grid gap-4 overflow-hidden px-4"},{default:l(()=>[I("div",on,[I("p",nn,U(m.workspace.desc),1),I("div",sn,[i(o(L),{name:"hugeicons:connect",class:"mr-2 h-4 w-4 opacity-70"}),I("span",rn," Connection : "+U(o(g).length),1)]),I("div",an,[i(o(L),{name:"hugeicons:clock-05",class:"mr-2 h-4 w-4 opacity-70"}),m.workspace.lastOpened?(S(),B("span",ln," Last opened : "+U(o(Q)(m.workspace.lastOpened).fromNow()),1)):(S(),B("span",cn," Last opened : -/- "))]),I("div",dn,[i(o(L),{name:"hugeicons:clock-01",class:"mr-2 h-4 w-4 opacity-70"}),I("span",un," Created : "+U(o(Q)(m.workspace.createdAt).fromNow()),1)])])]),_:1}),i(o(No),{class:"px-4"},{default:l(()=>[i(o(jt),{open:o(c),"onUpdate:open":x[8]||(x[8]=M=>te(c)?c.value=M:null)},{default:l(()=>[i(o(F),{id:`tour-open-workspace-${m.workspace.id}`,ref_key:"dropdownTriggerRef",ref:E,variant:"default",class:"w-full flex items-center justify-between",onClick:x[6]||(x[6]=M=>o($)()),size:"sm"},{default:l(()=>[I("div",pn,[i(o(L),{name:"hugeicons:square-arrow-up-right",class:"h-4 w-4"}),x[12]||(x[12]=W(" Open workspace "))]),i(o(F),{size:"iconSm",variant:"ghost",onClick:x[5]||(x[5]=Vt(M=>o(b)(),["stop"]))},{default:l(()=>[i(o(L),{name:"hugeicons:arrow-down-01",class:"size-5!"})]),_:1})]),_:1},8,["id"]),i(o(Kt),{reference:o(E)},{default:l(()=>[i(ee,null,{default:l(()=>[I("div",{class:"flex px-2 py-0.5 h-8 hover:bg-muted rounded-md font-normal text-sm items-center gap-1 cursor-pointer",onClick:x[7]||(x[7]=M=>p.value=!0)},[i(o(L),{name:"hugeicons:plus-sign"}),x[13]||(x[13]=W(" Add new connection "))]),o(g).length?(S(),A(G,{key:0})):V("",!0),(S(!0),B(Y,null,ne(o(g),M=>(S(),A(o(Qt),{class:"cursor-pointer",value:M.id,key:M.id,disabled:o(se)(M,o(n)),onSelect:K=>o(C)(M.id)},{default:l(()=>{var K;return[I("div",mn,[(S(),A(Ye((K=o(et)(M.type))==null?void 0:K.icon),{class:"size-4! shrink-0"})),I("span",fn,U(M.name),1),(M.tagIds??[]).length?(S(),B("div",vn,[(S(!0),B(Y,null,ne(o(s).getTagsByIds(M.tagIds??[]),ie=>(S(),A(o(Ge),{key:ie.id,tag:ie},null,8,["tag"]))),128))])):V("",!0),o(se)(M,o(n))?(S(),B("span",wn," Disabled ")):V("",!0)])]}),_:2},1032,["value","disabled","onSelect"]))),128))]),_:1})]),_:1},8,["reference"])]),_:1},8,["open"])]),_:1})]),_:1})],64)}}}),hn={class:"flex items-center justify-between mt-2"},_n={class:"container flex flex-col items-start gap-1 py-2"},kn={class:"text-3xl flex items-center gap-2 font-bold leading-tight tracking-tighter lg:leading-[1.1]"},yn={class:"flex items-center gap-2 shrink-0"},bn=D({__name:"WorkspaceHeader",props:{isShowButtonCreate:{type:Boolean},isShowButtonRestore:{type:Boolean}},emits:["create","restore"],setup(e,{emit:t}){const s=t;return(r,n)=>{const a=L;return S(),B("div",hn,[I("div",_n,[I("h1",kn,[n[2]||(n[2]=W(" Hello ")),i(a,{name:"hugeicons:waving-hand-01"})]),n[3]||(n[3]=I("p",{class:"max-w-2xl text-lg font-light text-foreground"}," Welcome to your workspaces ",-1))]),I("div",yn,[r.isShowButtonRestore?(S(),A(o(F),{key:0,type:"button",variant:"outline",size:"sm",onClick:n[0]||(n[0]=v=>s("restore"))},{default:l(()=>[i(a,{name:"lucide:upload"}),n[4]||(n[4]=W(" Restore Data "))]),_:1})):V("",!0),r.isShowButtonCreate?(S(),A(o(F),{key:1,id:"tour-new-workspace-btn",variant:"outline",size:"sm",onClick:n[1]||(n[1]=v=>s("create"))},{default:l(()=>[i(a,{name:"lucide:plus"}),n[5]||(n[5]=W(" New Workspace "))]),_:1})):V("",!0)])])}}});let Te={},rt;function xe(e={}){Te={animate:!0,allowClose:!0,overlayClickBehavior:"close",overlayOpacity:.7,smoothScroll:!1,disableActiveInteraction:!1,showProgress:!1,stagePadding:10,stageRadius:5,popoverOffset:10,showButtons:["next","previous","close"],disableButtons:[],overlayColor:"#000",...e}}function h(e){return e?Te[e]:Te}function Cn(e){rt=e}function H(){return rt}let me={};function ce(e,t){me[e]=t}function X(e){var t;(t=me[e])==null||t.call(me)}function xn(){me={}}function de(e,t,s,r){return(e/=r/2)<1?s/2*e*e+t:-s/2*(--e*(e-2)-1)+t}function it(e){const t='a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])';return e.flatMap(s=>{const r=s.matches(t),n=Array.from(s.querySelectorAll(t));return[...r?[s]:[],...n]}).filter(s=>getComputedStyle(s).pointerEvents!=="none"&&En(s))}function at(e){if(!e||Sn(e))return;const t=h("smoothScroll"),s=e.offsetHeight>window.innerHeight;e.scrollIntoView({behavior:!t||$n(e)?"auto":"smooth",inline:"center",block:s?"start":"center"})}function $n(e){if(!e||!e.parentElement)return;const t=e.parentElement;return t.scrollHeight>t.clientHeight}function Sn(e){const t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}function En(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}let fe={};function N(e,t){fe[e]=t}function y(e){return e?fe[e]:fe}function He(){fe={}}function Tn(e,t,s,r){let n=y("__activeStagePosition");const a=n||s.getBoundingClientRect(),v=r.getBoundingClientRect(),w=de(e,a.x,v.x-a.x,t),u=de(e,a.y,v.y-a.y,t),d=de(e,a.width,v.width-a.width,t),c=de(e,a.height,v.height-a.height,t);n={x:w,y:u,width:d,height:c},ct(n),N("__activeStagePosition",n)}function lt(e){if(!e)return;const t=e.getBoundingClientRect(),s={x:t.x,y:t.y,width:t.width,height:t.height};N("__activeStagePosition",s),ct(s)}function In(){const e=y("__activeStagePosition"),t=y("__overlaySvg");if(!e)return;if(!t){console.warn("No stage svg found.");return}const s=window.innerWidth,r=window.innerHeight;t.setAttribute("viewBox",`0 0 ${s} ${r}`)}function Wn(e){const t=Mn(e);document.body.appendChild(t),pt(t,s=>{s.target.tagName==="path"&&X("overlayClick")}),N("__overlaySvg",t)}function ct(e){const t=y("__overlaySvg");if(!t){Wn(e);return}const s=t.firstElementChild;if((s==null?void 0:s.tagName)!=="path")throw new Error("no path element found in stage svg");s.setAttribute("d",dt(e))}function Mn(e){const t=window.innerWidth,s=window.innerHeight,r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.classList.add("driver-overlay","driver-overlay-animated"),r.setAttribute("viewBox",`0 0 ${t} ${s}`),r.setAttribute("xmlSpace","preserve"),r.setAttribute("xmlnsXlink","http://www.w3.org/1999/xlink"),r.setAttribute("version","1.1"),r.setAttribute("preserveAspectRatio","xMinYMin slice"),r.style.fillRule="evenodd",r.style.clipRule="evenodd",r.style.strokeLinejoin="round",r.style.strokeMiterlimit="2",r.style.zIndex="10000",r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.width="100%",r.style.height="100%";const n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttribute("d",dt(e)),n.style.fill=h("overlayColor")||"rgb(0,0,0)",n.style.opacity=`${h("overlayOpacity")}`,n.style.pointerEvents="auto",n.style.cursor="auto",r.appendChild(n),r}function dt(e){const t=window.innerWidth,s=window.innerHeight,r=h("stagePadding")||0,n=h("stageRadius")||0,a=e.width+r*2,v=e.height+r*2,w=Math.min(n,a/2,v/2),u=Math.floor(Math.max(w,0)),d=e.x-r+u,c=e.y-r,E=a-u*2,p=v-u*2;return`M${t},0L0,0L0,${s}L${t},${s}L${t},0Z
2
2
  M${d},${c} h${E} a${u},${u} 0 0 1 ${u},${u} v${p} a${u},${u} 0 0 1 -${u},${u} h-${E} a${u},${u} 0 0 1 -${u},-${u} v-${p} a${u},${u} 0 0 1 ${u},-${u} z`}function An(){const e=y("__overlaySvg");e&&e.remove()}function Bn(){const e=document.getElementById("driver-dummy-element");if(e)return e;let t=document.createElement("div");return t.id="driver-dummy-element",t.style.width="0",t.style.height="0",t.style.pointerEvents="none",t.style.opacity="0",t.style.position="fixed",t.style.top="50%",t.style.left="50%",document.body.appendChild(t),t}function Fe(e){const{element:t}=e;let s=typeof t=="function"?t():typeof t=="string"?document.querySelector(t):t;s||(s=Bn()),Ln(s,e)}function Dn(){const e=y("__activeElement"),t=y("__activeStep");e&&(lt(e),In(),ft(e,t))}function Ln(e,t){var s;const r=Date.now(),n=y("__activeStep"),a=y("__activeElement")||e,v=!a||a===e,w=e.id==="driver-dummy-element",u=a.id==="driver-dummy-element",d=h("animate"),c=t.onHighlightStarted||h("onHighlightStarted"),E=(t==null?void 0:t.onHighlighted)||h("onHighlighted"),p=(n==null?void 0:n.onDeselected)||h("onDeselected"),g=h(),f=y();!v&&p&&p(u?void 0:a,n,{config:g,state:f,driver:H()}),c&&c(w?void 0:e,t,{config:g,state:f,driver:H()});const $=!v&&d;let b=!1;Hn(),N("previousStep",n),N("previousElement",a),N("activeStep",t),N("activeElement",e);const C=()=>{if(y("__transitionCallback")!==C)return;const _=Date.now()-r,m=400-_<=400/2;t.popover&&m&&!b&&$&&(ze(e,t),b=!0),h("animate")&&_<400?Tn(_,400,a,e):(lt(e),E&&E(w?void 0:e,t,{config:h(),state:y(),driver:H()}),N("__transitionCallback",void 0),N("__previousStep",n),N("__previousElement",a),N("__activeStep",t),N("__activeElement",e)),window.requestAnimationFrame(C)};N("__transitionCallback",C),window.requestAnimationFrame(C),at(e),!$&&t.popover&&ze(e,t),a.classList.remove("driver-active-element","driver-no-interaction"),a.removeAttribute("aria-haspopup"),a.removeAttribute("aria-expanded"),a.removeAttribute("aria-controls"),((s=t.disableActiveInteraction)!=null?s:h("disableActiveInteraction"))&&e.classList.add("driver-no-interaction"),e.classList.add("driver-active-element"),e.setAttribute("aria-haspopup","dialog"),e.setAttribute("aria-expanded","true"),e.setAttribute("aria-controls","driver-popover-content")}function Nn(){var e;(e=document.getElementById("driver-dummy-element"))==null||e.remove(),document.querySelectorAll(".driver-active-element").forEach(t=>{t.classList.remove("driver-active-element","driver-no-interaction"),t.removeAttribute("aria-haspopup"),t.removeAttribute("aria-expanded"),t.removeAttribute("aria-controls")})}function re(){const e=y("__resizeTimeout");e&&window.cancelAnimationFrame(e),N("__resizeTimeout",window.requestAnimationFrame(Dn))}function Pn(e){var t;if(!y("isInitialized")||!(e.key==="Tab"||e.keyCode===9))return;const s=y("__activeElement"),r=(t=y("popover"))==null?void 0:t.wrapper,n=it([...r?[r]:[],...s?[s]:[]]),a=n[0],v=n[n.length-1];if(e.preventDefault(),e.shiftKey){const w=n[n.indexOf(document.activeElement)-1]||v;w==null||w.focus()}else{const w=n[n.indexOf(document.activeElement)+1]||a;w==null||w.focus()}}function ut(e){var t;((t=h("allowKeyboardControl"))==null||t)&&(e.key==="Escape"?X("escapePress"):e.key==="ArrowRight"?X("arrowRightPress"):e.key==="ArrowLeft"&&X("arrowLeftPress"))}function pt(e,t,s){const r=(n,a)=>{const v=n.target;e.contains(v)&&((!s||s(v))&&(n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation()),a==null||a(n))};document.addEventListener("pointerdown",r,!0),document.addEventListener("mousedown",r,!0),document.addEventListener("pointerup",r,!0),document.addEventListener("mouseup",r,!0),document.addEventListener("click",n=>{r(n,t)},!0)}function On(){window.addEventListener("keyup",ut,!1),window.addEventListener("keydown",Pn,!1),window.addEventListener("resize",re),window.addEventListener("scroll",re)}function Rn(){window.removeEventListener("keyup",ut),window.removeEventListener("resize",re),window.removeEventListener("scroll",re)}function Hn(){const e=y("popover");e&&(e.wrapper.style.display="none")}function ze(e,t){var s,r;let n=y("popover");n&&document.body.removeChild(n.wrapper),n=zn(),document.body.appendChild(n.wrapper);const{title:a,description:v,showButtons:w,disableButtons:u,showProgress:d,nextBtnText:c=h("nextBtnText")||"Next &rarr;",prevBtnText:E=h("prevBtnText")||"&larr; Previous",progressText:p=h("progressText")||"{current} of {total}"}=t.popover||{};n.nextButton.innerHTML=c,n.previousButton.innerHTML=E,n.progress.innerHTML=p,a?(n.title.innerHTML=a,n.title.style.display="block"):n.title.style.display="none",v?(n.description.innerHTML=v,n.description.style.display="block"):n.description.style.display="none";const g=w||h("showButtons"),f=d||h("showProgress")||!1,$=(g==null?void 0:g.includes("next"))||(g==null?void 0:g.includes("previous"))||f;n.closeButton.style.display=g.includes("close")?"block":"none",$?(n.footer.style.display="flex",n.progress.style.display=f?"block":"none",n.nextButton.style.display=g.includes("next")?"block":"none",n.previousButton.style.display=g.includes("previous")?"block":"none"):n.footer.style.display="none";const b=u||h("disableButtons")||[];b!=null&&b.includes("next")&&(n.nextButton.disabled=!0,n.nextButton.classList.add("driver-popover-btn-disabled")),b!=null&&b.includes("previous")&&(n.previousButton.disabled=!0,n.previousButton.classList.add("driver-popover-btn-disabled")),b!=null&&b.includes("close")&&(n.closeButton.disabled=!0,n.closeButton.classList.add("driver-popover-btn-disabled"));const C=n.wrapper;C.style.display="block",C.style.left="",C.style.top="",C.style.bottom="",C.style.right="",C.id="driver-popover-content",C.setAttribute("role","dialog"),C.setAttribute("aria-labelledby","driver-popover-title"),C.setAttribute("aria-describedby","driver-popover-description");const _=n.arrow;_.className="driver-popover-arrow";const m=((s=t.popover)==null?void 0:s.popoverClass)||h("popoverClass")||"";C.className=`driver-popover ${m}`.trim(),pt(n.wrapper,P=>{var q,Z,J;const G=P.target,ee=((q=t.popover)==null?void 0:q.onNextClick)||h("onNextClick"),M=((Z=t.popover)==null?void 0:Z.onPrevClick)||h("onPrevClick"),K=((J=t.popover)==null?void 0:J.onCloseClick)||h("onCloseClick");if(G.closest(".driver-popover-next-btn"))return ee?ee(e,t,{config:h(),state:y(),driver:H()}):X("nextClick");if(G.closest(".driver-popover-prev-btn"))return M?M(e,t,{config:h(),state:y(),driver:H()}):X("prevClick");if(G.closest(".driver-popover-close-btn"))return K?K(e,t,{config:h(),state:y(),driver:H()}):X("closeClick")},P=>!(n!=null&&n.description.contains(P))&&!(n!=null&&n.title.contains(P))&&typeof P.className=="string"&&P.className.includes("driver-popover")),N("popover",n);const x=((r=t.popover)==null?void 0:r.onPopoverRender)||h("onPopoverRender");x&&x(n,{config:h(),state:y(),driver:H()}),ft(e,t),at(C);const k=e.classList.contains("driver-dummy-element"),T=it([C,...k?[]:[e]]);T.length>0&&T[0].focus()}function mt(){const e=y("popover");if(!(e!=null&&e.wrapper))return;const t=e.wrapper.getBoundingClientRect(),s=h("stagePadding")||0,r=h("popoverOffset")||0;return{width:t.width+s+r,height:t.height+s+r,realWidth:t.width,realHeight:t.height}}function qe(e,t){const{elementDimensions:s,popoverDimensions:r,popoverPadding:n,popoverArrowDimensions:a}=t;return e==="start"?Math.max(Math.min(s.top-n,window.innerHeight-r.realHeight-a.width),a.width):e==="end"?Math.max(Math.min(s.top-(r==null?void 0:r.realHeight)+s.height+n,window.innerHeight-(r==null?void 0:r.realHeight)-a.width),a.width):e==="center"?Math.max(Math.min(s.top+s.height/2-(r==null?void 0:r.realHeight)/2,window.innerHeight-(r==null?void 0:r.realHeight)-a.width),a.width):0}function Ue(e,t){const{elementDimensions:s,popoverDimensions:r,popoverPadding:n,popoverArrowDimensions:a}=t;return e==="start"?Math.max(Math.min(s.left-n,window.innerWidth-r.realWidth-a.width),a.width):e==="end"?Math.max(Math.min(s.left-(r==null?void 0:r.realWidth)+s.width+n,window.innerWidth-(r==null?void 0:r.realWidth)-a.width),a.width):e==="center"?Math.max(Math.min(s.left+s.width/2-(r==null?void 0:r.realWidth)/2,window.innerWidth-(r==null?void 0:r.realWidth)-a.width),a.width):0}function ft(e,t){const s=y("popover");if(!s)return;const{align:r="start",side:n="left"}=(t==null?void 0:t.popover)||{},a=r,v=e.id==="driver-dummy-element"?"over":n,w=h("stagePadding")||0,u=mt(),d=s.arrow.getBoundingClientRect(),c=e.getBoundingClientRect(),E=c.top-u.height;let p=E>=0;const g=window.innerHeight-(c.bottom+u.height);let f=g>=0;const $=c.left-u.width;let b=$>=0;const C=window.innerWidth-(c.right+u.width);let _=C>=0;const m=!p&&!f&&!b&&!_;let x=v;if(v==="top"&&p?_=b=f=!1:v==="bottom"&&f?_=b=p=!1:v==="left"&&b?_=p=f=!1:v==="right"&&_&&(b=p=f=!1),v==="over"){const k=window.innerWidth/2-u.realWidth/2,T=window.innerHeight/2-u.realHeight/2;s.wrapper.style.left=`${k}px`,s.wrapper.style.right="auto",s.wrapper.style.top=`${T}px`,s.wrapper.style.bottom="auto"}else if(m){const k=window.innerWidth/2-(u==null?void 0:u.realWidth)/2,T=10;s.wrapper.style.left=`${k}px`,s.wrapper.style.right="auto",s.wrapper.style.bottom=`${T}px`,s.wrapper.style.top="auto"}else if(b){const k=Math.min($,window.innerWidth-(u==null?void 0:u.realWidth)-d.width),T=qe(a,{elementDimensions:c,popoverDimensions:u,popoverPadding:w,popoverArrowDimensions:d});s.wrapper.style.left=`${k}px`,s.wrapper.style.top=`${T}px`,s.wrapper.style.bottom="auto",s.wrapper.style.right="auto",x="left"}else if(_){const k=Math.min(C,window.innerWidth-(u==null?void 0:u.realWidth)-d.width),T=qe(a,{elementDimensions:c,popoverDimensions:u,popoverPadding:w,popoverArrowDimensions:d});s.wrapper.style.right=`${k}px`,s.wrapper.style.top=`${T}px`,s.wrapper.style.bottom="auto",s.wrapper.style.left="auto",x="right"}else if(p){const k=Math.min(E,window.innerHeight-u.realHeight-d.width);let T=Ue(a,{elementDimensions:c,popoverDimensions:u,popoverPadding:w,popoverArrowDimensions:d});s.wrapper.style.top=`${k}px`,s.wrapper.style.left=`${T}px`,s.wrapper.style.bottom="auto",s.wrapper.style.right="auto",x="top"}else if(f){const k=Math.min(g,window.innerHeight-(u==null?void 0:u.realHeight)-d.width);let T=Ue(a,{elementDimensions:c,popoverDimensions:u,popoverPadding:w,popoverArrowDimensions:d});s.wrapper.style.left=`${T}px`,s.wrapper.style.bottom=`${k}px`,s.wrapper.style.top="auto",s.wrapper.style.right="auto",x="bottom"}m?s.arrow.classList.add("driver-popover-arrow-none"):Fn(a,x,e)}function Fn(e,t,s){const r=y("popover");if(!r)return;const n=s.getBoundingClientRect(),a=mt(),v=r.arrow,w=a.width,u=window.innerWidth,d=n.width,c=n.left,E=a.height,p=window.innerHeight,g=n.top,f=n.height;v.className="driver-popover-arrow";let $=t,b=e;if(t==="top"?(c+d<=0?($="right",b="end"):c+d-w<=0&&($="top",b="start"),c>=u?($="left",b="end"):c+w>=u&&($="top",b="end")):t==="bottom"?(c+d<=0?($="right",b="start"):c+d-w<=0&&($="bottom",b="start"),c>=u?($="left",b="start"):c+w>=u&&($="bottom",b="end")):t==="left"?(g+f<=0?($="bottom",b="end"):g+f-E<=0&&($="left",b="start"),g>=p?($="top",b="end"):g+E>=p&&($="left",b="end")):t==="right"&&(g+f<=0?($="bottom",b="start"):g+f-E<=0&&($="right",b="start"),g>=p?($="top",b="start"):g+E>=p&&($="right",b="end")),!$)v.classList.add("driver-popover-arrow-none");else{v.classList.add(`driver-popover-arrow-side-${$}`),v.classList.add(`driver-popover-arrow-align-${b}`);const C=s.getBoundingClientRect(),_=v.getBoundingClientRect(),m=h("stagePadding")||0,x=C.left-m<window.innerWidth&&C.right+m>0&&C.top-m<window.innerHeight&&C.bottom+m>0;t==="bottom"&&x&&(_.x>C.x&&_.x+_.width<C.x+C.width?r.wrapper.style.transform="translateY(0)":(v.classList.remove(`driver-popover-arrow-align-${b}`),v.classList.add("driver-popover-arrow-none"),r.wrapper.style.transform=`translateY(-${m/2}px)`))}}function zn(){const e=document.createElement("div");e.classList.add("driver-popover");const t=document.createElement("div");t.classList.add("driver-popover-arrow");const s=document.createElement("header");s.id="driver-popover-title",s.classList.add("driver-popover-title"),s.style.display="none",s.innerText="Popover Title";const r=document.createElement("div");r.id="driver-popover-description",r.classList.add("driver-popover-description"),r.style.display="none",r.innerText="Popover description is here";const n=document.createElement("button");n.type="button",n.classList.add("driver-popover-close-btn"),n.setAttribute("aria-label","Close"),n.innerHTML="&times;";const a=document.createElement("footer");a.classList.add("driver-popover-footer");const v=document.createElement("span");v.classList.add("driver-popover-progress-text"),v.innerText="";const w=document.createElement("span");w.classList.add("driver-popover-navigation-btns");const u=document.createElement("button");u.type="button",u.classList.add("driver-popover-prev-btn"),u.innerHTML="&larr; Previous";const d=document.createElement("button");return d.type="button",d.classList.add("driver-popover-next-btn"),d.innerHTML="Next &rarr;",w.appendChild(u),w.appendChild(d),a.appendChild(v),a.appendChild(w),e.appendChild(n),e.appendChild(t),e.appendChild(s),e.appendChild(r),e.appendChild(a),{wrapper:e,arrow:t,title:s,description:r,footer:a,previousButton:u,nextButton:d,closeButton:n,footerButtons:w,progress:v}}function qn(){var e;const t=y("popover");t&&((e=t.wrapper.parentElement)==null||e.removeChild(t.wrapper))}function Un(e={}){xe(e);function t(){h("allowClose")&&c()}function s(){const p=h("overlayClickBehavior");if(h("allowClose")&&p==="close"){c();return}if(typeof p=="function"){const g=y("__activeStep"),f=y("__activeElement");p(f,g,{config:h(),state:y(),driver:H()});return}p==="nextStep"&&r()}function r(){const p=y("activeIndex"),g=h("steps")||[];if(typeof p>"u")return;const f=p+1;g[f]?d(f):c()}function n(){const p=y("activeIndex"),g=h("steps")||[];if(typeof p>"u")return;const f=p-1;g[f]?d(f):c()}function a(p){(h("steps")||[])[p]?d(p):c()}function v(){var p;if(y("__transitionCallback"))return;const g=y("activeIndex"),f=y("__activeStep"),$=y("__activeElement");if(typeof g>"u"||typeof f>"u"||typeof y("activeIndex")>"u")return;const b=((p=f.popover)==null?void 0:p.onPrevClick)||h("onPrevClick");if(b)return b($,f,{config:h(),state:y(),driver:H()});n()}function w(){var p;if(y("__transitionCallback"))return;const g=y("activeIndex"),f=y("__activeStep"),$=y("__activeElement");if(typeof g>"u"||typeof f>"u")return;const b=((p=f.popover)==null?void 0:p.onNextClick)||h("onNextClick");if(b)return b($,f,{config:h(),state:y(),driver:H()});r()}function u(){y("isInitialized")||(N("isInitialized",!0),document.body.classList.add("driver-active",h("animate")?"driver-fade":"driver-simple"),On(),ce("overlayClick",s),ce("escapePress",t),ce("arrowLeftPress",v),ce("arrowRightPress",w))}function d(p=0){var g,f,$,b,C,_,m,x;const k=h("steps");if(!k){console.error("No steps to drive through"),c();return}if(!k[p]){c();return}N("__activeOnDestroyed",document.activeElement),N("activeIndex",p);const T=k[p],P=k[p+1],q=k[p-1],Z=((g=T.popover)==null?void 0:g.doneBtnText)||h("doneBtnText")||"Done",J=h("allowClose"),G=typeof((f=T.popover)==null?void 0:f.showProgress)<"u"?($=T.popover)==null?void 0:$.showProgress:h("showProgress"),ee=(((b=T.popover)==null?void 0:b.progressText)||h("progressText")||"{{current}} of {{total}}").replace("{{current}}",`${p+1}`).replace("{{total}}",`${k.length}`),M=((C=T.popover)==null?void 0:C.showButtons)||h("showButtons"),K=["next","previous",...J?["close"]:[]].filter(gt=>!(M!=null&&M.length)||M.includes(gt)),ie=((_=T.popover)==null?void 0:_.onNextClick)||h("onNextClick"),vt=((m=T.popover)==null?void 0:m.onPrevClick)||h("onPrevClick"),wt=((x=T.popover)==null?void 0:x.onCloseClick)||h("onCloseClick");Fe({...T,popover:{showButtons:K,nextBtnText:P?void 0:Z,disableButtons:[...q?[]:["previous"]],showProgress:G,progressText:ee,onNextClick:ie||(()=>{P?d(p+1):c()}),onPrevClick:vt||(()=>{d(p-1)}),onCloseClick:wt||(()=>{c()}),...(T==null?void 0:T.popover)||{}}})}function c(p=!0){const g=y("__activeElement"),f=y("__activeStep"),$=y("__activeOnDestroyed"),b=h("onDestroyStarted");if(p&&b){const m=!g||(g==null?void 0:g.id)==="driver-dummy-element";b(m?void 0:g,f,{config:h(),state:y(),driver:H()});return}const C=(f==null?void 0:f.onDeselected)||h("onDeselected"),_=h("onDestroyed");if(document.body.classList.remove("driver-active","driver-fade","driver-simple"),Rn(),qn(),Nn(),An(),xn(),He(),g&&f){const m=g.id==="driver-dummy-element";C&&C(m?void 0:g,f,{config:h(),state:y(),driver:H()}),_&&_(m?void 0:g,f,{config:h(),state:y(),driver:H()})}$&&$.focus()}const E={isActive:()=>y("isInitialized")||!1,refresh:re,drive:(p=0)=>{u(),d(p)},setConfig:xe,setSteps:p=>{He(),xe({...h(),steps:p})},getConfig:h,getState:y,getActiveIndex:()=>y("activeIndex"),isFirstStep:()=>y("activeIndex")===0,isLastStep:()=>{const p=h("steps")||[],g=y("activeIndex");return g!==void 0&&g===p.length-1},getActiveStep:()=>y("activeStep"),getActiveElement:()=>y("activeElement"),getPreviousElement:()=>y("previousElement"),getPreviousStep:()=>y("previousStep"),moveNext:r,movePrevious:n,moveTo:a,hasNextStep:()=>{const p=h("steps")||[],g=y("activeIndex");return g!==void 0&&!!p[g+1]},hasPreviousStep:()=>{const p=h("steps")||[],g=y("activeIndex");return g!==void 0&&!!p[g-1]},highlight:p=>{u(),Fe({...p,popover:p.popover?{showButtons:[],showProgress:!1,progressText:"",...p.popover}:void 0})},destroy:()=>{c(!1)}};return Cn(E),E}function jn({isOpenCreateWSModal:e,isOpenSelectConnectionModal:t,workspaceId:s,workspaceStore:r,onSelectWorkspace:n}){const a=Xt(Zt.HAS_SEEN_TOUR,!1,Jt());return{startTour:()=>{a.value=!0;const w=document.getElementById("tour-new-workspace-btn")?"#tour-new-workspace-btn":"#tour-new-workspace-btn-empty",d=Un({popoverClass:"driver-theme-system",showProgress:!0,allowClose:!0,steps:[{popover:{title:"Welcome to OrcaQ!",description:"Let us take a quick tour to get you familiar with the app."}},{element:"#tour-workspace-area",popover:{title:"Workspaces",description:"This is where you manage your workspaces."}},{element:w,popover:{title:"Create Workspace",description:"Click here to create a new workspace.",onNextClick:()=>{e.value=!0,setTimeout(()=>d.moveNext(),500)}}},{element:"#tour-workspace-icon",popover:{title:"Workspace Icon",description:"Choose an icon to identify your workspace."}},{element:"#tour-workspace-name",popover:{title:"Workspace Name",description:"Enter a unique name for your workspace."}},{element:"#tour-workspace-desc",popover:{title:"Workspace Description",description:"Provide a brief description."}},{element:"#tour-workspace-create",popover:{title:"Save Workspace",description:"After filling out the form, click here to create it.",onNextClick:()=>{const c=Qe();r.createWorkspace({desc:"My first workspace created from tour",id:c,name:"My Tour Workspace",icon:pe,createdAt:Q().toISOString()}),e.value=!1,s.value=c,setTimeout(()=>{d.moveNext()},600)}}},{element:document.getElementById(`tour-open-workspace-${s.value}`)||"#tour-workspace-area",popover:{title:"New Workspace Card",description:'Your new workspace appears here. Click "Open workspace" to manage its connections.',onNextClick:()=>{const c=document.getElementById(`tour-open-workspace-${s.value}`);c?c.click():(n(s.value),t.value=!0),setTimeout(()=>{d.moveNext()},800)}}},{element:"#tour-add-connection-btn",popover:{title:"Add Connection",description:"Inside a workspace, you can manage and add database connections.",onNextClick:()=>{var c;(c=document.getElementById("tour-add-connection-btn"))==null||c.click(),setTimeout(()=>d.moveNext(),600)}}},{element:"#tour-database-type-cards",popover:{title:"Select Database",description:"First, choose the database engine you want to connect to."}},{element:"#tour-database-type-next",popover:{title:"Next Step",description:"Click Next after selecting your database engine.",onNextClick:()=>{const c=document.querySelector("#tour-database-type-cards > div");c?(c.click(),setTimeout(()=>{var E;(E=document.getElementById("tour-database-type-next"))==null||E.click(),setTimeout(()=>d.moveNext(),600)},100)):d.moveNext()}}},{element:"#tour-connection-method-tabs",popover:{title:"Connection Method",description:"You can choose between connection string or form based setup."}},{element:"#tour-connection-string-tab",popover:{title:"Connection String Method",description:"Click here to use the connection string option.",onNextClick:()=>{var c;(c=document.getElementById("tour-connection-string-tab"))==null||c.click(),setTimeout(()=>d.moveNext(),300)}}},{element:"#connection-string",popover:{title:"Enter URI",description:"Paste your database URI here for quick access."}},{element:"#tour-connection-form-tab",popover:{title:"Connection Form Method",description:"Or click here to manually enter host, port, username, and password.",onNextClick:()=>{var c;(c=document.getElementById("tour-connection-form-tab"))==null||c.click(),setTimeout(()=>d.moveNext(),300)}}},{element:"#tour-create-update-connection-btn",popover:{title:"Create Connection",description:"After filling out the connection details, click here to save it."}},{popover:{title:"Tour Completed!",description:"You are now ready to use OrcaQ! Happy querying.",onNextClick:()=>{d.destroy()}}}],onDestroyStarted:()=>{e.value=!1,t.value=!1,document.querySelectorAll('[role="dialog"]').forEach(E=>{const p=E.querySelector('button[aria-label="Close"]');p&&p.click()}),document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape"})),d.destroy()}});d.drive()}}}function Vn(){const e=Ae(),t=Me(),s=eo(""),r=O(""),n=to(s,oo),a=oe(()=>(e.workspaces||[]).filter(d=>d.name.toLowerCase().includes(n.value.toLowerCase()))),v=O(!1),w=O(!1);return{workspaceStore:e,connectionStore:t,search:s,workspaceId:r,mappedWorkspaces:a,isOpenSelectConnectionModal:v,isOpenCreateWSModal:w,onSelectWorkspace:d=>{v.value=!0,r.value=d}}}const Kn={id:"tour-workspace-area",class:"flex flex-col h-full overflow-y-auto p-4 pt-0 space-y-4 relative"},Yn={class:"flex items-center gap-2"},Gn={class:"relative flex-1"},Qn={key:0,class:"grid grid-cols-3 gap-4 overflow-y-auto"},Xn={class:"flex items-center gap-2"},Zn=["href"],Jn=D({__name:"Workspaces",setup(e){const{workspaceStore:t,connectionStore:s,search:r,workspaceId:n,mappedWorkspaces:a,isOpenSelectConnectionModal:v,isOpenCreateWSModal:w,onSelectWorkspace:u}=Vn(),{startTour:d}=jn({isOpenCreateWSModal:w,isOpenSelectConnectionModal:v,workspaceId:n,workspaceStore:t,onSelectWorkspace:u}),c=O(!1),p=We().public.ggFormLink;return(g,f)=>{const $=L,b=Xe,C=F,_=Ke;return S(),B(Y,null,[o(w)?(S(),A(st,{key:0,open:o(w),"onUpdate:open":f[0]||(f[0]=m=>te(w)?w.value=m:null),workspaceSeq:o(t).workspaces.length},null,8,["open","workspaceSeq"])):V("",!0),i(Yo,{open:c.value,"onUpdate:open":f[1]||(f[1]=m=>c.value=m)},null,8,["open"]),i(o(Uo),{open:o(v),"onUpdate:open":f[2]||(f[2]=m=>te(v)?v.value=m:null),connections:o(s).getConnectionsByWorkspaceId(o(n)),"workspace-id":o(n)},null,8,["open","connections","workspace-id"]),I("div",Kn,[i(bn,{onCreate:f[3]||(f[3]=m=>w.value=!0),onRestore:f[4]||(f[4]=m=>c.value=!0),"is-show-button-create":!!o(a).length,"is-show-button-restore":!!o(a).length},null,8,["is-show-button-create","is-show-button-restore"]),I("div",Yn,[I("div",Gn,[i($,{name:"hugeicons:search-01",class:"absolute left-2.5 -translate-y-1/2 top-1/2 size-4"}),i(b,{type:"text",modelValue:o(r),"onUpdate:modelValue":f[5]||(f[5]=m=>te(r)?r.value=m:null),placeholder:"Search workspaces...",class:"pl-10 w-full"},null,8,["modelValue"])])]),o(a).length?(S(),B("div",Qn,[(S(!0),B(Y,null,ne(o(a),m=>(S(),A(gn,{workspace:m,onOnSelectWorkspace:o(u)},null,8,["workspace","onOnSelectWorkspace"]))),256))])):(S(),A(_,{key:1,title:"No workspaces found",desc:"There is nothing here to show. Let's create your first workspace."},{default:l(()=>[I("div",Xn,[i(C,{id:"tour-new-workspace-btn-empty",variant:"default",size:"sm",onClick:f[6]||(f[6]=m=>w.value=!0)},{default:l(()=>[i($,{name:"hugeicons:plus-sign"}),f[8]||(f[8]=W(" New Workspace "))]),_:1}),i(C,{variant:"outline",size:"sm",onClick:f[7]||(f[7]=m=>c.value=!0)},{default:l(()=>[i($,{name:"lucide:upload"}),f[9]||(f[9]=W(" Restore Data "))]),_:1}),i(C,{variant:"secondary",size:"sm",onClick:o(d)},{default:l(()=>[i($,{name:"hugeicons:book-open-02"}),f[10]||(f[10]=W(" Take a tour "))]),_:1},8,["onClick"])])]),_:1})),i(C,{class:"fixed bottom-0 right-4 z-10",variant:"secondary"},{default:l(()=>[I("a",{href:o(p),target:"_blank"},[i($,{name:"hugeicons:chat-feedback-01"}),f[11]||(f[11]=W(" Give me Feedback "))],8,Zn)]),_:1}),i(C,{class:"fixed bottom-16 right-4",variant:"secondary",onClick:o(d),title:"Start Tour"},{default:l(()=>[i($,{name:"hugeicons:book-open-02"}),f[12]||(f[12]=W(" Take a tour "))]),_:1},8,["onClick"])])],64)}}}),us=D({__name:"index",setup(e){return(t,s)=>(S(),A(o(Jn)))}});export{us as default};