1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8774],{38774:function(e,t,l){l.d(t,{default:function(){return R}});var a=l(57437),s=l(2265),n=l(96341),r=l(14232),i=l(99376),o=l(76417),c=l(27648),d=l(97539),u=l(94295),m=l(78737),x=l(17719),h=l(42171),v=l(19956),p=l(3810),f=l(87798),g=l(24326),j=l(45926);let b=null;var w=function(e){let{catalog:t,catalogSearchIds:l,className:n,resultData:r,stickyClass:o,showOption:c=!0,params:u,onClose:m}=e,[x,h]=(0,s.useState)(""),[v,p]=(0,s.useState)([]),[w,N]=(0,s.useState)(!0),y=(0,i.useRouter)(),_=async e=>{var a,s,n,i,o,c,d,m;if((null==e?void 0:e.length)>=2)try{let o=await fetch("".concat("https://bookroom.ir/callApi","/").concat(l?"entity":t),{method:"POST",headers:{"Content-Type":"application/json","app-version":"1"},body:JSON.stringify({q:e,show_img:1,catalog_id:l,...u})});o=await o.json(),p(null!==(n=null==o?void 0:null===(a=o.result)||void 0===a?void 0:a.data)&&void 0!==n?n:[]),r&&r(null!==(i=null==o?void 0:null===(s=o.result)||void 0===s?void 0:s.data)&&void 0!==i?i:[])}catch(e){}else if(N(!0),(null==e?void 0:e.length)<=2&&(null==x?void 0:x.length)>=2){let e=await fetch("".concat("https://bookroom.ir/callApi","/").concat(l?"entity":t),{method:"POST",headers:{"Content-Type":"application/json","app-version":"1"},body:JSON.stringify({show_img:1,catalog_id:l,...u})});p(null!==(d=null==(e=await e.json())?void 0:null===(o=e.result)||void 0===o?void 0:o.data)&&void 0!==d?d:[]),r&&r(null!==(m=null==e?void 0:null===(c=e.result)||void 0===c?void 0:c.data)&&void 0!==m?m:[])}};return(0,a.jsx)("div",{className:"w-full ".concat(null!=o?o:""),children:(0,a.jsx)("div",{children:(0,a.jsx)(g.hQ,{value:"",onChange:e=>{null==m||m(),Number(null==e?void 0:e.is_product)?y.push(null==e?void 0:e.direct_url):y.push("/".concat(null!=t?t:"products","?q=").concat(x))},children:(0,a.jsxs)("div",{className:"relative mt-1",children:[(0,a.jsx)("div",{className:"",children:(0,a.jsx)(g.gA,{className:"appearance-none focus:appearance-none ".concat(null!=n?n:"bg-custom-bg-4 w-72 h-10 block px-3 py-2 transition rounded-md focus:border focus:border-custom-border-1 focus:bg-custom-bg-3 mb-1 max-lg:ml-5 max-lg:mb-0"),placeholder:"ÚÙ ÚÛØ²Û Ø§ØØªÛاج Ø¯Ø§Ø±ÛØ",displayValue:e=>e.title,autoComplete:"disabled",onChange:async e=>{try{N(!0),clearTimeout(b),b=setTimeout(async()=>{await _(e.target.value),N(!1)},300)}catch(e){N(!1)}h(e.target.value)}})}),c&&(0,a.jsx)(j.u,{as:s.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>h(""),children:(0,a.jsxs)(g.L5,{className:"absolute mt-0 max-h-60 w-full z-10 overflow-auto rounded-md bg-custom-bg-3 py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm",children:[(0,a.jsx)(g.O2,{value:{direct_url:"".concat(t,"/q=").concat(x)}}),w&&(null==x?void 0:x.length)>=2?(0,a.jsx)(f.IconLoading,{size:30}):(0,a.jsx)(a.Fragment,{children:(null==v?void 0:v.length)===0&&""!==x?(0,a.jsx)(a.Fragment,{children:(null==x?void 0:x.length)>=2&&(0,a.jsx)("div",{className:"relative cursor-default select-none py-2 px-4 text-custom-text-2",children:"Ù
ÙØ±Ø¯Û ÛØ§Ùت ÙØ´Ø¯"})}):(0,a.jsx)(a.Fragment,{children:null==v?void 0:v.map(e=>(0,a.jsx)(g.O2,{className:e=>{let{active:t}=e;return"relative select-none py-2 pl-10 pr-4 cursor-pointer ".concat(t?"bg-custom-bg-7 text-custom-text-3":"text-custom-text-1")},value:e,children:t=>{let{selected:l,active:s}=t;return(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)(d.default,{src:(null==e?void 0:e.attach_index_image_md)||"/assets/images/custom/default.png",alt:null==e?void 0:e.title,width:50,height:50,imgClassName:"object-contain"}),(0,a.jsx)("span",{className:"block truncate ".concat(l?"font-medium":"font-normal"),title:null==e?void 0:e.title,children:null==e?void 0:e.title}),l?(0,a.jsx)("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 ".concat(s?"text-custom-text-3":"text-custom-text-4")}):null]})}},null==e?void 0:e.id))})})]})})]})})})})},N=l(23302),y=l(80434);let _=null;var k=function(e){let{resultData:t,stickyClass:l,showOption:n=!0,onClose:r}
1=e,[o,c]=(0,s.useState)(""),[u,m]=(0,s.useState)([]),[x,h]=(0,s.useState)(!0),[v,p]=(0,s.useState)({title:"کتاب",catalog:"book"}),b=(0,i.usePathname)(),w=(0,i.useSearchParams)(),k=(0,i.useRouter)();(0,s.useEffect)(()=>{if(!w.has("q"))return()=>{c(""),p({title:"کتاب",catalog:"book"})}},[b]);let C=async e=>{var l,a;let{title:s,catalog:n}=e;p({title:s,catalog:n});let r=await (0,N.W)({catalogName:null!=n?n:"entity",params:{q:o,show_img:1}});m(null!==(l=null==r?void 0:r.data)&&void 0!==l?l:[]),t&&t(null!==(a=null==r?void 0:r.data)&&void 0!==a?a:[])},z=async e=>{var l,a,s,n,r,i,c,d;if((null==e?void 0:e.length)>=2)try{let r=await fetch("".concat("https://bookroom.ir/callApi","/").concat(null==v?void 0:v.catalog),{method:"POST",headers:{"Content-Type":"application/json","app-version":"1"},body:JSON.stringify({q:e,show_img:1})});r=await r.json(),m(null!==(s=null==r?void 0:null===(l=r.result)||void 0===l?void 0:l.data)&&void 0!==s?s:[]),t&&t(null!==(n=null==r?void 0:null===(a=r.result)||void 0===a?void 0:a.data)&&void 0!==n?n:[])}catch(e){if("AbortError"===e.name){m([]);return}}else if(h(!0),(null==e?void 0:e.length)<=2&&(null==o?void 0:o.length)>=2){let e=await fetch("".concat("https://bookroom.ir/callApi","/").concat(null==v?void 0:v.catalog),{method:"POST",headers:{"Content-Type":"application/json","app-version":"1"},body:JSON.stringify({show_img:1})});m(null!==(c=null==(e=await e.json())?void 0:null===(r=e.result)||void 0===r?void 0:r.data)&&void 0!==c?c:[]),t&&t(null!==(d=null==e?void 0:null===(i=e.result)||void 0===i?void 0:i.data)&&void 0!==d?d:[])}};return(0,a.jsx)("div",{className:"w-full ".concat(null!=l?l:""),children:(0,a.jsxs)("form",{className:"flex items-center",onSubmit:e=>{var t,l;e.preventDefault(),(null==o?void 0:null===(t=o.trim())||void 0===t?void 0:t.length)>0&&(null==r||r(),k.push("/".concat(null!==(l=null==v?void 0:v.catalog)&&void 0!==l?l:"products","?q=").concat(o)))},children:[(0,a.jsx)(y.Z,{icon:(0,a.jsxs)("div",{className:"flex items-center justify-center text-custom-text-3 gap-2 p-3 px-2 rounded-2xl bg-custom-bg-1 h-12 -ml-4 relative z-10",children:[(0,a.jsx)("span",{className:"text-sm whitespace-nowrap",children:null==v?void 0:v.title}),(0,a.jsx)("span",{children:(0,a.jsx)(f.IconCaretDown,{size:15})})]}),itemsWrapperClassName:"right-0 !w-[200px]",buttonClassName:"!p-0",items:[{title:"کتاب",eventTarget:()=>C({title:"کتاب",catalog:"book"})},{title:"Ø§ÙØªØ´Ø§Ø±Ø§Øª",eventTarget:()=>C({title:"Ø§ÙØªØ´Ø§Ø±Ø§Øª",catalog:"publications"})},{title:"Ø´Ø®ØµÛØª ÙØ§",eventTarget:()=>C({title:"Ø´Ø®ØµÛØª ÙØ§",catalog:"people"})},{title:"Ù
Ø¬ÙØ§Øª",eventTarget:()=>C({title:"Ù
Ø¬ÙØ§Øª",catalog:"magazine"})},{title:"ÙÙØ ÙØ´Ø±Ø¯Ù",eventTarget:()=>C({title:"ÙÙØ ÙØ´Ø±Ø¯Ù",catalog:"disk"})},{title:"ÙÛÙÙ
Ù Ù
Ø³ØªÙØ¯",eventTarget:()=>C({title:"ÙÛÙÙ
Ù Ù
Ø³ØªÙØ¯",catalog:"movie"})},{title:"Ú©Ù Ø³Ø§ÛØª",eventTarget:()=>C({title:"Ú©Ù Ø³Ø§ÛØª",catalog:"entity"})}]}),(0,a.jsx)(g.hQ,{value:"",onChange:e=>{if(null==r||r(),Number(null==e?void 0:e.is_product))k.push(null==e?void 0:e.direct_url);else{var t;k.push("/".concat(null!==(t=null==v?void 0:v.catalog)&&void 0!==t?t:"products","?q=").concat(o))}},children:(0,a.jsxs)("div",{className:"relative h-12 w-full",children:[(0,a.jsx)(g.gA,{className:"appearance-none focus:appearance-none bg-custom-bg-4 w-full h-12 block pl-3 pr-6 py-2 transition rounded-e-2xl focus:border focus:border-custom-border-1 focus:bg-custom-bg-3 mb-1 max-lg:mb-0",placeholder:"جستج٠در ".concat(null==v?void 0:v.title),displayValue:e=>e.title,value:o,autoComplete:"disabled",onChange:e=>{let t=e.target.value;if((null==t?void 0:t.length)>=2)try{h(!0),clearTimeout(_),_=setTimeout(async()=>{await z(t),h(!1)},300)}catch(e){h(!1)}c(t)}}),n&&(0,a.jsx)(j.u,{as:s.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>c(o),children:(0,a.jsxs)(g.L5,{className:"absolute mt-0 max-h-60 w-full z-10 overflow-auto rounded-md bg-custom-bg-3 py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm",children:[(0,a.jsx)(g.O2,{value:{direct_url:"".concat(null==v?void 0:v.catalog,"/q=").concat(o)}}),x&&(null==o?void 0:o.length)>=2?(0,a.jsx)(f.IconLoading,{size:30}):(0,a.jsx)(a.Fragment,{children:(null==u?void 0:u.length)===0&&""!==o?(0,a.jsx)(a.Fragment,{children:(null==o?void 0:o.length)>=2&&(0,a.jsx)("div",{className:"relative cursor-default select-none py-2 px-4 text-custom-text-2",children:"Ù
ÙØ±Ø¯Û ÛØ§Ùت ÙØ´Ø¯"})}):(0,a.jsx)(a.Fragment,{children:null==u?void 0:u.map(e=>(0,a.jsx)(g.O2,{className:e=>{let{active:t}=e;return"relative select-none py-2 pl-10 pr-4 cursor-pointer ".concat(t?"bg-custom-bg-7 text-custom-text-3":"text-custom-text-1")},value:e,children:t=>{let{selected:l,active:s}=t;return(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)(d.default,{src:(null==e?void 0:e.attach_index_image_md)||"/assets/images/custom/default.png",alt:null==e?void 0:e.title,width:50,height:50,imgClassName:"object-contain"}),(0,a.jsx)("span",{className:"block truncate ".concat(l?"font-medium":"font-normal"),children:null==e?void 0:e.title}),l?(0,a.jsx)("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 ".concat(s?"text-custom-text-3":"text-custom-text-4")}):null]})}},null==e?void 0:e.id))})})]})})]})}),(0,a.jsx)("button",{className:"flex items-center justify-center gap-2 py-3 px-3 rounded-e-2xl bg-transparent absolute left-1 top-5 h-10 font-light",onClick:()=>{var e,t;(null==o?void 0:null===(e=o.trim())||void 0===e?void 0:e.length)>0&&(null==r||r(),k.push("/".concat(null!==(t=null==v?void 0:v.catalog)&&void 0!==t?t:"products","?q=").concat(o)))},children:(0,a.jsx)(f.IconSearch,{size:20})})]})})};let C=(0,h.Z)("custom");var z=e=>{var t,l,n,h,g;let{children:j,setting:b,catalog:N,catalogSearchIds:y,isAdvanced:_=!1,banner:z,shop:S=!0,logo:T,logoUrl:Z="/",mainClassName:F,titles:O,productsCountClassName:E}=e,I=(0,i.usePathname)(),P=(0,i.useRouter)(),A=(0,i.useSelectedLayoutSegments)(),[q,D]=(0,s.use
1State)(!1),[R,$]=(0,s.useState)(!1),[L,J]=(0,s.useState)(!1),[Q,H]=(0,s.useState)(!1),[W,V]=(0,s.useState)(!1),[Y,U]=(0,s.useState)([]),B=(0,r.C)(e=>{let{basket:t}=e;return null==t?void 0:t.products_total_count}),G="products"===A[0]&&"id"===A[1]||"catalog-id"===A[0]||["/basket/cart","/basket/cart","/basket/cart"].includes(I),M=(0,s.useCallback)(()=>{if(!b)return null;let{SOCIAL_APARAT:e,SOCIAL_BALE:t,SOCIAL_EITAA:l,SOCIAL_FACEBOOK:s,SOCIAL_GAP:n,SOCIAL_INSTAGRAM:r,SOCIAL_LINKEDIN:i,SOCIAL_SOROUSH:c,SOCIAL_TELEGRAM:d,SOCIAL_TWITTER:u,SOCIAL_WHATSAPP:m,SOCIAL_YOUTUBE:x}=b;return(0,a.jsxs)("div",{className:"justify-around items-center bg-custom-bg-3 shadow-shadow-3 rounded-md p-1 flex flex-col",children:[e&&(0,a.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"p-2",children:(0,a.jsx)(f.IconAparat,{size:23})}),t&&(0,a.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"p-2",children:(0,a.jsx)(f.IconBale,{size:23})}),l&&(0,a.jsx)("a",{href:l,target:"_blank",rel:"noopener noreferrer",className:"p-2",children:(0,a.jsx)(f.IconEitaa,{size:23})}),n&&(0,a.jsx)("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"p-2"}),c&&(0,a.jsx)("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"p-2"}),s&&(0,a.jsx)("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"p-2",children:(0,a.jsx)(o.HmH,{size:23})}),r&&(0,a.jsx)("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"p-2",children:(0,a.jsx)(o.V6w,{size:23})}),i&&(0,a.jsx)("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"p-2",children:(0,a.jsx)(o.JQD,{size:23})}),d&&(0,a.jsx)("a",{href:d,target:"_blank",rel:"noopener noreferrer",className:"p-2",children:(0,a.jsx)(o.CGK,{size:23})}),u&&(0,a.jsx)("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"p-2",children:(0,a.jsx)(o.T80,{size:23})}),m&&(0,a.jsx)("a",{href:m,target:"_blank",rel:"noopener noreferrer",className:"p-2",children:(0,a.jsx)(o.Cz3,{size:23})}),x&&(0,a.jsx)("a",{href:x,target:"_blank",rel:"noopener noreferrer",className:"p-2",children:(0,a.jsx)(o.cKP,{size:23})})]})},[b]),K=()=>{setTimeout(()=>{D(!1)},1500)},X=e=>{J(!0),V(!1),setTimeout(()=>{U(e),J(!1),0===e.length&&V(!0)},1e3)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"".concat(z&&(null==z?void 0:z.attach_mobile_image_md)?"h-32":"h-16"," w-full ").concat(null!=F?F:""),children:[(0,a.jsxs)("div",{className:"".concat(z&&(null==z?void 0:z.attach_mobile_image_md)?"h-32":"h-16"," flex flex-col right-0 left-0 z-40 mx-auto fixed"),children:[z&&(null==z?void 0:z.attach_mobile_image_md)&&(0,a.jsx)("div",{className:"lg:hidden block relative z-[2]",children:(null==z?void 0:z.url_target)?(0,a.jsx)(c.default,{href:null==z?void 0:z.url_target,target:"_blank",children:(0,a.jsx)(d.default,{src:(0,x.Z)(null==z?void 0:z.attach_mobile_image_md),alt:null==z?void 0:z.title,width:800,height:56,imgClassName:"w-full mx-h-[56px]"})}):(0,a.jsx)(d.default,{src:(0,x.Z)(null==z?void 0:z.attach_mobile_image_md),alt:null==z?void 0:z.title,width:800,height:56,imgClassName:"w-full max-h-[56px]"})}),(0,a.jsxs)("div",{className:"flex h-full",children:[(0,a.jsx)("div",{className:"w-full shadow-shadow-1 relative py-1 bg-custom-bg-3 mb-0 border-0",children:(0,a.jsxs)("div",{className:"flex justify-between container items-center h-full",children:[(0,a.jsx)("div",{onClick:()=>D(e=>!e),children:(0,a.jsx)(v.rp2,{size:20})}),(0,a.jsx)("div",{className:"flex w-full items-center justify-end gap-5",children:(0,a.jsx)("div",{className:"flex items-center w-full justify-end",children:(0,a.jsx)(c.default,{href:Z,children:(0,a.jsx)(d.default,{src:T||((null==b?void 0:b.logo)?(0,x.Z)(null==b?void 0:b.logo):"/assets/images/custom/logo.png"),alt:null==b?void 0:b.Site_Title,height:40,width:105,imgClassName:"h-12 w-32 object-contain"})})})}),(0,a.jsx)("div",{className:"flex overflow-y-auto gap-1 transition-all duration-500 fixed left-auto ".concat(z&&(null==z?void 0:z.attach_mobile_image_md)?"top-[125px] h-[calc(100vh-200px)]":"top-[70px] h-[calc(100vh-145px)]"," bottom-auto flex-col bg-custom-bg-3 z-40 w-[calc(100vw-95px)] shadow-shadow-3 rounded-lg items-start p-4 ").concat(q?"right-4 fixed visible":"invisible -right-full"),children:s.Children.map(j,e=>s.cloneElement(e,{onClose:K}))})]})}),"/"!==I&&(0,a.jsx)("div",{onClick:()=>{D(!1),P.back()},className:"bg-custom-bg-3 w-14 flex items-center justify-center shadow-shadow-3 cursor-pointer",children:(0,a.jsx)(u.u1R,{size:25})})]})]}),!q&&(0,a.jsxs)("div",{className:"grid ".concat(S?"grid-cols-5":"grid-cols-2"," justify-around items-center mx-auto h-16 fixed right-0 left-0 z-40 bg-custom-bg-3 shadow-shadow-3 p-1 ").concat(G?Q?"bottom-0":"-bottom-full":"bottom-0"),children:[(0,a.jsx)(c.default,{href:"/",className:"col-span-1",children:(0,a.jsxs)("div",{className:"rounded-full transition flex flex-col items-center justify-center gap-1",children:[(0,a.jsx)(o.fOz,{size:25}),(0,a.jsx)("span",{className:"text-xs block",children:null!==(t=null==O?void 0:O.home)&&void 0!==t?t:C.home})]})}),(0,a.jsxs)("div",{className:"rounded-full transition flex flex-col items-center justify-center gap-1 col-span-1",onClick:()=>$(!0),children:[(0,a.jsx)(o.fil,{size:25}),(0,a.jsx)("span",{className:"text-xs block",children:null!==(l=null==O?void 0:O.search)&&void 0!==l?l:C.search})]}),S&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.default,{href:"/products",className:"col-span-1",children:(0,a.jsxs)("div",{className:"rounded-full transition flex flex-col items-center justify-center gap-1",children:[(0,a.jsx)(o.DEw,{size:25}),(0,a.jsx)("span",{className:"text-xs block",children:null!==(n=null==O?void 0:O.product)&&void 0!==n?n:C.product})]})}),(0,a.jsx)(c.default,{href:"/basket/cart",className:"relative col-span-1",children:(0,a.jsxs)("div",{className:"rounded-full transition flex flex-col items-center justify-center gap-1",children:[(0,a.jsx)(o.H4w,{size:25}),(0,a.jsx)("span",{className:"text-xs block",children:null!==(h=null==O?void 0:O.basket)&&void 0!==h?h:C.basket}),B&&(0,a.jsx)("div",{className:"absolute top-1 right-1.5 bg-custom-bg-1 w-5 h-5 flex items-center justify-center text-center rounded-full ".concat(null!=E?E:""),children:(0,a.jsx)("span",{className:"text-custom-text-3 text-sm",children:B})})]})}),(0,a.jsx)(c.default,{href:"/profile",className:"col-span-1",children:(0,a.jsxs)("div",{className:"rounded-full transition flex flex-col items-center justify-center gap-1",children:[(0,a.jsx)(o.SEt,{size:25}),(0,a.jsx)("span",{className:"text-xs block",children:null!==(g=null==O?void 0:O.profile)&&void 0!==g?g:C.profile})]})})]})]}),q&&(0,a.jsxs)("div",{className:"justify-around items-center mx-auto h-16 fixed right-0 left-0 bottom-0 z-40 bg-custom-bg-3 shadow-shadow-3 p-1 flex",children:[(0,a.jsx)(c.default,{href:"/",children:(0,a.jsx)("div",{className:"p-2 rounded-full hover:bg-custom-bg-2 transition",children:(0,a.jsx)(o.fOz,{size:25})})}),(0,a.jsx)(c.default,{href:"/about",children:(0,a.jsx)("div",{className:"p-2 rounded-full hover:bg-custom-bg-2 transition",children:(0,a.jsx)(o.vry,{size:25})})}),(0,a.jsx)(c.default,{href:"/contact",children:(0,a.jsx)("div",{className:"p-2 rounded-full hover:bg-custom-bg-2 transition",children:(0,a.jsx)(o.TS7,{size:25})})})]})]}),(0,a.jsx)("div",{className:"fixed left-4 bottom-[5rem] z-40 w-[50px] mr-auto ".concat(q?"right-4 fixed":"-right-full"),children:q&&M()}
1),(0,a.jsx)("div",{className:"backdrop-blur-sm bg-black/30 fixed top-0 right-0 bottom-0 left-0 ".concat(q||R?"z-30 opacity-100 transition-opacity ease-in duration-900":"-z-10 opacity-0"),onClick:()=>{D(!1),$(!1)}}),S&&G&&!q&&(0,a.jsx)("div",{className:"block fixed right-4 bottom-20 bg-custom-bg-3 rounded-l-full py-2 px-3 shadow-shadow-3 z-40",onClick:()=>H(e=>!e),children:Q?(0,a.jsx)(o.y6L,{size:25}):(0,a.jsx)(o.pCD,{size:25})}),(0,a.jsx)("div",{className:"flex gap-12 m-auto max-xl:gap-6 transition-all duration-500 fixed left-auto top-[83px] bottom-auto flex-col bg-custom-bg-3 z-40 h-[calc(100vh-165px)] w-[calc(100vw-30px)] shadow-shadow-3 rounded-lg items-start p-4 ".concat(R?"right-4 fixed visible":"invisible -right-full"),children:(0,a.jsxs)("div",{className:"w-full relative",children:[(0,a.jsxs)("div",{className:"w-full absolute top-0",children:[(0,a.jsx)("span",{className:"cursor-pointer",onClick:()=>$(!1),children:(0,a.jsx)(m.u5Z,{size:15})}),_?(0,a.jsx)(k,{resultData:X,showOption:!1,onClose:()=>$(!1),className:"appearance-none bg-custom-bg-3 w-full h-12 block px-3 py-2 transition rounded-md border border-custom-border-1"}):(0,a.jsx)(w,{catalog:N,onClose:()=>$(!1),className:"appearance-none focus:appearance-none bg-custom-bg-3 w-full h-12 block px-3 py-2 transition rounded-md border border-custom-border-1 focus:bg-custom-bg-3 mb-0",showOption:!1,resultData:X,catalogSearchIds:y})]}),(0,a.jsx)("div",{className:"flex items-start flex-col w-full mt-24 overflow-auto h-[calc(100vh-280px)]",children:L?(0,a.jsx)("div",{className:"w-full",children:(0,a.jsx)(p.Z,{count:10,height:55,className:"!rounded-md mb-1"})}):W?(0,a.jsx)("div",{className:"text-center w-full text-gray-500",children:C.nothing_found}):Y.map((e,t)=>(0,a.jsxs)(c.default,{href:e.direct_url,className:"flex items-center py-1 gap-2 w-full border-b last:border-b-0",onClick:()=>$(!1),children:[(0,a.jsx)(d.default,{src:e.attach_index_image_md||"/assets/images/default.png",imgClassName:"object-contain w-[40px]",alt:e.title,width:50,height:50}),(0,a.jsx)("div",{className:"line-clamp-1 text-md w-[calc(100%-45px)] text-right max-md:text-sm",children:e.title})]},e.product_id||t))})]})})]})};let S=e=>{let{data:t,onClose:l,classNameListSubmenu:n,icon:r,mainSubsetClassName:i,rotate:o}=e,[d,u]=(0,s.useState)(new Set),m=(0,s.useCallback)(e=>{u(t=>{let l=new Set(t);return l.has(e)?l.delete(e):l.add(e),l})},[]);return(0,a.jsx)(a.Fragment,{children:t.map((e,t)=>(0,a.jsxs)("li",{className:"w-full",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center py-3",children:[(0,a.jsx)(c.default,{href:e.link||"#",className:"flex items-center hover:text-custom-text-7 gap-1 text-custom-text-2 font-light ".concat(null!=n?n:""),onClick:()=>!e.children&&l&&l(),children:(0,a.jsx)("span",{children:e.title})}),e.children&&(0,a.jsx)("span",{className:"mr-auto cursor-pointer w-10 h-5 flex justify-center items-center transition-transform ".concat(d.has(t)?null!=o?o:"-rotate-90":"rotate-0"),onClick:()=>m(t),children:null!=r?r:(0,a.jsx)(f.IconArrowBack,{size:15})})]}),e.children&&d.has(t)&&(0,a.jsx)("ul",{className:"bg-gray-200 pr-3 rounded-sm overflow-hidden ".concat(null!=i?i:""),children:(0,a.jsx)(S,{data:e.children,onClose:l,classNameListSubmenu:n})})]},t))})};var T=e=>{let{data:t,onClose:l,classNameListSubmenu:n,mainListClassName:r,mainSubsetClassName:i,icon:o,rotate:d}=e,[u,m]=(0,s.useState)(new Set),x=(0,s.useCallback)(e=>{m(t=>{let l=new Set(t);return l.has(e)?l.delete(e):l.add(e),l})},[]);return(0,a.jsx)("ul",{className:"w-full overflow-y-auto lg:hidden",children:t.map((e,t)=>(0,a.jsxs)("li",{className:"transition-all group w-full ".concat(null!=r?r:""),children:[(0,a.jsxs)("div",{className:"flex justify-between items-center py-3",children:[(0,a.jsx)(c.default,{href:e.link||"#",className:"flex items-center gap-2 hover:text-custom-text-7 text-custom-text-2 font-light ".concat(null!=n?n:""),onClick:()=>{!e.children&&l&&l()},children:(0,a.jsx)("span",{children:e.title})}),e.children&&(0,a.jsx)("span",{className:"mr-auto cursor-pointer w-10 h-5 flex justify-center items-center transition-transform ".concat(u.has(t)?null!=d?d:"-rotate-90":"rotate-0"),onClick:()=>x(t),children:null!=o?o:(0,a.jsx)(f.IconArrowBack,{size:15})})]}),e.children&&u.has(t)&&(0,a.jsx)("ul",{className:"flex items-start flex-col pr-4 w-full bg-gray-100 ".concat(null!=i?i:""),children:(0,a.jsx)(S,{data:e.children,onClose:l,classNameListSubmenu:n,icon:o,mainSubsetClassName:i,rotate:d})})]},t))})},Z=l(33085);let F=null;var O=function(e){let{className:t,resultData:l,stickyClass:n,settings:r,showOption:o=!0}
1=e,[c,d]=(0,s.useState)(""),[u,m]=(0,s.useState)([]),[x,h]=(0,s.useState)(!0),[v,p]=(0,s.useState)({title:"Ù
ØØµÙÙØ§Øª",catalog:"products"}),b=(0,i.usePathname)(),w=(0,i.useSearchParams)(),_=(0,i.useRouter)();(0,s.useEffect)(()=>{w.has("q")||(d(""),p({title:"Ù
ØØµÙÙØ§Øª",catalog:"products"}))},[b]);let k=async e=>{var t,a;let{title:s,catalog:n}=e;p({title:s,catalog:n});let r=await (0,N.W)({catalogName:null!=n?n:"entity",params:{q:c,show_img:1}});m(null!==(t=null==r?void 0:r.data)&&void 0!==t?t:[]),l&&l(null!==(a=null==r?void 0:r.data)&&void 0!==a?a:[])};return(0,a.jsx)("div",{className:"w-full ".concat(null!=n?n:""),children:(0,a.jsxs)("form",{className:"flex items-center max-lg:flex max-lg:justify-center",onSubmit:e=>{var t,l;e.preventDefault(),(null==c?void 0:null===(t=c.trim())||void 0===t?void 0:t.length)>0&&_.push("/".concat(null!==(l=null==v?void 0:v.catalog)&&void 0!==l?l:"products","?q=").concat(c))},children:[(0,a.jsx)(y.Z,{icon:(0,a.jsxs)("div",{className:"flex items-center justify-between text-custom-text-3 gap-2 p-3 rounded-lg bg-custom-bg-1 h-12 -ml-4 relative z-10 !w-auto lg:!w-36",children:[(0,a.jsx)("span",{className:"whitespace-nowrap",children:null==v?void 0:v.title}),(0,a.jsx)("span",{children:(0,a.jsx)(f.IconCaretDown,{size:20})})]}),buttonClassName:"!p-0",items:[{title:"Ù
ØØµÙÙØ§Øª",eventTarget:()=>k({title:"Ù
ØØµÙÙØ§Øª",catalog:"products"})},{title:"Ø§ÙØªØ´Ø§Ø±Ø§Øª",eventTarget:()=>k({title:"Ø§ÙØªØ´Ø§Ø±Ø§Øª",catalog:"publications"})},{title:"Ø´Ø®ØµÛØª ÙØ§",eventTarget:()=>k({title:"Ø´Ø®ØµÛØª ÙØ§",catalog:"people"})}]}),(0,a.jsx)(g.hQ,{value:"",onChange:e=>{Number(null==e?void 0:e.is_product)?_.push(null==e?void 0:e.direct_url):(null==e?void 0:e.direct_url)?_.push(null==e?void 0:e.direct_url):_.push((0,Z.C)({urlFormat:null==r?void 0:r.CATEGORY_URL_FORMAT,catalogName:"products",model:null==e?void 0:e.catalog_class,slug:null==e?void 0:e.slug,id:null==e?void 0:e.entity_id}))},children:(0,a.jsxs)("div",{className:"relative h-12",children:[(0,a.jsx)(g.hQ.Input,{className:"appearance-none focus:appearance-none ".concat(null!=t?t:"bg-custom-bg-4 w-96 h-12 block pl-3 pr-6 py-2 transition rounded-e-lg focus:border focus:border-custom-border-1 focus:bg-custom-bg-3 mb-1 max-lg:ml-5 max-lg:mb-0 max-lg:w-full"),placeholder:"جستج٠در ".concat(null==v?void 0:v.title),displayValue:e=>e.title,value:c,autoComplete:"off",onChange:e=>{h(!0);try{clearTimeout(F),F=setTimeout(async()=>{var t,a,s,n,r,i,o,d;if((null===(t=e.target.value)||void 0===t?void 0:t.length)>=2){let t=await (0,N.W)({catalogName:null!==(a=null==v?void 0:v.catalog)&&void 0!==a?a:"entity",params:{q:e.target.value,show_img:1}});m(null!==(s=null==t?void 0:t.data)&&void 0!==s?s:[]),l&&l(null!==(n=null==t?void 0:t.data)&&void 0!==n?n:[]),h(!1)}else{if((null===(r=e.target.value)||void 0===r?void 0:r.length)<=2&&(null==c?void 0:c.length)>=2){let e=await (0,N.W)({catalogName:null!==(i=null==v?void 0:v.catalog)&&void 0!==i?i:"entity",params:{show_img:1}});m(null!==(o=null==e?void 0:e.data)&&void 0!==o?o:[]),l&&l(null!==(d=null==e?void 0:e.data)&&void 0!==d?d:[])}h(!1)}},300)}catch(e){h(!1)}d(e.target.value)}}),o&&(0,a.jsx)(j.u,{as:s.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>d(c),children:(0,a.jsxs)(g.hQ.Options,{className:"absolute mt-0 max-h-60 w-full z-10 overflow-auto rounded-md bg-custom-bg-3 py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm",children:[(0,a.jsx)(g.hQ.Option,{value:{direct_url:"/".concat(null==v?void 0:v.catalog,"?q=").concat(c)}}),x&&(null==c?void 0:c.length)>=2?(0,a.jsx)("div",{className:"flex justify-center py-3",children:(0,a.jsx)(f.IconLoading,{size:30})}):(0,a.jsx)(a.Fragment,{children:(null==u?void 0:u.length)===0&&""!==c?(0,a.jsx)(a.Fragment,{children:(null==c?void 0:c.length)>=2&&(0,a.jsx)("div",{className:"relative cursor-default select-none py-2 px-4 text-custom-text-2",children:"Ù
ÙØ±Ø¯Û ÛØ§Ùت ÙØ´Ø¯"})}):null==u?void 0:u.map(e=>(0,a.jsx)(g.hQ.Option,{className:e=>{let{active:t}=e;return"relative select-none py-2 pl-10 pr-4 cursor-pointer ".concat(t?"bg-custom-bg-7 text-custom-text-3":"text-custom-text-1")},value:e,children:t=>{let{selected:l,active:s}=t;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"block truncate ".concat(l?"font-medium":"font-normal"),children:null==e?void 0:e.title}),l?(0,a.jsx)("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 ".concat(s?"text-custom-text-3":"text-custom-text-4")}):null]})}},null==e?void 0:e.id))})]})})]})}),(0,a.jsx)("button",{className:"flex items-center justify-center text-custom-text-3 gap-2 p-3 rounded-e-lg bg-custom-bg-1 h-12 -mr-4 pr-6",onClick:()=>{var e,t;(null==c?void 0:null===(e=c.trim())||void 0===e?void 0:e.length)>0&&_.push("/".concat(null!==(t=null==v?void 0:v.catalog)&&void 0!==t?t:"products","?q=").concat(c))},children:"جستجÙ"})]})})},E=l(19636),I=l(45490);function P(e){let{title:t,icon:l,body:n,btnClassName:r,className:i,panelClassName:o,containerClassName:c}=e;return(0,a.jsx)("div",{className:null!=i?i:"",children:(0,a.jsx)(I.J2,{className:"relative",children:e=>{let{open:i}=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(I.J2.Button,{className:"".concat(""," ").concat(null!=r?r:""),children:[t&&(0,a.jsx)("span",{children:"title"}),l&&l]}),(0,a.jsx)(j.u,{as:s.Fragment,enter:"transition ease-out duration-200",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-100 translate-y-0",leave:"transition ease-in duration-150",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 translate-y-1",children:(0,a.jsx)(I.J2.Panel,{className:"absolute bg-basket-bg-2 left-0 z-10 mt-3 max-w-sm px-4 sm:px-0 ".concat(null!=o?o:""),children:(0,a.jsx)("div",{className:"overflow-hidden rounded-lg shadow-lg ring-1 ring-black ring-opacity-5 w-96 ".concat(null!=c?c:""),children:n&&n})})})]})}})})}var A=l(45432),q=l(32475),D=e=>{let{classNameLink:t,basketViewClassName:l,basketBtnClassName:s,deleteIcon:n,basketHref:o}=e,u=(0,h.Z)("basket"),m=(0,i.usePathname)(),{totalGoodsPrice:x}=(0,r.C)(e=>{let{basket:t}=e;return null==t?void 0:t.prices})||{},{products_total_count:v,products:p}=(0,r.C)(e=>{let{basket:t}=e;return t})||{};return"/basket/cart"==m?(0,a.jsx)(a.Fragment,{}):(0,a.jsx)(a.Fragment,{children:v?(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"px-6 py-3.5",children:(0,a.jsxs)("header",{className:"flex w-full items-center justify-between rounded-md p-3 bg-gray-100",children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("h3",{className:"text-sm text-basket-text-6",children:u.your_basket}),(0,a.jsxs)("span",{className:"mr-2 text-xs text-basket-text-6",children:[" ",v," ",u.item_number," "]})]}),(0,a.jsx)(c.default,{href:null!=o?o:"/basket/cart",className:"flex items-center",children:(0,a.jsx)("p",{className:"flex items-center text-xs text-basket-text-4 ".concat(null!=l?l:""),children:u.basket_view})})]})}),(0,a.jsx)("div",{className:"max-h-96 max-w-full flex flex-col overflow-y-auto overflow-x-hidden px-8 dir-ltr mr",children:null==p?void 0:p.map((e,t)=>{var l;return(0,a.jsxs)("div",{className:"w-full pb-6 pt-3 border-b border-b-basket-border-2 last:border-0",children:[(0,a.jsxs)("div",{className:"flex w-full items-stretch flex-row",children:[(0,a.jsx)(c.default,{href:null!==(l=null==e?void 0:e.direct_url)&&void 0!==l?l:"/",className:"w-1/3 pt-3",children:(0,a.jsx)("div",{className:"w-full relative flex justify-center items-center",children:(0,a.jsx)(d.default,{src:null==e?void 0:e.img,alt:null==e?void 0:e.title,height:80,width:80,imgClassName:"object-contain"})})}),(0,a.jsx)("div",{className:"flex w-2/3 flex-col gap-2 items-start",children:(0,a.jsxs)("div",{className:"flex flex-col justify-between pr-4 items-start text-right",children:[(0,a.jsx)("h2",{className:"text-xs text-basket-text-2",children:null==e?void 0:e.title}),(0,a.jsxs)("div",{className:"mt-1 flex w-full flex-col items-start text-right",children:[(null==e?void 0:e.seller_title)&&(0,a.jsx)("div",{className:"mt-3 flex w-full items-center flex-row",children:(0,a.jsx)("p",{className:"text-xs text-basket-text-6",children:null==e?void 0:e.seller_title})}),(null==e?void 0:e.product_unit_lable)&&(0,a.jsx)("div",{className:"mt-2 flex w-full items-center flex-row",children:(0,a.jsx)("p",{className:"text-xs font-medium text-basket-text-6",children:null==e?void 0:e.product_unit_lable})}),(null==e?void 0:e.product_option)&&(0,a.jsx)("div",{className:"mt-3 flex w-full items-center flex-row",children:(0,a.jsx)("p",{className:"text-xs text-basket-text-6",children:null==e?void 0:e.product_option})})]})]})})]}),(0,a.jsx)("div",{className:"mt-3 flex w-full flex-col",children:(0,a.jsxs)("div",{className:"flex w-full flex-row items-center",children:[(0,a.jsx)("div",{className:"relative flex w-1/2 justify-between flex-row pl-2",children:(0,a.jsx)(q.Z,{entity_id:null==e?void 0:e.entity_id,product_id:null==e?void 0:e.product_id,product_option:null==e?void 0:e.product_option,array_key:null==e?void 0:e.array_key,btnClassName:s,deleteIcon:n})}),(0,a.jsx)("div",{className:"flex flex-1 flex-col justify-end",children:(0,a.jsxs)("div",{className:"flex flex-1 flex-col justify-end items-end",children:[(null==e?void 0:e.original_price)!=(null==e?void 0:e.price)&&(0,a.jsxs)("div",{className:"mb-1 mt-2 flex items-center",children:[(0,a.jsx)("span",{className:"text-sm font-medium text-basket-text-6 line-through",children:(0,A.Y)({number:null==e?void 0:e.original_price,isRial:!0})}),(0,a.jsxs)("span",{className:"text-xs font-medium mr-1 text-basket-text-6",children:[" ",u.currency," "]})]}),(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("p",{className:"text-basket-text-8 text-xl",children:(0,A.Y)({number:null==e?void 0:e.price,isRial:!0})}),(0,a.jsxs)("span",{className:"text-xs font-medium mr-1 text-basket-text-8",children:[" ",u.currency," "]})]})]})})]})})]},t)})}),(0,a.jsx)("div",{className:"w-full rounded-b-2xl border-t border-t-basket-border-1 px-6 py-4",children:(0,a.jsxs)(c.default,{href:null!=o?o:"/basket/cart",className:"transition-all relative flex items-center justify-center w-full text-basket-text-3 bg-custom-bg-1 p-3 rounded-lg ".concat(null!=t?t:""),children:[(0,a.jsxs)("p",{className:"flex-1 text-center text-md",children:[" ",u.submit_order," "]}),(0,a.jsxs)("span",{className:"flex flex-1 items-center justify-center text-xl",children:[(0,A.Y)({number:x,isRial:!0}),(0,a.jsx)("span",{className:"text-xs mr-1 text-basket-text-3",children:u.currency})]})]})})]}):(0,a.jsxs)("div",{className:"flex justify-center items-center p-6 flex-col gap-5",children:[(0,a.jsx)(d.default,{src:"/assets/images/empty_cart.svg",alt:(null==u?void 0:u.basket_empty)||"",width:80,height:80,imgClassName:"object-contain text-custom-text-1"}),(0,a.jsx)("p",{className:"text-custom-text-1 text-sm",children:null==u?void 0:u.basket_empty})]})})},R=e=>{var t;let{setting:l,menu:o}=e,{user:d,isMobile:u}=(0,s.useContext)(n.H),m=(0,r.C)(e=>{let{basket:t}=e;return null==t?void 0:t.products_total_count}),h=(0,i.useRouter)();return(0,a.jsx)("header",{children:u?(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(z,{setting:l,catalog:"products",children:(0,a.jsx)(T,{data:o})})}):(0,a.jsx)("div",{children:(0,a.jsx)("div",{className:"w-full",children:(0,a.jsx)("div",{className:"w-full shadow-shadow-4 mb-12 pt-3 relative bg-custom-bg-3",children:(0,a.jsxs)("div",{className:"flex container justify-between h-auto flex-nowrap flex-col",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)(c.default,{href:"/",children:(0,a.jsx)("img",{src:(null==l?void 0:l.logo)?(0,x.Z)(null==l?void 0:l.logo):"/assets/images/custom/logo.png",alt:(null==l?void 0:l.Site_Title)||"",className:"w-48 h-12 max-lg:w-12 object-contain"})}),(0,a.jsx)("div",{children:(0,a.jsx)(O,{settings:l})}),(0,a.jsxs)("div",{className:"flex gap-4",children:[(null==d?void 0:d.mobile)?(0,a.jsx)(y.Z,{icon:(0,a.jsxs)("div",{className:"flex items-center justify-center text-custom-text-7 gap-2 p-3 rounded-lg border border-custom-border-3 h-12",children:[(0,a.jsx)("span",{children:(null==d?void 0:null===(t=d.member_label)||void 0===t?void 0:t.trim())?null==d?void 0:d.member_label:"پرÙÙØ§ÛÙ"}),(0,a.jsx)("span",{children:(0,a.jsx)(f.IconCaretDown,{size:20})})]}),buttonClassName:"!p-0",items:[{title:"پرÙÙØ§ÛÙ",eventTarget:()=>h.push("/profile")},{title:"Ø³ÙØ§Ø±Ø´ ÙØ§Û Ù
Ù",eventTarget:()=>h.push("/profile/orders")},{title:"Ø®Ø±ÙØ¬",eventTarget:()=>(0,E.lv)()}]}):(0,a.jsxs)(c.default,{href:"/profile",className:"flex items-center justify-center text-custom-text-7 gap-2 p-3 rounded-lg border border-custom-border-3 h-12",children:[(0,a.jsx)("span",{className:"text-md text-custom-text-7",children:"ÙØ±Ùد/عضÙÛØª"}),(0,a.jsx)(f.IconUser,{size:18})]}),(0,a.jsx)(P,{icon:(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("div",{className:"flex items-center justify-center bg-custom-bg-1 text-custom-text-3 rounded-lg h-12 w-14",children:(0,a.jsx)(f.IconS
1hop,{size:25})}),!!Number(m)&&(0,a.jsx)("div",{className:"absolute -top-1 -right-2 bg-custom-bg-5 w-6 h-4 flex items-center justify-center text-center",children:(0,a.jsxs)("div",{className:"relative w-full",children:[(0,a.jsx)("span",{className:"absolute w-6 border-b-4 border-b-custom-border-7 border-r-[10px] border-r-transparent border-l-[10px] border-l-transparent right-0 left-0 top-0 z-[1]"}),(0,a.jsx)("span",{className:"text-custom-text-3 text-sm",children:m}),(0,a.jsx)("span",{className:"absolute w-6 border-t-4 border-t-custom-border-7 border-r-[10px] border-r-transparent border-l-[10px] border-l-transparent right-0 left-0 bottom-0 z-[1]"})]})})]}),body:(0,a.jsx)(D,{})})]})]}),(0,a.jsx)("nav",{className:"w-full flex justify-center mt-3 lg:py-3",children:(0,a.jsx)("ul",{className:"flex items-center gap-12 w-max",children:null==o?void 0:o.map((e,t)=>(0,a.jsx)("li",{children:(0,a.jsx)(c.default,{href:e.link,className:"flex flex-col items-center justify-center gap-2 hover:text-custom-text-7 group",children:(0,a.jsx)("span",{children:null==e?void 0:e.title})})},t))})})]})})})})})}},80434:function(e,t,l){var a=l(57437),s=l(32471),n=l(45926),r=l(2265),i=l(87798);t.Z=e=>{let{items:t,icon:l,title:o,buttonClassName:c,itemsWrapperClassName:d}=e;return(0,a.jsx)("div",{children:(0,a.jsxs)(s.v2,{as:"div",className:"relative inline-block",children:[(0,a.jsx)("div",{children:(0,a.jsxs)(s.j2,{className:"inline-flex w-full justify-center rounded-md px-2 py-2 text-sm font-medium gap-2 ".concat(null!=c?c:""),children:[o," ",null!=l?l:(0,a.jsx)(i.IconOptionsVertical,{size:15})]})}),(0,a.jsx)(n.u,{as:r.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:(0,a.jsx)(s.sd,{className:"absolute z-10 left-0 mt-2 w-auto origin-top-right divide-y divide-gray-100 rounded-md dropdownMenuItems shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none ".concat(null!=d?d:""),children:(0,a.jsx)("div",{className:"px-1 py-1",children:null==t?void 0:t.map((e,t)=>(0,a.jsx)(s.sN,{children:t=>{var l,s;let{active:n}=t;return(0,a.jsxs)("button",{onClick:()=>{e.eventTarget&&e.eventTarget()},type:"button",className:"".concat(n?"bg-custom-bg-6":"text-custom-text-1"," group flex w-full items-center rounded-md px-2 py-2 whitespace-nowrap ").concat(null!==(l=e.titleColor)&&void 0!==l?l:""),children:[e.icon&&(0,a.jsx)("span",{className:"ml-2 text-custom-text-3 ".concat(null!==(s=e.iconColor)&&void 0!==s?s:""),children:e.icon}),e.title&&e.title]})}},t))})})})]})})}},3810:function(e,t,l){var a=l(57437),s=l(41208);l(92119),t.Z=e=>{let{count:t=1,width:l,height:n,className:r}=e;return(0,a.jsx)(()=>{let e=[];for(let i=1;i<=t;i++)e.push((0,a.jsx)(s.Z,{count:1,height:n,width:l,style:{width:"100%"},className:null!=r?r:""},i));return(0,a.jsx)(a.Fragment,{children:e})},{})}},26070:function(e,t,l){l.d(t,{Z:function(){return a}});class a{constructor({message:e,messageId:t}){this.messages={message:e,messageId:t}}}},64358:function(e,t,l){var a=l(34307),s=l(27030),n=l(26070),r=l(51983),i=l.n(r);t.Z=function(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{serverSideToken:l,clientHost:r,sellerId:o,unSendSellerId:c,clientHostDockerImage:d,hostDockerImage:u,ignoreToken:m}=t,x=(0,s.$1)("x-api-key"),h=(0,s.$1)("sellerId"),v=(0,s.$1)("x-url"),p=(0,s.$1)("net-protocol"),f="";try{p&&(f=atob(p.toString()))}catch(e){}let g={"app-version":1,"x-url":v,"Cache-Control":"no-cache, no-store, must-revalidate",Pragma:"no-cache",Expires:"0"};f&&!m&&(g["x-real-ip"]=f),(x||l)&&(m||(g["x-api-key"]=null!=x?x:l),g["Access-Control-Allow-Origin"]="*"),(Number(h)||Number(o))&&(g.seller_id=Number(h||o)),e=r?d?"http://localhost:3000/api":"https://bookroom.ir/api":u?"http://localhost:3000/callApi":"https://bookroom.ir/callApi";let j=a.Z.create({baseURL:e,headers:g,timeout:Number("30000"),httpsAgent:new(i()).Agent({rejectUnauthorized:!1})});return j.interceptors.request.use(e=>e,e=>Promise.reject(e)),j.interceptors.response.use(e=>null==e?void 0:e.data,e=>{var t,l,a,r;let{response:i}=e;if(null==i?void 0:null===(t=i.data)||void 0===t?void 0:t.errorCode)throw(null==i?void 0:null===(l=i.data)||void 0===l?void 0:l.errorCode)===401&&(0,s.s$)("x-api-key","user"),new n.Z({message:null==i?void 0:null===(a=i.data)||void 0===a?void 0:a.message,messageId:null==i?void 0:null===(r=i.data)||void 0===r?void 0:r.messageId});return Promise.reject(e)}),j}},27030:function(e,t,l){l.d(t,{$1:function(){return o},lE:function(){return i},s$:function(){return c}});let a=new(l(820)).Z,s="bookroom".toString()||"",n={path:"/",domain:".bookroom.ir",sameSite:"lax",secure:!0},r={path:n.path,domain:n.domain};function i(e,t,l){try{var r;let i,o={...n};l&&(o.expires=(r=Number(l),(i=new Date).setTime(i.getTime()+r),i)),a.set("".concat(s+"-"+e),t,o)}catch(e){console.log(e)}}function o(e,t){var l;let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return null!==(l=a.get(n?"".concat(s+"-"+e):e))&&void 0!==l?l:t}function c(){for(var e=arguments.length,t=Array(e),l=0;l<e;l++)t[l]=arguments[l];
1t.forEach(e=>{a.remove("".concat(s+"-"+e),r)})}},33085:function(e,t,l){l.d(t,{C:function(){return a}});function a(e){let{urlFormat:t,catalogName:l="",model:a,slug:s,id:n,params:r="",productType:i,basePath:o}=e,c=!l;switch(t){case 1:return"".concat(null!=o?o:"","/").concat(1===i||c?"products":l,"/").concat(a,"-").concat(s).concat(r);case 2:return"/".concat(l,"/").concat(a,"/").concat(s).concat(r);case 3:return"/".concat(l,"/").concat(a,"=").concat(n,"/").concat(s).concat(r);default:return""}}},19636:function(e,t,l){l.d(t,{ee:function(){return m},lv:function(){return h},vx:function(){return x}});var a=l(26070),s=l(64358),n=l(27030),r=l(7409),i=l(34211),o=l(42171),c=l(20441);let d=(0,o.Z)("auth"),u=e=>{if(e instanceof a.Z){var t;(0,r.toast)(null==e?void 0:null===(t=e.messages)||void 0===t?void 0:t.message.toString(),{theme:"dark"})}else(0,r.toast)(d.auth_server_error,{theme:"dark"});return Promise.reject(e)};async function m(e){try{var t,l,a,i,o,m;let u=await (0,s.Z)().post("/authenticate",e);if((null==u?void 0:u.success)&&(null==u?void 0:u.result)){if(null==u||null===(t=u.result)||void 0===t||!t.login)return null==u?void 0:u.result;{if((0,n.lE)("user",null==u?void 0:null===(l=u.result)||void 0===l?void 0:l.login),null==e?void 0:e.remember){let e=await (0,n.$1)("x-api-key");(0,n.lE)("x-api-key",e,"31556952000")}(0,c.EX)(null==u?void 0:null===(a=u.result)||void 0===a?void 0:a.login);let t=null!==(i=null==e?void 0:e.backUrl)&&void 0!==i?i:"/profile";window.location.href=(e=>{try{let t=(e=e.trim()).toLowerCase();if(["\\","%5c","\n","\r","%00","%0d","%0a"].some(e=>t.includes(e))||!e.startsWith("/")||e.startsWith("//")||!/^\/[A-Za-z0-9\-._~\/]*$/.test(e))return!1;return!0}catch(e){return!1}})(t)?t:"/"}}else(0,r.toast)(null!==(m=null==u?void 0:null===(o=u.message)||void 0===o?void 0:o.toString())&&void 0!==m?m:d.auth_server_error,{theme:"dark"})}catch(e){return u(e)}}async function x(e){try{var t,l;let a=await (0,s.Z)().post("/clear_password",e);if((null==a?void 0:a.success)&&(null==a?void 0:a.result))return(null==e?void 0:e.otp)||(window.location.href="/users/password/forget"),a;(0,r.toast)(null!==(l=null==a?void 0:null===(t=a.message)||void 0===t?void 0:t.toString())&&void 0!==l?l:d.auth_server_error,{theme:"dark"})}catch(e){return u(e)}}async function h(){try{let e=await (0,s.Z)().post("/signout");(null==e?void 0:e.success)&&((0,n.s$)("user","x-api-key","basket_token","member_token","fb_address","user-agent"),(0,i.YT)(),(0,c.tC)(),window.location.href="/")}catch(e){return u(e)}}},23302:function(e,t,l){l.d(t,{W:function(){return n}});var a=l(26070),s=l(64358);async function n(e){let{catalogName:t,params:l,token:n,sellerId:r,clientHostDockerImage:i,hostDockerImage:o}=e;try{let e=!!Number(null==l?void 0:l.revalidate);l._method="GET";let a=await (0,s.Z)({ignoreToken:!((null==l?void 0:l.id)||(null==l?void 0:l.slug)||(null==l?void 0:l.like)||(null==l?void 0:l.bookmark)||(null==l?void 0:l.mine)||(null==l?void 0:l.notify)),serverSideToken:n,sellerId:r,clientHost:e,clientHostDockerImage:i,hostDockerImage:o}).post(e?"/revalidate?route=".concat(t):"/".concat(t),l,{headers:{"content-type":"multipart/form-data"}});if(a.success&&a.result)return a.result;throw Error(a.message||"Failed to fetch catalog")}catch(e){return e instanceof a.Z&&console.error("Validation error:",e.messages),Promise.reject(e)}}},34211:function(e,t,l){l.d(t,{JX:function(){return m},RR:function(){return u},RZ:function(){return h},TZ:function(){return c},YT:function(){return i},eQ:function(){return d},qj:function(){return x},ug:function(){return o},y4:function(){return v}});var a=l(26070),s=l(64358),n=l(27030);function r(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})}async function i(e,t){try{let l=(0,n.$1)("x-api-key"),a=(0,n.$1)("user-agent"),i=(0,n.$1)("android_app_version","",!1);if((0,n.$1)("android_firebase_token","",!1),(l||t)&&!e)return;let o=new FormData;o.append("app_version",i?i.toString():1),o.append("http_user_agent",null==a?void 0:a.ua),o.append("imei",""),o.append("model",""),o.append("brand",""),o.append("platform",i?"2":"6"),o.append("os",""),o.append("android_id",""),o.append("guid",r()),o.append("_method","POST");let c=await (0,s.Z)().post("/get_token",o);if((0,n.lE)("x-api-key",null==c?void 0:c.token),e)try{window.location.reload()}catch(e){}}catch(e){a.Z}}async function o(e){try{var t;let{revalidate:l}=e||{revalidate:3600},a={},n=!!Number(l);n&&(a.revalidate=l);let r=await (0,s.Z)({ignoreToken:!0,clientHost:n}).post(n?"/revalidate?route=province_city":"/province_city",a,{headers:{"content-type":"multipart/form-data"}});return null==r?void 0:null===(t=r.result)||void 0===t?void 0:t.province}catch(e){a.Z}}async function c(e){let{updateUser:t,params:l}=e;try{var i,o,c;let e=(0,n.$1)("user");if(((0,n.$1)("hello")||e)&&!t)return;let a=await (0,s.Z)().post("/hello",{_method:"GET",...l});return(null==a?void 0:null===(i=a.result)||void 0===i?void 0:i.member_info)&&(0,n.lE)("user",null==a?void 0:null===(c=a.result)||void 0===c?void 0:c.member_info),(0,n.lE)("hello",r()),null==a?void 0:null===(o=a.result)||void 0===o?void 0:o.member_info}catch(e){a.Z}}async function d(e){let{params:t,token:l,hostDockerImage:a}=e;try{let e=await (0,s.Z)({serverSideToken:l,hostDockerImage:a}).post("/invoice",t);return null==e?void 0:e.result}catch(e){return Promise.reject(e)}}async function u(e){try{let t=new FormData;
1"object"==typeof e&&Object.entries(e).forEach(e=>{let[l,a]=e;t.append(l,a)});let l=await (0,s.Z)().post("/utm_add",e);return null==l?void 0:l.result}catch(e){}}async function m(e){let{params:t}=e,l=new FormData;try{"object"==typeof t&&Object.entries(t).forEach(e=>{let[t,a]=e;l.append(t,a)});let e=await (0,s.Z)().post("/fast_buy",l);if((null==e?void 0:e.success)&&(null==e?void 0:e.result))return null==e?void 0:e.result}catch(e){return a.Z,Promise.reject(e)}}async function x(e){let{url:t}=e}async function h(e){let{request_method:t,address:l}=e;try{let e=new FormData;e.append("request_method",t),e.append("address",l);let a=await (0,s.Z)().post("/not_found_page_hit",e);return null==a?void 0:a.result}catch(e){return Promise.reject(e)}}async function v(e){try{let t=new FormData;return"object"==typeof e&&Object.entries(e).forEach(e=>{let[l,a]=e;a&&t.append(l,a)}),await (0,s.Z)({ignoreToken:!0,clientHost:!0}).post("/related",t)}catch(e){return Promise.reject(e)}}}}]);
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.