1"use strict";(globalThis.webpackChunkfss=globalThis.webpackChunkfss||[]).push([[1588],{86841(e,i,t){t.d(i,{oM:()=>o,dO:()=>d,er:()=>m});t(9950);var n=t(9213),l=t(59254),s=t(44414);const r=(0,l.Ay)(n.A)(e=>{let{theme:i}=e;return{cursor:"pointer","&:nth-of-type(odd)":{padding:i.spacing(0,1),color:i.palette.text.secondary,backgroundColor:i.palette.background.neutral,borderBottom:`1px solid ${i.palette.divider}`},whiteSpace:"nowrap","& .MuiTableCell-sizeSmall":{padding:"5px 6px 5px 10px"}}});function o(e){return(0,s.jsx)(r,{...e,children:e.children})}t(63575);var a=t(21671);function d(e){let{emptyRows:i,height:t}=e;return i?(0,s.jsx)(n.A,{sx:{...t&&{height:t*i}},children:(0,s.jsx)(a.A,{colSpan:5})}):null}var c=t(69780),h=t(83274),u=t(7251),x=t(53011),p=t(33507);const j={border:0,margin:-1,padding:0,width:"1px",height:"1px",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",clip:"rect(0 0 0 0)"};function m(e){let{order:i,headLabel:t,onSort:l}=e;const{user:r}=(0,p.A)();return(0,s.jsx)(c.A,{children:(0,s.jsx)(n.A,{children:t.map(e=>{var t,n;return"switch"===e.id?(1===(null===r||void 0===r||null===(t=r.roles[0])||void 0===t?void 0:t.id)||2===(null===r||void 0===r||null===(n=r.roles[0])||void 0===n?void 0:n.id))&&(0,s.jsx)(a.A,{align:e.align,padding:e.disablePadding?"none":"normal",sortDirection:i.id===e.id&&i.direction,sx:{background:e=>e.palette.background.paper,whiteSpace:"nowrap",fontWeight:"bold"},children:e.sort?(0,s.jsx)(h.A,{title:"Sort",placement:"right"===e.align?"bottom-end":"bottom-start",enterDelay:300,children:(0,s.jsxs)(u.A,{active:i.id===e.id,direction:i.direction,onClick:l(e.id),children:[e.label,i.id===e.id?(0,s.jsx)(x.A,{component:"span",sx:j,children:"desc"===i?"sorted descending":"sorted ascending"}):null]})}):(0,s.jsx)(s.Fragment,{children:e.label})},e.id):(0,s.jsx)(a.A,{align:e.align,padding:e.disablePadding?"none":"normal",sortDirection:i.id===e.id&&i.direction,sx:{background:e=>e.palette.background.paper,whiteSpace:"nowrap",fontWeight:"bold"},children:e.sort?(0,s.jsx)(h.A,{title:"Sort",placement:"right"===e.align?"bottom-end":"bottom-start",enterDelay:300,children:(0,s.jsxs)(u.A,{active:i.id===e.id,direction:i.direction,onClick:l(e.id),children:[e.label,i.id===e.id?(0,s.jsx)(x.A,{component:"span",sx:j,children:"desc"===i?"sorted descending":"sorted ascending"}):null]})}):(0,s.jsx)(s.Fragment,{children:e.label})},e.id)})})})}},38861(e,i,t){t.d(i,{Ay:()=>l,xl:()=>s});var n=t(9950);function l(e){const[i,t]=(0,n.useState)((null===e||void 0===e?void 0:e.defaultDense)||!1),[l,s]=(0,n.useState)((null===e||void 0===e?void 0:e.defaultOrderBy)||"name"),[r,o]=(0,n.useState)((null===e||void 0===e?void 0:e.defaultOrder)||"asc"),[a,d]=(0,n.useState)((null===e||void 0===e?void 0:e.defaultCurrentPage)||0),[c,h]=(0,n.useState)((null===e||void 0===e?void 0:e.defaultRowsPerPage)||5),[u,x]=(0,n.useState)((null===e||void 0===e?void 0:e.defaultSelected)||[]);return{dense:i,order:r,page:a,setPage:d,orderBy:l,rowsPerPage:c,selected:u,setSelected:x,onSelectRow:e=>{const i=u.indexOf(e);let t=[];-1===i?t=t.concat(u,e):0===i?t=t.concat(u.slice(1)):i===u.length-1?t=t.concat(u.slice(0,-1)):i>0&&(t=t.concat(u.slice(0,i),u.slice(i+1))),x(t)},onSelectAllRows:(e,i)=>{x(e?i:[])},onSort:e=>{""!==e&&(o(l===e&&"asc"===r?"desc":"asc"),s(e))},onChangePage:(e,i)=>{d(i)},onChangeDense:e=>{t(e.target.checked)},onChangeRowsPerPage:e=>{h(parseInt(e.target.value,10)),d(0)}}}function s(e,i,t){return e>0?Math.max(0,(1+e)*i-t):0}},61588(e,i,t){t.r(i),t.d(i,{default:()=>ce});var n=t(9950),l=t(19808),s=t(82053),r=t(83274),o=t(18216),a=t(48089),d=t(2235),c=t(15769),h=t(34075),u=t(9213),x=t(21671),p=t(25277),j=t(14650),m=t(86898),A=t(60899),v=t(76455),b=t(27081),y=t(28429),g=t(25045),f=t.n(g),w=t(63575),_=t
1(96812),C=t(93230),S=t(53011),D=t(44414);function I(e){let{title:i,icon:t,count:n}=e;return(0,D.jsxs)(a.A,{sx:{py:1,padding:2,textAlign:"center",boxShadow:.5},children:[(0,D.jsxs)(A.Ay,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"baseline",children:[(0,D.jsx)(A.Ay,{item:!0,children:(0,D.jsx)(C.A,{direction:"row",spacing:1,children:(0,D.jsx)(s.A,{variant:"button",component:"h6",ml:1,color:"primary.main",children:i})})}),(0,D.jsx)(A.Ay,{item:!0,children:(0,D.jsx)(p.A,{color:"primary",sx:{mt:1,mb:.5,px:1.1},size:"small",label:n})})]}),(0,D.jsx)("br",{}),(0,D.jsx)(A.Ay,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"baseline",sx:{py:.3},children:(0,D.jsx)(A.Ay,{item:!0,textAlign:"center",children:(0,D.jsx)(S.A,{sx:{justifyContent:"space-between",display:"flex"},children:(0,D.jsx)(j.In,{icon:t,width:"40",height:"40"})})})})]})}function k(e){let{title:i,icon:t}=e;return(0,D.jsxs)(a.A,{sx:{py:1,padding:2,textAlign:"center",boxShadow:.5},children:[(0,D.jsx)(A.Ay,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"baseline",children:(0,D.jsx)(A.Ay,{item:!0,children:(0,D.jsx)(C.A,{direction:"row",spacing:1,children:(0,D.jsx)(s.A,{variant:"button",component:"h6",ml:1,color:"primary.main",children:i})})})}),(0,D.jsx)("br",{}),(0,D.jsx)(A.Ay,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"baseline",sx:{py:.6},children:(0,D.jsx)(A.Ay,{item:!0,textAlign:"center",children:(0,D.jsx)(S.A,{sx:{justifyContent:"space-between",display:"flex"},children:(0,D.jsx)(j.In,{icon:t,width:"40",height:"40"})})})})]})}var F=t(41413),z=t(1320),Y=t(57073),B=t(24516),q=t(83239),M=t(96583),T=t(60666),P=t(26473),N=t(9449),W=t(28095),R=t(46639),U=t(63477),E=t(95468),L=t(12402),H=t(16765),O=t(27987),Q=t(33949),K=t(86841),V=t(33507);const G=e=>{const{list:i,handleView:t,handleUpdate:n,handleDelete:l}=e,{user:s}=(0,V.A)();return(0,D.jsx)(D.Fragment,{children:i.map(e=>{var i,o,a;return(0,D.jsxs)(K.oM,{onClick:()=>{var i;return(null===s||void 0===s||null===(i=s.permissions)||void 0===i?void 0:i.includes("source_show"))&&t(e)},children:[(0,D.jsx)(x.A,{children:e.supplier}),(0,D.jsx)(x.A,{children:e.supplier_ref}),(0,D.jsx)(x.A,{children:e&&e.food_item}),(0,D.jsx)(x.A,{children:e&&e.quantity}),(0,D.jsx)(x.A,{onClick:e=>{e.preventDefault(),e.stopPropagation()},children:(0,D.jsxs)(m.A,{style:{display:"flex",justifyContent:"flex-end",flexDirection:"row",columnGap:"5px"},children:[(null===s||void 0===s||null===(i=s.permissions)||void 0===i?void 0:i.includes("source_show"))&&(0,D.jsx)(Q.A,{color:"primary",sx:{width:33,height:33},children:(0,D.jsx)(r.A,{title:"View",arrow:!0,children:(0,D.jsx)(O.A,{onClick:()=>t(e),children:(0,D.jsx)(j.In,{icon:"fa6-solid:eye",width:"15",height:"15",color:"white"})})})}),(null===s||void 0===s||null===(o=s.permissions)||void 0===o?void 0:o.includes("source_edit"))&&(0,D.jsx)(Q.A,{color:"info",sx:{width:33,height:33},children:(0,D.jsx)(r.A,{title:"Edit",arrow:!0,children:(0,D.jsx)(O.A,{onClick:()=>n(e),children:(0,D.jsx)(j.In,{icon:"icon-park-outline:pencil",width:"15",height:"15",color:"white"})})})}),(null===s||void 0===s||null===(a=s.permissions)||void 0===a?void 0:a.includes("source_delete"))&&(0,D.jsx)(Q.A,{color:"error",sx:{width:33,height:33},children:(0,D.jsx)(r.A,{title:"Delete",arrow:!0,children:(0,D.jsx)(O.A,{onClick:()=>l(e),children:(0,D.jsx)(j.In,{icon:"ant-design:delete-filled",width:"15",height:"15",color:"white"})})})})]})})]},e.id)})})};var X=t(38861),$=t(65462);const Z=[{id:"supplier",label:"Supplier",align:"left"},{id:"supplier_ref",label:"Supplier Ref",align:"left"},{id:"food_item",label:"Food Item",align:"left"},{id:"quantity",label:"Quantity",align:"left"},{id:"actions",label:"Actions",align:"right"}];function J(){var e,i,t,l,p,m,g,_,I,k,O,Q,J;const{orderBy:ee}=(0,X.Ay)(),ie=(0,b.wA)(),te=(0,n.useRef)(null),{user:ne}=(0,V.A)(),le=(0,y.g)(),se=(0,b.d4)(e=>{let{source:i}=e;return i.sourcelist}),re=(0,b.d4)(e=>{let{loading:i}=e;return i.loading1}),[oe,ae]=(0,n.useState)(!1),[de,ce]=(0,n.useState)(null),[he,ue]=(0,n.use
1State)(!1),[xe,pe]=(0,n.useState)(!1),[je,me]=(0,n.useState)(!1),[Ae,ve]=(0,n.useState)({direction:"desc",id:"id"}),be={id:"",supplier:"",supplier_ref:"",food_item:"",quantity:"",source_temperature:"",photo:""},ye=T.Ik().shape({supplier:T.Yj().required("Supplier Name is required").min(3," Supplier Name must be at least 3 characters").max(50,"Supplier NameShould not exceed 50"),food_item:T.Yj().required("Food Item Name is required").min(3," Food Item Name must be at least 3 characters").max(50,"Food Item Should not exceed 50"),source_temperature:T.ai().transform(e=>isNaN(e)||null===e||void 0===e?0:e).notRequired().min(-400,"Source Temperature should not be less than -400\xb0C").max(400,"Source Temperature should not exceed 400\xb0C"),supplier_ref:T.Yj().max(50,"Supplier Reference Should not exceed 50"),quantity:T.Yj().max(16,"Quantity Should not exceed 16"),photo:T.gl().notRequired().test("fileSize","File size too large, max file size is 3 Mb",e=>!e||!e.size||e.size<=3e6).test("fileType","Unsupported File Format",e=>!e||!e.size||["image/jpg","image/jpeg","image/gif","image/png"].includes(null===e||void 0===e?void 0:e.type))}),ge=(0,N.mN)({resolver:(0,P.t)(ye),defaultValues:be}),{reset:fe,handleSubmit:we,register:_e,setValue:Ce,watch:Se,formState:{errors:De,isSubmitting:Ie}}=ge,ke=Se();(0,n.useEffect)(()=>{ie((0,H.Kq)(le))},[]);const Fe=()=>{ue(!0)},ze=()=>{pe(!0)},Ye=()=>{pe(!1)};return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(v.mg,{children:(0,D.jsx)("title",{children:"Batches Items"})}),(0,D.jsxs)(A.Ay,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"baseline",children:[(0,D.jsx)(A.Ay,{item:!0,children:(0,D.jsxs)(S.A,{sx:{display:"flex",justifyContent:"space-start"},children:[(0,D.jsx)(j.In,{icon:"fa-solid:sitemap",color:"#004e49",width:"25",height:"28"}),(0,D.jsx)(s.A,{variant:"h6",component:"h6",paddingLeft:1,children:"Source Items"})]})}),(0,D.jsx)(A.Ay,{item:!0,children:(0,D.jsx)(S.A,{style:{display:"flex",justifyContent:"flex-end",flexDirection:"row",columnGap:"5px"},children:(0,D.jsx)(S.A,{sx:{display:"flex",justifyContent:"space-end"},children:(null===ne||void 0===ne||!ne.subscription_status||(null===ne||void 0===ne||null===(e=ne.permissions)||void 0===e?void 0:e.includes("source_create")))&&(0,D.jsx)(F.A,{sx:{backgroundColor:"primary.main",color:"white"},onClick:()=>{null!==ne&&void 0!==ne&&ne.subscription_status?(me(!0),ae(!0)):ie((0,$.EQ)())},children:(0,D.jsx)(r.A,{title:"ADD",arrow:!0,children:(0,D.jsx)(o.A,{children:(0,D.jsx)(j.In,{icon:"akar-icons:plus",color:"white",width:"22",height:"22"})})})})})})})]}),(0,D.jsx)("br",{}),(0,D.jsx)(a.A,{children:(0,D.jsx)(z.A,{sx:{minWidth:300,position:"relative",py:2,px:2,overflowX:"auto","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"},children:(0,D.jsxs)(c.A,{size:"small",children:[(0,D.jsx)(K.er,{order:Ae,orderBy:ee,headLabel:Z,onSort:e=>()=>{const i=e;let t="desc";Ae.id===e&&"desc"===Ae.direction&&(t="asc"),ve({direction:t,id:i}
1),ie((0,H.Kq)(le),{sortBy:i,sortDirection:t})}}),(0,D.jsx)(h.A,{children:(0,D.jsx)(G,{list:se,handleView:e=>(e=>{ce(e),Fe()})(e),handleUpdate:e=>(e=>{var i;ce(e),Object.keys(be).map(i=>Ce(i,e[i]||"")),Ce("photo",e.photo&&String(null===(i=e.photo)||void 0===i?void 0:i.file_name)),ae(!0)})(e),handleDelete:e=>(e=>{ce(e),ze()})(e)})})]})})}),(0,D.jsx)(M.A,{open:oe,fullWidth:!0,maxWidth:"sm",disableEscapeKeyDown:!0,"aria-labelledby":"form-dialog-title",classes:{paper:"rounded-8"},disableRestoreFocus:!0,children:(0,D.jsx)(L.A,{methods:ge,onSubmit:we(async(e,i)=>{i.preventDefault();const t={...e,batch_uuid:le.uuid};try{if(je){delete t.id;const e=new FormData;Object.keys(t).map(i=>e.append(i,t[i])),ie((0,H.QQ)(e)).then(e=>{var i,t;null!==e&&void 0!==e&&null!==(i=e.payload)&&void 0!==i&&null!==(t=i.response)&&void 0!==t&&t.status&&(ae(!1),fe(),me(!1))})}else{const i={...e,batch_id:de.batch_id},t=new FormData;Object.keys(i).map(e=>t.append(e,i[e])),ie((0,H.pi)(t)).then(e=>{var i,t;null!==e&&void 0!==e&&null!==(i=e.payload)&&void 0!==i&&null!==(t=i.response)&&void 0!==t&&t.status&&(ae(!1),fe())})}}catch(n){console.error(n)}}),children:(0,D.jsx)(A.Ay,{item:!0,xs:12,md:12,children:(0,D.jsxs)(a.A,{sx:{p:3},children:[(0,D.jsx)(S.A,{sx:{pb:3},children:(0,D.jsx)(s.A,{variant:"h5",paddingBottom:1,children:je?"Add Source Item":"Update Source Item"})}),(0,D.jsxs)(S.A,{rowGap:2,columnGap:1,display:"grid",gridTemplateColumns:{xs:"repeat(1, 1fr)",sm:"repeat(2, 1fr)"},children:[(0,D.jsx)(E.o3,{id:"supplier",name:"supplier",size:"small",type:"text",label:"Supplier *",InputLabelProps:{shrink:!0}}),(0,D.jsx)(E.o3,{id:"supplier_ref",name:"supplier_ref",size:"small",type:"text",label:"Supplier Reference",InputLabelProps:{shrink:!0}}),(0,D.jsx)(E.o3,{id:"food_item",name:"food_item",size:"small",type:"text",label:"Food Item *",InputLabelProps:{shrink:!0}}),(0,D.jsx)(E.o3,{id:"quantity",name:"quantity",size:"small",type:"number",label:"Quantity",InputLabelProps:{shrink:!0}}),(0,D.jsx)(E.o3,{id:"source_temperature",name:"source_temperature",size:"small",type:"number",label:"Source Temperature",InputLabelProps:{shrink:!0}}),(0,D.jsxs)("div",{children:[(0,D.jsx)(C.A,{direction:"row",alignItems:"center",spacing:3,children:(0,D.jsx)(o.A,{color:"info",fullWidth:!0,variant:"contained",onClick:()=>(()=>{var e;null===(e=te.current)||void 0===e||e.click()})(),startIcon:(0,D.jsx)(j.In,{icon:"eva:cloud-upload-fill"}),children:"Upload Image"})}),(0,D.jsx)("div",{children:(0,D.jsxs)(A.Ay,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"baseline",children:[(0,D.jsx)(A.Ay,{item:!0,children:(0,D.jsx)(S.A,{sx:{display:"flex",justifyContent:"space-start"},children:(0,D.jsxs)(C.A,{direction:"row",alignItems:"center",spacing:1,children:[null!==ke&&void 0!==ke&&null!==(i=ke.photo)&&void 0!==i&&i.name?(0,D.jsx)(s.A,{variant:"subtitle2",children:null===ke||void 0===ke||null===(t=ke.photo)||void 0===t?void 0:t.name}):(0,D.jsx)(s.A,{variant:"subtitle2",children:null===ke||void 0===ke?void 0:ke.photo}),(null===ke||void 0===ke||null===(l=ke.photo)||void 0===l?void 0:l.size)&&(0,D.jsx)(s.A,{variant:"caption",sx:{color:"text.secondary"},children:(0,U.tm)(null===ke||void 0===ke||null===(p=ke.photo)||void 0===p?void 0:p.size)})]})})}),(0,D.jsx)(A.Ay,{item:!0,children:(null===ke||void 0===ke?void 0:ke.photo)&&(0,D.jsx)(Y.A,{onClick:()=>{Ce("photo",null)},children:(0,D.jsx)(j.In,{icon:"material-symbols:cancel-rounded",width:"20",height:"20"})})})]})}),(0,D.jsx)("input",{..._e("photo"),ref:te,type:"file",accept:"image/*",onChange:e=>{var i;const t=null===(i=e.target.files)||void 0===i?void 0:i[0];Ce("photo",t)},style:{display:"none"}}),!(null===De||void 0===De||!De.photo)&&(0,D.jsx)(B.A,{sx:{px:2,display:"block"},error:!0,children:null===De||void 0===De||null===(m=De.photo)||void 0===m?void 0:m.message})]})]}),(0,D.jsx)("br",{}),(0,D.jsxs)(A.Ay,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"baseline",children:[(0,D.jsx)(A.Ay,{item:!0,xs:3,md:3,sm:3,children:(0,D.jsx)(W.A,{sx:{mt:1,mb:.5,px:4,backgroundColor:"primary.main"},variant:"contained",type:"submit",disabled:re,color:"primary",loading:Ie,children:re?(0,D.jsx)(R.A,{size:24,color:"inherit"}):"Save"})}),(0,D.jsx)(A.Ay,{item:!0,xs:3,md:2.1,sm:2.1,children:(0,D.jsx)(o.A,{sx:{mt:1,mb:.5,px:3,backgroundColor:"warning"},variant:"contained",color:"warning",onClick:()=>(ae(!1),me(!1),void fe()),children:"Cancel"})})]})]})})})}),(0,D.jsxs)(M.A,{open:he,fullWidth:!0,maxWidth:"sm",disableEscapeKeyDown:!0,"aria-labelledby":"form-dialog-title",classes:{paper:"rounded-8"},disableRestoreFocus:!0,children:[(0,D.jsx)(q.A,{children:(0,D.jsx)(s.A,{variant:"h5",color:"primary",children:"Source Item Details"})}),(0,D.jsx)(z.A,{sx:{px:2},children:de&&(0,D.jsx)(d.A,{children:(0,D.jsx)(c.A,{"aria-label":"simple table",size:"small",children:(0,D.jsxs)(h.A,{children:[(0,D.jsxs)(u.A,{children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"ID"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:de.uuid})})]}),(0,D.jsxs)(u.A,{children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Batch"})}),(0,D.jsx)(x.A,{children:(0,D.jsxs)(s.A,{variant:"subtitle2",children:[" ",null===de||void 0===de||null===(g=de.batch)||void 0===g?void 0:g.batch_name]})})]}),(0,D.jsxs)(u.A,{children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Supplier"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:null===de||void 0===de?void 0:de.supplier})})]}),(0,D.jsxs)(u.A,{children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Supplier Reference"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:null===de||void 0===de?void 0:de.supplier_ref})})]}),(0,D.jsxs)(u.A,{children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Food Item"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:null===de||void 0===de?void 0:de.food_item})})]}),(0,D.jsxs)(u.A,{children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Quantity"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:null===de||void 0===de?void 0:de.quantity})})]}),(0,D.jsxs)(u.A,{children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Source Temperature"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:null===de||void 0===de?void 0:de.source_temperature})})]}),(0,D.jsxs)(u.A,{children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Image"})}),(0,D.jsx)(r.A,{title:(null===de||void 0===de||null===(_=de.photo)||void 0===_?void 0:_.url)&&(0,D.jsx)(w.A,{src:null===de||void 0===de||null===(I=de.photo)||void 0===I?void 0:I.url,sx:{width:250,height:200},alt:"image"}),arrow:!0,children:(0,D.jsx)(x.A,{children:(null===de||void 0===de||null===(k=de.photo)||void 0===k?void 0:k.url)&&(0,D.jsx)(w.A,{src:null===de||void 0===de||null===(O=de.photo)||void 0===O?void 0:O.url,sx:{width:100,height:100},alt:"image"})})})]}),(0,D.jsxs)(u.A,{children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Created By"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:de&&(null===de||void 0===de||null===(Q=de.created_by)||void 0===Q?void 0:Q.name)})})]}),(0,D.jsxs)(u.A,{children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Updated By"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:de&&(null===de||void 0===de||null===(J=de.updated_by)||void 0===J?void 0:J.name)})})]}),(0,D.jsxs)(u.A,{children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Created At"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:(null===de||void 0===de?void 0:de.created_at)&&f().utc(de.created_at).local().format("DD-MM-YYYY HH:mm:ss")})})]}),(0,D.jsxs)(u.A,{children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Updated At"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:(null===de||void 0===de?void 0:de.updated_at)&&f().utc(de.updated_at).local().format("DD-MM-YYYY HH:mm:ss")})})]})]})})})}),(0,D.jsxs)(A.Ay,{container:!0,justifyContent:"space-between",alignItems:"baseline",direction:"row",children:[(0,D.jsx)(A.Ay,{item:!0}),(0,D.jsx)(A.Ay,{item:!0,children:(0,D.jsx)(o.A,{sx:{mt:2,mb:2,px:6,mr:2},variant:"contained",onClick:()=>{ue(!1)},color:"warning",children:"Close"})})]})]}),(0,D.jsxs)(M.A,{open:xe,fullWidth:!0,maxWidth:"xs",disableEscapeKeyDown:!0,"aria-labelledby":"form-dialog-title",classes:{paper:"rounded-8"},disableRestoreFocus:!0,children:[(0,D.jsx)(q.A,{children:(0,D.jsx)(s.A,{variant:"h5",color:"error",children:"Alert"})}),(0,D.jsx)(s.A,{margin:"0px 15px 15px 21px",children:"Are you sure want to delete?"}
1),(0,D.jsx)(S.A,{sx:{"& .MuiTextField-root":{mb:1,mt:1},"& .react-tel-input.focused":{borderColor:"transparent1"},m:2},children:(0,D.jsxs)(A.Ay,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"baseline",children:[(0,D.jsx)(A.Ay,{item:!0,children:(0,D.jsx)(o.A,{sx:{mt:1,mb:1,px:4},type:"button",disabled:re,variant:"contained",color:"primary",onClick:()=>{ie((0,H.KA)(de.id)).then(e=>{var i,t;null!==e&&void 0!==e&&null!==(i=e.payload)&&void 0!==i&&null!==(t=i.response)&&void 0!==t&&t.status&&Ye()})},"aria-label":"delete",style:{textTransform:"capitalize",fontSize:"16px"},children:re?(0,D.jsx)(R.A,{size:24,olor:"inherit"}):"Yes"})}),(0,D.jsx)(A.Ay,{item:!0,children:(0,D.jsx)(o.A,{sx:{mt:1,mb:1,px:4},variant:"contained",onClick:()=>Ye(),color:"warning",style:{textTransform:"capitalize",fontSize:"16px"},children:"No"})})]})})]})]})}var ee=t(17154),ie=t(79777),te=t(59051),ne=t.n(te),le=t(59254);const se=e=>{const{list:i,handleView:t,handleUpdate:n,handleDelete:l}=e,{user:s}=(0,V.A)();return(0,D.jsx)(D.Fragment,{children:i.map(e=>{var i,o,a;return(0,D.jsxs)(K.oM,{onClick:()=>{var i;return(null===s||void 0===s||null===(i=s.permissions)||void 0===i?void 0:i.includes("destination_show"))&&t(e)},children:[(0,D.jsx)(x.A,{children:e&&(null===e||void 0===e?void 0:e.destination)}),(0,D.jsx)(x.A,{children:e&&(null===e||void 0===e?void 0:e.quantity)}),(0,D.jsx)(x.A,{children:e&&(null===e||void 0===e?void 0:e.dispatch_temperature)}),(0,D.jsx)(x.A,{onClick:e=>{e.preventDefault(),e.stopPropagation()},children:(0,D.jsxs)(m.A,{style:{display:"flex",justifyContent:"flex-end",flexDirection:"row",columnGap:"5px"},children:[(null===s||void 0===s||null===(i=s.permissions)||void 0===i?void 0:i.includes("destination_show"))&&(0,D.jsx)(Q.A,{color:"primary",sx:{width:33,height:33},children:(0,D.jsx)(r.A,{title:"View",arrow:!0,children:(0,D.jsx)(O.A,{onClick:()=>t(e),children:(0,D.jsx)(j.In,{icon:"fa6-solid:eye",width:"15",height:"15",color:"white"})})})}),(null===s||void 0===s||null===(o=s.permissions)||void 0===o?void 0:o.includes("destination_edit"))&&(0,D.jsx)(Q.A,{color:"info",sx:{width:33,height:33},children:(0,D.jsx)(r.A,{title:"Edit",arrow:!0,children:(0,D.jsx)(O.A,{onClick:()=>n(e),children:(0,D.jsx)(j.In,{icon:"icon-park-outline:pencil",width:"15",height:"15",color:"white"})})})}),(null===s||void 0===s||null===(a=s.permissions)||void 0===a?void 0:a.includes("destination_delete"))&&(0,D.jsx)(Q.A,{color:"error",sx:{width:33,height:33},children:(0,D.jsx)(r.A,{title:"Delete",arrow:!0,children:(0,D.jsx)(O.A,{onClick:()=>l(e),children:(0,D.jsx)(j.In,{icon:"ant-design:delete-filled",width:"15",height:"15",color:"white"})})})})]})})]},e.id)})})},re=[{id:"destination",label:"Destination",align:"left"},{id:"quantity",label:"Quantity",align:"left"},{id:"dispatch_temperature",label:"Dispatch Temp",align:"left"},{id:"actions",label:"Actions",align:"right"}],oe=[{label:"Yes",value:"1"},{label:"No",value:"0"}];function ae(){var e,i,t,l,m,g,_,I,k,O;const{orderBy:Q}=(0,X.Ay)(),G=(0,le.Ay)(s.A)(e=>{let{theme:i}=e;return{...i.typography.subtitle2,color:i.palette.text.secondary,marginBottom:i.spacing(1)}}),Z=(0,b.wA)(),J=(0,n.useRef)(null),te=(0,y.g)(),ae=(0,b.d4)(e=>{let{source:i}=e;return i.destination}),de=(0,b.d4)(e=>{let{loading:i}=e;return i.loading1}),{user:ce}
1=(0,V.A)(),[he,ue]=(0,n.useState)(!1),[xe,pe]=(0,n.useState)(null),[je,me]=(0,n.useState)(!1),[Ae,ve]=(0,n.useState)(!1),[be,ye]=(0,n.useState)(!1),[ge,fe]=(0,n.useState)({direction:"desc",id:"id"}),we={id:"",destination:"",quantity:"",dispatch_temperature:"",use_by:ne()(),destination_temperature:"",photo:"",raw_separation:""},_e=T.Ik().shape({destination:T.Yj().required("Destination name is required").min(3," Destination name must be at least 3 characters").max(50,"Destination name should not exceed 50 characters"),quantity:T.Yj().required("Quantity is required").max(16,"Quantity Should not exceed 16"),dispatch_temperature:T.ai().transform(e=>isNaN(e)||null===e||void 0===e?0:e).required().min(-400,"Dispatch Temperature should not be less than -400\xb0C").max(400,"Dispatch Temperature should not exceed 400\xb0C"),destination_temperature:T.ai().transform(e=>isNaN(e)||null===e||void 0===e?0:e).required().min(-400,"Destination Temperature should not be less than -400\xb0C").max(400,"Destination Temperature should not exceed 400\xb0C"),use_by:T.p6().nullable().required("Use By Date is required"),raw_separation:T.Yj().required("Please select one of the above"),photo:T.gl().notRequired().test("fileSize","File size too large, max file size is 3 Mb",e=>!e||!e.size||e.size<=3e6).test("fileType","Unsupported File Format",e=>!e||!e.size||["image/jpg","image/jpeg","image/gif","image/png"].includes(null===e||void 0===e?void 0:e.type))}),Ce=(0,N.mN)({resolver:(0,P.t)(_e),defaultValues:we}),{reset:Se,handleSubmit:De,register:Ie,setValue:ke,control:Fe,watch:ze,formState:{errors:Ye,isSubmitting:Be}}=Ce,qe=ze();(0,n.useEffect)(()=>{Z((0,H.Bx)(te))},[]);const Me=()=>{me(!0)},Te=()=>{ve(!0)},Pe=()=>{ve(!1)};return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(v.mg,{children:(0,D.jsx)("title",{children:"Batches Items | FSS"})}),(0,D.jsxs)(A.Ay,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"baseline",children:[(0,D.jsx)(A.Ay,{item:!0,children:(0,D.jsxs)(S.A,{sx:{display:"flex",justifyContent:"space-start"},children:[(0,D.jsx)(j.In,{icon:"carbon:delivery",color:"#004e49",width:"25",height:"28"}),(0,D.jsx)(s.A,{variant:"h6",component:"h6",paddingLeft:1,children:"Destination"})]})}),(0,D.jsx)(A.Ay,{item:!0,children:(0,D.jsx)(S.A,{style:{display:"flex",justifyContent:"flex-end",flexDirection:"row",columnGap:"5px"},children:(0,D.jsx)(S.A,{sx:{display:"flex",justifyContent:"space-end"},children:(null===ce||void 0===ce||!ce.subscription_status||(null===ce||void 0===ce||null===(e=ce.permissions)||void 0===e?void 0:e.includes("destination_create")))&&(0,D.jsx)(F.A,{sx:{backgroundColor:"primary.main",color:"white"},onClick:()=>{null!==ce&&void 0!==ce&&ce.subscription_status?(ye(!0),ue(!0)):Z((0,$.EQ)())},children:(0,D.jsx)(r.A,{title:"ADD",arrow:!0,children:(0,D.jsx)(o.A,{children:(0,D.jsx)(j.In,{icon:"akar-icons:plus",color:"white",width:"22",height:"22"})})})})})})})]}),(0,D.jsx)("br",{}),(0,D.jsx)(a.A,{children:(0,D.jsx)(z.A,{sx:{minWidth:300,position:"relative",py:2,px:2,overflowX:"auto","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"},children:(0,D.jsxs)(c.A,{size:"small",children:[(0,D.jsx)(K.er,{order:ge,orderBy:Q,headLabel:re,onSort:e=>()=>{const i=e;let t="desc";ge.id===e&&"desc"===ge.direction&&(t="asc"),fe({direction:t,id:i}
1),Z((0,H.Bx)({sortBy:i,sortDirection:t}))}}),(0,D.jsx)(h.A,{children:(0,D.jsx)(se,{list:ae,handleView:e=>(e=>{pe(e),Me()})(e),handleUpdate:e=>(e=>{var i;pe(e);const t={...e,use_by:e.use_by?ne()(e.use_by,"DD-MM-YYYY HH:mm:ss").toISOString():""};Object.keys(we).map(e=>ke(e,t[e]||"")),ke("raw_separation",String(e.raw_separation)),ke("photo",null===(i=e.photo)||void 0===i?void 0:i.name),ue(!0)})(e),handleDelete:e=>(e=>{pe(e),Te()})(e)})})]})})}),(0,D.jsx)(M.A,{open:he,fullWidth:!0,maxWidth:"sm",disableEscapeKeyDown:!0,"aria-labelledby":"form-dialog-title",classes:{paper:"rounded-8"},disableRestoreFocus:!0,children:(0,D.jsx)(L.A,{methods:Ce,onSubmit:De(async(e,i)=>{i.preventDefault();const t={...e,batch_uuid:te.uuid,use_by:e.use_by?ne()(e.use_by,"YYYY-MM-DD").format("DD-MM-YYYY"):null,raw_separation:String(e.raw_separation)};try{if(be){delete t.id;const e=new FormData;Object.keys(t).map(i=>e.append(i,t[i])),Z((0,H.LF)(e)).then(e=>{var i,t;null!==e&&void 0!==e&&null!==(i=e.payload)&&void 0!==i&&null!==(t=i.response)&&void 0!==t&&t.status&&(ue(!1),Se(),ye(!1))})}else{const e={...t,batch_id:xe.batch_id},i=new FormData;Object.keys(e).map(t=>i.append(t,e[t])),Z((0,H.aY)(i)).then(e=>{var i,t;null!==e&&void 0!==e&&null!==(i=e.payload)&&void 0!==i&&null!==(t=i.response)&&void 0!==t&&t.status&&(ue(!1),Se())})}}catch(n){console.error(n)}}),children:(0,D.jsx)(A.Ay,{item:!0,xs:12,md:12,children:(0,D.jsxs)(a.A,{sx:{p:3},children:[(0,D.jsx)(S.A,{sx:{pb:3},children:(0,D.jsx)(s.A,{variant:"h5",paddingBottom:1,children:be?"Add Destination":"Update Destination"})}),(0,D.jsxs)(S.A,{rowGap:2,columnGap:1,display:"grid",gridTemplateColumns:{xs:"repeat(1, 1fr)",sm:"repeat(2, 1fr)"},children:[(0,D.jsx)(E.o3,{id:"destination",name:"destination",size:"small",type:"text",label:"Destination *",InputLabelProps:{shrink:!0}}),(0,D.jsx)(E.o3,{id:"quantity",name:"quantity",size:"small",type:"number",label:"Quantity *",InputLabelProps:{shrink:!0}}),(0,D.jsx)(N.xI,{name:"use_by",control:Fe,render:e=>{let{field:i,fieldState:{error:t}}=e;return(0,D.jsx)(ie.l,{...i,label:"Use By Date *",inputFormat:"dd-MM-yyyy",renderInput:e=>(0,D.jsx)(ee.A,{fullWidth:!0,size:"small",...e,error:!!t,helperText:null===t||void 0===t?void 0:t.message,InputLabelProps:{shrink:!0}})})}}),(0,D.jsx)(E.o3,{id:"dispatch_temperature",size:"small",name:"dispatch_temperature",type:"number",label:"Dispatch Temperature",InputLabelProps:{shrink:!0}}),(0,D.jsx)(E.o3,{id:"destination_temperature",size:"small",name:"destination_temperature",type:"number",label:"Destination Temperature",InputLabelProps:{shrink:!0}}),(0,D.jsxs)("div",{children:[(0,D.jsx)(C.A,{direction:"row",alignItems:"center",spacing:3,children:(0,D.jsx)(o.A,{color:"info",fullWidth:!0,variant:"contained",onClick:()=>{var e;null===(e=J.current)||void 0===e||e.click()},startIcon:(0,D.jsx)(j.In,{icon:"eva:cloud-upload-fill"}),children:"Upload Image"})}),(0,D.jsx)("div",{children:(0,D.jsxs)(A.Ay,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"baseline",children:[(0,D.jsx)(A.Ay,{item:!0,children:(0,D.jsx)(S.A,{sx:{display:"flex",justifyContent:"space-start"},children:(0,D.jsxs)(C.A,{direction:"row",alignItems:"center",spacing:1,children:[null!==(i=qe.photo)&&void 0!==i&&i.name?(0,D.jsx)(s.A,{variant:"subtitle2",children:qe.photo.name}):(0,D.jsx)(s.A,{variant:"subtitle2",children:qe.photo}),(null===(t=qe.photo)||void 0===t?void 0:t.size)&&(0,D.jsx)(s.A,{variant:"caption",sx:{color:"text.secondary"},children:(0,U.tm)(qe.photo.size)})]})})}),(0,D.jsx)(A.Ay,{item:!0,children:qe.photo&&(0,D.jsx)(Y.A,{onClick:()=>{ke("photo",null)},children:(0,D.jsx)(j.In,{icon:"material-symbols:cancel-rounded",width:"20",height:"20"})})})]})}),(0,D.jsx)("input",{...Ie("photo"),ref:J,type:"file",accept:"image/*",onChange:e=>{var i;const t=null===(i=e.target.files)||void 0===i?void 0:i[0];ke("photo",t)},style:{display:"none"}}),!(null===Ye||void 0===Ye||!Ye.photo)&&(0,D.jsx)(B.A,{sx:{px:2,display:"block"},error:!0,children:null===Ye||void 0===Ye||null===(l=Ye.photo)||void 0===l?void 0:l.message})]}),(0,D.jsxs)(S.A,{children:[(0,D.jsx)(G,{children:"Separation *"}),(0,D.jsx)(E.b$,{id:"raw_separation",name:"raw_separation",size:"small",options:oe,sx:{"& .MuiFormControl
1Label-root":{mr:2}}})]})]}),(0,D.jsx)("br",{}),(0,D.jsxs)(A.Ay,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"baseline",children:[(0,D.jsx)(A.Ay,{item:!0,xs:3,md:3,sm:3,children:(0,D.jsx)(W.A,{sx:{mt:1,mb:.5,px:4,backgroundColor:"primary.main"},variant:"contained",type:"submit",disabled:de,color:"primary",loading:Be,children:de?(0,D.jsx)(R.A,{size:24,color:"inherit"}):"Save"})}),(0,D.jsx)(A.Ay,{item:!0,xs:3,md:2.1,sm:2.1,children:(0,D.jsx)(o.A,{sx:{mt:1,mb:.5,px:3,backgroundColor:"warning"},variant:"contained",color:"warning",onClick:()=>(ue(!1),ye(!1),void Se()),children:"Cancel"})})]})]})})})}),(0,D.jsxs)(M.A,{open:je,fullWidth:!0,maxWidth:"sm",disableEscapeKeyDown:!0,"aria-labelledby":"form-dialog-title",classes:{paper:"rounded-8"},disableRestoreFocus:!0,children:[(0,D.jsx)(q.A,{children:(0,D.jsx)(s.A,{variant:"h5",color:"primary",children:"Destination Details"})}),(0,D.jsx)(z.A,{sx:{px:2},children:xe&&(0,D.jsx)(d.A,{children:(0,D.jsx)(c.A,{"aria-label":"simple table",size:"small",children:(0,D.jsxs)(h.A,{children:[(0,D.jsxs)(u.A,{children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"ID"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:xe.uuid})})]}),(0,D.jsxs)(u.A,{children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Batch Name"})}),(0,D.jsx)(x.A,{children:(0,D.jsxs)(s.A,{variant:"subtitle2",children:[" ",xe&&xe.batch.batch_name]})})]}),(0,D.jsxs)(u.A,{children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Destination"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:xe&&xe.destination})})]}),(0,D.jsxs)(u.A,{children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Quantity"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:xe&&xe.quantity})})]}),(0,D.jsxs)(u.A,{children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Use By"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:xe&&xe.use_by})})]}),(0,D.jsxs)(u.A,{children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Dispatch Temperature"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:xe&&xe.dispatch_temperature})})]}),(0,D.jsxs)(u.A,{children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Destination Temperature"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:xe&&xe.destination_temperature})})]}),(0,D.jsxs)(u.A,{children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Separation"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:(0,D.jsx)(p.A,{variant:"soft",color:1===xe.raw_separation?"primary":"error",sx:{fontWeight:"bold",pt:.1,px:1===xe.raw_separation?.7:.1},label:1===xe.raw_separation?"Yes":"No",size:"small"})})})]}),(0,D.jsxs)(u.A,{children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Image"})}),(0,D.jsx)(r.A,{title:(null===xe||void 0===xe||null===(m=xe.photo)||void 0===m?void 0:m.url)&&(0,D.jsx)(w.A,{src:null===xe||void 0===xe||null===(g=xe.photo)||void 0===g?void 0:g.url,sx:{width:250,height:200},alt:"image"}),arrow:!0,children:(0,D.jsx)(x.A,{children:(null===xe||void 0===xe||null===(_=xe.photo)||void 0===_?void 0:_.url)&&(0,D.jsx)(w.A,{src:null===xe||void 0===xe||null===(I=xe.photo)||void 0===I?void 0:I.url,sx:{width:100,height:100},alt:"image"})})})]}),(0,D.jsxs)(u.A,{children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Created By"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:xe&&(null===xe||void 0===xe||null===(k=xe.created_by)||void 0===k?void 0:k.name)})})]}),(0,D.jsxs)(u.A,{children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Updated By"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:xe&&(null===xe||void 0===xe||null===(O=xe.updated_by)||void 0===O?void 0:O.name)})})]}),(0,D.jsxs)(u.A,{children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Created At"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:(null===xe||void 0===xe?void 0:xe.created_at)&&f().utc(xe.created_at).local().format("DD-MM-YYYY HH:mm:ss")})})]}),(0,D.jsxs)(u.A,{children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Updated At"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:(null===xe||void 0===xe?void 0:xe.updated_at)&&f().utc(xe.updated_at).local().format("DD-MM-YYYY HH:mm:ss")})})]})]})})})}),(0,D.jsxs)(A.Ay,{container:!0,justifyContent:"space-between",alignItems:"baseline",direction:"row",children:[(0,D.jsx)(A.Ay,{item:!0}),(0,D.jsx)(A.Ay,{item:!0,children:(0,D.jsx)(o.A,{sx:{mt:2,mb:2,px:6,mr:2},variant:"contained",onClick:()=>{me(!1)},color:"warning",children:"Close"})})]})]}),(0,D.jsxs)(M.A,{open:Ae,fullWidth:!0,maxWidth:"xs",disableEscapeKeyDown:!0,"aria-labelledby":"form-dialog-title",classes:{paper:"rounded-8"},disableRestoreFocus:!0,children:[(0,D.jsx)(q.A,{children:(0,D.jsx)(s.A,{variant:"h5",color:"error",children:"Alert"})}),(0,D.jsx)(s.A,{margin:"0px 15px 15px 21px",children:"Are you sure want to delete?"}
1),(0,D.jsx)(S.A,{sx:{"& .MuiTextField-root":{mb:1,mt:1},"& .react-tel-input.focused":{borderColor:"transparent1"},m:2},children:(0,D.jsxs)(A.Ay,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"baseline",children:[(0,D.jsx)(A.Ay,{item:!0,children:(0,D.jsx)(o.A,{sx:{mt:1,mb:1,px:4},type:"button",variant:"contained",disabled:de,color:"primary",onClick:()=>{Z((0,H.mR)(xe.id)).then(e=>{var i,t;null!==e&&void 0!==e&&null!==(i=e.payload)&&void 0!==i&&null!==(t=i.response)&&void 0!==t&&t.status&&Pe()})},"aria-label":"delete",style:{textTransform:"capitalize",fontSize:"16px"},children:de?(0,D.jsx)(R.A,{size:24,olor:"inherit"}):"Yes"})}),(0,D.jsx)(A.Ay,{item:!0,children:(0,D.jsx)(o.A,{sx:{mt:1,mb:1,px:4},variant:"contained",onClick:()=>Pe(),color:"warning",style:{textTransform:"capitalize",fontSize:"16px"},children:"No"})})]})})]})]})}var de=t(90260);function ce(){var e,i,t,g,C,S,F,z,Y,B,q;const{themeStretch:M}=(0,_.Mp)(),T=(0,y.g)(),P=(0,b.wA)(),N=(0,b.d4)(e=>{let{source:i}=e;return i.batchItemslist[0]}),W=(0,b.d4)(e=>{let{source:i}=e;return i.sourcelist.length}),R=(0,b.d4)(e=>{let{source:i}=e;return i.destination.length}),U=(0,y.Zp)(),{user:E}=(0,V.A)();return(0,n.useEffect)(()=>{P((0,H.Hq)(T))},[]),(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(v.mg,{children:(0,D.jsx)("title",{children:"Batch Items | FSS"})}),(0,D.jsxs)(l.A,{maxWidth:!M&&"xl",sx:{paddingBottom:"1.25rem"},children:[(0,D.jsxs)(A.Ay,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"baseline",children:[(0,D.jsx)(A.Ay,{item:!0,children:(0,D.jsxs)(m.A,{sx:{display:"flex",justifyContent:"space-start"},children:[(0,D.jsx)(j.In,{icon:"fa-cubes",color:"#004e49",width:"25",height:"28"}),(0,D.jsx)(s.A,{fontWeight:"bold",sx:{ml:1},textTransform:"capitalize",variant:"h5",children:null===N||void 0===N?void 0:N.batch_name})]})}),(0,D.jsx)(A.Ay,{item:!0,children:(0,D.jsx)(m.A,{sx:{display:"flex",justifyContent:"space-end"},children:(0,D.jsx)(Q.A,{sx:{backgroundColor:"primary.main",color:"white"},onClick:()=>U(de.nB.batches.list),children:(0,D.jsx)(r.A,{title:"Back to Batches",arrow:!0,children:(0,D.jsx)(o.A,{children:(0,D.jsx)(j.In,{icon:"vaadin:arrow-backward",color:"white",width:"20",height:"20"})})})})})})]}),(0,D.jsx)("br",{}),(0,D.jsxs)(A.Ay,{container:!0,spacing:3,direction:"row",justifyContent:"space-between",alignItems:"baseline",children:[(null===E||void 0===E||null===(e=E.permissions)||void 0===e?void 0:e.includes("source_access"))&&(0,D.jsx)(A.Ay,{item:!0,xs:12,sm:6,md:3,lg:3,children:(0,D.jsx)(I,{count:String(W),title:"SOURCE ITEMS",icon:"fa-solid:sitemap"})}),(null===E||void 0===E||null===(i=E.permissions)||void 0===i?void 0:i.includes("destination_access"))&&(0,D.jsx)(A.Ay,{item:!0,xs:12,sm:6,md:3,lg:3,children:(0,D.jsx)(I,{count:String(R),title:"DESTINATION",icon:"carbon:delivery"})}),(0,D.jsx)(A.Ay,{item:!0,xs:12,sm:6,md:3,lg:3,children:(0,D.jsx)(I,{count:String((null===N||void 0===N?void 0:N.batch_code)||""),title:"BATCH CODE",icon:"ic:baseline-barcode"})}),(0,D.jsx)(A.Ay,{item:!0,xs:12,sm:6,md:3,lg:3,children:(0,D.jsx)(k,{title:"QR",icon:"material-symbols:qr-code"})})]}),(0,D.jsxs)(A.Ay,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"baseline",spacing:3,sx:{py:4,mt:.5,px:1,mb:1},children:[(0,D.jsx)(A.Ay,{item:!0,lg:6,md:6,xs:12,sm:12,children:(null===E||void 0===E||null===(t=E.permissions)||void 0===t?void 0:t.includes("source_access"))&&(0,D.jsx)(J,{})}),(0,D.jsx)(A.Ay,{item:!0,lg:6,md:6,xs:12,sm:12,children:(null===E||void 0===E||null===(g=E.permissions)||void 0===g?void 0:g.includes("destination_access"))&&(0,D.jsx)(ae,{})})]}),(0,D.jsx)(a.A,{sx:{padding:"1rem"},children:(0,D.jsx)(d.A,{children:(0,D.jsx)(c.A,{"aria-label":"simple table",size:"small",children:(0,D.jsxs)(h.A,{children:[(0,D.jsxs)(u.A,{sx:{bgcolor:"#F4F6F8"},children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"ID"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:null===N||void 0===N?void 0:N.uuid})})]}),(0,D.jsxs)(u.A,{children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Kitchen Name"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:null===N||void 0===N||null===(C=N.kitchen)||void 0===C?void 0:C.kitchen_n
1ame})})]}),(0,D.jsxs)(u.A,{sx:{bgcolor:"#F4F6F8"},children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Batch Name"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:N&&(null===N||void 0===N?void 0:N.batch_name)})})]}),(0,D.jsxs)(u.A,{children:[(0,D.jsx)(x.A,{children:(0,D.jsxs)(s.A,{variant:"subtitle2",color:"gray",children:["Batch Size"," "]})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:N&&N.batch_size})})]}),(0,D.jsxs)(u.A,{sx:{bgcolor:"#F4F6F8"},children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Batch Code"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:N&&N.batch_code})})]}),(0,D.jsxs)(u.A,{children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Production Date"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:N&&(null===N||void 0===N?void 0:N.dispatch_date)})})]}),(0,D.jsxs)(u.A,{sx:{bgcolor:"#F4F6F8"},children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Product Temperature"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:N&&N.dispatch_temperature})})]}),(0,D.jsxs)(u.A,{children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Use By"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:N&&N.use_by})})]}),(0,D.jsxs)(u.A,{sx:{bgcolor:"#F4F6F8"},children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Comments"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:N&&N.comments})})]}),(0,D.jsxs)(u.A,{children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Image"})}),(0,D.jsx)(r.A,{title:(null===N||void 0===N||null===(S=N.photo)||void 0===S?void 0:S.url)&&(0,D.jsx)(w.A,{src:null===N||void 0===N||null===(F=N.photo)||void 0===F?void 0:F.url,sx:{width:250,height:200},alt:"image"}),arrow:!0,children:(0,D.jsx)(x.A,{children:(null===N||void 0===N||null===(z=N.photo)||void 0===z?void 0:z.url)&&(0,D.jsx)(w.A,{src:null===N||void 0===N||null===(Y=N.photo)||void 0===Y?void 0:Y.url,sx:{width:50,height:50},alt:"image"})})})]}),(0,D.jsxs)(u.A,{sx:{bgcolor:"#F4F6F8"},children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Public"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:(0,D.jsx)(p.A,{variant:"soft",color:1===(null===N||void 0===N?void 0:N.is_public)?"primary":"error",sx:{fontWeight:"bold",pt:.1,px:1===(null===N||void 0===N?void 0:N.is_public)?.7:.1},label:1===(null===N||void 0===N?void 0:N.is_public)?"Yes":"No",size:"small"})})})]}),(0,D.jsxs)(u.A,{children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Created By"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:N&&(null===N||void 0===N||null===(B=N.created_by)||void 0===B?void 0:B.name)})})]}),(0,D.jsxs)(u.A,{sx:{bgcolor:"#F4F6F8"},children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Updated By"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:N&&(null===N||void 0===N||null===(q=N.updated_by)||void 0===q?void 0:q.name)})})]}),(0,D.jsxs)(u.A,{children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Created At"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:(null===N||void 0===N?void 0:N.created_at)&&f().utc(N.created_at).local().format("DD-MM-YYYY HH:mm:ss")})})]}),(0,D.jsxs)(u.A,{children:[(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",color:"gray",children:"Updated At"})}),(0,D.jsx)(x.A,{children:(0,D.jsx)(s.A,{variant:"subtitle2",children:(null===N||void 0===N?void 0:N.updated_at)&&f().utc(N.updated_at).local().format("DD-MM-YYYY HH:mm:ss")})})]})]})})})})]})]})}},86898(e,i,t){t.d(i,{A:()=>r});var n=t(44501),l=t(12639);const s=(0,t(1763).A)("MuiBox",["root"]),r=(0,l.A)({defaultClassName:s.root,generateClassName:n.A.generate})}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.