PageSourceSearch

https://lidomatrip.com/_next/static/chunks/pages/admin/crm/[id]-f8eebe23a71bc010.js

js lidomatrip.com collected 2026-09-25 07:11:00 UTC 46,759 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5668],{68690:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/crm/[id]",function(){return t(13045)}])},97590:function(e,n,t){"use strict";t.d(n,{$4:function(){return j},Af:function(){return b},Gu:function(){return v},Hy:function(){return s},IU:function(){return f},LH:function(){return x},Mz:function(){return l},OV:function(){return p},Qq:function(){return h},SZ:function(){return u},VT:function(){return d},Ve:function(){return S},Zr:function(){return g},_V:function(){return c},aq:function(){return C},i0:function(){return N},nO:function(){return m},xn:function(){return o},yI:function(){return i},yS:function(){return y}});var r=t(10253),a=t(84858),i=function(){return(0,a.SC)("/api/admin/crm/stages")},s=function(e){return(0,a.SC)("/api/admin/crm/stages",{method:"POST",body:JSON.stringify({title:e})})},o=function(e,n){return(0,a.SC)("/api/admin/crm/stages/".concat(e),{method:"PATCH",body:JSON.stringify({title:n})})},l=function(e,n){return(0,a.SC)("/api/admin/crm/stages/".concat(e,"/move"),{method:"POST",body:JSON.stringify({direction:n})})},c=function(e){return(0,a.SC)("/api/admin/crm/stages/".concat(e),{method:"DELETE"})},u=function(e){return(0,a.SC)("/api/admin/crm/board?filter=".concat(e))},d=function(e){return(0,a.SC)("/api/admin/crm/cards/search-phone",{method:"POST",body:JSON.stringify({phone:e})})},x=function(e){return(0,a.SC)("/api/admin/crm/cards",{method:"POST",body:JSON.stringify(e)})},m=function(e){return(0,a.SC)("/api/admin/crm/cards/".concat(e))},p=function(e,n){return(0,a.SC)("/api/admin/crm/cards/".concat(e),{method:"PATCH",body:JSON.stringify(n)})},h=function(e,n,t){return(0,a.SC)("/api/admin/crm/cards/".concat(e,"/stage"),{method:"PATCH",body:JSON.stringify({stageId:n,order:t})})},f=function(e,n){var t=new URLSearchParams;return Object.entries(n).forEach(function(e){var n=(0,r.Z)(e,2),a=n[0],i=n[1];void 0!==i&&""!==i&&t.set(a,Array.isArray(i)?i.join(","):String(i))}),(0,a.SC)("/api/admin/crm/cards/".concat(e,"/search-residences?").concat(t.toString()))},g=function(e){return(0,a.SC)("/api/admin/crm/neighborhoods".concat(e?"?cityId=".concat(e):""))},v=function(e){return(0,a.SC)("/api/admin/crm/cards/".concat(e,"/residences"))},b=function(e,n){return(0,a.SC)("/api/admin/crm/cards/".concat(e,"/residences"),{method:"POST",body:JSON.stringify({residenceId:n})})},y=function(e,n){return(0,a.SC)("/api/admin/crm/cards/".concat(e,"/residences/").concat(n),{method:"DELETE"})},N=function(e){return(0,a.SC)("/api/admin/crm/cards/".concat(e,"/residences"),{method:"DELETE"})},j=function(e){return(0,a.SC)("/api/admin/crm/cards/".concat(e,"/send-link"),{method:"POST"})},C=function(e,n){return(0,a.SC)("/api/admin/crm/cards/".concat(e,"/reservation"),{method:"POST",body:JSON.stringify({residenceId:n})})},S=function(e){return(0,a.SC)("/api/admin/crm/cards/".concat(e,"/guest-history"))}},19365:function(e,n,t){"use strict";t.d(n,{n:function(){return s}});var r=t(10253),a=t(85893),i=t(67294);function s(e){var n,t=e.value,s=e.onChange,o=(0,r.Z)((0,i.useState)(null),2),l=o[0],c=o[1],u=null!==(n=null!=l?l:t)&&void 0!==n?n:0;return(0,a.jsx)("span",{className:"inline-flex items-center gap-x-2",onMouseLeave:function(){return c(null)},children:[1,2,3].map(function(e){return(0,a.jsx)("button",{type:"button",onMouseEnter:function(){return c(e)},onClick:function(n){n.stopPropagation(),s(t===e?null:e)},className:"leading-none","aria-label":"".concat(e," ستاره"),children:(0,a.jsx)("i",{className:"".concat(e<=u?"icon-StarFill text-[#FFB800]":"icon-Star text-gray-D2D2D7"," text-14")})},e)})})}},18730:function(e,n,t){"use strict";t.d(n,{Ps:function(){return s},U4:function(){return o},sM:function(){return i}});var r=t(36305),a=t(85893),i=[{value:"NO_DOCS",label:"بدون مدارک"},{value:"POOL",label:"استخردار"},{value:"PARKING",label:"پارکینگ دار"},{value:"LUXURY",label:"لوکس"},{value:"CHEAP",label:"ارزان"}],s={NO_DOCS:{bg:"#F0F0F0",text:"#6C6A7D",border:"#C4CAD3"},POOL:{bg:"#E8F1FF",text:"#1B4F9C",border:"#5B9BFF"},PARKING:{bg:"#FFF4E0",text:"#B26A00",border:"#FFB74D"},LUXURY:{bg:"#F1EAFE",text:"#5B32B0",border:"#B18AF0"},CHEAP:{bg:"#03D6BB14",text:"#015046",border:"#03D6BB"}};
1function o(e){var n=e.options,t=e.value,i=e.onChange,o=function(e){i(t.includes(e)?t.filter(function(n){return n!==e}):(0,r.Z)(t).concat([e]))};return(0,a.jsx)("div",{className:"flex flex-wrap gap-8",children:n.map(function(e){var n,r=t.includes(e.value),i=null!==(n=s[e.value])&&void 0!==n?n:s.NO_DOCS;return(0,a.jsx)("button",{type:"button","aria-pressed":r,onClick:function(){return o(e.value)},style:r?{backgroundColor:i.bg,color:i.text,borderColor:i.border}:void 0,className:"px-14 py-8 rounded-10 text-13 leading-20 border transition ".concat(r?"font-m":"border-gray-E5E5E6 text-gray-6C6A7D hover:border-gray-C4CAD3"),children:e.label},e.value)})})}},1965:function(e,n,t){"use strict";t.d(n,{Z:function(){return p}});var r=t(47568),a=t(10253),i=t(70655),s=t(85893),o=t(67294),l=t(44389),c=t(84858),u=t(32474),d=["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 p(e){var n=e.reservationId,t=e.createdAt,p=e.updatedAt,h=e.onCancel,f=e.onChanged,g=function(e,n){if("CANCEL"===e){h();return}C({state:e,label:n}),w(!1),D(""),O(!0),L(null)},v=(0,l.u)("/api/admin/reservations/".concat(n,"/state"),function(e){return(0,c.SC)(e)}),b=v.data,y=v.mutate,N=(0,a.Z)((0,o.useState)(null),2),j=N[0],C=N[1],S=(0,a.Z)((0,o.useState)(!1),2),E=S[0],w=S[1],A=(0,a.Z)((0,o.useState)(""),2),F=A[0],D=A[1],k=(0,a.Z)((0,o.useState)(!0),2),Z=k[0],O=k[1],I=(0,a.Z)((0,o.useState)(!1),2),_=I[0],P=I[1],T=(0,a.Z)((0,o.useState)(null),2),B=T[0],L=T[1];if(!b)return(0,s.jsx)(u.Od,{className:"h-[92px]"});var R=d.indexOf(b.current),M="CANCEL"===b.current||"EXPIRED"===b.current,U=new Map(b.allowed.map(function(e){return[e.state,e.label]}));function z(){return(z=(0,r.Z)(function(){var e;return(0,i.__generator)(this,function(t){switch(t.label){case 0:if(!j)return[2];P(!0),L(null),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,(0,c.SC)("/api/admin/reservations/".concat(n,"/state"),{method:"POST",body:JSON.stringify({toState:j.state,note:F.trim(),notify:Z})})];case 2:return t.sent(),C(null),y(),f(),[3,5];case 3:return L((e=t.sent())instanceof Error?e.message:"تغییر وضعیت انجام نشد"),[3,5];case 4:return P(!1),[7];case 5:return[2]}})})).apply(this,arguments)}return(0,s.jsxs)(u.Zb,{className:"p-16",children:[(0,s.jsxs)("div",{className:"flex items-center gap-x-16 flex-wrap gap-y-12",children:[(0,s.jsx)("div",{className:"flex items-center gap-x-8 shrink-0",children:(0,s.jsx)(u.Ct,{tone:M?"red":"DONE"===b.current?"green":"yellow",children:b.current_label})}),(0,s.jsxs)("div",{className:"flex items-center gap-x-4 flex-1 min-w-[320px] ".concat(M?"opacity-50":""),children:[d.map(function(e,n){var t,r=e===b.current,a=U.has(e),i=!M&&n<R;return(0,s.jsxs)("div",{className:"flex items-center gap-x-4 flex-1 last:flex-initial",children:[(0,s.jsx)("button",{type:"button",disabled:!a,onClick:function(){return g(e,null!==(t=U.get(e))&&void 0!==t?t:m[e])},title:r?"وضعیت فعلی":a?"انتقال به \xab".concat(m[e],"\xbb"):"از وضعیت فعلی این انتقال مجاز نیست",className:"px-10 py-6 rounded-8 text-12 leading-18 whitespace-nowrap border transition ".concat(r?"bg-primary-main text-white border-primary-main font-m":i?"bg-primary-light text-primary-dark border-primary-light":"bg-gray-F5F5F7 text-gray-9B9BAA border-gray-F5F5F7"," ").concat(a?"cursor-pointer hover:border-primary-main hover:text-primary-dark":"cursor-default"),children:x[e]}),n<d.length-1&&(0,s.jsx)("div",{className:"h-2 flex-1 rounded-full ".concat(i?"bg-primary-main":"bg-gray-F0F0F0")})]},e)}),U.has("EXPIRED")||M?(0,s.jsx)("span",{className:"mr-10 px-10 py-6 rounded-8 text-12 leading-18 whitespace-nowrap border ".concat(M?"bg-[#FFEBEB] text-[#C62828] border-[#FFEBEB] font-m":"bg-gray-F5F5F7 text-gray-9B9BAA border-gray-F5F5F7"),children:x["EXPIRED"===b.current?"EXPIRED":"CANCEL"]}):null]}),(0,s.jsxs)("span",{className:"text-11 leading-18 text-gray-9B9BAA whitespace-nowrap",children:["ثبت ",(0,u.IY)(t)," \xb7 آخرین تغییر ",(0,u.IY)(p)]})]}),!M&&(0,s.jsx)("p",{className:"mt-10 text-11 leading-18 text-gray-9B9BAA",children:"برای تغییر وضعیت، روی مرحله‌ی مقصد کلیک کنید. مراحل غیرفعال از وضعیت فعلی مجاز نیستند."}),(0,s.jsx)(u.u_,{open:!!j,onClose:function(){return C(null)}
1,title:E?"توضیح تغییر وضعیت":"آیا مطمئن هستید؟",width:"max-w-[520px]",children:E?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("textarea",{value:F,onChange:function(e){return D(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,s.jsx)("p",{className:"mt-6 text-11 leading-18 text-gray-9B9BAA",children:"این توضیح در تاریخچه‌ی رزرو با نام شما ثبت می‌شود و پاک نمی‌شود."}),(0,s.jsxs)("label",{className:"flex items-start gap-x-10 mt-14 cursor-pointer",children:[(0,s.jsx)("input",{type:"checkbox",checked:Z,onChange:function(e){return O(e.target.checked)},className:"w-16 h-16 mt-2 accent-[#03D6BB]"}),(0,s.jsxs)("span",{children:[(0,s.jsx)("span",{className:"block text-13 leading-22 text-black",children:"اطلاع‌رسانی به مهمان و میزبان"}),(0,s.jsx)("span",{className:"block text-11 leading-18 text-gray-9B9BAA",children:"اعلان درون‌سایتی ارسال می‌شود. سرویس پیامک هنوز وصل نیست، پس فعلاً پیامکی فرستاده نمی‌شود."})]})]}),B&&(0,s.jsx)("p",{className:"mt-10 text-13 text-[#C62828]",children:B}),(0,s.jsxs)("div",{className:"flex justify-end gap-x-8 mt-16",children:[(0,s.jsx)(u.zx,{variant:"secondary",onClick:function(){return w(!1)},children:"بازگشت"}),(0,s.jsx)(u.zx,{disabled:_||F.trim().length<3,onClick:function(){return z.apply(this,arguments)},children:_?"در حال ثبت...":"ثبت تغییر وضعیت"})]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("p",{className:"text-14 leading-24 text-black",children:["وضعیت این رزرو از \xab",b.current_label,"\xbb به \xab",j&&m[j.state],"\xbb تغییر می‌کند."]}),(0,s.jsx)("p",{className:"mt-8 text-12 leading-20 text-gray-6C6A7D",children:(null==j?void 0:j.state)==="DONE"?"با این کار سهم میزبان در کیف پولش ثبت می‌شود.":(null==j?void 0:j.state)==="DRAFT"||(null==j?void 0:j.state)==="EXPIRED"?"با این کار شب‌های این رزرو در تقویم آزاد می‌شوند.":"مهلت این مرحله از تنظیمات رزرواسیون دوباره تنظیم می‌شود."}),(0,s.jsxs)("div",{className:"flex justify-end gap-x-8 mt-16",children:[(0,s.jsx)(u.zx,{variant:"secondary",onClick:function(){return C(null)},children:"انصراف"}),(0,s.jsx)(u.zx,{onClick:function(){return w(!0)},children:"بله، ادامه"})]})]})})]})}},13045:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return M}});var r=t(47568),a=t(26042),i=t(69396),s=t(10253),o=t(36305),l=t(70655),c=t(85893),u=t(67294),d=t(11163),x=t(41664),m=t.n(x),p=t(44389),h=t(49759),f=t(32474),g=t(84858),v=t(55290),b=t(33496),y=t(1965),N=t(97590);function j(e){var n,t=e.value,r=e.onChange,a=(0,s.Z)((0,u.useState)(null!==(n=null==t?void 0:t.name)&&void 0!==n?n:""),2),i=a[0],o=a[1],l=(0,s.Z)((0,u.useState)(!1),2),d=l[0],x=l[1],m=(0,p.u)("/api/admin/cities",function(e){return(0,g.SC)(e)}).data;(0,u.useEffect)(function(){var e;o(null!==(e=null==t?void 0:t.name)&&void 0!==e?e:"")},[null==t?void 0:t.id,null==t?void 0:t.name]);var h=(0,u.useMemo)(function(){if(!m)return[];var e=i.trim();return e?m.filter(function(n){return n.name.includes(e)}).slice(0,20):m.slice(0,20)},[m,i]);return(0,c.jsxs)("div",{className:"relative",children:[(0,c.jsx)("input",{value:i,onChange:function(e){o(e.target.value),x(!0),e.target.value||r(null)},onFocus:function(){return x(!0)},onBlur:function(){return setTimeout(function(){return x(!1)},150)},placeholder:"شهر مقصد",className:"w-full px-14 py-10 rounded-10 border border-gray-E5E5E6 text-14 leading-22 outline-none focus:border-primary-main transition"}),d&&h.length>0&&(0,c.jsx)("div",{className:"absolute z-30 top-full mt-4 w-full max-h-[240px] overflow-y-auto bg-white rounded-12 border border-gray-E5E5E6 shadow-[0_8px_24px_rgba(24,39,58,0.14)] py-6",children:h.map(function(e){var n;return(0,c.jsxs)("button",{type:"button",onMouseDown:function(e){return e.preventDefault()},onClick:function(){r({id:e.id,name:e.name}),o(e.name),x(!1)},className:"w-full px-14 py-8 text-13 leading-20 text-black hover:bg-gray-F5F5F7 text-right",children:[e.name,(null===(n=e.parent)||void 0===n?void 0:n.name)&&(0,c.jsxs)("span",{className:"text-gray-9B9BAA",children:[" / ",e.parent.name]})]},e.id)})})]})}function C(e){var n,t=e.cityId,r=e.value,a=e.onChange,i=(0,s.Z)((0,u.useState)(null!==(n=null==r?void 0:r.name)&&void 0!==n?n:""),2),o=i[0],l=i[1],d=(0,s.Z)((0,u.useState)(!1),2),x=d[0],m=d[1],h=(0,p.u)(["crm-neighborhoods",t],function(){return(0,N.Zr)(null!=t?t:void 0)}).data;(0,u.useEffect)(function(){var e;l(null!==(e=null==r?void 0:r.name)&&void 0!==e?e:"")},[null==r?void 0:r.id,null==r?void 0:r.name]);var f=(0,u.useMemo)(function(){if(!h)return[];var e=o.trim();return e?h.filter(function(n){return n.name.includes(e)}).slice(0,20):h.slice(0,20)},[h,o]);return(0,c.jsxs)("div",{className:"relative",children:[(0,c.jsx)("input",{value:o,onChange:function(e){l(e.target.value),m(!0),e.target.value||a(null)},onFocus:function(){return m(!0)},onBlur:function(){return setTimeout(function(){return m(!1)},150)},placeholder:"محله (اختیاری)",className:"w-full px-14 py-10 rounded-10 border border-gray-E5E5E6 text-14 leading-22 outline-none focus:border-primary-main transition"}),x&&f.length>0&&(0,c.jsx)("div",{className:"absolute z-30 top-full mt-4 w-full max-h-[240px] overflow-y-auto bg-white rounded-12 border border-gray-E5E5E6 shadow-[0_8px_24px_rgba(24,39,58,0.14)] py-6",children:f.map(function(e){var n;return(0,c.jsxs)("button",{type:"button",onMouseDown:function(e){return e.preventDefault()},onClick:function(){a({id:e.id,name:e.name}),l(e.name),m(!1)},className:"w-full px-14 py-8 text-13 leading-20 text-black hover:bg-gray-F5F5F7 text-right",children:[e.name,(null===(n=e.parent)||void 0===n?void 0:n.name)&&(0,c.jsxs)("span",{className:"text-gray-9B9BAA",children:[" / ",e.parent.name]})]},e.id)})})]})}var S=t(18730),E=[{key:"out-guest",label:"با مهمان",direction:"OUTBOUND",party:"GUEST"},{key:"in-guest",label:"از مهمان",direction:"INBOUND",party:"GUEST"},{key:"out-host",label:"با میزبان",direction:"OUTBOUND",party:"HOST"},{key:"in-host",label:"از میزبان",direction:"INBOUND",party:"HOST"}];function w(e){var n=e.open,t=e.onClose,a=e.cardId,i=e.userId,o=e.onSaved,d=(0,s.Z)((0,u.useState)(null),2),x=d[0],m=d[1],p=(0,s.Z)((0,u.useState)(""),2),h=p[0],v=p[1],b=(0,s.Z)((0,u.useState)(!1),2),y=b[0],N=b[1],j=(0,s.Z)((0,u.useState)(null),2),C=j[0],S=j[1];function w(){return(w=(0,r.Z)(function(){var e,n;return(0,l.__generator)(this,function(r){switch(r.label){case 0:if((e=h.trim()).length<3)return[2];N(!0),S(null),r.label=1;case 1:if(r.trys.push([1,6,7,8]),!x)return[3,3];return[4,(0,g.SC)("/api/admin/activity/calls",{method:"POST",body:JSON.stringify({direction:x.direction,party:x.party,summary:e,crmCardId:a,userId:"GUEST"===x.party?i:null})})];case 2:return r.sent(),[3,5];case 3:return[4,(0,g.SC)("/api/admin/activity/notes",{method:"POST",body:JSON.stringify({summary:e,crmCardId:a,userId:i})})];case 4:r.sent(),r.label=5;case 5:return v(""),m(null),o(),t(),[3,8];case 6:return S((n=r.sent())instanceof Error?n.message:"ثبت نشد"),[3,8];case 7:return N(!1),[7];case 8:return[2]}})})).apply(this,arguments)}return(0,c.jsx)(f.u_,{open:n,onClose:t,title:"افزودن یادداشت یا تماس",children:(0,c.jsxs)("div",{className:"flex flex-col gap-y-12",children:[(0,c.jsx)("div",{className:"flex items-center gap-x-8 flex-wrap gap-y-8",children:E.map(function(e){var n=(null==x?void 0:x.key)===e.key;return(0,c.jsx)("button",{type:"button","aria-pressed":n,onClick:function(){return m(n?null:e)},className:"px-12 py-8 rounded-10 text-13 leading-20 border transition ".concat(n?"border-primary-main bg-primary-light text-primary-dark":"border-gray-E5E5E6 text-gray-6C6A7D hover:border-gray-C4CAD3"),children:e.label},e.key)})}),(0,c.jsx)("textarea",{value:h,onChange:function(e){return v(e.target.value)}
1,rows:4,autoFocus:!0,placeholder:x?"شرح ".concat(x.label):"متن یادداشت",className:"w-full rounded-12 border border-gray-E5E5E6 p-14 text-14 leading-24 outline-none focus:border-primary-main resize-y"}),C&&(0,c.jsx)("p",{className:"text-13 text-[#C62828]",children:C}),(0,c.jsx)(f.zx,{disabled:y||h.trim().length<3,onClick:function(){return w.apply(this,arguments)},children:y?"در حال ثبت...":x?"ثبت تماس":"ثبت یادداشت"})]})})}var A={CALL:"تماس",NOTE:"یادداشت",STATE_CHANGE:"تغییر مرحله",FIELD_CHANGE:"تغییر اطلاعات",MESSAGE_SENT:"پیام ارسالی"},F={CALL:"bg-gray-F0F0F0 text-gray-6C6A7D",NOTE:"bg-gray-F0F0F0 text-gray-6C6A7D",STATE_CHANGE:"bg-[#FFF4E0] text-[#B26A00]",FIELD_CHANGE:"bg-[#FFF4E0] text-[#B26A00]",MESSAGE_SENT:"bg-[#F1EAFE] text-[#5B32B0]"};function D(e){var n,t=e.cardId,r=e.refreshKey,a=(0,p.u)("/api/admin/activity?crmCardId=".concat(t,"&take=60&v=").concat(r),function(e){return(0,g.SC)(e)}),i=a.data,s=a.isLoading,o=null!==(n=null==i?void 0:i.items)&&void 0!==n?n:[];return(0,c.jsxs)(f.Zb,{className:"p-20",children:[(0,c.jsx)("h3",{className:"text-16 leading-24 font-m text-black mb-14",children:"تماس‌ها و رویدادها"}),s?(0,c.jsx)(f.Od,{className:"h-[160px]"}):0===o.length?(0,c.jsx)(f.ub,{text:"رویدادی ثبت نشده"}):(0,c.jsx)("div",{className:"flex flex-col gap-y-10",children:o.map(function(e){var n,t,r,a,i=(null===(n=e.call)||void 0===n?void 0:n.direction)==="OUTBOUND";return(0,c.jsxs)("div",{className:"flex items-start gap-x-12",children:[(0,c.jsx)("span",{className:"w-32 h-32 rounded-10 shrink-0 flex items-center justify-center ".concat(F[e.kind]),children:"CALL"===e.kind?(0,c.jsxs)("span",{className:"relative inline-flex text-14",children:[(0,c.jsx)("i",{className:"icon-PhoneFill"}),(0,c.jsx)("span",{"aria-hidden":!0,className:"absolute -top-3 ".concat(i?"-left-4":"-right-4"," text-9 leading-9 font-m"),children:i?"↗":"↙"})]}):(0,c.jsx)("i",{className:"icon-Edit text-14"})}),(0,c.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,c.jsxs)("div",{className:"flex items-center gap-x-8 flex-wrap gap-y-2",children:[(0,c.jsx)("span",{className:"px-8 py-2 rounded-8 text-11 leading-18 ".concat(F[e.kind]),children:"CALL"===e.kind?null!==(r=null===(t=e.call)||void 0===t?void 0:t.label)&&void 0!==r?r:"تماس":A[e.kind]}),(0,c.jsx)("span",{className:"text-11 leading-18 text-gray-9B9BAA",children:null!==(a=e.actor_name)&&void 0!==a?a:"سیستم"}),(0,c.jsxs)("span",{className:"text-11 leading-18 text-gray-9B9BAA mr-auto",children:[(0,f.A1)(e.created_at)[0]," ",(0,f.A1)(e.created_at)[1]]})]}),(0,c.jsx)("p",{className:"text-13 leading-22 text-black break-words whitespace-pre-wrap mt-2",children:e.summary})]})]},e.id)})})]})}function k(e){var n,t=e.rows,r=e.mode,a=e.selected,i=e.onToggle,s=e.onOpenRate,o=e.onRemove,l=e.onCreateReservation;return(0,c.jsx)("div",{className:"overflow-x-auto",children:(0,c.jsxs)("table",{className:"w-full text-13 leading-20 text-black",children:[(0,c.jsx)("thead",{children:(0,c.jsxs)("tr",{className:"text-11 leading-18 text-gray-9B9BAA text-right",children:[(0,c.jsx)("th",{className:"w-32 px-6 py-8"}),(0,c.jsx)("th",{className:"w-32 px-6 py-8",children:"#"}),(0,c.jsx)("th",{className:"px-6 py-8",children:"اقامتگاه"}),(0,c.jsx)("th",{className:"px-6 py-8",children:"اهمیت"}),(0,c.jsx)("th",{className:"px-6 py-8",children:"قیمت"}),(0,c.jsx)("th",{className:"px-6 py-8",children:"میزبان"}),(0,c.jsx)("th",{className:"px-6 py-8",children:"تماس میزبان"}),(0,c.jsx)("th",{className:"px-6 py-8",children:"به‌روزرسانی تقویم"}),(0,c.jsx)("th",{className:"px-6 py-8",children:"اتاق"}),(0,c.jsx)("th",{className:"w-32 px-6 py-8"})]})}),(0,c.jsx)("tbody",{children:t.map(function(e,t){return(0,c.jsx)(O,{row:e,index:t,mode:r,checked:null!==(n=null==a?void 0:a.has(e.id))&&void 0!==n&&n,onToggle:i,onOpenRate:s,onRemove:o,onCreateReservation:l},e.id)})})]})})}function Z(e){var n,t=e.text,a=(0,s.Z)((0,u.useState)(!1),2),i=a[0],o=a[1];return(0,c.jsx)("button",{type:"button",onClick:(n=(0,r.Z)(function(e){return(0,l.__generator)(this,function(n){switch(n.label){case 0:e.stopPropagation(),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,navigator.clipboard.writeText(t)];case 2:return n.sent(),o(!0),setTimeout(function(){return o(!1)},1200),[3,4];case 3:return n.sent(),[3,4];case 4:return[2]}})}),function(e){return n.apply(this,arguments)}),title:"کپی شماره",className:"w-20 h-20 rounded-6 inline-flex items-center justify-center text-gray-6C6A7D hover:bg-gray-F0F0F0",children:(0,c.jsx)("i",{className:"".concat(i?"icon-Tick text-[#03D6BB]":"icon-Copy"," text-12")})})}function O(e){var n,t,r,a,i,o,l,d=e.row,x=e.index,m=e.mode,p=e.checked,h=e.onToggle,g=e.onOpenRate,v=e.onRemove,b=e.onCreateReservation,y=(0,s.Z)((0,u.useState)(!1),2),N=y[0],j=y[1],C="search"===m;return(0,c.jsxs)("tr",{onClick:C?function(){return null==h?void 0:h(d.id)}:void 0,className:"border-t border-gray-F0F0F0 align-top transition ".concat(C?"cursor-pointer":""," ").concat(p?"bg-primary-light/50":"hover:bg-gray-F7F7F7"),children:[(0,c.jsx)("td",{className:"px-6 py-10"}),(0,c.jsx)("td",{className:"px-6 py-10",children:(0,c.jsx)("a",{href:d.publicUrl,target:"_blank",rel:"noreferrer",onClick:function(e){return e.stopPropagation()},title:"نمایش صفحه اقامتگاه",className:"inline-flex w-20 h-20 items-center justify-center rounded-6 text-gray-6C6A7D hover:bg-gray-F0F0F0 hover:text-primary-main",children:"↗"})}),(0,c.jsx)("td",{className:"px-6 py-10 text-gray-9B9BAA",children:(0,f.N)(x+1)}),(0,c.jsxs)("td",{className:"px-6 py-10 max-w-[220px]",children:[(0,c.jsx)("p",{className:"font-m truncate",title:d.name,children:d.name}),d.address&&(0,c.jsxs)("p",{className:"text-11 leading-16 text-gray-9B9BAA truncate",title:d.address,children:[d.city?"".concat(d.city," — "):"",d.address]})]}),(0,c.jsx)("td",{className:"px-6 py-10",children:(0,f.N)(d.importance)}),(0,c.jsx)("td",{className:"px-6 py-10 whitespace-nowrap",children:(0,c.jsxs)("button",{type:"button",onClick:function(e){e.stopPropagation(),g({id:d.id,name:d.name})},className:"inline-flex items-center gap-x-4 hover:text-primary-main",title:"نرخ‌گذاری کلی",children:[d.price?(0,f.ND)(d.price):"—",(0,c.jsx)("i",{className:"icon-CalendarFlash text-12"})]})}),(0,c.jsx)("td",{className:"px-6 py-10 truncate max-w-[120px]",title:null!==(i=null===(n=d.host)||void 0===n?void 0:n.name)&&void 0!==i?i:"",children:null!==(o=null===(t=d.host)||void 0===t?void 0:t.name)&&void 0!==o?o:"—"}),(0,c.jsx)("td",{className:"px-6 py-10 whitespace-nowrap",dir:"ltr",children:(0,c.jsxs)("span",{className:"inline-flex items-center gap-x-4",children:[null!==(l=null===(r=d.host)||void 0===r?void 0:r.phone)&&void 0!==l?l:"—",(null===(a=d.host)||void 0===a?void 0:a.phone)&&(0,c.jsx)(Z,{text:d.host.phone})]})}),(0,c.jsx)("td",{className:"px-6 py-10 whitespace-nowrap text-gray-6C6A7D",children:d.calendarUpdatedAt?(0,f.IY)(d.calendarUpdatedAt):"—"}),(0,c.jsx)("td",{className:"px-6 py-10",children:(0,f.N)(d.roomsCount)}),(0,c.jsx)("td",{className:"px-6 py-10",children:"selected"===m?(0,c.jsxs)("div",{className:"flex items-center gap-x-4 justify-end",children:[b&&(0,c.jsx)("button",{type:"button",onClick:function(e){e.stopPropagation(),b(d.id)},title:"ثبت درخواست رزرو روی این اقامتگاه",className:"px-10 py-6 rounded-8 text-11 leading-16 whitespace-nowrap bg-primary-light text-primary-dark hover:bg-primary-main hover:text-white transition",children:"ثبت درخواست"}),(0,c.jsx)("button",{type:"button",onClick:function(e){e.stopPropagation(),null==v||v(d.id)},title:"حذف از لیست",className:"w-24 h-24 rounded-8 inline-flex items-center justify-center text-[#E53935] hover:bg-[#FFEBEB] shrink-0",children:(0,c.jsx)("i",{className:"icon-Delete text-14"})})]}):(0,c.jsxs)("div",{className:"relative",children:[(0,c.jsx)("button",{onClick:function(e){e.stopPropagation(),j(function(e){return!e})},className:"w-24 h-24 rounded-8 inline-flex items-center justify-center text-gray-6C6A7D hover:bg-gray-F0F0F0",children:(0,c.jsx)("i",{className:"icon-Details text-14"})}),N&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"fixed inset-0 z-20",onClick:function(){return j(!1)}}),(0,c.jsx)("div",{className:"absolute left-0 top-full mt-4 z-30 w-[160px] bg-white rounded-12 border border-gray-E5E5E6 shadow-[0_8px_24px_rgba(24,39,58,0.14)] py-6",children:(0,c.jsx)("button",{onClick:function(){j(!1),g({id:d.id,name:d.name})},className:"w-full px-14 py-8 text-13 leading-20 text-black hover:bg-gray-F5F5F7 text-right",children:"ویرایش تقویم"})})]})]})})]})}var I=t(19365),_=[{value:"price_asc",label:"ارزان‌ترین"},{value:"price_desc",label:"گران‌ترین"},{value:"rating_desc",label:"بیشترین امتیاز"},{value:"newest",label:"جدیدترین"},{value:"discount_desc",label:"بیشترین تخفیف"}];function P(e){var n=e.open,t=e.onClose,r=e.value,a=e.onApply,i=function(e){m(function(n){return n.includes(e)?n.filter(function(n){return n!==e}):(0,o.Z)(n).concat([e])})},l=(0,p.u)("/api/admin/amenities",function(e){return(0,g.SC)(e)}).data,d=(0,s.Z)((0,u.useState)(r.features),2),x=d[0],m=d[1],h=(0,s.Z)((0,u.useState)(r.order),2),v=h[0],b=h[1];return(0,u.useEffect)(function(){n&&(m(r.features),b(r.order))},[n]),(0,c.jsx)(f.u_,{open:n,onClose:t,title:"فیلترهای پیشرفته",width:"max-w-[600px]",children:(0,c.jsxs)("div",{className:"flex flex-col gap-y-16",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("span",{className:"block mb-8 text-12 leading-18 text-gray-6C6A7D font-m",children:"امکانات"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-8",children:(null!=l?l:[]).filter(function(e){return e.key}
1).map(function(e){var n=x.includes(e.key);return(0,c.jsx)("button",{type:"button","aria-pressed":n,onClick:function(){return i(e.key)},className:"px-14 py-8 rounded-10 text-13 leading-20 border transition ".concat(n?"border-primary-main bg-primary-light text-primary-dark font-m":"border-gray-E5E5E6 text-gray-6C6A7D hover:border-gray-C4CAD3"),children:e.name},e.id)})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)("span",{className:"block mb-8 text-12 leading-18 text-gray-6C6A7D font-m",children:"ترتیب نمایش"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-8",children:_.map(function(e){return(0,c.jsx)("button",{type:"button","aria-pressed":v===e.value,onClick:function(){return b(v===e.value?void 0:e.value)},className:"px-14 py-8 rounded-10 text-13 leading-20 border transition ".concat(v===e.value?"border-primary-main bg-primary-light text-primary-dark font-m":"border-gray-E5E5E6 text-gray-6C6A7D hover:border-gray-C4CAD3"),children:e.label},e.value)})})]}),(0,c.jsxs)("div",{className:"flex items-center justify-between",children:[(0,c.jsx)("button",{type:"button",onClick:function(){m([]),b(void 0)},className:"text-13 text-gray-6C6A7D hover:text-black",children:"پاک‌کردن"}),(0,c.jsx)(f.zx,{onClick:function(){a({features:x,order:v}),t()},children:"اعمال فیلتر"})]})]})})}function T(e){var n,t=e.toast,r=e.onClose;if((0,u.useEffect)(function(){if(t){var e=setTimeout(r,4e3);return function(){return clearTimeout(e)}}},[t,r]),!t)return null;var a=null!==(n=t.tone)&&void 0!==n?n:"success";return(0,c.jsx)("div",{className:"fixed bottom-24 left-1/2 -translate-x-1/2 z-50 px-20 py-12 rounded-12 shadow-[0_8px_32px_rgba(24,39,58,0.18)] text-13 leading-20 font-m text-white",style:{backgroundColor:"success"===a?"#03B37E":"#E53935"},children:t.text})}var B={DRAFT:"در انتظار ثبت درخواست",HOST_APPROVAL:"در انتظار تایید میزبان",SECOND_PAYMENT:"در انتظار پرداخت مهمان",DONE:"قطعی",CANCEL:"لغو شده",EXPIRED:"منقضی شده"};function L(e){var n,t=e.history;return 0===t.cards.length&&0===t.reservations.length?null:(0,c.jsxs)(f.Zb,{className:"p-20",children:[(0,c.jsx)("h3",{className:"text-16 leading-24 font-m text-black mb-12",children:"درخواست‌ها و رزروهای قبلی این مهمان"}),(0,c.jsxs)("div",{className:"flex flex-col gap-y-8",children:[t.reservations.map(function(e){return(0,c.jsxs)(m(),{href:"/admin/reservations/".concat(e.id),className:"flex items-center justify-between gap-x-8 px-12 py-8 rounded-10 hover:bg-gray-F5F5F7 text-13 leading-20",children:[(0,c.jsxs)("span",{className:"text-black",children:["رزرو ",e.reference," — ",e.residenceName]}),(0,c.jsxs)("span",{className:"text-gray-6C6A7D whitespace-nowrap",children:[null!==(n=B[e.state])&&void 0!==n?n:e.state," \xb7 ",(0,f.IY)(e.createdAt)]})]},"res-".concat(e.id))}),t.cards.map(function(e){return(0,c.jsxs)(m(),{href:"/admin/crm/".concat(e.id),className:"flex items-center justify-between gap-x-8 px-12 py-8 rounded-10 hover:bg-gray-F5F5F7 text-13 leading-20",children:[(0,c.jsx)("span",{className:"text-black",children:"درخواست CRM"}),(0,c.jsxs)("span",{className:"text-gray-6C6A7D whitespace-nowrap",children:[e.stageTitle," \xb7 ",(0,f.IY)(e.createdAt)]})]},"card-".concat(e.id))})]})]})}var R={SUIT:"ویلا / سوئیت",BOOMGARDI:"بوم‌گردی",HOTEL:"هتل"};function M(){var e,n,t,x,E,A,F,Z,O,_,B,M,z,H,G,J,X,V,Y,q,K,Q,$,W,ee,en=(0,d.useRouter)(),et=Number(en.query.id),er=Number.isInteger(et)&&et>0,ea=(0,p.u)(er?"crm-card-".concat(et):null,function(){return(0,N.nO)(et)}),ei=ea.data,es=ea.mutate,eo=(0,p.u)("crm-stages",N.yI).data,el=(0,s.Z)((0,u.useState)({}),2),ec=el[0],eu=el[1],ed=(0,s.Z)((0,u.useState)(!1),2),ex=ed[0],em=ed[1],ep=(0,s.Z)((0,u.useState)(""),2),eh=ep[0],ef=ep[1],eg=(0,s.Z)((0,u.useState)({features:[]}),2),ev=eg[0],eb=eg[1],ey=(0,s.Z)((0,u.useState)(!1),2),eN=ey[0],ej=ey[1],eC=(0,s.Z)((0,u.useState)(null),2),eS=eC[0],eE=eC[1];(0,u.useEffect)(function(){if(ei){var e,n,t,r,i,s,o,l,c,u,d,x={destinationLocationId:ei.destinationLocationId,destinationNeighborhoodId:ei.destinationNeighborhoodId,tripStartDate:ei.tripStartDate?ei.tripStartDate.slice(0,10):"",guestsCount:String(null!==(t=ei.guestsCount)&&void 0!==t?t:""),residenceType:null!==(r=ei.residenceType)&&void 0!==r?r:"",minPrice:String(null!==(i=ei.minPrice)&&void 0!==i?i:""),maxPrice:String(null!==(s=ei.maxPrice)&&void 0!==s?s:""),residenceCode:""};eu((0,a.Z)({guestName:ei.guestName,destinationLocationName:null!==(o=null===(e=ei.destinationLocation)||void 0===e?void 0:e.name)&&void 0!==o?o:"",destinationNeighborhoodName:null!==(l=null===(n=ei.destinationNeighborhood)||void 0===n?void 0:n.name)&&void 0!==l?l:"",nightsCount:null!==(c=ei.nightsCount)&&void 0!==c?c:"",bedroomsCount:null!==(u=ei.bedroomsCount)&&void 0!==u?u:"",tags:null!==(d=ei.tags)&&void 0!==d?d:[]},x)),ef(U(x,{features:[]}))}},[ei]);var ew=(0,s.Z)((0,u.useState)(!1),2),eA=ew[0],eF=ew[1],eD=(0,s.Z)((0,u.useState)(0),2),ek=eD[0],eZ=eD[1],eO=(0,s.Z)((0,u.useState)(null),2),eI=eO[0],e_=eO[1],eP=(0,s.Z)((0,u.useState)(1),2),eT=eP[0],eB=eP[1],eL=(0,s.Z)((0,u.useState)(new Set),2),eR=eL[0],eM=eL[1],eU=U({destinationLocationId:null!==(e=ec.destinationLocationId)&&void 0!==e?e:null,destinationNeighborhoodId:null!==(n=ec.destinationNeighborhoodId)&&void 0!==n?n:null,tripStartDate:null!==(t=ec.tripStartDate)&&void 0!==t?t:"",guestsCount:null!==(x=ec.guestsCount)&&void 0!==x?x:"",residenceType:null!==(E=ec.residenceType)&&void 0!==E?E:"",minPrice:null!==(A=ec.minPrice)&&void 0!==A?A:"",maxPrice:null!==(F=ec.maxPrice)&&void 0!==F?F:"",residenceCode:null!==(Z=ec.residenceCode)&&void 0!==Z?Z:""},ev),ez=(0,p.u)(er&&ei&&eh?"crm-search-".concat(et,"-").concat(eT,"-").concat(eh):null,function(){return(0,N.IU)(et,{page:eT,pageSize:10,
1code:ec.residenceCode||void 0,features:ev.features,order:ev.order})}),eH=ez.data,eG=ez.isLoading,eJ=ez.mutate,eX=(0,p.u)(er?"crm-selected-".concat(et):null,function(){return(0,N.Gu)(et)}),eV=eX.data,eY=eX.mutate,eq=(0,p.u)(er?"crm-guest-history-".concat(et):null,function(){return(0,N.Ve)(et)}).data;if(!er)return null;if(!ei)return(0,c.jsx)(h.Z,{children:(0,c.jsx)(f.Od,{className:"h-[400px]"})});function eK(){return(eK=(0,r.Z)(function(){return(0,l.__generator)(this,function(e){switch(e.label){case 0:em(!0),e.label=1;case 1:return e.trys.push([1,,3,4]),[4,(0,N.OV)(et,{guestName:ec.guestName||null,destinationLocationId:ec.destinationLocationId||null,destinationNeighborhoodId:ec.destinationNeighborhoodId||null,tripStartDate:ec.tripStartDate||null,nightsCount:""===ec.nightsCount?null:Number(ec.nightsCount),guestsCount:""===ec.guestsCount?null:Number(ec.guestsCount),bedroomsCount:""===ec.bedroomsCount?null:Number(ec.bedroomsCount),residenceType:ec.residenceType||null,minPrice:""===ec.minPrice?null:Number(ec.minPrice),maxPrice:""===ec.maxPrice?null:Number(ec.maxPrice),tags:ec.tags})];case 2:return e.sent(),es(),[3,4];case 3:return em(!1),[7];case 4:return[2]}})})).apply(this,arguments)}function eQ(){return(eQ=(0,r.Z)(function(){return(0,l.__generator)(this,function(e){switch(e.label){case 0:return[4,function(){return eK.apply(this,arguments)}()];case 1:return e.sent(),eB(1),ef(eU),[2]}})})).apply(this,arguments)}function e$(){return(e$=(0,r.Z)(function(e){return(0,l.__generator)(this,function(n){switch(n.label){case 0:return[4,(0,N.OV)(et,{stars:e})];case 1:return n.sent(),es(),[2]}})})).apply(this,arguments)}function eW(){return(eW=(0,r.Z)(function(e){return(0,l.__generator)(this,function(n){switch(n.label){case 0:return[4,(0,N.Qq)(et,e,Date.now())];case 1:return n.sent(),es(),eZ(function(e){return e+1}),[2]}})})).apply(this,arguments)}function e0(){return(e0=(0,r.Z)(function(){return(0,l.__generator)(this,function(e){switch(e.label){case 0:return[4,Promise.all((0,o.Z)(eR).map(function(e){return(0,N.Af)(et,e)}))];case 1:return e.sent(),eM(new Set),eY(),[2]}})})).apply(this,arguments)}function e1(){return(e1=(0,r.Z)(function(){var e,n;return(0,l.__generator)(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,(0,N.$4)(et)];case 1:return eE({text:(e=t.sent()).sent?"لینک برای مهمان پیامک شد":"پیامک ارسال نشد — لینک: ".concat(e.url),tone:e.sent?"success":"error"}),[3,3];case 2:return eE({text:(n=t.sent())instanceof Error?n.message:"ارسال لینک ناموفق بود",tone:"error"}),[3,3];case 3:return[2]}})})).apply(this,arguments)}function e2(){return(e2=(0,r.Z)(function(e){var n;return(0,l.__generator)(this,function(t){switch(t.label){case 0:if(!window.confirm("درخواست رزرو روی این اقامتگاه ثبت شود؟ این یعنی یک رزرو واقعی برای میزبان ارسال می‌شود."))return[2];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,(0,N.aq)(et,e)];case 2:return t.sent(),eE({text:"درخواست رزرو ثبت شد",tone:"success"}),es(),[3,4];case 3:return eE({text:(n=t.sent())instanceof Error?n.message:"ثبت درخواست ناموفق بود",tone:"error"}),[3,4];case 4:return[2]}})})).apply(this,arguments)}function e6(){return(e6=(0,r.Z)(function(){var e,n,t;return(0,l.__generator)(this,function(r){switch(r.label){case 0:if(!(e=null==ei?void 0:ei.userId)||!(n=window.prompt("رمز عبور جدید برای این کاربر (حداقل ۶ کاراکتر)؟")))return[2];if(n.length<6)return eE({text:"رمز عبور باید حداقل ۶ کاراکتر باشد",tone:"error"}),[2];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,(0,g.SC)("/api/admin/users/".concat(e,"/password"),{method:"POST",body:JSON.stringify({password:n})})];case 2:return r.sent(),eE({text:"رمز عبور ثبت شد",tone:"success"}),[3,4];case 3:return eE({text:(t=r.sent())instanceof Error?t.message:"ثبت رمز عبور ناموفق بود",tone:"error"}),[3,4];case 4:return[2]}})})).apply(this,arguments)}return(0,c.jsxs)(h.Z,{title:ei.guestName||ei.phone,breadcrumb:(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(m(),{href:"/admin/crm",children:"درخواست‌های CRM"})}),backHref:"/admin/crm",children:[(0,c.jsxs)("div",{className:"flex flex-col gap-y-16",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between gap-x-16 flex-wrap gap-y-10",children:[(0,c.jsx)(f.Qm,{tabs:(null!=eo?eo:[]).map(function(e){return{key:String(e.id),label:e.title}}
1),value:String(ei.stageId),onChange:function(e){return function(e){return eW.apply(this,arguments)}(Number(e))}}),(0,c.jsx)("div",{className:"flex items-center gap-x-8",children:(0,c.jsxs)(f.zx,{variant:"secondary",onClick:function(){return eF(!0)},children:[(0,c.jsx)("i",{className:"icon-Edit text-14"})," افزودن یادداشت / تماس"]})})]}),(0,c.jsxs)(f.Zb,{className:"p-20",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between mb-16",children:[(0,c.jsx)("h2",{className:"text-16 leading-24 font-m text-black",children:"اطلاعات مهمان"}),(0,c.jsxs)("div",{className:"flex items-center gap-x-10",children:[(0,c.jsx)(I.n,{value:ei.stars,onChange:function(e){return e$.apply(this,arguments)}}),(0,c.jsx)("span",{dir:"ltr",className:"text-13 text-gray-6C6A7D",children:ei.phone}),ei.userId&&(0,c.jsx)("button",{type:"button",onClick:function(){return e6.apply(this,arguments)},title:"اختصاص رمز عبور به این کاربر",className:"w-24 h-24 rounded-8 flex items-center justify-center text-gray-6C6A7D hover:bg-gray-F0F0F0",children:(0,c.jsx)("i",{className:"icon-Key text-14"})})]})]}),(0,c.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-14",children:[(0,c.jsx)(f.gN,{label:"نام مهمان",children:(0,c.jsx)(f.II,{value:null!==(O=ec.guestName)&&void 0!==O?O:"",onChange:function(e){return eu(function(n){return(0,i.Z)((0,a.Z)({},n),{guestName:e.target.value})})}})}),(0,c.jsx)(f.gN,{label:"شهر مقصد",children:(0,c.jsx)(j,{value:ec.destinationLocationId?{id:ec.destinationLocationId,name:ec.destinationLocationName}:null,onChange:function(e){return eu(function(n){return(0,i.Z)((0,a.Z)({},n),{destinationLocationId:null!==(_=null==e?void 0:e.id)&&void 0!==_?_:null,destinationLocationName:null!==(B=null==e?void 0:e.name)&&void 0!==B?B:""})})}})}),(0,c.jsx)(f.gN,{label:"محله",children:(0,c.jsx)(C,{cityId:null!==(M=ec.destinationLocationId)&&void 0!==M?M:null,value:ec.destinationNeighborhoodId?{id:ec.destinationNeighborhoodId,name:ec.destinationNeighborhoodName}:null,onChange:function(e){return eu(function(n){return(0,i.Z)((0,a.Z)({},n),{destinationNeighborhoodId:null!==(z=null==e?void 0:e.id)&&void 0!==z?z:null,destinationNeighborhoodName:null!==(H=null==e?void 0:e.name)&&void 0!==H?H:""})})}})}),(0,c.jsx)(f.gN,{label:"کد اقامتگاه",hint:"اگر پر شود، فقط همین یک اقامتگاه نشان داده می‌شود",children:(0,c.jsx)(f.II,{inputMode:"numeric",value:null!==(G=ec.residenceCode)&&void 0!==G?G:"",onChange:function(e){return eu(function(n){return(0,i.Z)((0,a.Z)({},n),{residenceCode:e.target.value.replace(/\D/g,"")})})}})}),(0,c.jsx)(v.ZP,{label:"تاریخ سفر",value:null!==(J=ec.tripStartDate)&&void 0!==J?J:"",onChange:function(e){return eu(function(n){return(0,i.Z)((0,a.Z)({},n),{tripStartDate:e})})}}),(0,c.jsx)(f.gN,{label:"تعداد شب",children:(0,c.jsx)(f.II,{inputMode:"numeric",value:null!==(X=ec.nightsCount)&&void 0!==X?X:"",onCh
1ange:function(e){return eu(function(n){return(0,i.Z)((0,a.Z)({},n),{nightsCount:e.target.value.replace(/\D/g,"")})})}})}),(0,c.jsx)(f.gN,{label:"تعداد نفرات",children:(0,c.jsx)(f.II,{inputMode:"numeric",value:null!==(V=ec.guestsCount)&&void 0!==V?V:"",onChange:function(e){return eu(function(n){return(0,i.Z)((0,a.Z)({},n),{guestsCount:e.target.value.replace(/\D/g,"")})})}})}),(0,c.jsx)(f.gN,{label:"تعداد اتاق خواب",children:(0,c.jsx)(f.II,{inputMode:"numeric",value:null!==(Y=ec.bedroomsCount)&&void 0!==Y?Y:"",onChange:function(e){return eu(function(n){return(0,i.Z)((0,a.Z)({},n),{bedroomsCount:e.target.value.replace(/\D/g,"")})})}})}),(0,c.jsx)(f.gN,{label:"نوع اقامتگاه",children:(0,c.jsxs)(f.Ph,{value:null!==(q=ec.residenceType)&&void 0!==q?q:"",onChange:function(e){return eu(function(n){return(0,i.Z)((0,a.Z)({},n),{residenceType:e.target.value})})},children:[(0,c.jsx)("option",{value:"",children:"همه"}),Object.entries(R).map(function(e){var n=(0,s.Z)(e,2),t=n[0],r=n[1];return(0,c.jsx)("option",{value:t,children:r},t)})]})}),(0,c.jsx)(f.gN,{label:"حداقل قیمت",children:(0,c.jsx)(f.II,{inputMode:"numeric",value:null!==(K=ec.minPrice)&&void 0!==K?K:"",onChange:function(e){return eu(function(n){return(0,i.Z)((0,a.Z)({},n),{minPrice:e.target.value.replace(/\D/g,"")})})}})}),(0,c.jsx)(f.gN,{label:"حداکثر قیمت",children:(0,c.jsx)(f.II,{inputMode:"numeric",value:null!==(Q=ec.maxPrice)&&void 0!==Q?Q:"",onChange:function(e){return eu(function(n){return(0,i.Z)((0,a.Z)({},n),{maxPrice:e.target.value.replace(/\D/g,"")})})}})}),(0,c.jsx)(f.gN,{label:"وضعیت مدارک / امکانات",className:"md:col-span-3",children:(0,c.jsx)(S.U4,{options:S.sM,value:null!==($=ec.tags)&&void 0!==$?$:[],onChange:function(e){return eu(function(n){return(0,i.Z)((0,a.Z)({},n),{tags:e})})}})})]}),(0,c.jsxs)("div",{className:"flex items-center justify-between mt-16",children:[(0,c.jsxs)("button",{type:"button",onClick:function(){return ej(!0)},className:"text-13 leading-20 text-primary-dark hover:underline",children:["فیلترهای پیشرفته",ev.features.length>0&&" (".concat((0,f.N)(ev.features.length),")")]}),(0,c.jsx)(f.zx,{disabled:ex||!(eU!==eh),onClick:function(){return eQ.apply(this,arguments)},children:ex?"در حال ذخیره...":"ذخیره و جستجو"})]})]}),ei.reservation&&(0,c.jsx)(y.Z,{reservationId:ei.reservation.id,createdAt:ei.reservation.createdAt,updatedAt:ei.reservation.updatedAt,onCancel:function(){return en.push("/admin/reservations/".concat(ei.reservation.id))},onChanged:function(){return es()}}),eV&&eV.length>0&&(0,c.jsxs)(f.Zb,{className:"p-20",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between mb-14",children:[(0,c.jsx)("h2",{className:"text-16 leading-24 font-m text-black",children:"اقامتگاه‌های انتخاب‌شده"}),(0,c.jsxs)("div",{className:"flex items-center gap-x-8",children:[(0,c.jsx)(f.zx,{variant:"secondary",onClick:(0,r.Z)(function(){return(0,l.__generator)(this,function(e){switch(e.label){case 0:if(!window.confirm("کل لیست پاک شود؟"))return[3,2];return[4,(0,N.i0)(et)];case 1:e.sent(),eY(),e.label=2;case 2:return[2]}})}),children:"پاک‌کردن لیست"}),(0,c.jsx)(f.zx,{onClick:function(){return e1.apply(this,arguments)},children:"ارسال لینک به مهمان"})]})]}),(0,c.jsx)(k,{rows:eV,mode:"selected",onOpenRate:e_,onRemove:(ee=(0,r.Z)(function(e){return(0,l.__generator)(this,function(n){switch(n.label){case 0:return[4,(0,N.yS)(et,e)];case 1:return n.sent(),eY(),[2]}})}),function(e){return ee.apply(this,arguments)}),onCreateReservation:ei.reservationId?void 0:function(e){return e2.apply(this,arguments)}})]}),(0,c.jsxs)(f.Zb,{className:"p-20",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between mb-14",children:[(0,c.jsx)("h2",{className:"text-16 leading-24 font-m text-black",children:"اقامتگاه‌های فیلترشده"}),(0,c.jsxs)("div",{className:"flex items-center gap-x-8",children:[(0,c.jsx)("button",{onClick:function(){return eJ()},title:"بروزرسانی",className:"w-28 h-28 rounded-8 flex items-center justify-center text-gray-6C6A7D hover:bg-gray-F0F0F0",children:(0,c.jsx)("i",{className:"icon-Refresh text-14"})}),(0,c.jsx)("button",{disabled:eT<=1,onClick:function(){return eB(function(e){return e-1})},className:"w-28 h-28 rounded-8 flex items-center justify-center text-gray-6C6A7D hover:bg-gray-F0F0F0 disabled:opacity-40",children:(0,c.jsx)("i",{className:"icon-FlashRight text-14"})}),(0,c.jsxs)("span",{className:"text-12 text-gray-6C6A7D",children:[(0,f.N)(eT)," / ",(0,f.N)(eH?Math.max(1,Math.ceil(eH.total/eH.pageSize)):1)]}),(0,c.jsx)("button",{disabled:!eH||eT>=Math.ceil(eH.total/eH.pageSize),onClick:function(){return eB(function(e){return e+1})},className:"w-28 h-28 rounded-8 flex items-center justify-center text-gray-6C6A7D hover:bg-gray-F0F0F0 disabled:opacity-40",children:(0,c.jsx)("i",{className:"icon-FlashLeft text-14"})})]})]}),eG||!eH?(0,c.jsx)(f.Od,{className:"h-[200px]"}):0===eH.items.length?(0,c.jsx)("p",{className:"text-13 text-gray-6C6A7D py-20 text-center",children:"اقامتگاهی با این فیلترها پیدا نشد"}):(0,c.jsx)(k,{rows:eH.items,mode:"search",selected:eR,onToggle:function(e){eM(function(n){var t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t})},onOpenRate:e_})]}),eq&&(0,c.jsx)(L,{history:eq}),(0,c.jsx)(D,{cardId:et,refreshKey:ek})]}),(0,c.jsx)(w,{open:eA,onClose:function(){return eF(!1)},cardId:et,userId:ei.userId,onSaved:function(){eZ(function(e){return e+1}),es()}}),(0,c.jsx)(P,{open:eN,onClose:function(){return ej(!1)},value:ev,onApply:eb}),(0,c.jsx)(f.u_,{open:!!eI,onClose:function(){return e_(null)},title:"تقویم و نرخ — ".concat(null!==(W=null==eI?void 0:eI.name)&&void 0!==W?W:""),width:"max-w-[1280px]",children:eI&&(0,c.jsx)(b.Z,{targets:[{residenceId:eI.id,label:eI.name}],onApplied:function(){eJ(),eY()}})}),(0,c.jsx)(f.XL,{count:eR.size,onClear:function(){return eM(new Set)},actions:[{icon:"icon-Save",label:"ذخیره به عنوان لیست ارسال",onClick:function(){return e0.apply(this,arguments)}}]}),(0,c.jsx)(T,{toast:eS,onClose:function(){return eE(null)}})]})}function U(e,n){var t;return JSON.stringify([e,n.features.slice().sort(),null!==(t=n.order)&&void 0!==t?t:null])}}},function(e){e.O(0,[4885,9791,8289,9759,3496,9774,2888,179],function(){return e(e.s=68690)}),_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.