PageSourceSearch

https://lidomatrip.com/_next/static/chunks/pages/admin/settings/locations-771f5ea7ef4a84de.js

js lidomatrip.com collected 2026-10-02 20:26:33 UTC 23,103 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8031],{73695:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/settings/locations",function(){return a(83741)}])},83741:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return g}});var l=a(85893),n=a(67294),s=a(41664),i=a.n(s),r=a(44389),d=a(49759),o=a(84858),c=a(32474);let x=[{value:"COUNTRY",label:"کشور"},{value:"PROVINCE",label:"استان"},{value:"CITY",label:"شهر"},{value:"REGION",label:"منطقه"},{value:"VILLAGE",label:"روستا"},{value:"NEIGHBORHOOD",label:"محله"}],h=Object.fromEntries(x.map(e=>[e.value,e.label])),m={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]"},p="https://lidomatrip.com";function g(){let[e,t]=(0,n.useState)(""),[a,s]=(0,n.useState)(""),[p,g]=(0,n.useState)(null),[y,v]=(0,n.useState)(!1),{data:N,isLoading:b,mutate:f}=(0,r.u)("/api/admin/locations",e=>(0,o.SC)(e)),C=N??[],F=(0,n.useMemo)(()=>new Map(C.map(e=>[e.id,e])),[C]),E=(0,n.useMemo)(()=>{let t=e.trim();return C.filter(e=>(!a||e.type===a)&&(!t||e.name.includes(t)||(e.titleEn??"").toLowerCase().includes(t.toLowerCase())))},[C,e,a]),I=(0,n.useMemo)(()=>{let e={};
1return C.forEach(t=>e[t.type]=(e[t.type]??0)+1),e},[C]),w=(0,n.useMemo)(()=>{let e=new Map;return C.forEach(t=>{var a;let l=null===(a=t.titleEn)||void 0===a?void 0:a.trim().toLowerCase();l&&(e.has(l)||e.set(l,[]),e.get(l).push(t))}),[...e.entries()].filter(e=>{let[,t]=e;return t.length>1})},[C]),D=C.filter(e=>{var t;return!(null===(t=e.titleEn)||void 0===t?void 0:t.trim())}).length;return(0,l.jsxs)(d.Z,{title:"دسته‌بندی مکان‌ها",breadcrumb:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(i(),{href:"/admin",children:"داشبورد"}),(0,l.jsx)("span",{className:"mx-6 text-gray-B0AFBC",children:"/"}),(0,l.jsx)(i(),{href:"/admin/settings",children:"تنظیمات"})]}),toolbar:(0,l.jsxs)(c.Zb,{className:"px-8 py-6 flex items-center gap-x-4 overflow-x-auto",children:[(0,l.jsx)(i(),{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,l.jsx)("span",{className:"px-14 py-8 rounded-10 text-13 leading-20 font-m whitespace-nowrap bg-primary-main text-white",children:"دسته‌بندی مکان‌ها"}),(0,l.jsx)(i(),{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,l.jsx)(i(),{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,l.jsx)(i(),{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,l.jsx)(i(),{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,l.jsxs)("div",{className:"flex flex-col gap-y-16",children:[(0,l.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-6 gap-12",children:x.map(e=>(0,l.jsxs)("button",{onClick:()=>s(a===e.value?"":e.value),className:`rounded-12 px-16 py-14 text-right transition border ${a===e.value?"border-primary-main bg-primary-main/5":"border-gray-EFEFEF bg-white hover:border-gray-D9D9D9"}`,children:[(0,l.jsx)("div",{className:"text-12 leading-18 text-gray-6C6A7D",children:e.label}),(0,l.jsx)("div",{className:"text-20 leading-28 font-b text-gray-1E1D28",children:(0,c.N)(I[e.value]??0)})]},e.value))}),(w.length>0||D>0)&&(0,l.jsxs)(c.Zb,{className:"px-20 py-16 border-r-4 border-r-[#F59E0B]",children:[(0,l.jsx)("div",{className:"text-13 leading-22 font-m text-gray-1E1D28 mb-6",children:"نکته‌های سئویی"}),w.length>0&&(0,l.jsxs)("p",{className:"text-12 leading-22 text-gray-6C6A7D",children:[(0,c.N)(w.length)," اسلاگ تکراری در داده‌ی اودو وجود داره (مثل"," ",(0,l.jsx)("span",{className:"font-m",children:w[0][0]})," که هم برای"," ",w[0][1].map(e=>`${e.name} (${h[e.type]})`).join(" و ")," ثبت شده). این‌ها عمداً دست‌نخورده موندن چون آدرس‌های ایندکس‌شده روشون بنا شدن — ولی اسلاگ تکراری جدید پذیرفته نمی‌شه."]}),D>0&&(0,l.jsxs)("p",{className:"text-12 leading-22 text-gray-6C6A7D mt-4",children:[(0,c.N)(D)," مکان اسلاگ انگلیسی ندارن و صفحه‌ی سرچ اختصاصی نمی‌گیرن."]})]}),(0,l.jsxs)(c.Zb,{className:"p-0 overflow-hidden",children:[(0,l.jsxs)("div",{className:"px-20 py-16 flex flex-wrap items-center gap-12 border-b border-gray-EFEFEF",children:[(0,l.jsx)(c.II,{value:e,onChange:e=>t(e.target.value),placeholder:"جستجوی نام فارسی یا اسلاگ…",className:"flex-1 min-w-[220px]"}),(0,l.jsxs)(c.Ph,{value:a,onChange:e=>s(e.target.value),className:"w-[160px]",children:[(0,l.jsx)("option",{value:"",children:"همه‌ی انواع"}),x.map(e=>(0,l.jsx)("option",{value:e.value,children:e.label},e.value))]}),(0,l.jsx)(c.zx,{onClick:()=>v(!0),children:"افزودن مکان"})]}),b?(0,l.jsx)("div",{className:"p-20 flex flex-col gap-8",children:Array.from({length:8}).map((e,t)=>(0,l.jsx)(c.Od,{className:"h-40"},t))}):0===E.length?(0,l.jsx)(c.ub,{text:"مکانی با این فیلترها پیدا نشد."}):(0,l.jsxs)("div",{className:"overflow-x-auto",children:[(0,l.jsxs)("table",{className:"w-full text-13 leading-22",children:[(0,l.jsx)("thead",{className:"bg-gray-FAFAFA text-gray-6C6A7D",children:(0,l.jsxs)("tr",{children:[(0,l.jsx)("th",{className:"text-right font-m px-20 py-12 w-40",children:"ردیف"}),(0,l.jsx)("th",{className:"text-right font-m px-20 py-12",children:"نام"}),(0,l.jsx)("th",{className:"text-right font-m px-12 py-12",children:"نوع"}),(0,l.jsx)("th",{className:"text-right font-m px-12 py-12",children:"اسلاگ"}),(0,l.jsx)("th",{className:"text-right font-m px-12 py-12",children:"والد"}),(0,l.jsx)("th",{className:"text-right font-m px-12 py-12",children:"اقامتگاه"}),(0,l.jsx)("th",{className:"text-right font-m px-12 py-12",children:"زیرمجموعه"}),(0,l.jsx)("th",{className:"text-right font-m px-12 py-12",children:"وضعیت"}),(0,l.jsx)("th",{className:"px-20 py-12"})]})}),(0,l.jsx)("tbody",{children:E.slice(0,400).map((e,t)=>{var a;return(0,l.jsxs)("tr",{className:"border-t border-gray-F5F5F5 hover:bg-gray-FAFAFA",children:[(0,l.jsx)("td",{className:"px-20 py-12 text-gray-6C6A7D",children:(0,c.N)(t+1)}),(0,l.jsx)("td",{className:"px-20 py-12 font-m text-gray-1E1D28",children:e.name}),(0,l.jsx)("td",{className:"px-12 py-12",children:(0,l.jsx)("span",{className:`inline-block px-8 py-2 rounded-8 text-11 leading-18 ${m[e.type]??""}`,children:h[e.type]})}),(0,l.jsx)("td",{className:"px-12 py-12 text-gray-6C6A7D",dir:"ltr",children:e.titleEn||(0,l.jsx)("span",{className:"text-[#DC2626]",children:"—"})}),(0,l.jsx)("td",{className:"px-12 py-12 text-gray-6C6A7D",children:e.parentId?(null===(a=F.get(e.parentId))||void 0===a?void 0:a.name)??"—":"—"}),(0,l.jsxs)("td",{className:"px-12 py-12 text-gray-6C6A7D",children:[(0,c.N)(e.residenceCount),e.extraResidenceCount>0&&(0,l.jsxs)("span",{className:"text-11 text-gray-B0AFBC",children:[" +",(0,c.N)(e.extraResidenceCount)]})]}),(0,l.jsx)("td",{className:"px-12 py-12 text-gray-6C6A7D",children:(0,c.N)(e.childCount)}),(0,l.jsx)("td",{className:"px-12 py-12",children:e.isPublished?(0,l.jsx)(c.Ct,{tone:"green",children:"منتشرشده"}):(0,l.jsx)(c.Ct,{tone:"red",children:"منتشرنشده"})}),(0,l.jsx)("td",{className:"px-20 py-12 text-left",children:(0,l.jsx)("button",{onClick:()=>g(e.id),className:"text-12 text-primary-main hover:underline",children:"مدیریت"})})]},e.id)})})]}),E.length>400&&(0,l.jsxs)("div",{className:"px-20 py-12 text-12 text-gray-6C6A7D",children:[(0,c.N)(E.length-400)," مورد دیگه نمایش داده نشد — جستجو رو دقیق‌تر کن."]})]})]})]}),null!==p&&(0,l.jsx)(j,{id:p,allLocations:C,onClose:()=>g(null),onSaved:()=>f()}),y&&(0,l.jsx)(u,{allLocations:C,onClose:()=>v(!1),onSaved:()=>{v(!1),f()}})]})}function u(e){let{allLocations:t,onClose:a,onSaved:s}
1=e,[i,r]=(0,n.useState)({type:"CITY",name:"",titleEn:"",parentId:""}),[d,m]=(0,n.useState)(null),[p,g]=(0,n.useState)(!1),u=async()=>{g(!0),m(null);try{await (0,o.SC)("/api/admin/locations",{method:"POST",body:JSON.stringify({type:i.type,name:i.name.trim(),titleEn:i.titleEn.trim()||null,parentId:i.parentId?Number(i.parentId):null})}),s()}catch(e){m((null==e?void 0:e.message)??"ذخیره نشد.")}finally{g(!1)}};return(0,l.jsx)(c.u_,{open:!0,title:"افزودن مکان",onClose:a,children:(0,l.jsxs)("div",{className:"flex flex-col gap-y-14",children:[(0,l.jsx)(c.gN,{label:"نوع",children:(0,l.jsx)(c.Ph,{value:i.type,onChange:e=>r({...i,type:e.target.value}),children:x.map(e=>(0,l.jsx)("option",{value:e.value,children:e.label},e.value))})}),(0,l.jsx)(c.gN,{label:"نام فارسی",children:(0,l.jsx)(c.II,{value:i.name,onChange:e=>r({...i,name:e.target.value})})}),(0,l.jsx)(c.gN,{label:"اسلاگ انگلیسی",hint:"آدرس صفحه‌ی سرچ از همین ساخته می‌شه: /search/<اسلاگ>. خالی بذاری صفحه‌ی اختصاصی نمی‌گیره.",children:(0,l.jsx)(c.II,{dir:"ltr",value:i.titleEn,onChange:e=>r({...i,titleEn:e.target.value}),placeholder:"tehran"})}),(0,l.jsx)(c.gN,{label:"والد (برای بردکرامب)",children:(0,l.jsxs)(c.Ph,{value:i.parentId,onChange:e=>r({...i,parentId:e.target.value}),children:[(0,l.jsx)("option",{value:"",children:"— بدون والد —"}),t.filter(e=>"CITY"!==e.type||"NEIGHBORHOOD"===i.type).map(e=>(0,l.jsxs)("option",{value:e.id,children:[e.name," (",h[e.type],")"]},e.id))]})}),d&&(0,l.jsx)("p",{className:"text-12 leading-20 text-[#DC2626]",children:d}),(0,l.jsxs)("div",{className:"flex gap-x-8 justify-end pt-4",children:[(0,l.jsx)(c.zx,{variant:"ghost",onClick:a,children:"انصراف"}),(0,l.jsx)(c.zx,{onClick:u,disabled:p||!i.name.trim(),children:p?"در حال ذخیره…":"ذخیره"})]})]})})}let y=[{key:null,label:"پیش‌فرض"},{key:"BOOMGARDI",label:"بوم‌گردی"},{key:"HOTEL",label:"هتل"}];function j(e){let{id:t,allLocations:a,onClose:s,onSaved:i}=e,{data:d,isLoading:x,mutate:m}=(0,r.u)(`/api/admin/locations/${t}`,e=>(0,o.SC)(e)),[g,u]=(0,n.useState)("info"),[y,j]=(0,n.useState)(null);return x||!d?(0,l.jsx)(c.u_,{open:!0,title:"در حال بارگذاری…",onClose:s,children:(0,l.jsx)(c.Od,{className:"h-200"})}):(0,l.jsx)(c.u_,{open:!0,title:`${d.name} — ${h[d.type]}`,onClose:s,width:"max-w-[860px]",children:(0,l.jsxs)("div",{className:"flex flex-col gap-y-16",children:[(0,l.jsx)("div",{className:"text-12 leading-20 text-gray-6C6A7D",children:d.breadcrumb.map((e,t)=>(0,l.jsxs)("span",{children:[t>0&&(0,l.jsx)("span",{className:"mx-4",children:"›"}),e.name]},e.id))}),d.titleEn&&(0,l.jsxs)("a",{href:`${p}/search/${d.titleEn}`,target:"_blank",rel:"noreferrer",dir:"ltr",className:"text-12 text-primary-main hover:underline self-start",children:[p,"/search/",d.titleEn]}),(0,l.jsx)("div",{className:"flex gap-x-4 border-b border-gray-EFEFEF",children:[{k:"info",l:"اطلاعات"},{k:"includes",l:`شهرهای زیرمجموعه (${(0,c.N)(d.includes.length)})`},{k:"seo",l:"محتوای سئو"}].map(e=>(0,l.jsx)("button",{onClick:()=>u(e.k),className:`px-14 py-10 text-13 leading-20 font-m transition border-b-2 -mb-px ${g===e.k?"border-primary-main text-primary-main":"border-transparent text-gray-6C6A7D hover:text-gray-1E1D28"}`,children:e.l},e.k))}),y&&(0,l.jsx)("p",{className:"text-12 leading-20 text-[#DC2626]",children:y}),"info"===g&&(0,l.jsx)(v,{location:d,allLocations:a,onError:j,onSaved:()=>{m(),i()}}),"includes"===g&&(0,l.jsx)(N,{location:d,allLocations:a,onError:j,onSaved:()=>{m(),i()}}),"seo"===g&&(0,l.jsx)(b,{location:d,onError:j,onSaved:()=>m()})]})})}function v(e){let{location:t,allLocations:a,onError:s,onSaved:i}=e,[r,d]=(0,n.useState)({name:t.name,titleEn:t.titleEn??"",type:t.type,parentId:t.parentId?String(t.parentId):"",canonicalId:t.canonicalId?String(t.canonicalId):"",keywords:t.keywords??"",isPublished:t.isPublished,isPrimary:t.isPrimary,sortOrder:t.sortOrder}),[m,p]=(0,n.useState)(!1),g=async()=>{p(!0),s(null);try{await (0,o.SC)(`/api/admin/locations/${t.id}`,{method:"PATCH",body:JSON.stringify({name:r.name.trim(),titleEn:r.titleEn.trim()||null,type:r.type,parentId:r.parentId?Number(r.parentId):null,canonicalId:r.canonicalId?Number(r.canonicalId):null,keywords:r.keywords.trim()||null,isPublished:r.isPublished,isPrimary:r.isPrimary,sortOrder:Number(r.sortOrder)||0})}),i()}catch(e){s((null==e?void 0:e.message)??"ذخیره نشد.")}finally{p(!1)}};return(0,l.jsxs)("div",{className:"flex flex-col gap-y-14",children:[(0,l.jsxs)("div",{className:"grid md:grid-cols-2 gap-14",children:[(0,l.jsx)(c.gN,{label:"نام فارسی",children:(0,l.jsx)(c.II,{value:r.name,onChange:e=>d({...r,name:e.target.value})})}),(0,l.jsx)(c.gN,{label:"اسلاگ انگلیسی",hint:"تغییرش آدرس ایندکس‌شده رو عوض می‌کنه — با احتیاط.",children:(0,l.jsx)(c.II,{dir:"ltr",value:r.titleEn,onChange:e=>d({...r,titleEn:e.target.value})})}),(0,l.jsx)(c.gN,{label:"نوع",children:(0,l.jsx)(c.Ph,{value:r.type,onCh
1ange:e=>d({...r,type:e.target.value}),children:x.map(e=>(0,l.jsx)("option",{value:e.value,children:e.label},e.value))})}),(0,l.jsx)(c.gN,{label:"والد",hint:"فقط بردکرامب. لیست اقامتگاه‌ها رو تغییر نمی‌ده (مگر استان).",children:(0,l.jsxs)(c.Ph,{value:r.parentId,onChange:e=>d({...r,parentId:e.target.value}),children:[(0,l.jsx)("option",{value:"",children:"— بدون والد —"}),a.filter(e=>e.id!==t.id).map(e=>(0,l.jsxs)("option",{value:e.id,children:[e.name," (",h[e.type],")"]},e.id))]})}),(0,l.jsx)(c.gN,{label:"canonical",hint:"اگر این صفحه باید اعتبار سئوش به یه صفحه‌ی دیگه منتقل بشه.",children:(0,l.jsxs)(c.Ph,{value:r.canonicalId,onChange:e=>d({...r,canonicalId:e.target.value}),children:[(0,l.jsx)("option",{value:"",children:"— ندارد —"}),a.filter(e=>e.id!==t.id&&e.titleEn).map(e=>(0,l.jsxs)("option",{value:e.id,children:[e.name," (",e.titleEn,")"]},e.id))]})}),(0,l.jsx)(c.gN,{label:"ترتیب نمایش",children:(0,l.jsx)(c.II,{type:"number",value:r.sortOrder,onChange:e=>d({...r,sortOrder:Number(e.target.value)})})})]}),(0,l.jsx)(c.gN,{label:"کلیدواژه‌ها",hint:"فهرست آزاد، با کاما جدا می‌شه (از x_tags اودو).",children:(0,l.jsx)(c.II,{value:r.keywords,onChange:e=>d({...r,keywords:e.target.value})})}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-x-24 gap-y-10",children:[(0,l.jsx)(c.ZD,{checked:r.isPublished,onChange:e=>d({...r,isPublished:e}),label:"منتشرشده"}),(0,l.jsx)(c.ZD,{checked:r.isPrimary,onChange:e=>d({...r,isPrimary:e}),label:"مقصد اصلی"})]}),(0,l.jsxs)("div",{className:"rounded-10 bg-gray-FAFAFA px-16 py-12 text-12 leading-22 text-gray-6C6A7D",children:[(0,c.N)(t.residenceCount)," اقامتگاه اصلی \xb7 ",(0,c.N)(t.extraResidenceCount)," اقامتگاه فرعی \xb7"," ",(0,c.N)(t.children.length)," زیرشاخه",t.odooId?` \xb7 شناسه‌ی اودو ${(0,c.N)(t.odooId)}`:""]}),(0,l.jsx)("div",{className:"flex justify-end pt-4",children:(0,l.jsx)(c.zx,{onClick:g,disabled:m,children:m?"در حال ذخیره…":"ذخیره تغییرات"})})]})}function N(e){let{location:t,allLocations:a,onError:s,onSaved:i}=e,[r,d]=(0,n.useState)(t.includes.map(e=>
1e.child.id)),[x,m]=(0,n.useState)(""),[p,g]=(0,n.useState)(!1),u=(0,n.useMemo)(()=>{let e=x.trim();return e?a.filter(e=>e.id!==t.id).filter(t=>t.name.includes(e)||(t.titleEn??"").toLowerCase().includes(e.toLowerCase())).slice(0,40):a.filter(e=>r.includes(e.id))},[a,x,r,t.id]),y=a.filter(e=>r.includes(e.id)).reduce((e,t)=>e+t.residenceCount,0),j=async()=>{g(!0),s(null);try{await (0,o.SC)(`/api/admin/locations/${t.id}/includes`,{method:"PUT",body:JSON.stringify({childIds:r})}),i()}catch(e){s((null==e?void 0:e.message)??"ذخیره نشد.")}finally{g(!1)}};return(0,l.jsxs)("div",{className:"flex flex-col gap-y-14",children:[(0,l.jsxs)("p",{className:"text-12 leading-22 text-gray-6C6A7D",children:["اقامتگاه‌های مکان‌هایی که اینجا انتخاب می‌کنی، توی صفحه‌ی"," ",(0,l.jsx)("span",{className:"font-m text-gray-1E1D28",children:t.name})," هم نشون داده می‌شن. اگه یه استان انتخاب کنی، همه‌ی شهرهاش هم میان."]}),(0,l.jsx)(c.II,{value:x,onChange:e=>m(e.target.value),placeholder:"جستجو برای افزودن…"}),(0,l.jsx)("div",{className:"max-h-[280px] overflow-y-auto rounded-10 border border-gray-EFEFEF divide-y divide-gray-F5F5F5",children:0===u.length?(0,l.jsx)("div",{className:"px-16 py-20 text-12 text-gray-6C6A7D text-center",children:x.trim()?"چیزی پیدا نشد.":"هنوز زیرمجموعه‌ای انتخاب نشده — برای افزودن جستجو کن."}):u.map(e=>{let t=r.includes(e.id);return(0,l.jsxs)("label",{className:"flex items-center gap-x-10 px-16 py-10 cursor-pointer hover:bg-gray-FAFAFA",children:[(0,l.jsx)("input",{type:"checkbox",checked:t,onChange:()=>d(t?r.filter(t=>t!==e.id):[...r,e.id])}),(0,l.jsx)("span",{className:"text-13 text-gray-1E1D28 font-m",children:e.name}),(0,l.jsx)("span",{className:"text-11 text-gray-B0AFBC",children:h[e.type]}),(0,l.jsxs)("span",{className:"text-11 text-gray-6C6A7D mr-auto",children:[(0,c.N)(e.residenceCount)," اقامتگاه"]})]},e.id)})}),(0,l.jsxs)("div",{className:"rounded-10 bg-gray-FAFAFA px-16 py-12 text-12 leading-22 text-gray-6C6A7D",children:[(0,c.N)(r.length)," مکان انتخاب شده — حدود ",(0,c.N)(y)," اقامتگاه به این صفحه اضافه می‌شه (بدون احتساب شهرهای زیر استان‌ها)."]}),t.includedIn.length>0&&(0,l.jsxs)("div",{className:"text-12 leading-22 text-gray-6C6A7D",children:["این مکان خودش زیرمجموعه‌ی"," ",(0,l.jsx)("span",{className:"font-m text-gray-1E1D28",children:t.includedIn.map(e=>e.parent.name).join("، ")})," ","هست."]}),(0,l.jsx)("div",{className:"flex justify-end pt-4",children:(0,l.jsx)(c.zx,{onClick:j,disabled:p,children:p?"در حال ذخیره…":"ذخیره زیرمجموعه‌ها"})})]})}function b(e){let{location:t,onError:a,onSaved:s}=e,[i,r]=(0,n.useState)(""),d=t.seo.find(e=>(e.residenceType??"")===i),[x,h]=(0,n.useState)(()=>j(d)),[m,p]=(0,n.useState)(!1),[g,u]=(0,n.useState)("");function j(e){return{pageTitle:(null==e?void 0:e.pageTitle)??"",metaTitle:(null==e?void 0:e.metaTitle)??"",metaDescription:(null==e?void 0:e.metaDescription)??"",metaKeywords:(null==e?void 0:e.metaKeywords)??"",contentTitle:(null==e?void 0:e.contentTitle)??"",contentHtml:(null==e?void 0:e.contentHtml)??"",phone:(null==e?void 0:e.phone)??"",showPhone:(null==e?void 0:e.showPhone)??!1,showInHomepage:(null==e?void 0:e.showInHomepage)??!1}}g!==i&&(u(i),h(j(t.seo.find(e=>(e.residenceType??"")===i))));let v=async()=>{p(!0),a(null);try{await (0,o.SC)(`/api/admin/locations/${t.id}/seo`,{method:"PUT",body:JSON.stringify({residenceType:i||null,pageTitle:x.pageTitle.trim()||null,metaTitle:x.metaTitle.trim()||null,metaDescription:x.metaDescription.trim()||null,metaKeywords:x.metaKeywords.trim()||null,contentTitle:x.contentTitle.trim()||null,contentHtml:x.contentHtml.trim()||null,phone:x.phone.trim()||null,showPhone:x.showPhone,showInHomepage:x.showInHomepage})}),s()}catch(e){a((null==e?void 0:e.message)??"ذخیره نشد.")}finally{p(!1)}},N=x.metaTitle.trim().length,b=x.metaDescription.trim().length;return(0,l.jsxs)("div",{className:"flex flex-col gap-y-14",children:[(0,l.jsx)("div",{className:"flex gap-x-6",children:y.map(e=>{let a=e.key??"",n=t.seo.some(e=>(e.residenceType??"")===a);return(0,l.jsxs)("button",{onClick:()=>r(a),className:`px-12 py-6 rounded-8 text-12 leading-20 font-m transition ${i===a?"bg-primary-main text-white":"bg-gray-F5F5F5 text-gray-6C6A7D hover:bg-gray-EFEFEF"}`,children:[e.label,n&&(0,l.jsx)("span",{className:"mr-4 opacity-60",children:"•"})]},a)})}),(0,l.jsx)("p",{className:"text-11 leading-20 text-gray-B0AFBC",children:"هر نوع اقامتگاه متن سئوی جدا داره. \xabپیش‌فرض\xbb روی صفحه‌ی معمولی شهر نشون داده می‌شه."}),(0,l.jsx)(c.gN,{label:"عنوان صفحه (H1)",children:(0,l.jsx)(c.II,{value:x.pageTitle,onChange:e=>h({...x,pageTitle:e.target.value})})}),(0,l.jsx)(c.gN,{label:"meta title",hint:`${N} کاراکتر${N>60?" — از ۶۰ بیشتره، گوگل کوتاهش می‌کنه.":""}`,children:(0,l.jsx)(c.II,{value:x.metaTitle,onChange:e=>h({...x,metaTitle:e.target.value})})}),(0,l.jsx)(c.gN,{label:"meta description",hint:`${b} کاراکتر${b>160?" — از ۱۶۰ بیشتره.":""}`,children:(0,l.jsx)("textarea",{value:x.metaDescription,onChange:e=>h({...x,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,l.jsx)(c.gN,{label:"meta keywords",children:(0,l.jsx)(c.II,{value:x.metaKeywords,onChange:e=>h({...x,metaKeywords:e.target.value})})}),(0,l.jsx)(c.gN,{label:"عنوان متن راهنما",children:(0,l.jsx)(c.II,{value:x.contentTitle,onChange:e=>h({...x,contentTitle:e.target.value})})}),(0,l.jsx)(c.gN,{label:"متن راهنما",hint:"HTML مجازه — همون بلوک \xabدرباره\xbb پایین صفحه‌ی سرچ.",children:(0,l.jsx)("textarea",{value:x.contentHtml,onChange:e=>h({...x,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,l.jsxs)("div",{className:"grid md:grid-cols-2 gap-14",children:[(0,l.jsx)(c.gN,{label:"شماره تماس اختصاصی",children:(0,l.jsx)(c.II,{dir:"ltr",value:x.phone,onChange:e=>h({...x,phone:e.target.value})})}),(0,l.jsxs)("div",{className:"flex flex-col justify-end gap-y-10 pb-4",children:[(0,l.jsx)(c.ZD,{checked:x.showPhone,onChange:e=>h({...x,showPhone:e}),label:"نمایش شماره"}),(0,l.jsx)(c.ZD,{checked:x.showInHomepage,onChange:e=>h({...x,showInHomepage:e}),label:"نمایش در صفحه‌ی اصلی"})]})]}),(0,l.jsx)("div",{className:"flex justify-end pt-4",children:(0,l.jsx)(c.zx,{onClick:v,disabled:m,children:m?"در حال ذخیره…":"ذخیره محتوای سئو"})})]})}}},function(e){e.O(0,[4389,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.