Files
Rasadyar_FrontEnd/build/assets/Auction-D1F-cnli.js
2026-01-19 15:55:00 +03:30

2 lines
20 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{j as u,B,ag as O,ah as gu,ai as J,aj as Z,T as v,av as eu,aw as ru,ax as N,aX as Fu,aq as vu,bj as bu,aU as Eu,cp as H,p as k,i as Su,am as Lu,ak as z,aa as Iu,al as m,cn as Tu,aI as Du}from"./mui-vendor-CkIVaoQP.js";import{iB as su,_ as Mu,G as t,g6 as Bu,S as l,Q as nu,iC as U,N as R,L as _,a0 as Pu,h as W,u as tu,c as ou,b as lu,iD as au,iE as cu,iF as iu,iG as Cu,iH as du,r as Ru,j as wu,A as Nu,iI as K,v as Y,X as V,iJ as Au,iK as pu,$ as ku}from"./index-Vwb3Bce5.js";import{r as h,u as qu}from"./react-vendor-CmFgShSM.js";import{u as G,f as P,a as Wu}from"./redux-vendor-B7uoacJt.js";import{A as yu}from"./AdvancedTable-B0ObjV8k.js";import{T as hu}from"./Timer-BQ9QiCrC.js";import{c as Gu,a as _u}from"./city-get-city-DPzaFpLT.js";import"./index-CgNdnt2v.js";import"./Close-8pFLGZ5w.js";import"./Search-CLlOaERQ.js";import"./Delete-DHYHiC8G.js";const Hu=()=>{const[e,y]=h.useState([]),p=G(),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,L,E,S,c,s,d,T,i,f,M,C,o,b,D,I,F,q,w,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=(L=r==null?void 0:r.poultryRequest)==null?void 0:L.hatching)==null?void 0:E.date)||"",(((S=r==null?void 0:r.poultryRequest)==null?void 0:S.chickenBreed)||"")+((c=r==null?void 0:r.poultryRequest)!=null&&c.chickenBreed&&((T=(d=(s=r==null?void 0:r.poultryRequest)==null?void 0:s.process)==null?void 0:d.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)||""),(((C=r==null?void 0:r.poultryRequest)==null?void 0:C.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=(w=(q=(F=r==null?void 0:r.poultryRequest)==null?void 0:F.poultry)==null?void 0:q.address)==null?void 0:w.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 $;n(Bu+((($=r==null?void 0:r.poultryRequest)==null?void 0:$.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})})})},Yu=()=>{const e=G(),y=48,p=8,{auctions:n}=P(c=>c.auctionSlice||{}),[a,r]=h.useState([]),[x,A]=h.useState([]),[j,g]=h.useState("all"),L=c=>{g(c.target.value)},E=c=>{const{target:{value:s}}=c;r(typeof s=="string"?s.split(","):s)},S={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(d){return console.error("Error formatting date:",d),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(O,{children:u.jsxs(gu,{"aria-labelledby":"demo-controlled-radio-buttons-group",name:"controlled-radio-buttons-group",value:j,onChange:L,children:[u.jsx(J,{value:"all",control:u.jsx(Z,{}),label:"بدون فیلتر"}),u.jsx(J,{value:"filter",control:u.jsx(Z,{}),label:"انتخاب تاریخ"})]})})}),j==="filter"&&u.jsxs(u.Fragment,{children:[u.jsx(t,{children:u.jsx(v,{variant:"body2",children:"تاریخ هایی که مایل به رویت مناقصات آنها هستید را انتخاب کنید."})}),u.jsx(t,{children:u.jsxs(O,{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:S,children:x.map((c,s)=>u.jsxs(N,{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=G(),{avicultureChickenPrice:n}=P(i=>i.avicultureSlice);h.useEffect(()=>{p(_()),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,L]=h.useState([30,70]),[E,S]=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)&&S([n.floorPrice,n.ceilingPrice])},[n]);const c=(i,f)=>{x(f)},s=(i,f)=>{j(f)},d=(i,f)=>{L(f)},T=(i,f)=>{S(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(O,{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(N,{value:"همه",children:"همه"}),u.jsx(N,{value:"آرین",children:"آرین"}),u.jsx(N,{value:"راس",children:"راس"}),u.jsx(N,{value:"آربراکرز (آپلاس)",children:"آربراکرز (آپلاس)"}),u.jsx(N,{value:"کاب",children:"کاب"}),u.jsx(N,{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(H,{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(H,{size:"small",value:g,min:30,max:70,onChange:d,valueLabelDisplay:"auto"})]}),u.jsxs(t,{display:"flex",gap:l.SMALL,children:["وزن:",u.jsx(H,{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(H,{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(Cu(A)),p(du(E)),p(R({right:!1,bottom:!1,content:null}))},children:"ثبت اطلاعات"})})]})};fu.propTypes={minQuantity:k.PropTypes.number,maxQuantity:k.PropTypes.number};var Q={},Ou=Su;Object.defineProperty(Q,"__esModule",{value:!0});var xu=Q.default=void 0,zu=Ou(Ru()),Uu=u;xu=Q.default=(0,zu.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 Ku=Wu("AuctionOfferPrice",async e=>{const{data:y,status:p}=await wu.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,L,E,S,c,s,d,T,i,f,M;const r=G(),[x]=h.useContext(Nu),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:C=>C.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:C=>C.palette.grey.A700,children:"استان :"}),u.jsx(v,{variant:"body2",children:((L=(g=(j=e==null?void 0:e.poultry)==null?void 0:j.address)==null?void 0:g.province)==null?void 0:L.name)||""})]}),u.jsxs(t,{display:"flex",children:[u.jsx(v,{variant:"body2",mr:l.TINY,color:C=>C.palette.grey.A700,children:"شهر :"}),u.jsx(v,{variant:"body2",children:((c=(S=(E=e==null?void 0:e.poultry)==null?void 0:E.address)==null?void 0:S.city)==null?void 0:c.name)||""})]}),u.jsxs(t,{display:"flex",children:[u.jsx(v,{variant:"body2",mr:l.TINY,color:C=>C.palette.grey.A700,children:"مرغدار :"}),u.jsx(v,{variant:"body2",children:((d=(s=e==null?void 0:e.poultry)==null?void 0:s.userprofile)==null?void 0:d.fullName)||""})]}),u.jsxs(t,{display:"flex",children:[u.jsx(v,{variant:"body2",mr:l.TINY,color:C=>C.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:C=>C.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:C=>C.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:C=>C.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:C=>C.palette.grey.A700,children:"وزن :"}),u.jsxs(v,{variant:"body2",children:[(e==null?void 0:e.IndexWeight)||0," کیلوگرم"]})]}),u.jsx(Lu,{}),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:C=>C.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:C=>C.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(z,{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(_());const C=Number(A.values.offer)||0,o=Number(y)||0,b=Number(p)||0,D=n==="پیشنهادی وجود ندارد!"||!n?0:Number(n)||0;(n==="پیشنهادی وجود ندارد!"||!n||C-D>=1e3&&C>o&&C<=b)&&(e!=null&&e.key)?r(Ku({key:e.key,fee:C})).then(I=>{I!=null&&I.error?x({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(r(K()),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:k.PropTypes.any,floorPrice:k.PropTypes.string,ceilingPrice:k.PropTypes.string,highestBidedPrice:k.PropTypes.string,auctionRemainedSeconds:k.PropTypes.string};function uu(e,y,p){var j,g,L,E,S,c,s,d,T,i,f,M,C;const n=Y(new Date((g=(j=e==null?void 0:e.process)==null?void 0:j.auctionsList[0])==null?void 0:g.date)),a=Y(),r=n.diff(a),x=Y.duration(r).asSeconds(),A=(L=e.process)!=null&&L.killHouseAuctionsList?(S=e==null?void 0:e.process)==null?void 0:S.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=(d=e==null?void 0:e.process)==null?void 0:d.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,(C=e==null?void 0:e.process)==null?void 0:C.city.cityOperatorCity,u.jsx(hu,{seconds:x},"auctiontimer"+y),V()==="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 Vu=()=>{const[e,y]=h.useState(),[p,n]=h.useState(),[a,r]=h.useState(),[x,A]=h.useState(),[j,g]=h.useState(),[,L]=h.useState(),[E,S]=h.useState(!0),c=G();return h.useEffect(()=>{var s;c(_()),(s=c(Gu()))==null||s.then(d=>{var T;(T=d==null?void 0:d.payload)!=null&&T.data&&y(d.payload.data)}).catch(d=>{console.error("Error fetching provinces:",d)}).finally(()=>{c(W())})},[]),h.useEffect(()=>{a?(c(_()),c(_u(a)).then(s=>{var d;(d=s==null?void 0:s.payload)!=null&&d.data&&(n(s.payload.data),S(!1))}).catch(s=>{console.error("Error fetching cities:",s)}).finally(()=>{c(W())})):(n([]),S(!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,d)=>{d?(r(d.id),A(d.label)):(r(void 0),A(void 0))},renderInput:s=>u.jsx(z,{...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,d)=>{d?(L(d.id),g(d.label)):(L(void 0),g(void 0))},renderInput:s=>u.jsx(z,{...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=G(),{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||{}),[L,E]=h.useState([]),[S,c]=h.useState(0),[s,d]=h.useState(0);h.useEffect(()=>{e(K())},[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)),d(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},C=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],w=q==null?void 0:q.fee;return w==null?!1:w>=(g[0]||0)&&w<=(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(C).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=V()==="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(Yu,{}),title:" فیلتر تاریخ"}))},children:"فیلتر تاریخ"}),u.jsx(B,{onClick:()=>{e(R({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:" فیلتر بر اساس شهر و استان",content:u.jsx(Vu,{})}))},children:"فیلتر استان و شهرستان"}),u.jsx(B,{onClick:()=>{e(R({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"فیلتر پیشرفته",content:u.jsx(fu,{maxQuantity:s,minQuantity:S})}))},children:"فیلتر پیشرفته"}),u.jsx(B,{onClick:()=>{e(_()),e(U("")),e(Au("")),e(pu("")),e(au("")),e(cu("")),e(iu("")),e(Cu("")),e(du("")),e(K()),e(W())},children:"حذف همه فیلترها"})]})})]}),u.jsx(yu,{name:"مزایده های در حال انجام",columns:T,data:L})]})},o0=()=>{const[e]=ku();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,{})}),V()==="KillHouse"&&e.includes("KillHouse")&&u.jsx(t,{justifyContent:"center",my:l.MEDIUM,children:u.jsx(Hu,{})})]})})};export{o0 as default};