PageSourceSearch

https://indiancaucus.org/_next/static/chunks/pages/app/admin/contact/[id]-20ddb46e55a38097.js

js indiancaucus.org collected 2026-09-24 14:26:48 UTC 20,661 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7978],{24210:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>f});var s=a(37876),n=a(14232),r=a(89099),l=a(62422),o=a(62406),i=a(94430),d=a(56747),c=a(28859);let m=e=>`$${Math.round((e||0)/100).toLocaleString()}`,x={call:"bg-green-500",text:"bg-blue-500",donation:"bg-purple-500",intake:"bg-brand-orange"};function p({item:e}){let{kind:t,data:a,at:n}=e,r="",l="";if("call"===t){let e,t="inbound"===a.direction||"incoming"===a.direction;r=`${t?"Incoming":"Outgoing"} call \xb7 ${a.status}`,l=[a.caller_name,(e=a.duration_sec)?e>=60?`${Math.floor(e/60)}m ${e%60}s`:`${e}s`:""].filter(Boolean).join(" \xb7 ")}else"text"===t?(r="outbound"===a.direction?"You texted":"They texted",l=a.body):"donation"===t?(r=`Donated ${m(a.amount_cents)}${"monthly"===a.type?"/mo":""}`,l=a.cause_slug?`to ${a.cause_slug}`:""):"intake"===t&&(r="Submitted intake",l=a.need||"");return(0,s.jsxs)("div",{className:"flex gap-3",children:[(0,s.jsx)("div",{className:"w-8 h-8 rounded-full bg-gray-100 flex items-center justify-center shrink-0",children:(0,s.jsx)("span",{className:`w-2.5 h-2.5 rounded-full ${x[t]}`})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1 pb-3.5 border-b border-orange-50",children:[(0,s.jsx)("p",{className:"text-[13px] font-bold text-brand-navy",children:r}),l&&(0,s.jsx)("p",{className:"text-[13px] text-gray-600 mt-0.5 wrap-break-word whitespace-pre-wrap line-clamp-3",children:l}),(0,s.jsxs)("p",{className:"text-[11px] text-gray-400 mt-0.5",children:[n?new Date(n).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",timeZone:"America/New_York"}):"","donation"===t&&a.receiptUrl&&(0,s.jsxs)(s.Fragment,{children:[" \xb7 ",(0,s.jsx)("a",{href:a.receiptUrl,target:"_blank",rel:"noreferrer",className:"text-brand-orange font-semibold",children:"receipt ↗"})]})]})]})]})}function u({label:e,value:t}){return(0,s.jsxs)("div",{className:"flex-1 bg-white border border-orange-100 rounded-2xl p-3 text-center shadow-xs",children:[(0,s.jsx)("p",{className:"text-lg font-extrabold text-brand-navy leading-none",children:t}),(0,s.jsx)("p",{className:"text-[11px] text-gray-400 font-semibold mt-1",children:e})]})}function h({sub:e,onClose:t,onSaved:a}){let[r,l]=(0,n.useState)({email:e.email||"",firstName:e.first_name||"",lastName:e.last_name||"",phone:e.phone||"",company:e.company||"",title:e.title||"",address:e.address||""}
1),[o,i]=(0,n.useState)(!1),[c,m]=(0,n.useState)(""),x=e=>t=>l(a=>({...a,[e]:t.target.value}));async function p(t){t.preventDefault(),i(!0),m("");try{let t=await fetch(`/api/member/mod/contacts?id=${e.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}),s=await t.json().catch(()=>({}));if(i(!1),!t.ok||s.error)return void m(s.error||"Could not save");a()}catch{toast("Could not save — the connection dropped.","error")}finally{i(!1)}}let u="w-full border border-orange-100 rounded-xl px-4 py-2.5 text-sm";return(0,s.jsx)("div",{className:"app-backdrop fixed inset-0 z-50 flex items-end sm:items-center justify-center p-3",style:{background:"rgba(0,0,0,0.45)",paddingBottom:"calc(84px + env(safe-area-inset-bottom))"},onClick:t,children:(0,s.jsxs)("div",{className:"bg-white rounded-2xl shadow-xl w-full max-w-md max-h-[82dvh] overflow-y-auto",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-5 py-4 border-b border-orange-100",children:[(0,s.jsx)("h2",{className:"font-bold text-brand-navy",children:"Edit contact"}),(0,s.jsx)("button",{onClick:t,className:"w-8 h-8 rounded-full bg-orange-50 text-brand-orange flex items-center justify-center text-lg leading-none",children:"\xd7"})]}),(0,s.jsxs)("form",{onSubmit:p,className:"px-5 py-5 space-y-3",children:[(0,s.jsx)("input",{className:u,type:"email",placeholder:"Email",value:r.email,onChange:x("email"),required:!0}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsx)("input",{className:u,placeholder:"First name",value:r.firstName,onChange:x("firstName")}),(0,s.jsx)("input",{className:u,placeholder:"Last name",value:r.lastName,onChange:x("lastName")})]}),(0,s.jsx)("input",{className:u,placeholder:"Phone",value:r.phone,onChange:e=>l(t=>({...t,phone:(0,d.qH)(e.target.value)}))}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsx)("input",{className:u,placeholder:"Company",value:r.company,onChange:x("company")}),(0,s.jsx)("input",{className:u,placeholder:"Job title",value:r.title,onChange:x("title")})]}),(0,s.jsx)("textarea",{className:u,placeholder:"Mailing address",rows:2,value:r.address,onChange:x("address")}),c&&(0,s.jsx)("p",{className:"text-red-600 text-xs",children:c}),(0,s.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,s.jsx)("button",{type:"button",onClick:t,className:"flex-1 border border-orange-100 text-gray-600 text-sm font-semibold py-2.5 rounded-xl",children:"Cancel"}),(0,s.jsx)("button",{type:"submit",disabled:o,className:"flex-1 bg-linear-to-r from-brand-orange to-brand-saffron text-white text-sm font-bold py-2.5 rounded-xl disabled:opacity-50",children:o?"Saving…":"Save"})]})]})]})})}function b({contactId:e,contactName:t,onClose:a,onMerged:r}){let[l,o]=(0,n.useState)(""),[i,d]=(0,n.useState)([]),[c,m]=(0,n.use
1State)(!1),[x,p]=(0,n.useState)("");async function u(t){m(!0),p("");try{let a=await fetch("/api/member/mod/contacts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"merge",primaryId:e,secondaryId:t.id})}),s=await a.json().catch(()=>({}));if(!a.ok||!s.ok)return void p(s.error||"Merge failed");r()}catch{p("The connection dropped before we heard back — reload before trying again, the merge may have gone through.")}finally{m(!1)}}(0,n.useEffect)(()=>{if(!l.trim())return void d([]);let t=setTimeout(()=>{fetch(`/api/member/mod/contacts?status=all&search=${encodeURIComponent(l)}`).then(e=>e.json()).then(t=>d((t.subscribers||[]).filter(t=>t.id!==e).slice(0,8))).catch(()=>d([]))},250);return()=>clearTimeout(t)},[l,e]);let h=e=>[e.first_name,e.last_name].filter(Boolean).join(" ")||e.email;return(0,s.jsx)("div",{className:"app-backdrop fixed inset-0 z-50 flex items-end sm:items-center justify-center p-3",style:{background:"rgba(0,0,0,0.45)",paddingBottom:"calc(84px + env(safe-area-inset-bottom))"},onClick:a,children:(0,s.jsxs)("div",{className:"bg-white rounded-2xl shadow-xl w-full max-w-md max-h-[82dvh] overflow-y-auto",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"px-5 py-4 border-b border-orange-100",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("h2",{className:"font-bold text-brand-navy",children:"Merge into this contact"}),(0,s.jsx)("button",{onClick:a,className:"w-8 h-8 rounded-full bg-orange-50 text-brand-orange flex items-center justify-center text-lg leading-none",children:"\xd7"})]}),(0,s.jsxs)("p",{className:"text-[11px] text-gray-400 mt-1",children:["Find the duplicate — it merges into ",(0,s.jsx)("span",{className:"font-semibold",children:t})," and its history combines here."]})]}),(0,s.jsxs)("div",{className:"px-5 py-4",children:[(0,s.jsx)("input",{autoFocus:!0,value:l,onChange:e=>o(e.target.value),placeholder:"Search name, email, or phone…",className:"w-full border border-orange-100 rounded-xl px-4 py-2.5 text-sm mb-3"}),x&&(0,s.jsx)("p",{className:"text-red-600 text-xs mb-2",children:x}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[i.map(e=>(0,s.jsxs)("button",{disabled:c,onClick:()=>u(e),className:"w-full text-left flex items-center gap-3 p-2.5 rounded-xl border border-orange-100 active:scale-[0.99] disabled:opacity-50",children:[(0,s.jsx)("div",{className:"w-8 h-8 rounded-full bg-brand-navy text-white text-xs font-bold flex items-center justify-center shrink-0",children:h(e)[0].toUpperCase()}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("p",{className:"text-sm font-bold text-brand-navy truncate",children:h(e)}),(0,s.jsx)("p",{className:"text-xs text-gray-400 truncate",children:e.email})]}),(0,s.jsx)("span",{className:"text-[11px] font-bold text-brand-orange shrink-0",children:"Merge →"})]},e.id)),l.trim()&&!i.length&&(0,s.jsx)("p",{className:"text-gray-400 text-sm text-center py-4",children:"No matches."})]})]})]})})}function f(){let e=(0,r.useRouter)(),{id:t}=e.query,{member:a,loading:x}=(0,o.IG)(),{confirm:f,toast:g}
1=(0,i.j)(),[y,j]=(0,n.useState)(null),[N,v]=(0,n.useState)(!1),[w,k]=(0,n.useState)(!1),[C,S]=(0,n.useState)(!1);function $(){fetch(`/api/member/mod/contacts?id=${t}`).then(e=>{if(!e.ok)throw Error();return e.json()}).then(e=>{j(e),fetch(`/api/member/mod/contacts?id=${t}&stripe=1`).then(e=>e.json()).then(e=>{e&&!e.error&&j(e)}).catch(()=>{})}).catch(()=>v(!0))}async function _(){if(await f({title:"Unsubscribe contact?",message:`${y?.contact?.email} will be removed from the active list.`,confirmLabel:"Unsubscribe",danger:!0}))try{if(!(await fetch(`/api/member/mod/contacts?id=${t}`,{method:"DELETE"})).ok)throw Error();g("Unsubscribed.","success"),e.replace("/app/admin/contacts")}catch{g("Could not unsubscribe","error")}}async function E(){if(await f({title:"Remove volunteer status?",message:`${y?.contact?.email} will no longer be marked as a volunteer or receive volunteer messages.`,confirmLabel:"Remove",danger:!0}))try{if(!(await fetch(`/api/member/mod/contacts?id=${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({volunteer:!1})})).ok)throw Error();g("Removed from volunteers.","success"),$()}catch{g("Could not update","error")}}(0,n.useEffect)(()=>{if(!x&&t){if(a&&!(a.is_staff&&["staff","admin"].includes(a.staff_role)))return void e.replace("/app");$()}},[x,a,t]);let[T,U]=(0,n.useState)(!1);async function P(e){if(!e||await f({title:"Resend welcome email?",message:`${y?.contact?.email} will get another welcome email.`,confirmLabel:"Resend"})){U(!0);try{let a=await fetch("/api/member/mod/contacts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"send-welcome",id:t,force:!!e})}),s=await a.json().catch(()=>({}));if(!a.ok)throw Error(s.error||"Failed");s.skipped?g("already-sent"===s.skipped?"Already welcomed — use Resend to send again.":"Skipped — welcome emails are paused.","info"):g("Welcome email sent.","success"),$()}catch(e){g(e.message||"Could not send","error")}finally{U(!1)}}}let A=y?.contact,O=A?(0,c.Pe)(A)||A.email:"",R=A?.phone?(0,d.yk)(A.phone):null,M=y?function(e){let t=[];for(let a of e.calls||[])t.push({kind:"call",at:a.created_at,data:a});for(let a of e.texts||[])t.push({kind:"text",at:a.created_at,data:a});for(let a of e.donations||[])t.push({kind:"donation",at:a.created_at,data:a});for(let a of e.intake||[])t.push({kind:"intake",at:a.submitted_at,data:a});return t.sort((e,t)=>new Date(t.at)-new Date(e.at))}(y):[];return(0,s.jsxs)(l.Ay,{title:"Contact",active:"/app/admin",children:[(0,s.jsxs)("button",{onClick:()=>e.back(),className:"app-fade-up text-gray-500 text-sm font-semibold mb-3 flex items-center gap-1",children:[(0,s.jsx)("svg",{width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",children:(0,s.jsx)("polyline",{points:"15 18 9 12 15 6"})})," Contacts"]}),N?(0,s.jsx)("div",{className:"bg-white border border-red-200 rounded-2xl p-8 text-center shadow-xs",children:(0,s.jsx)("p",{className:"text-red-600 font-bold text-sm",children:"Couldn’t load this contact"})}):y?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"app-fade-up bg-white border border-orange-100 rounded-2xl p-5 shadow-xs",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"w-12 h-12 rounded-full flex items-center justify-center text-white text-lg font-bold shrink-0",style:{background:`hsl(${37*(O||"?").charCodeAt(0)%360}, 60%, 45%)`},children:(O||"?")[0].toUpperCase()}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("h1",{className:"text-lg font-extrabold text-brand-navy truncate",children:O}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-1.5 mt-1",children:[y.isMember&&(0,s.jsx)("span",{className:"inline-flex px-2 py-0.5 rounded-full text-[11px] font-semibold bg-indigo-50 text-indigo-700",children:"App member"}),A.volunteer&&(0,s.jsx)("span",{className:"inline-flex px-2 py-0.5 rounded-full text-[11px] font-semibold bg-orange-50 text-brand-orange",children:"Volunteer"}),A.vendor&&(0,s.jsx)("span",{className:"inline-flex px-2 py-0.5 rounded-full text-[11px] font-semibold bg-teal-50 text-teal-700",children:"Vendor"}),y.stats.donatedCents>0&&(0,s.jsx)("span",{className:"inline-flex px-2 py-0.5 rounded-full text-[11px] font-semibold bg-purple-50 text-purple-700",children:"Donor"}),"unsubscribed"===A.status&&(0,s.jsx)("span",{className:"inline-flex px-2 py-0.5 rounded-full text-[11px] font-semibold bg-red-50 text-red-600",children:"Unsubscribed"})]})]})]}),(0,s.jsxs)("div",{className:"mt-4 space-y-1.5 text-sm",children:[A.email&&(0,s.jsxs)("p",{className:"text-gray-600 flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-gray-400 w-14 shrink-0",children:"Email"}),(0,s.jsx)("a",{href:`mailto:${A.email}`,className:"text-brand-navy truncate",children:A.email})]}),y.mergedEmails?.length>0&&(0,s.jsxs)("p",{className:"text-gray-600 flex items-start gap-2",children:[(0,s.jsx)("span",{className:"text-gray-400 w-14 shrink-0",children:"Also"}),(0,s.jsx)("span",{className:"text-brand-navy wrap-break-word",children:y.mergedEmails.join(", ")})]}),A.phone&&(0,s.jsxs)("p",{className:"text-gray-600 flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-gray-400 w-14 shrink-0",children:"Phone"}),(0,s.jsx)("span",{className:"text-brand-navy font-mono",children:(0,d.qH)(A.phone)})]}),y.mergedPhones?.length>0&&(0,s.jsxs)("p",{className:"text-gray-600 flex items-start gap-2",children:[(0,s.jsx)("span",{className:"text-gray-400 w-14 shrink-0",children:"Also"}),(0,s.jsx)("span",{className:"text-brand-navy font-mono",children:y.mergedPhones.map(d.qH).join(", ")})]}),(A.company||A.title)&&(0,s.jsxs)("p",{className:"text-gray-600 flex items-start gap-2",children:[(0,s.jsx)("span",{className:"text-gray-400 w-14 shrink-0",children:"Work"}),(0,s.jsx)("span",{className:"text-brand-navy wrap-break-word",children:[A.title,A.company].filter(
1Boolean).join(" \xb7 ")})]}),A.address&&(0,s.jsxs)("p",{className:"text-gray-600 flex items-start gap-2",children:[(0,s.jsx)("span",{className:"text-gray-400 w-14 shrink-0",children:"Address"}),(0,s.jsx)("a",{href:`https://maps.google.com/?q=${encodeURIComponent(A.address)}`,target:"_blank",rel:"noreferrer",className:"text-brand-navy wrap-break-word",children:A.address})]}),A.source&&(0,s.jsxs)("p",{className:"text-gray-600 flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-gray-400 w-14 shrink-0",children:"Source"}),(0,s.jsx)("span",{className:"text-brand-navy",children:A.source})]})]}),(0,s.jsxs)("div",{className:"mt-4 pt-3 border-t border-orange-50 flex flex-wrap gap-1.5",children:["unsubscribed"===A.status?(0,s.jsx)("span",{className:"text-[11px] font-semibold rounded-full px-2.5 py-1 bg-red-50 text-red-600",children:"Email unsubscribed"}):(0,s.jsx)("span",{className:"text-[11px] font-semibold rounded-full px-2.5 py-1 bg-green-50 text-brand-green-dark dark:text-brand-green-light",children:"Email OK"}),y.smsOptedOut?(0,s.jsx)("span",{className:"text-[11px] font-semibold rounded-full px-2.5 py-1 bg-red-50 text-red-600",children:"SMS opted out — use email or app"}):R?(0,s.jsx)("span",{className:"text-[11px] font-semibold rounded-full px-2.5 py-1 bg-green-50 text-brand-green-dark dark:text-brand-green-light",children:"SMS OK"}):(0,s.jsx)("span",{className:"text-[11px] font-semibold rounded-full px-2.5 py-1 bg-gray-100 text-gray-500",children:"No phone number"}),y.welcomeEmail&&(0,s.jsxs)("span",{className:"text-[11px] font-semibold rounded-full px-2.5 py-1 bg-blue-50 text-blue-600",children:["Welcome email ",y.welcomeEmail.clicked_at?"clicked":y.welcomeEmail.opened_at?"opened":y.welcomeEmail.status||"sent"]})]}),(0,s.jsxs)("div",{className:"mt-4 space-y-2",children:[R&&(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("button",{onClick:()=>e.push(`/app/admin/communications?thread=${encodeURIComponent(R)}`),className:"flex-1 border border-orange-100 text-brand-navy text-sm font-bold rounded-xl py-2.5",children:"Text"}),(0,s.jsx)("button",{onClick:()=>e.push(`/app/admin/communications?call=${encodeURIComponent(R)}`),className:"flex-1 border border-orange-100 text-brand-navy text-sm font-bold rounded-xl py-2.5",children:"Call"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[A.email&&(0,s.jsx)("a",{href:`mailto:${A.email}`,className:"flex-1 border border-orange-100 text-brand-navy text-sm font-bold rounded-xl py-2.5 text-center",children:"Email"}),(0,s.jsx)("button",{onClick:()=>k(!0),className:"flex-1 border border-orange-100 text-brand-navy text-sm font-bold rounded-xl py-2.5",children:"Edit"}),(0,s.jsx)("button",{onClick:()=>S(!0),className:"flex-1 border border-orange-100 text-brand-navy text-sm font-bold rounded-xl py-2.5",children:"Merge"})]}),A.email&&"unsubscribed"!==A.status&&(y.welcomeEmail?(0,s.jsx)("button",{onClick:()=>P(!0),disabled:T,className:"w-full border border-orange-100 text-brand-navy text-sm font-bold rounded-xl py-2.5 disabled:opacity-50",children:T?"Sending…":"Resend welcome email"}):(0,s.jsx)("button",{onClick:()=>P(!1),disabled:T,className:"w-full border border-orange-100 text-brand-navy text-sm font-bold rounded-xl py-2.5 disabled:opacity-50",children:T?"Sending…":"Send welcome email"})),A.volunteer&&(0,s.jsx)("button",{onClick:E,className:"w-full border border-orange-200 text-brand-orange text-sm font-bold rounded-xl py-2.5",children:"Remove volunteer status"}),"unsubscribed"!==A.status&&(0,s.jsx)("button",{onClick:_,className:"w-full border border-red-200 text-red-600 text-sm font-bold rounded-xl py-2.5",children:"Unsubscribe"})]})]}),(0,s.jsxs)("div",{className:"app-fade-up flex gap-2 mt-3",children:[(0,s.jsx)(u,{label:"Donated",value:m(y.stats.donatedCents)}),(0,s.jsx)(u,{label:"Calls",value:y.stats.calls}),(0,s.jsx)(u,{label:"Texts",value:y.stats.texts})]}),(0,s.jsxs)("div",{className:"app-fade-up bg-white border border-orange-100 rounded-2xl p-5 shadow-xs mt-3",children:[(0,s.jsx)("h2",{className:"text-xs font-bold text-gray-400 uppercase tracking-wide mb-3",children:"Activity"}),0===M.length?(0,s.jsx)("p",{className:"text-gray-400 text-sm text-center py-6",children:"No activity yet — calls, texts, donations, and intake will show here."}):(0,s.jsx)("div",{className:"space-y-3.5",children:M.map((e,t)=>(0,s.jsx)(p,{item:e},`${e.kind}-${e.data.id}-${t}`))})]})]}):(0,s.jsx)("div",{className:"space-y-3",children:[0,1,2].map(e=>(0,s.jsx)("div",{className:"h-24 rounded-2xl bg-white border border-orange-100 app-shine"},e))}),w&&A&&(0,s.jsx)(h,{sub:A,onClose:()=>k(!1),onSaved:()=>{k(!1),g("Saved.","success"),$()}}),C&&A&&(0,s.jsx)(b,{contactId:A.id,contactName:O,onClose:()=>S(!1),onMerged:()=>{S(!1),g("Contacts merged.","success"),$()}})]})}},28859:(e,t,a)=>{"use strict";a.d(t,{$t:()=>n,Pe:()=>l,_b:()=>r,gE:()=>i});let s=new Set(["na","notprovided","none","nil","null","unknown"]);function n(e){let t=String(e??"").trim();if(!t)return"";let a=e=>e.toLowerCase().replace(/[^a-z]/g,"");return s.has(a(t))?"":t.split(/\s+/).filter(e=>"na"!==a(e)).join(" ")}function r(e){if(e&&"object"==typeof e){let t=n(e.firstName??e.first_name);if(t)return t.split(/\s+/)[0];let a=n(e.name);return a?a.split(/\s+/)[0]:""}let t=n(e);return t?t.split(/\s+/)[0]:""}function l(e){if(e&&"object"==typeof e){let t=[n(e.firstName??e.first_name),n(e.lastName??e.last_name)].filter(
1Boolean);return t.length?t.join(" "):n(e.name)}return n(e)}function o(e){return!e||/\d/.test(e)||/[a-z]/.test(e)&&/[A-Z]/.test(e)?e:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function i(e){return n(e).replace(/\s+/g," ").split(" ").map(e=>e.split("-").map(o).join("-")).join(" ")}},56747:(e,t,a)=>{"use strict";function s(e){let t=String(e||"").replace(/\D/g,"");return(11===t.length&&t.startsWith("1")&&(t=t.slice(1)),(t=t.slice(0,10)).length<4)?t:t.length<7?`(${t.slice(0,3)}) ${t.slice(3)}`:`(${t.slice(0,3)}) ${t.slice(3,6)}-${t.slice(6)}`}function n(e){let t=String(e||"").replace(/\D/g,"");return(11===t.length&&t.startsWith("1")&&(t=t.slice(1)),10!==t.length)?null:`+1${t}`}a.d(t,{qH:()=>s,yk:()=>n}),a(65364)},75604:(e,t,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/app/admin/contact/[id]",function(){return a(24210)}])}},e=>{e.O(0,[8230,900,6475,2422,636,6593,8792],()=>e(e.s=75604)),_N_E=e.O()}]);

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.