/
home
/
infinitibizsol
/
.trash
/
static.1
/
js
/
File Upload :
llllll
Current File: /home/infinitibizsol/.trash/static.1/js/524.66907c3a.chunk.js
"use strict";(self.webpackChunk_minimal_material_kit_react=self.webpackChunk_minimal_material_kit_react||[]).push([[524],{7550:(e,i,t)=>{t(5043);var n=t(4535),l=t(310),o=t(6446);(0,n.Ay)(o.A)((e=>{let{theme:i,ownerState:t}=e;const n="light"===i.palette.mode,o="filled"===t.variant,r="outlined"===t.variant,d="soft"===t.variant,a={..."default"===t.color&&{...r&&{backgroundColor:"transparent",color:i.palette.text.primary,border:"1px solid ".concat((0,l.X4)(i.palette.grey[500],.32))},...d&&{color:n?i.palette.text.primary:i.palette.common.white,backgroundColor:(0,l.X4)(i.palette.grey[500],.16)}}},s={..."default"!==t.color&&{...o&&{color:i.palette[t.color].contrastText,backgroundColor:i.palette[t.color].main},...r&&{backgroundColor:"transparent",color:i.palette[t.color].main,border:"1px solid ".concat(i.palette[t.color].main)},...d&&{color:i.palette[t.color][n?"dark":"light"],backgroundColor:(0,l.X4)(i.palette[t.color].main,.16)}}};return{height:24,minWidth:22,lineHeight:0,borderRadius:6,cursor:"default",alignItems:"center",whiteSpace:"nowrap",display:"inline-flex",justifyContent:"center",textTransform:"capitalize",padding:i.spacing(0,1),color:i.palette.grey[800],fontSize:i.typography.pxToRem(12),fontFamily:i.typography.fontFamily,backgroundColor:i.palette.grey[300],fontWeight:i.typography.fontWeightBold,...s,...a}}));t(579)},524:(e,i,t)=>{t.r(i),t.d(i,{default:()=>V});var n=t(3536),l=t(5043),o=t(9252),r=t(8911),d=t(5865),a=t(2110),s=t(8977),c=t(9650),u=t(1806),h=t(3460),x=t(8076),v=t(2420),p=t(3336),g=t(1574),j=t(2041),A=t(6446),m=(t(7550),t(5869),t(2500)),f=t(7894),w=t(3216),b=t(7154),y=t(9588),k=t(9456),_=t(1036),S=t(3568),C=t(9907),I=t(3383),D=t(579);const F={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:400,bgcolor:"background.paper",border:"2px solid black",borderRadius:2,boxShadow:24,p:4};function R(e,i,t){return i[t]<e[t]?-1:i[t]>e[t]?1:0}const V=()=>{const[e,i]=(0,l.useState)([]),[t,V]=(0,l.useState)(""),[N,W]=(0,l.useState)([]),z=(0,w.Zp)(),L=(0,k.wA)(),{userInfo:U}=(0,k.d4)((e=>e.auth)),{userData:B,filterType:P}=(0,k.d4)((e=>e.users)),{state:E}=(0,w.zy)();(0,l.useEffect)((()=>{E||z("/dashboard/app");let e=[];"auctioneer"===P&&(e=[{id:"auctioneer",label:"Name",alignRight:!1},{id:"units",label:"Units",alignRight:!1},{id:"view",label:"View",alignRight:!1},{id:"action",label:"Action",alignRight:!1},{id:""}]),"condition_light"===P&&(e=[{id:"conditionLight",label:"Condition Light"},{id:"conditionLightUnits",label:"Units"},{id:"viewConditionLight",label:"View"}]),"auction"===P&&(e=[{id:"auctionName",label:"Auction Name"},{id:"auctionUnits",label:"Units"},{id:"viewAuction",label:"View"}]),"sale_status"===P&&(e=[{id:"saleStatus",label:"Sale Status"},{id:"saleUnits",label:"Units"},{id:"viewSale",label:"View"}]),W(e)}),[B]);const T=(e,i)=>{L((0,C.P9)({condition_light:e.condition_light,week_id:null===E||void 0===E?void 0:E.week,user_id:null===U||void 0===U?void 0:U.user_id,sortBy:"year",orderDirection:"DESC"})),z("/dashboard/app/users/cars",{state:{name:i,startDate:null===E||void 0===E?void 0:E.startDate,endDate:null===E||void 0===E?void 0:E.endDate,weekId:null===E||void 0===E?void 0:E.week,filterValue:"conditonLight",filterId:e.opportunity_id,filterData:e.condition_light}})},O=(e,i)=>{L((0,C.FZ)({week_id:null===E||void 0===E?void 0:E.week,user_id:null===U||void 0===U?void 0:U.user_id,sale_status:"false"===e.sale_status?0:1,sortBy:"year",orderDirection:"DESC"})),z("/dashboard/app/users/cars",{state:{name:i,startDate:null===E||void 0===E?void 0:E.startDate,endDate:null===E||void 0===E?void 0:E.endDate,weekId:null===E||void 0===E?void 0:E.week,filterValue:"saleStatus",filterId:e.opportunity_id,filterData:"false"===e.sale_status?0:1}})},[X,Y]=(0,l.useState)(!1),[H,K]=(0,l.useState)(0),[M,q]=(0,l.useState)("asc"),[G,Z]=(0,l.useState)("name"),[J,Q]=(0,l.useState)(""),[$,ee]=(0,l.useState)([]),[ie,te]=(0,l.useState)(5),[ne,le]=(0,l.useState)(null),oe=H>0?Math.max(0,(1+H)*ie-(null===B||void 0===B?void 0:B.length)):0,re=function(e,i,t){const l=null===e||void 0===e?void 0:e.map(((e,i)=>[e,i]));return null===l||void 0===l||l.sort(((e,t)=>{const n=i(e[0],t[0]);return 0!==n?n:e[1]-t[1]})),t?(0,n.filter)(e,(e=>{var i;return-1!==(null===e||void 0===e||null===(i=e.first_name)||void 0===i?void 0:i.toLowerCase().indexOf(t.toLowerCase()))})):null===l||void 0===l?void 0:l.map((e=>e[0]))}(B,function(e,i){return"desc"===e?(e,t)=>R(e,t,i):(e,t)=>-R(e,t,i)}(M,G),J),de=!(null!==re&&void 0!==re&&re.length)&&!!J;return(0,D.jsx)(D.Fragment,{children:(0,D.jsxs)(o.A,{children:[(0,D.jsx)(r.A,{direction:"row",alignItems:"center",justifyContent:"space-between",mb:5,children:(0,D.jsxs)(d.A,{variant:"h4",sx:{mb:5},children:[null===E||void 0===E?void 0:E.startDate," - ",null===E||void 0===E?void 0:E.endDate]})}),(0,D.jsxs)(a.A,{children:[(0,D.jsxs)(r.A,{direction:"row",alignItems:"center",justifyContent:"space-between",margin:"10px 10px 0 10px",children:[(0,D.jsx)(s.A,{variant:"contained",onClick:()=>{z("/dashboard/app/add-auctioneer",{state:{weekId:null===E||void 0===E?void 0:E.week}})},children:"Add Auctioneer"}),(0,D.jsx)(f.H,{filterName:J,onFilterName:e=>{K(0),Q(e.target.value)},weekId:null===E||void 0===E?void 0:E.week,userId:null===U||void 0===U?void 0:U.user_id})]}),(0,D.jsx)(m.A,{children:(0,D.jsx)(c.A,{sx:{minWidth:800},children:(0,D.jsxs)(u.A,{children:[(0,D.jsx)(f.K,{order:M,orderBy:G,headLabel:N,rowCount:null===B||void 0===B?void 0:B.length,onRequestSort:(e,i)=>{q(G===i&&"asc"===M?"desc":"asc"),Z(i)}}),(0,D.jsxs)(h.A,{children:[null===re||void 0===re?void 0:re.slice(H*ie,H*ie+ie).map(((e,i)=>{const{user_id:t,first_name:n,units:o,auction_id:r,auctioneer_id:a,auction_name:c}=e;return(0,D.jsx)(l.Fragment,{children:n?(0,D.jsxs)(x.A,{hover:!0,tabIndex:-1,role:"checkbox",children:[(0,D.jsx)(v.A,{align:"left",children:n}),(0,D.jsx)(v.A,{align:"left",children:o}),(0,D.jsxs)(v.A,{align:"left",children:[(0,D.jsx)(s.A,{variant:"contained",onClick:()=>{return i=null===e||void 0===e?void 0:e.opportunity_id,t=n,l=o,r=a,L((0,C.e2)({user_id:null===U||void 0===U?void 0:U.user_id,opportunity_id:i,weekId:null===E||void 0===E?void 0:E.week})),void z("/dashboard/app/users/cars",{state:{name:t,totalUnits:l,startDate:null===E||void 0===E?void 0:E.startDate,endDate:null===E||void 0===E?void 0:E.endDate,weekId:null===E||void 0===E?void 0:E.week,filterValue:"auctioneer",filterId:i,auctioneerId:r}});var i,t,l,r},children:"View"})," "]}),(0,D.jsx)(v.A,{align:"left",children:(0,D.jsx)("img",{width:"40px",style:{cursor:"pointer"},alt:"Delete Auctioneer",src:S,onClick:()=>{Y(!0),ee([null===e||void 0===e?void 0:e.auctioneer_id])}})})]},t):c?(0,D.jsxs)(x.A,{hover:!0,tabIndex:-1,role:"checkbox",children:[(0,D.jsx)(v.A,{align:"left",children:c}),(0,D.jsx)(v.A,{align:"left",children:o}),(0,D.jsxs)(v.A,{align:"left",children:[(0,D.jsx)(s.A,{variant:"contained",onClick:()=>{return i=null===e||void 0===e?void 0:e.auction_id,t=c,n=o,L((0,C.oB)({user_id:null===U||void 0===U?void 0:U.user_id,week_id:null===E||void 0===E?void 0:E.week,auction_id:i,orderDirection:"DESC",sortBy:"year"})),void z("/dashboard/app/users/cars",{state:{name:t,totalUnits:n,startDate:null===E||void 0===E?void 0:E.startDate,endDate:null===E||void 0===E?void 0:E.endDate,weekId:null===E||void 0===E?void 0:E.week,filterValue:"auction",filterId:i}});var i,t,n},children:"View"})," "]})]},r):3===(null===B||void 0===B?void 0:B.length)?(0,D.jsxs)(D.Fragment,{children:[1===(null===e||void 0===e?void 0:e.condition_light)&&(0,D.jsxs)(x.A,{children:[(0,D.jsx)(v.A,{children:(0,D.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,D.jsx)(I.A,{style:{color:"#FF0000",fontSize:"30px",marginRight:"5px"}}),(0,D.jsx)(d.A,{sx:{color:"#FF0000",fontWeight:"bold"},children:"Red Status"})]})}),(0,D.jsx)(v.A,{children:null===e||void 0===e?void 0:e.units}),(0,D.jsx)(v.A,{children:(0,D.jsx)("div",{children:(0,D.jsx)(s.A,{variant:"contained",onClick:()=>T(e,"Red"),children:"View"})})})]}),2===(null===e||void 0===e?void 0:e.condition_light)&&(0,D.jsxs)(x.A,{children:[(0,D.jsx)(v.A,{children:(0,D.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,D.jsx)(I.A,{style:{color:"#FFFF00",fontSize:"30px",marginRight:"5px"}}),(0,D.jsx)(d.A,{sx:{color:"#FFFF00",fontWeight:"bold"},children:"Yellow Status"})]})}),(0,D.jsx)(v.A,{children:null===e||void 0===e?void 0:e.units}),(0,D.jsx)(v.A,{children:(0,D.jsx)("div",{children:(0,D.jsx)(s.A,{variant:"contained",onClick:()=>T(e,"Yellow"),children:"View"})})})]}),3===(null===e||void 0===e?void 0:e.condition_light)&&(0,D.jsxs)(x.A,{children:[(0,D.jsx)(v.A,{children:(0,D.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,D.jsx)(I.A,{style:{color:"#008000",fontSize:"30px",marginRight:"5px"}}),(0,D.jsx)(d.A,{sx:{color:"#008000",fontWeight:"bold"},children:"Green Status"})]})}),(0,D.jsx)(v.A,{children:null===e||void 0===e?void 0:e.units}),(0,D.jsx)(v.A,{children:(0,D.jsx)("div",{children:(0,D.jsx)(s.A,{variant:"contained",onClick:()=>T(e,"Green"),children:"View"})})})]})]}):2===(null===B||void 0===B?void 0:B.length)?(0,D.jsxs)(D.Fragment,{children:["true"===(null===e||void 0===e?void 0:e.sale_status)&&(0,D.jsxs)(x.A,{children:[(0,D.jsx)(v.A,{children:(0,D.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,D.jsx)(I.A,{style:{color:"#008000",fontSize:"30px",marginRight:"5px"}}),(0,D.jsx)(d.A,{sx:{color:"#008000",fontWeight:"bold"},children:"Sold"})]})}),(0,D.jsx)(v.A,{children:null===e||void 0===e?void 0:e.units}),(0,D.jsx)(v.A,{children:(0,D.jsx)("div",{children:(0,D.jsx)(s.A,{variant:"contained",onClick:()=>O(e,"Sold"),children:"View"})})})]}),"false"===(null===e||void 0===e?void 0:e.sale_status)&&(0,D.jsxs)(x.A,{children:[(0,D.jsx)(v.A,{children:(0,D.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,D.jsx)(I.A,{style:{color:"#FF0000",fontSize:"30px",marginRight:"5px"}}),(0,D.jsx)(d.A,{sx:{color:"#FF0000",fontWeight:"bold"},children:"Not Sold"})]})}),(0,D.jsx)(v.A,{children:null===e||void 0===e?void 0:e.units}),(0,D.jsx)(v.A,{children:(0,D.jsx)("div",{children:(0,D.jsx)(s.A,{variant:"contained",onClick:()=>O(e,"Not Sold"),children:"View"})})})]})]}):null},i)})),!(null!==B&&void 0!==B&&B.length)>0&&(0,D.jsx)(x.A,{style:{height:53*oe},children:(0,D.jsx)(v.A,{align:"center",colSpan:6,sx:{py:5},children:(0,D.jsx)(p.A,{sx:{textAlign:"center"},children:(0,D.jsx)(d.A,{variant:"h4",paragraph:!0,children:"No results found"})})})})]}),de&&(0,D.jsx)(h.A,{children:(0,D.jsx)(x.A,{children:(0,D.jsx)(v.A,{align:"center",colSpan:6,sx:{py:3},children:(0,D.jsxs)(p.A,{sx:{textAlign:"center"},children:[(0,D.jsx)(d.A,{variant:"h6",paragraph:!0,children:"Not found"}),(0,D.jsxs)(d.A,{variant:"body2",children:["No results found for \xa0",(0,D.jsxs)("strong",{children:['"',J,'"']}),".",(0,D.jsx)("br",{})," Try checking for typos or using complete words."]})]})})})})]})})}),(0,D.jsx)(g.A,{rowsPerPageOptions:[5,10,25],component:"div",count:null===B||void 0===B?void 0:B.length,rowsPerPage:ie,page:H,onPageChange:(e,i)=>{K(i)},onRowsPerPageChange:e=>{K(0),te(parseInt(e.target.value,10))}}),(0,D.jsx)(j.A,{open:X,onClose:()=>Y(!1),"aria-labelledby":"modal-modal-title","aria-describedby":"modal-modal-description",children:(0,D.jsxs)(A.A,{sx:F,children:[(0,D.jsx)(d.A,{id:"modal-modal-title",variant:"h6",component:"h2",sx:{color:"#1976D2",mb:1,textAlign:"center"},children:"Are you sure you want to remove"}),(0,D.jsx)(d.A,{id:"modal-modal-description",variant:"h6",component:"h2",align:"center",children:"this Auctioneer?"}),(0,D.jsxs)(r.A,{spacing:2,direction:"row",justifyContent:"center",alignItems:"flex-end",sx:{mt:2},children:[(0,D.jsx)(s.A,{variant:"contained",style:{width:"150px",backgroundColor:"#E53935",borderRadius:"30px",color:"white",marginRight:"8px",fontWeight:"bold"},onClick:async()=>{if($.length>0)try{Y(!1);const e={headers:{"Content-Type":"application/json"}},{data:i}=await b.A.post("".concat(y.VY,"/user/remove-auctioneer-from-opportunity"),{auctioneer_ids:$,weekId:null===E||void 0===E?void 0:E.week,user_id:null===U||void 0===U?void 0:U.user_id},e);if(i)return L((0,C.Np)({userId:null===U||void 0===U?void 0:U.user_id,weekId:null===E||void 0===E?void 0:E.week})),void _.oR.success("Auctioneer removed successfully!")}catch(e){console.log(e),Y(!1),_.oR.error("Error while removing Auctioneer!")}console.log("Deleted!")},children:"Yes"}),(0,D.jsx)(s.A,{variant:"contained",style:{width:"150px",backgroundColor:"#4CAF50",borderRadius:"30px",color:"white",fontWeight:"bold"},onClick:()=>Y(!1),children:"No"})]})]})})]})]})})}},7894:(e,i,t)=>{t.d(i,{K:()=>c,H:()=>S});var n=t(4882),l=t(8076),o=t(2420),r=t(8093),d=t(6446),a=t(579);const s={border:0,margin:-1,padding:0,width:"1px",height:"1px",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",clip:"rect(0 0 0 0)"};function c(e){let{order:i,orderBy:t,rowCount:c,headLabel:u,numSelected:h,onRequestSort:x,onSelectAllClick:v}=e;return(0,a.jsx)(n.A,{children:(0,a.jsx)(l.A,{children:u.map((e=>{return(0,a.jsx)(o.A,{align:e.alignRight?"right":"left",sortDirection:t===e.id&&i,children:(0,a.jsxs)(r.A,{hideSortIcon:!0,active:t===e.id,direction:t===e.id?i:"asc",onClick:(n=e.id,e=>{x(e,n)}),children:[e.label,t===e.id?(0,a.jsx)(d.A,{sx:{...s},children:"desc"===i?"sorted descending":"sorted ascending"}):null]})},e.id);var n}))})})}var u=t(4535),h=t(310),x=t(5263),v=t(9859),p=t(5865),g=t(5869),j=t(5043),A=t(8977),m=t(688),f=t(2143),w=t(9456),b=t(9907);const y=[{value:"auctioneer",label:"Auctioneer"},{value:"auction",label:"Auction"},{value:"condition_light",label:"Condition Light"},{value:"sale_status",label:"Sale Status"}];function k(e){let{weekId:i,userId:t}=e;const[n,l]=(0,j.useState)(null),[o,r]=(0,j.useState)("Auctioneer"),d=(0,w.wA)();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(A.A,{color:"inherit",disableRipple:!0,onClick:e=>{l(e.currentTarget)},endIcon:(0,a.jsx)(g.A,{icon:n?"eva:chevron-up-fill":"eva:chevron-down-fill"}),children:["Filter by \xa0",(0,a.jsx)(p.A,{component:"span",variant:"subtitle2",sx:{color:"text.secondary"},children:o})]}),(0,a.jsx)(m.A,{keepMounted:!0,anchorEl:n,open:Boolean(n),onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:y.map(((e,n)=>(0,a.jsx)(f.A,{selected:"auctioneer"===e.value,onClick:()=>{return n=e.value,o=e.label,console.log("Key",n),"auctioneer"===n?d((0,b.Np)({userId:t,weekId:i})):"auction"===n?d((0,b.x1)({user_id:t,week_id:i})):"condition_light"===n?d((0,b.S4)({user_id:t,week_id:i})):"sale_status"===n&&d((0,b.yh)({user_id:t,week_id:i})),r(o),void l(null);var n,o},sx:{typography:"body2"},children:e.label},e.value+"_"+e.label)))})]})}const _=(0,u.Ay)(x.A)((e=>{let{theme:i}=e;return{height:96,display:"flex",justifyContent:"flex-end",padding:i.spacing(0,1,0,3)}}));(0,u.Ay)(v.A)((e=>{let{theme:i}=e;return{width:240,transition:i.transitions.create(["box-shadow","width"],{easing:i.transitions.easing.easeInOut,duration:i.transitions.duration.shorter}),"&.Mui-focused":{width:320,boxShadow:i.customShadows.z8},"& fieldset":{borderWidth:"1px !important",borderColor:"".concat((0,h.X4)(i.palette.grey[500],.32)," !important")}}}));function S(e){let{numSelected:i,filterName:t,onFilterName:n,weekId:l,userId:o}=e;return(0,a.jsx)(_,{sx:{...i>0&&{color:"primary.main",bgcolor:"primary.lighter"}},children:i>0?(0,a.jsxs)(p.A,{component:"div",variant:"subtitle1",children:[i," selected"]}):(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(k,{weekId:l,userId:o})})})}},3568:(e,i,t)=>{e.exports=t.p+"static/media/trash.5795bffc2e3ba17cfc33.png"}}]); //# sourceMappingURL=524.66907c3a.chunk.js.map
Copyright ©2k19 -
Hexid
|
Tex7ure