1const m={Frontend:"frontend",Backend:"backend",DevOps:"devops","UI/Figma":"uiFigma",QA:"qa",PM:"pm"};function N(t){return Math.round(Number(t.frontend||0)+Number(t.backend||0)+Number(t.devops||0)+Number(t.uiFigma||0)+Number(t.qa||0)+Number(t.pm||0))}function O(t,n){let o=0;for(const[a,r]of Object.entries(m))o+=Number(t[r]||0)*f(n,a);return o}function v(t){return t.map(n=>({...n,totalHours:N(n)}))}function f(t,n){return t.find(o=>o.role===n)?.hourlyRate??0}function F(t){const n=t.roleRates??[],o=t.engagementConstraints?.activePhaseId||t.engagementConstraints?.phases?.find(e=>e.status==="active")?.id,a=(t.engagementConstraints?.phases?.length??0)>0,r=e=>!a||!e.phaseId?!0:e.phaseId===o;let u=0,h=0,d=0,p=0;const b=[],i={};for(const e of Object.keys(m))i[e]=0;for(const e of t.featureEstimates??[]){const s=N(e);if(!r(e)){d+=s,p+=O(e,n);continue}h+=s;for(const[c,H]of Object.entries(m)){const g=Number(e[H]||0);i[c]+=g,u+=g*f(n,c)}}for(const[e,s]of Object.entries(i)){const c=s*f(n,e);b.push({role:e,hours:Math.round(s),cost:c,pct:u>0?c/u*100:0})}const l=u,M=t.discountMode==="flat"?Math.max(0,t.discountValue||0):l*(t.discountValue||0)/100,R=Math.max(0,l-M),C=(t.paymentMilestones??[]).reduce((e,s)=>e+(s.percentage||0),0),y=(t.paymentMilestones??[]).reduce((e,s)=>e+(s.amount||0),0);return{totalHours:Math.round(h),futureHours:Math.round(d),futureCost:p,laborCost:u,subtotal:l,discountAmount:M,grandTotal:R,roleBreakdown:b,milestonePct:C,milestoneAmt:y}}function P(t,n){return t.map(o=>({...o,amount:Math.round(n*(o.percentage||0)/100*100)/100}))}function k(t,n){const o=Number(n);if(!Number.isFinite(o)||o<=0)return t;const a=Math.min(1,Math.max(.01,o));return t.map(r=>({...r,hourlyRate:Math.max(.01,Math.round((Number(r.hourlyRate)||0)*a*100)/100)}))}export{N as a,O as b,F as c,f as d,k as r,P as s,v as w};
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.