1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8031],{73695:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/settings/locations",function(){return t(83741)}])},83741:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return b}});var a=t(47568),r=t(26042),l=t(69396),i=t(10253),s=t(36305),o=t(70655),c=t(85893),d=t(67294),u=t(41664),x=t.n(u),h=t(44389),m=t(49759),p=t(84858),g=t(32474),f=[{value:"COUNTRY",label:"Ú©Ø´ÙØ±"},{value:"PROVINCE",label:"استاÙ"},{value:"CITY",label:"Ø´ÙØ±"},{value:"REGION",label:"Ù
ÙØ·ÙÙ"},{value:"VILLAGE",label:"Ø±ÙØ³ØªØ§"},{value:"NEIGHBORHOOD",label:"Ù
ØÙÙ"}],v=Object.fromEntries(f.map(function(e){return[e.value,e.label]})),y={COUNTRY:"bg-[#EEF2FF] text-[#4338CA]",PROVINCE:"bg-[#ECFDF5] text-[#047857]",CITY:"bg-[#EFF6FF] text-[#1D4ED8]",REGION:"bg-[#FFF7ED] text-[#C2410C]",VILLAGE:"bg-[#F0FDF4] text-[#15803D]",NEIGHBORHOOD:"bg-[#FDF4FF] text-[#A21CAF]"},j="https://lidomatrip.com";function b(){var e,n,t,a=(0,i.Z)((0,d.useState)(""),2),r=a[0],l=a[1],o=(0,i.Z)((0,d.useState)(""),2),u=o[0],j=o[1],b=(0,i.Z)((0,d.useState)(null),2),C=b[0],E=b[1],Z=(0,i.Z)((0,d.useState)(!1),2),I=Z[0],w=Z[1],D=(0,h.u)("/api/admin/locations",function(e){return(0,p.SC)(e)}),A=D.data,S=D.isLoading,k=D.mutate,T=null!=A?A:[],O=(0,d.useMemo)(function(){return new Map(T.map(function(e){return[e.id,e]}))},[T]),P=(0,d.useMemo)(function(){var e=r.trim();return T.filter(function(n){var t;return(!u||n.type===u)&&(!e||n.name.includes(e)||(null!==(t=n.titleEn)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase()))})},[T,r,u]),_=(0,d.useMemo)(function(){var e,n={};return T.forEach(function(t){return n[t.type]=(null!==(e=n[t.type])&&void 0!==e?e:0)+1}),n},[T]),H=(0,d.useMemo)(function(){var e=new Map;return T.forEach(function(n){var t,a=null===(t=n.titleEn)||void 0===t?void 0:t.trim().toLowerCase();a&&(e.has(a)||e.set(a,[]),e.get(a).push(n))}),(0,s.Z)(e.entries()).filter(function(e){return(0,i.Z)(e,2)[1].length>1})},[T]),L=T.filter(function(e){var n;return!(null===(n=e.titleEn)||void 0===n?void 0:n.trim())}).length;return(0,c.jsxs)(m.Z,{title:"دستÙâØ¨ÙØ¯Û Ù
کاÙâÙØ§",breadcrumb:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(x(),{href:"/admin",children:"Ø¯Ø§Ø´Ø¨ÙØ±Ø¯"}),(0,c.jsx)("span",{className:"mx-6 text-gray-B0AFBC",children:"/"}),(0,c.jsx)(x(),{href:"/admin/settings",children:"ØªÙØ¸ÛÙ
ات"})]}),toolbar:(0,c.jsxs)(g.Zb,{className:"px-8 py-6 flex items-center gap-x-4 overflow-x-auto",children:[(0,c.jsx)(x(),{href:"/admin/settings",className:"px-14 py-8 rounded-10 text-13 leading-20 font-m whitespace-nowrap text-gray-6C6A7D hover:bg-gray-F0F0F0",children:"اÙ
Ú©Ø§ÙØ§Øª Ù ÙÙØ§ÙÛÙ"}),(0,c.jsx)("span",{className:"px-14 py-8 rounded-10 text-13 leading-20 font-m whitespace-nowrap bg-primary-main text-white",children:"دستÙâØ¨ÙØ¯Û Ù
کاÙâÙØ§"}),(0,c.jsx)(x(),{href:"/admin/settings/tags",className:"px-14 py-8 rounded-10 text-13 leading-20 font-m whitespace-nowrap text-gray-6C6A7D hover:bg-gray-F0F0F0",children:"تگâÙØ§Û سئÙ"}),(0,c.jsx)(x(),{href:"/admin/settings/sitemap",className:"px-14 py-8 rounded-10 text-13 leading-20 font-m whitespace-nowrap text-gray-6C6A7D hover:bg-gray-F0F0F0",children:"sitemap Ù robots"}),(0,c.jsx)(x(),{href:"/admin/settings/faqs",className:"px-14 py-8 rounded-10 text-13 leading-20 font-m whitespace-nowrap text-gray-6C6A7D hover:bg-gray-F0F0F0",children:"Ø³ÙØ§Ùات Ù
تداÙÙ"}),(0,c.jsx)(x(),{href:"/admin/settings/home",className:"px-14 py-8 rounded-10 text-13 leading-20 font-m whitespace-nowrap text-gray-6C6A7D hover:bg-gray-F0F0F0",children:"ØµÙØÙ Ø§ØµÙÛ"})]}),children:[(0,c.jsxs)("div",{className:"flex flex-col gap-y-16",children:[(0,c.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-6 gap-12",children:f.map(function(n){return(0,c.jsxs)("button",{onClick:function(){return j(u===n.value?"":n.value)},className:"rounded-12 px-16 py-14 text-right transition border ".concat(u===n.value?"border-primary-main bg-primary-main/5":"border-gray-EFEFEF bg-white hover:border-gray-D9D9D9"),children:[(0,c.jsx)("div",{className:"text-12 leading-18 text-gray-6C6A7D",children:n.label}),(0,c.jsx)("div",{className:"text-20 leading-28 font-b text-gray-1E1D28",children:(0,g.N)(null!==(e=_[n.value])&&void 0!==e?e:0)})]},n.value)})}),(H.length>0||L>0)&&(0,c.jsxs)(g.Zb,{className:"px-20 py-16 border-r-4 border-r-[#F59E0B]",children:[(0,c.jsx)("div",{className:"text-13 leading-22 font-m text-gray-1E1D28 mb-6",children:"ÙکتÙâÙØ§Û سئÙÛÛ"}),H.length>0&&(0,c.jsxs)("p",{className:"text-12 leading-22 text-gray-6C6A7D",children:[(0,g.N)(H.length)," Ø§Ø³ÙØ§Ú¯ ØªÚ©Ø±Ø§Ø±Û Ø¯Ø± دادÙâÛ Ø§ÙØ¯Ù ÙØ¬Ùد دار٠(Ù
Ø«Ù"," ",(0,c.jsx)("span",{className:"font-m",children:H[0][0]})," Ú©Ù ÙÙ
براÛ"," ",H[0][1].map(function(e){return"".concat(e.name," (").concat(v[e.type],")")}).join(" Ù ")," ثبت شدÙ). اÛÙâÙØ§ عÙ
دا٠دستâÙØ®Ùرد٠Ù
ÙÙØ¯Ù ÚÙ٠آدرسâÙØ§Û اÛÙØ¯Ú©Ø³âØ´Ø¯Ù Ø±ÙØ´ÙÙ Ø¨ÙØ§ شد٠â ÙÙÛ Ø§Ø³ÙØ§Ú¯ ØªÚ©Ø±Ø§Ø±Û Ø¬Ø¯ÛØ¯ Ù¾Ø°ÛØ±Ùت٠ÙÙ
ÛâØ´Ù."]}),L>0&&(0,c.jsxs)("p",{className:"text-12 leading-22 text-gray-6C6A7D mt-4",children:[(0,g.N)(L)," Ù
Ú©Ø§Ù Ø§Ø³ÙØ§Ú¯ اÙÚ¯ÙÛØ³Û ÙØ¯Ø§Ø±Ù Ù ØµÙØÙâÛ Ø³Ø±Ú Ø§Ø®ØªØµØ§ØµÛ ÙÙ
ÛâÚ¯ÛØ±Ù."]})]}),(0,c.jsxs)(g.Zb,{className:"p-0 overflow-hidden",children:[(0,c.jsxs)("div",{className:"px-20 py-16 flex flex-wrap items-center gap-12 border-b border-gray-EFEFEF",children:[(0,c.jsx)(g.II,{value:r,onChange:function(e){return l(e.target.value)},placeholder:"جستجÙÛ ÙØ§Ù
ÙØ§Ø±Ø³Û ÛØ§ Ø§Ø³ÙØ§Ú¯â¦",className:"flex-1 min-w-[220px]"}),(0,c.jsxs)(g.Ph,{value:u,onChange:function(e){return j(e.target.value)},className:"w-[160px]",children:[(0,c.jsx)("option",{value:"",children:"ÙÙ
ÙâÛ Ø§ÙÙØ§Ø¹"}),f.map(function(e){return(0,c.jsx)("option",{value:e.value,children:e.label},e.value)})]}),(0,c.jsx)(g.zx,{onClick:function(){return w(!0)},children:"Ø§ÙØ²Ùد٠Ù
کاÙ"})]}),S?(0,c.jsx)("div",{className:"p-20 flex flex-col gap-8",children:Array.from({length:8}).map(function(e,n){return(0,c.jsx)(g.Od,{className:"h-40"},n)})}):0===P.length?(0,c.jsx)(g.ub,{text:"Ù
کاÙÛ Ø¨Ø§ اÛÙ ÙÛÙØªØ±Ùا Ù¾ÛØ¯Ø§ ÙØ´Ø¯."}):(0,c.jsxs)("div",{className:"overflow-x-auto",children:[(0,c.jsxs)("table",{className:"w-full text-13 leading-22",children:[(0,c.jsx)("thead",{className:"bg-gray-FAFAFA text-gray-6C6A7D",children:(0,c.jsxs)("tr",{children:[(0,c.jsx)("th",{className:"text-right font-m px-20 py-12 w-40",children:"ردÛÙ"}),(0,c.jsx)("th",{className:"text-right font-m px-20 py-12",children:"ÙØ§Ù
"}),(0,c.jsx)("th",{className:"text-right font-m px-12 py-12",children:"ÙÙØ¹"}),(0,c.jsx)("th",{className:"text-right font-m px-12 py-12",children:"Ø§Ø³ÙØ§Ú¯"}),(0,c.jsx)("th",{className:"text-right font-m px-12 py-12",children:"ÙØ§Ùد"}),(0,c.jsx)("th",{className:"text-right font-m px-12 py-12",children:"Ø§ÙØ§Ù
تگاÙ"}),(0,c.jsx)("th",{className:"text-right font-m px-12 py-12",children:"Ø²ÛØ±Ù
جÙ
ÙØ¹Ù"}),(0,c.jsx)("th",{className:"text-right font-m px-12 py-12",children:"ÙØ¶Ø¹Ûت"}),(0,c.jsx)("th",{className:"px-20 py-12"})]})}),(0,c.jsx)("tbody",{children:P.slice(0,400).map(function(e,a){var r;return(0,c.jsxs)("tr",{className:"border-t border-gray-F5F5F5 hover:bg-gray-FAFAFA",children:[(0,c.jsx)("td",{className:"px-20 py-12 text-gray-6C6A7D",children:(0,g.N)(a+1)}),(0,c.jsx)("td",{className:"px-20 py-12 font-m text-gray-1E1D28",children:e.name}),(0,c.jsx)("td",{className:"px-12 py-12",children:(0,c.jsx)("span",{className:"inline-block px-8 py-2 rounded-8 text-11 leading-18 ".concat(null!==(n=y[e.type])&&void 0!==n?n:""),children:v[e.type]})}),(0,c.jsx)("td",{className:"px-12 py-12 text-gray-6C6A7D",dir:"ltr",children:e.titleEn||(0,c.jsx)("span",{className:"text-[#DC2626]",children:"â"})}),(0,c.jsx)("td",{className:"px-12 py-12 text-gray-6C6A7D",children:e.parentId&&null!==(t=null===(r=O.get(e.parentId))||void 0===r?void 0:r.name)&&void 0!==t?t:"â"}),(0,c.jsxs)("td",{className:"px-12 py-12 text-gray-6C6A7D",children:[(0,g.N)(e.residenceCount),e.extraResidenceCount>0&&(0,c.jsxs)("span",{className:"text-11 text-gray-B0AFBC",children:[" +",(0,g.N)(e.extraResidenceCount)]})]}),(0,c.jsx)("td",{className:"px-12 py-12 text-gray-6C6A7D",children:(0,g.N)(e.childCount)}),(0,c.jsx)("td",{className:"px-12 py-12",children:e.isPublished?(0,c.jsx)(g.Ct,{tone:"green",children:"Ù
ÙØªØ´Ø±Ø´Ø¯Ù"}):(0,c.jsx)(g.Ct,{tone:"red",children:"Ù
ÙØªØ´Ø±ÙشدÙ"})}),(0,c.jsx)("td",{className:"px-20 py-12 text-left",children:(0,c.jsx)("button",{onClick:function(){return E(e.id)},className:"text-12 text-primary-main hover:underline",children:"Ù
Ø¯ÛØ±Ûت"})})]},e.id)})})]}),P.length>400&&(0,c.jsxs)("div",{className:"px-20 py-12 text-12 text-gray-6C6A7D",children:[(0,g.N)(P.length-400)," Ù
ÙØ±Ø¯ دÛÚ¯Ù ÙÙ
Ø§ÛØ´ Ø¯Ø§Ø¯Ù ÙØ´Ø¯ â Ø¬Ø³ØªØ¬Ù ر٠دÙÛÙâØªØ± Ú©Ù."]})]})]})]}),null!==C&&(0,c.jsx)(F,{id:C,allLocations:T,onClose:function(){return E(null)},onSaved:function(){return k()}}),I&&(0,c.jsx)(N,{allLocations:T,onClose:function(){return w(!1)},onSaved:function(){w(!1),k()}})]})}function N(e){var n,t=e.allLocations,s=e.onClose,u=e.onSaved,x=(0,i.Z)((0,d.useState)({type:"CITY",name:"",titleEn:"",parentId:""}),2),h=x[0],m=x[1],y=(0,i.Z)((0,d.useState)(null),2),j=y[0],b=y[1],N=(0,i.Z)((0,d.useState)(!1),2),C=N[0],F=N[1],E=(n=(0,a.Z)(function(){var e,n;return(0,o.__generator)(this,function(t){switch(t.label){case 0:F(!0),b(null),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,(0,p.SC)("/api/admin/locations",{method:"POST",body:JSON.stringify({type:h.type,name:h.name.trim(),titleEn:h.titleEn.trim()||null,parentId:h.parentId?Number(h.parentId):null})})];case 2:return t.sent(),u(),[3,5];case 3:return b(null!==(n=null==(e=t.sent())?void 0:e.message)&&void 0!==n?n:"Ø°Ø®ÛØ±Ù ÙØ´Ø¯."),[3,5];case 4:return F(!1),[7];case 5:return[2]}})}),function(){return n.apply(this,arguments)});return(0,c.jsx)(g.u_,{open:!0,title:"Ø§ÙØ²Ùد٠Ù
کاÙ",onClose:s,children:(0,c.jsxs)("div",{className:"flex flex-col gap-y-14",children:[(0,c.jsx)(g.gN,{label:"ÙÙØ¹",children:(0,c.jsx)(g.Ph,{value:h.type,onCh
1ange:function(e){return m((0,l.Z)((0,r.Z)({},h),{type:e.target.value}))},children:f.map(function(e){return(0,c.jsx)("option",{value:e.value,children:e.label},e.value)})})}),(0,c.jsx)(g.gN,{label:"ÙØ§Ù
ÙØ§Ø±Ø³Û",children:(0,c.jsx)(g.II,{value:h.name,onChange:function(e){return m((0,l.Z)((0,r.Z)({},h),{name:e.target.value}))}})}),(0,c.jsx)(g.gN,{label:"Ø§Ø³ÙØ§Ú¯ اÙÚ¯ÙÛØ³Û",hint:"آدرس ØµÙØÙâÛ Ø³Ø±Ú Ø§Ø² ÙÙ
Û٠ساخت٠Ù
ÛâØ´Ù: /search/<Ø§Ø³ÙØ§Ú¯>. خاÙÛ Ø¨Ø°Ø§Ø±Û ØµÙØÙâÛ Ø§Ø®ØªØµØ§ØµÛ ÙÙ
ÛâÚ¯ÛØ±Ù.",children:(0,c.jsx)(g.II,{dir:"ltr",value:h.titleEn,onChange:function(e){return m((0,l.Z)((0,r.Z)({},h),{titleEn:e.target.value}))},placeholder:"tehran"})}),(0,c.jsx)(g.gN,{label:"ÙØ§Ùد (Ø¨Ø±Ø§Û Ø¨Ø±Ø¯Ú©Ø±Ø§Ù
ب)",children:(0,c.jsxs)(g.Ph,{value:h.parentId,onChange:function(e){return m((0,l.Z)((0,r.Z)({},h),{parentId:e.target.value}))},children:[(0,c.jsx)("option",{value:"",children:"â Ø¨Ø¯ÙÙ ÙØ§Ùد â"}),t.filter(function(e){return"CITY"!==e.type||"NEIGHBORHOOD"===h.type}).map(function(e){return(0,c.jsxs)("option",{value:e.id,children:[e.name," (",v[e.type],")"]},e.id)})]})}),j&&(0,c.jsx)("p",{className:"text-12 leading-20 text-[#DC2626]",children:j}),(0,c.jsxs)("div",{className:"flex gap-x-8 justify-end pt-4",children:[(0,c.jsx)(g.zx,{variant:"ghost",onClick:s,children:"Ø§ÙØµØ±Ø§Ù"}),(0,c.jsx)(g.zx,{onClick:E,disabled:C||!h.name.trim(),children:C?"در ØØ§Ù Ø°Ø®ÛØ±Ùâ¦":"Ø°Ø®ÛØ±Ù"})]})]})})}var C=[{key:null,label:"Ù¾ÛØ´âÙØ±Ø¶"},{key:"BOOMGARDI",label:"بÙÙ
âگردÛ"},{key:"HOTEL",label:"ÙØªÙ"}];function F(e){var n=e.id,t=e.allLocations,a=e.onClose,r=e.onSaved,l=(0,h.u)("/api/admin/locations/".concat(n),function(e){return(0,p.SC)(e)}),s=l.data,o=l.isLoading,u=l.mutate,x=(0,i.Z)((0,d.useState)("info"),2),m=x[0],f=x[1],y=(0,i.Z)((0,d.useState)(null),2),b=y[0],N=y[1];return o||!s?(0,c.jsx)(g.u_,{open:!0,title:"در ØØ§Ù بارگذارÛâ¦",onClose:a,children:(0,c.jsx)(g.Od,{className:"h-200"})}):(0,c.jsx)(g.u_,{open:!0,title:"".concat(s.name," â ").concat(v[s.type]),onClose:a,width:"max-w-[860px]",children:(0,c.jsxs)("div",{className:"flex flex-col gap-y-16",children:[(0,c.jsx)("div",{className:"text-12 leading-20 text-gray-6C6A7D",children:s.breadcrumb.map(function(e,n){return(0,c.jsxs)("span",{children:[n>0&&(0,c.jsx)("span",{className:"mx-4",children:"âº"}),e.name]},e.id)})}),s.titleEn&&(0,c.jsxs)("a",{href:"".concat(j,"/search/").concat(s.titleEn),target:"_blank",rel:"noreferrer",dir:"ltr",className:"text-12 text-primary-main hover:underline self-start",children:[j,"/search/",s.titleEn]}),(0,c.jsx)("div",{className:"flex gap-x-4 border-b border-gray-EFEFEF",children:[{k:"info",l:"Ø§Ø·ÙØ§Ø¹Ø§Øª"},{k:"includes",l:"Ø´ÙØ±ÙØ§Û Ø²ÛØ±Ù
جÙ
ÙØ¹Ù (".concat((0,g.N)(s.includes.length),")")},{k:"seo",l:"Ù
ØØªÙØ§Û Ø³Ø¦Ù"}].map(function(e){return(0,c.jsx)("button",{onClick:function(){return f(e.k)},className:"px-14 py-10 text-13 leading-20 font-m transition border-b-2 -mb-px ".concat(m===e.k?"border-primary-main text-primary-main":"border-transparent text-gray-6C6A7D hover:text-gray-1E1D28"),children:e.l},e.k)})}),b&&(0,c.jsx)("p",{className:"text-12 leading-20 text-[#DC2626]",children:b}),"info"===m&&(0,c.jsx)(E,{location:s,allLocations:t,onError:N,onSaved:function(){u(),r()}}),"includes"===m&&(0,c.jsx)(Z,{location:s,allLocations:t,onError:N,onSaved:function(){u(),r()}}),"seo"===m&&(0,c.jsx)(I,{location:s,onError:N,onSaved:function(){return u()}})]})})}function E(e){var n,t,s,u=e.location,x=e.allLocations,h=e.onError,m=e.onSaved,y=(0,i.Z)((0,d.useState)({name:u.name,titleEn:null!==(t=u.titleEn)&&void 0!==t?t:"",type:u.type,parentId:u.parentId?String(u.parentId):"",canonicalId:u.canonicalId?String(u.canonicalId):"",keywords:null!==(s=u.keywords)&&void 0!==s?s:"",isPublished:u.isPublished,isPrimary:u.isPrimary,sortOrder:u.sortOrder}),2),j=y[0],b=y[1],N=(0,i.Z)((0,d.useState)(!1),2),C=N[0],F=N[1],E=(n=(0,a.Z)(function(){var e,n;return(0,o.__generator)(this,function(t){switch(t.label){case 0:F(!0),h(null),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,(0,p.SC)("/api/admin/locations/".concat(u.id),{method:"PATCH",body:JSON.stringify({name:j.name.trim(),titleEn:j.titleEn.trim()||null,type:j.type,parentId:j.parentId?Number(j.parentId):null,canonicalId:j.canonicalId?Number(j.canonicalId):null,keywords:j.keywords.trim()||null,isPublished:j.isPublished,isPrimary:j.isPrimary,sortOrder:Number(j.sortOrder)||0})})];case 2:return t.sent(),m(),[3,5];case 3:return h(null!==(n=null==(e=t.sent())?void 0:e.message)&&void 0!==n?n:"Ø°Ø®ÛØ±Ù ÙØ´Ø¯."),[3,5];case 4:return F(!1),[7];case 5:return[2]}})}),function(){return n.apply(this,arguments)});return(0,c.jsxs)("div",{className:"flex flex-col gap-y-14",children:[(0,c.jsxs)("div",{className:"grid md:grid-cols-2 gap-14",children:[(0,c.jsx)(g.gN,{label:"ÙØ§Ù
ÙØ§Ø±Ø³Û",children:(0,c.jsx)(g.II,{value:j.name,onChange:function(e){return b((0,l.Z)((0,r.Z)({},j),{name:e.target.value}))}})}),(0,c.jsx)(g.gN,{label:"Ø§Ø³ÙØ§Ú¯ اÙÚ¯ÙÛØ³Û",hint:"تغÛÛØ±Ø´ آدرس اÛÙØ¯Ú©Ø³âØ´Ø¯Ù Ø±Ù Ø¹ÙØ¶ Ù
ÛâÚ©ÙÙ â Ø¨Ø§ Ø§ØØªÛاط.",children:(0,c.jsx)(g.II,{dir:"ltr",value:j.titleEn,onChange:function(e){return b((0,l.Z)((0,r.Z)({},j),{titleEn:e.target.value}))}})}),(0,c.jsx)(g.gN,{label:"ÙÙØ¹",children:(0,c.jsx)(g.Ph,{value:j.type,onCh
1ange:function(e){return b((0,l.Z)((0,r.Z)({},j),{type:e.target.value}))},children:f.map(function(e){return(0,c.jsx)("option",{value:e.value,children:e.label},e.value)})})}),(0,c.jsx)(g.gN,{label:"ÙØ§Ùد",hint:"ÙÙØ· بردکراÙ
ب. ÙÛØ³Øª Ø§ÙØ§Ù
تگاÙâÙØ§ ر٠تغÛÛØ± ÙÙ
ÛâØ¯Ù (Ù
گر استاÙ).",children:(0,c.jsxs)(g.Ph,{value:j.parentId,onChange:function(e){return b((0,l.Z)((0,r.Z)({},j),{parentId:e.target.value}))},children:[(0,c.jsx)("option",{value:"",children:"â Ø¨Ø¯ÙÙ ÙØ§Ùد â"}),x.filter(function(e){return e.id!==u.id}).map(function(e){return(0,c.jsxs)("option",{value:e.id,children:[e.name," (",v[e.type],")"]},e.id)})]})}),(0,c.jsx)(g.gN,{label:"canonical",hint:"اگر اÛÙ ØµÙØÙ Ø¨Ø§ÛØ¯ اعتبار Ø³Ø¦ÙØ´ ب٠ÛÙ ØµÙØÙâÛ Ø¯ÛÚ¯Ù Ù
ÙØªÙ٠بشÙ.",children:(0,c.jsxs)(g.Ph,{value:j.canonicalId,onChange:function(e){return b((0,l.Z)((0,r.Z)({},j),{canonicalId:e.target.value}))},children:[(0,c.jsx)("option",{value:"",children:"â ÙØ¯Ø§Ø±Ø¯ â"}),x.filter(function(e){return e.id!==u.id&&e.titleEn}).map(function(e){return(0,c.jsxs)("option",{value:e.id,children:[e.name," (",e.titleEn,")"]},e.id)})]})}),(0,c.jsx)(g.gN,{label:"ØªØ±ØªÛØ¨ ÙÙ
Ø§ÛØ´",children:(0,c.jsx)(g.II,{type:"number",value:j.sortOrder,onChange:function(e){return b((0,l.Z)((0,r.Z)({},j),{sortOrder:Number(e.target.value)}))}})})]}),(0,c.jsx)(g.gN,{label:"Ú©ÙÛØ¯ÙاÚÙâÙØ§",hint:"ÙÙØ±Ø³Øª Ø¢Ø²Ø§Ø¯Ø Ø¨Ø§ کاÙ
ا جدا Ù
ÛâØ´Ù (از x_tags Ø§ÙØ¯Ù).",children:(0,c.jsx)(g.II,{value:j.keywords,onChange:function(e){return b((0,l.Z)((0,r.Z)({},j),{keywords:e.target.value}))}})}),(0,c.jsxs)("div",{className:"flex flex-wrap gap-x-24 gap-y-10",children:[(0,c.jsx)(g.ZD,{checked:j.isPublished,onChange:function(e){return b((0,l.Z)((0,r.Z)({},j),{isPublished:e}))},label:"Ù
ÙØªØ´Ø±Ø´Ø¯Ù"}),(0,c.jsx)(g.ZD,{checked:j.isPrimary,onChange:function(e){return b((0,l.Z)((0,r.Z)({},j),{isPrimary:e}))},label:"Ù
ÙØµØ¯ اصÙÛ"})]}),(0,c.jsxs)("div",{className:"rounded-10 bg-gray-FAFAFA px-16 py-12 text-12 leading-22 text-gray-6C6A7D",children:[(0,g.N)(u.residenceCount)," Ø§ÙØ§Ù
تگا٠اصÙÛ \xb7 ",(0,g.N)(u.extraResidenceCount)," Ø§ÙØ§Ù
ØªÚ¯Ø§Ù ÙØ±Ø¹Û \xb7"," ",(0,g.N)(u.children.length)," Ø²ÛØ±Ø´Ø§Ø®Ù",u.odooId?" \xb7 Ø´ÙØ§Ø³ÙâÛ Ø§ÙØ¯Ù ".concat((0,g.N)(u.odooId)):""]}),(0,c.jsx)("div",{className:"flex justify-end pt-4",children:(0,c.jsx)(g.zx,{onClick:E,disabled:C,children:C?"در ØØ§Ù Ø°Ø®ÛØ±Ùâ¦":"Ø°Ø®ÛØ±Ù تغÛÛØ±Ø§Øª"})})]})}function Z(e){var n,t=e.location,r=e.allLocations,l=e.onError,u=e.onSaved,x=(0,i.Z)((0,d.useState)(t.includes.map(function(e){return e.child.id})),2),h=x[0],m=x[1],f=(0,i.Z)((0,d.useState)(""),2),y=f[0],j=f[1],b=(0,i.Z)((0,d.useState)(!1),2),N=b[0],C=b[1],F=(0,d.useMemo)(function(){var e,n=y.trim();return n?r.filter(function(e){return e.id!==t.id}).filter(function(t){return t.name.includes(n)||(null!==(e=t.titleEn)&&void 0!==e?e:"").toLowerCase().includes(n.toLowerCase())}).slice(0,40):r.filter(function(e){return h.includes(e.id)})},[r,y,h,t.id]),E=r.filter(function(e){return h.includes(e.id)}).reduce(function(e,n){return e+n.residenceCount},0),Z=(n=(0,a.Z)(function(){var e,n;return(0,o.__generator)(this,function(a){switch(a.label){case 0:C(!0),l(null),a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,(0,p.SC)("/api/admin/locations/".concat(t.id,"/includes"),{method:"PUT",body:JSON.stringify({childIds:h})})];case 2:return a.sent(),u(),[3,5];case 3:return l(null!==(n=null==(e=a.sent())?void 0:e.message)&&void 0!==n?n:"Ø°Ø®ÛØ±Ù ÙØ´Ø¯."),[3,5];case 4:return C(!1),[7];case 5:return[2]}})}),function(){return n.apply(this,arguments)});return(0,c.jsxs)("div",{className:"flex flex-col gap-y-14",children:[(0,c.jsxs)("p",{className:"text-12 leading-22 text-gray-6C6A7D",children:["Ø§ÙØ§Ù
تگاÙâÙØ§Û Ù
کاÙâÙØ§ÛÛ Ú©Ù Ø§ÛÙØ¬Ø§ Ø§ÙØªØ®Ø§Ø¨ Ù
ÛâÚ©ÙÛØ تÙÛ ØµÙØÙâÛ"," ",(0,c.jsx)("span",{className:"font-m text-gray-1E1D28",children:t.name})," ÙÙ
ÙØ´Ù٠داد٠Ù
ÛâØ´Ù. اگ٠ÛÙ Ø§Ø³ØªØ§Ù Ø§ÙØªØ®Ø§Ø¨ Ú©ÙÛØ ÙÙ
ÙâÛ Ø´ÙØ±Ùاش ÙÙ
Ù
ÛØ§Ù."]}),(0,c.jsx)(g.II,{value:y,onChange:function(e){return j(e.target.value)},placeholder:"Ø¬Ø³ØªØ¬Ù Ø¨Ø±Ø§Û Ø§ÙØ²ÙدÙâ¦"}),(0,c.jsx)("div",{className:"max-h-[280px] overflow-y-auto rounded-10 border border-gray-EFEFEF divide-y divide-gray-F5F5F5",children:0===F.length?(0,c.jsx)("div",{className:"px-16 py-20 text-12 text-gray-6C6A7D text-center",children:y.trim()?"ÚÛØ²Û Ù¾ÛØ¯Ø§ ÙØ´Ø¯.":"ÙÙÙØ² زÛ
1رÙ
جÙ
ÙØ¹ÙâØ§Û Ø§ÙØªØ®Ø§Ø¨ ÙØ´Ø¯Ù â Ø¨Ø±Ø§Û Ø§ÙØ²Ùد٠جستج٠کÙ."}):F.map(function(e){var n=h.includes(e.id);return(0,c.jsxs)("label",{className:"flex items-center gap-x-10 px-16 py-10 cursor-pointer hover:bg-gray-FAFAFA",children:[(0,c.jsx)("input",{type:"checkbox",checked:n,onChange:function(){return m(n?h.filter(function(n){return n!==e.id}):(0,s.Z)(h).concat([e.id]))}}),(0,c.jsx)("span",{className:"text-13 text-gray-1E1D28 font-m",children:e.name}),(0,c.jsx)("span",{className:"text-11 text-gray-B0AFBC",children:v[e.type]}),(0,c.jsxs)("span",{className:"text-11 text-gray-6C6A7D mr-auto",children:[(0,g.N)(e.residenceCount)," Ø§ÙØ§Ù
تگاÙ"]})]},e.id)})}),(0,c.jsxs)("div",{className:"rounded-10 bg-gray-FAFAFA px-16 py-12 text-12 leading-22 text-gray-6C6A7D",children:[(0,g.N)(h.length)," Ù
Ú©Ø§Ù Ø§ÙØªØ®Ø§Ø¨ Ø´Ø¯Ù â ØØ¯ÙØ¯ ",(0,g.N)(E)," Ø§ÙØ§Ù
تگا٠ب٠اÛÙ ØµÙØÙ Ø§Ø¶Ø§ÙÙ Ù
ÛâØ´Ù (بدÙÙ Ø§ØØªØ³Ø§Ø¨ Ø´ÙØ±ÙØ§Û Ø²ÛØ± استاÙâÙØ§)."]}),t.includedIn.length>0&&(0,c.jsxs)("div",{className:"text-12 leading-22 text-gray-6C6A7D",children:["اÛÙ Ù
Ú©Ø§Ù Ø®ÙØ¯Ø´ Ø²ÛØ±Ù
جÙ
ÙØ¹ÙâÛ"," ",(0,c.jsx)("span",{className:"font-m text-gray-1E1D28",children:t.includedIn.map(function(e){return e.parent.name}).join("Ø ")})," ","ÙØ³Øª."]}),(0,c.jsx)("div",{className:"flex justify-end pt-4",children:(0,c.jsx)(g.zx,{onClick:Z,disabled:N,children:N?"در ØØ§Ù Ø°Ø®ÛØ±Ùâ¦":"Ø°Ø®ÛØ±Ù Ø²ÛØ±Ù
جÙ
ÙØ¹ÙâÙØ§"})})]})}function I(e){var n,t,s,u=e.location,x=e.onError,h=e.onSaved,m=function(e){var n,t,a,r,l,i,s,o,c;return{pageTitle:null!==(n=null==e?void 0:e.pageTitle)&&void 0!==n?n:"",metaTitle:null!==(t=null==e?void 0:e.metaTitle)&&void 0!==t?t:"",metaDescription:null!==(a=null==e?void 0:e.metaDescription)&&void 0!==a?a:"",metaKeywords:null!==(r=null==e?void 0:e.metaKeywords)&&void 0!==r?r:"",contentTitle:null!==(l=null==e?void 0:e.contentTitle)&&void 0!==l?l:"",contentHtml:null!==(i=null==e?void 0:e.contentHtml)&&void 0!==i?i:"",phone:null!==(s=null==e?void 0:e.phone)&&void 0!==s?s:"",showPhone:null!==(o=null==e?void 0:e.showPhone)&&void 0!==o&&o,showInHomepage:null!==(c=null==e?void 0:e.showInHomepage)&&void 0!==c&&c}},f=(0,i.Z)((0,d.useState)(""),2),v=f[0],y=f[1],j=u.seo.find(function(e){return(null!==(t=e.residenceType)&&void 0!==t?t:"")===v}),b=(0,i.Z)((0,d.useState)(function(){return m(j)}),2),N=b[0],F=b[1],E=(0,i.Z)((0,d.useState)(!1),2),Z=E[0],I=E[1],w=(0,i.Z)((0,d.useState)(""),2),D=w[0],A=w[1];D!==v&&(A(v),F(m(u.seo.find(function(e){return(null!==(s=e.residenceType)&&void 0!==s?s:"")===v}))));var S=(n=(0,a.Z)(function(){var e,n;return(0,o.__generator)(this,function(t){switch(t.label){case 0:I(!0),x(null),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,(0,p.SC)("/api/admin/locations/".concat(u.id,"/seo"),{method:"PUT",body:JSON.stringify({residenceType:v||null,pageTitle:N.pageTitle.trim()||null,metaTitle:N.metaTitle.trim()||null,metaDescription:N.metaDescription.trim()||null,metaKeywords:N.metaKeywords.trim()||null,contentTitle:N.contentTitle.trim()||null,contentHtml:N.contentHtml.trim()||null,phone:N.phone.trim()||null,showPhone:N.showPhone,showInHomepage:N.showInHomepage})})];case 2:return t.sent(),h(),[3,5];case 3:return x(null!==(n=null==(e=t.sent())?void 0:e.message)&&void 0!==n?n:"Ø°Ø®ÛØ±Ù ÙØ´Ø¯."),[3,5];case 4:return I(!1),[7];case 5:return[2]}})}),function(){return n.apply(this,arguments)}),k=N.metaTitle.trim().length,T=N.metaDescription.trim().length;return(0,c.jsxs)("div",{className:"flex flex-col gap-y-14",children:[(0,c.jsx)("div",{className:"flex gap-x-6",children:C.map(function(e){var n,t,a=null!==(n=e.key)&&void 0!==n?n:"",r=u.seo.some(function(e){return(null!==(t=e.residenceType)&&void 0!==t?t:"")===a});return(0,c.jsxs)("button",{onClick:function(){return y(a)},className:"px-12 py-6 rounded-8 text-12 leading-20 font-m transition ".concat(v===a?"bg-primary-main text-white":"bg-gray-F5F5F5 text-gray-6C6A7D hover:bg-gray-EFEFEF"),children:[e.label,r&&(0,c.jsx)("span",{className:"mr-4 opacity-60",children:"â¢"})]},a)})}),(0,c.jsx)("p",{className:"text-11 leading-20 text-gray-B0AFBC",children:"ÙØ± ÙÙØ¹ Ø§ÙØ§Ù
تگا٠Ù
ت٠سئÙÛ Ø¬Ø¯Ø§ دارÙ. \xabÙ¾ÛØ´âÙØ±Ø¶\xbb رÙÛ ØµÙØÙâÛ Ù
عÙ
ÙÙÛ Ø´ÙØ± ÙØ´Ù٠داد٠Ù
ÛâØ´Ù."}),(0,c.jsx)(g.gN,{label:"عÙÙØ§Ù ØµÙØÙ (H1)",children:(0,c.jsx)(g.II,{value:N.pageTitle,onChange:function(e){return F((0,l.Z)((0,r.Z)({},N),{pageTitle:e.target.value}))}})}),(0,c.jsx)(g.gN,{label:"meta title",hint:"".concat(k," کاراکتر").concat(k>60?" â Ø§Ø² Û¶Û° Ø¨ÛØ´ØªØ±ÙØ Ú¯ÙÚ¯Ù Ú©ÙØªØ§ÙØ´ Ù
ÛâÚ©ÙÙ.":""),children:(0,c.jsx)(g.II,{value:N.metaTitle,onChange:function(e){return F((0,l.Z)((0,r.Z)({},N),{metaTitle:e.target.value}))}})}),(0,c.jsx)(g.gN,{label:"meta description",hint:"".concat(T," کاراکتر").concat(T>160?" â Ø§Ø² Û±Û¶Û° Ø¨ÛØ´ØªØ±Ù.":""),children:(0,c.jsx)("textarea",{value:N.metaDescription,onChange:function(e){return F((0,l.Z)((0,r.Z)({},N),{metaDescription:e.target.value}))},rows:3,className:"w-full rounded-10 border border-gray-EFEFEF px-14 py-10 text-13 leading-22 outline-none focus:border-primary-main"})}),(0,c.jsx)(g.gN,{label:"meta keywords",children:(0,c.jsx)(g.II,{value:N.metaKeywords,onChange:function(e){return F((0,l.Z)((0,r.Z)({},N),{metaKeywords:e.target.value}))}})}),(0,c.jsx)(g.gN,{label:"عÙÙØ§Ù Ù
ت٠راÙÙÙ
ا",children:(0,c.jsx)(g.II,{value:N.contentTitle,onChange:function(e){return F((0,l.Z)((0,r.Z)({},N),{contentTitle:e.target.value}))}})}),(0,c.jsx)(g.gN,{label:"Ù
ت٠راÙÙÙ
ا",hint:"HTML Ù
جاز٠â ÙÙ
Ù٠بÙÙÚ© \xabدربارÙ\xbb پاÛÛÙ ØµÙØÙâÛ Ø³Ø±Ú.",children:(0,c.jsx)("textarea",{value:N.contentHtml,onChange:function(e){return F((0,l.Z)((0,r.Z)({},N),{contentHtml:e.target.value}))},rows:8,dir:"rtl",className:"w-full rounded-10 border border-gray-EFEFEF px-14 py-10 text-13 leading-22 outline-none focus:border-primary-main font-mono"})}),(0,c.jsxs)("div",{className:"grid md:grid-cols-2 gap-14",children:[(0,c.jsx)(g.gN,{label:"Ø´Ù
ار٠تÙ
اس اختصاصÛ",children:(0,c.jsx)(g.II,{dir:"ltr",value:N.phone,onChange:function(e){return F((0,l.Z)((0,r.Z)({},N),{phone:e.target.value}))}})}),(0,c.jsxs)("div",{className:"flex flex-col justify-end gap-y-10 pb-4",children:[(0,c.jsx)(g.ZD,{checked:N.showPhone,onChange:function(e){return F((0,l.Z)((0,r.Z)({},N),{showPhone:e}))},label:"ÙÙ
Ø§ÛØ´ Ø´Ù
ارÙ"}),(0,c.jsx)(g.ZD,{checked:N.showInHomepage,onChange:function(e){return F((0,l.Z)((0,r.Z)({},N),{showInHomepage:e}))},label:"ÙÙ
Ø§ÛØ´ در ØµÙØÙâÛ Ø§ØµÙÛ"})]})]}),(0,c.jsx)("div",{className:"flex justify-end pt-4",children:(0,c.jsx)(g.zx,{onClick:S,disabled:Z,children:Z?"در ØØ§Ù Ø°Ø®ÛØ±Ùâ¦":"Ø°Ø®ÛØ±Ù Ù
ØØªÙØ§Û Ø³Ø¦Ù"})})]})}}},function(e){e.O(0,[9791,9759,9774,2888,179],function(){return e(e.s=73695)}),_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.