(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,26463,e=>{"use strict";var t=e.i(16043);let n=t.forwardRef(function({title:e,titleId:n,...s},a){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":n},s),e?t.createElement("title",{id:n},e):null,t.createElement("path",{fillRule:"evenodd",d:"M16.28 11.47a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 0 1-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 0 1 1.06-1.06l7.5 7.5Z",clipRule:"evenodd"}))});e.s(["f",0,n],26463)},227339,e=>{"use strict";e.s(["y",0,{tickLine:!1,axisLine:!1,fontSize:12,tick:{fill:"hsl(var(--muted-foreground))"}},"Y",0,260,"A",0,{top:8,right:16,bottom:8,left:-16},"k",0,240,"j",0,150,"n",0,400,"W",0,{cost:"var(--chart-cost)",requests:"var(--chart-requests)",tokensPrompt:"var(--chart-tokens-prompt)",tokensCompletion:"var(--chart-tokens-completion)",tokensReasoning:"var(--chart-tokens-reasoning)",tokensCached:"var(--chart-tokens-cached)",tokensUncached:"var(--chart-tokens-uncached)",credits:"var(--chart-credits)",byok:"var(--chart-byok)"},"Q",0,function(e,t){return Math.max(e*(t?24:40),t?140:200)}])},741155,e=>{"use strict";var t=e.i(659350),n=e.i(663456),s=e.i(136562),a=e.i(535072),i=e.i(624112),r=e.i(751155);e.s(["f",0,function(e){let o,l,c,p,d,m=(0,n.c)(35);if((0,a.x)()){let n,a,i,o,l=e.side??"bottom",c=e.align,p=e.sideOffset,d=e.open,h=e.onOpenChange,f=e.inline?"inline-block":"flex items-center justify-center";return m[0]!==f?(n=(0,s.f)("p-0",f),m[0]=f,m[1]=n):n=m[1],m[2]!==e.className?(a=(0,s.f)("w-52 p-2 text-xs",e.className),m[2]=e.className,m[3]=a):a=m[3],m[4]!==e.content||m[5]!==a?(i=(0,t.jsx)("div",{className:a,children:e.content}),m[4]=e.content,m[5]=a,m[6]=i):i=m[6],m[7]!==e.align||m[8]!==e.children||m[9]!==e.onOpenChange||m[10]!==e.open||m[11]!==e.sideOffset||m[12]!==l||m[13]!==n||m[14]!==i?(o=(0,t.jsx)(r.Tooltip,{side:l,align:c,sideOffset:p,open:d,onOpenChange:h,className:n,content:i,children:e.children}),m[7]=e.align,m[8]=e.children,m[9]=e.onOpenChange,m[10]=e.open,m[11]=e.sideOffset,m[12]=l,m[13]=n,m[14]=i,m[15]=o):o=m[15],o}let h=e.open,f=e.onOpenChange,u=e.inline&&"inline-block";m[16]!==u?(o=(0,s.f)(u),m[16]=u,m[17]=o):o=m[17];let g="button"===e.children.type;m[18]!==e.children||m[19]!==o||m[20]!==g?(l=(0,t.jsx)(i.J,{className:o,nativeButton:g,render:e.children}),m[18]=e.children,m[19]=o,m[20]=g,m[21]=l):l=m[21];let x=e.side,_=e.align,v=e.sideOffset;return m[22]!==e.className?(c=(0,s.f)("w-52 p-2",e.className),m[22]=e.className,m[23]=c):c=m[23],m[24]!==e.align||m[25]!==e.content||m[26]!==e.side||m[27]!==e.sideOffset||m[28]!==c?(p=(0,t.jsx)(i.T,{side:x,align:_,sideOffset:v,text:"body",className:c,children:e.content}),m[24]=e.align,m[25]=e.content,m[26]=e.side,m[27]=e.sideOffset,m[28]=c,m[29]=p):p=m[29],m[30]!==e.onOpenChange||m[31]!==e.open||m[32]!==p||m[33]!==l?(d=(0,t.jsxs)(i.V,{open:h,onOpenChange:f,children:[l,p]}),m[30]=e.onOpenChange,m[31]=e.open,m[32]=p,m[33]=l,m[34]=d):d=m[34],d}])},648888,e=>{"use strict";e.s(["f",0,function(e){return e.slug?`/apps/${e.slug}`:`/apps/url/${encodeURIComponent(e.origin_url)}`}])},973251,e=>{"use strict";var t=e.i(659350),n=e.i(663456),s=e.i(136562),a=e.i(227339),i=e.i(670168),r=e.i(775922),o=e.i(336810),l=e.i(695880),c=e.i(885024),p=e.i(618115);e.i(707060);var d=e.i(288265);e.i(16043);var m=e.i(369677),h=e.i(447906),f=e.i(585351),u=e.i(444731);let g=[o.F.Blue,a.W.tokensUncached],x={isRanking:!1,position:"bottom",showPercentage:!1,forceSingleColumn:!0};function _(e){let a,o,p,m,f,u,_,j=(0,n.c)(32),{appStats:k,isAppStatsLoading:b,cachedAt:N}=e,y=(0,d.f)(),w=y("Top 5 Apps"),O=y("Rest of OpenRouter");if(k?.top_apps_chart,k?.model_chart,j[0]!==k?.model_chart||j[1]!==k?.top_apps_chart||j[2]!==O||j[3]!==w){let e,t,n=new Map;for(let t of(j[5]!==k?.top_apps_chart?(e=k?.top_apps_chart??[],j[5]=k?.top_apps_chart,j[6]=e):e=j[6],e))n.set(t.date,t.total_prompt_tokens+t.total_completion_tokens);j[7]!==k?.model_chart?(t=k?.model_chart??[],j[7]=k?.model_chart,j[8]=t):t=j[8],a=t.toReversed().map(e=>{let t=e.total_prompt_tokens+e.total_completion_tokens,s=n.get(e.date)??0,a=Math.max(0,t-s);return{x:e.date,ys:{[w]:s,[O]:a}}}),j[0]=k?.model_chart,j[1]=k?.top_apps_chart,j[2]=O,j[3]=w,j[4]=a}else a=j[4];let C=a;if(j[9]!==C||j[10]!==O||j[11]!==w){let e;j[13]!==O||j[14]!==w?(e=e=>(e.ys[w]??0)>0||(e.ys[O]??0)>0,j[13]=O,j[14]=w,j[15]=e):e=j[15],o=C.some(e),j[9]=C,j[10]=O,j[11]=w,j[12]=o}else o=j[12];let A=o;if(b||!k){let e;return j[16]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(i.A,{count:5,skeletonClassName:"h-12 w-full"}),j[16]=e):e=j[16],e}if(0===k.top_apps.length){let e,n=y("Not enough data for apps using this model yet.");return j[17]!==n?(e=(0,t.jsx)(r.f,{message:n,icon:"app",height:"20rem"}),j[17]=n,j[18]=e):e=j[18],e}return j[19]===Symbol.for("react.memo_cache_sentinel")?(p=(0,s.f)("mx-auto w-full","flex flex-col gap-8 lg:flex-row lg:gap-16"),j[19]=p):p=j[19],j[20]!==k.top_apps?(m=k.top_apps.map(v),j[20]=k.top_apps,j[21]=m):m=j[21],j[22]!==m?(f=(0,t.jsx)("div",{className:"flex flex-col gap-5 lg:w-1/2 lg:justify-between lg:gap-0",children:m}),j[22]=m,j[23]=f):f=j[23],j[24]!==N||j[25]!==C||j[26]!==y||j[27]!==A?(u=(0,t.jsx)("div",{className:"lg:w-1/2",children:A?(0,t.jsx)(h.f,{sectionId:"apps",chartId:"top_apps",title:y("Token usage by top apps"),inSectionTitle:!0,children:(0,t.jsx)("div",{"data-chart-share-surface":"",children:(0,t.jsx)(l.StackedBarChart,{colors:g,data:C,yAxisHidden:!0,legendConfig:x,forecast:c.n.OneDay,forecastFromTimestamp:N})})}):(0,t.jsx)(r.f,{message:y("No chart data available"),icon:"bar",height:"15rem"})}),j[24]=N,j[25]=C,j[26]=y,j[27]=A,j[28]=u):u=j[28],j[29]!==f||j[30]!==u?(_=(0,t.jsxs)("div",{className:p,children:[f,u]}),j[29]=f,j[30]=u,j[31]=_):_=j[31],_}function v(e,n){return(0,t.jsx)(u.f,{rank:n+1,appAnalytics:e},e.app_id)}e.s(["ModelApps",0,function(){let e,s,a,i=(0,n.c)(9),{model:r,staticVariant:o}=(0,m.useModelPage)();i[0]!==r.permaslug||i[1]!==o?(e=(0,f.S)({permaslug:r.permaslug,variant:o}),i[0]=r.permaslug,i[1]=o,i[2]=e):e=i[2];let{data:l,isLoading:c}=(0,p.f)(e);return i[3]!==l?.cachedAt?(s=l?.cachedAt??Date.now(),i[3]=l?.cachedAt,i[4]=s):s=i[4],i[5]!==l||i[6]!==c||i[7]!==s?(a=(0,t.jsx)("div",{className:"flex w-full flex-col",children:(0,t.jsx)(_,{appStats:l,isAppStatsLoading:c,cachedAt:s})}),i[5]=l,i[6]=c,i[7]=s,i[8]=a):a=i[8],a}])},662512,function(e){e.n(e.i(973251))},764043,e=>{"use strict";var t=e.i(659350),n=e.i(663456),s=e.i(778553),a=e.i(136562),i=e.i(139697),r=e.i(912147),o=e.i(73668),l=e.i(814492);e.s(["f",0,function(e){let c,p,d,m,h,f=(0,n.c)(9),{app:u,className:g}=e,{entity:x}=(0,o.useEntity)();if(!x.data?.is_internal_admin)return null;f[0]===Symbol.for("react.memo_cache_sentinel")?(c=(0,l.G)(),f[0]=c):c=f[0];let _=`${c}/admin-utils/app-editor?url=${encodeURIComponent(u.origin_url)}`;return f[1]!==g?(p=(0,a.f)("text-warning hover:text-warning/80",g),f[1]=g,f[2]=p):p=f[2],f[3]===Symbol.for("react.memo_cache_sentinel")?(d=(0,t.jsx)(s.f,{className:"size-3"}),f[3]=d):d=f[3],f[4]!==_?(m=(0,t.jsx)(r.f,{href:_,target:"_blank",rel:"noopener noreferrer",className:"no-underline",children:d}),f[4]=_,f[5]=m):m=f[5],f[6]!==p||f[7]!==m?(h=(0,t.jsx)(i.Button,{className:p,variant:"outline",size:"icon-sm",render:m}),f[6]=p,f[7]=m,f[8]=h):h=f[8],h}])},444731,e=>{"use strict";var t=e.i(659350),n=e.i(663456),s=e.i(26463),a=e.i(782143),i=e.i(136562),r=e.i(987457),o=e.i(829622),l=e.i(954217),c=e.i(741155),p=e.i(195362),d=e.i(138257),m=e.i(335609),h=e.i(648888);e.i(707060);var f=e.i(196991),u=e.i(16043),g=e.i(764043);function x(e){let s,i,r,o,l=(0,n.c)(8),{appAnalytics:c}=e,m=(0,d.useLocale)(),h=c.total_tokens;return l[0]!==m||l[1]!==h?(s=(0,a.f)(h,{locale:m,preset:"compact-rounded-thousands"})??"—",l[0]=m,l[1]=h,l[2]=s):s=l[2],l[3]!==s?(i=(0,t.jsx)("span",{children:s}),l[3]=s,l[4]=i):i=l[4],l[5]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)(f.T,{children:(0,t.jsx)("span",{className:"ml-1",children:"tokens"})}),l[5]=r):r=l[5],l[6]!==i?(o=(0,t.jsx)(p.R,{className:"text-muted-foreground text-xs",children:(0,t.jsxs)("div",{children:[i,r]})}),l[6]=i,l[7]=o):o=l[7],o}e.s(["f",0,function(e){var a;let d,_,v,j,k,b,N,y,w,O,C,A,R,S,T,B=(0,n.c)(35),{appAnalytics:L,rank:U}=e,{app:z}=L,[I,M]=(0,u.useState)(z);if(!I)return null;B[0]!==I?(d=new URL((a=I).origin_url),_={name:a.title||(0,m.d)(d.host+d.pathname),description:a.description},B[0]=I,B[1]=_):_=B[1];let F=_,P=I.favicon_url||I.main_url||I.origin_url||"";B[2]!==U?(v=(0,t.jsxs)(p.r,{children:[U,"."]}),B[2]=U,B[3]=v):v=B[3],B[4]!==I.icon_class_name?(j=(0,i.f)("size-full",I.icon_class_name),B[4]=I.icon_class_name,B[5]=j):j=B[5];let E=I.favicon_url?I.id:void 0;return B[6]!==j||B[7]!==E||B[8]!==P?(k=(0,t.jsx)(r.f,{variant:"app",className:"size-6 shrink-0",children:(0,t.jsx)(o.RemoteFavicon,{className:j,faviconFor:P,curatedIconAppId:E})}),B[6]=j,B[7]=E,B[8]=P,B[9]=k):k=B[9],B[10]!==I?(b=(0,h.f)(I),B[10]=I,B[11]=b):b=B[11],B[12]===Symbol.for("react.memo_cache_sentinel")?(N=(0,t.jsx)(s.f,{className:"inline w-4 transition-transform group-hover:translate-x-0.5"}),B[12]=N):N=B[12],B[13]!==F.name||B[14]!==b?(y=(0,t.jsxs)(l.TextLink,{size:"body",weight:"medium",className:"group block truncate",href:b,children:[F.name," ",N]}),B[13]=F.name,B[14]=b,B[15]=y):y=B[15],B[16]!==F.description?(w=F.description?(0,t.jsx)(c.f,{content:F.description,side:"bottom",align:"start",inline:!0,children:(0,t.jsx)("span",{className:"truncate cursor-help",children:F.description})}):(0,t.jsx)(f.T,{children:(0,t.jsx)("span",{className:"text-faint",children:"new"})}),B[16]=F.description,B[17]=w):w=B[17],B[18]!==I?(O=(0,t.jsx)(g.f,{app:I,onUpdate:M}),B[18]=I,B[19]=O):O=B[19],B[20]!==O||B[21]!==w?(C=(0,t.jsxs)("div",{className:"text-muted-foreground flex items-center gap-1 text-xs",children:[w,O]}),B[20]=O,B[21]=w,B[22]=C):C=B[22],B[23]!==C||B[24]!==y?(A=(0,t.jsxs)(p.T,{children:[y,C]}),B[23]=C,B[24]=y,B[25]=A):A=B[25],B[26]!==A||B[27]!==k?(R=(0,t.jsxs)(p.B,{children:[k,A]}),B[26]=A,B[27]=k,B[28]=R):R=B[28],B[29]!==L?(S=(0,t.jsx)(x,{appAnalytics:L}),B[29]=L,B[30]=S):S=B[30],B[31]!==R||B[32]!==S||B[33]!==v?(T=(0,t.jsxs)(p.F,{children:[v,R,S]}),B[31]=R,B[32]=S,B[33]=v,B[34]=T):T=B[34],T}])}]); //# sourceMappingURL=0a0g97oedqy5a.js.map