"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[324],{30324:function(e,s,a){a.d(s,{Z:function(){return _}});var t=a(52322),r=a(2784),n=a(3068),l=a(88124),i=a(7512),d=a(66055),c=a(24436),o=a(12524),m=a.n(o),u=a(39097),x=a.n(u),f=a(5042),h=a(28795);let p=async()=>{let e=await fetch("/api/payments/count",{credentials:"include",method:"GET",headers:{"Content-Type":"application/json"}});return(await e.json()).count};var j=a(45569),g=a(46560),v=a(9631),N=a(73154),y=a(5632),w=a.n(y);function b(){let{user:e,logOut:s,isLoggedIn:a}=(0,f.kP)(),r=(null==e?void 0:e.name)||"Guest";return(0,t.jsx)(t.Fragment,{children:a&&(0,t.jsxs)(g.J2,{children:[(0,t.jsx)(g.xo,{children:(0,t.jsxs)(j.qE,{className:"w-8 h-8",children:[(0,t.jsx)(j.F$,{src:null==e?void 0:e.image,alt:r}),(0,t.jsx)(j.Q5,{children:r.charAt(0)})]})}),(0,t.jsxs)(g.yk,{align:"end",className:"flex flex-col gap-y-2",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center justify-start p-4",children:[(0,t.jsxs)(j.qE,{className:"w-12 h-12 mb-4",children:[(0,t.jsx)(j.F$,{src:null==e?void 0:e.image,alt:r}),(0,t.jsx)(j.Q5,{children:r.charAt(0)})]}),r]}),(0,t.jsxs)(h.z,{variant:"secondary",size:"sm",className:"w-full !justify-start !text-left cursor-pointer",onClick:()=>w().push("/settings"),children:[(0,t.jsx)(v.Z,{size:16,className:"mr-2"})," Account Settings"]}),(0,t.jsxs)(h.z,{variant:"secondary",size:"sm",className:"w-full !justify-start !text-left cursor-pointer",onClick:()=>s(),children:[(0,t.jsx)(N.Z,{size:16,className:"mr-2"})," Log Out"]})]})]})})}var k=a(84130),z=a(8364),C=a(11727);let R=[{name:"Photo Packs",href:"/packs/browse"},{name:"Reviews",href:"/examples-and-reviews"},{name:"Pricing",href:"/pricing"},{name:"Referral Program",href:"/refer"}];function _(e){let{className:s,width:a="default",hideNavigation:o=!1}=e,u=(0,y.useRouter)(),{isLoggedIn:j}=(0,f.kP)(),g=z.h.userCredits.get.useQuery({},{enabled:j}),[v,N]=r.useState(!1),[w,_]=r.useState(0),[Z,P]=r.useState(!0),F=r.useMemo(()=>{var e;return!Z&&!!(w>0||Number((null===(e=g.data)||void 0===e?void 0:e.modelCredits)||0)>0)},[Z,w,g.data]);return r.useEffect(()=>{j&&(async()=>{P(!0),_(await p()),P(!1)})()},[j]),(0,t.jsx)(n.p,{as:"nav",className:"bg-background inset-x-0 relative z-10 ".concat(s),children:e=>{let{open:s}=e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:m()("px-2 md:px-8 flex flex-col w-full m-auto gap-6",{"max-w-screen-2xl":"default"===a}),children:(0,t.jsxs)("div",{className:"relative flex h-16 items-center justify-between",children:[(0,t.jsx)("div",{className:"absolute inset-y-0 left-0 flex items-center lg:hidden",children:(0,t.jsxs)(n.p.Button,{className:"inline-flex items-center justify-center rounded-md p-2 hover:bg-primary/20 text-primary hover:text-primary focus:outline-none",children:[(0,t.jsx)("span",{className:"sr-only",children:"Open main menu"}),s?(0,t.jsx)(l.Z,{className:"block h-6 w-6","aria-hidden":"true"}):(0,t.jsx)(i.Z,{className:"block h-6 w-6","aria-hidden":"true"})]})}),(0,t.jsx)("div",{className:"  flex flex-1 lg:flex-initial w-fit items-center justify-center lg:items-stretch lg:justify-start",children:(0,t.jsx)("div",{className:"flex flex-shrink-0 items-center",children:(0,t.jsx)(x(),{href:"/",children:(0,t.jsx)(d.Z,{className:"hover:opacity-80"})})})}),!o&&(0,t.jsx)("div",{className:"hidden lg:flex lg:absolute w-fit  items-center justify-center left-0 right-0 m-auto lg:gap-x-4",children:R.map(e=>(0,t.jsx)(x(),{href:e.href,children:(0,t.jsx)(h.z,{variant:"ghost",size:"sm",children:e.name})},e.name))}),(0,t.jsxs)("div",{className:"  hidden absolute right-0 lg:flex items-center sm:static gap-x-2",children:[(0,t.jsx)(c.l,{className:"hidden px-3 md:flex ring-0 hover:bg-muted shadow-none"}),j?(0,t.jsx)(C.F,{open:v,onOpenChange:N,href:"/packs/review"}):null,j?F?(0,t.jsx)(x(),{href:"/dashboard",className:"text-sm font-semibold leading-6 text-primary",children:(0,t.jsx)(h.z,{variant:"ghost",size:"sm",children:"Dashboard"})}):(0,t.jsx)(x(),{href:"/pricing",className:"text-sm font-semibold leading-6 text-primary",children:(0,t.jsx)(h.z,{variant:"ghost",size:"sm",className:"min-w-[100px]",children:"Buy a pack"})}):(0,t.jsxs)(t.Fragment,{children:[" ",(0,t.jsx)(h.z,{variant:"outline",size:"sm",asChild:!0,children:(0,t.jsx)(x(),{href:{pathname:"/login",query:{source:"navbar_login",from:encodeURIComponent(u.asPath)}},children:"Log in"})}),(0,t.jsx)(h.z,{variant:"accent",size:"sm",asChild:!0,children:(0,t.jsx)(x(),{href:{pathname:"/login",query:{source:"navbar_signup",from:encodeURIComponent(u.asPath)}},children:"Sign up"})})]}),j&&(0,t.jsx)(b,{})]})]})}),(0,t.jsx)(n.p.Panel,{className:"lg:hidden",children:(0,t.jsxs)("div",{className:"bg-background space-y-1 px-2 pb-3 pt-2 dark:shadow-[rgba(0,_0,_0,_0.9)_0px_20px_40px_-7px] backdrop-filter backdrop-blur-xl ",children:[j?(0,t.jsx)(x(),{href:"/dashboard",children:(0,t.jsx)(n.p.Button,{className:"w-full justiy-start flex leading-6 text-primary rounded-md px-3 py-2 text-base font-medium hover:bg-muted hover:text-primary",children:"Dashboard"})}):(0,t.jsx)(x(),{href:{pathname:"/login",query:{source:"navbar_login",from:encodeURIComponent(u.asPath)}},children:(0,t.jsx)(n.p.Button,{className:"w-full justiy-start flex leading-6 text-primary rounded-md px-3 py-2 text-base font-medium hover:bg-muted hover:text-primary",children:"Log in"})}),!o&&R.map(e=>(0,t.jsx)(n.p.Button,{as:"a",href:e.href,className:m()("hover:bg-muted hover:text-primary","text-primary block rounded-md px-3 py-2 text-base font-medium"),children:e.name},e.name)),(0,t.jsx)("div",{className:"px-2",children:j?(0,t.jsx)(k.Z,{}):(0,t.jsxs)("div",{className:"w-full flex flex-col gap-y-4 my-6",children:[(0,t.jsx)(h.z,{variant:"accent",className:"w-full",asChild:!0,children:(0,t.jsx)(x(),{className:"w-full",href:{pathname:"/login",query:{source:"navbar_signup",from:encodeURIComponent(u.asPath)}},children:"Sign up"})}),(0,t.jsxs)("div",{className:"w-full flex flex-col mt-4",children:[(0,t.jsx)("div",{className:"m-auto text-xs text-muted-foreground",children:"Already have an account?"}),(0,t.jsx)(h.z,{variant:"link",className:"w-full text-accent",asChild:!0,children:(0,t.jsx)(x(),{href:{pathname:"/login",query:{source:"navbar_login",from:encodeURIComponent(u.asPath)}},children:"Log in"})})]})]})})]})})]})}})}},55286:function(e,s,a){a.d(s,{y:function(){return h}});var t=a(52322);a(2784);var r=a(96577),n=a.n(r),l=a(36168),i=a(28795),d=a(43738),c=a(4093),o=a(10929),m=a(51929),u=a(79732),x=a(49542);let f=(0,o.j)("flex w-full gap-4",{variants:{size:{default:"flex-row text-sm",sm:"flex-col text-xs items-center"}},defaultVariants:{size:"default"}});function h(e){let{title:s,mainImageSrc:a,model:r,modelAvatar:o,quantity:h,price:p,clothing:j,photoSize:g,isAdmin:v,onRemove:N,onQuantityChange:y,size:w="default",modelVersion:b}=e;return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(u.Zb,{className:"p-6 relative shadow-none border-[1px] border-border",children:(0,t.jsxs)("li",{className:(0,c.cn)(f({size:w})),children:[(0,t.jsx)("div",{className:(0,c.cn)("relative overflow-hidden flex-shrink-0 rounded-lg aspect-[4/5]",{"max-w-32 h-full ":"default"===w,"max-w-32 h-full":"sm"===w}),children:(0,t.jsx)(n(),{src:a?(0,l.m)(a,"default"===w?200:150):"/images/pack-covers/blank.jpg",className:"object-cover aspect-[4/5]",alt:s,width:400,height:500})}),(0,t.jsxs)("div",{className:(0,c.cn)("w-full flex-grow justify-between text-sm flex gap-3",{"flex-row":"default"===w,"flex-col":"sm"===w}),children:[(0,t.jsxs)("div",{className:"flex-grow flex flex-col justify-between",children:[(0,t.jsxs)("div",{className:"space-y-1 text-muted-foreground mb-3",children:[(0,t.jsx)("h3",{className:"text-foreground text-xl",children:s}),(0,t.jsxs)("div",{className:"text-muted-foreground",children:[40*h," photos @ $",(p*h).toFixed(2)]}),(0,t.jsxs)("div",{className:"space-x-1 text-muted-foreground",children:[(0,t.jsxs)("span",{children:["Clothing: ",j||"Random"]}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"•"}),(0,t.jsxs)("span",{children:["Aspect ratio: ",(null==g?void 0:g.aspectRatio)?g.aspectRatio:"1:1"]}),v&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"•"}),(0,t.jsxs)("span",{children:["Size:"," ",(null==g?void 0:g.size)?(0,t.jsxs)(t.Fragment,{children:[(0,x.at)(g.aspectRatio,g.size,b).width," x "]}):"",(null==g?void 0:g.size)?(0,x.at)(g.aspectRatio,g.size,b).height:""]})]})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(n(),{src:o,alt:r,width:28,height:28,className:"rounded-full"}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{className:"",children:"Photos for "}),(0,t.jsx)("div",{className:"flex items-center",children:(0,t.jsx)("span",{className:"text-blue-800 dark:text-blue-300",children:r})})]})]})]}),(0,t.jsxs)("div",{className:(0,c.cn)("flex flex-row sm:items-end mt-4 sm:mt-0 gap-4 sm:gap-2",{"flex-row":"sm"===w,"flex-col justify-end":"default"===w}),children:[(0,t.jsxs)("div",{className:"",children:[(0,t.jsx)("label",{htmlFor:"quantity",className:"sr-only",children:"Quantity"}),(0,t.jsxs)(d.Ph,{value:h.toString(),onValueChange:e=>null==y?void 0:y(parseInt(e,10)),children:[(0,t.jsx)(d.i4,{children:(0,t.jsx)(d.ki,{placeholder:"1"})}),(0,t.jsx)(d.Bw,{className:"",children:[1,2,3,4,5].map(e=>(0,t.jsxs)(d.Ql,{value:e.toString(),className:"",children:[(0,t.jsxs)("span",{children:[e," ",e>1?"packs":"pack"]})," ",(0,t.jsxs)("span",{className:"text-muted-foreground text-xs ml-1",children:["(",40*e," Photos)"]})]},e))})]})]}),(0,t.jsxs)(i.z,{variant:"ghost",className:"rounded-full text-muted-foreground absolute right-2 top-2",onClick:N,size:"icon","aria-label":"Remove item from cart",children:[(0,t.jsx)("span",{className:"sr-only",children:"Remove"}),(0,t.jsx)(m.Z,{size:16})]})]})]})]})})})}},11727:function(e,s,a){a.d(s,{F:function(){return h}});var t=a(52322),r=a(2784),n=a(96147),l=a(28795),i=a(35780),d=a(55286),c=a(39097),o=a.n(c),m=a(16099),u=a(66892),x=a(4352),f=a(56958);function h(e){let{open:s,onOpenChange:a,href:c,variant:h="icon",className:p}=e,{cart:j,totalItems:g,updateThemeQuantity:v,removeTheme:N}=(0,i.a)(),{themes:y,model:w}=j,b=(0,r.useRef)(g);return(0,r.useEffect)(()=>{g!==b.current&&(g>b.current?(0,f.Am)("Item added to cart",{position:"top-right",description:"Your item has been added to the cart.",action:{label:"View Cart",onClick:()=>a(!0)}}):g<b.current&&(0,f.Am)("Item removed from cart",{position:"top-right",description:"An item has been removed from your cart.",action:{label:"View Cart",onClick:()=>a(!0)}}),b.current=g)},[g,a]),(0,t.jsxs)(n.yo,{open:s,onOpenChange:a,children:[(0,t.jsx)(n.aM,{className:"w-full md:w-fit",children:"icon"===h?(0,t.jsxs)(l.z,{variant:"ghost",size:"icon",className:"relative",children:[(0,t.jsx)(x.Z,{size:"16"}),g>0&&(0,t.jsx)("span",{className:"absolute -top-1 -right-1 bg-accent text-accent-foreground rounded-full text-xs w-4 h-4 flex items-center justify-center",children:g})]}):(0,t.jsxs)(l.z,{size:"xl",variant:"outline",className:"relative border-foreground/10 hover:bg-foreground/10 ".concat(p),children:[(0,t.jsx)(x.Z,{size:"16",className:" mr-2"}),"Cart (",g,")"]})}),(0,t.jsx)(n.ue,{onOpenAutoFocus:e=>e.preventDefault(),children:(0,t.jsxs)("div",{className:"flex flex-col h-full",children:[(0,t.jsxs)(n.Tu,{children:[(0,t.jsx)(n.bC,{children:"Cart Details"}),(0,t.jsx)(n.Ei,{children:"Review the items in your cart."}),(0,t.jsx)(o(),{href:c,passHref:!0,className:"w-full",children:(0,t.jsx)(l.z,{className:"w-full",variant:"accent",children:"Proceed to Checkout"})})]}),(0,t.jsx)(u.x,{children:(0,t.jsx)("div",{className:"flex flex-col gap-2",children:null==y?void 0:y.map(e=>{var s,a,r,n;return(0,t.jsx)(d.y,{size:"sm",title:e.name,mainImageSrc:e.image||"/images/pack-covers/blank.jpg",clothing:(null===(s=e.selectedModifiers)||void 0===s?void 0:s.clothing)||"",price:m.wL[m.f9],isAdmin:!0,quantity:e.quantity||1,model:w?null===(a=w.trainingMeta)||void 0===a?void 0:a.readableName:"",modelAvatar:w?null===(n=w.trainingMeta)||void 0===n?void 0:null===(r=n.trainingImages)||void 0===r?void 0:r[0]:"",onQuantityChange:s=>{v(e.id,s)},onRemove:()=>{N(e.id)},modelVersion:null==w?void 0:w.version},e.id)})})})]})})]})}},79732:function(e,s,a){a.d(s,{Ol:function(){return i},SZ:function(){return c},Zb:function(){return l},aY:function(){return o},eW:function(){return m},ll:function(){return d}});var t=a(52322),r=a(2784),n=a(4093);let l=r.forwardRef((e,s)=>{let{className:a,...r}=e;return(0,t.jsx)("div",{ref:s,className:(0,n.cn)("rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden",a),...r})});l.displayName="Card";let i=r.forwardRef((e,s)=>{let{className:a,...r}=e;return(0,t.jsx)("div",{ref:s,className:(0,n.cn)("flex flex-col space-y-1.5 p-6",a),...r})});i.displayName="CardHeader";let d=r.forwardRef((e,s)=>{let{className:a,...r}=e;return(0,t.jsx)("h3",{ref:s,className:(0,n.cn)("text-2xl font-semibold leading-none tracking-tight",a),...r})});d.displayName="CardTitle";let c=r.forwardRef((e,s)=>{let{className:a,...r}=e;return(0,t.jsx)("p",{ref:s,className:(0,n.cn)("text-sm text-muted-foreground",a),...r})});c.displayName="CardDescription";let o=r.forwardRef((e,s)=>{let{className:a,...r}=e;return(0,t.jsx)("div",{ref:s,className:(0,n.cn)("p-6 pt-0",a),...r})});o.displayName="CardContent";let m=r.forwardRef((e,s)=>{let{className:a,...r}=e;return(0,t.jsx)("div",{ref:s,className:(0,n.cn)("flex items-center p-6 pt-0",a),...r})});m.displayName="CardFooter"},43738:function(e,s,a){a.d(s,{Bw:function(){return h},Ph:function(){return o},Ql:function(){return p},i4:function(){return u},ki:function(){return m}});var t=a(52322),r=a(2784),n=a(21183),l=a(45576),i=a(20817),d=a(15159),c=a(4093);let o=n.fC;n.ZA;let m=n.B4,u=r.forwardRef((e,s)=>{let{className:a,children:r,...i}=e;return(0,t.jsxs)(n.xz,{ref:s,className:(0,c.cn)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",a),...i,children:[r,(0,t.jsx)(n.JO,{asChild:!0,children:(0,t.jsx)(l.Z,{className:"h-4 w-4 opacity-50"})})]})});u.displayName=n.xz.displayName;let x=r.forwardRef((e,s)=>{let{className:a,...r}=e;return(0,t.jsx)(n.u_,{ref:s,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",a),...r,children:(0,t.jsx)(i.Z,{className:"h-4 w-4"})})});x.displayName=n.u_.displayName;let f=r.forwardRef((e,s)=>{let{className:a,...r}=e;return(0,t.jsx)(n.$G,{ref:s,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",a),...r,children:(0,t.jsx)(l.Z,{className:"h-4 w-4"})})});f.displayName=n.$G.displayName;let h=r.forwardRef((e,s)=>{let{className:a,children:r,position:l="popper",...i}=e;return(0,t.jsx)(n.h_,{children:(0,t.jsxs)(n.VY,{ref:s,className:(0,c.cn)("w-[--radix-select-trigger-width] relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===l&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",a),position:l,...i,children:[(0,t.jsx)(x,{}),(0,t.jsx)(n.l_,{className:(0,c.cn)("p-1","popper"===l&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),(0,t.jsx)(f,{})]})})});h.displayName=n.VY.displayName,r.forwardRef((e,s)=>{let{className:a,...r}=e;return(0,t.jsx)(n.__,{ref:s,className:(0,c.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",a),...r})}).displayName=n.__.displayName;let p=r.forwardRef((e,s)=>{let{className:a,children:r,...l}=e;return(0,t.jsxs)(n.ck,{ref:s,className:(0,c.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 hover:bg-foreground/10",a),...l,children:[(0,t.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(n.wU,{children:(0,t.jsx)(d.Z,{className:"h-4 w-4"})})}),(0,t.jsx)(n.eT,{children:r})]})});p.displayName=n.ck.displayName,r.forwardRef((e,s)=>{let{className:a,...r}=e;return(0,t.jsx)(n.Z0,{ref:s,className:(0,c.cn)("-mx-1 my-1 h-px bg-muted",a),...r})}).displayName=n.Z0.displayName},36168:function(e,s,a){a.d(s,{m:function(){return t}});let t=(e,s)=>e.replace("public","width=".concat(s))}}]);
//# sourceMappingURL=324-675e1535684419ed.js.map