PageSourceSearch

https://schoolhouse.world/_next/static/chunks/pages/admin/user/[user]-c2c65e7edc815fa1.js

js schoolhouse.world collected 2026-09-24 09:12:21 UTC 26,624 bytes, 12 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4167],{15369:(e,l,r)=>{"use strict";r.d(l,{A:()=>i});class n extends Error{name="PageError";statusCode=400}class i extends n{name="PageNotFoundError";statusCode=404;constructor(e="Oh no! This page does not exist."){super(e)}}},15649:(e,l,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/user/[user]",function(){return r(91929)}])},17927:(e,l,r)=>{"use strict";r.d(l,{A:()=>$});var n=r(18153),i=r(59803),t=r(99407),d=r(63973),o=r(2665),s=r(55791),a=r(83734),c=r(43043),u=r(64435),h=r(91921),Y=r(38890),m=r(14232),A=r(55720),p=r(46304),y=r(46860),T=r(90799),b=r(97501),v=r(76032),f=r(74175),_=r(9496),g=r(41130),w=r(65956);function D({userVolunteerRoleId:e,onClose:l}){let r=(0,g._)(),[i,t]=(0,f.A)(async()=>{null!=e&&(await _.Vf.admin_deleteUserVolunteerRole({userVolunteerRoleId:e}),r({title:"User Volunteer Role Deleted",status:"success"}),l())},[l,r,e],"Delete Volunteer Role");return(0,n.Y)(w.A,{size:"2xl",open:null!=e,onClose:l,title:"Delete Volunteer Role",body:()=>(0,n.FD)(v.B,{children:[(0,n.Y)(h.E,{children:"Are you sure you'd like to delete this record?"}),(0,n.Y)(h.E,{children:"Deleting this record will remove this volunteer experience from the user's profile / portfolio."}),(0,n.Y)(h.E,{children:"Note: If the user currently holds this role, you will need to notify them and remove their permissions manually."})]}),rightFooterContent:()=>(0,n.FD)(v.B,{direction:"row",spacing:"8px",children:[(0,n.Y)(Y.$,{variant:"outline",onClick:l,children:"Cancel"}),(0,n.Y)(Y.$,{variant:"danger",isLoading:t,onClick:i,children:"Delete"})]})})}var F=r(46862),C=r(70794);function N({userVolunteerRole:e,onClose:l}){let r=(0,g._)(),i=(0,C.A)(["id","title"]),t=(0,m.useCallback)(async n=>{null!=e&&(await _.Vf.admin_editUserVolunteerRole({userVolunteerRoleId:e.id,startDate:new Date(`${n.startDate}`),endDate:null==n.endDate?null:new Date(`${n.endDate}`),worldId:null==n.worldId?null:Number.parseInt(`${n.worldId}`,10)}),r({title:"User Volunteer Role Updated",status:"success"}),l())},[l,e,r]),d=(0,m.useMemo)(()=>[{label:"Start Date",type:"date",name:"startDate",initialValue:e?.startDate.toISO(),required:!0,size:6},{label:"End Date",type:"date",name:"endDate",initialValue:e?.endDate==null?null:e.endDate.toISO(),required:!1,size:6},{label:"Subworld",type:"select",name:"worldId",options:i.map(e=>({label:e.title,value:`${e.id}`})),initialValue:e?.world?.id==null?null:`${e.world.id}`,required:!1,size:6}],[e,i]);return(0,n.Y)(w.A,{size:"2xl",open:null!=e,onClose:l,title:"Edit User Volunteer Role",body:()=>(0,n.FD)(v.B,{children:[(0,n.Y)(h.E,{children:"This record will show up on the user's profile/portfolio"}),(0,n.Y)(h.E,{children:"If the user is currently in the role, leave End Date blank."}),(0,n.Y)(h.E,{children:"Note: If the user currently holds this role, you will need to notify them and remove their permissions manually. (If you'd like these to happen automatically, please add the user from the volunteer team page)"}),(0,n.Y)(F.A,{name:"AdminEditUserVolunteerRoles",blocks:d,onSubmit:t})]})})}function $({userVolunteerRoles:e,canEdit:l}){let[r,v]=m.useState(null),[f,_]=m.useState(null);return(0,n.FD)(i.s,{flexDir:"column",children:[(0,n.Y)(N,{userVolunteerRole:f,onClose:()=>_(null)}),(0,n.Y)(D,{userVolunteerRoleId:r,onClose:()=>v(null)}),(0,n.FD)(t.X,{variant:"simple",children:[(0,n.Y)(d.d,{children:(0,n.FD)(o.Tr,{children:[(0,n.Y)(s.Th,{children:"User"}),(0,n.Y)(s.Th,{children:"Team / Role"}),(0,n.Y)(s.Th,{children:"Subworld"}),(0,n.Y)(s.Th,{children:"Start Date"}),(0,n.Y)(s.Th,{children:"End Date"}),l?(0,n.Y)(s.Th,{children:"Actions"}):null]})}),0===e.length?(0,n.Y)(a.r,{children:"No volunteer roles to display."}):null,(0,n.Y)(c.N,{children:e.map(e=>{let{id:r,userId:i,startDate:t,endDate:d,roleId:s,roleName:a,teamName:c,teamSlug:m,world:f}=(0,b.SP)(e),g=e(A.Ay.display_name)??"";return(0,n.FD)(o.Tr,{children:[(0,n.Y)(u.Td,{children:(0,n.Y)(y.A,{href:(0,p.hTK)(`user/${i}`),children:g})}),(0,n.FD)(u.Td,{children:[(0,n.Y)(h.E,{children:(0,n.Y)(y.A,{href:(0,p.hX1)(m),children:c})}),(0,n.Y)(h.E,{children:(0,n.Y)(y.A,{href:(0,p.ojW)(s),children:a})})]}),(0,n.Y)(u.Td,{children:f?.title??"N/A"}),(0,n.Y)(u.Td,{children:(0,n.Y)(T.A,{time:t.toISO(),format:"yyyy LLL d"})}),(0,n.Y)(u.Td,{children:null==d?"N/A":(0,n.Y)(T.A,{time:d.toISO(),format:"yyyy LLL d"})}),l?(0,n.FD)(u.Td,{children:[(0,n.Y)(Y.$,{mr:"4px",variant:"outline",onClick:()=>_({id:r,startDate:t,endDate:d,world:f}),children:"Edit"}),(0,n.Y)(Y.$,{variant:"danger",onClick:()=>v(r),children:"Delete"})]}):null]},r)})})]})]})}},55791:(e,l,r)=>{"use strict";r.d(l,{Th:()=>o});var n=r(37876),i=r(99407),t=r(11842),d=r(85696);let o=(0,t.R)(({isNumeric:e,...l},r)=>{let t=(0,i.k)();return(0,n.jsx)(d.B.th,{...l,ref:r,__css:t.th,"data-is-numeric":e})})},63973:(e,l,r)=>{"use strict";r.d(l,{d:()=>o});var n=r(37876),i=r(99407),t=r(11842),d=r(85696);let o=(0,t.R)((e,l)=>{let r=(0,i.k)();return(0,n.jsx)(d.B.thead,{...e,ref:l,__css:r.thead})})},83328:(e,l,r)=>{"use strict";r.d(l,{C:()=>a});var n=r(37876),i=r(29185),t=r(75255),d=r(11842),o=r(66394),s=r(85696);let a=(0,d.R)(function(e,l){let r=(0,o.V)("Code",e),{className:d,...a}=(0,i.M)(e);return(0,n.jsx)(s.B.code,{ref:l,className:(0,t.cx)("chakra-code",e.className),...a,__css:{display:"inline-block",...r}})});a.displayName="Code"},83734:(e,l,r)=>{"use strict";r.d(l,{r:()=>o});var n=r(37876),i=r(99407),t=r(11842),d=r(85696);let o=(0,t.R)((e,l)=>{let{placement:r="bottom",...t}=e,o=(0,i.k)();return(0,n.jsx)(d.B.caption,{...t,ref:l,__css:{...o.caption,captionSide:r}})});o.displayName="TableCaption"},84878:(e,l,r)=>{"use strict";r.d(l,{l:()=>A});var n=r(37876),i=r(29185),t=r(33527),d=r(46396),o=r(71851),s=r(14232),a=r(75255),c=r(11842),u=r(85696);let h=(0,c.R)(function(e,l){let{children:r,placeholder:i,className:t,...d}=e;return(0,n.jsxs)(u.B.select,{...d,ref:l,className:(0,a.cx)("chakra-select",t),children:[i&&(0,n.jsx)("option",{value:"",children:i}),r]})});h.displayName="SelectField";var Y=r(70667),m=r(66394);let A=(0,c.R)((e,l)=>
1{let r=(0,m.o)("Select",e),{rootProps:s,placeholder:a,icon:c,color:A,height:p,h:y,minH:b,minHeight:v,iconColor:f,iconSize:_,...g}=(0,i.M)(e),[w,D]=(0,d.l)(g,t.GF),F=(0,Y.t)(D),C={paddingEnd:"2rem",...r.field,_focus:{zIndex:"unset",...r.field?._focus}};return(0,n.jsxs)(u.B.div,{className:"chakra-select__wrapper",__css:{width:"100%",height:"fit-content",position:"relative",color:A},...w,...s,children:[(0,n.jsx)(h,{ref:l,height:y??p,minH:b??v,placeholder:a,...F,__css:C,children:e.children}),(0,n.jsx)(T,{"data-disabled":(0,o.s)(F.disabled),...(f||A)&&{color:f||A},__css:r.icon,..._&&{fontSize:_},children:c})]})});A.displayName="Select";let p=e=>(0,n.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,n.jsx)("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),y=(0,u.B)("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),T=e=>{let{children:l=(0,n.jsx)(p,{}),...r}=e,i=(0,s.cloneElement)(l,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return(0,n.jsx)(y,{...r,className:"chakra-select__icon-wrapper",children:(0,s.isValidElement)(l)?i:null})};T.displayName="SelectIcon"},91929:(e,l,r)=>{"use strict";r.r(l),r.d(l,{__N_SSP:()=>eF,default:()=>eC});var n=r(18153),i=r(24836),t=r(42720),d=r(99407),o=r(43043),s=r(2665),a=r(64435),c=r(39955),u=r(76032),h=r(91921),Y=r(50485),m=r(38890),A=r(38993),p=r(44517),y=r(28898),T=r(44824),b=r(89099),v=r(14232),f=r(19515),_=r(97390),g=r(78919),w=r(74856),D=r(55720);let F={...(0,w.SN)("user_note")(["id","user_id","subject_user_id","note","created_at","updated_at","deleted_at"]),where:({subjectUserId:e,include:l=[],groupBy:r=null,order:n=null},i=null)=>(0,g.Xs)`
2        FROM ${F}
3        ${(0,w.cA)(F,l)}
4        WHERE
5            ${null!=e?(0,g.Xs)`${F.subject_user_id} = ${e} AND`:(0,g.Xs)``}
6            ${null!=i?i:(0,g.Xs)`TRUE`}
7        ${(0,w.G1)(r)}
8        ${(0,w.k5)(n)}
9    `,associations:()=>({User:{query:D.Ay,foreignKey:D.Ay.id,sourceKey:F.user_id},Subject:{query:D.Ay,foreignKey:D.Ay.id,sourceKey:F.subject_user_id}})};
9var C=r(7243),N=r(89112),$=r(85562),E=r(89360),S=r(4724),I=r(54443),R=r(75292),k=r(15369),x=r(61110),U=r(46304),L=r(77489),V=r(59676),O=r(45514),j=r(4110),M=r(59803),z=r(63973),B=r(55791),P=r(83734),q=r(46860),W=r(23538),X=r(90799);function K({userNotes:e}){return(0,n.Y)(M.s,{flexDir:"column",children:(0,n.FD)(d.X,{variant:"simple",children:[(0,n.Y)(z.d,{children:(0,n.FD)(s.Tr,{children:[(0,n.Y)(B.Th,{width:"150px",children:"Date"}),(0,n.Y)(B.Th,{width:"150px",children:"Logged by"}),(0,n.Y)(B.Th,{children:"Note"})]})}),0===e.length?(0,n.Y)(P.r,{children:"No user notes to display."}):null,(0,n.Y)(o.N,{children:e.map(e=>{let l=e(F.id),r=e(F.created_at),i=e(F.user_id),t=e(D.Ay.display_name),d=e(F.note);return(0,n.Y)(v.Fragment,{children:(0,n.FD)(s.Tr,{children:[(0,n.Y)(a.Td,{children:(0,n.Y)(X.A,{time:r})}),(0,n.Y)(a.Td,{children:(0,n.Y)(q.A,{href:(0,U.hTK)(`user/${i}`),children:t})}),(0,n.Y)(a.Td,{children:(0,n.Y)(W.A,{text:d})})]})},l??0)})})]})})}var H=r(52125),J=r(43060);function G({userId:e}){var l;let r,i=(0,I.I)(),{dryRun:t}=(0,S.U)(),c=i.one(D.Ay.where({id:e}))(D.Ay.roles)??[],u=(l=i.many(H.A.where({userId:e,paranoid:!1})),r=l.flatMap(e=>{let l=e.one(H.A.getAssigner()),r=e(H.A.assigner_user_id),n=null!=r||t?{id:r??0,displayName:l(D.Ay.display_name)??"",username:l(D.Ay.username)}:null,i={type:"assign",date:T.c9.fromISO(`${e(H.A.created_at)}`),role:e(H.A.role)??"user:basic",source:e(H.A.assigned_source)??"backfill",relatedUser:n},d=null!=e(H.A.deleted_at),o=e.one(H.A.getRemover()),s=e(H.A.remover_user_id),a=null!=s||t?{id:s??0,displayName:o(D.Ay.display_name)??"",username:o(D.Ay.username)}:null;return[i,d||t?{type:"remove",date:T.c9.fromISO(`${e(H.A.deleted_at)}`),role:e(H.A.role)??"user:basic",source:e(H.A.removed_source)??"manual",relatedUser:a}:null].filter(f.Pe)}),(0,J.A)(r,"date","asc"));return(0,n.Y)(M.s,{flexDir:"column",children:(0,n.FD)(d.X,{variant:"simple",children:[(0,n.Y)(z.d,{children:(0,n.FD)(s.Tr,{children:[(0,n.Y)(B.Th,{children:"Role"}),(0,n.Y)(B.Th,{children:"Event"}),(0,n.Y)(B.Th,{children:"Date"}),(0,n.Y)(B.Th,{children:"Source"}),(0,n.Y)(B.Th,{children:"Related User"})]})}),(0,n.FD)(P.r,{children:["Current roles: ",c.length>0?c.join(", "):"None"]}),(0,n.Y)(o.N,{children:u.map(({type:e,role:l,source:r,relatedUser:i,date:t})=>(0,n.FD)(s.Tr,{children:[(0,n.Y)(a.Td,{children:l}),(0,n.Y)(a.Td,{children:e}),(0,n.Y)(a.Td,{children:t.toLocaleString(T.c9.DATETIME_SHORT_WITH_SECONDS)}),(0,n.Y)(a.Td,{children:r}),(0,n.Y)(a.Td,{children:i?.id==null?"N/A":(0,n.FD)(q.A,{href:(0,U.dEd)({userId:i?.id??0,username:i.username}),children:[" ",i?.displayName]})})]},`${e}-${l}-${t}`))})]})})}var Z=r(17927),Q=r(85696),ee=r(97460),el=r(81188),er=r(17297),en=r(38791),ei=r(53596),et=r(65956),ed=r(70794),eo=r(97501),es=r(38863);function ea({channelMembers:e}){return(0,n.Y)(M.s,{flexDir:"column",children:(0,n.FD)(d.X,{variant:"simple",children:[(0,n.Y)(z.d,{children:(0,n.FD)(s.Tr,{children:[(0,n.Y)(B.Th,{children:"Title"}),(0,n.Y)(B.Th,{children:"Post Count"}),(0,n.Y)(B.Th,{children:"Joined At"})]})}),0===e.length?(0,n.Y)(P.r,{children:"This user is not in any channels."}):null,(0,n.Y)(o.N,{children:e.map(e=>{let l=e(er.A.id)??0,r=e(en.A.title),i=e(er.A.countPosts()),t=e(er.A.created_at);return(0,n.FD)(s.Tr,{children:[(0,n.Y)(a.Td,{children:r}),(0,n.Y)(a.Td,{children:i}),(0,n.Y)(a.Td,{children:(0,n.Y)(X.A,{time:t})})]},l??0)})})]})})}var ec=r(74175),eu=r(9496),eh=r(41130),eY=r(85279);function em({open:e,onClose:l,worlds:r,userId:i,userName:t}){let d=(0,eh._)(),[o,s]=(0,v.useState)(null);(0,v.useEffect)(()=>s(null),[e]);let[a,Y]=(0,ec.A)(async()=>{null!=o&&(await eu.Vf.admin_addUserToWorld({userId:i,worldId:o.id}),d({title:`User#${i} was added to ${o.title}.`,status:"success"}),l())},[l,d,i,o],"Add User to World");return(0,n.Y)(et.A,{size:"xl",open:e,onClose:l,title:"Add to Subworld",body:()=>(0,n.Y)(c.a,{children:(0,n.FD)(u.B,{children:[(0,n.Y)(h.E,{children:"Select a world:"}
9),(0,n.Y)(eY.A,{instanceId:"add-world",name:"add-world",options:r.map(e=>({value:e.id,label:e.title})),onChange:e=>s(null==e?null:{id:e.value,title:e.label}),isSearchable:!0,components:{IndicatorSeparator:()=>null}}),null!=o?(0,n.FD)(h.E,{children:["Are you sure you want to add ",(0,n.Y)("b",{children:t})," to the ",(0,n.Y)("b",{children:o.title})," ","subworld?"]}):null]})}),leftFooterContent:()=>(0,n.Y)(m.$,{variant:"ghost",onClick:l,children:"Cancel"}),rightFooterContent:()=>(0,n.Y)(m.$,{isLoading:Y,isDisabled:null==o,onClick:a,children:"Add"})})}var eA=r(46862);function ep({open:e,onClose:l,world:r,userId:i,userName:t,currentLevel:d}){let o=(0,eh._)(),s=(0,v.useMemo)(()=>[{name:"level",type:"select",label:`What level would you like to promote ${t} to?`,options:_.n_G.filter(e=>(0,ei.Fl)({level:e,minLevel:d})&&e!==d).map(e=>({label:(0,ei.v9)({level:e,worldSlug:r.slug}),value:e})),size:6}],[d,r,t]),[a]=(0,ec.A)(async e=>{let n=e.level;await eu.Vf.admin_promoteToLevel({userId:i,worldId:r.id,level:n}),o({title:`User#${i} is now a ${(0,ei.v9)({level:n,worldSlug:r.slug})} in ${r.title}.`,status:"success"}),l()},[l,o,i,r],"Promote to Level");return(0,n.Y)(et.A,{size:"lg",open:e,onClose:l,title:`Promote ${t}`,body:()=>(0,n.Y)(c.a,{children:(0,n.Y)(eA.A,{blocks:s,name:"PromoteToLevel",onSubmit:a})})})}var ey=r(34205);function eT({open:e,onClose:l,world:r,userId:i,userName:t}){let d=(0,eh._)(),[o,s]=(0,ec.A)(async()=>{await eu.Vf.admin_removeUserFromWorld({userId:i,worldId:r.id}),d({title:`User#${i} was removed from ${r.title}.`,status:"success"}),l()},[l,d,i,r],"Leave World");return(0,n.Y)(et.A,{size:"3xl",open:e,onClose:l,title:"Remove from Subworld",body:()=>(0,n.FD)(c.a,{children:[(0,n.FD)(h.E,{children:["Are you sure you want to remove ",(0,n.Y)("b",{children:t})," from the ",(0,n.Y)("b",{children:r.title})," ","subworld?"]}),(0,n.FD)(ey.Xy,{children:[(0,n.FD)(ey.ck,{children:[t," CAN rejoin public subworlds to see discussions, reply to posts, and attend sessions."]}),(0,n.FD)(ey.ck,{children:[t," CANNOT rejoin private subworlds on their own."]})]}),(0,n.Y)(h.E,{children:"Note: If a user is currently registered for any series/sessions or hosting any series/sessions in the subworld, they CANNOT be removed. Please withdraw them from their registrations and end their sessions/series (via the series/session pages) before removing them from the subworld."})]}),leftFooterContent:()=>(0,n.Y)(m.$,{onClick:l,children:"Cancel"}),rightFooterContent:()=>(0,n.FD)(m.$,{variant:"danger",isLoading:s,onClick:o,children:["Remove from: ",r.title]})})}function eb({open:e,onClose:l,world:r,userId:i,userName:t}){let d=(0,eh._)(),[o,s]=(0,ec.A)(async()=>{await eu.Vf.admin_resetLevel({userId:i,worldId:r.id}),d({title:`User#${i}'s level was reset in ${r.title}.`,status:"success"}),l()},[l,d,i,r],"Reset User Level");return(0,n.Y)(et.A,{size:"lg",open:e,onClose:l,title:"Reset User Level",body:()=>(0,n.FD)(u.B,{children:[(0,n.Y)(h.E,{children:"Resetting a user's level will revert them back to a member and then level them up to the appropriate level. They will be removed from channels as appropriate, but they will NOT be removed from the Tutor / Moderator worlds. World removal must be done separately."}),(0,n.Y)(h.E,{children:"Use this when demoting users from moderator status."}),(0,n.FD)(h.E,{children:["Are you sure you want to reset ",(0,n.Y)("b",{children:t}),"'s level in ",(0,n.Y)("b",{children:r.title}),"?"]})]}),leftFooterContent:()=>(0,n.Y)(m.$,{onClick:l,variant:"ghost",children:"Cancel"}),rightFooterContent:()=>(0,n.Y)(m.$,{variant:"danger",isLoading:s,onClick:o,children:"Reset Level"})})}let ev="expand";function ef({user:e,worldMembers:l}){let r=(0,b.useRouter)(),i=(0,I.I)(),t=(0,R.Jd)(),[Y,A]=(0,v.useState)(null),[T,f]=(0,v.useState)(!1),[_,w]=(0,v.useState)(!1),[F,C]=(0,v.useState)(null),[E,S]=(0,v.useState)(!1),k=(0,ed.A)(["id","title"],{adminIncludeAll:!0,numRandomUsersToInclude:0}),x=e(D.Ay.id)??0,U=e(D.Ay.display_name)??"",L=Number.parseInt(r.query[ev],10)||null,O=null==L?null:i.one(N.A.where({id:L})),j=(0,v.useCallback)(e=>{r.replace({query:{...r.query,[ev]:e}}
9).catch(e=>{el.A.error("Navigation failed",{err:e})})},[r]),q=(0,v.useCallback)(()=>{r.replace({query:(0,y.A)(r.query,[ev])}).catch(e=>{el.A.error("Navigation failed",{err:e})})},[r]),W=null==L?null:O?.many(er.A.where({userId:N.A.user_id,include:[{association:"Channel",required:!0,where:(0,g.Xs)`${en.A.world_id} = ${N.A.world_id}`}],order:[[en.A.position,"asc"]]}))??[],K=l.map(e=>e(N.A.world_id)),H=k.filter(e=>!K.includes(e.id));return(0,n.FD)(M.s,{flexDir:"column",children:[(0,V.A)(t,"admin:world:manage-users")?(0,n.Y)(em,{open:T,onClose:()=>f(!1),worlds:H,userId:x,userName:U}):null,(0,V.A)(t,"admin:world:manage-users")&&null!=Y?(0,n.FD)(n.FK,{children:[(0,n.Y)(eT,{open:_,onClose:()=>w(!1),world:Y,userId:x,userName:U}),null==F?null:(0,n.Y)(ep,{open:null!=F,onClose:()=>C(null),world:Y,userId:x,userName:U,currentLevel:F.currentLevel}),(0,n.Y)(eb,{open:E,onClose:()=>S(!1),world:Y,userId:x,userName:U})]}):null,(0,n.Y)(et.A,{size:"3xl",open:null!=L,onClose:q,title:"Channels",body:()=>null==W?null:(0,n.Y)(ea,{channelMembers:W})}),(0,n.Y)(c.a,{children:(0,n.Y)(m.$,{onClick:()=>f(!0),leftIcon:(0,n.Y)(ee.g,{size:"lg",icon:p.nWR}),children:"Add to Subworld"})}),(0,n.FD)(d.X,{variant:"simple",children:[(0,n.Y)(z.d,{children:(0,n.FD)(s.Tr,{children:[(0,n.Y)(a.Td,{children:"Subworld"}),(0,n.Y)(B.Th,{minW:"200px",children:"Promotion?"}),(0,n.Y)(B.Th,{children:"Joined At"}),(0,n.Y)(B.Th,{children:"Intents"}),(0,n.Y)(B.Th,{children:"Goal"}),(0,n.Y)(B.Th,{children:"Stats"}),(0,n.Y)(B.Th,{children:"Actions"})]})}),0===l.length?(0,n.Y)(P.r,{color:"fg.muted",children:"This user is not in any subworlds."}):null,(0,n.Y)(o.N,{children:l.map(e=>{let l=e(N.A.id)??0,r=e(N.A.created_at),i=e($.A.title),d=e(N.A.countPosts()),o=e(N.A.level),c=e(N.A.goal),Y=e(N.A.details),y=(0,eo.$h)(["id","slug","title"],{world:e,userId:x}),T=e(N.A.countComments());return(0,n.FD)(s.Tr,{children:[(0,n.Y)(a.Td,{children:(0,n.FD)(u.B,{direction:"column",children:[(0,n.Y)(Q.B.span,{children:i}),null==o?null:(0,n.Y)(es.A,{level:o,worldSlug:y.slug})]})}),(0,n.Y)(a.Td,{children:Y?.backfilledMinLevel==null?null:(0,n.FD)(h.E,{children:[(0,ei.v9)({level:Y.backfilledMinLevel.level,worldSlug:y.slug})," ","(",Y.backfilledMinLevel.reason,")"]})}),(0,n.Y)(a.Td,{children:(0,n.Y)(X.A,{time:r})}),(0,n.Y)(a.Td,{children:Y?.helpIntents??"N/A"}),(0,n.Y)(a.Td,{children:c??"N/A"}),(0,n.Y)(a.Td,{children:(0,n.FD)(u.B,{direction:"column",spacing:"2px",children:[(0,n.FD)(h.E,{children:["Posts: ",d]}),(0,n.FD)(h.E,{children:["Comments: ",T]})]})}),(0,n.Y)(a.Td,{children:(0,n.FD)(u.B,{children:[(0,n.Y)(m.$,{onClick:()=>{j(l)},variant:"outline",leftIcon:(0,n.Y)(ee.g,{size:"lg",icon:p.$UM}),children:"View Channels"}),(0,V.A)(t,"admin:world:manage-users")?(0,n.FD)(n.FK,{children:[(0,n.Y)(m.$,{onClick:()=>{null!=o&&(A(y),C({currentLevel:o}))},variant:"solid",isDisabled:"moderator"===o,leftIcon:(0,n.Y)(ee.g,{size:"lg",icon:p.INu}),children:"Promote Level"}),(0,n.Y)(m.$,{onClick:()=>{A(y),S(!0)},variant:"solid",leftIcon:(0,n.Y)(ee.g,{size:"lg",icon:p.V3T}),children:"Reset User Level"}),(0,n.Y)(m.$,{onClick:()=>{A(y),w(!0)},variant:"danger",leftIcon:(0,n.Y)(ee.g,{size:"lg",icon:p.bB2}),children:"Remove from Subworld"})]}):null]})})]},l??0)})})]})]})}var e_=r(49783),eg=r(82899),ew=r(94990);let eD=(0,x.A)(function(){let e=(0,b.useRouter)(),l=(0,I.I)(),r=(0,S.U)(),w=(0,R.Jd)(),[x,M]=(0,v.useState)(!1),{isOpen:z,onClose:B,onOpen:P}=(0,i.j)(),W=`${e.query.user}`,H=Number.parseInt(W,10)||null,J=null==H?D.Ay.where({username:W,paranoid:!1}):D.Ay.where({id:H,paranoid:!1}),Q=(0,g.Xs)`(SELECT ${D.Ay.id} ${J})`,ee=l.one(J),el=ee(D.Ay.id),er=ee(D.Ay.first_name)??"N/A",en=ee(D.Ay.last_name)??"N/A",ei=(0,f.Ei)(ee(D.Ay.country)??"")??"N/A",ed=ee(D.Ay.bio)??"N/A",eo=ee(D.Ay.username)??"N/A",es=T.c9.fromISO(`${ee(D.Ay.last_online_at)}`),ea=Math.round(ee(D.Ay.getAttendedMinutes())??0),ec=Math.round(ee(D.Ay.getTutoringMinutes({}))??0),eu=ee`date_part('year', ${D.Ay.date_of_birth})`??"N/A",eh=ee(D.Ay.getResearchGroup()),eY=null!=eh?_.hY1[eh]:"None",em=ee(D.Ay.onboarding_details),eA=ee(D.Ay.application_screen_details),ep=l.one`FROM ${D.Ay} WHERE ${D.Ay.id} = (
10    SELECT ${D.Ay.reviewing_user_id} FROM ${D.Ay} WHERE ${D.Ay.id} = ${Q}
11  )`,ey=ep(D.Ay.id),eT=ep(D.Ay.display_name),eb=l.many(C.A.where({userId:Q,include:[{association:"User",required:!0},{association:"VolunteerRole",required:!0,include:[{association:"VolunteerTeam",required:!0}]}],order:[[C.A.start_date,"asc"]]}
11)),ev=l.many(F.where({subjectUserId:Q,include:[{association:"User",required:!0}],order:[[F.created_at,"desc"]]})),eD=l.many(N.A.where({userId:Q,include:[{association:"World",required:!0},{association:"User",required:!0}],order:[[$.A.position,"asc"]]})),eF=ee.one(D.Ay.getZipCodeInfo()),eC=eF(E.A.zip_code),eN=eF(E.A.state),e$=eF(E.A.details)??{};if(w.id===el&&!(0,L.OK)(w,"admin:super"))throw new k.A("Sorry, you cannot view your own user profile.");if(!r.dryRun&&null==el)throw new k.A("Oh no! This user account does not exist.");return(0,n.FD)(e_.A,{title:`User#${el}`,children:[(0,n.FD)(t.m,{children:[(0,n.Y)(j.A,{queryUserId:Q,currentTab:"Overview"}),(0,n.Y)(O.A,{title:"About this User",body:()=>(0,n.Y)(d.X,{css:(0,A.AH)("td:nth-child(1),td:nth-child(3){font-weight:600;}"),children:(0,n.FD)(o.N,{children:[(0,n.FD)(s.Tr,{children:[(0,n.Y)(a.Td,{children:"First Name"}),(0,n.Y)(a.Td,{children:er}),(0,n.Y)(a.Td,{children:"Signed Up"}),(0,n.Y)(a.Td,{children:(0,n.Y)(X.A,{time:ee(D.Ay.created_at)})})]}),(0,n.FD)(s.Tr,{children:[(0,n.Y)(a.Td,{children:"Last Name"}),(0,n.Y)(a.Td,{children:en}),(0,n.Y)(a.Td,{children:"Referrer"}),(0,n.Y)(a.Td,{children:ee(D.Ay.referral_name)})]}),(0,n.FD)(s.Tr,{children:[(0,n.Y)(a.Td,{children:"Email"}),(0,n.Y)(a.Td,{children:ee(D.Ay.email)}),(0,n.Y)(a.Td,{children:"Phone Number"}),(0,n.Y)(a.Td,{children:ee(D.Ay.phone_number)})]}),(0,n.FD)(s.Tr,{children:[(0,n.Y)(a.Td,{children:"Timezone"}),(0,n.Y)(a.Td,{children:ee(D.Ay.timezone)}),(0,n.Y)(a.Td,{children:"Country"}),(0,n.Y)(a.Td,{children:ei})]}),(0,n.FD)(s.Tr,{children:[(0,n.Y)(a.Td,{children:"Roles"}),(0,n.Y)(a.Td,{children:(ee(D.Ay.roles)??[]).join(", ")}),(0,n.Y)(a.Td,{children:"Reviewed By"}),(0,n.Y)(a.Td,{children:null==ey?"N/A":(0,n.Y)(q.A,{href:`/admin/user/${ey}`,children:eT})})]}),(0,n.FD)(s.Tr,{children:[(0,n.Y)(a.Td,{children:"Bio"}),(0,n.Y)(a.Td,{children:ed}),(0,n.Y)(a.Td,{children:"Portfolio"}),(0,n.Y)(a.Td,{children:(0,n.Y)(q.A,{href:(0,U.EzL)(ee(D.Ay.uuid_portfolio)??""),children:"Portfolio"})})]}),(0,n.Y)(et.A,{open:x,onClose:()=>M(!1),title:`Zip Code ${eC}`,body:()=>(0,n.Y)(c.a,{children:(0,n.Y)(ew.A,{object:e$,indentValues:!0})})}),(0,n.FD)(s.Tr,{children:[(0,n.Y)(a.Td,{children:"Last Online"}),(0,n.Y)(a.Td,{children:es.toLocaleString(T.c9.DATETIME_MED_WITH_WEEKDAY)}),(0,n.Y)(a.Td,{children:"Zip Code"}),(0,n.Y)(a.Td,{children:null==eC?"N/A":(0,n.FD)(u.B,{direction:"row",spacing:"4px",children:[(0,n.FD)(h.E,{children:[eC," (",eN,")"]}),(0,n.Y)(Y.K,{variant:"icon",onClick:()=>M(!0),icon:(0,n.Y)(eg.A,{faIcon:p.$UM,size:"md"}),"aria-label":"Zip code details"})]})})]}),(0,n.FD)(s.Tr,{children:[(0,n.Y)(a.Td,{children:"Learning Minutes"}),(0,n.Y)(a.Td,{children:ea}),(0,n.Y)(a.Td,{children:"Tutoring Minutes"}),(0,n.Y)(a.Td,{children:ec})]}),(0,n.FD)(s.Tr,{children:[(0,n.Y)(a.Td,{children:"Username"}),(0,n.Y)(a.Td,{children:eo}),(0,n.Y)(a.Td,{children:"Year of Birth"}),(0,n.Y)(a.Td,{children:eu})]}),(0,n.FD)(s.Tr,{children:[(0,n.Y)(a.Td,{children:"Pronouns"}),(0,n.Y)(a.Td,{children:ee(D.Ay.pronouns)}),(0,V.A)(w,"admin:users:research_group:view")?(0,n.FD)(n.FK,{children:[(0,n.Y)(a.Td,{children:"Research Group"}),(0,n.Y)(a.Td,{children:eY})]}):null]}),(0,n.FD)(s.Tr,{children:[(0,n.Y)(a.Td,{children:"Automated Screening"}),(0,n.Y)(a.Td,{children:null==eA?"N/A":(0,n.FD)(n.FK,{children:[(0,n.FD)(h.E,{children:["Score: ",eA?.score]}),(0,n.Y)(c.a,{children:(0,n.Y)(m.$,{variant:"ghost",onClick:P,children:"Details"})})]})})]})]})})}),(0,n.Y)(O.A,{title:"Subworlds",body:()=>(0,n.Y)(c.a,{overflowX:"auto",children:(0,n.Y)(ef,{user:ee,worldMembers:eD})}),collapsible:!0}),(0,n.Y)(O.A,{title:"Onboarding Details",body:()=>(0,n.FD)(n.FK,{children:[(0,n.Y)(ew.A,{object:(0,y.A)(em,"video_introduction"),nullMessage:"This user has not completed onboarding yet",emptyMessage:"This user didn't tell us much in onboarding",indentValues:!0}),null!=em&&"video_introduction"in em?(0,n.FD)(c.a,{children:[(0,n.Y)(c.a,{fontWeight:"bold",mb:"4px",children:"Video Introduction"}),(0,n.Y)("video",{src:`${em.video_introduction}`,controls:!0})]}):null]}),collapsible:!0}),(0,n.Y)(O.A,{title:"Volunteer Roles",body:()=>(0,n.Y)(Z.A,{userVolunteerRoles:eb,canEdit:(0,L.OK)(w,"admin:super")}),collapsible:!0}),(0,n.Y)(O.A,{title:"User Roles History",body:()=>(0,n.Y)(G,{userId:Q}
11),collapsible:!0}),(0,n.Y)(O.A,{title:"User Notes",body:()=>(0,n.Y)(K,{userNotes:ev}),collapsible:!0})]}),(0,n.Y)(et.A,{size:"lg",open:z,title:"Automated Screening Details",onClose:B,body:()=>(0,n.Y)(ew.A,{object:eA,indentValues:!0})})]})},{authScopes:["admin:users:read","admin:phone_number:waive"]});var eF=!0;let eC=eD},94990:(e,l,r)=>{"use strict";r.d(l,{A:()=>s});var n=r(18153),i=r(76032),t=r(39955),d=r(91921),o=r(23538);function s({object:e,nullMessage:l="No JSON",emptyMessage:r="Empty JSON",indentValues:a=!1}){let c=Object.keys(e||{});return(0,n.Y)(t.a,{children:null==e?(0,n.Y)(d.E,{children:l}):0===c.length?(0,n.Y)(d.E,{children:r}):function e(l,r){return Array.isArray(l)?(0,n.Y)(i.B,{direction:"column",spacing:2,children:l.map(i=>(0,n.Y)(t.a,{p:4,borderRadius:"8px",bg:l.length<=1?"auto":"bg.muted",children:e(i,{border:!0,indentValues:r.indentValues})},`${i}`))}):l instanceof Object?(0,n.Y)(i.B,{spacing:"12px",border:r.border?"2px solid":"none",borderColor:"border.emphasized",children:Object.entries(l).map(([l,i])=>(0,n.FD)(t.a,{children:[(0,n.Y)(t.a,{fontWeight:"bold",mb:"4px",children:l}),(0,n.Y)(t.a,{pl:r.indentValues?"12px":0,children:e(i,{border:!0,indentValues:r.indentValues})})]},l))}):"string"==typeof l?(0,n.Y)(t.a,{children:(0,n.Y)(o.A,{text:l,enableLinks:!0})}):"number"==typeof l?(0,n.Y)(t.a,{children:l}):(0,n.Y)(t.a,{children:JSON.stringify(l)})}(e,{border:!1,indentValues:a})})}}},e=>{e.O(0,[6425,6807,636,6593,8792],()=>e(e.s=15649)),_N_E=e.O()}]);
12//# sourceMappingURL=[user]-c2c65e7edc815fa1.js.map

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.