1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9091],{68552:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/reservations/[id]",function(){return a(98209)}])},1965:function(e,t,a){"use strict";a.d(t,{Z:function(){return h}});var n=a(47568),s=a(10253),r=a(70655),l=a(85893),i=a(67294),c=a(44389),o=a(84858),d=a(32474),u=["DRAFT","HOST_APPROVAL","SECOND_PAYMENT","DONE"],x={DRAFT:"ثبت Ø¯Ø±Ø®ÙØ§Ø³Øª",HOST_APPROVAL:"تاÛÛØ¯ Ù
ÛØ²Ø¨Ø§Ù",SECOND_PAYMENT:"پرداخت Ù
ÙÙ
اÙ",DONE:"ÙØ·Ø¹Û",CANCEL:"ÙØºÙ",EXPIRED:"Ù
ÙÙØ¶Û"},m={DRAFT:"در Ø§ÙØªØ¸Ø§Ø± ثبت Ø¯Ø±Ø®ÙØ§Ø³Øª",HOST_APPROVAL:"در Ø§ÙØªØ¸Ø§Ø± تاÛÛØ¯ Ù
ÛØ²Ø¨Ø§Ù",SECOND_PAYMENT:"در Ø§ÙØªØ¸Ø§Ø± پرداخت Ù
ÙÙ
اÙ",DONE:"ÙØ·Ø¹Û",CANCEL:"ÙØºÙ شدÙ",EXPIRED:"Ù
ÙÙØ¶Û شدÙ"};function h(e){var t=e.reservationId,a=e.createdAt,h=e.updatedAt,g=e.onCancel,p=e.onChanged,b=function(e,t){if("CANCEL"===e){g();return}C({state:e,label:t}),w(!1),k(""),F(!0),M(null)},f=(0,c.u)("/api/admin/reservations/".concat(t,"/state"),function(e){return(0,o.SC)(e)}),j=f.data,v=f.mutate,y=(0,s.Z)((0,i.useState)(null),2),N=y[0],C=y[1],A=(0,s.Z)((0,i.useState)(!1),2),E=A[0],w=A[1],S=(0,s.Z)((0,i.useState)(""),2),D=S[0],k=S[1],B=(0,s.Z)((0,i.useState)(!0),2),_=B[0],F=B[1],Z=(0,s.Z)((0,i.useState)(!1),2),O=Z[0],T=Z[1],P=(0,s.Z)((0,i.useState)(null),2),I=P[0],M=P[1];if(!j)return(0,l.jsx)(d.Od,{className:"h-[92px]"});var L=u.indexOf(j.current),R="CANCEL"===j.current||"EXPIRED"===j.current,z=new Map(j.allowed.map(function(e){return[e.state,e.label]}));function G(){return(G=(0,n.Z)(function(){var e;return(0,r.__generator)(this,function(a){switch(a.label){case 0:if(!N)return[2];T(!0),M(null),a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,(0,o.SC)("/api/admin/reservations/".concat(t,"/state"),{method:"POST",body:JSON.stringify({toState:N.state,note:D.trim(),notify:_})})];case 2:return a.sent(),C(null),v(),p(),[3,5];case 3:return M((e=a.sent())instanceof Error?e.message:"تغÛÛØ± ÙØ¶Ø¹Ûت Ø§ÙØ¬Ø§Ù
ÙØ´Ø¯"),[3,5];case 4:return T(!1),[7];case 5:return[2]}})})).apply(this,arguments)}return(0,l.jsxs)(d.Zb,{className:"p-16",children:[(0,l.jsxs)("div",{className:"flex items-center gap-x-16 flex-wrap gap-y-12",children:[(0,l.jsx)("div",{className:"flex items-center gap-x-8 shrink-0",children:(0,l.jsx)(d.Ct,{tone:R?"red":"DONE"===j.current?"green":"yellow",children:j.current_label})}),(0,l.jsxs)("div",{className:"flex items-center gap-x-4 flex-1 min-w-[320px] ".concat(R?"opacity-50":""),children:[u.map(function(e,t){var a,n=e===j.current,s=z.has(e),r=!R&&t<L;return(0,l.jsxs)("div",{className:"flex items-center gap-x-4 flex-1 last:flex-initial",children:[(0,l.jsx)("button",{type:"button",disabled:!s,onClick:function(){return b(e,null!==(a=z.get(e))&&void 0!==a?a:m[e])},title:n?"ÙØ¶Ø¹Ûت ÙØ¹ÙÛ":s?"Ø§ÙØªÙا٠ب٠\xab".concat(m[e],"\xbb"):"از ÙØ¶Ø¹Ûت ÙØ¹ÙÛ Ø§ÛÙ Ø§ÙØªÙا٠Ù
جاز ÙÛØ³Øª",className:"px-10 py-6 rounded-8 text-12 leading-18 whitespace-nowrap border transition ".concat(n?"bg-primary-main text-white border-primary-main font-m":r?"bg-primary-light text-primary-dark border-primary-light":"bg-gray-F5F5F7 text-gray-9B9BAA border-gray-F5F5F7"," ").concat(s?"cursor-pointer hover:border-primary-main hover:text-primary-dark":"cursor-default"),children:x[e]}),t<u.length-1&&(0,l.jsx)("div",{className:"h-2 flex-1 rounded-full ".concat(r?"bg-primary-main":"bg-gray-F0F0F0")})]},e)}),z.has("EXPIRED")||R?(0,l.jsx)("span",{className:"mr-10 px-10 py-6 rounded-8 text-12 leading-18 whitespace-nowrap border ".concat(R?"bg-[#FFEBEB] text-[#C62828] border-[#FFEBEB] font-m":"bg-gray-F5F5F7 text-gray-9B9BAA border-gray-F5F5F7"),children:x["EXPIRED"===j.current?"EXPIRED":"CANCEL"]}):null]}),(0,l.jsxs)("span",{className:"text-11 leading-18 text-gray-9B9BAA whitespace-nowrap",children:["ثبت ",(0,d.IY)(a)," \xb7 آخرÛ٠تغÛÛØ± ",(0,d.IY)(h)]})]}),!R&&(0,l.jsx)("p",{className:"mt-10 text-11 leading-18 text-gray-9B9BAA",children:"Ø¨Ø±Ø§Û ØªØºÛÛØ± ÙØ¶Ø¹ÛØªØ Ø±ÙÛ Ù
رØÙÙâÛ Ù
ÙØµØ¯ Ú©ÙÛÚ© Ú©ÙÛØ¯. Ù
راØÙ ØºÛØ±Ùعا٠از ÙØ¶Ø¹Ûت ÙØ¹ÙÛ Ù
جاز ÙÛØ³ØªÙد."}),(0,l.jsx)(d.u_,{open:!!N,onClose:function(){return C(null)}
1,title:E?"ØªÙØ¶ÛØ ØªØºÛÛØ± ÙØ¶Ø¹Ûت":"Ø¢ÛØ§ Ù
Ø·Ù
Ø¦Ù ÙØ³ØªÛدØ",width:"max-w-[520px]",children:E?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("textarea",{value:D,onChange:function(e){return k(e.target.value)},rows:3,placeholder:"ÚØ±Ø§ اÛ٠رزر٠جابÙâØ¬Ø§ Ù
ÛâØ´ÙØ¯Ø",className:"w-full rounded-10 border border-gray-E5E5E6 p-12 text-13 leading-22 outline-none focus:border-primary-main"}),(0,l.jsx)("p",{className:"mt-6 text-11 leading-18 text-gray-9B9BAA",children:"اÛÙ ØªÙØ¶ÛØ Ø¯Ø± ØªØ§Ø±ÛØ®ÚÙâÛ Ø±Ø²Ø±Ù Ø¨Ø§ ÙØ§Ù
Ø´Ù
ا ثبت Ù
ÛâØ´ÙØ¯ ٠پاک ÙÙ
ÛâØ´ÙØ¯."}),(0,l.jsxs)("label",{className:"flex items-start gap-x-10 mt-14 cursor-pointer",children:[(0,l.jsx)("input",{type:"checkbox",checked:_,onChange:function(e){return F(e.target.checked)},className:"w-16 h-16 mt-2 accent-[#03D6BB]"}),(0,l.jsxs)("span",{children:[(0,l.jsx)("span",{className:"block text-13 leading-22 text-black",children:"Ø§Ø·ÙØ§Ø¹âرساÙÛ Ø¨Ù Ù
ÙÙ
ا٠٠Ù
ÛØ²Ø¨Ø§Ù"}),(0,l.jsx)("span",{className:"block text-11 leading-18 text-gray-9B9BAA",children:"Ø§Ø¹ÙØ§Ù درÙÙâØ³Ø§ÛØªÛ ارسا٠Ù
ÛâØ´ÙØ¯. سرÙÛØ³ Ù¾ÛØ§Ù
Ú© ÙÙÙØ² ÙØµÙ ÙÛØ³ØªØ پس ÙØ¹ÙØ§Ù Ù¾ÛØ§Ù
Ú©Û ÙØ±Ø³ØªØ§Ø¯Ù ÙÙ
ÛâØ´ÙØ¯."})]})]}),I&&(0,l.jsx)("p",{className:"mt-10 text-13 text-[#C62828]",children:I}),(0,l.jsxs)("div",{className:"flex justify-end gap-x-8 mt-16",children:[(0,l.jsx)(d.zx,{variant:"secondary",onClick:function(){return w(!1)},children:"بازگشت"}),(0,l.jsx)(d.zx,{disabled:O||D.trim().length<3,onClick:function(){return G.apply(this,arguments)},children:O?"در ØØ§Ù ثبت...":"ثبت تغÛÛØ± ÙØ¶Ø¹Ûت"})]})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("p",{className:"text-14 leading-24 text-black",children:["ÙØ¶Ø¹Ûت اÛ٠رزر٠از \xab",j.current_label,"\xbb ب٠\xab",N&&m[N.state],"\xbb تغÛÛØ± Ù
ÛâÚ©ÙØ¯."]}),(0,l.jsx)("p",{className:"mt-8 text-12 leading-20 text-gray-6C6A7D",children:(null==N?void 0:N.state)==="DONE"?"با اÛ٠کار سÙÙ
Ù
ÛØ²Ø¨Ø§Ù در Ú©ÛÙ Ù¾ÙÙØ´ ثبت Ù
ÛâØ´ÙØ¯.":(null==N?void 0:N.state)==="DRAFT"||(null==N?void 0:N.state)==="EXPIRED"?"با اÛ٠کار شبâÙØ§Û اÛ٠رزر٠در تÙÙÛÙ
آزاد Ù
ÛâØ´ÙÙØ¯.":"Ù
ÙÙØª اÛÙ Ù
رØÙ٠از ØªÙØ¸ÛÙ
ات Ø±Ø²Ø±ÙØ§Ø³ÛÙÙ Ø¯ÙØ¨Ø§Ø±Ù ØªÙØ¸ÛÙ
Ù
ÛâØ´ÙØ¯."}),(0,l.jsxs)("div",{className:"flex justify-end gap-x-8 mt-16",children:[(0,l.jsx)(d.zx,{variant:"secondary",onClick:function(){return C(null)},children:"Ø§ÙØµØ±Ø§Ù"}),(0,l.jsx)(d.zx,{onClick:function(){return w(!0)},children:"بÙÙØ اداÙ
Ù"})]})]})})]})}},98209:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return ed}});var n=a(47568),s=a(10253),r=a(70655),l=a(85893),i=a(67294),c=a(41664),o=a.n(c),d=a(11163),u=a(44389),x=a(49759),m=a(84858),h=a(35157),g=a(26042),p=a(32474),b=[{value:"GUEST_CANCELLED",label:"Ù
ÙÙ
اÙ"},{value:"HOST_CANCELLED",label:"Ù
ÛØ²Ø¨Ø§Ù"},{value:"LIDOMA_CANCELLED",label:"ÙÛØ¯ÙÙ
ا (Ø³Ø§ÛØª)"}],f=[{value:"BOTH",label:"ÙØ± دÙ",hint:"Ù
ÙÙ
ا٠٠Ù
ÛØ²Ø¨Ø§Ù ÙØ± د٠خبر Ù
ÛâØ´ÙÙØ¯"},{value:"ONLY_GUEST",label:"ÙÙØ· Ù
ÙÙ
اÙ",hint:"Ù
ÛØ²Ø¨Ø§Ù Ù¾ÛØ§Ù
Û Ø¯Ø±ÛØ§Ùت ÙÙ
ÛâÚ©ÙØ¯"},{value:"ONLY_HOST",label:"ÙÙØ· Ù
ÛØ²Ø¨Ø§Ù",hint:"Ù
ÙÙ
Ø§Ù Ù¾ÛØ§Ù
Û Ø¯Ø±ÛØ§Ùت ÙÙ
ÛâÚ©ÙØ¯"},{value:"NONE",label:"ÙÛÚâکداÙ
",hint:"ÙØ¨Ùا٠تÙÙÙÛ ÙÙ
اÙÙÚ¯ شدÙ"}],j={GUEST_CANCELLED:["از Ø§ÙØ¬Ø§Ù
Ø³ÙØ± Ù
ÙØµØ±Ù شدÙ
","تأÛÛØ¯ Ù
ÛØ²Ø¨Ø§Ù Ø®ÛÙÛ Ø·ÙÙ Ú©Ø´ÛØ¯","در ثبت Ø§Ø·ÙØ§Ø¹Ø§Øª Ø¯ÚØ§Ø± اشتبا٠شدÙâØ§Ù
","Ø§ÙØ§Ù
تگا٠دÛÚ¯Ø±Û Ø¯Ø± ÙÛØ¯ÙÙ
ا Ù¾ÛØ¯Ø§ کردÙ
","با ÙÛÙ
ت تÙ
اÙ
âØ´Ø¯Ù Ø±Ø²Ø±Ù Ù
شک٠داشتÙ
","در پرداخت Ù
شک٠داشتÙ
"],HOST_CANCELLED:["Ø§ÙØ§Ù
تگا٠آÙ
اد٠ÙÛØ³Øª","ÙØ¨ÙØ§Ù Ø±Ø²Ø±Ù Ø´Ø¯Ù Ø¨ÙØ¯","Ù
Ø³Ø§ÙØ± Ø¯ÛØ± پرداخت کرد","Ù
Ø´Ú©Ù ÙÙÛ Ø¯Ø± Ø§ÙØ§Ù
تگاÙ"],LIDOMA_CANCELLED:["ÙÙ
اÙÙÚ¯Û Ø¨Ø§ Ù
ÛØ²Ø¨Ø§Ù","ÙÙ
اÙÙÚ¯Û Ø¨Ø§ Ù
ÙÙ
اÙ","تخÙÙ Ù
ÛØ²Ø¨Ø§Ù","تخÙÙ Ù
ÙÙ
اÙ","عدÙ
پاسخگÙÛÛ Ù
ÛØ²Ø¨Ø§Ù"]};function v(e){var t=e.reservationId,a=e.reference,c=e.open,o=e.onClose,d=e.onCancelled,x=(0,s.Z)((0,i.useState)("LIDOMA_CANCELLED"),2),h=x[0],v=x[1],N=(0,s.Z)((0,i.useState)(""),2),C=N[0],A=N[1],E=(0,s.Z)((0,i.useState)(""),2),w=E[0],S=E[1],D=(0,s.Z)((0,i.useState)(!1),2),k=D[0],B=D[1],_=(0,s.Z)((0,i.useState)(!1),2),F=_[0],Z=_[1],O=(0,s.Z)((0,i.useState)(""),2),T=O[0],P=O[1],I=(0,s.Z)((0,i.useState)("BOTH"),2),M=I[0],L=I[1],R=(0,s.Z)((0,i.useState)(""),2),z=R[0],G=R[1],Y=(0,s.Z)((0,i.useState)(!1),2),H=Y[0],U=Y[1],J=(0,s.Z)((0,i.useState)(null),2),V=J[0],W=J[1];(0,i.useEffect)(function(){A("")},[h]);var X=z.trim()?(0,p.EU)(z):null,K=new URLSearchParams((0,g.Z)({cancelledBy:h},k?{justified:"true"}:{},F?{withoutPayback:"true"}:{},null!=X?{penaltyOverride:String(X)}:{})),q=(0,u.u)(c?"/api/admin/reservations/".concat(t,"/cancel-quote?").concat(K.toString()):null,function(e){return(0,m.SC)(e)}).data;function Q(){return(Q=(0,n.Z)(function(){var e;return(0,r.__generator)(this,function(a){switch(a.label){case 0:U(!0),W(null),a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,(0,m.SC)("/api/admin/reservations/".concat(t,"/cancel"),{method:"POST",body:JSON.stringify({cancelledBy:h,reason:C.trim(),desc:w.trim()||null,justified:k,withoutPayback:F,c
1oordinatedWith:T||null,notifyMode:M,penaltyOverride:X})})];case 2:return a.sent(),d(),o(),[3,5];case 3:return W((e=a.sent())instanceof Error?e.message:"ÙØºÙ Ø§ÙØ¬Ø§Ù
ÙØ´Ø¯"),[3,5];case 4:return U(!1),[7];case 5:return[2]}})})).apply(this,arguments)}return(0,l.jsxs)(p.u_,{open:c,onClose:o,title:"ÙØºÙ رزر٠".concat(a),width:"max-w-[860px]",children:[(0,l.jsxs)("div",{className:"grid gap-16 md:grid-cols-[1fr_300px] items-start",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-y-14",children:[(0,l.jsx)(p.gN,{label:"ÙØºÙ ØªÙØ³Ø·",children:(0,l.jsx)(p.Ph,{value:h,onChange:function(e){return v(e.target.value)},children:b.map(function(e){return(0,l.jsx)("option",{value:e.value,children:e.label},e.value)})})}),(0,l.jsx)(p.gN,{label:"Ø¹ÙØª ÙØºÙ",children:(0,l.jsxs)(p.Ph,{value:C,onChange:function(e){return A(e.target.value)},children:[(0,l.jsx)("option",{value:"",children:"Ø§ÙØªØ®Ø§Ø¨ Ú©ÙÛØ¯â¦"}),j[h].map(function(e){return(0,l.jsx)("option",{value:e,children:e},e)}),(0,l.jsx)("option",{value:"Ø³Ø§ÛØ± Ù
ÙØ§Ø±Ø¯",children:"Ø³Ø§ÛØ± Ù
ÙØ§Ø±Ø¯"})]})}),(0,l.jsx)(p.gN,{label:"ØªÙØ¶ÛØ Ø¯Ø§Ø®ÙÛ (ÙÙØ· Ø¨Ø±Ø§Û ØªÛÙ
Ù¾Ø´ØªÛØ¨Ø§ÙÛ)",children:(0,l.jsx)(p.II,{value:w,onChange:function(e){return S(e.target.value)}})}),"LIDOMA_CANCELLED"===h&&(0,l.jsx)(p.gN,{label:"با ÙÙ
اÙÙÚ¯Û",children:(0,l.jsxs)(p.Ph,{value:T,onChange:function(e){return P(e.target.value)},children:[(0,l.jsx)("option",{value:"",children:"â"}),(0,l.jsx)("option",{value:"guest",children:"Ù
ÙÙ
اÙ"}),(0,l.jsx)("option",{value:"host",children:"Ù
ÛØ²Ø¨Ø§Ù"})]})}),(0,l.jsxs)("div",{className:"rounded-10 bg-gray-F5F5F7 p-12 flex flex-col gap-y-10",children:[(0,l.jsxs)("label",{className:"flex items-start gap-x-10 cursor-pointer",children:[(0,l.jsx)(p.ZD,{checked:k,onChange:B}),(0,l.jsxs)("span",{children:[(0,l.jsx)("span",{className:"block text-14 leading-20 text-black",children:"Ú©ÙØ³ÙÛ Ù
ÙØ¬Ù"}),(0,l.jsx)("span",{className:"block text-11 leading-18 text-gray-9B9BAA",children:"Ú©Ø³Ø±Û Ø§Ø¹Ù
ا٠ÙÙ
ÛâØ´ÙØ¯ Ù Ú©Ù Ù
Ø¨ÙØº Ù¾Ø±Ø¯Ø§Ø®ØªÛ Ø¨Ù Ù
ÙÙ
ا٠برÙ
Ûâگردد."})]})]}),(0,l.jsxs)("label",{className:"flex items-start gap-x-10 cursor-pointer",children:[(0,l.jsx)(p.ZD,{checked:F,onChange:Z}),(0,l.jsxs)("span",{children:[(0,l.jsx)("span",{className:"block text-14 leading-20 text-black",children:"عدÙ
بازگشت ÙØ¬Ù ب٠Ù
شترÛ"}),(0,l.jsx)("span",{className:"block text-11 leading-18 text-gray-9B9BAA",children:"ÙÛÚ Ù
Ø¨ÙØºÛ ب٠Ù
ÙÙ
ا٠برÙÙ
Ûâگردد. تصÙ
ÛÙ
Ø§Ø³ØªØ ÙÙ Ù
ØØ§Ø³Ø¨Ù."})]})]})]}),(0,l.jsxs)(p.gN,{label:"Ù
Ø¨ÙØº کسر Ø¯Ø³ØªÛ (Ø§Ø®ØªÛØ§Ø±Û â ØªÙÙ
اÙ)",children:[(0,l.jsx)(p.II,{inputMode:"numeric",value:X?X.toLocaleString("fa-IR"):"",onChange:function(e){return G(e.target.value)},placeholder:"طب٠Ù
ÙØ±Ø±Ø§Øª Ù
ØØ§Ø³Ø¨Ù Ù
ÛâØ´ÙØ¯"}),(0,l.jsx)("p",{className:"mt-6 text-11 leading-18 text-gray-9B9BAA",children:"Ø¨Ø±Ø§Û Ø±Ø²Ø±ÙÙØ§Û بÙÙØ¯Ù
دت Ù Ø§ÛØ§Ù
Ù¾ÛÚ© ک٠طب٠Ù
ÙØ±Ø±Ø§Øª \xabبا ØªÙØ§ÙÙ Ù
ÛØ²Ø¨Ø§Ù\xbb تعÛÛÙ Ù
ÛâØ´ÙÙØ¯."})]}),(0,l.jsx)(p.gN,{label:"ÙØÙÙ Ø§Ø±Ø³Ø§Ù Ù¾ÛØ§Ù
ÙØºÙ",children:(0,l.jsx)("div",{className:"grid grid-cols-2 gap-8",children:f.map(function(e){return(0,l.jsxs)("button",{type:"button",onClick:function(){return L(e.value)},"aria-pressed":M===e.value,className:"text-right px-12 py-10 rounded-10 border transition ".concat(M===e.value?"border-primary-main bg-primary-light":"border-gray-E5E5E6 hover:border-gray-C4CAD3"),children:[(0,l.jsx)("span",{className:"block text-13 leading-20 text-black",children:e.label}),(0,l.jsx)("span",{className:"block text-11 leading-16 text-gray-9B9BAA",children:e.hint})]},e.value)})})})]}),(0,l.jsxs)("div",{className:"rounded-12 border border-gray-E5E5E6 p-14 sticky top-0",children:[(0,l.jsx)("h4",{className:"text-14 leading-22 font-m text-black mb-2",children:"ØµÙØ±ØªØØ³Ø§Ø¨ ÙØºÙ"}),q?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(p.Ct,{tone:q.penalty>0?"yellow":"green",children:q.bandLabel}),(0,l.jsxs)("div",{className:"mt-12 flex flex-col gap-y-6 text-12 leading-20",children:[(0,l.jsx)(y,{label:"Ù
Ø¨ÙØº ک٠اجارÙ",value:q.totalAmount}),(0,l.jsx)(y,{label:"Ù¾Ø±Ø¯Ø§Ø®ØªÛ Ù
ÙÙ
اÙ",value:q.paidAmount}),(0,l.jsx)("div",{className:"border-t border-dashed border-gray-E5E5E6 my-4"}),(0,l.jsx)(y,{label:"کسر",value:q.penalty,tone:"red"}),(0,l.jsx)(y,{label:"بازگشت ب٠Ù
ÙÙ
اÙ",value:q.refund,tone:"green",strong:!0}),(0,l.jsx)("div",{className:"border-t border-dashed border-gray-E5E5E6 my-4"}),(0,l.jsx)(y,{label:"سÙÙ
Ù
ÛØ²Ø¨Ø§Ù از کسر",value:q.hostShare}),(0,l.jsx)(y,{label:"سÙÙ
Ø³Ø§ÛØª از کسر",value:q.siteShare})]}),(0,l.jsx)("ul",{className:"mt-12 flex flex-col gap-y-4",children:q.explanation.map(function(e,t){return(0,l.jsxs)("li",{className:"text-11 leading-18 text-gray-6C6A7D",children:["\xb7 ",e]},t)})}),(0,l.jsx)("p",{className:"mt-10 text-11 leading-18 text-gray-9B9BAA",children:q.hoursToCheckIn>0?"".concat((0,p.N)(q.hoursToCheckIn)," ساعت تا Ø´Ø±ÙØ¹ Ø§ÙØ§Ù
ت"):"Ø§ÙØ§Ù
ت Ø´Ø±ÙØ¹ شد٠است"})]}):(0,l.jsx)("p",{className:"text-12 text-gray-9B9BAA",children:"در ØØ§Ù Ù
ØØ§Ø³Ø¨Ùâ¦"})]})]}),!!V&&(0,l.jsx)("p",{className:"mt-12 text-13 text-[#C62828]",children:V}),(0,l.jsxs)("div",{className:"flex justify-end gap-x-10 mt-16",children:[(0,l.jsx)(p.zx,{variant:"secondary",onClick:o,children:"Ø§ÙØµØ±Ø§Ù"}),(0,l.jsx)(p.zx,{variant:"danger",disabled:H||!C.trim(),onClick:function(){return Q.apply(this,arguments)},children:H?"در ØØ§Ù ÙØºÙ...":"ÙØºÙ رزرÙ"})]})]})}function y(e){var t=e.label,a=e.value,n=e.tone,s=e.strong;return(0,l.jsxs)("div",{className:"flex items-baseline justify-between gap-x-10",children:[(0,l.jsx)("span",{className:"text-gray-6C6A7D",children:t}),(0,l.jsx)("span",{className:"whitespace-nowrap ".concat(s?"font-m":""," ").concat("red"===n?"text-[#C62828]":"green"===n?"text-[#2E7D32]":"text-black"),children:(0,p.N)(a)})]})}var N=a(1965),C=[{kind:"HOST_INFO_TO_GUEST",label:"Ø§Ø·ÙØ§Ø¹Ø§Øª Ù
ÛØ²Ø¨Ø§Ù ب٠Ù
ÙÙ
اÙ"},{kind:"GUEST_INFO_TO_HOST",label:"Ø§Ø·ÙØ§Ø¹Ø§Øª Ù
ÙÙ
ا٠ب٠Ù
ÛØ²Ø¨Ø§Ù"},{kind:"RESIDENCE_LINK_TO_GUEST",label:"ÙÛÙÚ© Ø§ÙØ§Ù
تگاÙ"},{kind:"VOUCHER_TO_HOST",label:"ÙÚØ± ب٠Ù
ÛØ²Ø¨Ø§Ù"},{kind:"PAYMENT_LINK_TO_GUEST",label:"ÙÛÙÚ© پرداخت"},{kind:"CARD_NUMBER_TO_GUEST",label:"Ø´Ù
ار٠کارت"},{kind:"REVIEW_LINK_TO_GUEST",label:"ÙÛÙÚ© ÙØ¸Ø±Ø³ÙجÛ"}];function A(e){var t=e.reservationId,a=e.onActed,c=(0,s.Z)((0,i.useState)(!1),2),o=c[0],d=c[1],u=(0,s.Z)((0,i.useState)(null),2),x=u[0],h=u[1],g=(0,s.Z)((0,i.useState)(null),2),b=g[0],f=g[1],j=(0,s.Z)((0,i.useState)(null),2),v=j[0],y=j[1],N=(0,i.useRef)(null);function A(){return(A=(0,n.Z)(function(e,n){var s,l,i;return(0,r.__generator)(this,function(r){switch(r.label){case 0:h(e),y(null),f(null),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,(0,m.SC)("/api/admin/reservations/".concat(t,"/actions"),{method:"POST",body:JSON.stringify({kind:e})})];case 2:return l=r.sent(),f("".concat(n," ارسا٠شد â ").concat((null==l?void 0:null===(s=l.sms)||void 0===s?void 0:s.sent)?"Ù¾ÛØ§Ù
Ú© Ù Ø§Ø¹ÙØ§Ù":"ÙÙØ· Ø§Ø¹ÙØ§Ù Ø¯Ø§Ø®Ù Ø³Ø§ÛØª")),d(!1),a(),setTimeout(function(){return f(null)},4e3),[3,5];case 3:return y((i=r.sent())instanceof Error?i.message:"Ø§Ø±Ø³Ø§Ù ÙØ´Ø¯"),[3,5];case 4:return h(null),[7];case 5:return[2]}})})).apply(this,arguments)}return(0,i.useEffect)(function(){var e=function(e){var t;(null===(t=N.current)||void 0===t?void 0:t.contains(e.target))||d(!1)},t=function(e){"Escape"===e.key&&d(!1)};if(o)return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),function(){document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[o]),(0,l.jsxs)("div",{ref:N,className:"relative",children:[(0,l.jsxs)(p.zx,{variant:"secondary",onClick:function(){return d(function(e){return!e})},"aria-expanded":o,children:[(0,l.jsx)("i",{className:"icon-SendMessage text-16"})," Ø§Ø±Ø³Ø§Ù Ù¾ÛØ§Ù
",(0,l.jsx)("i",{className:"icon-FlashDown text-14 transition ".concat(o?"rotate-180":"")})]}),o&&(0,l.jsxs)("div",{className:"absolute z-3 mt-6 left-0 w-[248px] bg-white rounded-12 border border-gray-E5E5E6 shadow-[0_6px_16px_0px_rgba(8,19,56,0.12)] p-6",children:[(0,l.jsx)("p",{className:"px-10 py-6 text-11 leading-18 text-gray-9B9BAA",children:"ÙØ± ارسا٠در ØªØ§Ø±ÛØ®Ú٠ثبت Ù
ÛâØ´ÙØ¯"}),C.map(function(e){return(0,l.jsx)("button",{type:"button",disabled:x===e.kind,onClick:function(){return function(e,t){return A.apply(this,arguments)}(e.kind,e.label)},className:"w-full text-right px-10 py-8 rounded-10 text-13 leading-20 text-gray-6C6A7D hover:bg-gray-F7F7F7 hover:text-black transition disabled:opacity-50",children:x===e.kind?"در ØØ§Ù ارساÙ...":e.label},e.kind)}),v&&(0,l.jsx)("p",{className:"px-10 py-6 text-12 text-[#C62828]",children:v})]}),b&&(0,l.jsx)("span",{className:"absolute top-full right-0 mt-6 whitespace-nowrap rounded-8 bg-[#03D6BB14] text-[#015046] text-12 leading-20 px-10 py-4",children:b})]})}var E=a(7092),w=a(36305),S=a(68289),D=a.n(S),k=["ÙØ±ÙردÛÙ","Ø§Ø±Ø¯ÛØ¨Ùشت","خرداد","ØªÛØ±","Ù
رداد","Ø´ÙØ±ÛÙØ±","Ù
ÙØ±","آباÙ","آذر","دÛ","بÙÙ
Ù","اسÙÙØ¯"],B=function(e){return String(e).replace(/[0-9]/g,function(e){return"Û°Û±Û²Û³Û´ÛµÛ¶Û·Û¸Û¹"[Number(e)]})};function _(e){var t,a,c,o,d,x=e.open,h=e.onClose,b=e.reservationId,f=e.reference,j=e.residenceId,v=e.startDate,y=e.endDate,N=e.onSaved,C=function(e,t){if(er){var a=(0,g.Z)({},E),n=!0,s=!1,r=void 0;try{for(var l,i=er.nights[Symbol.iterator]();!(n=(l=i.next()).done);
1n=!0){var c=l.value;F(c,e)&&(a[c.date]=t)}}catch(e){s=!0,r=e}finally{try{n||null==i.return||i.return()}finally{if(s)throw r}}S(a)}},A=(0,s.Z)((0,i.useState)({}),2),E=A[0],S=A[1],_=(0,s.Z)((0,i.useState)(new Set),2),P=_[0],I=_[1],M=(0,s.Z)((0,i.useState)(0),2),L=M[0],R=M[1],z=(0,s.Z)((0,i.useState)(""),2),G=z[0],Y=z[1],H=(0,s.Z)((0,i.useState)("both"),2),U=H[0],J=H[1],V=(0,s.Z)((0,i.useState)(""),2),W=V[0],X=V[1],K=(0,s.Z)((0,i.useState)(!1),2),q=K[0],Q=K[1],$=(0,s.Z)((0,i.useState)(null),2),ee=$[0],et=$[1],ea=v.slice(0,10),en=y.slice(0,10);(0,i.useEffect)(function(){x&&(R(D()(ea,"YYYY-MM-DD").diff(D()().startOf("jMonth"),"months")),S({}),I(new Set),X(""),et(null),J("both"))},[x,ea]);var es=JSON.stringify(E),er=(0,u.u)(x?"/api/admin/reservations/".concat(b,"/reprice"):null,function(e){return(0,m.SC)(e)}).data,el=(0,u.u)(x?["/api/admin/reservations/".concat(b,"/reprice/preview"),es]:null,function(e){var t=(0,s.Z)(e,2),a=t[0],n=t[1];return(0,m.SC)(a,{method:"POST",body:JSON.stringify({draft:JSON.parse(n)})})},{keepPreviousData:!0}),ei=el.data,ec=el.isLoading,eo=(0,i.useMemo)(function(){return D()().add(L,"jMonth")},[L]),ed=eo.clone().startOf("jMonth").format("YYYY-MM-DD"),eu=eo.clone().endOf("jMonth").format("YYYY-MM-DD"),ex=(0,u.u)(x?"/api/admin/residences/".concat(j,"/calendar?from=").concat(ed,"&to=").concat(eu):null,function(e){return(0,m.SC)(e)}).data,em=null!==(t=null==ex?void 0:ex.days)&&void 0!==t?t:[],eh=(eo.clone().startOf("jMonth").day()+1)%7,eg=Object.entries(E).sort(function(e,t){var a=(0,s.Z)(e,1)[0],n=(0,s.Z)(t,1)[0];return a.localeCompare(n)}),ep=eg.length>0,eb=function(e){var t,n;return null!==(c=null!==(a=null===(t=null==er?void 0:er.nights.find(function(t){return t.date===e}))||void 0===t?void 0:t.unitPrice)&&void 0!==a?a:null===(n=em.find(function(t){return t.date===e}))||void 0===n?void 0:n.effective_price)&&void 0!==c?c:0};function ef(){return(ef=(0,n.Z)(function(){var e,t,a,n,l,i,c,o,d,u,x,p,f,v,y,C,A,S,D,k;return(0,r.__generator)(this,function(r){switch(r.label){case 0:if(!ep||W.trim().length<3)return[2];Q(!0),et(null),r.label=1;case 1:if(r.trys.push([1,12,13,14]),!("calendar"===U||"both"===U))return[3,9];e=new Map,t=!0,a=!1,n=void 0;try{for(l=eg[Symbol.iterator]();!(t=(i=l.next()).done);t=!0)o=(c=(0,s.Z)(i.value,2))[0],d=c[1],e.set(d,(0,w.Z)(null!==(u=e.get(d))&&void 0!==u?u:[]).concat([o]))}catch(e){a=!0,n=e}finally{try{t||null==l.return||l.return()}finally{if(a)throw n}}x=!0,p=!1,f=void 0,r.label=2;case 2:r.trys.push([2,7,8,9]),v=e[Symbol.iterator](),r.label=3;case 3:if(x=(y=v.next()).done)return[3,6];return A=(C=(0,s.Z)(y.value,2))[0],S=C[1],[4,(0,m.SC)("/api/admin/residences/".concat(j,"/calendar"),{method:"PATCH",body:JSON.stringify({dates:S,specialPrice:A})})];case 4:r.sent(),r.label=5;case 5:return x=!0,[3,3];case 6:return[3,9];case 7:return D=r.sent(),p=!0,f=D,[3,9];case 8:try{x||null==v.return||v.return()}finally{if(p)throw f}return[7];case 9:if(!("reservation"===U||"both"===U))return[3,11];return[4,(0,m.SC)("/api/admin/reservations/".concat(b,"/reprice"),{method:"POST",body:JSON.stringify((0,g.Z)({note:W.trim()},"reservation"===U?{draft:E}:{}))})];case 10:r.sent(),r.label=11;case 11:return N(),h(),[3,14];case 12:return et((k=r.sent())instanceof Error?k.message:"Ø°Ø®ÛØ±Ù ÙØ´Ø¯"),[3,14];case 13:return Q(!1),[7];case 14:return[2]}})})).apply(this,arguments)}var ej=(0,p.EU)(G);return(0,l.jsx)(p.u_,{open:x,onClose:h,title:"ÙÛØ±Ø§ÛØ´ ÙÛÙ
ت رزر٠".concat(f),width:"max-w-[1180px]",children:ec&&!ei?(0,l.jsx)(p.Od,{className:"h-[420px]"}):ei?(0,l.jsxs)("div",{className:"grid lg:grid-cols-14 gap-16 items-start",children:[(0,l.jsxs)("section",{className:"lg:col-span-4 rounded-16 border border-gray-E5E5E6 p-16 min-w-0",children:[(0,l.jsx)("h4",{className:"text-14 leading-22 font-m text-black mb-2",children:"ÙØ±Ø®âÙØ§Û Ù
ØØ§Ø³Ø¨ÙâØ´Ø¯Ù"}),(0,l.jsx)("p",{className:"text-11 leading-18 text-gray-9B9BAA mb-12",children:"ÙÙ
ا٠ÚÛØ²Û Ú©Ù Ù
ÙÙ
ا٠در ÙØ±Ù
Ø±Ø²Ø±Ù Ø¯ÛØ¯. تغÛÛØ± ÙØ± ÙØ±Ø® رÙÛ ÙÙ
ÙâÛ Ø´Ø¨âÙØ§Û Ø¢Ù ÙÙØ¹ اعÙ
ا٠Ù
ÛâØ´ÙØ¯."}),(0,l.jsx)("div",{className:"flex flex-col gap-y-10",children:(null!==(o=null==er?void 0:er.buckets)&&void 0!==o?o:ei.buckets).map(function(e){return(0,l.jsx)(Z,{bucket:e,draftPrice:function(e,t,a){var n=new Set,s=!0,r=!1,l=void 0;try{for(var i,c=t[Symbol.iterator]();!(s=(i=c.next()).done);s=!0){var o,d=i.value;F(d,e)&&n.add(null!==(o=a[d.date])&&void 0!==o?o:d.unitPrice)}}catch(e){r=!0,l=e}finally{try{s||null==c.return||c.return()}finally{if(r)throw l}}return 0===n.size?e.unit_price:n.size>1?null:(0,w.Z)(n)[0]}(e,null!==(d=null==er?void 0:er.nights)&&void 0!==d?d:[],E),onChange:function(t){return C(e,t)},editable:!!er&&"extra-guests"!==e.key},e.key)})}),ei.totals.discount_amount>0&&(0,l.jsxs)("div",{className:"flex items-center justify-between mt-12 text-12 leading-20",children:[(0,l.jsxs)("span",{className:"text-gray-6C6A7D",children:["تخÙÛÙ Ø§ÙØ§Ù
ت بÙÙØ¯Ù
دت \xb7 ",(0,p.N)(ei.totals.discount_percent),"Ùª"]}),(0,l.jsxs)("span",{className:"text-[#C62828]",children:["â ",(0,p.N)(ei.totals.discount_amount)]})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between gap-x-12 mt-12 rounded-10 bg-gray-F5F5F7 px-12 py-10",children:[(0,l.jsx)("span",{className:"text-12 leading-20 text-gray-6C6A7D",children:"Ù
Ø¨ÙØº رزرÙ"}),(0,l.jsx)("b",{className:"text-14 leading-24 font-m text-black",children:(0,p.ND)(ei.totals.reservation_amount)})]}),(0,l.jsx)("p",{className:"mt-10 text-11 leading-18 text-gray-9B9BAA",children:"ÙØ±Ø® ÙÙØ± اضاÙ٠از ØªÙØ¸ÛÙ
ات Ø®ÙØ¯ Ø§ÙØ§Ù
تگا٠Ù
ÛâØ¢ÛØ¯ ٠از اÛÙØ¬Ø§ تغÛÛØ± ÙÙ
ÛâÚ©ÙØ¯."})]}),(0,l.jsxs)("section",{className:"lg:col-span-6 rounded-16 border border-gray-E5E5E6 p-16 min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between gap-x-10 mb-12",children:[(0,l.jsx)(p.zx,{variant:"secondary",onClick:function(){return R(function(e){return e-1})},children:"Ù
Ø§Ù ÙØ¨Ù"}),(0,l.jsxs)("span",{className:"text-14 font-m text-black",children:[k[eo.jMonth()]," ",B(eo.jYear())]}),(0,l.jsx)(p.zx,{variant:"secondary",onClick:function(){return R(function(e){return e+1})},children:"Ù
ا٠بعد"})]}),(0,l.jsx)("div",{className:"grid grid-cols-7 gap-4 mb-4",children:["Ø´","Û","د","س","Ú","Ù¾","ج"].map(function(e){return(0,l.jsx)("div",{className:"text-center text-11 text-gray-9B9BAA py-2",children:e},e)})}),(0,l.jsxs)("div",{className:"grid grid-cols-7 gap-4",children:[Array.from({length:eh}).map(function(e,t){return(0,l.jsx)("div",{},"blank-".concat(t))}),em.map(function(e){var t,a,n,s=e.date>=ea&&e.date<en,r=P.has(e.date),i=void 0!==E[e.date],c=i?E[e.date]:e.effective_price;return(0,l.jsxs)("button",{type:"button",onClick:function(){return I(function(t){var a=new Set(t);return a.has(e.date)?a.delete(e.date):a.add(e.date),a})},title:s?"شب اÛ٠رزرÙ":null!==(n=null===(a=e.reservation)||void 0===a?void 0:a.reference)&&void 0!==n?n:"",className:"relative rounded-10 border p-6 text-right transition min-h-[58px] ".concat(r?"border-primary-main bg-primary-light":i?"border-[#B26A00] bg-[#FFF4E0]":"border-gray-E5E5E6 bg-white hover:border-gray-C4CAD3"," ").concat(s?"ring-2 ring-primary-main ring-offset-1":""),children:[(0,l.jsx)("span",{className:"block text-12 leading-18 text-black",children:(t=e.date,B(D()(t,"YYYY-MM-DD").format("jD")))}),(0,l.jsxs)("span",{className:"block text-10 leading-14 ".concat(i?"text-[#B26A00] font-m":"text-gray-6C6A7D"),children:[(0,p.N)(Math.round(c/1e3)),"k"]}),e.reservation&&!s&&(0,l.jsx)("span",{className:"absolute top-4 left-4 w-6 h-6 rounded-full bg-gray-C4CAD3"})]},e.date)})]}),(0,l.jsxs)("div",{className:"flex items-center gap-x-8 flex-wrap gap-y-8 mt-12",children:[(0,l.jsx)("span",{className:"text-12 leading-20 text-gray-6C6A7D",children:P.size>0?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("b",{children:(0,p.N)(P.size)})," Ø±ÙØ² Ø§ÙØªØ®Ø§Ø¨ شدÙ"]}):"Ø±ÙØ²Ùا را Ø§ÙØªØ®Ø§Ø¨ Ú©ÙÛØ¯"}),(0,l.jsx)(p.zx,{variant:"secondary",onClick:function(){return I(new Set(em.filter(function(e){return e.date>=ea&&e.date<en}).map(function(e){return e.date})))},children:"شبâÙØ§Û اÛ٠رزرÙ"}),P.size>0&&(0,l.jsx)(p.zx,{variant:"secondary",onClick:function(){return I(new Set)},children:"پاک کردÙ"})]}),(0,l.jsxs)("div",{className:"flex items-end gap-x-8 mt-10",children:[(0,l.jsxs)("label",{className:"flex-1 min-w-0",children:[(0,l.jsx)("span",{className:"block mb-4 text-11 leading-18 text-gray-6C6A7D",children:"ÙØ±Ø® Ø±ÙØ²ÙØ§Û Ø§ÙØªØ®Ø§Ø¨âشد٠(تÙÙ
اÙ)"}),(0,l.jsx)("input",{inputMode:"numeric",value:ej?ej.toLocaleStr
1ing("fa-IR"):"",onChange:function(e){return Y(e.target.value)},placeholder:"Ù
Ø«ÙØ§Ù ÛµÙ¬Û°Û°Û°Ù¬Û°Û°Û°",className:"w-full px-12 py-8 rounded-10 border border-gray-E5E5E6 text-13 leading-22 outline-none focus:border-primary-main"})]}),(0,l.jsx)(p.zx,{disabled:0===P.size||ej<=0,onClick:function(){var e=(0,p.EU)(G);if(e&&0!==P.size){var t=(0,g.Z)({},E);P.forEach(function(a){return t[a]=e}),S(t),I(new Set),Y("")}},children:"اعÙ
اÙ"})]}),(0,l.jsx)("p",{className:"mt-8 text-11 leading-18 text-gray-9B9BAA",children:"ØÙÙÙâÛ Ø±ÙÚ¯Û = شبâÙØ§Û اÛ٠رزر٠\xb7 زرد = تغÛÛØ± Ø°Ø®ÛØ±ÙâÙØ´Ø¯Ù"})]}),(0,l.jsxs)("section",{className:"lg:col-span-4 rounded-16 border border-gray-E5E5E6 p-16 min-w-0 flex flex-col",children:[(0,l.jsx)("h4",{className:"text-14 leading-22 font-m text-black mb-2",children:"تغÛÛØ±Ø§Øª"}),ep?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"max-h-[132px] overflow-y-auto rounded-10 border border-gray-F0F0F0 divide-y divide-gray-F0F0F0 mb-12",children:eg.map(function(e){var t,a=(0,s.Z)(e,2),n=a[0],r=a[1],i=eb(n);return(0,l.jsxs)("div",{className:"flex items-center justify-between px-10 py-6 text-12 leading-20",children:[(0,l.jsx)("span",{className:"text-gray-6C6A7D",children:(t=D()(n,"YYYY-MM-DD"),"".concat(B(t.format("jD"))," ").concat(k[t.jMonth()]))}),(0,l.jsxs)("span",{className:"text-black whitespace-nowrap",children:[(0,l.jsx)("span",{className:"text-gray-9B9BAA line-through",children:(0,p.N)(i)})," â ",(0,l.jsx)("b",{className:"font-m",children:(0,p.N)(r)})]})]},n)})}),(0,l.jsxs)("div",{className:"rounded-10 bg-gray-F5F5F7 p-12 mb-12",children:[(0,l.jsx)(O,{label:"Ù
Ø¨ÙØº ک٠اجارÙ",a:ei.before.total_amount,b:ei.after.total_amount}),(0,l.jsx)(O,{label:"سÙÙ
Ù
ÛØ²Ø¨Ø§Ù",a:ei.before.host_share,b:ei.after.host_share}),(0,l.jsx)(O,{label:"سÙÙ
ÙÛØ¯ÙÙ
ا",a:ei.before.website_share,b:ei.after.website_share}),(0,l.jsx)(O,{label:"Ù
Ø§ÙØ¯Ù ÙØ§Ø±Ûز",a:ei.before.clear_remainder,b:ei.after.clear_remainder})]}),ei.warnings.length>0&&(0,l.jsx)("div",{className:"flex flex-col gap-y-6 mb-12",children:ei.warnings.map(function(e,t){return(0,l.jsxs)("div",{className:"flex items-start gap-x-8",children:[(0,l.jsx)(p.Ct,{tone:"yellow",children:"ØªÙØ¬Ù"}),(0,l.jsx)("span",{className:"text-11 leading-18 text-gray-6C6A7D",children:e})]},t)})}),(0,l.jsx)("p",{className:"text-12 leading-20 text-gray-6C6A7D mb-8",children:"اÛÙ ÙØ±Ø®âÙØ§ کجا اعÙ
Ø§Ù Ø´ÙØ¯Ø"}),(0,l.jsxs)("div",{className:"flex flex-col gap-y-8 mb-12",children:[(0,l.jsx)(T,{checked:"both"===U,onSelect:function(){return J("both")},label:"ÙÙ
رÙÛ ØªÙÙÛÙ
Ø ÙÙ
رÙÛ Ø§Û٠رزرÙ",hint:"ØØ§Ùت Ù
عÙ
ÙÙ: ÙØ±Ø® Ø§Ø´ØªØ¨Ø§Ù Ø¨ÙØ¯Ù Ù Ø¨Ø§ÛØ¯ ÙÙ
ÙâØ¬Ø§ درست Ø´ÙØ¯."}),(0,l.jsx)(T,{checked:"reservation"===U,onSelect:function(){return J("reservation")},label:"ÙÙØ· اÛ٠رزرÙ",hint:"تÙÙÛÙ
Ø§ÙØ§Ù
تگا٠دستâÙØ®Ùرد٠Ù
ÛâÙ
Ø§ÙØ¯Ø ÙÙØ· ÙÛÙ
ت ÙÙ
ÛÙ Ø±Ø²Ø±Ù Ø¹ÙØ¶ Ù
ÛâØ´ÙØ¯."}),(0,l.jsx)(T,{checked:"calendar"===U,onSelect:function(){return J("calendar")},label:"ÙÙØ· تÙÙÛÙ
â Ø§Û٠رزر٠تغÛÛØ± ÙÚ©ÙØ¯",hint:"ÙÛÙ
ØªÛ Ú©Ù Ø¨Ù Ø§ÛÙ Ù
ÙÙ
Ø§Ù Ú¯ÙØªÙ شد٠سر Ø¬Ø§ÛØ´ Ù
ÛâÙ
Ø§ÙØ¯."})]}),"calendar"!==U&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("textarea",{value:W,onChange:function(e){return X(e.target.value)},rows:2,placeholder:"ÛØ§Ø¯Ø¯Ø§Ø´Øª ÙÛÙ
تâÚ¯Ø°Ø§Ø±Û â ÚØ±Ø§ اÛÙ ÙØ±Ø® Ø¹ÙØ¶ Ù
ÛâØ´ÙØ¯Ø",className:"w-full rounded-10 border border-gray-E5E5E6 p-10 text-12 leading-20 outline-none focus:border-primary-main"}),(0,l.jsx)("p",{className:"mt-4 mb-12 text-11 leading-18 text-gray-9B9BAA",children:"با ÙØ§Ù
Ø´Ù
ا در ØªØ§Ø±ÛØ®ÚÙâÛ Ø±Ø²Ø±Ù Ø«Ø¨Øª Ù
ÛâØ´ÙØ¯."})]}),ee&&(0,l.jsx)("p",{className:"mb-8 text-12 text-[#C62828]",children:ee})]}):(0,l.jsx)("p",{className:"text-12 leading-20 text-gray-9B9BAA",children:"ÙÙÙØ² ÚÛØ²Û تغÛÛØ± ÙکردÙ. ÙØ±Ø®Û را از ستÙ٠راست ÛØ§ رÙÛ ØªÙÙÛÙ
Ø¹ÙØ¶ Ú©ÙÛØ¯."}),(0,l.jsxs)("div",{className:"flex items-center gap-x-8 mt-auto pt-4",children:[(0,l.jsx)(p.zx,{className:"flex-1",disabled:q||!ep||"calendar"!==U&&W.trim().length<3,onClick:function(){return ef.apply(this,arguments)},children:q?"در ØØ§Ù Ø°Ø®ÛØ±Ù...":"Ø°Ø®ÛØ±Ù کرد٠تغÛÛØ±Ø§Øª"}),(0,l.jsx)(p.zx,{variant:"secondary",disabled:q||!ep,onClick:function(){S({}),I(new Set),Y(""),et(null)},children:"بازگرداÙÛ"})]})]})]}):(0,l.jsx)("p",{className:"text-13 text-[#C62828]",children:"ÙØ±Ø® اÛÙ Ø±Ø²Ø±Ù Ø®ÙØ§ÙØ¯Ù ÙØ´Ø¯."})})}function F(e,t){return t.key.startsWith("special")?e.isSpecial&&e.unitPrice===t.unit_price:"peak"===t.key?!e.isSpecial&&e.isPeak:"weekend"===t.key?!e.isSpecial&&!e.isPeak&&e.isWeekend:"week"===t.key&&!e.isSpecial&&!e.isPeak&&!e.isWeekend}
1function Z(e){var t=e.bucket,a=e.draftPrice,n=e.onChange,r=e.editable,c=function(e){u(e);var t=(0,p.EU)(e);t>0&&n(t)},o=(0,s.Z)((0,i.useState)(null),2),d=o[0],u=o[1],x=0===t.nights,m=null!==a&&a!==t.unit_price,h=null!==d?d:null===a?"":a?a.toLocaleString("fa-IR"):"";return(0,l.jsxs)("div",{className:"grid grid-cols-[1fr_auto] gap-x-8 items-center ".concat(x?"opacity-45":""),children:[(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("span",{className:"block text-12 leading-20 text-gray-6C6A7D truncate",children:t.label}),(0,l.jsxs)("span",{className:"block text-11 leading-18 text-gray-9B9BAA",children:[x?"بدÙ٠شب":"".concat((0,p.N)(t.nights)," شب"),m&&(0,l.jsx)("span",{className:"text-[#B26A00]",children:" \xb7 تغÛÛØ± کردÙ"})]})]}),(0,l.jsx)("input",{inputMode:"numeric",disabled:!r||x,value:h,placeholder:null===a?"ÚÙØ¯ ÙØ±Ø®":"",onChange:function(e){return c(e.target.value)},onBlur:function(){return u(null)},className:"w-[122px] px-10 py-8 rounded-10 border text-12 leading-20 text-center outline-none transition focus:border-primary-main disabled:bg-gray-F5F5F7 disabled:text-gray-9B9BAA ".concat(m?"border-[#B26A00] bg-[#FFF4E0]":"border-gray-E5E5E6")})]})}function O(e){var t=e.label,a=e.a,n=e.b;return(0,l.jsxs)("div",{className:"flex items-baseline justify-between gap-x-10 py-2 text-12 leading-20",children:[(0,l.jsx)("span",{className:"text-gray-6C6A7D",children:t}),(0,l.jsxs)("span",{className:"whitespace-nowrap",children:[(0,l.jsx)("span",{className:"text-gray-9B9BAA",children:(0,p.N)(a)})," â ",(0,l.jsx)("b",{className:"font-m ".concat(Math.abs(a-n)>=1?n>a?"text-[#2E7D32]":"text-[#C62828]":"text-gray-9B9BAA"),children:(0,p.N)(n)})]})]})}function T(e){var t=e.checked,a=e.onSelect,n=e.label,s=e.hint;return(0,l.jsxs)("label",{className:"flex items-start gap-x-8 rounded-10 border p-10 cursor-pointer transition ".concat(t?"border-primary-main bg-primary-light":"border-gray-E5E5E6 hover:border-gray-C4CAD3"),children:[(0,l.jsx)("input",{type:"radio",checked:t,onChange:a,className:"w-14 h-14 mt-2 accent-[#03D6BB]"}),(0,l.jsxs)("span",{className:"min-w-0",children:[(0,l.jsx)("span",{className:"block text-12 leading-20 ".concat(t?"text-primary-dark font-m":"text-black"),children:n}),(0,l.jsx)("span",{className:"block text-11 leading-18 text-gray-9B9BAA",children:s})]})]})}var P=a(33496),I=a(55290),M=[{value:"CARD_TRANSFER",label:"کارت ب٠کارت"},{value:"BANK_TRANSFER",label:"ÙØ§Ø±Ûز باÙÚ©Û"},{value:"CASH",label:"ÙÙØ¯Û"},{value:"GATEWAY",label:"درگا٠پرداخت"},{value:"WALLET",label:"Ú©ÛÙ Ù¾ÙÙ"},{value:"OTHER",label:"Ø³Ø§ÛØ±"}];function L(e){var t=e.reservationId,a=e.canRecord,n=e.guestWalletBalance,r=e.onChanged,c=(0,u.u)("/api/admin/reservations/".concat(t,"/payments"),function(e){return(0,m.SC)(e)}),o=c.data,d=c.isLoading,x=c.mutate,h=(0,s.Z)((0,i.useState)(!1),2),g=h[0],b=h[1],f=(0,s.Z)((0,i.useState)(null),2),j=f[0],v=f[1],y=null==o?void 0:o.summary;return(0,l.jsxs)(p.Zb,{className:"p-20",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between gap-x-12 flex-wrap gap-y-8 mb-14",children:[(0,l.jsx)("h3",{className:"text-16 leading-24 font-m text-black",children:"پرداختâÙØ§Û Ù
ÙÙ
اÙ"}),a&&(0,l.jsx)(p.zx,{onClick:function(){return b(!0)},children:"ثبت پرداخت"})]}),null!=n&&(0,l.jsxs)("div",{className:"mb-14 rounded-10 bg-gray-F7F7F7 px-14 py-10 flex items-center justify-between gap-x-8",children:[(0,l.jsx)("span",{className:"text-12 leading-20 text-gray-6C6A7D",children:"Ù
ÙØ¬ÙØ¯Û Ú©ÛÙ Ù¾ÙÙ Ù
ÙÙ
اÙ"}),(0,l.jsx)("b",{className:"text-14 leading-22 font-m text-black",children:(0,p.ND)(n)})]}),d||!y?(0,l.jsx)(p.Od,{className:"h-[140px]"}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"grid grid-cols-3 gap-10 mb-14",children:[(0,l.jsx)(R,{label:"Ù
Ø¨ÙØº Ú©Ù Ø¬ÙØª پرداختÛ",value:(0,p.ND)(y.due)}),(0,l.jsx)(R,{label:"جÙ
ع پرداختÛ",value:(0,p.ND)(y.paid),tone:y.paid>0?"green":void 0}),(0,l.jsx)(R,{label:y.overpaid>0?"اضاÙÙâپرداخت":"باÙÛâÙ
Ø§ÙØ¯Ù",value:(0,p.ND)(y.overpaid>0?y.overpaid:y.remaining),tone:y.overpaid>0?"amber":y.remaining>0?"red":"green"})]}),y.overpaid>0&&(0,l.jsx)("p",{className:"mb-12 text-12 leading-20 text-[#B26A00]",children:"Ù
ÙÙ
Ø§Ù Ø¨ÛØ´ØªØ± از Ù
Ø¨ÙØº رزر٠پرداخت کرد٠â Ù
ابÙâØ§ÙØªÙØ§ÙØª Ø¨Ø§ÛØ¯ برگردد."}),0===o.items.length?(0,l.jsx)(p.ub,{text:y.stored_paid_amount>0?"Ù¾Ø±Ø¯Ø§Ø®ØªÛ Ø«Ø¨ØªâØ´Ø¯ÙâØ§Û Ø¯Ø± Ø¯ÙØªØ± ÙÛØ³ØªØ ÙÙÛ ".concat((0,p.ND)(y.stored_paid_amount)," رÙÛ Ø§Û٠رزر٠ثبت است. با اÙÙÛ٠ثبت Ù¾Ø±Ø¯Ø§Ø®ØªØ Ø§ÛÙ Ù
Ø¨ÙØº بÙâØ¹ÙÙØ§Ù Ù
Ø§ÙØ¯ÙâÛ Ø§ÙÙ ÙØ§Ø±Ø¯ Ø¯ÙØªØ± Ù
ÛâØ´ÙØ¯."):"Ù¾Ø±Ø¯Ø§Ø®ØªÛ Ø«Ø¨Øª ÙØ´Ø¯Ù"}):(0,l.jsx)("div",{className:"rounded-12 border border-gray-E5E5E6 divide-y divide-gray-F0F0F0",children:o.items.map(function(e){return(0,l.jsx)(z,{payment:e,onVoid:a?function(){return v(e)}:void 0},e.id)})})]}),(0,l.jsx)(G,{open:g,reservationId:t,suggested:y?Math.max(y.remaining,0):0,guestWalletBalance:n,onClose:function(){return b(!1)},onDone:function(){x(),r()}}),(0,l.jsx)(Y,{payment:j,onClose:function(){return v(null)},onDone:function(){x(),r()}})]})}function R(e){var t=e.label,a=e.value,n=e.tone;return(0,l.jsxs)("div",{className:"rounded-12 border border-gray-E5E5E6 p-12",children:[(0,l.jsx)("span",{className:"block text-11 leading-18 text-gray-9B9BAA mb-4",children:t}),(0,l.jsx)("strong",{className:"block text-14 leading-22 font-m ".concat("green"===n?"text-[#2E7D32]":"red"===n?"text-[#C62828]":"amber"===n?"text-[#B26A00]":"text-black"),children:a})]})}function z(e){var t=e.payment,a=e.onVoid,n=!!t.voided_at;return(0,l.jsxs)("div",{className:"flex items-start justify-between gap-x-12 px-14 py-10 ".concat(n?"opacity-55":""),children:[(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-x-8 flex-wrap gap-y-4",children:[(0,l.jsx)("b",{className:"text-14 leading-22 font-m ".concat(n?"line-through text-gray-9B9BAA":"text-black"),children:(0,p.ND)(t.amount)}),(0,l.jsx)(p.Ct,{tone:"gray",children:t.method_label}),n&&(0,l.jsx)(p.Ct,{tone:"red",children:"باط٠شدÙ"})]}),(0,l.jsxs)("p",{className:"text-11 leading-18 text-gray-9B9BAA mt-2",children:[(0,I.R3)(t.paid_at)," ساعت ",(0,p.A1)(t.paid_at)[1],t.reference?" \xb7 Ù¾ÛÚ¯ÛØ±Û ".concat(t.reference):"",t.recorded_by?" \xb7 ثبت ".concat(t.recorded_by):""]}),t.note&&(0,l.jsx)("p",{className:"text-12 leading-20 text-gray-6C6A7D mt-2 break-words",children:t.note}),n&&t.voided_reason&&(0,l.jsxs)("p",{className:"text-11 leading-18 text-[#C62828] mt-2",children:["دÙÛ٠ابطاÙ: ",t.voided_reason]})]}),!n&&a&&(0,l.jsx)("button",{type:"button",onClick:a,className:"shrink-0 text-11 leading-18 text-gray-9B9BAA hover:text-[#C62828] transition",children:"ابطاÙ"})]})}function G(e){var t=e.open,a=e.reservationId,c=e.suggested,o=e.guestWalletBalance,d=e.onClose,u=e.onDone,x=(0,s.Z)((0,i.useState)(""),2),h=x[0],g=x[1],b=(0,s.Z)((0,i.useState)("CARD_TRANSFER"),2),f=b[0],j=b[1],v=(0,s.Z)((0,i.useState)(function(){return new Date().toISOString().slice(0,10)}),2),y=v[0],N=v[1],C=(0,s.Z)((0,i.useState)(function(){return new Date().toTimeStr
1ing().slice(0,5)}),2),A=C[0],E=C[1],w=(0,s.Z)((0,i.useState)(""),2),S=w[0],D=w[1],k=(0,s.Z)((0,i.useState)(""),2),B=k[0],_=k[1],F=(0,s.Z)((0,i.useState)(!1),2),Z=F[0],O=F[1],T=(0,s.Z)((0,i.useState)(null),2),P=T[0],L=T[1],R=(0,p.EU)(h);function z(){return(z=(0,n.Z)(function(){var e;return(0,r.__generator)(this,function(t){switch(t.label){case 0:O(!0),L(null),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,(0,m.SC)("/api/admin/reservations/".concat(a,"/payments"),{method:"POST",body:JSON.stringify({amount:R,method:f,paidAt:new Date("".concat(y,"T").concat(A||"00:00")).toISOString(),reference:S.trim()||null,note:B.trim()||null})})];case 2:return t.sent(),g(""),D(""),_(""),u(),d(),[3,5];case 3:return L((e=t.sent())instanceof Error?e.message:"ثبت ÙØ´Ø¯"),[3,5];case 4:return O(!1),[7];case 5:return[2]}})})).apply(this,arguments)}return(0,l.jsxs)(p.u_,{open:t,onClose:d,title:"ثبت پرداخت Ù
ÙÙ
اÙ",width:"max-w-[520px]",children:[(0,l.jsxs)("label",{className:"block mb-12",children:[(0,l.jsx)("span",{className:"block mb-6 text-12 leading-18 text-gray-6C6A7D font-m",children:"Ù
Ø¨ÙØº (تÙÙ
اÙ)"}),(0,l.jsx)("input",{inputMode:"numeric",value:R?R.toLocaleString("fa-IR"):"",onChange:function(e){return g(e.target.value)},placeholder:"Ù
Ø¨ÙØº اÛÙ ÙØ§Ø±Ûز",className:"w-full px-14 py-10 rounded-10 border border-gray-E5E5E6 text-14 leading-22 outline-none focus:border-primary-main"}),c>0&&(0,l.jsxs)("button",{type:"button",onClick:function(){return g(String(c))},className:"mt-6 text-11 leading-18 text-primary-dark hover:underline",children:["ک٠باÙÛâÙ
Ø§ÙØ¯Ù: ",(0,p.N)(c)," تÙÙ
اÙ"]})]}),(0,l.jsxs)("div",{className:"grid md:grid-cols-2 gap-12 mb-12",children:[(0,l.jsxs)("label",{className:"block",children:[(0,l.jsx)("span",{className:"block mb-6 text-12 leading-18 text-gray-6C6A7D font-m",children:"Ø±ÙØ´ پرداخت"}),(0,l.jsx)("select",{value:f,onChange:function(e){return j(e.target.value)},className:"w-full px-14 py-10 rounded-10 border border-gray-E5E5E6 text-14 leading-22 bg-white outline-none focus:border-primary-main",children:M.map(function(e){return(0,l.jsx)("option",{value:e.value,children:e.label},e.value)})})]}),(0,l.jsx)(I.ZP,{label:"ØªØ§Ø±ÛØ® ÙØ§Ø±Ûز",value:y,onChange:N})]}),"WALLET"===f&&(0,l.jsxs)("p",{className:"mb-12 text-12 leading-20 rounded-8 px-10 py-8 ".concat(null!=o&&R>o?"bg-[#FFF4E5] text-[#B26A00]":"bg-gray-F5F5F7 text-gray-6C6A7D"),children:["اÛÙ Ù
Ø¨ÙØº از Ù
ÙØ¬ÙØ¯Û Ú©ÛÙ Ù¾ÙÙ Ù
ÙÙ
ا٠کسر Ù
ÛâØ´ÙØ¯.",null!=o&&(0,l.jsxs)(l.Fragment,{children:[" ","Ù
ÙØ¬ÙØ¯Û ÙØ¹ÙÛ: ",(0,l.jsx)("b",{children:(0,p.ND)(o)}),R>o&&" â Ú©Ù
تر از Ù
Ø¨ÙØº ÙØ§Ø±Ø¯Ø´Ø¯Ù است."]})]}),(0,l.jsxs)("label",{className:"block mb-12",children:[(0,l.jsx)("span",{className:"block mb-6 text-12 leading-18 text-gray-6C6A7D font-m",children:"ساعت ÙØ§Ø±Ûز"}),(0,l.jsx)("input",{type:"time",value:A,onChange:function(e){return E(e.target.value)},className:"w-full px-14 py-10 rounded-10 border border-gray-E5E5E6 text-14 leading-22 outline-none focus:border-primary-main"})]}),(0,l.jsxs)("label",{className:"block mb-12",children:[(0,l.jsx)("span",{className:"block mb-6 text-12 leading-18 text-gray-6C6A7D font-m",children:"Ø´Ù
ار٠پÛÚ¯ÛØ±Û / ÙÛØ´ (Ø§Ø®ØªÛØ§Ø±Û)"}),(0,l.jsx)("input",{value:S,onChange:function(e){return D(e.target.value)},dir:"ltr",className:"w-full px-14 py-10 rounded-10 border border-gray-E5E5E6 text-14 leading-22 text-right outline-none focus:border-primary-main"})]}),(0,l.jsx)("textarea",{value:B,onChange:function(e){return _(e.target.value)},rows:2,placeholder:"ØªÙØ¶ÛØ (Ø§Ø®ØªÛØ§Ø±Û)",className:"w-full rounded-10 border border-gray-E5E5E6 p-12 text-13 leading-22 outline-none focus:border-primary-main"}),P&&(0,l.jsx)("p",{className:"mt-10 text-13 text-[#C62828]",children:P}),(0,l.jsxs)("div",{className:"flex justify-end gap-x-8 mt-16",children:[(0,l.jsx)(p.zx,{variant:"secondary",onClick:d,children:"Ø§ÙØµØ±Ø§Ù"}),(0,l.jsx)(p.zx,{disabled:Z||R<=0||!y,onClick:function(){return z.apply(this,arguments)},children:Z?"در ØØ§Ù ثبت...":"ثبت پرداخت"})]})]})}function Y(e){var t=e.payment,a=e.onClose,c=e.onDone,o=(0,s.Z)((0,i.useState)(""),2),d=o[0],u=o[1],x=(0,s.Z)((0,i.useState)(!1),2),h=x[0],g=x[1],b=(0,s.Z)((0,i.useState)(null),2),f=b[0],j=b[1];function v(){return(v=(0,n.Z)(function(){var e;return(0,r.__generator)(this,function(n){switch(n.label){case 0:if(!t)return[2];g(!0),j(null),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,(0,m.SC)("/api/admin/payments/".concat(t.id,"/void"),{method:"POST",body:JSON.stringify({reason:d.trim()})})];case 2:return n.sent(),u(""),c(),a(),[3,5];case 3:return j((e=n.sent())instanceof Error?e.message:"Ø§Ø¨Ø·Ø§Ù ÙØ´Ø¯"),[3,5];case 4:return g(!1),[7];case 5:return[2]}})})).apply(this,arguments)}return(0,l.jsxs)(p.u_,{open:!!t,onClose:a,title:"ابطا٠پرداخت",width:"max-w-[460px]",children:[(0,l.jsxs)("p",{className:"text-13 leading-22 text-gray-6C6A7D mb-10",children:["پرداخت ",(0,l.jsx)("b",{className:"text-black",children:t&&(0,p.ND)(t.amount)})," از جÙ
ع Ù¾Ø±Ø¯Ø§Ø®ØªÛ Ú©Ø³Ø± Ù
ÛâØ´ÙØ¯. ردÛ٠پاک ÙÙ
ÛâØ´ÙØ¯ ٠با دÙÛÙ Ø´Ù
ا در Ø¯ÙØªØ± Ù
ÛâÙ
Ø§ÙØ¯."]}),(0,l.jsx)("textarea",{value:d,onChange:function(e){return u(e.target.value)},rows:3,placeholder:"ÚØ±Ø§ اÛ٠پرداخت باط٠Ù
ÛâØ´ÙØ¯Ø",className:"w-full rounded-10 border border-gray-E5E5E6 p-12 text-13 leading-22 outline-none focus:border-primary-main"}),f&&(0,l.jsx)("p",{className:"mt-10 text-13 text-[#C62828]",children:f}),(0,l.jsxs)("div",{className:"flex justify-end gap-x-8 mt-16",children:[(0,l.jsx)(p.zx,{variant:"secondary",onClick:a,children:"Ø§ÙØµØ±Ø§Ù"}),(0,l.jsx)(p.zx,{variant:"danger",disabled:h||d.trim().length<3,onClick:function(){return v.apply(this,arguments)},children:h?"در ØØ§Ù ابطاÙ...":"ابطا٠پرداخت"})]})]})}var H=a(69396);function U(e){var t,a,c,o=e.open,d=e.onClose,u=e.reservationId,x=e.terms,h=e.onSaved,b=(0,s.Z)((0,i.useState)(""),2),f=b[0],j=b[1],v=(0,s.Z)((0,i.useState)(""),2),y=v[0],N=v[1],C=(0,s.Z)((0,i.useState)(""),2),A=C[0],E=C[1],w=(0,s.Z)((0,i.useState)(""),2),S=w[0],D=w[1],k=(0,s.Z)((0,i.useState)(null),2),B=k[0],_=k[1],F=(0,s.Z)((0,i.useState)(!1),2),Z=F[0],O=F[1],T=(0,s.Z)((0,i.useState)(null),2),P=T[0],I=T[1];(0,i.useEffect)(function(){var e,t,a;o&&(j(String(Math.round(null!==(e=x.websiteShare)&&void 0!==e?e:0))),N(String(Math.round(null!==(t=x.vatAmou
1nt)&&void 0!==t?t:0))),E(String(Math.round(null!==(a=x.guestCommission)&&void 0!==a?a:0))),D(""),_(null),I(null))},[o,x.websiteShare,x.vatAmount,x.guestCommission]);var M=function(e){return(0,p.EU)(e)},L={websiteShare:M(f),vatAmount:M(y),guestCommission:M(A)},R=L.websiteShare!==Math.round(null!==(t=x.websiteShare)&&void 0!==t?t:0)||L.vatAmount!==Math.round(null!==(a=x.vatAmount)&&void 0!==a?a:0)||L.guestCommission!==Math.round(null!==(c=x.guestCommission)&&void 0!==c?c:0);function z(){return(z=(0,n.Z)(function(){var e;return(0,r.__generator)(this,function(t){switch(t.label){case 0:O(!0),I(null),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,(0,m.SC)("/api/admin/reservations/".concat(u,"/terms"),{method:"PATCH",body:JSON.stringify((0,H.Z)((0,g.Z)({},L),{dryRun:!0}))})];case 2:return _(t.sent()),[3,5];case 3:return I((e=t.sent())instanceof Error?e.message:"Ù
ØØ§Ø³Ø¨Ù ÙØ´Ø¯"),[3,5];case 4:return O(!1),[7];case 5:return[2]}})})).apply(this,arguments)}function G(){return(G=(0,n.Z)(function(){var e;return(0,r.__generator)(this,function(t){switch(t.label){case 0:O(!0),I(null),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,(0,m.SC)("/api/admin/reservations/".concat(u,"/terms"),{method:"PATCH",body:JSON.stringify((0,H.Z)((0,g.Z)({},L),{note:S.trim()}))})];case 2:return t.sent(),h(),d(),[3,5];case 3:return I((e=t.sent())instanceof Error?e.message:"Ø°Ø®ÛØ±Ù ÙØ´Ø¯"),[3,5];case 4:return O(!1),[7];case 5:return[2]}})})).apply(this,arguments)}var Y=Math.max(x.totalAmount-L.websiteShare-L.vatAmount,0),U=function(e,t){return t>0?e/t*100:0};return(0,l.jsxs)(p.u_,{open:o,onClose:d,title:"ÙÛØ±Ø§ÛØ´ کارÙ
زد Ù Ù
اÙÛØ§Øª",width:"max-w-[560px]",children:[(0,l.jsxs)("p",{className:"text-12 leading-20 text-gray-9B9BAA mb-14",children:["Ù
Ø¨ÙØº ک٠اجار٠(",(0,p.ND)(x.totalAmount),") از ÙØ±Ø® شبâÙØ§ Ù
ÛâØ¢ÛØ¯ ٠اÛÙØ¬Ø§ تغÛÛØ± ÙÙ
ÛâÚ©ÙØ¯ â Ø¨Ø±Ø§Û آ٠از \xabÙÛØ±Ø§ÛØ´ ÙÛÙ
ت رزرÙ\xbb Ø§Ø³ØªÙØ§Ø¯Ù Ú©ÙÛØ¯."]}),(0,l.jsx)(J,{label:"سÙÙ
ÙÛØ¯ÙÙ
ا",hint:"".concat((0,p.N)(Math.round(10*U(L.websiteShare,x.totalAmount))/10),"Ùª از اجارÙ"),value:f,onChange:function(e){j(e),_(null)}}),(0,l.jsx)(J,{label:"ارزش Ø§ÙØ²ÙدÙ",hint:"".concat((0,p.N)(Math.round(10*U(L.vatAmount,L.websiteShare))/10),"Ùª از کارÙ
زد"),value:y,onChange:function(e){N(e),_(null)}}),(0,l.jsx)(J,{label:"کارÙ
زد رزر٠Ù
ÙÙ
اÙ",hint:"".concat((0,p.N)(Math.round(10*U(L.guestCommission,x.totalAmount))/10),"ÙªØ Ø§ÙØ²ÙØ¯Ù Ø¨Ù Ù¾Ø±Ø¯Ø§Ø®ØªÛ Ù
ÙÙ
اÙ"),value:A,onChange:function(e){E(e),_(null)}}),(0,l.jsxs)("div",{className:"rounded-10 bg-gray-F5F5F7 p-12 mt-4 mb-14",children:[(0,l.jsx)(V,{label:"سÙÙ
Ù
ÛØ²Ø¨Ø§Ù پس از کسر",value:(0,p.ND)(Y),strong:!0}),(0,l.jsx)(V,{label:"Ù
Ø¨ÙØº Ú©Ù Ø¬ÙØª Ù¾Ø±Ø¯Ø§Ø®ØªÛ Ù
ÙÙ
اÙ",value:(0,p.ND)(x.totalAmount+L.guestCommission)})]}),B&&(0,l.jsxs)("div",{className:"rounded-10 border border-gray-E5E5E6 p-12 mb-14",children:[(0,l.jsx)("p",{className:"text-12 leading-20 text-gray-6C6A7D mb-8",children:"پس از Ø°Ø®ÛØ±Ù"}),(0,l.jsx)(W,{label:"سÙÙ
Ù
ÛØ²Ø¨Ø§Ù",a:B.before.host_share,b:B.after.host_share}),(0,l.jsx)(W,{label:"کارÙ
زد Ø³Ø§ÛØª",a:B.before.website_share,b:B.after.website_share}),(0,l.jsx)(W,{label:"ارزش Ø§ÙØ²ÙدÙ",a:B.before.vat_amount,b:B.after.vat_amount}),(0,l.jsx)(W,{label:"کارÙ
زد رزر٠Ù
ÙÙ
اÙ",a:B.before.guest_commission,b:B.after.guest_commission}),B.warnings.map(function(e,t){return(0,l.jsxs)("div",{className:"flex items-start gap-x-8 mt-8",children:[(0,l.jsx)(p.Ct,{tone:"yellow",children:"ØªÙØ¬Ù"}),(0,l.jsx)("span",{className:"text-11 leading-18 text-gray-6C6A7D",children:e})]},t)})]}),(0,l.jsx)("textarea",{value:S,onChange:function(e){return D(e.target.value)},rows:2,placeholder:"ØªÙØ¶ÛØ â ÚØ±Ø§ اÛÙ Ù
Ø¨Ø§ÙØº Ø¹ÙØ¶ Ù
ÛâØ´ÙØ¯Ø",className:"w-full rounded-10 border border-gray-E5E5E6 p-12 text-13 leading-22 outline-none focus:border-primary-main"}),(0,l.jsx)("p",{className:"mt-4 text-11 leading-18 text-gray-9B9BAA",children:"با ÙØ§Ù
Ø´Ù
ا در ØªØ§Ø±ÛØ®ÚÙâÛ Ø±Ø²Ø±Ù Ø«Ø¨Øª Ù
ÛâØ´ÙØ¯."}),P&&(0,l.jsx)("p",{className:"mt-10 text-13 text-[#C62828]",children:P}),(0,l.jsxs)("div",{className:"flex justify-end gap-x-8 mt-16",children:[(0,l.jsx)(p.zx,{variant:"secondary",onClick:d,children:"Ø§ÙØµØ±Ø§Ù"}),B?(0,l.jsx)(p.zx,{disabled:Z||S.trim().length<3,onClick:function(){return G.apply(this,arguments)},children:Z?"در ØØ§Ù Ø°Ø®ÛØ±Ù...":"Ø°Ø®ÛØ±Ù"}):(0,l.jsx)(p.zx,{disabled:Z||!R,onClick:function(){return z.apply(this,arguments)},children:Z?"...":"Ù
ØØ§Ø³Ø¨ÙâÛ ØªØºÛÛØ±"})]})]})}
1function J(e){var t=e.label,a=e.hint,n=e.value,s=e.onChange,r=(0,p.EU)(n);return(0,l.jsxs)("label",{className:"grid grid-cols-[1fr_auto] gap-x-10 items-center mb-10",children:[(0,l.jsxs)("span",{className:"min-w-0",children:[(0,l.jsx)("span",{className:"block text-13 leading-20 text-black",children:t}),(0,l.jsx)("span",{className:"block text-11 leading-18 text-gray-9B9BAA",children:a})]}),(0,l.jsx)("input",{inputMode:"numeric",value:r?r.toLocaleString("fa-IR"):"",onChange:function(e){return s(e.target.value)},placeholder:"Û°",className:"w-[150px] px-12 py-8 rounded-10 border border-gray-E5E5E6 text-13 leading-20 text-center outline-none focus:border-primary-main"})]})}function V(e){var t=e.label,a=e.value,n=e.strong;return(0,l.jsxs)("div",{className:"flex items-baseline justify-between gap-x-12 py-2",children:[(0,l.jsx)("span",{className:"text-12 leading-20 text-gray-6C6A7D",children:t}),(0,l.jsx)("span",{className:"text-13 leading-20 whitespace-nowrap ".concat(n?"font-m text-black":"text-gray-6C6A7D"),children:a})]})}function W(e){var t=e.label,a=e.a,n=e.b;return(0,l.jsxs)("div",{className:"flex items-baseline justify-between gap-x-10 py-2 text-12 leading-20",children:[(0,l.jsx)("span",{className:"text-gray-6C6A7D",children:t}),(0,l.jsxs)("span",{className:"whitespace-nowrap",children:[(0,l.jsx)("span",{className:"text-gray-9B9BAA",children:(0,p.N)(Math.round(a))})," â ",(0,l.jsx)("b",{className:"font-m ".concat(Math.abs(a-n)>=1?n>a?"text-[#2E7D32]":"text-[#C62828]":"text-gray-9B9BAA"),children:(0,p.N)(Math.round(n))})]})]})}var X=a(70707);function K(e){var t=e.open,a=e.onClose,c=e.reservationId,o=e.invoice,d=e.onSaved,u=(0,s.Z)((0,i.useState)(""),2),x=u[0],h=u[1],b=(0,s.Z)((0,i.useState)(""),2),f=b[0],j=b[1],v=(0,s.Z)((0,i.useState)(""),2),y=v[0],N=v[1],C=(0,s.Z)((0,i.useState)(null),2),A=C[0],E=C[1],w=(0,s.Z)((0,i.useState)(!1),2),S=w[0],D=w[1],k=(0,s.Z)((0,i.useState)(null),2),B=k[0],_=k[1];function F(e){return Z.apply(this,arguments)}function Z(){return(Z=(0,n.Z)(function(e){var t,n;return(0,r.__generator)(this,function(s){switch(s.label){case 0:D(!0),_(null),s.label=1;case 1:return s.trys.push([1,3,4,5]),[4,(0,m.SC)("/api/admin/reservations/".concat(c,"/gift-discounts"),{method:"PATCH",body:JSON.stringify((0,H.Z)((0,g.Z)({},{hostGiftDiscount:(0,X.EU)(x),siteGiftDiscount:(0,X.EU)(f)}),{note:y.trim(),dryRun:e}))})];case 2:return t=s.sent(),e?E(t):(d(),a()),[3,5];case 3:return _((n=s.sent())instanceof Error?n.message:"Ø§ÙØ¬Ø§Ù
ÙØ´Ø¯"),[3,5];case 4:return D(!1),[7];case 5:return[2]}})})).apply(this,arguments)}return(0,i.useEffect)(function(){t&&(h(o.hostGiftDiscount?String(o.hostGiftDiscount):""),j(o.siteGiftDiscount?String(o.siteGiftDiscount):""),N(""),E(null),_(null))},[t,o.hostGiftDiscount,o.siteGiftDiscount]),(0,l.jsxs)(p.u_,{open:t,onClose:a,title:"تخÙÛÙ ÙØ¯ÛÙ",width:"max-w-[560px]",children:[(0,l.jsxs)("p",{className:"mb-16 rounded-10 bg-gray-F7F7F7 px-14 py-10 text-12 leading-20 text-gray-6C6A7D",children:["ÙØ± د٠ب٠ÛÚ© Ø§ÙØ¯Ø§Ø²Ù از ØµÙØ±ØªØØ³Ø§Ø¨ Ù
ÙÙ
ا٠کÙ
Ù
ÛâÚ©ÙÙØ¯. ØªÙØ§Ùتشا٠اÛ٠است Ú©Ù"," ",(0,l.jsx)("b",{className:"text-black",children:"ÙØ¯ÛÙ Ù
ÛØ²Ø¨Ø§Ù"})," از ÙØ§Ø±ÛØ²Û Ø®ÙØ¯Ù Ù
ÛØ²Ø¨Ø§Ù Ú©Ù
Ù
ÛâØ´ÙØ¯ Ù"," ",(0,l.jsx)("b",{className:"text-black",children:"ÙØ¯ÛÙ Ø³Ø§ÛØª"})," از سÙÙ
ÙÛØ¯ÙÙ
ا â ÙØ§Ø±ÛØ²Û Ù
ÛØ²Ø¨Ø§Ù را دست ÙÙ
ÛâØ²ÙØ¯."]}),(0,l.jsxs)("div",{className:"grid md:grid-cols-2 gap-14",children:[(0,l.jsx)(p.gN,{label:"تخÙÛÙ ÙØ¯ÛÙ Ù
ÛØ²Ø¨Ø§Ù (تÙÙ
اÙ)",hint:"ØØ¯Ø§Ú©Ø«Ø± ".concat((0,p.ND)(o.hostShareBeforeGift)," â Ø³ÙÙ
Ù
ÛØ²Ø¨Ø§Ù از اÛ٠رزرÙ"),children:(0,l.jsx)(p.II,{inputMode:"numeric",value:x,onChange:function(e){return h(e.target.value)}})}),(0,l.jsx)(p.gN,{label:"تخÙÛÙ ÙØ¯ÛÙ Ø³Ø§ÛØª (تÙÙ
اÙ)",hint:"از سÙÙ
ÙÛØ¯ÙÙ
ا پرداخت Ù
ÛâØ´ÙØ¯",children:(0,l.jsx)(p.II,{inputMode:"numeric",value:f,onChange:function(e){return j(e.target.value)}})})]}),(0,l.jsx)(p.gN,{label:"ØªÙØ¶ÛØ (Ø§ÙØ²Ø§Ù
Û)",className:"mt-14",children:(0,l.jsx)(p.II,{value:y,onChange:function(e){return N(e.target.value)},placeholder:"ÚØ±Ø§ اÛ٠تخÙÛ٠ثبت Ù
ÛâØ´ÙØ¯Ø"})}),B&&(0,l.jsx)("p",{className:"mt-14 rounded-10 bg-[#FEE] px-14 py-10 text-13 text-[#C62828]",children:B}),A&&(0,l.jsxs)("div",{className:"mt-16 rounded-12 border border-gray-E5E5E6 p-14",children:[(0,l.jsx)("p",{className:"mb-10 text-13 font-m text-black",children:"Ù¾ÛØ´âÙÙ
Ø§ÛØ´"}),(0,l.jsx)(q,{label:"Ù
Ø¨ÙØº ÙÙØ§ÛÛ ÙØ§Ø¨Ù پرداخت Ù
ÙÙ
اÙ",from:A.before.guest_payable,to:A.after.guest_payable}),(0,l.jsx)(q,{label:"Ù
Ø¨ÙØº ÙÙØ§ÛÛ Ø¯Ø±ÛØ§Ùت Ù
ÛØ²Ø¨Ø§Ù",from:A.before.host_share,to:A.after.host_share}),A.warnings.map(function(e){return(0,l.jsxs)("p",{className:"mt-8 text-12 leading-20 text-[#B26A00]",children:["â ",e]},e)})]}),(0,l.jsxs)("div",{className:"mt-20 flex items-center justify-end gap-x-8",children:[(0,l.jsx)(p.zx,{variant:"ghost",onClick:a,children:"Ø§ÙØµØ±Ø§Ù"}),(0,l.jsx)(p.zx,{variant:"secondary",disabled:S,onClick:function(){return F(!0)},children:"Ù¾ÛØ´âÙÙ
Ø§ÛØ´"}),(0,l.jsx)(p.zx,{disabled:S||!y.trim(),onClick:function(){return F(!1)},children:S?"در ØØ§Ù ثبتâ¦":"ثبت تخÙÛÙ"})]})]})}function q(e){var t=e.label,a=e.from,n=e.to,s=n-a;return(0,l.jsxs)("div",{className:"flex items-baseline justify-between gap-x-12 py-4",children:[(0,l.jsx)("span",{className:"text-12 leading-20 text-gray-9B9BAA",children:t}),(0,l.jsxs)("span",{className:"text-13 leading-20 whitespace-nowrap",children:[(0,l.jsx)("span",{className:"text-gray-9B9BAA line-through",children:(0,p.ND)(a)}),(0,l.jsx)("span",{className:"mx-6",children:"â"}),(0,l.jsx)("span",{className:"font-m text-black",children:(0,p.ND)(n)}),0!==s&&(0,l.jsxs)(p.Ct,{tone:s<0?"red":"green",children:[s<0?"â":"+",(0,p.N)(Math.abs(s))]})]})]})}function Q(e){var t=e.invoice,a=function(e){return e?" (".concat((0,p.N)(e),"Ùª)"):""},n=t.stay;return(0,l.jsxs)(p.Zb,{className:"p-20",children:[(0,l.jsx)("h3",{className:"text-14 leading-22 font-m text-black mb-2",children:"ØµÙØ±ØªØØ³Ø§Ø¨ ÙØ± طرÙ"}),(0,l.jsx)("p",{className:"text-11 leading-18 text-gray-9B9BAA mb-14",children:"دÙÛÙØ§Ù ÙÙ
ا٠ÚÛØ²Û Ú©Ù Ù
ÙÙ
ا٠٠Ù
ÛØ²Ø¨Ø§Ù در Ù¾ÙÙ Ø®ÙØ¯Ø´Ø§Ù Ù
ÛâØ¨ÛÙÙØ¯."}),(0,l.jsxs)("div",{className:"rounded-12 border border-gray-E5E5E6 p-14 mb-16",children:[(0,l.jsx)("p",{className:"mb-8 text-12 leading-20 font-m text-gray-6C6A7D",children:"Ø¬Ø²Ø¦ÛØ§Øª Ù
Ø¨ÙØº ک٠رزرÙ"}),n?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)($,{label:"Ø±ÙØ²ÙØ§Û ÙØ³Ø· ÙÙØªÙ",nights:n.weekdayNights,unit:n.weekdayUnit,total:n.weekdayTotal}),(0,l.jsx)($,{label:"Ø±ÙØ²ÙØ§Û Ø¢Ø®Ø± ÙÙØªÙ",nights:n.weekendNights,unit:n.weekendUnit,total:n.weekendTotal}),(0,l.jsx)($,{label:"Ø±ÙØ²ÙØ§Û Ø§ÛØ§Ù
Ù¾ÛÚ©",nights:n.peakNights,unit:n.peakUnit,total:n.peakTotal}),(0,l.jsx)($,{label:"Ø±ÙØ²ÙØ§Û Ø®Ø§Øµ",nights:n.specialNights,unit:n.specialUnit,total:n.specialTotal}),n.extraGuests>0&&(0,l.jsx)($,{label:"ÙØ±Ø® ÙÙØ± اضاÙÙ",nights:n.extraGuests,unitLabel:"ÙÙØ±",total:n.extraGuestsTotal}),n.lengthDiscountAmount>0&&(0,l.jsx)(ee,{label:"تخÙÛÙ Ù
دت رزرÙ".concat(a(n.lengthDiscountPercent)),value:-n.lengthDiscountAmount,negative:!0}),(0,l.jsx)("div",{className:"mt-8 pt-8 border-t border-gray-F0F0F0",children:(0,l.jsx)(ee,{label:"Ù
Ø¨ÙØº ک٠رزرÙ",value:t.totalAmount,strong:!0})})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ee,{label:"Ù
Ø¨ÙØº ک٠رزرÙ",value:t.totalAmount,strong:!0}),(0,l.jsx)("p",{className:"mt-6 text-11 leading-18 text-gray-9B9BAA",children:"تÙÚ©ÛÚ© شبâÙØ§ Ø¨Ø±Ø§Û Ø§ÛÙ Ø±Ø²Ø±Ù Ø°Ø®ÛØ±Ù ÙØ´Ø¯Ù â Ù¾ÛØ´ از Ø§ÙØ²ÙدÙâØ´Ø¯Ù Ø§Û٠ستÙ٠ثبت شد٠است."})]})]}),(0,l.jsxs)("div",{className:"grid md:grid-cols-2 gap-x-20 gap-y-14",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"mb-8 text-12 leading-20 font-m text-gray-6C6A7D",children:"Ù
ÙÙ
ا٠Ù
ÛâØ¨ÛÙØ¯"}),(0,l.jsx)(ee,{label:"Ù
Ø¨ÙØº ک٠رزرÙ",value:t.totalAmount}),t.codeDiscount>0&&(0,l.jsx)(ee,{label:"کد تخÙÛÙ".concat(t.discountCode?" (".concat(t.discountCode,")"):""),value:-t.codeDiscount,negative:!0}),t.hostGiftDiscount>0&&(0,l.jsx)(ee,{label:"تخÙÛÙ ÙØ¯ÛÙ Ù
ÛØ²Ø¨Ø§Ù",value:-t.hostGiftDiscount,negative:!0}),t.siteGiftDiscount>0&&(0,l.jsx)(ee,{label:"تخÙÛÙ ÙØ¯ÛÙ Ø³Ø§ÛØª",value:-t.siteGiftDiscount,negative:!0}),t.totalDiscount>0&&(0,l.jsx)(ee,{label:"Ù
Ø¨ÙØº ÙÙØ§ÛÛ ØµÙØ±ØªØØ³Ø§Ø¨",value:t.invoiceAmount}),(0,l.jsx)(ee,{label:"کارÙ
زد رزر٠Ù
ÙÙ
اÙ".concat(a(t.guestCommissionPercent)),value:t.guestCommission}),(0,l.jsx)(ee,{label:"Ù
Ø¨ÙØº ÙÙØ§ÛÛ ÙØ§Ø¨Ù پرداخت Ù
ÙÙ
اÙ",value:t.guestPayable,strong:!0})]}),(0,l.jsxs)("div",{className:"md:border-r md:border-gray-F0F0F0 md:pr-20",children:[(0,l.jsx)("p",{className:"mb-8 text-12 leading-20 font-m text-gray-6C6A7D",children:"Ù
ÛØ²Ø¨Ø§Ù Ù
ÛâØ¨ÛÙØ¯"}),(0,l.jsx)(ee,{label:"Ù
Ø¨ÙØº ک٠رزرÙ",value:t.totalAmount}),(0,l.jsx)(ee,{label:"سÙÙ
ÙÛØ¯ÙÙ
ا".concat(a(t.commissionPercent)),value:-t.websiteShare,negative:!0}),(0,l.jsx)(ee,{label:"ارزش Ø§ÙØ²ÙدÙ".concat(t.vatPercent?" (".concat((0,p.N)(t.vatPercent),"Ùª از سÙÙ
ÙÛØ¯ÙÙ
ا)"):""),value:-t.vatAmount,negative:!0}),t.hostGiftDiscount>0&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ee,{label:"Ø¯Ø±ÛØ§ÙØªÛ Ù¾ÛØ´ از ÙØ¯ÛÙ",value:t.hostShareBeforeGift}),(0,l.jsx)(ee,{label:"تخÙÛÙ ÙØ¯ÛÙ Ù
ÛØ²Ø¨Ø§Ù",value:-t.hostGiftDiscount,negative:!0})]}),(0,l.jsx)(ee,{label:"Ù
Ø¨ÙØº ÙÙØ§ÛÛ Ø¯Ø±ÛØ§Ùت Ù
ÛØ²Ø¨Ø§Ù",value:t.hostShare,strong:!0}),(t.codeDiscount>0||t.siteGiftDiscount>0)&&(0,l.jsx)("p",{className:"mt-8 text-11 leading-18 text-gray-9B9BAA",children:"کد تخÙÛÙ Ù ÙØ¯ÛÙ Ø³Ø§ÛØª از سÙÙ
ÙÛØ¯ÙÙ
ا پرداخت Ù
ÛâØ´ÙÙØ¯ ٠رÙÛ Ø§Û٠عدد Ø§Ø«Ø±Û ÙØ¯Ø§Ø±Ùد."})]})]})]})}function $(e){var t=e.label,a=e.nights,n=e.unit,s=e.total,r=e.unitLabel;return a?(0,l.jsxs)("div",{className:"flex items-baseline justify-between gap-x-10 py-3",children:[(0,l.jsxs)("span",{className:"text-12 leading-20 text-gray-9B9BAA min-w-0",children:[t,(0,l.jsxs)("span",{className:"text-11 text-gray-C4CAD3",children:[" \xb7 ",(0,p.N)(a)," ",void 0===r?"شب":r,n?" \xd7 ".concat((0,p.ND)(n)):""]})]}),(0,l.jsx)("span",{className:"text-13 leading-20 whitespace-nowrap text-gray-6C6A7D",children:(0,p.ND)(s)})]}):null}function ee(e){var t=e.label,a=e.value,n=e.strong,s=e.negative;return(0,l.jsxs)("div",{className:"flex items-baseline justify-between gap-x-10 py-3",children:[(0,l.jsx)("span",{className:"text-12 leading-20 text-gray-9B9BAA min-w-0",children:t}),(0,l.jsx)("span",{className:"text-13 leading-20 whitespace-nowrap ".concat(s?"text-[#C62828]":n?"font-m text-black":"text-gray-6C6A7D"),children:a<0?"â".concat((0,p.ND)(Math.abs(a)
1)):(0,p.ND)(a)})]})}function et(e){var t,a,c,o=e.open,d=e.onClose,u=e.reservationId,x=e.stay,h=e.onSaved,b=(0,s.Z)((0,i.useState)(""),2),f=b[0],j=b[1],v=(0,s.Z)((0,i.useState)(1),2),y=v[0],N=v[1],C=(0,s.Z)((0,i.useState)(1),2),A=C[0],E=C[1],w=(0,s.Z)((0,i.useState)(""),2),S=w[0],k=w[1],B=(0,s.Z)((0,i.useState)(null),2),_=B[0],F=B[1],Z=(0,s.Z)((0,i.useState)(!1),2),O=Z[0],T=Z[1],P=(0,s.Z)((0,i.useState)(null),2),M=P[0],L=P[1];(0,i.useEffect)(function(){o&&(j(x.startDate.slice(0,10)),N(Math.max(x.daysCount,1)),E(x.guestsCount),k(""),F(null),L(null))},[o,x.startDate,x.daysCount,x.guestsCount]);var R=f?D()(f,"YYYY-MM-DD").add(y,"day").format("YYYY-MM-DD"):"",z=(t=x.capacity,a=x.maxCapacity,t?Math.max(Math.min(A,null!=a?a:A)-t,0):0),G=f!==x.startDate.slice(0,10)||y!==x.daysCount||A!==x.guestsCount||z!==x.extraGuestsCount,Y=!!x.maxCapacity&&A>x.maxCapacity;function H(e){return U.apply(this,arguments)}function U(){return(U=(0,n.Z)(function(e){var t,a;return(0,r.__generator)(this,function(n){switch(n.label){case 0:T(!0),L(null),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,(0,m.SC)("/api/admin/reservations/".concat(u,"/stay"),{method:"PATCH",body:JSON.stringify((0,g.Z)({startDate:f,endDate:R,guestsCount:A,extraGuestsCount:z,dryRun:e},e?{}:{note:S.trim()}))})];case 2:return t=n.sent(),e?F(t):(h(),d()),[3,5];case 3:return L((a=n.sent())instanceof Error?a.message:e?"Ù
ØØ§Ø³Ø¨Ù ÙØ´Ø¯":"Ø°Ø®ÛØ±Ù ÙØ´Ø¯"),[3,5];case 4:return T(!1),[7];case 5:return[2]}})})).apply(this,arguments)}var J=!!_&&_.clashes.length>0;return(0,l.jsxs)(p.u_,{open:o,onClose:d,title:"ÙÛØ±Ø§ÛØ´ Ø§ÙØ§Ù
ت",width:"max-w-[560px]",children:[(0,l.jsxs)("div",{className:"grid md:grid-cols-2 gap-12 mb-12",children:[(0,l.jsx)(I.ZP,{label:"ØªØ§Ø±ÛØ® ÙØ±Ùد",value:f,onChange:function(e){j(e),F(null)}}),(0,l.jsx)(ea,{label:"تعداد شب",value:y,min:1,onChange:function(e){N(e),F(null)}})]}),(0,l.jsxs)("div",{className:"rounded-10 bg-gray-F5F5F7 px-12 py-10 mb-12 flex items-center justify-between gap-x-12 flex-wrap gap-y-6",children:[(0,l.jsx)("span",{className:"text-12 leading-20 text-gray-6C6A7D",children:"ØªØ§Ø±ÛØ® Ø®Ø±ÙØ¬"}),(0,l.jsx)("b",{className:"text-14 leading-22 font-m text-black",children:(0,I.R3)(R)})]}),(0,l.jsxs)("div",{className:"grid md:grid-cols-2 gap-12 mb-4",children:[(0,l.jsx)(ea,{label:"تعداد Ù
ÙÙ
Ø§ÙØ§Ù",value:A,min:1,max:null!==(c=x.maxCapacity)&&void 0!==c?c:void 0,onChange:function(e){E(e),F(null)}}),(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{className:"block mb-6 text-12 leading-18 text-gray-6C6A7D font-m",children:"ÙÙØ±Ø§Øª اضاÙÙ"}),(0,l.jsxs)("div",{className:"px-14 py-10 rounded-10 border border-gray-E5E5E6 bg-gray-F5F5F7 text-14 leading-22 text-center text-black",children:[(0,p.N)(z)," ÙÙØ±"]}),(0,l.jsx)("span",{className:"block mt-4 text-11 leading-18 text-gray-9B9BAA",children:x.capacity?"ظرÙÛØª پاÛÙ ".concat((0,p.N)(x.capacity)," ÙÙØ±").concat(x.maxCapacity?" \xb7 ØØ¯Ø§Ú©Ø«Ø± ".concat((0,p.N)(x.maxCapacity)):""):"ظرÙÛØª پاÛÙâÛ Ø§ÙØ§Ù
تگا٠ثبت ÙØ´Ø¯Ù"})]})]}),Y&&(0,l.jsxs)("p",{className:"mb-12 text-12 leading-20 text-[#C62828]",children:["ظرÙÛØª اÛÙ Ø§ÙØ§Ù
ØªÚ¯Ø§Ù ØØ¯Ø§Ú©Ø«Ø± ",(0,p.N)(x.maxCapacity)," ÙÙØ± است."]}),_&&(0,l.jsxs)("div",{className:"rounded-10 border border-gray-E5E5E6 p-12 mt-8 mb-14",children:[(0,l.jsx)("p",{className:"text-12 leading-20 text-gray-6C6A7D mb-8",children:"پس از Ø°Ø®ÛØ±Ù"}),(0,l.jsx)(en,{label:"Ù
Ø¨ÙØº ک٠اجارÙ",a:_.before.total_amount,b:_.after.total_amount}),(0,l.jsx)(en,{label:"سÙÙ
Ù
ÛØ²Ø¨Ø§Ù",a:_.before.host_share,b:_.after.host_share}),(0,l.jsx)(en,{label:"کارÙ
زد رزر٠Ù
ÙÙ
اÙ",a:_.before.guest_commission,b:_.after.guest_commission}),_.clashes.length>0&&(0,l.jsx)("div",{className:"mt-10 rounded-8 bg-[#FFEBEB] p-10",children:(0,l.jsxs)("p",{className:"text-12 leading-20 text-[#C62828]",children:["اÛ٠باز٠با رزر٠",_.clashes.map(function(e){return e.reference}).join("Ø ")," تداخ٠دارد Ù Ø°Ø®ÛØ±Ù ÙÙ
ÛâØ´ÙØ¯."]})}),_.warnings.map(function(e,t){return(0,l.jsxs)("div",{className:"flex items-start gap-x-8 mt-8",children:[(0,l.jsx)(p.Ct,{tone:"yellow",children:"ØªÙØ¬Ù"}),(0,l.jsx)("span",{className:"text-11 leading-18 text-gray-6C6A7D",children:e})]},t)}),(0,l.jsx)("p",{className:"mt-10 text-11 leading-18 text-gray-9B9BAA",children:"Ù
Ø¨ÙØº اجار٠از ÙØ±Ø® شبâÙØ§Û بازÙâÛ Ø¬Ø¯ÛØ¯ در تÙÙÛÙ
Ø¯ÙØ¨Ø§Ø±Ù ØØ³Ø§Ø¨ Ù
ÛâØ´ÙØ¯ ٠شبâÙØ§Û ÙØ¨ÙÛ Ø¯Ø± تÙÙÛÙ
آزاد Ù
ÛâØ´ÙÙØ¯."})]}),(0,l.jsx)("textarea",{value:S,onChange:function(e){return k(e.target.value)},rows:2,placeholder:"ØªÙØ¶ÛØ â ÚØ±Ø§ اÛÙ Ø§ÙØ§Ù
ت جابÙâØ¬Ø§ Ù
ÛâØ´ÙØ¯Ø",className:"w-full rounded-10 border border-gray-E5E5E6 p-12 text-13 leading-22 outline-none focus:border-primary-main"}),(0,l.jsx)("p",{className:"mt-4 text-11 leading-18 text-gray-9B9BAA",children:"با ÙØ§Ù
Ø´Ù
ا در ØªØ§Ø±ÛØ®ÚÙâÛ Ø±Ø²Ø±Ù Ø«Ø¨Øª Ù
ÛâØ´ÙØ¯."}),M&&(0,l.jsx)("p",{className:"mt-10 text-13 text-[#C62828]",children:M}),(0,l.jsxs)("div",{className:"flex justify-end gap-x-8 mt-16",children:[(0,l.jsx)(p.zx,{variant:"secondary",onClick:d,children:"Ø§ÙØµØ±Ø§Ù"}),_?(0,l.jsx)(p.zx,{disabled:O||J||S.trim().length<3,onClick:function(){return H(!1)},children:O?"در ØØ§Ù Ø°Ø®ÛØ±Ù...":"Ø°Ø®ÛØ±Ù"}):(0,l.jsx)(p.zx,{disabled:O||!G||!f||Y,onClick:function(){return H(!0)},children:O?"...":"Ù
ØØ§Ø³Ø¨ÙâÛ ØªØºÛÛØ±"})]})]})}function ea(e){var t=e.label,a=e.value,n=e.min,s=e.max,r=e.onChange;return(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{className:"block mb-6 text-12 leading-18 text-gray-6C6A7D font-m",children:t}),(0,l.jsxs)("div",{className:"flex items-center gap-x-8",children:[(0,l.jsx)("button",{type:"button",onClick:function(){return r(Math.max(a-1,n))},className:"w-36 h-36 shrink-0 rounded-10 border border-gray-E5E5E6 text-16 text-gray-6C6A7D hover:border-gray-C4CAD3 transition",children:"â"}),(0,l.jsx)("span",{className:"flex-1 text-center text-14 leading-22 font-m text-black",children:(0,p.N)(a)}),(0,l.jsx)("button",{type:"button",disabled:void 0!==s&&a>=s,onClick:function(){return r(a+1)},className:"w-36 h-36 shrink-0 rounded-10 border border-gray-E5E5E6 text-16 text-gray-6C6A7D hover:border-gray-C4CAD3 transition disabled:opacity-40",children:"+"})]})]})}function en(e){var t=e.label,a=e.a,n=e.b;return(0,l.jsxs)("div",{className:"flex items-baseline justify-between gap-x-10 py-2 text-12 leading-20",children:[(0,l.jsx)("span",{className:"text-gray-6C6A7D",children:t}),(0,l.jsxs)("span",{className:"whitespace-nowrap",children:[(0,l.jsx)("span",{className:"text-gray-9B9BAA",children:(0,p.ND)(Math.round(a))})," â ",(0,l.jsx)("b",{className:"font-m ".concat(Math.abs(a-n)>=1?n>a?"text-[#2E7D32]":"text-[#C62828]":"text-gray-9B9BAA"),children:(0,p.ND)(Math.round(n))})]})]})}var es={DRAFT:"در Ø§ÙØªØ¸Ø§Ø± ثبت Ø¯Ø±Ø®ÙØ§Ø³Øª",HOST_APPROVAL:"در Ø§ÙØªØ¸Ø§Ø± تاÛÛØ¯ Ù
ÛØ²Ø¨Ø§Ù",SECOND_PAYMENT:"در Ø§ÙØªØ¸Ø§Ø± پرداخت ÙÙØ§ÛÛ",DONE:"تکÙ
Û٠شدÙ",CANCEL:"ÙØºÙ شدÙ",EXPIRED:"Ù
ÙÙØ¶Û شدÙ"},er={DRAFT:"gray",HOST_APPROVAL:"yellow",SECOND_PAYMENT:"yellow",DONE:"green",CANCEL:"red",EXPIRED:"gray"},el={HOST_CANCELLED:"Ù
ÛØ²Ø¨Ø§Ù",LIDOMA_CANCELLED:"Ù¾Ø´ØªÛØ¨Ø§ÙÛ ÙÛØ¯ÙÙ
ا",GUEST_CANCELLED:"Ù
ÙÙ
اÙ"},ei={BOOMGARDI:"بÙÙ
âگردÛ",SUIT:"Ø³ÙØ¦Ûت"},ec={CONFIRMED:"کارت Ù
ÙÛ â ØªØ§ÛÛØ¯ شدÙ",CHECKING:"کارت Ù
ÙÛ â Ø¯Ø± ØØ§Ù بررسÛ",NOT_CONFIRMED:"ثبت ÙØ´Ø¯Ù"},eo={DRAFT:{to:"HOST_APPROVAL",approve:"ارسا٠ب٠Ù
ÛØ²Ø¨Ø§Ù",reject:"رد Ø¯Ø±Ø®ÙØ§Ø³Øª",deadline:"Ù
ÙÙØª ثبت Ø¯Ø±Ø®ÙØ§Ø³Øª"},HOST_APPROVAL:{to:"SECOND_PAYMENT",approve:"تاÛÛØ¯ Ø¯Ø±Ø®ÙØ§Ø³Øª",reject:"رد Ø¯Ø±Ø®ÙØ§Ø³Øª",deadline:"Ù
ÙÙØª تاÛÛØ¯ ÛØ§ رد"},SECOND_PAYMENT:{to:"DONE",approve:"ثبت پرداخت Ù
ÙÙ
اÙ",reject:"ÙØºÙ رزرÙ",deadline:"Ù
ÙÙØª پرداخت Ù
ÙÙ
اÙ"}};function ed(){var e,t,a,n,r=(0,d.useRouter)().query.id,c=(0,s.Z)((0,i.useState)(!1),2),g=c[0],b=c[1],f=(0,s.Z)((0,i.useState)(!1),2),j=f[0],y=f[1],C=(0,s.Z)((0,i.useState)(!1),2),w=C[0],S=C[1],D=(0,s.Z)((0,i.useState)(!1),2),k=D[0],B=D[1],F=(0,s.Z)((0,i.useState)(!1),2),Z=F[0],O=F[1],T=(0,s.Z)((0,i.useState)(!1),2),I=T[0],M=T[1],R=(0,s.Z)((0,i.useState)(0),2),z=R[0],G=R[1],Y=(0,u.u)(r?"/api/admin/reservations/".concat(r):null,function(e){return(0,m.SC)(e)}
1),H=Y.data,J=Y.mutate,V=Y.isLoading,W=!!H&&"CANCEL"!==H.state&&"EXPIRED"!==H.state,X=(0,h.o)("reservations",r);return(0,l.jsxs)(x.Z,{title:null!==(t=null==H?void 0:H.reference)&&void 0!==t?t:"Ø¬Ø²Ø¦ÛØ§Øª رزرÙ",breadcrumb:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(o(),{href:"/admin",children:"Ø¯Ø§Ø´Ø¨ÙØ±Ø¯"})," / ",(0,l.jsx)(o(),{href:"/admin/reservations",children:"رزرÙÙØ§"})]}),backHref:null!==(a=null==X?void 0:X.returnUrl)&&void 0!==a?a:"/admin/reservations",prevNext:X?{prevHref:X.prevId?"/admin/reservations/".concat(X.prevId):null,nextHref:X.nextId?"/admin/reservations/".concat(X.nextId):null,position:"".concat((0,p.N)(X.index+1)," از ").concat((0,p.N)(X.total))}:void 0,actions:H&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(p.zx,{className:"bg-[#2E7D32] text-white hover:opacity-90",onClick:function(){return eu("payments")},children:[(0,l.jsx)("i",{className:"icon-Cash text-16"})," ثبت پرداخت"]}),(0,l.jsxs)(p.zx,{className:"bg-[#1B4F9C] text-white hover:opacity-90",onClick:function(){return eu("activity")},children:[(0,l.jsx)("i",{className:"icon-PhoneFill text-16"})," تÙ
اس Ù ÛØ§Ø¯Ø¯Ø§Ø´Øª"]}),(0,l.jsxs)(p.zx,{variant:"secondary",onClick:function(){return y(!0)},children:[(0,l.jsx)("i",{className:"icon-CalendarFlash text-16"})," تÙÙÛÙ
Ù ÙØ±Ø®"]}),(0,l.jsx)("a",{href:"/admin/reservations/".concat(H.id,"/invoice"),target:"_blank",rel:"noreferrer",children:(0,l.jsxs)(p.zx,{variant:"secondary",children:[(0,l.jsx)("i",{className:"icon-Details text-16"})," ÚØ§Ù¾ ÙØ§Ú©ØªÙر"]})}),(0,l.jsx)(A,{reservationId:H.id,onActed:function(){return G(function(e){return e+1})}}),W&&(0,l.jsx)(p.zx,{variant:"danger",onClick:function(){return b(!0)},children:"ÙØºÙ رزرÙ"})]}),children:[V&&(0,l.jsxs)("div",{className:"flex flex-col gap-16",children:[(0,l.jsx)(p.Od,{className:"h-[64px]"}),(0,l.jsx)(p.Od,{className:"h-[420px]"})]}),H&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(v,{reservationId:H.id,reference:H.reference,open:g,onClose:function(){return b(!1)},onCancelled:function(){return J()}}),(0,l.jsx)(p.u_,{open:j,onClose:function(){return y(!1)},title:"تÙÙÛÙ
Ù ÙØ±Ø® â ".concat(H.residence.name),width:"max-w-[1280px]",children:(0,l.jsx)(P.Z,{targets:H.rooms.length>0?H.rooms.map(function(e){return{residenceId:H.residence.id,roomId:e.room.id,label:e.room.name}}):[{residenceId:H.residence.id,label:H.residence.name}],onApplied:function(){J(),G(function(e){return e+1})},footerRight:(0,l.jsx)("button",{type:"button",onClick:function(){y(!1),S(!0)},className:"text-11 leading-18 font-m text-primary-dark whitespace-nowrap",children:"Ù
ÛâØ®ÙØ§ÙÛØ¯ ÙÙØ· ÙÛÙ
ت ÙÙ
ÛÙ Ø±Ø²Ø±Ù Ø¹ÙØ¶ Ø´ÙØ¯Ø"})})}),(0,l.jsx)(_,{open:w,onClose:function(){return S(!1)},reservationId:H.id,reference:H.reference,residenceId:H.residence.id,startDate:H.startDate,endDate:H.endDate,onSaved:function(){J(),G(function(e){return e+1})}}),(0,l.jsx)(K,{open:Z,onClose:function(){return O(!1)},reservationId:H.id,invoice:H.invoice,onSaved:function(){J(),G(function(e){return e+1})}}),(0,l.jsx)(U,{open:k,onClose:function(){return B(!1)},reservationId:H.id,terms:{totalAmount:H.totalAmount,websiteShare:H.websiteShare,vatAmount:H.vatAmount,guestCommission:H.guestCommission,hostShare:H.hostShare},onSaved:function(){J(),G(function(e){return e+1})}}),(0,l.jsx)(et,{open:I,onClose:function(){return M(!1)},reservationId:H.id,stay:{startDate:H.startDate,endDate:H.endDate,daysCount:H.daysCount,guestsCount:H.guestsCount,extraGuestsCount:H.extraGuestsCount,capacity:H.residence.capacity,maxCapacity:H.residence.maxCapacity},onSaved:function(){J(),G(function(e){return e+1})}}),(0,l.jsxs)("div",{className:"flex flex-col gap-y-16",children:[(0,l.jsx)(N.Z,{reservationId:H.id,createdAt:H.createdAt,updatedAt:H.updatedAt,onCancel:function(){return b(!0)},onChanged:function(){J(),G(function(e){return e+1})}}),(0,l.jsxs)("div",{className:"grid lg:grid-cols-12 gap-16 items-start",children:[(0,l.jsxs)("div",{className:"lg:col-span-5 flex flex-col gap-y-16 min-w-0",children:[(0,l.jsx)(ep,{data:H,onEditStay:function(){return M(!0)}}),(0,l.jsx)(eb,{data:H}),(0,l.jsx)(ef,{data:H})]}),(0,l.jsx)("div",{className:"lg:col-span-4 min-w-0",children:(0,l.jsx)(ej,{data:H,onEditRates:function(){return y(!0)},onEditTerms:function(){return B(!0)},onEditGift:function(){return O(!0)}})}),(0,l.jsxs)("div",{className:"lg:col-span-3 flex flex-col gap-y-16 min-w-0",children:[(0,l.jsx)(eC,{data:H,onChanged:function(){return J()},onReject:function(){return b(!0)}}
1),(0,l.jsx)(eN,{conversation:H.conversation})]})]}),(0,l.jsx)(Q,{invoice:H.invoice}),(0,l.jsx)("div",{id:"payments",children:(0,l.jsx)(L,{reservationId:H.id,canRecord:"CANCEL"!==H.state,guestWalletBalance:null===(e=H.guestProfile)||void 0===e?void 0:e.walletBalance,onChanged:function(){J(),G(function(e){return e+1})}})}),(0,l.jsx)("div",{id:"activity",children:(0,l.jsx)(E.Z,{reservationId:H.id,refreshKey:z})}),"CANCEL"===H.state&&(0,l.jsxs)(p.Zb,{className:"p-20 border-r-4 border-r-[#E53935]",children:[(0,l.jsx)("h3",{className:"text-16 leading-24 font-m text-black mb-10",children:"Ø§Ø·ÙØ§Ø¹Ø§Øª ÙØºÙ"}),(0,l.jsxs)("div",{className:"grid md:grid-cols-2 gap-x-24",children:[(0,l.jsx)(ex,{label:"ÙØºÙÚ©ÙÙØ¯Ù",value:null!==(n=H.cancelledBy&&el[H.cancelledBy])&&void 0!==n?n:"â"}),(0,l.jsx)(ex,{label:"دÙÛÙ",value:H.cancelReason||"â"})]}),H.cancelDesc&&(0,l.jsx)("p",{className:"mt-12 rounded-10 bg-gray-F7F7F7 p-12 text-13 leading-22 text-gray-6C6A7D whitespace-pre-wrap",children:H.cancelDesc})]}),H.review&&(0,l.jsx)(eA,{review:H.review})]})]})]})}function eu(e){requestAnimationFrame(function(){var t=document.getElementById(e);if(t){var a=t.getBoundingClientRect().top+window.scrollY-76;window.scrollTo({top:Math.max(a,0)})}})}function ex(e){var t=e.label,a=e.value,n=e.nowrap;return(0,l.jsxs)("div",{className:"flex items-baseline gap-x-8 py-4 text-13 leading-22",children:[(0,l.jsxs)("span",{className:"text-gray-9B9BAA shrink-0",children:[t," :"]}),(0,l.jsx)("span",{className:"text-black min-w-0 ".concat(n?"whitespace-nowrap":"break-words"),children:a})]})}function em(e){var t=e.icon,a=e.children;return(0,l.jsxs)("div",{className:"flex items-center gap-x-8 mb-12",children:[(0,l.jsx)("i",{className:"".concat(t," text-16 text-gray-9B9BAA")}),(0,l.jsx)("h3",{className:"text-15 leading-24 font-m text-black",children:a})]})}function eh(e){var t=e.value,a=(0,s.Z)((0,i.useState)(!1),2),n=a[0],r=a[1];return(0,l.jsxs)("span",{className:"inline-flex items-center gap-x-6",children:[(0,l.jsx)("a",{href:"tel:".concat(t),dir:"ltr",className:"text-13 leading-22 text-black hover:text-primary-main",children:t}),(0,l.jsx)("button",{type:"button",title:"Ú©Ù¾Û Ø´Ù
ارÙ",onClick:function(){var e;
1null===(e=navigator.clipboard)||void 0===e||e.writeText(t).then(function(){r(!0),setTimeout(function(){return r(!1)},1400)},function(){})},className:"px-6 py-2 rounded-6 text-10 leading-16 border transition ".concat(n?"border-[#03D6BB] text-[#015046] bg-[#03D6BB14]":"border-gray-E5E5E6 text-gray-9B9BAA hover:border-gray-C4CAD3"),children:n?"Ú©Ù¾Û Ø´Ø¯":"Ú©Ù¾Û"})]})}function eg(e){var t,a=e.url,n=e.name,s=e.size,r=void 0===s?44:s;return(0,l.jsx)("span",{className:"rounded-full bg-gray-F0F0F0 overflow-hidden shrink-0 flex items-center justify-center text-14 text-gray-6C6A7D",style:{width:r,height:r},children:a?(0,l.jsx)("img",{src:(0,p.vD)(a,96),alt:"",className:"w-full h-full object-cover"}):null!==(t=null==n?void 0:n[0])&&void 0!==t?t:"Ø"})}function ep(e){var t=e.data,a=e.onEditStay,n=t.guestProfile;return(0,l.jsxs)(p.Zb,{className:"p-20",children:[(0,l.jsx)(em,{icon:"icon-Profile",children:"Ù
شخصات Ù
ÙÙ
اÙ"}),(0,l.jsxs)("div",{className:"flex items-center gap-x-12 mb-12",children:[(0,l.jsx)(eg,{url:t.guest.avatarUrl,name:t.guest.name}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-x-8 flex-wrap gap-y-6",children:[(0,l.jsx)(o(),{href:"/admin/users/".concat(t.guest.id),className:"text-14 leading-22 font-m text-primary-dark hover:text-primary-main truncate",children:t.guest.name||"بدÙÙ ÙØ§Ù
"}),(null==n?void 0:n.isSpecialHost)&&(0,l.jsx)(p.Ct,{tone:"yellow",children:"Ù
ÙÙ
ا٠ÙÛÚÙ"})]}),(0,l.jsxs)("div",{className:"mt-2",children:[(0,l.jsx)("span",{className:"text-12 text-gray-9B9BAA",children:"Ø´Ù
ار٠تÙ
اس "}),(0,l.jsx)(eh,{value:t.guestPhoneOverride||t.guest.phone})]})]})]}),(0,l.jsxs)("div",{className:"grid md:grid-cols-2 gap-x-20",children:[(0,l.jsxs)("div",{className:"flex items-center gap-x-6",children:[(0,l.jsx)(ex,{nowrap:!0,label:"ØªØ§Ø±ÛØ® Ø³ÙØ±",value:"".concat((0,I.R3)(t.startDate)," â ").concat((0,I.R3)(t.endDate))}),(0,l.jsx)("button",{type:"button",onClick:a,title:"ÙÛØ±Ø§ÛØ´ Ø§ÙØ§Ù
ت",className:"shrink-0 text-gray-9B9BAA hover:text-primary-main transition",children:(0,l.jsx)("i",{className:"icon-Edit text-16"})})]}),(0,l.jsx)(ex,{nowrap:!0,label:"Ù
دت Ø§ÙØ§Ù
ت",value:"".concat((0,p.N)(t.daysCount)," شب")}),(0,l.jsx)(ex,{nowrap:!0,label:"تعداد Ù
ÙÙ
Ø§ÙØ§Ù",value:"".concat((0,p.N)(t.guestsCount)," ÙÙØ±").concat(t.extraGuestsCount>0?" + ".concat((0,p.N)(t.extraGuestsCount)," ÙÙØ± اضاÙÙ"):"")}),(0,l.jsx)(ex,{nowrap:!0,label:"Ù
ÙØ¬ÙØ¯Û Ú©ÛÙ Ù¾ÙÙ",value:n?(0,p.ND)(n.walletBalance):"â"})]}),t.guestNameOverride&&(0,l.jsxs)("p",{className:"mt-8 text-11 leading-18 text-gray-9B9BAA",children:["Ø±Ø²Ø±Ù Ø¨Ø±Ø§Û Ø´Ø®Øµ دÛگر: ",t.guestNameOverride]})]})}function eb(e){var t,a,n,s,r,i,c,d,u,x=e.data,m=x.residence,h=[null===(t=m.city)||void 0===t?void 0:t.name,null===(a=m.city)||void 0===a?void 0:null===(n=a.province)||void 0===n?void 0:n.name,m.neighborhood].filter(Boolean).join("Ø ");return(0,l.jsxs)(p.Zb,{className:"p-20",children:[(0,l.jsx)(em,{icon:"icon-Homes",children:"Ù
شخصات Ø§ÙØ§Ù
تگاÙ"}),(0,l.jsxs)("div",{className:"flex gap-x-14",children:[(null===(s=m.images[0])||void 0===s?void 0:s.url)?(0,l.jsx)("img",{src:(0,p.vD)(m.images[0].url,384),alt:"",className:"w-[104px] h-[78px] rounded-12 object-cover shrink-0"}):(0,l.jsx)("span",{className:"w-[104px] h-[78px] rounded-12 bg-gray-F0F0F0 shrink-0"}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-x-8 flex-wrap gap-y-4",children:[(0,l.jsx)(o(),{href:"/admin/residences/".concat(null!==(r=m.publicId)&&void 0!==r?r:m.id),className:"text-14 leading-22 font-m text-primary-dark hover:text-primary-main",children:m.name}),(0,l.jsxs)("span",{className:"text-12 text-gray-9B9BAA",children:["( کد : ",m.reference," )"]}),(0,l.jsx)(p.Ct,{tone:"gray",children:null!==(i=ei[m.type])&&void 0!==i?i:m.type})]}),(0,l.jsxs)("p",{className:"flex items-start gap-x-6 text-12 leading-20 text-gray-6C6A7D mt-4",children:[(0,l.jsx)("i",{className:"icon-Home text-14 text-gray-9B9BAA shrink-0 mt-2"}
1),(0,l.jsx)("span",{children:[h,m.address].filter(Boolean).join("Ø ")||"â"})]}),(0,l.jsx)("div",{className:"mt-6",children:(0,l.jsx)(p.tS,{value:m.averageRating,count:m.reviewsCount})})]})]}),(0,l.jsxs)("div",{className:"grid md:grid-cols-2 gap-x-20 mt-12",children:[(0,l.jsx)(ex,{nowrap:!0,label:"ÙØ±Ùد",value:"".concat(null!==(c=m.checkinFrom)&&void 0!==c?c:"â"," تا ").concat(null!==(d=m.checkinTo)&&void 0!==d?d:"â")}),(0,l.jsx)(ex,{nowrap:!0,label:"Ø®Ø±ÙØ¬",value:null!==(u=m.checkout)&&void 0!==u?u:"â"})]}),x.rooms.length>0&&(0,l.jsxs)("p",{className:"mt-8 text-12 leading-20 text-gray-6C6A7D",children:["اتاÙâÙØ§Û Ø±Ø²Ø±ÙØ´Ø¯Ù: ",x.rooms.map(function(e){return e.room.name}).join("Ø ")]}),m.rules.length>0&&(0,l.jsxs)("p",{className:"mt-4 text-11 leading-18 text-gray-9B9BAA",children:["ÙÙØ§ÙÛÙ: ",m.rules.map(function(e){return e.rule.name}).join("Ø ")]})]})}function ef(e){var t,a=e.data,n=a.hostProfile;return(0,l.jsxs)(p.Zb,{className:"p-20",children:[(0,l.jsx)(em,{icon:"icon-Profile",children:"Ù
شخصات Ù
ÛØ²Ø¨Ø§Ù"}),(0,l.jsxs)("div",{className:"flex items-center gap-x-12",children:[(0,l.jsx)(eg,{url:a.host.avatarUrl,name:a.host.name}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-x-8 flex-wrap gap-y-6",children:[(0,l.jsx)(o(),{href:"/admin/users/".concat(a.host.id),className:"text-14 leading-22 font-m text-primary-dark hover:text-primary-main truncate",children:a.host.name||"بدÙÙ ÙØ§Ù
"}),(null==n?void 0:n.isSpecialHost)&&(0,l.jsx)(p.Ct,{tone:"blue",children:"Ù
ÛØ²Ø¨Ø§Ù ÙÛÚÙ"})]}),(0,l.jsxs)("div",{className:"mt-2",children:[(0,l.jsx)("span",{className:"text-12 text-gray-9B9BAA",children:"Ø´Ù
ار٠تÙ
اس "}),(0,l.jsx)(eh,{value:a.host.phone})]})]})]}),(0,l.jsxs)("div",{className:"grid md:grid-cols-2 gap-x-20 mt-10",children:[(0,l.jsx)(ex,{nowrap:!0,label:"کارÙ
زد Ø³Ø§ÛØª",value:null!=a.commissionPercent?"".concat((0,p.N)(a.commissionPercent),"Ùª از اÛ٠رزرÙ"):"â"}),(0,l.jsx)(ex,{nowrap:!0,label:"Ù
ÙØ¬ÙØ¯Û Ú©ÛÙ Ù¾ÙÙ",value:n?(0,p.ND)(n.walletBalance):"â"}),(0,l.jsx)(ex,{label:"Ù
دارک",value:n&&null!==(t=ec[n.verificationStatus])&&void 0!==t?t:"â"}),(0,l.jsx)(ex,{nowrap:!0,label:"تعداد Ø§ÙØ§Ù
تگاÙ",value:(null==n?void 0:n.residencesCount)!==void 0?"".concat((0,p.N)(n.residencesCount)," Ø§ÙØ§Ù
تگاÙ"):"â"})]})]})}function ej(e){var t,a,n,s,r=e.data,i=e.onEditRates,c=e.onEditTerms,o=e.onEditGift,d=r.invoice,u=(null!==(t=r.hostShare)&&void 0!==t?t:0)-r.settledAmount,x=function(e){return null!=e?"".concat((0,p.N)(e),"Ùª"):void 0};return(0,l.jsxs)(p.Zb,{className:"p-20",children:[(0,l.jsxs)("div",{className:"rounded-12 border border-gray-E5E5E6 py-12 text-center mb-14",children:[(0,l.jsx)("span",{className:"text-13 leading-22 text-gray-6C6A7D",children:"کد رزر٠"}),(0,l.jsx)("b",{className:"text-15 leading-24 font-m text-black tracking-wide",children:r.reference})]}),(0,l.jsxs)("div",{className:"rounded-12 bg-gray-F7F7F7 p-14 mb-14 text-center",children:[(0,l.jsx)("p",{className:"text-12 leading-20 text-gray-6C6A7D mb-2",children:"Ù
Ø¨ÙØº ÙÙØ§ÛÛ ÙØ§Ø¨Ù پرداخت Ù
ÙÙ
اÙ"}),(0,l.jsx)("strong",{className:"text-18 leading-28 font-m text-black",children:(0,p.ND)(d.guestPayable)})]}),(0,l.jsx)(ey,{label:"Ù
Ø¨ÙØº ک٠رزرÙ",value:d.totalAmount}),d.codeDiscount>0&&(0,l.jsx)(ey,{label:"کد تخÙÛÙ".concat(d.discountCode?" (".concat(d.discountCode,")"):""),value:-d.codeDiscount,tone:"red"}),d.hostGiftDiscount>0&&(0,l.jsx)(ey,{label:"تخÙÛÙ ÙØ¯ÛÙ Ù
ÛØ²Ø¨Ø§Ù",value:-d.hostGiftDiscount,tone:"red"}),d.siteGiftDiscount>0&&(0,l.jsx)(ey,{label:"تخÙÛÙ ÙØ¯ÛÙ Ø³Ø§ÛØª",value:-d.siteGiftDiscount,tone:"red"}),d.totalDiscount>0&&(0,l.jsx)(ey,{label:"Ù
Ø¨ÙØº ÙÙØ§ÛÛ ØµÙØ±ØªØØ³Ø§Ø¨",value:d.invoiceAmount,strong:!0}),(0,l.jsx)(ey,{label:"کارÙ
زد رزر٠Ù
ÙÙ
اÙ",hint:x(d.guestCommissionPercent),value:d.guestCommission}),(0,l.jsx)(ey,{label:"Ù
Ø¨ÙØº ÙÙØ§ÛÛ ÙØ§Ø¨Ù پرداخت Ù
ÙÙ
اÙ",value:d.guestPayable,strong:!0}),(0,l.jsx)(ey,{label:"Ù¾Ø±Ø¯Ø§Ø®ØªÛ Ù
Ø³Ø§ÙØ±",value:r.paidAmount}
1),r.remainingAmount>0&&(0,l.jsx)(ey,{label:"باÙÛâÙ
Ø§ÙØ¯Ù پرداخت",value:r.remainingAmount,tone:"red",strong:!0}),(0,l.jsx)(ev,{}),(0,l.jsx)(ey,{label:"سÙÙ
ÙÛØ¯ÙÙ
ا",hint:x(d.commissionPercent),value:d.websiteShare}),(0,l.jsx)(ey,{label:"ارزش Ø§ÙØ²ÙدÙ",hint:null!=d.vatPercent?"".concat((0,p.N)(d.vatPercent),"Ùª از سÙÙ
ÙÛØ¯ÙÙ
ا"):void 0,value:d.vatAmount}),d.hostGiftDiscount>0?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ey,{label:"Ø¯Ø±ÛØ§ÙØªÛ Ù
ÛØ²Ø¨Ø§Ù Ù¾ÛØ´ از ÙØ¯ÛÙ",value:d.hostShareBeforeGift}),(0,l.jsx)(ey,{label:"تخÙÛÙ ÙØ¯ÛÙ Ù
ÛØ²Ø¨Ø§Ù",value:-d.hostGiftDiscount,tone:"red"})]}):null,(0,l.jsx)(ey,{label:"Ù
Ø¨ÙØº ÙÙØ§ÛÛ Ø¯Ø±ÛØ§Ùت Ù
ÛØ²Ø¨Ø§Ù",value:d.hostShare,strong:!0}),(0,l.jsx)(ev,{}),(0,l.jsx)(ey,{label:"ÙØ§Ø±Ûز شد٠ب٠Ù
ÛØ²Ø¨Ø§Ù",value:r.settledAmount}),(0,l.jsx)(ey,{label:"Ù
Ø§ÙØ¯Ù سÙÙ
Ù
ÛØ²Ø¨Ø§Ù",value:null==r.hostShare?null:u,strong:!0,tone:u>0?"red":"green"}),(null!=r.residence.hostShareTotalAmount||null!=r.residence.hostSharePastNights||null!=r.residence.hostShareFutureNights)&&(0,l.jsxs)("p",{className:"mt-10 text-11 leading-18 text-gray-9B9BAA",children:["Ø³ÛØ§Ø³Øª تسÙÛÙ: Ú©Ù ",null!==(a=r.residence.hostShareTotalAmount)&&void 0!==a?a:"â","Ùª \xb7 شبâÙØ§Û گذشتÙ"," ",null!==(n=r.residence.hostSharePastNights)&&void 0!==n?n:"â","Ùª \xb7 شبâÙØ§Û Ø¢ÛÙØ¯Ù"," ",null!==(s=r.residence.hostShareFutureNights)&&void 0!==s?s:"â","Ùª"]}),(0,l.jsxs)("div",{className:"mt-14 flex flex-col gap-y-8",children:[(0,l.jsxs)(p.zx,{variant:"secondary",className:"w-full",onClick:i,children:[(0,l.jsx)("i",{className:"icon-Edit text-16"})," ÙÛØ±Ø§ÛØ´ ÙÛÙ
ت رزرÙ"]}),(0,l.jsxs)(p.zx,{variant:"secondary",className:"w-full",onClick:c,children:[(0,l.jsx)("i",{className:"icon-Cash text-16"})," ÙÛØ±Ø§ÛØ´ کارÙ
زد Ù Ù
اÙÛØ§Øª"]}),(0,l.jsxs)(p.zx,{variant:"secondary",className:"w-full",onClick:o,children:[(0,l.jsx)("i",{className:"icon-Offer text-16"})," تخÙÛÙ ÙØ¯ÛÙ"]})]})]})}function ev(){return(0,l.jsx)("div",{className:"h-1 bg-gray-F0F0F0 my-10"})}function ey(e){var t=e.label,a=e.value,n=e.hint,s=e.strong,r=e.tone,i=e.text;return(0,l.jsxs)("div",{className:"flex items-baseline justify-between gap-x-12 py-3",children:[(0,l.jsxs)("span",{className:"text-12 leading-20 text-gray-9B9BAA min-w-0",children:[t,n&&(0,l.jsxs)("span",{className:"text-11",children:[" \xb7 ",n]})]}),(0,l.jsx)("span",{className:"text-13 leading-20 whitespace-nowrap ".concat("red"===r?"text-[#C62828]":"green"===r?"text-[#2E7D32]":s?"text-black":"text-gray-6C6A7D"," ").concat(s?"font-m":""),children:null!=i?i:null==a?(0,l.jsx)("span",{className:"text-gray-9B9BAA",children:"ثبت ÙØ´Ø¯Ù"}):(0,p.ND)(a)})]})}function eN(e){var t=e.conversation,a=null==t?void 0:t.lastMessage;return(0,l.jsxs)(p.Zb,{className:"p-16",children:[(0,l.jsx)("h3",{className:"text-13 leading-20 font-m text-black mb-8",children:"آخرÛÙ Ù¾ÛØ§Ù
Ú¯ÙØªÚ¯Ù"}),a?(0,l.jsxs)("div",{className:"mb-10",children:[(0,l.jsx)("span",{className:"text-11 leading-18 text-gray-9B9BAA",children:"GUEST"===a.senderRole?"Ù
ÙÙ
اÙ":"Ù
ÛØ²Ø¨Ø§Ù"}),(0,l.jsx)("p",{className:"mt-2 text-13 leading-22 text-black break-words",children:a.preview})]}):(0,l.jsx)("p",{className:"mb-10 text-12 leading-20 text-gray-9B9BAA",children:"Ú¯ÙØªÚ¯ÙÛÛ ÙØ¯Ø§Ø´ØªÙد"}),t&&(0,l.jsx)(o(),{href:"/admin/conversations?c=".concat(t.id),children:(0,l.jsxs)(p.zx,{variant:"secondary",className:"w-full",children:[(0,l.jsx)("i",{className:"icon-message text-16"})," Ù
Ø´Ø§ÙØ¯Ù Ú¯ÙØªÚ¯Ù"]})})]})}function eC(e){var t,a,c,o=e.data,d=e.onChanged,u=e.onReject,x=(0,s.Z)((0,i.useState)(!1),2),h=x[0],g=x[1],b=(0,s.Z)((0,i.useState)(""),2),f=b[0],j=b[1],v=(0,s.Z)((0,i.useState)(!1),2),y=v[0],N=v[1],C=(0,s.Z)((0,i.useState)(null),2),A=C[0],E=C[1],w=(0,s.Z)((0,i.useState)(!1),2),S=w[0],D=w[1],k=(0,s.Z)((0,i.useState)(null),2),B=k[0],_=k[1],F=eo[o.state],Z=o.expiryDate?Math.round((new Date(o.expiryDate).getTime()-Date.now())/6e4):null,O=null!=Z&&Z<=0;function T(){return P.apply(this,arguments)}function P(){return(P=(0,n.Z)(function(){return(0,r.__generator)(this,function(e){switch(e.label){case 0:if(!F)return[2];return[4,(0,m.SC)("/api/admin/reservations/".concat(o.id,"/state"),{method:"POST",body:JSON.stringify({toState:F.to,note:f.trim()})})];case 1:return e.sent(),g(!1),_(null),j(""),d(),[2]}})})).apply(this,arguments)}function M(){return(M=(0,n.Z)(function(){var e,t;return(0,r.__generator)(this,function(a){switch(a.label){case 0:if(!F)return[2];N(!0),E(null),a.label=1;case 1:if(a.trys.push([1,5,6,7]),"DONE"!==F.to)return[3,3];return[4,(0,m.SC)("/api/admin/reservations/".concat(o.id,"/payments"))];case 2:if((e=a.sent()).summary.remaining>0)return g(!1),_(e.summary.remaining),[2];a.label=3;case 3:return[4,T()];case 4:return a.sent(),[3,7];case 5:return E((t=a.sent())instanceof Error?t.message:"ثبت ÙØ´Ø¯"),[3,7];case 6:return N(!1),[7];case 7:return[2]}})})).apply(this,arguments)}function L(){return(L=(0,n.Z)(function(){var e;return(0,r.__generator)(this,function(t){switch(t.label){case 0:N(!0),E(null),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,T()];case 2:return t.sent(),[3,5];case 3:return E((e=t.sent())instanceof Error?e.message:"ثبت ÙØ´Ø¯"),[3,5];case 4:return N(!1),[7];case 5:return[2]}})})).apply(this,arguments)}function R(){return(R=(0,n.Z)(function(e){var t;return(0,r.__generator)(this,function(a){switch(a.label){case 0:N(!0),E(null),a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,(0,m.SC)("/api/admin/reservations/".concat(o.id,"/expiry"),{method:"PATCH",body:JSON.stringify({minutesFromN
1ow:e})})];case 2:return a.sent(),D(!1),d(),[3,5];case 3:return E((t=a.sent())instanceof Error?t.message:"تÙ
Ø¯ÛØ¯ ÙØ´Ø¯"),[3,5];case 4:return N(!1),[7];case 5:return[2]}})})).apply(this,arguments)}var z=(0,l.jsxs)(p.u_,{open:null!=B,onClose:function(){return _(null)},title:"Ù
ÙÙ
ا٠ÙÙÙØ² پرداخت را کاÙ
Ù ÙکردÙ",width:"max-w-[460px]",children:[(0,l.jsxs)("p",{className:"text-13 leading-22 text-gray-6C6A7D mb-4",children:["Ø·Ø¨Ù Ø¯ÙØªØ± پرداختâÙØ§Ø ÙÙÙØ²"," ",(0,l.jsx)("b",{className:"text-[#C62828]",children:null!=B&&(0,p.ND)(B)})," از Ù
ÙÙ
Ø§Ù Ø¯Ø±ÛØ§Ùت ÙØ´Ø¯Ù است. رزر٠",(0,l.jsx)("b",{className:"text-black",children:o.reference})," ÙÙÙØ² \xabÙØ·Ø¹Û\xbb ÙØ´Ø¯Ù â Ø§Û٠تصÙ
ÛÙ
Ø´Ù
است."]}),(0,l.jsx)("p",{className:"text-12 leading-20 text-gray-9B9BAA mb-16",children:"Ù
ÛâØªÙØ§ÙÛØ¯ ÙÙ
ÛÙ ØØ§Ùا برÙÛØ¯ ٠پرداخت را ثبت Ú©ÙÛØ¯ â Ø±Ø²Ø±Ù تا آ٠زÙ
ا٠ب٠ÙÙ
ÛÙ ØØ§Ùت Ù
ÛâÙ
Ø§ÙØ¯ â ÛØ§ بدÙÙ Ø¯Ø±ÛØ§Ùت اÛÙ Ù
Ø¨ÙØº رزر٠را ÙÙ
ÛÙ Ø§ÙØ§Ù ÙØ·Ø¹Û Ú©ÙÛØ¯."}),(0,l.jsxs)("div",{className:"flex flex-col gap-y-8",children:[(0,l.jsx)(p.zx,{className:"w-full",disabled:y,onClick:function(){var e;_(null),null===(e=document.getElementById("payments"))||void 0===e||e.scrollIntoView({behavior:"smooth",block:"start"})},children:"ثبت پرداخت Ù
ÙÙ
اÙ"}),(0,l.jsx)(p.zx,{variant:"ghost",className:"w-full",disabled:y,onClick:function(){return L.apply(this,arguments)},children:y?"در ØØ§Ù ثبت...":"اداÙ
Ù Ù ÙØ·Ø¹Ûâکرد٠رزر٠بدÙ٠پرداخت Ù
ÙÙ
اÙ"})]}),A&&(0,l.jsx)("p",{className:"mt-10 text-13 text-[#C62828]",children:A})]});return F?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(p.Zb,{className:"p-20",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-y-10",children:[(0,l.jsx)(p.zx,{className:"w-full bg-[#2E7D32] text-white hover:opacity-90",onClick:function(){return g(!0)},children:F.approve}),(0,l.jsx)(p.zx,{variant:"danger",className:"w-full",onClick:u,children:F.reject})]}),(0,l.jsxs)("div",{className:"mt-16 pt-14 border-t border-gray-F0F0F0",children:[(0,l.jsx)("p",{className:"text-12 leading-20 text-gray-6C6A7D mb-6",children:F.deadline}),o.expiryDate?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"text-24 leading-32 font-m tracking-wide ".concat(O?"text-[#C62828]":"text-black"),dir:"ltr",children:O?"Û°Û° : Û°Û°":(t=function(e){return(0,p.N)(e).padStart(2,"Û°")},"".concat(t(Math.floor(Z/60))," : ").concat(t(Z%60)))}),(0,l.jsxs)("p",{className:"text-11 leading-18 text-gray-9B9BAA mt-2",children:[(0,I.R3)(o.expiryDate)," ساعت ",(0,p.A1)(o.expiryDate)[1],O&&" â Ú¯Ø°Ø´ØªÙØ در Ø§Ø¬Ø±Ø§Û Ø¨Ø¹Ø¯Û Ø²Ù
اÙâØ¨ÙØ¯ Ù
ÙÙØ¶Û Ù
ÛâØ´ÙØ¯"]})]}):(0,l.jsx)("p",{className:"text-12 leading-20 text-gray-9B9BAA",children:"Ù
ÙÙØªÛ ثبت ÙØ´Ø¯Ù â Ø§ÛÙ Ø±Ø²Ø±Ù Ø®ÙØ¯Ø¨ÙâØ®ÙØ¯ Ù
ÙÙØ¶Û ÙÙ
ÛâØ´ÙØ¯."}),S?(0,l.jsxs)("div",{className:"mt-10 flex flex-wrap gap-8",children:[[30,60,120,720].map(function(e){return(0,l.jsx)("button",{type:"button",disabled:y,onClick:function(){return function(e){return R.apply(this,arguments)}(e)},className:"px-10 py-6 rounded-10 text-12 leading-20 border border-gray-E5E5E6 text-gray-6C6A7D hover:border-gray-C4CAD3 transition disabled:opacity-50",children:e<60?"".concat((0,p.N)(e)," دÙÛÙÙ"):"".concat((0,p.N)(e/60)," ساعت")},e)}),(0,l.jsx)("button",{type:"button",onClick:function(){return D(!1)},className:"px-10 py-6 rounded-10 text-12 leading-20 text-gray-9B9BAA",children:"Ø§ÙØµØ±Ø§Ù"})]}):(0,l.jsxs)(p.zx,{variant:"secondary",className:"w-full mt-10",onClick:function(){return D(!0)},children:["تÙ
Ø¯ÛØ¯ ",F.deadline]})]}),A&&(0,l.jsx)("p",{className:"mt-10 text-13 text-[#C62828]",children:A}),(0,l.jsxs)(p.u_,{open:h,onClose:function(){return g(!1)},title:F.approve,width:"max-w-[460px]",children:[(0,l.jsxs)("p",{className:"text-13 leading-22 text-gray-6C6A7D mb-10",children:["رزر٠",(0,l.jsx)("b",{className:"text-black",children:o.reference})," Ø¨Ù ÙØ¶Ø¹Ûت \xab",es[F.to],"\xbb Ù
ÙØªÙÙ Ù
ÛâØ´ÙØ¯."]}),(0,l.jsx)("textarea",{value:f,onChange:function(e){return j(e.target.value)},rows:3,placeholder:"ØªÙØ¶ÛØ â ÚØ±Ø§ اÛ٠رزر٠جابÙâØ¬Ø§ Ù
ÛâØ´ÙØ¯Ø",className:"w-full rounded-8 border border-gray-E5E5E6 p-10 text-13 leading-22 outline-none focus:border-primary-main"}),(0,l.jsx)("p",{className:"mt-6 text-11 leading-18 text-gray-9B9BAA",children:"اÛÙ ØªÙØ¶ÛØ Ø¯Ø± ØªØ§Ø±ÛØ®ÚÙâÛ Ø±Ø²Ø±Ù Ø¨Ø§ ÙØ§Ù
Ø´Ù
ا ثبت Ù
ÛâØ´ÙØ¯ ٠پاک ÙÙ
ÛâØ´ÙØ¯."}),A&&(0,l.jsx)("p",{className:"mt-8 text-13 text-[#C62828]",children:A}),(0,l.jsxs)("div",{className:"flex justify-end gap-x-8 mt-14",children:[(0,l.jsx)(p.zx,{variant:"secondary",onClick:function(){return g(!1)},children:"Ø§ÙØµØ±Ø§Ù"}),(0,l.jsx)(p.zx,{disabled:y||f.trim().length<3,onClick:function(){return M.apply(this,arguments)},children:y?"در ØØ§Ù ثبت...":"ثبت"})]})]})]}),z]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(p.Zb,{className:"p-20",children:[(0,l.jsx)("h3",{className:"text-15 leading-24 font-m text-black mb-8",children:"ÙØ¶Ø¹Ûت رزرÙ"}),(0,l.jsx)(p.Ct,{tone:null!==(a=er[o.state])&&void 0!==a?a:"gray",children:null!==(c=es[o.state])&&void 0!==c?c:o.state}),(0,l.jsx)("p",{className:"mt-10 text-12 leading-20 text-gray-6C6A7D",children:"تصÙ
ÛÙ
Û Ø¨Ø±Ø§Û Ø§Û٠رزر٠در Ø§ÙØªØ¸Ø§Ø± ÙÛØ³Øª. Ø¨Ø±Ø§Û Ø¬Ø§Ø¨ÙâØ¬Ø§ÛÛ Ø¯Ø³ØªÛ Ø§Ø² Ù¾ÙÙ \xabÙØ¶Ø¹Ûت رزرÙ\xbb پاÛÛÙ ØµÙØÙ Ø§Ø³ØªÙØ§Ø¯Ù Ú©ÙÛØ¯."})]}),z]})}function eA(e){var t=e.review,a=[{label:"ÙØ¸Ø§Ùت",score:t.cleaning},{label:"Ù
ÙÙØ¹Ûت Ù
کاÙÛ",score:t.location},{label:"Ú©ÛÙÛØª ÙØ³Ø¨Øª Ø¨Ù ÙØ±Ø®",score:t.quality},{label:"ØµØØª Ù
Ø·Ø§ÙØ¨",score:t.integrity},{label:"Ø¨Ø±Ø®ÙØ±Ø¯ Ù
ÛØ²Ø¨Ø§Ù",score:t.greeting},{label:"ÙØÙ٠تØÙÛÙ",score:t.delivery}];return(0,l.jsxs)(p.Zb,{className:"p-20",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between gap-x-12 flex-wrap gap-y-8 mb-10",children:[(0,l.jsx)("h3",{className:"text-16 leading-24 font-m text-black",children:"ÙØ¸Ø± Ù
ÙÙ
اÙ"}),(0,l.jsx)(p.tS,{value:t.averageRating})]}),(0,l.jsx)("p",{className:"text-13 leading-22 text-black whitespace-pre-wrap",children:t.comment}),(0,l.jsx)("div",{className:"grid md:grid-cols-3 gap-x-24 mt-12",children:a.map(function(e){return(0,l.jsx)(ex,{label:e.label,value:"".concat((0,p.N)(e.score)," از Ûµ")},e.label)})}),t.hostAnswer&&(0,l.jsxs)("div",{className:"mt-12 rounded-10 bg-gray-F7F7F7 p-12",children:[(0,l.jsx)("p",{className:"text-11 leading-18 text-gray-9B9BAA mb-4",children:"پاسخ Ù
ÛØ²Ø¨Ø§Ù"}),(0,l.jsx)("p",{className:"text-13 leading-22 text-black whitespace-pre-wrap",children:t.hostAnswer})]})]})}}},function(e){e.O(0,[4885,9791,8289,9759,3496,5197,9774,2888,179],function(){return e(e.s=68552)}),_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.