PageSourceSearch

https://rehobethalabama.com/assets/BudgetVisualizer-BQ-bNc6S.js

js rehobethalabama.com collected 2026-09-25 07:56:38 UTC 8,964 bytes, 1 lines download raw bytes

1import{j as e}from"./markdown-DtjUNGiI.js";import{r as x,c as w,R as N}from"./vendor-BwYRWotU.js";import{d as b}from"./index-DSU2RxiB.js";import{l as y,w as u,D as k,z as S,E as A,G as V}from"./firebase-CwtiMJt_.js";import{a$ as g,ap as f,T as $,b0 as B}from"./icons-Ck4WJybW.js";import"./geo-D5jDzFjM.js";const z=t=>{const[r,n]=x.useState([]),[i,a]=x.useState(!0),[l,c]=x.useState([]);return x.useEffect(()=>{if(!t)return;const s=y(b,`tenants/${t}/budgets/road-maintenance`),d=u(s,o=>{if(o.exists()){const h=o.data();n([{id:"road-maintenance",...h,history:[{month:"Jan",spend:4e4},{month:"Feb",spend:35e3},{month:"Mar",spend:8e4},{month:"Apr",spend:42e3},{month:"May",spend:123e3}]}])}}),m=k(b,`tenants/${t}/alerts`),j=S(m,V("createdAt","desc"),A(10)),v=u(j,o=>{const h=o.docs.map(p=>({id:p.id,...p.data()}));c(h),a(!1)});return()=>{d(),v()}},[t]),{budgets:r,alerts:l,loading:i}},R=({budget:t})=>{const r=t.currentSpend||0,n=t.committedPO||0,i=t.totalAllocated||1,a=r+n,l=Math.min(a/i*100,100),c=l>90?"from-rose-500 to-red-600":l>75?"from-amber-400 to-orange-500":"from-emerald-400 to-teal-500";return e.jsxs("div",{className:"bg-white rounded-3xl p-8 shadow-xl shadow-slate-200/50 border border-slate-100 mb-6 group transition-all hover:scale-[1.02] active:scale-100",children:[e.jsxs("div",{className:"flex justify-between items-start mb-6",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-bold text-slate-800 text-lg tracking-tight",children:t.name}),e.jsx("span",{className:"text-[10px] font-semibold text-slate-400 bg-slate-50 px-2 py-0.5 rounded border border-slate-100 mt-2 inline-block uppercase tracking-wider",children:t.code})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("div",{className:"text-2xl font-bold text-slate-900 tracking-tight",children:["$",t.totalAllocated.toLocaleString()]}),e.jsx("div",{className:"text-[9px] text-slate-400 uppercase font-bold tracking-wider mt-1",children:"Allocation"})]})]}),e.jsxs("div",{className:"relative pt-1 mt-8",children:[e.jsxs("div",{className:"flex mb-3 items-center justify-between",children:[e.jsx("div",{children:e.jsxs("span",{className:`text-[10px] font-black inline-block py-1.5 px-3 uppercase rounded-xl tracking-widest ${l>90?"text-rose-600 bg-rose-50 shadow-sm shadow-rose-200/50":"text-emerald-600 bg-emerald-50 shadow-sm shadow-emerald-200/50"}`,children:[l.toFixed(1),"% Utilization"]})}),e.jsx("div",{className:"text-right",children:e.jsxs("span",{className:"text-[10px] font-black text-slate-500 uppercase tracking-widest",children:["Available: $",(i-a).toLocaleString()]})})]}),e.jsx("div",{className:"overflow-hidden h-2.5 mb-4 flex rounded-full bg-slate-100",children:e.jsx("div",{style:{width:`${l}%`},className:`h-full bg-linear-to-r ${c} transition-all duration-1000 ease-out`})})]}),e.jsxs("div",{className:"mt-6 flex items-center p-4 rounded-2xl bg-slate-50 border border-slate-100 group-hover:bg-blue-50/50 group-hover:border-blue-100 transition-all",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-slate-100 flex items-center justify-center mr-3",children:e.jsx(B,{className:"w-4 h-4 text-slate-600"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[9px] font-bold text-slate-500 uppercase tracking-widest",children:"Fiscal Insight"}),e.jsx("p",{className:"text-xs text-slate-600 font-medium leading-tight mt-0.5",children:l>80?"Burn rate exceeds historical seasonal averages. Depletion projected in 42 days.":"Financial velocity stable. Optimized for remainder of fiscal period."})]})]})]})},M=()=>{const{tenantId:t}=w(),{budgets:r,alerts:n,loading:i}=z(t),[a,l]=N.useState({revenueVar:0,expenseVar:0}),c=(s,d)=>{l(m=>({...m,[d]:s}))};return i?e.jsxs("div",{className:"h-screen bg-slate-950 flex flex-col items-center justify-center",children:[e.jsx("div",{className:"w-16 h-16 border-4 border-blue-500/20 border-t-blue-500 rounded-full animate-spin mb-8"}),e.jsx("div",{className:"text-white font-black uppercase tracking-[0.3em] text-sm animate-pulse",children:"Initializing GovStax Orbit Ledger"})]}):e.jsxs("div",{className:"flex h-full bg-slate-50 overflow-hidden font-sans",children:[e.jsxs("div",{className:"flex-1 p-10 overflow-y-auto custom-scrollbar bg-slate-50",children:[e.jsxs("div",{className:"flex items-center justify-between mb-10",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"w-12 h-12 bg-slate-900 rounded-xl flex items-center justify-center mr-4 shadow-lg shadow-slate-200",children:e.jsx(g,{className:"w-6 h-6 text-white"})}),e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-slate-900 tracking-tight",children:["GovStax Orbit ",e.jsx("span",{className:"text-slate-500 font-medium tracking-normal",children:"Ledger"})]}),e.jsx("p",{className:"text-[10px] font-semibold text-slate-400 uppercase tracking-wider mt-0.5",children:"Financial Oversight & Strategy"})]})]}),e.jsxs("div",{className:"flex gap-4 p-4 bg-white rounded-2xl border border-slate-200 shadow-sm",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("label",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest block mb-2",children:["Revenue V
1ariance (",a.revenueVar,"%)"]}),e.jsx("input",{type:"range",min:"-20",max:"20",value:a.revenueVar,onChange:s=>c(parseInt(s.target.value),"revenueVar"),className:"w-full accent-emerald-500"})]}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("label",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest block mb-2",children:["Expense Variance (",a.expenseVar,"%)"]}),e.jsx("input",{type:"range",min:"-20",max:"20",value:a.expenseVar,onChange:s=>c(parseInt(s.target.value),"expenseVar"),className:"w-full accent-rose-500"})]}),e.jsx("button",{onClick:()=>l({revenueVar:0,expenseVar:0}),className:"px-4 py-2 bg-slate-100 hover:bg-slate-200 rounded-xl text-[10px] font-black uppercase text-slate-600",children:"Reset"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[r.map(s=>{const d={...s,totalAllocated:s.totalAllocated*(1+a.revenueVar/100),currentSpend:s.currentSpend*(1+a.expenseVar/100)};return e.jsx(R,{budget:d},s.id)}),r.length===0&&e.jsxs("div",{className:"col-span-full bg-white border border-slate-200 rounded-[3rem] p-20 text-center shadow-xl shadow-slate-100 flex flex-col items-center",children:[e.jsx("div",{className:"w-24 h-24 bg-slate-100 rounded-full flex items-center justify-center mb-8",children:e.jsx(g,{className:"w-12 h-12 text-slate-300"})}),e.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight uppercase",children:"Ledger Inactive"}),e.jsxs("p",{className:"text-slate-500 mt-4 max-w-md text-sm leading-relaxed",children:["Financial data registers are empty. Activate the ",e.jsx("span",{className:"text-indigo-600 font-bold",children:'"Seed Demo Data"'})," protocol in the administration sidebar to initialize."]})]})]})]}),e.jsxs("div",{className:"w-104 bg-white border-l border-slate-200 flex flex-col shadow-2xl z-20 overflow-hidden",children:[e.jsxs("div",{className:"p-8 border-b border-slate-100 bg-white",children:[e.jsxs("h3",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest flex items-center mb-1",children:[e.jsx(f,{className:"w-4 h-4 mr-2 text-slate-400"}),"Governance Monitoring"]}),e.jsx("p",{className:"text-[9px] font-medium text-slate-400 uppercase tracking-wider ml-6 opacity-60",children:"Anomaly & Compliance Intelligence"})]}),e.jsxs("div",{className:"flex-1 p-10 space-y-6 overflow-y-auto custom-scrollbar",children:[n.map(s=>e.jsx("div",{className:`p-6 rounded-4xl border transition-all hover:scale-[1.02] ${s.severity==="critical"?"bg-rose-50/50 border-rose-100 shadow-lg shadow-rose-500/5":s.severity==="warning"?"bg-amber-50/50 border-amber-100 shadow-lg shadow-amber-500/5":"bg-blue-50/50 border-blue-100 shadow-lg shadow-blue-500/5"}`,children:e.jsxs("div",{className:"flex items-start",children:[e.jsx("div",{className:`p-3 rounded-2xl mr-4 shadow-xl ${s.severity==="critical"?"bg-rose-500 shadow-rose-500/30":s.severity==="warning"?"bg-amber-500 shadow-amber-500/30":"bg-blue-500 shadow-blue-500/30"}`,children:e.jsx($,{className:"w-5 h-5 text-white"})}),e.jsxs("div",{className:"pt-1",children:[e.jsx("h4",{className:"text-sm font-bold tracking-tight mb-1 text-slate-900",children:s.title}),e.jsx("p",{className:"text-xs text-slate-600 leading-relaxed font-normal",children:s.message}),e.jsx("div",{className:"mt-4 flex items-center",children:e.jsx("button",{className:"text-[10px] font-bold uppercase tracking-wider text-slate-500 hover:text-slate-800 transition-colors",children:"Acknowledge"})})]})]})},s.id)),n.length===0&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-center opacity-30",children:[e.jsx(f,{className:"w-20 h-20 text-slate-300 mb-6"}),e.jsx("div",{className:"text-[10px] font-black uppercase tracking-[0.3em] text-slate-400",children:"Sentinel Scan Nominal"})]})]})]})]})};export{M as BudgetVisualizer};

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.