PageSourceSearch

https://dashboard.velocity.in/assets/index-B7lJFPxc.js

js velocity.in collected 2026-09-24 09:25:23 UTC 43,451 bytes, 1 lines download raw bytes

1import{ay as H,bt as Z,r as s,b$ as cs,c0 as ds,fj as V,aS as Pe,d as He,j as e,bd as h,bM as je,Z as Ie,c5 as us,bk as $e,o as ze,p as Ve,T as ye,V as Rs,L as Be,bP as Te,by as ve,W as K,X as qe,a1 as M,jX as Os,a4 as q,du as pe,gq as X,jY as Es,aU as Fe,jZ as Fs,j_ as Ps,bK as bs,c as ws,bw as Hs,bS as We,v as $s,ak as G,dp as Ne,j$ as zs,bJ as Vs,bT as qs,bU as Ws,k0 as Us,k1 as Zs,br as Q,k2 as Ks,k3 as Xs,k4 as Ys,a9 as ps,bW as U,gj as hs}from"./index-2CwtICst.js";import Gs from"./index-DPUY9k-P.js";import{s as De,B as Qs,a as Js}from"./index-B2YUK9XD.js";import{M as Ae}from"./index-BC4zRIry.js";import{t as et,f as st,v as tt,p as at,h as ot,w as nt,x as lt}from"./index-BRNAGDIA.js";import{M as ue}from"./modal_component-CQ9TsgKw.js";import{P as rt}from"./package_creation_form-CiBjDsoa.js";import{S as it}from"./PackageSmall-DXcoG-iG.js";import{v as ct}from"./form_utils-BRD3em_d.js";import{u as dt}from"./index-D-uFs3Zw.js";import{R as ut}from"./PlusOutlined-BhrmrG55.js";import{R as pt}from"./index-D5IWliUN.js";import{S as ht}from"./Truck-z2BlKDGK.js";import{S as mt}from"./LocationPin-DFaNt5VD.js";import{S as _t}from"./Package-J2UabPx2.js";import{S as gt}from"./Guidelines-C6yJTdTp.js";import{B as ft}from"./bulk_labels_download_modal-C4sXpKk6.js";import{C as Ct}from"./confirmation_modal-z4uGN-A_.js";import{R as ae}from"./CopyOutlined-DHdlcXnq.js";import{a as kt}from"./modal_header-Zzno9Dew.js";import{R as bt}from"./CheckOutlined-BXgii8XF.js";import{R as wt}from"./CloseOutlined-DrYqvwGF.js";import{S as xt}from"./index-pRpjweVS.js";import{R as St,C as yt}from"./common-Cfql01h7.js";import{t as jt}from"./mixpanel_utils-DOVBG_9P.js";import{C as It}from"./disable_tooltips-CFCTnA_K.js";import{s as v}from"./index.module-B54GJK89.js";import{R as Me}from"./TagOutlined-Cvcr9B5o.js";import{R as Bt}from"./EditOutlined-DNdDFaOm.js";import{R as ms}from"./CheckCircleOutlined-M_0-lFA0.js";import{R as _s}from"./DeleteOutlined-DLNmsFde.js";import{R as Re}from"./DownloadOutlined-hBiodi2E.js";import{D as Tt}from"./dropdown-1Xi7yUr8.js";import{R as vt}from"./DownOutlined-DqNR-cNR.js";import"./DialogWrap-DDRffVA8.js";import"./Portal-m7W4unkL.js";import"./getScrollBarSize-CHB1zEd-.js";import"./useId-BeW6vcu-.js";import"./warning_modal.module-BPXieIa4.js";import"./CloseCircleFilled-CbIeIgTN.js";import"./InfoCircleOutlined-WJAwMEA5.js";import"./ToolOutlined-BgnpUS8U.js";import"./ExclamationCircleFilled-OdkGiaQF.js";import"./solo_shipping_edit.module-Wqcl7gGd.js";import"./col-MZTILiOt.js";import"./PlusOutlined-ByZyTB3m.js";import"./index.module-C1ppdSyB.js";import"./CheckCircleFilled-BVfbTM6t.js";import"./index-CuJiRo7R.js";import"./Keyframes-kYrXGAxm.js";import"./TagV2-DonN_lBO.js";import"./TimerLine-DK0gYHeS.js";import"./DeleteOutlined-DFutYCzo.js";import"./DownloadOutlined-DTidZHln.js";import"./Dropdown-CSDSyzzq.js";import"./isNumeric-OYazz19Q.js";const Nt="_formContainer_1koqv_13",At="_submitButton_1koqv_21",Lt="_form_1koqv_13",Dt="_formTitle_1koqv_38",Mt="_noteText_1koqv_44",Rt="_noteTextBold_1koqv_53",Ot="_warehouseLabelContainer_1koqv_63",Et="_title_1koqv_63",Ft="_description_1koqv_68",L={formContainer:Nt,submitButton:At,form:Lt,formTitle:Dt,noteText:Mt,noteTextBold:Rt,warehouseLabelContainer:Ot,title:Et,description:Ft},Pt=({onClose:o})=>{const{query:i}=H(),_=i.selected_order_ids,u=_?_==null?void 0:_.split(","):[],{reloadShipfastOrders:y}=Z(),[c,j]=s.useState(""),[C]=cs(c,500),[N,w]=s.useState(""),[a]=cs(N,500),{shipfastWarehousePickupList:I}=ds(C),{shipfastWarehousePickupList:t}=ds(a),[x,g]=s.useState(!1),{params:m}=V(),f=i.selectAll==="true",n=s.useRef(null),[d,l]=s.useState(!1),{shipfastProfile:p}=Pe(),{isShipfastChildUser:A,userUuid:k}=He(),F=f?"all selected":u==null?void 0:u.length,he=I.filter(b=>b.attributes.active_status==="active").map(b=>{var S,B;return{label:e.jsxs(h,{vertical:!0,gap:0,className:L.warehouseLabelContainer,align:"flex-start",children:[e.jsx("p",{className:L.title,children:je(Ie((S=b==null?void 0:b.attributes)==null?void 0:S.name),20)}),e.jsx("p",{className:L.description,style:{whiteSpace:"pre-line"},children:us(b)})]}),value:b.id,name:(B=b==null?void 0:b.attributes)==null?void 0:B.name}}),ne=t.filter(b=>b.attributes.active_status==="active").map(b=>{var S,B;return{label:e.jsxs(h,{vertical:!0,gap:0,className:L.warehouseLabelContainer,align:"flex-start",children:[e.jsx("p",{className:L.title,children:je(Ie((S=b==null?void 0:b.attributes)==null?void 0:S.name),20)}),e.jsx("p",{className:L.description,style:{whiteSpace:"pre-line"},children:us(b)})]}),value:b.id,name:(B=b==null?void 0:b.attributes)==null?void 0:B.name}}),me=async()=>{var le,ge,re,fe,J,Ce;const b=(ge=(le=n==null?void 0:n.current)==null?void 0:le.values)==null?void 0:ge.warehouseId,S=(fe=(re=n==null?void 0:n.current)==null?void 0:re.values)==null?void 0:fe.rtoSameAsPickup,B=S?b:(Ce=(J=n==null?void 0:n.current)==null?void 0:J.values)==null?void 0:Ce.rtoWarehouseId;if(qe("shipfast_orders_bulk_change_address",{client_id:p==null?void 0:p.id,user_uuid:k,is_child_user:A}),!b&&(!B||S)){M("Please select a address");return}g(!0);const{ok:E,data:W}
1=await Os({shipmentIds:u,warehouseId:b,rtoWarehouseId:B,selectAll:f,queryParams:f?{...m,search:i.search}:{}});g(!1),E?(q((W==null?void 0:W.message)||"Request acknowledged. Address will be updated for all the selected orders in sometime!"),pe({showProgress:!0}),y(),o()):M((W==null?void 0:W.error)||"Failed to update address")},_e=`You have selected ${F} ${typeof F=="number"?$e("order",F):"orders"} to update address. Please choose your preferred warehouse.`;return e.jsx(ze,{innerRef:n,onSubmit:me,initialValues:{warehouseId:void 0,rtoWarehouseId:void 0,rtoSameAsPickup:!0},children:({values:b})=>(he.find(S=>S.value===b.warehouseId),ne.find(S=>S.value===b.rtoWarehouseId),e.jsx(Ve,{className:L.form,children:e.jsxs(h,{vertical:!0,gap:16,className:L.formContainer,children:[e.jsxs(ye.Text,{type:"secondary",className:L.noteText,children:[e.jsx("span",{className:L.noteTextBold,children:"NOTE:"})," ",_e]}),e.jsx(Rs,{checked:b.rtoSameAsPickup,onChange:S=>{var B,E;(B=n.current)==null||B.setFieldValue("rtoSameAsPickup",S.target.checked),S.target.checked&&((E=n.current)==null||E.setFieldValue("rtoWarehouseId",void 0))},className:L.checkbox,children:"RTO address is same as Pickup address"}),e.jsxs(h,{vertical:!0,gap:12,children:[e.jsxs("p",{className:L.formTitle,children:["Pickup Address",e.jsx(ye.Text,{type:"danger",children:"*"})]}),e.jsx(Be,{component:Te,options:he,showSearch:!0,optionFilterProp:"name",filterOption:(S,B)=>{var E;return(E=B==null?void 0:B.name)==null?void 0:E.toLowerCase().includes(S.toLowerCase())},onSearch:S=>j(S),onChange:S=>{var B;(B=n.current)==null||B.setFieldValue("warehouseId",S)},required:!0,name:"warehouseId",style:{width:"100%"},placeholder:"Search by warehouse name","data-testid":"pickup-address-select",wrapperClassName:L.country,dropdownStyle:{width:300,top:-45},allowClear:!0,innerRef:void 0,showRequiredMarker:!1})]}),!b.rtoSameAsPickup&&e.jsxs(h,{vertical:!0,gap:12,children:[e.jsxs("p",{className:L.formTitle,children:["RTO Address",e.jsx(ye.Text,{type:"danger",children:"*"})]}),e.jsx(Be,{component:Te,options:ne,showSearch:!0,style:{width:"100%"},optionFilterProp:"name",filterOption:(S,B)=>{var E;return(E=B==null?void 0:B.name)==null?void 0:E.toLowerCase().includes(S.toLowerCase())},onSearch:S=>w(S),onChange:S=>{var B;(B=n.current)==null||B.setFieldValue("rtoWarehouseId",S)},required:!0,name:"rtoWarehouseId",placeholder:"Search by warehouse name","data-testid":"rto-address-select",wrapperClassName:L.country,dropdownStyle:{width:300,top:-65},allowClear:!0,innerRef:void 0,showRequiredMarker:!1})]}),e.jsxs(h,{justify:"space-between",gap:18,children:[e.jsx(ve,{onClick:o,className:L.submitButton,children:"Cancel"}),e.jsx(K,{className:L.submitButton,loading:x,disabled:x,onClick:me,children:"CHANGE ADDRESS"})]})]})}))})},Ht="_modalTitle_zabu7_10",$t="_modalSubTitle_zabu7_16",zt="_confirmButton_zabu7_21",oe={modalTitle:Ht,modalSubTitle:$t,confirmButton:zt},Vt=({onCloseModal:o})=>{const{query:i,appendParams:_}=H(),[u,y]=s.useState(!1),{selectedShipfastOrdersId:c}=X(),j=i.selectAll==="true",{params:C}=V(),N=async()=>{y(!0);const{ok:w,data:a}=await Es({shipmentIds:c,selectAll:j,queryParams:j?{...C,search:i.search}:{}});y(!1),w?(q((a==null?void 0:a.message)||"Request acknowledged. All the selected orders will be marked as fulfilled in sometime."),o(),_({selected_order_ids:[],selectAll:[]})):M((a==null?void 0:a.error)||"Failed to mark orders as fulfilled")};return e.jsx(Ae,{open:!0,onCancel:o,footer:null,centered:!0,width:500,children:e.jsxs(h,{vertical:!0,gap:16,children:[e.jsxs(h,{vertical:!0,gap:4,children:[e.jsx("p",{className:oe.modalTitle,children:"Are you sure you want to mark the selected orders as fulfilled?"}),e.jsx("p",{className:oe.modalSubTitle,children:"This action will mark all the selected orders as fulfilled and cannot be undone."})]}),e.jsx(h,{justify:"flex-end",children:e.jsx(K,{loading:u,disabled:u,onClick:N,className:oe.confirmButton,children:"CONFIRM"})})]})})},qt="_modalTitle_zabu7_10",Wt="_modalSubTitle_zabu7_16",Ut="_confirmButton_zabu7_21",Oe={modalTitle:qt,modalSubTitle:Wt,confirmButton:Ut},gs=({onCloseModal:o,actionType:i})=>{const{query:_,appendParams:u}=H(),[y,c]=s.useState(!1),{selectedShipfastOrdersId:j}=X(),C=_.selectAll==="true",{reloadShipfastOrders:N}=Z(),{params:w}=V(),{isFeatureEnabled:a}=Fe("cred_client"),I={rto:{title:"Are you sure you want to bulk initiate RTO for the selected orders?",description:"This action will initiate RTO for all the selected orders and cannot be undone.",primaryActionFunction:Ps,successMessage:"RTO initiated successfully!",errorMessage:"Failed to initiate RTO!"},reattempt:{title:"Are you sure you want to bulk initiate re-attempt for the selected orders?",description:"This action will initiate re-attempt for all the selected orders and cannot be undone.",primaryActionFunction:Fs,successMessage:"Re-Attempt initiated successfully!",errorMessage:"Failed to initiate Re-Attempt!"}},t=I[i].title,x=I[i].description,g=I[i].primaryActionFunction,m=async()=>
1{if(a&&i==="rto")return;c(!0);const{ok:f,data:n}=await g({selectAll:C,shipmentIds:j,queryParams:C?{...w,search:_.search}:{}});c(!1),f?(q((n==null?void 0:n.message)||I[i].successMessage),N(),o(),u({selected_order_ids:[],selectAll:[]}),pe({showProgress:!0})):M((n==null?void 0:n.error)||I[i].errorMessage)};return e.jsx(Ae,{open:!0,onCancel:o,footer:null,centered:!0,width:500,children:e.jsxs(h,{vertical:!0,gap:16,children:[e.jsxs(h,{vertical:!0,gap:4,children:[e.jsx("p",{className:Oe.modalTitle,children:t}),e.jsx("p",{className:Oe.modalSubTitle,children:x})]}),e.jsx(h,{justify:"flex-end",children:e.jsx(K,{loading:y,disabled:y,onClick:m,className:Oe.confirmButton,children:"CONFIRM"})})]})})},Zt=({onCloseModal:o})=>{const{query:i,appendParams:_}=H(),[u,y]=s.useState(!1),{shipfastProfile:c}=Pe(),{isShipfastChildUser:j,userUuid:C}=He(),{selectedShipfastOrders:N}=X(),{reloadShipfastOrders:w}=Z(),a=i.selectAll==="true",I=N.map(g=>g==null?void 0:g.id).filter(g=>!!g),{params:t}=V(),x=async()=>{y(!0),qe("shipfast_orders_bulk_fetch_rto_risk",{client_id:c==null?void 0:c.id,user_uuid:C,is_child_user:j});const{ok:g,data:m}=await et({orderIds:I,all:a,queryParams:a?{...t,search:i.search}:{}});y(!1),g?(q("Request acknowledged. Risk Score will be updated for all the selected orders in sometime."),w(),o(),_({selected_order_ids:[],selectAll:[]}),pe({showProgress:!0})):M((m==null?void 0:m.error)||"Failed to check RTO risk")};return e.jsx(Ae,{open:!0,onCancel:o,footer:null,centered:!0,width:500,children:e.jsxs(h,{vertical:!0,gap:16,children:[e.jsxs(h,{vertical:!0,gap:4,children:[e.jsx("p",{className:De.modalTitle,children:"Are you sure you want to fetch RTO risk for the selected orders?"}),e.jsx("p",{className:De.modalSubTitle,children:"RTO scores will be fetched for only orders where it is not already fetched. It may take sometime to fetch the scores if the order volume is high."})]}),e.jsx(h,{justify:"flex-end",children:e.jsx(K,{loading:u,disabled:u,onClick:x,className:De.confirmButton,children:"CONFIRM"})})]})})},Kt="_icon_1hwto_10",Xt="_labeledInputWithoutIcon_1hwto_40",Yt="_selectInput_1hwto_49",Gt="_packageLabelContainer_1hwto_55",Qt="_title_1hwto_55",Jt="_addPackageButton_1hwto_63",ea="_divider_1hwto_78",sa="_productsLoaderContainer_1hwto_81",$={icon:Kt,labeledInputWithoutIcon:Xt,selectInput:Yt,packageLabelContainer:Gt,title:Qt,addPackageButton:Jt,divider:ea,productsLoaderContainer:sa},ta=({formikRef:o})=>{const{appendParams:i}=H(),{packages:_,isLoading:u,reloadPackages:y}=dt(),[c,j]=s.useState(!1),[C,N]=s.useState([]),w=bs(t=>{i({searchPackage:t})},1e3),a=[..._||[],...C],I=(t,x)=>{var g,m,f,n,d,l;return((f=(m=(g=x.packageName)==null?void 0:g.toLowerCase)==null?void 0:m.call(g))==null?void 0:f.indexOf(t==null?void 0:t.toLowerCase()))>=0||((l=(d=(n=x.packageSize)==null?void 0:n.toLowerCase)==null?void 0:d.call(n))==null?void 0:l.indexOf(t==null?void 0:t.toLowerCase()))>=0};return e.jsx(ze,{innerRef:o,onSubmit:()=>{},initialValues:{package_id:void 0},children:({values:t,setValues:x})=>{const[g,m]=s.useState((a==null?void 0:a.map(d=>{var A,k;const{attributes:l}=d,p=` (${l==null?void 0:l.length} x ${l==null?void 0:l.width} x ${l==null?void 0:l.height} cms)`;return{label:e.jsx(h,{vertical:!0,className:$.packageLabelContainer,children:e.jsxs("p",{className:$.title,children:[je(Ie((A=d==null?void 0:d.attributes)==null?void 0:A.name),20),e.jsx("span",{children:p})]})}),value:d.id,packageName:(k=d==null?void 0:d.attributes)==null?void 0:k.name,packageSize:p.replaceAll(" ","")}}))||[]);s.useEffect(()=>{if(u)return;const d=[..._||[],...C];m((d==null?void 0:d.map(l=>{var k,F;const{attributes:p}=l,A=` (${p==null?void 0:p.length} x ${p==null?void 0:p.width} x ${p==null?void 0:p.height} cms)`;return{label:e.jsx(h,{vertical:!0,className:$.packageLabelContainer,children:e.jsxs("p",{className:$.title,children:[je(Ie((k=l==null?void 0:l.attributes)==null?void 0:k.name),20),e.jsx("span",{children:A})]})}),value:l.id,packageName:(F=l==null?void 0:l.attributes)==null?void 0:F.name,packageSize:A.replaceAll(" ","")}}))||[])},[_,u]);const f=()=>{const p=Object.keys(t).filter(A=>!A.includes("new_package_")).reduce((A,k)=>(A[k]=t[k],A),{});x(p)},n=async d=>{const l={id:d,type:"package",attributes:{id:d,name:t.new_package_name||"",length:Number(t.
1new_package_length||"0"),width:Number(t.new_package_width||"0"),height:Number(t.new_package_height||"0"),package_type:Number(t.new_package_type||"0"),created_at:new Date().toISOString(),updated_at:new Date().toISOString(),default:!1,unique_id:d,dead_weight:Number(t.new_package_dead_weight||"0")*1e3}};N(p=>[...p,l]),f(),j(!1),setTimeout(()=>{x({...t,package_id:d,new_package_view_form:!1})},0),y()};return e.jsxs(Ve,{children:[e.jsx(Be,{prefix:e.jsx(it,{className:$.icon}),component:Te,options:g,required:!0,showSearch:!0,onSearch:d=>w(d),filterOption:I,name:"package_id",label:"Package",placeholder:"Select package",onBlur:()=>{i({searchPackage:""})},onSelect:d=>{i({searchPackage:""})},loading:u,wrapperClassName:G($.labeledInputWithoutIcon,$.selectInput),validate:ct([{test:$s.required,message:"Package is required"}]),open:c,onDropdownVisibleChange:j,dropdownRender:d=>e.jsxs(e.Fragment,{children:[d,u&&e.jsx(h,{justify:"center",align:"center",className:$.productsLoaderContainer,children:e.jsx(ws,{size:"small",showText:!1})}),e.jsx(Hs,{className:$.divider}),e.jsx(We,{type:"text",icon:e.jsx(ut,{}),onClick:()=>{x({...t,new_package_view_form:!0,new_package_name:"",new_package_type:void 0,new_package_length:"",new_package_width:"",new_package_height:"",new_package_dead_weight:""}),j(!1)},size:"small",className:$.addPackageButton,children:"Add Package"})]})}),!!t.new_package_view_form&&e.jsx(rt,{formikRef:o,onClose:f,onPackageAdded:n,setValues:x,values:t})]})}})},aa="_formContainer_odva1_10",oa="_submitButton_odva1_14",na="_formTitle_odva1_17",la="_noteText_odva1_26",ra="_noteTextBold_odva1_35",te={formContainer:aa,submitButton:oa,formTitle:na,noteText:la,noteTextBold:ra},ia=({onCloseModal:o,isSelectAllTrue:i})=>{var t,x;const{query:_,appendParams:u}=H(),{params:y}=V(),c=s.useRef(null),[j,C]=s.useState(!1),{reloadShipfastOrders:N}=Z(),{TAB_ITEMS:w}=Ne(),a=(t=_==null?void 0:_.selected_order_ids)==null?void 0:t.split(","),I=async()=>{var n,d,l,p,A;(n=c==null?void 0:c.current)==null||n.handleSubmit();const g=(d=c==null?void 0:c.current)==null?void 0:d.errors;if(((l=Object.keys(g||{}))==null?void 0:l.length)>0)return;C(!0),qe("shipfast_orders_bulk_edit_package");const{ok:m,data:f}=await zs({package_id:(A=(p=c==null?void 0:c.current)==null?void 0:p.values)==null?void 0:A.package_id,shipment_ids:a,all:i,queryParams:i?{...y,search:_.search}:{}});C(!1),m?(q((f==null?void 0:f.message)||"Request acknowledged. Package details will be updated for all the selected orders in sometime.!"),N(),o(),u({selected_order_ids:[],selectAll:[]})):M((f==null?void 0:f.error)||"Failed to update package details")};return e.jsx(ue,{onClose:o,title:"Edit Package",children:e.jsxs(h,{vertical:!0,gap:16,className:te.formContainer,children:[e.jsxs(ye.Text,{type:"secondary",className:te.noteText,children:[e.jsx("span",{className:te.noteTextBold,children:"NOTE:"})," You have selected"," ",i?((x=w.find(g=>g.key===_.order_status))==null?void 0:x.count)||0:a==null?void 0:a.length," ","Orders. Please choose appropriate package for the selected orders to proceed with."]}),e.jsx("h3",{className:te.formTitle,children:"Select Package"}),e.jsx(ta,{formikRef:c}),e.jsxs(h,{justify:"space-between",gap:18,children:[e.jsx(ve,{onClick:o,className:te.submitButton,children:"Cancel"}),e.jsx(K,{className:te.submitButton,loading:j,disabled:j,onClick:I,children:"CONFIRM"})]})]})})},ca=o=>s.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o},s.createElement("path",{d:"M6 1.5C8.48528 1.5 10.5 3.51472 10.5 6C10.5 8.48528 8.48528 10.5 6 10.5C3.51472 10.5 1.5 8.48528 1.5 6C1.5 3.51472 3.51472 1.5 6 1.5Z",stroke:"#B9BECE"}),s.createElement("path",{d:"M5.03125 6.0625L4 5.03125L5.03125 4",stroke:"#B9BECE",strokeLinecap:"round",strokeLinejoin:"round"}),s.createElement("path",{d:"M5.03125 7.4375H6.92188C7.24096 7.4375 7.54698 7.31074 7.77261 7.08511C7.99824 6.85948 8.125 6.55346 8.125 6.23438C8.125 5.91529 7.99824 5.60927 7.77261 5.38364C7.54698 5.15801 7.24096 5.03125 6.92188 5.03125H4",stroke:"#B9BECE",strokeLinecap:"round",strokeLinejoin:"round"})),da="_container_1mi23_10",ua="_buttonsContainer_1mi23_13",pa="_addTagButton_1mi23_16",ha="_tagsListContainer_1mi23_19",ma="_tagContainer_1mi23_22",_a="_inputStyle_1mi23_27",ga="_cancelButton_1mi23_31",fa="_confirmButton_1mi23_37",Ca="_tagIcon_1mi23_43",ka="_productsLoaderContainer_1mi23_46",z={container:da,buttonsContainer:ua,addTagButton:pa,tagsListContainer:ha,tagContainer:ma,inputStyle:_a,cancelButton:ga,confirmButton:fa,tagIcon:Ca,productsLoaderContainer:ka},ba=({onClose:o})=>{const{tags:i,isLoading:_}=Vs({}),[u,y]=s.useState([]),[c,j]=s.useState(!1),[C,N]=s.useState([]),[w,a]=s.useState(""),{query:I,appendParams:t}=H(),{selectedShipfastOrdersId:x}=X(),{params:g}=V(),m=I.selectAll==="true",f=(u==null?void 0:u.length)===0,n=async()=>{j(!0);const{ok:d,data:l}=await Us({shipmentIds:x,selectAll:m,queryParams:m?{...g,search:I.search}:{},new_tags:u});j(!1),d?(q((l==null?void 0:l.message)||"New tags have been added to the orders"),o(),t({selected_order_ids:[],selectAll:[]})):M((l==null?void 0:l.error)||"Failed to add tags to the orders")};return e.jsx(ue,{onClose:o,title:"Bulk Add Tags",fluidHeight:!0,children:e.jsxs(h,{className:z.container,vertical:!0,gap:30,children:[e.jsxs(h,{vertical:!0,gap:10,children:[e.jsx(ze,{initialValues:{tag:""},onSubmit:()=>{},children:({values:d,setFieldValue:l})=>{const p=bs(k=>{t({tagsSearch:k||[]})},500);s.useEffect(()=>{_||(i==null?void 0:i.length)===0||N(i)},[_,i]);const A=C.map(k=>({label:k,value:k}));return s.useEffect(()=>{p(w)},[w]),e.jsx(Ve,{children:e.jsx(Be,{prefix:e.jsx(qs,{className:z.tagIcon}),name:"tag",label:"Tags",component:Te,wrapperClassName:z.inputStyle,placeholder:"Enter tag",options:A,showSearch:!0,onSearch:k=>{p(k),a(k)},searchValue:w,autoClearSearchValue:!1,suffix:e.jsx("div",{children:e.jsx(ve,{size:"small",onMouseDown:k=>{w&&(y([...u,w]),l("tag",""),a(""))},disabled:!w,className:z.addTagButton,children:"Add"})}),onKeyDown:k=>{if(k.key==="Enter"){if(k==null||k.preventDefault(),(w==null?void 0:w.length)===0)return;y([...u,w]),a(""),l("tag","")}},onSelect:k=>{y([...u,k]),a(""),l("tag","")},dropdownRender:k=>e.jsxs(e.Fragment,{children:[k,_&&e.jsx(h,{justify:"center",align:"center",className:z.productsLoaderContainer,children:e.jsx(ws,{size:"small",showText:!1})})]})})})}}),e.jsx(h,{className:z.tagsListContainer,gap:8,children:u.map(d=>e.jsx(Ws,{className:z.tagContainer,closable:!0,onClose:()=>{y(u.filter(l=>l!==d))},children:d},d))})]}),e.jsxs(h,{align:"center",gap:20,className:z.buttonsContainer,children:[e.jsx(We,{className:z.cancelButton,onClick:o,children:"CANCEL"}),e.jsx(K,{className:z.confirmButton,disabled:f,loading:c,onClick:n,children:"CONFIRM"})]})]})})},wa="_icon_17uqm_10",xa={icon:wa},fs=5e3,Sa=({onClose:o})=>{var t;const{query:i,appendParams:_}=H(),{selectedShipfastOrdersId:u}=X(),{reloadShipfastOrders:y}=Z(),{TAB_ITEMS:c}=Ne(),j=i.selectAll==="true",[C,N]=s.useState(!1),{params:w}=V(),a=j?((t=c.find(x=>x.key===i.order_status))==null?void 0:t.count)||0:u.length,I=async()=>
1{if(N(!0),a>fs){M(`You can only clone a maximum of ${fs} orders at a time.`),N(!1);return}const{ok:x,data:g}=await Zs({shipmentIds:u,selectAll:j,queryParams:j?{...w,search:i.search}:{}});N(!1),x?(q((g==null?void 0:g.message)||"Request accepted. Selected orders will be cloned shortly."),y(),o(),_({selected_order_ids:[],selectAll:[]}),pe({showProgress:!0})):M(Q(g,"Failed to bulk clone orders"))};return e.jsx(Ct,{onClose:o,onConfirm:I,title:"Bulk Clone Orders",description:`Are you sure you want to bulk clone ${a} ${$e("order",a)}?`,icon:e.jsx(h,{className:xa.icon,align:"center",justify:"center",children:e.jsx(ae,{})}),confirmText:"YES",cancelText:"CANCEL",loading:C,disabled:C})},ya=o=>s.createElement("svg",{width:40,height:40,viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o},s.createElement("rect",{width:40,height:40,rx:8,fill:"#1AB746",fillOpacity:.06}),s.createElement("path",{d:"M10.1508 15.8359C9.5091 15.8359 8.9611 16.1857 8.58397 16.6476C7.48153 18.0457 7.22656 20.5678 7.22656 22.6143H20.4523C20.3449 21.2534 20.4093 17.7674 21.7359 17.0729V31.6615H9.44333V23.7254H8.33549V32.7726H19.7248H31.1141V23.7254H30.003V31.6615H22.847V17.0696C24.1516 17.7764 24.1878 20.7528 24.135 22.6143H32.7796C32.7796 21.1515 32.6807 18.2274 31.4179 16.6476C31.0407 16.1857 30.4927 15.8359 29.8511 15.8359H10.1508ZM10.1508 16.947H20.3742C19.3978 18.2267 19.3708 19.985 19.3781 21.5032H8.41144C8.4976 19.943 8.65065 18.4134 9.4455 17.3485C9.68297 17.0577 9.88502 16.947 10.1508 16.947ZM11.3585 26.6496V27.7607H15.3688V26.6496H11.3585ZM11.3585 28.8718V29.9829H13.4928V28.8718H11.3585Z",fill:"#1AB746"}),s.createElement("path",{d:"M22.7617 7.21875C22.7617 7.29123 22.677 7.49644 22.5089 7.72656C22.0972 8.27865 21.6118 8.72485 21.2057 9.24346C21.0186 9.48416 20.8585 9.6864 20.8585 9.95201V10.6367H21.8524V15.8395C22.9773 15.8395 24.1021 15.8395 25.2269 15.8395V10.6367H26.2208C26.2208 10.4085 26.2208 10.1802 26.2208 9.95201C26.2208 9.6864 26.0607 9.48416 25.8736 9.24346C25.4483 8.70121 24.9656 8.26261 24.5705 7.72656C24.4024 7.49644 24.3155 7.29126 24.3155 7.21875H22.7617ZM15.6871 8.46005C15.6871 8.53254 15.6024 8.73883 15.4343 8.96895C15.0226 9.52104 14.5373 9.96616 14.1312 10.4848C13.9441 10.7255 13.7839 10.9277 13.7839 11.1933V11.878H14.7778V14.7284C15.9027 14.7284 17.0275 14.7284 18.1524 14.7284V11.878H19.1463C19.1463 11.6498 19.1463 11.4215 19.1463 11.1933C19.1463 10.9277 18.9861 10.7255 18.7991 10.4848C18.3737 9.94251 17.8911 9.505 17.4959 8.96895C17.3278 8.73883 17.2409 8.53256 17.2409 8.46005C17.0935 8.46005 15.8346 8.46005 15.6871 8.46005Z",fill:"#1AB746"})),ja=o=>s.createElement("svg",{width:40,height:40,viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o},s.createElement("rect",{width:40,height:40,rx:8,fill:"#D93E3E",fillOpacity:.06}),s.createElement("path",{d:"M10.1508 12C9.5091 12 8.9611 12.3498 8.58397 12.8116C7.48153 14.2097 7.22656 16.7319 7.22656 18.7783H20.4523C20.3449 17.4174 20.4093 13.9315 21.7359 13.237V27.8255H9.44333V19.8894H8.33549V28.9366H19.7248H31.1141V19.8894H30.003V27.8255H22.847V13.2337C24.1516 13.9405 24.1878 16.9168 24.135 18.7783H32.7796C32.7796 17.3155 32.6807 14.3914 31.4179 12.8116C31.0407 12.3498 30.4927 12 29.8511 12H10.1508ZM10.1508 13.1111H20.3742C19.3978 14.3907 19.3708 16.149 19.3781 17.6672H8.41144C8.4976 16.1071 8.65065 14.5774 9.4455 13.5126C9.68297 13.2218 9.88502 13.1111 10.1508 13.1111ZM11.3585 22.8137V23.9248H15.3688V22.8137H11.3585ZM11.3585 25.0359V26.147H13.4928V25.0359H11.3585Z",fill:"#D93E3E"}),s.createElement("line",{x1:9.53033,y1:8.46967,x2:32.1577,y2:31.0971,stroke:"#D93E3E",strokeWidth:1.5})),Ia="_modalWrapper_shzi4_10",Ba="_container_shzi4_29",Ta="_headerRow_shzi4_37",va="_closeButtonWrap_shzi4_42",Na="_headerCopy_shzi4_48",Aa="_title_shzi4_53",La="_subtitle_shzi4_63",Da="_ordersSection_shzi4_70",Ma="_sectionDivider_shzi4_73",Ra="_ordersSelectedLabel_shzi4_81",Oa="_ordersChipContainer_shzi4_90",Ea="_selectAllText_shzi4_96",Fa="_optionsSection_shzi4_102",Pa="_optionsLabel_shzi4_105",Ha="_optionCardsRow_shzi4_113",$a="_optionCard_shzi4_113",za="_optionCardSelected_shzi4_133",Va="_optionRadio_shzi4_138",qa="_optionRadioSelected_shzi4_149",Wa="_optionCardTopRow_shzi4_163",Ua="_optionIcon_shzi4_167",Za="_optionCardTitle_shzi4_172",Ka="_optionCardDescription_shzi4_181",Xa="_optionDetail
1s_shzi4_189",Ya="_enableDetails_shzi4_197",Ga="_disableDetails_shzi4_200",Qa="_optionDetailsTitle_shzi4_203",Ja="_optionDetailsList_shzi4_211",eo="_optionDetailsItem_shzi4_219",so="_enableDetailIcon_shzi4_227",to="_disableDetailIcon_shzi4_233",ao="_actionsRow_shzi4_239",oo="_cancelButton_shzi4_244",no="_updateButton_shzi4_245",r={modalWrapper:Ia,container:Ba,headerRow:Ta,closeButtonWrap:va,headerCopy:Na,title:Aa,subtitle:La,ordersSection:Da,sectionDivider:Ma,ordersSelectedLabel:Ra,ordersChipContainer:Oa,selectAllText:Ea,optionsSection:Fa,optionsLabel:Pa,optionCardsRow:Ha,optionCard:$a,optionCardSelected:za,optionRadio:Va,optionRadioSelected:qa,optionCardTopRow:Wa,optionIcon:Ua,optionCardTitle:Za,optionCardDescription:Ka,optionDetails:Xa,enableDetails:Ya,disableDetails:Ga,optionDetailsTitle:Qa,optionDetailsList:Ja,optionDetailsItem:eo,enableDetailIcon:so,disableDetailIcon:to,actionsRow:ao,cancelButton:oo,updateButton:no},lo=["Additional charges will apply","Applicable only for orders enabled for OBD","If not accepted, it may be returned as per standard SOP"],ro=["No additional charges","Package remains sealed on delivery","Customer can't open or inspect before acceptance"],io=({onClose:o})=>{var m;const{query:i,appendParams:_}=H(),[u,y]=s.useState(!1),[c,j]=s.useState("enable"),{selectedShipfastOrdersId:C}=X(),{reloadShipfastOrders:N}=Z(),{TAB_ITEMS:w}=Ne(),a=i.selectAll==="true",{params:I}=V(),t=a?((m=w.find(f=>f.key===i.order_status))==null?void 0:m.count)||0:C==null?void 0:C.length,x=a?Number(t):C.length,g=async()=>{if(!a&&C.length===0){M("Please select at least one order to update.");return}y(!0);try{const{ok:f,data:n}=await Ks({shipmentIds:C,selectAll:a,isObd:c==="enable",queryParams:a?{...I,search:i.search}:{}});f?(q((n==null?void 0:n.message)||(c==="enable"?"Open Box Delivery has been enabled for the selected orders.":"Open Box Delivery has been disabled for the selected orders.")),N(),o(),_({selected_order_ids:[],selectAll:[]})):M(Q(n,c==="enable"?"Failed to enable Open Box Delivery":"Failed to disable Open Box Delivery"))}finally{y(!1)}};return e.jsxs(h,{vertical:!0,className:r.container,children:[e.jsxs("div",{className:r.headerRow,children:[e.jsx("div",{className:r.closeButtonWrap,children:e.jsx(kt,{onClose:o})}),e.jsxs(h,{vertical:!0,align:"center",gap:4,className:r.headerCopy,children:[e.jsx("h2",{className:r.title,children:"Update Open Box Delivery"}),e.jsx("p",{className:r.subtitle,children:"Allows customers to verify the package at delivery"})]})]}),e.jsxs(h,{vertical:!0,gap:8,className:r.ordersSection,children:[e.jsxs("p",{className:r.ordersSelectedLabel,children:[x," ",$e("order",x)," selected"]}),a&&e.jsx("div",{className:r.ordersChipContainer,children:e.jsxs("p",{className:r.selectAllText,children:["All ",t," orders matching the current selection will be updated."]})})]}),e.jsx("div",{className:r.sectionDivider,"aria-hidden":"true"}),e.jsxs(h,{vertical:!0,gap:8,className:r.optionsSection,children:[e.jsx("p",{className:r.optionsLabel,children:"Select an option:"}),e.jsxs(h,{gap:12,className:r.optionCardsRow,children:[e.jsxs("button",{type:"button",className:G(r.optionCard,{[r.optionCardSelected]:c==="enable"}),onClick:()=>j("enable"),children:[e.jsx("span",{className:G(r.optionRadio,{[r.optionRadioSelected]:c==="enable"}),"aria-hidden":"true"}),e.jsxs(h,{align:"flex-start",gap:10,className:r.optionCardTopRow,children:[e.jsx(ya,{"aria-hidden":"true",className:r.optionIcon}),e.jsx("span",{className:r.optionCardTitle,children:"Enable Open Box Delivery"})]}),e.jsx("p",{className:r.optionCardDescription,children:"Customers will be allowed to open and inspect the package on delivery"}),e.jsxs("div",{className:G(r.optionDetails,r.enableDetails),children:[e.jsx("p",{className:r.optionDetailsTitle,children:"If OBD is enabled:"}),e.jsx("ul",{className:r.optionDetailsList,children:lo.map(f=>e.jsxs("li",{className:r.optionDetailsItem,children:[e.jsx(bt,{className:r.enableDetailIcon}),e.jsx("span",{children:f})]},f))})]})]}),e.jsxs("button",{type:"button",className:G(r.optionCard,{[r.optionCardSelected]:c==="disable"}),onClick:()=>j("disable"),children:[e.jsx("span",{className:G(r.optionRadio,{[r.optionRadioSelected]:c==="disable"}),"aria-hidden":"true"}
1),e.jsxs(h,{align:"flex-start",gap:10,className:r.optionCardTopRow,children:[e.jsx(ja,{"aria-hidden":"true",className:r.optionIcon}),e.jsx("span",{className:r.optionCardTitle,children:"Disable Open Box Delivery"})]}),e.jsx("p",{className:r.optionCardDescription,children:"The selected orders will be delivered as sealed packages"}),e.jsxs("div",{className:G(r.optionDetails,r.disableDetails),children:[e.jsx("p",{className:r.optionDetailsTitle,children:"If OBD is disabled:"}),e.jsx("ul",{className:r.optionDetailsList,children:ro.map(f=>e.jsxs("li",{className:r.optionDetailsItem,children:[e.jsx(wt,{className:r.disableDetailIcon}),e.jsx("span",{children:f})]},f))})]})]})]})]}),e.jsxs(h,{justify:"space-between",className:r.actionsRow,children:[e.jsx(ve,{onClick:o,className:r.cancelButton,disabled:u,children:"CANCEL"}),e.jsx(K,{loading:u,disabled:u||!a&&x===0,onClick:g,className:r.updateButton,children:"UPDATE"})]})]})},co=({approval:o,onCloseModal:i})=>{const{query:_,appendParams:u}=H(),[y,c]=s.useState(!1),{selectedShipfastOrdersId:j}=X(),{reloadShipfastOrders:C}=Z(),N=_.selectAll==="true",{params:w}=V(),a=async()=>{c(!0);try{const{ok:I,data:t}=await Xs({shipmentIds:j,selectAll:N,approval:o,queryParams:N?{...w,search:_.search}:{}});I?(q((t==null?void 0:t.message)||(o?"Weight updated successfully for selected orders":"Selected orders will proceed with declared weight")),C(),i(),u({selected_order_ids:[],selectAll:[]})):M(Q(t,o?"Failed to accept historic weight for selected orders":"Failed to proceed with declared weight for selected orders"))}finally{c(!1)}};return e.jsx(Ae,{open:!0,onCancel:i,footer:null,centered:!0,width:500,children:e.jsxs(h,{vertical:!0,gap:16,children:[e.jsxs(h,{vertical:!0,gap:4,children:[e.jsx("p",{className:oe.modalTitle,children:o?"Accept & update weight for selected orders?":"Proceed with declared weight for selected orders?"}),e.jsx("p",{className:oe.modalSubTitle,children:o?"This will update the selected orders to the historically charged weight.":"This will keep the declared weight on the selected orders and cannot be undone."})]}),e.jsx(h,{justify:"flex-end",children:e.jsx(K,{loading:y,disabled:y,onClick:a,className:oe.confirmButton,children:"CONFIRM"})})]})})},uo=o=>s.createElement("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o},s.createElement("path",{d:"M4.99805 9.5C2.51277 9.5 0.498047 7.48528 0.498047 5C0.498047 2.51472 2.51277 0.5 4.99805 0.5C7.48333 0.5 9.49805 2.51472 9.49805 5C9.49805 7.48528 7.48333 9.5 4.99805 9.5Z",stroke:"#B9BECE"}),s.createElement("path",{d:"M4.0293 5.0625L2.99805 4.03125L4.0293 3",stroke:"#B9BECE",strokeLinecap:"round",strokeLinejoin:"round"}),s.createElement("path",{d:"M4.0293 6.4375H5.91992C6.23901 6.4375 6.54503 6.31074 6.77066 6.08511C6.99629 5.85948 7.12305 5.55346 7.12305 5.23438C7.12305 4.91529 6.99629 4.60927 6.77066 4.38364C6.54503 4.15801 6.23901 4.03125 5.91992 4.03125H2.99805",stroke:"#B9BECE",strokeLinecap:"round",strokeLinejoin:"round"})),po=o=>s.createElement("svg",{width:11,height:11,viewBox:"0 0 11 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o},s.createElement("path",{d:"M8 4.59V4H9V4.515C8.92 4.5 8.835 4.5 8.75 4.5C8.5 4.5 8.25 4.535 8 4.59ZM6.5 4.75C6.5 4.61 6.39 4.5 6.25 4.5H3.75C3.61 4.5 3.5 4.61 3.5 4.75V5.5H6.41L6.5 5.41V4.75ZM2 8.5V4H1V9.5H6.015C5.82 9.195 5.675 8.86 5.59 8.5H2ZM9.5 3.5H0.5V0.5H9.5V3.5ZM8.5 1.5H1.5V2.5H8.5V1.5ZM8.5 5.75V5L7.375 6.125L8.5 7.25V6.5C8.83152 6.5 9.14946 6.6317 9.38388 6.86612C9.61831 7.10054 9.75 7.41848 9.75 7.75C9.75 7.95 9.705 8.14 9.62 8.31L10.165 8.855C10.375 8.54 10.5 8.16 10.5 7.75C10.5 6.645 9.605 5.75 8.5 5.75ZM8.5 9C8.16848 9 7.85054 8.86831 7.61612 8.63388C7.3817 8.39946 7.25 8.08152 7.25 7.75C7.25 7.55 7.295 7.36 7.38 7.19L6.835 6.645C6.625 6.96 6.5 7.34 6.5 7.75C6.5 8.855 7.395 9.75 8.5 9.75V10.5L9.625 9.375L8.5 8.25V9Z",fill:"#B9BECE"})),Se=500,Ee=2500,Cs=1e3,ks=5e3,gn=({setFetchDocument:o,showShippingLottie:i})=>{var ts,as,os,ns,ls;const{isLoading:_,isValidating:u}=Z(),{TAB_ITEMS:y}=Ne(),{selectedShipfastOrders:c}=X(),[j,C]=s.useState(!1),{isShipfastChildUser:N,userUuid:w}=He(),{query:a,appendParams:I}=H(),t=a.order_status,{isAiCallingEnabled:x,isBuyerDataAccessEnabled:g,shipfastProfile:m}=Pe(),{isFeatureEnabled:f}=Fe("bulk_label_via_lambda"),{isFeatureEnabled:n}=Fe("cred_client"),d=D=>n?e.jsx(U,{title:It,color:"#FFFFFF",overlayInnerStyle:{color:"#3D3D6B"},children:e.jsx("span",{children:D})}):D,l=a.selected_order_ids,p=l?l==null?void 0:l.split(","):[],A=(p==null?void 0:p.length)===0||_||u,[k,F]=s.useState({showModal:!1,shipmentIds:[]}),[he,ne]=s.useState(!1),[me,_e]=s.useState(!1),[b,S]=s.useState(!1),[B,E]=s.useState(!1),[W,le]=s.useState(!1),[ge,re]=s.useState(!1),[fe,J]=s.useState(!1),[Ce,Ue]=s.useState(!1),[xs,Ze]=s.useState(!1),[Ss,Ke]=s.useState(!1),[ys,ee]=s.useState(!1),[Xe,Ye]=s.useState(null),[ke,ie]=s.useState({show:!1,s3Url:null,error:null,isLoading:!1}),{params:ce}=V(),Ge=t=="pending",js=t=="ready_to_ship",Is=t=="in_transit",Bs=t=="all",Ts=Ge&&(c==null?void 0:c.some(D=>{var P;return Ys((P=D.attributes)==null?void 0:P.insights)})),R=a.selectAll==="true",be=((ts=y.find(D=>D.key===t))==null?void 0:ts.count)||0,se=R&&be>Se,we=R&&be>
1Ee,Qe=R&&be>Cs,Je=R&&be>ks,vs=[...St,...yt].includes((as=m==null?void 0:m.attributes)==null?void 0:as.default_courier_selection_mode),Le=async()=>{var O;const D=p,{ok:P,data:T}=await st({shipmentIds:D,selectAll:R,queryParams:R?{...ce,search:a.search}:{}});if(!P){M(Q(T,"Failed to download invoices"));return}I({selected_order_ids:[],selectAll:[]}),o({show:!0,jobId:(O=T==null?void 0:T.data)==null?void 0:O.id})},es=async()=>{var O;const D=p,{ok:P,data:T}=await ot({shipmentIds:D,selectAll:R,queryParams:R?{...ce,search:a.search}:{}});if(!P){M(Q(T,"Failed to download labels"));return}I({selected_order_ids:[],selectAll:[]}),o({show:!0,jobId:(O=T==null?void 0:T.data)==null?void 0:O.id,type:"label"})},ss=async()=>{var rs,is;const D=p;ie({show:!0,s3Url:null,error:null,isLoading:!0});const{ok:P,data:T}=await tt({shipmentIds:D,selectAll:R,queryParams:R?{...ce,search:a.search}:{}}),O=(rs=T==null?void 0:T.data)==null?void 0:rs.tracking_numbers,xe=(is=T==null?void 0:T.data)==null?void 0:is.token;if(!P||!xe||!(O!=null&&O.length)){ie(de=>({...de,error:(T==null?void 0:T.error)||"Failed to fetch tracking numbers",isLoading:!1}));return}const{ok:Ms,data:Y}=await at({token:xe,trackingNumbers:O});if(!Ms||!(Y!=null&&Y.s3Url)){ie(de=>({...de,error:(Y==null?void 0:Y.status)||"Failed to download labels",isLoading:!1}));return}ie(de=>({...de,s3Url:Y.s3Url,isLoading:!1}))},Ns=async()=>{var O;const D=p,{ok:P,data:T}=await nt({shipmentIds:D,selectAll:R,queryParams:R?{...ce,search:a.search}:{}});if(!P){M(Q(T,"Failed to download picklist"));return}I({selected_order_ids:[],selectAll:[]}),o({show:!0,jobId:(O=T==null?void 0:T.data)==null?void 0:O.id})},As=()=>{n||C(!0)},Ls=async(D,P)=>{if(n)return;const T=p,{ok:O,data:xe}=await lt({carrierId:D,shipmentIds:T,selectAll:R,queryParams:R?{...ce,search:a.search}:{},hideCourierList:vs,warehouseId:P});if(jt("shipfast_orders_reassign_shipments",{client_id:m==null?void 0:m.id,user_uuid:w,is_child_user:N}),!O){M(Q(xe,"Failed to Reassign Shipments"));return}I({selected_order_ids:[],selectAll:[]}),q("Request accepted. Please check the status in the Bulk Actions tab."),pe({showProgress:!0})},Ds=Ge?[{key:"ship_order",label:"Ship Order",icon:e.jsx(ht,{className:v.secondaryIcon}),onClick:()=>{re(!0)}},{key:"initiate_ai_call",label:"Initiate AI Call",icon:e.jsx(ps,{className:v.secondaryIcon}),onClick:()=>{F({showModal:!0,shipmentIds:p})},disabled:!x},{key:"bulk_clone",label:"Bulk Clone Orders",icon:e.jsx(ae,{className:v.secondaryIcon}),onClick:()=>ee(!0)},{key:"add_tag",label:"Bulk Add Tag",icon:e.jsx(Me,{className:v.secondaryIcon}),onClick:()=>{Ke(!0)}},{key:"view_rto_risk",label:"Fetch RTO Risk Scores",icon:e.jsx(ca,{className:v.secondaryIcon}),onClick:()=>{Ze(!0)}},{key:"update_open_box_delivery",label:"Update Open Box Delivery",icon:e.jsx(xt,{className:v.obdBulkIcon}),onClick:()=>{_e(!0)}},{key:"change_address",label:"Change Address",icon:e.jsx(mt,{className:v.secondaryIcon}),onClick:()=>{ne(!0)}},{key:"edit_package",label:"Edit Package",icon:e.jsx(Bt,{className:v.secondaryIcon}),onClick:()=>{S(!0)}},...Ts?[{key:"accept_historic_weight",label:"Accept & Update Weight",icon:e.jsx(ms,{className:v.secondaryIcon}),onClick:()=>Ye({approval:!0})}]:[],{type:"divider"},{key:"fulfill",label:"Mark as Fulfilled",icon:e.jsx(ms,{className:v.secondaryIcon}),onClick:()=>{Ue(!0)}},{key:"cancel",label:d("Cancel Order"),icon:e.jsx(_s,{}),disabled:!!n,onClick:()=>{n||J(!0)},danger:!0}]:js?[...(os=m==null?void 0:m.attributes)!=null&&os.should_generate_invoice?[{key:"download_invoice",label:e.jsx(U,{title:se?`Max ${Se} invoices can be downloaded at a time`:"",color:"#FFFFFF",overlayInnerStyle:{color:"#3D3D6B"},children:"Download Invoice"}),icon:e.jsx(Re,{className:v.secondaryIcon}),onClick:Le,disabled:se}]:[],{key:"download_label",label:e.jsx(U,{title:we?`Max ${Ee} labels can be downloaded at a time`:"",color:"#FFFFFF",overlayInnerStyle:{color:"#3D3D6B"},children:"Download Label"}),icon:e.jsx(Me,{className:v.secondaryIcon}),onClick:f?ss:es,disabled:we},{key:"download_picklist",label:e.jsx(U,{title:Qe?`Max ${Cs} pick lists can be downloaded at a time`:"",color:"#FFFFFF",overlayInnerStyle:{color:"#3D3D6B"},children:"Download Pick List"}),icon:e.jsx(gt,{className:v.secondaryIconCustom}),onClick:Ns,disabled:!g||Qe},{key:"bulk_clone",label:"Bulk Clone Orders",icon:e.jsx(ae,{className:v.secondaryIcon}),onClick:()=>ee(!0)},{type:"divider"},{key:"reassign",label:d("Re-assign Shipments"),icon:e.jsx(_t,{className:v.packageIcon}),disabled:!!n,onClick:As,danger:!0},{key:"cancel",label:d("Cancel Order"),icon:e.jsx(_s,{}),disabled:!!n,onClick:()=>{n||J(!0)},danger:!0}]:Is?[...(ns=m==null?void 0:m.attributes)!=null&&ns.should_generate_invoice?[{key:"download_invoice",label:e.jsx(U,{title:se?`Max ${Se} invoices can be downloaded at a time`:"",color:"#FFFFFF",overlayInnerStyle:{color:"#3D3D6B"},children:"Download Invoice"}),icon:e.jsx(Re,{className:v.secondaryIcon}),onClick:Le,disabled:se}]:[],{key:"download_label",label:e.jsx(U,{title:we?`Max ${Ee} labels can be downloaded at a time`:"",color:"#FFFFFF",overlayInnerStyle:{color:"#3D3D6B"}
1,children:"Download Label"}),icon:e.jsx(Me,{className:v.secondaryIcon}),onClick:f?ss:es,disabled:we},{key:"bulk_clone",label:"Bulk Clone Orders",icon:e.jsx(ae,{className:v.secondaryIcon}),onClick:()=>ee(!0)}]:Bs?[...(ls=m==null?void 0:m.attributes)!=null&&ls.should_generate_invoice?[{key:"download_invoice",label:e.jsx(U,{title:se?`Max ${Se} invoices can be downloaded at a time`:"",color:"#FFFFFF",overlayInnerStyle:{color:"#3D3D6B"},children:"Download Invoice"}),icon:e.jsx(Re,{className:v.secondaryIcon}),onClick:Le,disabled:se}]:[],{key:"bulk_clone",label:"Bulk Clone Orders",icon:e.jsx(ae,{className:v.secondaryIcon}),onClick:()=>ee(!0)}]:[{key:"initiate_rto",label:d("Initiate RTO"),icon:e.jsx(uo,{className:v.secondaryIcon}),disabled:!!n,onClick:()=>{n||E(!0)}},{key:"initiate_re_attempt",label:e.jsx(U,{title:Je?`Max ${ks} re-attempts can be initiated at a time`:"",color:"#FFFFFF",overlayInnerStyle:{color:"#3D3D6B"},children:"Initiate Re-Attempt"}),icon:e.jsx(po,{className:v.secondaryIcon}),onClick:()=>{le(!0)},disabled:Je},{key:"bulk_clone",label:"Bulk Clone Orders",icon:e.jsx(ae,{className:v.secondaryIcon}),onClick:()=>ee(!0)},{key:"initiate_ai_call",label:"Initiate AI Call",icon:e.jsx(ps,{className:v.secondaryIcon}),onClick:()=>{F({showModal:!0,shipmentIds:p})},disabled:!x}];return["ndr_raised","pending","ready_to_ship","in_transit","all"].includes(t)?e.jsxs(e.Fragment,{children:[k.showModal&&e.jsx(Gs,{onSuccess:()=>{hs(!0,"ai-calling"),setTimeout(()=>{hs(!1,"ai-calling")},3e3)},onClose:()=>{F({showModal:!1,shipmentIds:[]}),I({selected_order_ids:[],selectAll:[]})},onCancel:()=>{F({showModal:!1,shipmentIds:[]})},isBulkAction:!0,shipmentIds:k.shipmentIds}),ge&&e.jsx(Qs,{onCloseModal:()=>re(!1),showShippingLottie:i}),he&&e.jsx(ue,{Component:Pt,title:"Change Address",onClose:()=>ne(!1)}),me&&e.jsx(ue,{Component:io,onClose:()=>_e(!1),hideHeader:!0,modalClassWrap:r.modalWrapper,forceWidth:548,fluidHeight:!0,bodyPadding:0}),b&&e.jsx(ia,{onCloseModal:()=>S(!1),isSelectAllTrue:R}),fe&&e.jsx(Js,{onCloseModal:()=>J(!1)}),Ce&&e.jsx(Vt,{onCloseModal:()=>Ue(!1)}),B&&e.jsx(gs,{onCloseModal:()=>{E(!1)},actionType:"rto"}),W&&e.jsx(gs,{onCloseModal:()=>{le(!1)},actionType:"reattempt"}),j&&e.jsx(ue,{title:"Re-assign Shipments",onClose:()=>C(!1),fluidHeight:!0,children:e.jsx(pt,{onClose:()=>C(!1),onSubmit:Ls,totalShipments:(p==null?void 0:p.length)||0})}),xs&&e.jsx(Zt,{onCloseModal:()=>Ze(!1)}),Ss&&e.jsx(ba,{onClose:()=>Ke(!1)}),ys&&e.jsx(Sa,{onClose:()=>ee(!1)}),Xe&&e.jsx(co,{approval:Xe.approval,onCloseModal:()=>Ye(null)}),ke.show&&e.jsx(ft,{onCloseModal:()=>{ie({show:!1,s3Url:null,error:null,isLoading:!1}),I({selected_order_ids:[],selectAll:[]})},s3Url:ke.s3Url,error:ke.error,isLoading:ke.isLoading}),e.jsx(Tt,{menu:{items:Ds},disabled:A,placement:"bottomRight",children:e.jsx(We,{size:"small",className:v.dropdownButton,children:e.jsxs(h,{gap:10,align:"center",justify:"space-between",children:[e.jsx("p",{children:"Select bulk action"}),e.jsx(h,{className:v.dropdownIconContainer,children:e.jsx(vt,{})})]})})})]}):e.jsx(e.Fragment,{})};export{gn 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.