"use strict";exports.id=9621,exports.ids=[9621],exports.modules={59621:(e,a,s)=>{s.a(e,async(e,l)=>{try{s.d(a,{A:()=>o,p:()=>u});vart=s(8732),i=s(82015),n=s.n(i),r=s(48241),c=s(86571),d=e([r]);functiono({database:e,tables:a,setTargetTable:s,confirmedDelegetedUser:l,query:i,user:d}){returnl?.delegated,l?.priviledges?.match(/Edit Tables/i),l?.priviledges?.match(/Delete Tables/i),l?.priviledges?.match(/Create Tables/i),(0,t.jsxs)(n().Fragment,{children:[e.active_clone&&d?(0,t.jsx)(c.A,{database:e,user:d}):(0,t.jsx)(t.Fragment,{}),e.remote_connected?(0,t.jsx)(u,{database:e}):(0,t.jsx)(t.Fragment,{}),(0,t.jsxs)("section",{className:"paper gray",children:[a&&a[0]?(0,t.jsxs)("div",{className:"flex-wrap gap-4 justify-between w-full",children:[(0,t.jsx)("h2",{className:"text-xl m-0",children:"Tables"}),(0,t.jsx)("a",{href:`/admin/${d?.id}/databases/${e.db_slug}/tables`,className:"button outlined gray small-text",children:"See All Tables"})]}):(0,t.jsx)("h2",{className:"text-xl m-0",children:"This Database is empty"}),(0,t.jsx)("hr",{}),d?(0,t.jsx)(r.A,{database:e,tables:a,setTargetTable:s,confirmedDelegetedUser:l,query:i,user:d}):null]})]})}functionu({database:e}){return(0,t.jsx)("div",{className:"info green",children:(0,t.jsxs)("span",{className:"text font-normal",children:["This database is an active clone of"," ",(0,t.jsx)("b",{children:e.remote_db_full_name?.replace(/datasquirel_user_\d+_/,"")})," ","on"," ",(0,t.jsx)("a",{className:"font-bold text-inherit",href:e.remote_connection_host,target:"_blank",children:e.remote_connection_host})," ","Host"]})})}r=(d.then?(awaitd)():d)[0],l()}catch(e){l(e)}})},6258:(e,a,s)=>{s.d(a,{A:()=>o});varl=s(8732),t=s(82015),i=s.n(t),n=s(63715),r=s(83147),c=s(32415),d=s(2459);functiono({database:e}){leta=i().useRef(),[s,t]=i().useState(!1);return(0,l.jsxs)(i().Fragment,{children:[(0,l.jsx)("input",{type:"file",name:"sql-file-input",id:"sql-file-input",accept:".sql",className:"hidden",ref:a}),(0,l.jsxs)("button",{className:"flex-col normal-weight outlined gray dashed w-full p-8 relative",onClick:s=>{a.current?.addEventListener("change",a=>{lets=a.target;if(!s.files?.[0]){window.alert("No FIles selected");return}r.A({inputFile:s.files[0]}).then(a=>{window.confirm(`Use this file '${a.fileName}' as your import file?`)&&(t(!0),n.A("/api/importDatabase",{method:"post",body:{database:e,fileBase64:a.fileBase64}},!0).then(e=>{e.success?window.location.reload():window.alert("Import Failed!"),setTimeout(()=>{t(!1)},1e3)}))})}),a.current?.click()},children:[s&&(0,l.jsx)(c.A,{}),(0,l.jsx)("span",{className:"text-slate-400",children:"Do you have an SQL file already?"}),(0,l.jsx)(d.A,{}),(0,l.jsx)("span",{className:"",children:"Import Database"})]})]})}},39615:(e,a,s)=>{s.d(a,{A:()=>o});varl=s(8732),t=s(82015),i=s.n(t),n=s(63715),r=s(83147),c=s(32415),d=s(38552);functiono({database:e}){leta=i().useRef(),[s,t]=i().useState(!1);return(0,l.jsxs)(i().Fragment,{children:[(0,l.jsx)("input",{type:"file",name:"json_file_input",id:"json_file_input",accept:".json",className:"hidden",ref:a}),(0,l.jsxs)("button",{className:"flex-col normal-weight outlined gray dashed w-full p-8 relative",onClick:s=>{a.current?.addEventListener("change",a=>{lets=a.target;if(!s.files?.[0]){window.alert("No FIles selected");return}r.A({inputFile:s.files[0]}).then(a=>{window.confirm(`Use this file '${a.fileName}' as your import file?`)&&(t(!0),n.A("/api/importDatabaseSchema",{method:"post",body:{database:e,fileBase64:a.fileBase64}},!0).then(e=>{e.success?window.location.reload():window.alert("Import Failed!"),setTimeout(()=>{t(!1)},1e3)}))})}),a.current?.click()},children:[s&&(0,l.jsx)(c.A,{}),(0,l.jsx)("span",{className:"text-slate-400",children:"Do you have a JSON schema?"}),(0,l.jsx)(d.A,{}),(0,l.jsx)("span",{className:"",children:"Import JSON schema"})]})]})}},15510:(e,a,s)=>{s.a(e,async(e,l)=>{try{s.d(a,{A:()=>h});vart=s(8732),i=s(82015),n=s.n(i),r=s(94010),c=s(55158),d=s(62506),o=s(93213),u=s(6070),m=e([r]);functionh({table:e,setTargetTable:a,database:s,confirmedDelegetedUser:l,query:i,icons:m,user:h}){letp=l?.delegate