%PDF- %PDF-
Direktori : /home/opti/public_html/ezone.optisoft.com.ng/ |
Current File : /home/opti/public_html/ezone.optisoft.com.ng/19.64ab6918d5d2c4ac815d.chunk.js |
(window.webpackJsonp=window.webpackJsonp||[]).push([[19],{"9a060dfdd92cb70dcc11":function(e,t,o){"use strict";o.r(t);var r,n=o("8af190b70a6bc55c6f1b"),i=o.n(n),a=(o("8a2d1b95e05b6a321e74"),o("d7dd51e1bf6bfc2c9c3d")),l=o("e95a63b25fb92ed15721"),c=o("0d7f0986bcd2f33d8a2a"),u=o("a28fc3c963a1d4d1a2e5"),d=o("ab4cb61bcb2dc161defb"),s=o("adc20f99e57c573c589c"),f=o("d95b0cf107403b178365"),m=o("df2365f3247c381f4927"),p=o("6d5cf2865bab8c17990d"),b=o("3ee96b90e3c6771f6e6b"),v=o("4dbba5bb0aecfcd6a1c2"),y=o("6a55381db84a511b309a"),g=o.n(y),h=o("979f0bf208cac32de897"),w=o("340a59d39dc0a303b131"),I=o("8eef12c383e3c845d72d"),C=o.n(I),S=o("80e80f602055becd595c"),T=o.n(S),O=o("0d939196e59ed73c94e6"),j=o("5c0e9784aa1783f42087"),x=o.n(j),k=o("23b8d02be40765ac53e3"),A=o("ea0b630a63dab025c838"),N=o.n(A),R=o("0b3cb19af78752326f59");function P(){return(P=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e}).apply(this,arguments)}function D(e,t,o,n){r||(r="function"===typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var i=e&&e.defaultProps,a=arguments.length-3;if(t||0===a||(t={children:void 0}),1===a)t.children=n;else if(a>1){for(var l=new Array(a),c=0;c<a;c++)l[c]=arguments[c+3];t.children=l}if(t&&i)for(var u in i)void 0===t[u]&&(t[u]=i[u]);else t||(t=i||{});return{$$typeof:r,type:e,key:void 0===o?null:""+o,ref:null,props:t,_owner:null}}function G(e,t){if(null==e)return{};var o,r,n=function(e,t){if(null==e)return{};var o,r,n={},i=Object.keys(e);for(r=0;r<i.length;r++)o=i[r],t.indexOf(o)>=0||(n[o]=e[o]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)o=i[r],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function B(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(e)))return;var o=[],r=!0,n=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(o.push(a.value),!t||o.length!==t);r=!0);}catch(e){n=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(n)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return E(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return E(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r}var M={display:"flex",flexDirection:"row",flexWrap:"wrap",marginTop:16},L={display:"inline-flex",borderRadius:2,border:"1px solid #eaeaea",marginBottom:8,marginRight:8,width:100,height:100,padding:4,boxSizing:"border-box"},F={display:"flex",minWidth:0,overflow:"hidden"},W={display:"block",width:"auto",height:"100%"},z=R.a.div.withConfig({displayName:"PaperDropzone__Container",componentId:"sc-1lxvlol-0"})(["flex:1;display:flex;flex-direction:column;align-items:center;padding:10px 20px;border-width:2px;border-radius:2px;border-color:",";border-style:dashed;background-color:#fafafa;color:#bdbdbd;outline:none;transition:border 0.24s ease-in-out;"],(function(e){return function(e){return e.isDragAccept?"#00e676":e.isDragReject?"#ff1744":e.isDragActive?"#2196f3":"#eeeeee"}(e)})),$=D("p",{},void 0,"Drag 'n' drop some files here, or click to select files");var H,U=function(e){var t=B(Object(n.useState)([]),2),o=t[0],r=t[1],a=e.uploadFileAction,l=Object(k.useDropzone)({accept:"image/*",noClick:!0,noKeyboard:!0,onDrop:function(e){r(e.map((function(e){return Object.assign(e,{preview:URL.createObjectURL(e)})})));var t={};x()(t,"fileName",e[0].name),x()(t,"format",e[0].type),x()(t,"size",e[0].size),p(e[0],(function(e){return x()(t,"file",e)})),a(t)}}),c=l.open,u=(l.acceptedFiles,l.getRootProps),d=l.getInputProps,s=l.isDragActive,f=l.isDragAccept,m=l.isDragReject,p=function(e,t){var o=new FileReader;o.readAsDataURL(e),o.onload=function(){return t(o.result.split(",")[1])},o.onerror=function(e){console.log("Error: ",e)}},b=u(),v=b.ref,y=G(b,["ref"]),g=o.map((function(e){return D("div",{style:L},e.name,D("div",{style:F},void 0,D("img",{src:e.preview,style:W,alt:""})))}));return Object(n.useEffect)((function(){return function(){o.forEach((function(e){return URL.revokeObjectURL(e.preview)}))}}),[o]),D(N.a,{rootRef:v},void 0,i.a.createElement("div",y,i.a.createElement(z,u({className:"dropzone",isDragActive:s,isDragAccept:f,isDragReject:m}),i.a.createElement("input",P({},d(),{multiple:!1})),$,D("button",{type:"button",onClick:c},void 0,"Open File Dialog")),D("aside",{style:M},void 0,g)))};function _(){return(_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e}).apply(this,arguments)}function K(e,t,o,r){H||(H="function"===typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var n=e&&e.defaultProps,i=arguments.length-3;if(t||0===i||(t={children:void 0}),1===i)t.children=r;else if(i>1){for(var a=new Array(i),l=0;l<i;l++)a[l]=arguments[l+3];t.children=a}if(t&&n)for(var c in n)void 0===t[c]&&(t[c]=n[c]);else t||(t=n||{});return{$$typeof:H,type:e,key:void 0===o?null:""+o,ref:null,props:t,_owner:null}}function V(e){return function(e){if(Array.isArray(e))return X(e)}(e)||function(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Z(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function q(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function J(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?q(Object(o),!0).forEach((function(t){Y(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):q(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function Y(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function Q(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(e)))return;var o=[],r=!0,n=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(o.push(a.value),!t||o.length!==t);r=!0);}catch(e){n=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(n)throw i}}return o}(e,t)||Z(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Z(e,t){if(e){if("string"===typeof e)return X(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?X(e,t):void 0}}function X(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r}var ee=Object(O.makeStyles)((function(e){return{root:{flexGrow:1},grid:{justifyContent:"center",alignItems:"center"},card:{boxShadow:e.shadows[0],"& .MuiCardActions-root":{justifyContent:"flex-end","& button":{marginLeft:e.spacing(1)}}},table:{whiteSpace:"nowrap",display:"flex","& td, th":{borderBottom:0}},title:{fontWeight:e.typography.fontWeightMedium}}})),te=[{id:1,value:"STOCK_ITEM",label:"Stock"},{id:2,value:"COMPONENT_ITEM",label:"Component"}],oe={barcode:"",costPrice:"",description:"",state:"",itemDimension:"",itemName:"",itemCategory:"",itemType:"",itemWeight:"",manufacturer:"",quantity:"",sellingPrice:"",sku:"",unit:"",wareHouseId:"",vendorId:"",orgId:"",componentItemIds:null,inventoryAccountId:"",taxAccountId:"",salesAccountId:"",purchaseAccountId:"",attachments:[]},re=K(O.Divider,{}),ne=K(O.FormLabel,{component:"legend"},void 0,"Item Type"),ie=K(O.Radio,{color:"primary"}),ae=K(O.Radio,{color:"primary"}),le=K(O.ListItemText,{primary:"Accounting"}),ce=K(C.a,{}),ue=K(T.a,{}),de=K(O.Button,{color:"primary",variant:"outlined",size:"small"},void 0,"Cancel"),se=K(O.CircularProgress,{size:20}),fe=Object(u.b)({loading:m.r(),message:m.s(),dialog:m.p(),warehouses:m.i(),accounts:m.b(),vendors:m.n(),itemById:m.k(),getAllItems:m.d()});var me,pe=Object(a.connect)(fe,(function(e){return{createNewItem:function(t){return e(v.j(t))},updateItem:function(t){return e(v.ib(t))}}})),be=Object(d.compose)(l.withRouter,pe,n.memo)((function(e){var t,o,r,a,l,c,u,d,s=e.match,f=e.loading,m=e.dialog,p=e.accounts,b=e.vendors,v=e.warehouses,y=e.getAllItems,I=e.createNewItem,C=e.updateItem,S=e.itemById,T=ee(),j=Q(i.a.useState(J({},oe)),2),x=j[0],k=j[1],A=Q(i.a.useState(!1),2),N=A[0],R=A[1],P=function(e){return function(t){k(J(J({},x),{},Y({},e,t.target.value)))}},D=function(e){return function(t,o){k(J(J({},x),{},Y({},e,"itemCategory"===e?o.value:o.id)))}},G=s.params;return Object(n.useEffect)((function(){if("edit"===m.type&&m.data){var e=h.a.matchWithPairs(J({},oe),m.data),t=m.data,o=t.id,r=t.componentItems,n=t.wareHouseUuid,i=Object.assign({},x,e,{id:o,wareHouseId:n,componentItemIds:r});k(i)}else k(J({},oe))}),[]),Object(n.useEffect)((function(){}),[S]),console.log(x,"values item"),console.log(f,"loading item"),K("div",{className:T.root},void 0,K(O.Grid,{container:!0,className:T.grid},void 0,K(O.Grid,{item:!0,xs:12},void 0,K(O.Card,{square:!0,className:T.card},void 0,K(O.CardContent,{},void 0,K(O.Typography,{variant:"h6",className:T.title},void 0,"new"===G.status?"New Item":"Edit Item")),re,K(O.CardContent,{},void 0,K(O.Grid,{container:!0,spacing:2},void 0,K(O.Grid,{item:!0,xs:12},void 0,K(O.Table,{size:"small",className:T.table},void 0,K(O.TableBody,{},void 0,K(O.TableRow,{},void 0,K(O.TableCell,{colSpan:2},void 0,K(O.FormControl,{component:"fieldset"},void 0,ne,K(O.RadioGroup,{row:!0,"aria-label":"position",name:"position",value:x.itemType},void 0,K(O.FormControlLabel,{value:"GOODS",control:ie,label:"Goods",onChange:P("itemType")}),K(O.FormControlLabel,{value:"SERVICE",control:ae,label:"Service",onChange:P("itemType")}))))),K(O.TableRow,{},void 0,K(O.TableCell,{},void 0,K(O.TextField,{id:"outlined-item-name",size:"small",label:"Item Name",value:x.itemName,onChange:P("itemName"),variant:"outlined"})),K(O.TableCell,{},void 0,K(O.TextField,{id:"outlined-sku",size:"small",label:"SKU",value:x.sku,onChange:P("sku"),variant:"outlined"}))),K(O.TableRow,{},void 0,K(O.TableCell,{},void 0,K(O.TextField,{id:"outlined-barcode",size:"small",label:"Barcode",value:x.barcode,onChange:P("barcode"),variant:"outlined"})),K(O.TableCell,{},void 0,K(O.TextField,{id:"outlined-Unit",size:"small",label:"Unit",value:x.unit,onChange:P("unit"),variant:"outlined"}))),K(O.TableRow,{},void 0,K(O.TableCell,{colSpan:2},void 0,K(U,{uploadFileAction:function(e){k(J(J({},x),{},{attachments:[].concat(V(x.attachments),[e])}))}}))),K(O.TableRow,{},void 0,K(O.TableCell,{colSpan:"2"},void 0,K(O.TextField,{id:"outlined-Manufacturer",size:"small",fullWidth:!0,name:"manufacturer",label:"Manufacturer",value:x.manufacturer,onChange:P("manufacturer"),variant:"outlined"}))),K(O.TableRow,{},void 0,K(O.TableCell,{},void 0,K(O.TextField,{id:"outlined-quantity",size:"small",fullWidth:!0,label:"Quantity",value:x.quantity,onChange:P("quantity"),variant:"outlined"})),K(O.TableCell,{},void 0,K(O.TextField,{id:"outlined-dimensions",size:"small",fullWidth:!0,label:"Dimensions (cm)",value:x.itemDimension,onChange:P("itemDimension"),variant:"outlined"}))),K(O.TableRow,{},void 0,K(O.TableCell,{},void 0,K(O.TextField,{id:"outlined-weight",size:"small",fullWidth:!0,label:"Weight (kg)",value:x.itemWeight,onChange:P("itemWeight"),variant:"outlined"})),K(O.TableCell,{},void 0,K(O.TextField,{id:"outlined-selling-price",size:"small",fullWidth:!0,label:"Selling Price",value:x.sellingPrice,onChange:P("sellingPrice"),variant:"outlined"}))),K(O.TableRow,{},void 0,K(O.TableCell,{colSpan:"2"},void 0,K(w.Autocomplete,{multiple:!0,id:"combo-component-item-ids",size:"small",options:y,getOptionLabel:function(e){return e.itemName},onChange:(d="componentItemIds",function(e,t){k(J(J({},x),{},Y({},d,t)))}),value:x.componentItemIds?x.componentItemIds:[],renderInput:function(e){return i.a.createElement(O.TextField,_({},e,{label:"Select Items",variant:"outlined",fullWidth:!0,placeholder:"Items"}))}}))),K(O.TableRow,{},void 0,K(O.TableCell,{},void 0,K(O.TextField,{id:"outlined-cost-price",size:"small",label:"Cost Price",value:x.costPrice,onChange:P("costPrice"),variant:"outlined"})),K(O.TableCell,{},void 0,K(w.Autocomplete,{id:"combo-item-category",size:"small",options:te,getOptionLabel:function(e){return e.label},onChange:D("itemCategory"),value:x.itemCategory?g()(te,{value:x.itemCategory}):null,renderInput:function(e){return i.a.createElement(O.TextField,_({},e,{label:"Select Category",variant:"outlined",fullWidth:!0,placeholder:"Category"}))}}))),K(O.TableRow,{},void 0,K(O.TableCell,{colSpan:"2"},void 0,K(w.Autocomplete,{id:"combo-item-vendor",size:"small",options:b,getOptionLabel:function(e){return e.fullName},onChange:D("vendorId"),value:x.vendorId?g()(b,{id:x.vendorId}):null,renderInput:function(e){return i.a.createElement(O.TextField,_({},e,{label:"Select Vendor",variant:"outlined",fullWidth:!0,placeholder:"Vendors"}))}}))),K(O.TableRow,{},void 0,K(O.TableCell,{},void 0,K(O.TextField,{id:"outlined-state",size:"small",name:"state",label:"State",value:x.state,onChange:P("state"),variant:"outlined"})),K(O.TableCell,{},void 0,K(w.Autocomplete,{id:"combo-warehouse-id",size:"small",options:v,getOptionLabel:function(e){return e.name},onChange:D("wareHouseId"),value:x.wareHouseId?g()(v,{uuid:x.wareHouseId}):null,renderInput:function(e){return i.a.createElement(O.TextField,_({},e,{label:"Select WareHouse",variant:"outlined",placeholder:"WareHouse"}))}}))),K(O.TableRow,{},void 0,K(O.TableCell,{colSpan:2},void 0,K(O.TextField,{id:"standard-description",size:"small",label:"Description",variant:"outlined",value:x.description?x.description:"",onChange:P("description"),margin:"normal",fullWidth:!0,rows:2,multiline:!0}))),K(O.TableRow,{},void 0,K(O.TableCell,{colSpan:"2"},void 0,K(O.List,{},void 0,K(O.ListItem,{button:!0,onClick:function(){R(!N)},dense:!0},void 0,le,N?ce:ue),K(O.Collapse,{in:N,timeout:"auto",unmountOnExit:!0},void 0,K(w.Autocomplete,{id:"combo-inventory-accounts",size:"small",options:p,getOptionLabel:function(e){return e.accountName},onChange:D("inventoryAccountId"),value:x.inventoryAccountId?g()(p,{id:x.inventoryAccountId}):null,renderInput:function(e){return i.a.createElement(O.TextField,_({},e,{margin:"normal",label:"Select Inventory Account",variant:"outlined",fullWidth:!0,placeholder:"Accounts"}))}}),K(w.Autocomplete,{id:"combo-sales-accounts",size:"small",options:p,getOptionLabel:function(e){return e.accountName},onChange:D("salesAccountId"),value:x.salesAccountId?g()(p,{id:x.salesAccountId}):null,renderInput:function(e){return i.a.createElement(O.TextField,_({},e,{label:"Select Sales Account",margin:"normal",variant:"outlined",fullWidth:!0,placeholder:"Accounts"}))}}),K(w.Autocomplete,{id:"combo-purchase-accounts",size:"small",options:p,getOptionLabel:function(e){return e.accountName},onChange:D("purchaseAccountId"),value:x.purchaseAccountId?g()(p,{id:x.purchaseAccountId}):null,renderInput:function(e){return i.a.createElement(O.TextField,_({},e,{label:"Select Purchase Account",margin:"normal",variant:"outlined",fullWidth:!0,placeholder:"Accounts"}))}}),K(w.Autocomplete,{id:"combo-tax-accounts",size:"small",options:p,getOptionLabel:function(e){return e.accountName},onChange:D("taxAccountId"),value:x.taxAccountId?g()(p,{id:x.taxAccountId}):null,renderInput:function(e){return i.a.createElement(O.TextField,_({},e,{margin:"normal",label:"Select Tax Account",variant:"outlined",fullWidth:!0,placeholder:"Accounts"}))}})))))))))),K(O.CardActions,{},void 0,de,K(O.Button,{onClick:function(){"new"===m.type?I(x):C(x)},color:"primary",variant:"contained",size:"small",disabled:f||(t=x.itemName,o=x.itemType,r=x.description,a=x.costPrice,l=x.itemCategory,c=x.wareHouseId,u=x.manufacturer,!(t.length>0&&o.length>0&&r.length>0&&a&&u.length>0&&c&&l.length>0)),endIcon:f&&se},void 0,"new"===m.type?"Save":"Update Item"))))))})),ve=o("6938d226fd372a75cbf9"),ye=o("a9d46fa1f298693c7c0e"),ge=o("c0459d6a931679ecbbc6"),he=o.n(ge),we=o("bf95d08a577daedf0222"),Ie=o.n(we),Ce=o("dd46c28ea7213527e0e6"),Se=o.n(Ce),Te=o("616d6d831a8998e0ea12"),Oe=o.n(Te),je=o("c233babf320cd068509e"),xe=o.n(je);function ke(e,t,o,r){me||(me="function"===typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var n=e&&e.defaultProps,i=arguments.length-3;if(t||0===i||(t={children:void 0}),1===i)t.children=r;else if(i>1){for(var a=new Array(i),l=0;l<i;l++)a[l]=arguments[l+3];t.children=a}if(t&&n)for(var c in n)void 0===t[c]&&(t[c]=n[c]);else t||(t=n||{});return{$$typeof:me,type:e,key:void 0===o?null:""+o,ref:null,props:t,_owner:null}}function Ae(){return(Ae=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e}).apply(this,arguments)}function Ne(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(e)))return;var o=[],r=!0,n=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(o.push(a.value),!t||o.length!==t);r=!0);}catch(e){n=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(n)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return Re(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return Re(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Re(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r}var Pe,De=Object(ve.makeStyles)((function(e){return{flex:{display:"flex",justifyContent:"space-between",alignItems:"center"},list:{"& .MuiListItemIcon-root":{minWidth:"40px !important"}}}})),Ge=ke(Se.a,{}),Be=ke(xe.a,{}),Ee=ke(O.ListItemIcon,{},void 0,ke(Oe.a,{})),Me=Object(l.withRouter)((function(e){e.history;var t=e.items,o=e.handleItemById,r=e.handleNewClick,n=e.selectedIndex,a=De(),l=Ne(i.a.useState(!1),2),c=l[0],u=l[1],d=i.a.useRef(null),s=i.a.useRef(c);i.a.useEffect((function(){!0===s.current&&!1===c&&d.current.focus(),s.current=c}),[c]);var f=Ie()(t,["dateCreated"],["desc"]),m=function(e){d.current&&d.current.contains(e.target)||u(!1)},p=ke(O.Paper,{},void 0,ke(O.ClickAwayListener,{onClickAway:m},void 0,ke(O.MenuList,{autoFocusItem:c,id:"menu-list-grow",onKeyDown:function(e){"Tab"===e.key&&(e.preventDefault(),u(!1))}},void 0,ke(O.MenuItem,{onClick:m},void 0,"All"),ke(O.MenuItem,{onClick:m},void 0,"Filter 1"),ke(O.MenuItem,{onClick:m},void 0,"Filter 2"))));return ke("div",{},void 0,ke(O.List,{className:a.list,component:"nav",subheader:ke(O.ListSubheader,{component:"div",id:"nested-list-subheader"},void 0,ke("div",{className:a.flex},void 0,ke("div",{},void 0,i.a.createElement(O.Button,{ref:d,"aria-controls":c?"menu-list-grow":void 0,"aria-haspopup":"true",onClick:function(){u((function(e){return!e}))},size:"small",endIcon:Ge},"All Items"),ke(O.Popper,{open:c,anchorEl:d.current,role:void 0,transition:!0,disablePortal:!0},void 0,(function(e){var t=e.TransitionProps,o=e.placement;return i.a.createElement(O.Grow,Ae({},t,{style:{transformOrigin:"bottom"===o?"center top":"center bottom"}}),p)}))),ke(O.Button,{variant:"contained",size:"small",color:"primary",startIcon:Be,onClick:r,disableElevation:!0},void 0,"Add")))},void 0,f&&t.map((function(e){return ke(O.ListItem,{disableRipple:!0,button:!0,selected:n==e.id,onClick:function(){return o(e.id,e.sku)}},e.id,Ee,ke(O.ListItemText,{primary:e.itemName}))}))))})),Le=o("aeaca52f6069b4b4887e"),Fe=o.n(Le),We=o("c5b4c3ec8e8fb2fcea62"),ze=o.n(We);function $e(e,t,o,r){Pe||(Pe="function"===typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var n=e&&e.defaultProps,i=arguments.length-3;if(t||0===i||(t={children:void 0}),1===i)t.children=r;else if(i>1){for(var a=new Array(i),l=0;l<i;l++)a[l]=arguments[l+3];t.children=a}if(t&&n)for(var c in n)void 0===t[c]&&(t[c]=n[c]);else t||(t=n||{});return{$$typeof:Pe,type:e,key:void 0===o?null:""+o,ref:null,props:t,_owner:null}}var He,Ue=Object(ve.makeStyles)((function(e){return{icon:{color:e.palette.grey[800],"&.approved":{color:e.palette.primary.main},"&.inProgress":{color:ye.orange[500]},"&.done":{color:ye.green[500]}},buttonGroup:{textAlign:"right"}}})),_e=Object(l.withRouter)((function(e){var t=e.history,o=e.itemById,r=e.openEditItemDialog,n=Ue();return $e("div",{className:n.buttonGroup},void 0,$e(O.ButtonGroup,{size:"small","aria-label":"small outlined button group"},void 0,$e(O.Button,{onClick:function(){r(o),t.push("/inventory/item/".concat(o.id,"/").concat(o.sku,"/edit"))},startIcon:$e(ze.a,{className:n.icon})},void 0,"Edit"),$e(O.Button,{onClick:function(){},startIcon:$e(Fe.a,{className:n.icon})},void 0,"Adjust Stock"),$e(O.Button,{endIcon:$e(Se.a,{className:n.icon})},void 0,"More")))})),Ke=o("9d5a6558444d5fcb3bac"),Ve=o.n(Ke),qe=o("6e7cb9018586e5f4d7d3"),Je=o.n(qe),Ye=o("b77766ff4c3033f1a334"),Qe=o.n(Ye);function Ze(){return(Ze=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e}).apply(this,arguments)}function Xe(e,t,o,r){He||(He="function"===typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var n=e&&e.defaultProps,i=arguments.length-3;if(t||0===i||(t={children:void 0}),1===i)t.children=r;else if(i>1){for(var a=new Array(i),l=0;l<i;l++)a[l]=arguments[l+3];t.children=a}if(t&&n)for(var c in n)void 0===t[c]&&(t[c]=n[c]);else t||(t=n||{});return{$$typeof:He,type:e,key:void 0===o?null:""+o,ref:null,props:t,_owner:null}}function et(e,t){if(null==e)return{};var o,r,n=function(e,t){if(null==e)return{};var o,r,n={},i=Object.keys(e);for(r=0;r<i.length;r++)o=i[r],t.indexOf(o)>=0||(n[o]=e[o]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)o=i[r],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function tt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(e)))return;var o=[],r=!0,n=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(o.push(a.value),!t||o.length!==t);r=!0);}catch(e){n=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(n)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return ot(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return ot(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ot(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r}var rt={display:"flex",flexDirection:"row",flexWrap:"wrap",marginTop:16},nt={display:"inline-flex",borderRadius:2,border:"1px solid #eaeaea",marginBottom:8,marginRight:8,width:100,height:100,padding:4,boxSizing:"border-box"},it={display:"flex",minWidth:0,overflow:"hidden"},at={display:"block",width:"auto",height:"100%"},lt=R.a.div.withConfig({displayName:"ReactDropZone__Container",componentId:"sc-6c1mc5-0"})(["flex:1;display:flex;flex-direction:column;align-items:center;padding:50px;border-width:2px;border-radius:2px;border-color:",";border-style:dashed;background-color:#fafafa;color:#bdbdbd;outline:none;transition:border .24s ease-in-out;"],(function(e){return function(e){return e.isDragAccept?"#00e676":e.isDragReject?"#ff1744":e.isDragActive?"#2196f3":"#eeeeee"}(e)})),ct=Xe("p",{},void 0,"Drag 'n' drop some files here, or click to select files");var ut,dt=function(e){var t=tt(Object(n.useState)([]),2),o=t[0],r=t[1],a=e.uploadFileAction,l=Object(k.useDropzone)({accept:"image/*",noClick:!0,noKeyboard:!0,onDrop:function(e){r(e.map((function(e){return Object.assign(e,{preview:URL.createObjectURL(e)})})));var t=[],o={};x()(o,"fileName",e[0].name),x()(o,"format",e[0].type),x()(o,"size",e[0].size),p(e[0],(function(e){return x()(o,"file",e)})),t.push(o),a(t)}}),c=l.open,u=(l.acceptedFiles,l.getRootProps),d=l.getInputProps,s=l.isDragActive,f=l.isDragAccept,m=l.isDragReject,p=function(e,t){var o=new FileReader;o.readAsDataURL(e),o.onload=function(){return t(o.result.split(",")[1])},o.onerror=function(e){console.log("Error: ",e)}},b=u(),v=b.ref,y=et(b,["ref"]),g=o.map((function(e){return Xe("div",{style:nt},e.name,Xe("div",{style:it},void 0,Xe("img",{src:e.preview,style:at})))}));return Object(n.useEffect)((function(){return function(){o.forEach((function(e){return URL.revokeObjectURL(e.preview)}))}}),[o]),console.log(o,"files state library"),Xe(N.a,{rootRef:v},void 0,i.a.createElement("div",y,i.a.createElement(lt,u({className:"dropzone",isDragActive:s,isDragAccept:f,isDragReject:m}),i.a.createElement("input",Ze({},d(),{multiple:!1})),ct,Xe("button",{type:"button",onClick:c},void 0,"Open File Dialog")),Xe("aside",{style:rt},void 0,g)))};function st(e,t,o,r){ut||(ut="function"===typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var n=e&&e.defaultProps,i=arguments.length-3;if(t||0===i||(t={children:void 0}),1===i)t.children=r;else if(i>1){for(var a=new Array(i),l=0;l<i;l++)a[l]=arguments[l+3];t.children=a}if(t&&n)for(var c in n)void 0===t[c]&&(t[c]=n[c]);else t||(t=n||{});return{$$typeof:ut,type:e,key:void 0===o?null:""+o,ref:null,props:t,_owner:null}}var ft,mt=Object(ve.makeStyles)((function(e){return{table2:{"& .MuiTableHead-root":{"& .MuiTableCell-head":{fontWeight:e.typography.fontWeightBold}},"& .MuiTableCell-root":{border:"1px solid ".concat(e.palette.divider," !important")},"& th.MuiTableCell-root":{fontWeight:e.typography.fontWeightMedium,color:e.palette.text.secondary}}}})),pt=st(O.TableHead,{},void 0,st(O.TableRow,{},void 0,st(O.TableCell,{rowSpan:2,align:"center"},void 0,"WAREHOUSE NAME"),st(O.TableCell,{colSpan:3,align:"center"},void 0,"ACCOUNTING STOCK")),st(O.TableRow,{},void 0,st(O.TableCell,{align:"center"},void 0,"STOCK ON HAND"),st(O.TableCell,{align:"center"},void 0,"COMMITTED STOCK"),st(O.TableCell,{align:"center"},void 0,"AVAILABLE FOR SALE"))),bt=function(e){var t=e.stockLocations,o=mt();return st(O.Table,{className:o.table2,size:"small","aria-label":"custom table"},void 0,pt,st(O.TableBody,{},void 0,t&&t.map((function(e,t){return st(O.TableRow,{},t,st(O.TableCell,{component:"th"},void 0,e.warehouseName),st(O.TableCell,{align:"right"},void 0,e.stockOnHand),st(O.TableCell,{align:"right"},void 0,e.committedStock),st(O.TableCell,{align:"right"},void 0,e.availableForSale))}))))};function vt(e,t,o,r){ft||(ft="function"===typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var n=e&&e.defaultProps,i=arguments.length-3;if(t||0===i||(t={children:void 0}),1===i)t.children=r;else if(i>1){for(var a=new Array(i),l=0;l<i;l++)a[l]=arguments[l+3];t.children=a}if(t&&n)for(var c in n)void 0===t[c]&&(t[c]=n[c]);else t||(t=n||{});return{$$typeof:ft,type:e,key:void 0===o?null:""+o,ref:null,props:t,_owner:null}}function yt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(e)))return;var o=[],r=!0,n=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(o.push(a.value),!t||o.length!==t);r=!0);}catch(e){n=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(n)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return gt(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return gt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gt(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r}var ht,wt=Object(ve.makeStyles)((function(e){return{root:{flexGrow:1},flex:{display:"flex",justifyContent:"space-between",alignItems:"center"},table:{"& .MuiTableHead-root":{"& .MuiTableCell-head":{fontWeight:e.typography.fontWeightBold,borderBottom:"1px solid ".concat(e.palette.divider," !important")}},"& .MuiTableCell-root":{border:"none !important","& button:nth-child(n+2)":{marginLeft:e.spacing(1)}},"& th.MuiTableCell-root":{fontWeight:e.typography.fontWeightMedium,color:e.palette.text.secondary}},table2:{"& .MuiTableHead-root":{"& .MuiTableCell-head":{fontWeight:e.typography.fontWeightBold}},"& .MuiTableCell-root":{border:"1px solid ".concat(e.palette.divider," !important")},"& th.MuiTableCell-root":{fontWeight:e.typography.fontWeightMedium,color:e.palette.text.secondary}},gridList:{width:"100%",height:250},toolbar:e.mixins.toolbar,drawerPaper:{width:"100%"},content:{flexGrow:1},tabs:{minHeight:36,"& .MuiTabs-flexContainer":{justifyContent:"flex-end"},"& .Mui-selected":{color:e.palette.secondary.contrastText,background:e.palette.primary.main},"& .MuiTab-root":{minHeight:36}}}})),It=vt(O.TableCell,{component:"th",scope:"row"},void 0,"SKU"),Ct=vt(O.TableCell,{component:"th",scope:"row"},void 0,"Unit"),St=vt(O.TableCell,{component:"th",scope:"row"},void 0,"Manufacturer"),Tt=vt(O.TableHead,{},void 0,vt(O.TableRow,{},void 0,vt(O.TableCell,{colSpan:2},void 0,"Product Information"))),Ot=vt(O.TableCell,{component:"th",scope:"row"},void 0,"Cost Price "),jt=vt(O.TableHead,{},void 0,vt(O.TableRow,{},void 0,vt(O.TableCell,{colSpan:2},void 0,"Sales Information"))),xt=vt(O.TableCell,{component:"th",scope:"row"},void 0,"Selling Price"),kt=vt(O.TableHead,{},void 0,vt(O.TableRow,{},void 0,vt(O.TableCell,{},void 0,"Item Description"))),At=vt(O.Typography,{variant:"h6",gutterBottom:!0},void 0,"Stock Locations "),Nt=vt(O.Tab,{label:"Acccounting Stock"}),Rt=vt(O.Tab,{label:"Physical Stock"}),Pt=vt("div",{}),Dt=vt(O.ListSubheader,{component:"div"},void 0,"Attachment Preview"),Gt=vt(O.ListSubheader,{component:"div"},void 0,"There are no Attachment"),Bt=vt(Qe.a,{}),Et=vt(O.TableCell,{component:"th",scope:"row"},void 0,"Stock on hand"),Mt=vt(O.TableCell,{component:"th",scope:"row"},void 0,"Committed Stock"),Lt=vt(O.TableCell,{component:"th",scope:"row"},void 0,"Available on Sale"),Ft=vt(Je.a,{variant:"rect",animation:"wave",width:"100%",height:118}),Wt=function(e){var t=e.stockLocations,o=e.itemById,r=wt(),n=yt(i.a.useState(0),2),a=n[0],l=n[1];return vt("div",{className:r.root},void 0,o?vt(O.Grid,{container:!0},void 0,vt(O.Grid,{item:!0,xs:9},void 0,vt(O.Table,{className:r.table,size:"small","aria-label":"custom table"},void 0,vt(O.TableBody,{},void 0,vt(O.TableRow,{},void 0,It,vt(O.TableCell,{align:"right"},void 0,o.sku)),vt(O.TableRow,{},void 0,Ct,vt(O.TableCell,{align:"right"},void 0,o.unit)),vt(O.TableRow,{},void 0,St,vt(O.TableCell,{align:"right"},void 0,o.manufacturer)))),vt(O.Table,{className:r.table,size:"small","aria-label":"custom table"},void 0,Tt,vt(O.TableBody,{},void 0,vt(O.TableRow,{},void 0,Ot,vt(O.TableCell,{align:"right"},void 0,o.costPrice)))),vt(O.Table,{className:r.table,size:"small","aria-label":"custom table"},void 0,jt,vt(O.TableBody,{},void 0,vt(O.TableRow,{},void 0,xt,vt(O.TableCell,{align:"right"},void 0,o.sellingPrice)))),vt(O.Table,{className:r.table,size:"small","aria-label":"custom table"},void 0,kt,vt(O.TableBody,{},void 0,vt(O.TableRow,{},void 0,vt(O.TableCell,{component:"th"},void 0,o.description)))),vt(O.Box,{p:1,mt:2},void 0,At,vt(O.Paper,{square:!0,elevation:0},void 0,vt(O.Tabs,{className:r.tabs,value:a,indicatorColor:"primary",textColor:"primary",onChange:function(e,t){l(t)},"aria-label":"stocks tabs"},void 0,Nt,Rt)),0===a&&vt(bt,{stockLocations:t}),1===a&&Pt)),vt(O.Grid,{item:!0,xs:3},void 0,vt("div",{},void 0,vt(O.GridList,{cellHeight:180,className:r.gridList},void 0,vt(O.GridListTile,{cols:2,style:{height:"auto"}},"Subheader",o.itemsImages&&o.itemsImages.length>0?Dt:Gt),o.itemsImages&&o.itemsImages.map((function(e,t){return vt(O.GridListTile,{cols:2},t,vt("img",{src:e.fileUrl,alt:e.fileName}),vt(O.GridListTileBar,{title:e.fileName}))}))),vt(dt,{uploadFileAction:function(){}})),vt(O.Paper,{square:!0,elevation:0},void 0,[{name:"Accounting Stock"},{name:"Physical Stock"}].map((function(e,o){return vt(O.Table,{className:r.table,size:"small","aria-label":"custom table"},o,vt(O.TableHead,{},void 0,vt(O.TableRow,{},void 0,vt(O.TableCell,{colSpan:2},void 0,e.name,Bt))),vt(O.TableBody,{},void 0,vt(O.TableRow,{},void 0,Et,vt(O.TableCell,{align:"left"},void 0,Ve()(t,"stockOnHand"))),vt(O.TableRow,{},void 0,Mt,vt(O.TableCell,{align:"left"},void 0,Ve()(t,"committedStock"))),vt(O.TableRow,{},void 0,Lt,vt(O.TableCell,{align:"left"},void 0,Ve()(t,"availableForSale")))))}))))):Ft)};function zt(e,t,o,r){ht||(ht="function"===typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var n=e&&e.defaultProps,i=arguments.length-3;if(t||0===i||(t={children:void 0}),1===i)t.children=r;else if(i>1){for(var a=new Array(i),l=0;l<i;l++)a[l]=arguments[l+3];t.children=a}if(t&&n)for(var c in n)void 0===t[c]&&(t[c]=n[c]);else t||(t=n||{});return{$$typeof:ht,type:e,key:void 0===o?null:""+o,ref:null,props:t,_owner:null}}function $t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(e)))return;var o=[],r=!0,n=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(o.push(a.value),!t||o.length!==t);r=!0);}catch(e){n=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(n)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return Ht(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return Ht(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ht(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r}function Ut(){return(Ut=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e}).apply(this,arguments)}var _t=Object(ve.makeStyles)((function(e){return{root:{flexGrow:1,backgroundColor:e.palette.background.paper},flex:{display:"flex",justifyContent:"space-between",alignItems:"center"},drawer:(t={},o=e.breakpoints.up("sm"),r={display:"flex",flexDirection:"column",width:"100%",flexShrink:0,overflowY:"auto",height:"100vh",borderRight:"1px solid ".concat(e.palette.grey[100]),"& .MuiListSubheader-root":{backgroundColor:e.palette.common.white},"&::-webkit-scrollbar":{width:"6px",backgroundColor:"#F5F5F5"},"&::-webkit-scrollbar-track":{"-webkitBoxShadow":"inset 0 0 6px rgba(0,0,0,0.3)",borderRadius:"10px"},"&::-webkit-scrollbar-thumb":{borderRadius:"10px","-webkit-box-shadow":"inset 0 0 6px rgba(0,0,0,0.5)",backgroundColor:e.palette.primary.main}},o in t?Object.defineProperty(t,o,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[o]=r,t),drawerPaper:{width:"100%"},content:{flexGrow:1},icon:{color:e.palette.grey[800],"&.approved":{color:e.palette.primary.main},"&.inProgress":{color:ye.orange[500]},"&.done":{color:ye.green[500]}},backdrop:{zIndex:e.zIndex.drawer+1,color:"#fff"}};var t,o,r})),Kt=Object(ve.withStyles)({root:{borderBottom:"1px solid #e8e8e8"},indicator:{backgroundColor:"#1890ff"}})(O.Tabs),Vt=Object(ve.withStyles)((function(e){return{root:{textTransform:"none",minWidth:72,fontWeight:e.typography.fontWeightRegular,marginRight:e.spacing(4),fontFamily:["-apple-system","BlinkMacSystemFont",'"Segoe UI"',"Roboto",'"Helvetica Neue"',"Arial","sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"'].join(","),"&:hover":{color:"#40a9ff",opacity:1},"&$selected":{color:"#1890ff",fontWeight:e.typography.fontWeightMedium},"&:focus":{color:"#40a9ff"}},selected:{}}}))((function(e){return i.a.createElement(O.Tab,Ut({disableRipple:!0},e))})),qt=zt(O.CircularProgress,{color:"inherit"}),Jt=zt(O.Hidden,{smUp:!0,implementation:"css"}),Yt=zt(Vt,{label:"Overview"}),Qt=zt(Vt,{label:"Transactions"}),Zt=zt(Vt,{label:"Related List"}),Xt=zt(Vt,{label:"Adjustment"}),eo=zt(Vt,{label:"History"}),to=zt("div",{}),oo=zt("div",{}),ro=Object(u.b)({loading:m.r(),items:m.d(),itemById:m.k(),stockLocations:m.l()});var no,io=Object(a.connect)(ro,(function(e){return{getItemById:function(t){return e(v.J(t))},openNewItemDialog:function(){return e(v.fb())},openEditItemDialog:function(t){return e(v.bb(t))},getStockLocations:function(t){return e(v.S(t))}}})),ao=Object(d.compose)(l.withRouter,io,n.memo)((function(e){var t=_t(),o=e.loading,r=e.history,a=e.items,l=e.match,c=e.getItemById,u=e.itemById,d=e.openNewItemDialog,s=e.openEditItemDialog,f=e.getStockLocations,m=e.stockLocations,p=$t(i.a.useState(0),2),b=p[0],v=p[1],y=$t(i.a.useState(0),2),g=y[0],h=y[1],w=l.params;i.a.useEffect((function(){c(w.itemId),w.sku&&f(w.sku)}),[w.itemId]);return console.log(u,"itemById"),console.log(m,"stockLocations"),console.log(w,"params"),zt("div",{className:t.root},void 0,zt(O.Backdrop,{className:t.backdrop,open:o},void 0,qt),zt(O.Grid,{container:!0,justify:"space-between"},void 0,zt(O.Grid,{item:!0,md:2},void 0,zt("nav",{className:t.drawer,"aria-label":"inventory item"},void 0,Jt,zt(O.Hidden,{xsDown:!0,implementation:"css"},void 0,zt("div",{className:t.drawerPaper},void 0,zt(Me,{items:a,handleItemById:function(t,o){v(t),c(t),f(o),e.history.push({pathname:"/inventory/item/".concat(t,"/").concat(o)})},selectedIndex:b,handleNewClick:function(){d(),r.push("/inventory/items/create/new")}}))))),zt(O.Grid,{item:!0,xs:10},void 0,zt(O.Grid,{container:!0},void 0,zt(O.Grid,{item:!0,xs:12},void 0,zt("div",{className:t.content},void 0,zt(O.Box,{p:2},void 0,zt("div",{className:t.flex},void 0,zt(O.Typography,{variant:"h6"},void 0,u&&u.itemName),zt(_e,{openEditItemDialog:s,itemById:u})),zt(O.Breadcrumbs,{"aria-label":"breadcrumb",separator:"\u203a"},void 0,zt(O.Typography,{color:"textPrimary",className:t.link},void 0,"Items"),zt(O.Typography,{color:"textPrimary",className:t.link},void 0,zt(he.a,{className:t.icon})," ",u&&u.itemName))),zt(n.Fragment,{},void 0,zt(Kt,{value:g,onChange:function(e,t){h(t)},"aria-label":"ant example"},void 0,Yt,Qt,Zt,Xt,eo),zt(O.Typography,{className:t.padding}),zt(O.Box,{my:2},void 0,0==g&&zt(Wt,{itemById:u,stockLocations:m}),1==g&&to,2==g&&oo))))))))})),lo=o("b0c37be7de20d933b466"),co=o("d4df020feb07c4f688e4"),uo=o.n(co),so=o("8e4c85c29cdef1bf8a5f"),fo=o("711f9393a7bdb8588a8c"),mo=o("c5fefa80e14e6a26e322"),po=o.n(mo);function bo(e,t,o,r){no||(no="function"===typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var n=e&&e.defaultProps,i=arguments.length-3;if(t||0===i||(t={children:void 0}),1===i)t.children=r;else if(i>1){for(var a=new Array(i),l=0;l<i;l++)a[l]=arguments[l+3];t.children=a}if(t&&n)for(var c in n)void 0===t[c]&&(t[c]=n[c]);else t||(t=n||{});return{$$typeof:no,type:e,key:void 0===o?null:""+o,ref:null,props:t,_owner:null}}var vo=Object(O.makeStyles)((function(e){return{root:{flexGrow:1,backgroundColor:e.palette.background.paper},content:{display:"flex",flexDirection:"column",padding:e.spacing(3,0)},toolbar:{display:"flex",justifyContent:"space-between","& > div":{display:"flex"},"& > div:first-child":{display:"flex",justifyContent:"space-between","& a":{color:e.palette.common.white,marginLeft:"20px",borderRadius:0,textDecoration:"none",display:"flex",alignItems:"center",textTransform:"uppercase",padding:e.spacing(1),"& :hover":{color:Object(lo.fade)(e.palette.common.white,.5),backgroundColor:"red"}}}},active:{backgroundColor:Object(lo.darken)(e.palette.primary.main,.25)}}})),yo=bo(po.a,{});var go=Object(u.b)({});var ho,wo=Object(a.connect)(go,(function(e){return{}})),Io=Object(l.withRouter)(Object(d.compose)(wo,n.memo)((function(e){var t=vo();return bo("div",{className:t.root},void 0,bo(O.AppBar,{position:"relative",color:"secondary"},void 0,bo(O.Toolbar,{variant:"dense",className:t.toolbar},void 0,bo("div",{},void 0,bo(O.IconButton,{"aria-label":"delete",onClick:function(){window.location.reload(!1)}},void 0,yo),bo(l.NavLink,{exact:!0,to:"#",activeClassName:t.active},void 0,"Overview"),bo(l.NavLink,{exact:!0,to:"#",activeClassName:t.active},void 0,"Transactions"),bo(l.NavLink,{exact:!0,to:"#",activeClassName:t.active},void 0,"Related List"),bo(l.NavLink,{exact:!0,to:"#",activeClassName:t.active},void 0,"Adjustments"),bo(l.NavLink,{exact:!0,to:"#",activeClassName:t.active},void 0,"History")))),bo("main",{className:t.content},void 0,bo(O.Grid,{container:!0},void 0,bo(O.Grid,{item:!0,xs:12},void 0,e.children))))})));function Co(e,t,o,r){ho||(ho="function"===typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var n=e&&e.defaultProps,i=arguments.length-3;if(t||0===i||(t={children:void 0}),1===i)t.children=r;else if(i>1){for(var a=new Array(i),l=0;l<i;l++)a[l]=arguments[l+3];t.children=a}if(t&&n)for(var c in n)void 0===t[c]&&(t[c]=n[c]);else t||(t=n||{});return{$$typeof:ho,type:e,key:void 0===o?null:""+o,ref:null,props:t,_owner:null}}function So(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(e)))return;var o=[],r=!0,n=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(o.push(a.value),!t||o.length!==t);r=!0);}catch(e){n=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(n)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return To(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return To(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function To(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r}function Oo(){return(Oo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e}).apply(this,arguments)}var jo=Object(O.makeStyles)((function(e){return{appBar:{position:"relative"},title:{marginLeft:e.spacing(2),flex:1},container:{width:400},textField:{margin:e.spacing(1)},divider:{margin:e.spacing(1),border:"1px solid red"},buttonStyle:{alignItems:"center",justifyContent:"center"}}})),xo=i.a.forwardRef((function(e,t){return i.a.createElement(O.Slide,Oo({direction:"up",ref:t},e))})),ko=Co(fo.Close,{}),Ao=Co(O.Divider,{}),No=Co("div",{},void 0,Co(Io,{},void 0,"welcome")),Ro=Co(so.b,{}),Po=Object(u.b)({loading:m.r(),itemDialog:m.u(),getAllWarehouses:m.i()});var Do,Go=Object(a.connect)(Po,(function(e){return{dispatchCreateNewItemAction:function(t){return e(v.j(t))},closeViewItemDialogAction:function(){return e(v.d())},dispatch:e}}));Object(d.compose)(Go,n.memo)((function(e){var t=e.loading,o=e.itemDialog,r=(e.getAllWarehouses,e.closeViewItemDialogAction),n=(e.closeEditEmployeeDialogAction,e.dispatchCreateNewItemAction),a=jo(),l=So(i.a.useState({barcode:"",costPrice:"",description:"",fileFormat:"",state:"",fileUrl:"",itemDimension:"",itemName:"",itemType:"",itemWeight:"",manufacturer:"",quantity:"",sellingPrice:"",sku:"",unit:"",wareHouseId:"",orgId:"",itemCategory:""}),2),c=l[0];l[1];return console.log(o,"itemDialog"),Co("div",{},void 0,i.a.createElement(O.Dialog,Oo({},o.props,{onClose:r,keepMounted:!0,fullScreen:!0,TransitionComponent:xo,"aria-labelledby":"form-dialog-title"}),Co(O.AppBar,{className:a.appBar},void 0,Co(O.Toolbar,{},void 0,Co(O.IconButton,{edge:"start",color:"inherit",onClick:r,"aria-label":"close"},void 0,ko),Co(O.Typography,{variant:"h6",className:a.title},void 0,"view"===o.type?"".concat(o.data.itemName):""),Co(O.Button,{autoFocus:!0,color:"inherit",onClick:r},void 0,"save"))),Ao,Co(O.DialogContent,{},void 0,"view"===o.type?No:null),Co(O.DialogActions,{},void 0,t?Ro:Co(O.Button,{onClick:function(){n(c)},color:"primary",variant:"contained"},void 0,"Save"),Co(O.Button,{onClick:function(){return r()},color:"primary",variant:"contained"},void 0,"Cancel"))))}));function Bo(e,t,o,r){Do||(Do="function"===typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var n=e&&e.defaultProps,i=arguments.length-3;if(t||0===i||(t={children:void 0}),1===i)t.children=r;else if(i>1){for(var a=new Array(i),l=0;l<i;l++)a[l]=arguments[l+3];t.children=a}if(t&&n)for(var c in n)void 0===t[c]&&(t[c]=n[c]);else t||(t=n||{});return{$$typeof:Do,type:e,key:void 0===o?null:""+o,ref:null,props:t,_owner:null}}var Eo=Object(O.makeStyles)((function(e){return{button:{margin:e.spacing(1)},datatable:{"& .MuiTableRow-root:hover":{cursor:"pointer"},"& .MuiTableHead-root":{"& .MuiTableCell-head":{color:e.palette.common.white},"& .MuiTableCell-root:nth-child(odd)":{backgroundColor:e.palette.primary.main},"& .MuiTableCell-root:nth-child(even)":{backgroundColor:Object(lo.darken)(e.palette.primary.main,.1)}}}}})),Mo=Bo(O.Icon,{}),Lo=Bo(xe.a,{}),Fo=Bo(so.b,{}),Wo=Object(u.b)({loading:m.r(),getAllItems:m.d()});var zo,$o=Object(a.connect)(Wo,(function(e){return{getItemById:function(t){return e(v.J(t))},openNewItemDialog:function(t){return e(v.fb(t))}}})),Ho=Object(d.compose)(l.withRouter,$o,n.memo)((function(e){var t=Eo(),o=e.loading,r=e.history,n=e.getAllItems,a=e.getItemById,l=e.openNewItemDialog,c=function(){l(),r.push("/inventory/items/create/new")},u=function(e,t){r.push("/inventory/item/".concat(e,"/").concat(t))},d=Ie()(n,"dateCreated","desc");console.log(n,"getAllItems");var s=[{name:"id",label:" ",options:{display:"excluded",filter:!0}},{name:"Id",label:"S/N",options:{filter:!0,customBodyRender:function(e,t){return Bo(O.FormControlLabel,{label:t.rowIndex+1,control:Mo})}}},{name:"itemName",label:"Name",options:{filter:!0,sort:!0}},{name:"sku",label:"SKU",options:{filter:!0,sort:!1}},{name:"barcode",label:"Barcode",options:{filter:!0,sort:!1}},{name:"quantity",label:"Stock On Hand",options:{filter:!0,sort:!1}},{name:"id",label:"Action",options:{filter:!0,sort:!1,customBodyRender:function(e){var t=n.find((function(t){return e===t.id}));return Bo(O.Button,{"aria-controls":"simple-menu","aria-haspopup":"true",onClick:function(){return u(t.id,t.sku)}},void 0,"View")}}}],f={filterType:"checkbox",responsive:"scrollMaxHeight",selectableRows:"none",sortOrder:{name:"itemName",direction:"desc"},customToolbar:function(){return Bo(O.Button,{variant:"contained",color:"primary",size:"small",className:t.button,startIcon:Lo,onClick:c},void 0,"New")},onRowClick:function(e,t){a(e[0]),u(e[0],e[3])},elevation:0};return o?Fo:Bo(i.a.Fragment,{},void 0,Bo(uo.a,{className:t.datatable,title:"All Items",data:d,columns:s,options:f}))}));function Uo(e,t,o,r){zo||(zo="function"===typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var n=e&&e.defaultProps,i=arguments.length-3;if(t||0===i||(t={children:void 0}),1===i)t.children=r;else if(i>1){for(var a=new Array(i),l=0;l<i;l++)a[l]=arguments[l+3];t.children=a}if(t&&n)for(var c in n)void 0===t[c]&&(t[c]=n[c]);else t||(t=n||{});return{$$typeof:zo,type:e,key:void 0===o?null:""+o,ref:null,props:t,_owner:null}}var _o=Uo(c.Helmet,{},void 0,Uo("title",{},void 0,"Items"),Uo("meta",{name:"description",content:"Description of Items"}));var Ko=Object(u.b)({itemPage:Object(m.a)()});var Vo,qo=Object(a.connect)(Ko,(function(e){return{}})),Jo=Object(d.compose)(l.withRouter,qo,n.memo)((function(e){Object(f.b)({key:"itemPage",reducer:p.a}),Object(s.b)({key:"itemPage",saga:b.a});var t=e.match.path;return Object(n.useEffect)((function(){}),[]),Uo("div",{},void 0,_o,Uo(n.Fragment,{},void 0,Uo(l.Route,{exact:!0,path:"".concat(t,"/:itemId/:sku"),component:ao}),Uo(l.Route,{exact:!0,path:"".concat(t,"/:itemId/:sku/edit"),component:be})))}));function Yo(e,t,o,r){Vo||(Vo="function"===typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var n=e&&e.defaultProps,i=arguments.length-3;if(t||0===i||(t={children:void 0}),1===i)t.children=r;else if(i>1){for(var a=new Array(i),l=0;l<i;l++)a[l]=arguments[l+3];t.children=a}if(t&&n)for(var c in n)void 0===t[c]&&(t[c]=n[c]);else t||(t=n||{});return{$$typeof:Vo,type:e,key:void 0===o?null:""+o,ref:null,props:t,_owner:null}}var Qo=Object(O.makeStyles)((function(e){return{datatable:{"& .MuiTableRow-root:hover":{cursor:"pointer"},"& .MuiTableHead-root":{"& .MuiTableCell-head":{color:e.palette.common.white},"& .MuiTableCell-root:nth-child(odd)":{backgroundColor:e.palette.primary.main},"& .MuiTableCell-root:nth-child(even)":{backgroundColor:Object(lo.darken)(e.palette.primary.main,.1)}}}}})),Zo=Yo(O.Icon,{}),Xo=Yo(so.b,{}),er=Yo(xe.a,{}),tr=Object(u.b)({loading:m.r(),ItemsGroups:m.f()});var or,rr=Object(a.connect)(tr,(function(e){return{getItemsGroupById:function(t){return e(v.M(t))},openViewItemGroupDialog:function(t){return e(v.gb(t))},openNewItemGroupDialog:function(){return e(v.gb())}}})),nr=Object(d.compose)(l.withRouter,rr,n.memo)((function(e){var t=Qo(),o=e.loading,r=e.history,n=e.match,a=e.ItemsGroups,l=e.openNewItemGroupDialog,c=e.getItemsGroupById,u=function(e){r.push("".concat(n.url,"/").concat(e))},d=Ie()(a,"dateCreated","desc"),s=[{name:"id",label:" ",options:{display:"excluded",filter:!0}},{name:"Id",label:"S/N",options:{filter:!0,customBodyRender:function(e,t){return Yo(O.FormControlLabel,{label:t.rowIndex+1,control:Zo})}}},{name:"groupName",label:"Name",options:{filter:!0,sort:!0}},{name:"groupDescription",label:"Description",options:{filter:!0,sort:!1}},{name:"items",label:"No of Items",options:{filter:!0,sort:!1,customBodyRender:function(e){return e.length}}},{name:"id",label:"Action",options:{filter:!0,sort:!1,customBodyRender:function(e){var t=a.find((function(t){return e===t.id}));return Yo(O.Button,{"aria-controls":"simple-menu","aria-haspopup":"true",onClick:function(e){e.stopPropagation(),u(t.id)}},void 0,"View")}}}],f=Yo(O.Button,{variant:"contained",color:"primary",size:"small",startIcon:er,onClick:l},void 0,"New"),m={filterType:"checkbox",responsive:"scrollMaxHeight",selectableRows:"none",sortOrder:{name:"itemName",direction:"desc"},customToolbar:function(){return f},onRowClick:function(e,t){c(e[0]),u(e[0])},elevation:0};return o?Xo:Yo(i.a.Fragment,{},void 0,Yo(uo.a,{className:t.datatable,title:"All Items Groups",data:d,columns:s,options:m}))}));function ir(e,t,o,r){or||(or="function"===typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var n=e&&e.defaultProps,i=arguments.length-3;if(t||0===i||(t={children:void 0}),1===i)t.children=r;else if(i>1){for(var a=new Array(i),l=0;l<i;l++)a[l]=arguments[l+3];t.children=a}if(t&&n)for(var c in n)void 0===t[c]&&(t[c]=n[c]);else t||(t=n||{});return{$$typeof:or,type:e,key:void 0===o?null:""+o,ref:null,props:t,_owner:null}}function ar(){return(ar=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e}).apply(this,arguments)}function lr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(e)))return;var o=[],r=!0,n=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(o.push(a.value),!t||o.length!==t);r=!0);}catch(e){n=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(n)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return cr(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return cr(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cr(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r}var ur,dr=Object(ve.makeStyles)((function(e){return{flex:{display:"flex",justifyContent:"space-between",alignItems:"center"},list:{"& .MuiListItemIcon-root":{minWidth:"40px !important"}}}})),sr=ir(Se.a,{}),fr=ir(xe.a,{}),mr=ir(O.ListItemIcon,{},void 0,ir(Oe.a,{})),pr=Object(l.withRouter)((function(e){e.history;var t=e.itemsGroups,o=e.handleItemGroupById,r=e.openNewItemGroupDialog,n=e.selectedIndex,a=dr(),l=lr(i.a.useState(!1),2),c=l[0],u=l[1],d=i.a.useRef(null),s=Ie()(t,["dateCreated"],["desc"]),f=function(e){d.current&&d.current.contains(e.target)||u(!1)},m=ir(O.Paper,{},void 0,ir(O.ClickAwayListener,{onClickAway:f},void 0,ir(O.MenuList,{autoFocusItem:c,id:"menu-list-grow",onKeyDown:function(e){"Tab"===e.key&&(e.preventDefault(),u(!1))}},void 0,ir(O.MenuItem,{onClick:f},void 0,"All"),ir(O.MenuItem,{onClick:f},void 0,"Filter 1"),ir(O.MenuItem,{onClick:f},void 0,"Filter 2"))));return ir("div",{},void 0,ir(O.List,{className:a.list,component:"nav",subheader:ir(O.ListSubheader,{component:"div",id:"nested-list-subheader"},void 0,ir("div",{className:a.flex},void 0,ir("div",{},void 0,i.a.createElement(O.Button,{ref:d,"aria-controls":c?"menu-list-grow":void 0,"aria-haspopup":"true",onClick:function(){u((function(e){return!e}))},size:"small",endIcon:sr},"Items Groups"),ir(O.Popper,{open:c,anchorEl:d.current,role:void 0,transition:!0,disablePortal:!0},void 0,(function(e){var t=e.TransitionProps,o=e.placement;return i.a.createElement(O.Grow,ar({},t,{style:{transformOrigin:"bottom"===o?"center top":"center bottom"}}),m)}))),ir(O.IconButton,{variant:"contained",size:"small",color:"primary",onClick:r},void 0,fr)))},void 0,s&&t.map((function(e){return ir(O.ListItem,{disableRipple:!0,button:!0,selected:n==e.id,onClick:function(){return o(e.id)}},e.id,mr,ir(O.ListItemText,{primary:e.groupName}))}))))}));function br(e,t,o,r){ur||(ur="function"===typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var n=e&&e.defaultProps,i=arguments.length-3;if(t||0===i||(t={children:void 0}),1===i)t.children=r;else if(i>1){for(var a=new Array(i),l=0;l<i;l++)a[l]=arguments[l+3];t.children=a}if(t&&n)for(var c in n)void 0===t[c]&&(t[c]=n[c]);else t||(t=n||{});return{$$typeof:ur,type:e,key:void 0===o?null:""+o,ref:null,props:t,_owner:null}}var vr,yr=Object(ve.makeStyles)((function(e){return{icon:{color:e.palette.grey[800],"&.approved":{color:e.palette.primary.main},"&.inProgress":{color:ye.orange[500]},"&.done":{color:ye.green[500]}},buttonGroup:{textAlign:"right"}}})),gr=Object(l.withRouter)((function(e){var t=e.itemsGroup,o=e.openEditItemGroupDialog,r=yr();return br("div",{className:r.buttonGroup},void 0,br(O.ButtonGroup,{size:"small","aria-label":"small outlined button group"},void 0,br(O.Button,{onClick:function(){return o(t)},startIcon:br(ze.a,{className:r.icon})},void 0,"Edit"),br(O.Button,{endIcon:br(Se.a,{className:r.icon})},void 0,"More")))})),hr=o("988b7bbe4d0c07f69a17"),wr=o.n(hr);function Ir(e,t,o,r){vr||(vr="function"===typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var n=e&&e.defaultProps,i=arguments.length-3;if(t||0===i||(t={children:void 0}),1===i)t.children=r;else if(i>1){for(var a=new Array(i),l=0;l<i;l++)a[l]=arguments[l+3];t.children=a}if(t&&n)for(var c in n)void 0===t[c]&&(t[c]=n[c]);else t||(t=n||{});return{$$typeof:vr,type:e,key:void 0===o?null:""+o,ref:null,props:t,_owner:null}}var Cr,Sr=Object(ve.makeStyles)((function(e){return{root:{flexGrow:1},flex:{display:"flex",justifyContent:"space-between",alignItems:"center"},table:{"& .MuiTableHead-root":{"& .MuiTableCell-head":{fontWeight:e.typography.fontWeightBold,borderBottom:"1px solid ".concat(e.palette.divider)}},"& .MuiTableCell-root":{border:"none !important","& button:nth-child(n+2)":{marginLeft:e.spacing(1)}},"& th.MuiTableCell-root":{fontWeight:e.typography.fontWeightMedium,color:e.palette.text.secondary}},table2:{"& .MuiTableHead-root":{"& .MuiTableCell-head":{fontWeight:e.typography.fontWeightBold}},"& .MuiTableCell-root":{border:"1px solid ".concat(e.palette.divider," !important")},"& th.MuiTableCell-root":{fontWeight:e.typography.fontWeightMedium,color:e.palette.text.secondary}},toolbar:e.mixins.toolbar,icon:{"&.status":{color:ye.green[500]}}}})),Tr=Ir(O.TableHead,{},void 0,Ir(O.TableRow,{},void 0,Ir(O.TableCell,{colSpan:2},void 0,"Group Description"))),Or=Ir(O.TableCell,{rowSpan:2,align:"center"},void 0,"ITEM NAME"),jr=Ir(O.TableRow,{},void 0,Ir(O.TableCell,{align:"center"},void 0,"STOCK ON HAND"),Ir(O.TableCell,{align:"center"},void 0,"COMMITTED STOCK"),Ir(O.TableCell,{align:"center"},void 0,"AVAILABLE FOR SALE")),xr=Ir(O.Grid,{item:!0,xs:3}),kr=Ir(Je.a,{variant:"rect",animation:"wave",width:"100%",height:118}),Ar=function(e){var t=e.itemsGroup,o=Sr();return t?Ir("div",{className:o.root},void 0,Object.keys(t).length>0?Ir(O.Grid,{container:!0},void 0,Ir(O.Grid,{item:!0,xs:9},void 0,Ir(O.Table,{className:o.table,size:"small","aria-label":"custom table"},void 0,Tr,Ir(O.TableBody,{},void 0,Ir(O.TableRow,{},void 0,Ir(O.TableCell,{},void 0,t.groupDescription)))),Ir(O.Box,{p:1,mt:2},void 0,Ir(O.Box,{my:1},void 0,Ir("div",{className:o.flex},void 0,Ir(O.Typography,{variant:"subtitle1"},void 0,t.groupName," Items"),Ir(O.ButtonGroup,{size:"small","aria-label":"small outlined button group"},void 0,Ir(O.Button,{variant:"contained",color:"primary",onClick:function(){},disableElevation:!0},void 0,"Items"),Ir(O.Button,{onClick:function(){}},void 0,"Clear")))),Ir(O.Table,{className:o.table2,size:"small","aria-label":"custom table"},void 0,Ir(O.TableHead,{},void 0,Ir(O.TableRow,{},void 0,Or,Ir(O.TableCell,{colSpan:3,align:"center"},void 0,t.groupName.toUpperCase()," ITEMS")),jr),Ir(O.TableBody,{},void 0,t.items&&t.items.map((function(e){return Ir(O.TableRow,{},e.id,Ir(O.TableCell,{component:"th"},void 0,e.itemName),Ir(O.TableCell,{align:"center"},void 0,e.unit),Ir(O.TableCell,{align:"center"},void 0,e.quantity),Ir(O.TableCell,{align:"center"},void 0,Ir(O.Icon,{className:wr()(o.icon,{status:e.status})},void 0,"check")))})))))),xr):kr):null};function Nr(e,t,o,r){Cr||(Cr="function"===typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var n=e&&e.defaultProps,i=arguments.length-3;if(t||0===i||(t={children:void 0}),1===i)t.children=r;else if(i>1){for(var a=new Array(i),l=0;l<i;l++)a[l]=arguments[l+3];t.children=a}if(t&&n)for(var c in n)void 0===t[c]&&(t[c]=n[c]);else t||(t=n||{});return{$$typeof:Cr,type:e,key:void 0===o?null:""+o,ref:null,props:t,_owner:null}}function Rr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(e)))return;var o=[],r=!0,n=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(o.push(a.value),!t||o.length!==t);r=!0);}catch(e){n=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(n)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return Pr(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return Pr(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pr(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r}function Dr(){return(Dr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e}).apply(this,arguments)}var Gr=Object(ve.makeStyles)((function(e){return{root:{flexGrow:1,backgroundColor:e.palette.background.paper},flex:{display:"flex",justifyContent:"space-between",alignItems:"center"},drawer:(t={},o=e.breakpoints.up("sm"),r={display:"flex",flexDirection:"column",width:"100%",flexShrink:0,overflowY:"auto",height:"100vh",borderRight:"1px solid ".concat(e.palette.grey[100]),"& .MuiListSubheader-root":{backgroundColor:e.palette.common.white},"&::-webkit-scrollbar":{width:"6px",backgroundColor:"#F5F5F5"},"&::-webkit-scrollbar-track":{"-webkitBoxShadow":"inset 0 0 6px rgba(0,0,0,0.3)",borderRadius:"10px"},"&::-webkit-scrollbar-thumb":{borderRadius:"10px","-webkit-box-shadow":"inset 0 0 6px rgba(0,0,0,0.5)",backgroundColor:e.palette.primary.main}},o in t?Object.defineProperty(t,o,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[o]=r,t),drawerPaper:{width:"100%"},content:{flexGrow:1},icon:{color:e.palette.grey[800],"&.approved":{color:e.palette.primary.main},"&.inProgress":{color:ye.orange[500]},"&.done":{color:ye.green[500]}},backdrop:{zIndex:e.zIndex.drawer+1,color:"#fff"}};var t,o,r})),Br=Object(ve.withStyles)({root:{borderBottom:"1px solid #e8e8e8"},indicator:{backgroundColor:"#1890ff"}})(O.Tabs),Er=Object(ve.withStyles)((function(e){return{root:{textTransform:"none",minWidth:72,fontWeight:e.typography.fontWeightRegular,marginRight:e.spacing(4),fontFamily:["-apple-system","BlinkMacSystemFont",'"Segoe UI"',"Roboto",'"Helvetica Neue"',"Arial","sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"'].join(","),"&:hover":{color:"#40a9ff",opacity:1},"&$selected":{color:"#1890ff",fontWeight:e.typography.fontWeightMedium},"&:focus":{color:"#40a9ff"}},selected:{}}}))((function(e){return i.a.createElement(O.Tab,Dr({disableRipple:!0},e))})),Mr=Nr(O.Hidden,{smUp:!0,implementation:"css"}),Lr=Nr(O.CircularProgress,{color:"inherit"}),Fr=Nr(Er,{label:"Overview"}),Wr=Nr(Er,{label:"Transactions"}),zr=Nr(Er,{label:"Related List"}),$r=Nr(Er,{label:"Adjustment"}),Hr=Nr(Er,{label:"History"}),Ur=Nr("div",{}),_r=Nr("div",{}),Kr=Object(u.b)({loading:m.r(),itemsGroups:m.f(),itemsGroup:m.e()});var Vr,qr=Object(a.connect)(Kr,(function(e){return{getItemsGroupById:function(t){return e(v.M(t))},openNewItemGroupDialog:function(){return e(v.gb())},openEditItemGroupDialog:function(t){return e(v.cb(t))}}})),Jr=Object(d.compose)(l.withRouter,qr,n.memo)((function(e){var t=Gr(),o=e.loading,r=e.itemsGroups,n=e.itemsGroup,a=e.match,l=e.openNewItemGroupDialog,c=e.openEditItemGroupDialog,u=e.getItemsGroupById,d=Rr(i.a.useState(0),2),s=d[0],f=d[1],m=Rr(i.a.useState(!1),2),p=m[0],b=(m[1],i.a.useRef(null)),v=Rr(i.a.useState(0),2),y=v[0],g=v[1],h=a.params,w=i.a.useRef(p);i.a.useEffect((function(){!0===w.current&&!1===p&&b.current.focus(),w.current=p}),[h.groupId]);return console.log(n,"itemsGroup itemsGroup"),Nr("div",{className:t.root},void 0,Nr(O.Grid,{container:!0,justify:"space-between"},void 0,Nr(O.Grid,{item:!0,md:2},void 0,Nr("nav",{className:t.drawer,"aria-label":"inventory item"},void 0,Mr,Nr(O.Hidden,{xsDown:!0,implementation:"css"},void 0,Nr("div",{className:t.drawerPaper},void 0,Nr(pr,{itemsGroups:r,handleItemGroupById:function(t){f(t),u(t),e.history.push({pathname:"/inventory/items/groups/".concat(t)})},openNewItemGroupDialog:l,selectedIndex:s}))))),Nr(O.Grid,{item:!0,xs:10},void 0,Nr(O.Grid,{container:!0},void 0,Nr(O.Grid,{item:!0,xs:12},void 0,Nr("div",{className:t.content},void 0,Nr(O.Backdrop,{className:t.backdrop,open:o},void 0,Lr),Nr(O.Box,{p:2},void 0,Nr("div",{className:t.flex},void 0,Nr(O.Typography,{variant:"h6"},void 0,n&&n.groupName),Nr(gr,{openEditItemGroupDialog:c,itemsGroup:n})),Nr(O.Breadcrumbs,{"aria-label":"breadcrumb",separator:"\u203a"},void 0,Nr(O.Typography,{color:"textPrimary",className:t.link},void 0,"Items Group"),Nr(O.Typography,{color:"textPrimary",className:t.link},void 0,Nr(he.a,{className:t.icon}),n&&n.groupName))),Nr("div",{className:t.paper},void 0,Nr(Br,{value:y,onChange:function(e,t){g(t)},"aria-label":"ant example"},void 0,Fr,Wr,zr,$r,Hr),Nr(O.Typography,{className:t.padding}),Nr(O.Box,{my:2},void 0,0==y&&Nr(Ar,{itemsGroup:n}),1==y&&Ur,2==y&&_r))))))))}));function Yr(e,t,o,r){Vr||(Vr="function"===typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var n=e&&e.defaultProps,i=arguments.length-3;if(t||0===i||(t={children:void 0}),1===i)t.children=r;else if(i>1){for(var a=new Array(i),l=0;l<i;l++)a[l]=arguments[l+3];t.children=a}if(t&&n)for(var c in n)void 0===t[c]&&(t[c]=n[c]);else t||(t=n||{});return{$$typeof:Vr,type:e,key:void 0===o?null:""+o,ref:null,props:t,_owner:null}}var Qr=Yr("div",{},void 0,Yr(c.Helmet,{},void 0,Yr("title",{},void 0,"Items Group Details"),Yr("meta",{name:"description",content:"Description of Items Group Details"})),Yr(n.Fragment,{},void 0,Yr(Jr,{})));var Zr=Object(u.b)({itemsGroup:m.e()});var Xr,en=Object(a.connect)(Zr,(function(e){return{getItemsGroupById:function(t){return e(v.M(t))}}})),tn=Object(d.compose)(l.withRouter,en,n.memo)((function(e){var t=e.match,o=e.getItemsGroupById,r=t.params;return console.log(t,"match ItemsGroupDetailsPage"),Object(n.useEffect)((function(){o(r.groupId)}),[]),Qr}));function on(e,t,o,r){Xr||(Xr="function"===typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var n=e&&e.defaultProps,i=arguments.length-3;if(t||0===i||(t={children:void 0}),1===i)t.children=r;else if(i>1){for(var a=new Array(i),l=0;l<i;l++)a[l]=arguments[l+3];t.children=a}if(t&&n)for(var c in n)void 0===t[c]&&(t[c]=n[c]);else t||(t=n||{});return{$$typeof:Xr,type:e,key:void 0===o?null:""+o,ref:null,props:t,_owner:null}}function rn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(e)))return;var o=[],r=!0,n=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(o.push(a.value),!t||o.length!==t);r=!0);}catch(e){n=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(n)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return nn(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return nn(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nn(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r}function an(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function ln(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?an(Object(o),!0).forEach((function(t){cn(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):an(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function cn(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function un(){return(un=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e}).apply(this,arguments)}var dn=i.a.forwardRef((function(e,t){return i.a.createElement(O.Slide,un({direction:"up",ref:t},e))})),sn=on(O.CircularProgress,{size:20}),fn=Object(u.b)({loading:m.r(),dialog:m.q(),items:m.d()});var mn,pn=Object(a.connect)(fn,(function(e){return{createItemGroup:function(t){return e(v.e(t))},closeNewItemGroupDialog:function(){return e(v.c())},updateItemsGroup:function(t){return e(v.lb(t))},closeEditItemGroupDialog:function(){return e(v.a())}}})),bn=Object(d.compose)(pn,n.memo)((function(e){var t=e.loading,o=e.items,r=e.dialog,a=e.closeNewItemGroupDialog,l=e.createItemGroup,c=e.updateItemsGroup;Object(n.useEffect)((function(){"edit"===r.type&&r.data&&p(ln({},r.data))}),[r.data]);var u,d,s,f=rn(i.a.useState({groupDescription:"",groupName:"",items:[]}),2),m=f[0],p=f[1],b=function(e){p(ln(ln({},m),{},cn({},e.target.name,e.target.value)))};return console.log(m,"values"),console.log(r,"dialog"),on("div",{},void 0,i.a.createElement(O.Dialog,un({},r.props,{onClose:a,keepMounted:!0,TransitionComponent:dn,"aria-labelledby":"form-dialog-title"}),on(O.DialogTitle,{id:"alert-dialog-slide-title"},void 0,"new"===r.type?"New Item Group":"Edit Item Group"),on(O.DialogContent,{dividers:!0},void 0,on("div",{},void 0,on(O.TextField,{id:"standard-group-name",size:"small",name:"groupName",label:"Group Name",variant:"outlined",value:m.groupName,onChange:b,margin:"normal",fullWidth:!0}),on(O.TextField,{id:"standard-group-description",size:"small",name:"groupDescription",label:"Item Group Description",variant:"outlined",value:m.groupDescription,onChange:b,margin:"normal",fullWidth:!0,rows:2,multiline:!0}),on(w.Autocomplete,{multiple:!0,id:"combo-items",size:"small",options:o,getOptionLabel:function(e){return e.itemName},onChange:(s="items",function(e,t){p(ln(ln({},m),{},cn({},s,t)))}),value:m.items,renderInput:function(e){return i.a.createElement(O.TextField,un({},e,{label:"Select Items",variant:"outlined",margin:"normal",placeholder:"Items",fullWidth:!0}))}}))),on(O.DialogActions,{},void 0,on(O.Button,{onClick:function(){"new"===r.type?l(m):c(m)},color:"primary",variant:"contained",disabled:t||(u=m.groupName,d=m.groupDescription,!(u.length>0&&d.length>0)),endIcon:t&&sn},void 0,"new"===r.type?"Save":"Update"),on(O.Button,{onClick:a,color:"primary",variant:"outlined"},void 0,"Cancel"))))}));function vn(e,t,o,r){mn||(mn="function"===typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var n=e&&e.defaultProps,i=arguments.length-3;if(t||0===i||(t={children:void 0}),1===i)t.children=r;else if(i>1){for(var a=new Array(i),l=0;l<i;l++)a[l]=arguments[l+3];t.children=a}if(t&&n)for(var c in n)void 0===t[c]&&(t[c]=n[c]);else t||(t=n||{});return{$$typeof:mn,type:e,key:void 0===o?null:""+o,ref:null,props:t,_owner:null}}var yn=vn(c.Helmet,{},void 0,vn("title",{},void 0,"Items Groups"),vn("meta",{name:"description",content:"Description of Items Groups"})),gn=vn(bn,{});var hn=Object(u.b)({itemPage:Object(m.a)()});var wn,In=Object(a.connect)(hn,(function(e){return{}})),Cn=Object(d.compose)(l.withRouter,In,n.memo)((function(e){Object(f.b)({key:"itemPage",reducer:p.a}),Object(s.b)({key:"itemPage",saga:b.a});var t=e.match.path;return Object(n.useEffect)((function(){}),[]),vn("div",{},void 0,yn,vn(n.Fragment,{},void 0,vn(l.Route,{exact:!0,path:t,component:nr}),vn(l.Route,{path:"".concat(t,"/:groupId"),component:tn})),gn)})),Sn=o("31b583a4f06a1dd2503f");function Tn(e,t,o,r){wn||(wn="function"===typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var n=e&&e.defaultProps,i=arguments.length-3;if(t||0===i||(t={children:void 0}),1===i)t.children=r;else if(i>1){for(var a=new Array(i),l=0;l<i;l++)a[l]=arguments[l+3];t.children=a}if(t&&n)for(var c in n)void 0===t[c]&&(t[c]=n[c]);else t||(t=n||{});return{$$typeof:wn,type:e,key:void 0===o?null:""+o,ref:null,props:t,_owner:null}}o.d(t,"ItemPage",(function(){return An}));var On=Tn(c.Helmet,{},void 0,Tn("title",{},void 0,"Item Page"),Tn("meta",{name:"description",content:"Description of Item Page"})),jn=Tn(l.Route,{path:"/inventory/items/groups",component:Cn}),xn=Tn(l.Route,{exact:!0,path:"/inventory/items/create/:status?",component:be}),kn=Tn(l.Route,{path:"/inventory/item",component:Jo});function An(e){Object(f.b)({key:"itemPage",reducer:p.a}),Object(s.b)({key:"itemPage",saga:b.a});var t=e.getAllItems,o=e.getItemsGroups,r=e.getAllWarehouse,i=e.getAccounts,a=e.getVendors,c=e.match.path;return Object(n.useEffect)((function(){t(),o(),r(),i(),a()}),[]),Tn("div",{},void 0,Tn(Sn.a,{},void 0,On,Tn(n.Fragment,{},void 0,Tn(l.Route,{exact:!0,path:c,component:Ho}),jn,xn,kn)))}var Nn=Object(u.b)({itemPage:Object(m.a)()});var Rn=Object(a.connect)(Nn,(function(e){return{getAllItems:function(){return e(v.u())},getItemsGroups:function(){return e(v.P())},getAllWarehouse:function(){return e(v.D())},getAccounts:function(){return e(v.o())},getVendors:function(){return e(v.Y())}}}));t.default=Object(d.compose)(l.withRouter,Rn,n.memo)(An)}}]);