1"use strict";(globalThis.webpackChunkdeepedge_platform||=[]).push([[3131],{13131(e,t,n){n.r(t),n.d(t,{default:()=>A});var o=n(65043),i=n(26240),a=n(55556),s=n(7353),r=n(94496),l=n(3438),c=n(68903),d=n(23505),p=n.n(d),m=n(73216),h=n(83703),v=n(51604),x=n(94412),u=n(97929),g=n(42406),j=n(61596),y=n(70579);const f=()=>{const[e,t]=(0,o.useState)(!0),n=()=>{console.log("Closing Notification"),t(!1)};return(0,o.useEffect)(()=>{if(!e)return;const t=setTimeout(()=>{n()},5e3);return()=>clearTimeout(t)},[e]),e?(0,y.jsx)(s.A,{children:(0,y.jsxs)(j.A,{elevation:3,sx:{position:"fixed",top:110,left:"50%",transform:"translateX(-50%)",backgroundColor:"#222222",color:"#EEEEEE",padding:"10px 10px",borderRadius:"9px",display:"flex",alignItems:"center",gap:1},children:[(0,y.jsxs)(r.A,{variant:"body1",style:{color:"#EEEEEE",fontWeight:"400"},children:[(0,y.jsx)(x.g,{icon:u.JUx}),"Swipe from left to right to see other products/categories"]}),(0,y.jsx)(x.g,{icon:u.yYc,onClick:n})]})}):null},A=()=>{const{station_id:e}=(0,m.g)(),t=(0,m.Zp)(),n=(0,i.A)(),d=(0,a.A)(n.breakpoints.down("sm")),j=(0,a.A)(n.breakpoints.down("md")),A=`visual-inspection/inspection_session/?station_id=${e}`,{data:b,loading:_,error:z}=(0,v.A)(A,"get"),E=Array.isArray(b)?b.length:0,S=(0,o.useMemo)(()=>Math.min(E,d?1:j?2:3),[E,d,j]),w=Math.max(0,E-S),[W,C]=(0,o.useState)("grid"),[N,k]=(0,o.useState)(0),[I,M]=(0,o.useState)(0);(0,o.useEffect)(()=>{k(e=>Math.min(Math.max(e,0),w))},[w,E,S]);const P=(e,n)=>{t(`/inspectiondetails/${e}`,{state:{nextId:!0}}),localStorage.setItem("stationId",n)},T=E>S,B=function(e,t){var n,o,i,a,c;let{fixedWidth:d}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const p=null!==(n=null===e||void 0===e?void 0:e._id)&&void 0!==n?n:t,m=I===t;return(0,y.jsxs)(s.A,{className:"vi-inspect-card"+(m?" is-active":""),onClick:()=>(e=>{I!==e&&M(e)})(t),sx:{cursor:"pointer",width:d?{xs:"100%",sm:d}:"100%",maxWidth:d||"none",flex:d?"0 1 auto":void 0,backgroundColor:"#252528","&:hover":{backgroundColor:"var(--card-hover-color, #313134)"}},children:[(0,y.jsx)(s.A,{className:"vi-inspect-card__media",children:(0,y.jsx)("img",{src:(null===e||void 0===e?void 0:e.product_thumbnail)||"/images/placeholder.png",alt:(null===e||void 0===e?void 0:e.product_name)||"Product"})}),(0,y.jsxs)(r.A,{variant:"h5",className:"d-a gap-2 card-title",sx:{fontWeight:"var(--type-subheading-weight)",color:"var(--type-primary)",mt:1,mb:1,fontSize:"var(--type-subheading-size) !important",lineHeight:"var(--type-subheading-line)",whiteSpace:"normal"},children:[(null===e||void 0===e?void 0:e.product_name)||"Unnamed Product",(0,y.jsx)(r.A,{variant:"body2",className:"p-0",sx:{marginBottom:"-2px"},children:(0,y.jsx)(s.A,{component:"span",sx:{color:"var(--type-meta)",fontWeight:"var(--type-meta-weight)",fontSize:"var(--type-meta-size)"},className:"p-0",children:"---"})}),(0,y.jsx)(r.A,{variant:"body2",className:"p-0",sx:{marginBottom:"-5px"},children:(0,y.jsx)(s.A,{component:"span",sx:{color:"var(--type-meta)",fontWeight:"var(--type-meta-weight)",fontSize:"var(--type-meta-size)"},className:"p-0",children:(null===e||void 0===e?void 0:e.status)||"\u2014"})})]}),(0,y.jsxs)(r.A,{variant:"body2",children:[(0,y.jsx)(s.A,{component:"span",sx:{color:"#828282",fontWeight:500},children:"Category of Inspection:"})," ",(0,y.jsx)(s.A,{component:"span",sx:{color:"var(--type-meta)",fontWeight:"var(--type-meta-weight)",fontSize:"var(--type-meta-size)"},children:Object.values(null!==(o=null===e||void 0===e?void 0:e.defects_category)&&void 0!==o?o:{}).join(", ")||"\u2014"})]}),(0,y.jsxs)(r.A,{variant:"body2",children:[(0,y.jsx)(s.A,{component:"span",sx:{color:"#828282",fontWeight:500},children:"Number of Units:"})," ",(0,y.jsx)(s.A,{component:"span",sx:{color:"var(--type-meta)",fontWeight:"var(--type-meta-weight)",fontSize:"var(--type-meta-size)"},children:Object.values(null!==(i=null===e||void 0===e?void 0:e.unit_range)&&void 0!==i?i:{}).join("-")||"\u2014"})]}),(0,y.jsxs)(r.A,{variant:"body2",children:[(0,y.jsx)(s.A,{component:"span",sx:{color:"#828282",fontWeight:500},children:"Pending Units:"})," ",(0,y.jsx)(s.A,{component:"span",sx:{color:"var(--type-meta)",fontWeight:"var(--type-meta-weight)",fontSize:"var(--type-meta-size)"},children:null!==e&&void 0!==e&&null!==(a=e.unit_range)&&void 0!==a&&a.length?e.unit_range[1]-e.unit_range[0]+1-(null!==(c=e.inspected_count)&&void 0!==c?c:0):"\u2014"})]}),(0,y.jsxs)(r.A,{variant:"body2",children:[(0,y.jsx)(s.A,{component:"span",sx:{color:"#828282",fontWeight:500},children:"Estimated Duration:"})," ",(0,y.jsx)(s.A,{component:"span",sx:{color:"var(--type-meta)",fontSize:"var(--type-meta-size)"},children:null!=(null===e||void 0===e?void 0:e.estimated_duration_seconds)?`${e.estimated_duration_seconds} Sec`:"\u2014"})]}),(0,y.jsxs)(r.A,{variant:"body2",gutterBottom:!0,children:[(0,y.jsx)(s.A,{component:"span",sx:{color:"#828282",fontWeight:500},children:"Last Modified:"})," ",(0,y.jsx)(s.A,{component:"span",sx:{color:"var(--type-meta)",fontSize:"var(--type-meta-size)"},children:null!==e&&void 0!==e&&e.updatedAt?e.updatedAt.split("T")[0]:"\u2014"})]}),m&&(0,y.jsx)(l.A,{variant:"contained",sx:{mt:2,backgroundColor:"#3754D2",position:"relative",zIndex:10},onClick:()=>{P(e._id,null===e||void 0===e?void 0:e.station_id)},children:"Inspect"})]},p)};if(_)return(0,y.jsx)(g.A,{});const U=1===E?380:2===E?340:300;return(0,y.jsxs)(s.A,{className:"vi",sx:{userSelect:"none"},children:[(0,y.jsx)(h.Ay,{}),(0,y.jsx)(f,{}),(0,y.jsxs)(s.A,{className:"vi-body pt-5 mt-3",children:[(0,y.jsxs)(s.A,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",width:"100%"},children:[(0,y.jsxs)(s.A,{children:[(0,y.jsx)(r.A,{component:"h1",className:"vi-title",children:"Today's Inspection"}),(0,y.jsx)(r.A,{className:"vi-subtitle",children:"Choose product to start Inspection"})]}),(0,y.jsxs)(s.A,{children:[(0,y.jsx)(l.A,{onClick:e=>{e.stopPropagation(),C("list")},className:"p-2",style:{backgroundColor:"list"===W?"#1a73e8":"transparent",borderRadius:"4px",minWidth:"unset"}
1,children:(0,y.jsx)(x.g,{icon:u.ITF,style:{fontSize:16,color:"list"===W?"#000":"#888"}})}),(0,y.jsx)(l.A,{onClick:()=>C("grid"),className:"p-2",style:{backgroundColor:"grid"===W?"#1a73e8":"transparent",borderRadius:"4px",minWidth:"unset"},children:(0,y.jsx)(x.g,{icon:u.l9V,style:{fontSize:16,color:"grid"===W?"#000":"#888"}})})]})]}),z?(0,y.jsxs)(r.A,{color:"error",children:["Error: ",String(z)]}):E>0?"grid"===W?T?(0,y.jsx)(s.A,{className:"vi-inspect-carousel",children:(0,y.jsx)(p(),{numberOfCards:S,slidesToScroll:1,gutter:16,chevronWidth:48,outsideChevron:!1,firstAndLastGutter:!1,enablePlaceholder:!1,activePosition:"left",activeItemIndex:N,requestToChangeActive:e=>{const t=Math.min(Math.max(e,0),w);k(t)},infiniteLoop:E>S,leftChevron:(0,y.jsx)(x.g,{icon:u.QEZ,onClick:()=>k(e=>Math.max(e-1,0)),style:{height:30,color:0===N?"#333":"#EEEEEE",cursor:0===N?"not-allowed":"pointer",pointerEvents:0===N?"none":"auto"}}),rightChevron:(0,y.jsx)(x.g,{icon:u.xnu,onClick:()=>k(e=>Math.min(e+1,w)),style:{height:30,color:N>=w?"#333":"#EEEEEE",cursor:N>=w?"not-allowed":"pointer",pointerEvents:N>=w?"none":"auto"}}),children:b.map((e,t)=>B(e,t))})}):(0,y.jsx)(s.A,{className:"vi-inspect-row",children:b.map((e,t)=>B(e,t,{fixedWidth:U}))}):(0,y.jsx)(c.Ay,{container:!0,spacing:2,className:"mt-3",children:b.map((e,t)=>{var n,o,i;return(0,y.jsx)(c.Ay,{item:!0,xs:12,children:(0,y.jsxs)(s.A,{className:"vi-inspect-card is-active",sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2},children:[(0,y.jsxs)(s.A,{sx:{display:"flex",alignItems:"center",gap:2,width:"100%"},children:[(0,y.jsx)("img",{src:(null===e||void 0===e?void 0:e.product_thumbnail)||"/images/placeholder.png",alt:(null===e||void 0===e?void 0:e.product_name)||"Product",style:{maxWidth:150,maxHeight:150,objectFit:"contain"}}),(0,y.jsxs)(s.A,{sx:{minWidth:0},children:[(0,y.jsxs)(r.A,{variant:"h5",className:"d-a gap-2 card-title",sx:{fontWeight:"var(--type-subheading-weight)",color:"var(--type-primary)",mt:1,mb:1,fontSize:"var(--type-subheading-size) !important",whiteSpace:"normal"},children:[(null===e||void 0===e?void 0:e.product_name)||"Unnamed Product",(0,y.jsx)(r.A,{variant:"body2",className:"p-0",sx:{marginBottom:"-2px"},children:(0,y.jsx)(s.A,{component:"span",sx:{color:"var(--type-meta)",fontWeight:"var(--type-meta-weight)",fontSize:"var(--type-meta-size)"},className:"p-0",children:"---"})}),(0,y.jsx)(r.A,{variant:"body2",className:"p-0",sx:{marginBottom:"-5px"},children:(0,y.jsx)(s.A,{component:"span",sx:{color:"var(--type-meta)",fontWeight:"var(--type-meta-weight)",fontSize:"var(--type-meta-size)"},className:"p-0",children:(null===e||void 0===e?void 0:e.status)||"\u2014"})})]}),(0,y.jsxs)(r.A,{variant:"body2",children:[(0,y.jsx)(s.A,{component:"span",sx:{color:"#828282",fontWeight:500},children:"Category of Inspection:"})," ",(0,y.jsx)(s.A,{component:"span",sx:{color:"var(--type-meta)",fontWeight:"var(--type-meta-weight)",fontSize:"var(--type-meta-size)"},children:Object.values(null!==(o=null===e||void 0===e?void 0:e.defects_category)&&void 0!==o?o:{}).join(", ")||"\u2014"})]}),(0,y.jsxs)(r.A,{variant:"body2",children:[(0,y.jsx)(s.A,{component:"span",sx:{color:"#828282",fontWeight:500},children:"Nunber of Units:"})," ",(0,y.jsx)(s.A,{component:"span",sx:{color:"var(--type-meta)",fontWeight:"var(--type-meta-weight)",fontSize:"var(--type-meta-size)"},children:Object.values(null!==(i=null===e||void 0===e?void 0:e.unit_range)&&void 0!==i?i:{}).join(", ")||"\u2014"})]}),(0,y.jsxs)(r.A,{variant:"body2",children:[(0,y.jsx)(s.A,{component:"span",sx:{color:"#828282",fontWeight:500},children:"Estimated Duration:"})," ",(0,y.jsx)(s.A,{component:"span",sx:{color:"var(--type-meta)",fontSize:"var(--type-meta-size)"},children:null!=(null===e||void 0===e?void 0:e.estimated_duration_seconds)?`${e.estimated_duration_seconds} Sec`:"\u2014"})]}),(0,y.jsxs)(r.A,{variant:"body2",gutterBottom:!0,children:[(0,y.jsx)(s.A,{component:"span",sx:{color:"#828282",fontWeight:500},children:"Last Modified:"})," ",(0,y.jsx)(s.A,{component:"span",sx:{color:"var(--type-meta)",fontSize:"var(--type-meta-size)"},children:null!==e&&void 0!==e&&e.updatedAt?new Date(e.updatedAt).toLocaleStr
1ing():"\u2014"})]})]})]}),(0,y.jsx)(l.A,{variant:"contained",sx:{backgroundColor:"#3754D2",ml:2,whiteSpace:"nowrap"},onClick:()=>P(null===e||void 0===e?void 0:e._id,null===e||void 0===e?void 0:e.station_id),children:"Inspect"})]})},null!==(n=null===e||void 0===e?void 0:e._id)&&void 0!==n?n:t)})}):(0,y.jsx)(r.A,{variant:"body1",color:"white",align:"center",children:"No inspection data available."})]})]})}}}]); 2//# sourceMappingURL=3131.4734a1a2.chunk.js.map
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.