2 lines
20 KiB
JavaScript
2 lines
20 KiB
JavaScript
import{j as u,B,aj as z,ak as gu,al as $,am as J,T as v,ay as eu,az as ru,aA as w,a_ as Fu,at as vu,bl as bu,aX as Eu,cw as G,ah as N,i as Lu,ap as Su,an as O,ac as Iu,ao as m,cr as Tu,aL as Du}from"./mui-vendor-D_SVL-Dx.js";import{jW as su,a3 as Mu,G as t,gv as Bu,S as l,X as nu,jX as U,W as R,L as Y,a5 as Pu,h as W,u as tu,c as ou,b as lu,jY as au,jZ as cu,j_ as iu,j$ as du,k0 as Cu,r as Ru,j as ku,A as wu,k1 as V,v as H,a0 as K,k2 as Au,k3 as pu,a4 as Nu}from"./index-D80MdVQn.js";import{r as h,u as qu}from"./react-vendor-CmFgShSM.js";import{u as _,f as P,a as Wu}from"./redux-vendor-CfkcHgWN.js";import{A as yu}from"./AdvancedTable-DF_gMS-x.js";import{T as hu}from"./Timer-DH9WN_K5.js";import{c as _u,a as Yu}from"./city-get-city-Cof5ivkn.js";import"./index-Eu1ghc4Y.js";import"./Close-J1gH5PMD.js";import"./Search-TgPAjvS8.js";import"./Delete-CIwpNviU.js";const Gu=()=>{const[e,y]=h.useState([]),p=_(),n=qu(),{auctionSlaughterRequestsData:a}=P(r=>r.auctionSlice);return h.useEffect(()=>{p(su())},[]),h.useEffect(()=>{if(!a||!Array.isArray(a)){y([]);return}y(a.map(r=>{var A,j,g,S,E,L,c,s,C,T,i,f,M,d,o,b,D,I,F,q,k,X;const x=(r==null?void 0:r.state)==="accepted"?"برنده شده اید!":(r==null?void 0:r.state)==="pending"?"در حال انجام مزایده":"درخواست شما پذیرفته نشد.";return[((A=r==null?void 0:r.poultryRequest)==null?void 0:A.id)||"",((j=r==null?void 0:r.poultryRequest)==null?void 0:j.orderCode)||"",((r==null?void 0:r.fee)||0)+" ﷼",(((g=r==null?void 0:r.poultryRequest)==null?void 0:g.quantity)||0)+" قطعه",((E=(S=r==null?void 0:r.poultryRequest)==null?void 0:S.hatching)==null?void 0:E.date)||"",(((L=r==null?void 0:r.poultryRequest)==null?void 0:L.chickenBreed)||"")+((c=r==null?void 0:r.poultryRequest)!=null&&c.chickenBreed&&((T=(C=(s=r==null?void 0:r.poultryRequest)==null?void 0:s.process)==null?void 0:C.poultry)!=null&&T.age)?" - ":"")+(((M=(f=(i=r==null?void 0:r.poultryRequest)==null?void 0:i.process)==null?void 0:f.poultry)==null?void 0:M.age)||""),(((d=r==null?void 0:r.poultryRequest)==null?void 0:d.IndexWeight)||0)+" کیلوگرم",((I=(D=(b=(o=r==null?void 0:r.poultryRequest)==null?void 0:o.poultry)==null?void 0:b.address)==null?void 0:D.province)==null?void 0:I.name)||"",((X=(k=(q=(F=r==null?void 0:r.poultryRequest)==null?void 0:F.poultry)==null?void 0:q.address)==null?void 0:k.city)==null?void 0:X.name)||"",r!=null&&r.date?Mu(r.date):"",x==="برنده شده اید!"?u.jsxs(t,{container:!0,alignItems:"center",justifyContent:"center",children:[x,u.jsx(B,{onClick:()=>{var Z;n(Bu+(((Z=r==null?void 0:r.poultryRequest)==null?void 0:Z.id)||""))},children:"ادامه خرید"})]}):x]}))},[a]),u.jsx(u.Fragment,{children:a&&Array.isArray(a)&&a.length>0&&u.jsx(t,{container:!0,gap:l.SMALL,p:l.SMALL,width:"100%",children:u.jsx(yu,{name:"مزایده های شما",columns:["شماره مزایده","کدسفارش","قیمت پیشنهادی شما","تعداد","تاریخ جوجه ریزی","نژاد و سن به روز","وزن","استان","شهرستان","تاریخ ثبت پیشنهاد","وضعیت"],data:e})})})},Hu=()=>{const e=_(),y=48,p=8,{auctions:n}=P(c=>c.auctionSlice||{}),[a,r]=h.useState([]),[x,A]=h.useState([]),[j,g]=h.useState("all"),S=c=>{g(c.target.value)},E=c=>{const{target:{value:s}}=c;r(typeof s=="string"?s.split(","):s)},L={PaperProps:{style:{maxHeight:y*4.5+p,width:250}}};return h.useEffect(()=>{if(n&&Array.isArray(n)){const c=n.filter(s=>s==null?void 0:s.sendDate).map(s=>{try{return nu(new Date(s.sendDate),"yyyy/MM/dd")}catch(C){return console.error("Error formatting date:",C),null}}).filter(s=>s!==null);A(c)}else A([])},[n]),u.jsx(t,{container:!0,p:l.MEDIUM,gap:l.SMALL,direction:"column",flex:"1",height:"100%",justifyContent:"space-between",children:u.jsxs(t,{container:!0,direction:"column",gap:l.SMALL,children:[u.jsx(t,{children:u.jsx(z,{children:u.jsxs(gu,{"aria-labelledby":"demo-controlled-radio-buttons-group",name:"controlled-radio-buttons-group",value:j,onChange:S,children:[u.jsx($,{value:"all",control:u.jsx(J,{}),label:"بدون فیلتر"}),u.jsx($,{value:"filter",control:u.jsx(J,{}),label:"انتخاب تاریخ"})]})})}),j==="filter"&&u.jsxs(u.Fragment,{children:[u.jsx(t,{children:u.jsx(v,{variant:"body2",children:"تاریخ هایی که مایل به رویت مناقصات آنها هستید را انتخاب کنید."})}),u.jsx(t,{children:u.jsxs(z,{sx:{width:"100%"},children:[u.jsx(eu,{id:"demo-multiple-checkbox-label",children:"تاریخ های انتخاب شده"}),u.jsx(ru,{multiple:!0,labelId:"demo-multiple-checkbox-label",id:"demo-multiple-checkbox",value:a,onChange:E,input:u.jsx(bu,{label:"تاریخ های انتخاب شده"}),renderValue:c=>Array.isArray(c)?c.join(", "):"",MenuProps:L,children:x.map((c,s)=>u.jsxs(w,{value:c||"",children:[u.jsx(Fu,{checked:Array.isArray(a)&&a.indexOf(c)>-1}),u.jsx(vu,{primary:c||""})]},(c||"")+s))})]})})]}),u.jsx(t,{children:u.jsx(B,{fullWidth:!0,variant:"contained",onClick:()=>{e(j==="all"?U(null):U(Array.isArray(a)?a:[])),e(R({right:!1,bottom:!1,content:null}))},children:"ثبت اطلاعات"})})]})})},fu=({minQuantity:e=0,maxQuantity:y=1e3})=>{const p=_(),{avicultureChickenPrice:n}=P(i=>i.avicultureSlice);h.useEffect(()=>{p(Y()),p(Pu()),p(W())},[]);const a=tu({initialValues:{age:"",race:"همه"},validationSchema:ou({age:lu().typeError("لطفا سن مرغ را وارد کنید.")})}),[r,x]=h.useState([e||0,y||1e3]),[A,j]=h.useState([1,5]),[g,S]=h.useState([30,70]),[E,L]=h.useState([(n==null?void 0:n.floorPrice)||0,(n==null?void 0:n.ceilingPrice)||1e5]);h.useEffect(()=>{n!=null&&n.floorPrice&&(n!=null&&n.ceilingPrice)&&L([n.floorPrice,n.ceilingPrice])},[n]);const c=(i,f)=>{x(f)},s=(i,f)=>{j(f)},C=(i,f)=>{S(f)},T=(i,f)=>{L(f)};return u.jsxs(t,{container:!0,p:l.MEDIUM,direction:"column",flex:"1",justifyContent:"space-between",gap:l.SMALL,children:[u.jsxs(t,{container:!0,direction:"column",gap:l.SMALL,children:[u.jsx(t,{children:u.jsxs(z,{fullWidth:!0,children:[u.jsx(eu,{id:"demo-simple-select-label",children:"نژاد مرغ"}),u.jsxs(ru,{labelId:"demo-simple-select-label",id:"race",label:"نژاد مرغ",value:a.values.race,error:a.touched.race?!!a.errors.race:null,onChange:i=>{a.setFieldValue("race",i.target.value)},onBlur:a.handleBlur,children:[u.jsx(w,{value:"همه",children:"همه"}),u.jsx(w,{value:"آرین",children:"آرین"}),u.jsx(w,{value:"راس",children:"راس"}),u.jsx(w,{value:"آربراکرز (آپلاس)",children:"آربراکرز (آپلاس)"}),u.jsx(w,{value:"کاب",children:"کاب"}),u.jsx(w,{value:"هوبارد",children:"هوبارد"})]}),u.jsx(Eu,{children:a.touched.race&&a.errors.race?a.errors.race:null})]})}),r&&Array.isArray(r)&&r[0]!==void 0&&r[0]!==1/0&&e!==void 0&&y!==void 0?u.jsxs(t,{display:"flex",gap:l.SMALL,children:["تعداد:",u.jsx(G,{size:"small",getAriaLabel:()=>"تعداد",value:r,min:e||0,max:y||1e3,step:100,onChange:c,valueLabelDisplay:"auto"})]}):"",u.jsxs(t,{display:"flex",gap:l.SMALL,children:["سن:",u.jsx(G,{size:"small",value:g,min:30,max:70,onChange:C,valueLabelDisplay:"auto"})]}),u.jsxs(t,{display:"flex",gap:l.SMALL,children:["وزن:",u.jsx(G,{size:"small",getAriaLabel:()=>"Temperature range",value:A,min:1,max:5,onChange:s,valueLabelDisplay:"auto"})]}),u.jsxs(t,{display:"flex",gap:l.SMALL,children:["قیمت:",u.jsx(G,{size:"small",getAriaLabel:()=>"سقف و کف قیمت امروز",value:E,step:5e3,min:(n==null?void 0:n.floorPrice)||0,max:(n==null?void 0:n.ceilingPrice)||1e5,onChange:T,valueLabelDisplay:"auto"})]})]}),u.jsx(t,{children:u.jsx(B,{fullWidth:!0,variant:"contained",onClick:()=>{p(au(r)),p(cu(g)),p(iu(a.values.race==="همه"?"":a.values.race)),p(du(A)),p(Cu(E)),p(R({right:!1,bottom:!1,content:null}))},children:"ثبت اطلاعات"})})]})};fu.propTypes={minQuantity:N.PropTypes.number,maxQuantity:N.PropTypes.number};var Q={},zu=Lu;Object.defineProperty(Q,"__esModule",{value:!0});var xu=Q.default=void 0,Ou=zu(Ru()),Uu=u;xu=Q.default=(0,Ou.default)((0,Uu.jsx)("path",{d:"m5.2494 8.0688 2.83-2.8269 14.1343 14.15-2.83 2.8269zm4.2363-4.2415 2.828-2.8289 5.6577 5.656-2.828 2.8289zM.9989 12.3147l2.8284-2.8285 5.6569 5.6569-2.8285 2.8284zM1 21h12v2H1z"}),"Gavel");const Vu=Wu("AuctionOfferPrice",async e=>{const{data:y,status:p}=await ku.post("kill_house_Request_auction/",e);return{data:y,status:p}}),ju=({data:e,floorPrice:y,ceilingPrice:p,highestBidedPrice:n,auctionRemainedSeconds:a})=>{var j,g,S,E,L,c,s,C,T,i,f,M;const r=_(),[x]=h.useContext(wu),A=tu({initialValues:{offer:""},validationSchema:ou({offer:lu().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!")})});return u.jsx(t,{container:!0,gap:l.TINY,direction:"column",flex:"1",height:"100%",justifyContent:"space-between",children:u.jsxs(t,{container:!0,direction:"column",gap:l.TINY,children:[u.jsxs(t,{display:"flex",children:[u.jsx(v,{variant:"body2",mr:l.TINY,color:d=>d.palette.grey.A700,children:"مانده تا پایان مناقصه :"}),u.jsx(hu,{seconds:a},"auctiontimer")]}),u.jsxs(t,{display:"flex",children:[u.jsx(v,{variant:"body2",mr:l.TINY,color:d=>d.palette.grey.A700,children:"استان :"}),u.jsx(v,{variant:"body2",children:((S=(g=(j=e==null?void 0:e.poultry)==null?void 0:j.address)==null?void 0:g.province)==null?void 0:S.name)||""})]}),u.jsxs(t,{display:"flex",children:[u.jsx(v,{variant:"body2",mr:l.TINY,color:d=>d.palette.grey.A700,children:"شهر :"}),u.jsx(v,{variant:"body2",children:((c=(L=(E=e==null?void 0:e.poultry)==null?void 0:E.address)==null?void 0:L.city)==null?void 0:c.name)||""})]}),u.jsxs(t,{display:"flex",children:[u.jsx(v,{variant:"body2",mr:l.TINY,color:d=>d.palette.grey.A700,children:"مرغدار :"}),u.jsx(v,{variant:"body2",children:((C=(s=e==null?void 0:e.poultry)==null?void 0:s.userprofile)==null?void 0:C.fullName)||""})]}),u.jsxs(t,{display:"flex",children:[u.jsx(v,{variant:"body2",mr:l.TINY,color:d=>d.palette.grey.A700,children:"محل پرورش :"}),u.jsx(v,{variant:"body2",children:((i=(T=e==null?void 0:e.poultry)==null?void 0:T.address)==null?void 0:i.address)||""})]}),u.jsxs(t,{display:"flex",children:[u.jsx(v,{variant:"body2",mr:l.TINY,color:d=>d.palette.grey.A700,children:"نژاد :"}),u.jsx(v,{variant:"body2",children:(e==null?void 0:e.chickenBreed)||""})]}),u.jsxs(t,{display:"flex",children:[u.jsx(v,{variant:"body2",mr:l.TINY,color:d=>d.palette.grey.A700,children:"تعداد :"}),u.jsx(v,{variant:"body2",mr:l.TINY,children:(e==null?void 0:e.quantity)||0}),"قطعه"]}),u.jsxs(t,{display:"flex",children:[u.jsx(v,{variant:"body2",mr:l.TINY,color:d=>d.palette.grey.A700,children:"سن :"}),u.jsxs(v,{variant:"body2",children:[((M=(f=e==null?void 0:e.process)==null?void 0:f.poultry)==null?void 0:M.age)||0," روز"]})]}),u.jsxs(t,{display:"flex",children:[u.jsx(v,{variant:"body2",mr:l.TINY,color:d=>d.palette.grey.A700,children:"وزن :"}),u.jsxs(v,{variant:"body2",children:[(e==null?void 0:e.IndexWeight)||0," کیلوگرم"]})]}),u.jsx(Su,{}),u.jsxs(t,{container:!0,gap:l.SMALL,direction:"column",flex:"1",height:"100%",justifyContent:"space-between",children:[u.jsxs(t,{display:"flex",children:[u.jsx(v,{variant:"body1",mr:l.TINY,color:d=>d.palette.grey.A700,children:"قیمت پایه :"}),u.jsx(v,{mr:l.TINY,fontWeight:"bold",children:y||0}),"ریال"]}),u.jsxs(t,{display:"flex",children:[u.jsx(v,{variant:"body1",mr:l.TINY,color:d=>d.palette.grey.A700,children:"بالاترین قیمت پیشنهادی :"}),u.jsx(v,{mr:l.TINY,fontWeight:"bold",children:n||"پیشنهادی وجود ندارد!"}),n==="پیشنهادی وجود ندارد!"||!n?"":"ریال"]})]}),u.jsx(t,{mt:l.SMALL,children:u.jsx(O,{id:"offer",label:"قیمت پیشنهادی",InputProps:{endAdornment:u.jsx(Iu,{position:"end",children:"ریال"})},variant:"outlined",sx:{width:"100%"},value:A.values.offer,error:A.touched.offer?!!A.errors.offer:null,onChange:A.handleChange,onBlur:A.handleBlur,helperText:A.touched.offer&&A.errors.offer?A.errors.offer:null})}),u.jsx(t,{mt:l.SMALL,children:u.jsx(B,{disabled:!A.isValid,fullWidth:!0,variant:"contained",onClick:()=>{r(Y());const d=Number(A.values.offer)||0,o=Number(y)||0,b=Number(p)||0,D=n==="پیشنهادی وجود ندارد!"||!n?0:Number(n)||0;(n==="پیشنهادی وجود ندارد!"||!n||d-D>=1e3&&d>o&&d<=b)&&(e!=null&&e.key)?r(Vu({key:e.key,fee:d})).then(I=>{I!=null&&I.error?x({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(r(V()),r(su()),r(R({right:!1,bottom:!1,content:null})),x({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))}).catch(I=>{console.error("Error submitting offer:",I),x({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"})}).finally(()=>{r(W())}):(x({vertical:"top",horizontal:"center",msg:"قیمت پیشنهادی باید از بیشترین قیمت پیشنهاد شده بیشتر باشد و از حداکثر قیمت روز کمتر باشد.",severity:"error"}),r(W()))},children:"ثبت اطلاعات"})})]})})};ju.propTypes={data:N.PropTypes.any,floorPrice:N.PropTypes.string,ceilingPrice:N.PropTypes.string,highestBidedPrice:N.PropTypes.string,auctionRemainedSeconds:N.PropTypes.string};function uu(e,y,p){var j,g,S,E,L,c,s,C,T,i,f,M,d;const n=H(new Date((g=(j=e==null?void 0:e.process)==null?void 0:j.auctionsList[0])==null?void 0:g.date)),a=H(),r=n.diff(a),x=H.duration(r).asSeconds(),A=(S=e.process)!=null&&S.killHouseAuctionsList?(L=e==null?void 0:e.process)==null?void 0:L.killHouseAuctionsList[((E=e==null?void 0:e.process)==null?void 0:E.killHouseAuctionsList.length)-1].fee:"پیشنهادی وجود ندارد!";return[e.id,e.orderCode,(s=(c=e==null?void 0:e.process)==null?void 0:c.auctionsList[0])==null?void 0:s.floorPrice,(T=(C=e==null?void 0:e.process)==null?void 0:C.auctionsList[0])==null?void 0:T.ceilingPrice,A,e.quantity,e.sendDate,e.chickenBreed+" - "+((f=(i=e==null?void 0:e.process)==null?void 0:i.poultry)==null?void 0:f.age),e.IndexWeight,(M=e==null?void 0:e.process)==null?void 0:M.city.cityOperatorProvince,(d=e==null?void 0:e.process)==null?void 0:d.city.cityOperatorCity,u.jsx(hu,{seconds:x},"auctiontimer"+y),K()==="KillHouse"&&u.jsx(B,{variant:"outlined",startIcon:u.jsx(xu,{}),onClick:()=>{var o,b,D,I;p(R({right:!0,size:500,title:"ثبت قیمت در مزایده",content:u.jsx(ju,{data:e,floorPrice:(b=(o=e==null?void 0:e.process)==null?void 0:o.auctionsList[0])==null?void 0:b.floorPrice,ceilingPrice:(I=(D=e==null?void 0:e.process)==null?void 0:D.auctionsList[0])==null?void 0:I.ceilingPrice,highestBidedPrice:A,auctionRemainedSeconds:x})}))},children:"ثبت قیمت"},"auctionbidsumbmit"+y)]}const Ku=()=>{const[e,y]=h.useState(),[p,n]=h.useState(),[a,r]=h.useState(),[x,A]=h.useState(),[j,g]=h.useState(),[,S]=h.useState(),[E,L]=h.useState(!0),c=_();return h.useEffect(()=>{var s;c(Y()),(s=c(_u()))==null||s.then(C=>{var T;(T=C==null?void 0:C.payload)!=null&&T.data&&y(C.payload.data)}).catch(C=>{console.error("Error fetching provinces:",C)}).finally(()=>{c(W())})},[]),h.useEffect(()=>{a?(c(Y()),c(Yu(a)).then(s=>{var C;(C=s==null?void 0:s.payload)!=null&&C.data&&(n(s.payload.data),L(!1))}).catch(s=>{console.error("Error fetching cities:",s)}).finally(()=>{c(W())})):(n([]),L(!0))},[a]),u.jsxs(t,{container:!0,p:l.MEDIUM,direction:"column",flex:"1",height:"100%",justifyContent:"space-between",gap:l.SMALL,children:[u.jsxs(t,{container:!0,direction:"column",gap:l.SMALL,children:[u.jsx(t,{children:u.jsx(m,{disablePortal:!0,id:"province",options:e&&Array.isArray(e)?e.filter(s=>(s==null?void 0:s.key)&&(s==null?void 0:s.name)).map(s=>({id:s.key,label:s.name})):[],onChange:(s,C)=>{C?(r(C.id),A(C.label)):(r(void 0),A(void 0))},renderInput:s=>u.jsx(O,{...s,label:"استان را انتخاب کنید"})})}),u.jsx(t,{children:u.jsx(m,{disabled:E,disablePortal:!0,id:"city",options:p&&Array.isArray(p)?p.filter(s=>(s==null?void 0:s.key)&&(s==null?void 0:s.name)).map(s=>({id:s.key,label:s.name})):[],onChange:(s,C)=>{C?(S(C.id),g(C.label)):(S(void 0),g(void 0))},renderInput:s=>u.jsx(O,{...s,label:"شهر را انتخاب کنید"})})})]}),u.jsx(t,{children:u.jsx(B,{fullWidth:!0,variant:"contained",onClick:()=>{c(Au(j)),c(pu(x)),c(R({right:!1,bottom:!1,content:null}))},children:"ثبت اطلاعات"})})]})},Qu=()=>{const e=_(),{auctions:y}=P(i=>i.auctionSlice||{}),{filterByDate:p}=P(i=>i.auctionSlice||{}),{filterByCity:n}=P(i=>i.auctionSlice||{}),{filterByProvince:a}=P(i=>i.auctionSlice||{}),{filterByQuantity:r,filterByAge:x,filterByRace:A,filterByWeight:j,filterByPrice:g}=P(i=>i.auctionSlice||{}),[S,E]=h.useState([]),[L,c]=h.useState(0),[s,C]=h.useState(0);h.useEffect(()=>{e(V())},[p,n,r,g,j,x,A]),h.useEffect(()=>{if(y&&Array.isArray(y)&&y.length>0){const i=y.map(f=>f==null?void 0:f.quantity).filter(f=>f!=null);i.length>0&&(c(Math.min(...i)),C(Math.max(...i)))}},[y]),h.useEffect(()=>{if(y&&Array.isArray(y)){let i=[];const f=o=>{if(!p||!Array.isArray(p))return!0;if(!(o!=null&&o.sendDate))return!1;try{const b=nu(new Date(o.sendDate),"yyyy/MM/dd");return p.includes(b)}catch(b){return console.error("Error formatting date:",b),!1}},M=o=>{var b,D,I,F;if(n||a){if(n)return((D=(b=o==null?void 0:o.process)==null?void 0:b.city)==null?void 0:D.cityOperatorCity)===n;if(a)return((F=(I=o==null?void 0:o.process)==null?void 0:I.city)==null?void 0:F.cityOperatorProvince)===a}return!0},d=o=>{var b,D,I;if(A)return(o==null?void 0:o.chickenBreed)===A;if(r&&Array.isArray(r)){const F=o==null?void 0:o.quantity;return F==null?!1:F>=(r[0]||0)&&F<=(r[1]||1/0)}if(g&&Array.isArray(g)){if((b=o==null?void 0:o.process)!=null&&b.killHouseAuctionsList){const F=o.process.killHouseAuctionsList;if(Array.isArray(F)&&F.length>0){const q=F[F.length-1],k=q==null?void 0:q.fee;return k==null?!1:k>=(g[0]||0)&&k<=(g[1]||1/0)}}return!1}if(j&&Array.isArray(j)){const F=o==null?void 0:o.IndexWeight;return F==null?!1:F>=(j[0]||0)&&F<=(j[1]||1/0)}if(x!=null){const F=(I=(D=o==null?void 0:o.process)==null?void 0:D.poultry)==null?void 0:I.age;return F==null?!1:F<=x}return!0};p||n||a||r||g||j||x!==void 0||A?i=y.filter(f).filter(M).filter(d).map((o,b)=>uu(o,b,e)):i=y.map((o,b)=>uu(o,b,e)),E(i)}else E([])},[y,p,n,a,r,g,j,x,A,e]);const T=K()==="KillHouse"?["شماره مزایده","کدسفارش","قیمت کف","قیمت سقف","بالاترین قیمت پیشنهادی","تعداد","تاریخ درخواست کشتار","نژاد و سن به روز","وزن","استان","شهرستان","زمان تا پایان","عملیات"]:["شماره مزایده","کدسفارش","قیمت کف","قیمت سقف","بالاترین قیمت پیشنهادی","تعداد","تاریخ درخواست کشتار","نژاد و سن به روز","وزن","استان","شهرستان","زمان تا پایان"];return u.jsxs(t,{container:!0,gap:l.SMALL,p:l.SMALL,width:"100%",children:[u.jsxs(t,{container:!0,alignItems:"center",gap:l.SMALL,children:[u.jsx(t,{children:u.jsx(v,{color:i=>i.palette.grey.A700,children:"فیلتر کردن مزایده ها"})}),u.jsx(t,{children:u.jsxs(Tu,{variant:"text","aria-label":"outlined button group",children:[u.jsx(B,{onClick:()=>{e(R({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(Hu,{}),title:" فیلتر تاریخ"}))},children:"فیلتر تاریخ"}),u.jsx(B,{onClick:()=>{e(R({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:" فیلتر بر اساس شهر و استان",content:u.jsx(Ku,{})}))},children:"فیلتر استان و شهرستان"}),u.jsx(B,{onClick:()=>{e(R({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"فیلتر پیشرفته",content:u.jsx(fu,{maxQuantity:s,minQuantity:L})}))},children:"فیلتر پیشرفته"}),u.jsx(B,{onClick:()=>{e(Y()),e(U("")),e(Au("")),e(pu("")),e(au("")),e(cu("")),e(iu("")),e(du("")),e(Cu("")),e(V()),e(W())},children:"حذف همه فیلترها"})]})})]}),u.jsx(yu,{name:"مزایده های در حال انجام",columns:T,data:S})]})},o0=()=>{const[e]=Nu();return u.jsx(Du,{display:"flex",justifyContent:"center",children:u.jsxs(t,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[u.jsx(t,{container:!0,justifyContent:"space-between",gap:l.SMALL,children:u.jsx(Qu,{})}),K()==="KillHouse"&&e.includes("KillHouse")&&u.jsx(t,{justifyContent:"center",my:l.MEDIUM,children:u.jsx(Gu,{})})]})})};export{o0 as default};
|