PageSourceSearch

https://humanberto-portfolio-web.vercel.app/_next/static/chunks/6513.947d910c294b7eb3.js

js humanberto-portfolio-web.vercel.app collected 2026-10-03 05:18:08 UTC 7,662 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6513],{56513:(e,t,n)=>{n.r(t),n.d(t,{DealCalculator:()=>b});var s=n(54568),i=n(57322),a=n(7620),l=n(6395);let r={pencilsMinBps:150,tightMinBps:50},c={units:{min:0,max:400,step:1},monthlyRentPerUnit:{min:0,max:5e3,step:25},landCost:{min:0,max:2e7,step:5e4},hardCostPerUnit:{min:0,max:5e5,step:5e3},softCostPercent:{min:0,max:50,step:1},vacancyPercent:{min:0,max:100,step:1},operatingExpensePercent:{min:0,max:100,step:1},exitCapPercent:{min:0,max:12,step:.1}},o=[{id:"sample-pencils",label:"Sample: pencils",inputs:{units:100,monthlyRentPerUnit:2e3,landCost:2e6,hardCostPerUnit:15e4,softCostPercent:20,vacancyPercent:5,operatingExpensePercent:30,exitCapPercent:5}},{id:"sample-tight",label:"Sample: tight",inputs:{units:60,monthlyRentPerUnit:2200,landCost:15e5,hardCostPerUnit:2e5,softCostPercent:18,vacancyPercent:5,operatingExpensePercent:32,exitCapPercent:5.25}},{id:"sample-miss",label:"Sample: doesn't pencil",inputs:{units:40,monthlyRentPerUnit:1500,landCost:4e6,hardCostPerUnit:275e3,softCostPercent:22,vacancyPercent:8,operatingExpensePercent:40,exitCapPercent:6}}];function d(e,t){let n=c[e];return Number.isFinite(t)?Math.min(n.max,Math.max(n.min,t)):n.min}function m(e){return e.toLocaleString("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0})}function u(e){return"".concat(e.toLocaleString("en-US",{minimumFractionDigits:1,maximumFractionDigits:1}),"%")}function x(e){return"".concat(Math.round(e).toLocaleString("en-US")," bps")}var p=n(27696);let h=[{key:"units",label:"Units",format:"count"},{key:"monthlyRentPerUnit",label:"Average monthly rent per unit",format:"money"},{key:"landCost",label:"Land cost",format:"money"},{key:"hardCostPerUnit",label:"Hard cost per unit",format:"money"},{key:"softCostPercent",label:"Soft costs (% of hard costs)",format:"percent"},{key:"vacancyPercent",label:"Vacancy %",format:"percent"},{key:"operatingExpensePercent",label:"Operating expenses (% of revenue)",format:"percent"},{key:"exitCapPercent",label:"Exit cap rate",format:"percent"}];function f(e,t){let n=h.find(t=>t.key===e);return(null==n?void 0:n.format)==="money"?m(t):(null==n?void 0:n.format)==="percent"?u(t):t.toLocaleString("en-US")}function g(e){let{value:t,format:n}=e,r=(0,l.I)(),c=(0,a.useRef)(null!=t?t:0),[o,d]=(0,a.useState)(null!=t?t:0);return((0,a.useEffect)(()=>{if(null===t)return;if(r){c.current=t,d(t);return}let e=(0,i.i)(c.current,t,{duration:p.T.duration.base,ease:p.T.ease.out,onUpdate:e=>{c.current=e,d(e)}});return()=>e.stop()},[r,t]),null===t)?(0,s.jsx)("span",{children:"n/a"}):(0,s.jsxs)("span",{children:[(0,s.jsx)("span",{className:"sr-only",children:n(t)}),(0,s.jsx)("span",{"aria-hidden":"true",className:"tabular-nums",children:n(o)})]})}function v(e){let{fieldKey:t,label:n,value:i,onChange:l}=e,r=(0,a.useId)(),o=c[t],m="".concat(r,"-number");return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[(0,s.jsx)("label",{htmlFor:m,className:"text-sm text-fg",children:n}),(0,s.jsx)("span",{className:"text-xs text-faint",children:f(t,i)})]}),(0,s.jsxs)("div",{className:"mt-2 flex items-center gap-3",children:[(0,s.jsx)("input",{type:"range",min:o.min,max:o.max,step:o.step,value:i,"aria-label":"".concat(n," slider"),"aria-valuetext":f(t,i),className:"h-11 min-w-0 flex-1 accent-gold focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gold/60",onChange:e=>l(d(t,Number(e.target.value)))}),(0,s.jsx)("input",{id:m,type:"number",min:o.min,max:o.max,step:o.step,value:i,className:"w-28 rounded-xl border border-line bg-ink px-3 text-sm text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gold/60",style:{minHeight:p.T.touchTarget},onChange:e=>{l(d(t,""===e.target.value?o.min:Number(e.target.value)))}})]})]})}function b(){let e=o[0],[t,n]=(0,a.useState)(e?e.inputs:{units:0,monthlyRentPerUnit:0,landCost:0,hardCostPerUnit:0,softCostPercent:0,vacancyPercent:0,operatingExpensePercent:0,exitCapPercent:0}),i=function(e){let t=e.units*e.hardCostPerUnit,n=t*(e.softCostPercent/100),s=e.landCost+t+n,i=e.units*e.monthlyRentPerUnit*12*(1-e.vacancyPercent/100)*(1-e.operatingExpensePercent/100),a=s>0?i/s*100:null,l=e.exitCapPercent>
10?i/(e.exitCapPercent/100):null,c=null===a?null:(a-e.exitCapPercent)*100;return{totalDevelopmentCost:s,noi:i,yieldOnCost:a,valueAtExit:l,spreadBps:c,profitMargin:null===l||s<=0?null:(l-s)/s*100,verdict:null===c?"Doesn't pencil":c>=r.pencilsMinBps?"Pencils":c>=r.tightMinBps?"Tight":"Doesn't pencil"}}(t),l=o.find(e=>{var n;return n=e.inputs,Object.keys(c).every(e=>n[e]===t[e])}),d="Pencils"===i.verdict?"border-gold/50 bg-gold/10 text-gold-bright":"Tight"===i.verdict?"border-amber-400/60 bg-amber-400/10 text-amber-200":"border-line bg-white/5 text-muted";return(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs font-medium uppercase tracking-[0.16em] text-gold",children:"Interactive demo \xb7 sample data"}),(0,s.jsx)("div",{className:"mt-4 flex flex-wrap gap-2",role:"group","aria-label":"Sample presets",children:o.map(e=>{let t=(null==l?void 0:l.id)===e.id;return(0,s.jsx)("button",{type:"button","aria-pressed":t,className:"rounded-full border px-4 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gold/60 ".concat(t?"border-gold/50 text-fg":"border-line text-muted"),style:{minHeight:p.T.touchTarget},onClick:()=>n(e.inputs),children:e.label},e.id)})}),(0,s.jsxs)("div",{className:"mt-6 grid gap-8 lg:grid-cols-2",children:[(0,s.jsx)("div",{className:"space-y-5",children:h.map(e=>(0,s.jsx)(v,{fieldKey:e.key,label:e.label,value:t[e.key],onChange:t=>{var s;return s=e.key,void n(e=>({...e,[s]:t}))}},e.key))}),(0,s.jsxs)("div",{className:"rounded-2xl border border-line bg-surface/40 p-5",children:[(0,s.jsx)("p",{"aria-live":"polite",className:"inline-flex items-center rounded-full border px-3 text-sm ".concat(d),style:{minHeight:p.T.touchTarget},children:i.verdict}),(0,s.jsxs)("p",{className:"mt-3 text-xs text-faint",children:["Sample thresholds. Pencils from ",r.pencilsMinBps," bps. Tight from"," ",r.tightMinBps," bps."]}),(0,s.jsxs)("dl",{className:"mt-5 space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-muted",children:"Total development cost"}),(0,s.jsx)("dd",{className:"font-display text-2xl font-light",children:(0,s.jsx)(g,{value:i.totalDevelopmentCost,format:m})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-muted",children:"NOI"}),(0,s.jsx)("dd",{className:"font-display text-2xl font-light",children:(0,s.jsx)(g,{value:i.noi,format:m})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-muted",children:"Yield on cost"}),(0,s.jsx)("dd",{className:"font-display text-2xl font-light",children:(0,s.jsx)(g,{value:i.yieldOnCost,format:u})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-muted",children:"Value at exit cap"}),(0,s.jsx)("dd",{className:"font-display text-2xl font-light",children:(0,s.jsx)(g,{value:i.valueAtExit,format:m})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-muted",children:"Development spread"}),(0,s.jsx)("dd",{className:"font-display text-2xl font-light",children:(0,s.jsx)(g,{value:i.spreadBps,format:x})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-muted",children:"Profit margin"}),(0,s.jsx)("dd",{className:"font-display text-2xl font-light",children:(0,s.jsx)(g,{value:i.profitMargin,format:u})})]})]})]})]}),(0,s.jsx)("p",{className:"mt-6 text-sm text-muted",children:"Simplified model for illustration. Not investment advice."})]})}}}]);

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.