1import{K as X,u as O,l as Q,r as d,x as Y,c as S,m as ee,D as N,a as E,o as n,b as u,h as i,z as g,g as R,e as s,t as o,f as F,i as v,n as _,C as y,F as L,d as z,I as te}from"./DsBqIO5m.js";import{Z as se}from"./BnKUuynb.js";import{Z as ae}from"./CLIoo3Sw.js";import{Z as re}from"./B7HtDI_I.js";import{Z as ne}from"./BTc38dix.js";import{u as le}from"./CdRYCogL.js";import{u as oe}from"./Dq7SsXZo.js";import"./DkkuhfSA.js";import"./N6srsExD.js";import"./BporYn2C.js";const ue={key:0,class:"flex min-h-[320px] items-center justify-center"},ie={key:1},ce={class:"mb-10 flex flex-col gap-5 border-b border-dark-tint-1 pb-8 sm:flex-row sm:items-start sm:justify-between"},de={class:"text-xxl font-text-bold text-light"},me={class:"mt-3 flex flex-wrap items-center gap-2 text-sm text-light-tint-3"},pe={class:"text-light-tint-3"},fe={key:1},xe={class:"flex flex-wrap items-center gap-3"},ve={key:0,class:"opacity-75"},_e=["disabled"],he={class:"space-y-5"},ge={class:"max-w-[calc(100%-52px)] flex-1 sm:max-w-[78%]"},ye={class:"mb-2 flex items-center justify-between gap-4 text-xs"},be={class:"text-light"},ke={class:"text-light-tint-3"},we={key:0,class:"whitespace-pre-line"},Ce=["href"],Ne={key:0,class:"mt-12 rounded-xs border border-dark-tint-1 bg-dark-tint-2 p-5"},Re={class:"mt-10 flex flex-col-reverse gap-9 md:flex-row md:items-center"},Te={key:1,class:"mt-12 rounded-xs border border-dark-tint-1 bg-dark-tint-2 px-5 py-6 text-center text-light-tint-3"},Ze=10*1024*1024,Le=X({__name:"[id]",setup(Be){const U=O(),G=Q(),b=oe(),e=d(null),k=d(!0),w=d(!1),C=d(!1),m=d(""),p=d(null);Y(()=>({title:e.value?`Ù
Ø¯ÛØ±Ûت Ø¯Ø±Ø®ÙØ§Ø³Øª ${e.value.id}`:"Ù
Ø¯ÛØ±Ûت Ø¯Ø±Ø®ÙØ§Ø³Øª"}));const H=S(()=>{var a,l,c,f;return(((l=(a=e.value)==null?void 0:a.user)==null?void 0:l.name)||((f=(c=e.value)==null?void 0:c.user)==null?void 0:f.username)||"Ú©").trim().charAt(0)||"Ú©"}),T=S(()=>{var t,a,l,c;return((a=(t=e.value)==null?void 0:t.user_read_status)==null?void 0:a.value)==="seen"?{icon:"eye",className:"bg-green/15 text-green"}:((c=(l=e.value)==null?void 0:l.user_read_status)==null?void 0:c.value)==="unseen"?{icon:"eye-slash",className:"bg-orange/15 text-orange"}:{icon:"clock",className:"bg-dark-tint-1 text-light-tint-3"}});ee(q);function q(){k.value=!0,b.adminTicket(String(U.params.id)).then(t=>{e.value=t.data}).catch(h).finally(()=>{k.value=!1})}function J(t){var l;const a=((l=t.files)==null?void 0:l[0])||null;if(a&&a.size>Ze){p.value=null,t.value="",h({message:"ØØ¬Ù
ÙØ§ÛÙ Ù¾ÛÙØ³Øª ÙØ¨Ø§Ûد Ø¨ÛØ´ØªØ± از Û±Û° Ù
Ú¯Ø§Ø¨Ø§ÛØª باشد."});return}p.value=a}function K(){if(!m.value.trim()&&!p.value){B({message:"Ù
ت٠پاسخ ÛØ§ ÙØ§ÛÙ Ù¾ÛÙØ³Øª را ÙØ§Ø±Ø¯ Ú©ÙÛØ¯."});return}w.value=!0,b.adminReply(e.value.id,{content:m.value.trim(),attachment:p.value}).then(t=>{e.value=t.data,m.value="",p.value=null,N().$toast.success("پاسخ Ù¾Ø´ØªÛØ¨Ø§ÙÛ Ø§Ø±Ø³Ø§Ù Ø´Ø¯.",{theme:"colored",type:"success"})}).catch(h).finally(()=>{w.value=!1})}function M(){C.value=!0,b.adminClose(e.value.id).then(t=>{e.value=t.data,N().$toast.success("Ø¯Ø±Ø®ÙØ§Ø³Øª بست٠شد.",{theme:"colored",type:"success"})}).catch(h).finally(()=>{C.value=!1})}function Z(t){return le(t)}function W(t){return t==="waiting_for_support"?"bg-primary/15 text-primary":t==="waiting_for_user"?"bg-secondary/15 text-secondary":"bg-dark-tint-1 text-light-tint-3"}function h(t){if(t.status===403){G.replace("/panel/support");return}B(t)}function B(t){N().$toast.error(t.message||"عÙ
ÙÛØ§Øª Ù¾Ø´ØªÛØ¨Ø§ÙÛ Ø§ÙØ¬Ø§Ù
ÙØ´Ø¯.",{theme:"colored",type:"error"})}return(t,a)=>{var V,j,$,A,D,I,P;const l=E("font-awesome-icon"),c=E("RouterLink"),f=te;return k.value?(n(),u("div",ue,[i(g(ne))])):e.value?(n(),u("div",ie,[i(c,{class:"mb-10 flex items-center text-primary",to:"/admin/support"},{default:R(()=>[i(l,{icon:"arrow-right",class:"ml-2 h-4 w-4"}),a[1]||(a[1]=y(" بازگشت ب٠Ù
Ø¯ÛØ±Ûت تÛکتâÙØ§ "))]),_:1}),s("header",ce,[s("div",null,[s("h1",de,o(e.value.title),1),s("div",me,[(V=e.value.user)!=null&&V.id?(n(),F(f,{key:0,to:`/admin/users/${e.value.user.id}`,class:"inline-flex items-center gap-1.5 text-light transition hover:text-primary"},{default:R(()=>{var r,x;return[s("span",null,o(((r=e.value.user)==null?void 0:r.name)||((x=e.value.user)==null?void 0:x.username)||"کاربر"),1),s("small",pe,"#"+o(e.value.user.id),1),i(l,{icon:"external-link-alt",class:"h-2.5 w-2.5"})]}),_:1},8,["to"])):(n(),u("span",fe,o(((j=e.value.user)==null?void 0:j.name)||(($=e.value.user)==null?void 0:$.username)||"کاربر"),1)),(A=e.value.user)!=null&&A.username?(n(),F(f,{key:2,to:`/${encodeURIComponent(e.value.user.username)}`,target:"_blank",rel:"noopener noreferrer",class:"inline-flex text-primary transition hover:text-primary-tint-1",dir:"ltr"},{default:R(()=>[y(" @"+o(e.value.user.username),1)]),_:1},8,["to"])):v("",!0),s("span",null,"· "+o(e.value.department.title),
11)])]),s("div",xe,[s("span",{class:_(["inline-flex items-center gap-1.5 rounded-full px-3 py-1 text-xs",T.value.className])},[i(l,{icon:T.value.icon,class:"h-3 w-3"},null,8,["icon"]),y(" "+o(((D=e.value.user_read_status)==null?void 0:D.title)||"ÙØ§Ù
شخص")+" ",1),((I=e.value.user_read_status)==null?void 0:I.value)==="seen"&&((P=e.value.user_read_status)!=null&&P.seen_at)?(n(),u("small",ve," · "+o(Z(e.value.user_read_status.seen_at)),1)):v("",!0)],2),s("span",{class:_(["rounded-full px-3 py-1 text-xs",W(e.value.status.value)])},o(e.value.status.title),3),e.value.status.value!=="closed"?(n(),u("button",{key:0,type:"button",class:"rounded-xs border border-red px-4 py-2 text-xs text-red transition hover:bg-red hover:text-light",disabled:C.value,onClick:M}," Ø¨Ø³ØªÙ Ø¯Ø±Ø®ÙØ§Ø³Øª ",8,_e)):v("",!0)])]),s("div",he,[(n(!0),u(L,null,z(e.value.messages,r=>(n(),u("article",{key:r.id,class:_(["flex gap-3",r.is_staff?"flex-row-reverse":""])},[s("div",{class:_(["flex h-10 w-10 shrink-0 items-center justify-center rounded-full text-xs font-text-bold",r.is_staff?"bg-secondary text-dark":"bg-primary text-light"])},o(r.is_staff?"د":H.value),3),s("div",ge,[s("div",ye,[s("span",be,o(r.author_name),1),s("span",ke,o(Z(r.created_at)),1)]),s("div",{class:_(["rounded-xs border bg-dark-tint-2 px-5 py-4 leading-7 text-light",r.is_staff?"border-secondary/50":"border-primary/50"])},[r.content?(n(),u("p",we,o(r.content),1)):v("",!0),(n(!0),u(L,null,z(r.attachments,x=>(n(),u("a",{key:x.id,href:x.url,class:"mt-4 flex w-fit items-center gap-2 text-sm text-primary",target:"_blank",rel:"noopener noreferrer"},[i(l,{icon:"paperclip",class:"h-3 w-3"}),a[2]||(a[2]=y(" Ø¯Ø±ÛØ§Ùت ÙØ§ÛÙ Ù¾ÛÙØ³Øª "))],8,Ce))),128))],2)])],2))),128))]),e.value.status.value!=="closed"?(n(),u("div",Ne,[a[3]||(a[3]=s("p",{class:"mb-8 font-text-bold text-light"},"پاسخ Ù¾Ø´ØªÛØ¨Ø§ÙÛ",-1)),i(g(re),{modelValue:m.value,"onUpdate:modelValue":a[0]||(a[0]=r=>m.value=r)},null,8,["modelValue"]),s("div",Re,[i(g(se),{title:"ارسا٠پاسخ",class:"min-w-fit w-fit",loading:w.value,onClicked:K},null,8,["loading"]),i(g(ae),{class:"md:mr-auto md:max-w-[420px]",label:"ÙØ§ÛÙ Ù¾ÛÙØ³Øª: JPGØ PNGØ WEBPØ PDF ÛØ§ TXT (ØØ¯Ø§Ú©Ø«Ø± Û±Û° Ù
Ú¯Ø§Ø¨Ø§ÛØª)",type:"file",accept:".jpg,.jpeg,.png,.webp,.pdf,.txt",onUpload:J})])])):(n(),u("div",Te," اÛÙ Ø¯Ø±Ø®ÙØ§Ø³Øª بست٠شد٠است. "))])):v("",!0)}}});export{Le as default};
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.