1import{j as e,t as dt,F as ut,a as j,R as Ne,b as Q,y as ht,E as xt,n as gt,a3 as jt,L as mt}from"./react-DZIhD4CV.js";import{cS as pt,cT as Te,aC as ft,bK as bt,ai as O,aH as yt,E as S,cU as Ct,cP as be,k as x,q as v,H as Mt,$ as St,ct as y,cV as p,s as q,cK as ke,cW as vt,as as $e,aK as U,cR as Z,b_ as ye,bT as Le,bU as W,bV as X,bW as d,bX as r,c as R,c3 as ge,c6 as je,c4 as me,cX as wt,cY as Pt,cZ as Dt,au as w,cb as pe,c_ as Oe,aq as Tt,c$ as $t,m as Rt,c7 as qe,d0 as u,cM as K,bl as _t}from"./index-DYHSnDuC.js";import{BillingLoader as At,BillingError as Et,BillingInvalidSubscription as Yt}from"./BillingLayout-B5dAE5ld.js";import{a as F,e as le,f as ce}from"./billing-DM3WdHI1.js";import{u as Ut,d as Ft,g as ze,P as Bt,e as Re,f as Vt,h as It,i as de,j as E,k as Nt,l as kt,a as He,F as Lt,V as Ot,L as qt,S as zt,b as Ht,D as Wt,c as Kt,m as Qt,U as Xt,n as Zt,C as Jt,N as Gt}from"./Card-vIGTvqmE.js";import{V as We,S as es,D as b}from"./constants-D1Rvb1JH.js";import{u as Ke,C as ts,a as ss}from"./CollapsibleElements-Dj5gDkgV.js";import{S as rs}from"./PaymentForm-DsZnEXNz.js";import"./d3-q0zOtUjj.js";import"./partners-B0O1S0Gm.js";import"./ErrorCard-Df5f0Dce.js";import"./constants-47zfTh5j.js";import"./FullScreenDrawer-6KSyjdlL.js";import"./VideoQualityForm-C8ixmQEy.js";import"./redacted-Bf0D5Xnx.js";import"./RedactedPII-CtlQ8zN3.js";const ns=({estimated:t,current:s})=>e.jsxs(pt,{children:[e.jsx(Te,{variant:"striped",progress:t}),e.jsx(Te,{progress:s})]}),_e=({type:t,cta:s,title:n})=>e.jsx(be,{type:t,children:e.jsxs(S,{gap:2,children:[e.jsxs(x,{gap:2,children:[e.jsx(v,{as:"span",$bold:!0,children:n}),e.jsxs("div",{children:["To learn more,"," ",e.jsx(Mt,{includeIcon:!1,href:"https://docs.mux.com/pricing/video#automatic-cold-storage",children:"view details here"}),"."]})]}),e.jsx(St,{}),e.jsx(x,{yAlign:"center",xAlign:"center",children:s})]})}),is=()=>{const t=dt(),s=ut(ft),{mutate:n}=bt({onSuccess:o=>{const i={...s,autoColdStorage:o.autoColdStorage};t({type:"OrganizationUpdated",payload:{organization:i}})},meta:{errorToastContent:{id:"organization_update",description:"Cold storage enrollment failed"}}});return s.autoColdStorage?e.jsx(_e,{type:"success",title:e.jsxs(S,{gap:1,yAlign:"center",children:[e.jsx(Ct,{})," Enrolled in Automatic Cold Storage"]}),cta:e.jsx(O,{as:"a",href:yt,target:"_blank",rel:"noopener noreferrer",children:"Contact Support to Opt Out"})}):e.jsx(_e,{type:"info",title:"Enroll in Automatic Cold Storage",cta:e.jsx(O,{onClick:()=>n({id:s.id,changes:{autoColdStorage:!0}}),children:"Enroll"})})},as=j(be)(["margin-bottom:",";"],q[3]),os=({limit:t})=>e.jsx(as,{type:"warn",children:e.jsxs(x,{gap:2,children:[e.jsx(y,{children:"Plan limit reached"}),e.jsxs(v,{children:["You've reached the monthly ",p(t),"-view limit and no additional views will be processed for the remainder of your billing cycle. Upgrade for additional views."]})]})}),ls=({onClose:t})=>{const{data:s}=F(),{mutate:n,isLoading:o}=Ut(U.Starter);if(!s)return null;const i=Ft(s.publicPlans,U.Starter)?.id??"",{starter:a}=ze(s.publicPlans),c=p(a?.viewsPerMonth??0),l=ke.format(a?.additionalCost??0),h=()=>n({planId:i});return e.jsxs(Bt,{onClose:t,children:[e.jsx(Re,{children:e.jsxs(x,{gap:3,children:[e.jsx(vt,{children:"Data: Pay As You Go"}),e.jsx($e,{$bold:!0,children:"What you get"}),e.jsx(v,{children:"No more monthly caps on video views."}),e.jsx($e,{$bold:!0,children:"What you pay"}),e.jsxs(v,{children:[e.jsx("strong",{children:"You will be charged $0 today"}),", and video views over ",c," will be charged at the end of each monthly billing cycle, plus sales tax if applicable. The Mux Data Pay As You Go Plan is a monthly plan that can be canceled at any time."]}),e.jsx(Vt,{children:e.jsxs(It,{children:[e.jsxs(de,{children:[e.jsx(E,{children:"Monthly fee"}),e.jsx(E,{right:!0,children:e.jsx("strong",{children:"$0.00"})})]}),e.jsxs(de,{children:[e.jsxs(E,{ratio:1.5,children:[c," monitored views per month"]}),e.jsx(E,{right:!0,children:e.jsx("strong",{children:"Included"})})]}),e.jsxs(de,{children:[e.jsxs(E,{ratio:1.5,children:["Monitored video views over ",c]}),e.jsx(E,{right:!0,children:e.jsxs("strong",{children:[l," per ",p(We)," views"]})})]})]})})]})}),e.jsx(Re,{children:e.jsx(Nt,{onClose:t,handleUpgrade:h,isLoading:o})})]})},cs=({additionalCost:t,trackedMuxVideoViews:s,trackedViews:n})=>{const{commercialDetails:{trackedViews:o}}=Z(),[i,a]=Ne.useState(!1),c=()=>{a(!i)},l=Math.min(s||0,n||0),h=Math.max(n-l,0);return e.jsxs(e.Fragment,{children:[e.jsxs(ye,{bordered:!0,children:[e.jsxs(Le,{children:[e.jsx(W,{ratio:2,columnName:"Category"}),e.jsx(W,{right:!0,columnName:"Included in plan"}),e.jsx(W,{right:!0,columnName:"Current monthly usage"})]}),e.jsxs(X,{children:[e.jsxs(d,{children:[e.jsx(r,{ratio:2,children:"Monitoring of videos hosted by Mux"}),e.jsx(r,{right:!0,children:"Unlimited"}),e.jsx(r,{right:!0,children:p(l)})]}),e.jsxs(d,{style:{borderBottom:"none"},children:[e.jsx(r,{ratio:2,children:"Views of videos not hosted by Mux (per month)"}),e.jsx(r,{right:!0,children:p(o.includedAmount)}),e.jsx(r,{right:!0,children:p(h)})]})]})]}),e.jsx(ds,{children:e.jsxs(S,{xAlign:"space-between",yAlign:"center",children:[e.jsxs(x,{gap:2,children:[e.jsx(y,{$bold:!0,children:"Need more video views?"}),e.jsxs("div",{children:["Opt-in for additional views at ",ke.format(t)," per ",p(We)," views"]})]}),i&&e.jsx(ls,{onClose:c}),e.jsx(O,{variant:"access",onClick:c,children:"Get more views"})]})})]})};var ds=j(be)(["margin-top:",";"],q[3]);const fe=j(({value:t,className:s})=>e.jsxs("span",{className:s,children:[Math.round(t),"%"]}))([""," ",""],({value:t})=>t>100&&Q(["color:",";"],R.blue50),({variant:t})=>t==="secondary"&&Q(["font-size:10px;width:45px;text-align:right;"])),us=j(Dt).attrs({width:16,height:16})(["margin-left:6px;"]),J=({content:t})=>e.jsxs(ge,{children:[e.jsx(je,{children:t}),e.jsx(me,{asChild:!0,children:e.jsx(us,{})})]}),Ae=()=>e.jsx(J,{content:"Minutes stored is prorated over your billing cycle. For example, if your current storage is 1,000 minutes and you are halfway through the billing cycle, your usage for minutes stored will be 500."}),hs=()=>e.jsx(J,{content:"The usage tier represents the range of minutes that are associated with a specific unit cost. If your usage increases into the next tier, youâll see multiple rows."}),xs=j.ul(["list-style:none;margin:0;padding-left:20px;padding-right:5px;li{position:relative;margin-bottom:10px;&:last-child{margin-bottom:0;}}"]),Ee=j.li(["position:relative;&::before{"," position:absolute;width:8px;height:8px;left:-18px;top:4px;","}"],({$hideBullet:t})=>!t&&Q(["content:'';"]),({$striped:t})=>t?Pt({angle:55,color:R.gray60,size:1}):Q(["background-color:",";"],R.blue50)),Ye=({current:t,estimated:s,estimatedCost:n,unit:o,currentPercentUsed:i,estimatedPercentUsed:a})=>{const{data:c}=F(),l=i!==null,h=a!==null;return e.jsxs(xs,{children:[e.jsxs(Ee,{$hideBullet:!l,children:["Actual usage: ",e.jsx("strong",{children:t})," ",o," ",l&&e.jsxs(e.Fragment,{children:["(",e.jsx(fe,{value:i}),")"]})]}),e.jsxs(Ee,{$hideBullet:!h,$striped:!0,children:["Est. usage: ",e.jsx("strong",{children:s})," ",o," ",h&&e.jsxs(e.Fragment,{children:["(",e.jsx(fe,{value:a}),")"]}),e.jsx("br",{}),"Est. cost: ",e.jsx("strong",{children:n})]}),c&&e.jsxs("li",{children:[e.jsx("strong",{children:wt(c.accountActivity.cycleEnd)})," left in billing cycle"]})]})},Qe={minutes_stored:e.jsx(Ae,{}),minutes_stored_audio:e.jsx(Ae,{})},Xe=t=>"resolutionItems"in t,gs=t=>t.includes("infrequent")?" - Infrequent":t.includes("cold")?" - Cold":"",js=t=>t.includes("baseline")||t.includes("basic")?" - Basic":t.includes("premium")?" - Premium":t.includes("delivered")?"":" - Plus",ms=t=>t.includes("mp4")?" - Static Renditions":t.includes("free_minutes_delivered")?" - Free Delivery Minutes":"",Ze=(t,s,{is4kBillingEnabled:n,isFreeVodEncodingEnabled:o})=>{const i=es.find(h=>s?.indexOf(h)>-1);if(!i)return t;const a=o?js(s):"",c=gs(s),l=ms(s);if(n)return`${i==="audio"?"Audio":i}${a}${l}${c}`;switch(i){case"1080p":return`Above 720p${a}${l}${c}`;case"720p":return`Up to 720p${a}${l}${c}`;default:return t}},ps=t=>{if(!t)return null;const{start:s,end:n}=t;if(s===0&&n!==null&&n>=0)return`Up to ${p(n)}`;if(s!==null){if(s>0&&n!=null)return`${p(s)} - ${p(n)}`;if(s>0&&n===null)return`Above ${p(s)}`}return"None"},Ue=(t,s)=>!s||s.end===null||s.start===null||s.end<0||s.start<0?null:t/(s.end-s.start)*100,fs=t=>t.tieredItems.length===0||!t.pricingTiers||t.pricingTiers.length===0?!1:t.tieredItems.length>1||t.pricingTiers.length>1?!0:t.pricingTiers[0].start!==0,L={category:1.7,usage:.8,unitPrice:.7,usageCost:.8},bs=({currentPercentUsed:t,estimatedPercentUsed:s})=>t===null||s===null?null:e.jsxs(e.Fragment,{children:[e.jsx(ns,{current:t,estimated:s}),e.jsx(fe,{variant:"secondary",value:t})]}),H=({tieredItems:t,includedAmount:s,multiTier:n,depth:o=0})=>{const i=w("4KBilling"),a=w("freeVodEncodingEnabled"),{isCollapsed:c}=Ke();return c&&n?null:e.jsx(e.Fragment,{children:t.filter(l=>!(l.tier?.end===0&&l.tier?.start===0)).map((l,h)=>{const{quantity:C,estimatedUsage:m,unit:M}=l,{quantity:P,estimatedUsage:B,estimatedCost:V,unitPrice:I,totalAmount:_}=l.formatted,D=Ue(C,l.tier),A=Ue(m,l.tier);let T="â";return s&&s!==-1?T=p(s):n&&(T="None"),l.productType==="tracked_mux_video_views"&&!s&&(T="Unlimited"),e.jsxs(d,{children:[e.jsx(r,{ratio:L.category,left:!0,children:n?null:e.jsxs(ys,{yAlign:"center",$_css:o,children:[Ze(l.description,l.productType,{is4kBillingEnabled:i,isFreeVodEncodingEnabled:a})," ",Qe[l.productType]]})}),e.jsx(r,{ratio:L.usage,right:!0,children:e.jsxs(ge,{children:[e.jsx(je,{side:"bottom",children:e.jsx(Ye,{current:P,estimated:m,estimatedCost:V,unit:M,currentPercentUsed:D,estimatedPercentUsed:A})}),e.jsx(me,{asChild:!0,children:e.jsx("div",{children:P})})]})}),e.jsx(r,{ratio:L.usage,children:e.jsxs(ge,{children:[e.jsx(je,{side:"bottom",children:e.jsx(Ye,{current:P,estimated:B,estimatedCost:V,unit:M,currentPercentUsed:D,estimatedPercentUsed:A})}),e.jsx(me,{asChild:!0,children:e.jsx(Cs,{yAlign:"center",xAlign:"space-between",children:e.jsx(bs,{currentPercentUsed:D,estimatedPercentUsed:A})})})]})}),e.jsx(r,{right:!0,width:150,children:n?ps(l.tier):T}),e.jsx(r,{right:!0,ratio:L.unitPrice,children:I}),e.jsx(r,{right:!0,ratio:L.usageCost,children:_})]},l.productType+h.toString())})})};var ys=j(S)(["padding-left:calc("," * ",");"],t=>
1t.$_css,q[4]),Cs=j(S)(["height:100%;width:100%;"]);const g={category:1.7,usage:.8,includedInPlan:1,unitPrice:.7,usageCost:.8},Y=j(W)(["white-space:nowrap;"]),Ms=j.div(["border-bottom:1px solid ",";width:100%;"],R.gray90),Ss=({children:t,balance:s})=>e.jsxs(d,{children:[e.jsx(r,{ratio:g.category,left:!0,children:t}),e.jsx(r,{ratio:g.usage,right:!0,children:"â"}),e.jsx(r,{ratio:g.usage}),e.jsx(r,{ratio:g.includedInPlan,right:!0,children:"â"}),e.jsx(r,{ratio:g.unitPrice,right:!0,children:"â"}),e.jsxs(r,{ratio:g.usageCost,right:!0,children:["(",s,")"]})]}),vs=({balance:t,...s})=>t?e.jsxs(Ss,{...s,balance:t,children:["Covered by Mux",e.jsx(J,{content:"We won't bill you for usage less than $5.00."})]}):null,ws=({itemGroup:t,children:s,depth:n=0,hideToggle:o})=>{const i=w("4KBilling"),a=w("freeVodEncodingEnabled"),{isCollapsed:c}=Ke();return e.jsxs(e.Fragment,{children:[e.jsxs(d,{children:[e.jsxs(r,{ratio:g.category,children:[!o&&e.jsx(Ds,{$_css:n}),Ze(t.baseDescription,t.productType,{is4kBillingEnabled:i,isFreeVodEncodingEnabled:a}),n===0&&Qe[Xe(t)?t.productGrouping:t.productType]]}),e.jsx(r,{right:!0,ratio:g.usage,children:t.formatted.totalUsage}),e.jsx(r,{ratio:g.usage}),e.jsx(r,{width:150}),e.jsx(r,{right:!0,ratio:g.unitPrice,children:"Variable"}),e.jsx(r,{right:!0,ratio:g.usageCost,children:t.formatted.totalUsageCost})]},t.baseDescription),c?null:s]})},ue=({itemGroup:t,children:s,depth:n,hideToggle:o})=>e.jsx(ts,{children:e.jsx(ws,{depth:n,itemGroup:t,hideToggle:o,children:s})}),Ps=({type:t,invoiceItems:s,currentTotal:n,totalCredits:o})=>{const i=w("4KBilling");return!s||s.length===0?null:e.jsxs(ye,{bordered:!0,children:[e.jsxs(Le,{children:[e.jsx(Y,{ratio:g.category,columnName:"Category"}),e.jsx(Y,{right:!0,ratio:g.usage,columnName:"Usage"}),e.jsx(Y,{width:150}),e.jsxs(Y,{right:!0,ratio:g.usage,children:["Usage Tier",e.jsx(hs,{})]}),e.jsx(Y,{right:!0,ratio:g.unitPrice,columnName:"Unit Cost"}),e.jsx(Y,{right:!0,ratio:g.usageCost,columnName:"Usage Cost"})]}),e.jsxs(X,{children:[s.map(a=>a.productType==="video_credit"||a.productType?.includes("free_minutes_delivered")?null:Xe(a)?e.jsx(ue,{itemGroup:a,hideToggle:a.resolutionItems.length===0&&i,children:a.resolutionItems.map(c=>c.pricingTiers?.length===0?e.jsx(H,{depth:1,...c}):e.jsx(ue,{depth:1,itemGroup:c,children:e.jsx(H,{multiTier:!0,...c})},c.productType))},a.baseDescription):fs(a)?e.jsx(ue,{itemGroup:a,children:e.jsx(H,{multiTier:!0,...a})},a.baseDescription):e.jsx(H,{...a},a.baseDescription)),e.jsx(vs,{balance:o?.minimumInvoiceHandling}),e.jsx(Ms,{}),e.jsxs(d,{children:[e.jsx(r,{ratio:1.5,left:!0,children:e.jsxs("strong",{children:["Current Mux ",t==="video"?"Video":t==="robots"?"Robots":"Data"," usage cost"]})}),e.jsx(r,{right:!0,children:e.jsx("strong",{children:pe(Math.abs(n||0))})})]})]})]})};var Ds=j(ss)(["padding-left:calc("," * ",");"],t=>t.$_css,q[4]);const Ts=j.div(["margin-top:",";padding:2px;"],q[2]),$s=({currentVideoStorageAmount:t,mp4sDisabledVideoStorageAmount:s})=>{const n=t-s;if(n<=0)return null;const o=n/t*100;let i;return o<1?i=`*You can save ${pe(n)} on storage if you disable MP4 support`:i=`*You can save ${o.toFixed()}% (or ${pe(n)}) on storage if you disable MP4 support`,e.jsx(Ts,{children:e.jsx(v,{$color:"gray70",children:i})})},he=({type:t})=>{const{data:s}=F(),n=w("staticRenditionColdStorageEnabled");if(!s)return null;const{invoiceItems:o,totalCredits:i,current:{videoAmount:a,dataAmount:c,robotsAmount:l,plan:h,videoStorageAmount:C},mp4SDisabled:{videoStorageAmount:m}}=s.accountActivity,M=t==="video",P=t==="video"?a:t==="data"?c:l,B=t==="video"?o.video:t==="data"?o.data:o.robots;return e.jsx(e.Fragment,{children:h&&e.jsxs(e.Fragment,{children:[M&&e.jsx(y,{children:"Usage charges"}),e.jsx(Ps,{type:t,currentTotal:P,invoiceItems:B,totalCredits:M?i:null}),!n&&M&&s.organization.autoColdStorage&&e.jsx($s,{currentVideoStorageAmount:C,mp4sDisabledVideoStorageAmount:m})]})})},Rs=j(v)(["margin-right:14px;"]),_s=({paymentDetails:t})=>{const s=ht(),{basePath:n,paths:o}=Oe(),i=xt("/organizations/:orgId/:parent/billing/:tab"),a=i?gt(i.pattern.path,{...i.params,tab:o.paymentMethod}):`${n}/${o.paymentMethod}`;return e.jsxs(S,{xAlign:"center",yAlign:"center",children:[e.jsx(Rs,{children:"Payment method"}),t&&["card","us_bank_account"].includes(t?.type??"")?e.jsx(rs,{paymentMethodType:t.type,brand:t.brand,lastFour:t?.lastFour,onClick:()=>s(a)}):e.jsx(O,{as:Tt,to:a,prefix:e.jsx($t,{}),"aria-label":"Add payment method details",children:"Add"})]})},Fe=j.small(["font-size:12px;margin-top:8px;display:block;color:",";"],R.text.default),Be=j.div(["border-bottom:1px solid ",";width:100%;"],R.gray90),Ve=j(ye)(["border-top:1px solid ",";"],R.gray10),Je={month:"monthly",quarter:"quarterly","half-year":"semi-annually",year:"annually"},Ie=({credit:t,...s})=>t?e.jsxs(d,{...s,children:[e.jsxs(r,{left:!0,children:["Promotional credits",e.jsx(J,{content:"The total credit balance on your account, which may include the credit when you signed up, or any one-time credits."})]}),e.jsxs(r,{right:!0,children:["(",t,")"]})]}):null,xe=({product:t})=>{const s=qe(),{data:n}=F();if(!n)return null;const{accountActivity:{cycleEnd:o,committedTotals:i},subscription:a}=n;if(!i?.[t])return null;const c={video:"Video",data:"Data",support:"Support",base:"Base"}[t],l={month:1,quarter:3,"half-year":6,year:12}[a?.billingFrequency??"month"],h=Je[a?.billingFrequency??"month"],C=new Date(o),m=new Date(C);return m.setMonth(m.getMonth()+l),e.jsxs(d,{children:[e.jsxs(r,{ratio:3,left:!0,children:[c?`Mux ${c} - `:"",K(h)," contracted amount (",s(C,b.M_DD_YYYY)," - ",s(m,b.M_DD_YYYY),")"]}),e.jsx(r,{right:!0,children:i[t]})]})},As=({planName:t})=>{const{paths:s,basePath:n}=Oe(),{data:o}=F(),{testVideoOnly:i}=Z();if(!o||!o.subscription)return null;const{nextPlan:a,currentCycleEnd:c}=o.subscription;return e.jsxs(e.Fragment,{children:[t===U.Custom?e.jsx(Jt,{isSummary:!0,cta:e.jsx(O,{as:mt,to:`${n}/${s.plans}`,children:"View Plan"})}):e.jsx(e.Fragment,{children:a?e.jsx(Gt,{plan:a,currentCycleEnd:c}):e.jsx(He,{actionMode:"view",condensed:!0})}),e.jsxs(x,{gap:6,children:[!i&&e.jsxs(x,{gap:4,children:[e.jsx(y,{$bold:!0,children:"Mux Video"}),e.jsx(he,{type:"video"})]}),e.jsxs(x,{gap:4,children:[e.jsx(y,{$bold:!0,children:"Mux Data"}),e.jsx(he,{type:"data"})]}),e.jsxs(x,{gap:4,children:[e.jsx(y,{$bold:!0,children:"Mux Robots"}),e.jsx(he,{type:"robots"})]})]})]})},Es=({accountActivity:t,invoiceNeedsAttention:s,subscription:n,paymentDetails:o})=>{const i=qe(),{testVideoOnly:a}=Z(),{billingType:c,subscriptionRenewalDate:l}=n,h=w("autoColdStorageOptInEnabled"),C=w("staticRenditionColdStorageEnabled"),[m]=jt(),[M,P]=Ne.useState(m.has(Qt)),B=()=>{P(!1)},{dollarCommitChargeAmount:V,dollarCommitCreditAmount:I,dollarCommitCreditRefillIntervalMonths:_,frequencyIntervalMonths:D}=t.estimated.plan,A=n.billingFrequency==="month",T=D===1,Ge=i(t.cycleStart,b.M_DD),G=i(t.cycleStart,b.M_DD_YYYY),ee=i(t.cycleEnd,b.M_DD_YYYY),et=i(t?.futureCreditsRefilledOn||t.cycleEnd,b.M_DD_YYYY),tt=i(l||"",b.M_DD_YYYY),z=t.previousPaidInvoice,{totalAmount:st,videoAmount:te,baseAmount:Ce,dataAmount:se,robotsAmount:re,plan:N}=t.current,{dollarCommitChargeAmount:Me,dollarCommitCreditAmount:ne,dollarCommitCreditRefillIntervalMonths:k}=N,f=i(Date.now(),b.M_DD_YYYY),Se=Je[n?.billingFrequency??"month"],rt=l?` in ${i(l,b.M)}`:"",nt=`($${N.cost}/mo. billed ${A?Se:`${Se}${rt}`})`,$=typeof Me=="number",{videoCredit:ve,dollarCommitCredit:it}=t.totalCredits,{dollarCommitCreditBalance:at,overageDollarCommitCredit:ie}=t,we=k===1,ot=typeof V=="number"&&(T||l&&new Date(l).getTime()<=new Date(t.cycleEnd).getTime()||A&&!T),Pe=({children:ae})=>e.jsxs(x,{gap:2,children:[e.jsxs(y,{children:["Total usage costs â ",f]}),e.jsxs("div",{children:[e.jsx(Ve,{bordered:!0,children:e.jsxs(X,{children:[ae,e.jsx(Ie,{credit:ve}),e.jsx(Be,{}),e.jsxs(d,{children:[e.jsx(r,{left:!0,children:e.jsxs("strong",{children:["Usage overages subtotal as of ",f]})}),e.jsx(r,{right:!0,children:e.jsx("strong",{children:u(Math.max(ie,0))})})]})]})}),e.jsx(Fe,{children:"Does not include sales tax, if applicable"})]})]}),lt=()=>e.jsxs(Pe,{children:[e.jsxs(d,{children:[e.jsxs(r,{left:!0,children:["Mux Video - Current total usage cost as of ",f]}),e.jsx(r,{right:!0,children:u(te)})]}),e.jsxs(d,{children:[e.jsxs(r,{left:!0,children:["Mux Data - Current total usage cost as of ",f]}),e.jsx(r,{right:!0,children:u(se)})]}),e.jsxs(d,{children:[e.jsxs(r,{left:!0,children:["Mux Robots - Current total usage cost as of ",f]}),e.jsx(r,{right:!0,children:u(re)})]}),e.jsxs(d,{children:[e.jsxs(r,{left:!0,children:["Monthly plan credits (",G," - ",ee,")"]}),e.jsxs(r,{right:!0,children:["(",it||"$0.00",")"]})]})]}),ct=()=>{const ae=ne!==null?ne-at:0,oe=new Date(l||"");oe.setMonth(oe.getMonth()-(k||1));const De=i(oe,b.M_DD_YYYY);return e.jsxs(Pe,{children:[e.jsxs(d,{children:[e.jsxs(r,{ratio:3,left:!0,children:[K(ce(k))," plan credits -"," ",u(ne||0)," per"," ",le(k)," (",De," -"," ",tt,")"]}),e.jsx(r,{right:!0,children:u(Me||0)})]}),e.jsxs(d,{children:[e.jsxs(r,{left:!0,children:[K(ce(k))," plan credits - Total used starting (",De," - ",G,")"]}),e.jsxs(r,{right:!0,children:["(",u(ae),")"]})]}),e.jsxs(d,{children:[e.jsxs(r,{left:!0,children:["Mux Video - Current total usage cost as of ",f]}),e.jsx(r,{right:!0,children:u(te)})]}),e.jsxs(d,{children:[e.jsxs(r,{left:!0,children:["Mux Data - Current total usage cost as of ",f]}),e.jsx(r,{right:!0,children:u(se)})]}),e.jsxs(d,{children:[e.jsxs(r,{left:!0,children:["Mux Robots - Current total usage cost as of ",f]}),e.jsx(r,{right:!0,children:u(re)})]})]})};return e.jsxs(x,{gap:6,children:[e.jsxs(x,{gap:6,children:[s&&e.jsx(Xt,{}),e.jsxs(x,{gap:2,children:[e.jsx(S,{xAlign:"space-between",yAlign:"flex-start",children:c==="stripe"&&e.jsx(_s,{paymentDetails:o})}),e.jsxs(v,{children:["Billing cycle: ",Ge," â ",ee]}),z?.paymentAt&&z?.totalAmount!==0&&e.jsxs(v,{children:["We received your last payment of ",u(z.totalAmount)," on"," ",i(z.paymentAt,b.M_DD_YYYY)]})]})]}),$&&we&&e.jsx(lt,{}),$&&!we&&e.jsx(ct,{}),e.jsxs(x,{gap:2,children:[e.jsxs(y,{children:["Next invoice â ",ee]}),e.jsxs("div",{children:[e.jsx(Ve,{bordered:!0,children:e.jsxs(X,{children:[$&&ie?e.jsxs(d,{children:[e.jsxs(r,{left:!0,children:["Usage overages as of ",G]}),e.jsx(r,{right:!0,children:u(ie)})]}):null,!a&&!$&&e.jsx(e.Fragment,{children:e.jsxs(d,{children:[e.jsxs(r,{left:!0,children:["Mux Video - Current total usage cost as of ",f]}),e.jsx(r,{right:!0,children:u(te)})]})}),e.jsx(xe,{product:"video"}),!$&&e.jsxs(d,{children:[e.jsxs(r,{left:!0,children:["Mux Data - Current total usage cost as of ",f]}),e.jsx(r,{right:!0,children:u(se)})]}),N.name===U.Pro||N.name===U.SelfServiceMedia?Ce>0&&e.jsxs(d,{children:[e.jsxs(r,{left:!0,children:["Mux Data - ",nt]}),e.jsx(r,{right:!0,children:u(Ce)})]}):e.jsx(xe,{product:"data"}),!$&&e.jsxs(d,{children:[e.jsxs(r,{left:!0,children:["Mux Robots - Current total usage cost as of ",f]}),e.jsx(r,{right:!0,children:u(re)})]}),e.jsx(xe,{product:"support"}),ot&&e.jsxs(d,{children:[e.jsxs(r,{ratio:4,left:!0,children:[K(ce(_))," plan credits (",u(I||0)," per"," ",le(_),") starting ",et," -"," ",_!==null?u((I||0)*(D/_)):u(I||0)," ","per ",le(D)]}),e.jsx(r,{right:!0,children:u(V||0)})]}),$?null:e.jsx(Ie,{credit:ve}),e.jsx(Be,{}),e.jsxs(d,{children:[e.jsx(r,{left:!0,children:e.jsx("strong",{children:"Next invoice total (based on current usage)"})}),e.jsx(r,{right:!0,children:e.jsx("strong",{children:u(st)})})]})]})}),e.jsx(Fe,{children:"Does not include sales tax, if applicable"})]})]}),e.jsxs(x,{gap:4,children:[!C&&h&&!a&&e.jsx(is,{}),e.jsx(As,{planName:N.name})]}),M&&e.jsx(Zt,{onClose:B})]})},Ys=()=>{const{plan:t,isPaid:s,commercialDetails:{trackedViews:n}}=Z(),{data:o,isLoading:i,error:a}=F(),c=kt();if(i)return e.jsx(At,{});if(a||!o)return e.jsx(Et,{});if(o.subscription===null)return e.jsx(Yt,{});if(s)return e.jsx(Es,{...o,subscription:o.subscription});const{publicPlans:l,accountActivity:h}=o,{productTypeUsage:C}=h.current,{starter:m,"self-service media":M}=ze(l);return e.jsxs(x,{gap:6,children:[e.jsxs(x,{gap:4,children:[e.jsx(He,{}),e.jsx(y,{$bold:!0,children:"Video Plans"}),t===U.Lite&&e.jsx(Lt,{}),e.jsxs(S,{gap:2,children:[e.jsx(Ot,{}),e.jsx(qt,{}),e.jsx(zt,{})]}),e.jsx(Ht,{})]}),e.jsx(Rt,{}),e.jsxs(x,{gap:4,children:[e.jsx(y,{$bold:!0,children:"Mux Data"}),e.jsxs("div",{children:[c&&e.jsx(os,{limit:n.includedAmount}),m&&e.jsx(cs,{...m,...C})]}),e.jsx(y,{$bold:!0,children:"Data plans"}),e.jsxs(S,{gap:2,children:[e.jsx(Wt,{...M}),e.jsx(Kt,{})]})]})]})};function Zs(){return _t("Summary | Billing"),e.jsx(Ys,{})}export{Zs as default}; 2//# sourceMappingURL=SummaryRoute-TrNoO8dY.js.map
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.