1import{s as Y}from"./themeMode-CJ36fwdE.js";import{P as pe,s as ee,c as w}from"./main-BoLYIECj.js";import{a6 as he,a7 as ge,j as se}from"./ExeBuilder-BRe68UH-.js";import{s as Be}from"./index-B8fhzqqY.js";import{U as te}from"./UsageSectionTable-DvU8vzYl.js";import{d as fe,x as ve,e as u,g as i,m as r,A as B,t as v,k as h,u as c,F as S,l as ke,c as m,b as k,o as l,q as ae,z as G,H as we,_ as be}from"./600-B6wu_fgg.js";import"./tokens-BBKQUwyO.js";import"./index-BehoICQ0.js";import"./index-_kifQDUK.js";import"./index-ZvcpiT__.js";import"./index-zkENnhbM.js";import"./index-B4BbUcMP.js";const _e={class:"usage-page"},Ce={class:"page-head"},$e={key:0,class:"period-label"},Ie={key:0,class:"page-section"},Ue={key:0,class:"inline-loading-skeleton",role:"status","aria-label":"Loading pool bill"},xe={class:"card-error"},Pe={key:2,class:"usage-empty"},Le={key:0,class:"section-summary"},Te={class:"stat-note"},Ae={class:"section-heading-row"},Se={class:"section-heading"},Ge=["aria-label"],De={class:"card-error"},Ee={class:"section-summary"},Oe={class:"stat-note"},He={key:1,class:"stat-note"},Ne={key:2,class:"stat-note"},oe=1024**3,Re=fe({__name:"TeamUsage",setup(Fe){const d=k(null),b=k(!0),_=k(!1),y=k(null),C=k(!0),$=k(!1),D=m(()=>{const e=d.value??y.value;return e?`${U(e.periodStart)} â ${U(e.periodEnd)}`:""}),E=m(()=>d.value?.pools.length===0&&d.value.grossUnitHours===0),ne=m(()=>d.value?d.value.hasPoolAccess||!E.value:!0),le=m(()=>[...d.value?.pools??[]].filter(e=>!e.standalone).sort((e,s)=>s.unitHours-e.unitHours||e.name.localeCompare(s.name))),ie=m(()=>[...d.value?.pools??[]].filter(e=>e.standalone).sort((e,s)=>s.unitHours-e.unitHours||e.name.localeCompare(s.name))),de=m(()=>[...y.value?.pools??[]].filter(e=>e.diskBytes>0).sort((e,s)=>s.diskBytes-e.diskBytes||e.name.localeCompare(s.name))),O=m(()=>[...y.value?.legacy??[]].filter(e=>e.diskBytes>0).sort((e,s)=>s.diskBytes-e.diskBytes||e.email.localeCompare(s.email))),re=m(()=>[...y.value?.pools??[]].filter(e=>e.txBytes>0).sort((e,s)=>s.txBytes-e.txBytes||e.name.localeCompare(s.name))),H=m(()=>[...y.value?.legacy??[]].filter(e=>e.txBytes>0).sort((e,s)=>s.txBytes-e.txBytes||e.email.localeCompare(s.email)));function g(e,s,a){return s.length===0?[]:[{id:`group-${e.toLowerCase().replaceAll(" ","-")}`,kind:"subgroup",name:e,resources:"",usage:"",cost:""},...s.map(o=>({kind:"item",...a(o)}))]}const ue=m(()=>{const e=d.value;if(!e)return[];const s=t=>({id:t.poolId,name:F(t.name,t.deleted),resources:t.cpus>0?`${t.cpus} vCPU`:"",usage:`${I(t.unitHours)} unit-hrs`,cost:f(t.grossCents),muted:t.deleted}),a=[...g("Pools",le.value,s),...g("Standalone Pools",ie.value,s)];return e.includedUnits>0&&a.push({id:"included",kind:"deduction",name:"Included capacity",resources:`${e.includedUnits} units`,usage:`-${I(e.includedUnitHours)} unit-hrs`,cost:f(-e.includedCents)}),a.push({id:"total",kind:"total",name:"Total",resources:"",usage:`${I(e.billableUnitHours)} unit-hrs`,cost:V(e.estimatedCents)}),a}),ce=m(()=>{const e=y.value,s=e?.allowanceModel??"",a=s==="per_resource_group",t=s!=="";return[{key:"disk",title:"Disk",asOf:e?.diskAsOf??e?.asOf??"",usedBytes:e?.diskUsedBytes??0,includedBytes:e?.diskIncludedBytes??0,appliedIncludedBytes:e?.diskAppliedIncludedBytes??0,billableBytes:e?.diskBillableBytes??0,showAllowanceMeter:a,showIncludedColumn:t,allowanceNote:R(s,"disk",e?.diskUsedBytes??0,e?.diskIncludedBytes??0,e?.diskAppliedIncludedBytes??0,e?.diskBillableBytes??0,e?.diskPerMemberBytes??0,e?.memberCount??0),hasLegacyRows:O.value.length>0,rows:e?N({allowanceModel:s,pools:de.value,legacy:O.value,usedBytes:e.diskUsedBytes,includedBytes:e.diskIncludedBytes,appliedIncludedBytes:e.diskAppliedIncludedBytes,billableBytes:e.diskBillableBytes,includedCents:e.diskIncludedCents,estimatedCents:e.diskEstimatedCents,bytesOf:o=>o.diskBytes,grossCentsOf:o=>o.diskGrossCents,earnedIncludedBytesOf:o=>o.diskEarnedIncludedBytes,estimatedCentsOf:o=>o.diskEstimatedCents}):[]},{key:"bandwidth",title:"Bandwidth",asOf:e?.bandwidthAsOf??e?.asOf??"",usedBytes:e?.bandwidthTxBytes??0,includedBytes:e?.bandwidthIncludedBytes??0,appliedIncludedBytes:e?.bandwidthAppliedIncludedBytes??0,billableBytes:e?.bandwidthBillableBytes??0,showAllowanceMeter:a,showIncludedColumn:t,allowanceNote:R(s,"bandwidth",e?.bandwidthTxBytes??0,e?.bandwidthIncludedBytes??0,e?.bandwidthAppliedIncludedBytes??0,e?.bandwidthBillableBytes??0,e?.bandwidthPerMemberBytes??0,e?.memberCount??0),hasLegacyRows:H.value.length>0,rows:e?N({allowanceModel:s,pools:re.value,legacy:H.value,usedBytes:e.bandwidthTxBytes,includedBytes:e.bandwidthIncludedBytes,appliedIncludedBytes:e.bandwidthAppliedIncludedBytes,billableBytes:e.bandwidthBillableBytes,includedCents:e.bandwidthIncludedCents,estimatedCents:e.bandwidthEstimatedCents,bytesOf:o=>o.txBytes,grossCentsOf:o=>o.txGrossCents,earnedIncludedBytesOf:o=>o.txEarnedIncludedBytes,estimatedCentsOf:o=>o.txEstimatedCents}):[]}]});function N({allowanceModel:e,pools:s,legacy:a,usedBytes:t,includedBytes:o,appliedIncludedBytes:x,billableBytes:P,includedCents:L,estimatedCents:ye,bytesOf:W,grossCentsOf:J,earnedIncludedBytesOf:K,estimatedCentsOf:Q}){const T=n=>({id:n.poolId,name:F(n.name,n.deleted),resources:e==="pool_capacity"?`${p(K(n))} GB`:"",usage:`${p(W(n))} GB`,cost:M(e,J(n),Q(n)),muted:n.deleted}),X=n=>({id:`${n.kind}-${n.email}`,name:n.email,resources:e==="pool_capacity"?`${p(K(n))} GB`:"",usage:`${p(W(n))} GB`,cost:M(e,J(n),Q(n))}),A=e==="per_resource_group"?[...g("Pools",s,T),...g("Legacy / Poolless VMs",a,X)]:[...g("Pools",s.filter(n=>n.kind!=="standalone_pool"),T),...g("Standalone VMs",s.filter(n=>n.kind==="standalone_pool"),T),...g("Legacy / Poolless VMs",a,X)];return e==="per_resource_group"&&o>0&&A.push({id:"included",kind:"deduction",name:"Included capacity",resources:`${z(o)} GB`,usage:`-${p(x)} GB`,cost:f(-L)}),A.push({id:"total",kind:"total",name:"Total",resources:"",usage:`${p(e===""?t:P)} GB`,cost:e===""?"Contracted":V(ye)}),A}function R(e,s,a,t,o,x,P,L){return e==="pool_capacity"?`Included ${s} is what each pool has earned so far this billing period.`:e==="per_resource_group"?`${p(a)} GB used · ${p(o)} GB included applied · ${p(x)} GB billable · ${z(P)} GB à ${L} members`:""}function F(e,s){return s?`Deleted: ${e}`:e}function M(e,s,a){return e==="pool_capacity"?f(a):e==="per_resource_group"?f(s):""}function f(e){const s=e<0?"-":"",a=Math.abs(e)/100;return`${s}
1$${a.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function V(e){return f(Math.max(0,e))}function p(e){return(e/oe).toLocaleString("en-US",{minimumFractionDigits:1,maximumFractionDigits:1})}function z(e){return Math.round(e/oe).toLocaleString("en-US")}function I(e){return e.toFixed(1)}function me(e,s){return s<=0?0:Math.min(100,Math.max(0,e/s*100))}function U(e){return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",timeZone:"UTC"})}function Z(e){const s=new Date(e),a=U(e),t=new Intl.DateTimeFormat("en-GB",{hour:"2-digit",minute:"2-digit",hourCycle:"h23",timeZone:"UTC"}).format(s);return`${a}, ${t} UTC`}async function j(){b.value=!0,_.value=!1;try{d.value=await he()}catch{d.value=null,_.value=!0}finally{b.value=!1}}async function q(){C.value=!0,$.value=!1;try{y.value=await ge()}catch{y.value=null,$.value=!0}finally{C.value=!1}}return ve(()=>{j(),q()}),(e,s)=>{const a=we("router-link");return l(),u("div",_e,[i("div",Ce,[r(pe,null,{default:B(()=>[r(a,{to:"/",class:"breadcrumb-link"},{default:B(()=>[...s[0]||(s[0]=[ae("Home",-1)])]),_:1}),s[2]||(s[2]=i("span",{class:"breadcrumb-sep"},"âº",-1)),r(a,{to:"/team",class:"breadcrumb-link"},{default:B(()=>[...s[1]||(s[1]=[ae("Team",-1)])]),_:1}),s[3]||(s[3]=i("span",{class:"breadcrumb-sep"},"âº",-1)),s[4]||(s[4]=i("span",{class:"breadcrumb-current"},"Usage",-1))]),_:1}),D.value?(l(),u("span",$e,"Current Period: "+v(D.value),1)):h("",!0)]),ne.value?(l(),u("section",Ie,[s[6]||(s[6]=i("div",{class:"section-heading-row"},[i("h2",{class:"section-heading"},"Pools")],-1)),r(c(ee),null,{content:B(()=>[b.value?(l(),u("div",Ue,[r(c(w),{width:"30%",height:"0.75rem"}),r(c(w),{width:"100%",height:"6rem"})])):_.value?(l(),G(c(se),{key:1,severity:"warn",closable:!1},{default:B(()=>[i("div",xe,[s[5]||(s[5]=i("span",null,"Failed to load pool usage.",-1)),r(c(Y),{label:"Retry",severity:"secondary",outlined:"",size:"small",onClick:j})])]),_:1})):d.value&&E.value?(l(),u("div",Pe," No pool usage this period ")):d.value?(l(),u(S,{key:3},[d.value.rolledUpThrough?(l(),u("div",Le,[i("div",Te,"As of "+v(Z(d.value.rolledUpThrough)),1)])):h("",!0),r(te,{rows:ue.value},null,8,["rows"])],64)):h("",!0)]),_:1})])):h("",!0),(l(!0),u(S,null,ke(ce.value,t=>(l(),u("section",{key:t.key,class:"page-section"},[i("div",Ae,[i("h2",Se,v(t.title),1)]),r(c(ee),null,{content:B(()=>[C.value?(l(),u("div",{key:0,class:"inline-loading-skeleton",role:"status","aria-label":`Loading ${t.key} usage`},[r(c(w),{width:"30%",height:"0.75rem"}),r(c(w),{width:"100%",height:"0.5rem"}),r(c(w),{width:"100%",height:"5rem"})],8,Ge)):$.value?(l(),G(c(se),{key:1,severity:"warn",closable:!1},{default:B(()=>[i("div",De,[i("span",null,"Failed to load "+v(t.key)+" usage.",1),r(c(Y),{label:"Retry",severity:"secondary",outlined:"",size:"small",onClick:q})])]),_:2},1024)):y.value?(l(),u(S,{key:2},[i("div",Ee,[i("div",Oe,"As of "+v(Z(t.asOf)),1),t.showAllowanceMeter?(l(),G(c(Be),{key:0,class:"stat-meter",value:me(t.appliedIncludedBytes,t.includedBytes),"show-value":!1,"aria-label":`${t.title} included allowance used`},null,8,["value","aria-label"])):h("",!0),t.allowanceNote?(l(),u("div",He,v(t.allowanceNote),1)):h("",!0),t.hasLegacyRows?(l(),u("div",Ne," Legacy / Poolless VMs are not yet in a pool and retain their existing usage treatment until adopted. ")):h("",!0)]),r(te,{rows:t.rows,"resources-header":"Included","cost-header":"Estimated cost","show-resources":t.showIncludedColumn},null,8,["rows","show-resources"])],64)):h("",!0)]),_:2},1024)]))),128))])}}}),es=be(Re,[["__scopeId","data-v-e4a07784"]]);export{es as default};
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.