(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3439],{90909:function(e,t,s){Promise.resolve().then(s.bind(s,49262))},87461:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});var a=s(64090),r={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let l=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),n=(e,t)=>{let s=(0,a.forwardRef)((s,n)=>{let{color:i="currentColor",size:c=24,strokeWidth:d=2,absoluteStrokeWidth:o,className:x="",children:h,...m}=s;return(0,a.createElement)("svg",{ref:n,...r,width:c,height:c,stroke:i,strokeWidth:o?24*Number(d)/Number(c):d,className:["lucide","lucide-".concat(l(e)),x].join(" "),...m},[...t.map(e=>{let[t,s]=e;return(0,a.createElement)(t,s)}),...Array.isArray(h)?h:[h]])});return s.displayName="".concat(e),s}},53879:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let a=(0,s(87461).Z)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},97307:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let a=(0,s(87461).Z)("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]])},46578:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let a=(0,s(87461).Z)("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},18994:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let a=(0,s(87461).Z)("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},90684:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let a=(0,s(87461).Z)("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]])},30438:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let a=(0,s(87461).Z)("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]])},85904:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let a=(0,s(87461).Z)("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]])},28670:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let a=(0,s(87461).Z)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},79990:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let a=(0,s(87461).Z)("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]])},50489:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let a=(0,s(87461).Z)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},71483:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let a=(0,s(87461).Z)("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},49262:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return Z}});var a=s(3827),r=s(64090),l=s(71774),n=s(89966),i=s(46578),c=s(30438),d=s(90684);/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let o=(0,s(87461).Z)("MailOpen",[["path",{d:"M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z",key:"1jhwl8"}],["path",{d:"m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10",key:"1qfld7"}]]);var x=s(79990),h=s(71483),m=s(28670),u=s(18994),p=s(53879),g=s(85904),b=s(97307),f=s(50489);function y(e,t){return t?e.ar:e.en}let j=e=>fetch(e).then(e=>e.json()),w={title:{en:"Messages",ar:"الرسائل"},search:{en:"Search messages...",ar:"بحث في الرسائل..."},allStatuses:{en:"All Statuses",ar:"جميع الحالات"},allSubjects:{en:"All Subjects",ar:"جميع المواضيع"},new:{en:"New",ar:"جديد"},read:{en:"Read",ar:"مقروء"},replied:{en:"Replied",ar:"تم الرد"},closed:{en:"Closed",ar:"مغلق"},total:{en:"Total",ar:"الإجمالي"},reply:{en:"Send Reply",ar:"إرسال الرد"},close:{en:"Close",ar:"إغلاق"},delete:{en:"Delete",ar:"حذف"},replyPlaceholder:{en:"Type your reply...",ar:"اكتب ردك..."},noMessages:{en:"No messages yet",ar:"لا توجد رسائل بعد"},selectMessage:{en:"Select a message to view",ar:"اختر رسالة لعرضها"},from:{en:"From",ar:"من"},email:{en:"Email",ar:"البريد"},phone:{en:"Phone",ar:"الهاتف"},subject:{en:"Subject",ar:"الموضوع"},date:{en:"Date",ar:"التاريخ"},status:{en:"Status",ar:"الحالة"},repliedBy:{en:"Replied by",ar:"رد بواسطة"},repliedAt:{en:"Replied at",ar:"تاريخ الرد"},confirmDelete:{en:"Are you sure you want to delete this message?",ar:"هل أنت متأكد من حذف هذه الرسالة؟"},support:{en:"Technical Support",ar:"دعم فني"},sales:{en:"Sales",ar:"مبيعات"},partnerships:{en:"Partnerships",ar:"شراكات"},general:{en:"General Inquiry",ar:"استفسار عام"},other:{en:"Other",ar:"أخرى"}},N={NEW:"bg-amber-500",READ:"bg-blue-500",REPLIED:"bg-emerald-500",CLOSED:"bg-gray-500"},v={NEW:"bg-amber-500/10 text-amber-400 border-amber-500/20",READ:"bg-blue-500/10 text-blue-400 border-blue-500/20",REPLIED:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20",CLOSED:"bg-gray-500/10 text-gray-400 border-gray-500/20"},E=["support","sales","partnerships","general","other"];function k(e,t){let s=e.toLowerCase();return s in w?y(w[s],t):e}function Z(){var e,t,s,Z;let{lang:S}=(0,l.Z)(),C="ar"===S,[D,L]=(0,r.useState)(""),[M,R]=(0,r.useState)(""),[A,P]=(0,r.useState)(""),[O,T]=(0,r.useState)(null),[W,z]=(0,r.useState)(""),[I,q]=(0,r.useState)(!1),[_,B]=(0,r.useState)(""),[H,V]=(0,r.useState)(!1),J=new URLSearchParams;D&&J.set("search",D),M&&J.set("status",M),A&&J.set("subject",A),J.set("limit","50");let{data:$,isLoading:F,mutate:G}=(0,n.ZP)("/api/admin/messages?".concat(J.toString()),j,{refreshInterval:3e4}),U=null!==(t=null==$?void 0:$.messages)&&void 0!==t?t:[],X=null!==(s=null==$?void 0:$.stats)&&void 0!==s?s:{total:0,NEW:0,READ:0,REPLIED:0,CLOSED:0},{data:K,isLoading:Q,mutate:Y}=(0,n.ZP)(O?"/api/admin/messages/".concat(O):null,j);(0,r.useEffect)(()=>{if(O){let e=setTimeout(()=>G(),1e3);return()=>clearTimeout(e)}},[O,G]);let ee=e=>{B(e),setTimeout(()=>B(""),3e3)},et=async()=>{if(O&&W.trim()){q(!0);try{(await fetch("/api/admin/messages/".concat(O,"/reply"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reply:W})})).ok&&(z(""),Y(),G(),ee(C?"تم إرسال الرد":"Reply sent"))}finally{q(!1)}}},es=async()=>{O&&(await fetch("/api/admin/messages/".concat(O),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:"CLOSED"})})).ok&&(Y(),G(),ee(C?"تم إغلاق الرسالة":"Message closed"))},ea=async()=>{O&&confirm(y(w.confirmDelete,C))&&(await fetch("/api/admin/messages/".concat(O),{method:"DELETE"})).ok&&(T(null),V(!1),G(),ee(C?"تم حذف الرسالة":"Message deleted"))},er=e=>{T(e),z(""),V(!0)};return(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"mb-6",children:(0,a.jsx)("h1",{className:"text-2xl font-bold text-white",children:y(w.title,C)})}),_&&(0,a.jsxs)("div",{className:"mb-4 px-4 py-2.5 rounded-lg bg-green-500/10 border border-green-500/20 text-green-400 text-sm flex items-center gap-2",children:[(0,a.jsx)(i.Z,{className:"h-4 w-4 shrink-0"}),_]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3 mb-6",children:[(0,a.jsxs)("button",{onClick:()=>R(""),className:"rounded-2xl border p-4 text-left transition-colors ".concat(M?"border-white/[0.06] bg-white/[0.02] hover:bg-white/[0.04]":"border-indigo-500/30 bg-indigo-500/5"),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-2",children:(0,a.jsx)("div",{className:"p-1.5 rounded-lg bg-indigo-500/10",children:(0,a.jsx)(c.Z,{className:"h-4 w-4 text-indigo-400"})})}),(0,a.jsx)("div",{className:"text-2xl font-bold text-white",children:X.total}),(0,a.jsx)("p",{className:"text-xs text-gray-400 mt-0.5",children:y(w.total,C)})]}),(0,a.jsxs)("button",{onClick:()=>R("NEW"===M?"":"NEW"),className:"rounded-2xl border p-4 text-left transition-colors ".concat("NEW"===M?"border-amber-500/30 bg-amber-500/5":"border-white/[0.06] bg-white/[0.02] hover:bg-white/[0.04]"),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-2",children:(0,a.jsx)("div",{className:"p-1.5 rounded-lg bg-amber-500/10",children:(0,a.jsx)(d.Z,{className:"h-4 w-4 text-amber-400"})})}),(0,a.jsx)("div",{className:"text-2xl font-bold text-white",children:X.NEW}),(0,a.jsx)("p",{className:"text-xs text-gray-400 mt-0.5",children:y(w.new,C)})]}),(0,a.jsxs)("button",{onClick:()=>R("READ"===M?"":"READ"),className:"rounded-2xl border p-4 text-left transition-colors ".concat("READ"===M?"border-blue-500/30 bg-blue-500/5":"border-white/[0.06] bg-white/[0.02] hover:bg-white/[0.04]"),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-2",children:(0,a.jsx)("div",{className:"p-1.5 rounded-lg bg-blue-500/10",children:(0,a.jsx)(o,{className:"h-4 w-4 text-blue-400"})})}),(0,a.jsx)("div",{className:"text-2xl font-bold text-white",children:X.READ}),(0,a.jsx)("p",{className:"text-xs text-gray-400 mt-0.5",children:y(w.read,C)})]}),(0,a.jsxs)("button",{onClick:()=>R("REPLIED"===M?"":"REPLIED"),className:"rounded-2xl border p-4 text-left transition-colors ".concat("REPLIED"===M?"border-emerald-500/30 bg-emerald-500/5":"border-white/[0.06] bg-white/[0.02] hover:bg-white/[0.04]"),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-2",children:(0,a.jsx)("div",{className:"p-1.5 rounded-lg bg-emerald-500/10",children:(0,a.jsx)(x.Z,{className:"h-4 w-4 text-emerald-400"})})}),(0,a.jsx)("div",{className:"text-2xl font-bold text-white",children:X.REPLIED}),(0,a.jsx)("p",{className:"text-xs text-gray-400 mt-0.5",children:y(w.replied,C)})]}),(0,a.jsxs)("button",{onClick:()=>R("CLOSED"===M?"":"CLOSED"),className:"rounded-2xl border p-4 text-left transition-colors ".concat("CLOSED"===M?"border-gray-500/30 bg-gray-500/5":"border-white/[0.06] bg-white/[0.02] hover:bg-white/[0.04]"),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-2",children:(0,a.jsx)("div",{className:"p-1.5 rounded-lg bg-gray-500/10",children:(0,a.jsx)(h.Z,{className:"h-4 w-4 text-gray-400"})})}),(0,a.jsx)("div",{className:"text-2xl font-bold text-white",children:X.CLOSED}),(0,a.jsx)("p",{className:"text-xs text-gray-400 mt-0.5",children:y(w.closed,C)})]})]}),(0,a.jsxs)("div",{className:"flex flex-col md:flex-row gap-3 mb-6",children:[(0,a.jsxs)("div",{className:"relative flex-1",children:[(0,a.jsx)(m.Z,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-500"}),(0,a.jsx)("input",{type:"text",value:D,onChange:e=>L(e.target.value),placeholder:y(w.search,C),className:"w-full pl-10 pr-4 py-2.5 rounded-xl bg-white/[0.03] border border-white/[0.06] text-sm text-white placeholder-gray-500 focus:outline-none focus:border-indigo-500/50 transition-colors"})]}),(0,a.jsxs)("select",{value:M,onChange:e=>R(e.target.value),className:"px-4 py-2.5 rounded-xl bg-[#0f0f1a] border border-white/[0.06] text-sm text-gray-300 focus:outline-none focus:border-indigo-500/50 transition-colors [&>option]:bg-[#0f0f1a] [&>option]:text-gray-300",children:[(0,a.jsx)("option",{value:"",children:y(w.allStatuses,C)}),(0,a.jsx)("option",{value:"NEW",children:y(w.new,C)}),(0,a.jsx)("option",{value:"READ",children:y(w.read,C)}),(0,a.jsx)("option",{value:"REPLIED",children:y(w.replied,C)}),(0,a.jsx)("option",{value:"CLOSED",children:y(w.closed,C)})]}),(0,a.jsxs)("select",{value:A,onChange:e=>P(e.target.value),className:"px-4 py-2.5 rounded-xl bg-[#0f0f1a] border border-white/[0.06] text-sm text-gray-300 focus:outline-none focus:border-indigo-500/50 transition-colors [&>option]:bg-[#0f0f1a] [&>option]:text-gray-300",children:[(0,a.jsx)("option",{value:"",children:y(w.allSubjects,C)}),E.map(e=>(0,a.jsx)("option",{value:e,children:y(w[e],C)},e))]})]}),F&&(0,a.jsx)("div",{className:"flex items-center justify-center py-20",children:(0,a.jsx)(u.Z,{className:"h-6 w-6 animate-spin text-gray-500"})}),!F&&0===U.length&&(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center py-20 text-gray-500",children:[(0,a.jsx)(c.Z,{className:"h-12 w-12 mb-3 opacity-30"}),(0,a.jsx)("p",{className:"text-sm",children:y(w.noMessages,C)})]}),!F&&U.length>0&&(0,a.jsxs)("div",{className:"flex flex-col md:flex-row gap-4 min-h-[600px]",children:[(0,a.jsx)("div",{className:"w-full md:w-[35%] rounded-2xl border border-white/[0.06] bg-white/[0.02] overflow-hidden flex flex-col ".concat(H?"hidden md:flex":"flex"),children:(0,a.jsx)("div",{className:"overflow-y-auto flex-1 divide-y divide-white/[0.04]",children:U.map(e=>(0,a.jsx)("button",{onClick:()=>er(e.id),className:"w-full text-left p-4 hover:bg-white/[0.03] transition-colors ".concat(O===e.id?"bg-white/[0.04]":""),children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"w-2.5 h-2.5 rounded-full mt-1.5 shrink-0 ".concat(N[e.status]||"bg-gray-500")}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsx)("span",{className:"text-sm truncate ".concat("NEW"===e.status?"font-bold text-white":"text-gray-300"),children:e.name}),(0,a.jsx)("span",{className:"text-xs text-gray-500 shrink-0",children:function(e,t){let s=new Date,a=new Date(e),r=Math.floor((s.getTime()-a.getTime())/6e4),l=Math.floor(r/60),n=Math.floor(l/24);return"ar"===t?r<1?"الآن":r<60?"منذ ".concat(r," دقيقة"):l<24?"منذ ".concat(l," ساعة"):"منذ ".concat(n," يوم"):r<1?"just now":r<60?"".concat(r,"m ago"):l<24?"".concat(l,"h ago"):"".concat(n,"d ago")}(e.createdAt,S)})]}),(0,a.jsx)("p",{className:"text-xs truncate mt-0.5 ".concat("NEW"===e.status?"font-semibold text-gray-300":"text-gray-500"),children:k(e.subject,C)}),(0,a.jsx)("p",{className:"text-xs text-gray-600 truncate mt-0.5",children:e.message})]})]})},e.id))})}),(0,a.jsxs)("div",{className:"w-full md:w-[65%] rounded-2xl border border-white/[0.06] bg-white/[0.02] overflow-hidden flex flex-col ".concat(H?"flex":"hidden md:flex"),children:[!O&&(0,a.jsx)("div",{className:"flex-1 flex items-center justify-center text-gray-500",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)(o,{className:"h-12 w-12 mx-auto mb-3 opacity-30"}),(0,a.jsx)("p",{className:"text-sm",children:y(w.selectMessage,C)})]})}),O&&Q&&(0,a.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,a.jsx)(u.Z,{className:"h-6 w-6 animate-spin text-gray-500"})}),O&&K&&!Q&&(0,a.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[(0,a.jsx)("div",{className:"md:hidden p-3 border-b border-white/[0.06]",children:(0,a.jsxs)("button",{onClick:()=>{V(!1)},className:"flex items-center gap-2 text-sm text-gray-400 hover:text-white transition-colors",children:[(0,a.jsx)(p.Z,{className:"h-4 w-4"}),(0,a.jsx)("span",{children:C?"رجوع":"Back"})]})}),(0,a.jsxs)("div",{className:"p-5 border-b border-white/[0.06]",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold text-white truncate",children:K.name}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-x-4 gap-y-1 mt-2 text-sm",children:[(0,a.jsxs)("span",{className:"flex items-center gap-1.5 text-gray-400",children:[(0,a.jsx)(d.Z,{className:"h-3.5 w-3.5"}),K.email]}),K.phone&&(0,a.jsxs)("span",{className:"flex items-center gap-1.5 text-gray-400",children:[(0,a.jsx)(g.Z,{className:"h-3.5 w-3.5"}),K.phone]}),(0,a.jsxs)("span",{className:"flex items-center gap-1.5 text-gray-400",children:[(0,a.jsx)(b.Z,{className:"h-3.5 w-3.5"}),new Date(K.createdAt).toLocaleDateString(C?"ar":"en",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})]})]})]}),(0,a.jsx)("div",{className:"flex items-center gap-2 shrink-0",children:(0,a.jsx)("span",{className:"px-2.5 py-1 rounded-full text-xs font-medium border ".concat(v[K.status]||"bg-gray-500/10 text-gray-400 border-gray-500/20"),children:(Z=K.status,y({NEW:w.new,READ:w.read,REPLIED:w.replied,CLOSED:w.closed}[Z]||{en:Z,ar:Z},C))})})]}),(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsx)("span",{className:"px-2.5 py-1 rounded-full text-xs font-medium bg-indigo-500/10 text-indigo-400 border border-indigo-500/20",children:k(K.subject,C)})})]}),(0,a.jsx)("div",{className:"p-5 border-b border-white/[0.06]",children:(0,a.jsx)("p",{className:"text-sm text-gray-300 whitespace-pre-wrap leading-relaxed",children:K.message})}),(0,a.jsxs)("div",{className:"p-5",children:[K.reply?(0,a.jsxs)("div",{className:"rounded-xl bg-emerald-500/5 border border-emerald-500/10 p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,a.jsx)(x.Z,{className:"h-3.5 w-3.5 text-emerald-400"}),(0,a.jsxs)("span",{className:"text-xs font-medium text-emerald-400",children:[y(w.repliedBy,C),": ",(null===(e=K.replier)||void 0===e?void 0:e.name)||K.repliedBy||"—"]}),K.repliedAt&&(0,a.jsxs)("span",{className:"text-xs text-gray-500",children:["\xb7 ",new Date(K.repliedAt).toLocaleDateString(C?"ar":"en",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})]})]}),(0,a.jsx)("p",{className:"text-sm text-gray-300 whitespace-pre-wrap",children:K.reply})]}):"CLOSED"!==K.status&&(0,a.jsxs)("div",{children:[(0,a.jsx)("textarea",{value:W,onChange:e=>z(e.target.value),placeholder:y(w.replyPlaceholder,C),rows:4,className:"w-full px-4 py-3 rounded-xl bg-white/[0.03] border border-white/[0.06] text-sm text-white placeholder-gray-500 focus:outline-none focus:border-indigo-500/50 resize-none transition-colors"}),(0,a.jsx)("div",{className:"flex justify-end mt-3",children:(0,a.jsxs)("button",{onClick:et,disabled:I||!W.trim(),className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-indigo-500 hover:bg-indigo-600 text-white text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:[I?(0,a.jsx)(u.Z,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(x.Z,{className:"h-4 w-4"}),y(w.reply,C)]})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 mt-4 pt-4 border-t border-white/[0.06]",children:["CLOSED"!==K.status&&(0,a.jsxs)("button",{onClick:es,className:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm text-gray-400 hover:text-white hover:bg-white/[0.06] border border-white/[0.06] transition-colors",children:[(0,a.jsx)(h.Z,{className:"h-4 w-4"}),y(w.close,C)]}),(0,a.jsxs)("button",{onClick:ea,className:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm text-red-400 hover:text-red-300 hover:bg-red-500/[0.06] border border-red-500/10 transition-colors",children:[(0,a.jsx)(f.Z,{className:"h-4 w-4"}),y(w.delete,C)]})]})]})]})]})]})]})}}},function(e){e.O(0,[9966,1774,2971,8069,1744],function(){return e(e.s=90909)}),_N_E=e.O()}]);