1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4580],{33907:function(e,s,l){(window.__NEXT_P=window.__NEXT_P||[]).push(["/play/[playerName]/manage",function(){return l(70198)}])},70198:function(e,s,l){"use strict";l.r(s),l.d(s,{__N_SSG:function(){return F},default:function(){return A}});var a=l(97458),t=l(86635),n=l(78605),r=l(52983),i=l(51341),d=l(46178),c=l(56299),o=l.n(c),m=l(92216),u=l(25838),h=l(79417),x=l(57027),p=function(e){let{name:s,label:l,value:t,selected:n,onChange:i}=e,d=(0,r.useId)();return(0,a.jsxs)("div",{className:"relative flex",children:[(0,a.jsx)("input",{id:"tab-".concat(d),className:"peer sr-only",type:"radio",name:s,value:t,checked:n===t,onChange:()=>i(t)}),(0,a.jsx)("label",{htmlFor:"tab-".concat(d),className:" body-3 cursor-pointer px-3.5 pb-[14px] font-medium text-brand-grey-11 peer-checked:bg-main-gradient peer-checked:cursor-default peer-checked:bg-[size:100%_2px] peer-checked:bg-bottom peer-checked:bg-no-repeat peer-checked:text-white hover:text-white ",children:l})]})},f=l(88321),b=(0,t.u3)(function(){let{userImages:e,loadingUserImages:s,imageVisibilityFilter:l,loadingMoreImages:t,loadMoreImages:n,setImageVisibilityFilter:d,refreshUserImages:c,resetImages:b,resetPagination:g,deleteImage:v}=(0,i.U)(),[j,N]=(0,r.useState)(!1),[y,w]=(0,r.useState)(!1),C=(0,r.useRef)(null),E=(0,r.useRef)(null),_=()=>{t||n()},k=e=>{E.current=e,w(!0)},D=async()=>{if(E.current)try{await v(E.current),m.Am.success("Deleted")}catch(e){m.Am.error("Something went wrong"),console.error(e)}finally{w(!1)}},F=e=>{g().then(()=>d(e))};return(0,f.Z)(_,C),(0,r.useEffect)(()=>(d(void 0),c().then(()=>N(!0)),()=>{b(),N(!1)}),[]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"flex items-center pb-6 pt-7 md:pt-[90px]",children:(0,a.jsx)("h1",{className:"headline-5 grow font-semibold md:headline-4",children:"My Gallery"})}),(0,a.jsxs)("div",{className:"relative flex space-x-4 before:absolute before:bottom-0 before:h-[1px] before:w-full before:bg-brand-grey-16 md:space-x-10",children:[(0,a.jsx)(p,{name:"status-filter",label:"All",selected:l,onChange:F}),(0,a.jsx)(p,{name:"status-filter",label:"Public",value:"public",selected:l,onChange:F}),(0,a.jsx)(p,{name:"status-filter",label:"Private",value:"private",selected:l,onChange:F})]}),(0,a.jsx)("div",{className:"md:scrollbar-default mt-4",children:!j||s||(null==e?void 0:e.length)?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("ul",{className:"grid grid-cols-1 gap-5 sm:grid-cols-2 md:grid-cols-[repeat(auto-fill,306px)]",children:[s&&Array.from({length:9}).map((e,s)=>(0,a.jsx)(h.Z,{tiltEnabled:!1,animateOnScroll:!1,as:"li"},s)),j&&(null==e?void 0:e.map((e,s)=>(0,a.jsx)(x.Z,{image:e,isOwner:!0,onDelete:k},s))),t&&Array.from({length:9}).map((e,s)=>(0,a.jsx)(h.Z,{tiltEnabled:!1,as:"li"},s))]}),e&&(0,a.jsx)("div",{ref:C,className:"h-[1px]",children:(0,a.jsx)("span",{className:"sr-only",children:"Loading More Models"})})]}):(0,a.jsxs)("div",{className:"mt-20 flex flex-col items-center",children:[(0,a.jsx)(o(),{src:"/images/svg/empty-models.svg",width:"119",height:"131",alt:"","aria-hidden":"true",draggable:"false",priority:!0,unoptimized:!0}),(0,a.jsx)("span",{className:"body-3 mt-6 font-medium text-white",children:"It's empty in here!"}),(0,a.jsxs)("span",{className:"caption mt-2 text-brand-grey-1",children:["This user has no ",l," images yet"]})]})})]}),(0,a.jsx)(u.Z,{isOpen:y,hideCancelButton:!1,onConfirm:D,onClose:()=>w(!1),onCancel:()=>w(!1),confirmText:"Delete",title:"Delete Image",hideCloseIcon:!0,children:(0,a.jsx)("div",{className:"p-2 text-center md:max-w-xs",children:(0,a.jsx)("p",{children:"Are you sure you want to delete this image?"})})})]})}),g=l(84206),v=l.n(g),j=l(87608),N=l.n(j),y=l(73474),w=l.n(y),C=l(35645),E=l(72115);function _(e){var s,l,t,n,i,d;let{as:c="div",model:m}=e,{allowNsfw:u}=(0,E.Z)(),h=null==m?void 0:null===(s=m.Image)||void 0===s?void 0:null===(l=s[0])||void 0===l?void 0:null===(t=l.File)||void 0===t?void 0:t.url,x=(0,C.av)(null==m?void 0:null===(n=m.File)||void 0===n?void 0:n.Metadata).basemodel;return(0,r.createElement)(c,{className:"relative flex min-w-0 flex-col rounded-xl bg-brand-grey-6"},(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"flex p-3",children:[(0,a.jsx)("span",{className:N()("relative flex h-[148px] w-[116px] flex-shrink-0 overflow-hidden rounded-[10px] bg-brand-grey-1",{"after:absolute after:inset-0 after:rounded-[10px] after:backdrop-blur-[5px]":(null==m?void 0:m.nsfw)&&!u}),children:h&&(0,a.jsx)(o(),{src:"".concat(h,"&thumbnail"),width:"116",height:"148",className:"object-cover object-center",alt:"","aria-hidden":"true",draggable:!1,unoptimized:!0,onError:e=>{e.target.remove()}})}),(0,a.jsxs)("div",{className:"ml-4 min-w-0",children:[(0,a.jsxs)("div",{className:"flex flex-col space-y-3",children:[(0,a.jsx)("span",{className:"body-3 truncate font-semibold md:body-2",children:m.name}),(0,a.jsxs)("span",{className:"caption text-brand-grey-11 md:body-3",children:["Using ",x]}),(0,a.jsxs)("span",{className:"caption text-brand-grey-11 md:body-3",children:["Created at: ",w()(null==m?void 0:null===(i=m.File)||void 0===i?void 0:null===(d=i.Metadata)||void 0===d?void 0:d.createdAt).format("MMM DD YYYY")]})]}),(0,a.jsxs)("div",{className:"mt-9 flex items-center",children:[(0,a.jsx)("span",{className:"caption md:body-3",children:"Status"}),m.status&&(0,a.jsx)(k,{className:"ml-2",status:m.status})]})]})]})}))}function k(e){let{status:s,className:l}=e,t=s[0]+(null==s?void 0:s.slice(1).toLowerCase()),n=["COMPLETED","READY"].includes(s)?"bg-[#158D4C]":["Failed","CANCELED"].includes(s)?"bg-[#FF4848]":"bg-[#FF5C00]";return(0,a.jsxs)("div",{className:N()("flex items-center rounded-full bg-[#158D4C] py-[2px] pl-2 pr-1",n,l),children:[(0,a.jsx)("span",{className:"caption font-medium",children:t}),(0,a.jsx)(o(),{className:"ml-1",src:"/icons/info-white.svg",alt:"",width:"16",height:"16","aria-hidden":"true",draggable:"false"})]})}var D=(0,t.u3)(function(){let{userModels:e,statusFilter:s,setStatusFilter:l}=(0,i.U)();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between pb-6 pt-7 md:pt-[90px]",children:[(0,a.jsx)("h1",{className:"headline-5 font-semibold md:headline-4",children:"Models"}),e&&e.length>0&&(0,a.jsxs)(v(),{href:"/upload",className:"b-button hidden items-center !pr-4 md:flex",children:[(0,a.jsx)(o(),{src:"/icons/plus-white.svg",alt:"",width:"24",height:"24","aria-hidden":"true",unoptimized:!0}),(0,a.jsx)("span",{className:"body-3 ml-[2px]",children:"Upload model"})]})]}),(0,a.jsxs)("div",{className:"relative flex space-x-10 before:absolute before:bottom-0 before:h-[1px] before:w-full before:bg-brand-grey-16",children:[(0,a.jsx)(p,{name:"status-filter",label:"All",selected:s,onChange:l}),(0,a.jsx)(p,{name:"status-filter",label:"Pending",value:"PENDING",selected:s,onChange:l}),(0,a.jsx)(p,{name:"status-filter",label:"Rejected",value:"BLOCKED",selected:s,onChange:l})]}),(0,a.jsx)("div",{className:"md:scrollbar-default mt-6 md:pr-2",children:e&&e.length>0?(0,a.jsx)("ul",{className:"grid gap-5 md:grid-cols-[repeat(auto-fill,minmax(450px,1fr))]",children:e.map((e,s)=>(0,a.jsx)(_,{model:e},s))}):(0,a.jsxs)("div",{className:"mt-20 flex flex-col items-center",children:[(0,a.jsx)(o(),{src:"/images/svg/empty-models.svg",width:"119",height:"131",alt:"","aria-hidden":"true",draggable:"false",priority:!0,unoptimized:!0}),(0,a.jsx)("span",{className:"body-3 mt-6 font-medium text-white",children:"It's empty in here!"}),(0,a.jsx)("span",{className:"caption mt-2 text-brand-grey-1",children:"You havenât uploaded any models yet"}),(0,a.jsxs)(v(),{href:"/upload",className:"b-button mt-7 flex items-center !pr-4",children:[(0,a.jsx)(o(),{src:"/icons/plus-white.svg",alt:"",width:"24",height:"24","aria-hidden":"true",unoptimized:!0}),(0,a.jsx)("span",{className:"body-3 ml-[2px]",children:"Upload model"})]})]})})]})}),F=!0,A=(0,t.u3)(function(e){let{user:s}=e,l=(0,n.useRouter)(),{userMetadata:c}=(0,E.Z)(),{isAuthenticated:o,user:m,isLoading:u}=(0,t.D3)(),{setUsername:h,refreshUserImages:x,resetImages:p}=(0,i.U)(),[f,g]=(0,r.useState)(!1),[v,j]=(0,r.useState)("gallery");return(0,r.useEffect)(()=>{var e;if(u||!s||!m||!(null==c?void 0:null===(e=c.data)||void 0===e?void 0:e.username))return;if(!s.username||!s.authId){l.push("/"),g(!1);return}let a=s.username===c.data.username&&s.authId===m.sub;a?h(s.username).then(()=>g(!0)):(l.push("/play/".concat(s.username)),g(!1))},[s,c,u,o,f,m,l,h,x]),(0,r.useEffect)(()=>()=>{h(""),p()},[]),(0,a.jsxs)(d.Z,{user:s,loading:!f||!o||u||l.isFallback,onNavChange:e=>j(e),children:["gallery"===v&&(0,a.jsx)(b,{}),"models"===v&&(0,a.jsx)(D,{})]})})}},function(e){e.O(0,[5302,7372,9774,2888,179],function(){return e(e.s=33907)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.