copilot-usage-studio 0.2.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -1
- package/data/github-copilot-pricing.json +66 -3
- package/dist/copilot-usage-studio/browser/chunk-2VFTKZDH.js +1 -0
- package/dist/copilot-usage-studio/browser/chunk-4SRW5HAB.js +1 -0
- package/dist/copilot-usage-studio/browser/chunk-5FL3PHQS.js +1 -0
- package/dist/copilot-usage-studio/browser/{chunk-WWU6QMJC.js → chunk-5KYZJDMG.js} +1 -1
- package/dist/copilot-usage-studio/browser/chunk-6AXGMNCK.js +1 -0
- package/dist/copilot-usage-studio/browser/{chunk-QMNOUQ2X.js → chunk-OKFPCYAJ.js} +1 -1
- package/dist/copilot-usage-studio/browser/{chunk-23NLHIOR.js → chunk-QJ4KZ5PT.js} +1 -1
- package/dist/copilot-usage-studio/browser/{chunk-7I2HDBC6.js → chunk-ST4Z2MU5.js} +1 -1
- package/dist/copilot-usage-studio/browser/{chunk-RTOXDOOI.js → chunk-YCZAIDR7.js} +1 -1
- package/dist/copilot-usage-studio/browser/index.html +1 -1
- package/dist/copilot-usage-studio/browser/{main-XFPP45VE.js → main-GTYMLVSP.js} +1 -1
- package/docs/pricing.md +3 -3
- package/lib/local-runtime.mjs +13 -0
- package/package.json +1 -1
- package/scripts/scanner-customization-inventory.mjs +23 -2
- package/dist/copilot-usage-studio/browser/chunk-5JYQJM5G.js +0 -1
- package/dist/copilot-usage-studio/browser/chunk-TICIZRSM.js +0 -1
- package/dist/copilot-usage-studio/browser/chunk-XMVGLQQH.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Y,b as Z,c as ee,d as te,e as ne,g as V}from"./chunk-RTOXDOOI.js";import{f as L,q as A,r as E,s as U}from"./chunk-TICIZRSM.js";import{$a as C,Ca as u,Da as x,Ea as R,Fa as M,Ga as P,Ha as g,Ia as i,Ja as n,Ka as w,O as b,Oa as O,P as f,Qa as v,Sa as p,Ta as D,U as z,Va as a,Wa as _,Xa as m,Ya as N,Z as S,Za as T,_a as c,ab as y,db as k,ka as l,ob as W,sa as G,sb as H,ub as j,vb as q,wb as J,xb as K,yb as Q,zb as X}from"./chunk-WOIYAEKB.js";var ie=(o,t)=>t.value,me=(o,t)=>t.model+t.pricingModel,ge=(o,t)=>t.size,_e=(o,t)=>t.key,ue=(o,t)=>t.label,xe=(o,t)=>t.session.id;function Ce(o,t){if(o&1&&a(0),o&2){let e=p();m(" ",e.analyticsExcludedCount," excluded by these filters. ")}}function ye(o,t){if(o&1){let e=O();i(0,"button",11),v("click",function(){b(e);let r=p(2);return f(r.resetAnalyticsFilters())}),a(1,"Reset filters"),n()}}function he(o,t){if(o&1&&(i(0,"option",8),a(1),n()),o&2){let e=t.$implicit;g("value",e.value),l(),_(e.label)}}function be(o,t){if(o&1&&(i(0,"option",8),a(1),n()),o&2){let e=t.$implicit;g("value",e),l(),_(e==="all"?"All workspaces":e)}}function fe(o,t){if(o&1&&(i(0,"option",8),a(1),n()),o&2){let e=t.$implicit;g("value",e),l(),_(e==="all"?"All models":e)}}function ve(o,t){if(o&1&&(i(0,"option",8),a(1),n()),o&2){let e=t.$implicit;g("value",e.value),l(),_(e.label)}}function Me(o,t){if(o&1){let e=O();i(0,"button",11),v("click",function(){b(e);let r=p(3);return f(r.resetAnalyticsFilters())}),a(1,"Reset filters"),n()}}function Pe(o,t){if(o&1&&(i(0,"section",10)(1,"h3"),a(2),n(),i(3,"p"),a(4),n(),u(5,Me,2,0,"button",5),n()),o&2){let e=p();l(2),_(e.emptyTitle),l(2),_(e.emptyDetail),l(),x(e.analyticsFiltersActive?5:-1)}}function Oe(o,t){o&1&&(i(0,"em",27),a(1,"fallback pricing"),n())}function Se(o,t){if(o&1&&(a(0),c(1,"number")),o&2){let e=p().$implicit;m(" / ",C(1,1,e.cachedInput)," cached in ")}}function we(o,t){if(o&1&&(a(0),c(1,"number")),o&2){let e=p().$implicit;m(" / ",C(1,1,e.cacheWrite)," cache write ")}}function ke(o,t){if(o&1&&(i(0,"div",17)(1,"strong"),a(2),i(3,"em"),a(4),n(),u(5,Oe,2,0,"em",27),n(),i(6,"span"),a(7),c(8,"number"),n(),i(9,"span"),a(10),c(11,"number"),i(12,"em"),a(13),c(14,"number"),u(15,Se,2,3),u(16,we,2,3),a(17),c(18,"number"),n()(),i(19,"span"),a(20),c(21,"number"),i(22,"em"),a(23),c(24,"number"),n()(),i(25,"span"),a(26),c(27,"number"),n(),i(28,"span",28),a(29),c(30,"number"),w(31,"i"),n()()),o&2){let e=t.$implicit,s=p(3);l(2),m(" ",e.model," "),l(2),_(e.pricingModel),l(),x(e.usesFallbackPrice?5:-1),l(2),_(C(8,15,e.sessionCount)),l(3),m(" ",C(11,17,e.tokens)," "),l(3),m(" ",C(14,19,e.input)," normal in "),l(2),x(e.cachedInput?15:-1),l(),x(e.cacheWrite?16:-1),l(),m(" / ",C(18,21,e.output)," out "),l(3),m(" $",y(21,23,e.cost,"1.2-4")," "),l(3),m("",y(24,26,s.aiCredits(e.cost),"1.0-1")," credits"),l(3),m("$",y(27,29,e.costPer1k,"1.4-4")),l(3),m(" ",y(30,32,e.share,"1.0-0"),"% "),l(2),D("width",e.share,"%")}}function Ee(o,t){o&1&&(i(0,"p",18),a(1,"No model rows for the current Insights cohort."),n())}function Te(o,t){if(o&1&&(i(0,"small"),a(1),n(),i(2,"span",30),a(3,"Open run"),n()),o&2){let e=p().$implicit;l(),m("Top run: ",e.topSession.title)}}function Ae(o,t){if(o&1){let e=O();i(0,"button",29),v("click",function(){let r=b(e).$implicit,d=p(3);return f(d.emitOpenSession(r.topSession))}),i(1,"span"),a(2),n(),i(3,"strong"),a(4),c(5,"number"),n(),i(6,"em"),a(7),c(8,"number"),c(9,"number"),c(10,"number"),n(),u(11,Te,4,1),n()}if(o&2){let e=t.$implicit;g("disabled",!e.topSession),l(2),_(e.size),l(2),m("",C(5,7,e.count)," runs"),l(3),T(" ",y(8,9,e.credits,"1.0-1")," credits \xB7 $",y(9,12,e.cost,"1.2-4")," \xB7 ",y(10,15,e.share,"1.0-0"),"% of cohort "),l(4),x(e.topSession?11:-1)}}function Ie(o,t){if(o&1&&(i(0,"small"),a(1),n(),i(2,"span",30),a(3,"Open run"),n()),o&2){let e=p().$implicit;l(),m("Top run: ",e.topSession.title)}}function Fe(o,t){if(o&1){let e=O();i(0,"button",29),v("click",function(){let r=b(e).$implicit,d=p(3);return f(d.emitOpenSession(r.topSession))}),i(1,"span"),a(2),n(),i(3,"strong"),a(4),c(5,"number"),n(),i(6,"em"),a(7),c(8,"number"),c(9,"number"),c(10,"number"),n(),u(11,Ie,4,1),n()}if(o&2){let e=t.$implicit;g("disabled",!e.topSession),l(2),_(e.label),l(2),m("",C(5,7,e.count)," runs"),l(3),T(" ",y(8,9,e.credits,"1.0-1")," credits \xB7 $",y(9,12,e.cost,"1.2-4")," \xB7 ",C(10,15,e.tokens)," tokens "),l(4),x(e.topSession?11:-1)}}function Be(o,t){o&1&&(i(0,"p",18),a(1,"No trend rows for the current Insights cohort."),n())}function $e(o,t){if(o&1&&(i(0,"em"),a(1),n(),i(2,"span",30),a(3,"Open run"),n()),o&2){let e=p().$implicit;l(),_(e.session.title)}}function Re(o,t){if(o&1){let e=O();i(0,"button",29),v("click",function(){let r=b(e).$implicit,d=p(3);return f(d.emitOpenSession(r.session))}),i(1,"span",31),a(2),w(3,"app-help-popover",32),n(),i(4,"strong"),a(5),n(),u(6,$e,4,1),n()}if(o&2){let e=t.$implicit;g("disabled",!e.session),l(2),m(" ",e.label," "),l(),g("text",e.help)("label","Explain "+e.label)("interactive",!1),l(2),_(e.value),l(),x(e.session?6:-1)}}function Ve(o,t){if(o&1){let e=O();i(0,"button",33),v("click",function(){let r=b(e).$implicit,d=p(3);return f(d.emitOpenSession(r.session))}),i(1,"span"),a(2),c(3,"number"),c(4,"number"),c(5,"number"),n(),i(6,"strong"),a(7),n(),i(8,"em"),a(9),n(),i(10,"span",30),a(11,"Open run"),n()()}if(o&2){let e=t.$implicit,s=p(3);l(2),T(" ",C(3,5,e.tokens)," tokens \xB7 $",y(4,7,s.usageUsd(e.session),"1.2-4")," \xB7 ",y(5,10,s.usageCredits(e.session),"1.0-1")," credits "),l(5),_(e.session.title),l(2),_(e.reason)}}function ze(o,t){o&1&&(i(0,"p",18),a(1,"No outliers in the current Insights cohort."),n())}function Ge(o,t){if(o&1&&(i(0,"section",12)(1,"div",13)(2,"div",14)(3,"div")(4,"h3"),a(5,"Model breakdown"),n(),i(6,"p"),a(7,"Model mix and priced token shape for this cohort."),n()(),i(8,"span"),a(9),c(10,"number"),n()(),i(11,"div",15)(12,"div",16)(13,"span"),a(14,"Model"),n(),i(15,"span"),a(16,"Sessions"),n(),i(17,"span"),a(18,"Tokens"),n(),i(19,"span"),a(20,"Cost"),n(),i(21,"span"),a(22,"Cost / 1k"),n(),i(23,"span"),a(24,"Share"),n()(),M(25,ke,32,35,"div",17,me,!1,Ee,2,0,"p",18),n()(),i(28,"aside",19)(29,"div",20)(30,"div",21)(31,"h3"),a(32,"Run size mix"),n(),i(33,"p"),a(34,"How runs are distributed by size."),n()(),i(35,"div",22),M(36,Ae,12,18,"button",23,ge),n()(),i(38,"div",20)(39,"div",21)(40,"h3"),a(41,"Usage trend"),n(),i(42,"p"),a(43),n()(),i(44,"div",22),M(45,Fe,12,17,"button",23,_e,!1,Be,2,0,"p",18),n()()()(),i(48,"section",24)(49,"div",20)(50,"div",21)(51,"h3"),a(52,"Runs to inspect"),n(),i(53,"p"),a(54,"Open the largest runs in this cohort."),n()(),i(55,"div",25),M(56,Re,7,7,"button",23,ue),n()(),i(58,"div",20)(59,"div",21)(60,"h3"),a(61,"Outlier signals"),n(),i(62,"p"),a(63,"Runs that stand apart from this cohort."),n()(),i(64,"div",25),M(65,Ve,12,13,"button",26,xe,!1,ze,2,0,"p",18),n()()()),o&2){let e=p();l(9),m("",C(10,5,e.modelRows.length)," rows"),l(16),P(e.modelRows),l(11),P(e.distribution),l(7),m("",e.groupingLabel,"."),l(2),P(e.trendRows),l(11),P(e.highlights),l(9),P(e.outliers)}}function De(o,t){if(o&1){let e=O();i(0,"section",0)(1,"div",1)(2,"div")(3,"p",2),a(4,"Cohort insights"),n(),i(5,"h2"),a(6,"Run patterns"),n(),i(7,"p",3),a(8),u(9,Ce,1,1),w(10,"app-help-popover",4),n()(),u(11,ye,2,0,"button",5),n(),i(12,"section",6)(13,"label")(14,"span"),a(15," Time range "),n(),i(16,"select",7),v("ngModelChange",function(r){b(e);let d=p();return f(d.setAnalyticsTimeRange(r))}),M(17,he,2,2,"option",8,ie),n()(),i(19,"label")(20,"span"),a(21,"Workspace"),n(),i(22,"select",7),v("ngModelChange",function(r){b(e);let d=p();return f(d.setAnalyticsWorkspaceFilter(r))}),M(23,be,2,2,"option",8,R),n()(),i(25,"label")(26,"span"),a(27,"Model"),n(),i(28,"select",7),v("ngModelChange",function(r){b(e);let d=p();return f(d.setAnalyticsModelFilter(r))}),M(29,fe,2,2,"option",8,R),n()(),i(31,"label")(32,"span"),a(33," Group trend by "),w(34,"app-help-popover",9),n(),i(35,"select",7),v("ngModelChange",function(r){b(e);let d=p();return f(d.setAnalyticsGrouping(r))}),M(36,ve,2,2,"option",8,ie),n()()(),u(38,Pe,6,3,"section",10)(39,Ge,68,7),n()}if(o&2){let e=t,s=p();l(8),N(" ",e.count," of ",e.importedCount," imported sessions included. "),l(),x(e.analyticsExcludedCount>0?9:-1),l(),g("text",s.help.analyticsScope),l(),x(e.analyticsFiltersActive?11:-1),l(5),g("ngModel",s.analyticsTimeRange()),l(),P(s.analyticsTimeOptions),l(5),g("ngModel",s.analyticsWorkspaceFilter()),l(),P(s.analyticsWorkspaceOptions()),l(5),g("ngModel",s.analyticsModelFilter()),l(),P(s.analyticsModelOptions()),l(5),g("text",s.help.trendGrouping),l(),g("ngModel",s.analyticsGrouping()),l(),P(s.analyticsGroupingOptions),l(2),x(e.count===0?38:39)}}var oe=class o{sessionsInput=S([]);openSession=new z;set sessions(t){this.sessionsInput.set(t??[])}analyticsTimeRange=S("all");analyticsWorkspaceFilter=S("all");analyticsModelFilter=S("all");analyticsGrouping=S("day");help={analyticsScope:"Insights use imported sessions and the time, workspace, and model filters on this page.",trendGrouping:"Time range chooses which sessions are included. Grouping only changes how those sessions are bucketed in the trend panel."};sizeOptions=["Small","Medium","Large","Very large"];analyticsTimeOptions=[{value:"all",label:"All time"},{value:"current-month",label:"Current month"},{value:"previous-month",label:"Previous month"},{value:"7d",label:"Last 7 days"},{value:"30d",label:"Last 30 days"},{value:"90d",label:"Last 90 days"}];analyticsGroupingOptions=[{value:"day",label:"By day"},{value:"week",label:"By week"},{value:"month",label:"By month"}];analyticsWorkspaceOptions=k(()=>{let t=new Set(this.sessionsInput().map(s=>s.workspace).filter(Boolean)),e=this.analyticsWorkspaceFilter();return e!=="all"&&t.add(e),["all",...[...t].sort()]});analyticsModelOptions=k(()=>{let t=new Set;for(let s of this.sessionsInput())for(let r of s.modelBreakdown)t.add(r.pricingModel||r.model);let e=this.analyticsModelFilter();return e!=="all"&&t.add(e),["all",...[...t].sort()]});analyticsSessions=k(()=>Y(this.sessionsInput(),this.analyticsTimeRange(),this.analyticsWorkspaceFilter(),this.analyticsModelFilter()));analytics=k(()=>{let t=this.analyticsSessions(),e=t.length,s=this.sessionsInput().length,r=t.reduce((h,$)=>h+A($),0),d=t.reduce((h,$)=>h+E($),0),ae=e?r/e:0,le=e?d/e:0,I=V(t,h=>A(h)),F=V(t,h=>E(h)),se=Z(t,d),re=ee(t,this.analyticsGrouping()),ce=te(t,d),pe=ne(t,le,ae),de=this.analyticsTimeRange()!=="all"||this.analyticsWorkspaceFilter()!=="all"||this.analyticsModelFilter()!=="all"||this.analyticsGrouping()!=="day",B=Math.max(s-e,0);return{count:e,importedCount:s,analyticsFiltersActive:de,analyticsExcludedCount:B,emptyTitle:s===0?"No imported sessions":"No sessions in this Insights cohort",emptyDetail:s===0?"Import VS Code sessions to explore model mix, run sizes, trends, and outliers.":`${B.toLocaleString()} imported session${B===1?"":"s"} excluded by the Insights controls. Reset the filters to return to all imported sessions.`,timeRangeLabel:this.analyticsTimeOptions.find(h=>h.value===this.analyticsTimeRange())?.label??"All time",workspaceLabel:this.analyticsWorkspaceFilter()==="all"?"All workspaces":this.analyticsWorkspaceFilter(),modelLabel:this.analyticsModelFilter()==="all"?"All models":this.analyticsModelFilter(),groupingLabel:this.analyticsGroupingOptions.find(h=>h.value===this.analyticsGrouping())?.label??"By day",highlights:[{label:"Highest-token run",session:I,value:I?`${A(I).toLocaleString()} tokens`:"n/a",help:"The included session with the largest imported token total."},{label:"Most expensive run",session:F,value:F?`$${E(F).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:4})}`:"n/a",help:"The included session with the highest GitHub source usage, falling back to token estimate when source usage is absent."}],modelRows:se,trendRows:re,distribution:ce,outliers:pe}});setAnalyticsTimeRange(t){this.analyticsTimeRange.set(t)}setAnalyticsWorkspaceFilter(t){this.analyticsWorkspaceFilter.set(t)}setAnalyticsModelFilter(t){this.analyticsModelFilter.set(t)}setAnalyticsGrouping(t){this.analyticsGrouping.set(t)}resetAnalyticsFilters(){this.analyticsTimeRange.set("all"),this.analyticsWorkspaceFilter.set("all"),this.analyticsModelFilter.set("all"),this.analyticsGrouping.set("day")}emitOpenSession(t){t&&this.openSession.emit(t)}aiCredits(t){return t/L}usageUsd(t){return E(t)}usageCredits(t){return U(t)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=G({type:o,selectors:[["app-analytics-page"]],inputs:{sessions:"sessions"},outputs:{openSession:"openSession"},decls:1,vars:1,consts:[[1,"pricing-page","analytics-page"],[1,"pricing-header"],[1,"eyebrow"],[1,"analytics-cohort"],["label","Explain analytics scope",3,"text"],["type","button",1,"ghost-button"],["aria-label","Analytics cohort controls",1,"analytics-controls"],[3,"ngModelChange","ngModel"],[3,"value"],["label","Explain trend grouping",3,"text"],[1,"analytics-empty"],["type","button",1,"ghost-button",3,"click"],[1,"analytics-primary"],[1,"analytics-panel","model-panel"],[1,"panel-heading"],["role","table","aria-label","Model breakdown",1,"cost-table","compact-table"],[1,"cost-row","analytics-model-row","cost-row-heading"],[1,"cost-row","analytics-model-row"],[1,"empty"],[1,"analytics-side"],[1,"analytics-panel"],[1,"panel-heading","compact-heading"],[1,"stat-list","compact"],["type","button",3,"disabled"],[1,"analytics-split"],[1,"highlight-list"],["type","button"],[1,"warning-text"],[1,"share-cell"],["type","button",3,"click","disabled"],[1,"open-cue"],[1,"row-kicker"],[3,"text","label","interactive"],["type","button",3,"click"]],template:function(e,s){if(e&1&&u(0,De,40,11,"section",0),e&2){let r;x((r=s.analytics())?0:-1,r)}},dependencies:[X,K,Q,J,j,q,H,W],styles:[".analytics-page[_ngcontent-%COMP%]{display:grid;gap:10px}.pricing-header[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.pricing-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:3px 0 0;color:var(--text-strong);font-size:21px;font-weight:760;letter-spacing:0}.pricing-header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:inline-flex;align-items:center;flex-wrap:wrap;gap:4px;max-width:820px;margin:6px 0 0;color:var(--muted);font-size:12px;line-height:1.45}.analytics-cohort[_ngcontent-%COMP%]{opacity:.86}.ghost-button[_ngcontent-%COMP%]{border:1px solid var(--line);border-radius:9px;padding:7px 10px;color:var(--text);background:var(--surface-soft);font-size:13px;font-weight:720;cursor:pointer}.ghost-button[_ngcontent-%COMP%]:hover{border-color:var(--line-strong)}.analytics-controls[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(4,minmax(140px,1fr));gap:7px;border:1px solid var(--line);border-radius:12px;padding:8px;background:linear-gradient(135deg,#0c9f830e,#6f5cff09),var(--surface);box-shadow:var(--shadow-soft, 0 12px 30px rgba(15, 23, 42, .08))}.analytics-controls[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:grid;gap:5px;min-width:0;color:var(--muted);font-size:10px;font-weight:720}.analytics-controls[_ngcontent-%COMP%] label[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px}.analytics-controls[_ngcontent-%COMP%] select[_ngcontent-%COMP%], .analytics-controls[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{width:100%;min-height:30px;border:1px solid var(--line);border-radius:7px;padding:6px 9px;background:var(--surface-soft);color:var(--text);font:inherit;font-size:12px;font-weight:720}.analytics-empty[_ngcontent-%COMP%], .analytics-panel[_ngcontent-%COMP%]{border:1px solid var(--line);border-radius:12px;background:var(--surface);box-shadow:var(--shadow-soft, 0 12px 30px rgba(15, 23, 42, .08))}.analytics-empty[_ngcontent-%COMP%]{display:grid;gap:8px;justify-items:start;padding:18px}.analytics-empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{max-width:720px;margin:0;color:var(--muted);font-size:12px}.analytics-primary[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr;gap:10px;align-items:start}.analytics-side[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.analytics-split[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;align-items:start}.analytics-panel[_ngcontent-%COMP%]{display:grid;gap:8px;min-width:0;padding:11px}.analytics-panel[_ngcontent-%COMP%] h3[_ngcontent-%COMP%], .analytics-empty[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;color:var(--text-strong);font-size:15px;font-weight:760}.panel-heading[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.compact-heading[_ngcontent-%COMP%]{align-items:baseline}.panel-heading[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:3px 0 0;color:var(--muted);font-size:12px}.compact-heading[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;text-align:right}.panel-note[_ngcontent-%COMP%]{margin:-3px 0 0;color:var(--muted);font-size:12px}.panel-heading[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{flex:0 0 auto;border:1px solid var(--line);border-radius:999px;padding:3px 7px;color:var(--muted);background:var(--surface-soft);font-size:11px;font-weight:720}.highlight-list[_ngcontent-%COMP%], .stat-list[_ngcontent-%COMP%]{display:grid;gap:6px}.highlight-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%], .stat-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%], .stat-list[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{display:grid;gap:5px;width:100%;min-width:0;border:1px solid var(--line);border-radius:9px;padding:8px 9px;background:var(--surface-soft);color:var(--text);text-align:left}.highlight-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%], .stat-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{cursor:pointer}.highlight-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover, .stat-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{border-color:var(--line-strong)}.highlight-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled, .stat-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{cursor:default;opacity:.65}.highlight-list[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .highlight-list[_ngcontent-%COMP%] em[_ngcontent-%COMP%], .stat-list[_ngcontent-%COMP%] small[_ngcontent-%COMP%], .stat-list[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .stat-list[_ngcontent-%COMP%] em[_ngcontent-%COMP%], .cost-row[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .cost-row[_ngcontent-%COMP%] em[_ngcontent-%COMP%], .empty[_ngcontent-%COMP%]{color:var(--muted);font-size:12px;font-style:normal;line-height:1.35}.stat-list[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.row-kicker[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px}.highlight-list[_ngcontent-%COMP%] strong[_ngcontent-%COMP%], .stat-list[_ngcontent-%COMP%] strong[_ngcontent-%COMP%], .cost-row[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text-strong);font-size:14px;font-weight:760;line-height:1.25}.open-cue[_ngcontent-%COMP%]{justify-self:start;border:1px solid var(--line);border-radius:999px;padding:3px 7px;background:#0c9f8314;color:var(--accent-strong, var(--accent))!important;font-size:10px!important;font-weight:760;text-transform:uppercase;letter-spacing:.04em}.highlight-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover .open-cue[_ngcontent-%COMP%], .highlight-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:focus-visible .open-cue[_ngcontent-%COMP%]{border-color:color-mix(in srgb,var(--accent) 45%,var(--line));background:#0c9f8324}.stat-list.compact[_ngcontent-%COMP%] div[_ngcontent-%COMP%], .stat-list.compact[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{grid-template-columns:minmax(110px,.35fr) minmax(0,1fr) auto;gap:4px 10px;align-items:center;padding:8px 9px}.stat-list.compact[_ngcontent-%COMP%] small[_ngcontent-%COMP%], .stat-list.compact[_ngcontent-%COMP%] .open-cue[_ngcontent-%COMP%]{grid-column:2 / -1}.cost-table[_ngcontent-%COMP%]{overflow-x:auto;border:1px solid var(--line);border-radius:10px;background:var(--surface)}.cost-row[_ngcontent-%COMP%]{display:grid;align-items:start;gap:8px;min-width:650px;border-bottom:1px solid var(--line);padding:8px 10px}.cost-row[_ngcontent-%COMP%]:last-child{border-bottom:0}.cost-row-heading[_ngcontent-%COMP%]{color:var(--muted);background:var(--surface-soft);font-size:11px;font-weight:760;letter-spacing:.04em;text-transform:uppercase}.analytics-model-row[_ngcontent-%COMP%]{grid-template-columns:minmax(170px,1.25fr) minmax(62px,.36fr) minmax(180px,1fr) minmax(86px,.48fr) minmax(84px,.46fr) minmax(80px,.45fr)}.analytics-model-row[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{display:grid;gap:3px}.analytics-model-row[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{display:block;margin-top:2px}.warning-text[_ngcontent-%COMP%]{color:var(--warning-text, #ffcf91)!important}.share-cell[_ngcontent-%COMP%]{display:grid;gap:5px}.share-cell[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{display:block;width:0;max-width:100%;height:4px;border-radius:999px;background:linear-gradient(90deg,var(--accent),var(--accent-2))}@media(max-width:1200px){.analytics-side[_ngcontent-%COMP%], .analytics-split[_ngcontent-%COMP%]{grid-template-columns:1fr}}@media(max-width:960px){.analytics-primary[_ngcontent-%COMP%]{grid-template-columns:1fr}}@media(max-width:900px){.pricing-header[_ngcontent-%COMP%], .analytics-controls[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr}}@media(max-width:600px){.analytics-panel[_ngcontent-%COMP%]{padding:11px}.cost-row[_ngcontent-%COMP%]{min-width:620px}}"]})};export{oe as AnalyticsPageComponent};
|
|
1
|
+
import{a as Y,b as Z,c as ee,d as te,e as ne,g as V}from"./chunk-YCZAIDR7.js";import{f as L,q as A,r as E,s as U}from"./chunk-5FL3PHQS.js";import{$a as C,Ca as u,Da as x,Ea as R,Fa as M,Ga as P,Ha as g,Ia as i,Ja as n,Ka as w,O as b,Oa as O,P as f,Qa as v,Sa as p,Ta as D,U as z,Va as a,Wa as _,Xa as m,Ya as N,Z as S,Za as T,_a as c,ab as y,db as k,ka as l,ob as W,sa as G,sb as H,ub as j,vb as q,wb as J,xb as K,yb as Q,zb as X}from"./chunk-WOIYAEKB.js";var ie=(o,t)=>t.value,me=(o,t)=>t.model+t.pricingModel,ge=(o,t)=>t.size,_e=(o,t)=>t.key,ue=(o,t)=>t.label,xe=(o,t)=>t.session.id;function Ce(o,t){if(o&1&&a(0),o&2){let e=p();m(" ",e.analyticsExcludedCount," excluded by these filters. ")}}function ye(o,t){if(o&1){let e=O();i(0,"button",11),v("click",function(){b(e);let r=p(2);return f(r.resetAnalyticsFilters())}),a(1,"Reset filters"),n()}}function he(o,t){if(o&1&&(i(0,"option",8),a(1),n()),o&2){let e=t.$implicit;g("value",e.value),l(),_(e.label)}}function be(o,t){if(o&1&&(i(0,"option",8),a(1),n()),o&2){let e=t.$implicit;g("value",e),l(),_(e==="all"?"All workspaces":e)}}function fe(o,t){if(o&1&&(i(0,"option",8),a(1),n()),o&2){let e=t.$implicit;g("value",e),l(),_(e==="all"?"All models":e)}}function ve(o,t){if(o&1&&(i(0,"option",8),a(1),n()),o&2){let e=t.$implicit;g("value",e.value),l(),_(e.label)}}function Me(o,t){if(o&1){let e=O();i(0,"button",11),v("click",function(){b(e);let r=p(3);return f(r.resetAnalyticsFilters())}),a(1,"Reset filters"),n()}}function Pe(o,t){if(o&1&&(i(0,"section",10)(1,"h3"),a(2),n(),i(3,"p"),a(4),n(),u(5,Me,2,0,"button",5),n()),o&2){let e=p();l(2),_(e.emptyTitle),l(2),_(e.emptyDetail),l(),x(e.analyticsFiltersActive?5:-1)}}function Oe(o,t){o&1&&(i(0,"em",27),a(1,"fallback pricing"),n())}function Se(o,t){if(o&1&&(a(0),c(1,"number")),o&2){let e=p().$implicit;m(" / ",C(1,1,e.cachedInput)," cached in ")}}function we(o,t){if(o&1&&(a(0),c(1,"number")),o&2){let e=p().$implicit;m(" / ",C(1,1,e.cacheWrite)," cache write ")}}function ke(o,t){if(o&1&&(i(0,"div",17)(1,"strong"),a(2),i(3,"em"),a(4),n(),u(5,Oe,2,0,"em",27),n(),i(6,"span"),a(7),c(8,"number"),n(),i(9,"span"),a(10),c(11,"number"),i(12,"em"),a(13),c(14,"number"),u(15,Se,2,3),u(16,we,2,3),a(17),c(18,"number"),n()(),i(19,"span"),a(20),c(21,"number"),i(22,"em"),a(23),c(24,"number"),n()(),i(25,"span"),a(26),c(27,"number"),n(),i(28,"span",28),a(29),c(30,"number"),w(31,"i"),n()()),o&2){let e=t.$implicit,s=p(3);l(2),m(" ",e.model," "),l(2),_(e.pricingModel),l(),x(e.usesFallbackPrice?5:-1),l(2),_(C(8,15,e.sessionCount)),l(3),m(" ",C(11,17,e.tokens)," "),l(3),m(" ",C(14,19,e.input)," normal in "),l(2),x(e.cachedInput?15:-1),l(),x(e.cacheWrite?16:-1),l(),m(" / ",C(18,21,e.output)," out "),l(3),m(" $",y(21,23,e.cost,"1.2-4")," "),l(3),m("",y(24,26,s.aiCredits(e.cost),"1.0-1")," credits"),l(3),m("$",y(27,29,e.costPer1k,"1.4-4")),l(3),m(" ",y(30,32,e.share,"1.0-0"),"% "),l(2),D("width",e.share,"%")}}function Ee(o,t){o&1&&(i(0,"p",18),a(1,"No model rows for the current Insights cohort."),n())}function Te(o,t){if(o&1&&(i(0,"small"),a(1),n(),i(2,"span",30),a(3,"Open run"),n()),o&2){let e=p().$implicit;l(),m("Top run: ",e.topSession.title)}}function Ae(o,t){if(o&1){let e=O();i(0,"button",29),v("click",function(){let r=b(e).$implicit,d=p(3);return f(d.emitOpenSession(r.topSession))}),i(1,"span"),a(2),n(),i(3,"strong"),a(4),c(5,"number"),n(),i(6,"em"),a(7),c(8,"number"),c(9,"number"),c(10,"number"),n(),u(11,Te,4,1),n()}if(o&2){let e=t.$implicit;g("disabled",!e.topSession),l(2),_(e.size),l(2),m("",C(5,7,e.count)," runs"),l(3),T(" ",y(8,9,e.credits,"1.0-1")," credits \xB7 $",y(9,12,e.cost,"1.2-4")," \xB7 ",y(10,15,e.share,"1.0-0"),"% of cohort "),l(4),x(e.topSession?11:-1)}}function Ie(o,t){if(o&1&&(i(0,"small"),a(1),n(),i(2,"span",30),a(3,"Open run"),n()),o&2){let e=p().$implicit;l(),m("Top run: ",e.topSession.title)}}function Fe(o,t){if(o&1){let e=O();i(0,"button",29),v("click",function(){let r=b(e).$implicit,d=p(3);return f(d.emitOpenSession(r.topSession))}),i(1,"span"),a(2),n(),i(3,"strong"),a(4),c(5,"number"),n(),i(6,"em"),a(7),c(8,"number"),c(9,"number"),c(10,"number"),n(),u(11,Ie,4,1),n()}if(o&2){let e=t.$implicit;g("disabled",!e.topSession),l(2),_(e.label),l(2),m("",C(5,7,e.count)," runs"),l(3),T(" ",y(8,9,e.credits,"1.0-1")," credits \xB7 $",y(9,12,e.cost,"1.2-4")," \xB7 ",C(10,15,e.tokens)," tokens "),l(4),x(e.topSession?11:-1)}}function Be(o,t){o&1&&(i(0,"p",18),a(1,"No trend rows for the current Insights cohort."),n())}function $e(o,t){if(o&1&&(i(0,"em"),a(1),n(),i(2,"span",30),a(3,"Open run"),n()),o&2){let e=p().$implicit;l(),_(e.session.title)}}function Re(o,t){if(o&1){let e=O();i(0,"button",29),v("click",function(){let r=b(e).$implicit,d=p(3);return f(d.emitOpenSession(r.session))}),i(1,"span",31),a(2),w(3,"app-help-popover",32),n(),i(4,"strong"),a(5),n(),u(6,$e,4,1),n()}if(o&2){let e=t.$implicit;g("disabled",!e.session),l(2),m(" ",e.label," "),l(),g("text",e.help)("label","Explain "+e.label)("interactive",!1),l(2),_(e.value),l(),x(e.session?6:-1)}}function Ve(o,t){if(o&1){let e=O();i(0,"button",33),v("click",function(){let r=b(e).$implicit,d=p(3);return f(d.emitOpenSession(r.session))}),i(1,"span"),a(2),c(3,"number"),c(4,"number"),c(5,"number"),n(),i(6,"strong"),a(7),n(),i(8,"em"),a(9),n(),i(10,"span",30),a(11,"Open run"),n()()}if(o&2){let e=t.$implicit,s=p(3);l(2),T(" ",C(3,5,e.tokens)," tokens \xB7 $",y(4,7,s.usageUsd(e.session),"1.2-4")," \xB7 ",y(5,10,s.usageCredits(e.session),"1.0-1")," credits "),l(5),_(e.session.title),l(2),_(e.reason)}}function ze(o,t){o&1&&(i(0,"p",18),a(1,"No outliers in the current Insights cohort."),n())}function Ge(o,t){if(o&1&&(i(0,"section",12)(1,"div",13)(2,"div",14)(3,"div")(4,"h3"),a(5,"Model breakdown"),n(),i(6,"p"),a(7,"Model mix and priced token shape for this cohort."),n()(),i(8,"span"),a(9),c(10,"number"),n()(),i(11,"div",15)(12,"div",16)(13,"span"),a(14,"Model"),n(),i(15,"span"),a(16,"Sessions"),n(),i(17,"span"),a(18,"Tokens"),n(),i(19,"span"),a(20,"Cost"),n(),i(21,"span"),a(22,"Cost / 1k"),n(),i(23,"span"),a(24,"Share"),n()(),M(25,ke,32,35,"div",17,me,!1,Ee,2,0,"p",18),n()(),i(28,"aside",19)(29,"div",20)(30,"div",21)(31,"h3"),a(32,"Run size mix"),n(),i(33,"p"),a(34,"How runs are distributed by size."),n()(),i(35,"div",22),M(36,Ae,12,18,"button",23,ge),n()(),i(38,"div",20)(39,"div",21)(40,"h3"),a(41,"Usage trend"),n(),i(42,"p"),a(43),n()(),i(44,"div",22),M(45,Fe,12,17,"button",23,_e,!1,Be,2,0,"p",18),n()()()(),i(48,"section",24)(49,"div",20)(50,"div",21)(51,"h3"),a(52,"Runs to inspect"),n(),i(53,"p"),a(54,"Open the largest runs in this cohort."),n()(),i(55,"div",25),M(56,Re,7,7,"button",23,ue),n()(),i(58,"div",20)(59,"div",21)(60,"h3"),a(61,"Outlier signals"),n(),i(62,"p"),a(63,"Runs that stand apart from this cohort."),n()(),i(64,"div",25),M(65,Ve,12,13,"button",26,xe,!1,ze,2,0,"p",18),n()()()),o&2){let e=p();l(9),m("",C(10,5,e.modelRows.length)," rows"),l(16),P(e.modelRows),l(11),P(e.distribution),l(7),m("",e.groupingLabel,"."),l(2),P(e.trendRows),l(11),P(e.highlights),l(9),P(e.outliers)}}function De(o,t){if(o&1){let e=O();i(0,"section",0)(1,"div",1)(2,"div")(3,"p",2),a(4,"Cohort insights"),n(),i(5,"h2"),a(6,"Run patterns"),n(),i(7,"p",3),a(8),u(9,Ce,1,1),w(10,"app-help-popover",4),n()(),u(11,ye,2,0,"button",5),n(),i(12,"section",6)(13,"label")(14,"span"),a(15," Time range "),n(),i(16,"select",7),v("ngModelChange",function(r){b(e);let d=p();return f(d.setAnalyticsTimeRange(r))}),M(17,he,2,2,"option",8,ie),n()(),i(19,"label")(20,"span"),a(21,"Workspace"),n(),i(22,"select",7),v("ngModelChange",function(r){b(e);let d=p();return f(d.setAnalyticsWorkspaceFilter(r))}),M(23,be,2,2,"option",8,R),n()(),i(25,"label")(26,"span"),a(27,"Model"),n(),i(28,"select",7),v("ngModelChange",function(r){b(e);let d=p();return f(d.setAnalyticsModelFilter(r))}),M(29,fe,2,2,"option",8,R),n()(),i(31,"label")(32,"span"),a(33," Group trend by "),w(34,"app-help-popover",9),n(),i(35,"select",7),v("ngModelChange",function(r){b(e);let d=p();return f(d.setAnalyticsGrouping(r))}),M(36,ve,2,2,"option",8,ie),n()()(),u(38,Pe,6,3,"section",10)(39,Ge,68,7),n()}if(o&2){let e=t,s=p();l(8),N(" ",e.count," of ",e.importedCount," imported sessions included. "),l(),x(e.analyticsExcludedCount>0?9:-1),l(),g("text",s.help.analyticsScope),l(),x(e.analyticsFiltersActive?11:-1),l(5),g("ngModel",s.analyticsTimeRange()),l(),P(s.analyticsTimeOptions),l(5),g("ngModel",s.analyticsWorkspaceFilter()),l(),P(s.analyticsWorkspaceOptions()),l(5),g("ngModel",s.analyticsModelFilter()),l(),P(s.analyticsModelOptions()),l(5),g("text",s.help.trendGrouping),l(),g("ngModel",s.analyticsGrouping()),l(),P(s.analyticsGroupingOptions),l(2),x(e.count===0?38:39)}}var oe=class o{sessionsInput=S([]);openSession=new z;set sessions(t){this.sessionsInput.set(t??[])}analyticsTimeRange=S("all");analyticsWorkspaceFilter=S("all");analyticsModelFilter=S("all");analyticsGrouping=S("day");help={analyticsScope:"Insights use imported sessions and the time, workspace, and model filters on this page.",trendGrouping:"Time range chooses which sessions are included. Grouping only changes how those sessions are bucketed in the trend panel."};sizeOptions=["Small","Medium","Large","Very large"];analyticsTimeOptions=[{value:"all",label:"All time"},{value:"current-month",label:"Current month"},{value:"previous-month",label:"Previous month"},{value:"7d",label:"Last 7 days"},{value:"30d",label:"Last 30 days"},{value:"90d",label:"Last 90 days"}];analyticsGroupingOptions=[{value:"day",label:"By day"},{value:"week",label:"By week"},{value:"month",label:"By month"}];analyticsWorkspaceOptions=k(()=>{let t=new Set(this.sessionsInput().map(s=>s.workspace).filter(Boolean)),e=this.analyticsWorkspaceFilter();return e!=="all"&&t.add(e),["all",...[...t].sort()]});analyticsModelOptions=k(()=>{let t=new Set;for(let s of this.sessionsInput())for(let r of s.modelBreakdown)t.add(r.pricingModel||r.model);let e=this.analyticsModelFilter();return e!=="all"&&t.add(e),["all",...[...t].sort()]});analyticsSessions=k(()=>Y(this.sessionsInput(),this.analyticsTimeRange(),this.analyticsWorkspaceFilter(),this.analyticsModelFilter()));analytics=k(()=>{let t=this.analyticsSessions(),e=t.length,s=this.sessionsInput().length,r=t.reduce((h,$)=>h+A($),0),d=t.reduce((h,$)=>h+E($),0),ae=e?r/e:0,le=e?d/e:0,I=V(t,h=>A(h)),F=V(t,h=>E(h)),se=Z(t,d),re=ee(t,this.analyticsGrouping()),ce=te(t,d),pe=ne(t,le,ae),de=this.analyticsTimeRange()!=="all"||this.analyticsWorkspaceFilter()!=="all"||this.analyticsModelFilter()!=="all"||this.analyticsGrouping()!=="day",B=Math.max(s-e,0);return{count:e,importedCount:s,analyticsFiltersActive:de,analyticsExcludedCount:B,emptyTitle:s===0?"No imported sessions":"No sessions in this Insights cohort",emptyDetail:s===0?"Import VS Code sessions to explore model mix, run sizes, trends, and outliers.":`${B.toLocaleString()} imported session${B===1?"":"s"} excluded by the Insights controls. Reset the filters to return to all imported sessions.`,timeRangeLabel:this.analyticsTimeOptions.find(h=>h.value===this.analyticsTimeRange())?.label??"All time",workspaceLabel:this.analyticsWorkspaceFilter()==="all"?"All workspaces":this.analyticsWorkspaceFilter(),modelLabel:this.analyticsModelFilter()==="all"?"All models":this.analyticsModelFilter(),groupingLabel:this.analyticsGroupingOptions.find(h=>h.value===this.analyticsGrouping())?.label??"By day",highlights:[{label:"Highest-token run",session:I,value:I?`${A(I).toLocaleString()} tokens`:"n/a",help:"The included session with the largest imported token total."},{label:"Most expensive run",session:F,value:F?`$${E(F).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:4})}`:"n/a",help:"The included session with the highest GitHub source usage, falling back to token estimate when source usage is absent."}],modelRows:se,trendRows:re,distribution:ce,outliers:pe}});setAnalyticsTimeRange(t){this.analyticsTimeRange.set(t)}setAnalyticsWorkspaceFilter(t){this.analyticsWorkspaceFilter.set(t)}setAnalyticsModelFilter(t){this.analyticsModelFilter.set(t)}setAnalyticsGrouping(t){this.analyticsGrouping.set(t)}resetAnalyticsFilters(){this.analyticsTimeRange.set("all"),this.analyticsWorkspaceFilter.set("all"),this.analyticsModelFilter.set("all"),this.analyticsGrouping.set("day")}emitOpenSession(t){t&&this.openSession.emit(t)}aiCredits(t){return t/L}usageUsd(t){return E(t)}usageCredits(t){return U(t)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=G({type:o,selectors:[["app-analytics-page"]],inputs:{sessions:"sessions"},outputs:{openSession:"openSession"},decls:1,vars:1,consts:[[1,"pricing-page","analytics-page"],[1,"pricing-header"],[1,"eyebrow"],[1,"analytics-cohort"],["label","Explain analytics scope",3,"text"],["type","button",1,"ghost-button"],["aria-label","Analytics cohort controls",1,"analytics-controls"],[3,"ngModelChange","ngModel"],[3,"value"],["label","Explain trend grouping",3,"text"],[1,"analytics-empty"],["type","button",1,"ghost-button",3,"click"],[1,"analytics-primary"],[1,"analytics-panel","model-panel"],[1,"panel-heading"],["role","table","aria-label","Model breakdown",1,"cost-table","compact-table"],[1,"cost-row","analytics-model-row","cost-row-heading"],[1,"cost-row","analytics-model-row"],[1,"empty"],[1,"analytics-side"],[1,"analytics-panel"],[1,"panel-heading","compact-heading"],[1,"stat-list","compact"],["type","button",3,"disabled"],[1,"analytics-split"],[1,"highlight-list"],["type","button"],[1,"warning-text"],[1,"share-cell"],["type","button",3,"click","disabled"],[1,"open-cue"],[1,"row-kicker"],[3,"text","label","interactive"],["type","button",3,"click"]],template:function(e,s){if(e&1&&u(0,De,40,11,"section",0),e&2){let r;x((r=s.analytics())?0:-1,r)}},dependencies:[X,K,Q,J,j,q,H,W],styles:[".analytics-page[_ngcontent-%COMP%]{display:grid;gap:10px}.pricing-header[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.pricing-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:3px 0 0;color:var(--text-strong);font-size:21px;font-weight:760;letter-spacing:0}.pricing-header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:inline-flex;align-items:center;flex-wrap:wrap;gap:4px;max-width:820px;margin:6px 0 0;color:var(--muted);font-size:12px;line-height:1.45}.analytics-cohort[_ngcontent-%COMP%]{opacity:.86}.ghost-button[_ngcontent-%COMP%]{border:1px solid var(--line);border-radius:9px;padding:7px 10px;color:var(--text);background:var(--surface-soft);font-size:13px;font-weight:720;cursor:pointer}.ghost-button[_ngcontent-%COMP%]:hover{border-color:var(--line-strong)}.analytics-controls[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(4,minmax(140px,1fr));gap:7px;border:1px solid var(--line);border-radius:12px;padding:8px;background:linear-gradient(135deg,#0c9f830e,#6f5cff09),var(--surface);box-shadow:var(--shadow-soft, 0 12px 30px rgba(15, 23, 42, .08))}.analytics-controls[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:grid;gap:5px;min-width:0;color:var(--muted);font-size:10px;font-weight:720}.analytics-controls[_ngcontent-%COMP%] label[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px}.analytics-controls[_ngcontent-%COMP%] select[_ngcontent-%COMP%], .analytics-controls[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{width:100%;min-height:30px;border:1px solid var(--line);border-radius:7px;padding:6px 9px;background:var(--surface-soft);color:var(--text);font:inherit;font-size:12px;font-weight:720}.analytics-empty[_ngcontent-%COMP%], .analytics-panel[_ngcontent-%COMP%]{border:1px solid var(--line);border-radius:12px;background:var(--surface);box-shadow:var(--shadow-soft, 0 12px 30px rgba(15, 23, 42, .08))}.analytics-empty[_ngcontent-%COMP%]{display:grid;gap:8px;justify-items:start;padding:18px}.analytics-empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{max-width:720px;margin:0;color:var(--muted);font-size:12px}.analytics-primary[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr;gap:10px;align-items:start}.analytics-side[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.analytics-split[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;align-items:start}.analytics-panel[_ngcontent-%COMP%]{display:grid;gap:8px;min-width:0;padding:11px}.analytics-panel[_ngcontent-%COMP%] h3[_ngcontent-%COMP%], .analytics-empty[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;color:var(--text-strong);font-size:15px;font-weight:760}.panel-heading[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.compact-heading[_ngcontent-%COMP%]{align-items:baseline}.panel-heading[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:3px 0 0;color:var(--muted);font-size:12px}.compact-heading[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;text-align:right}.panel-note[_ngcontent-%COMP%]{margin:-3px 0 0;color:var(--muted);font-size:12px}.panel-heading[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{flex:0 0 auto;border:1px solid var(--line);border-radius:999px;padding:3px 7px;color:var(--muted);background:var(--surface-soft);font-size:11px;font-weight:720}.highlight-list[_ngcontent-%COMP%], .stat-list[_ngcontent-%COMP%]{display:grid;gap:6px}.highlight-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%], .stat-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%], .stat-list[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{display:grid;gap:5px;width:100%;min-width:0;border:1px solid var(--line);border-radius:9px;padding:8px 9px;background:var(--surface-soft);color:var(--text);text-align:left}.highlight-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%], .stat-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{cursor:pointer}.highlight-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover, .stat-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{border-color:var(--line-strong)}.highlight-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled, .stat-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{cursor:default;opacity:.65}.highlight-list[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .highlight-list[_ngcontent-%COMP%] em[_ngcontent-%COMP%], .stat-list[_ngcontent-%COMP%] small[_ngcontent-%COMP%], .stat-list[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .stat-list[_ngcontent-%COMP%] em[_ngcontent-%COMP%], .cost-row[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .cost-row[_ngcontent-%COMP%] em[_ngcontent-%COMP%], .empty[_ngcontent-%COMP%]{color:var(--muted);font-size:12px;font-style:normal;line-height:1.35}.stat-list[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.row-kicker[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px}.highlight-list[_ngcontent-%COMP%] strong[_ngcontent-%COMP%], .stat-list[_ngcontent-%COMP%] strong[_ngcontent-%COMP%], .cost-row[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text-strong);font-size:14px;font-weight:760;line-height:1.25}.open-cue[_ngcontent-%COMP%]{justify-self:start;border:1px solid var(--line);border-radius:999px;padding:3px 7px;background:#0c9f8314;color:var(--accent-strong, var(--accent))!important;font-size:10px!important;font-weight:760;text-transform:uppercase;letter-spacing:.04em}.highlight-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover .open-cue[_ngcontent-%COMP%], .highlight-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:focus-visible .open-cue[_ngcontent-%COMP%]{border-color:color-mix(in srgb,var(--accent) 45%,var(--line));background:#0c9f8324}.stat-list.compact[_ngcontent-%COMP%] div[_ngcontent-%COMP%], .stat-list.compact[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{grid-template-columns:minmax(110px,.35fr) minmax(0,1fr) auto;gap:4px 10px;align-items:center;padding:8px 9px}.stat-list.compact[_ngcontent-%COMP%] small[_ngcontent-%COMP%], .stat-list.compact[_ngcontent-%COMP%] .open-cue[_ngcontent-%COMP%]{grid-column:2 / -1}.cost-table[_ngcontent-%COMP%]{overflow-x:auto;border:1px solid var(--line);border-radius:10px;background:var(--surface)}.cost-row[_ngcontent-%COMP%]{display:grid;align-items:start;gap:8px;min-width:650px;border-bottom:1px solid var(--line);padding:8px 10px}.cost-row[_ngcontent-%COMP%]:last-child{border-bottom:0}.cost-row-heading[_ngcontent-%COMP%]{color:var(--muted);background:var(--surface-soft);font-size:11px;font-weight:760;letter-spacing:.04em;text-transform:uppercase}.analytics-model-row[_ngcontent-%COMP%]{grid-template-columns:minmax(170px,1.25fr) minmax(62px,.36fr) minmax(180px,1fr) minmax(86px,.48fr) minmax(84px,.46fr) minmax(80px,.45fr)}.analytics-model-row[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{display:grid;gap:3px}.analytics-model-row[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{display:block;margin-top:2px}.warning-text[_ngcontent-%COMP%]{color:var(--warning-text, #ffcf91)!important}.share-cell[_ngcontent-%COMP%]{display:grid;gap:5px}.share-cell[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{display:block;width:0;max-width:100%;height:4px;border-radius:999px;background:linear-gradient(90deg,var(--accent),var(--accent-2))}@media(max-width:1200px){.analytics-side[_ngcontent-%COMP%], .analytics-split[_ngcontent-%COMP%]{grid-template-columns:1fr}}@media(max-width:960px){.analytics-primary[_ngcontent-%COMP%]{grid-template-columns:1fr}}@media(max-width:900px){.pricing-header[_ngcontent-%COMP%], .analytics-controls[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr}}@media(max-width:600px){.analytics-panel[_ngcontent-%COMP%]{padding:11px}.cost-row[_ngcontent-%COMP%]{min-width:620px}}"]})};export{oe as AnalyticsPageComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as Q}from"./chunk-RTOXDOOI.js";import{i as S,r as U,s as W}from"./chunk-TICIZRSM.js";import{$a as f,Ca as P,Da as h,Ea as T,Fa as y,Ga as M,Ha as g,Ia as o,Ja as i,Ka as F,O as E,Oa as I,P as D,Qa as x,Sa as _,Ta as V,U as A,Ua as B,Va as s,Wa as m,Xa as N,Ya as w,Z as v,Za as z,_a as l,ab as b,db as C,ka as r,nb as L,ob as R,sa as $,sb as Y,ub as j,vb as H,wb as G,xb as q,yb as J,zb as K}from"./chunk-WOIYAEKB.js";var X=(n,t)=>t.id,ae=(n,t)=>t.key;function ie(n,t){if(n&1&&(o(0,"option",6),s(1),i()),n&2){let e=t.$implicit;g("value",e),r(),m(e==="all"?"All workspaces":e)}}function oe(n,t){if(n&1&&(o(0,"option",6),s(1),i()),n&2){let e=t.$implicit;g("value",e),r(),m(e==="all"?"All models":e)}}function re(n,t){if(n&1&&(o(0,"option",6),s(1),i()),n&2){let e=t.$implicit;g("value",e.id),r(),m(e.label)}}function se(n,t){if(n&1){let e=I();o(0,"button",17),x("click",function(){E(e);let p=_();return D(p.resetScope())}),s(1,"Reset scope"),i()}}function le(n,t){if(n&1&&(s(0),l(1,"number")),n&2){let e=_().$implicit;w(" \xB7 ",f(1,2,e.fallbackCount)," fallback",e.fallbackCount===1?"":"s"," ")}}function pe(n,t){if(n&1&&(o(0,"span",23),s(1),i()),n&2){let e=_().$implicit;r(),m(e.actionLabel)}}function ce(n,t){if(n&1){let e=I();o(0,"button",18),x("click",function(){let p=E(e).$implicit,c=_();return D(c.emitOpenSession(p.session))}),o(1,"span",19),s(2),i(),o(3,"strong"),s(4),l(5,"number"),i(),o(6,"em",20),s(7),i(),o(8,"em"),s(9),l(10,"number"),i(),o(11,"i",21),F(12,"b"),i(),o(13,"small",22)(14,"span"),s(15),l(16,"number"),P(17,le,2,4),i(),P(18,pe,2,1,"span",23),i()()}if(n&2){let e=t.$implicit,a=_();B("primary",e.id==="last-session")("can-open",a.canOpenSession&&e.session)("empty",!e.session),g("disabled",!a.canOpenSession||!e.session),r(2),m(e.label),r(2),N("",b(5,18,e.credits,"1.0-2")," credits"),r(3),m(e.period),r(2),w("$",b(10,21,e.usd,"1.2-4")," \xB7 ",e.detail),r(3),V("width",e.allowanceShare>100?100:e.allowanceShare,"%"),r(3),w(" ",b(16,24,e.allowanceShare,"1.0-1"),"% of ",a.selectedAllowance().shortLabel," "),r(2),h(e.fallbackCount?17:-1),r(),h(a.canOpenSession?18:-1)}}function de(n,t){if(n&1&&(o(0,"span"),s(1),l(2,"number"),l(3,"number"),i()),n&2){let e=t;r(),w("",f(2,2,e.sourceCount)," source \xB7 ",f(3,4,e.fallbackCount)," fallback")}}function ge(n,t){if(n&1&&(s(0),l(1,"number")),n&2){let e=_().$implicit;w(" \xB7 ",f(1,2,e.fallbackCount)," fallback",e.fallbackCount===1?"":"s"," ")}}function ue(n,t){if(n&1){let e=I();o(0,"button",24),x("click",function(){let p=E(e).$implicit,c=_();return D(c.emitOpenSession(p.topSession))}),o(1,"span"),s(2),l(3,"date"),i(),o(4,"strong"),s(5),l(6,"number"),i(),o(7,"em"),s(8),l(9,"number"),l(10,"number"),P(11,ge,2,4),i()()}if(n&2){let e=t.$implicit,a=_();B("can-open",a.canOpenSession&&e.topSession)("empty",!e.topSession),g("disabled",!a.canOpenSession||!e.topSession),r(2),m(b(3,11,e.date,"EEE, MMM d")),r(3),N("",b(6,14,e.credits,"1.0-2")," credits"),r(3),z(" ",f(9,17,e.count)," session",e.count===1?"":"s"," \xB7 $",b(10,19,e.usd,"1.2-4")," "),r(3),h(e.fallbackCount?11:-1)}}var Z=class n{sessionsInput=v([]);allowancePlanInput=v("business-standard");workspaceFilter=v("all");modelFilter=v("all");set sessions(t){this.sessionsInput.set(t??[])}set allowancePlan(t){this.allowancePlanInput.set(t??"business-standard")}canOpenSession=!0;allowancePlanChange=new A;openSession=new A;allowancePlans=S;help={scope:"Usage is calculated from imported local VS Code sessions. When VS Code reports Copilot usage units, the app uses those. Otherwise it estimates from token buckets and GitHub model prices.",allowance:"Compares your local imported usage with the included monthly AI credits for the selected Copilot plan."};selectedAllowance=C(()=>S.find(t=>t.id===this.allowancePlanInput())??S[0]);currentAllowancePlan=C(()=>this.selectedAllowance().id);workspaceOptions=C(()=>["all",...[...new Set(this.sessionsInput().map(t=>t.workspace).filter(Boolean))].sort()]);modelOptions=C(()=>["all",...[...new Set(this.sessionsInput().map(t=>t.model).filter(Boolean))].sort()]);scopedSessions=C(()=>this.sessionsInput().filter(t=>(this.workspaceFilter()==="all"||t.workspace===this.workspaceFilter())&&(this.modelFilter()==="all"||t.model===this.modelFilter())));scopeActive=C(()=>this.workspaceFilter()!=="all"||this.modelFilter()!=="all");usageWindows=C(()=>Q(this.scopedSessions(),this.selectedAllowance().creditsPerUserMonthly));dailyRows=C(()=>this.buildDailyRows(this.scopedSessions(),14));sourceCoverage=C(()=>{let t=this.scopedSessions(),e=t.filter(a=>a.sourceUsage).length;return{sourceCount:e,fallbackCount:t.length-e,total:t.length}});setAllowancePlan(t){if(!S.some(a=>a.id===t))return;let e=t;this.allowancePlanInput.set(e),this.allowancePlanChange.emit(e)}setWorkspaceFilter(t){this.workspaceFilter.set(t)}setModelFilter(t){this.modelFilter.set(t)}resetScope(){this.workspaceFilter.set("all"),this.modelFilter.set("all")}emitOpenSession(t){this.canOpenSession&&t&&this.openSession.emit(t)}buildDailyRows(t,e){let a=me(new Date);return Array.from({length:e},(p,c)=>{let k=ee(a,-c),te=ee(k,1),O=t.filter(d=>{let u=Date.parse(d.startedAt);return Number.isFinite(u)&&u>=k.getTime()&&u<te.getTime()}),ne=O.reduce((d,u)=>!d||U(u)>U(d)?u:d,null);return{date:k,key:Ce(k),credits:O.reduce((d,u)=>d+W(u),0),usd:O.reduce((d,u)=>d+U(u),0),count:O.length,topSession:ne,fallbackCount:O.filter(d=>!d.sourceUsage).length}})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=$({type:n,selectors:[["app-usage-page"]],inputs:{sessions:"sessions",allowancePlan:"allowancePlan",canOpenSession:"canOpenSession"},outputs:{allowancePlanChange:"allowancePlanChange",openSession:"openSession"},decls:55,vars:15,consts:[[1,"usage-page"],[1,"usage-header"],[1,"eyebrow"],["label","Explain usage scope",3,"text"],[1,"usage-controls"],[3,"ngModelChange","ngModel"],[3,"value"],["label","Explain allowance",3,"text"],[1,"usage-scope"],["type","button"],["aria-label","Usage answer cards",1,"usage-answer-grid"],["type","button",1,"usage-answer-card",3,"primary","can-open","empty","disabled"],[1,"usage-panels"],[1,"usage-panel"],[1,"panel-heading"],[1,"daily-usage-list"],["type","button",3,"can-open","empty","disabled"],["type","button",3,"click"],["type","button",1,"usage-answer-card",3,"click","disabled"],[1,"usage-card-label"],[1,"usage-card-period"],["aria-hidden","true"],[1,"usage-card-footer"],[1,"usage-card-action"],["type","button",3,"click","disabled"]],template:function(e,a){if(e&1&&(o(0,"section",0)(1,"header",1)(2,"div")(3,"p",2),s(4,"Usage home"),i(),o(5,"h2"),s(6,"Your Copilot usage"),i(),o(7,"p"),s(8," Today, this week, this month, and recent activity across imported VS Code sessions. "),F(9,"app-help-popover",3),i()(),o(10,"div",4)(11,"label")(12,"span"),s(13,"Workspace"),i(),o(14,"select",5),x("ngModelChange",function(c){return a.setWorkspaceFilter(c)}),y(15,ie,2,2,"option",6,T),i()(),o(17,"label")(18,"span"),s(19,"Model"),i(),o(20,"select",5),x("ngModelChange",function(c){return a.setModelFilter(c)}),y(21,oe,2,2,"option",6,T),i()(),o(23,"label")(24,"span"),s(25," Monthly allowance "),F(26,"app-help-popover",7),i(),o(27,"select",5),x("ngModelChange",function(c){return a.setAllowancePlan(c)}),y(28,re,2,2,"option",6,X),i()()()(),o(30,"div",8)(31,"span"),s(32),l(33,"number"),l(34,"number"),i(),o(35,"span"),s(36),i(),o(37,"span"),s(38),i(),P(39,se,2,0,"button",9),i(),o(40,"section",10),y(41,ce,19,27,"button",11,X),i(),o(43,"section",12)(44,"article",13)(45,"div",14)(46,"div")(47,"h3"),s(48,"Recent days"),i(),o(49,"p"),s(50,"Last 14 local calendar days from imported VS Code sessions."),i()(),P(51,de,4,6,"span"),i(),o(52,"div",15),y(53,ue,12,22,"button",16,ae),i()()()()),e&2){let p;r(9),g("text",a.help.scope),r(5),g("ngModel",a.workspaceFilter()),r(),M(a.workspaceOptions()),r(5),g("ngModel",a.modelFilter()),r(),M(a.modelOptions()),r(5),g("text",a.help.allowance),r(),g("ngModel",a.currentAllowancePlan()),r(),M(a.allowancePlans),r(4),w("",f(33,11,a.scopedSessions().length)," of ",f(34,13,a.sessionsInput().length)," sessions"),r(4),m(a.workspaceFilter()==="all"?"All workspaces":a.workspaceFilter()),r(2),m(a.modelFilter()==="all"?"All models":a.modelFilter()),r(),h(a.scopeActive()?39:-1),r(2),M(a.usageWindows()),r(10),h((p=a.sourceCoverage())?51:-1,p),r(2),M(a.dailyRows())}},dependencies:[K,q,J,G,j,H,Y,L,R],styles:["[_nghost-%COMP%]{display:block}.usage-page[_ngcontent-%COMP%]{display:grid;gap:12px}.usage-header[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;border:1px solid color-mix(in srgb,var(--accent-2) 24%,var(--line));border-radius:18px;padding:16px;background:var(--header-gradient);box-shadow:var(--shadow)}.eyebrow[_ngcontent-%COMP%]{margin:0;color:var(--muted-2);font-size:10px;font-weight:820;letter-spacing:.08em;text-transform:uppercase}.usage-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:3px 0 0;color:var(--text-strong);font-size:26px;font-weight:820;letter-spacing:0}.usage-header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:inline-flex;align-items:center;flex-wrap:wrap;gap:4px;max-width:720px;margin:7px 0 0;color:var(--muted);font-size:13px;line-height:1.45}.usage-controls[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,minmax(150px,1fr));gap:8px;width:min(720px,58vw)}.usage-controls[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:grid;gap:6px;min-width:0;color:var(--muted);font-size:11px;font-weight:760}.usage-controls[_ngcontent-%COMP%] label[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px}.usage-controls[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{width:100%;min-height:34px;border:1px solid var(--line);border-radius:9px;padding:7px 10px;background:var(--surface-soft);color:var(--text);font:inherit;font-size:13px;font-weight:760}.usage-scope[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:7px;color:var(--muted);font-size:11px}.usage-scope[_ngcontent-%COMP%] > span[_ngcontent-%COMP%], .usage-scope[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border:1px solid var(--line);border-radius:999px;padding:4px 8px;background:var(--surface-soft)}.usage-scope[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:var(--accent);font:inherit;font-weight:800;cursor:pointer}.usage-answer-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:9px}.usage-answer-card[_ngcontent-%COMP%], .usage-panel[_ngcontent-%COMP%]{border:1px solid var(--line);border-radius:15px;background:var(--surface);box-shadow:var(--shadow-soft)}.usage-answer-card[_ngcontent-%COMP%]{display:grid;gap:6px;min-width:0;padding:13px;color:var(--text);text-align:left;cursor:default}.usage-answer-card.primary[_ngcontent-%COMP%]{border-color:#0c9f8347;background:linear-gradient(135deg,#0c9f831f,#6f5cff0d),var(--surface)}.usage-answer-card.empty[_ngcontent-%COMP%]:disabled{cursor:default;opacity:.72}.usage-answer-card.can-open[_ngcontent-%COMP%]{cursor:pointer}.usage-answer-card.can-open[_ngcontent-%COMP%]:hover{border-color:color-mix(in srgb,var(--accent) 42%,var(--line));transform:translateY(-1px)}.usage-answer-card[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .usage-answer-card[_ngcontent-%COMP%] em[_ngcontent-%COMP%], .usage-answer-card[_ngcontent-%COMP%] small[_ngcontent-%COMP%], .daily-usage-list[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .daily-usage-list[_ngcontent-%COMP%] em[_ngcontent-%COMP%], .usage-panel[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .usage-panel[_ngcontent-%COMP%] li[_ngcontent-%COMP%], .panel-heading[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .panel-heading[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{color:var(--muted);font-size:12px;font-style:normal;line-height:1.35}.usage-answer-card[_ngcontent-%COMP%] .usage-card-label[_ngcontent-%COMP%]{color:var(--muted-2);font-size:10px;font-weight:820;letter-spacing:.08em;text-transform:uppercase}.usage-answer-card[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text-strong);font-size:21px;font-weight:820;line-height:1.05;overflow-wrap:anywhere}.usage-card-period[_ngcontent-%COMP%]{color:var(--text)!important;font-size:12px!important;font-weight:760}.usage-answer-card[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{display:block;width:100%;height:5px;overflow:hidden;border-radius:999px;background:#61708524}.usage-answer-card[_ngcontent-%COMP%] b[_ngcontent-%COMP%]{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--accent),var(--accent-2))}.usage-card-footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:8px}.usage-card-footer[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{min-width:0}.usage-card-action[_ngcontent-%COMP%]{flex:0 0 auto;color:var(--accent-strong, var(--accent))!important;font-size:11px!important;font-weight:820}.usage-answer-card[_ngcontent-%COMP%]:disabled .usage-card-action[_ngcontent-%COMP%]{color:var(--muted-2)!important}.usage-panels[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr;gap:12px;align-items:start}.usage-panel[_ngcontent-%COMP%]{display:grid;gap:10px;padding:13px}.panel-heading[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.panel-heading[_ngcontent-%COMP%] h3[_ngcontent-%COMP%], .usage-panel[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;color:var(--text-strong);font-size:16px;font-weight:800}.panel-heading[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:3px 0 0}.panel-heading[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{flex:0 0 auto;border:1px solid var(--line);border-radius:999px;padding:4px 8px;background:var(--surface-soft);font-weight:760}.daily-usage-list[_ngcontent-%COMP%]{display:grid;gap:6px}.daily-usage-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(120px,.45fr) minmax(110px,.35fr) minmax(0,1fr);gap:10px;align-items:center;border:1px solid var(--line);border-radius:10px;padding:8px 10px;background:var(--surface-soft);color:var(--text);text-align:left;cursor:default}.daily-usage-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{cursor:default}.daily-usage-list[_ngcontent-%COMP%] button.empty[_ngcontent-%COMP%]:disabled{opacity:.64}.daily-usage-list[_ngcontent-%COMP%] button.can-open[_ngcontent-%COMP%]{cursor:pointer}.daily-usage-list[_ngcontent-%COMP%] button.can-open[_ngcontent-%COMP%]:hover{border-color:var(--line-strong)}.daily-usage-list[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text-strong);font-size:14px;font-weight:800}@media(max-width:1200px){.usage-answer-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:850px){.usage-header[_ngcontent-%COMP%], .panel-heading[_ngcontent-%COMP%]{display:grid}.usage-controls[_ngcontent-%COMP%]{grid-template-columns:1fr;width:100%}.usage-answer-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(2,minmax(0,1fr))}.daily-usage-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{grid-template-columns:1fr;gap:4px}}@media(max-width:560px){.usage-answer-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}"]})};function me(n){return new Date(n.getFullYear(),n.getMonth(),n.getDate())}function ee(n,t){let e=new Date(n);return e.setDate(e.getDate()+t),e}function Ce(n){let t=n.getFullYear(),e=String(n.getMonth()+1).padStart(2,"0"),a=String(n.getDate()).padStart(2,"0");return`${t}-${e}-${a}`}export{Z as UsagePageComponent};
|
|
1
|
+
import{f as Q}from"./chunk-YCZAIDR7.js";import{i as S,r as U,s as W}from"./chunk-5FL3PHQS.js";import{$a as f,Ca as P,Da as h,Ea as T,Fa as y,Ga as M,Ha as g,Ia as o,Ja as i,Ka as F,O as E,Oa as I,P as D,Qa as x,Sa as _,Ta as V,U as A,Ua as B,Va as s,Wa as m,Xa as N,Ya as w,Z as v,Za as z,_a as l,ab as b,db as C,ka as r,nb as L,ob as R,sa as $,sb as Y,ub as j,vb as H,wb as G,xb as q,yb as J,zb as K}from"./chunk-WOIYAEKB.js";var X=(n,t)=>t.id,ae=(n,t)=>t.key;function ie(n,t){if(n&1&&(o(0,"option",6),s(1),i()),n&2){let e=t.$implicit;g("value",e),r(),m(e==="all"?"All workspaces":e)}}function oe(n,t){if(n&1&&(o(0,"option",6),s(1),i()),n&2){let e=t.$implicit;g("value",e),r(),m(e==="all"?"All models":e)}}function re(n,t){if(n&1&&(o(0,"option",6),s(1),i()),n&2){let e=t.$implicit;g("value",e.id),r(),m(e.label)}}function se(n,t){if(n&1){let e=I();o(0,"button",17),x("click",function(){E(e);let p=_();return D(p.resetScope())}),s(1,"Reset scope"),i()}}function le(n,t){if(n&1&&(s(0),l(1,"number")),n&2){let e=_().$implicit;w(" \xB7 ",f(1,2,e.fallbackCount)," fallback",e.fallbackCount===1?"":"s"," ")}}function pe(n,t){if(n&1&&(o(0,"span",23),s(1),i()),n&2){let e=_().$implicit;r(),m(e.actionLabel)}}function ce(n,t){if(n&1){let e=I();o(0,"button",18),x("click",function(){let p=E(e).$implicit,c=_();return D(c.emitOpenSession(p.session))}),o(1,"span",19),s(2),i(),o(3,"strong"),s(4),l(5,"number"),i(),o(6,"em",20),s(7),i(),o(8,"em"),s(9),l(10,"number"),i(),o(11,"i",21),F(12,"b"),i(),o(13,"small",22)(14,"span"),s(15),l(16,"number"),P(17,le,2,4),i(),P(18,pe,2,1,"span",23),i()()}if(n&2){let e=t.$implicit,a=_();B("primary",e.id==="last-session")("can-open",a.canOpenSession&&e.session)("empty",!e.session),g("disabled",!a.canOpenSession||!e.session),r(2),m(e.label),r(2),N("",b(5,18,e.credits,"1.0-2")," credits"),r(3),m(e.period),r(2),w("$",b(10,21,e.usd,"1.2-4")," \xB7 ",e.detail),r(3),V("width",e.allowanceShare>100?100:e.allowanceShare,"%"),r(3),w(" ",b(16,24,e.allowanceShare,"1.0-1"),"% of ",a.selectedAllowance().shortLabel," "),r(2),h(e.fallbackCount?17:-1),r(),h(a.canOpenSession?18:-1)}}function de(n,t){if(n&1&&(o(0,"span"),s(1),l(2,"number"),l(3,"number"),i()),n&2){let e=t;r(),w("",f(2,2,e.sourceCount)," source \xB7 ",f(3,4,e.fallbackCount)," fallback")}}function ge(n,t){if(n&1&&(s(0),l(1,"number")),n&2){let e=_().$implicit;w(" \xB7 ",f(1,2,e.fallbackCount)," fallback",e.fallbackCount===1?"":"s"," ")}}function ue(n,t){if(n&1){let e=I();o(0,"button",24),x("click",function(){let p=E(e).$implicit,c=_();return D(c.emitOpenSession(p.topSession))}),o(1,"span"),s(2),l(3,"date"),i(),o(4,"strong"),s(5),l(6,"number"),i(),o(7,"em"),s(8),l(9,"number"),l(10,"number"),P(11,ge,2,4),i()()}if(n&2){let e=t.$implicit,a=_();B("can-open",a.canOpenSession&&e.topSession)("empty",!e.topSession),g("disabled",!a.canOpenSession||!e.topSession),r(2),m(b(3,11,e.date,"EEE, MMM d")),r(3),N("",b(6,14,e.credits,"1.0-2")," credits"),r(3),z(" ",f(9,17,e.count)," session",e.count===1?"":"s"," \xB7 $",b(10,19,e.usd,"1.2-4")," "),r(3),h(e.fallbackCount?11:-1)}}var Z=class n{sessionsInput=v([]);allowancePlanInput=v("business-standard");workspaceFilter=v("all");modelFilter=v("all");set sessions(t){this.sessionsInput.set(t??[])}set allowancePlan(t){this.allowancePlanInput.set(t??"business-standard")}canOpenSession=!0;allowancePlanChange=new A;openSession=new A;allowancePlans=S;help={scope:"Usage is calculated from imported local VS Code sessions. When VS Code reports Copilot usage units, the app uses those. Otherwise it estimates from token buckets and GitHub model prices.",allowance:"Compares your local imported usage with the included monthly AI credits for the selected Copilot plan."};selectedAllowance=C(()=>S.find(t=>t.id===this.allowancePlanInput())??S[0]);currentAllowancePlan=C(()=>this.selectedAllowance().id);workspaceOptions=C(()=>["all",...[...new Set(this.sessionsInput().map(t=>t.workspace).filter(Boolean))].sort()]);modelOptions=C(()=>["all",...[...new Set(this.sessionsInput().map(t=>t.model).filter(Boolean))].sort()]);scopedSessions=C(()=>this.sessionsInput().filter(t=>(this.workspaceFilter()==="all"||t.workspace===this.workspaceFilter())&&(this.modelFilter()==="all"||t.model===this.modelFilter())));scopeActive=C(()=>this.workspaceFilter()!=="all"||this.modelFilter()!=="all");usageWindows=C(()=>Q(this.scopedSessions(),this.selectedAllowance().creditsPerUserMonthly));dailyRows=C(()=>this.buildDailyRows(this.scopedSessions(),14));sourceCoverage=C(()=>{let t=this.scopedSessions(),e=t.filter(a=>a.sourceUsage).length;return{sourceCount:e,fallbackCount:t.length-e,total:t.length}});setAllowancePlan(t){if(!S.some(a=>a.id===t))return;let e=t;this.allowancePlanInput.set(e),this.allowancePlanChange.emit(e)}setWorkspaceFilter(t){this.workspaceFilter.set(t)}setModelFilter(t){this.modelFilter.set(t)}resetScope(){this.workspaceFilter.set("all"),this.modelFilter.set("all")}emitOpenSession(t){this.canOpenSession&&t&&this.openSession.emit(t)}buildDailyRows(t,e){let a=me(new Date);return Array.from({length:e},(p,c)=>{let k=ee(a,-c),te=ee(k,1),O=t.filter(d=>{let u=Date.parse(d.startedAt);return Number.isFinite(u)&&u>=k.getTime()&&u<te.getTime()}),ne=O.reduce((d,u)=>!d||U(u)>U(d)?u:d,null);return{date:k,key:Ce(k),credits:O.reduce((d,u)=>d+W(u),0),usd:O.reduce((d,u)=>d+U(u),0),count:O.length,topSession:ne,fallbackCount:O.filter(d=>!d.sourceUsage).length}})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=$({type:n,selectors:[["app-usage-page"]],inputs:{sessions:"sessions",allowancePlan:"allowancePlan",canOpenSession:"canOpenSession"},outputs:{allowancePlanChange:"allowancePlanChange",openSession:"openSession"},decls:55,vars:15,consts:[[1,"usage-page"],[1,"usage-header"],[1,"eyebrow"],["label","Explain usage scope",3,"text"],[1,"usage-controls"],[3,"ngModelChange","ngModel"],[3,"value"],["label","Explain allowance",3,"text"],[1,"usage-scope"],["type","button"],["aria-label","Usage answer cards",1,"usage-answer-grid"],["type","button",1,"usage-answer-card",3,"primary","can-open","empty","disabled"],[1,"usage-panels"],[1,"usage-panel"],[1,"panel-heading"],[1,"daily-usage-list"],["type","button",3,"can-open","empty","disabled"],["type","button",3,"click"],["type","button",1,"usage-answer-card",3,"click","disabled"],[1,"usage-card-label"],[1,"usage-card-period"],["aria-hidden","true"],[1,"usage-card-footer"],[1,"usage-card-action"],["type","button",3,"click","disabled"]],template:function(e,a){if(e&1&&(o(0,"section",0)(1,"header",1)(2,"div")(3,"p",2),s(4,"Usage home"),i(),o(5,"h2"),s(6,"Your Copilot usage"),i(),o(7,"p"),s(8," Today, this week, this month, and recent activity across imported VS Code sessions. "),F(9,"app-help-popover",3),i()(),o(10,"div",4)(11,"label")(12,"span"),s(13,"Workspace"),i(),o(14,"select",5),x("ngModelChange",function(c){return a.setWorkspaceFilter(c)}),y(15,ie,2,2,"option",6,T),i()(),o(17,"label")(18,"span"),s(19,"Model"),i(),o(20,"select",5),x("ngModelChange",function(c){return a.setModelFilter(c)}),y(21,oe,2,2,"option",6,T),i()(),o(23,"label")(24,"span"),s(25," Monthly allowance "),F(26,"app-help-popover",7),i(),o(27,"select",5),x("ngModelChange",function(c){return a.setAllowancePlan(c)}),y(28,re,2,2,"option",6,X),i()()()(),o(30,"div",8)(31,"span"),s(32),l(33,"number"),l(34,"number"),i(),o(35,"span"),s(36),i(),o(37,"span"),s(38),i(),P(39,se,2,0,"button",9),i(),o(40,"section",10),y(41,ce,19,27,"button",11,X),i(),o(43,"section",12)(44,"article",13)(45,"div",14)(46,"div")(47,"h3"),s(48,"Recent days"),i(),o(49,"p"),s(50,"Last 14 local calendar days from imported VS Code sessions."),i()(),P(51,de,4,6,"span"),i(),o(52,"div",15),y(53,ue,12,22,"button",16,ae),i()()()()),e&2){let p;r(9),g("text",a.help.scope),r(5),g("ngModel",a.workspaceFilter()),r(),M(a.workspaceOptions()),r(5),g("ngModel",a.modelFilter()),r(),M(a.modelOptions()),r(5),g("text",a.help.allowance),r(),g("ngModel",a.currentAllowancePlan()),r(),M(a.allowancePlans),r(4),w("",f(33,11,a.scopedSessions().length)," of ",f(34,13,a.sessionsInput().length)," sessions"),r(4),m(a.workspaceFilter()==="all"?"All workspaces":a.workspaceFilter()),r(2),m(a.modelFilter()==="all"?"All models":a.modelFilter()),r(),h(a.scopeActive()?39:-1),r(2),M(a.usageWindows()),r(10),h((p=a.sourceCoverage())?51:-1,p),r(2),M(a.dailyRows())}},dependencies:[K,q,J,G,j,H,Y,L,R],styles:["[_nghost-%COMP%]{display:block}.usage-page[_ngcontent-%COMP%]{display:grid;gap:12px}.usage-header[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;border:1px solid color-mix(in srgb,var(--accent-2) 24%,var(--line));border-radius:18px;padding:16px;background:var(--header-gradient);box-shadow:var(--shadow)}.eyebrow[_ngcontent-%COMP%]{margin:0;color:var(--muted-2);font-size:10px;font-weight:820;letter-spacing:.08em;text-transform:uppercase}.usage-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:3px 0 0;color:var(--text-strong);font-size:26px;font-weight:820;letter-spacing:0}.usage-header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:inline-flex;align-items:center;flex-wrap:wrap;gap:4px;max-width:720px;margin:7px 0 0;color:var(--muted);font-size:13px;line-height:1.45}.usage-controls[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,minmax(150px,1fr));gap:8px;width:min(720px,58vw)}.usage-controls[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:grid;gap:6px;min-width:0;color:var(--muted);font-size:11px;font-weight:760}.usage-controls[_ngcontent-%COMP%] label[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px}.usage-controls[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{width:100%;min-height:34px;border:1px solid var(--line);border-radius:9px;padding:7px 10px;background:var(--surface-soft);color:var(--text);font:inherit;font-size:13px;font-weight:760}.usage-scope[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:7px;color:var(--muted);font-size:11px}.usage-scope[_ngcontent-%COMP%] > span[_ngcontent-%COMP%], .usage-scope[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border:1px solid var(--line);border-radius:999px;padding:4px 8px;background:var(--surface-soft)}.usage-scope[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:var(--accent);font:inherit;font-weight:800;cursor:pointer}.usage-answer-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:9px}.usage-answer-card[_ngcontent-%COMP%], .usage-panel[_ngcontent-%COMP%]{border:1px solid var(--line);border-radius:15px;background:var(--surface);box-shadow:var(--shadow-soft)}.usage-answer-card[_ngcontent-%COMP%]{display:grid;gap:6px;min-width:0;padding:13px;color:var(--text);text-align:left;cursor:default}.usage-answer-card.primary[_ngcontent-%COMP%]{border-color:#0c9f8347;background:linear-gradient(135deg,#0c9f831f,#6f5cff0d),var(--surface)}.usage-answer-card.empty[_ngcontent-%COMP%]:disabled{cursor:default;opacity:.72}.usage-answer-card.can-open[_ngcontent-%COMP%]{cursor:pointer}.usage-answer-card.can-open[_ngcontent-%COMP%]:hover{border-color:color-mix(in srgb,var(--accent) 42%,var(--line));transform:translateY(-1px)}.usage-answer-card[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .usage-answer-card[_ngcontent-%COMP%] em[_ngcontent-%COMP%], .usage-answer-card[_ngcontent-%COMP%] small[_ngcontent-%COMP%], .daily-usage-list[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .daily-usage-list[_ngcontent-%COMP%] em[_ngcontent-%COMP%], .usage-panel[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .usage-panel[_ngcontent-%COMP%] li[_ngcontent-%COMP%], .panel-heading[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .panel-heading[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{color:var(--muted);font-size:12px;font-style:normal;line-height:1.35}.usage-answer-card[_ngcontent-%COMP%] .usage-card-label[_ngcontent-%COMP%]{color:var(--muted-2);font-size:10px;font-weight:820;letter-spacing:.08em;text-transform:uppercase}.usage-answer-card[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text-strong);font-size:21px;font-weight:820;line-height:1.05;overflow-wrap:anywhere}.usage-card-period[_ngcontent-%COMP%]{color:var(--text)!important;font-size:12px!important;font-weight:760}.usage-answer-card[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{display:block;width:100%;height:5px;overflow:hidden;border-radius:999px;background:#61708524}.usage-answer-card[_ngcontent-%COMP%] b[_ngcontent-%COMP%]{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--accent),var(--accent-2))}.usage-card-footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:8px}.usage-card-footer[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{min-width:0}.usage-card-action[_ngcontent-%COMP%]{flex:0 0 auto;color:var(--accent-strong, var(--accent))!important;font-size:11px!important;font-weight:820}.usage-answer-card[_ngcontent-%COMP%]:disabled .usage-card-action[_ngcontent-%COMP%]{color:var(--muted-2)!important}.usage-panels[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr;gap:12px;align-items:start}.usage-panel[_ngcontent-%COMP%]{display:grid;gap:10px;padding:13px}.panel-heading[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.panel-heading[_ngcontent-%COMP%] h3[_ngcontent-%COMP%], .usage-panel[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;color:var(--text-strong);font-size:16px;font-weight:800}.panel-heading[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:3px 0 0}.panel-heading[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{flex:0 0 auto;border:1px solid var(--line);border-radius:999px;padding:4px 8px;background:var(--surface-soft);font-weight:760}.daily-usage-list[_ngcontent-%COMP%]{display:grid;gap:6px}.daily-usage-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(120px,.45fr) minmax(110px,.35fr) minmax(0,1fr);gap:10px;align-items:center;border:1px solid var(--line);border-radius:10px;padding:8px 10px;background:var(--surface-soft);color:var(--text);text-align:left;cursor:default}.daily-usage-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{cursor:default}.daily-usage-list[_ngcontent-%COMP%] button.empty[_ngcontent-%COMP%]:disabled{opacity:.64}.daily-usage-list[_ngcontent-%COMP%] button.can-open[_ngcontent-%COMP%]{cursor:pointer}.daily-usage-list[_ngcontent-%COMP%] button.can-open[_ngcontent-%COMP%]:hover{border-color:var(--line-strong)}.daily-usage-list[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text-strong);font-size:14px;font-weight:800}@media(max-width:1200px){.usage-answer-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:850px){.usage-header[_ngcontent-%COMP%], .panel-heading[_ngcontent-%COMP%]{display:grid}.usage-controls[_ngcontent-%COMP%]{grid-template-columns:1fr;width:100%}.usage-answer-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(2,minmax(0,1fr))}.daily-usage-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{grid-template-columns:1fr;gap:4px}}@media(max-width:560px){.usage-answer-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}"]})};function me(n){return new Date(n.getFullYear(),n.getMonth(),n.getDate())}function ee(n,t){let e=new Date(n);return e.setDate(e.getDate()+t),e}function Ce(n){let t=n.getFullYear(),e=String(n.getMonth()+1).padStart(2,"0"),a=String(n.getDate()).padStart(2,"0");return`${t}-${e}-${a}`}export{Z as UsagePageComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as H,b as $,c as W,d as V,e as j,f as q,g as J,h as K,i as y,m as Q,r as X,s as Y}from"./chunk-TICIZRSM.js";import{$a as O,Ca as f,Da as w,Fa as M,Ga as v,Ha as c,Ia as t,Ja as n,Ka as x,O as U,Oa as F,P as D,Qa as E,Sa as C,Ta as L,U as N,Ua as z,Va as i,Wa as s,Xa as d,Ya as T,Z as S,_a as p,a as b,ab as _,b as k,db as P,ja as A,ka as o,nb as G,ob as B,sa as R,sb as Z,ub as ee,vb as te,wb as ne,xb as ie,yb as ae,zb as oe}from"./chunk-WOIYAEKB.js";var re=(l,a)=>a.id,ce=(l,a)=>a.value,se=(l,a)=>a.model+":"+a.tier;function pe(l,a){if(l&1&&(t(0,"option",10),i(1),n()),l&2){let e=a.$implicit;c("value",e.id),o(),s(e.label)}}function de(l,a){if(l&1&&(t(0,"option",10),i(1),n()),l&2){let e=a.$implicit;c("value",e.value),o(),s(e.label)}}function ge(l,a){if(l&1){let e=F();t(0,"button",24),E("click",function(){let g=U(e).$implicit,m=C();return D(m.setSelectedAllowancePlan(g.id))}),t(1,"span"),i(2),n(),t(3,"strong"),i(4),p(5,"number"),n(),t(6,"em"),i(7),n()()}if(l&2){let e=a.$implicit,r=C();z("active",r.selectedAllowance().id===e.id),o(2),s(e.period),o(2),s(O(5,5,e.creditsPerUserMonthly)),o(3),d("",e.label," credits/user/month")}}function me(l,a){if(l&1&&(t(0,"em"),i(1),n()),l&2){let e=C().$implicit;o(),s(e.note)}}function ue(l,a){if(l&1&&(i(0),p(1,"number")),l&2){let e=C().$implicit;d(" $",_(1,1,e.cacheWrite,"1.0-3")," ")}}function he(l,a){l&1&&i(0," - ")}function xe(l,a){if(l&1&&(t(0,"span",26),i(1," Used by imports "),x(2,"app-help-popover",28),n()),l&2){let e=C(3);o(2),c("text",e.help.pricingFallback)}}function _e(l,a){if(l&1&&(t(0,"span",26),i(1," Estimate fallback "),x(2,"app-help-popover",28),n()),l&2){let e=C(3);o(2),c("text",e.help.pricingFallback)}}function Ce(l,a){l&1&&(t(0,"span",27),i(1,"Direct pricing"),n())}function Pe(l,a){if(l&1&&f(0,xe,3,1,"span",26)(1,_e,3,1,"span",26)(2,Ce,2,0,"span",27),l&2){let e=C().$implicit;w(e.usedDirectly&&e.usedAsFallback?0:e.usedAsFallback?1:2)}}function be(l,a){l&1&&(t(0,"span",25),i(1,"Not yet"),n())}function fe(l,a){if(l&1&&(t(0,"div",23)(1,"strong"),i(2),f(3,me,2,1,"em"),n(),t(4,"span"),i(5),n(),t(6,"span"),i(7),n(),t(8,"span"),i(9),n(),t(10,"span"),i(11),t(12,"em"),i(13),n()(),t(14,"span"),i(15),p(16,"number"),n(),t(17,"span"),i(18),p(19,"number"),n(),t(20,"span"),f(21,ue,2,4)(22,he,1,0),n(),t(23,"span"),i(24),p(25,"number"),n(),t(26,"span"),f(27,Pe,3,1)(28,be,2,0,"span",25),n()()),l&2){let e=a.$implicit;o(2),d(" ",e.model," "),o(),w(e.note?3:-1),o(2),s(e.provider),o(2),s(e.releaseStatus),o(2),s(e.category),o(2),d(" ",e.tier," "),o(2),s(e.threshold),o(2),d("$",_(16,12,e.input,"1.0-3")),o(3),d("$",_(19,15,e.cachedInput,"1.0-3")),o(3),w(e.cacheWrite?21:22),o(3),d("$",_(25,18,e.output,"1.0-3")),o(3),w(e.usedByImportedSessions?27:28)}}var le=class l{sessionsInput=S([]);selectedAllowancePlanInput=S("business-standard");usageTimeRange=S("all");set sessions(a){this.sessionsInput.set(a??[])}set selectedAllowancePlan(a){this.selectedAllowancePlanInput.set(a??"business-standard")}selectedAllowancePlanChange=new N;pricingVersion=H;pricingSourceLabel=W;pricingSourceUrl=$;pricingSnapshotDate=V;pricingImportedAt=j;allowanceSourceUrl=J;creditUsd=q;allowancePlans=y;usageTimeOptions=[{value:"all",label:"All imported sessions"},{value:"7d",label:"Last 7 days"},{value:"30d",label:"Last 30 days"},{value:"90d",label:"Last 90 days"}];help={inputTokens:"Normal, non-cached input/context tokens priced at the GitHub input rate. Raw VS Code inputTokens can be higher when cachedTokens are present.",outputTokens:"Generated model response tokens.",cachedInput:"Input/context tokens VS Code reported as cachedTokens. They are part of raw input, but priced with GitHub cached-input rates instead of normal input rates.",cacheWrite:"Provider cache creation tokens when the billing source exposes them. GitHub lists this mainly for Anthropic pricing rows.",pricingFallback:"The raw model name from VS Code did not match a GitHub price row in the local pricing table, so the estimate uses the displayed fallback price row. Treat this as an explicit estimate assumption.",allowance:"Included AI credits for Copilot Business and Enterprise are monthly per assigned license, but GitHub pools them at the organization or enterprise billing entity level.",credit:"GitHub states that 1 AI credit equals $0.01 USD. When VS Code logs GitHub source usage, the app uses that first; otherwise it converts the local token estimate into credits.",usageWindow:"This only filters the imported sessions used by the allowance meter. It does not change the GitHub price table below."};selectedAllowance=P(()=>y.find(a=>a.id===this.selectedAllowancePlanInput())??y[0]);allowanceSessions=P(()=>{let a=this.usageCutoff(this.sessionsInput(),this.usageTimeRange());return this.sessionsInput().filter(e=>!a||new Date(e.startedAt).getTime()>=a)});totalEstimateUsd=P(()=>this.allowanceSessions().reduce((a,e)=>a+X(e),0));totalEstimateCredits=P(()=>this.allowanceSessions().reduce((a,e)=>a+Y(e),0));selectedAllowanceUsage=P(()=>{let a=this.selectedAllowance(),e=this.totalEstimateCredits(),r=a.creditsPerUserMonthly>0?e/a.creditsPerUserMonthly*100:0;return{credits:e,share:r,perUserCredits:a.creditsPerUserMonthly,sessions:this.allowanceSessions().length,totalSessions:this.sessionsInput().length,windowLabel:this.usageTimeOptions.find(g=>g.value===this.usageTimeRange())?.label??"All imported sessions"}});pricingRows=P(()=>Object.entries(K).flatMap(([a,e])=>{let r=u=>{let I=this.sessionsInput().flatMap(h=>h.modelBreakdown).filter(h=>h.pricingModel===a&&(h.pricingTiers?.includes(u)??u===(e.tierLabel??"Default")));return{usedByImportedSessions:I.length>0,usedDirectly:I.some(h=>!this.usesPricingFallback(h.model,h.pricingModel)),usedAsFallback:I.some(h=>this.usesPricingFallback(h.model,h.pricingModel))}},g={model:a,provider:e.provider,releaseStatus:e.releaseStatus,category:e.category,note:e.note},m=e.tierLabel??"Default";return[k(b(b({},g),r(m)),{tier:m,threshold:e.tierThresholdLabel??"All request sizes",input:e.input,cachedInput:e.cachedInput,cacheWrite:e.cacheWrite??0,output:e.output}),...(e.tiers??[]).map(u=>k(b(b({},g),r(u.label)),{tier:u.label,threshold:u.thresholdLabel,input:u.input,cachedInput:u.cachedInput,cacheWrite:u.cacheWrite??e.cacheWrite??0,output:u.output}))]}));setSelectedAllowancePlan(a){if(!y.some(r=>r.id===a))return;let e=a;this.selectedAllowancePlanInput.set(e),this.selectedAllowancePlanChange.emit(e)}setUsageTimeRange(a){this.usageTimeOptions.some(e=>e.value===a)&&this.usageTimeRange.set(a)}usesPricingFallback=Q;usageCutoff(a,e){if(e==="all"||!a.length)return null;let r=e==="7d"?7:e==="30d"?30:90,g=Math.max(...a.map(m=>new Date(m.startedAt).getTime()).filter(Number.isFinite));return Number.isFinite(g)?g-r*24*60*60*1e3:null}static \u0275fac=function(e){return new(e||l)};static \u0275cmp=R({type:l,selectors:[["app-pricing-page"]],inputs:{sessions:"sessions",selectedAllowancePlan:"selectedAllowancePlan"},outputs:{selectedAllowancePlanChange:"selectedAllowancePlanChange"},decls:129,vars:46,consts:[[1,"pricing-page"],[1,"pricing-header"],[1,"eyebrow"],["target","_blank","rel","noreferrer",3,"href"],[1,"pricing-source"],["aria-label","GitHub Copilot AI credit allowance",1,"allowance-panel"],[1,"allowance-copy"],[1,"allowance-control"],["label","Explain AI credit allowance",3,"text"],[3,"ngModelChange","ngModel"],[3,"value"],["label","Explain usage window",3,"text"],[1,"allowance-meter"],["aria-hidden","true",1,"allowance-bar"],["aria-label","Available Copilot allowance plans",1,"allowance-grid"],["type","button",1,"allowance-card",3,"active"],[1,"pricing-note"],[1,"pricing-table"],[1,"pricing-row","pricing-row-heading"],["label","Explain normal input",3,"text"],["label","Explain cached input",3,"text"],["label","Explain cache write",3,"text"],["label","Explain output tokens",3,"text"],[1,"pricing-row"],["type","button",1,"allowance-card",3,"click"],[1,"muted"],[1,"used-pill","fallback-used"],[1,"used-pill"],["label","Explain fallback pricing",3,"text"]],template:function(e,r){e&1&&(t(0,"section",0)(1,"div",1)(2,"div")(3,"p",2),i(4,"Cost inputs"),n(),t(5,"h2"),i(6,"GitHub Copilot prices used by this app"),n(),t(7,"p"),i(8," Evidence page for the rate card, AI-credit conversion, source usage, and token-estimate fallback. "),n()(),t(9,"a",3),i(10,"Open GitHub source"),n()(),t(11,"section",4)(12,"div")(13,"span"),i(14,"Source"),n(),t(15,"strong"),i(16),n()(),t(17,"div")(18,"span"),i(19,"Pricing version"),n(),t(20,"strong"),i(21),n()(),t(22,"div")(23,"span"),i(24,"Source checked"),n(),t(25,"strong"),i(26),p(27,"date"),n()(),t(28,"div")(29,"span"),i(30,"Imported into app"),n(),t(31,"strong"),i(32),p(33,"date"),n()()(),t(34,"section",5)(35,"div",6)(36,"p",2),i(37,"License allowance"),n(),t(38,"h3"),i(39,"AI credits context"),n(),t(40,"p"),i(41," GitHub converts model usage into AI credits at "),t(42,"strong"),i(43),p(44,"number"),n(),i(45,". The meter below compares imported source usage, with token estimates as fallback, against the selected per-license allowance. "),n(),t(46,"a",3),i(47,"Open allowance source"),n()(),t(48,"div",7)(49,"label")(50,"span"),i(51," Selected plan "),x(52,"app-help-popover",8),n(),t(53,"select",9),E("ngModelChange",function(m){return r.setSelectedAllowancePlan(m)}),M(54,pe,2,2,"option",10,re),n()(),t(56,"label")(57,"span"),i(58," Usage window "),x(59,"app-help-popover",11),n(),t(60,"select",9),E("ngModelChange",function(m){return r.setUsageTimeRange(m)}),M(61,de,2,2,"option",10,ce),n()(),t(63,"div",12)(64,"div")(65,"span"),i(66),n(),t(67,"strong"),i(68),p(69,"number"),n(),t(70,"em"),i(71),p(72,"number"),p(73,"number"),n()(),t(74,"div")(75,"span"),i(76,"Monthly allowance"),n(),t(77,"strong"),i(78),p(79,"number"),n()(),t(80,"div")(81,"span"),i(82,"Allowance used"),n(),t(83,"strong"),i(84),p(85,"number"),n()()(),t(86,"div",13),x(87,"span"),n(),t(88,"p"),i(89),n()()(),t(90,"section",14),M(91,ge,8,7,"button",15,re),n(),t(93,"div",16)(94,"strong"),i(95,"Calculation rule"),n(),t(96,"p"),i(97," Per-1M-token GitHub rates are multiplied by imported VS Code token buckets. Normal input is "),t(98,"code"),i(99,"inputTokens - cachedTokens"),n(),i(100," when cached tokens are present. Estimates stay in USD because GitHub prices and AI credits are USD-native; cache write is only priced when a numeric cache-write field is imported. Long-context rates are selected independently for each model call from that call's normal plus cached input. "),n()(),t(101,"div",17)(102,"div",18)(103,"span"),i(104,"Model"),n(),t(105,"span"),i(106,"Provider"),n(),t(107,"span"),i(108,"Status"),n(),t(109,"span"),i(110,"Category"),n(),t(111,"span"),i(112,"Tier"),n(),t(113,"span"),i(114,"Normal input "),x(115,"app-help-popover",19),n(),t(116,"span"),i(117,"Cached input "),x(118,"app-help-popover",20),n(),t(119,"span"),i(120,"Cache write "),x(121,"app-help-popover",21),n(),t(122,"span"),i(123,"Output "),x(124,"app-help-popover",22),n(),t(125,"span"),i(126,"Used"),n()(),M(127,fe,29,21,"div",23,se),n()()),e&2&&(o(9),c("href",r.pricingSourceUrl,A),o(7),s(r.pricingSourceLabel),o(5),s(r.pricingVersion),o(5),s(_(27,25,r.pricingSnapshotDate,"MMM d, y")),o(6),s(_(33,28,r.pricingImportedAt,"MMM d, y")),o(11),d("1 credit = $",_(44,31,r.creditUsd,"1.2-2")," USD"),o(3),c("href",r.allowanceSourceUrl,A),o(6),c("text",r.help.allowance),o(),c("ngModel",r.selectedAllowance().id),o(),v(r.allowancePlans),o(5),c("text",r.help.usageWindow),o(),c("ngModel",r.usageTimeRange()),o(),v(r.usageTimeOptions),o(5),s(r.selectedAllowanceUsage().windowLabel),o(2),d("",_(69,34,r.selectedAllowanceUsage().credits,"1.0-1")," credits"),o(3),T("",O(72,37,r.selectedAllowanceUsage().sessions)," of ",O(73,39,r.selectedAllowanceUsage().totalSessions)," sessions"),o(7),d("",O(79,41,r.selectedAllowance().creditsPerUserMonthly)," credits/user"),o(6),d("",_(85,43,r.selectedAllowanceUsage().share,"1.0-1"),"%"),o(3),L("width",r.selectedAllowanceUsage().share>100?100:r.selectedAllowanceUsage().share,"%"),o(2),T("",r.selectedAllowance().period,". ",r.selectedAllowance().note),o(2),v(r.allowancePlans),o(24),c("text",r.help.inputTokens),o(3),c("text",r.help.cachedInput),o(3),c("text",r.help.cacheWrite),o(3),c("text",r.help.outputTokens),o(3),v(r.pricingRows()))},dependencies:[oe,ie,ae,ne,ee,te,Z,G,B],styles:["[_nghost-%COMP%]{display:block}.pricing-page[_ngcontent-%COMP%]{display:grid;gap:16px}.pricing-header[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.pricing-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;color:var(--text-strong);font-size:22px;font-weight:760;letter-spacing:0}.pricing-header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}.pricing-header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]:not(.eyebrow){max-width:720px;margin-top:6px;color:var(--muted);font-size:12px;line-height:1.45}.pricing-header[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{border:1px solid var(--line-strong);border-radius:999px;padding:7px 10px;color:var(--text);font-size:12px;font-weight:720;text-decoration:none;white-space:nowrap}.pricing-source[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));overflow:hidden;border:1px solid var(--line);border-radius:12px;background:var(--surface);box-shadow:var(--shadow, 0 18px 50px rgba(0, 0, 0, .22))}.pricing-source[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{padding:12px;border-right:1px solid var(--line)}.pricing-source[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:last-child{border-right:0}.pricing-source[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .pricing-row[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .pricing-note[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:var(--muted);font-size:12px}.pricing-source[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{display:block;margin-top:5px;color:var(--text);font-weight:760}.pricing-note[_ngcontent-%COMP%]{border:1px solid var(--line);border-left:4px solid var(--accent-2);border-radius:12px;padding:12px 14px;background:var(--surface-soft)}.pricing-note[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text-strong)}.pricing-note[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{max-width:940px;margin:4px 0 0;line-height:1.45}.allowance-panel[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(260px,.85fr) minmax(320px,1.15fr);gap:14px;border:1px solid var(--line);border-radius:14px;padding:14px;background:var(--header-gradient, linear-gradient(135deg, rgba(124, 92, 255, .16), rgba(31, 209, 165, .07)), var(--surface))}.allowance-copy[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;color:var(--text-strong);font-size:18px;font-weight:760}.allowance-copy[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .allowance-control[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .allowance-card[_ngcontent-%COMP%] em[_ngcontent-%COMP%], .allowance-card[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--muted);font-size:12px;line-height:1.45}.allowance-copy[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{display:inline-flex;margin-top:8px;color:var(--accent-2);font-size:12px;font-weight:760;text-decoration:none}.allowance-control[_ngcontent-%COMP%]{display:grid;align-content:start;gap:12px}.allowance-control[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:grid;gap:6px}.allowance-control[_ngcontent-%COMP%] label[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;color:var(--muted);font-size:12px;font-weight:760}.allowance-control[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{width:100%;border:1px solid var(--line-strong);border-radius:10px;padding:8px 10px;background:var(--control-bg, rgba(5, 12, 22, .55));color:var(--text);font:inherit;font-weight:720}.allowance-meter[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.allowance-meter[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{border:1px solid var(--line);border-radius:10px;padding:10px;background:var(--surface-soft)}.allowance-meter[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;color:var(--muted);font-size:11px}.allowance-meter[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{display:block;margin-top:3px;color:var(--muted);font-size:11px;font-style:normal}.allowance-meter[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{display:block;margin-top:3px;color:var(--text-strong);font-size:16px;font-weight:760}.allowance-bar[_ngcontent-%COMP%]{height:7px;overflow:hidden;border-radius:999px;background:#6170852e}.allowance-bar[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--accent-2),#ffba4a)}.allowance-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.allowance-card[_ngcontent-%COMP%]{display:grid;gap:3px;border:1px solid var(--line);border-radius:12px;padding:10px;background:var(--surface);color:inherit;font:inherit;text-align:left;cursor:pointer}.allowance-card.active[_ngcontent-%COMP%]{border-color:#1fd1a570;background:#1fd1a517;box-shadow:0 0 0 1px #1fd1a51f inset}.allowance-card[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text-strong);font-size:20px;font-weight:760}.pricing-table[_ngcontent-%COMP%]{overflow-x:auto;border:1px solid var(--line);border-radius:12px;background:var(--surface)}.pricing-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(210px,1.35fr) repeat(3,minmax(100px,.65fr)) minmax(150px,.9fr) repeat(4,minmax(100px,.58fr)) minmax(124px,.7fr);min-width:1240px;border-bottom:1px solid var(--line)}.pricing-row[_ngcontent-%COMP%]:last-child{border-bottom:0}.pricing-row[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{padding:10px 12px}.pricing-row-heading[_ngcontent-%COMP%]{background:var(--surface-soft);color:var(--muted);font-size:11px;font-weight:720;text-transform:uppercase}.pricing-row[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text);font-size:14px;font-weight:760}.pricing-row[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{display:block;margin-top:4px;color:var(--text);font-size:12px;font-style:normal;font-weight:600}.used-pill[_ngcontent-%COMP%]{display:inline-flex;border:1px solid rgba(31,209,165,.35);border-radius:999px;padding:4px 8px;background:#1fd1a51f;color:var(--success-text, #bbfff0)!important;font-size:12px;font-weight:900;white-space:nowrap}.used-pill.fallback-used[_ngcontent-%COMP%]{border-color:#ffba4a73;background:#ffba4a1f;color:var(--warning-text, #ffe0a0)!important}.muted[_ngcontent-%COMP%]{color:var(--muted)}.eyebrow[_ngcontent-%COMP%]{color:var(--accent-2);font-size:10px;font-weight:760;letter-spacing:.08em;text-transform:uppercase}@media(max-width:900px){.pricing-header[_ngcontent-%COMP%], .pricing-source[_ngcontent-%COMP%]{display:grid}.pricing-source[_ngcontent-%COMP%], .allowance-panel[_ngcontent-%COMP%], .allowance-grid[_ngcontent-%COMP%], .allowance-meter[_ngcontent-%COMP%]{grid-template-columns:1fr}.pricing-source[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{border-right:0;border-bottom:1px solid var(--line)}.pricing-source[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:last-child{border-bottom:0}}.used-pill[_ngcontent-%COMP%]{padding:3px 7px;font-size:11px;font-weight:760}@media(max-width:1100px){.allowance-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(2,minmax(0,1fr))}}.theme-light[_nghost-%COMP%] .pricing-source[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .pricing-source[_ngcontent-%COMP%], .theme-light[_nghost-%COMP%] .pricing-table[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .pricing-table[_ngcontent-%COMP%], .theme-light[_nghost-%COMP%] .pricing-note[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .pricing-note[_ngcontent-%COMP%], .theme-light[_nghost-%COMP%] .allowance-panel[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .allowance-panel[_ngcontent-%COMP%]{box-shadow:var(--shadow-soft)}.theme-light[_nghost-%COMP%] .pricing-source[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .pricing-source[_ngcontent-%COMP%]{background:linear-gradient(180deg,#ffffffc2,#ffffff75),var(--surface)}.theme-light[_nghost-%COMP%] .pricing-note[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .pricing-note[_ngcontent-%COMP%]{background:linear-gradient(135deg,#0c9f830b,#6f5cff05),var(--surface)}.theme-light[_nghost-%COMP%] .allowance-panel[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .allowance-panel[_ngcontent-%COMP%]{border-color:#bdcbdae6}.theme-light[_nghost-%COMP%] .allowance-card[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .allowance-card[_ngcontent-%COMP%], .theme-light[_nghost-%COMP%] .allowance-meter[_ngcontent-%COMP%] div[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .allowance-meter[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{background:#ffffffad}.theme-light[_nghost-%COMP%] .pricing-table[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .pricing-table[_ngcontent-%COMP%]{background:var(--surface)}"]})};export{le as PricingPageComponent};
|
|
1
|
+
import{a as H,b as $,c as W,d as V,e as j,f as q,g as J,h as K,i as y,m as Q,r as X,s as Y}from"./chunk-5FL3PHQS.js";import{$a as O,Ca as f,Da as w,Fa as M,Ga as v,Ha as c,Ia as t,Ja as n,Ka as x,O as U,Oa as F,P as D,Qa as E,Sa as C,Ta as L,U as N,Ua as z,Va as i,Wa as s,Xa as d,Ya as T,Z as S,_a as p,a as b,ab as _,b as k,db as P,ja as A,ka as o,nb as G,ob as B,sa as R,sb as Z,ub as ee,vb as te,wb as ne,xb as ie,yb as ae,zb as oe}from"./chunk-WOIYAEKB.js";var re=(l,a)=>a.id,ce=(l,a)=>a.value,se=(l,a)=>a.model+":"+a.tier;function pe(l,a){if(l&1&&(t(0,"option",10),i(1),n()),l&2){let e=a.$implicit;c("value",e.id),o(),s(e.label)}}function de(l,a){if(l&1&&(t(0,"option",10),i(1),n()),l&2){let e=a.$implicit;c("value",e.value),o(),s(e.label)}}function ge(l,a){if(l&1){let e=F();t(0,"button",24),E("click",function(){let g=U(e).$implicit,m=C();return D(m.setSelectedAllowancePlan(g.id))}),t(1,"span"),i(2),n(),t(3,"strong"),i(4),p(5,"number"),n(),t(6,"em"),i(7),n()()}if(l&2){let e=a.$implicit,r=C();z("active",r.selectedAllowance().id===e.id),o(2),s(e.period),o(2),s(O(5,5,e.creditsPerUserMonthly)),o(3),d("",e.label," credits/user/month")}}function me(l,a){if(l&1&&(t(0,"em"),i(1),n()),l&2){let e=C().$implicit;o(),s(e.note)}}function ue(l,a){if(l&1&&(i(0),p(1,"number")),l&2){let e=C().$implicit;d(" $",_(1,1,e.cacheWrite,"1.0-3")," ")}}function he(l,a){l&1&&i(0," - ")}function xe(l,a){if(l&1&&(t(0,"span",26),i(1," Used by imports "),x(2,"app-help-popover",28),n()),l&2){let e=C(3);o(2),c("text",e.help.pricingFallback)}}function _e(l,a){if(l&1&&(t(0,"span",26),i(1," Estimate fallback "),x(2,"app-help-popover",28),n()),l&2){let e=C(3);o(2),c("text",e.help.pricingFallback)}}function Ce(l,a){l&1&&(t(0,"span",27),i(1,"Direct pricing"),n())}function Pe(l,a){if(l&1&&f(0,xe,3,1,"span",26)(1,_e,3,1,"span",26)(2,Ce,2,0,"span",27),l&2){let e=C().$implicit;w(e.usedDirectly&&e.usedAsFallback?0:e.usedAsFallback?1:2)}}function be(l,a){l&1&&(t(0,"span",25),i(1,"Not yet"),n())}function fe(l,a){if(l&1&&(t(0,"div",23)(1,"strong"),i(2),f(3,me,2,1,"em"),n(),t(4,"span"),i(5),n(),t(6,"span"),i(7),n(),t(8,"span"),i(9),n(),t(10,"span"),i(11),t(12,"em"),i(13),n()(),t(14,"span"),i(15),p(16,"number"),n(),t(17,"span"),i(18),p(19,"number"),n(),t(20,"span"),f(21,ue,2,4)(22,he,1,0),n(),t(23,"span"),i(24),p(25,"number"),n(),t(26,"span"),f(27,Pe,3,1)(28,be,2,0,"span",25),n()()),l&2){let e=a.$implicit;o(2),d(" ",e.model," "),o(),w(e.note?3:-1),o(2),s(e.provider),o(2),s(e.releaseStatus),o(2),s(e.category),o(2),d(" ",e.tier," "),o(2),s(e.threshold),o(2),d("$",_(16,12,e.input,"1.0-3")),o(3),d("$",_(19,15,e.cachedInput,"1.0-3")),o(3),w(e.cacheWrite?21:22),o(3),d("$",_(25,18,e.output,"1.0-3")),o(3),w(e.usedByImportedSessions?27:28)}}var le=class l{sessionsInput=S([]);selectedAllowancePlanInput=S("business-standard");usageTimeRange=S("all");set sessions(a){this.sessionsInput.set(a??[])}set selectedAllowancePlan(a){this.selectedAllowancePlanInput.set(a??"business-standard")}selectedAllowancePlanChange=new N;pricingVersion=H;pricingSourceLabel=W;pricingSourceUrl=$;pricingSnapshotDate=V;pricingImportedAt=j;allowanceSourceUrl=J;creditUsd=q;allowancePlans=y;usageTimeOptions=[{value:"all",label:"All imported sessions"},{value:"7d",label:"Last 7 days"},{value:"30d",label:"Last 30 days"},{value:"90d",label:"Last 90 days"}];help={inputTokens:"Normal, non-cached input/context tokens priced at the GitHub input rate. Raw VS Code inputTokens can be higher when cachedTokens are present.",outputTokens:"Generated model response tokens.",cachedInput:"Input/context tokens VS Code reported as cachedTokens. They are part of raw input, but priced with GitHub cached-input rates instead of normal input rates.",cacheWrite:"Provider cache creation tokens when the billing source exposes them. GitHub lists this mainly for Anthropic pricing rows.",pricingFallback:"The raw model name from VS Code did not match a GitHub price row in the local pricing table, so the estimate uses the displayed fallback price row. Treat this as an explicit estimate assumption.",allowance:"Included AI credits for Copilot Business and Enterprise are monthly per assigned license, but GitHub pools them at the organization or enterprise billing entity level.",credit:"GitHub states that 1 AI credit equals $0.01 USD. When VS Code logs GitHub source usage, the app uses that first; otherwise it converts the local token estimate into credits.",usageWindow:"This only filters the imported sessions used by the allowance meter. It does not change the GitHub price table below."};selectedAllowance=P(()=>y.find(a=>a.id===this.selectedAllowancePlanInput())??y[0]);allowanceSessions=P(()=>{let a=this.usageCutoff(this.sessionsInput(),this.usageTimeRange());return this.sessionsInput().filter(e=>!a||new Date(e.startedAt).getTime()>=a)});totalEstimateUsd=P(()=>this.allowanceSessions().reduce((a,e)=>a+X(e),0));totalEstimateCredits=P(()=>this.allowanceSessions().reduce((a,e)=>a+Y(e),0));selectedAllowanceUsage=P(()=>{let a=this.selectedAllowance(),e=this.totalEstimateCredits(),r=a.creditsPerUserMonthly>0?e/a.creditsPerUserMonthly*100:0;return{credits:e,share:r,perUserCredits:a.creditsPerUserMonthly,sessions:this.allowanceSessions().length,totalSessions:this.sessionsInput().length,windowLabel:this.usageTimeOptions.find(g=>g.value===this.usageTimeRange())?.label??"All imported sessions"}});pricingRows=P(()=>Object.entries(K).flatMap(([a,e])=>{let r=u=>{let I=this.sessionsInput().flatMap(h=>h.modelBreakdown).filter(h=>h.pricingModel===a&&(h.pricingTiers?.includes(u)??u===(e.tierLabel??"Default")));return{usedByImportedSessions:I.length>0,usedDirectly:I.some(h=>!this.usesPricingFallback(h.model,h.pricingModel)),usedAsFallback:I.some(h=>this.usesPricingFallback(h.model,h.pricingModel))}},g={model:a,provider:e.provider,releaseStatus:e.releaseStatus,category:e.category,note:e.note},m=e.tierLabel??"Default";return[k(b(b({},g),r(m)),{tier:m,threshold:e.tierThresholdLabel??"All request sizes",input:e.input,cachedInput:e.cachedInput,cacheWrite:e.cacheWrite??0,output:e.output}),...(e.tiers??[]).map(u=>k(b(b({},g),r(u.label)),{tier:u.label,threshold:u.thresholdLabel,input:u.input,cachedInput:u.cachedInput,cacheWrite:u.cacheWrite??e.cacheWrite??0,output:u.output}))]}));setSelectedAllowancePlan(a){if(!y.some(r=>r.id===a))return;let e=a;this.selectedAllowancePlanInput.set(e),this.selectedAllowancePlanChange.emit(e)}setUsageTimeRange(a){this.usageTimeOptions.some(e=>e.value===a)&&this.usageTimeRange.set(a)}usesPricingFallback=Q;usageCutoff(a,e){if(e==="all"||!a.length)return null;let r=e==="7d"?7:e==="30d"?30:90,g=Math.max(...a.map(m=>new Date(m.startedAt).getTime()).filter(Number.isFinite));return Number.isFinite(g)?g-r*24*60*60*1e3:null}static \u0275fac=function(e){return new(e||l)};static \u0275cmp=R({type:l,selectors:[["app-pricing-page"]],inputs:{sessions:"sessions",selectedAllowancePlan:"selectedAllowancePlan"},outputs:{selectedAllowancePlanChange:"selectedAllowancePlanChange"},decls:129,vars:46,consts:[[1,"pricing-page"],[1,"pricing-header"],[1,"eyebrow"],["target","_blank","rel","noreferrer",3,"href"],[1,"pricing-source"],["aria-label","GitHub Copilot AI credit allowance",1,"allowance-panel"],[1,"allowance-copy"],[1,"allowance-control"],["label","Explain AI credit allowance",3,"text"],[3,"ngModelChange","ngModel"],[3,"value"],["label","Explain usage window",3,"text"],[1,"allowance-meter"],["aria-hidden","true",1,"allowance-bar"],["aria-label","Available Copilot allowance plans",1,"allowance-grid"],["type","button",1,"allowance-card",3,"active"],[1,"pricing-note"],[1,"pricing-table"],[1,"pricing-row","pricing-row-heading"],["label","Explain normal input",3,"text"],["label","Explain cached input",3,"text"],["label","Explain cache write",3,"text"],["label","Explain output tokens",3,"text"],[1,"pricing-row"],["type","button",1,"allowance-card",3,"click"],[1,"muted"],[1,"used-pill","fallback-used"],[1,"used-pill"],["label","Explain fallback pricing",3,"text"]],template:function(e,r){e&1&&(t(0,"section",0)(1,"div",1)(2,"div")(3,"p",2),i(4,"Cost inputs"),n(),t(5,"h2"),i(6,"GitHub Copilot prices used by this app"),n(),t(7,"p"),i(8," Evidence page for the rate card, AI-credit conversion, source usage, and token-estimate fallback. "),n()(),t(9,"a",3),i(10,"Open GitHub source"),n()(),t(11,"section",4)(12,"div")(13,"span"),i(14,"Source"),n(),t(15,"strong"),i(16),n()(),t(17,"div")(18,"span"),i(19,"Pricing version"),n(),t(20,"strong"),i(21),n()(),t(22,"div")(23,"span"),i(24,"Source checked"),n(),t(25,"strong"),i(26),p(27,"date"),n()(),t(28,"div")(29,"span"),i(30,"Imported into app"),n(),t(31,"strong"),i(32),p(33,"date"),n()()(),t(34,"section",5)(35,"div",6)(36,"p",2),i(37,"License allowance"),n(),t(38,"h3"),i(39,"AI credits context"),n(),t(40,"p"),i(41," GitHub converts model usage into AI credits at "),t(42,"strong"),i(43),p(44,"number"),n(),i(45,". The meter below compares imported source usage, with token estimates as fallback, against the selected per-license allowance. "),n(),t(46,"a",3),i(47,"Open allowance source"),n()(),t(48,"div",7)(49,"label")(50,"span"),i(51," Selected plan "),x(52,"app-help-popover",8),n(),t(53,"select",9),E("ngModelChange",function(m){return r.setSelectedAllowancePlan(m)}),M(54,pe,2,2,"option",10,re),n()(),t(56,"label")(57,"span"),i(58," Usage window "),x(59,"app-help-popover",11),n(),t(60,"select",9),E("ngModelChange",function(m){return r.setUsageTimeRange(m)}),M(61,de,2,2,"option",10,ce),n()(),t(63,"div",12)(64,"div")(65,"span"),i(66),n(),t(67,"strong"),i(68),p(69,"number"),n(),t(70,"em"),i(71),p(72,"number"),p(73,"number"),n()(),t(74,"div")(75,"span"),i(76,"Monthly allowance"),n(),t(77,"strong"),i(78),p(79,"number"),n()(),t(80,"div")(81,"span"),i(82,"Allowance used"),n(),t(83,"strong"),i(84),p(85,"number"),n()()(),t(86,"div",13),x(87,"span"),n(),t(88,"p"),i(89),n()()(),t(90,"section",14),M(91,ge,8,7,"button",15,re),n(),t(93,"div",16)(94,"strong"),i(95,"Calculation rule"),n(),t(96,"p"),i(97," Per-1M-token GitHub rates are multiplied by imported VS Code token buckets. Normal input is "),t(98,"code"),i(99,"inputTokens - cachedTokens"),n(),i(100," when cached tokens are present. Estimates stay in USD because GitHub prices and AI credits are USD-native; cache write is only priced when a numeric cache-write field is imported. Long-context rates are selected independently for each model call from that call's normal plus cached input. "),n()(),t(101,"div",17)(102,"div",18)(103,"span"),i(104,"Model"),n(),t(105,"span"),i(106,"Provider"),n(),t(107,"span"),i(108,"Status"),n(),t(109,"span"),i(110,"Category"),n(),t(111,"span"),i(112,"Tier"),n(),t(113,"span"),i(114,"Normal input "),x(115,"app-help-popover",19),n(),t(116,"span"),i(117,"Cached input "),x(118,"app-help-popover",20),n(),t(119,"span"),i(120,"Cache write "),x(121,"app-help-popover",21),n(),t(122,"span"),i(123,"Output "),x(124,"app-help-popover",22),n(),t(125,"span"),i(126,"Used"),n()(),M(127,fe,29,21,"div",23,se),n()()),e&2&&(o(9),c("href",r.pricingSourceUrl,A),o(7),s(r.pricingSourceLabel),o(5),s(r.pricingVersion),o(5),s(_(27,25,r.pricingSnapshotDate,"MMM d, y")),o(6),s(_(33,28,r.pricingImportedAt,"MMM d, y")),o(11),d("1 credit = $",_(44,31,r.creditUsd,"1.2-2")," USD"),o(3),c("href",r.allowanceSourceUrl,A),o(6),c("text",r.help.allowance),o(),c("ngModel",r.selectedAllowance().id),o(),v(r.allowancePlans),o(5),c("text",r.help.usageWindow),o(),c("ngModel",r.usageTimeRange()),o(),v(r.usageTimeOptions),o(5),s(r.selectedAllowanceUsage().windowLabel),o(2),d("",_(69,34,r.selectedAllowanceUsage().credits,"1.0-1")," credits"),o(3),T("",O(72,37,r.selectedAllowanceUsage().sessions)," of ",O(73,39,r.selectedAllowanceUsage().totalSessions)," sessions"),o(7),d("",O(79,41,r.selectedAllowance().creditsPerUserMonthly)," credits/user"),o(6),d("",_(85,43,r.selectedAllowanceUsage().share,"1.0-1"),"%"),o(3),L("width",r.selectedAllowanceUsage().share>100?100:r.selectedAllowanceUsage().share,"%"),o(2),T("",r.selectedAllowance().period,". ",r.selectedAllowance().note),o(2),v(r.allowancePlans),o(24),c("text",r.help.inputTokens),o(3),c("text",r.help.cachedInput),o(3),c("text",r.help.cacheWrite),o(3),c("text",r.help.outputTokens),o(3),v(r.pricingRows()))},dependencies:[oe,ie,ae,ne,ee,te,Z,G,B],styles:["[_nghost-%COMP%]{display:block}.pricing-page[_ngcontent-%COMP%]{display:grid;gap:16px}.pricing-header[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.pricing-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;color:var(--text-strong);font-size:22px;font-weight:760;letter-spacing:0}.pricing-header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}.pricing-header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]:not(.eyebrow){max-width:720px;margin-top:6px;color:var(--muted);font-size:12px;line-height:1.45}.pricing-header[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{border:1px solid var(--line-strong);border-radius:999px;padding:7px 10px;color:var(--text);font-size:12px;font-weight:720;text-decoration:none;white-space:nowrap}.pricing-source[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));overflow:hidden;border:1px solid var(--line);border-radius:12px;background:var(--surface);box-shadow:var(--shadow, 0 18px 50px rgba(0, 0, 0, .22))}.pricing-source[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{padding:12px;border-right:1px solid var(--line)}.pricing-source[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:last-child{border-right:0}.pricing-source[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .pricing-row[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .pricing-note[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:var(--muted);font-size:12px}.pricing-source[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{display:block;margin-top:5px;color:var(--text);font-weight:760}.pricing-note[_ngcontent-%COMP%]{border:1px solid var(--line);border-left:4px solid var(--accent-2);border-radius:12px;padding:12px 14px;background:var(--surface-soft)}.pricing-note[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text-strong)}.pricing-note[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{max-width:940px;margin:4px 0 0;line-height:1.45}.allowance-panel[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(260px,.85fr) minmax(320px,1.15fr);gap:14px;border:1px solid var(--line);border-radius:14px;padding:14px;background:var(--header-gradient, linear-gradient(135deg, rgba(124, 92, 255, .16), rgba(31, 209, 165, .07)), var(--surface))}.allowance-copy[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;color:var(--text-strong);font-size:18px;font-weight:760}.allowance-copy[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .allowance-control[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .allowance-card[_ngcontent-%COMP%] em[_ngcontent-%COMP%], .allowance-card[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--muted);font-size:12px;line-height:1.45}.allowance-copy[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{display:inline-flex;margin-top:8px;color:var(--accent-2);font-size:12px;font-weight:760;text-decoration:none}.allowance-control[_ngcontent-%COMP%]{display:grid;align-content:start;gap:12px}.allowance-control[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:grid;gap:6px}.allowance-control[_ngcontent-%COMP%] label[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;color:var(--muted);font-size:12px;font-weight:760}.allowance-control[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{width:100%;border:1px solid var(--line-strong);border-radius:10px;padding:8px 10px;background:var(--control-bg, rgba(5, 12, 22, .55));color:var(--text);font:inherit;font-weight:720}.allowance-meter[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.allowance-meter[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{border:1px solid var(--line);border-radius:10px;padding:10px;background:var(--surface-soft)}.allowance-meter[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;color:var(--muted);font-size:11px}.allowance-meter[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{display:block;margin-top:3px;color:var(--muted);font-size:11px;font-style:normal}.allowance-meter[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{display:block;margin-top:3px;color:var(--text-strong);font-size:16px;font-weight:760}.allowance-bar[_ngcontent-%COMP%]{height:7px;overflow:hidden;border-radius:999px;background:#6170852e}.allowance-bar[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--accent-2),#ffba4a)}.allowance-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.allowance-card[_ngcontent-%COMP%]{display:grid;gap:3px;border:1px solid var(--line);border-radius:12px;padding:10px;background:var(--surface);color:inherit;font:inherit;text-align:left;cursor:pointer}.allowance-card.active[_ngcontent-%COMP%]{border-color:#1fd1a570;background:#1fd1a517;box-shadow:0 0 0 1px #1fd1a51f inset}.allowance-card[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text-strong);font-size:20px;font-weight:760}.pricing-table[_ngcontent-%COMP%]{overflow-x:auto;border:1px solid var(--line);border-radius:12px;background:var(--surface)}.pricing-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(210px,1.35fr) repeat(3,minmax(100px,.65fr)) minmax(150px,.9fr) repeat(4,minmax(100px,.58fr)) minmax(124px,.7fr);min-width:1240px;border-bottom:1px solid var(--line)}.pricing-row[_ngcontent-%COMP%]:last-child{border-bottom:0}.pricing-row[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{padding:10px 12px}.pricing-row-heading[_ngcontent-%COMP%]{background:var(--surface-soft);color:var(--muted);font-size:11px;font-weight:720;text-transform:uppercase}.pricing-row[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text);font-size:14px;font-weight:760}.pricing-row[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{display:block;margin-top:4px;color:var(--text);font-size:12px;font-style:normal;font-weight:600}.used-pill[_ngcontent-%COMP%]{display:inline-flex;border:1px solid rgba(31,209,165,.35);border-radius:999px;padding:4px 8px;background:#1fd1a51f;color:var(--success-text, #bbfff0)!important;font-size:12px;font-weight:900;white-space:nowrap}.used-pill.fallback-used[_ngcontent-%COMP%]{border-color:#ffba4a73;background:#ffba4a1f;color:var(--warning-text, #ffe0a0)!important}.muted[_ngcontent-%COMP%]{color:var(--muted)}.eyebrow[_ngcontent-%COMP%]{color:var(--accent-2);font-size:10px;font-weight:760;letter-spacing:.08em;text-transform:uppercase}@media(max-width:900px){.pricing-header[_ngcontent-%COMP%], .pricing-source[_ngcontent-%COMP%]{display:grid}.pricing-source[_ngcontent-%COMP%], .allowance-panel[_ngcontent-%COMP%], .allowance-grid[_ngcontent-%COMP%], .allowance-meter[_ngcontent-%COMP%]{grid-template-columns:1fr}.pricing-source[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{border-right:0;border-bottom:1px solid var(--line)}.pricing-source[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:last-child{border-bottom:0}}.used-pill[_ngcontent-%COMP%]{padding:3px 7px;font-size:11px;font-weight:760}@media(max-width:1100px){.allowance-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(2,minmax(0,1fr))}}.theme-light[_nghost-%COMP%] .pricing-source[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .pricing-source[_ngcontent-%COMP%], .theme-light[_nghost-%COMP%] .pricing-table[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .pricing-table[_ngcontent-%COMP%], .theme-light[_nghost-%COMP%] .pricing-note[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .pricing-note[_ngcontent-%COMP%], .theme-light[_nghost-%COMP%] .allowance-panel[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .allowance-panel[_ngcontent-%COMP%]{box-shadow:var(--shadow-soft)}.theme-light[_nghost-%COMP%] .pricing-source[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .pricing-source[_ngcontent-%COMP%]{background:linear-gradient(180deg,#ffffffc2,#ffffff75),var(--surface)}.theme-light[_nghost-%COMP%] .pricing-note[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .pricing-note[_ngcontent-%COMP%]{background:linear-gradient(135deg,#0c9f830b,#6f5cff05),var(--surface)}.theme-light[_nghost-%COMP%] .allowance-panel[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .allowance-panel[_ngcontent-%COMP%]{border-color:#bdcbdae6}.theme-light[_nghost-%COMP%] .allowance-card[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .allowance-card[_ngcontent-%COMP%], .theme-light[_nghost-%COMP%] .allowance-meter[_ngcontent-%COMP%] div[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .allowance-meter[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{background:#ffffffad}.theme-light[_nghost-%COMP%] .pricing-table[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .pricing-table[_ngcontent-%COMP%]{background:var(--surface)}"]})};export{le as PricingPageComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as M,q as p,r as d,s as h,w as U}from"./chunk-
|
|
1
|
+
import{p as M,q as p,r as d,s as h,w as U}from"./chunk-5FL3PHQS.js";import{a as D,b as T}from"./chunk-WOIYAEKB.js";function P(t,r,o,e){let n=O(t,r);return t.filter(s=>{let i=new Date(s.startedAt).getTime();return n.start!==null&&i<n.start||n.end!==null&&i>=n.end||o!=="all"&&s.workspace!==o?!1:e==="all"||s.modelBreakdown.some(u=>u.pricingModel===e||u.model===e)})}function V(t,r){let o=new Map;for(let e of t)for(let n of e.modelBreakdown){let s=`${n.model}::${n.pricingModel}`,i=o.get(s)??{model:n.model,pricingModel:n.pricingModel,turns:0,sessions:new Set,tokens:0,input:0,cachedInput:0,cacheWrite:0,output:0,cost:0};i.turns+=n.turns,i.sessions.add(e.id),i.tokens+=M(n.tokens),i.input+=n.tokens.input,i.cachedInput+=n.tokens.cachedInput,i.cacheWrite+=n.tokens.cacheWrite,i.output+=n.tokens.output,i.cost+=n.cost.usd,o.set(s,i)}return[...o.values()].map(e=>T(D({},e),{sessionCount:e.sessions.size,costPer1k:e.tokens?e.cost/e.tokens*1e3:0,share:r>0?e.cost/r*100:0,usesFallbackPrice:U(e.model,e.pricingModel)})).sort((e,n)=>n.cost-e.cost)}function B(t,r){let o=new Map;for(let e of t){let n=W(e.startedAt,r),s=o.get(n.key)??T(D({},n),{count:0,tokens:0,cost:0,credits:0,topSession:null,topSessionCost:0});s.count+=1,s.tokens+=p(e);let i=d(e);s.cost+=i,s.credits+=h(e),(!s.topSession||i>s.topSessionCost)&&(s.topSession=e,s.topSessionCost=i),o.set(n.key,s)}return[...o.values()].sort((e,n)=>n.key.localeCompare(e.key)).slice(0,8)}function G(t,r){return["Small","Medium","Large","Very large"].map(e=>{let n=t.filter(a=>v(p(a))===e),s=n.reduce((a,c)=>a+p(c),0),i=n.reduce((a,c)=>a+d(c),0),u=n.reduce((a,c)=>a+h(c),0),l=S(n,a=>d(a));return{size:e,count:n.length,tokens:s,cost:i,share:r>0?i/r*100:0,credits:u,topSession:l,topSessionCost:l?d(l):0}})}function E(t,r,o){if(!t.length)return[];let e=F(t.map(s=>d(s))),n=F(t.map(s=>p(s)));return t.map(s=>{let i=p(s),u=e>0?(d(s)-r)/e:0,l=n>0?(i-o)/n:0,a=Math.max(u,l),c=I(s,u,l);return{session:s,tokens:i,score:a,reason:c}}).filter(s=>s.score>=1||t.length<=5).sort((s,i)=>i.score-s.score||d(i.session)-d(s.session)).slice(0,5)}function H(t,r,o=new Date){let e=Number.isFinite(o.getTime())?o:new Date,n=S(t,L=>Date.parse(L.startedAt)||0),s=$(e),i=b(s,1),u=N(e),l=b(s,1),a=R(e),c=Y(e),m=w(t,s,i),g=w(t,u,l),k=w(t,a,c),x=n?z(n.startedAt):null;return[f("last-session","Last session",n?[n]:[],r,n?.title??"No imported sessions",x?y(x):"No imported sessions"),f("today","Today",m,r,"Imported sessions from today",y(s)),f("week","This week",g,r,"Week so far",A(u,b(l,-1))),f("month","Calendar month",k,r,"Current calendar month",A(a,b(c,-1))),f("visible","Selected scope",t,r,"Sessions matching Usage filters","All imported dates in this view")]}function O(t,r){if(r==="all"||!t.length)return{start:null,end:null,anchor:null};let o=Math.max(...t.map(s=>new Date(s.startedAt).getTime()).filter(Number.isFinite));if(!Number.isFinite(o))return{start:null,end:null,anchor:null};let e=new Date(o);if(r==="current-month"||r==="previous-month"){let s=r==="current-month"?0:-1,i=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+s,1)),u=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+s+1,1));return{start:i.getTime(),end:u.getTime(),anchor:e}}return{start:o-(r==="7d"?7:r==="30d"?30:90)*24*60*60*1e3,end:null,anchor:e}}function W(t,r){let o=new Date(t);if(!Number.isFinite(o.getTime()))return{key:"unknown",label:"Unknown date"};let e=C(o);if(r==="day")return{key:e,label:e};if(r==="month")return{key:e.slice(0,7),label:e.slice(0,7)};let n=new Date(Date.UTC(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate())),s=n.getUTCDay()||7;return n.setUTCDate(n.getUTCDate()-s+1),{key:C(n),label:`Week of ${C(n)}`}}function v(t){return t>=15e5?"Very large":t>=5e5?"Large":t>=1e5?"Medium":"Small"}function S(t,r){return t.reduce((o,e)=>!o||r(e)>r(o)?e:o,null)}function I(t,r,o){let e=p(t),n=t.tokens.input+t.tokens.cachedInput+t.tokens.cacheWrite,s=e?n/e*100:0,i=S(t.modelBreakdown,k=>k.cost.usd),u=d(t),l=i&&u>0?i.cost.usd/u*100:0,a=t.traceSummary.modelTurns,c=t.traceSummary.toolCalls,m=a+c;return Math.max(r,o)>=2&&m<=3&&e>=1e5?`Suspicious spike: ${e.toLocaleString()} tokens with only ${m.toLocaleString()} imported model/tool events. Inspect the largest model call and source log shape.`:s>=85&&n>=1e5?`Mostly input/context tokens (${s.toFixed(0)}% of imported tokens). Check prompt context, repo reads, prior conversation, and tool results.`:i&&l>=70?`${i.pricingModel} produced ${l.toFixed(0)}% of this run's estimate. Model mix is the first thing to inspect.`:c>=20?`${c.toLocaleString()} tool calls may have added results back into later model input.`:t.traceSummary.errors===0&&a>=8&&c>=8?`Large but plausible long agent run: ${a.toLocaleString()} model turns and ${c.toLocaleString()} tool calls with no imported errors. Inspect input/context and tool activity before treating it as waste.`:r>=o?`Cost is ${r.toFixed(1)} standard deviations above this cohort. Check model price rows and output mix.`:`Tokens are ${o.toFixed(1)} standard deviations above this cohort. Check input context and model-turn count.`}function f(t,r,o,e,n,s){let i=o.reduce((m,g)=>m+h(g),0),u=o.reduce((m,g)=>m+d(g),0),l=S(o,m=>d(m)),a=o.filter(m=>!m.sourceUsage).length,c=e>0?i/e*100:0;return{id:t,label:r,period:s,credits:i,usd:u,count:o.length,allowanceShare:c,fallbackCount:a,session:l,detail:o.length?`${o.length.toLocaleString()} session${o.length===1?"":"s"}`:n,actionLabel:l?t==="last-session"?"Open run":"Open top run":"No run to open"}}function w(t,r,o){let e=r.getTime(),n=o.getTime();return t.filter(s=>{let i=Date.parse(s.startedAt);return Number.isFinite(i)&&i>=e&&i<n})}function $(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate())}function N(t){let r=t.getDay()||7,o=$(t);return o.setDate(o.getDate()-r+1),o}function R(t){return new Date(t.getFullYear(),t.getMonth(),1)}function Y(t){return new Date(t.getFullYear(),t.getMonth()+1,1)}function b(t,r){let o=new Date(t);return o.setDate(o.getDate()+r),o}function z(t){let r=Date.parse(t);return Number.isFinite(r)?new Date(r):null}function y(t){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(t)}function A(t,r){return t.getFullYear()===r.getFullYear()&&t.getMonth()===r.getMonth()?`${new Intl.DateTimeFormat("en-US",{month:"short"}).format(t)} ${t.getDate()}-${r.getDate()}, ${t.getFullYear()}`:`${y(t)} - ${y(r)}`}function F(t){if(t.length<2)return 0;let r=t.reduce((e,n)=>e+n,0)/t.length,o=t.reduce((e,n)=>e+(n-r)**2,0)/t.length;return Math.sqrt(o)}function C(t){return t.toISOString().slice(0,10)}export{P as a,V as b,B as c,G as d,E as e,H as f,S as g};
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
<style>*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:Aptos,Segoe UI Variable,Segoe UI,Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,sans-serif;font-size:14px;line-height:1.45;background:#090d14;color:#d7dde7;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased}</style><link rel="stylesheet" href="styles-7RDDQXQV.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles-7RDDQXQV.css"></noscript></head>
|
|
10
10
|
<body>
|
|
11
11
|
<app-root></app-root>
|
|
12
|
-
<link rel="modulepreload" href="chunk-OS2XPCVW.js"><link rel="modulepreload" href="chunk-
|
|
12
|
+
<link rel="modulepreload" href="chunk-OS2XPCVW.js"><link rel="modulepreload" href="chunk-5FL3PHQS.js"><link rel="modulepreload" href="chunk-WOIYAEKB.js"><script src="main-GTYMLVSP.js" type="module"></script></body>
|
|
13
13
|
</html>
|