1 line
19 KiB
JavaScript
1 line
19 KiB
JavaScript
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8887],{96224:function(e,a,t){var n=t(64836);a.Z=void 0;var s=n(t(64938)),i=t(85893),l=(0,s.default)([(0,i.jsx)("path",{d:"m16 7.58-5.5-2.4L5 7.58v3.6c0 3.5 2.33 6.74 5.5 7.74.25-.08.49-.2.73-.3-.15-.51-.23-1.06-.23-1.62 0-2.97 2.16-5.43 5-5.91V7.58z",opacity:".3"},"0"),(0,i.jsx)("path",{d:"M17 13c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 1.38c.62 0 1.12.51 1.12 1.12s-.51 1.12-1.12 1.12-1.12-.51-1.12-1.12.5-1.12 1.12-1.12zm0 5.37c-.93 0-1.74-.46-2.24-1.17.05-.72 1.51-1.08 2.24-1.08s2.19.36 2.24 1.08c-.5.71-1.31 1.17-2.24 1.17z",opacity:".3"},"1"),(0,i.jsx)("circle",{cx:"17",cy:"15.5",r:"1.12"},"2"),(0,i.jsx)("path",{d:"M18 11.09V6.27L10.5 3 3 6.27v4.91c0 4.54 3.2 8.79 7.5 9.82.55-.13 1.08-.32 1.6-.55C13.18 21.99 14.97 23 17 23c3.31 0 6-2.69 6-6 0-2.97-2.16-5.43-5-5.91zM11 17c0 .56.08 1.11.23 1.62-.24.11-.48.22-.73.3-3.17-1-5.5-4.24-5.5-7.74v-3.6l5.5-2.4 5.5 2.4v3.51c-2.84.48-5 2.94-5 5.91zm6 4c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4z"},"3"),(0,i.jsx)("path",{d:"M17 17.5c-.73 0-2.19.36-2.24 1.08.5.71 1.32 1.17 2.24 1.17s1.74-.46 2.24-1.17c-.05-.72-1.51-1.08-2.24-1.08z"},"4")],"AdminPanelSettingsTwoTone");a.Z=l},88518:function(e,a,t){var n=t(64836);a.Z=void 0;var s=n(t(64938)),i=t(85893),l=(0,s.default)([(0,i.jsx)("path",{d:"M22 15c0-1.66-1.34-3-3-3h-1.5v-.5C17.5 8.46 15.04 6 12 6c-.77 0-1.49.17-2.16.46L20.79 17.4c.73-.55 1.21-1.41 1.21-2.4zM2 14c0 2.21 1.79 4 4 4h9.73l-8-8H6c-2.21 0-4 1.79-4 4z",opacity:".3"},"0"),(0,i.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4c-1.33 0-2.57.36-3.65.97l1.49 1.49C10.51 6.17 11.23 6 12 6c3.04 0 5.5 2.46 5.5 5.5v.5H19c1.66 0 3 1.34 3 3 0 .99-.48 1.85-1.21 2.4l1.41 1.41c1.09-.92 1.8-2.27 1.8-3.81 0-2.64-2.05-4.78-4.65-4.96zM3 5.27l2.77 2.77h-.42C2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h11.73l2 2 1.41-1.41L4.41 3.86 3 5.27zM7.73 10l8 8H6c-2.21 0-4-1.79-4-4s1.79-4 4-4h1.73z"},"1")],"CloudOffTwoTone");a.Z=l},57150:function(e,a,t){t.d(a,{Z:function(){return n}});const n=(0,t(45711).Z)("BookText",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20",key:"t4utmx"}],["path",{d:"M8 7h6",key:"1f0q6e"}],["path",{d:"M8 11h8",key:"vwpz6n"}]])},33587:function(e,a,t){t.d(a,{Z:function(){return n}});const n=(0,t(45711).Z)("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]])},3848:function(e,a,t){t.d(a,{Z:function(){return n}});const n=(0,t(45711).Z)("FileKey2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v6",key:"rc0qvx"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"4",cy:"16",r:"2",key:"1ehqvc"}],["path",{d:"m10 10-4.5 4.5",key:"7fwrp6"}],["path",{d:"m9 11 1 1",key:"wa6s5q"}]])},4844:function(e,a,t){t.d(a,{Z:function(){return n}});const n=(0,t(45711).Z)("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},68599:function(e,a,t){t.d(a,{Z:function(){return n}});const n=(0,t(45711).Z)("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]])},78107:function(e,a,t){t.d(a,{Z:function(){return n}});const n=(0,t(45711).Z)("Images",[["path",{d:"M18 22H4a2 2 0 0 1-2-2V6",key:"pblm9e"}],["path",{d:"m22 13-1.296-1.296a2.41 2.41 0 0 0-3.408 0L11 18",key:"nf6bnh"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["rect",{width:"16",height:"16",x:"6",y:"2",rx:"2",key:"12espp"}]])},62888:function(e,a,t){t.d(a,{Z:function(){return n}});const n=(0,t(45711).Z)("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]])},49525:function(e,a,t){t.d(a,{Z:function(){return n}});const n=(0,t(45711).Z)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]])},41352:function(e,a,t){t.d(a,{Z:function(){return n}});const n=(0,t(45711).Z)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},43726:function(e,a,t){t.d(a,{Z:function(){return u}});var n=t(828),s=t(85893),i=t(67294),l=t(95264),r=t(96706),c=(t(94105),t(25472),t(73121)),d=t(21933);function u(e){var a=i.useContext(r.AddDatabaseContext),t=a.user,u=a.dbImage,o=a.setDbImage,m=a.query;if(!t)return(0,s.jsx)(i.Fragment,{});var p=(0,n.Z)(i.useState(null),2),h=(p[0],p[1],(0,n.Z)(i.useState(!1),2)),f=h[0],g=h[1];return(0,s.jsx)("section",{className:"card",children:(0,s.jsxs)("div",{className:"w-full grid grid-cols-1 xl:grid-cols-2 gap-6 items-stretch",children:[f&&(0,s.jsx)(l.Z,{}),(0,s.jsxs)("div",{className:"flex-col items-start",children:[(0,s.jsx)("h2",{className:"text-xl m-0 text-left w-full",children:"New Database Information"}),t&&u&&o&&(0,s.jsx)(c.Z,{user:t,dbImage:u,setDbImage:o,setLoading:g,query:m})]}),t&&u&&o&&(0,s.jsx)(d.Z,{user:t,dbImage:u,setDbImage:o})]})})}},73121:function(e,a,t){t.d(a,{Z:function(){return g}});var n=t(47568),s=t(828),i=t(97582),l=t(85893),r=t(67294),c=t(94105),d=t(97037),u=(t(73935),t(86729)),o=t(81069);function m(){return(m=(0,n.Z)((function(e){var a,t,n,s,l,r,c,d,m,p,h,f,g,b;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return a=e.e,t=e.setLoading,n=e.dbImage,s=e.database,l=e.user,t(!0),f={db_description:(null===(r=a.target.database_description)||void 0===r||null===(c=r.value)||void 0===c?void 0:c.match(/./))?a.target.database_description.value:null,db_name:(null===(d=a.target.database_name)||void 0===d||null===(m=d.value)||void 0===m?void 0:m.match(/./))?a.target.database_name.value:null,db_slug:(null===(p=a.target.database_slug)||void 0===p||null===(h=p.value)||void 0===h?void 0:h.match(/./))?a.target.database_slug.value:null,db_full_name:s.db_full_name,id:s.id,active_clone:s.active_clone,active_clone_parent_db:s.active_clone_parent_db},n?"string"!==typeof n?[3,1]:(f.db_image=n,[3,3]):[3,4];case 1:return"object"!==typeof n?[3,3]:[4,(0,u.Z)("/api/addUserMedia",{method:"post",body:{media:[n],folder:f.db_slug.replace(/_/g,"-"),type:"image"}},!0)];case 2:b=i.sent(),f.db_image=(null===(g=null===b||void 0===b?void 0:b.mediaData[0])||void 0===g?void 0:g.media_thumbnail_url)?b.mediaData[0].media_thumbnail_url:"/images/database-placeholder.png",i.label=3;case 3:return[3,5];case 4:f.db_image="/images/database-placeholder.png",i.label=5;case 5:return(0,u.Z)("/api/updateUserDatabase",{method:"post",body:f},!0).then((function(e){e.success?(0,o.Z)().then((function(){window.location.pathname="/admin/".concat(null===l||void 0===l?void 0:l.id,"/databases"),setTimeout((function(){t(!1)}),1e3)})):(alert("Error! Please Try Again"),setTimeout((function(){t(!1)}),1e3))})),[2]}}))}))).apply(this,arguments)}function p(){return(p=(0,n.Z)((function(e){var a,t,n,s,l,r,c,d,m,p,h,f;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return a=e.e,t=e.setLoading,n=e.dbImage,s=e.keepUpdated,l=e.keepDataUpdated,r=e.query,c=e.user,t(!0),p={db_name:a.target.database_name.value,db_slug:a.target.database_slug.value,db_description:(null===(d=a.target.database_description)||void 0===d||null===(m=d.value)||void 0===m?void 0:m.match(/./))?a.target.database_description.value:null},n?"string"!==typeof n?[3,1]:(p.db_image=n,[3,3]):[3,3];case 1:return"object"!==typeof n?[3,3]:[4,(0,u.Z)("/api/addUserMedia",{method:"post",body:{media:[n],folder:p.db_slug.replace(/_/g,"-"),type:"image"}},!0)];case 2:f=i.sent(),p.db_image=(null===(h=null===f||void 0===f?void 0:f.mediaData[0])||void 0===h?void 0:h.media_thumbnail_url)?f.mediaData[0].media_thumbnail_url:"/images/database-placeholder.png",i.label=3;case 3:return(null===r||void 0===r?void 0:r.duplicate)&&(p.duplicate=r.duplicate,p.keepUpdated=s||!1,p.keepDataUpdated=l||!1),(0,u.Z)("/api/createUserDatabase",{method:"post",body:p},!0).then((function(e){e.success?(0,o.Z)().then((function(){window.location.pathname="/admin/".concat(null===c||void 0===c?void 0:c.id,"/databases/").concat(p.db_slug)})):setTimeout((function(){t(!1)}),1e3)})),[2]}}))}))).apply(this,arguments)}var h,f=t(49486);function g(e){var a=e.user,t=e.dbImage,u=(e.setDbImage,e.database),o=e.setLoading,g=e.query;function b(e){return v.apply(this,arguments)}function v(){return(v=(0,n.Z)((function(e){return(0,i.__generator)(this,(function(t){switch(t.label){case 0:return(null===u||void 0===u?void 0:u.db_slug)===e?[2,null]:[4,(0,c.Z)({tableName:"user_databases",columnName:"db_slug",value:e,userId:a.id})];case 1:return[2,t.sent()]}}))}))).apply(this,arguments)}var x=r.useState(null),y=(0,s.Z)(x,2),_=y[0],w=y[1],j=(0,s.Z)(r.useState(!1),2),Z=j[0],k=j[1],N=(0,s.Z)(r.useState(!1),2),D=N[0];N[1];return(0,l.jsxs)("form",{className:"w-full max-w-none xl:max-w-lg flex flex-col items-start gap-4 relative",onSubmit:function(e){e.preventDefault(),u?function(e){m.apply(this,arguments)}({e:e,setLoading:o,dbImage:t,database:u,user:a}):function(e){p.apply(this,arguments)}({e:e,setLoading:o,dbImage:t,keepUpdated:Z,keepDataUpdated:D,query:g,user:a})},children:[_&&(0,l.jsx)(d.Z,{message:_}),(0,l.jsxs)("div",{className:"flex flex-col items-start gap-0.5 w-full",children:[(0,l.jsx)("label",{htmlFor:"database_name",children:"Name"}),(0,l.jsx)("input",{type:"text",name:"database_name",id:"database_name",placeholder:"Database Name",onInput:function(){var e=(0,n.Z)((function(e){var a,t,n;return(0,i.__generator)(this,(function(s){return a=e.target,t=a.closest("form"),a.value.match(/./)?(a.classList.remove("warning"),w(null)):a.classList.add("warning"),t&&(t.database_slug.value=a.value.toLowerCase().replace(/ /g,"_").replace(/[^a-zA-Z0-9-_]/g,""),n=t.database_slug.value,window.clearTimeout(h),h=setTimeout((function(){b(n).then((function(e){(null===e||void 0===e?void 0:e.result)?(t.database_slug.classList.add("warning"),w("Duplicate Database Name")):(t.database_slug.classList.remove("warning"),w(null))}))}),300)),[2]}))}));return function(a){return e.apply(this,arguments)}}(),defaultValue:u?u.db_name:"",required:!0})]}),(0,l.jsxs)("div",{className:"flex flex-col items-start gap-0.5 w-full",children:[(0,l.jsx)("label",{htmlFor:"database_slug",children:"Slug"}),(0,l.jsx)("input",{type:"text",name:"database_slug",id:"database_slug",placeholder:"Database Slug",onInput:function(e){var a=e.target;a.value.match(/./)?(a.classList.remove("warning"),w(null)):a.classList.add("warning");var t=a.value;window.clearTimeout(h),h=setTimeout((function(){b(t).then((function(e){(null===e||void 0===e?void 0:e.result)?(a.classList.add("warning"),w("Duplicate Database Name")):(a.classList.remove("warning"),w(null))}))}),300)},defaultValue:u?u.db_slug:"",required:!0})]}),(0,l.jsxs)("div",{className:"flex flex-col items-start gap-0.5 w-full",children:[(0,l.jsx)("label",{htmlFor:"database_description",children:"Description (optional)"}),(0,l.jsx)("textarea",{name:"database_description",id:"database_description",placeholder:"Short Description of database",defaultValue:u?u.db_description:""})]}),(null===g||void 0===g?void 0:g.duplicate)&&(0,l.jsx)(r.Fragment,{children:(0,l.jsxs)("div",{className:"card col items-start",children:[(0,l.jsx)(f.Z,{checkBoxValues:[{payload:"Keep New Database Updated?",title:"Keep New Database Updated?",name:"clone_database",onChangeHandler:function(e){e.target.checked?k(!0):k(!1)}}]}),(0,l.jsx)("span",{className:"text-sm italic text-slate-600 dark:text-slate-300",children:"By checking this box the new Database stays up to date with changes to the structure of the parent Database"})]})}),(0,l.jsxs)("button",{type:"submit",className:"w-full",children:[u?"Update":"Create"," Database"]})]})}},21933:function(e,a,t){t.d(a,{Z:function(){return u}});var n=t(47568),s=t(97582),i=t(85893),l=t(67294),r=t(36718),c=t(25472),d=t(45449);function u(e){e.user;var a=e.dbImage,t=e.setDbImage,u=(e.database,l.useRef());return(0,i.jsxs)("div",{className:"card no-hover col items-center justify-center",children:[(0,i.jsx)("h4",{className:"m-0",children:"Database Image"}),(0,i.jsx)("div",{className:"bg-white rounded-full overflow-hidden w-24 h-24",children:(0,i.jsx)("img",{src:a?"string"===typeof a?a:a.imageBase64Full:"/images/database-placeholder.png",alt:"Database Image",width:100,className:"w-full h-full object-cover",ref:u,"data-imagepreview":"image"})}),(0,i.jsxs)("div",{className:"w-full flex-col",id:"edit-database-image-option-wrapper",children:[(0,i.jsxs)(d.Z,{column:!0,className:"w-full",children:[(0,i.jsx)("button",{className:"outlined w-full whitespace-normal",onClick:function(e){(0,c.Mw)("user-media-popup")},children:"Choose Image from uploads"}),(0,i.jsx)("button",{className:"outlined secondary w-full whitespace-normal",onClick:function(e){var a,t,n=e.target;null===(t=null===(a=null===n||void 0===n?void 0:n.closest("#edit-database-image-option-wrapper"))||void 0===a?void 0:a.querySelector("input"))||void 0===t||t.click()},children:"Choose Image from Computer"})]}),(0,i.jsx)("input",{type:"file",accept:".png,.jpg,.jpeg,.webp",placeholder:"Choose Database Image",className:"hidden",onChange:function(){var e=(0,n.Z)((function(e){var a,n;return(0,s.__generator)(this,(function(s){switch(s.label){case 0:return a=e.target.files[0],[4,(0,r.Z)({imageInputFile:a,maxWidth:400})];case 1:return n=s.sent(),t(n),[2]}}))}));return function(a){return e.apply(this,arguments)}}()})]})]})}},79310:function(e,a,t){t.d(a,{Z:function(){return d}});var n=t(828),s=t(85893),i=t(67294),l=t(86729),r=t(25472),c=t(95264);t(99967);function d(e){var a=e.setDbImage,t=(0,n.Z)(i.useState(!0),2),d=t[0],u=t[1],o=i.useState(null),m=(0,n.Z)(o,2),p=m[0],h=m[1];return i.useEffect((function(){(0,l.Z)("/api/getUserMedia").then((function(e){u(!1),h(e.media)}))}),[]),(0,s.jsxs)(r.ZP,{title:"user-media-popup",children:[d&&(0,s.jsx)(c.Z,{width:"20px"}),(0,s.jsx)("h4",{className:"m-0 text-lg",children:"Your Uploaded Images"}),(0,s.jsx)("div",{className:"grid grid-cols-2",children:p&&p[0]&&p.filter((function(e){return"image"==e.media_type})).map((function(e,t){return(0,s.jsx)("div",{className:"w-full h-44 cursor-pointer hover:opacity-70",onClick:function(t){a(e.media_thumbnail_url||null),(0,r.j4)()},children:(0,s.jsx)("img",{src:e.media_thumbnail_url,alt:"User Media",className:"w-full h-full object-contain"})},t+1)}))})]})}},49486:function(e,a,t){t.d(a,{Z:function(){return s}});var n=t(85893);t(67294);function s(e){var a=e.name,t=e.checkBoxValues,s=e.setAlert,i=e.labelColor,l=e.flexRow,r=e.baseText,c=e.smallText,d=e.className;return(0,n.jsx)("div",{className:"flex items-start gap-x-4"+(l?" flex-row flex-wrap gap-y-2 ":" flex-col gap-y-4 ")+(d||""),children:t.map((function(e,t){var l=e.payload,d=e.title,u=e.onChangeHandler,o=e.fixed,m=e.jsx,p=e.name?"".concat(a,"-").concat(e.name):l?a+"-"+l:a;return(0,n.jsxs)("div",{className:"flex items-center"+(e.default&&o?" pointer-events-none":"")+(c?" gap-1 ":" gap-2 ")+((null===e||void 0===e?void 0:e.className)?e.className:""),children:[(0,n.jsx)("input",{className:"m-0"+(c?" w-4 h-4":" w-5 h-5"),type:"checkbox",defaultChecked:!!e.default,name:p,id:p,onChange:function(a){s&&s(null),u&&u(a,e)},value:l,style:{minWidth:"20px"}}),m||(0,n.jsx)("label",{htmlFor:p,className:"m-0 "+(i||"text-slate-800 dark:text-white/80")+(r||c?" text-base":" text-lg"),children:d})]},t+1)}))})}},97037:function(e,a,t){t.d(a,{Z:function(){return s}});var n=t(85893);t(67294);function s(e){var a=e.message;return(0,n.jsxs)("div",{className:"p-2 bg-orange-50 w-full justify-center rounded text-sm text-orange-700 border border-orange-400 border-solid",children:[(0,n.jsx)("img",{src:"/images/warning.png",alt:"Warning Image Icon",width:22,className:"-my-2"}),(0,n.jsx)("span",{children:a})]})}},94105:function(e,a,t){t.d(a,{Z:function(){return l}});var n=t(47568),s=t(97582),i=(t(73935),t(86729));function l(e){return r.apply(this,arguments)}function r(){return(r=(0,n.Z)((function(e){var a,t,n,l,r,c;return(0,s.__generator)(this,(function(s){switch(s.label){case 0:return a=e.tableName,t=e.columnName,n=e.value,l=e.dbFullName,e.dispatch,r=e.userId,c=e.dbId,[4,(0,i.Z)("/api/checkDuplicateData?tableName=".concat(a,"&type=").concat(t,"&value=").concat(n).concat(l?"&dbFullName="+l:"").concat(r?"&userId="+r:"").concat(c?"&dbId="+c:""))];case 1:return[2,s.sent()]}}))}))).apply(this,arguments)}},36718:function(e,a,t){t.d(a,{Z:function(){return i}});var n=t(47568),s=t(97582);function i(e){return l.apply(this,arguments)}function l(){return(l=(0,n.Z)((function(e){var a,t,n,i,l,r,c,d,u,o,m,p,h;return(0,s.__generator)(this,(function(s){switch(s.label){case 0:return a=e.imageInputFile,t=e.maxWidth,n=document.querySelector("[data-imagepreview='image']"),i=a.name.replace(/\..*/,""),c=document.createElement("canvas"),d=a.type,u=.95,o=t||null,null,m=a,p=URL.createObjectURL(m),(h=new Image).src=p,[4,new Promise((function(e,a){h.onerror=function(){URL.revokeObjectURL(this.src),console.log("Cannot load image")},h.onload=function(){if(URL.revokeObjectURL(this.src),o){var a=o/h.naturalWidth;c.width=h.naturalWidth<o?h.naturalWidth:o,c.height=h.naturalWidth<o?h.naturalHeight:h.naturalHeight*a}else c.width=h.naturalWidth,c.height=h.naturalHeight;var t=c.getContext("2d");null===t||void 0===t||t.drawImage(h,0,0,c.width,c.height);var s=c.toDataURL(d,u);n&&document.querySelectorAll("[data-imagepreview='image']").forEach((function(e){e.src=s})),e(s)}}))];case 1:return l=s.sent(),[4,new Promise((function(e,a){c.toBlob((function(a){e(null===a||void 0===a?void 0:a.size)}),d,u)}))];case 2:return r=s.sent(),[2,{imageBase64:l.replace(/.*?base64,/,""),imageBase64Full:l,imageName:i,imageSize:r}]}}))}))).apply(this,arguments)}},96706:function(e,a,t){t.r(a),t.d(a,{AddDatabaseContext:function(){return h},__N_SSP:function(){return p},default:function(){return f}});var n=t(828),s=t(85893),i=t(67294),l=t(54858),r=t(61781),c=t(424),d=t(43726);function u(e){var a=i.useContext(h),t=a.query,n=a.duplicateDb,l=a.user,u=(null===t||void 0===t?void 0:t.duplicate)?(0,s.jsxs)("span",{children:["Duplicate"," ",(0,s.jsx)("a",{href:"/admin/".concat(null===l||void 0===l?void 0:l.id,"/databases/").concat(null===n||void 0===n?void 0:n.db_slug),target:"_blank",children:null===n||void 0===n?void 0:n.db_name})," ","Database"]}):"Add A New Database";return(0,s.jsxs)(i.Fragment,{children:[(0,s.jsxs)("div",{className:"flex-col items-start gap-0 w-full",children:[(0,s.jsxs)("div",{className:"flex-wrap",children:[(0,s.jsx)(r.Z,{}),(0,s.jsx)("h1",{className:"text-3xl m-0",children:u})]}),(0,s.jsx)(c.Z,{user:l})]}),(0,s.jsx)(d.Z,{})]})}var o=t(79310),m={},p=!0,h=i.createContext(m);function f(e){var a=e.user,t=e.databases,r=e.query,c=e.duplicateDb,d=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("title",{children:"Add Database | Datasquirel"}),(0,s.jsx)("meta",{name:"description",content:"Add a database"})]}),m=i.useState("/images/database-placeholder.png"),p=(0,n.Z)(m,2),f=p[0],g=p[1];return(0,s.jsx)(l.Z,{head:d,user:a,children:(0,s.jsxs)(h.Provider,{value:{user:a,databases:t,dbImage:f,setDbImage:g,query:r,duplicateDb:c},children:[(0,s.jsx)(u,{}),(0,s.jsx)(o.Z,{setDbImage:g})]})})}},29815:function(e,a,t){t.d(a,{Z:function(){return l}});var n=t(20943);var s=t(13375);var i=t(91566);function l(e){return function(e){if(Array.isArray(e))return(0,n.Z)(e)}(e)||(0,s.Z)(e)||(0,i.Z)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}}}]); |