PageSourceSearch

https://ambrook.com/_next/static/chunks/pages/app/settings/subscription-2e07cbb952eabbc3.js

js ambrook.com collected 2026-09-24 20:50:04 UTC 23,079 bytes, 1 lines download raw bytes

1try{!function(){var n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},e=(new n.Error).stack;e&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[e]="458035e7-a22f-4b63-8654-cf5115844b48",n._sentryDebugIdIdentifier="sentry-dbid-458035e7-a22f-4b63-8654-cf5115844b48")}()}catch(n){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8749],{12211:(n,e,i)=>{var t=i(70178),l=i(65048);n.exports=function(n){return t(l(n))}},12264:(n,e,i)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/app/settings/subscription",function(){return i(25996)}])},25996:(n,e,i)=>{"use strict";i.r(e),i.d(e,{__N_SSP:()=>nK,default:()=>nY});var t=i(37876),l=i(31527),a=i(269),o=i(27809),r=i(59267),s=i(24973),c=i(19555),u=i(24573),d=i(3838),g=i(6448),h=i(79686),p=i(50869),b=i(93554),f=i(15066),m=i(52200),A=i(11355),v=i(93742),y=i(89028),x=i(94211),j=i(28304),C=i(52336),k=i(55361),w=i(37507),S=i(20104),I=i(49535),P=i(8891),E=i(1806),B=i(14232),_=i(52244),M=i(34178),T=i(7811),R=i(97693),O=i(56155),W=i(82077),z=i(99576),D=i(28842),N=i(71763),q=i(70208),F=i(34366),$=i(90810),K=i(35982),Y=i(14811),J=i(3285),L=i(90420),H=i(9479),U=i(96427),G=i(27630),V=i(78248),X=i(64177);function Z(){let n=(0,U._)(["\n    query BillingRetentionOffers($orgId: ID!, $cancellationReason: BillingSubscriptionCancellationReason!) {\n  organization(orgId: $orgId) {\n    id\n    billingRetentionOffers(cancellationReason: $cancellationReason) {\n      type\n      trialExtensionDate\n    }\n  }\n}\n    "]);return Z=function(){return n},n}function Q(){let n=(0,U._)(["\n    mutation AcceptBillingRetentionOffer($input: AcceptBillingRetentionOfferInput!) {\n  acceptBillingRetentionOffer(input: $input) {\n    id\n    billingSubscription {\n      id\n      status\n      timing {\n        frequency\n        startDate\n      }\n      cancelAtPeriodEnd\n      cancelAtMs\n    }\n  }\n}\n    "]);return Q=function(){return n},n}let nn={},ne=(0,G.J1)(Z()),ni=(0,G.J1)(Q());function nt(n){let e={...nn,...n};return X.n(ni,e)}var nl=i(99595),na=i.n(nl);function no(){let n=(0,U._)(["\n    mutation CancelBillingSubscription($input: CancelSubscriptionInput!) {\n  cancelSubscription(input: $input) {\n    id\n    billingSubscription {\n      timing {\n        frequency\n        startDate\n      }\n      status\n      cancelAtPeriodEnd\n      cancelAtMs\n    }\n  }\n}\n    "]);return no=function(){return n},n}let nr={},ns=(0,G.J1)(no()),nc=[{label:"Too expensive",value:W.EW.TooExpensive},{label:"Missing features I need",value:W.EW.MissingFeatures},{label:"Switching to another platform",value:W.EW.SwitchingPlatform},{label:"Glitches in the product",value:W.EW.Bugs},{label:"I'll try again in 2027",value:W.EW.Timing}],nu={label:"Something else",value:W.EW.Other};var nd=i(30964),ng=i(68813),nh=i(95110),np=i(75545),nb=i(91811),nf=i(33437);let nm=n=>{let{subscriptionId:e,reason:i,onBookingComplete:l,onContinueCancellation:a}=n,[o,s]=(0,B.useState)(!1),{userData:u,calEmbedProps:d,trackOfferShown:g,handleDismiss:p,handleShowScheduler:m}=(n=>{let{subscriptionId:e,reason:i,onBookingComplete:t,onDismiss:l,setShowScheduler:a}=n,o=(0,nb.Ay)(),s=(0,N.A)(),[u]=nt(),d=(0,B.useRef)(u);d.current=u;let{data:g,loading:h}=(0,nf.S3)({variables:{orgId:s}}),p=(0,B.useMemo)(()=>{var n,e,i,t,l,a,r,s,c;return(null==o?void 0:o.email)&&!h?{businessName:null!=(r=null==g||null==(e=g.organization)||null==(n=e.profile)?void 0:n.businessName)?r:null,email:o.email,firstName:null!=(s=null==g||null==(t=g.viewer.profile)||null==(i=t.name)?void 0:i.first)?s:null,lastName:null!=(c=null==g||null==(a=g.viewer.profile)||null==(l=a.name)?void 0:l.last)?c:null}:null},[null==o?void 0:o.email,g,h]);(0,B.useEffect)(()=>{!async function(){let n=await (0,nd.T)();n("ui",{hideEventTypeDetails:!0,layout:"month_view",styles:{branding:{brandColor:f.Ay.green[50]}},theme:"light"}),n("on",{action:"bookingSuccessful",callback:()=>{t()}})}()},[t,s,i,e]);let b=(0,B.useCallback)(()=>{(0,c.track)(r.ti.BillingRetentionOfferShown,{offerType:"onboarding",reason:i,subscriptionId:e})},[i,e]),m=(0,B.useCallback)(()=>{(0,c.track)(r.ti.BillingRetentionOfferDismissed,{offerType:"onboarding",reason:i,subscriptionId:e}),l()},[l,i,e]),A=(0,B.useCallback)(()=>{a(!0),d.current({variables:{input:{cancellationReason:i,offerType:W.kzK.Onboarding,orgId:s,subscriptionId:e}}}).catch(()=>{})},[a,i,s,e]);return(0,B.useMemo)(()=>{var n,e,i;return{calEmbedProps:{calLink:nh.nT,config:{"business-name":null!=(n=null==p?void 0:p.businessName)?n:"",email:null!=(e=null==p?void 0:p.email)?e:"",layout:"month_view","metadata[fbc]":(0,np.Ri)("_fbc")||"","metadata[fbp]":(0,np.Ri)("_fbp")||"","metadata[firstName]":(null==p?void 0:p.firstName)||"","metadata[gclid]":(0,np.Ri)("_gclid")||"","metadata[lastName]":(null==p?void 0:p.lastName)||"","metadata[liFatId]":(0,np.Ri)("_li_fat_id")||"","metadata[userId]":null!=(i=null==o?void 0:o.uid)?i:"",name:"".concat(null==p?void 0:p.firstName," ").concat(null==p?void 0:p.lastName)},style:{height:"auto",overflow:"scroll",width:"100%"}},handleDismiss:m,handleShowScheduler:A,trackOfferShown:b,userData:p}},[null==o?void 0:o.uid,m,A,b,p])})({onBookingComplete:l,onDismiss:a,reason:i,setShowScheduler:s,subscriptionId:e});return((0,B.useEffect)(()=>{g()},[g]),o)?(0,t.jsxs)(x.A,{column:!0,spacing:1.5,children:[(0,t.jsx)(I.A,{variant:"body",medium:!0,children:"Schedule your free onboarding session"}),(0,t.jsx)(I.A,{variant:"small",children:"Pick a time that works for you. We'll walk you through the features that matter most for your business."}),u?(0,t.jsx)(ng.U,{$negativeMargin:"1rem",children:(0,t.jsx)(nd.A,{...d})}):(0,t.jsx)(x.A,{justify:"center",children:(0,t.jsx)(C.A,{})})]}):(0,t.jsxs)(x.A,{column:!0,spacing:1.5,children:[(0,t.jsxs)(b.A,{bgColor:f.Ay.yellow[30],padding:[1,1.5],radius:"md",shadow:"extraLargeYellow",column:!0,spacing:1,children:[(0,t.jsx)(I.A,{variant:"large",bold:!0,children:"Not sure how to get started?"}),(0,t.jsx)(I.A,{variant:"body",children:"Book a free 1-on-1 onboarding session with our team. We'll walk you through the features that matter most for your business."}),(0,t.jsx)(h.A,{fullWidth:!0,color:"yellow",size:"large",onClick:m,children:"Schedule Free Onboarding"})]}),(0,t.jsx)(h.A,{variant:"text",color:"brown",onClick:p,children:"Continue with cancellation"})]})},nA=n=>{let{subscriptionId:e,orgId:i,cancellationReason:l,trialExtensionDate:s,onAccept:u,onContinueCancellation:d}=n,[g,{loading:p}]=nt(),[m,A]=(0,B.useState)(null),v=(0,B.useMemo)(()=>s?a.A.long((0,o.Ay)(s)):null,[s]);(0,B.useEffect)(()=>{(0,c.track)(r.ti.BillingRetentionOfferShown,{offerType:"trial_extension",subscriptionId:e,trialExtensionDate:s})},[e,s]);let y=(0,B.useCallback)(async()=>{try{A(null),await g({variables:{input:{cancellationReason:l,offerType:W.kzK.TrialExtension,orgId:i,subscriptionId:e}}}),(0,c.track)(r.ti.BillingRetentionOfferAccepted,{offerType:"trial_extension",subscriptionId:e,trialExtensionDate:s}),u()}catch(n){A("Couldn't extend trial. Please contact support.")}},[e,i,l,g,u,s]),j=(0,B.useCallback)(()=>{(0,c.track)(r.ti.BillingRetentionOfferDismissed,{offerType:"trial_extension",subscriptionId:e,trialExtensionDate:s}),d()},[e,s,d]);return(0,t.jsxs)(x.A,{column:!0,spacing:1.5,children:[(0,t.jsxs)(b.A,{bgColor:f.Ay.yellow[30],padding:[1,1.5],radius:"md",shadow:"extraLargeYellow",column:!0,spacing:1,children:[(0,t.jsx)(I.A,{variant:"large",bold:!0,children:"Looking to get started in 2026?"}),(0,t.jsxs)(I.A,{variant:"body",children:["Would you like to extend your free trial",null!==v?" until ".concat(v):"","? No commitment—just more time to explore when it works for you."]}),null!==m&&(0,t.jsx)(I.A,{variant:"small",color:"red",children:m}),(0,t.jsx)(h.A,{fullWidth:!0,color:"yellow",size:"large",onClick:y,isLoading:p,disabled:p,children:"Extend My Trial"})]}),(0,t.jsx)(h.A,{variant:"text",color:"brown",onClick:j,disabled:p,children:"Continue with cancellation"})]})},nv=n=>{let{open:e,onClose:i,subscription:l}=n,[s,u]=(0,B.useState)(null),[d,g]=(0,B.useState)(""),[p,b]=(0,B.useState)(null),[f,m]=(0,B.useState)(null),[A,v]=(0,B.useState)(null),y=(0,q.nd)(),j=(0,q.W4)(),C=(0,N.A)(),[k,{loading:w}]=function(n){let e={...nn,...void 0};return V._(ne,e)}(),{submitCancellation:S,loading:P,error:E,reset:_,cancellationReasons:M,isCancelled:T}=(n=>{let{subscription:e,onSuccess:i}=n,[t,l]=(0,B.useState)(!1),[a,o]=(0,B.useState)(null),[s]=function(n){let e={...nr,...void 0};return X.n(ns,e)}(),[u,d]=(0,B.useState)(!1),g=(0,N.A)(),h=(0,B.useMemo)(()=>na()(nc).concat([nu]),[]),p=(0,B.useCallback)(async(n,t)=>{l(!0),o(null);try{await s({variables:{input:{additionalNotes:t,orgId:g,reasonCodes:[n]}}}),(0,c.track)(r.ti.BillingSubscriptionChangeRequested,{subscriptionId:e.id}),d(!0),i()}catch(n){console.error("Failed to cancel subscription",n),o("Something went wrong while attempting to cancel. Please try again or c
1ontact support if the issue persists.")}finally{l(!1)}},[g,i,s,e]),b=(0,B.useCallback)(()=>{o(null),l(!1)},[]);return(0,B.useMemo)(()=>({cancellationReasons:h,error:a,isCancelled:u,loading:t,reset:b,submitCancellation:p}),[p,a,t,b,h,u])})({onSuccess:()=>{_()},subscription:l}),R=(0,B.useCallback)(()=>{i(),_(),u(null),g(""),b(null),m(null),v(null)},[i,_]),O=(0,B.useCallback)((n,e)=>{m(n),b(null),e&&v(e)},[]),z=(0,B.useCallback)(async()=>{var n,e;if(!s)return;let{data:i}=await k({variables:{cancellationReason:s,orgId:C}}),t=null!=(e=null==i||null==(n=i.organization)?void 0:n.billingRetentionOffers)?e:[];if(t.length>0)return void b(t[0]);await S(s,d)},[s,d,S,k,C]),D=(0,B.useCallback)(async()=>{s&&await S(s,d)},[s,d,S]),F=(0,B.useCallback)(n=>{u(n)},[]);return(0,t.jsx)(K.A,{open:e,onClose:R,variant:"bottom-sheet",desktopVariant:"modal",title:T||l.cancelAtPeriodEnd?"Subscription Cancelled":f===W.kzK.TrialExtension?"Trial Extended!":f===W.kzK.Onboarding?"Onboarding Scheduled!":p?"Before you go...":"Cancel Subscription",buttonPosition:"none",children:(0,t.jsx)(x.A,{column:!0,spacing:2,children:T||l.cancelAtMs?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(I.A,{variant:"body",children:"Thank you for your feedback! We'll use it to improve Ambrook."}),(0,t.jsxs)(I.A,{variant:"body",children:["You can continue using Ambrook until the end of your"," ",l.status===W.ZNH.Trialing?"trial ":"billing ","period on"," ",a.A.shortNumeric((0,o.Ay)(l.cancelAtMs)),"."]}),(0,t.jsx)(I.A,{variant:"body",children:"You can reactivate your subscription at any time."}),(0,t.jsxs)(I.A,{variant:"body",children:["If you have any questions, please"," ",(0,t.jsx)($.A,{onClick:()=>y.toggleChat(),children:"contact support."})]}),(0,t.jsxs)(x.A,{spacing:1,children:[(0,t.jsx)(h.A,{fullWidth:!0,light:!0,color:"green",onClick:()=>j("Hello, I'd like to reactivate my subscription."),children:"Reactivate"}),(0,t.jsx)(h.A,{fullWidth:!0,light:!0,color:"brown",onClick:R,children:"Close"})]})]}):f===W.kzK.TrialExtension?(0,t.jsxs)(x.A,{column:!0,spacing:1.5,children:[(0,t.jsxs)(I.A,{variant:"body",children:["Great news! Your free trial has been extended",A?" until ".concat(a.A.long((0,o.Ay)(A))):"",". Take all the time you need to explore Ambrook."]}),(0,t.jsxs)(I.A,{variant:"body",children:["If you have any questions, feel free to"," ",(0,t.jsx)($.A,{onClick:()=>y.toggleChat(),children:"reach out to our team"}),"."]}),(0,t.jsx)(h.A,{fullWidth:!0,color:"green",onClick:R,children:"Continue"})]}):f===W.kzK.Onboarding?(0,t.jsxs)(x.A,{column:!0,spacing:1.5,children:[(0,t.jsx)(I.A,{variant:"body",children:"We're looking forward to meeting with you! Check your email for the calendar invite."}),(0,t.jsxs)(I.A,{variant:"body",children:["If you have any questions before then, feel free to"," ",(0,t.jsx)($.A,{onClick:()=>y.toggleChat(),children:"reach out to our team"}),"."]}),(0,t.jsx)(h.A,{fullWidth:!0,color:"green",onClick:R,children:"Continue"})]}):(null==p?void 0:p.type)===W.kzK.Onboarding&&s?(0,t.jsx)(nm,{subscriptionId:l.id,reason:s,onBookingComplete:()=>O(W.kzK.Onboarding),onContinueCancellation:D}):(null==p?void 0:p.type)===W.kzK.TrialExtension&&s&&p.trialExtensionDate?(0,t.jsx)(nA,{subscriptionId:l.id,orgId:C,cancellationReason:s,trialExtensionDate:p.trialExtensionDate,onAccept:()=>O(W.kzK.TrialExtension,p.trialExtensionDate),onContinueCancellation:D}):(0,t.jsxs)(x.A,{column:!0,spacing:2,children:[(0,t.jsxs)(x.A,{column:!0,spacing:1.5,children:[(0,t.jsx)(I.A,{variant:"body",children:"Sorry to see you go! We'd love to hear what we could have done better. Your feedback goes a long way to help us improve Ambrook for folks like you."}),(0,t.jsx)(L.Ay,{name:"cancellation-reason",value:s,onChange:F,children:M.map(n=>{let{label:e,value:i}=n;return(0,t.jsx)(Y.A,{value:i,control:(0,t.jsx)(J.A,{}),label:e},i)})}),s===W.EW.Other&&(0,t.jsxs)(x.A,{column:!0,spacing:.5,children:[(0,t.jsx)(I.A,{variant:"body",children:"We'd really appreciate a few words about why you're leaving:"}),(0,t.jsx)(H.A,{autoFocus:!0,multiline:!0,value:d,onChange:n=>g(n.target.value),placeholder:"What can we do to improve?"})]}),!!E&&(0,t.jsx)(I.A,{color:"red",variant:"small",children:E})]}),(0,t.jsxs)(x.A,{column:!0,spacing:1,children:[(0,t.jsx)(h.A,{fullWidth:!0,onClick:z,disabled:!s||P||w,color:"red",isLoading:P||w,children:"Cancel Subscription"}),(0,t.jsx)(h.A,{fullWidth:!0,light:!0,color:"brown",onClick:R,children:"Go Back"})]})]})})})};function ny(){let n=(0,U._)(["\n    mutation ResumeBillingSubscription($input: ResumeSubscriptionInput!) {\n  resumeSubscription(input: $input) {\n    id\n    billingSubscription {\n      id\n      timing {\n        frequency\n        startDate\n      }\n      status\n      cancelAtPeriodEnd\n      cancelAtMs\n    }\n  }\n}\n    "]);return ny=function(){return n},n}let nx={},nj=(0,G.J1)(ny());var nC=i(29627);let nk=n=>{let{subscription:e}=n,i=(0,D.A)(),l=(0,N.A)(),s=(0,z.m)(),[u]=function(n){let e={...nx,...void 0};return X.n(nj,e)}(),d=(0,q.W4)(),[g,p]=(0,B.useState)(!1),m=(0,B.useCallback)(()=>{(0,c.track)(r.ti.BillingSubscriptionChangeRequested,{subscriptionId:e.id}),d("Hello, I'd like to ".concat(e.product===W.eOY.FullService?"change":"upgrade"," my subscription."))},[d,e.id,e.product]),A=e.cancelAtPeriodEnd&&!F.A.isTerminatedStatus(e.status),v=(0,B.useCallback)(()=>{i("/get-started/plan")},[i]),y=(0,B.useCallback)(async()=>{try{let{errors:n}=await u({errorPolicy:"all",variables:{input:{orgId:l}}});s(void 0,n?[...n]:void 0)}catch(n){s([{message:"Something went wrong keeping your plan. Please try again or c
1ontact support if the issue persists."}])}},[u,l,s]),j=e.product!==W.eOY.FullService&&(e.timing.frequency===W.Xl9.Monthly||e.status===W.ZNH.Trialing)&&!e.cancelAtPeriodEnd&&!F.A.isTerminatedStatus(e.status),C=(0,B.useCallback)(()=>{(0,c.track)(r.ti.BillingSubscriptionChangeRequested,{subscriptionId:e.id}),p(!0)},[e.id]);return(0,t.jsxs)(b.A,{variant:"outlined",borderColor:f.Ay.yellow[50],bgColor:f.Ay.brown[1],showShadow:"hover",shadow:"extraLargeYellow",column:!0,padding:[.75,1.5],spacing:[1,1.5],children:[(0,t.jsxs)(x.A,{column:!0,spacing:[.25,.5,.75],children:[(0,t.jsxs)(x.A,{justify:"space-between",spacing:.5,children:[(0,t.jsx)(I.A,{variant:["body","large"],medium:!0,children:nC.A.planName(e)}),(0,t.jsxs)(x.A,{spacing:1,align:"center",children:[(0,t.jsx)(h.A,{size:["small","medium"],light:!0,color:"brown",transparentColor:!0,onClick:m,children:"Change Plan"}),(e.cancelAtPeriodEnd||F.A.isTerminatedStatus(e.status))&&(0,t.jsx)(h.A,{size:["small","medium"],color:"green",onClick:A?y:v,children:A?"Keep Plan":"Renew"}),j&&(0,t.jsx)(h.A,{size:["small","medium"],color:"red",light:!0,transparentColor:!0,onClick:C,children:"Cancel"})]})]}),F.A.isCurrentlySubscribedStatus(e.status)?(0,t.jsxs)(I.A,{variant:["small","body"],children:[e.cancelAtMs?"":nC.A.frequency(e),e.cancelAtMs&&"Will end on ".concat(a.A.medium((0,o.Ay)(e.cancelAtMs)))]}):(0,t.jsx)(I.A,{variant:["small","body"],children:e.cancelAtMs?"Ended on ".concat(a.A.medium((0,o.Ay)(e.cancelAtMs)),"."):"Canceled."})]}),(0,t.jsx)(nv,{open:g,subscription:e,onClose:()=>p(!1)})]})};var nw=i(29700),nS=i(89387),nI=i.n(nS),nP=i(16338),nE=i(29231),nB=i(27250);function n_(){let n=(0,U._)(["\n    fragment BillingSubscriptionForBillingPage on BillingSubscription {\n  id\n  limits {\n    maxEntities\n  }\n  timing {\n    frequency\n    startDate\n  }\n  pricing {\n    type\n    flatFee\n    perEntity\n  }
1\n  discounts {\n    id\n    coupon {\n      id\n      name\n      percentOff\n    }\n  }\n  product\n  status\n  cancelAtPeriodEnd\n  cancelAtMs\n  outstandingBalanceCents\n}\n    "]);return n_=function(){return n},n}function nM(){let n=(0,U._)(["\n    query SubscriptionScreen($orgId: ID!) {\n  organization(orgId: $orgId) {\n    id\n    billingPaymentMethods {\n      ...BillingPaymentMethodPreview\n    }\n    billingSubscription {\n      ...BillingSubscriptionForBillingPage\n    }\n    billingInvoices {\n      ...BillingInvoicePreview\n    }\n  }\n}\n    ","\n","\n",""]);return nM=function(){return n},n}function nT(){let n=(0,U._)(["\n    mutation RefreshInvoicePdf($input: RefreshInvoicePdfInput!) {\n  refreshInvoicePdf(input: $input) {\n    invoice {\n      ...BillingInvoicePreview\n    }\n    userErrors {\n      message\n      code\n    }\n  }\n}\n    ",""]);return nT=function(){return n},n}let nR={},nO=(0,G.J1)(n_()),nW=(0,G.J1)(nM(),nE.H,nO,nE.T),nz=(0,G.J1)(nT(),nE.T),nD=n=>{let{children:e}=n;return(0,t.jsxs)(x.A,{column:!0,spacing:1,children:[(0,t.jsx)(k.A,{title:"Subscription",parentHref:"/app/settings",showBack:"mobile-only",endActions:(0,t.jsx)(P.A,{})}),(0,t.jsx)(j.A,{gutter:"responsive",column:!0,spacing:2,children:e})]})},nN=n=>{var e;let{invoice:i}=n,[l]=function(n){let e={...nR,...void 0};return X.n(nz,e)}(),{downloadToCache:r}=(0,v.o)(),{queueSnackbar:c,dequeueSnackbar:d}=(0,S.xt)(),h=(0,B.useCallback)(async n=>{let e=n.source.pdfUrl,i=c({autoHideDuration:null,message:"Preparing invoice for download...",startIcon:(0,t.jsx)(C.A,{size:"xsmall"})});if(!e){var a,o;e=null==(o=(await l({variables:{input:{invoiceId:n.id}}})).data)||null==(a=o.refreshInvoicePdf.invoice)?void 0:a.source.pdfUrl}if(d(i),!e)return void c({color:"red",message:"This invoice isn't available for download right now. Please contact Ambrook support to get your latest subscription invoice."});if("web"===_.A.OS)c({cta:"Download",href:e,message:"Invoice ready",targetBlank:!0});else{let i=await r(e,n.id);await (0,u.w)(i)}},[d,r,c,l]);return(0,t.jsxs)(x.A,{spacing:[.5,.75,1],align:"center",children:[(0,t.jsx)(y.A,{path:s.f49,color:"brown"}),(0,t.jsx)(g.A,{fullWidth:!0,label:(0,t.jsxs)(I.A,{variant:"mini",light:!0,children:[i.status," \xb7"," ",(0,t.jsx)(A.A,{value:i.totalCents,tabular:!0})]}),labelPosition:"bottom",spacing:0,children:(0,t.jsx)(I.A,{variant:"body",truncate:!0,tabular:!0,children:a.A.medium((0,o.Ay)(i.dueDate))})}),(0,t.jsx)(p.A,{onPress:()=>h(i),href:null!=(e=i.source.pdfUrl)?e:void 0,targetBlank:!!i.source.pdfUrl,children:(0,t.jsx)(y.A,{path:s.Bxv})})]})},nq=n=>{let{subscription:e}=n,[i,l]=(0,B.useState)(!1),a=(0,E.vc)(O.A.paymentMethodRecentlyAdded);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.A,{startIcon:(0,t.jsx)(y.A,{path:s.PoQ}),message:"You have an unpaid balance of ".concat((null==e?void 0:e.outstandingBalanceCents)?(0,M.CM)(e.outstandingBalanceCents,{omitCentsIfZero:!0}):"0"),cta:a?"Pay":"Add Card & Pay",onClick:()=>{(0,c.track)(r.ti.PaymentMethodAddCardAndPayOverdueBalanceClicked),l(!0)},color:"red"}),(0,t.jsx)(T.A,{open:i,onClose:()=>l(!1),initialStepOverride:a?T.O.PayBalance:T.O.AddCard})]})},nF=()=>{let{paymentMethods:n,loading:e,canRemoveBackup:i,subscription:l,invoices:a,showOutstandingPaymentBalanceAlert:o}=(()=>{var n,e,i,t;let l=(0,N.A)(),a=(0,nw.A)("core"),{data:o,loading:r}=function(n){let e={...nR,...n};return nB.IT(nW,e)}({variables:{orgId:l}}),s=null!=(t=null==o||null==(n=o.organization)?void 0:n.billingSubscription)?t:null,c=(0,B.useMemo)(()=>nI()(null==s?void 0:s.outstandingBalanceCents)&&!!(null==s?void 0:s.outstandingBalanceCents)&&nP.A.hasPastDueSubscription(a),[a,null==s?void 0:s.outstandingBalanceCents]),u=(0,B.useMemo)(()=>{var n,e;return[...null!=(e=null==o||null==(n=o.organization)?void 0:n.billingPaymentMethods)?e:[]].sort((n,e)=>n.default&&!e.default?-1:!n.default&&e.default?1:0)},[null==o||null==(e=o.organization)?void 0:e.billingPaymentMethods]),d=(0,B.useMemo)(()=>{var n,e;return null!=(e=null==o||null==(n=o.organization)?void 0:n.billingInvoices)?e:[]},[null==o||null==(i=o.organization)?void 0:i.billingInvoices]),g=(0,B.useMemo)(()=>{let n=u.find(n=>n.default);return!!n&&n.type!==W.eqJ.AmbrookWallet},[u]);return(0,B.useMemo)(()=>({canRemoveBackup:g,invoices:d,loading:r,paymentMethods:u,showOutstandingPaymentBalanceAlert:c,subscription:s}),[g,r,u,s,d,c])})(),[r,c]=(0,B.useState)(!1);return e?(0,t.jsx)(nD,{children:(0,t.jsx)(w.A,{count:5,height:"2.5rem",spacing:2})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(nD,{children:[(0,t.jsxs)(x.A,{column:!0,spacing:1,children:[o&&(0,t.jsx)(nq,{subscription:l}),l?(0,t.jsx)(nk,{subscription:l}):(0,t.jsx)(b.A,{variant:"outlined",borderColor:f.Ay.yellow[50],bgColor:f.Ay.brown[1],showShadow:"hover",shadow:"extraLargeYellow",column:!0,padding:[.75,1.5],spacing:[1,1.5],children:(0,t.jsxs)(x.A,{spacing:1,justify:"space-between",children:[(0,t.jsx)(I.A,{variant:"body",children:"No active plan."}),(0,t.jsx)(h.A,{size:"medium",onClick:()=>c(!0),children:"Subscribe"})]})})]}),(0,t.jsx)(m.A,{light:!0}),(0,t.jsxs)(x.A,{align:"center",children:[(0,t.jsx)(I.A,{variant:"body",bold:!0,fullWidth:!0,children:"Payment Methods"}),(0,t.jsx)(h.A,{startIcon:(0,t.jsx)(y.A,{path:s.QAD}),size:"medium",onClick:()=>c(!0),children:"Add Card"})]}),n.length?n.map(n=>(0,t.jsx)(R.A,{paymentMethod:n,canRemoveBackup:i},n.id)):(0,t.jsx)(d.A,{message:"No payment methods set up",cta:"Add Card",onClick:()=>c(!0)}),a&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m.A,{light:!0}),(0,t.jsx)(I.A,{variant:"body",bold:!0,children:"Previous Invoices"})]}),a&&[...a].sort((n,e)=>e.period.start>n.period.start?1:-1).map(n=>(0,t.jsx)(nN,{invoice:n},n.id))]}),(0,t.jsx)(T.A,{open:r,onClose:()=>c(!1)})]})};var n$=i(62867),nK=!0;let nY=()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n$.bV,{title:"Billing",description:"View and update your billing settings and payment methods",openGraph:{description:"View and update your billing settings and payment methods"},noindex:!0}),(0,t.jsx)(l.A,{activeTab:"subscription",children:(0,t.jsx)(nF,{})})]})},58305:(n,e,i)=>{var t=i(79699),l=i(70178);n.exports=function(n){return l(t(n))}},65793:n=>{var e=Math.floor,i=Math.random;n.exports=function(n,t){return n+e(i()*(t-n+1))}},70178:(n,e,i)=>{var t=i(65793);n.exports=function(n,e){var i=-1,l=n.length,a=l-1;for(e=void 0===e?l:e;++i<e;){var o=t(i,a),r=n[o];n[o]=n[i],n[i]=r}return n.length=e,n}},99595:(n,e,i)=>{var t=i(58305),l=i(12211),a=i(93007);n.exports=function(n){return(a(n)?t:l)(n)}}},n=>{n.O(0,[8992,16,4337,3737,8798,6371,4285,8185,3600,815,2455,3246,9117,8681,9479,1792,3736,9973,551,1651,2260,2762,1144,404,4274,7588,9843,5519,9560,6765,1567,636,6593,8792],()=>n(n.s=12264)),_N_E=n.O()}]);

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.