1import{r as t,d as Q,aT as ee,dk as se,j as e,bd as d,eq as Z,W as te,co as ne,fc as ie,bi as x,aC as re}from"./index-2CwtICst.js";import{M as ce}from"./modal_component-CQ9TsgKw.js";import{a as oe}from"./modal_header-Zzno9Dew.js";import{u as ae}from"./index-BRNAGDIA.js";import{T as le}from"./Table-CwvOdCcz.js";import{P as H}from"./progress-BiVrF1Ei.js";import"./index-BC4zRIry.js";import"./DialogWrap-DDRffVA8.js";import"./Portal-m7W4unkL.js";import"./getScrollBarSize-CHB1zEd-.js";import"./useId-BeW6vcu-.js";import"./index-BxPsFHPt.js";import"./css-CG3sgCP8.js";import"./isEqual-DAIv1GAa.js";import"./dropdown-1Xi7yUr8.js";import"./Dropdown-CSDSyzzq.js";import"./isNumeric-OYazz19Q.js";const ue=l=>t.createElement("svg",{width:70,height:70,viewBox:"0 0 70 70",fill:"none",xmlns:"http://www.w3.org/2000/svg",...l},t.createElement("rect",{width:70,height:70,rx:15,fill:"#0F48E3",fillOpacity:.07}),t.createElement("path",{d:"M44.7615 21.756L41.2615 19.9185C38.1885 18.3067 36.652 17.5 35 17.5C33.348 17.5 31.8115 18.305 28.7385 19.9185L28.1767 20.2143L43.792 29.1375L50.82 25.62C49.6895 24.339 47.866 23.3818 44.7615 21.7525M52.059 27.937L45.0625 31.437V36.75C45.0625 37.0981 44.9242 37.4319 44.6781 37.6781C44.4319 37.9242 44.0981 38.0625 43.75 38.0625C43.4019 38.0625 43.0681 37.9242 42.8219 37.6781C42.5758 37.4319 42.4375 37.0981 42.4375 36.75V32.7495L36.3125 35.812V52.332C37.569 52.0188 38.9987 51.2698 41.2615 50.0815L44.7615 48.244C48.5257 46.2683 50.4087 45.2813 51.4552 43.505C52.5 41.7305 52.5 39.5203 52.5 35.105V34.9003C52.5 31.5875 52.5 29.5155 52.059 27.937ZM33.6875 52.332V35.812L17.941 27.937C17.5 29.5155 17.5 31.5875 17.5 34.8968V35.1015C17.5 39.5203 17.5 41.7305 18.5447 43.505C19.5912 45.2813 21.4742 46.27 25.2385 48.2458L28.7385 50.0815C31.0012 51.2698 32.431 52.0188 33.6875 52.332ZM19.18 25.6217L35 33.5318L40.9692 30.548L25.4187 21.6615L25.2385 21.756C22.1357 23.3835 20.3105 24.3408 19.18 25.6235",fill:"#0F48E3"}),t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M52.0186 39.6326C52.6688 38.4766 54.3323 38.4766 54.9817 39.6326L59.7247 48.0646C60.3622 49.1985 59.5436 50.5976 58.244 50.5976H48.7571C47.4566 50.5976 46.6381 49.1985 47.2756 48.0646L52.0186 39.6326ZM54.3501 48.0485C54.3501 48.2739 54.2606 48.4901 54.1012 48.6495C53.9418 48.8089 53.7255 48.8985 53.5001 48.8985C53.2747 48.8985 53.0585 48.8089 52.8991 48.6495C52.7397 48.4901 52.6501 48.2739 52.6501 48.0485C52.6501 47.823 52.7397 47.6068 52.8991 47.4474C53.0585 47.288 53.2747 47.1985 53.5001 47.1985C53.7255 47.1985 53.9418 47.288 54.1012 47.4474C54.2606 47.6068 54.3501 47.823 54.3501 48.0485ZM53.5001 41.2485C53.2747 41.2485 53.0585 41.338 52.8991 41.4974C52.7397 41.6568 52.6501 41.873 52.6501 42.0985V44.6485C52.6501 44.8739 52.7397 45.0901 52.8991 45.2495C53.0585 45.4089 53.2747 45.4985 53.5001 45.4985C53.7255 45.4985 53.9418 45.4089 54.1012 45.2495C54.2606 45.0901 54.3501 44.8739 54.3501 44.6485V42.0985C54.3501 41.873 54.2606 41.6568 54.1012 41.4974C53.9418 41.338 53.7255 41.2485 53.5001 41.2485Z",fill:"#D93E3E"})),me=l=>t.createElement("svg",{width:70,height:70,viewBox:"0 0 70 70",fill:"none",xmlns:"http://www.w3.org/2000/svg",...l},t.createElement("rect",{width:70,height:70,rx:15,fill:"#1AB746",fillOpacity:.07}),t.createElement("path",{d:"M50.5833 24.4807L44.1867 27.0406L28.4367 20.7406L32.2692 19.2055C34.0217 18.5044 35.9767 18.5044 37.7292 19.2055L49.8189 24.0418C50.0929 24.1509 50.3502 24.3 50.5833 24.4807ZM35.0013 30.7135L41.3601 28.1683L25.6101 21.8683L20.1795 24.0418C19.9055 24.1509 19.6482 24.2979 19.4151 24.4786L35.0013 30.7135ZM18.1992 26.9671C18.1992 26.7347 18.2237 26.5079 18.2727 26.2867L33.9492 32.5573V39.628C33.2566 41.1395 32.8984 42.7827 32.8992 44.4454C32.8992 46.1674 33.2772 47.7991 33.9492 49.2649V51.2347C33.3766 51.1535 32.8166 51.0037 32.2692 50.7853L20.1795 45.949C19.5949 45.7152 19.0937 45.3115 18.7407 44.7901C18.3877 44.2686 18.1991 43.6534 18.1992 43.0237V26.9671ZM51.7992 26.9671V35.5351C49.7315 33.8261 47.1318 32.8932 44.4492 32.8975C42.8763 32.8972 41.32 33.2182 39.8756 33.8407C38.4311 34.4633 37.1291 35.3743 36.0492 36.5179V32.5573L51.7257 26.2867C51.7747 26.5079 51.7992 26.7347 51.7992 26.9671ZM44.4492 53.8975C46.9555 53.8975 49.3592 52.9019 51.1314 51.1297C52.9036 49.3574 53.8992 46.9538 53.8992 44.4475C53.8992 41.9412 52.9036 39.5376 51.1314 37.7653C49.3592 35.9931 46.9555 34.9975 44.4492 34.9975C41.9429 34.9975 39.5393 35.9931 37.7671 37.7653C35.9948 39.5376 34.9992 41.9412 34.9992 44.4475C34.9992 46.9538 35.9948 49.3574 37.7671 51.1297C39.5393 52.9019 41.9429 53.8975 44.4492 53.8975Z",fill:"#1AB746"}),t.createElement("path",{d:"M41 45L43.6667 48L49 42",stroke:"white",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round"}
1)),pe="_container_1wvwk_10",de="_title_1wvwk_15",Ce="_description_1wvwk_20",he="_closeButton_1wvwk_25",we="_warningIcon_1wvwk_30",_e="_extraInfo_1wvwk_34",fe="_successContent_1wvwk_40",xe="_successText_1wvwk_48",ge="_partialSuccessContent_1wvwk_55",je="_successDescription_1wvwk_70",ke="_successIcon_1wvwk_80",ve="_progressBlue_1wvwk_84",Le="_openDocumentButton_1wvwk_87",Te="_clickHere_1wvwk_90",be="_partialSuccessContentTable_1wvwk_96",Se="_partialSuccessContentTableTitle_1wvwk_106",Ne="_errorCount_1wvwk_111",s={container:pe,title:de,description:Ce,closeButton:he,warningIcon:we,extraInfo:_e,successContent:fe,successText:xe,partialSuccessContent:ge,successDescription:je,successIcon:ke,progressBlue:ve,openDocumentButton:Le,clickHere:Te,partialSuccessContentTable:be,partialSuccessContentTableTitle:Se,errorCount:Ne},O=60,Je=({jobId:l,onClose:u,onSuccess:c,extraInfo:g,type:a})=>{var N,B,D,E,I,y,V,F,M,P;const{data:n,isLoading:j,reload:A,isValidating:k}=ae({jobId:l}),[v,R]=t.useState(!1),[L,T]=t.useState(!1),[C,U]=t.useState(!1),[W,b]=t.useState(0),{profile:h}=Q(),w=(B=(N=n==null?void 0:n.data)==null?void 0:N.attributes)==null?void 0:B.file_url,o=(E=(D=n==null?void 0:n.data)==null?void 0:D.attributes)==null?void 0:E.status,S=((y=(I=n==null?void 0:n.data)==null?void 0:I.attributes)==null?void 0:y.progress)||0,r=(F=(V=n==null?void 0:n.data)==null?void 0:V.attributes)==null?void 0:F.output_metadata,m=W>=O,z=o==="failed",_=o==="pending",J=o==="completed",$=(ee()?(M=se)==null?void 0:M.admin_uid:h==null?void 0:h.email)||"your registered email ID",q=!m,G=m?_?"This is taking longer than expected":a==="reassign"?"Failed to reassign shipments":a==="manifest"?r==null?void 0:r.message:"Failed to fetch document":a==="reassign"?"Reassigning Shipments":C?"Success":"Fetching document",K=m?_?`It will be mailed to ${$}. ${a==="label"?"Alternatively you can download it from report download section under reports.":""}`:a==="manifest"?"":"Please try again later":C?"":"This may take some time",f=t.useRef(null);t.useEffect(()=>{if(!(j||k)){if(a==="reassign"&&(o==="completed"&&(R(!0),c==null||c()),o==="partially_completed"&&(T(!0),c==null||c()),o==="failed"&&T(!0)),a!=="reassign"&&w){if(window.open(w,"_blank"),U(!0),c){c();return}u();return}if(z){b(O+1);return}if(!m)return f.current=setTimeout(async()=>{A(),b(p=>p+2)},2e3),()=>{f.current&&clearTimeout(f.current)}}},[j,k]);const X=[{title:"Order Id",key:"order_id",width:"30%",render:(p,i)=>e.jsx(x,{children:i==null?void 0:i.order_id})},{title:"AWB Number",key:"awb_number",render:(p,i)=>e.jsx(x,{children:i==null?void 0:i.awb_number})},{title:"Error",key:"error",render:(p,i)=>e.jsx(x,{children:re(i==null?void 0:i.error_message,30)})}],Y=()=>{window.open(w,"_blank")};return e.jsx(ce,{width:"small",onClose:u,hideHeader:!0,fluidHeight:!0,children:e.jsxs(d,{vertical:!0,align:"center",justify:"center",className:s.container,gap:30,children:[v&&e.jsxs("div",{className:s.successContent,children:[e.jsx(me,{}),e.jsxs(d,{vertical:!0,gap:4,align:"center",children:[e.jsx("p",{className:s.successText,children:"Successfully Shipped"}),e.jsxs("span",{className:s.successDescription,children:[e.jsx(Z,{className:s.successIcon}),"Shipments were successfully shipped"]})]})]}),L&&e.jsxs("div",{className:s.partialSuccessContent,children:[e.jsx(ue,{}),e.jsxs(d,{vertical:!0,gap:4,align:"center",children:[e.jsx("p",{className:s.successText,children:o==="failed"?"Failed":"Partially Shipped"}),o!=="failed"&&e.jsxs("span",{className:s.successDescription,children:[e.jsx(Z,{className:s.successIcon}),"Shipments were paritally shipped"]})]}),e.jsxs("div",{className:s.partialSuccessContentTable,children:[e.jsxs("p",{className:s.partialSuccessContentTableTitle,children:["List of"," ",e.jsxs("span",{className:s.errorCount,children:[(P=r==null?void 0:r.failure_rows)==null?void 0:P.length," failed"]})," ","shipments:"]}),e.jsx(le,{dataSource:(r==null?void 0:r.failure_rows)||[],columns:X,pagination:!1})]})]}),v||L?e.jsx(e.Fragment,{children:e.jsx(te,{size:"medium",onClick:u,children:"OKAY"})}):e.jsxs(e.Fragment,{children:[q?S>0?e.jsx(H,{type:"circle",percent:S,width:50,strokeColor:"var(--shipfast-primary-color)",trailColor:"#f5f5f5",className:s.progressBlue}):J?e.jsx(H,{type:"circle",percent:100,width:50,strokeColor:"var(--shipfast-primary-color)",trailColor:"#f5f5f5",className:s.progressBlue}):e.jsx(ne,{size:"large"}):e.jsx(ie,{className:s.warningIcon}),e.jsxs(d,{vertical:!0,gap:4,align:"center",children:[e.jsx("p",{className:s.title,children:G}),e.jsx("p",{className:s.description,children:K}),_&&g&&e.jsxs("p",{className:s.extraInfo,children:[e.jsx("b",{children:"Note: "}),g]}),C&&e.jsxs("p",{onClick:Y,className:s.openDocumentButton,children:[e.jsx("span",{className:s.clickHere,children:"Click here"})," to open Document"]})]})]}),e.jsx("div",{className:s.closeButton,children:e.jsx(oe,{onClose:u})})]})})};export{Je as default};
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.