PageSourceSearch

https://freightcompare.ai/assets/CalculationDetailsPage-ch6lo9td.js

js freightcompare.ai collected 2026-10-02 01:11:23 UTC 31,265 bytes, 11 lines download raw bytes

1import{c as f,bm as j,E as p,r as m,j as e,T as h,F as v,B as g,X as N}from"./index-BFYamPZN.js";import{A as w}from"./arrow-left-xOH_e3v_.js";import{C}from"./calculator-Dc4pZ2YU.js";import{B as b}from"./book-open-u6j011f0.js";import{I as y}from"./info-CQ4LeTEy.js";/**
2 * @license lucide-react v0.344.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const k=f("Fuel",[["line",{x1:"3",x2:"15",y1:"22",y2:"22",key:"xegly4"}],["line",{x1:"4",x2:"14",y1:"9",y2:"9",key:"xcnuvu"}],["path",{d:"M14 22V4a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v18",key:"16j0yd"}],["path",{d:"M14 13h2a2 2 0 0 1 2 2v2a2 2 0 0 0 2 2h0a2 2 0 0 0 2-2V9.83a2 2 0 0 0-.59-1.42L18 5",key:"8ur5zv"}]]);/**
7 * @license lucide-react v0.344.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const u=f("Sigma",[["path",{d:"M18 7V4H6l6 8-6 8h12v-3",key:"zis8ev"}]]),F=({isOpen:x,onClose:c,quote:s})=>{const[r,o]=m.useState("example"),a=s?.formulaParams||{},t=n=>new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",minimumFractionDigits:0,maximumFractionDigits:2}).format(n),l=[{term:"Actual Weight",def:"The physical weight of the shipment as measured on a scale.",formula:"Measured in kg"},{term:"Volumetric Weight",def:"Weight calculated based on the dimensions of the package. Lighter but bulky items are charged by this weight.",formula:"(Length × Width × Height) / kFactor (usually 5000)"},{term:"Chargeable Weight",def:"The weight used to calculate the Base Freight. It is the higher of the Actual Weight or Volumetric Weight.",formula:"MAX(Actual Weight, Volumetric Weight)"},{term:"Base Freight",def:"The core transport cost derived from the zone-to-zone rate card.",formula:"Chargeable Weight × Rate per kg"},{term:"Minimum Freight (Min Charge)",def:"The minimum amount a transporter charges for a shipment, regardless of weight.",formula:"If Base Freight < Min Charge, then Min Charge is applied."},{term:"Fuel Surcharge",def:"A variable surcharge to account for fluctuating fuel prices.",formula:"Effective Base Freight × Fuel %"}
11,{term:"Docket Charge",def:"A fixed administrative fee for issuing the consignment note (LR/Docket).",formula:"Fixed Amount"},{term:"ROV (Risk on Value)",def:"Liability coverage for the shipment value (Carrier's Risk).",formula:"MAX(Invoice Value × ROV %, Fixed ROV Amount)"},{term:"ODA (Out of Delivery Area)",def:"Extra charge for deliveries to remote or non-serviceable locations. Mode varies by carrier.",formula:"per_kg_minimum: MAX(perKg × Weight, Min) | weight_band: flat per band | distance_weight_matrix: flat charge by km × kg band"},{term:"Handling Charge",def:"Fee for loading/unloading or special handling of cargo. Mode and threshold vary by carrier.",formula:"per_box: MAX(perBox × numBoxes, Min) | per_kg (≥threshold): MAX(perKg × Weight, Min) | percentage: MAX(variable% × baseFreight, fixed)"},{term:"Appointment Charge",def:"Fee for shipments requiring a specific delivery appointment.",formula:"MAX(Base Freight × Appt %, Fixed Appt Amount)"},{term:"Green Tax",def:"Environmental cess levied by some states (e.g. NGT surcharge for Delhi).",formula:"Fixed Amount per shipment"},{term:"DACC Charges",def:"Delivery Against Consignee Copy — fee collected when POD copy is returned.",formula:"Fixed Amount per shipment"},{term:"OS/OW (Oversize / Overweight)",def:"Mandatory surcharge for shipments exceeding carrier weight thresholds.",formula:"weight_band: flat charge for matching weight band (e.g. ≤75kg: ₹0, 75–200kg: ₹200, >200kg: ₹2000)"}
11,{term:"Single Piece Charge",def:"Per-piece surcharge when an individual item in the shipment is very heavy.",formula:"per_piece_weight_band: chargePerPiece × numBoxes (when avg piece weight ≥ threshold)"},{term:"DOD (Delivery on Demand)",def:"Flat surcharge for on-demand or scheduled delivery slots.",formula:"Fixed Amount per shipment"},{term:"GST",def:"Goods and Services Tax applied on total freight charges (where applicable).",formula:"GST% × Subtotal (only when carrier's GST rate > 0)"},{term:"Invoice Value Charge",def:"Additional surcharge based on total property value.",formula:"MAX(Invoice Value × %, Min Amount)"}];return e.jsx(v,{children:x&&e.jsxs(e.Fragment,{children:[e.jsx(g.div,{initial:{opacity:0},animate:{opacity:.5},exit:{opacity:0},onClick:c,className:"fixed inset-0 bg-black z-40"}),e.jsxs(g.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:25,stiffness:200},className:"fixed top-0 right-0 h-full w-full md:w-[500px] bg-white z-50 shadow-2xl overflow-y-auto flex flex-col",children:[e.jsxs("div",{className:"p-6 sticky top-0 bg-white z-10 border-b border-slate-100",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("h2",{className:"text-xl font-bold text-slate-800 flex items-center gap-2",children:[e.jsx(b,{className:"text-blue-600"}),"Formula Guide"]}),e.jsx("button",{onClick:c,className:"p-2 hover:bg-slate-100 rounded-full transition-colors",children:e.jsx(N,{size:20,className:"text-slate-500"})})]}),e.jsxs("div",{className:"flex p-1 bg-slate-100 rounded-lg",children:[e.jsx("button",{onClick:()=>o("example"),className:`flex-1 py-1.5 text-sm font-medium rounded-md transition-all ${r==="example"?"bg-white text-blue-600 shadow-sm":"text-slate-500 hover:text-slate-700"}`,children:"Worked Example"}),e.jsx("button",{onClick:()=>o("glossary"),className:`flex-1 py-1.5 text-sm font-medium rounded-md transition-all ${r==="glossary"?"bg-white text-blue-600 shadow-sm":"text-slate-500 hover:text-slate-700"}`,children:"A-Z Glossary"})]})]}),e.jsxs("div",{className:"p-6 overflow-y-auto flex-1",children:[r==="example"?e.jsxs("div",{className:"space-y-6 text-sm",children:[e.jsxs("div",{className:"bg-slate-50 border border-slate-200 rounded-xl p-4",children:[e.jsx("h3",{className:"font-bold text-slate-800 mb-1",children:"Current Scenario"}),e.jsxs("p",{className:"text-slate-600",children:["Shipment of ",e.jsxs("span",{className:"font-mono font-bold text-slate-900",children:[s.actualWeight," kg"]})," (Actual) / ",e.jsxs("span",{className:"font-mono font-bold text-slate-900",children:[s.volumetricWeight," kg"]})," (Volumetric)."]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("h4",{className:"font-bold text-slate-900 flex items-center gap-2 border-b border-slate-100 pb-2",children:[e.jsx("span",{className:"bg-blue-100 text-blue-700 w-5 h-5 flex items-center justify-center rounded text-xs",children:"1"}),"Chargeable Weight Logic"]}),e.jsxs("div",{className:"pl-3 border-l-2 border-slate-100 space-y-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"flex justify-between text-slate-500 text-xs uppercase font-bold tracking-wider mb-1",children:"Actual Weight"}),e.jsxs("div",{className:"font-mono text-slate-700",children:[s.actualWeight," kg"]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"flex justify-between text-slate-500 text-xs uppercase font-bold tracking-wider mb-1",children:"Volumetric Weight"}),s.boxes&&s.boxes.length>0&&e.jsxs("div",{className:"bg-white p-2 rounded border border-slate-200 mb-2",children:[e.jsxs("div",{className:"text-[10px] uppercase font-bold text-slate-400 mb-1",children:["Dimensions (",s.boxes.length," ",s.boxes.length===1?"Box":"Boxes",")"]}),e.jsx("div",{className:"space-y-1",children:s.boxes.map((n,i)=>e.jsxs("div",{className:"flex justify-between text-xs text-slate-600 font-mono",children:[e.jsxs("span",{children:[n.length,"×",n.width,"×",n.height]}),e.jsxs("span",{className:"text-slate-400",children:["(",n.count,"x)"]})]},i))})]}),e.jsxs("div",{className:"font-mono text-slate-600 mb-1",children:["(L×B×H) / ",a.kFactor]}),e.jsxs("div",{className:"font-mono text-slate-800",children:["= ",s.volumetricWeight," kg"]})]}),e.jsxs("div",{className:"bg-blue-50 p-3 rounded-lg border border-blue-100",children:[e.jsx("div",{className:"text-blue-800 font-bold mb-1",children:"Chargeable Weight"}),e.jsxs("div",{className:"font-mono text-blue-900",children:["= MAX(",s.actualWeight,", ",s.volumetricWeight,") = ",e.jsxs("b",{children:[s.chargeableWeight," kg"]})]}),e.jsxs("div",{className:"text-xs text-blue-600 mt-1",children:["Checkmark: ",s.actualWeight>=s.volumetricWeight?"Actual":"Volumetric"," Weight Applied"]})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("h4",{className:"font-bold text-slate-900 flex items-center gap-2 border-b border-slate-100 pb-2",children:[e.jsx("span",{className:"bg-blue-100 text-blue-700 w-5 h-5 flex items-center justify-center rounded text-xs",children:"2"}),"Base Freight"]}),e.jsxs("div",{className:"pl-3 border-l-2 border-slate-100 space-y-3",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:"Rate"}),e.jsxs("span",{className:"font-mono",children:[t(a.unitPrice)," / kg"]})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsxs("span",{className:"text-slate-600",children:["Calculated (",s.chargeableWeight," × ",a.unitPrice,")"]}),e.jsx("span",{className:"font-mono",children:t(s.chargeableWeight*a.unitPrice)})]}),e.jsxs("div",{className:"flex justify-between text-slate-400 text-xs",children:[e.jsx("span",{children:"Minimum Floor"}),e.jsx("span",{children:t(a.minCharges)})]}),e.jsxs("div",{className:"border-t border-slate-200 pt-2 flex justify-between font-bold text-slate-800",children:[e.jsx("span",{children:"Effective Base Freight"}),e.jsx("span",{children:t(a.baseFreight)})]}),e.jsx("div",{className:"text-xs text-slate-400 italic",children:"(MAX of Calculated vs Minimum)"})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("h4",{className:"font-bold text-slate-900 flex items-center gap-2 border-b border-slate-100 pb-2",children:[e.jsx("span",{className:"bg-blue-100 text-blue-700 w-5 h-5 flex items-center justify-center rounded text-xs",children:"3"}),"Surcharges"]}),e.jsxs("div",{className:"pl-3 border-l-2 border-slate-100 space-y-3",children:[s.docketCharge>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-700 font-medium",children:"Docket Charge"}),e.jsx("span",{className:"font-mono",children:t(s.docketCharge)})]}),e.jsx("div",{className:"text-xs text-slate-400",children:"Fixed Fee"})]}),s.fuelCharges>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-700 font-medium",children:"Fuel Surcharge"}),e.jsx("span",{className:"font-mono",children:t(s.fuelCharges)})]}),e.jsxs("div",{className:"text-xs text-slate-400",children:[a.fuelPercent,"% × ",t(a.baseFreight)," (Effective Base)"]})]}),s.rovCharges>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-700 font-medium",children:"ROV"}),e.jsx("span",{className:"font-mono",children:t(s.rovCharges)})]}),e.jsxs("div",{className:"text-xs text-slate-400",children:["MAX(",a.rovBasis==="invoice"?"Invoice":"Base Freight"," × ",a.rovPercent,"%, Fixed ",t(a.rovFixed),")"]})]}),(s.breakdown?.odaCharges??s.odaCharges??0)>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-700 font-medium",children:"ODA Charges"}),e.jsx("span",{className:"font-mono",children:t(s.breakdown?.odaCharges??s.odaCharges)})]}),e.jsx("div",{className:"text-xs text-slate-400",children:a.odaConfig?.type==="distance_weight_matrix"?"Distance × Weight matrix lookup":a.odaConfig?.type==="weight_band"?"Weight-band flat charge":`MAX(${a.odaConfig?.variable??0}/kg × Weight, Min ₹)`})]}),(s.breakdown?.handlingCharges??s.handlingCharges??0)>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-700 font-medium",children:"Handling Charges"}),e.jsx("span",{className:"font-mono",children:t(s.breakdown?.handlingCharges??s.handlingCharges)})]}),e.jsx("div",{className:"text-xs text-slate-400",children:a.handlingConfig?.type==="per_box"?`MAX(₹${a.handlingConfig.perBox}/box × boxes, Min ₹${a.handlingConfig.minimum})`:a.handlingConfig?.type==="per_kg_minimum"?`MAX(₹${a.handlingConfig.perKg}/kg × weight, Min ₹${a.handlingConfig.minimum})${a.handlingConfig.thresholdWeight>0?` — only if weight ≥ ${a.handlingConfig.thresholdWeight}kg`:""}`:"Fixed + Variable% of freight"})]}),(s.breakdown?.greenTax??s.greenTax??a.greenTax??0)>0&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-700 font-medium",children:"Green Tax"}),e.jsx("span",{className:"font-mono",children:t(s.breakdown?.greenTax??s.greenTax??a.greenTax)})]}),(s.breakdown?.daccCharges??s.daccCharges??a.daccCharge??0)>0&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-700 font-medium",children:"DACC Charges"}),e.jsx("span",{className:"font-mono",children:t(s.breakdown?.daccCharges??s.daccCharges??a.daccCharge)})]}),(s.breakdown?.hamaliCharges??s.hamaliCharges??a.hamaliCharge??0)>0&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-700 font-medium",children:"Hamali Charges"}),e.jsx("span",{className:"font-mono",children:t(s.breakdown?.hamaliCharges??s.hamaliCharges??a.hamaliCharge)})]}),(s.breakdown?.osOwCharges??s.osOwCharges??a.osOwCharge??0)>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-700 font-medium",children:"OS/OW Charges"}),e.jsx("span",{className:"font-mono",children:t(s.breakdown?.osOwCharges??s.osOwCharges??a.osOwCharge)})]}),e.jsx("div",{className:"text-xs text-slate-400",children:"Oversize/Overweight weight-band surcharge"})]}),(s.breakdown?.singlePieceCharges??s.singlePieceCharges??a.singlePieceCharge??0)>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-700 font-medium",children:"Single Piece Charges"}),e.jsx("span",{className:"font-mono",children:t(s.breakdown?.singlePieceCharges??s.singlePieceCharges??a.singlePieceCharge)})]}),e.jsx("div",{className:"text-xs text-slate-400",children:"Per-piece heavy-item surcharge × no. of pieces"})]}),(s.breakdown?.dodCharges??s.dodCharges??a.dodCharge??0)>0&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-700 font-medium",children:"DOD Charges"}),e.jsx("span",{className:"font-mono",children:t(s.breakdown?.dodCharges??s.dodCharges??a.dodCharge)})]}),(s.breakdown?.gstAmount??s.gstAmount??a.gstAmount??0)>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsxs("span",{className:"text-slate-700 font-medium",children:["GST (",a.gstPercent??18,"%)"]}),e.jsx("span",{className:"font-mono",children:t(s.breakdown?.gstAmount??s.gstAmount??a.gstAmount)})]}),e.jsxs("div",{className:"text-xs text-slate-400",children:[a.gstPercent??18,"% × Subtotal"]})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("h4",{className:"font-bold text-slate-900 flex items-center gap-2 border-b border-slate-100 pb-2",children:[e.jsx("span",{className:"bg-blue-100 text-blue-700 w-5 h-5 flex items-center justify-center rounded text-xs",children:"4"}),"Total"]}),e.jsxs("div",{className:"bg-slate-900 text-white p-4 rounded-xl",children:[e.jsx("div",{className:"flex justify-between items-center mb-2",children:e.jsx("span",{className:"text-slate-400 text-xs",children:"Sum of all components"})}),e.jsxs("div",{className:"font-mono text-xl font-bold flex justify-between items-center",children:[e.jsx("span",{children:"Total"}),e.jsx("span",{children:t(s.totalCharges)})]})]})]})]}):e.jsx("div",{className:"space-y-8",children:l.map((n,i)=>e.jsxs("div",{className:"bg-slate-50 p-4 rounded-xl border border-slate-100",children:[e.jsx("h3",{className:"font-bold text-slate-800 text-lg mb-2",children:n.term}),e.jsx("p",{className:"text-slate-600 text-sm mb-3 leading-relaxed",children:n.def}),e.jsxs("div",{className:"bg-blue-50 text-blue-800 px-3 py-2 rounded-lg text-xs font-mono border border-blue-100 flex items-start gap-2",children:[e.jsx(u,{size:14,className:"mt-0.5 flex-shrink-0"}),e.jsx("span",{children:n.formula})]})]},i))}),e.jsx("div",{className:"mt-8 pt-8 border-t border-slate-200 text-center text-slate-400 text-xs",children:e.jsx("p",{children:"Freight Calculation Standard v2.2"})})]})]})]})})},D=()=>{const x=j(),c=p(),s=x.state?.quote,[r,o]=m.useState(!1),[a,t]=m.useState(!1);if(!s)return e.jsxs("div",{className:"flex flex-col items-center justify-center min-h-screen bg-slate-50",children:[e.jsx("p",{className:"text-slate-500 mb-4",children:"No quote data found."}),e.jsx("button",{onClick:()=>c(-1),className:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700",children:"Go Back"})]});const l=s.formulaParams||{},n=!!s.formulaParams,i=d=>new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",minimumFractionDigits:0,maximumFractionDigits:2}).format(d);return e.jsxs("div",{className:"min-h-screen bg-slate-50 p-4 md:p-8",children:[e.jsx(F,{isOpen:a,onClose:()=>t(!1),quote:s}),e.jsxs("div",{className:"max-w-4xl mx-auto",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("button",{onClick:()=>c(-1),className:"flex items-center text-slate-500 hover:text-slate-800 transition-colors mb-4",children:[e.jsx(w,{size:16,className:"mr-1"})," Back to Results"]}),e.jsxs("div",{className:"flex flex-col md:flex-row md:items-start md:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold text-slate-900 flex items-center gap-2",children:[e.jsx("button",{onClick:()=>t(!0),className:"p-1 hover:bg-blue-50 rounded-full transition-colors",title:"Open Formula Guide",children:e.jsx(C,{className:"text-blue-600"})}),"Calculation Breakdown"]}),e.jsxs("p",{className:"text-slate-500 mt-2",children:["Detailed analysis for ",e.jsx("span",{className:"font-semibold text-slate-700",children:s.companyName})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("button",{onClick:()=>o(!r),className:`flex items-center gap-2 px-4 py-2 rounded-lg border transition-all ${r?"bg-indigo-50 border-indigo-200 text-indigo-700":"bg-white border-slate-200 text-slate-600 hover:bg-slate-50"}`,children:[e.jsx(u,{size:16}),e.jsx("span",{className:"text-sm font-medium",children:r?"Show Values":"Show Logic"})]}),e.jsxs("button",{onClick:()=>t(!0),className:"flex items-center gap-2 px-4 py-2 bg-slate-800 text-white rounded-lg hover:bg-slate-700 transition-colors shadow-sm",children:[e.jsx(b,{size:16}),e.jsx("span",{className:"text-sm font-medium",children:"Formula Guide"})]})]})]})]}),s.companyName==="IndiaPost"?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"bg-white rounded-2xl shadow-sm border border-slate-200 overflow-hidden",children:[e.jsxs("div",{className:"bg-slate-50 px-6 py-4 border-b border-slate-200 flex items-center justify-between",children:[e.jsxs("h3",{className:"font-bold text-slate-800 flex items-center gap-2",children:[e.jsx(h,{size:20,className:"text-slate-400"}),"IndiaPost Service Details"]}
11),e.jsx("div",{className:"text-xs font-mono text-slate-500 bg-white px-2 py-1 rounded border border-slate-200",children:"Postal Pricing"})]}),e.jsxs("div",{className:"p-6 grid grid-cols-1 md:grid-cols-2 gap-8",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-bold text-slate-400 uppercase tracking-widest mb-1",children:"Chargeable Weight"}),e.jsxs("div",{className:"text-2xl font-bold text-blue-600",children:[s.chargeableWeight," ",e.jsx("span",{className:"text-sm text-blue-400",children:"kg"})]}),e.jsxs("div",{className:"text-xs text-slate-500 mt-1",children:["Matched Slab: ",s.matchedWeight||s.chargeableWeight," kg"]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-bold text-slate-400 uppercase tracking-widest mb-1",children:"Calculated Distance"}),e.jsx("div",{className:"text-2xl font-light text-slate-700",children:s.distance}),e.jsxs("div",{className:"text-xs text-slate-500 mt-1",children:["Matched Pricing Bracket: ",s.matchedDistance||parseInt(s.distance)," km"]})]})]})]}),e.jsxs("section",{className:"bg-white rounded-2xl shadow-sm border border-slate-200 overflow-hidden",children:[e.jsx("div",{className:"bg-slate-50 px-6 py-4 border-b border-slate-200",children:e.jsx("h3",{className:"font-bold text-slate-800",children:"Total Freight Calculation"})}),e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("span",{className:"text-slate-600 font-medium",children:"Postal Freight (Weight & Distance Matrix)"}),e.jsx("span",{className:"font-mono text-slate-900",children:i(s.price)})]}),e.jsxs("div",{className:"border-t-2 border-slate-100 mt-6 pt-6 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xl font-extrabold text-slate-900",children:"Total Amount"}),e.jsx("div",{className:"text-xs text-slate-400 mt-1",children:"Flat Rate (Inclusive of all postal surcharges)"})]}),e.jsx("div",{className:"text-3xl font-extrabold text-blue-600",children:i(s.totalCharges)})]})]})]})]}):n?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"bg-white rounded-2xl shadow-sm border border-slate-200 overflow-hidden",children:[e.jsxs("div",{className:"bg-slate-50 px-6 py-4 border-b border-slate-200 flex items-center justify-between",children:[e.jsxs("h3",{className:"font-bold text-slate-800 flex items-center gap-2",children:[e.jsx(h,{size:20,className:"text-slate-400"}),"Step 1: Weight Logic"]}),e.jsx("div",{className:"text-xs font-mono text-slate-500 bg-white px-2 py-1 rounded border border-slate-200",children:"Chargeable = MAX(Actual, Volumetric)"})]}),e.jsxs("div",{className:"p-6 grid grid-cols-1 md:grid-cols-3 gap-8",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-bold text-slate-400 uppercase tracking-widest mb-1",children:"Actual Weight"}),e.jsxs("div",{className:"text-2xl font-light text-slate-700",children:[s.actualWeight," ",e.jsx("span",{className:"text-sm text-slate-400",children:"kg"})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"text-xs font-bold text-slate-400 uppercase tracking-widest mb-1",children:"Volumetric Weight"}),e.jsx("div",{className:"text-2xl font-light text-slate-700",children:r?e.jsxs("span",{className:"text-sm font-mono text-indigo-600",children:["(L×B×H)/",l.kFactor]}):e.jsxs("span",{children:[s.volumetricWeight," ",e.jsx("span",{className:"text-sm text-slate-400",children:"kg"})]})}),e.jsxs("div",{className:"text-xs text-slate-400 mt-1 font-mono",children:["Divisor (kFactor): ",l.kFactor]}),s.volumetricWeight>s.actualWeight&&e.jsx("div",{className:"absolute top-0 right-0",children:e.jsx("span",{className:"bg-blue-100 text-blue-700 text-[10px] font-bold px-2 py-1 rounded uppercase tracking-wide",children:"Applied"})})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-3xl font-bold text-blue-600",children:[s.chargeableWeight," ",e.jsx("span",{className:"text-lg text-blue-400",children:"kg"})]}),s.minWeightApplied&&e.jsxs("div",{className:"mt-1 text-amber-500 font-bold text-xs",children:["Minimum Weight : ",s.minWeight," kgs"]}),e.jsxs("div",{className:"text-xs text-green-600 mt-2 font-medium flex items-center gap-1",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-green-500"}),s.minWeightApplied?"Transporter Minimum Weight Applied":s.actualWeight>=s.volumetricWeight?"Actual Weight Applied":"Volumetric Weight Applied"]})]})]})]}),e.jsxs("section",{className:"bg-white rounded-2xl shadow-sm border border-slate-200 overflow-hidden",children:[e.jsx("div",{className:"bg-slate-50 px-6 py-4 border-b border-slate-200",children:e.jsx("h3",{className:"font-bold text-slate-800",children:"Step 2: Base Freight Calculation"})}),e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("span",{className:"text-slate-600 font-medium",children:"Zone Rate (per kg)"}),e.jsx("span",{className:"font-mono text-slate-900",children:i(l.unitPrice)})]}),e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("span",{className:"text-slate-600 font-medium",children:["Chargeable ",s.minWeightApplied?"(Min) Weight":"Weight"]}),e.jsxs("span",{className:"font-mono text-slate-900",children:["× ",s.finalWeight||s.chargeableWeight]})]}),e.jsxs("div",{className:"flex items-center justify-between mb-6 pb-6 border-b border-slate-100",children:[e.jsx("span",{className:"text-slate-600 font-medium",children:"Min Freight Floor"}),e.jsx("span",{className:"font-mono text-slate-500",children:i(l.minCharges||0)})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 bg-slate-50 rounded-xl",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-bold text-slate-800",children:"Effective Base Freight"}),e.jsx("span",{className:"text-xs text-slate-500 font-mono mt-1",children:"MAX(Calculated, Min)"})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("div",{className:"font-bold text-xl text-slate-900",children:r?e.jsxs("span",{className:"font-mono text-lg text-indigo-600",children:["MAX(",l.unitPrice*(s.finalWeight||s.chargeableWeight),", ",l.minCharges,")"]}):i(l.effectiveBaseFreight||l.baseFreight)}),l.baseFreight<=l.minCharges&&l.minCharges>0&&e.jsx("div",{className:"text-xs text-amber-600 mt-1 font-medium",children:"Minimum Floor Applied"})]})]})]})]}),e.jsxs("section",{className:"bg-white rounded-2xl shadow-sm border border-slate-200 overflow-hidden",children:[e.jsxs("div",{className:"bg-slate-50 px-6 py-4 border-b border-slate-200 flex justify-between items-center",children:[e.jsx("h3",{className:"font-bold text-slate-800",children:"Step 3: Surcharges & Additional Fees"}),r&&e.jsx("span",{className:"text-xs text-indigo-600 font-medium px-2 py-1 bg-indigo-50 rounded",children:"Logic View Active"})]}),e.jsxs("div",{className:"p-6 space-y-5",children:[s.docketCharge>0&&e.jsxs("div",{className:"flex items-start justify-between group",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-slate-700 font-bold",children:"Docket Charge"}),e.jsx("div",{className:"text-xs text-slate-400 mt-0.5",children:"Fixed administrative fee"})]}),e.jsx("div",{className:"font-mono text-slate-900 font-medium",children:r?e.jsx("span",{className:"text-indigo-600",children:"Fixed"}):i(s.docketCharge)})]}),s.fuelCharges>0&&e.jsxs("div",{className:"flex items-start justify-between group",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"text-slate-700 font-bold flex items-center gap-1.5",children:[e.jsx(k,{size:14,className:"text-slate-400"}),"Fuel Surcharge"]}),e.jsxs("div",{className:"text-xs text-slate-400 mt-0.5",children:[l.fuelPercent,"% of Effe
11ctive Base Freight"]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("div",{className:"font-mono text-slate-900 font-medium",children:r?e.jsxs("span",{className:"text-indigo-600 text-sm",children:[i(l.baseFreight)," × ",l.fuelPercent,"%"]}):i(s.fuelCharges)}),!r&&e.jsxs("div",{className:"text-xs text-slate-400 mt-0.5",children:[l.fuelPercent,"% of Base Freight"]})]})]}),s.rovCharges>0&&e.jsxs("div",{className:"flex items-start justify-between group",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-slate-700 font-bold",children:"ROV (Risk on Value)"}),e.jsx("div",{className:"text-xs text-slate-400 mt-0.5",children:"Carrier's risk liability (on Invoice Value)"})]}),e.jsx("div",{className:"text-right",children:e.jsx("div",{className:"font-mono text-slate-900 font-medium",children:r?e.jsxs("span",{className:"text-indigo-600 text-sm",children:["MAX(Invoice Value × ",l.rovPercent,"%, Fixed ",i(l.rovFixed),")"]}):i(s.rovCharges)})})]}),s.odaCharges>0&&e.jsxs("div",{className:"flex items-start justify-between group",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-slate-700 font-bold",children:"ODA Charge"}),e.jsx("div",{className:"text-xs text-slate-400 mt-0.5",children:"Out of Delivery Area Surcharge"})]}),e.jsx("div",{className:"text-right",children:e.jsx("div",{className:"font-mono text-slate-900 font-medium",children:r?e.jsxs("span",{className:"text-indigo-600 text-sm",children:[i(l.odaConfig.fixed)," + (",s.chargeableWeight," × ",l.odaConfig.variable,"%)"]}):i(s.odaCharges)})})]}),s.invoiceValueCharge>0&&e.jsxs("div",{className:"flex items-start justify-between group",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-slate-700 font-bold",children:"Invoice Value Charge"}),e.jsx("div",{className:"text-xs text-slate-400 mt-0.5",children:"Based on declared value"})]}),e.jsx("div",{className:"text-right",children:e.jsx("div",{className:"font-mono text-slate-900 font-medium",children:r?e.jsx("span",{className:"text-indigo-600 text-sm",children:"MAX(Invoice × %, Min)"}):i(s.invoiceValueCharge)})})]}),[{label:"Green Tax",val:s.greenTax??s.breakdown?.greenTax,form:"Fixed"},{label:"Handling",val:s.handlingCharges??s.breakdown?.handlingCharges,form:"Fixed + (Wt × Var%)"},{label:"Appointment",val:s.appointmentCharges??s.breakdown?.appointmentCharges,form:"Base × %"},{label:"DACC",val:s.daccCharges??s.breakdown?.daccCharges,form:"Fixed"},{label:"Misc",val:s.miscCharges??s.breakdown?.miscCharges,form:"Fixed"},{label:"Insurance",val:s.insuaranceCharges??s.breakdown?.insuaranceCharges,form:"Base × %"},{label:"FM Charges",val:s.fmCharges??s.breakdown?.fmCharges,form:"Base × %"},{label:"COD",val:s.codCharges??s.breakdown?.codCharges,form:"MAX(Base × %, Fixed)"},{label:"To-Pay",val:s.topayCharges??s.breakdown?.topayCharges,form:"MAX(Base × %, Fixed)"},{label:"Hamali",val:s.hamaliCharges??s.breakdown?.hamaliCharges,form:"Fixed"},{label:"Custom Surcharges",val:s.customSurcharges??s.breakdown?.customSurcharges,form:"Vendor-specific"}].filter(d=>d.val>0).map(d=>e.jsxs("div",{className:"flex items-start justify-between group",children:[e.jsx("div",{className:"text-slate-700 font-bold",children:d.label}),e.jsx("div",{className:"font-mono text-slate-900 font-medium",children:r?e.jsx("span",{className:"text-indigo-600 text-sm",children:d.form}):i(d.val)})]},d.label)),e.jsxs("div",{className:"border-t-2 border-slate-100 mt-6 pt-6 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xl font-extrabold text-slate-900",children:"Total Amount"}),e.jsx("div",{className:"text-xs text-slate-400 mt-1",children:"Inclusive of all surcharges"})]}),e.jsx("div",{className:"text-3xl font-extrabold text-blue-600",children:i(s.totalCharges)})]})]})]})]}):e.jsxs("div",{className:"bg-white p-12 rounded-2xl shadow-sm text-center border border-dashed border-slate-300",children:[e.jsx(y,{className:"w-12 h-12 text-slate-300 mx-auto mb-4"}),e.jsx("h3",{className:"text-xl font-semibold text-slate-700",children:"Detailed Breakdown Not Available"}),e.jsx("p",{className:"text-slate-500 mt-2 max-w-md mx-auto",children:"This quote was calculated using an older method or external service that does not utilize the detailed formula engine."})]})]})]})};export{D 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.