copilot-usage-studio 0.2.0 → 0.2.1
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 +16 -1
- package/README.md +42 -13
- package/data/github-copilot-pricing.json +34 -6
- package/dist/copilot-usage-studio/browser/chunk-2SAR2Q6M.js +1 -0
- package/dist/copilot-usage-studio/browser/chunk-5JYQJM5G.js +1 -0
- package/dist/copilot-usage-studio/browser/chunk-7FKLWMFH.js +1 -0
- package/dist/copilot-usage-studio/browser/chunk-EWN3YOHT.js +1 -0
- package/dist/copilot-usage-studio/browser/{chunk-NXH37FKU.js → chunk-KS5W2HMH.js} +1 -1
- package/dist/copilot-usage-studio/browser/{chunk-TVSYR63W.js → chunk-OS2XPCVW.js} +2 -2
- package/dist/copilot-usage-studio/browser/{chunk-QQOFM3HF.js → chunk-U4H425LY.js} +1 -1
- package/dist/copilot-usage-studio/browser/chunk-VEKXIM47.js +1 -0
- package/dist/copilot-usage-studio/browser/chunk-WOIYAEKB.js +4 -0
- package/dist/copilot-usage-studio/browser/{chunk-J47KKACI.js → chunk-XHID4XVE.js} +1 -1
- package/dist/copilot-usage-studio/browser/index.html +2 -2
- package/dist/copilot-usage-studio/browser/main-OZIMQRXC.js +1 -0
- package/dist/copilot-usage-studio/browser/styles-7RDDQXQV.css +1 -0
- package/docs/local-deployment.md +67 -11
- package/docs/pricing.md +3 -3
- package/docs/scanner-api.md +28 -0
- package/lib/cli.mjs +15 -1
- package/lib/local-runtime.mjs +455 -19
- package/lib/scanner-worker.mjs +25 -0
- package/package.json +17 -1
- package/scripts/pricing-utils.mjs +5 -0
- package/scripts/scan-vscode-sessions.mjs +383 -1475
- package/scripts/scanner-customization-evidence.mjs +576 -0
- package/scripts/scanner-customization-inventory.mjs +1021 -0
- package/scripts/scanner-memory.mjs +229 -0
- package/scripts/scanner-session-parser.mjs +1237 -0
- package/scripts/scanner-traversal.mjs +203 -0
- package/scripts/scanner-workspace.mjs +209 -0
- package/dist/copilot-usage-studio/browser/chunk-CUKTUQ6W.js +0 -1
- package/dist/copilot-usage-studio/browser/chunk-EYAHOEVS.js +0 -1
- package/dist/copilot-usage-studio/browser/chunk-FXNLFSUB.js +0 -1
- package/dist/copilot-usage-studio/browser/chunk-HJNYITFH.js +0 -1
- package/dist/copilot-usage-studio/browser/chunk-KDAJN6DF.js +0 -4
- package/dist/copilot-usage-studio/browser/main-TL27ZSEQ.js +0 -1
- package/dist/copilot-usage-studio/browser/styles-GZOQ5QIH.css +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{A as Q,D as
|
|
2
|
-
`).forEach(r=>{let n=r.indexOf(":");if(n>0){let o=r.slice(0,n),s=r.slice(n+1).trim();this.addHeaderEntry(o,s)}})}:typeof Headers<"u"&&e instanceof Headers?(this.headers=new Map,e.forEach((r,n)=>{this.addHeaderEntry(n,r)})):this.lazyInit=()=>{this.headers=new Map,Object.entries(e).forEach(([r,n])=>{this.setHeaderEntries(r,n)})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();let r=this.headers.get(e.toLowerCase());return r&&r.length>0?r[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,r){return this.clone({name:e,value:r,op:"a"})}set(e,r){return this.clone({name:e,value:r,op:"s"})}delete(e,r){return this.clone({name:e,value:r,op:"d"})}maybeSetNormalizedName(e,r){this.normalizedNames.has(r)||this.normalizedNames.set(r,e)}init(){this.lazyInit&&(this.lazyInit instanceof t?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(r=>{this.headers.set(r,e.headers.get(r)),this.normalizedNames.set(r,e.normalizedNames.get(r))})}clone(e){let r=new t;return r.lazyInit=this.lazyInit&&this.lazyInit instanceof t?this.lazyInit:this,r.lazyUpdate=(this.lazyUpdate||[]).concat([e]),r}applyUpdate(e){let r=e.name.toLowerCase();switch(e.op){case"a":case"s":let n=e.value;if(typeof n=="string"&&(n=[n]),n.length===0)return;this.maybeSetNormalizedName(e.name,r);let o=(e.op==="a"?this.headers.get(r):void 0)||[];o.push(...n),this.headers.set(r,o);break;case"d":let s=e.value;if(!s)this.headers.delete(r),this.normalizedNames.delete(r);else{let i=this.headers.get(r);if(!i)return;i=i.filter(l=>s.indexOf(l)===-1),i.length===0?(this.headers.delete(r),this.normalizedNames.delete(r)):this.headers.set(r,i)}break}}addHeaderEntry(e,r){let n=e.toLowerCase();this.maybeSetNormalizedName(e,n),this.headers.has(n)?this.headers.get(n).push(r):this.headers.set(n,[r])}setHeaderEntries(e,r){let n=(Array.isArray(r)?r:[r]).map(s=>s.toString()),o=e.toLowerCase();this.headers.set(o,n),this.maybeSetNormalizedName(e,o)}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(r=>e(this.normalizedNames.get(r),this.headers.get(r)))}};var L=class{map=new Map;set(e,r){return this.map.set(e,r),this}get(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}delete(e){return this.map.delete(e),this}has(e){return this.map.has(e)}keys(){return this.map.keys()}},S=class{encodeKey(e){return ae(e)}encodeValue(e){return ae(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}};function we(t,e){let r=new Map;return t.length>0&&t.replace(/^\?/,"").split("&").forEach(o=>{let s=o.indexOf("="),[i,l]=s==-1?[e.decodeKey(o),""]:[e.decodeKey(o.slice(0,s)),e.decodeValue(o.slice(s+1))],a=r.get(i)||[];a.push(l),r.set(i,a)}),r}var be=/%(\d[a-f0-9])/gi,Re={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function ae(t){return encodeURIComponent(t).replace(be,(e,r)=>Re[r]??e)}function U(t){return`${t}`}var y=class t{map;encoder;updates=null;cloneFrom=null;constructor(e={}){if(this.encoder=e.encoder||new S,e.fromString){if(e.fromObject)throw new m(2805,!1);this.map=we(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(r=>{let n=e.fromObject[r],o=Array.isArray(n)?n.map(U):[U(n)];this.map.set(r,o)})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();let r=this.map.get(e);return r?r[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,r){return this.clone({param:e,value:r,op:"a"})}appendAll(e){let r=[];return Object.keys(e).forEach(n=>{let o=e[n];Array.isArray(o)?o.forEach(s=>{r.push({param:n,value:s,op:"a"})}):r.push({param:n,value:o,op:"a"})}),this.clone(r)}set(e,r){return this.clone({param:e,value:r,op:"s"})}delete(e,r){return this.clone({param:e,value:r,op:"d"})}toString(){return this.init(),this.keys().map(e=>{let r=this.encoder.encodeKey(e);return this.map.get(e).map(n=>r+"="+this.encoder.encodeValue(n)).join("&")}).filter(e=>e!=="").join("&")}clone(e){let r=new t({encoder:this.encoder});return r.cloneFrom=this.cloneFrom||this,r.updates=(this.updates||[]).concat(e),r}init(){this.map===null&&(this.map=new Map),this.cloneFrom!==null&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":let r=(e.op==="a"?this.map.get(e.param):void 0)||[];r.push(U(e.value)),this.map.set(e.param,r);break;case"d":if(e.value!==void 0){let n=this.map.get(e.param)||[],o=n.indexOf(U(e.value));o!==-1&&n.splice(o,1),n.length>0?this.map.set(e.param,n):this.map.delete(e.param)}else{this.map.delete(e.param);break}}}),this.cloneFrom=this.updates=null)}};function Pe(t){switch(t){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}function ce(t){return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer}function de(t){return typeof Blob<"u"&&t instanceof Blob}function le(t){return typeof FormData<"u"&&t instanceof FormData}function Me(t){return typeof URLSearchParams<"u"&&t instanceof URLSearchParams}var ue="Content-Type",he="Accept",fe="text/plain",pe="application/json",Ne=`${pe}, ${fe}, */*`,M=class t{url;body=null;headers;context;reportProgress=!1;withCredentials=!1;credentials;keepalive=!1;cache;priority;mode;redirect;referrer;integrity;referrerPolicy;responseType="json";method;params;urlWithParams;transferCache;timeout;constructor(e,r,n,o){this.url=r,this.method=e.toUpperCase();let s;if(Pe(this.method)||o?(this.body=n!==void 0?n:null,s=o):s=n,s){if(this.reportProgress=!!s.reportProgress,this.withCredentials=!!s.withCredentials,this.keepalive=!!s.keepalive,s.responseType&&(this.responseType=s.responseType),s.headers&&(this.headers=s.headers),s.context&&(this.context=s.context),s.params&&(this.params=s.params),s.priority&&(this.priority=s.priority),s.cache&&(this.cache=s.cache),s.credentials&&(this.credentials=s.credentials),typeof s.timeout=="number"){if(s.timeout<1||!Number.isInteger(s.timeout))throw new m(2822,"");this.timeout=s.timeout}s.mode&&(this.mode=s.mode),s.redirect&&(this.redirect=s.redirect),s.integrity&&(this.integrity=s.integrity),s.referrer&&(this.referrer=s.referrer),s.referrerPolicy&&(this.referrerPolicy=s.referrerPolicy),this.transferCache=s.transferCache}if(this.headers??=new E,this.context??=new L,!this.params)this.params=new y,this.urlWithParams=r;else{let i=this.params.toString();if(i.length===0)this.urlWithParams=r;else{let l=r.indexOf("?"),a=l===-1?"?":l<r.length-1?"&":"";this.urlWithParams=r+a+i}}}serializeBody(){return this.body===null?null:typeof this.body=="string"||ce(this.body)||de(this.body)||le(this.body)||Me(this.body)?this.body:this.body instanceof y?this.body.toString():typeof this.body=="object"||typeof this.body=="boolean"||Array.isArray(this.body)?JSON.stringify(this.body):this.body.toString()}detectContentTypeHeader(){return this.body===null||le(this.body)?null:de(this.body)?this.body.type||null:ce(this.body)?null:typeof this.body=="string"?fe:this.body instanceof y?"application/x-www-form-urlencoded;charset=UTF-8":typeof this.body=="object"||typeof this.body=="number"||typeof this.body=="boolean"?pe:null}clone(e={}){let r=e.method||this.method,n=e.url||this.url,o=e.responseType||this.responseType,s=e.keepalive??this.keepalive,i=e.priority||this.priority,l=e.cache||this.cache,a=e.mode||this.mode,f=e.redirect||this.redirect,x=e.credentials||this.credentials,w=e.referrer||this.referrer,D=e.integrity||this.integrity,F=e.referrerPolicy||this.referrerPolicy,j=e.transferCache??this.transferCache,C=e.timeout??this.timeout,c=e.body!==void 0?e.body:this.body,d=e.withCredentials??this.withCredentials,p=e.reportProgress??this.reportProgress,P=e.headers||this.headers,u=e.params||this.params,I=e.context??this.context;return e.setHeaders!==void 0&&(P=Object.keys(e.setHeaders).reduce((A,b)=>A.set(b,e.setHeaders[b]),P)),e.setParams&&(u=Object.keys(e.setParams).reduce((A,b)=>A.set(b,e.setParams[b]),u)),new t(r,n,c,{params:u,headers:P,context:I,reportProgress:p,responseType:o,withCredentials:d,transferCache:j,keepalive:s,cache:l,priority:i,timeout:C,mode:a,redirect:f,credentials:x,referrer:w,integrity:D,referrerPolicy:F})}},R=(function(t){return t[t.Sent=0]="Sent",t[t.UploadProgress=1]="UploadProgress",t[t.ResponseHeader=2]="ResponseHeader",t[t.DownloadProgress=3]="DownloadProgress",t[t.Response=4]="Response",t[t.User=5]="User",t})(R||{}),O=class{headers;status;statusText;url;ok;type;redirected;responseType;constructor(e,r=200,n="OK"){this.headers=e.headers||new E,this.status=e.status!==void 0?e.status:r,this.statusText=e.statusText||n,this.url=e.url||null,this.redirected=e.redirected,this.responseType=e.responseType,this.ok=this.status>=200&&this.status<300}},B=class t extends O{constructor(e={}){super(e)}type=R.ResponseHeader;clone(e={}){return new t({headers:e.headers||this.headers,status:e.status!==void 0?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}},_=class t extends O{body;constructor(e={}){super(e),this.body=e.body!==void 0?e.body:null}type=R.Response;clone(e={}){return new t({body:e.body!==void 0?e.body:this.body,headers:e.headers||this.headers,status:e.status!==void 0?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0,redirected:e.redirected??this.redirected,responseType:e.responseType??this.responseType})}},N=class extends O{name="HttpErrorResponse";message;error;ok=!1;constructor(e){super(e,0,"Unknown Error"),this.status>=200&&this.status<300?this.message=`Http failure during parsing for ${e.url||"(unknown url)"}`:this.message=`Http failure response for ${e.url||"(unknown url)"}: ${e.status} ${e.statusText}`,this.error=e.error||null}},Oe=200,De=204;var Ie=new T("");var Ae=/^\)\]\}',?\n/;var V=(()=>{class t{xhrFactory;tracingService=h(ne,{optional:!0});constructor(r){this.xhrFactory=r}maybePropagateTrace(r){return this.tracingService?.propagate?this.tracingService.propagate(r):r}handle(r){if(r.method==="JSONP")throw new m(-2800,!1);let n=this.xhrFactory;return X(null).pipe(Q(()=>new W(s=>{let i=n.build();if(i.open(r.method,r.urlWithParams),r.withCredentials&&(i.withCredentials=!0),r.headers.forEach((c,d)=>i.setRequestHeader(c,d.join(","))),r.headers.has(he)||i.setRequestHeader(he,Ne),!r.headers.has(ue)){let c=r.detectContentTypeHeader();c!==null&&i.setRequestHeader(ue,c)}if(r.timeout&&(i.timeout=r.timeout),r.responseType){let c=r.responseType.toLowerCase();i.responseType=c!=="json"?c:"text"}let l=r.serializeBody(),a=null,f=()=>{if(a!==null)return a;let c=i.statusText||"OK",d=new E(i.getAllResponseHeaders()),p=i.responseURL||r.url;return a=new B({headers:d,status:i.status,statusText:c,url:p}),a},x=this.maybePropagateTrace(()=>{let{headers:c,status:d,statusText:p,url:P}=f(),u=null;d!==De&&(u=typeof i.response>"u"?i.responseText:i.response),d===0&&(d=u?Oe:0);let I=d>=200&&d<300;if(r.responseType==="json"&&typeof u=="string"){let A=u;u=u.replace(Ae,"");try{u=u!==""?JSON.parse(u):null}catch(b){u=A,I&&(I=!1,u={error:b,text:u})}}I?(s.next(new _({body:u,headers:c,status:d,statusText:p,url:P||void 0})),s.complete()):s.error(new N({error:u,headers:c,status:d,statusText:p,url:P||void 0}))}),w=this.maybePropagateTrace(c=>{let{url:d}=f(),p=new N({error:c,status:i.status||0,statusText:i.statusText||"Unknown Error",url:d||void 0});s.error(p)}),D=w;r.timeout&&(D=this.maybePropagateTrace(c=>{let{url:d}=f(),p=new N({error:new DOMException("Request timed out","TimeoutError"),status:i.status||0,statusText:i.statusText||"Request timeout",url:d||void 0});s.error(p)}));let F=!1,j=this.maybePropagateTrace(c=>{F||(s.next(f()),F=!0);let d={type:R.DownloadProgress,loaded:c.loaded};c.lengthComputable&&(d.total=c.total),r.responseType==="text"&&i.responseText&&(d.partialText=i.responseText),s.next(d)}),C=this.maybePropagateTrace(c=>{let d={type:R.UploadProgress,loaded:c.loaded};c.lengthComputable&&(d.total=c.total),s.next(d)});return i.addEventListener("load",x),i.addEventListener("error",w),i.addEventListener("timeout",D),i.addEventListener("abort",w),r.reportProgress&&(i.addEventListener("progress",j),l!==null&&i.upload&&i.upload.addEventListener("progress",C)),i.send(l),s.next({type:R.Sent}),()=>{i.removeEventListener("error",w),i.removeEventListener("abort",w),i.removeEventListener("load",x),i.removeEventListener("timeout",D),r.reportProgress&&(i.removeEventListener("progress",j),l!==null&&i.upload&&i.upload.removeEventListener("progress",C)),i.readyState!==i.DONE&&i.abort()}})))}static \u0275fac=function(n){return new(n||t)(v(ie))};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function ke(t,e){return e(t)}function _e(t,e,r){return(n,o)=>ee(r,()=>e(n,s=>t(s,o)))}var ye=new T("",{factory:()=>[]}),me=new T(""),ge=new T("",{factory:()=>!0});var G=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:function(n){let o=null;return n?o=new(n||t):o=v(V),o},providedIn:"root"})}return t})();var z=(()=>{class t{backend;injector;chain=null;pendingTasks=h(te);contributeToStability=h(ge);constructor(r,n){this.backend=r,this.injector=n}handle(r){if(this.chain===null){let n=Array.from(new Set([...this.injector.get(ye),...this.injector.get(me,[])]));this.chain=n.reduceRight((o,s)=>_e(o,s,this.injector),ke)}if(this.contributeToStability){let n=this.pendingTasks.add();return this.chain(r,o=>this.backend.handle(o)).pipe(Z(n))}else return this.chain(r,n=>this.backend.handle(n))}static \u0275fac=function(n){return new(n||t)(v(G),v(J))};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),K=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:function(n){let o=null;return n?o=new(n||t):o=v(z),o},providedIn:"root"})}return t})();function $(t,e){return{body:e,headers:t.headers,context:t.context,observe:t.observe,params:t.params,reportProgress:t.reportProgress,responseType:t.responseType,withCredentials:t.withCredentials,credentials:t.credentials,transferCache:t.transferCache,timeout:t.timeout,keepalive:t.keepalive,priority:t.priority,cache:t.cache,mode:t.mode,redirect:t.redirect,integrity:t.integrity,referrer:t.referrer,referrerPolicy:t.referrerPolicy}}var Te=(()=>{class t{handler;constructor(r){this.handler=r}request(r,n,o={}){let s;if(r instanceof M)s=r;else{let a;o.headers instanceof E?a=o.headers:a=new E(o.headers);let f;o.params&&(o.params instanceof y?f=o.params:f=new y({fromObject:o.params})),s=new M(r,n,o.body!==void 0?o.body:null,{headers:a,context:o.context,params:f,reportProgress:o.reportProgress,responseType:o.responseType||"json",withCredentials:o.withCredentials,transferCache:o.transferCache,keepalive:o.keepalive,priority:o.priority,cache:o.cache,mode:o.mode,redirect:o.redirect,credentials:o.credentials,referrer:o.referrer,referrerPolicy:o.referrerPolicy,integrity:o.integrity,timeout:o.timeout})}let i=X(s).pipe(q(a=>this.handler.handle(a)));if(r instanceof M||o.observe==="events")return i;let l=i.pipe(Y(a=>a instanceof _));switch(o.observe||"body"){case"body":switch(s.responseType){case"arraybuffer":return l.pipe(k(a=>{if(a.body!==null&&!(a.body instanceof ArrayBuffer))throw new m(2806,!1);return a.body}));case"blob":return l.pipe(k(a=>{if(a.body!==null&&!(a.body instanceof Blob))throw new m(2807,!1);return a.body}));case"text":return l.pipe(k(a=>{if(a.body!==null&&typeof a.body!="string")throw new m(2808,!1);return a.body}));default:return l.pipe(k(a=>a.body))}case"response":return l;default:throw new m(2809,!1)}}delete(r,n={}){return this.request("DELETE",r,n)}get(r,n={}){return this.request("GET",r,n)}head(r,n={}){return this.request("HEAD",r,n)}jsonp(r,n){return this.request("JSONP",r,{params:new y().append(n,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(r,n={}){return this.request("OPTIONS",r,n)}patch(r,n,o={}){return this.request("PATCH",r,$(o,n))}post(r,n,o={}){return this.request("POST",r,$(o,n))}put(r,n,o={}){return this.request("PUT",r,$(o,n))}static \u0275fac=function(n){return new(n||t)(v(K))};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var xe=new T("",{factory:()=>!0}),Fe="XSRF-TOKEN",je=new T("",{factory:()=>Fe}),Ce="X-XSRF-TOKEN",Ue=new T("",{factory:()=>Ce}),Le=(()=>{class t{cookieName=h(je);doc=h(re);lastCookieString="";lastToken=null;parseCount=0;getToken(){let r=this.doc.cookie||"";return r!==this.lastCookieString&&(this.parseCount++,this.lastToken=se(r,this.cookieName),this.lastCookieString=r),this.lastToken}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),ve=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:function(n){let o=null;return n?o=new(n||t):o=v(Le),o},providedIn:"root"})}return t})();function Se(t,e){if(!h(xe)||t.method==="GET"||t.method==="HEAD")return e(t);try{let o=h(oe).href,{origin:s}=new URL(o),{origin:i}=new URL(t.url,s);if(s!==i)return e(t)}catch{return e(t)}let r=h(ve).getToken(),n=h(Ue);return r!=null&&!t.headers.has(n)&&(t=t.clone({headers:t.headers.set(n,r)})),e(t)}function Be(...t){let e=[Te,z,{provide:K,useExisting:z},{provide:G,useFactory:()=>h(Ie,{optional:!0})??h(V)},{provide:ye,useValue:Se,multi:!0}];for(let r of t)e.push(...r.\u0275providers);return H(e)}export{Te as a,Be as b};
|
|
1
|
+
import{A as Q,D as g,F as m,H as T,I as v,J as h,K as H,M as J,N as ee,R as re,_ as te,e as K,j as X,kb as oe,n as _,na as ne,pb as se,qb as ie,s as Y,u as q,w as Z}from"./chunk-WOIYAEKB.js";var w=class t{headers;normalizedNames=new Map;lazyInit;lazyUpdate=null;constructor(e){e?typeof e=="string"?this.lazyInit=()=>{this.headers=new Map,e.split(`
|
|
2
|
+
`).forEach(r=>{let n=r.indexOf(":");if(n>0){let o=r.slice(0,n),s=r.slice(n+1).trim();this.addHeaderEntry(o,s)}})}:typeof Headers<"u"&&e instanceof Headers?(this.headers=new Map,e.forEach((r,n)=>{this.addHeaderEntry(n,r)})):this.lazyInit=()=>{this.headers=new Map,Object.entries(e).forEach(([r,n])=>{this.setHeaderEntries(r,n)})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();let r=this.headers.get(e.toLowerCase());return r&&r.length>0?r[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,r){return this.clone({name:e,value:r,op:"a"})}set(e,r){return this.clone({name:e,value:r,op:"s"})}delete(e,r){return this.clone({name:e,value:r,op:"d"})}maybeSetNormalizedName(e,r){this.normalizedNames.has(r)||this.normalizedNames.set(r,e)}init(){this.lazyInit&&(this.lazyInit instanceof t?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(r=>{this.headers.set(r,e.headers.get(r)),this.normalizedNames.set(r,e.normalizedNames.get(r))})}clone(e){let r=new t;return r.lazyInit=this.lazyInit&&this.lazyInit instanceof t?this.lazyInit:this,r.lazyUpdate=(this.lazyUpdate||[]).concat([e]),r}applyUpdate(e){let r=e.name.toLowerCase();switch(e.op){case"a":case"s":let n=e.value;if(typeof n=="string"&&(n=[n]),n.length===0)return;this.maybeSetNormalizedName(e.name,r);let o=(e.op==="a"?this.headers.get(r):void 0)||[];o.push(...n),this.headers.set(r,o);break;case"d":let s=e.value;if(!s)this.headers.delete(r),this.normalizedNames.delete(r);else{let i=this.headers.get(r);if(!i)return;i=i.filter(l=>s.indexOf(l)===-1),i.length===0?(this.headers.delete(r),this.normalizedNames.delete(r)):this.headers.set(r,i)}break}}addHeaderEntry(e,r){let n=e.toLowerCase();this.maybeSetNormalizedName(e,n),this.headers.has(n)?this.headers.get(n).push(r):this.headers.set(n,[r])}setHeaderEntries(e,r){let n=(Array.isArray(r)?r:[r]).map(s=>s.toString()),o=e.toLowerCase();this.headers.set(o,n),this.maybeSetNormalizedName(e,o)}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(r=>e(this.normalizedNames.get(r),this.headers.get(r)))}};var L=class{map=new Map;set(e,r){return this.map.set(e,r),this}get(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}delete(e){return this.map.delete(e),this}has(e){return this.map.has(e)}keys(){return this.map.keys()}},S=class{encodeKey(e){return ae(e)}encodeValue(e){return ae(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}};function be(t,e){let r=new Map;return t.length>0&&t.replace(/^\?/,"").split("&").forEach(o=>{let s=o.indexOf("="),[i,l]=s==-1?[e.decodeKey(o),""]:[e.decodeKey(o.slice(0,s)),e.decodeValue(o.slice(s+1))],a=r.get(i)||[];a.push(l),r.set(i,a)}),r}var Re=/%(\d[a-f0-9])/gi,Pe={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function ae(t){return encodeURIComponent(t).replace(Re,(e,r)=>Pe[r]??e)}function j(t){return`${t}`}var y=class t{map;encoder;updates=null;cloneFrom=null;constructor(e={}){if(this.encoder=e.encoder||new S,e.fromString){if(e.fromObject)throw new g(2805,!1);this.map=be(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(r=>{let n=e.fromObject[r],o=Array.isArray(n)?n.map(j):[j(n)];this.map.set(r,o)})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();let r=this.map.get(e);return r?r[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,r){return this.clone({param:e,value:r,op:"a"})}appendAll(e){let r=[];return Object.keys(e).forEach(n=>{let o=e[n];Array.isArray(o)?o.forEach(s=>{r.push({param:n,value:s,op:"a"})}):r.push({param:n,value:o,op:"a"})}),this.clone(r)}set(e,r){return this.clone({param:e,value:r,op:"s"})}delete(e,r){return this.clone({param:e,value:r,op:"d"})}toString(){return this.init(),this.keys().map(e=>{let r=this.encoder.encodeKey(e);return this.map.get(e).map(n=>r+"="+this.encoder.encodeValue(n)).join("&")}).filter(e=>e!=="").join("&")}clone(e){let r=new t({encoder:this.encoder});return r.cloneFrom=this.cloneFrom||this,r.updates=(this.updates||[]).concat(e),r}init(){this.map===null&&(this.map=new Map),this.cloneFrom!==null&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":let r=(e.op==="a"?this.map.get(e.param):void 0)||[];r.push(j(e.value)),this.map.set(e.param,r);break;case"d":if(e.value!==void 0){let n=this.map.get(e.param)||[],o=n.indexOf(j(e.value));o!==-1&&n.splice(o,1),n.length>0?this.map.set(e.param,n):this.map.delete(e.param)}else{this.map.delete(e.param);break}}}),this.cloneFrom=this.updates=null)}};function Me(t){switch(t){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}function ce(t){return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer}function de(t){return typeof Blob<"u"&&t instanceof Blob}function le(t){return typeof FormData<"u"&&t instanceof FormData}function Ne(t){return typeof URLSearchParams<"u"&&t instanceof URLSearchParams}var ue="Content-Type",he="Accept",fe="text/plain",pe="application/json",Oe=`${pe}, ${fe}, */*`,M=class t{url;body=null;headers;context;reportProgress=!1;withCredentials=!1;credentials;keepalive=!1;cache;priority;mode;redirect;referrer;integrity;referrerPolicy;responseType="json";method;params;urlWithParams;transferCache;timeout;constructor(e,r,n,o){this.url=r,this.method=e.toUpperCase();let s;if(Me(this.method)||o?(this.body=n!==void 0?n:null,s=o):s=n,s){if(this.reportProgress=!!s.reportProgress,this.withCredentials=!!s.withCredentials,this.keepalive=!!s.keepalive,s.responseType&&(this.responseType=s.responseType),s.headers&&(this.headers=s.headers),s.context&&(this.context=s.context),s.params&&(this.params=s.params),s.priority&&(this.priority=s.priority),s.cache&&(this.cache=s.cache),s.credentials&&(this.credentials=s.credentials),typeof s.timeout=="number"){if(s.timeout<1||!Number.isInteger(s.timeout))throw new g(2822,"");this.timeout=s.timeout}s.mode&&(this.mode=s.mode),s.redirect&&(this.redirect=s.redirect),s.integrity&&(this.integrity=s.integrity),s.referrer&&(this.referrer=s.referrer),s.referrerPolicy&&(this.referrerPolicy=s.referrerPolicy),this.transferCache=s.transferCache}if(this.headers??=new w,this.context??=new L,!this.params)this.params=new y,this.urlWithParams=r;else{let i=this.params.toString();if(i.length===0)this.urlWithParams=r;else{let l=r.indexOf("?"),a=l===-1?"?":l<r.length-1?"&":"";this.urlWithParams=r+a+i}}}serializeBody(){return this.body===null?null:typeof this.body=="string"||ce(this.body)||de(this.body)||le(this.body)||Ne(this.body)?this.body:this.body instanceof y?this.body.toString():typeof this.body=="object"||typeof this.body=="boolean"||Array.isArray(this.body)?JSON.stringify(this.body):this.body.toString()}detectContentTypeHeader(){return this.body===null||le(this.body)?null:de(this.body)?this.body.type||null:ce(this.body)?null:typeof this.body=="string"?fe:this.body instanceof y?"application/x-www-form-urlencoded;charset=UTF-8":typeof this.body=="object"||typeof this.body=="number"||typeof this.body=="boolean"?pe:null}clone(e={}){let r=e.method||this.method,n=e.url||this.url,o=e.responseType||this.responseType,s=e.keepalive??this.keepalive,i=e.priority||this.priority,l=e.cache||this.cache,a=e.mode||this.mode,f=e.redirect||this.redirect,x=e.credentials||this.credentials,E=e.referrer||this.referrer,D=e.integrity||this.integrity,F=e.referrerPolicy||this.referrerPolicy,C=e.transferCache??this.transferCache,U=e.timeout??this.timeout,c=e.body!==void 0?e.body:this.body,d=e.withCredentials??this.withCredentials,p=e.reportProgress??this.reportProgress,P=e.headers||this.headers,u=e.params||this.params,I=e.context??this.context;return e.setHeaders!==void 0&&(P=Object.keys(e.setHeaders).reduce((A,b)=>A.set(b,e.setHeaders[b]),P)),e.setParams&&(u=Object.keys(e.setParams).reduce((A,b)=>A.set(b,e.setParams[b]),u)),new t(r,n,c,{params:u,headers:P,context:I,reportProgress:p,responseType:o,withCredentials:d,transferCache:C,keepalive:s,cache:l,priority:i,timeout:U,mode:a,redirect:f,credentials:x,referrer:E,integrity:D,referrerPolicy:F})}},R=(function(t){return t[t.Sent=0]="Sent",t[t.UploadProgress=1]="UploadProgress",t[t.ResponseHeader=2]="ResponseHeader",t[t.DownloadProgress=3]="DownloadProgress",t[t.Response=4]="Response",t[t.User=5]="User",t})(R||{}),O=class{headers;status;statusText;url;ok;type;redirected;responseType;constructor(e,r=200,n="OK"){this.headers=e.headers||new w,this.status=e.status!==void 0?e.status:r,this.statusText=e.statusText||n,this.url=e.url||null,this.redirected=e.redirected,this.responseType=e.responseType,this.ok=this.status>=200&&this.status<300}},B=class t extends O{constructor(e={}){super(e)}type=R.ResponseHeader;clone(e={}){return new t({headers:e.headers||this.headers,status:e.status!==void 0?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}},k=class t extends O{body;constructor(e={}){super(e),this.body=e.body!==void 0?e.body:null}type=R.Response;clone(e={}){return new t({body:e.body!==void 0?e.body:this.body,headers:e.headers||this.headers,status:e.status!==void 0?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0,redirected:e.redirected??this.redirected,responseType:e.responseType??this.responseType})}},N=class extends O{name="HttpErrorResponse";message;error;ok=!1;constructor(e){super(e,0,"Unknown Error"),this.status>=200&&this.status<300?this.message=`Http failure during parsing for ${e.url||"(unknown url)"}`:this.message=`Http failure response for ${e.url||"(unknown url)"}: ${e.status} ${e.statusText}`,this.error=e.error||null}},De=200,Ie=204;var Ae=new T("");var _e=/^\)\]\}',?\n/;var V=(()=>{class t{xhrFactory;tracingService=h(ne,{optional:!0});constructor(r){this.xhrFactory=r}maybePropagateTrace(r){return this.tracingService?.propagate?this.tracingService.propagate(r):r}handle(r){if(r.method==="JSONP")throw new g(-2800,!1);let n=this.xhrFactory;return X(null).pipe(Q(()=>new K(s=>{let i=n.build();if(i.open(r.method,r.urlWithParams),r.withCredentials&&(i.withCredentials=!0),r.headers.forEach((c,d)=>i.setRequestHeader(c,d.join(","))),r.headers.has(he)||i.setRequestHeader(he,Oe),!r.headers.has(ue)){let c=r.detectContentTypeHeader();c!==null&&i.setRequestHeader(ue,c)}if(r.timeout&&(i.timeout=r.timeout),r.responseType){let c=r.responseType.toLowerCase();i.responseType=c!=="json"?c:"text"}let l=r.serializeBody(),a=null,f=()=>{if(a!==null)return a;let c=i.statusText||"OK",d=new w(i.getAllResponseHeaders()),p=i.responseURL||r.url;return a=new B({headers:d,status:i.status,statusText:c,url:p}),a},x=this.maybePropagateTrace(()=>{let{headers:c,status:d,statusText:p,url:P}=f(),u=null;d!==Ie&&(u=typeof i.response>"u"?i.responseText:i.response),d===0&&(d=u?De:0);let I=d>=200&&d<300;if(r.responseType==="json"&&typeof u=="string"){let A=u;u=u.replace(_e,"");try{u=u!==""?JSON.parse(u):null}catch(b){u=A,I&&(I=!1,u={error:b,text:u})}}I?(s.next(new k({body:u,headers:c,status:d,statusText:p,url:P||void 0})),s.complete()):s.error(new N({error:u,headers:c,status:d,statusText:p,url:P||void 0}))}),E=this.maybePropagateTrace(c=>{let{url:d}=f(),p=new N({error:c,status:i.status||0,statusText:i.statusText||"Unknown Error",url:d||void 0});s.error(p)}),D=E;r.timeout&&(D=this.maybePropagateTrace(c=>{let{url:d}=f(),p=new N({error:new DOMException("Request timed out","TimeoutError"),status:i.status||0,statusText:i.statusText||"Request timeout",url:d||void 0});s.error(p)}));let F=!1,C=this.maybePropagateTrace(c=>{F||(s.next(f()),F=!0);let d={type:R.DownloadProgress,loaded:c.loaded};c.lengthComputable&&(d.total=c.total),r.responseType==="text"&&i.responseText&&(d.partialText=i.responseText),s.next(d)}),U=this.maybePropagateTrace(c=>{let d={type:R.UploadProgress,loaded:c.loaded};c.lengthComputable&&(d.total=c.total),s.next(d)});return i.addEventListener("load",x),i.addEventListener("error",E),i.addEventListener("timeout",D),i.addEventListener("abort",E),r.reportProgress&&(i.addEventListener("progress",C),l!==null&&i.upload&&i.upload.addEventListener("progress",U)),i.send(l),s.next({type:R.Sent}),()=>{i.removeEventListener("error",E),i.removeEventListener("abort",E),i.removeEventListener("load",x),i.removeEventListener("timeout",D),r.reportProgress&&(i.removeEventListener("progress",C),l!==null&&i.upload&&i.upload.removeEventListener("progress",U)),i.readyState!==i.DONE&&i.abort()}})))}static \u0275fac=function(n){return new(n||t)(v(ie))};static \u0275prov=m({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function ke(t,e){return e(t)}function xe(t,e,r){return(n,o)=>ee(r,()=>e(n,s=>t(s,o)))}var ye=new T("",{factory:()=>[]}),ge=new T(""),me=new T("",{factory:()=>!0});var G=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275prov=m({token:t,factory:function(n){let o=null;return n?o=new(n||t):o=v(V),o},providedIn:"root"})}return t})();var z=(()=>{class t{backend;injector;chain=null;pendingTasks=h(te);contributeToStability=h(me);constructor(r,n){this.backend=r,this.injector=n}handle(r){if(this.chain===null){let n=Array.from(new Set([...this.injector.get(ye),...this.injector.get(ge,[])]));this.chain=n.reduceRight((o,s)=>xe(o,s,this.injector),ke)}if(this.contributeToStability){let n=this.pendingTasks.add();return this.chain(r,o=>this.backend.handle(o)).pipe(Z(n))}else return this.chain(r,n=>this.backend.handle(n))}static \u0275fac=function(n){return new(n||t)(v(G),v(J))};static \u0275prov=m({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),W=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275prov=m({token:t,factory:function(n){let o=null;return n?o=new(n||t):o=v(z),o},providedIn:"root"})}return t})();function $(t,e){return{body:e,headers:t.headers,context:t.context,observe:t.observe,params:t.params,reportProgress:t.reportProgress,responseType:t.responseType,withCredentials:t.withCredentials,credentials:t.credentials,transferCache:t.transferCache,timeout:t.timeout,keepalive:t.keepalive,priority:t.priority,cache:t.cache,mode:t.mode,redirect:t.redirect,integrity:t.integrity,referrer:t.referrer,referrerPolicy:t.referrerPolicy}}var Te=(()=>{class t{handler;constructor(r){this.handler=r}request(r,n,o={}){let s;if(r instanceof M)s=r;else{let a;o.headers instanceof w?a=o.headers:a=new w(o.headers);let f;o.params&&(o.params instanceof y?f=o.params:f=new y({fromObject:o.params})),s=new M(r,n,o.body!==void 0?o.body:null,{headers:a,context:o.context,params:f,reportProgress:o.reportProgress,responseType:o.responseType||"json",withCredentials:o.withCredentials,transferCache:o.transferCache,keepalive:o.keepalive,priority:o.priority,cache:o.cache,mode:o.mode,redirect:o.redirect,credentials:o.credentials,referrer:o.referrer,referrerPolicy:o.referrerPolicy,integrity:o.integrity,timeout:o.timeout})}let i=X(s).pipe(q(a=>this.handler.handle(a)));if(r instanceof M||o.observe==="events")return i;let l=i.pipe(Y(a=>a instanceof k));switch(o.observe||"body"){case"body":switch(s.responseType){case"arraybuffer":return l.pipe(_(a=>{if(a.body!==null&&!(a.body instanceof ArrayBuffer))throw new g(2806,!1);return a.body}));case"blob":return l.pipe(_(a=>{if(a.body!==null&&!(a.body instanceof Blob))throw new g(2807,!1);return a.body}));case"text":return l.pipe(_(a=>{if(a.body!==null&&typeof a.body!="string")throw new g(2808,!1);return a.body}));default:return l.pipe(_(a=>a.body))}case"response":return l;default:throw new g(2809,!1)}}delete(r,n={}){return this.request("DELETE",r,n)}get(r,n={}){return this.request("GET",r,n)}head(r,n={}){return this.request("HEAD",r,n)}jsonp(r,n){return this.request("JSONP",r,{params:new y().append(n,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(r,n={}){return this.request("OPTIONS",r,n)}patch(r,n,o={}){return this.request("PATCH",r,$(o,n))}post(r,n,o={}){return this.request("POST",r,$(o,n))}put(r,n,o={}){return this.request("PUT",r,$(o,n))}static \u0275fac=function(n){return new(n||t)(v(W))};static \u0275prov=m({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var Fe=new T("",{factory:()=>!0}),Ce="XSRF-TOKEN",Ue=new T("",{factory:()=>Ce}),je="X-XSRF-TOKEN",Le=new T("",{factory:()=>je}),Se=(()=>{class t{cookieName=h(Ue);doc=h(re);lastCookieString="";lastToken=null;parseCount=0;getToken(){let r=this.doc.cookie||"";return r!==this.lastCookieString&&(this.parseCount++,this.lastToken=se(r,this.cookieName),this.lastCookieString=r),this.lastToken}static \u0275fac=function(n){return new(n||t)};static \u0275prov=m({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),ve=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275prov=m({token:t,factory:function(n){let o=null;return n?o=new(n||t):o=v(Se),o},providedIn:"root"})}return t})();function Be(t,e){if(!h(Fe)||t.method==="GET"||t.method==="HEAD")return e(t);try{let o=h(oe).href,{origin:s}=new URL(o),{origin:i}=new URL(t.url,s);if(s!==i)return e(t)}catch{return e(t)}let r=h(ve).getToken(),n=h(Le);return r!=null&&!t.headers.has(n)&&(t=t.clone({headers:t.headers.set(n,r)})),e(t)}function ze(...t){let e=[Te,z,{provide:W,useExisting:z},{provide:G,useFactory:()=>h(Ae,{optional:!0})??h(V)},{provide:ye,useValue:Be,multi:!0}];for(let r of t)e.push(...r.\u0275providers);return H(e)}function we(){return globalThis.window?.__COPILOT_USAGE_STUDIO_HOST__??{}}function Ir(t){let e=we().apiBaseUrl?.replace(/\/+$/,"")??"",r=t.startsWith("/")?t:`/${t}`;return`${e}${r}`}function Ar(t){let e=we().allowedViews;return Array.isArray(e)&&e.length?e:t}export{Te as a,ze as b,we as c,Ir as d,Ar as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as K,o as X,p as L,q as G,r as w,v as S,w as Y,x as j}from"./chunk-FXNLFSUB.js";import{$a as _,Ba as W,Ca as x,Da as h,Fa as T,Ga as E,Ha as A,Ia as a,Ja as o,Ka as Q,Na as F,O as U,P as D,Pa as O,Ra as u,Ta as y,U as z,Ua as c,Va as f,Wa as k,Xa as C,Ya as V,Z as B,Za as m,_a as b,cb as v,ka as s,lb as H,nb as J,rb as Z,sa as q,sb as ee,tb as te,ub as ne,yb as ie}from"./chunk-KDAJN6DF.js";var re=(r,t)=>t.id,ae=(r,t)=>t.label,se=(r,t)=>t.title,ce=(r,t)=>t.model+t.pricingModel;function le(r,t){if(r&1){let e=F();a(0,"button",12),O("click",function(){U(e);let i=u();return D(i.openBaselinePicker())}),a(1,"strong"),c(2),o(),a(3,"em"),c(4),m(5,"number"),o()()}if(r&2){let e=t,n=u();s(2),f(e.title),s(2),C("",n.compactDate(e.startedAt)," \xB7 $",_(5,3,n.usageUsd(e),"1.2-4"))}}function pe(r,t){r&1&&(a(0,"em",15),c(1,"Same prompt as B"),o())}function de(r,t){if(r&1&&(a(0,"em",16),c(1),m(2,"number"),o()),r&2){let e=u().$implicit,n=u(2);s(),k("",b(2,1,n.promptRepeatCount(e))," matching prompts")}}function me(r,t){if(r&1){let e=F();a(0,"button",14),O("click",function(){let i=U(e).$implicit,l=u(2);return D(l.setCompareA(i.id))}),a(1,"strong"),c(2),o(),a(3,"span"),c(4),m(5,"number"),m(6,"number"),o(),x(7,pe,2,0,"em",15)(8,de,3,3,"em",16),o()}if(r&2){let e=t.$implicit,n=u(2);y("active",e.id===n.selectedAId())("same-prompt",n.isSamePromptAsOther(e,"baseline")),W("aria-selected",e.id===n.selectedAId()),s(2),f(e.title),s(2),V(" ",n.compactDate(e.startedAt)," \xB7 $",_(5,10,n.usageUsd(e),"1.2-4")," \xB7 ",b(6,13,n.runTokenTotal(e))," tokens "),s(3),h(n.isSamePromptAsOther(e,"baseline")?7:n.promptRepeatCount(e)>1?8:-1)}}function ue(r,t){r&1&&(a(0,"em"),c(1,"No matching runs"),o())}function ge(r,t){if(r&1&&(a(0,"div",7),T(1,me,9,15,"button",13,re,!1,ue,2,0,"em"),o()),r&2){let e=u();s(),E(e.baselineOptions().slice(0,8))}}function Ce(r,t){if(r&1){let e=F();a(0,"button",17),O("click",function(){U(e);let i=u();return D(i.openCandidatePicker())}),a(1,"strong"),c(2),o(),a(3,"em"),c(4),m(5,"number"),o()()}if(r&2){let e=t,n=u();s(2),f(e.title),s(2),C("",n.compactDate(e.startedAt)," \xB7 $",_(5,3,n.usageUsd(e),"1.2-4"))}}function _e(r,t){r&1&&(a(0,"em",15),c(1,"Same prompt as A"),o())}function xe(r,t){if(r&1&&(a(0,"em",16),c(1),m(2,"number"),o()),r&2){let e=u().$implicit,n=u(2);s(),k("",b(2,1,n.promptRepeatCount(e))," matching prompts")}}function he(r,t){if(r&1){let e=F();a(0,"button",14),O("click",function(){let i=U(e).$implicit,l=u(2);return D(l.setCompareB(i.id))}),a(1,"strong"),c(2),o(),a(3,"span"),c(4),m(5,"number"),m(6,"number"),o(),x(7,_e,2,0,"em",15)(8,xe,3,3,"em",16),o()}if(r&2){let e=t.$implicit,n=u(2);y("active",e.id===n.selectedBId())("same-prompt",n.isSamePromptAsOther(e,"candidate")),W("aria-selected",e.id===n.selectedBId()),s(2),f(e.title),s(2),V(" ",n.compactDate(e.startedAt)," \xB7 $",_(5,10,n.usageUsd(e),"1.2-4")," \xB7 ",b(6,13,n.runTokenTotal(e))," tokens "),s(3),h(n.isSamePromptAsOther(e,"candidate")?7:n.promptRepeatCount(e)>1?8:-1)}}function be(r,t){r&1&&(a(0,"em"),c(1,"No matching runs"),o())}function fe(r,t){if(r&1&&(a(0,"div",10),T(1,he,9,15,"button",13,re,!1,be,2,0,"em"),o()),r&2){let e=u();s(),E(e.candidateOptions().slice(0,8))}}function ve(r,t){r&1&&(a(0,"p",19),c(1,"These first prompts differ, so read this as run comparison rather than prompt A/B testing."),o())}function Pe(r,t){if(r&1&&(a(0,"strong"),c(1),m(2,"number"),o(),a(3,"em"),c(4),m(5,"number"),m(6,"number"),o()),r&2){let e=u().$implicit,n=u(2);y("saving",e.lowerIsBetter&&e.delta<0),s(),C(" ",e.delta<0?"-":"+","$",_(2,6,n.abs(e.delta),"1.2-4")," "),s(3),C("A $",_(5,9,e.a,"1.2-4")," / B $",_(6,12,e.b,"1.2-4"))}}function Me(r,t){if(r&1&&(c(0),m(1,"number")),r&2){let e=u(2).$implicit;C(" \xB7 ",e.percent>=0?"+":"","",_(1,2,e.percent,"1.0-0"),"% ")}}function Oe(r,t){if(r&1&&(a(0,"strong"),c(1),m(2,"number"),o(),a(3,"em"),c(4),m(5,"number"),m(6,"number"),x(7,Me,2,5),o()),r&2){let e=u().$implicit;y("saving",e.lowerIsBetter&&e.delta<0),s(),C(" ",e.delta>=0?"+":"","",b(2,7,e.delta)," "),s(3),C(" A ",b(5,9,e.a)," / B ",b(6,11,e.b)," "),s(3),h(e.percent!==null?7:-1)}}function ye(r,t){if(r&1&&(a(0,"div")(1,"span"),c(2),Q(3,"app-help-popover",29),o(),x(4,Pe,7,15)(5,Oe,8,13),o()),r&2){let e=t.$implicit;s(2),k(" ",e.label," "),s(),A("text",e.help)("label","Explain "+e.label),s(),h(e.format==="currency"?4:5)}}function ke(r,t){if(r&1&&(a(0,"article",24)(1,"div")(2,"span"),c(3),o(),a(4,"strong"),c(5),o()(),a(6,"p"),c(7),o()()),r&2){let e=t.$implicit;A("ngClass",e.tone),s(3),f(e.title),s(2),f(e.value),s(2),f(e.detail)}}function we(r,t){if(r&1&&(a(0,"em",30),c(1," fallback pricing "),Q(2,"app-help-popover",32),o()),r&2){let e=u().$implicit,n=u(2);s(2),A("text",n.pricingFallbackReason(e.model,e.pricingModel))}}function Se(r,t){if(r&1&&(a(0,"em"),c(1),o()),r&2){let e=u().$implicit,n=u(2);s(),k("write ",n.tokenDeltaLabel(e.cacheWriteDelta))}}function Be(r,t){if(r&1&&(a(0,"div",28)(1,"strong"),c(2),o(),a(3,"span"),c(4),x(5,we,3,1,"em",30),o(),a(6,"span"),c(7),m(8,"number"),m(9,"number"),o(),a(10,"span",31)(11,"strong"),c(12),m(13,"number"),o(),a(14,"em"),c(15),o(),x(16,Se,2,1,"em"),a(17,"em"),c(18),o()(),a(19,"span"),c(20),m(21,"number"),m(22,"number"),o(),a(23,"span"),c(24),m(25,"number"),o()()),r&2){let e=t.$implicit,n=u(2);s(2),f(e.model),s(2),k(" ",e.pricingModel," "),s(),h(e.usesFallbackPrice?5:-1),s(2),C("$",_(8,17,e.aCost,"1.4-6")," / $",_(9,20,e.bCost,"1.4-6")),s(5),C("",e.tokenDelta>=0?"+":"","",b(13,23,e.tokenDelta)),s(3),C(" normal ",n.tokenDeltaLabel(e.inputDelta)," \xB7 cached ",n.tokenDeltaLabel(e.cachedInputDelta)," "),s(),h(e.cacheWriteDelta?16:-1),s(2),k("out ",n.tokenDeltaLabel(e.outputDelta)),s(2),C("",b(21,25,e.aTurns)," / ",b(22,27,e.bTurns)),s(3),y("saving",e.costDelta<0),s(),C(" ",e.costDelta<0?"-":"+","$",_(25,29,n.abs(e.costDelta),"1.4-4")," ")}}function Ie(r,t){if(r&1&&(a(0,"div",18)(1,"div")(2,"span"),c(3),o(),a(4,"strong"),c(5),m(6,"number"),o(),a(7,"p"),c(8),o(),x(9,ve,2,0,"p",19),o(),a(10,"dl")(11,"div")(12,"dt"),c(13,"A"),o(),a(14,"dd"),c(15),m(16,"number"),o()(),a(17,"div")(18,"dt"),c(19,"B"),o(),a(20,"dd"),c(21),m(22,"number"),o()(),a(23,"div")(24,"dt"),c(25,"Tokens"),o(),a(26,"dd"),c(27),m(28,"number"),o()()()(),a(29,"div",20),T(30,ye,6,4,"div",null,ae),o(),a(32,"section",21)(33,"div",22)(34,"h3"),c(35,"What changed"),o()(),a(36,"div",23),T(37,ke,8,4,"article",24,se),o()(),a(39,"section",25)(40,"div",22)(41,"h3"),c(42,"Model movement"),o(),a(43,"p"),c(44,"Pricing row, token buckets, turns, and cost movement."),o()(),a(45,"div",26)(46,"div",27)(47,"span"),c(48,"Model"),o(),a(49,"span"),c(50,"Price row"),o(),a(51,"span"),c(52,"Cost A / B"),o(),a(53,"span"),c(54,"Token movement"),o(),a(55,"span"),c(56,"Model calls A / B"),o(),a(57,"span"),c(58,"Cost delta"),o()(),T(59,Be,26,32,"div",28,ce),o()()),r&2){let e=t,n=u();s(3),f(e.promptMatch?"Same-prompt read":"Manual comparison read"),s(),y("saving",e.costDelta<0),s(),C(" ",e.costDelta<0?"-":"+","$",_(6,11,n.abs(e.costDelta),"1.2-4")," "),s(3),f(e.summary),s(),h(e.promptMatch?-1:9),s(6),k("",_(16,14,n.usageUsd(e.a),"1.2-2")," USD"),s(6),k("",_(22,17,n.usageUsd(e.b),"1.2-2")," USD"),s(6),C("",e.totalTokenDelta>=0?"+":"","",b(28,20,e.totalTokenDelta)),s(3),E(e.metrics),s(7),E(e.drivers),s(22),E(e.modelRows)}}function Te(r,t){r&1&&(a(0,"p",11),c(1,"Pick two different sessions to compare cost and token deltas."),o())}var oe=class r{sessionsInput=B([]);compareAInput=B(null);compareBInput=B(null);baselineQuery=B("");candidateQuery=B("");baselinePickerOpen=B(!1);candidatePickerOpen=B(!1);compareAChange=new z;compareBChange=new z;set sessions(t){this.sessionsInput.set(t??[])}set compareA(t){this.compareAInput.set(t??null)}set compareB(t){this.compareBInput.set(t??null)}sessionOptions=v(()=>this.sessionsInput());selectedAId=v(()=>this.compareAInput()??this.sessionOptions()[0]?.id??null);selectedBId=v(()=>this.compareBInput()??this.sessionOptions()[1]?.id??null);selectedASession=v(()=>this.sessionOptions().find(t=>t.id===this.selectedAId())??null);selectedBSession=v(()=>this.sessionOptions().find(t=>t.id===this.selectedBId())??null);baselineOptions=v(()=>this.filteredSessionOptions(this.baselineQuery(),this.selectedAId()));candidateOptions=v(()=>this.filteredSessionOptions(this.candidateQuery(),this.selectedBId()));abs=Math.abs;pricingFallbackReason=K;promptGroups=v(()=>this.samePromptGroups(this.sessionOptions()));comparison=v(()=>{let t=this.sessionOptions().find(R=>R.id===this.selectedAId()),e=this.sessionOptions().find(R=>R.id===this.selectedBId());if(!t||!e||t.id===e.id)return null;let n=this.sessionComparisonAnalysis(t),i=this.sessionComparisonAnalysis(e),l=i.totalTokens-n.totalTokens,p=w(t),d=w(e),g=d-p,P=i.inputContextUsd-n.inputContextUsd,I=i.outputUsd-n.outputUsd,M=e.traceSummary.toolCalls-t.traceSummary.toolCalls,N=e.traceSummary.modelTurns-t.traceSummary.modelTurns;return{a:t,b:e,aAnalysis:n,bAnalysis:i,promptMatch:$(t.firstPrompt)===$(e.firstPrompt),costDelta:g,totalTokenDelta:l,percent:S(p,d),summary:this.comparisonSummary(g,l,P,I,M,N),metrics:[{label:"Usage",a:p,b:d,delta:g,percent:S(p,d),format:"currency",lowerIsBetter:!0,help:"GitHub source usage when VS Code logged it. Falls back to local token pricing when source usage is unavailable."},{label:"Normal input tokens",a:t.tokens.input,b:e.tokens.input,delta:e.tokens.input-t.tokens.input,percent:S(t.tokens.input,e.tokens.input),format:"number",lowerIsBetter:!0,help:"Prompt/context tokens priced at the normal input rate. Cached input is shown separately when present."},{label:"Cached input tokens",a:t.tokens.cachedInput,b:e.tokens.cachedInput,delta:e.tokens.cachedInput-t.tokens.cachedInput,percent:S(t.tokens.cachedInput,e.tokens.cachedInput),format:"number",lowerIsBetter:!0,help:"Prompt/context tokens VS Code reported as cachedTokens. These are priced with the cached-input rate, not merged into normal input."},{label:"Cache write tokens",a:t.tokens.cacheWrite,b:e.tokens.cacheWrite,delta:e.tokens.cacheWrite-t.tokens.cacheWrite,percent:S(t.tokens.cacheWrite,e.tokens.cacheWrite),format:"number",lowerIsBetter:!0,help:"Cache creation tokens when VS Code exposes a numeric cache-write field. These are priced separately from normal and cached input."},{label:"Output tokens",a:t.tokens.output,b:e.tokens.output,delta:e.tokens.output-t.tokens.output,percent:S(t.tokens.output,e.tokens.output),format:"number",lowerIsBetter:!1,help:"Generated response tokens. More output can be useful, but it still affects cost."},{label:"Model turns",a:t.traceSummary.modelTurns,b:e.traceSummary.modelTurns,delta:N,percent:S(t.traceSummary.modelTurns,e.traceSummary.modelTurns),format:"number",lowerIsBetter:!1,help:"Model request count. More turns often means more accumulated context gets resent."},{label:"Tool calls",a:t.traceSummary.toolCalls,b:e.traceSummary.toolCalls,delta:M,percent:S(t.traceSummary.toolCalls,e.traceSummary.toolCalls),format:"number",lowerIsBetter:!1,help:"Tool activity. Tool results can become later input context."}],drivers:this.comparisonDrivers(n,i,g,P,I,M,N),modelRows:this.compareModelRows(n.modelRows,i.modelRows)}});setCompareA(t){let e=this.selectedAId(),n=this.selectedBId();this.compareAInput.set(t),this.compareAChange.emit(t),t&&t===n&&e&&e!==t&&(this.compareBInput.set(e),this.compareBChange.emit(e)),this.baselineQuery.set(""),this.baselinePickerOpen.set(!1)}setCompareB(t){let e=this.selectedAId(),n=this.selectedBId();this.compareBInput.set(t),this.compareBChange.emit(t),t&&t===e&&n&&n!==t&&(this.compareAInput.set(n),this.compareAChange.emit(n)),this.candidateQuery.set(""),this.candidatePickerOpen.set(!1)}setBaselineQuery(t){this.baselineQuery.set(t),this.baselinePickerOpen.set(!0)}setCandidateQuery(t){this.candidateQuery.set(t),this.candidatePickerOpen.set(!0)}openBaselinePicker(){this.baselinePickerOpen.set(!0)}openCandidatePicker(){this.candidatePickerOpen.set(!0)}closePickerOnFocusOut(t,e){let n=e.relatedTarget;if(!(n instanceof Node&&e.currentTarget instanceof Node&&e.currentTarget.contains(n))){if(t==="baseline"){this.baselinePickerOpen.set(!1);return}this.candidatePickerOpen.set(!1)}}compactDate(t){return new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(t))}runTokenTotal(t){return G(t)}usageUsd(t){return w(t)}promptRepeatCount(t){let e=$(t.firstPrompt);return e?this.promptGroups().find(n=>n.key===e)?.sessions.length??1:1}isSamePromptAsOther(t,e){let n=e==="baseline"?this.selectedBSession():this.selectedASession(),i=$(t.firstPrompt);return!!(n&&i&&i===$(n.firstPrompt))}tokenDeltaLabel(t){return`${t>=0?"+":""}${t.toLocaleString()}`}filteredSessionOptions(t,e){let n=t.trim().toLowerCase();if(!n)return this.sessionOptions();let i=this.sessionOptions().filter(p=>[p.title,p.firstPrompt,p.model,p.workspace].join(" ").toLowerCase().includes(n)),l=this.sessionOptions().find(p=>p.id===e);return l&&!i.some(p=>p.id===l.id)?[l,...i]:i}sessionComparisonAnalysis(t){let e=t.modelBreakdown.map(i=>X(i,w(t))),n=[...e].sort((i,l)=>l.totalUsd-i.totalUsd)[0]??null;return{session:t,modelRows:e,totalTokens:G(t),inputUsd:e.reduce((i,l)=>i+l.inputUsd,0),inputContextUsd:e.reduce((i,l)=>i+l.inputUsd+l.cachedInputUsd+l.cacheWriteUsd,0),outputUsd:e.reduce((i,l)=>i+l.outputUsd,0),cachedInputUsd:e.reduce((i,l)=>i+l.cachedInputUsd,0),cacheWriteUsd:e.reduce((i,l)=>i+l.cacheWriteUsd,0),topModel:n,modelNames:new Set(e.map(i=>i.model)),pricingRows:new Set(e.map(i=>i.pricingModel))}}samePromptGroups(t){let e=new Map;for(let n of t){let i=$(n.firstPrompt);i&&e.set(i,[...e.get(i)??[],n])}return[...e.entries()].filter(([,n])=>n.length>1).map(([n,i])=>{let l=[...i].sort((p,d)=>w(p)-w(d));return{key:n,sessions:[...i].sort((p,d)=>p.startedAt.localeCompare(d.startedAt)),costRangeUsd:w(l[l.length-1])-w(l[0])}}).sort((n,i)=>i.sessions.length-n.sessions.length||i.costRangeUsd-n.costRangeUsd)}comparisonSummary(t,e,n,i,l,p){let d=t>0?"more expensive":t<0?"cheaper":"about the same cost",g=e>0?"more":e<0?"fewer":"the same number of",P=Math.abs(n)>=Math.abs(i)?"input/context tokens":"generated output tokens",I=Math.abs(p)>=Math.abs(l)?`${Math.abs(p).toLocaleString()} ${p>=0?"more":"fewer"} model turns`:`${Math.abs(l).toLocaleString()} ${l>=0?"more":"fewer"} tool calls`;return t===0&&e===0?"These runs look equivalent on imported cost and token totals. Check logs if behavior differed qualitatively.":`Run B is ${d}, with ${Math.abs(e).toLocaleString()} ${g} imported tokens. The largest priced movement is ${P}; activity changed by ${I}.`}comparisonDrivers(t,e,n,i,l,p,d){let g=j(t.modelNames,e.modelNames)||j(t.pricingRows,e.pricingRows),P=t.topModel?.pricingModel!==e.topModel?.pricingModel;return[{title:"Cost movement",value:n>0?"Higher":n<0?"Lower":"Flat",tone:n>0?"high":n<0?"info":"medium",detail:n===0?"The imported estimate did not materially change between these two runs.":`Run B moved by ${n>0?"+":"-"}$${Math.abs(n).toFixed(4)}. Cheaper is only better if the run still did the job.`},{title:"Priced token driver",value:Math.abs(i)>=Math.abs(l)?"Input":"Output",tone:Math.abs(i)>=Math.abs(l)?"high":"medium",detail:Math.abs(i)>=Math.abs(l)?`Input/context cost moved by ${i>=0?"+":"-"}$${Math.abs(i).toFixed(4)} across normal input, cached input, and cache-write buckets. This is usually repo context, prior chat, or tool results.`:`Output cost moved by ${l>=0?"+":"-"}$${Math.abs(l).toFixed(4)}. The later run generated more or less text.`},{title:"Model pricing",value:g?"Changed":"Same",tone:g||P?"medium":"info",detail:g?`The model or pricing-row mix changed. A: ${[...t.pricingRows].join(", ")}. B: ${[...e.pricingRows].join(", ")}.`:`Both runs used the same imported pricing row mix: ${[...e.pricingRows].join(", ")}.`},{title:"Agent activity",value:`${d>=0?"+":""}${d} turns`,tone:d>3||p>10?"medium":"info",detail:`Run B has ${Math.abs(d)} ${d>=0?"more":"fewer"} model turns and ${Math.abs(p)} ${p>=0?"more":"fewer"} tool calls.`}]}compareModelRows(t,e){return[...new Set([...t,...e].map(i=>`${i.model}::${i.pricingModel}`))].map(i=>{let[l,p]=i.split("::"),d=t.find(M=>M.model===l&&M.pricingModel===p),g=e.find(M=>M.model===l&&M.pricingModel===p),P=d?L(d.tokens):0,I=g?L(g.tokens):0;return{model:l,pricingModel:p,usesFallbackPrice:Y(l,p),aCost:d?.totalUsd??0,bCost:g?.totalUsd??0,costDelta:(g?.totalUsd??0)-(d?.totalUsd??0),aTokens:P,bTokens:I,tokenDelta:I-P,inputDelta:(g?.tokens.input??0)-(d?.tokens.input??0),cachedInputDelta:(g?.tokens.cachedInput??0)-(d?.tokens.cachedInput??0),cacheWriteDelta:(g?.tokens.cacheWrite??0)-(d?.tokens.cacheWrite??0),outputDelta:(g?.tokens.output??0)-(d?.tokens.output??0),aTurns:d?.turns??0,bTurns:g?.turns??0}}).sort((i,l)=>Math.abs(l.costDelta)-Math.abs(i.costDelta))}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=q({type:r,selectors:[["app-compare-page"]],inputs:{sessions:"sessions",compareA:"compareA",compareB:"compareB"},outputs:{compareAChange:"compareAChange",compareBChange:"compareBChange"},decls:24,vars:11,consts:[[1,"compare"],[1,"compare-header"],[1,"eyebrow"],[1,"selectors"],[1,"run-picker",3,"focusout"],["type","button","aria-label","Open baseline run picker",1,"selected-run"],["type","search","placeholder","Search baseline runs","aria-label","Search baseline runs",3,"ngModelChange","focus","ngModel"],["role","listbox","aria-label","Baseline run results",1,"selector-results"],["type","button","aria-label","Open candidate run picker",1,"selected-run"],["type","search","placeholder","Search candidate runs","aria-label","Search candidate runs",3,"ngModelChange","focus","ngModel"],["role","listbox","aria-label","Candidate run results",1,"selector-results"],[1,"empty"],["type","button","aria-label","Open baseline run picker",1,"selected-run",3,"click"],["type","button","role","option",3,"active","same-prompt"],["type","button","role","option",3,"click"],[1,"match-chip"],[1,"match-chip","muted-chip"],["type","button","aria-label","Open candidate run picker",1,"selected-run",3,"click"],[1,"compare-readout"],[1,"compare-caveat"],[1,"comparison-grid","advanced"],[1,"comparison-section","comparison-drivers"],[1,"section-heading"],[1,"driver-list"],[3,"ngClass"],[1,"comparison-section","comparison-models"],[1,"cost-table","compact-table"],[1,"cost-row","cost-row-heading"],[1,"cost-row"],[3,"text","label"],[1,"warning-text"],[1,"token-movement"],["label","Explain fallback pricing",3,"text"]],template:function(e,n){if(e&1&&(a(0,"section",0)(1,"div",1)(2,"div")(3,"p",2),c(4,"Evaluation"),o(),a(5,"h2"),c(6,"Compare runs"),o(),a(7,"p"),c(8,"Pick a baseline and a candidate run. The page explains what changed in cost, tokens, activity, and model mix."),o()(),a(9,"div",3)(10,"div",4),O("focusout",function(l){return n.closePickerOnFocusOut("baseline",l)}),a(11,"span"),c(12,"Baseline A"),o(),x(13,le,6,6,"button",5),a(14,"input",6),O("ngModelChange",function(l){return n.setBaselineQuery(l)})("focus",function(){return n.openBaselinePicker()}),o(),x(15,ge,4,1,"div",7),o(),a(16,"div",4),O("focusout",function(l){return n.closePickerOnFocusOut("candidate",l)}),a(17,"span"),c(18,"Candidate B"),o(),x(19,Ce,6,6,"button",8),a(20,"input",9),O("ngModelChange",function(l){return n.setCandidateQuery(l)})("focus",function(){return n.openCandidatePicker()}),o(),x(21,fe,4,1,"div",10),o()()(),x(22,Ie,61,22)(23,Te,2,0,"p",11),o()),e&2){let i,l,p;s(10),y("open",n.baselinePickerOpen()),s(3),h((i=n.selectedASession())?13:-1,i),s(),A("ngModel",n.baselineQuery()),s(),h(n.baselinePickerOpen()?15:-1),s(),y("open",n.candidatePickerOpen()),s(3),h((l=n.selectedBSession())?19:-1,l),s(),A("ngModel",n.candidateQuery()),s(),h(n.candidatePickerOpen()?21:-1),s(),h((p=n.comparison())?22:23,p)}},dependencies:[ie,ee,te,ne,Z,H,J],styles:["[_nghost-%COMP%]{display:block}.compare[_ngcontent-%COMP%]{display:grid;gap:10px;border:1px solid var(--line);border-radius:16px;padding:16px;background:linear-gradient(180deg,#6f5cff09,#0c9f8305),var(--surface);box-shadow:var(--shadow-soft, 0 16px 38px rgba(15, 23, 42, .1))}.compare-header[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.compare[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:4px 0 0;color:var(--text-strong);font-size:22px;font-weight:760;letter-spacing:0}.compare-header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]:not(.eyebrow){max-width:620px;margin:6px 0 0;color:var(--muted);font-size:12px;line-height:1.45}.eyebrow[_ngcontent-%COMP%]{margin:0;color:var(--accent-2);font-size:10px;font-weight:760;letter-spacing:.08em;text-transform:uppercase}.selectors[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(260px,360px));gap:12px;min-width:min(760px,62vw)}.run-picker[_ngcontent-%COMP%]{position:relative;display:grid;gap:6px;min-width:0}.run-picker[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{color:var(--muted);font-size:11px;font-weight:760}.selectors[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .selected-run[_ngcontent-%COMP%]{width:100%;border:1px solid var(--line);border-radius:10px;padding:9px 11px;background:var(--control-bg, var(--surface-soft));color:var(--text);font:inherit;font-size:12px}.selected-run[_ngcontent-%COMP%]{display:grid;gap:3px;min-height:50px;text-align:left;cursor:pointer}.selected-run[_ngcontent-%COMP%]:hover, .run-picker.open[_ngcontent-%COMP%] .selected-run[_ngcontent-%COMP%]{border-color:#1fd1a573;box-shadow:0 0 0 3px #1fd1a514}.selected-run[_ngcontent-%COMP%] strong[_ngcontent-%COMP%], .selected-run[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.selected-run[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text-strong);font-size:12px;font-weight:760}.selected-run[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{color:var(--muted);font-size:11px;font-style:normal}.selectors[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{min-height:34px;border-color:#637d9438;background:color-mix(in srgb,var(--surface-soft) 78%,transparent)}.selectors[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::placeholder{color:var(--muted-2)}.selector-results[_ngcontent-%COMP%]{position:absolute;z-index:20;top:calc(100% + 6px);left:0;right:0;display:grid;gap:6px;max-height:min(320px,46vh);overflow:auto;border:1px solid var(--line);border-radius:11px;padding:6px;background:var(--surface);box-shadow:0 18px 42px #0f172a29}.selector-results[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{display:grid;gap:2px;width:100%;border:1px solid transparent;border-radius:9px;padding:8px 9px;background:transparent;color:var(--text);font:inherit;text-align:left;cursor:pointer}.selector-results[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover, .selector-results[_ngcontent-%COMP%] button.active[_ngcontent-%COMP%]{border-color:#1fd1a559;background:#1fd1a514}.selector-results[_ngcontent-%COMP%] button.same-prompt[_ngcontent-%COMP%]{border-color:#6f5cff61;background:linear-gradient(135deg,#6f5cff17,#1fd1a50e),transparent}.selector-results[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{overflow:hidden;color:var(--text-strong);font-size:12px;font-weight:760;text-overflow:ellipsis;white-space:nowrap}.selector-results[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .selector-results[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{overflow:hidden;color:var(--muted);font-size:11px;font-style:normal;text-overflow:ellipsis;white-space:nowrap}.match-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;width:fit-content;max-width:100%;border:1px solid rgba(111,92,255,.28);border-radius:999px;padding:2px 7px;background:#6f5cff17;color:var(--text-strong)!important;font-size:10px!important;font-weight:760;line-height:1.2}.match-chip.muted-chip[_ngcontent-%COMP%]{border-color:var(--line);background:color-mix(in srgb,var(--surface-soft) 72%,transparent);color:var(--muted)!important}.compare-readout[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:stretch;border:1px solid rgba(12,159,131,.2);border-radius:13px;padding:12px;background:radial-gradient(circle at 100% 0%,rgba(111,92,255,.11),transparent 34%),linear-gradient(135deg,#0c9f8313,#6f5cff09),var(--surface)}.compare-readout[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{border-left:4px solid var(--accent-2);padding-left:12px}.compare-readout[_ngcontent-%COMP%] dl[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,minmax(86px,1fr));gap:8px;align-self:center;margin:0}.compare-readout[_ngcontent-%COMP%] dl[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{display:grid;gap:4px;border:1px solid var(--line);border-radius:11px;padding:9px;background:var(--surface-soft)}.compare-readout[_ngcontent-%COMP%] dt[_ngcontent-%COMP%]{color:var(--muted-2);font-size:10px;font-weight:760;letter-spacing:.08em;text-transform:uppercase}.compare-readout[_ngcontent-%COMP%] dd[_ngcontent-%COMP%]{margin:0;color:var(--text-strong);font-size:14px;font-weight:760;white-space:nowrap}.compare-readout[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;margin-bottom:3px;color:var(--muted);font-size:11px;font-weight:760;letter-spacing:.08em;text-transform:uppercase}.compare-readout[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text-strong);font-size:22px;font-weight:760}.compare-readout[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{max-width:920px;margin:5px 0 0;color:var(--muted);font-size:12px;line-height:1.45}.compare-caveat[_ngcontent-%COMP%]{color:var(--warning-text, #ffcf75)!important}.comparison-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:7px}.comparison-grid[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{display:grid;gap:3px;border:1px solid var(--line);border-radius:10px;padding:8px 9px;background:var(--surface-soft)}.comparison-grid[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .comparison-grid[_ngcontent-%COMP%] em[_ngcontent-%COMP%], .cost-row[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .cost-row[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{color:var(--muted);font-size:12px;font-style:normal}.comparison-grid[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text-strong);font-size:15px;font-weight:760;letter-spacing:0}.comparison-section[_ngcontent-%COMP%]{display:grid;gap:8px}.section-heading[_ngcontent-%COMP%]{display:flex;align-items:end;justify-content:space-between;gap:14px}.section-heading[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;color:var(--text-strong);font-size:15px;font-weight:760}.section-heading[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;color:var(--muted);font-size:12px}.driver-list[_ngcontent-%COMP%]{display:grid;gap:6px}.driver-list[_ngcontent-%COMP%] article[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(155px,.34fr) minmax(0,1fr);gap:10px;align-items:start;border:1px solid var(--line);border-left:3px solid var(--accent);border-radius:10px;padding:8px 10px;background:color-mix(in srgb,var(--surface-soft) 58%,transparent)}.driver-list[_ngcontent-%COMP%] article.medium[_ngcontent-%COMP%]{border-left-color:var(--warning)}.driver-list[_ngcontent-%COMP%] article.high[_ngcontent-%COMP%]{border-left-color:var(--danger)}.driver-list[_ngcontent-%COMP%] article[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{display:grid;gap:2px;min-width:0}.driver-list[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--muted-2);font-size:10px;font-weight:760;letter-spacing:.08em;text-transform:uppercase}.driver-list[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text-strong);font-size:14px;font-weight:760;line-height:1.1;overflow-wrap:anywhere}.driver-list[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;color:var(--text);font-size:12px;line-height:1.35}.cost-table[_ngcontent-%COMP%]{display:grid;overflow:auto hidden;border:1px solid var(--line);border-radius:12px;background:var(--surface)}.cost-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(140px,1.05fr) minmax(110px,.82fr) minmax(128px,.95fr) minmax(190px,1.25fr) minmax(96px,.7fr) minmax(74px,.5fr);gap:8px;align-items:start;min-width:760px;border-bottom:1px solid var(--line);padding:8px 9px}.cost-row[_ngcontent-%COMP%]:last-child{border-bottom:0}.cost-row-heading[_ngcontent-%COMP%]{background:var(--surface-soft);font-size:11px;font-weight:720;text-transform:uppercase}.cost-row[_ngcontent-%COMP%] strong[_ngcontent-%COMP%], .cost-row[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:grid;gap:3px}.cost-row[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text-strong)}.cost-row[_ngcontent-%COMP%] .token-movement[_ngcontent-%COMP%]{gap:4px}.cost-row[_ngcontent-%COMP%] .token-movement[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{display:block;color:var(--text-strong);font-size:12px}.cost-row[_ngcontent-%COMP%] .token-movement[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{line-height:1.35}.saving[_ngcontent-%COMP%]{color:var(--success-text, #35d07f)!important}.warning-text[_ngcontent-%COMP%]{color:var(--warning-text, #ffcf75)!important;font-weight:900}.empty[_ngcontent-%COMP%]{margin:0;color:var(--muted)}@media(max-width:900px){.compare-header[_ngcontent-%COMP%], .compare-readout[_ngcontent-%COMP%], .section-heading[_ngcontent-%COMP%]{display:grid}.comparison-grid[_ngcontent-%COMP%], .driver-list[_ngcontent-%COMP%] article[_ngcontent-%COMP%], .selectors[_ngcontent-%COMP%], .compare-readout[_ngcontent-%COMP%] dl[_ngcontent-%COMP%], .cost-row[_ngcontent-%COMP%]{grid-template-columns:1fr}.cost-row[_ngcontent-%COMP%], .selectors[_ngcontent-%COMP%]{min-width:0}}"]})};function $(r){return String(r??"").toLowerCase().replace(/[^\p{L}\p{N}#/@._-]+/gu," ").replace(/\s+/g," ").trim()}export{oe as ComparePageComponent};
|
|
1
|
+
import{n as K,o as X,p as L,q as G,r as w,v as S,w as Y,x as j}from"./chunk-VEKXIM47.js";import{$a as b,Ba as W,Ca as x,Da as h,Fa as T,Ga as E,Ha as A,Ia as a,Ja as o,Ka as Q,O as U,Oa as F,P as D,Qa as O,Sa as u,U as z,Ua as y,Va as c,Wa as f,Xa as k,Ya as C,Z as B,Za as V,_a as m,ab as _,db as v,ka as s,mb as H,ob as J,sa as q,sb as Z,tb as ee,ub as te,vb as ne,zb as ie}from"./chunk-WOIYAEKB.js";var re=(r,t)=>t.id,ae=(r,t)=>t.label,se=(r,t)=>t.title,ce=(r,t)=>t.model+t.pricingModel;function le(r,t){if(r&1){let e=F();a(0,"button",12),O("click",function(){U(e);let i=u();return D(i.openBaselinePicker())}),a(1,"strong"),c(2),o(),a(3,"em"),c(4),m(5,"number"),o()()}if(r&2){let e=t,n=u();s(2),f(e.title),s(2),C("",n.compactDate(e.startedAt)," \xB7 $",_(5,3,n.usageUsd(e),"1.2-4"))}}function pe(r,t){r&1&&(a(0,"em",15),c(1,"Same prompt as B"),o())}function de(r,t){if(r&1&&(a(0,"em",16),c(1),m(2,"number"),o()),r&2){let e=u().$implicit,n=u(2);s(),k("",b(2,1,n.promptRepeatCount(e))," matching prompts")}}function me(r,t){if(r&1){let e=F();a(0,"button",14),O("click",function(){let i=U(e).$implicit,l=u(2);return D(l.setCompareA(i.id))}),a(1,"strong"),c(2),o(),a(3,"span"),c(4),m(5,"number"),m(6,"number"),o(),x(7,pe,2,0,"em",15)(8,de,3,3,"em",16),o()}if(r&2){let e=t.$implicit,n=u(2);y("active",e.id===n.selectedAId())("same-prompt",n.isSamePromptAsOther(e,"baseline")),W("aria-selected",e.id===n.selectedAId()),s(2),f(e.title),s(2),V(" ",n.compactDate(e.startedAt)," \xB7 $",_(5,10,n.usageUsd(e),"1.2-4")," \xB7 ",b(6,13,n.runTokenTotal(e))," tokens "),s(3),h(n.isSamePromptAsOther(e,"baseline")?7:n.promptRepeatCount(e)>1?8:-1)}}function ue(r,t){r&1&&(a(0,"em"),c(1,"No matching runs"),o())}function ge(r,t){if(r&1&&(a(0,"div",7),T(1,me,9,15,"button",13,re,!1,ue,2,0,"em"),o()),r&2){let e=u();s(),E(e.baselineOptions().slice(0,8))}}function Ce(r,t){if(r&1){let e=F();a(0,"button",17),O("click",function(){U(e);let i=u();return D(i.openCandidatePicker())}),a(1,"strong"),c(2),o(),a(3,"em"),c(4),m(5,"number"),o()()}if(r&2){let e=t,n=u();s(2),f(e.title),s(2),C("",n.compactDate(e.startedAt)," \xB7 $",_(5,3,n.usageUsd(e),"1.2-4"))}}function _e(r,t){r&1&&(a(0,"em",15),c(1,"Same prompt as A"),o())}function xe(r,t){if(r&1&&(a(0,"em",16),c(1),m(2,"number"),o()),r&2){let e=u().$implicit,n=u(2);s(),k("",b(2,1,n.promptRepeatCount(e))," matching prompts")}}function he(r,t){if(r&1){let e=F();a(0,"button",14),O("click",function(){let i=U(e).$implicit,l=u(2);return D(l.setCompareB(i.id))}),a(1,"strong"),c(2),o(),a(3,"span"),c(4),m(5,"number"),m(6,"number"),o(),x(7,_e,2,0,"em",15)(8,xe,3,3,"em",16),o()}if(r&2){let e=t.$implicit,n=u(2);y("active",e.id===n.selectedBId())("same-prompt",n.isSamePromptAsOther(e,"candidate")),W("aria-selected",e.id===n.selectedBId()),s(2),f(e.title),s(2),V(" ",n.compactDate(e.startedAt)," \xB7 $",_(5,10,n.usageUsd(e),"1.2-4")," \xB7 ",b(6,13,n.runTokenTotal(e))," tokens "),s(3),h(n.isSamePromptAsOther(e,"candidate")?7:n.promptRepeatCount(e)>1?8:-1)}}function be(r,t){r&1&&(a(0,"em"),c(1,"No matching runs"),o())}function fe(r,t){if(r&1&&(a(0,"div",10),T(1,he,9,15,"button",13,re,!1,be,2,0,"em"),o()),r&2){let e=u();s(),E(e.candidateOptions().slice(0,8))}}function ve(r,t){r&1&&(a(0,"p",19),c(1,"These first prompts differ, so read this as run comparison rather than prompt A/B testing."),o())}function Pe(r,t){if(r&1&&(a(0,"strong"),c(1),m(2,"number"),o(),a(3,"em"),c(4),m(5,"number"),m(6,"number"),o()),r&2){let e=u().$implicit,n=u(2);y("saving",e.lowerIsBetter&&e.delta<0),s(),C(" ",e.delta<0?"-":"+","$",_(2,6,n.abs(e.delta),"1.2-4")," "),s(3),C("A $",_(5,9,e.a,"1.2-4")," / B $",_(6,12,e.b,"1.2-4"))}}function Me(r,t){if(r&1&&(c(0),m(1,"number")),r&2){let e=u(2).$implicit;C(" \xB7 ",e.percent>=0?"+":"","",_(1,2,e.percent,"1.0-0"),"% ")}}function Oe(r,t){if(r&1&&(a(0,"strong"),c(1),m(2,"number"),o(),a(3,"em"),c(4),m(5,"number"),m(6,"number"),x(7,Me,2,5),o()),r&2){let e=u().$implicit;y("saving",e.lowerIsBetter&&e.delta<0),s(),C(" ",e.delta>=0?"+":"","",b(2,7,e.delta)," "),s(3),C(" A ",b(5,9,e.a)," / B ",b(6,11,e.b)," "),s(3),h(e.percent!==null?7:-1)}}function ye(r,t){if(r&1&&(a(0,"div")(1,"span"),c(2),Q(3,"app-help-popover",29),o(),x(4,Pe,7,15)(5,Oe,8,13),o()),r&2){let e=t.$implicit;s(2),k(" ",e.label," "),s(),A("text",e.help)("label","Explain "+e.label),s(),h(e.format==="currency"?4:5)}}function ke(r,t){if(r&1&&(a(0,"article",24)(1,"div")(2,"span"),c(3),o(),a(4,"strong"),c(5),o()(),a(6,"p"),c(7),o()()),r&2){let e=t.$implicit;A("ngClass",e.tone),s(3),f(e.title),s(2),f(e.value),s(2),f(e.detail)}}function we(r,t){if(r&1&&(a(0,"em",30),c(1," fallback pricing "),Q(2,"app-help-popover",32),o()),r&2){let e=u().$implicit,n=u(2);s(2),A("text",n.pricingFallbackReason(e.model,e.pricingModel))}}function Se(r,t){if(r&1&&(a(0,"em"),c(1),o()),r&2){let e=u().$implicit,n=u(2);s(),k("write ",n.tokenDeltaLabel(e.cacheWriteDelta))}}function Be(r,t){if(r&1&&(a(0,"div",28)(1,"strong"),c(2),o(),a(3,"span"),c(4),x(5,we,3,1,"em",30),o(),a(6,"span"),c(7),m(8,"number"),m(9,"number"),o(),a(10,"span",31)(11,"strong"),c(12),m(13,"number"),o(),a(14,"em"),c(15),o(),x(16,Se,2,1,"em"),a(17,"em"),c(18),o()(),a(19,"span"),c(20),m(21,"number"),m(22,"number"),o(),a(23,"span"),c(24),m(25,"number"),o()()),r&2){let e=t.$implicit,n=u(2);s(2),f(e.model),s(2),k(" ",e.pricingModel," "),s(),h(e.usesFallbackPrice?5:-1),s(2),C("$",_(8,17,e.aCost,"1.4-6")," / $",_(9,20,e.bCost,"1.4-6")),s(5),C("",e.tokenDelta>=0?"+":"","",b(13,23,e.tokenDelta)),s(3),C(" normal ",n.tokenDeltaLabel(e.inputDelta)," \xB7 cached ",n.tokenDeltaLabel(e.cachedInputDelta)," "),s(),h(e.cacheWriteDelta?16:-1),s(2),k("out ",n.tokenDeltaLabel(e.outputDelta)),s(2),C("",b(21,25,e.aTurns)," / ",b(22,27,e.bTurns)),s(3),y("saving",e.costDelta<0),s(),C(" ",e.costDelta<0?"-":"+","$",_(25,29,n.abs(e.costDelta),"1.4-4")," ")}}function Ie(r,t){if(r&1&&(a(0,"div",18)(1,"div")(2,"span"),c(3),o(),a(4,"strong"),c(5),m(6,"number"),o(),a(7,"p"),c(8),o(),x(9,ve,2,0,"p",19),o(),a(10,"dl")(11,"div")(12,"dt"),c(13,"A"),o(),a(14,"dd"),c(15),m(16,"number"),o()(),a(17,"div")(18,"dt"),c(19,"B"),o(),a(20,"dd"),c(21),m(22,"number"),o()(),a(23,"div")(24,"dt"),c(25,"Tokens"),o(),a(26,"dd"),c(27),m(28,"number"),o()()()(),a(29,"div",20),T(30,ye,6,4,"div",null,ae),o(),a(32,"section",21)(33,"div",22)(34,"h3"),c(35,"What changed"),o()(),a(36,"div",23),T(37,ke,8,4,"article",24,se),o()(),a(39,"section",25)(40,"div",22)(41,"h3"),c(42,"Model movement"),o(),a(43,"p"),c(44,"Pricing row, token buckets, turns, and cost movement."),o()(),a(45,"div",26)(46,"div",27)(47,"span"),c(48,"Model"),o(),a(49,"span"),c(50,"Price row"),o(),a(51,"span"),c(52,"Cost A / B"),o(),a(53,"span"),c(54,"Token movement"),o(),a(55,"span"),c(56,"Model calls A / B"),o(),a(57,"span"),c(58,"Cost delta"),o()(),T(59,Be,26,32,"div",28,ce),o()()),r&2){let e=t,n=u();s(3),f(e.promptMatch?"Same-prompt read":"Manual comparison read"),s(),y("saving",e.costDelta<0),s(),C(" ",e.costDelta<0?"-":"+","$",_(6,11,n.abs(e.costDelta),"1.2-4")," "),s(3),f(e.summary),s(),h(e.promptMatch?-1:9),s(6),k("",_(16,14,n.usageUsd(e.a),"1.2-2")," USD"),s(6),k("",_(22,17,n.usageUsd(e.b),"1.2-2")," USD"),s(6),C("",e.totalTokenDelta>=0?"+":"","",b(28,20,e.totalTokenDelta)),s(3),E(e.metrics),s(7),E(e.drivers),s(22),E(e.modelRows)}}function Te(r,t){r&1&&(a(0,"p",11),c(1,"Pick two different sessions to compare cost and token deltas."),o())}var oe=class r{sessionsInput=B([]);compareAInput=B(null);compareBInput=B(null);baselineQuery=B("");candidateQuery=B("");baselinePickerOpen=B(!1);candidatePickerOpen=B(!1);compareAChange=new z;compareBChange=new z;set sessions(t){this.sessionsInput.set(t??[])}set compareA(t){this.compareAInput.set(t??null)}set compareB(t){this.compareBInput.set(t??null)}sessionOptions=v(()=>this.sessionsInput());selectedAId=v(()=>this.compareAInput()??this.sessionOptions()[0]?.id??null);selectedBId=v(()=>this.compareBInput()??this.sessionOptions()[1]?.id??null);selectedASession=v(()=>this.sessionOptions().find(t=>t.id===this.selectedAId())??null);selectedBSession=v(()=>this.sessionOptions().find(t=>t.id===this.selectedBId())??null);baselineOptions=v(()=>this.filteredSessionOptions(this.baselineQuery(),this.selectedAId()));candidateOptions=v(()=>this.filteredSessionOptions(this.candidateQuery(),this.selectedBId()));abs=Math.abs;pricingFallbackReason=K;promptGroups=v(()=>this.samePromptGroups(this.sessionOptions()));comparison=v(()=>{let t=this.sessionOptions().find(R=>R.id===this.selectedAId()),e=this.sessionOptions().find(R=>R.id===this.selectedBId());if(!t||!e||t.id===e.id)return null;let n=this.sessionComparisonAnalysis(t),i=this.sessionComparisonAnalysis(e),l=i.totalTokens-n.totalTokens,p=w(t),d=w(e),g=d-p,P=i.inputContextUsd-n.inputContextUsd,I=i.outputUsd-n.outputUsd,M=e.traceSummary.toolCalls-t.traceSummary.toolCalls,N=e.traceSummary.modelTurns-t.traceSummary.modelTurns;return{a:t,b:e,aAnalysis:n,bAnalysis:i,promptMatch:$(t.firstPrompt)===$(e.firstPrompt),costDelta:g,totalTokenDelta:l,percent:S(p,d),summary:this.comparisonSummary(g,l,P,I,M,N),metrics:[{label:"Usage",a:p,b:d,delta:g,percent:S(p,d),format:"currency",lowerIsBetter:!0,help:"GitHub source usage when VS Code logged it. Falls back to local token pricing when source usage is unavailable."},{label:"Normal input tokens",a:t.tokens.input,b:e.tokens.input,delta:e.tokens.input-t.tokens.input,percent:S(t.tokens.input,e.tokens.input),format:"number",lowerIsBetter:!0,help:"Prompt/context tokens priced at the normal input rate. Cached input is shown separately when present."},{label:"Cached input tokens",a:t.tokens.cachedInput,b:e.tokens.cachedInput,delta:e.tokens.cachedInput-t.tokens.cachedInput,percent:S(t.tokens.cachedInput,e.tokens.cachedInput),format:"number",lowerIsBetter:!0,help:"Prompt/context tokens VS Code reported as cachedTokens. These are priced with the cached-input rate, not merged into normal input."},{label:"Cache write tokens",a:t.tokens.cacheWrite,b:e.tokens.cacheWrite,delta:e.tokens.cacheWrite-t.tokens.cacheWrite,percent:S(t.tokens.cacheWrite,e.tokens.cacheWrite),format:"number",lowerIsBetter:!0,help:"Cache creation tokens when VS Code exposes a numeric cache-write field. These are priced separately from normal and cached input."},{label:"Output tokens",a:t.tokens.output,b:e.tokens.output,delta:e.tokens.output-t.tokens.output,percent:S(t.tokens.output,e.tokens.output),format:"number",lowerIsBetter:!1,help:"Generated response tokens. More output can be useful, but it still affects cost."},{label:"Model turns",a:t.traceSummary.modelTurns,b:e.traceSummary.modelTurns,delta:N,percent:S(t.traceSummary.modelTurns,e.traceSummary.modelTurns),format:"number",lowerIsBetter:!1,help:"Model request count. More turns often means more accumulated context gets resent."},{label:"Tool calls",a:t.traceSummary.toolCalls,b:e.traceSummary.toolCalls,delta:M,percent:S(t.traceSummary.toolCalls,e.traceSummary.toolCalls),format:"number",lowerIsBetter:!1,help:"Tool activity. Tool results can become later input context."}],drivers:this.comparisonDrivers(n,i,g,P,I,M,N),modelRows:this.compareModelRows(n.modelRows,i.modelRows)}});setCompareA(t){let e=this.selectedAId(),n=this.selectedBId();this.compareAInput.set(t),this.compareAChange.emit(t),t&&t===n&&e&&e!==t&&(this.compareBInput.set(e),this.compareBChange.emit(e)),this.baselineQuery.set(""),this.baselinePickerOpen.set(!1)}setCompareB(t){let e=this.selectedAId(),n=this.selectedBId();this.compareBInput.set(t),this.compareBChange.emit(t),t&&t===e&&n&&n!==t&&(this.compareAInput.set(n),this.compareAChange.emit(n)),this.candidateQuery.set(""),this.candidatePickerOpen.set(!1)}setBaselineQuery(t){this.baselineQuery.set(t),this.baselinePickerOpen.set(!0)}setCandidateQuery(t){this.candidateQuery.set(t),this.candidatePickerOpen.set(!0)}openBaselinePicker(){this.baselinePickerOpen.set(!0)}openCandidatePicker(){this.candidatePickerOpen.set(!0)}closePickerOnFocusOut(t,e){let n=e.relatedTarget;if(!(n instanceof Node&&e.currentTarget instanceof Node&&e.currentTarget.contains(n))){if(t==="baseline"){this.baselinePickerOpen.set(!1);return}this.candidatePickerOpen.set(!1)}}compactDate(t){return new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(t))}runTokenTotal(t){return G(t)}usageUsd(t){return w(t)}promptRepeatCount(t){let e=$(t.firstPrompt);return e?this.promptGroups().find(n=>n.key===e)?.sessions.length??1:1}isSamePromptAsOther(t,e){let n=e==="baseline"?this.selectedBSession():this.selectedASession(),i=$(t.firstPrompt);return!!(n&&i&&i===$(n.firstPrompt))}tokenDeltaLabel(t){return`${t>=0?"+":""}${t.toLocaleString()}`}filteredSessionOptions(t,e){let n=t.trim().toLowerCase();if(!n)return this.sessionOptions();let i=this.sessionOptions().filter(p=>[p.title,p.firstPrompt,p.model,p.workspace].join(" ").toLowerCase().includes(n)),l=this.sessionOptions().find(p=>p.id===e);return l&&!i.some(p=>p.id===l.id)?[l,...i]:i}sessionComparisonAnalysis(t){let e=t.modelBreakdown.map(i=>X(i,w(t))),n=[...e].sort((i,l)=>l.totalUsd-i.totalUsd)[0]??null;return{session:t,modelRows:e,totalTokens:G(t),inputUsd:e.reduce((i,l)=>i+l.inputUsd,0),inputContextUsd:e.reduce((i,l)=>i+l.inputUsd+l.cachedInputUsd+l.cacheWriteUsd,0),outputUsd:e.reduce((i,l)=>i+l.outputUsd,0),cachedInputUsd:e.reduce((i,l)=>i+l.cachedInputUsd,0),cacheWriteUsd:e.reduce((i,l)=>i+l.cacheWriteUsd,0),topModel:n,modelNames:new Set(e.map(i=>i.model)),pricingRows:new Set(e.map(i=>i.pricingModel))}}samePromptGroups(t){let e=new Map;for(let n of t){let i=$(n.firstPrompt);i&&e.set(i,[...e.get(i)??[],n])}return[...e.entries()].filter(([,n])=>n.length>1).map(([n,i])=>{let l=[...i].sort((p,d)=>w(p)-w(d));return{key:n,sessions:[...i].sort((p,d)=>p.startedAt.localeCompare(d.startedAt)),costRangeUsd:w(l[l.length-1])-w(l[0])}}).sort((n,i)=>i.sessions.length-n.sessions.length||i.costRangeUsd-n.costRangeUsd)}comparisonSummary(t,e,n,i,l,p){let d=t>0?"more expensive":t<0?"cheaper":"about the same cost",g=e>0?"more":e<0?"fewer":"the same number of",P=Math.abs(n)>=Math.abs(i)?"input/context tokens":"generated output tokens",I=Math.abs(p)>=Math.abs(l)?`${Math.abs(p).toLocaleString()} ${p>=0?"more":"fewer"} model turns`:`${Math.abs(l).toLocaleString()} ${l>=0?"more":"fewer"} tool calls`;return t===0&&e===0?"These runs look equivalent on imported cost and token totals. Check logs if behavior differed qualitatively.":`Run B is ${d}, with ${Math.abs(e).toLocaleString()} ${g} imported tokens. The largest priced movement is ${P}; activity changed by ${I}.`}comparisonDrivers(t,e,n,i,l,p,d){let g=j(t.modelNames,e.modelNames)||j(t.pricingRows,e.pricingRows),P=t.topModel?.pricingModel!==e.topModel?.pricingModel;return[{title:"Cost movement",value:n>0?"Higher":n<0?"Lower":"Flat",tone:n>0?"high":n<0?"info":"medium",detail:n===0?"The imported estimate did not materially change between these two runs.":`Run B moved by ${n>0?"+":"-"}$${Math.abs(n).toFixed(4)}. Cheaper is only better if the run still did the job.`},{title:"Priced token driver",value:Math.abs(i)>=Math.abs(l)?"Input":"Output",tone:Math.abs(i)>=Math.abs(l)?"high":"medium",detail:Math.abs(i)>=Math.abs(l)?`Input/context cost moved by ${i>=0?"+":"-"}$${Math.abs(i).toFixed(4)} across normal input, cached input, and cache-write buckets. This is usually repo context, prior chat, or tool results.`:`Output cost moved by ${l>=0?"+":"-"}$${Math.abs(l).toFixed(4)}. The later run generated more or less text.`},{title:"Model pricing",value:g?"Changed":"Same",tone:g||P?"medium":"info",detail:g?`The model or pricing-row mix changed. A: ${[...t.pricingRows].join(", ")}. B: ${[...e.pricingRows].join(", ")}.`:`Both runs used the same imported pricing row mix: ${[...e.pricingRows].join(", ")}.`},{title:"Agent activity",value:`${d>=0?"+":""}${d} turns`,tone:d>3||p>10?"medium":"info",detail:`Run B has ${Math.abs(d)} ${d>=0?"more":"fewer"} model turns and ${Math.abs(p)} ${p>=0?"more":"fewer"} tool calls.`}]}compareModelRows(t,e){return[...new Set([...t,...e].map(i=>`${i.model}::${i.pricingModel}`))].map(i=>{let[l,p]=i.split("::"),d=t.find(M=>M.model===l&&M.pricingModel===p),g=e.find(M=>M.model===l&&M.pricingModel===p),P=d?L(d.tokens):0,I=g?L(g.tokens):0;return{model:l,pricingModel:p,usesFallbackPrice:Y(l,p),aCost:d?.totalUsd??0,bCost:g?.totalUsd??0,costDelta:(g?.totalUsd??0)-(d?.totalUsd??0),aTokens:P,bTokens:I,tokenDelta:I-P,inputDelta:(g?.tokens.input??0)-(d?.tokens.input??0),cachedInputDelta:(g?.tokens.cachedInput??0)-(d?.tokens.cachedInput??0),cacheWriteDelta:(g?.tokens.cacheWrite??0)-(d?.tokens.cacheWrite??0),outputDelta:(g?.tokens.output??0)-(d?.tokens.output??0),aTurns:d?.turns??0,bTurns:g?.turns??0}}).sort((i,l)=>Math.abs(l.costDelta)-Math.abs(i.costDelta))}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=q({type:r,selectors:[["app-compare-page"]],inputs:{sessions:"sessions",compareA:"compareA",compareB:"compareB"},outputs:{compareAChange:"compareAChange",compareBChange:"compareBChange"},decls:24,vars:11,consts:[[1,"compare"],[1,"compare-header"],[1,"eyebrow"],[1,"selectors"],[1,"run-picker",3,"focusout"],["type","button","aria-label","Open baseline run picker",1,"selected-run"],["type","search","placeholder","Search baseline runs","aria-label","Search baseline runs",3,"ngModelChange","focus","ngModel"],["role","listbox","aria-label","Baseline run results",1,"selector-results"],["type","button","aria-label","Open candidate run picker",1,"selected-run"],["type","search","placeholder","Search candidate runs","aria-label","Search candidate runs",3,"ngModelChange","focus","ngModel"],["role","listbox","aria-label","Candidate run results",1,"selector-results"],[1,"empty"],["type","button","aria-label","Open baseline run picker",1,"selected-run",3,"click"],["type","button","role","option",3,"active","same-prompt"],["type","button","role","option",3,"click"],[1,"match-chip"],[1,"match-chip","muted-chip"],["type","button","aria-label","Open candidate run picker",1,"selected-run",3,"click"],[1,"compare-readout"],[1,"compare-caveat"],[1,"comparison-grid","advanced"],[1,"comparison-section","comparison-drivers"],[1,"section-heading"],[1,"driver-list"],[3,"ngClass"],[1,"comparison-section","comparison-models"],[1,"cost-table","compact-table"],[1,"cost-row","cost-row-heading"],[1,"cost-row"],[3,"text","label"],[1,"warning-text"],[1,"token-movement"],["label","Explain fallback pricing",3,"text"]],template:function(e,n){if(e&1&&(a(0,"section",0)(1,"div",1)(2,"div")(3,"p",2),c(4,"Evaluation"),o(),a(5,"h2"),c(6,"Compare runs"),o(),a(7,"p"),c(8,"Pick a baseline and a candidate run. The page explains what changed in cost, tokens, activity, and model mix."),o()(),a(9,"div",3)(10,"div",4),O("focusout",function(l){return n.closePickerOnFocusOut("baseline",l)}),a(11,"span"),c(12,"Baseline A"),o(),x(13,le,6,6,"button",5),a(14,"input",6),O("ngModelChange",function(l){return n.setBaselineQuery(l)})("focus",function(){return n.openBaselinePicker()}),o(),x(15,ge,4,1,"div",7),o(),a(16,"div",4),O("focusout",function(l){return n.closePickerOnFocusOut("candidate",l)}),a(17,"span"),c(18,"Candidate B"),o(),x(19,Ce,6,6,"button",8),a(20,"input",9),O("ngModelChange",function(l){return n.setCandidateQuery(l)})("focus",function(){return n.openCandidatePicker()}),o(),x(21,fe,4,1,"div",10),o()()(),x(22,Ie,61,22)(23,Te,2,0,"p",11),o()),e&2){let i,l,p;s(10),y("open",n.baselinePickerOpen()),s(3),h((i=n.selectedASession())?13:-1,i),s(),A("ngModel",n.baselineQuery()),s(),h(n.baselinePickerOpen()?15:-1),s(),y("open",n.candidatePickerOpen()),s(3),h((l=n.selectedBSession())?19:-1,l),s(),A("ngModel",n.candidateQuery()),s(),h(n.candidatePickerOpen()?21:-1),s(),h((p=n.comparison())?22:23,p)}},dependencies:[ie,ee,te,ne,Z,H,J],styles:["[_nghost-%COMP%]{display:block}.compare[_ngcontent-%COMP%]{display:grid;gap:10px;border:1px solid var(--line);border-radius:16px;padding:16px;background:linear-gradient(180deg,#6f5cff09,#0c9f8305),var(--surface);box-shadow:var(--shadow-soft, 0 16px 38px rgba(15, 23, 42, .1))}.compare-header[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.compare[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:4px 0 0;color:var(--text-strong);font-size:22px;font-weight:760;letter-spacing:0}.compare-header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]:not(.eyebrow){max-width:620px;margin:6px 0 0;color:var(--muted);font-size:12px;line-height:1.45}.eyebrow[_ngcontent-%COMP%]{margin:0;color:var(--accent-2);font-size:10px;font-weight:760;letter-spacing:.08em;text-transform:uppercase}.selectors[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(260px,360px));gap:12px;min-width:min(760px,62vw)}.run-picker[_ngcontent-%COMP%]{position:relative;display:grid;gap:6px;min-width:0}.run-picker[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{color:var(--muted);font-size:11px;font-weight:760}.selectors[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .selected-run[_ngcontent-%COMP%]{width:100%;border:1px solid var(--line);border-radius:10px;padding:9px 11px;background:var(--control-bg, var(--surface-soft));color:var(--text);font:inherit;font-size:12px}.selected-run[_ngcontent-%COMP%]{display:grid;gap:3px;min-height:50px;text-align:left;cursor:pointer}.selected-run[_ngcontent-%COMP%]:hover, .run-picker.open[_ngcontent-%COMP%] .selected-run[_ngcontent-%COMP%]{border-color:#1fd1a573;box-shadow:0 0 0 3px #1fd1a514}.selected-run[_ngcontent-%COMP%] strong[_ngcontent-%COMP%], .selected-run[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.selected-run[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text-strong);font-size:12px;font-weight:760}.selected-run[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{color:var(--muted);font-size:11px;font-style:normal}.selectors[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{min-height:34px;border-color:#637d9438;background:color-mix(in srgb,var(--surface-soft) 78%,transparent)}.selectors[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::placeholder{color:var(--muted-2)}.selector-results[_ngcontent-%COMP%]{position:absolute;z-index:20;top:calc(100% + 6px);left:0;right:0;display:grid;gap:6px;max-height:min(320px,46vh);overflow:auto;border:1px solid var(--line);border-radius:11px;padding:6px;background:var(--surface);box-shadow:0 18px 42px #0f172a29}.selector-results[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{display:grid;gap:2px;width:100%;border:1px solid transparent;border-radius:9px;padding:8px 9px;background:transparent;color:var(--text);font:inherit;text-align:left;cursor:pointer}.selector-results[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover, .selector-results[_ngcontent-%COMP%] button.active[_ngcontent-%COMP%]{border-color:#1fd1a559;background:#1fd1a514}.selector-results[_ngcontent-%COMP%] button.same-prompt[_ngcontent-%COMP%]{border-color:#6f5cff61;background:linear-gradient(135deg,#6f5cff17,#1fd1a50e),transparent}.selector-results[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{overflow:hidden;color:var(--text-strong);font-size:12px;font-weight:760;text-overflow:ellipsis;white-space:nowrap}.selector-results[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .selector-results[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{overflow:hidden;color:var(--muted);font-size:11px;font-style:normal;text-overflow:ellipsis;white-space:nowrap}.match-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;width:fit-content;max-width:100%;border:1px solid rgba(111,92,255,.28);border-radius:999px;padding:2px 7px;background:#6f5cff17;color:var(--text-strong)!important;font-size:10px!important;font-weight:760;line-height:1.2}.match-chip.muted-chip[_ngcontent-%COMP%]{border-color:var(--line);background:color-mix(in srgb,var(--surface-soft) 72%,transparent);color:var(--muted)!important}.compare-readout[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:stretch;border:1px solid rgba(12,159,131,.2);border-radius:13px;padding:12px;background:radial-gradient(circle at 100% 0%,rgba(111,92,255,.11),transparent 34%),linear-gradient(135deg,#0c9f8313,#6f5cff09),var(--surface)}.compare-readout[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{border-left:4px solid var(--accent-2);padding-left:12px}.compare-readout[_ngcontent-%COMP%] dl[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,minmax(86px,1fr));gap:8px;align-self:center;margin:0}.compare-readout[_ngcontent-%COMP%] dl[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{display:grid;gap:4px;border:1px solid var(--line);border-radius:11px;padding:9px;background:var(--surface-soft)}.compare-readout[_ngcontent-%COMP%] dt[_ngcontent-%COMP%]{color:var(--muted-2);font-size:10px;font-weight:760;letter-spacing:.08em;text-transform:uppercase}.compare-readout[_ngcontent-%COMP%] dd[_ngcontent-%COMP%]{margin:0;color:var(--text-strong);font-size:14px;font-weight:760;white-space:nowrap}.compare-readout[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;margin-bottom:3px;color:var(--muted);font-size:11px;font-weight:760;letter-spacing:.08em;text-transform:uppercase}.compare-readout[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text-strong);font-size:22px;font-weight:760}.compare-readout[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{max-width:920px;margin:5px 0 0;color:var(--muted);font-size:12px;line-height:1.45}.compare-caveat[_ngcontent-%COMP%]{color:var(--warning-text, #ffcf75)!important}.comparison-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:7px}.comparison-grid[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{display:grid;gap:3px;border:1px solid var(--line);border-radius:10px;padding:8px 9px;background:var(--surface-soft)}.comparison-grid[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .comparison-grid[_ngcontent-%COMP%] em[_ngcontent-%COMP%], .cost-row[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .cost-row[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{color:var(--muted);font-size:12px;font-style:normal}.comparison-grid[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text-strong);font-size:15px;font-weight:760;letter-spacing:0}.comparison-section[_ngcontent-%COMP%]{display:grid;gap:8px}.section-heading[_ngcontent-%COMP%]{display:flex;align-items:end;justify-content:space-between;gap:14px}.section-heading[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;color:var(--text-strong);font-size:15px;font-weight:760}.section-heading[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;color:var(--muted);font-size:12px}.driver-list[_ngcontent-%COMP%]{display:grid;gap:6px}.driver-list[_ngcontent-%COMP%] article[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(155px,.34fr) minmax(0,1fr);gap:10px;align-items:start;border:1px solid var(--line);border-left:3px solid var(--accent);border-radius:10px;padding:8px 10px;background:color-mix(in srgb,var(--surface-soft) 58%,transparent)}.driver-list[_ngcontent-%COMP%] article.medium[_ngcontent-%COMP%]{border-left-color:var(--warning)}.driver-list[_ngcontent-%COMP%] article.high[_ngcontent-%COMP%]{border-left-color:var(--danger)}.driver-list[_ngcontent-%COMP%] article[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{display:grid;gap:2px;min-width:0}.driver-list[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--muted-2);font-size:10px;font-weight:760;letter-spacing:.08em;text-transform:uppercase}.driver-list[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text-strong);font-size:14px;font-weight:760;line-height:1.1;overflow-wrap:anywhere}.driver-list[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;color:var(--text);font-size:12px;line-height:1.35}.cost-table[_ngcontent-%COMP%]{display:grid;overflow:auto hidden;border:1px solid var(--line);border-radius:12px;background:var(--surface)}.cost-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(140px,1.05fr) minmax(110px,.82fr) minmax(128px,.95fr) minmax(190px,1.25fr) minmax(96px,.7fr) minmax(74px,.5fr);gap:8px;align-items:start;min-width:760px;border-bottom:1px solid var(--line);padding:8px 9px}.cost-row[_ngcontent-%COMP%]:last-child{border-bottom:0}.cost-row-heading[_ngcontent-%COMP%]{background:var(--surface-soft);font-size:11px;font-weight:720;text-transform:uppercase}.cost-row[_ngcontent-%COMP%] strong[_ngcontent-%COMP%], .cost-row[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:grid;gap:3px}.cost-row[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text-strong)}.cost-row[_ngcontent-%COMP%] .token-movement[_ngcontent-%COMP%]{gap:4px}.cost-row[_ngcontent-%COMP%] .token-movement[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{display:block;color:var(--text-strong);font-size:12px}.cost-row[_ngcontent-%COMP%] .token-movement[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{line-height:1.35}.saving[_ngcontent-%COMP%]{color:var(--success-text, #35d07f)!important}.warning-text[_ngcontent-%COMP%]{color:var(--warning-text, #ffcf75)!important;font-weight:900}.empty[_ngcontent-%COMP%]{margin:0;color:var(--muted)}@media(max-width:900px){.compare-header[_ngcontent-%COMP%], .compare-readout[_ngcontent-%COMP%], .section-heading[_ngcontent-%COMP%]{display:grid}.comparison-grid[_ngcontent-%COMP%], .driver-list[_ngcontent-%COMP%] article[_ngcontent-%COMP%], .selectors[_ngcontent-%COMP%], .compare-readout[_ngcontent-%COMP%] dl[_ngcontent-%COMP%], .cost-row[_ngcontent-%COMP%]{grid-template-columns:1fr}.cost-row[_ngcontent-%COMP%], .selectors[_ngcontent-%COMP%]{min-width:0}}"]})};function $(r){return String(r??"").toLowerCase().replace(/[^\p{L}\p{N}#/@._-]+/gu," ").replace(/\s+/g," ").trim()}export{oe as ComparePageComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as c,b as l}from"./chunk-WOIYAEKB.js";var u={version:"github-copilot-usage-pricing-2026-07-05",sourceUrl:"https://docs.github.com/en/copilot/reference/copilot-billing/models-and-pricing",sourceLabel:"GitHub Docs: Models and pricing for GitHub Copilot",snapshotDate:"2026-07-05",importedAt:"2026-07-05",fallbackModel:"GPT-5.4",models:{"GPT-5 mini":{provider:"OpenAI",releaseStatus:"GA",category:"Lightweight",input:.25,cachedInput:.025,output:2},"GPT-5.3-Codex":{provider:"OpenAI",releaseStatus:"GA",category:"Powerful",input:1.75,cachedInput:.175,output:14},"GPT-5.4":{provider:"OpenAI",releaseStatus:"GA",category:"Versatile",input:2.5,cachedInput:.25,output:15,tierLabel:"Default",tierThresholdLabel:"Up to 272K input tokens",tiers:[{id:"long-context",label:"Long context",thresholdInputTokensExclusive:272e3,thresholdLabel:"Over 272K input tokens",input:5,cachedInput:.5,output:22.5}]},"GPT-5.4 mini":{provider:"OpenAI",releaseStatus:"GA",category:"Lightweight",input:.75,cachedInput:.075,output:4.5},"GPT-5.4 nano":{provider:"OpenAI",releaseStatus:"GA",category:"Lightweight",input:.2,cachedInput:.02,output:1.25},"GPT-5.5":{provider:"OpenAI",releaseStatus:"GA",category:"Powerful",input:5,cachedInput:.5,output:30,tierLabel:"Default",tierThresholdLabel:"Up to 272K input tokens",tiers:[{id:"long-context",label:"Long context",thresholdInputTokensExclusive:272e3,thresholdLabel:"Over 272K input tokens",input:10,cachedInput:1,output:45}]},"Claude Haiku 4.5":{provider:"Anthropic",releaseStatus:"GA",category:"Versatile",input:1,cachedInput:.1,cacheWrite:1.25,output:5},"Claude Sonnet 4":{provider:"Anthropic",releaseStatus:"GA",category:"Versatile",input:3,cachedInput:.3,cacheWrite:3.75,output:15},"Claude Sonnet 4.5":{provider:"Anthropic",releaseStatus:"GA",category:"Versatile",input:3,cachedInput:.3,cacheWrite:3.75,output:15},"Claude Sonnet 4.6":{provider:"Anthropic",releaseStatus:"GA",category:"Versatile",input:3,cachedInput:.3,cacheWrite:3.75,output:15},"Claude Opus 4.5":{provider:"Anthropic",releaseStatus:"GA",category:"Powerful",input:5,cachedInput:.5,cacheWrite:6.25,output:25},"Claude Opus 4.6":{provider:"Anthropic",releaseStatus:"GA",category:"Powerful",input:5,cachedInput:.5,cacheWrite:6.25,output:25},"Claude Opus 4.7":{provider:"Anthropic",releaseStatus:"GA",category:"Powerful",input:5,cachedInput:.5,cacheWrite:6.25,output:25},"Claude Opus 4.8":{provider:"Anthropic",releaseStatus:"GA",category:"Powerful",input:5,cachedInput:.5,cacheWrite:6.25,output:25},"Claude Sonnet 5":{provider:"Anthropic",releaseStatus:"GA",category:"Versatile",input:2,cachedInput:.2,cacheWrite:2.5,output:10,note:"GitHub documents this promotional pricing through August 31, 2026."},"Claude Opus 4.8 (fast mode)":{provider:"Anthropic",releaseStatus:"GA",category:"Powerful",input:10,cachedInput:1,cacheWrite:12.5,output:50,aliases:["Claude Opus 4.8 fast","claude-opus-4.8-fast"],note:"GitHub's table includes '(preview)' in the model label."},"Claude Fable 5":{provider:"Anthropic",releaseStatus:"GA",category:"Powerful",input:10,cachedInput:1,cacheWrite:12.5,output:50},"Gemini 2.5 Pro":{provider:"Google",releaseStatus:"GA",category:"Powerful",input:1.25,cachedInput:.125,output:10},"Gemini 3 Flash":{provider:"Google",releaseStatus:"Public preview",category:"Lightweight",input:.5,cachedInput:.05,output:3},"Gemini 3.1 Pro":{provider:"Google",releaseStatus:"Public preview",category:"Powerful",input:2,cachedInput:.2,output:12,tierLabel:"Default",tierThresholdLabel:"Up to 200K input tokens",tiers:[{id:"long-context",label:"Long context",thresholdInputTokensExclusive:2e5,thresholdLabel:"Over 200K input tokens",input:4,cachedInput:.4,output:18}]},"Gemini 3.5 Flash":{provider:"Google",releaseStatus:"GA",category:"Lightweight",input:1.5,cachedInput:.15,output:9},"Raptor mini":{provider:"Fine-tuned (GitHub)",releaseStatus:"GA",category:"Versatile",input:.25,cachedInput:.025,output:2},"MAI-Code-1-Flash":{provider:"Microsoft",releaseStatus:"GA",category:"Lightweight",input:.75,cachedInput:.075,output:4.5},"Kimi K2.7 Code":{provider:"Moonshot AI",releaseStatus:"GA",category:"Versatile",input:.95,cachedInput:.19,output:4}}};var v=u.version,U=u.sourceUrl,M=u.sourceLabel,_=u.snapshotDate,E=u.importedAt,A=u.fallbackModel,P=.01,O="https://docs.github.com/en/copilot/concepts/billing/usage-based-billing-for-organizations-and-enterprises",a=u.models,y=[{id:"business-standard",label:"Copilot Business",shortLabel:"Business",creditsPerUserMonthly:1900,period:"Standard monthly allowance",note:"Included AI credits are pooled at the billing entity level."},{id:"enterprise-standard",label:"Copilot Enterprise",shortLabel:"Enterprise",creditsPerUserMonthly:3900,period:"Standard monthly allowance",note:"Included AI credits are pooled at the billing entity level."},{id:"business-promo",label:"Copilot Business promo",shortLabel:"Business promo",creditsPerUserMonthly:3e3,period:"Existing-customer promo, Jun 1-Sep 1 2026",note:"GitHub documents this temporary higher allowance for existing Business customers."},{id:"enterprise-promo",label:"Copilot Enterprise promo",shortLabel:"Enterprise promo",creditsPerUserMonthly:7e3,period:"Existing-customer promo, Jun 1-Sep 1 2026",note:"GitHub documents this temporary higher allowance for existing Enterprise customers."}];function p(e){return String(e??"").replace(/^copilot\//i,"").toLowerCase().replace(/[^a-z0-9]+/g," ").trim().replace(/\s+/g," ")}function g(e){let r=String(e??"").replace(/^copilot\//i,"").trim(),n=p(r),t=Object.keys(a),i=t.flatMap(o=>(a[o].aliases??[]).map(s=>({name:o,aliasKey:p(s)})));return t.find(o=>p(o)===n)??i.find(({aliasKey:o})=>o===n)?.name??t.find(o=>n.includes(p(o)))??i.find(({aliasKey:o})=>n.includes(o))?.name??(r||"Unknown model")}function x(e){let r=g(e);return a[r]?r:A}function S(e){return a[e||""]??a[A]}function w(e,r){let n=S(e),t=Math.max(0,r.input)+Math.max(0,r.cachedInput),i=[...n.tiers??[]].sort((o,s)=>s.thresholdInputTokensExclusive-o.thresholdInputTokensExclusive).find(o=>t>o.thresholdInputTokensExclusive);return i?l(c(c({},n),i),{tiers:n.tiers}):n}function d(e,r){let n=g(e);return(r||x(n))!==n||!a[n]}function G(e,r){let n=g(e),t=r||x(n);return d(n,t)?`${n||"Unknown model"} is priced with the ${t} row because that raw model id is not in the local GitHub pricing table.`:"This model matched a GitHub price row directly."}function D(e,r){let n=e.pricingModel||e.model,t=w(n,e.tokens),i=e.costBreakdown?.inputUsd??h(e.tokens.input,t.input),o=e.costBreakdown?.cachedInputUsd??h(e.tokens.cachedInput,t.cachedInput),s=e.costBreakdown?.cacheWriteUsd??h(e.tokens.cacheWrite,t.cacheWrite??0),m=e.costBreakdown?.outputUsd??h(e.tokens.output,t.output),I=i+o+s+m,f=e.pricingTiers?.length?e.pricingTiers:[t.label??t.tierLabel??"Default"];return l(c({},e),{provider:t.provider,releaseStatus:t.releaseStatus,category:t.category,inputRate:t.input,cachedInputRate:t.cachedInput,cacheWriteRate:t.cacheWrite??0,outputRate:t.output,inputUsd:i,cachedInputUsd:o,cacheWriteUsd:s,outputUsd:m,totalUsd:I,share:r>0?I/r*100:0,usesFallbackPrice:d(e.model,n),pricingTierLabel:f.join(" + "),hasMixedPricingTiers:f.length>1})}function h(e,r){return e/1e6*r}function T(e){return e.input+e.cachedInput+e.cacheWrite+e.output}function H(e){return T(e.tokens)}function N(e){return b(e.sourceUsage?.usd)??e.cost.usd}function K(e){return b(e.sourceUsage?.credits)??e.cost.usd/P}function V(e){return e.sourceUsage?"GitHub usage":"Estimate fallback"}function z(e){return b(e.sourceUsage?.usd)}function j(e,r){return e===0?null:(r-e)/e*100}var J=d;function $(e,r){return e.size!==r.size?!0:[...e].some(n=>!r.has(n))}function b(e){return typeof e=="number"&&Number.isFinite(e)?e:null}export{v as a,U as b,M as c,_ as d,E as e,P as f,O as g,a as h,y as i,p as j,x as k,w as l,d as m,G as n,D as o,T as p,H as q,N as r,K as s,V as t,z as u,j as v,J as w,$ as x};
|