PageSourceSearch

https://billanalyzer.ai/assets/admin.ptc-daily-CT5aQfqm.js

js billanalyzer.ai collected 2026-10-05 14:40:53 UTC 4,284 bytes, 1 lines download raw bytes

1import{j as e,as as p,r,e as g,m as f}from"./index-C98cF--x.js";import{PTC_UTILITIES as j,utilityLabel as N,computeDailyPtcAll as y}from"./ptc-D0OKtm0P.js";function b(){const a=new Date;return`${a.getFullYear()}-${String(a.getMonth()+1).padStart(2,"0")}-${String(a.getDate()).padStart(2,"0")}`}function S(){const[a,m]=r.useState(b()),[x,l]=r.useState(!1),[u,h]=r.useState({ACE:[],JCPL:[],PSEG:[]}),[d,c]=r.useState(null);async function o(){l(!0),c(null);try{const t=await y(a);h(t)}catch(t){c(t?.message??String(t))}finally{l(!1)}}return r.useEffect(()=>{o()},[a]),e.jsxs("div",{className:"mx-auto max-w-5xl px-4 py-6",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 mb-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Daily Price-to-Compare"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Computed per-utility using the current NJ tariff rules (season = Jun–Sep summer, Oct–May winter)."})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"date",className:"border rounded-md px-2 py-1 text-sm bg-background",value:a,onChange:t=>m(t.target.value)}),e.jsxs("button",{onClick:o,className:"inline-flex items-center gap-1 rounded-md border px-2 py-1 text-sm hover:bg-muted",children:[x?e.jsx(g,{className:"h-4 w-4 animate-spin"}):e.jsx(f,{className:"h-4 w-4"}),"Refresh"]})]})]}),d&&e.jsx("div",{className:"mb-4 rounded-md border border-destructive/30 bg-destructive/10 p-2 text-sm text-destructive",children:d}),e.jsx("div",{className:"grid gap-4 md:grid-cols-3",children:j.map(t=>{const i=u[t.code]??[],n=i[0];return e.jsxs("div",{className:"rounded-lg border p-4 bg-card",children:[e.jsx("div",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:t.code}),e.jsx("div",{className:"text-sm font-medium mb-2",children:N(t.code)}),i.length===0?e.jsx("div",{className:"text-sm text-muted-foreground",children:"No components loaded."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-3xl font-semibold tabular-nums",children:["$",n.total_ptc.toFixed(5),e.jsx("span",{className:"text-sm text-muted-foreground font-normal",children:" /kWh"})]}),e.jsxs("div",{className:"text-xs text-muted-foreground mb-3",children:["Headline tier: ",n.usage_tier," · season ",n.season," · effective ",n.effective_from]}),e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{className:"text-muted-foreground",children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-left font-normal py-1",children:"Tier"}),e.jsx("th",{className:"text-right font-normal py-1",children:"BGS"}),e.jsx("th",{className:"text-right font-normal py-1",children:"Trans"}),e.jsx("th",{className:"text-right font-normal py-1",children:"Recon"}),t.code!=="PSEG"&&e.jsx("th",{className:"text-right font-normal py-1",children:"TEC"}),t.code!=="PSEG"&&e.jsx("th",{className:"text-right font-normal py-1",children:"RMR"}),e.jsx("th",{className:"text-right font-medium py-1",children:"Total"})]})}),e.jsx("tbody",{children:i.map(s=>e.jsxs("tr",{className:"border-t",children:[e.jsx("td",{className:"py-1",children:s.usage_tier}),e.jsx("td",{className:"py-1 text-right tabular-nums",children:s.bgs_rate.toFixed(5)}),e.jsx("td",{className:"py-1 text-right tabular-nums",children:s.transmission_rate.toFixed(5)}),e.jsx("td",{className:"py-1 text-right tabular-nums",children:s.reconciliation_rate.toFixed(5)}),t.code!=="PSEG"&&e.jsx("td",{className:"py-1 text-right tabular-nums",children:s.tec_rate.toFixed(5)}),t.code!=="PSEG"&&e.jsx("td",{className:"py-1 text-right tabular-nums",children:s.rmr_rate.toFixed(5)}),e.jsx("td",{className:"py-1 text-right font-medium tabular-nums",children:s.total_ptc.toFixed(5)})]},s.usage_tier))})]})]})]},t.code)})}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-4",children:["ACE / JCPL total = BGS + Reconciliation + Transmission + TEC + RMR. PSE&G total = BGS + Transmission + Reconciliation. Component values come from ",e.jsx("code",{children:"utility_ptc_rate_components"}),"; the newest set with effective_date ≤ selected day is used."]})]})}const C=()=>e.jsx(p,{policy:{anyOf:["admin","super_admin","tenant_admin","broker","finance_admin"],redirectToLogin:!0},children:e.jsx(S,{})});
1export{C 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.