1import{j as e,u as f,r as d,T as I}from"./elements-5kxJS_4j.js";import{A as j,j as N,q as L,L as v}from"./index-CtCeyryw.js";import{B as C}from"./BillingSideContentContainer-CJkKgLhW.js";import{R as w}from"./SupportLink-DCM4mU_A.js";import{A as S}from"./authorization-DRCBMAi9.js";import{u as P}from"./useRedesign-xeayEwR4.js";import"./grids-DGmfp9GI.js";import"./startOfDay-AazlW55I.js";import"./ManagePayment-Dmr654v8.js";import"./useIsMobile-DE0QDUth.js";import"./useAuthorization-XS6cSJ0I.js";const Q={title:"Payment Consent",showPropertySelector:!1,showAi:!1};function U(){return P()?e.jsx(A,{}):e.jsx(z,{})}function A(){const{t:n}=f(),[a]=j(),[p,m]=d.useState([]),u=N(s=>s.accounts),[y,b]=d.useState(),r=a.get("accountNumber")??void 0,l=a.has("subLedgerId")?Number(a.get("subLedgerId")):void 0;d.useEffect(()=>{var o;const s=u.find(t=>t.accountNumber===r&&t.subLedgerId===l)??u.at(0);b(s),L.getPayments({ownerId:s==null?void 0:s.ownerId,subLedgerId:(o=s==null?void 0:s.subLedgerId)==null?void 0:o.toString()}).then(t=>m(t.member)).catch(console.error)},[r,l]);const i="text-base font-semibold mb-1",x="mb-6",g=n("billing.paymentConsent.sectionOrder",{returnObjects:!0});return e.jsx(S,{controller:"Homeowner_v2",action:"Billing",children:e.jsxs("div",{className:"flex flex-col tablet:flex-row gap-6",children:[e.jsxs("div",{className:"tablet:w-2/3 p-horizontal-layout-sm tablet:p-horizontal-layout bg-base-fill rounded-xl","data-qa":"disclosures",children:[e.jsx("h1",{className:"text-xl font-semibold mb-12",children:n("billing.paymentConsent.documentTitle")}),Array.isArray(g)&&g.map(s=>e.jsxs("div",{children:[e.jsx("h2",{className:i,children:n(`billing.paymentConsent.header.${s.headerKey}`)}),s.bodyKeys.map(o=>e.jsx("p",{className:x,"data-qa":o,children:n(`billing.paymentConsent.body.${o}`)},o))]},s.headerKey))]}),e.jsx(C,{payments:p,selectedAccount:y})]})})}function z(){const{t:n}=f(),[a]=j(),[p,m]=d.useState(!0),[u,y]=d.useState([]),b=N(t=>t.accounts),r=a.get("accountNumber")??void 0,l=a.has("subLedgerId")?Number(a.get("subLedgerId")):void 0,i=new URLSearchParams;r&&i.set("accountNumber",r),typeof l=="number"&&i.set("subLedgerId",String(l));const x=`/billing${i.toString()?`?${i.toString()}`:""}`;d.useEffect(()=>{var c;const t=b.find(h=>h.accountNumber===r&&h.subLedgerId===l)??b.at(0);m(!0),L.getPayments({ownerId:t==null?void 0:t.ownerId,subLedgerId:(c=t==null?void 0:t.subLedgerId)==null?void 0:c.toString()}).then(h=>y(h.member)).catch(console.error).finally(()=>m(!1))},[r,l]);const g="text-lg font-bold",s="mb-5",o=n("billing.paymentConsent.sectionOrder",{returnObjects:!0});return e.jsx(S,{controller:"Homeowner_v2",action:"Billing",children:e.jsxs("div",{className:"flex flex-col md:flex-row bg-base-fill rounded-xl",children:[e.jsxs("div",{className:"md:w-2/3 p-horizontal-layout-sm sm:p-horizontal-layout","data-qa":"disclosures",children:[e.jsx("h1",{className:"text-2xl font-bold mb-5",children:n("billing.paymentConsent.documentTitle")}),Array.isArray(o)&&o.map(t=>e.jsxs("div",{children:[e.jsx("h2",{className:g,children:n(`billing.paymentConsent.header.${t.headerKey}`)}),t.bodyKeys.map(c=>e.jsx("p",{className:s,"data-qa":c,children:n(`billing.paymentConsent.body.${c}`)},c))]},t.headerKey))]}),e.jsxs("aside",{className:"p-horizontal-layout-sm sm:p-horizontal-layout md:w-2/5",children:[!p&&e.jsx(w,{payments:u}),e.jsx("div",{className:"float-right pt-3 pr-3",children:e.jsx(I,{i18nKey:"billing.paymentConsent.makePayment",components:{Link:e.jsx(v,{"data-qa":"billing-link",className:"text-base-link hover:underline",to:x})}})})]})]})})}export{U as Component,Q as handle};
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.