PageSourceSearch

https://esfahanahan.com/_next/static/chunks/pages/salehalls/[slug]/cards-9a3cac3b3442efcd.js

js esfahanahan.com collected 2026-10-03 23:58:44 UTC 23,167 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5641],{1375:function(e,s,l){(window.__NEXT_P=window.__NEXT_P||[]).push(["/salehalls/[slug]/cards",function(){return l(24034)}])},73013:function(e,s,l){"use strict";l.d(s,{Z:function(){return r}});var t=l(85893),a=l(92718),i=l(35781),n=l(27750);l(67294);var r=e=>{let{title:s,onClose:l,isVisible:r,children:d,onConfirm:o,isMutating:c}=e;return(0,t.jsxs)(i.Z,{name:"confirmModal",title:s,onClose:l,isVisible:r,children:[d,(0,t.jsxs)("div",{className:"flex gap-x-2 justify-end",children:[(0,t.jsx)(a.Z,{className:"md:text-xl text-base",text:"تایید",color:"success",Icon:n.Y,width:80,onClick:o,disabled:null!=c&&c,isLoading:null!=c&&c}),(0,t.jsx)(a.Z,{className:"md:text-xl text-base",text:"انصراف",color:"lightblue",Icon:n.Y,width:80,onClick:l})]})]})}},44250:function(e,s,l){"use strict";var t,a;l.d(s,{C:function(){return t}}),(a=t||(t={}))[a.pending=10]="pending",a[a.bidding=20]="bidding",a[a.done=30]="done",a[a.expired=40]="expired",a[a.rejected=50]="rejected",a[a.failed=60]="failed"},57763:function(e,s,l){"use strict";var t=l(48130);s.Z=e=>{let s=(0,t.ec)();return e.every(e=>{var l,t;return null==s?void 0:null===(t=s.type)||void 0===t?void 0:null===(l=t.abilities)||void 0===l?void 0:l.includes(e)})}},69872:function(e,s,l){"use strict";var t=l(67294);s.Z=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"899px",[s,l]=(0,t.useState)(!1);return(0,t.useEffect)(()=>
1{l(window.matchMedia("(max-width: ".concat(e,"px)")).matches)},[]),s}},24034:function(e,s,l){"use strict";l.r(s),l.d(s,{default:function(){return ed}});var t=l(85893),a=l(25119),i=l(98446),n=l(21414),r=l(92718),d=l(74670),o=l(45347),c=l(46539),u=l(4612),x=l(17722),m=l(90512),h=l(11163),p=l(67294),g=l(13897),f=l(89114),b=l(44130),v=l(64561),j=l(35781),Z=l(712),N=l(35778),_=l(14344),w=l(27750),y=l(87536),C=l(75362),k=l(39303);class S{}S.endpoints={saleHallVendors:"/landings/salehall-vendors/subscribe"},S.subscribeToTheSaleHallVendorsLanding=()=>{let{trigger:e,data:s,error:l,isMutating:t}=(0,C.Z)(S.endpoints.saleHallVendors,(e,s)=>{let{arg:l}=s;return k.Z.post(e,l)});return{trigger:e,data:s,error:l,isMutating:t}};var L=l(28939),I=l(99274),V=e=>{let{isVisible:s,onClose:l}=e,{handleSubmit:a,register:i,setValue:n,formState:{errors:d}}=(0,y.cI)(),{trigger:o,isMutating:c}=S.subscribeToTheSaleHallVendorsLanding(),u=a(async e=>{let s=(0,L.D)(e);try{await o(s),N.Z.getInstance().success("ثبت درخواست با موفقیت انجام شد"),l()}catch(e){N.Z.getInstance().error(e.response.data.message),console.log("error",e)}});return(0,t.jsxs)(j.Z,{name:"collaborationModal",isVisible:s,onClose:l,title:"من تامین کننده ام",children:[(0,t.jsxs)("div",{className:(0,m.Z)("child:text-base","child:text-gulf-blue/90","flex","flex-col","gap-1","my-3"),children:[(0,t.jsx)(_.Z,{weight:"semibold",children:"اگر تولید کننده و یا صاحب بار هستید و تمایل به همکاری با شرکت اصفهان آهن در بخش تامین بارهای تالار را دارید لطفا فیلد های زیر با تکمیل نموده و برای ما ارسال نمایید."}),(0,t.jsx)(_.Z,{weight:"semibold",children:"کارشناسان ما در اسرع وقت با شما تماس خواهند گرفت"})]}),(0,t.jsxs)("form",{onSubmit:u,children:[(0,t.jsxs)("div",{className:"sm:grid gap-4 flex-col flex sm:grid-cols-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(v.Z,{placeholder:"نام و نام خانوادگی",state:d.name&&"error",className:(0,m.Z)("w-full"),...i("name",{required:{value:!0,message:"انتخاب این فیلد الزامی است"},maxLength:{value:30,message:"نام و نام خانوادگی باید حداکثر ۳۰ کاراکتر باشد"},minLength:{value:3,message:"نام و نام خانوادگی باید حداقل ۳ کاراکتر باشد"}})}),d.name&&(0,t.jsx)("span",{className:"text-error text-xl col-start-2 col-span-3 mt-3",children:d.name.message})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(v.Z,{inputMode:"numeric",placeholder:"شماره تماس",state:d.phone&&"error",className:(0,m.Z)("w-full"),...i("phone",{required:{value:!0,message:"انتخاب این فیلد الزامی است"},pattern:{value:/^(\+98|0)?9\d{9}$/,message:"قالب شماره موبایل قابل قبول نیست"},onChange:e=>{n("phone",(0,I.Z)(e.target.value))}})}),d.phone&&(0,t.jsx)("span",{className:"text-error text-xl col-start-2 col-span-3 mt-3",children:d.phone.message})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(Z.Z,{...i("description",{maxLength:{value:500,message:"توضیحات سفارش باید حداکثر 500 کاراکتر باشد"},minLength:{value:10,message:"توضیحات سفارش باید حداقل 10 کارکتر باشد"}}),placeholder:"توضیحات (اختیاری)",rows:3,className:(0,m.Z)("col-span-3 resize-none mt-3",{"!border-error":d.description})}),d.description&&(0,t.jsx)("span",{className:"text-error text-xl col-start-2 col-span-3 mt-3",children:d.description.message})]}),(0,t.jsx)(r.Z,{text:"ثبت",type:"submit",className:"mt-8 mr-auto gap-x-2",Icon:w.Y,disabled:c,isLoading:c})]})]})},O=l(26329);l(4276);var M=l(2261),H=e=>{let{data:s,selectedId:l,onToggle:a,onClear:i}=e;return(0,t.jsxs)("div",{className:"my-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)(_.Z,{weight:"semibold",className:"sm:text-xl text-base text-gulf-blue ",children:"فیلتر بر اساس دسته بندی"}),l>0&&(0,t.jsx)(r.Z,{text:"پاک کردن",size:"small",color:"white",Icon:O.T,className:"sm:hidden block text-base gap-x-2 shrink-0 h-8",iconClassName:"!w-2 !h-2",onClick:i})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(M.tq,{spaceBetween:4,slidesPerView:"auto",className:"!z-0 !m
1-0",children:null==s?void 0:s.map((e,s)=>(0,t.jsx)(M.o5,{onClick:()=>a(e.id),className:(0,m.Z)("!w-max","text-center","mr-2",{"!mr-0":0===s},"hover:bg-cerulean-blue/10","text-gulf-blue/80","rounded-[10px]","border-[1px]","bg-white","text-base","font-bold","transition","duration-100 cursor-pointer",{"!bg-cerulean-blue/10 !border-cerulean-blue !text-cerulean-blue":l===e.id}),children:(0,t.jsx)(_.Z,{className:"py-2 px-4",children:e.name})},e.id))}),l>0&&(0,t.jsx)(r.Z,{text:"پاک کردن",size:"small",color:"white",Icon:O.T,className:"sm:flex hidden text-base gap-x-2 shrink-0",iconClassName:"!w-2 !h-2",onClick:i})]})]})},q=l(73013),E=l(4234),T=l(16268),z=l(77009),D=l(13368),Y=l(12352),F=l(17361),A=l(742),P=l(83279),Q=l(21019),R=e=>{let{isVisible:s,onClose:l,cardId:a,slug:i,revalidate:n}=e,[d,c]=(0,p.useState)([]),u=(0,y.cI)(),{data:x}=A.Z.getState(),{data:h,isLoading:f}=P.Z.showUserCardOnASaleHall(a),{trigger:b,isMutating:v}=g.Z.UpdateCardOfASalehall(i,a),{reset:C,watch:S,control:I,setValue:V,handleSubmit:M,formState:{errors:H}}=u,q=M(async e=>{let s=(0,L.D)(e);try{await b(s),N.Z.getInstance().success("ویرایش درخواست با موفقیت انجام شد"),n(),l()}catch(e){console.log(e),N.Z.getInstance().error("درخواست با مشکل مواجه شد")}}),E=(0,p.useCallback)((e,s)=>{var l,t;let a=e.find(e=>e.id===s);return null!==(t=null==a?void 0:null===(l=a.unit)||void 0===l?void 0:l.name)&&void 0!==t?t:""},[]),T=e=>{let s=[...S("items")];s.splice(e,1),V("items",s);let l=[...d];l.splice(e,1),c(l)};return(0,p.useEffect)(()=>{let e=async()=>{let e=[];await Promise.all(h.data.items.map(async(s,l)=>{let{product_variation_id:t,product_variation:{title:a,product:{slug:n}}}=s.product_variation_unit,{data:r}=await k.Z.get(g.Z.endpoints.saleHallProductVariationUnitList(i,n,t));V("items.".concat(l),{product_variation_unit_id:+s.product_variation_unit_id,quantity:+s.quantity}),r.data.length>0&&e.push({title:a,units:null==r?void 0:r.data,id:+s.id})})),c(e)};if(null==h?void 0:h.data){var s;e(),C({unload_state_id:null==h?void 0:h.data.unload_state_id,user_settle_type:null==h?void 0:h.data.user_settle_type,user_note:null!==(s=null==h?void 0:h.data.user_note)&&void 0!==s?s:""})}},[null==h?void 0:h.data]),(0,t.jsx)(j.Z,{isVisible:s,onClose:l,name:"editCardModal",title:"ویرایش درخواست",children:f?(0,t.jsx)(o.Z,{className:"!h-[238px] !w-full"}):(0,t.jsx)(y.RV,{...u,children:(0,t.jsxs)("form",{onSubmit:q,children:[d.length>0&&d.map((e,s)=>{var l,a;return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mt-2",children:[(0,t.jsx)(_.Z,{weight:"bold",className:"text-xl text-gulf-blue",children:e.title}),d.length>1&&(0,t.jsx)(r.Z,{text:"حذف",Icon:O.T,color:"white",className:"gap-x-4 h-7 text-xl",size:"small",iconClassName:"w-2 h-2",onClick:()=>T(s)})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 border-b border-b-gulf-blue/10 py-2 gap-x-2",children:[(0,t.jsx)(y.Qr,{name:"items.".concat(s,".product_variation_unit_id"),control:I,rules:{required:{value:!0,message:"انتخاب این فیلد الزامی است"}},render:l=>{var a,i,n;let{field:{onChange:r,...d}}=l;return(0,t.jsxs)("div",{className:"self-start",children:[(0,t.jsx)(D.Z,{...d,className:(0,m.Z)({"!border-error":(null==H?void 0:H.items)&&(null==H?void 0:null===(a=H.items[s])||void 0===a?void 0:a.product_variation_unit_id)},"w-full"),placeholder:"انتخاب واحد",onChange:e=>r(e),children:null===(i=e.units)||void 0===i?void 0:i.map(e=>(0,t.jsx)(Y.Z,{label:e.unit.name,value:e.id},e.id))}),(null==H?void 0:H.items)&&(null==H?void 0:null===(n=H.items[s])||void 0===n?void 0:n.product_variation_unit_id)&&(0,t.jsx)("span",{className:"text-error text-xl mt-3",children:null==H?void 0:H.items[s].product_variation_unit_id.message})]})}}),(0,t.jsxs)("div",{className:"flex flex-col gap-y-2",children:[(0,t.jsx)(F.Z,{fieldName:"items.".concat(s,".quantity"),className:"w-full",placeholder:null!==(l=E(e.units,S("items.".concat(s,".product_variation_unit_id"))))&&void 0!==l?l:"تناژ درخواستی",helperText:null!==(a=E(e.units,S("items.".concat(s,".product_variation_unit_id"))))&&void 0!==a?a:""}),(0,t.jsx)("div",{className:"text-sm text-gray-500",children:(0,Q.S)(S("items.".concat(s,".product_variation_unit_id")),S("items.".concat(s,".quantity")),e.units)})]})]})]},e.id)}),(0,t.jsxs)("div",{className:"grid sm:grid-cols-2 grid-cols-1 gap-x-5 sm:gap-y-3 gap-y-5 mt-4 mb-6",children:[(0,t.jsx)(y.Qr,{name:"unload_state_id",control:I,rules:{required:{value:!0,message:"انتخاب این فیلد الزامی است"}},render:e=>{var s,l;
1let{field:{onChange:a,...i}}=e;return(0,t.jsxs)("div",{children:[(0,t.jsx)(D.Z,{...i,className:(0,m.Z)({"!border-error":H.unload_state_id},"w-full"),placeholder:"مقصد بار",onChange:e=>a(e),children:null==x?void 0:null===(l=x.data)||void 0===l?void 0:null===(s=l.data)||void 0===s?void 0:s.map(e=>(0,t.jsx)(Y.Z,{label:e.name,value:e.id},""+e.id))}),H.unload_state_id&&(0,t.jsx)("span",{className:"text-error text-xl mt-3",children:H.unload_state_id.message})]})}}),(0,t.jsx)(y.Qr,{name:"user_settle_type",control:I,rules:{required:{value:!0,message:"انتخاب این فیلد الزامی است"}},render:e=>{let{field:{onChange:s,...l}}=e;return(0,t.jsxs)("div",{children:[(0,t.jsxs)(D.Z,{...l,className:(0,m.Z)({"!border-error":H.user_settle_type},"w-full"),placeholder:"نحوه تسویه",onChange:e=>s(e),children:[(0,t.jsx)(Y.Z,{label:"نقدی",value:1}),(0,t.jsx)(Y.Z,{label:"اعتباری",value:2,disabled:!0})]}),H.user_settle_type&&(0,t.jsx)("span",{className:"text-error text-xl mt-3",children:H.user_settle_type.message})]})}})]}),(0,t.jsx)(y.Qr,{name:"user_note",rules:{maxLength:{value:191,message:"توضیحات سفارش باید حداکثر ۱۹۱ کاراکتر باشد"}},control:I,render:e=>{let{field:s}=e;return(0,t.jsxs)("div",{children:[(0,t.jsx)(Z.Z,{...s,placeholder:"توضیحات ( اختیاری )",className:(0,m.Z)("h-full resize-none",{"!border-error":H.user_note,"!h-fit":Object.keys(H).length>0})}),H.user_note&&(0,t.jsx)("span",{className:"text-error text-xl mt-3",children:H.user_note.message})]})}}),(0,t.jsx)(r.Z,{className:"w-[135px] mt-11 mr-auto",text:"ثبت درخواست",Icon:w.Y,size:"small",type:"submit",isLoading:v,disabled:v})]})})})},U=l(57763),B=l(9481),K=l(91105),X=l(44250),$=e=>{var s,l,a,i;let{slug:n,card:r,onEdit:d,onDelete:o}=e,c=(0,h.useRouter)(),u=(0,U.Z)(["salehalls.cards.update"]),x=(0,U.Z)(["salehalls.cards.delete"]);return(0,t.jsx)("div",{className:(0,m.Z)("border rounded-[10px] border-gulf-blue/20",{"shadow-[0px_2px_6px_#00A65170]":r.misc.is_mine&&r.status.value!==X.C.pending}),children:(0,t.jsxs)("div",{className:" h-full flex flex-col ",children:[r.status.value===X.C.pending&&(0,t.jsxs)("div",{className:"bg-yellow/20 rounded-t-[10px] sm:px-4 px-2 text-xl py-1 text-gulf-blue flex items-center justify-between",children:[(0,t.jsx)(_.Z,{children:"در انتظار تایید"}),(0,t.jsxs)("div",{className:"flex items-center gap-x-2",children:[u&&(0,t.jsx)(K.d,{onClick:()=>d(r.id),className:"w-4 h-4  cursor-pointer"}),x&&(0,t.jsx)(B.p,{onClick:()=>o(r.id),className:"w-4 h-4 text-error cursor-pointer"})]})]}),(0,t.jsx)("div",{className:(0,m.Z)("text-right bg-cerulean-blue  px-1.5 py-2.5  text-white flex",{"rounded-t-[10px]":r.status.value!==X.C.pending}),children:(0,t.jsxs)(_.Z,{className:"text-base",children:["درخواست مشتری: #",r.id]})}),(0,t.jsxs)("div",{className:"flex flex-col relative overflow-hidden grow",children:[r.status.value===X.C.done&&(0,t.jsx)(_.Z,{weight:"semibold",className:"absolute -left-6 top-[13px] bg-success px-5 py-1 text-white  text-base -rotate-45",children:"فروخته شد"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 text-base sm:px-4 px-2 border-b py-2 items-center border-gulf-blue/10",children:[(0,t.jsx)(_.Z,{weight:"bold",className:"text-gulf-blue",children:"مشخصات کالا"}),(0,t.jsx)(_.Z,{className:"text-gulf-blue/80",children:null!==(s=r.size_info)&&void 0!==s?s:"-"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 text-base sm:px-4 px-2 border-b py-2 items-center border-gulf-blue/10",children:[(0,t.jsx)(_.Z,{weight:"bold",className:"text-gulf-blue",children:"تناژ"}),(0,t.jsx)(_.Z,{className:"text-gulf-blue/80",children:null!==(l=r.quantity_info)&&void 0!==l?l:"-"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 text-base sm:px-4 px-2 border-b py-2 items-center border-gulf-blue/10",children:[(0,t.jsx)(_.Z,{weight:"bold",className:"text-gulf-blue",children:"نحوه تسویه"}),(0,t.jsx)(_.Z,{className:"text-gulf-blue/80",children:null!==(a=r.settle_info)&&void 0!==a?a:"-"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 text-base sm:px-4 px-2 py-2 items-center border-gulf-blue/10",children:[(0,t.jsx)(_.Z,{weight:"bold",className:"text-gulf-blue",children:"مقصد بار"}),(0,t.jsx)(_.Z,{className:"text-gulf-blue/80",children:null!==(i=r.unload_state.name)&&void 0!==i?i:"-"})]})]}),(0,t.jsxs)("div",{onClick:()=>c.push("/salehalls/".concat(n,"/cards/").concat(r.id,"/bids")),className:"bg-cerulean-blue/20 rounded-b-[10px] py-1 text-gulf-blue flex items-center justify-center sm:gap-x-3 gap-x-1.5 cursor-pointer",children:[(0,t.jsx)(_.Z,{className:"text-base",children:"مشاهده قیمت‌های پیشنهادی"}),(0,t.jsx)(w.Y,{className:" w-[8px] h-[8px]"})]})]})})},G=e=>{let{slug:s,filterQueryParam:l}=e,{data:a,isLoading:i,error:n}=g.Z.getSaleHallCardList(s,l),[r,d]=(0,p.useState)({from:void 0,to:void 0}),[c,u]=(0,p.useState)(!1),[x,m]=(0,p.useState)(!1),[h,f]=(0,p.useState)(null),{trigger:b,isMutating:v}=g.Z.RemoveCardOfASalehall(s,h),j=!r.to||!r.from||r.to-r.from+1<(null==a?void 0:a.meta.per_page),{ref:Z,scrollLoadingData:w,items:y}=(0,E.M)({getKey:e=>j?null:g.Z.endpoints.saleHallCard(s,"".concat(e+2),l),isReachingEnd:j}
1),C=(0,p.useMemo)(()=>[...(null==a?void 0:a.data)||[],...y],[a,y]);(0,p.useEffect)(()=>{(null==a?void 0:a.meta)&&d({from:a.meta.from,to:a.meta.to})},[null==a?void 0:a.meta]),(0,p.useEffect)(()=>{var e,s;w&&w.length>0&&d({from:null===(e=w[w.length-1])||void 0===e?void 0:e.meta.from,to:null===(s=w[w.length-1])||void 0===s?void 0:s.meta.to})},[w]);let k=e=>{m(!0),f(e)},S=e=>{u(!0),f(e)};return n?(0,t.jsx)(_.Z,{children:"موردی یافت نشد"}):(0,t.jsxs)(t.Fragment,{children:[i?(0,t.jsx)(o.Z,{className:"!h-[400px] !rounded-[10px]"}):(0,t.jsx)(t.Fragment,{children:(0,t.jsx)("div",{className:"flex flex-col gap-y-6 sm:grid sm:grid-cols-2 md:grid-cols-3 gap-x-3 md:gap-x-4",children:C.map(e=>(0,t.jsx)($,{slug:s,card:e,onEdit:k,onDelete:S},e.id))})}),(0,t.jsx)("div",{ref:Z,children:!i&&!j&&(0,t.jsxs)("div",{className:"mt-6 flex items-center justify-center",children:[(0,t.jsx)(_.Z,{className:"text-gulf-blue/70",children:"لطفا منتظر بمانید..."}),(0,t.jsx)(T.default,{})]})}),x&&h&&(0,t.jsx)(R,{slug:s,cardId:h,isVisible:x,onClose:()=>{m(!1),f(null)},revalidate:()=>(0,z.j)(g.Z.endpoints.saleHallCard(s,void 0,l))}),c&&(0,t.jsx)(q.Z,{title:"حذف درخواست",onClose:()=>{u(!1),f(null)},isVisible:c,onConfirm:async()=>{try{await b(),N.Z.getInstance().success("حذف درخواست با موفقیت انجام شد"),(0,z.j)(g.Z.endpoints.saleHallCard(s,void 0,l)),u(!1)}catch(e){console.log("error",e),N.Z.getInstance().error("خطا")}},isMutating:v,children:(0,t.jsx)(_.Z,{className:"text-gulf-blue",weight:"semibold",children:"آیا می خواهید این درخواست را حذف کنید؟"})})]})},J=l(69872),W=l(27484),ee=l.n(W),es=l(8593),el=l(78949),et=e=>{let{vendor:s}=e;return(0,t.jsxs)("div",{className:(0,m.Z)("flex","flex-col","md:flex-row","items-center","group","gap-x-5","border","py-1","mb-3","bg-white","px-2","border-gulf-blue/10","rounded-xl","sm:justify-normal","justify-center",{"!bg-gulf-blue/5":s.isOffline}),children:[(0,t.jsx)("div",{className:(0,m.Z)({"rounded-full p-[2px] bg-gradient-to-tr from-red-500 via-yellow to-pink-500":s.amAVendor&&!s.isOffline}),children:(0,t.jsxs)("div",{className:(0,m.Z)("sm:p-3.5 p-2 rounded-full bg-gulf-blue/10 relative",{"bg-white":s.amAVendor&&!s.isOffline}),children:[(0,t.jsx)(el.t,{className:(0,m.Z)("text-gulf-blue/70",{"!text-gulf-blue/20":s.isOffline})}),(0,t.jsx)("div",{className:(0,m.Z)("sm:w-2.5 sm:h-2.5 w-2 h-2 bg-success rounded-full absolute left-0",{"!bg-[#BDC0C5]":s.isOffline})})]})}),(0,t.jsx)(_.Z,{className:(0,m.Z)("text-cerulean-blue block lg:text-xl text-sm mt-1 text-center",{"text-slate-400":s.isOffline}),weight:"semibold",children:s.display_name})]})};ee().extend(es.Z);var ea=e=>{let{slug:s}=e,{data:l,isLoading:a,error:i}=g.Z.getSaleHallVendorList(s),[n,r]=(0,p.useState)(1),[d,c]=(0,p.useState)(null);(0,J.Z)("599");let u=n===(null==l?void 0:l.meta.last_page),{ref:x,scrollLoadingData:m,items:h}=(0,E.M)({getKey:e=>u?null:g.Z.endpoints.saleHallVendorList(s,"".concat(e+2)),isReachingEnd:u}),f=(0,p.useMemo)(()=>[...(null==l?void 0:l.data)||[],...h],[l,h]);(0,p.useEffect)(()=>{var e;m&&m.length>0&&r(null===(e=m[m.length-1])||void 0===e?void 0:e.meta.current_page)},[m]);let b=new Date,v=null==f?void 0:f.map(e=>{var s;let{display_name:t,last_activity_at:a,id:i}=e,n={id:i,display_name:t,isOffline:!1,amAVendor:(null==l?void 0:null===(s=l.misc.my_vendor)||void 0===s?void 0:s.id)===i};return a?ee()(b).diff(ee()(a),"s")>120&&(n.isOffline=!0):n.isOffline=!0,n});return i?(0,t.jsx)(_.Z,{children:"موردی یافت نشد"}):(0,t.jsxs)(t.Fragment,{children:[a?(0,t.jsx)(o.Z,{className:"!rounded-[10px]"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(_.Z,{className:"text-gulf-blue mb-4 border-b border-gulf-blue/10 pb-3 md:text-2xl sm:text-xl text-xs text-center",weight:"bold",children:["تامین کنندگان ",null==l?void 0:l.meta.total," نفر"]}),null==v?void 0:v.map((e,s)=>(0,t.jsx)(et,{vendor:e},e.id))]}),(0,t.jsx)("div",{ref:x,children:!a&&!u&&(0,t.jsx)("div",{className:"flex items-center justify-center",children:(0,t.jsx)(T.default,{})})})]})};let ei=[{desktop:"https://cdn.esfahanahan.com/public/assets/images/welcome-salehalls-desk.png",mobile:"https://cdn.esfahanahan.com/public/assets/images/welcome-salehalls-mob.png",alt:"welcome-salehalls"},{desktop:"https://cdn.esfahanahan.com/public/assets/images/salehalls-discount-desk.png",mobile:"https://cdn.esfahanahan.com/public/assets/images/salehalls-discount-mob.png",alt:"salehalls-discount"},{desktop:"https://cdn.esfahanahan.com/public/assets/images/s-h-1-desk.png",mobile:"https://cdn.esfahanahan.com/public/assets/images/s-h-1-mob.png",alt:"salehalls-discount"},{desktop:"https://cdn.esfahanahan.com/public/assets/images/s-h-2-desk.png",mobile:"https://cdn.esfahanahan.com/public/assets/images/s-h-2-mob.png",alt:"salehalls-discount"}];var en=()=>{var e,s;let l=(0,h.useRouter)(),{slug:a,...i}=l.query,v=null!==(e=i["filter[category][id][0]"])&&void 0!==e?e:0,[j,Z]=(0,p.useState)(+v),[N,_]=(0,p.useState)(!1),{data:w,isLoading:y}=g.Z.getSaleHallCategoryList(a);return(0,p.useEffect)(()=>
1{if(j){let e={"filter[category][id][0]":j.toString()},s=(0,f.N)(e);l.push("/salehalls/".concat(a,"/cards/?").concat(s))}else l.push("/salehalls/".concat(a,"/cards/"))},[j]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b.Z,{banners:ei}),(0,t.jsx)(c.Z,{title:"تالار خرید",landingLink:"https://esfahanahan.com/landings/hall/",subscriptionLink:"/salehalls/general/cards/"}),(0,t.jsxs)("div",{className:"flex sm:items-center sm:justify-between sm:flex-row flex-col gap-y-3",children:[(0,t.jsx)(d.Z,{title:"تالار خرید",subscriptionLink:"/salehalls/general/cards/",landingLink:"https://esfahanahan.com/landings/hall/"}),(0,t.jsxs)("div",{className:"flex justify-between items-center gap-x-5 mt-3",children:[(0,t.jsx)(u.Z,{format:"dddd DD MMMM YYYY",time:new Date}),(0,t.jsx)(r.Z,{Icon:x.p,text:"ثبت درخواست",onClick:()=>l.push("/salehalls/".concat(a,"/cards/create")),className:"sm:gap-x-8 gap-x-4 text-xl sm:text-2xl",size:"small",color:"success"})]})]}),y?(0,t.jsx)(o.Z,{className:"!h-[70px] !rounded-[10px] my-3"}):(null==w?void 0:w.misc.cards_categories.length)>0?(0,t.jsx)(H,{data:null!==(s=null==w?void 0:w.misc.cards_categories)&&void 0!==s?s:[],selectedId:j,onToggle:e=>{Z(s=>s===e?0:e)},onClear:()=>{Z(0)}}):(0,t.jsx)(t.Fragment,{}),(0,t.jsx)("div",{className:"grid sm:grid-cols-4 grid-cols-4 pt-4 sm:gap-x-8 gap-x-3",children:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:(0,m.Z)("flex","flex-col","gap-y-6","pretty-scroll","hide-scrollbar-mobile","sticky","top-0","left-0"),children:[(0,t.jsx)(n.Z,{className:"sm:pt-5 sm:pb-2 sm:px-4 px-2 py-1 pt-3sm:h-[400px] h-[450px] overflow-y-auto",children:(0,t.jsx)(ea,{slug:a})}),(0,t.jsx)(r.Z,{text:"من تامین کننده ام",size:"small",className:"text-[10px] sm:text-xl md:text-2xl w-fit flex md:gap-3",Icon:x.p,onClick:()=>_(!0)})]}),(0,t.jsx)(n.Z,{className:"sm:py-5 sm:px-5 px-3 py-3 sm:col-span-3 col-span-3",children:(0,t.jsx)(G,{slug:a,filterQueryParam:(0,f.N)(i)})})]})}),N&&(0,t.jsx)(V,{isVisible:N,onClose:()=>_(!1)})]})};let er=()=>(0,t.jsx)(i.Z,{children:(0,t.jsx)(en,{})});er.getLayout=e=>(0,t.jsx)(a.Z,{wrapperClassName:"bg-[#f6f8f9] pt-14",showFooter:!1,children:e});var ed=er}},function(e){e.O(0,[1664,2950,7536,2446,4576,885,2416,550,4691,7079,3028,7229,3490,2888,9774,179],function(){return e(e.s=1375)}),_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.