(()=>{(self.webpackChunkics_operations=self.webpackChunkics_operations||[]).push([[179],{1843:(I,d,e)=>{"use strict";e.d(d,{Z:()=>C});var t=e(5881),i=e.n(t),s=e(2354),c=e.n(s),a=c()(i());a.push([I.id,"",""]),a.locals={"brand-primary-navy":"#182d55","brand-primary-teal":"#6ec6aa","brand-secondary-buttercup":"#f2a71e","brand-secondary-cornflowerblue":"#3e8ccc","brand-secondary-seagull":"#85d3ea","brand-secondary-apple":"#7dc242","brand-secondary-tropicalrainforest":"#007d59","brand-neutral-athensgray":"#eff0f3","brand-neutral-westar":"#e3e1dd","brand-neutral-iceberg":"#daf0f4","grayscale-white":"#fff","grayscale-gray200":"#f8f8f8","grayscale-gray300":"#e4e4e4","grayscale-gray400":"#cecece","grayscale-gray600":"#adadad","grayscale-gray700":"#6c6c6c","grayscale-gray800":"#333","grayscale-black":"#000","status-positive-main":"#319b51","status-positive-light":"#50fd84","status-positive-dark":"#277c41","status-positive-darker":"#1c5934","status-negative-main":"#df5d5f","status-negative-light":"#ef5350","status-negative-dark":"#d1292c","status-negative-darker":"#991e20","status-information-main":"#3e8ccc","status-information-light":"#1294ff","status-information-dark":"#2d71a9","status-information-darker":"#21547d","status-warning-main":"#f2a71e","status-warning-light":"#f7a50f","status-warning-dark":"#bc7e0b","status-warning-darker":"#6b4705"};const C=a},400:(I,d,e)=>{"use strict";e.d(d,{Z:()=>C});var t=e(5881),i=e.n(t),s=e(2354),c=e.n(s),a=c()(i());a.push([I.id,"",""]),a.locals={fontFamily:"Tahoma,Calibri,Arial"};const C=a},3755:(I,d,e)=>{"use strict";e.d(d,{s:()=>C});var t=e(4119),i=e(3452),s=e(1732);const c=y=>async D=>{try{const{accessToken:S}=await i.U.acquireTokenSilent({scopes:[y]});if(!S){const l=new Error("Empty access token received from acquireTokenSilent");throw console.error("[appendAuthToken] Empty access token",{scope:y}),l}return D.set("Authorization",`Bearer ${S}`),D}catch(S){const l=(0,s.h)(S);throw console.error("[appendAuthToken] Token acquisition failed",{scope:y,name:l.name,code:l.errorCode||l.code,message:l.message}),S}};var a=e(6902);const C=(y,D={})=>{const{scope:S=a.D.scope,injectCompanyHeader:l=!0}=D;return(0,t.ni)({baseUrl:y,prepareHeaders:async(h,L)=>{try{const p=await c(S)(h);if(l){const O=L.getState().session?.selectedCompanyId;O&&p.set("Tcmis-Company-ID",O)}return p}catch(B){const p=(0,s.h)(B);throw console.error("[baseQueryWithAuth] Failed to prepare auth headers",{baseUrl:y,scope:S,name:p.name,code:p.errorCode||p.code,message:p.message}),B}}})}},881:(I,d,e)=>{"use strict";e.d(d,{_S:()=>l,Ml:()=>A,oG:()=>h,xJ:()=>p});var t=e(3755),i=e(6902),s=e(9665);const c=O=>O.query({query:v=>{const E=new URLSearchParams;return v["delivery-date-max"]&&E.append("delivery-date-max",v["delivery-date-max"]),v["delivery-date-min"]&&E.append("delivery-date-min",v["delivery-date-min"]),v.facilityId&&E.append("facility-id",v.facilityId),v.page!==void 0&&E.append("page",v.page.toString()),v.shipment!==void 0&&E.append("shipment",v.shipment.toString()),v.size!==void 0&&E.append("size",v.size.toString()),v.sort&&v.sort.forEach(m=>E.append("sort",m)),v.workArea&&E.append("work-area",v.workArea),{url:"/put-away-errors",params:E}}});var a=e(1386);const C=!1,y={content:[{vendorId:"securastock",vendorCabinetId:"6408231608",facilityId:"TestHub",facilityName:"Test Hub",cabinetDescription:"Test Work Area 1",cabinetName:"TestHostWorkArea1",cabinetId:8813573,inventoryGroup:"TestInventoryGroup",inventoryGroupName:"Test Inventory Group"},{vendorId:"securastock",vendorCabinetId:"6408231609",facilityId:"TestHub",facilityName:"Test Hub",cabinetDescription:"Test Work Area 2",cabinetName:"TestHostWorkArea2",cabinetId:8813574,inventoryGroup:"TestInventoryGroup",inventoryGroupName:"Test Inventory Group"},{vendorId:"securastock",vendorCabinetId:"6408231610",facilityId:"TestHub",facilityName:"Test Hub",cabinetDescription:"Test Work Area 3",cabinetName:"TestHostWorkArea3",cabinetId:8813575,inventoryGroup:"TestInventoryGroup",inventoryGroupName:"Test Inventory Group"}],pageable:{pageNumber:0,pageSize:20,sort:{unsorted:!0,sorted:!1,empty:!0},offset:0,unpaged:!1,paged:!0},totalPages:1,totalElements:3,last:!0,numberOfElements:3,first:!0,size:20,number:0,sort:{unsorted:!0,sorted:!1,empty:!0},empty:!1},D=O=>window.location.host.startsWith("localhost")&&C?(console.warn("[DEV] Using mocked /facilities/:facilityId/work-areas response"),O.query({queryFn:async m=>(await new Promise(j=>setTimeout(j,400)),(0,a.Cv)(`[DEV] Returning ${y.totalElements} work areas for facilityId=${m}`),{data:y})})):O.query({query:m=>({url:`/facilities/${m}/work-areas`})}),S=O=>O.mutation({query:v=>({url:"/counts",method:"POST",body:v})}),l=(0,s.LC)({reducerPath:"customerOpsApi",baseQuery:(0,t.s)(i.D.api.customerOps),endpoints:O=>({getPutAwayErrors:c(O),getWorkAreasByFacility:D(O),createCount:S(O)})}),{useGetPutAwayErrorsQuery:h,useLazyGetPutAwayErrorsQuery:L,useGetWorkAreasByFacilityQuery:B,useLazyGetWorkAreasByFacilityQuery:p,useCreateCountMutation:A}=l},7110:(I,d,e)=>{"use strict";e.d(d,{GW:()=>F,T:()=>oe,Pg:()=>q,bt:()=>ae,of:()=>ie});var t=e(3755);const i=R=>R.query({query:()=>({url:"/user"})});var s=e(6902),c=e(9665);const a=R=>R.query({query:({role:b})=>({url:"/users",params:{role:b}})});var C=e(1386);const y=!1,D="multiple",S=[{companyId:"HostCompany",personnelId:1027356,status:"A",defaultFacilityId:"FAC_DE_01",defaultHub:"HUB_DE_01",adminRole:"User",dataSource:"TCMIS",lockoutDate:null,defaultOpsEntityId:"OPS_DE_01",itarRole:"User",msdsQcRole:"User"},{companyId:"ACME_US",personnelId:1027356,status:"A",defaultFacilityId:"FAC_US_01",defaultHub:"HUB_US_01",adminRole:"Admin",dataSource:"TCMIS",lockoutDate:null,defaultOpsEntityId:"OPS_US_01",itarRole:"Admin",msdsQcRole:"Admin"},{companyId:"BOEING_UK",personnelId:1027356,status:"A",defaultFacilityId:"FAC_UK_01",defaultHub:"HUB_UK_01",adminRole:"User",dataSource:"TCMIS",lockoutDate:null,defaultOpsEntityId:"OPS_UK_01",itarRole:"User",msdsQcRole:"User"}],l=R=>window.location.host.startsWith("localhost")&&y?(console.warn(`[DEV] Using mocked /user/companies response (mode: ${D})`),R.query({queryFn:async()=>{await new Promise(K=>setTimeout(K,400));let M;return D==="none"?M=[]:D==="single"?M=[S[0]]:M=S,(0,C.Cv)(`[DEV] Returning ${M.length} companies`),{data:M}}})):R.query({query:()=>({url:"/user/companies"})}),h=!1,L=R=>window.location.host.startsWith("localhost")&&h?(console.warn("[DEV] Using mocked /users/:personnelId/companies response"),R.query({queryFn:async()=>(await new Promise(M=>setTimeout(M,400)),{data:[]})})):R.query({query:M=>({url:`/users/${M}/companies`})}),B=!1,p=[{personnelId:1027356,companyId:"HostCompany",facilityId:"testfacility1",facilityName:"Test Facility 1",preferredAccountSysId:"testaccountsys1",preferredAccountSysDesc:"Test Preferred Account System",defaultApplication:"DefaultApp1",defaultApplicationDesc:"Default Application 1",adminRole:"Admin"}],A=R=>window.location.host.startsWith("localhost")&&B?(console.warn("[DEV] Using mocked /users/:personnelId/facilities response"),R.query({queryFn:async M=>(await new Promise(K=>setTimeout(K,400)),(0,C.Cv)(`[DEV] Returning ${p.length} facilities for personnelId=${M}`),{data:p})})):R.query({query:M=>({url:`/users/${M}/facilities`})}),O=!1,v=R=>window.location.host.startsWith("localhost")&&O?(console.warn("[DEV] Using mocked /users/:personnelId/companies/:companyId/facilities response"),R.query({queryFn:async()=>(await new Promise(M=>setTimeout(M,400)),{data:[]})})):R.query({query:({personnelId:M,companyId:K})=>({url:`/users/${M}/companies/${K}/facilities`})}),E=!1,m="all",j=[{companyId:"HostCompany",personnelId:1027356,pageId:"invoice-problem-management",adminRole:null},{companyId:"HostCompany",personnelId:1027356,pageId:"secura-stock",adminRole:null},{companyId:"HostCompany",personnelId:1027356,pageId:"inbound-quality",adminRole:null}],z=[{companyId:"HostCompany",personnelId:1027356,pageId:"invoice-problem-management",adminRole:null}],P=R=>window.location.host.startsWith("localhost")&&E?(console.warn(`[DEV] Using mocked /users/:userId/companies/:companyId/pages response (mode: ${m})`),R.query({queryFn:async()=>{await new Promise(K=>setTimeout(K,400));let M;return m==="none"?M=[]:m==="partial"?M=z:M=j,(0,C.Cv)(`[DEV] Returning ${M.length} pages`),{data:M}}})):R.query({query:({userId:M,companyId:K})=>({url:`/users/${M}/companies/${K}/pages`})}),F=(0,c.LC)({reducerPath:"iamApi",baseQuery:(0,t.s)(s.D.api.iam),endpoints:R=>({getUserWorkContext:i(R),getAuthorizedUsersForRoles:a(R),getUserCompanies:l(R),getUserCompaniesByPersonnelId:L(R),getUserFacilities:A(R),getUserFacilitiesByCompany:v(R),getUserPages:P(R)})}),{useGetUserWorkContextQuery:G,useGetAuthorizedUsersForRolesQuery:U,useGetUserCompaniesQuery:W,useLazyGetUserCompaniesQuery:q,useGetUserCompaniesByPersonnelIdQuery:w,useLazyGetUserCompaniesByPersonnelIdQuery:oe,useGetUserFacilitiesQuery:ne,useLazyGetUserFacilitiesQuery:se,useGetUserFacilitiesByCompanyQuery:re,useLazyGetUserFacilitiesByCompanyQuery:ae,useGetUserPagesQuery:ce,useLazyGetUserPagesQuery:ie}=F},4890:(I,d,e)=>{"use strict";e.d(d,{wU:()=>B,_o:()=>v,hr:()=>p});var t=e(3755),i=e(6902);const s=i.D.api.logistics,c=null,a={Prefer:"code=200, dynamic=true",Accept:"application/json"},C={Prefer:"code=200",Accept:"application/json"},y=E=>E.query({query:({receiptId:m})=>{console.log("[getReceipt] Fetching receipt with ID:",m);const j={url:`${s}/receipts/${m}`,headers:a};return console.log("[getReceipt] Request configuration:",{url:j.url,headers:Object.keys(j.headers||{})}),j},transformResponse:(m,j,z)=>(console.log("[getReceipt] Successfully received receipt data for ID:",z.receiptId),console.log("[getReceipt] Response data:",{receiptId:m?.id||"N/A",status:m?.returnReceiptId||"N/A",responseSize:JSON.stringify(m).length}),m),transformErrorResponse:(m,j,z)=>{const P=m;return console.log("[getReceipt] Error fetching receipt with ID:",z.receiptId),console.log("[getReceipt] Error details:",{status:P.status,error:P.error,data:P.data}),m}}),D=E=>E.query({query:()=>({url:"/receipts/documenttypes"})}),S=null,l=E=>E.query({query:({assignedTo:m,hub:j,operatingEntity:z,receivingStatus:P,assignedToUser:F,inventoryGroups:G=[]})=>{const U=new URLSearchParams;U.append("operatingEntity",z),U.append("hub",j),U.append("assignedTo",m);for(let W=0;WE.query({query:m=>{console.log("[getReceiptStatusViewsById] Starting query with receiptId:",m);const j=`/receipts/views/status/${m}`;return console.log("[getReceiptStatusViewsById] Generated URL:",j),{url:j}},transformResponse:m=>(console.log("[getReceiptStatusViewsById] Raw response received:",m),m),transformErrorResponse:m=>(console.log("[getReceiptStatusViewsById] Error response:",m),m)});var L=e(9665);const B=(0,L.LC)({reducerPath:"logisticsApi",baseQuery:(0,t.s)(i.D.api.logistics),endpoints:E=>({getReceipt:y(E),getReceiptStatusViews:l(E),getReceiptStatusViewsById:h(E),getReceiptDocumentTypes:D(E)})}),{useGetReceiptQuery:p,useLazyGetReceiptStatusViewsQuery:A,useLazyGetReceiptStatusViewsByIdQuery:O,useGetReceiptDocumentTypesQuery:v}=B},3239:(I,d,e)=>{"use strict";e.d(d,{L:()=>a,r:()=>C});var t=e(3755),i=e(6902),s=e(9665),c=e(7260);const a=(0,s.LC)({reducerPath:"microsoftGraphApi",baseQuery:(0,t.s)(i.D.api.microsoftGraph,{scope:c.f1,injectCompanyHeader:!1}),endpoints:y=>({currentUser:y.query({query:()=>"me"})})}),{useCurrentUserQuery:C}=a},3452:(I,d,e)=>{"use strict";e.d(d,{U:()=>a});var t=e(1825),i=e(9600),s=e(6902);const c={auth:{clientId:s.D.authentication.clientId,authority:s.D.authentication.authority,redirectUri:window.location.origin,postLogoutRedirectUri:window.location.origin},cache:{cacheLocation:"localStorage",storeAuthStateInCookie:!1}},a=new t.L(c);a.handleRedirectPromise().then(C=>{C&&a.setActiveAccount(C.account)}).catch(C=>{console.error("Redirect authentication error:",C)}),a.addEventCallback(C=>{if(C.eventType===i.t.LOGIN_SUCCESS&&C.payload){const D=C.payload.account;a.setActiveAccount(D)}})},7260:(I,d,e)=>{"use strict";e.d(d,{X3:()=>c,f1:()=>s,s5:()=>a});const t=null,i={prod:"api://b42aa4a0-7833-4601-91e0-cd9e26b96401/ICSService.DefaultScope",dev:"api://a390d735-8347-4ef1-8a65-875d1410e88c/ICSService.DefaultScope",localhost:"api://a390d735-8347-4ef1-8a65-875d1410e88c/ICSService.DefaultScope"},s="User.Read",c=C=>i[C]||i.prod,a=C=>[c(C),s]},3168:(I,d,e)=>{"use strict";e.d(d,{$:()=>t});const t={INVOICE_PROBLEM_MANAGEMENT:"invoice-problem-management",SECURA_STOCK:"secura-stock"}},888:(I,d,e)=>{"use strict";e.d(d,{V:()=>t});const t=(i,s)=>{if(console.log(`[getEnvironmentFromHost] Input host: "${i}"`),console.log(`[getEnvironmentFromHost] Input namespace: "${s}"`),i.startsWith("localhost"))return console.log("[getEnvironmentFromHost] Localhost detected - returning dev environment"),"localhost";const c=i.split(".")[0];console.log(`[getEnvironmentFromHost] Host part: "${c}"`);let a;return c==="chemops"?a="prod":c.startsWith("chemops-")?a=c.replace("chemops-",""):a="prod",console.log(`[getEnvironmentFromHost] Determined environment: "${a}"`),a}},6902:(I,d,e)=>{"use strict";e.d(d,{D:()=>y});var t=e(888),i=e(7260);const s={namespace:"ics-operations-app",authentication:{clientId:"18a25ed5-b469-4694-a8a6-475fdf28e31a",authority:"https://login.microsoftonline.com/c7354023-f985-41a6-966e-da42877461b4"},api:{microsoftGraph:"https://graph.microsoft.com/v1.0",logistics:"https://chemops-dev.incora.com/chemicals/api/logistics",iam:"https://chemops-dev.incora.com/chemicals/api/iam",customerOps:"https://chemops-dev.incora.com/chemicals/api/customer-ops"},scope:(0,i.X3)("dev")},c={namespace:"ics-operations-app",authentication:{clientId:"a14295c2-fc21-4cf7-892d-73bd92cf2086",authority:"https://login.microsoftonline.com/c7354023-f985-41a6-966e-da42877461b4"},api:{microsoftGraph:"https://graph.microsoft.com/v1.0",logistics:"https://chemops.incora.com/chemicals/api/logistics",iam:"https://chemops.incora.com/chemicals/api/iam",customerOps:"https://chemops.incora.com/chemicals/api/customer-ops"},scope:(0,i.X3)("prod")},a={namespace:"ics-operations-app",authentication:{clientId:"18a25ed5-b469-4694-a8a6-475fdf28e31a",authority:"https://login.microsoftonline.com/c7354023-f985-41a6-966e-da42877461b4"},api:{microsoftGraph:"https://graph.microsoft.com/v1.0",logistics:"https://chemops-dev.incora.com/chemicals/api/logistics",iam:"https://chemops-dev.incora.com/chemicals/api/iam",customerOps:"https://chemops-dev.incora.com/chemicals/api/customer-ops"},scope:(0,i.X3)("dev")},y=(()=>{if(console.log("Configuration initialization started"),console.log("Current host:",window.location.host),console.log("Full location:",window.location.href),window.location.host.startsWith("localhost"))return console.log("Localhost detected - using development configuration"),console.log("Development configuration loaded:",s),{...s,scope:(0,i.X3)("localhost")};console.log("Non-localhost environment detected");const D=(0,t.V)(window.location.host,"ics-operations-app");console.log("Environment detected:",D);let S,l;return D==="prod"?(console.log("Loading production configuration"),S=c,l=(0,i.X3)("prod")):(console.log("Loading development configuration"),S=a,l=(0,i.X3)(D)||(0,i.X3)("dev")),console.log("Final configuration loaded:",S),{...S,scope:l}})()},8242:(I,d,e)=>{"use strict";e.d(d,{mA:()=>C,I0:()=>i,rM:()=>z,Tt:()=>y,TE:()=>v,v9:()=>s});var t=e(3583);const i=t.I0,s=t.v9;var c=e(9288),a=e(8051);const C=()=>{const{instance:P,accounts:F}=(0,c.Fp)(),[G,U]=(0,a.useState)(P.getActiveAccount()??F[0]??null);return(0,a.useEffect)(()=>{const W=P.getActiveAccount();if(W){U(W);return}F.length>0?(P.setActiveAccount(F[0]),U(F[0])):U(null)},[F,P]),G},y=P=>{(0,a.useEffect)(()=>{document.title=P},[P])};var D=(P=>(P.Default="Default",P.QATechnician="ics-qa-technician",P.QASupervisor="ics-qa-supervisor",P.InventoryManager="Inventory Manager",P))(D||{});const{Default:S,QATechnician:l,QASupervisor:h,InventoryManager:L}=D,B={"user.read":[S],"user.write":[S],"sds.read":[S],"warehouse-operations.read":[l,h,L],"inbound-quality.read":[l,h],"inbound-quality.assign":[h],"receiving.read":[l,h,L],"qvr.read":[l,h]},p=P=>Object.entries(B).reduce((F,[G,U])=>((U.includes(P)||U.includes(D.Default))&&F.push(G),F),[]),A=P=>P.reduce((G,U)=>[...G,...p(U)],[]).filter((G,U,W)=>W.indexOf(G)===U),O=P=>!P||P.length===0?[D.Default]:P,v=()=>{const P=C(),F=O(P?.idTokenClaims?.roles),G=A(F);return{hasPermission:w=>(w||(w="user.read"),!0),hasRole:w=>F.includes(w),getPermissions:()=>G}};var E=e(8343),m=e(8868),j=e(5029);const z=()=>{const P=(0,m.v9)(j.hV);return{hasPageAccess:G=>P.some(U=>U.pageId===G)}}},8343:(I,d,e)=>{"use strict";e.d(d,{Q:()=>S});var t=e(8051),i=e(8868),s=e(9288),c=e(7110),a=e(5029),C=e(3168),y=e(1386),D=e(1732);const S=()=>{const l=(0,i.I0)(),{accounts:h}=(0,s.Fp)(),{isInitialized:L}=(0,i.v9)(O=>O.session),[B]=(0,c.Pg)(),[p]=(0,c.of)(),A=(0,t.useRef)(!1);(0,t.useEffect)(()=>((0,y.Cv)("[BOOTSTRAP MOUNT]"),()=>{(0,y.Cv)("[BOOTSTRAP UNMOUNT]")}),[]),(0,t.useEffect)(()=>{if((0,y.Cv)("[BOOTSTRAP EFFECT] Running initialization check"),h.length===0){(0,y.Cv)("[SessionBootstrap] No authenticated accounts, skipping initialization");return}if(L){(0,y.Cv)("[SessionBootstrap] Session already initialized");return}if(A.current){(0,y.Cv)("[SessionBootstrap] Initialization already attempted");return}(0,y.Cv)("[SessionBootstrap] Starting session initialization..."),A.current=!0,(async()=>{try{(0,y.Cv)("[SessionBootstrap] Fetching companies...");const v=await B().unwrap();if(!v||!Array.isArray(v)){(0,y.H)("[SessionBootstrap] Invalid companies response:",v),l((0,a.o4)("Unable to retrieve your company access. Please contact support."));return}if((0,y.Cv)("[SessionBootstrap] Companies fetched:",v.length),v.length===0){(0,y.Ki)("[SessionBootstrap] User has no companies"),l((0,a.o4)("You do not have access to any companies. Please contact your administrator."));return}const E=v[0].personnelId;if(typeof E!="number"){(0,y.H)("[SessionBootstrap] Invalid personnelId for company:",v[0].companyId),l((0,a.o4)("Your user profile is incomplete. Please contact your administrator."));return}(0,y.Cv)("[SessionBootstrap] Setting personnelId:",E),l((0,a.y8)(E)),(0,y.Cv)("[SessionBootstrap] Auto-selecting first company:",v[0].companyId),l((0,a.ht)(v[0])),(0,y.Cv)("[SessionBootstrap] Fetching user pages for company:",v[0].companyId);const m=await p({userId:E,companyId:v[0].companyId}).unwrap();if(!Array.isArray(m)){(0,y.H)("[SessionBootstrap] Invalid pages response:",m),l((0,a.o4)("Unable to retrieve your page access. Please contact support."));return}if(m.length===0){(0,y.Ki)("[SessionBootstrap] User has no accessible pages"),l((0,a.o4)("You do not have access to any pages. Please contact your administrator."));return}(0,y.Cv)("[SessionBootstrap] User pages fetched:",m.length);const j=Object.values(C.$);m.forEach(z=>{j.includes(z.pageId)||(0,y.Ki)("[SessionBootstrap] Unknown pageId returned by backend \u2014 check PAGE_IDS registry for drift:",z.pageId)}),l((0,a.QQ)(m)),l((0,a.Uv)(v)),(0,y.Cv)("[SessionBootstrap] Session initialization complete")}catch(v){(0,y.H)("[SessionBootstrap] Error during initialization:",v);let E="Unable to complete session initialization. Please try again or contact support.";const m=(0,D.h)(v);m.name==="TypeError"||m.message&&(m.message.includes("fetch")||m.message.includes("network"))?E="Network error: Unable to connect to the service. Please check your internet connection.":m.status===401||m.status===403?E="You do not have permission to access this application. Please contact support.":m.status!==void 0&&m.status>=500?E="Service unavailable. Please try again later.":m.dataMessage?E=m.dataMessage:m.message&&m.message.length<200&&(E=m.message),l((0,a.o4)(E))}})()},[h.length,L,l,B,p])}},3527:(I,d,e)=>{"use strict";var t=e(9470),i=e(8051),s=e(8236),c=e(1632),a=e(7924);const C=({children:o})=>(0,t.jsx)(a.Z,{sx:{display:"flex"},children:o});var y=e(2522),D=e(2097),S=e(6367),l=e(5344),h=e(366),L=e(5909),B=e(1155),p=e(8242),A=e(3813),O=e(9951),v=e(2485),E=e(2322);const m=(0,A.ZP)(O.Z)(()=>({"& .MuiTypography-root":{fontSize:"0.875rem"}})),j=({icon:o,label:g,path:T})=>{const u=(0,p.v9)(Z=>Z.portal.sideNavOpen),N=(0,c.s0)(),{pathname:$}=(0,c.TH)();return(0,t.jsxs)(v.Z,{disableRipple:!0,selected:$===T,onClick:()=>N(T),sx:Z=>({minHeight:48,justifyContent:u?"space-evenly":"center",margin:"0.25rem","&.MuiButtonBase-root.MuiListItemButton-root":{borderRadius:"0.25rem",":hover:not(.Mui-selected)":{backgroundColor:Z.palette.primary.light,filter:"brightness(1.2)",opacity:.8,"& .MuiListItemIcon-root, .MuiListItemText-root":{color:Z.palette.grey[400]}},"&.Mui-selected":{backgroundColor:Z.palette.primary.main,"& .MuiListItemIcon-root, .MuiListItemText-root":{color:Z.palette.getContrastText(Z.palette.primary.main)}}}}),children:[(0,t.jsx)(E.Z,{sx:{minWidth:0,mr:u?"0.5rem":"auto",justifyContent:"center",opacity:u?.7:1},children:o}),(0,t.jsx)(m,{primary:g,sx:{opacity:u?1:0}})]},g)},z=({links:o})=>{const{hasPermission:g}=(0,p.TE)(),{hasPageAccess:T}=(0,p.rM)();return(0,t.jsx)(t.Fragment,{children:o.map(u=>!g(u.permission)||u.pageId!==void 0&&!T(u.pageId)?null:(0,t.jsx)(j,{...u},u.label))})};var P=e(3192);const F="15rem",G=o=>({width:F,transition:o.transitions.create("width",{easing:o.transitions.easing.sharp,duration:o.transitions.duration.enteringScreen}),overflowX:"hidden"}),U=o=>({transition:o.transitions.create("width",{easing:o.transitions.easing.sharp,duration:o.transitions.duration.leavingScreen}),overflowX:"hidden",width:`calc(${o.spacing(7)} + 1px)`,[o.breakpoints.up("sm")]:{width:`calc(${o.spacing(8)} + 1px)`}}),W=(0,A.ZP)(P.ZP,{shouldForwardProp:o=>o!=="open"})(({theme:o,open:g})=>({width:F,flexShrink:0,whiteSpace:"nowrap",boxSizing:"border-box",...g&&{...G(o),"& .MuiDrawer-paper":G(o)},...!g&&{...U(o),"& .MuiDrawer-paper":U(o)}})),q=(0,A.ZP)("div")(({theme:o})=>({display:"flex",alignItems:"center",justifyContent:"flex-end",backgroundColor:o.palette.primary.light,padding:o.spacing(0,1),...o.mixins.toolbar}));var w=e(3841);const oe={sideNavOpen:!0},ne=(0,w.oM)({name:"portal",initialState:oe,reducers:{toggleDrawer(o){o.sideNavOpen=!o.sideNavOpen}}}),{toggleDrawer:se}=ne.actions,re=ne.reducer;var ae=e(1233),ce=e(8095),ie=e(6974),R=e(3070),b=e(3168);const Y=[{label:"Warehouse Operations",links:[{icon:(0,t.jsx)(ae.Z,{}),label:"Invoice Problem Management",path:"/warehouse-operations/invoice-problem-management",permission:"user.write",pageId:b.$.INVOICE_PROBLEM_MANAGEMENT},{icon:(0,t.jsx)(ce.Z,{}),label:"SecuraStock",path:"/warehouse-operations/secura-stock",permission:"user.write",pageId:b.$.SECURA_STOCK}]}],M={links:[{icon:(0,t.jsx)(ie.Z,{}),label:"Account",path:"/account"},{icon:(0,t.jsx)(R.Z,{}),label:"Logout",path:"/logout"}]};var K=e(7150),Ce=e(5444);const Ee=({label:o,open:g})=>(0,t.jsx)(Ce.Z,{fontWeight:"bold",fontSize:"0.6rem",sx:g?{m:"1rem",opacity:.8}:{m:"1rem",textAlign:"center",visibility:"hidden"},children:o.toUpperCase()},o),le=()=>(0,t.jsx)(y.Z,{sx:{marginTop:"0.75rem"}}),Ie=()=>{const o=(0,p.v9)(u=>u.portal.sideNavOpen),g=(0,p.I0)(),T=(0,c.s0)();return(0,t.jsxs)(W,{variant:"permanent",open:o,sx:{fontSize:"0.875rem"},children:[(0,t.jsx)(q,{children:o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(D.Z,{onClick:()=>T("/"),sx:{marginRight:"4rem"},children:(0,t.jsx)("img",{alt:"Incora Logo",src:K,style:{maxHeight:"2.0rem"}})}),(0,t.jsx)(S.Z,{onClick:()=>g(se()),children:(0,t.jsx)(h.Z,{})})]}):(0,t.jsx)(S.Z,{color:"inherit","aria-label":"open drawer",onClick:()=>g(se()),sx:{marginRight:"0.25rem"},children:(0,t.jsx)(L.Z,{})})}),(0,t.jsx)(y.Z,{}),(0,t.jsxs)(l.Z,{component:"nav","data-testid":"side-nav",children:[(0,t.jsx)(j,{icon:(0,t.jsx)(B.Z,{}),path:"/",label:"Home"}),(0,t.jsx)(le,{}),Y.map(u=>(0,t.jsxs)("div",{children:[u?.label?(0,t.jsx)(Ee,{label:u.label,open:o}):null,(0,t.jsx)(z,{...u}),(0,t.jsx)(le,{})]},u.label))]}),(0,t.jsx)(l.Z,{sx:{mt:"auto"},component:"nav",children:(0,t.jsx)(z,{...M})})]})};var de=e(9902);const Pe=({children:o})=>(0,t.jsx)(de.Z,{disableGutters:!0,maxWidth:!1,sx:{maxWidth:"100%",height:"100vh",overflow:"auto"},children:o}),Se=({children:o})=>(0,t.jsxs)(C,{children:[(0,t.jsx)(Ie,{}),(0,t.jsx)(Pe,{children:o})]}),X=o=>(0,t.jsx)(Se,{children:o});var n=e(9540),r=e(4776),f=e(3661);const H=(0,A.ZP)(f.Z)(({theme:o})=>({backgroundColor:o.palette.primary.light,boxShadow:"none",zIndex:o.zIndex.drawer+1})),ue=o=>(0,t.jsxs)(i.Fragment,{children:[(0,t.jsx)(H,{position:"relative",children:(0,t.jsx)(r.Z,{children:(0,t.jsx)("img",{alt:"Incora Logo",src:K,style:{maxHeight:"2rem",paddingLeft:"2rem"}})})}),(0,t.jsx)(a.Z,{sx:{pt:1},children:o.children})]}),_=o=>(0,t.jsx)(ue,{children:o});var Q=e(5110);const Xe=(0,Q.ZP)(()=>Promise.all([e.e(962),e.e(156),e.e(937),e.e(110),e.e(216),e.e(267)]).then(e.bind(e,4640)),{resolveComponent:o=>o.Form}),Ye=(0,Q.ZP)(()=>e.e(713).then(e.bind(e,9648)),{resolveComponent:o=>o.Summary}),ke=(0,Q.ZP)(()=>e.e(12).then(e.bind(e,8960)),{resolveComponent:o=>o.Specifications}),Je=(0,Q.ZP)(()=>Promise.all([e.e(962),e.e(156),e.e(216),e.e(567)]).then(e.bind(e,632)),{resolveComponent:o=>o.ReceiptDetails}),qe=(0,Q.ZP)(()=>Promise.all([e.e(962),e.e(156),e.e(216),e.e(47)]).then(e.bind(e,8306)),{resolveComponent:o=>o.Notes}),_e=[{id:"qvr",path:"/qvr/:receiptId",children:[{id:"qvr-form",index:!0,element:_((0,t.jsx)(Xe,{}))},{id:"qvr-summary",path:"summary",element:_((0,t.jsx)(Ye,{}))},{id:"qvr-specification",path:"specification",element:_((0,t.jsx)(ke,{}))},{id:"qvr-receipt-details",path:"receipt-details",element:_((0,t.jsx)(Je,{}))},{id:"qvr-notes",path:"notes",element:_((0,t.jsx)(qe,{}))}]}],et=(0,Q.ZP)(()=>Promise.all([e.e(962),e.e(937),e.e(216),e.e(378)]).then(e.bind(e,1982)),{resolveComponent:o=>o.Account}),tt=[{id:"account",path:"/account",element:X((0,t.jsx)(et,{}))}];var ot=e(8810),nt=e(5236),st=e(2743);const Ue=()=>((0,p.Tt)("Unauthorized"),(0,t.jsx)(de.Z,{sx:{pt:5},children:(0,t.jsx)(ot.Z,{children:(0,t.jsxs)(nt.Z,{severity:"error",children:[(0,t.jsx)(st.Z,{children:"Authorization"}),"You are not authorized to view this content."]})})})),je=({children:o,permission:g,pageId:T})=>{const{hasPermission:u}=(0,p.TE)(),{hasPageAccess:N}=(0,p.rM)();return u(g)?T!==void 0&&!N(T)?(0,t.jsx)(Ue,{}):o:(0,t.jsx)(Ue,{})},at=(0,Q.ZP)(()=>Promise.all([e.e(962),e.e(156),e.e(937),e.e(110),e.e(216),e.e(763)]).then(e.bind(e,6669)),{resolveComponent:o=>o.InvoiceProblemManagementPage}),it=(0,Q.ZP)(()=>Promise.all([e.e(962),e.e(156),e.e(937),e.e(110),e.e(216),e.e(618)]).then(e.bind(e,7055)),{resolveComponent:o=>o.SecuraStockPage}),rt=[{id:"warehouse-operations",path:"/warehouse-operations",children:[{id:"warehouse-operations",index:!0,element:X((0,t.jsx)(n.LoadableNotFound,{}))},{id:"invoice-problem-management",path:"invoice-problem-management",element:X((0,t.jsx)(je,{permission:"user.write",pageId:b.$.INVOICE_PROBLEM_MANAGEMENT,children:(0,t.jsx)(at,{})}))},{id:"secura-stock",path:"secura-stock",element:X((0,t.jsx)(je,{permission:"user.write",pageId:b.$.SECURA_STOCK,children:(0,t.jsx)(it,{})}))}]}];var ct=e(8868),De=e(9288),Ae=e(1240),V=e(1386);const lt=({children:o})=>{const g=(0,c.s0)(),T=(0,c.TH)(),{accounts:u}=(0,De.Fp)();(0,V.Cv)(`[GUARD] path=${T.pathname}`);const{selectedCompanyId:N,isInitialized:$,initError:Z}=(0,ct.v9)(Le=>Le.session);return(0,i.useEffect)(()=>{if(u.length===0){(0,V.Cv)("[CompanyGuard] No authenticated accounts, skipping guard logic");return}if(!$){(0,V.Cv)("[CompanyGuard] Session not initialized yet, waiting...");return}if((0,V.Cv)("[CompanyGuard] Guard check:",{path:T.pathname,isInitialized:$,initError:Z,selectedCompanyId:N}),Z){(0,V.Cv)("[CompanyGuard] Initialization error detected, redirecting to login"),g("/login",{replace:!0});return}},[$,Z,N,u.length,T.pathname,g]),$?Z?((0,V.Cv)("[CompanyGuard] Init error present, redirecting..."),(0,t.jsx)(a.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"100vh"},children:(0,t.jsx)(Ae.Z,{})})):N?((0,V.Cv)("[CompanyGuard] Rendering children (init successful, company selected)"),(0,t.jsx)(t.Fragment,{children:o})):((0,V.Cv)("[CompanyGuard] Waiting for company auto-selection..."),(0,t.jsxs)(a.Z,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",minHeight:"100vh",gap:2},children:[(0,t.jsx)(Ae.Z,{}),(0,t.jsx)(a.Z,{sx:{color:"text.secondary"},children:"Loading your account..."})]})):((0,V.Cv)("[CompanyGuard] Rendering loading spinner (not initialized)"),(0,t.jsxs)(a.Z,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",minHeight:"100vh",gap:2},children:[(0,t.jsx)(Ae.Z,{}),(0,t.jsx)(a.Z,{sx:{color:"text.secondary"},children:"Loading your account..."})]}))},dt=(0,Q.ZP)(()=>Promise.all([e.e(216),e.e(177)]).then(e.bind(e,6490)),{resolveComponent:o=>o.Home}),ut=(0,Q.ZP)(()=>e.e(227).then(e.bind(e,5107)),{resolveComponent:o=>o.SDS}),mt=(0,Q.ZP)(()=>Promise.all([e.e(962),e.e(156),e.e(216),e.e(535)]).then(e.bind(e,7219)),{resolveComponent:o=>o.Login}),pt=(0,Q.ZP)(()=>e.e(170).then(e.bind(e,9841)),{resolveComponent:o=>o.Logout}),gt=[{id:"login",path:"/login",element:(0,t.jsx)(mt,{})},{id:"logout",path:"/logout",element:(0,t.jsx)(pt,{})},{id:"protected",element:(0,t.jsx)(lt,{children:(0,t.jsx)(c.j3,{})}),children:[{id:"home",path:"/",element:X((0,t.jsx)(dt,{}))},{id:"sds",path:"/sds",element:X((0,t.jsx)(ut,{}))},..._e,...tt,...rt,{id:"not-found",path:"*",element:X((0,t.jsx)(n.LoadableNotFound,{}))}]}],ft=()=>(0,c.V$)(gt);var yt=e(8343);const vt=({children:o})=>((0,yt.Q)(),(0,t.jsx)(t.Fragment,{children:o})),ht=()=>{const o=(0,p.mA)(),g=(0,c.TH)(),T=(0,c.s0)(),{inProgress:u}=(0,De.Fp)(),N=(0,i.useRef)(!1),$=(0,p.v9)(we=>we.session.initError);(0,V.Cv)(`[APP] path=${g.pathname}, account=${o?"true":"false"}, inProgress=${u}`);const Z=g.pathname==="/login",Le=g.pathname==="/logout",$e=Z||Le;return(0,i.useEffect)(()=>{if((0,V.Cv)("[APP EFFECT] Running navigation logic"),N.current&&(Z||g.pathname==="/")&&(N.current=!1,(0,V.Cv)("[APP] Navigation completed, flag reset")),u!=="none"){(0,V.Cv)("[APP EFFECT] Skipping - MSAL in progress");return}if(N.current){(0,V.Cv)("[APP EFFECT] Skipping - navigation already performed");return}if(!o&&!$e){(0,V.Cv)("[APP NAVIGATE] -> /login (not authenticated)"),N.current=!0,T("/login");return}if(o&&Z&&!$){(0,V.Cv)("[APP NAVIGATE] -> / (authenticated on login page)"),N.current=!0,T("/");return}(0,V.Cv)("[APP EFFECT] No navigation needed")},[o,g.pathname,u,$,Z,$e,T]),u!=="none"&&Z?null:(0,t.jsx)("div",{"data-testid":"app-test-id",children:(0,t.jsx)(vt,{children:(0,t.jsx)(ft,{})})})};var me=e(280);typeof document<"u"&&(document.cookie="i18next=; Max-Age=0; Path=/; SameSite=Strict; Secure"),me.z2.use((0,me.Xf)((o,g)=>e(2071)(`./${o.replace("-","_")}/${g}.json`))).use(me.qB).use(me.Db).init({fallbackLng:"en-US",debug:!1,load:"currentOnly",ns:["translation"],defaultNS:"translation",interpolation:{escapeValue:!1},detection:{order:["localStorage","queryString","navigator","htmlTag"],caches:["localStorage"],cookieOptions:{secure:!0,sameSite:"strict"}}});const qt=null;var Ct=e(6588),Et=e(5527),It=e(2204),Pt=e(8346),k=e(3683),St=e(3379),Fe=e.n(St),Dt=e(7795),Be=e.n(Dt),At=e(569),Ge=e.n(At),Rt=e(3565),Ne=e.n(Rt),xt=e(9216),We=e.n(xt),Mt=e(4589),Ve=e.n(Mt),pe=e(1843),ee={};ee.styleTagTransform=Ve(),ee.setAttributes=Ne(),ee.insert=Ge().bind(null,"head"),ee.domAPI=Be(),ee.insertStyleElement=We();var _t=Fe()(pe.Z,ee);const x=pe.Z&&pe.Z.locals?pe.Z.locals:void 0;var ge=e(400),te={};te.styleTagTransform=Ve(),te.setAttributes=Ne(),te.insert=Ge().bind(null,"head"),te.domAPI=Be(),te.insertStyleElement=We();var eo=Fe()(ge.Z,te);const Tt=ge.Z&&ge.Z.locals?ge.Z.locals:void 0;var Ze=e(3834);const Ot=o=>{switch(o){case"ar_AE":return k.gP;case"de_DE":return k.y1;case"fr_FR":return k.gQ;case"it_IT":return k.KL;case"pl_PL":return k.sv;case"tr_TR":return k.Xl;case"zh_CN":return k.U1;default:return k._z}},Lt=({children:o})=>{const[,g]=(0,Ze.$G)(),T=(0,It.Z)({typography:{fontFamily:Tt.fontFamily},palette:{common:{black:x["grayscale-black"],white:x["grayscale-white"]},primary:{main:x["brand-primary-navy"],contrastText:x["grayscale-white"]},secondary:{main:x["brand-primary-teal"]},neutral:{main:x["grayscale-gray700"],dark:x["grayscale-gray800"]},error:{main:x["status-negative-main"],light:x["status-negative-light"],dark:x["status-negative-dark"],darker:x["status-negative-darker"]},warning:{main:x["status-warning-main"],light:x["status-warning-light"],dark:x["status-warning-dark"],darker:x["status-warning-darker"]},info:{main:x["status-information-main"],light:x["status-information-light"],dark:x["status-information-dark"],darker:x["status-information-darker"]},success:{main:x["status-positive-main"],light:x["status-positive-light"],dark:x["status-positive-dark"],darker:x["status-positive-darker"]},grey:{200:x["grayscale-gray200"],300:x["grayscale-gray300"],400:x["grayscale-gray400"],600:x["grayscale-gray600"],700:x["grayscale-gray700"],800:x["grayscale-gray800"]},background:{default:"rgb(239, 240, 243)",paper:x["grayscale-white"]}},components:{MuiTab:{styleOverrides:{root:({theme:u})=>({background:u.palette.common.white,borderRadius:".4rem",boxShadow:u.shadows[1],borderBottom:".1rem",borderBottomColor:u.palette.grey[400],borderBottomStyle:"solid",fontWeight:"bold","&.Mui-selected":{backgroundColor:u.palette.secondary.main,color:u.palette.common.white}})}},MuiDataGrid:{styleOverrides:{root:({theme:u})=>({"& .Mui-even":{backgroundColor:u.palette.grey[200]},"& .MuiDataGrid-pinnedColumnHeaders .MuiDataGrid-columnHeader":{backgroundColor:u.palette.primary.main},"& .MuiDataGrid-columnHeader":{backgroundColor:u.palette.primary.light,color:u.palette.common.white},"& .MuiDataGrid-columnHeader--dragging":{color:u.palette.common.black},"& .MuiDataGrid-iconSeparator":{color:u.palette.common.white},"& .MuiDataGrid-sortIcon":{color:u.palette.common.white},"& .MuiDataGrid-menuIconButton":{color:u.palette.common.white},"& .MuiDataGrid-cell:focus-within":{outline:"none"},"& .MuiDataGrid-cell:focus":{outline:"none"},"& .row-status--greyed":{backgroundColor:u.palette.grey[600]}," & .row-status--greyed:hover":{backgroundColor:u.palette.grey[400]}})}},MuiInputBase:{styleOverrides:{input:({theme:u})=>({"&.MuiFilledInput-input.Mui-disabled":{WebkitTextFillColor:u.palette.grey[700]}})}},MuiInputLabel:{styleOverrides:{root:({theme:u})=>({"&.MuiInputLabel-root.Mui-disabled":{color:u.palette.grey[700]}})}},MuiDrawer:{styleOverrides:{paper:({theme:u})=>({backgroundColor:u.palette.grey[400]})}}}},Ot(g.resolvedLanguage));return(0,t.jsx)(Pt.Z,{theme:T,children:o})};var Ut=e(7262),jt=e(9488);const Ft=({children:o})=>{const[,g]=(0,Ze.$G)(),T=g.language.toLowerCase().replace("_","-");return(0,t.jsx)(Ut._,{dateAdapter:jt.Y,adapterLocale:T,dateFormats:{monthShort:"MMM M"},children:o})};var Bt=e(1846);const Gt=({children:o})=>(0,t.jsx)(Bt.VK,{children:o});var Nt=e(4119),ze=e(3755);const Wt=o=>o.query({query:({itemId:g,inventoryGroup:T})=>`/item/${g}/inventorygroup/${T}/parts`});var Ke=e(9665);const fe=(0,Ke.LC)({reducerPath:"catalogApi",baseQuery:(0,ze.s)("https://stoplight.io/mocks/incora/catalog-api/70635011"),endpoints:o=>({catalogParts:Wt(o)})}),{useCatalogPartsQuery:to}=fe,Vt=o=>o.query({query:({itemId:g,radianPo:T,poLine:u})=>`/item/${g}/po/${T}/poline/${u}/customernotes`}),ye=(0,Ke.LC)({reducerPath:"fulfillmentApi",baseQuery:(0,ze.s)("https://stoplight.io/mocks/incora/fulfillment-api/73869180"),endpoints:o=>({customerNotes:Vt(o)})}),{useCustomerNotesQuery:oo}=ye;var Re=e(4890),xe=e(3239),Zt=e(9545);const ve={InReceiving:"In Receiving",QaReady:"QA Ready",SentForReimaging:"Sent for Reimaging",PutAwayReady:"Put Away Ready"},no=[ve.InReceiving,ve.QaReady,ve.SentForReimaging,ve.PutAwayReady],he={All:"All",MyAssignments:"My Assignments",Unassigned:"Unassigned"},so=[he.All,he.MyAssignments,he.Unassigned],zt={operatingEntity:{selected:"",error:!1},distributionCenter:{selected:"",error:!1,inventoryGroups:{selected:[]}},statuses:{selected:[],error:!1},assignment:{selected:he.All,error:!1},receiptIdSearchValue:void 0},Qe=(0,w.oM)({name:"inboundQuality",initialState:zt,reducers:{setOperatingEntity:(o,g)=>({...o,operatingEntity:{...o.operatingEntity,selected:g.payload,error:!1},distributionCenter:{...o.distributionCenter,selected:"",inventoryGroups:{...o.distributionCenter.inventoryGroups}}}),setDistributionCenter:(o,g)=>({...o,distributionCenter:{...o.distributionCenter,selected:g.payload,error:!1,inventoryGroups:{...o.distributionCenter.inventoryGroups}}}),setInventoryGroups:(o,g)=>{o.distributionCenter.inventoryGroups.selected=g.payload},setStatuses:(o,g)=>{o.statuses.selected=g.payload,o.statuses.error=!1},setAssignment:(o,g)=>{o.assignment.selected=g.payload,o.assignment.error=!1},setReceiptIdSearchValue:(o,g)=>{o.receiptIdSearchValue=g.payload,o.isReceiptIdSearch=!0},setOperatingEntityError:(o,g)=>{o.operatingEntity.error=g.payload},setDistributionCenterError:(o,g)=>{o.distributionCenter.error=g.payload},setStatusesError:(o,g)=>{o.statuses.error=g.payload},setIsReceiptIdSearch:(o,g)=>{o.isReceiptIdSearch=g.payload},setReceiptIdSearchError:(o,g)=>{o.isReceiptIdSearchError=g.payload}}}),{setOperatingEntity:ao,setDistributionCenter:io,setInventoryGroups:ro,setStatuses:co,setAssignment:lo,setReceiptIdSearchValue:uo,setOperatingEntityError:mo,setDistributionCenterError:po,setStatusesError:go,setIsReceiptIdSearch:fo,setReceiptIdSearchError:yo}=Qe.actions,Kt=Qe.reducer;var Qt=e(6606),bt=e(8979),Me=e(881),Te=e(7110),Ht=e(5029);const be=(0,w.xC)({reducer:{portal:re,qvrForm:Zt.ZP,inboundQuality:Kt,invoiceProblemManagement:Qt.ZP,securaStock:bt.ZP,session:Ht.ZP,[fe.reducerPath]:fe.reducer,[ye.reducerPath]:ye.reducer,[Re.wU.reducerPath]:Re.wU.reducer,[xe.L.reducerPath]:xe.L.reducer,[Te.GW.reducerPath]:Te.GW.reducer,[Me._S.reducerPath]:Me._S.reducer},middleware:o=>o({serializableCheck:{ignoredActions:["qvrForm/uploadDocuments"]}}).concat([fe.middleware,ye.middleware,Re.wU.middleware,xe.L.middleware,Te.GW.middleware,Me._S.middleware])});(0,Nt.sj)(be.dispatch);var $t=e(3583);const wt=({children:o})=>(0,t.jsx)($t.zt,{store:be,children:o});var J=e(3452),Oe=e(9600);const Xt=({children:o})=>((0,i.useEffect)(()=>{if(!J.U.getActiveAccount()){const u=J.U.getAllAccounts();u.length===1&&J.U.setActiveAccount(u[0])}const T=J.U.addEventCallback(u=>{if(u.eventType===Oe.t.LOGIN_SUCCESS||u.eventType===Oe.t.ACQUIRE_TOKEN_SUCCESS||u.eventType===Oe.t.SSO_SILENT_SUCCESS){const N=u.payload;if(N&&typeof N=="object"&&"account"in N&&N.account){const $=N.account;$&&(J.U.setActiveAccount($),(0,V.Cv)("[AuthContextProvider] Active account set after login:",$.username))}}});return()=>{T&&J.U.removeEventCallback(T)}},[]),(0,t.jsx)(De.rL,{instance:J.U,children:o})),Yt=({children:o})=>(0,t.jsx)(wt,{children:(0,t.jsx)(Xt,{children:(0,t.jsx)(Gt,{children:(0,t.jsx)(Ct.Z,{injectFirst:!0,children:(0,t.jsx)(Ft,{children:(0,t.jsxs)(Lt,{children:[(0,t.jsx)(Et.ZP,{}),o]})})})})})});var kt=e(1442),Jt=e(4553);Jt.T.setLicenseKey("d8e46f3df97261c934293ecedb7e6280Tz02Mjk3NyxFPTE3MTE2NDc2ODY5MDMsUz1wcmVtaXVtLExNPXN1YnNjcmlwdGlvbixLVj0y");const He=document.getElementById("root");if(!He)throw new Error("Failed to find the root element");(0,s.s)(He).render((0,t.jsx)(i.StrictMode,{children:(0,t.jsx)(i.Suspense,{fallback:(0,t.jsx)(kt.g,{}),children:(0,t.jsx)(Yt,{children:(0,t.jsx)(ht,{})})})}))},8815:(I,d,e)=>{"use strict";e.d(d,{ou:()=>t.ou});var t=e(6928)},280:(I,d,e)=>{"use strict";e.d(d,{Db:()=>i.Db,Xf:()=>a.Z,ei:()=>t.$,qB:()=>c.Z,z2:()=>s.ZP});var t=e(9089),i=e(1336),s=e(6894),c=e(1660),a=e(3477)},9288:(I,d,e)=>{"use strict";e.d(d,{Fp:()=>t.Fp,rL:()=>t.rL});var t=e(3047)},3583:(I,d,e)=>{"use strict";e.d(d,{I0:()=>t.I0,v9:()=>t.v9,zt:()=>t.zt});var t=e(8868)},3834:(I,d,e)=>{"use strict";e.d(d,{$G:()=>i,iu:()=>s,y4:()=>c});var t=e(280);const i=t.ei,s=Object.freeze({"ar-AE":"\u0639\u0631\u0628\u064A","de-DE":"Deutsch","en-US":"English (US)","en-GB":"English (UK)","fr-FR":"Fran\xE7ais","it-IT":"Italiano","pl-PL":"Polski","tr-TR":"T\xFCrk","zh-CN":"\u4E2D\u56FD\u4EBA"}),c=Object.keys(s)},1442:(I,d,e)=>{"use strict";e.d(d,{g:()=>c});var t=e(9470),i=e(493),s=e(1240);const c=()=>(0,t.jsx)(i.Z,{open:!0,sx:{height:"100vh",width:"100vw",position:"fixed",top:0,left:0,zIndex:1e4,display:"flex",justifyContent:"center",alignItems:"center"},children:(0,t.jsx)(s.Z,{size:"10em"})})},9540:(I,d,e)=>{"use strict";e.r(d),e.d(d,{LoadableNotFound:()=>S,NotFound:()=>D});var t=e(9470),i=e(7362),s=e(5236),c=e(2743),a=e(3834),C=e(8242),y=e(5110);const D=()=>{(0,C.Tt)("Not Found");const[l]=(0,a.$G)();return(0,t.jsxs)(i.ZP,{container:!0,spacing:3,children:[(0,t.jsx)(i.ZP,{item:!0,xs:!0}),(0,t.jsx)(i.ZP,{item:!0,xs:6,children:(0,t.jsxs)(s.Z,{severity:"error",sx:{marginTop:"3em"},children:[(0,t.jsx)(c.Z,{children:l("missingpage.title","Content Not Found")}),l("noKey.message"," Sorry it seems that the content you are looking for is not available.")]})}),(0,t.jsx)(i.ZP,{item:!0,xs:!0})]})},S=(0,y.ZP)(()=>Promise.resolve().then(e.bind(e,9540)),{resolveComponent:l=>l.NotFound})},2697:()=>{"use strict"},9545:(I,d,e)=>{"use strict";e.d(d,{kx:()=>v,ZP:()=>X,iH:()=>re,zF:()=>q,Fv:()=>W,sb:()=>ae,bv:()=>Ee,j:()=>K,z3:()=>R,oE:()=>ie,RU:()=>ce,g$:()=>ne,aQ:()=>oe,Ub:()=>Y,w1:()=>le,on:()=>Ce,L9:()=>w,Ik:()=>de,I0:()=>M,dx:()=>Pe,mz:()=>b,_l:()=>Ie,Ws:()=>Se,GA:()=>se});var t=e(3841);const s={catalogPartShelfLifeVerification:[{id:"",company:"",catalog:"",catalogPartNumber:"",perMfg:"",basis:"",duration:"",customerStorageTemperature:"",partVerified:!1,receiptPartExpireDate:"",verified:!1}]},c={ghsLabelRequirements:[],specifications:[],nonConformanceCodes:[]},a={id:0,type:"",flowDown:0,description:"",reviewDate:"",catalog:"",company:""},C={id:"",date:"",link:"",type:"",name:"",company:"",delete:!1,file:void 0},y={description:{value:"",verified:!1},notes:{internal:"",external:""},flowDowns:[a]};var D=e(2697);const L={receiptData:{itemVerification:y,inboundDocuments:[C],receivedVerification:{quantity:{ordered:"",received:"",verified:!1},manufacturerLot:{value:"",verified:!1},deliveryTicket:{value:"",verified:!1}},shelfLifeBasis:{dateOfReceipt:""}},complianceChecks:c,catalogPartData:s},B={submitted:!1,current:!1};var p=e(8815),A=e(7939),O=e(4890);const v=[{name:"Receipt Data",steps:["Verify Item","Review & Categorize Inbound Documents","Verify Received","Shelf Life Basis Date"]},{name:"Compliance Checks",steps:["GHS Label Requirements","Verify Specifications","Non-Conformance Codes"]},{name:"Compliance Checks",steps:["Catalog Part Shelf Life Verification"]}],E={initialized:!1,form:L,section:0,step:0},m=(0,t.oM)({name:"qvrForm",initialState:E,reducers:{initializeQVRForm(n,r){n.initialized||(n.initialized=!0,n.form=r.payload)},setQVRForm(n,r){n.form=r.payload},setSectionAndStep(n,r){if(r.payload.section<0||r.payload.section>v.length-1)return;const f=v[r.payload.section].steps;r.payload.step<0||r.payload.step>f.length-1||(n.section=r.payload.section,n.step=r.payload.step)},setSection(n,r){r.payload<0||r.payload>v.length-1||(n.section=r.payload)},setStep(n,r){const f=v[n.section].steps;r.payload<0||r.payload>f.length-1||(n.step=r.payload)},previousStep(n){n.step>0?n.step-=1:n.section>0&&(n.section-=1,n.step=v[n.section].steps.length-1)},nextStep(n){const r=v[n.section].steps;n.step({id:crypto.randomUUID(),date:p.ou.fromMillis(H.lastModified).toISODate(),name:H.name,file:"File"}));n.form.receiptData.inboundDocuments.push(...f)},deleteDocument(n,r){const f=[...n.form.receiptData.inboundDocuments],H=f.findIndex(Q=>Q.id===r.payload),ue=f[H];ue.delete=!0,ue.file!==void 0&&f.splice(H,1),n.form.receiptData.inboundDocuments=f},restoreDocument(n,r){n.form.receiptData.inboundDocuments=n.form.receiptData.inboundDocuments.map(f=>(f.id===r.payload&&(f.delete=!1),f))},setDocumentType(n,r){n.form.receiptData.inboundDocuments=n.form.receiptData.inboundDocuments.map(f=>(f.id===r.payload.id&&(f.type=r.payload.type,(0,A.E)(f.name)&&(f.name=r.payload.type)),f))},setDocumentName(n,r){n.form.receiptData.inboundDocuments=n.form.receiptData.inboundDocuments.map(f=>(f.id===r.payload.id&&(f.name=r.payload.name),f))},setDocumentCompany(n,r){n.form.receiptData.inboundDocuments=n.form.receiptData.inboundDocuments.map(f=>(f.id===r.payload.id&&(f.company=r.payload.company),f))},toggleQuantityReceivedVerified(n){n.form.receiptData.receivedVerification.quantity.verified=!n.form.receiptData.receivedVerification.quantity.verified},setManufacturerLot(n,r){n.form.receiptData.receivedVerification.manufacturerLot.value=r.payload},toggleManufacturerLotVerified(n){n.form.receiptData.receivedVerification.manufacturerLot.verified=!n.form.receiptData.receivedVerification.manufacturerLot.verified},setDeliveryTicket(n,r){n.form.receiptData.receivedVerification.deliveryTicket.value=r.payload},toggleDeliveryTicketVerified(n){n.form.receiptData.receivedVerification.deliveryTicket.verified=!n.form.receiptData.receivedVerification.deliveryTicket.verified},setDateOfReceipt(n,r){n.form.receiptData.shelfLifeBasis.dateOfReceipt=r.payload},setReceiptPartExpireDate(n,r){n.form.catalogPartData.catalogPartShelfLifeVerification=n.form.catalogPartData.catalogPartShelfLifeVerification.map(f=>(f.id===r.payload.id&&(f.receiptPartExpireDate=r.payload.date),f))},toggleReceiptPartVerified(n,r){n.form.catalogPartData.catalogPartShelfLifeVerification=n.form.catalogPartData.catalogPartShelfLifeVerification.map(f=>(f.id===r.payload&&(f.verified=!f.verified),f))},toggleGhsLabelVerified(n,r){n.form.complianceChecks.ghsLabelRequirements.includes(r.payload)?n.form.complianceChecks.ghsLabelRequirements=n.form.complianceChecks.ghsLabelRequirements.filter(f=>f!==r.payload):n.form.complianceChecks.ghsLabelRequirements=[...n.form.complianceChecks.ghsLabelRequirements,r.payload]},toggleNonConformanceCodes(n,r){const f=n.form.complianceChecks.nonConformanceCodes.findIndex(H=>H.id===r.payload);n.form.complianceChecks.nonConformanceCodes[f].isApplied=!n.form.complianceChecks.nonConformanceCodes[f].isApplied},toggleSpecifications(n,r){const f=n.form.complianceChecks.specifications.findIndex(H=>H.id===r.payload.id);n.form.complianceChecks.specifications[f].verifiedCertificates.includes(r.payload.certificate)?n.form.complianceChecks.specifications[f].verifiedCertificates=n.form.complianceChecks.specifications[f].verifiedCertificates.filter(H=>H!==r.payload.certificate):n.form.complianceChecks.specifications[f].verifiedCertificates=[...n.form.complianceChecks.specifications[f].verifiedCertificates,r.payload.certificate]}},extraReducers:n=>{n.addMatcher(O.wU.endpoints.getReceipt.matchFulfilled,(r,{payload:f})=>{j(r,f)})}}),j=(n,r)=>{n.form.complianceChecks.ghsLabelRequirements?.length===0&&(n.form.complianceChecks.ghsLabelRequirements=r.quality?.ghsLabels.verified??[]),n.form.complianceChecks.nonConformanceCodes?.length===0&&(n.form.complianceChecks.nonConformanceCodes=r.quality?.nonConformanceCodes??[]),n.form.complianceChecks.specifications?.length===0&&(n.form.complianceChecks.specifications=r.quality?.specifications.map(f=>({id:f.purchasedSpecification.specificationRef.id,verifiedCertificates:f.latestVerifiedCertificates??[]}))??[])},{initializeQVRForm:z,setQVRForm:P,setSection:F,setStep:G,setSectionAndStep:U,previousStep:W,nextStep:q,toggleDescriptionVerified:w,setInternalNote:oe,setExternalNote:ne,uploadDocuments:se,deleteDocument:re,restoreDocument:ae,setDocumentType:ce,setDocumentName:ie,setDocumentCompany:R,toggleQuantityReceivedVerified:b,setManufacturerLot:Y,toggleManufacturerLotVerified:M,setDeliveryTicket:K,toggleDeliveryTicketVerified:Ce,setDateOfReceipt:Ee,setReceiptPartExpireDate:le,toggleReceiptPartVerified:Ie,toggleGhsLabelVerified:de,toggleNonConformanceCodes:Pe,toggleSpecifications:Se}=m.actions,X=m.reducer},6606:(I,d,e)=>{"use strict";e.d(d,{Hl:()=>c,V6:()=>C,Z5:()=>a,ZP:()=>S});var t=e(3841);const i={tabIndex:0,selection:[],showFilters:!1,rows:[]},s=(0,t.oM)({name:"invoiceProblemManagement",initialState:i,reducers:{setTabIndex(l,h){l.tabIndex=h.payload,l.selection=[]},setSelection(l,h){l.selection=h.payload},setShowFilters(l,h){l.showFilters=h.payload},setRows(l,h){l.rows=h.payload},reset(l){l.tabIndex=0,l.selection=[],l.showFilters=!1,l.rows=[]}}}),{setTabIndex:c,setSelection:a,setShowFilters:C,setRows:y,reset:D}=s.actions,S=s.reducer},8979:(I,d,e)=>{"use strict";e.d(d,{DQ:()=>D,E6:()=>a,Gx:()=>y,WZ:()=>c,ZP:()=>l,gn:()=>C});var t=e(3841);const i={selectedCompanyId:null,selectedFacilityId:null,selectedRowId:null,showResults:!1},s=(0,t.oM)({name:"securaStock",initialState:i,reducers:{setSelectedCompanyId(h,L){h.selectedCompanyId=L.payload,h.selectedFacilityId=null,h.showResults=!1,h.selectedRowId=null},setSelectedFacilityId(h,L){h.selectedFacilityId=L.payload,h.showResults=!1,h.selectedRowId=null},setSelectedRowId(h,L){h.selectedRowId=L.payload},setShowResults(h,L){h.showResults=L.payload},resetResults(h){h.showResults=!1,h.selectedRowId=null},reset(h){h.selectedCompanyId=null,h.selectedFacilityId=null,h.selectedRowId=null,h.showResults=!1}}}),{setSelectedCompanyId:c,setSelectedFacilityId:a,setSelectedRowId:C,setShowResults:y,resetResults:D,reset:S}=s.actions,l=s.reducer},5029:(I,d,e)=>{"use strict";e.d(d,{CB:()=>h,Mi:()=>S,Ov:()=>l,QQ:()=>y,Uv:()=>a,ZP:()=>B,hV:()=>L,ht:()=>C,o4:()=>D,y8:()=>c});var t=e(3841);const i={personnelId:null,companies:[],selectedCompanyId:null,userPages:[],isInitialized:!1,initError:null},s=(0,t.oM)({name:"session",initialState:i,reducers:{setPersonnelId(p,A){p.personnelId=A.payload},setCompanies(p,A){p.companies=A.payload,p.isInitialized=!0},setSelectedCompany(p,A){p.selectedCompanyId=A.payload.companyId},setUserPages(p,A){p.userPages=A.payload},setInitializationError(p,A){p.initError=A.payload,p.isInitialized=!0},clearInitError(p){p.initError=null},clearSession(p){p.personnelId=null,p.companies=[],p.selectedCompanyId=null,p.userPages=[],p.isInitialized=!1,p.initError=null}}}),{setPersonnelId:c,setCompanies:a,setSelectedCompany:C,setUserPages:y,setInitializationError:D,clearInitError:S,clearSession:l}=s.actions,h=p=>{const{selectedCompanyId:A,companies:O}=p.session;return A?O.find(v=>v.companyId===A)??null:null},L=p=>p.session.userPages,B=s.reducer},1732:(I,d,e)=>{"use strict";e.d(d,{h:()=>i});function t(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)}function i(s){const c={};return t(s)&&(typeof s.name=="string"&&(c.name=s.name),typeof s.message=="string"&&(c.message=s.message),(typeof s.code=="string"||typeof s.code=="number")&&(c.code=s.code),(typeof s.errorCode=="string"||typeof s.errorCode=="number")&&(c.errorCode=s.errorCode),typeof s.status=="number"&&(c.status=s.status),s.data!==void 0&&(c.data=s.data,t(s.data)&&typeof s.data.message=="string"&&(c.dataMessage=s.data.message))),c}},7939:(I,d,e)=>{"use strict";e.d(d,{E:()=>t});const t=i=>!i||i.trim().length===0},1386:(I,d,e)=>{"use strict";e.d(d,{Cv:()=>i,H:()=>c,Ki:()=>s});const t=window.location.host.startsWith("localhost"),i=(...a)=>{t&&console.log(...a)},s=(...a)=>{t&&console.warn(...a)},c=(...a)=>{console.error(...a)}},2071:(I,d,e)=>{var t={"./ar_AE/translation.json":[6611,611],"./de_DE/translation.json":[9061,61],"./en_GB/translation.json":[9758,758],"./en_US/translation.json":[5916,916],"./fr_FR/translation.json":[6779,606],"./it_IT/translation.json":[1640,640],"./pl_PL/translation.json":[4778,778],"./tr_TR/translation.json":[6908,908],"./zh_CN/translation.json":[9871,871]};function i(s){if(!e.o(t,s))return Promise.resolve().then(()=>{var C=new Error("Cannot find module '"+s+"'");throw C.code="MODULE_NOT_FOUND",C});var c=t[s],a=c[0];return e.e(c[1]).then(()=>e.t(a,19))}i.keys=()=>Object.keys(t),i.id=2071,I.exports=i},7150:(I,d,e)=>{"use strict";I.exports=e.p+"bffc5e001d7d9eab09d5.png"}},I=>{var d=t=>I(I.s=t);I.O(0,[363,328,216],()=>d(3527));var e=I.O()}]);})();