Nicholai 16cee69250 __Admin dashboard scaffolded with D1 database and R2 file uploads__
This commit implements the core admin dashboard functionality including NextAuth authentication, Cloudflare D1 database integration with complete schema, and Cloudflare R2 file upload system for portfolio images. Features include artist management, appointment scheduling, and data migration capabilities.
2025-09-17 16:08:34 -06:00

1 line
16 KiB
JavaScript

(()=>{var e={};e.id=8098,e.ids=[8098],e.modules={72934:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external.js")},54580:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external.js")},45869:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},20399:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},55315:e=>{"use strict";e.exports=require("path")},17360:e=>{"use strict";e.exports=require("url")},14201:(e,t,r)=>{"use strict";r.r(t),r.d(t,{GlobalError:()=>s.a,__next_app__:()=>p,originalPathname:()=>u,pages:()=>c,routeModule:()=>m,tree:()=>d}),r(54766),r(40656),r(40509),r(70546);var n=r(30170),a=r(45002),i=r(83876),s=r.n(i),o=r(66299),l={};for(let e in o)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(l[e]=()=>o[e]);r.d(t,l);let d=["",{children:["auth",{children:["signin",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(r.bind(r,54766)),"/home/Nicholai/Documents/Dev/united_v03/united-tattoo/united-tattoo/app/auth/signin/page.tsx"]}]},{}]},{metadata:{icon:[async e=>(await Promise.resolve().then(r.bind(r,57481))).default(e)],apple:[],openGraph:[],twitter:[],manifest:void 0}}]},{layout:[()=>Promise.resolve().then(r.bind(r,40656)),"/home/Nicholai/Documents/Dev/united_v03/united-tattoo/united-tattoo/app/layout.tsx"],error:[()=>Promise.resolve().then(r.bind(r,40509)),"/home/Nicholai/Documents/Dev/united_v03/united-tattoo/united-tattoo/app/error.tsx"],"not-found":[()=>Promise.resolve().then(r.bind(r,70546)),"/home/Nicholai/Documents/Dev/united_v03/united-tattoo/united-tattoo/app/not-found.tsx"],metadata:{icon:[async e=>(await Promise.resolve().then(r.bind(r,57481))).default(e)],apple:[],openGraph:[],twitter:[],manifest:void 0}}],c=["/home/Nicholai/Documents/Dev/united_v03/united-tattoo/united-tattoo/app/auth/signin/page.tsx"],u="/auth/signin/page",p={require:r,loadChunk:()=>Promise.resolve()},m=new n.AppPageRouteModule({definition:{kind:a.x.APP_PAGE,page:"/auth/signin/page",pathname:"/auth/signin",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:d}})},10232:(e,t,r)=>{Promise.resolve().then(r.bind(r,71572))},55437:(e,t,r)=>{Promise.resolve().then(r.bind(r,86544))},403:(e,t,r)=>{Promise.resolve().then(r.bind(r,54528))},15784:(e,t,r)=>{Promise.resolve().then(r.bind(r,37614))},36033:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,63642,23)),Promise.resolve().then(r.t.bind(r,87586,23)),Promise.resolve().then(r.t.bind(r,47838,23)),Promise.resolve().then(r.t.bind(r,58057,23)),Promise.resolve().then(r.t.bind(r,77741,23)),Promise.resolve().then(r.t.bind(r,13118,23))},71572:(e,t,r)=>{"use strict";r.d(t,{default:()=>x});var n=r(97247),a=r(19898),i=r(58797),s=r(41755),o=r(36634),l=r(28964);function d({children:e}){return n.jsx(n.Fragment,{children:e})}var c=r(57797),u=r(17818);let p=({...e})=>{let{theme:t="system"}=(0,c.F)();return n.jsx(u.x7,{theme:t,className:"toaster group",style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},...e})};var m=r(34178);function x({children:e}){(0,m.useSearchParams)();let[t]=(0,l.useState)(()=>new i.S({defaultOptions:{queries:{staleTime:6e4,retry:(e,t)=>!(t?.status>=400&&t?.status<500)&&e<3}}}));return n.jsx(a.SessionProvider,{children:(0,n.jsxs)(s.aH,{client:t,children:[n.jsx(l.Suspense,{fallback:n.jsx("div",{children:"Loading..."}),children:(0,n.jsxs)(d,{children:[e,n.jsx(p,{})]})}),n.jsx(o.t,{initialIsOpen:!1})]})})}r(4047)},86544:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>m});var n=r(97247),a=r(19898),i=r(28964),s=r(34178),o=r(58053),l=r(27757),d=r(70170),c=r(22394),u=r(2502),p=r(8749);function m(){let[e,t]=(0,i.useState)(!1),[r,m]=(0,i.useState)(null),x=(0,s.useSearchParams)(),f=(0,s.useRouter)(),v=x.get("error"),h=x.get("callbackUrl")||"/admin",g=async e=>{e.preventDefault(),t(!0),m(null);let r=new FormData(e.currentTarget),n=r.get("email"),i=r.get("password");try{let e=await (0,a.signIn)("credentials",{email:n,password:i,redirect:!1});e?.error?m("Invalid email or password. Please try again."):e?.ok&&(f.push(h),f.refresh())}catch(e){m("An error occurred during sign in. Please try again.")}finally{t(!1)}};return n.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 py-12 px-4 sm:px-6 lg:px-8",children:(0,n.jsxs)(l.Zb,{className:"w-full max-w-md",children:[(0,n.jsxs)(l.Ol,{className:"text-center",children:[n.jsx(l.ll,{className:"text-2xl font-bold",children:"Sign In"}),n.jsx(l.SZ,{children:"Access the United Tattoo Studio admin dashboard"})]}),(0,n.jsxs)(l.aY,{className:"space-y-6",children:[(r||v)&&n.jsx(u.bZ,{variant:"destructive",children:n.jsx(u.X,{children:r||("CredentialsSignin"===v?"Invalid email or password. Please try again.":"An error occurred during sign in. Please try again.")})}),(0,n.jsxs)("form",{onSubmit:g,className:"space-y-4",children:[(0,n.jsxs)("div",{className:"space-y-2",children:[n.jsx(c._,{htmlFor:"email",children:"Email"}),n.jsx(d.I,{id:"email",name:"email",type:"email",placeholder:"nicholai@biohazardvfx.com",required:!0,disabled:e})]}),(0,n.jsxs)("div",{className:"space-y-2",children:[n.jsx(c._,{htmlFor:"password",children:"Password"}),n.jsx(d.I,{id:"password",name:"password",type:"password",placeholder:"Enter your password",required:!0,disabled:e})]}),n.jsx(o.z,{type:"submit",className:"w-full",disabled:e,children:e?(0,n.jsxs)(n.Fragment,{children:[n.jsx(p.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Signing in..."]}):"Sign In"})]}),(0,n.jsxs)("div",{className:"text-center text-sm text-gray-500",children:[n.jsx("p",{children:"For development testing:"}),(0,n.jsxs)("p",{className:"text-xs mt-1",children:["Use any email/password combination.",n.jsx("br",{}),"Admin: nicholai@biohazardvfx.com"]})]})]})]})})}},54528:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>a});var n=r(97247);function a({error:e,reset:t}){return n.jsx("div",{className:"min-h-[50vh] flex items-center justify-center p-8",children:(0,n.jsxs)("div",{className:"text-center space-y-3",children:[n.jsx("h2",{className:"text-xl font-semibold",children:"Something went wrong"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:e?.message||"An unexpected error occurred."}),n.jsx("button",{onClick:()=>t(),className:"inline-flex items-center rounded-md border px-3 py-1.5 text-sm hover:bg-accent",children:"Try again"})]})})}r(28964)},37614:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>a});var n=r(97247);function a(){return n.jsx("div",{className:"min-h-[50vh] flex items-center justify-center p-8",children:(0,n.jsxs)("div",{className:"text-center space-y-3",children:[n.jsx("h2",{className:"text-xl font-semibold",children:"404 - Page Not Found"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"The page you are looking for does not exist or has been moved."}),n.jsx("a",{href:"/",className:"inline-flex items-center rounded-md border px-3 py-1.5 text-sm hover:bg-accent",children:"Go home"})]})})}},2502:(e,t,r)=>{"use strict";r.d(t,{Cd:()=>l,X:()=>d,bZ:()=>o});var n=r(97247);r(28964);var a=r(87972),i=r(25008);let s=(0,a.j)("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function o({className:e,variant:t,...r}){return n.jsx("div",{"data-slot":"alert",role:"alert",className:(0,i.cn)(s({variant:t}),e),...r})}function l({className:e,...t}){return n.jsx("div",{"data-slot":"alert-title",className:(0,i.cn)("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function d({className:e,...t}){return n.jsx("div",{"data-slot":"alert-description",className:(0,i.cn)("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}},58053:(e,t,r)=>{"use strict";r.d(t,{d:()=>o,z:()=>l});var n=r(97247);r(28964);var a=r(69008),i=r(87972),s=r(25008);let o=(0,i.j)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function l({className:e,variant:t,size:r,asChild:i=!1,...l}){let d=i?a.g7:"button";return n.jsx(d,{"data-slot":"button",className:(0,s.cn)(o({variant:t,size:r,className:e})),...l})}},27757:(e,t,r)=>{"use strict";r.d(t,{Ol:()=>s,SZ:()=>l,Zb:()=>i,aY:()=>d,eW:()=>c,ll:()=>o});var n=r(97247);r(28964);var a=r(25008);function i({className:e,...t}){return n.jsx("div",{"data-slot":"card",className:(0,a.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function s({className:e,...t}){return n.jsx("div",{"data-slot":"card-header",className:(0,a.cn)("@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",e),...t})}function o({className:e,...t}){return n.jsx("div",{"data-slot":"card-title",className:(0,a.cn)("leading-none font-semibold",e),...t})}function l({className:e,...t}){return n.jsx("div",{"data-slot":"card-description",className:(0,a.cn)("text-muted-foreground text-sm",e),...t})}function d({className:e,...t}){return n.jsx("div",{"data-slot":"card-content",className:(0,a.cn)("px-6",e),...t})}function c({className:e,...t}){return n.jsx("div",{"data-slot":"card-footer",className:(0,a.cn)("flex items-center px-6 [.border-t]:pt-6",e),...t})}},70170:(e,t,r)=>{"use strict";r.d(t,{I:()=>i});var n=r(97247);r(28964);var a=r(25008);function i({className:e,type:t,...r}){return n.jsx("input",{type:t,"data-slot":"input",className:(0,a.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...r})}},22394:(e,t,r)=>{"use strict";r.d(t,{_:()=>s});var n=r(97247);r(28964);var a=r(94056),i=r(25008);function s({className:e,...t}){return n.jsx(a.f,{"data-slot":"label",className:(0,i.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}},25008:(e,t,r)=>{"use strict";r.d(t,{cn:()=>i});var n=r(61929),a=r(35770);function i(...e){return(0,a.m6)((0,n.W)(e))}},8749:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});let n=(0,r(26323).Z)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},54766:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});let n=(0,r(45347).createProxy)(String.raw`/home/Nicholai/Documents/Dev/united_v03/united-tattoo/united-tattoo/app/auth/signin/page.tsx#default`)},40509:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});let n=(0,r(45347).createProxy)(String.raw`/home/Nicholai/Documents/Dev/united_v03/united-tattoo/united-tattoo/app/error.tsx#default`)},40656:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>p,dynamic:()=>u,metadata:()=>c});var n=r(72051),a=r(54233),i=r.n(a),s=r(73372),o=r.n(s);r(67272);var l=r(26269);let d=(0,r(45347).createProxy)(String.raw`/home/Nicholai/Documents/Dev/united_v03/united-tattoo/united-tattoo/app/ClientLayout.tsx#default`),c={title:"United Tattoo - Professional Tattoo Studio",description:"Book appointments with our talented artists and explore stunning tattoo portfolios at United Tattoo.",generator:"v0.app"},u="force-dynamic";function p({children:e}){return n.jsx("html",{lang:"en",className:`${i().variable} ${o().variable}`,children:n.jsx("body",{className:"font-sans antialiased",children:n.jsx(l.Suspense,{fallback:null,children:n.jsx(d,{children:e})})})})}},70546:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});let n=(0,r(45347).createProxy)(String.raw`/home/Nicholai/Documents/Dev/united_v03/united-tattoo/united-tattoo/app/not-found.tsx#default`)},54203:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ReflectAdapter",{enumerable:!0,get:function(){return r}});class r{static get(e,t,r){let n=Reflect.get(e,t,r);return"function"==typeof n?n.bind(e):n}static set(e,t,r,n){return Reflect.set(e,t,r,n)}static has(e,t){return Reflect.has(e,t)}static deleteProperty(e,t){return Reflect.deleteProperty(e,t)}}},57481:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>a});var n=r(54564);let a=e=>[{type:"image/x-icon",sizes:"16x16",url:(0,n.fillMetadataSegment)(".",e.params,"favicon.ico")+""}]},67272:()=>{},4047:()=>{},94056:(e,t,r)=>{"use strict";r.d(t,{f:()=>p});var n=r(28964);function a(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}r(46817);var i=r(97247),s=n.forwardRef((e,t)=>{let{children:r,...a}=e,s=n.Children.toArray(r),l=s.find(d);if(l){let e=l.props.children,r=s.map(t=>t!==l?t:n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null);return(0,i.jsx)(o,{...a,ref:t,children:n.isValidElement(e)?n.cloneElement(e,void 0,r):null})}return(0,i.jsx)(o,{...a,ref:t,children:r})});s.displayName="Slot";var o=n.forwardRef((e,t)=>{let{children:r,...i}=e;if(n.isValidElement(r)){let e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}(r);return n.cloneElement(r,{...function(e,t){let r={...t};for(let n in t){let a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...e)=>{i(...e),a(...e)}:a&&(r[n]=a):"style"===n?r[n]={...a,...i}:"className"===n&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}(i,r.props),ref:t?function(...e){return t=>{let r=!1,n=e.map(e=>{let n=a(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){let r=n[t];"function"==typeof r?r():a(e[t],null)}}}}(t,e):e})}return n.Children.count(r)>1?n.Children.only(null):null});o.displayName="SlotClone";var l=({children:e})=>(0,i.jsx)(i.Fragment,{children:e});function d(e){return n.isValidElement(e)&&e.type===l}var c=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{let r=n.forwardRef((e,r)=>{let{asChild:n,...a}=e,o=n?s:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,i.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),u=n.forwardRef((e,t)=>(0,i.jsx)(c.label,{...e,ref:t,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));u.displayName="Label";var p=u}};var t=require("../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),n=t.X(0,[9379,9234,7598],()=>r(14201));module.exports=n})();