PageSourceSearch

https://withbase.ai/assets/_authenticated.finance-BMVCkHuE.js

js withbase.ai collected 2026-10-05 13:39:19 UTC 20,372 bytes, 1 lines download raw bytes

1import{y as $e,d as Ae,h as A,g as h,_ as pe,j as e,t as N,cM as Pe,u as Le,as as R,aX as le,bh as Fe,X as Re}from"./index-ZokJCbAl.js";import{D as Ee}from"./DrillStat-D4cBTqzP.js";import{S as Me}from"./StatDrilldown-BKL4aLEl.js";import{u as J}from"./use-is-connected-BAdAxJYl.js";import{l as _e,m as Qe,f as Xe}from"./data-C9YTcZWl.js";import{u as qe,C as Ue}from"./CommandConfirmDialog-ehBQxHcG.js";import{u as We}from"./data-B6_vqEDy.js";import{u as Oe,a as ze,r as Ve}from"./use-finance-data-ozi0Du9K.js";import{I as Ge}from"./InsightsPanel-DS75i2mK.js";import{x as Ke,a as He}from"./xero.functions-Dn4m2HjY.js";import{a as Ye,b as Je}from"./quickbooks.functions-CV4uCLcX.js";import{C as $}from"./card-BQhXkuZy.js";import{B as C}from"./badge-8StaUBQG.js";import{B as P}from"./button-Bi_qhQAX.js";import{d as O,e as z,f as y,g as l,h as V,i,T as Ze,a as es,b as q,c as U}from"./table-B4K7xb0s.js";import{s as ss,a as fe}from"./vendor-bills.functions-Dw8vNXbo.js";import{R as de}from"./receipt-CrZUiIZm.js";import{R as ue}from"./refresh-cw-RnFFGE0E.js";import{f as je}from"./formatDistanceToNow-DL52HbRu.js";import{I as Z}from"./input-BDk6uqx-.js";import{L as ee}from"./label-CpGeQHKz.js";import{D as ts,a as ns,b as as,c as rs,e as os}from"./dialog-B4gQoLZ7.js";import{f as me}from"./utils-Bw6udmlp.js";import{P as is}from"./plus-C5TqOXge.js";import{C as xe}from"./circle-alert-CL9tWsp6.js";import{W as cs}from"./wallet-Cm4vB1u8.js";import{B as ls}from"./banknote-uS-p-eEM.js";import{T as ds}from"./trending-down-Bh42ovUN.js";import"./format-8_x1dSPN.js";import"./chevron-right-nu8SqgW2.js";import"./action-templates-BKlYxYP4.js";import"./gmail.functions-DQmifNcj.js";import"./identity.functions-3ZnMayB9.js";import"./ModuleRecordDrawer-C-jTjCEf.js";import"./sheet-BE4XvwDp.js";import"./index-qd_mUhQo.js";import"./index-Cc9gkJEO.js";import"./index-M8aEO0bF.js";import"./index-BOEOuUeN.js";import"./external-link-CvOmuZcB.js";import"./useMutation-FgFKmWo4.js";import"./loops.functions-Btr3BLlp.js";import"./client.server-vtGzLRIL.js";import"./catalog-BQrNmuVe.js";import"./org-status-DgOgR9WB.js";import"./command-log-DxUtMtXy.js";import"./tooltip-BrXA54WP.js";import"./index-DmAPSOAB.js";import"./index-D9cZPKb7.js";import"./index-DSZaeLjD.js";import"./RevenueAnswerCard-Bjo7SBbs.js";import"./triangle-alert-CXX9eWf1.js";import"./lightbulb-Cf5xFv5j.js";import"./info-Byn6EZ54.js";import"./circle-check-DD7YcHx3.js";import"./index-Ctz8Ot2I.js";import"./index-DP1kEgKC.js";import"./index-CWgnLZr-.js";import"./en-US-DIdCsyf3.js";const us=[["path",{d:"M11 17h3v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-3a3.16 3.16 0 0 0 2-2h1a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1h-1a5 5 0 0 0-2-4V3a4 4 0 0 0-3.2 1.6l-.3.4H11a6 6 0 0 0-6 6v1a5 5 0 0 0 2 4v3a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1z",key:"1piglc"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M2 8v1a2 2 0 0 0 2 2h1",key:"1env43"}]],ms=$e("piggy-bank",us),xs=[{id:"vb_1",vendor:"AWS",amount:1820,due:1820,currency:"GBP",status:"awaiting_payment",dueAt:"2026-06-14",source:"quickbooks"},{id:"vb_2",vendor:"Rotterdam Bottling Co.",amount:6400,due:6400,currency:"GBP",status:"awaiting_payment",dueAt:"2026-06-20",source:"xero"},{id:"vb_3",vendor:"WeWork",amount:2400,due:0,currency:"GBP",status:"paid",dueAt:"2026-05-28",source:"xero"}];function W(n,r="GBP"){return new Intl.NumberFormat("en-GB",{style:"currency",currency:r,maximumFractionDigits:0}).format(n)}function hs(n,r){return n==="paid"?e.jsx(C,{variant:"default",children:"Paid"}):n==="void"?e.jsx(C,{variant:"outline",children:"Void"}):r?e.jsx(C,{variant:"destructive",children:"Overdue"}):n==="draft"?e.jsx(C,{variant:"outline",children:"Draft"}):e.jsx(C,{variant:"secondary",children:"Awaiting payment"})}function ps({demo:n,orgId:r}){const S=Ae(),p=A(ss),[a,x]=h.useState(!1),{data:f,isLoading:b}=pe({queryKey:["vendor-bills",r],enabled:!!r&&!n,queryFn:()=>fe({data:{orgId:r}})}),j=f?.bills??[],u=f?.summary,c=Date.now(),E=h.useMemo(()=>n?xs.map(t=>({id:t.id,vendorName:t.vendor,total:t.amount,amountDue:t.due,currency:t.currency,status:t.status,dueAt:t.dueAt,source:t.source})):j.map(t=>({id:t.id,vendorName:t.vendorName??"Unnamed vendor",total:t.total,amountDue:t.amountDue,currency:t.currency,status:t.status,dueAt:t.dueAt,source:t.source})),[n,j]);async function M(){if(r){x(!0);try{const t=await p({data:{orgId:r}});t.sources.length?(N.success(`Pulled ${t.total} bills from ${t.sources.join(" and ")}`),await S.invalidateQueries({queryKey:["vendor-bills",r]})):N.error("Connect Xero or QuickBooks first")}
1catch(t){N.error(t.message)}finally{x(!1)}}}return!n&&!b&&E.length===0?e.jsxs($,{className:"flex items-start gap-3 border-dashed bg-muted/30 p-6 text-sm",children:[e.jsx(de,{className:"mt-0.5 h-4 w-4 text-muted-foreground"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"font-medium text-foreground",children:"No bills pulled yet"}),e.jsxs("p",{className:"text-muted-foreground",children:["Bills come from Xero or QuickBooks accounts payable. Connect one from"," ",e.jsx("a",{href:"/modules/finance",className:"underline",children:"Modules → Finance"}),", then pull. Nothing is estimated in the meantime."]}),e.jsxs(P,{size:"sm",variant:"outline",onClick:M,disabled:a||!r,children:[e.jsx(ue,{className:`mr-2 h-3.5 w-3.5 ${a?"animate-spin":""}`}),a?"Pulling…":"Pull bills"]})]})]}):e.jsxs(e.Fragment,{children:[!n&&u&&u.outstanding!==null&&e.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-[12.5px] text-muted-foreground",children:[e.jsxs("span",{children:[e.jsx("span",{className:"text-foreground font-medium",children:W(u.outstanding,u.currency)})," ","owed across ",u.vendorCount," vendors"]}),u.overdue?e.jsxs("span",{className:"text-destructive",children:[W(u.overdue,u.currency)," overdue"]}):null,u.nextDue&&e.jsxs("span",{children:["Next: ",u.nextDue.vendor," ",je(new Date(u.nextDue.dueAt),{addSuffix:!0})]}),e.jsxs(P,{size:"sm",variant:"ghost",className:"ml-auto",onClick:M,disabled:a,children:[e.jsx(ue,{className:`mr-2 h-3.5 w-3.5 ${a?"animate-spin":""}`}),a?"Pulling…":"Pull bills"]})]}),e.jsx($,{className:"overflow-hidden",children:e.jsxs(O,{children:[e.jsx(z,{children:e.jsxs(y,{children:[e.jsx(l,{children:"Vendor"}),e.jsx(l,{children:"Amount"}),e.jsx(l,{children:"Outstanding"}),e.jsx(l,{children:"Due"}),e.jsx(l,{children:"Status"}),e.jsx(l,{children:"Source"})]})}),e.jsx(V,{children:E.map(t=>{const _=!!t.dueAt&&t.amountDue>0&&new Date(t.dueAt).getTime()<c;return e.jsxs(y,{children:[e.jsx(i,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(de,{className:"h-4 w-4 text-muted-foreground"}),t.vendorName]})}),e.jsx(i,{children:W(t.total,t.currency)}),e.jsx(i,{className:_?"text-destructive":void 0,children:t.amountDue>0?W(t.amountDue,t.currency):"-"}),e.jsx(i,{className:"text-sm text-muted-foreground",children:t.dueAt?new Date(t.dueAt).toLocaleDateString():"-"}),e.jsx(i,{children:hs(t.status,_)}),e.jsx(i,{className:"text-sm capitalize text-muted-foreground",children:t.source})]},t.id)})})]})})]})}function m(n,r="USD"){return new Intl.NumberFormat("en-US",{style:"currency",currency:r,maximumFractionDigits:0}).format(n)}function he(n){switch(n){case"paid":return"default";case"overdue":case"failed":return"destructive";case"sent":case"in_transit":case"pending":return"secondary";default:return"outline"}}function Nt(){const[n,r]=h.useState(null),S=n,p=(s,d)=>r(s?{key:s,label:d??""}:null),a=_e("finance"),x=J("stripe"),f=J("xero"),b=J("quickbooks"),j=x.connected||f.connected||b.connected,u=qe(),{data:c}=We(),E=A(Qe),M=A(Ke),t=A(Ye),_=A(He),ge=A(Je),[ve,L]=h.useState(!1),{new:te}=Pe.useSearch(),ne=Le();h.useEffect(()=>{te&&(L(!0),ne({to:"/finance",search:{},replace:!0}))},[te,ne]);const[g,ae]=h.useState(""),[re,oe]=h.useState(""),[G,ye]=h.useState("14"),{data:Ne=[],isLoading:be,isError:we}=Oe(c?.id),{data:De=[],isLoading:Ce,isError:Se}=ze(c?.id),v=Ne,K=De,w=v.length>0,ke=K.length>0,H=be||Ce,Q=we||Se,Ie=!H&&!Q&&!w&&!ke,k=v[0]?.currency??"GBP",Y=h.useMemo(()=>{const s=v.filter(o=>o.status==="sent"||o.status==="overdue").reduce((o,B)=>o+B.amount,0),d=v.filter(o=>o.status==="overdue").reduce((o,B)=>o+B.amount,0),D=v.filter(o=>o.status==="paid").reduce((o,B)=>o+B.amount,0);return{outstanding:s,overdue:d,collected:D}},[v]),X=h.useMemo(()=>
1Ve(v,30),[v]),F=h.useMemo(()=>({income:X.reduce((s,d)=>s+d.amount,0)}),[X]),{data:ie}=pe({queryKey:["vendor-bills",c?.id],enabled:!!c?.id&&!a,queryFn:()=>fe({data:{orgId:c.id}})}),I=h.useMemo(()=>{const s=ie?.bills??[],d=Date.now()-30*864e5,D=s.filter(o=>o.issuedAt&&new Date(o.issuedAt).getTime()>=d&&o.status!=="void");return D.length?D.reduce((o,B)=>o+B.total,0):null},[ie]);function ce(){return x.connected?"Stripe":f.connected?"Xero":b.connected?"QuickBooks":"Stripe"}function Be(){const s=Number(re);if(!g.trim()||!Number.isFinite(s)||s<=0){N.error("Enter a customer and amount");return}const d=ce(),D=new Date;D.setDate(D.getDate()+Number(G||"14")),u.ask({payload:{title:`Send invoice to ${g}`,description:`Will be created in ${d}.`,fields:[{label:"Customer",value:g},{label:"Amount",value:m(s)},{label:"Due",value:D.toLocaleDateString()},{label:"Target",value:d}],confirmLabel:"Create invoice"},execute:async()=>{if(!c?.id)throw new Error("No active workspace");const o=D.toISOString().slice(0,10);return d==="Stripe"?await E({data:{orgId:c.id,customerEmail:`${g.toLowerCase().replace(/\s+/g,".")}@example.com`,description:`Invoice for ${g}`,amount:s,daysUntilDue:Number(G||"14")}}):d==="Xero"?await M({data:{orgId:c.id,contactName:g,description:"Services",amount:s,dueDate:o,send:!0}}):await t({data:{orgId:c.id,customerName:g,amount:s,description:"Services",dueDate:o}}),{ok:!0,target:d}},onSuccess:()=>{N.success(`Invoice queued in ${d}`),L(!1),ae(""),oe("")},onFailure:o=>N.error(o.message),log:{commandText:`send invoice ${g} ${m(s)}`,moduleRoutedTo:"finance",integrationUsed:d,previewSummary:`Invoice ${m(s)} → ${g} via ${d}`}})}function Te(s){u.ask({payload:{title:`Record payment for ${s.number}`,description:`Mark ${s.number} as paid in ${s.source}.`,fields:[{label:"Customer",value:s.customer},{label:"Amount",value:m(s.amount,s.currency)},{label:"Source",value:s.source}],confirmLabel:"Record payment"},execute:async()=>{if(!c?.id)throw new Error("No active workspace");return s.source==="Xero"?await _({data:{orgId:c.id,invoiceId:s.id,amount:s.amount}}):s.source==="QuickBooks"&&await ge({data:{orgId:c.id,customerId:s.customer,amount:s.amount,invoiceId:s.id}}),{ok:!0}},onSuccess:()=>N.success(`${s.number} marked paid`),onFailure:d=>N.error(d.message),log:{commandText:`record payment ${s.number}`,moduleRoutedTo:"finance",integrationUsed:s.source,previewSummary:`Mark ${s.number} (${m(s.amount)}) paid in ${s.source}`}})}return e.jsxs("div",{className:"space-y-6 p-6",children:[e.jsxs("header",{className:"flex flex-wrap items-end justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold text-foreground",children:"Finance"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Cash, revenue, invoices, payouts and expenses. Unified across Stripe, Xero and QuickBooks."})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(se,{label:"Stripe",status:x,orgId:c?.id,demo:a}),e.jsx(se,{label:"Xero",status:f,orgId:c?.id,demo:a}),e.jsx(se,{label:"QuickBooks",status:b,orgId:c?.id,demo:a}),e.jsxs(P,{size:"sm",onClick:()=>L(!0),children:[e.jsx(is,{className:"mr-1 h-4 w-4"})," New invoice"]})]})]}),Q&&!a?e.jsxs($,{className:"flex items-start gap-3 border-dashed border-destructive/40 bg-destructive/5 p-4 text-sm",children:[e.jsx(xe,{className:"mt-0.5 h-4 w-4 text-destructive"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:"Could not load your finance data"}),e.jsxs("p",{className:"text-muted-foreground",children:["The last read of your invoices or payouts failed, so these tables are empty rather than showing figures we cannot stand behind. Try again shortly, or check your connections in"," ",e.jsx("a",{href:"/modules/finance",className:"underline",children:"Modules → Finance"}),"."]})]})]}):null,Ie&&!a?e.jsxs($,{className:"flex items-start gap-3 border-dashed bg-muted/30 p-4 text-sm",children:[e.jsx(xe,{className:"mt-0.5 h-4 w-4 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:j?"Nothing has synced yet":"No finance tool connected"}),e.jsxs("p",{className:"text-muted-foreground",children:[j?"Your finance tools are connected but no invoices or payouts have synced into Base yet. Use Sync now on the Finance module to pull them in. Base will not show stand-in figures here.":"Connect Stripe, Xero or QuickBooks to see your real invoices, payouts and revenue. Base will not show stand-in figures on a finance page."," ",e.jsx("a",{href:"/modules/finance",className:"underline",children:"Modules → Finance"})]})]})]}):null,e.jsxs("section",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(T,{icon:e.jsx(cs,{className:"h-4 w-4"}
1),label:"Cash on hand",value:a?`£${R.cashInBank.toLocaleString()}`:"Not available",sub:a?`revenue ${"£"+R.revenueThisMonth.toLocaleString()} this month`:"needs a bank or accounting feed"}),e.jsx(T,{icon:e.jsx(le,{className:"h-4 w-4"}),label:"Revenue collected",...w?{drill:"invoices.paid_30d",onDrill:p}:{},value:w?m(F.income,k):a?`£${R.revenueThisMonth.toLocaleString()}`:"No data yet",sub:w?"paid invoices, last 30 days":a?"sample figure":"paid invoices, last 30 days",trend:F.income>0?"up":void 0}),e.jsx(T,{icon:e.jsx(Fe,{className:"h-4 w-4"}),label:"Runway",value:a?`${R.runwayMonths} mo`:"Not available",sub:a?`burn £${R.burnRate.toLocaleString()}/mo`:"needs cash balance and expenses"}),e.jsx(T,{icon:e.jsx(ls,{className:"h-4 w-4"}),label:"A/R outstanding",drill:"invoices.outstanding",onDrill:p,value:w?m(Y.outstanding,k):"No data yet",sub:w?`${m(Y.overdue,k)} overdue`:"needs synced invoices",trend:Y.overdue>0?"down":void 0})]}),e.jsx(Me,{orgId:c?.id,drillKey:S?.key??null,label:S?.label,onClose:()=>p(null)}),e.jsx("div",{className:"mb-4",children:e.jsx(Ge,{orgId:c?.id,scope:"finance",variant:"panel",limit:4})}),e.jsxs(Ze,{defaultValue:"invoices",className:"space-y-4",children:[e.jsxs(es,{children:[e.jsx(q,{value:"invoices",children:"Invoices"}),e.jsx(q,{value:"payouts",children:"Payouts"}),e.jsx(q,{value:"expenses",children:"Expenses"}),e.jsx(q,{value:"pnl",children:"P&L"})]}),e.jsx(U,{value:"invoices",className:"space-y-3",children:e.jsx($,{className:"overflow-hidden",children:e.jsxs(O,{children:[e.jsx(z,{children:e.jsxs(y,{children:[e.jsx(l,{children:"Number"}),e.jsx(l,{children:"Customer"}),e.jsx(l,{children:"Amount"}),e.jsx(l,{children:"Status"}),e.jsx(l,{children:"Due"}),e.jsx(l,{children:"Source"}),e.jsx(l,{className:"text-right",children:"Actions"})]})}),e.jsxs(V,{children:[v.length===0?e.jsx(y,{children:e.jsx(i,{colSpan:7,className:"py-6 text-center text-sm text-muted-foreground",children:H?"Loading...":Q?"We could not load your invoices just now.":j?"No invoices have synced yet.":"Connect a finance tool to see your invoices."})}):null,v.map(s=>e.jsxs(y,{children:[e.jsx(i,{className:"font-mono text-xs",children:s.number}),e.jsx(i,{children:s.customer}),e.jsx(i,{children:m(s.amount,s.currency)}),e.jsx(i,{children:e.jsx(C,{variant:he(s.status),children:me(s.status)})}),e.jsx(i,{className:"text-sm text-muted-foreground",children:s.due_at?new Date(s.due_at).toLocaleDateString():"-"}),e.jsx(i,{className:"text-sm text-muted-foreground",children:s.source}),e.jsx(i,{className:"text-right",children:w&&s.status!=="paid"&&s.status!=="void"?e.jsx(P,{size:"sm",variant:"ghost",onClick:()=>Te(s),children:"Record payment"}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"-"})})]},s.id))]})]})})}),e.jsx(U,{value:"payouts",className:"space-y-3",children:e.jsx($,{className:"overflow-hidden",children:e.jsxs(O,{children:[e.jsx(z,{children:e.jsxs(y,{children:[e.jsx(l,{children:"Amount"}),e.jsx(l,{children:"Status"}),e.jsx(l,{children:"Arrives"}),e.jsx(l,{children:"Source"})]})}),e.jsxs(V,{children:[K.length===0?e.jsx(y,{children:e.jsx(i,{colSpan:4,className:"py-6 text-center text-sm text-muted-foreground",children:H?"Loading...":Q?"We could not load your payouts just now.":j?"No payouts have synced yet.":"Connect a finance tool to see your payouts."})}):null,K.map(s=>e.jsxs(y,{children:[e.jsx(i,{className:"font-medium",children:m(s.amount,s.currency)}),e.jsx(i,{children:e.jsx(C,{variant:he(s.status),children:me(s.status)})}),e.jsx(i,{className:"text-sm text-muted-foreground",children:s.arrives_at?je(new Date(s.arrives_at),{addSuffix:!0}):"-"}),e.jsx(i,{className:"text-sm text-muted-foreground",children:s.source})]},s.id))]})]})})}),e.jsx(U,{value:"expenses",className:"space-y-3",children:e.jsx(ps,{demo:a,orgId:c?.id})}),e.jsxs(U,{value:"pnl",className:"space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-3",children:[e.jsx(T,{icon:e.jsx(le,{className:"h-4 w-4"}),label:"Income",...w?{drill:"invoices.paid_30d",onDrill:p}:{},value:w||a?m(F.income,k):"No data yet",sub:"paid invoices, last 30 days",trend:F.income>0?"up":void 0}),e.jsx(T,{icon:e.jsx(ds,{className:"h-4 w-4"}),label:"Expenses",...I!==null?{drill:"vendor_bills.recent_30d",onDrill:p}:{}
1,value:I!==null?m(I,k):"Not available",sub:I!==null?"vendor bills, last 30 days":"needs Xero or QuickBooks"}),e.jsx(T,{icon:e.jsx(ms,{className:"h-4 w-4"}),label:"Net",value:I!==null?m(F.income-I,k):"Not available",sub:I!==null?"income minus billed expenses":"needs expenses"})]}),e.jsx($,{className:"overflow-hidden",children:X.length===0?e.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:"No paid invoices in the last 30 days, so there is nothing to break down yet."}):e.jsxs(O,{children:[e.jsx(z,{children:e.jsxs(y,{children:[e.jsx(l,{children:"Source"}),e.jsx(l,{children:"Type"}),e.jsx(l,{className:"text-right",children:"Amount"})]})}),e.jsx(V,{children:X.map(s=>e.jsxs(y,{children:[e.jsx(i,{children:s.account}),e.jsx(i,{children:e.jsx(C,{variant:"default",className:"capitalize",children:"income"})}),e.jsx(i,{className:"text-right font-mono",children:m(s.amount,k)})]},s.account))})]})})]})]}),e.jsx(ts,{open:ve,onOpenChange:L,children:e.jsxs(ns,{children:[e.jsx(as,{children:e.jsx(rs,{children:"New invoice"})}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(ee,{htmlFor:"inv-customer",children:"Customer"}),e.jsx(Z,{id:"inv-customer",placeholder:"Acme Corp",value:g,onChange:s=>ae(s.target.value)})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(ee,{htmlFor:"inv-amount",children:"Amount (USD)"}),e.jsx(Z,{id:"inv-amount",type:"number",min:"0",step:"0.01",placeholder:"2500",value:re,onChange:s=>oe(s.target.value)})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(ee,{htmlFor:"inv-due",children:"Due in (days)"}),e.jsx(Z,{id:"inv-due",type:"number",min:"0",step:"1",value:G,onChange:s=>ye(s.target.value)})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Will be created in ",ce(),j?"":" (preview only. Not connected yet)","."]})]}),e.jsxs(os,{children:[e.jsx(P,{variant:"outline",onClick:()=>L(!1),children:"Cancel"}),e.jsx(P,{onClick:Be,children:"Continue"})]})]})}),e.jsx(Ue,{...u.dialogProps})]})}function se({label:n,status:r,orgId:S,demo:p}){const a=Xe(S),x=r.connected,f=x&&!p&&r.integration&&!r.integration.id.startsWith("demo-"),b=async j=>{if(j.stopPropagation(),!!r.integration&&confirm(`Disconnect ${n}? Base will stop pulling finance data from it.`))try{await a.mutateAsync(r.integration.id),N.success(`${n} disconnected`)}catch(u){N.error(u?.message??`Failed to disconnect ${n}`)}};return e.jsxs(C,{variant:x?"default":"outline",className:"gap-1",children:[e.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${x?"bg-primary-foreground":"bg-muted-foreground"}`}),n,f?e.jsx("button",{type:"button",onClick:b,disabled:a.isPending,"aria-label":`Disconnect ${n}`,title:`Disconnect ${n}`,className:"ml-1 -mr-0.5 rounded p-0.5 hover:bg-primary-foreground/20 disabled:opacity-50",children:e.jsx(Re,{className:"h-3 w-3"})}):null]})}function T({icon:n,label:r,value:S,sub:p,trend:a,drill:x,onDrill:f,onClick:b}){return e.jsx(Ee,{icon:n,label:r,value:S,sub:p,trend:a,drill:x,onDrill:f,onClick:b})}export{Nt as component};

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.