1const f=[{role:"Frontend",hourlyRate:45},{role:"Backend",hourlyRate:50},{role:"DevOps",hourlyRate:55},{role:"UI/Figma",hourlyRate:40},{role:"QA",hourlyRate:35},{role:"PM",hourlyRate:60}],R="Full source code ownership transferred to client upon final payment. We retain the right to showcase the project in our portfolio unless an NDA is signed.",S={problemSummary:"",mvpBoundary:{included:[],excluded:[]},projectSummary:"",pricingType:"hourly",fixedPrice:0,functionalRequirements:[],featureEstimates:[],roleRates:[...f],staffingAllocations:[],staffingStacks:[],ratesSource:"default",engagementConstraints:{phases:[],askedOnce:!1},constraintFit:{maxHours:null,maxCost:null,estimatedHours:0,estimatedCost:0,fits:!0,formula:"",gapNote:"",deferredFeatures:[],flaggedFeatures:[],reconciled:!1},budgetFit:{note:""},discountMode:"percent",discountValue:0,discountPercent:0,discountFlat:0,discountReason:"",paymentMilestones:[],weeklyTimeline:[],techStackJustification:[],included:[],excluded:[],risks:[],whyChooseUs:[],assumptions:"",paymentTerms:"",revisionPolicy:"",outOfScope:"",intellectualProperty:R,frCustomColumns:[],featureCustomColumns:[],customFields:[],customSections:[]};function v(t){return(t?.functionalRequirements??[]).some(s=>!!s.module?.trim()||!!s.description?.trim())}const b="ESTIMATION_NEEDS_CHAT",P="crm-estimation-open-chat";function E(t){typeof window>"u"||window.dispatchEvent(new CustomEvent(P,{detail:{leadId:t}}))}function I(t){const s=t?.data;if(!s)return!1;if(s.code===b)return!0;const e=s.message;return!!(e&&typeof e=="object"&&e.code===b)}function h(t,s=0){return`stack-${t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||s+1}`}function x(t){const s=t??[],e=f.map(n=>{const r=s.find(c=>c.role.trim().toLowerCase()===n.role.toLowerCase());return{label:n.role,hourlyRate:r?Number(r.hourlyRate)||0:n.hourlyRate}});for(const n of s){const r=n.role.trim();r&&(e.some(c=>c.label.toLowerCase()===r.toLowerCase())||e.push({label:r,hourlyRate:Number(n.hourlyRate)||0}))}return e.map((n,r)=>({id:h(n.label,r),label:n.label,hourlyRate:n.hourlyRate,members:[]}))}function F(t,s){const e=(s?.length?s:f).find(n=>n.role.trim().toLowerCase()===t.trim().toLowerCase());return e&&Number(e.hourlyRate)||0}function d(t){return Math.round(t*100)/100}function N(t){const s=t.members??[];if(s.length<2)return!1;const e=Number(t.hourlyRate);return!Number.isFinite(e)||e<=0?!1:s.every(n=>{const r=Number(n.estimationHourlyRateUsd);return Number.isFinite(r)&&Math.abs(r-e)<.001})}function w(t,s){const e=(t.members??[]).map(l=>({...l}));if(!e.length){const l=Number(t.hourlyRate),o=t.hourlyRate!=null&&Number.isFinite(l)?d(Math.max(0,l)):d(Math.max(0,F(t.label,s)));return{...t,hourlyRate:o,members:[]}}const n=N(t),r=e.map(l=>{const o=Math.max(0,Number(l.minimumHourlyRateUsd)||0);let a=Number(l.estimationHourlyRateUsd);n?a=o>0?o:Number.isFinite(a)&&a>0?a:o:(!Number.isFinite(a)||a<0)&&(a=o);const u=d(Math.max(0,a)),i=Math.max(0,Number(l.estimatedHours)||0);return{...l,estimationHourlyRateUsd:u,estimatedHours:i,internalEstimatedCostUsd:d(u*i)}}),c=r.length===1?d(r[0].estimationHourlyRateUsd):d(r.reduce((l,o)=>l+(Number(o.estimationHourlyRateUsd)||0),0));return{...t,hourlyRate:c,members:r}}function g(t,s){const e=x(s),n=l=>l.map(o=>w(o,s));if(!t.length)return e;const r=new Set(t.map(l=>l.label.trim().toLowerCase()));return e.some(l=>r.has(l.label.toLowerCase()))?n(t):[...e,...n(t)]}function k(t,s,e){const n=(t?.length?t:f).map(o=>({...o})),r=new Map(s.map(o=>[o.id,o]));for(const o of e){const a=Number(o.hourlyRate),u=Number.isFinite(a)?a:0,i=o.label.trim();if(!i)continue;const m=r.get(o.id);if(m&&m.label!==i){const p=n.findIndex(C=>C.role===m.label);if(p>=0){n[p]={role:i,hourlyRate:u};continue}}const y=n.findIndex(p=>p.role.toLowerCase()===i.toLowerCase());y>=0?n[y]={...n[y],hourlyRate:u}:n.push({role:i,hourlyRate:u})}const c=new Set(e.map(o=>o.label.trim().toLowerCase())),l=new Set(s.filter(o=>!e.some(a=>a.id===o.id)).map(o=>o.label.trim().toLowerCase()));return n.filter(o=>{const a=o.role.trim().toLowerCase();return!(l.has(a)&&!c.has(a))})}function L(t){const s=t?.roleRates?.length?t.roleRates:f,e=Array.isArray(t?.staffingStacks)?t.staffingStacks:[],n=(o,a,u)=>(o??[]).filter(i=>i?.employeeId).map(i=>({...i,id:String(i.id||`staff-${i.employeeId}`),employeeId:String(i.employeeId),employeeName:String(i.employeeName??""),role:String(i.role??""),stackId:a,stackLabel:u,minimumHourlyRateUsd:Math.max(0,Number(i.minimumHourlyRateUsd)||0),estimationHourlyRateUsd:Math.max(0,Number(i.estimationHourlyRateUsd)||Number(i.minimumHourlyRateUsd)||0),estimatedHours:Math.max(0,Number(i.estimatedHours)||0)}));if(e.length>0){const o=e.map((a,u)=>{const i=String(a?.id||h(String(a?.label??""),u)),m=String(a?.label??"").trim()||`Stack ${u+1}`;return{id:i,label:m,hourlyRate:a?.hourlyRate,members:n(a?.members,i,m)}});return g(o,s)}const r=Array.isArray(t?.staffingAllocations)?t.staffingAllocations:[];if(!r.length)return g([],s);const c=new Map;for(const o of r){if(!o?.employeeId)continue;const a=String(o.stackLabel||o.teamLabel||"Staffing").trim()||"Staffing",u=c.get(a)??[];u.push(o),c.set(a,u)}const l=Array.from(c.entries()).map(([o,a],u)=>{const i=h(o,u);return{id:i,label:o,hourlyRate:void 0,members:n(a,i,o)}});return g(l,s)}function A(t){const s=[],e=new Set;for(const n of t??[])for(const r of n.members??[]){if(!r?.employeeId)continue;const c=`${n.id}::${r.employeeId}`;e.has(c)||(e.add(c),s.push({...r,stackId:n.id,stackLabel:n.label,estimationHourlyRateUsd:Math.max(0,Number(r.estimationHourlyRateUsd)||Number(r.minimumHourlyRateUsd)||0)}))}return s}function H(t){const s=t&&typeof t=="object"?t:{},e={...S,...s};let n=e.discountMode??"percent",r=e.discountValue??0;return s.discountMode===void 0&&((s.discountFlat??0)>0?(n="flat",r=Number(s.discountFlat)||0):(n="percent",r=Number(s.discountPercent)||0)),{...e,problemSummary:e.problemSummary??"",mvpBoundary:{included:e.mvpBoundary?.included??[],excluded:e.mvpBoundary?.excluded??[]},budgetFit:{note:e.budgetFit?.note??""},engagementConstraints:{phases:e.engagementConstraints?.phases??[],askedOnce:!!e.engagementConstraints?.askedOnce,timelineDays:e.engagementConstraints?.timelineDays,timelineLabel:e.engagementConstraints?.timelineLabel,hoursPerDay:e.engagementConstraints?.hoursPerDay,developerCount:e.engagementConstraints?.developerCount,clientBudget:e.engagementConstraints?.clientBudget,budgetCurrency:e.engagementConstraints?.budgetCurrency,budgetType:e.engagementConstraints?.budgetType,roleRatesOverride:e.engagementConstraints?.roleRatesOverride,activePhaseId:e.engagementConstraints?.activePhaseId},constraintFit:{maxHours:e.constraintFit?.maxHours??null,maxCost:e.constraintFit?.maxCost??null,estimatedHours:Number(e.constraintFit?.estimatedHours)||0,estimatedCost:Number(e.constraintFit?.estimatedCost)||0,fits:e.constraintFit?.fits!==!1,formula:e.constraintFit?.formula??"",gapNote:e.constraintFit?.gapNote??"",deferredFeatures:e.constraintFit?.deferredFeatures??[],flaggedFeatures:e.constraintFit?.flaggedFeatures??[],reconciled:!!e.constraintFit?.reconciled}
1,ratesSource:e.ratesSource==="rate_card"?"rate_card":e.ratesSource==="default"?"default":e.ratesSource,discountMode:n,discountValue:r,fixedPrice:Number(e.fixedPrice)||0,discountPercent:n==="percent"?r:0,discountFlat:n==="flat"?r:0,...(()=>{const c=L(e),l=A(c),o=k(e.roleRates?.length?e.roleRates:f,c,c);return{staffingStacks:c,staffingAllocations:l,roleRates:o}})(),paymentMilestones:e.paymentMilestones??[],weeklyTimeline:e.weeklyTimeline??[],techStackJustification:e.techStackJustification??[],included:e.included??[],excluded:e.excluded??[],risks:e.risks??[],whyChooseUs:e.whyChooseUs??[],assumptions:e.assumptions??"",paymentTerms:e.paymentTerms??"",revisionPolicy:e.revisionPolicy??"",outOfScope:e.outOfScope??"",intellectualProperty:e.intellectualProperty||R,frCustomColumns:e.frCustomColumns??[],featureCustomColumns:e.featureCustomColumns??[],customFields:e.customFields??[],customSections:e.customSections??[]}}const M=[{key:"chatbot",label:"Lead chatbot (Aria)",description:"Landing assistant â tone, services, qualification.",contextPlaceholder:"Company name, services, target clients, tone, SLAâ¦",instructionsPlaceholder:"e.g. One question at a time. Never quote exact pricing without a call."},{key:"lead_insights",label:"Lead AI insights & scoring",description:"Win probability, risks, suggestions, and lead score on detail page.",contextPlaceholder:"ICP, hot-lead criteria, SLAs, stage definitionsâ¦",instructionsPlaceholder:"e.g. Weight budget + engagement. Suggest concrete next steps."},{key:"estimation_fr",label:"Estimation â FR & scope",description:"Problem summary, MVP boundary, functional requirements, and complexity.",contextPlaceholder:"Project types, discovery process, typical modulesâ¦",instructionsPlaceholder:"e.g. Only estimate what the lead describes. Prefer fewer precise FRs."},{key:"estimation",label:"Estimation â hours",description:"Feature hour estimates, budget fit, and pricing.",contextPlaceholder:"Hourly bands, role mix, sprint length, buffer policyâ¦",instructionsPlaceholder:"e.g. Keep hours consistent with complexity. Respect client budget when realistic."},{key:"proposals",label:"Proposals",description:"Proposal copy and client-facing language.",contextPlaceholder:"Brand voice, payment terms, support policyâ¦",instructionsPlaceholder:"e.g. Professional tone. Include timeline + milestones."},{key:"upwork_proposal",label:"Upwork proposals",description:"Cover letters and proposal drafts for Upwork marketplace jobs.",contextPlaceholder:"Freelancer profile, skills, portfolio, tone, case studiesâ¦",instructionsPlaceholder:"e.g. Under 300 words. Ask 1â2 questions. Plain text only."},{key:"lead_cover_letter",label:"Lead cover letter",description:"Initial pitch on Lead Detail after client intelligence analysis.",contextPlaceholder:"Studio positioning, services, industries, proof you may citeâ¦",instructionsPlaceholder:"e.g. Start a conversation. No pricing tables. Ask for a discovery call."},{key:"automations",label:"Automations",description:"CRM automation AI context.",contextPlaceholder:"Lead SLA, follow-up cadence, stage rulesâ¦",instructionsPlaceholder:"e.g. Hot leads â notify assignee within 1 hour."},{key:"personal",label:"Personal / portfolio",description:"Outreach and portfolio AI context.",contextPlaceholder:"Your expertise, portfolio highlights, outreach styleâ¦",instructionsPlaceholder:"e.g. Under 120 words. One relevant case study."},{key:"resume_ats",label:"Resume ATS scoring",description:"ATS readiness score in Job Portal â Resume Optimizer.",contextPlaceholder:"Hiring roles, must-have sections, keyword expectations, ATS pitfallsâ¦",instructionsPlaceholder:"e.g. Penalize missing metrics. Prefer parseable single-column clarity."}];export{M as A,f as D,S as E,P as a,E as b,x as d,A as f,v as h,I as i,H as n,w as r,k as s};
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.