1import{n as f}from"./leadAiScore-DLZA4zjJ.js";import{n as A}from"./phoneUtils-BNyk9-6c.js";function d(e){if(e==null||e==="")return;const t=Number(e);return Number.isFinite(t)?t:void 0}function o(e){return typeof e=="string"?e:e!=null?String(e):""}function v(e){const t=o(e).trim();if(t)return t.slice(0,10)}const N=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function p(e){return!!(e?.trim()&&N.test(e.trim()))}function U(e,t){const n=(e??"").trim();return n&&!p(n)?n:""}function C(e){return Array.isArray(e)?e.map(t=>String(t)):e&&typeof e=="object"?Object.keys(e):[]}function T(e){return Array.isArray(e)?e:[]}function P(e){return e.map(t=>({id:t.id??`att-${t.url}`,name:t.name,url:t.url,kind:t.kind==="link"?"link":"file",size:t.size,uploadedAt:t.uploadedAt??new Date().toISOString(),uploadedById:t.uploadedById??""}))}function w(e){return{id:e.id,leadId:e.leadId,type:e.type,subject:e.subject,description:e.description,outcome:e.outcome,nextStep:e.nextStep,nextFollowUp:e.nextFollowUp,date:String(e.activityDate).slice(0,10),duration:e.duration,byId:e.byUserId}}function D(e){return{id:e.id,leadId:e.leadId,title:e.title,type:e.type,assigneeId:e.assigneeUserId,dueDate:String(e.dueDate).slice(0,10),priority:e.priority??"Medium",status:e.status}}function R(e){const t=(e??"").trim().split(/\s+/).filter(Boolean);return t.length?t.length===1?{firstName:t[0],lastName:""}:{firstName:t[0],lastName:t.slice(1).join(" ")}:{firstName:"",lastName:""}}function h(e){return{id:e.id,noteType:e.noteType??"text",text:e.text??"",audioUrl:e.audioUrl,audioDurationSeconds:e.audioDurationSeconds,transcript:e.transcript,transcriptStatus:e.transcriptStatus,transcriptError:e.transcriptError,byId:e.byUserId,createdAt:typeof e.createdAt=="string"?e.createdAt:String(e.createdAt),byName:e.actor?.fullName,byInitials:e.actor?.initials,byAvatar:e.actor?.avatar}}function j(e,t){const n=o(e.title)||"Untitled",c=U(e.companyName,e.companyId),s=o(e.contactName).trim(),i=s&&!p(s)?s:"",r=i?i.split(/\s+/):[],a=r[0]??"",u=r.slice(1).join(" "),l=o(e.source)||"Other",m=o(e.priority)||"",y=d(e.budget),g=o(e.budgetCurrency)||"USD",I=v(e.followUpDate)||v(e.lastContactedAt?String(e.lastContactedAt):void 0),b=typeof e.createdAt=="string"?e.createdAt:e.createdAt!=null?String(e.createdAt):"",S=f(e.score,o(e.source)||void 0);return{id:e.id,title:n,company:c,firstName:a,lastName:u,sourcePlatform:l,sourceAccountId:e.sourceAccountId,sourceAccountLabel:e.sourceAccountLabel??void 0,sourceUrl:e.sourceUrl||void 0,jobUrl:o(e.jobUrl||e.jobUrl)||void 0,status:e.status??"new",priority:m,assigneeId:e.assignedToUserId??"",team:e.team??null,teamId:e.teamId??null,estimatedValue:y,budgetCurrency:g,aiScore:S,followUpDate:I,createdAt:b,convertedDealId:e.convertedDealId??null,convertedPartnerId:e.convertedPartnerId??null,convertedInvestorId:e.convertedInvestorId??null,companyRevenue:e.companyRevenue??null,companyCurrency:e.companyCurrency??null,companyClientSpending:e.companyClientSpending??null,companyClientRating:e.companyClientRating??null,companyHiringRate:e.companyHiringRate??null,companyBudget:e.companyBudget??null,customFields:e.customFields??null,isFavorite:e.isFavorite??!1}}function k(e,t){const n=e.company,c=e.contact,s=o(e.title)||"Untitled",i=n?.name??U(t,e.companyId)??"",{firstName:r,lastName:a}=R(c?.name),u=o(e.description)||"",l=C(e.techStack),m=Array.isArray(e.tags)?e.tags:Array.isArray(n?.tags)?n.tags:[],y=(e.activities??[]).map(w),g=(e.tasks??[]).map(D),I=(e.leadNotes??[]).map(h);return{id:e.id,sourcePlatform:o(e.source)||"Other",sourceAccountId:e.sourceAccountId,sourceAccountLabel:e.sourceAccountLabel??void 0,sourceUrl:e.sourceUrl||void 0,leadType:o(e.leadType)||"Inbound",jobUrl:o(e.jobUrl)||void 0,jobTitle:o(e.jobTitle)||void 0,bidAmount:d(e.bidAmount),contractType:e.contractType,company:i,companyWebsite:n?.website||void 0,companyPersona:o(e.companyPersona)||void 0,industry:n?.industry||o(e.industry)||"",companySize:n?.size||void 0,country:n?.country||"",state:n?.state||void 0,city:n?.city||void 0,firstName:r,lastName:a,email:c?.email||"",phone:c?.phone?A(c.phone,n?.country):void 0,designation:c?.designation||void 0,linkedin:c?.linkedin||void 0,whatsapp:c?.whatsapp?A(c.whatsapp,n?.country):void 0,timezone:c?.timezone||"IST",preferredContact:c?.preferredContact||"",title:s,description:u,projectType:o(e.projectType)||"Web App",techStack:l,budget:d(e.budget),budgetCurrency:o(e.budgetCurrency)||n?.currency||"USD",budgetType:o(e.budgetType)||"",timeline:o(e.timeline)||void 0,complexity:o(e.complexity)||"",priority:o(e.priority)||"",estimatedValue:d(e.budget),assigneeId:e.assignedToUserId??"",assignedToUserId:e.assignedToUserId??void 0,assignedToUser:e.assignedToUser??void 0,assigneeName:e.assigneeName??e.assignedToUser?.name??e.assignedToUser?.fullName??e.assignedToUser?.email??void 0,followUpPersonId:o(e.followUpPersonId)||void 0,followerIds:Array.isArray(e.followerIds)?e.followerIds:[],team:o(e.team)||void 0,followUpDate:v(e.followUpDate),tags:m,internalNotes:typeof e.notes=="string"?e.notes:"",attachments:T(e.attachments),notes:I,activities:y,tasks:g,status:e.status??"new",aiScore:f(e.score,o(e.source)||void 0),createdAt:typeof e.createdAt=="string"?e.createdAt.slice(0,10):String(e.createdAt??"").slice(0,10),createdById:"p1",negotiationValue:d(e.negotiationValue),discountMode:e.discountMode,discountValue:d(e.discountValue),discountAmount:d(e.discountAmount),discountApprovalStatus:e.discountApprovalStatus,discountReason:o(e.discountReason)||void 0,lastActivityAt:typeof e.updatedAt=="string"?e.updatedAt.slice(0,10):String(e.updatedAt??"").slice(0,10),convertedDealId:e.convertedDealId??null,convertedPartnerId:e.convertedPartnerId??null,convertedInvestorId:e.convertedInvestorId??null,customFields:e.customFields??null,isFavorite:e.isFavorite??!1}}function z(e){return{id:e.id,title:e.title,companyId:e.companyId??void 0,contactId:e.contactId??void 0,assignedToUserId:e.assignedToUserId??void 0,source:e.source||e.originalLeadSource||e.discoverySource||"Other",sourceAccountId:e.sourceAccountId??void 0,sourceAccountLabel:e.sourceAccountLabel??void 0,priority:e.priority??"Medium",status:e.stageSlug||"new",stageId:e.partnershipStageId??void 0,notes:e.notes??void 0,description:e.description??void 0,isFavorite:e.isFavorite,tags:e.tags??void 0,customFields:e.customFields??void 0,followUpPersonId:e.followUpPersonId??void 0,followUpDate:e.followUpDate??void 0,followerIds:e.followerIds??void 0,team:e.team??void 0,lastContactedAt:e.lastContactedAt??void 0,companyName:e.companyName??void 0,contactName:e.contactName??void 0,companyRevenue:e.companyRevenue??null,companyCurrency:e.companyCurrency??null,createdAt:e.createdAt,updatedAt:e.updatedAt,recordCategory:"partner",score:0,company:e.companyId?{id:e.companyId,name:e.companyName??"",revenue:e.companyRevenue??void 0,currency:e.companyCurrency??void 0,clientSpending:e.companyClientSpending??void 0,clientRating:e.companyClientRating??void 0,hiringRate:e.companyHiringRate??void 0,budget:e.companyBudget??void 0}:null}}function x(e){return{id:e.id,title:e.title,companyId:e.companyId??void 0,contactId:e.contactId??void 0,assignedToUserId:e.assignedToUserId??void 0,source:e.source||e.originalLeadSource||"Other",sourceAccountId:e.sourceAccountId??void 0,sourceAccountLabel:e.sourceAccountLabel??void 0,priority:e.priority??"Medium",status:e.stageSlug||"new",stageId:e.investmentStageId??void 0,notes:e.notes??void 0,description:e.description??void 0,isFavorite:e.isFavorite,tags:e.tags??void 0,customFields:e.customFields??void 0,followUpPersonId:e.followUpPersonId??void 0,followUpDate:e.followUpDate??void 0,followerIds:e.followerIds??void 0,team:e.team??void 0,lastContactedAt:e.lastContactedAt??void 0,companyName:e.companyName??void 0,contactName:e.contactName??void 0,companyRevenue:e.companyRevenue??null,companyCurrency:e.companyCurrency??null,createdAt:e.createdAt,updatedAt:e.updatedAt,recordCategory:"investor",score:0,company:e.companyId?{id:e.companyId,name:e.companyName??"",revenue:e.companyRevenue??void 0,currency:e.companyCurrency??void 0,clientSpending:e.companyClientSpending??void 0,clientRating:e.companyClientRating??void 0,hiringRate:e.companyHiringRate??void 0,budget:e.companyBudget??void 0}:null}}export{j as a,D as b,P as c,z as d,x as e,p as i,k as m};
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.