%PDF- %PDF-
Direktori : /home/opti/public_html/ezone-accounting.optisoft.com.ng/static/js/ |
Current File : /home/opti/public_html/ezone-accounting.optisoft.com.ng/static/js/107.56f390c4.chunk.js |
(this["webpackJsonpfuse-react-app"]=this["webpackJsonpfuse-react-app"]||[]).push([[107],{1137:function(e,t,a){"use strict";a.d(t,"a",(function(){return w}));var r=a(39),c=a(1072),n=a(5),i=a(0),o=a(43),s=a(1099),l=a(27),d=a(6),p=a(1);var u=function(e){const t=Object(o.a)(),a=Object(d.c)(Object(l.c)(t.palette.primary.main));return Object(p.jsx)("div",{className:e.classes.header,children:e.header&&Object(p.jsx)(s.a,{theme:a,children:e.header})})},b=a(94),m=a(1121),j=a(1125);var h=function(e){const t=Object(o.a)(),a=Object(d.c)(Object(l.c)(t.palette.primary.main)),{classes:c}=e;return Object(p.jsxs)(p.Fragment,{children:[e.header&&Object(p.jsx)(s.a,{theme:a,children:Object(p.jsx)("div",{className:Object(n.a)(c.sidebarHeader,e.variant),children:e.header})}),e.content&&Object(p.jsx)(r.a,{className:c.sidebarContent,enable:e.innerScroll,children:e.content})]})};function x(e,t){const[a,r]=Object(i.useState)(!1),{classes:c}=e;Object(i.useImperativeHandle)(t,(()=>({toggleSidebar:o})));const o=()=>{r(!a)};return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(m.a,{lgUp:"permanent"===e.variant,children:Object(p.jsx)(j.a,{variant:"temporary",anchor:e.position,open:a,onOpen:e=>{},onClose:e=>o(),disableSwipeToOpen:!0,classes:{root:Object(n.a)(c.sidebarWrapper,e.variant),paper:Object(n.a)(c.sidebar,e.variant,"left"===e.position?c.leftSidebar:c.rightSidebar)},ModalProps:{keepMounted:!0},container:e.rootRef.current,BackdropProps:{classes:{root:c.backdrop}},style:{position:"absolute"},children:Object(p.jsx)(h,{...e})})}),"permanent"===e.variant&&Object(p.jsx)(m.a,{mdDown:!0,children:Object(p.jsx)(b.a,{variant:"permanent",className:Object(n.a)(c.sidebarWrapper,e.variant),open:a,classes:{paper:Object(n.a)(c.sidebar,e.variant,"left"===e.position?c.leftSidebar:c.rightSidebar)},children:Object(p.jsx)(h,{...e})})})]})}var g=Object(i.forwardRef)(x);const f=200,O=Object(c.a)((e=>({"@global":{"#fuse-main":{height:e=>e.innerScroll&&"100vh"}},root:{display:"flex",flexDirection:"row",minWidth:0,minHeight:"100%",position:"relative",flex:"1 1 auto",height:"auto",backgroundColor:e.palette.background.default},innerScroll:{height:"100%"},topBg:{position:"absolute",left:0,right:0,top:0,height:f,background:"linear-gradient(to right, ".concat(e.palette.primary.dark," 0%, ").concat(e.palette.primary.main," 100%)"),backgroundSize:"cover",pointerEvents:"none"},contentWrapper:{display:"flex",flexDirection:"column",padding:"0 3.2rem",flex:"1 1 100%",zIndex:2,maxWidth:"100%",minWidth:0,minHeight:0,[e.breakpoints.down("xs")]:{padding:"0 1.6rem"}},header:{height:136,minHeight:136,maxHeight:136,display:"flex",color:e.palette.primary.contrastText},headerSidebarToggleButton:{color:e.palette.primary.contrastText},contentCard:{display:"flex",flex:"1 1 100%",flexDirection:"column",backgroundColor:e.palette.background.paper,boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",minHeight:0,borderRadius:"20px 20px 0 0"},toolbar:{height:64,minHeight:64,display:"flex",alignItems:"center",borderBottom:"1px solid ".concat(e.palette.divider)},content:{flex:"1 1 auto",height:"100%",overflow:"auto","-webkit-overflow-scrolling":"touch"},sidebarWrapper:{position:"absolute",backgroundColor:"transparent",zIndex:5,overflow:"hidden","&.permanent":{[e.breakpoints.up("lg")]:{zIndex:1,position:"relative"}}},sidebar:{position:"absolute","&.permanent":{[e.breakpoints.up("lg")]:{backgroundColor:"transparent",position:"relative",border:"none",overflow:"hidden"}},width:240,height:"100%"},leftSidebar:{},rightSidebar:{},sidebarHeader:{height:f,minHeight:f,color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.dark,"&.permanent":{[e.breakpoints.up("lg")]:{backgroundColor:"transparent"}}},sidebarContent:{display:"flex",flex:"1 1 auto",flexDirection:"column",backgroundColor:e.palette.background.default,color:e.palette.text.primary,[e.breakpoints.up("lg")]:{overflow:"auto","-webkit-overflow-scrolling":"touch"}},backdrop:{position:"absolute"}}))),v=Object(i.forwardRef)(((e,t)=>{const a=Object(i.useRef)(null),c=Object(i.useRef)(null),o=Object(i.useRef)(null),s=O(e),l=e.rightSidebarHeader||e.rightSidebarContent,d=e.leftSidebarHeader||e.leftSidebarContent;return Object(i.useImperativeHandle)(t,(()=>({rootRef:o,toggleLeftSidebar:()=>{a.current.toggleSidebar()},toggleRightSidebar:()=>{c.current.toggleSidebar()}}))),Object(p.jsxs)("div",{className:Object(n.a)(s.root,e.innerScroll&&s.innerScroll),ref:o,children:[Object(p.jsx)("div",{className:s.topBg}),Object(p.jsxs)("div",{className:"flex container w-full",children:[d&&Object(p.jsx)(g,{position:"left",header:e.leftSidebarHeader,content:e.leftSidebarContent,variant:e.leftSidebarVariant||"permanent",innerScroll:e.innerScroll,classes:s,ref:a,rootRef:o}),Object(p.jsxs)("div",{className:Object(n.a)(s.contentWrapper,d&&(void 0===e.leftSidebarVariant||"permanent"===e.leftSidebarVariant)&&"lg:ltr:pl-0 lg:rtl:pr-0",l&&(void 0===e.rightSidebarVariant||"permanent"===e.rightSidebarVariant)&&"lg:pr-0"),children:[Object(p.jsx)(u,{header:e.header,classes:s}),Object(p.jsxs)("div",{className:Object(n.a)(s.contentCard,e.innerScroll&&"inner-scroll"),children:[e.contentToolbar&&Object(p.jsx)("div",{className:s.toolbar,children:e.contentToolbar}),e.content&&Object(p.jsx)(r.a,{className:s.content,enable:e.innerScroll,scrollToTopOnRouteChange:e.innerScroll,children:e.content})]})]}),l&&Object(p.jsx)(g,{position:"right",header:e.rightSidebarHeader,content:e.rightSidebarContent,variant:e.rightSidebarVariant||"permanent",innerScroll:e.innerScroll,classes:s,ref:c,rootRef:o})]})]})}));v.defaultProps={};var w=Object(i.memo)(v)},1182:function(e,t,a){"use strict";a.d(t,"b",(function(){return i})),a.d(t,"c",(function(){return o})),a.d(t,"d",(function(){return l})),a.d(t,"e",(function(){return u}));var r=a(19),c=a(50),n=a.n(c);const i=Object(r.b)("eCommerceApp/orders/getOrders",(async()=>{const e=await n.a.get("/api/e-commerce-app/orders");return await e.data})),o=Object(r.b)("eCommerceApp/orders/removeOrders",(async(e,t)=>{let{dispatch:a,getState:r}=t;return await n.a.post("/api/e-commerce-app/remove-orders",{orderIds:e}),e})),s=Object(r.c)({}),{selectAll:l,selectById:d}=s.getSelectors((e=>e.eCommerceApp.orders)),p=Object(r.d)({name:"eCommerceApp/orders",initialState:s.getInitialState({searchText:""}),reducers:{setOrdersSearchText:{reducer:(e,t)=>{e.searchText=t.payload},prepare:e=>({payload:e.target.value||""})}},extraReducers:{[i.fulfilled]:s.setAll,[o.fulfilled]:(e,t)=>s.removeMany(e,t.payload)}}),{setOrdersSearchText:u}=p.actions;t.a=p.reducer},1183:function(e,t,a){"use strict";a.d(t,"b",(function(){return i})),a.d(t,"c",(function(){return o})),a.d(t,"d",(function(){return l})),a.d(t,"e",(function(){return u}));var r=a(19),c=a(50),n=a.n(c);const i=Object(r.b)("eCommerceApp/products/getProducts",(async()=>{const e=await n.a.get("/api/e-commerce-app/products");return await e.data})),o=Object(r.b)("eCommerceApp/products/removeProducts",(async(e,t)=>{let{dispatch:a,getState:r}=t;return await n.a.post("/api/e-commerce-app/remove-products",{productIds:e}),e})),s=Object(r.c)({}),{selectAll:l,selectById:d}=s.getSelectors((e=>e.eCommerceApp.products)),p=Object(r.d)({name:"eCommerceApp/products",initialState:s.getInitialState({searchText:""}),reducers:{setProductsSearchText:{reducer:(e,t)=>{e.searchText=t.payload},prepare:e=>({payload:e.target.value||""})}},extraReducers:{[i.fulfilled]:s.setAll,[o.fulfilled]:(e,t)=>s.removeMany(e,t.payload)}}),{setProductsSearchText:u}=p.actions;t.a=p.reducer},1187:function(e,t,a){"use strict";a.d(t,"b",(function(){return o})),a.d(t,"d",(function(){return s})),a.d(t,"f",(function(){return l})),a.d(t,"c",(function(){return p})),a.d(t,"e",(function(){return u}));var r=a(19),c=a(50),n=a.n(c),i=a(52);const o=Object(r.b)("eCommerceApp/product/getProduct",(async e=>{const t=await n.a.get("/api/e-commerce-app/product",{params:e}),a=await t.data;return void 0===a?null:a})),s=Object(r.b)("eCommerceApp/product/removeProduct",(async(e,t)=>{let{dispatch:a,getState:r}=t;const{id:c}=r().eCommerceApp.product;return await n.a.post("/api/e-commerce-app/remove-product",{id:c}),c})),l=Object(r.b)("eCommerceApp/product/saveProduct",(async(e,t)=>{let{dispatch:a,getState:r}=t;const{product:c}=r().eCommerceApp,i=await n.a.post("/api/e-commerce-app/product/save",{...c,...e});return await i.data})),d=Object(r.d)({name:"eCommerceApp/product",initialState:null,reducers:{resetProduct:()=>null,newProduct:{reducer:(e,t)=>t.payload,prepare:e=>({payload:{id:i.a.generateGUID(),name:"",handle:"",description:"",categories:[],tags:[],images:[],priceTaxExcl:0,priceTaxIncl:0,taxRate:0,comparedPrice:0,quantity:0,sku:"",width:"",height:"",depth:"",weight:"",extraShippingFee:0,active:!0}})}},extraReducers:{[o.fulfilled]:(e,t)=>t.payload,[l.fulfilled]:(e,t)=>t.payload,[s.fulfilled]:(e,t)=>null}}),{newProduct:p,resetProduct:u}=d.actions;t.a=d.reducer},1200:function(e,t,a){"use strict";a.d(t,"b",(function(){return i})),a.d(t,"c",(function(){return l}));var r=a(19),c=a(50),n=a.n(c);const i=Object(r.b)("eCommerceApp/order/getOrder",(async e=>{const t=await n.a.get("/api/e-commerce-app/order",{params:e}),a=await t.data;return void 0===a?null:a})),o=Object(r.b)("eCommerceApp/order/saveOrder",(async e=>{const t=await n.a.post("/api/e-commerce-app/order/save",e);return await t.data})),s=Object(r.d)({name:"eCommerceApp/order",initialState:null,reducers:{resetOrder:()=>null},extraReducers:{[i.fulfilled]:(e,t)=>t.payload,[o.fulfilled]:(e,t)=>t.payload}}),{resetOrder:l}=s.actions;t.a=s.reducer},1224:function(e,t,a){"use strict";var r=a(112),c=a(1200),n=a(1182),i=a(1187),o=a(1183);const s=Object(r.c)({products:o.a,product:i.a,orders:n.a,order:c.a});t.a=s},2707:function(e,t,a){"use strict";a.r(t);var r=a(1137),c=a(133),n=a(1224),i=a(1098),o=a(1090),s=a(548),l=a(193),d=a(1099),p=a(194),u=a(1118),b=a(6),m=a(28),j=a(27),h=a(1183),x=a(1);var g=function(e){const t=Object(b.b)(),a=Object(b.c)((e=>{let{eCommerceApp:t}=e;return t.products.searchText})),r=Object(b.c)(j.e);return Object(x.jsxs)("div",{className:"flex flex-1 w-full items-center justify-between",children:[Object(x.jsxs)("div",{className:"flex items-center",children:[Object(x.jsx)(o.a,{component:u.a.span,initial:{scale:0},animate:{scale:1,transition:{delay:.2}},className:"text-24 md:text-32",children:"shopping_basket"}),Object(x.jsx)(p.a,{component:u.a.span,initial:{x:-20},animate:{x:0,transition:{delay:.2}},delay:300,className:"hidden sm:flex text-16 md:text-24 mx-12 font-semibold",children:"Products"})]}),Object(x.jsx)("div",{className:"flex flex-1 items-center justify-center px-12",children:Object(x.jsx)(d.a,{theme:r,children:Object(x.jsxs)(l.a,{component:u.a.div,initial:{y:-20,opacity:0},animate:{y:0,opacity:1,transition:{delay:.2}},className:"flex items-center w-full max-w-512 px-8 py-4 rounded-16 shadow",children:[Object(x.jsx)(o.a,{color:"action",children:"search"}),Object(x.jsx)(s.a,{placeholder:"Search",className:"flex flex-1 mx-8",disableUnderline:!0,fullWidth:!0,value:a,inputProps:{"aria-label":"Search"},onChange:e=>t(Object(h.e)(e))})]})})}),Object(x.jsx)(u.a.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0,transition:{delay:.2}},children:Object(x.jsxs)(i.a,{component:m.a,to:"/apps/e-commerce/products/new",className:"whitespace-nowrap",variant:"contained",color:"secondary",children:[Object(x.jsx)("span",{className:"hidden sm:flex",children:"Add New Product"}),Object(x.jsx)("span",{className:"flex sm:hidden",children:"New"})]})})]})},f=a(39),O=a(10),v=a(1165),w=a(1220),y=a(1223),S=a(1199),C=a(2511),k=a(1222),N=a(5),P=a(0),A=a(49),I=a(236),T=a(1028),R=a(1112),H=a(1103),B=a(536),W=a(1092),q=a(1032),D=a(1072),M=a(1221),z=a(2715),V=a(1097);const E=[{id:"image",align:"left",disablePadding:!0,label:"",sort:!1},{id:"name",align:"left",disablePadding:!1,label:"Name",sort:!0},{id:"categories",align:"left",disablePadding:!1,label:"Category",sort:!0},{id:"priceTaxIncl",align:"right",disablePadding:!1,label:"Price",sort:!0},{id:"quantity",align:"right",disablePadding:!1,label:"Quantity",sort:!0},{id:"active",align:"right",disablePadding:!1,label:"Active",sort:!0}],_=Object(D.a)((e=>({actionsButtonWrapper:{background:e.palette.background.paper}})));var F=function(e){const t=_(e),{selectedProductIds:a}=e,r=a.length,[c,n]=Object(P.useState)(null),i=Object(b.b)();function s(){n(null)}return Object(x.jsx)(M.a,{children:Object(x.jsxs)(k.a,{className:"h-48 sm:h-64",children:[Object(x.jsxs)(S.a,{padding:"none",className:"w-40 md:w-64 text-center z-99",children:[Object(x.jsx)(v.a,{indeterminate:r>0&&r<e.rowCount,checked:0!==e.rowCount&&r===e.rowCount,onChange:e.onSelectAllClick}),r>0&&Object(x.jsxs)("div",{className:Object(N.a)("flex items-center justify-center absolute w-64 top-0 ltr:left-0 rtl:right-0 mx-56 h-64 z-10 border-b-1",t.actionsButtonWrapper),children:[Object(x.jsx)(T.a,{"aria-owns":c?"selectedProductsMenu":null,"aria-haspopup":"true",onClick:function(e){n(e.currentTarget)},children:Object(x.jsx)(o.a,{children:"more_horiz"})}),Object(x.jsx)(B.a,{id:"selectedProductsMenu",anchorEl:c,open:Boolean(c),onClose:s,children:Object(x.jsx)(q.a,{children:Object(x.jsxs)(W.a,{onClick:()=>{i(Object(h.c)(a)),e.onMenuItemClick(),s()},children:[Object(x.jsx)(R.a,{className:"min-w-40",children:Object(x.jsx)(o.a,{children:"delete"})}),Object(x.jsx)(H.a,{primary:"Remove"})]})})})]})]}),E.map((t=>{return Object(x.jsx)(S.a,{className:"p-4 md:p-16",align:t.align,padding:t.disablePadding?"none":"normal",sortDirection:e.order.id===t.id&&e.order.direction,children:t.sort&&Object(x.jsx)(V.a,{title:"Sort",placement:"right"===t.align?"bottom-end":"bottom-start",enterDelay:300,children:Object(x.jsx)(z.a,{active:e.order.id===t.id,direction:e.order.direction,onClick:(a=t.id,t=>{e.onRequestSort(t,a)}),className:"font-semibold",children:t.label})})},t.id);var a}),this)]})})};var L=Object(A.k)((function(e){const t=Object(b.b)(),a=Object(b.c)(h.d),r=Object(b.c)((e=>{let{eCommerceApp:t}=e;return t.products.searchText})),[c,n]=Object(P.useState)(!0),[i,s]=Object(P.useState)([]),[l,d]=Object(P.useState)(a),[m,j]=Object(P.useState)(0),[g,A]=Object(P.useState)(10),[T,R]=Object(P.useState)({direction:"asc",id:null});return Object(P.useEffect)((()=>{t(Object(h.b)()).then((()=>n(!1)))}),[t]),Object(P.useEffect)((()=>{0!==r.length?(d(O.a.filter(a,(e=>e.name.toLowerCase().includes(r.toLowerCase())))),j(0)):d(a)}),[a,r]),c?Object(x.jsx)(I.a,{}):0===l.length?Object(x.jsx)(u.a.div,{initial:{opacity:0},animate:{opacity:1,transition:{delay:.1}},className:"flex flex-1 items-center justify-center h-full",children:Object(x.jsx)(p.a,{color:"textSecondary",variant:"h5",children:"There are no products!"})}):Object(x.jsxs)("div",{className:"w-full flex flex-col",children:[Object(x.jsx)(f.a,{className:"flex-grow overflow-x-auto",children:Object(x.jsxs)(w.a,{stickyHeader:!0,className:"min-w-xl","aria-labelledby":"tableTitle",children:[Object(x.jsx)(F,{selectedProductIds:i,order:T,onSelectAllClick:function(e){e.target.checked?s(l.map((e=>e.id))):s([])},onRequestSort:function(e,t){const a=t;let r="desc";T.id===t&&"desc"===T.direction&&(r="asc"),R({direction:r,id:a})},rowCount:l.length,onMenuItemClick:function(){s([])}}),Object(x.jsx)(y.a,{children:O.a.orderBy(l,[e=>"categories"===T.id?e.categories[0]:e[T.id]],[T.direction]).slice(m*g,m*g+g).map((t=>{const a=-1!==i.indexOf(t.id);return Object(x.jsxs)(k.a,{className:"h-72 cursor-pointer",hover:!0,role:"checkbox","aria-checked":a,tabIndex:-1,selected:a,onClick:a=>{return r=t,void e.history.push("/apps/e-commerce/products/".concat(r.id,"/").concat(r.handle));var r},children:[Object(x.jsx)(S.a,{className:"w-40 md:w-64 text-center",padding:"none",children:Object(x.jsx)(v.a,{checked:a,onClick:e=>e.stopPropagation(),onChange:e=>function(e,t){const a=i.indexOf(t);let r=[];-1===a?r=r.concat(i,t):0===a?r=r.concat(i.slice(1)):a===i.length-1?r=r.concat(i.slice(0,-1)):a>0&&(r=r.concat(i.slice(0,a),i.slice(a+1))),s(r)}(0,t.id)})}),Object(x.jsx)(S.a,{className:"w-52 px-4 md:px-0",component:"th",scope:"row",padding:"none",children:t.images.length>0&&t.featuredImageId?Object(x.jsx)("img",{className:"w-full block rounded",src:O.a.find(t.images,{id:t.featuredImageId}).url,alt:t.name}):Object(x.jsx)("img",{className:"w-full block rounded",src:"assets/images/ecommerce/product-image-placeholder.png",alt:t.name})}),Object(x.jsx)(S.a,{className:"p-4 md:p-16",component:"th",scope:"row",children:t.name}),Object(x.jsx)(S.a,{className:"p-4 md:p-16 truncate",component:"th",scope:"row",children:t.categories.join(", ")}),Object(x.jsxs)(S.a,{className:"p-4 md:p-16",component:"th",scope:"row",align:"right",children:[Object(x.jsx)("span",{children:"$"}),t.priceTaxIncl]}),Object(x.jsxs)(S.a,{className:"p-4 md:p-16",component:"th",scope:"row",align:"right",children:[t.quantity,Object(x.jsx)("i",{className:Object(N.a)("inline-block w-8 h-8 rounded mx-8",t.quantity<=5&&"bg-red",t.quantity>5&&t.quantity<=25&&"bg-orange",t.quantity>25&&"bg-green")})]}),Object(x.jsx)(S.a,{className:"p-4 md:p-16",component:"th",scope:"row",align:"right",children:t.active?Object(x.jsx)(o.a,{className:"text-green text-20",children:"check_circle"}):Object(x.jsx)(o.a,{className:"text-red text-20",children:"remove_circle"})})]},t.id)}))})]})}),Object(x.jsx)(C.a,{className:"flex-shrink-0 border-t-1",component:"div",count:l.length,rowsPerPage:g,page:m,backIconButtonProps:{"aria-label":"Previous Page"},nextIconButtonProps:{"aria-label":"Next Page"},onPageChange:function(e,t){j(t)},onRowsPerPageChange:function(e){A(e.target.value)}})]})}));t.default=Object(c.a)("eCommerceApp",n.a)((function(){return Object(x.jsx)(r.a,{classes:{content:"flex",contentCard:"overflow-hidden",header:"min-h-72 h-72 sm:h-136 sm:min-h-136"},header:Object(x.jsx)(g,{}),content:Object(x.jsx)(L,{}),innerScroll:!0})}))}}]);