2024-12-09 12:27:08 +00:00
|
|
|
"use strict";(()=>{var e={};e.id=8810,e.ids=[3220,8810],e.modules={30671:(e,t)=>{Object.defineProperty(t,"M",{enumerable:!0,get:function(){return function e(t,r){return r in t?t[r]:"then"in t&&"function"==typeof t.then?t.then(t=>e(t,r)):"function"==typeof t&&"default"===r?t:void 0}}})},90467:(e,t,r)=>{r.r(t),r.d(t,{config:()=>b,default:()=>y,getServerSideProps:()=>v,getStaticPaths:()=>D,getStaticProps:()=>x,reportWebVitals:()=>N,routeModule:()=>O,unstable_getServerProps:()=>R,unstable_getServerSideProps:()=>j,unstable_getStaticParams:()=>P,unstable_getStaticPaths:()=>A,unstable_getStaticProps:()=>L});var s={};r.r(s),r.d(s,{CreateAccountContext:()=>S,default:()=>h,getServerSideProps:()=>E});var a=r(63865),n=r(9455),i=r(30671),o=r(49407),l=r(89600),c=r(8732),u=r(82015),d=r.n(u),p=r(71457),_=r(87472),m=r(70045);function g(e){let{query:t,invitingUser:r}=d().useContext(S);return(0,c.jsxs)("section",{className:"flex-col items-center lg:items-center gap-20 p-0",children:[(0,c.jsx)("img",{src:"/images/grid.webp",alt:"Dotted image background",className:"absolute top-0 left-0 w-full h-full object-cover opacity-80 dark:opacity-10 z-0"}),(0,c.jsxs)("div",{className:"w-full lg:w-1/2 max-w-6xl gap-4 flex-col items-center px-4 py-10 bg-white dark:bg-slate-900 relative z-10",children:[r?.first_name&&(0,c.jsxs)("span",{className:"text-xs bg-emerald-100 rounded-full px-4 py-1 mb-4",children:["You have been invited by"," ",(0,c.jsxs)("b",{children:[r.first_name," ",r.last_name," (",r.email,")"]})," ","to manage an account. Please create an account to gain access."]}),(0,c.jsx)("h1",{className:"m-0 text-center text-2xl",children:"Create An Account"}),(0,c.jsx)(m.A,{query:t})]})]})}r(20048),r(26123),r(67216),r(63715);var f=r(55966);r(6505);let S=d().createContext({});function h(e){let t="Create Account | Datasquirel",r="Create a FREE account and start storing data.",s=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("title",{children:t}),(0,c.jsx)("meta",{name:"description",content:r}),(0,c.jsx)(_.A,{pageTitle:t,pageDescription:r,pagePathname:"/"})]}),[a,n]=d().useState(null);return e.query?.invite?(0,c.jsx)(f.A,{}):(0,c.jsx)(p.A,{head:s,children:(0,c.jsx)(S.Provider,{value:{user:a,query:e.query,invitingUser:e.invitingUser},children:(0,c.jsx)("main",{children:(0,c.jsx)(g,{})})})})}async function E({req:e,res:t,query:r}){return{redirect:{destination:"/login",permanent:!1}}}let y=(0,i.M)(s,"default"),x=(0,i.M)(s,"getStaticProps"),D=(0,i.M)(s,"getStaticPaths"),v=(0,i.M)(s,"getServerSideProps"),b=(0,i.M)(s,"config"),N=(0,i.M)(s,"reportWebVitals"),L=(0,i.M)(s,"unstable_getStaticProps"),A=(0,i.M)(s,"unstable_getStaticPaths"),P=(0,i.M)(s,"unstable_getStaticParams"),R=(0,i.M)(s,"unstable_getServerProps"),j=(0,i.M)(s,"unstable_getServerSideProps"),O=new a.PagesRouteModule({definition:{kind:n.A.PAGES,page:"/create-account",pathname:"/create-account",bundlePath:"",filename:""},components:{App:l.default,Document:o.default},userland:s})},55966:(e,t,r)=>{r.d(t,{A:()=>n});var s=r(8732);r(82015);var a=r(32415);function n(){return(0,s.jsx)("div",{className:"flex flex-col gap-4 items-center justify-center w-full h-screen p-6 bg-slate-100",children:(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center gap-4 px-6 py-20 bg-white rounded shadow-sm max-w-2xl w-full",children:[(0,s.jsx)("img",{src:"/images/logo-icon-alt-2.webp",alt:"Datasquirel Logo",width:60}),(0,s.jsx)("div",{className:"w-10 h-10 flex flex-col items-center justify-center",children:(0,s.jsx)(a.A,{width:"25px",position:"relative"})})]})})}},20048:(e,t,r)=>{r(81630);let s=r(67216),a=r(77463),n=r(29021),i=r(6505);async function o(e,t,r,o){let{keyCookieName:l,csrfCookieName:c}=i();if(!e.cookies?.[l]?.match(/./))return null;let u=a({encryptedString:e.cookies[l]});if(!u)return null;let d=JSON.parse(u);if(!d.csrf_k||r&&!e.headers["x-csrf-auth"]?.match(RegExp(`${d.csrf_k}`)))return null;let p=process.env.DSQL_USER_LOGIN_KEYS_PATH;if(!p)return console.log("DSQL_USER_LOGIN_KEYS_PATH env variable not found. Please set this variable."),null;if(r&&!n.existsSync(`${p}/${d.csrf_k}`))return null;if(0=
|
2024-12-09 09:39:09 +00:00
|
|
|
${l}`)}catch(e){console.log("Server Error Reporting Error:",e.message)}}},77463:(e,t,r)=>{let{scryptSync:s,createDecipheriv:a}=r(55511),{Buffer:n}=r(79428);e.exports=({encryptedString:e,encryptionKey:t,encryptionSalt:r})=>{if(!e?.match(/./))return console.log("Encrypted string is invalid"),e;let i=t||process.env.DSQL_ENCRYPTION_PASSWORD,o=r||process.env.DSQL_ENCRYPTION_SALT,l=process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24;if(!i?.match(/.{8,}/))return console.log("Decrption key is invalid"),e;if(!o?.match(/.{8,}/))return console.log("Decrption salt is invalid"),e;let c=a("aes-192-cbc",s(i,o,l),n.alloc(16,0));try{let t=c.update(e,"hex","utf8");return t+=c.final("utf8")}catch(t){return console.log("Error in decrypting =>",t.message),e}}},53219:(e,t,r)=>{let{scryptSync:s,createCipheriv:a}=r(55511),{Buffer:n}=r(79428);e.exports=({data:e,encryptionKey:t,encryptionSalt:r})=>{if(!e?.match(/./))return console.log("Encryption string is invalid"),e;let i=t||process.env.DSQL_ENCRYPTION_PASSWORD,o=r||process.env.DSQL_ENCRYPTION_SALT,l=process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24;if(!i?.match(/.{8,}/))return console.log("Encryption key is invalid"),e;if(!o?.match(/.{8,}/))return console.log("Encryption salt is invalid"),e;let c=a("aes-192-cbc",s(i,o,l),n.alloc(16,0));try{let t=c.update(e,"utf8","hex");return t+=c.final("hex")}catch(t){return console.log("Error in encrypting =>",t.message),e}}},67216:(e,t,r)=>{let s=r(9973),a=r(31976),n=s({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_USERNAME,password:process.env.DSQL_DB_PASSWORD,database:process.env.DSQL_DB_NAME,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4",ssl:a()}});async function i(...e){try{let t=await n.query(...e);return await n.end(),JSON.parse(JSON.stringify(t))}catch(e){return console.log("DB Error =>",e),{success:!1,error:e.message}}}e.exports=i},1231:(e,t,r)=>{let s=r(29021);r(33873);let a=r(9973),n=r(31976),i=a({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_READ_ONLY_USERNAME,password:process.env.DSQL_DB_READ_ONLY_PASSWORD,charset:"utf8mb4",ssl:n()}});e.exports=function({paradigm:e,database:t,queryString:r,queryValues:o}){try{return new Promise((l,c)=>{let u=!!e?.match(/full.access|^fa$/i);try{function d(e){i.end(),l(JSON.parse(JSON.stringify(e)))}function p(e){i.end(),l({error:e.message,queryStringGenerated:r,queryValuesGenerated:o,sql:e.sql})}i=u?a({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_FULL_ACCESS_USERNAME,password:process.env.DSQL_DB_FULL_ACCESS_PASSWORD,database:t,ssl:n()}}):a({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_READ_ONLY_USERNAME,password:process.env.DSQL_DB_READ_ONLY_PASSWORD,database:t,ssl:n()}}),o&&Array.isArray(o)&&o[0]?i.query(r,o).then(d).catch(p):i.query(r).then(d).catch(p)}catch(e){s.appendFileSync("./.tmp/dbErrorLogs.txt",e.message+"\n"+Date()+"\n\n\n","utf8"),l({error:e.message})}})}catch(e){return{success:!1,error:e.message}}}},88896:(e,t,r)=>{let s=r(9973),a=r(31976);async function n(...e){let t=s({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_USERNAME,password:process.env.DSQL_DB_PASSWORD,database:process.env.DSQL_DB_NAME,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4",ssl:a()},onConnect:()=>{console.log("Connection Successful!")},onConnectError:e=>{console.log("Connection Error",e.message)},onError:e=>{console.log("Client Error",e.message)}});console.log("Querying ...");try{let r=await t.query(...e);return await t.end(),JSON.parse(JSON.stringify(r))}catch(e){return console.log("DB Error =>",e.message),{success:!1,error:e.message}}}e.exports=n},31976:(e,t,r)=>{let s=r(29021);e.exports=function(){let e=process.env.DSQL_SSL_DIR;if(!e?.match(/./))return;let t=`${e}/ca-cert.pem`;if(!s.existsSync(t)){console.log(`${t} does not exist`);return}return{ca:s.readFileSync(`${e}/ca-cert.pem`)}}},49407:(e,t,r)=>{r.r(t),r.d(t,{default:()=>n});var s=r(8732);r(82015);var a=r(20883);function n(e){retur
|