omnigateway 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -1
- package/bin/omni.js +304 -41
- package/gateway.js +570 -44
- package/package.json +1 -1
- package/public/assets/{Chip-D0XSbQUr.js → Chip-C3dIFd8s.js} +1 -1
- package/public/assets/{CopyValue-DAlmkISB.js → CopyValue-DG88CWpN.js} +1 -1
- package/public/assets/{Field-DG1317zr.js → Field-EvdVyEqx.js} +30 -12
- package/public/assets/Lamp-CL0i4yaa.js +26 -0
- package/public/assets/{Rack-CDUOJkS2.js → Rack-DMrfn4-H.js} +5 -5
- package/public/assets/{RequestTable-i3TtCB9m.js → RequestTable-CtuuMOT2.js} +3 -3
- package/public/assets/{SummaryDeck-DrzTQQo5.js → SummaryDeck-DHsYYpYO.js} +2 -2
- package/public/assets/{Toggle-CdMD58sy.js → Toggle-BTie3NY8.js} +1 -1
- package/public/assets/{TokenBreakdown-BC6nqo1v.js → TokenBreakdown-Bf0zsKcd.js} +1 -1
- package/public/assets/{WindowChart-Bqbl-KFO.js → WindowChart-CaPUJ4GJ.js} +2 -2
- package/public/assets/_app.accounts-xCJhRd32.js +70 -0
- package/public/assets/{_app.console-BgA6_yPW.js → _app.console-DS37cfIu.js} +2 -2
- package/public/assets/_app.database-BCwEMrEA.js +24 -0
- package/public/assets/_app.index-DW6wain4.js +67 -0
- package/public/assets/_app.keys-CCU2NB3-.js +120 -0
- package/public/assets/_app.logs-CRC5qDK3.js +46 -0
- package/public/assets/_app.models-B4brzRdK.js +148 -0
- package/public/assets/{_app.plugins._pluginId-B825jp0T.js → _app.plugins._pluginId-CD9KXknf.js} +1 -1
- package/public/assets/_app.settings-NJSb_L2B.js +88 -0
- package/public/assets/_app.usage-BR6a92zI.js +78 -0
- package/public/assets/chevron-down-3tlYNJqZ.js +1 -0
- package/public/assets/chevron-right-kvaJRnfj.js +1 -0
- package/public/assets/client-B9t0CsmA.js +46 -0
- package/public/assets/{dist-BBGxva0Y.js → dist-B8iuo_hI.js} +1 -1
- package/public/assets/index-6rZSWe9j.js +14 -0
- package/public/assets/{login-BBURVBwb.js → login-NuwPF5SS.js} +2 -2
- package/public/assets/plus-CVqm87L-.js +1 -0
- package/public/assets/{preload-helper-B7KDmXJ9.js → preload-helper-1xe0b53X.js} +1 -1
- package/public/assets/{rotate-ccw-Do43Argv.js → rotate-ccw-Dionx_MW.js} +1 -1
- package/public/assets/{shared-DDpLUhCp.js → shared-HVgLEGgl.js} +2 -2
- package/public/assets/{trash-00950_yY.js → trash-Bsi60qJc.js} +1 -1
- package/public/index.html +4 -4
- package/public/assets/Lamp-Dk9XrTCg.js +0 -26
- package/public/assets/_app.accounts-2syjcpos.js +0 -70
- package/public/assets/_app.database-CqSoTi2l.js +0 -24
- package/public/assets/_app.index-BV1kJJjA.js +0 -67
- package/public/assets/_app.keys-CY65Ov9F.js +0 -107
- package/public/assets/_app.logs-PjRK5wqy.js +0 -46
- package/public/assets/_app.models-BfmeeB5e.js +0 -148
- package/public/assets/_app.settings-CdSQyweb.js +0 -88
- package/public/assets/_app.usage--5qFtU1W.js +0 -76
- package/public/assets/chevron-down-Bb5ZGvwk.js +0 -1
- package/public/assets/chevron-right-hwF5mD6-.js +0 -1
- package/public/assets/client-CkeRVeTV.js +0 -39
- package/public/assets/index-Ug93No6D.js +0 -14
- package/public/assets/plus-BgcHxxIr.js +0 -1
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import{$ as e,A as t,At as n,B as r,C as i,Ct as a,D as o,Dt as s,E as c,Et as l,F as u,G as d,H as f,I as p,J as m,K as h,L as g,M as _,Mt as v,N as y,O as b,Ot as x,P as S,Q as C,R as w,S as T,St as E,T as D,Tt as O,U as ee,V as te,W as ne,X as re,Y as ie,Z as ae,_ as oe,_t as se,a as k,at as ce,b as A,bt as j,c as le,ct as ue,d as M,dt as de,et as fe,f as pe,ft as me,g as he,gt as ge,h as _e,ht as ve,i as ye,it as be,j as xe,jt as Se,k as Ce,kt as we,l as Te,lt as Ee,m as De,mt as Oe,n as ke,nt as Ae,o as je,ot as Me,p as Ne,pt as Pe,q as Fe,r as Ie,rt as Le,s as N,st as Re,t as ze,tt as Be,u as P,ut as Ve,v as He,vt as Ue,w as We,wt as Ge,x as F,xt as Ke,y as qe,yt as Je,z as Ye}from"./shared-HVgLEGgl.js";import{G as Xe,I as Ze,L as Qe,N as I,Pt as $e,Tt as et,gt as tt,in as L,jt as nt,vt as rt,z as R}from"./Lamp-CL0i4yaa.js";import{C as it,E as at,S as z,T as B,b as V,r as ot,v as st,y as ct}from"./Panel-CsovmtxF.js";import{D as lt,S as ut,t as dt,w as ft}from"./Rack-DMrfn4-H.js";import{i as pt}from"./Field-EvdVyEqx.js";import{i as mt,n as H,r as U,t as ht}from"./Table-CVDZ69Zx.js";import{i as W,n as gt,r as _t,t as vt}from"./SummaryDeck-DHsYYpYO.js";import*as G from"react";import{PureComponent as yt,forwardRef as bt,useMemo as K,useRef as xt,useState as q}from"react";import{jsx as J,jsxs as Y}from"react/jsx-runtime";import X from"styled-components";function St(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.xAxisId??0}function Ct(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.yAxisId??0}var wt=(e,t,n)=>C(e,`xAxis`,St(e,t),n),Tt=(e,t,n)=>fe(e,`xAxis`,St(e,t),n),Et=(e,t,n)=>C(e,`yAxis`,Ct(e,t),n),Dt=(e,t,n)=>fe(e,`yAxis`,Ct(e,t),n),Ot=j([ue,wt,Et,Tt,Dt],(e,t,n,r,i)=>Ue(e,`xAxis`)?Pe(t,r,!1):Pe(n,i,!1)),kt=j([Be,(e,t)=>t],(e,t)=>e.filter(e=>e.type===`area`).find(e=>e.id===t)),At=e=>{var t=ue(e);return Ue(t,`xAxis`)?`yAxis`:`xAxis`},jt=(e,t)=>At(e)===`yAxis`?Ct(e,t):St(e,t),Mt=(t,n,r)=>e(t,At(t),jt(t,n),r),Nt=j([kt,Mt],(e,t)=>{if(e!=null&&t!=null){var n=e.stackId,r=Ae(e);if(n!=null&&r!=null){var i=(t[n]?.stackedData)?.find(e=>e.key===r);if(i!=null)return i.map(e=>[e[0],e[1]])}}}),Pt=j([kt,Mt],(e,t)=>{if(e!=null&&e.stackId!=null&&t!=null){var n=t[e.stackId];if(n!=null)return n.graphicalItems.map(e=>e.dataKey).filter(O)}}),Ft=j([ue,wt,Et,Tt,Dt,Nt,ce,Ot,kt,be,Pt],(e,t,n,r,i,a,o,s,c,l,u)=>{var d=o.chartData,f=o.dataStartIndex,p=o.dataEndIndex;if(!(c==null||e!==`horizontal`&&e!==`vertical`||t==null||n==null||r==null||i==null||r.length===0||i.length===0||s==null)){var m=c.data,h=m&&m.length>0?m:d?.slice(f,p+1);if(h!=null)return mn({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:f,areaSettings:c,stackedData:a,displayedData:h,chartBaseValue:l,bandSize:s,stackDataKeys:u})}}),It=[`animationElapsedTime`,`isAnimating`,`isEntrance`,`layout`,`isRange`,`stroke`,`connectNulls`],Lt=[`id`,`baseLine`];function Rt(){return Rt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rt.apply(null,arguments)}function zt(e,t){if(e==null)return{};var n,r,i=Bt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Bt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Vt(e){var t=e.alpha,n=e.baseLine,r=e.points,i=e.strokeWidth,a=r[0]?.x,o=r[r.length-1]?.x;if(!Je(a)||!Je(o))return null;var c=t*Math.abs(a-o),l=Math.max(...r.map(e=>e.y||0));return s(n)?l=Math.max(n,l):n&&Array.isArray(n)&&n.length&&(l=Math.max(...n.map(e=>e.y||0),l)),s(l)?G.createElement(`rect`,{x:a<o?a:a-c,y:0,width:c,height:Math.floor(l+(i?parseInt(`${i}`,10):1))}):null}function Ht(e){var t=e.alpha,n=e.baseLine,r=e.points,i=e.strokeWidth,a=r[0]?.y,o=r[r.length-1]?.y;if(!Je(a)||!Je(o))return null;var c=t*Math.abs(a-o),l=Math.max(...r.map(e=>e.x||0));return s(n)?l=Math.max(n,l):n&&Array.isArray(n)&&n.length&&(l=Math.max(...n.map(e=>e.x||0),l)),s(l)?G.createElement(`rect`,{x:0,y:a<o?a:a-c,width:l+(i?parseInt(`${i}`,10):1),height:Math.floor(c)}):null}function Ut(e){var t=e.alpha,n=e.layout,r=e.points,i=e.baseLine,a=e.strokeWidth;return n===`vertical`?G.createElement(Ht,{alpha:t,points:r,baseLine:i,strokeWidth:a}):G.createElement(Vt,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function Wt(e){var t=e.animationElapsedTime,n=t===void 0?1:t,r=e.isAnimating,i=r!==void 0&&r,a=e.isEntrance,o=a!==void 0&&a,s=e.layout,c=e.isRange,l=e.stroke,u=e.connectNulls,d=zt(e,It),f=s===`vertical`?`vertical`:`horizontal`,m=u??!1,h=p(),g=d.id,_=d.baseLine,v=zt(d,Lt),y=Se(v),b=G.createElement(Me,Rt({},d,{id:g,baseLine:_,connectNulls:m,stroke:`none`,className:`recharts-area-area`,layout:f})),x=l!==`none`&&G.createElement(Me,Rt({},y,{className:`recharts-area-curve`,layout:f,type:d.type,connectNulls:m,fill:`none`,stroke:l,points:d.points})),S=l!==`none`&&c&&Array.isArray(_)&&G.createElement(Me,Rt({},y,{className:`recharts-area-curve`,layout:f,type:d.type,connectNulls:m,fill:`none`,stroke:l,points:_}));return o&&(i||n<1)?G.createElement(we,null,G.createElement(`defs`,null,G.createElement(`clipPath`,{id:h},G.createElement(Ut,{alpha:n,points:d.points??[],baseLine:_,layout:f,strokeWidth:d.strokeWidth}))),G.createElement(we,{clipPath:`url(#${h})`},b,x,S)):G.createElement(G.Fragment,null,b,x,S)}var Gt=[`id`],Kt=[`activeDot`,`animationBegin`,`animationDuration`,`animationEasing`,`connectNulls`,`dot`,`fill`,`fillOpacity`,`hide`,`isAnimationActive`,`legendType`,`stroke`,`xAxisId`,`yAxisId`];function qt(){return qt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qt.apply(null,arguments)}function Jt(e,t){if(e==null)return{};var n,r,i=Yt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Yt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Xt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Z(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Xt(Object(n),!0).forEach(function(t){Zt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Zt(e,t,n){return(t=Qt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qt(e){var t=$t(e,`string`);return typeof t==`symbol`?t:t+``}function $t(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var en={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,animationMatchBy:te,animationInterpolateFn:(e,t)=>e==null?[]:t===1?e.flatMap(e=>e.status===`removed`?[]:[e.next]):e.flatMap(e=>e.status===`matched`?[Z(Z({},e.next),{},{x:a(e.prev.x,e.next.x,t),y:a(e.prev.y,e.next.y,t)})]:e.status===`added`?[e.next]:[]),connectNulls:!1,dot:!1,fill:`#3182bd`,fillOpacity:.6,hide:!1,isAnimationActive:`auto`,legendType:`line`,stroke:`#3182bd`,strokeWidth:1,type:`linear`,label:!1,shape:Wt,xAxisId:0,yAxisId:0,zIndex:Le.area};function tn(e,t){return e&&e!==`none`?e:t}var nn=e=>{var t=e.dataKey,n=e.name,r=e.stroke,i=e.fill,a=e.legendType;return[{inactive:e.hide,dataKey:t,type:a,color:tn(r,i),value:ge(n,t),payload:e}]},rn=G.memo(e=>{var t=e.dataKey,n=e.data,r=e.stroke,i=e.strokeWidth,a=e.fill,o=e.name,s=e.hide,c=e.unit,l=e.formatter,u=e.tooltipType,d=e.id,f={dataDefinedOnItem:n,getPosition:x,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:ge(o,t),hide:s,type:u,color:tn(r,a),unit:c,formatter:l,graphicalItemId:d}};return G.createElement(ee,{tooltipEntrySettings:f})});function an(e){var t=e.clipPathId,n=e.points,r=e.props,i=r.needClip,a=r.dot,o=r.dataKey,s=Se(r);return G.createElement(y,{points:n,dot:a,className:`recharts-area-dots`,dotClassName:`recharts-area-dot`,dataKey:o,baseProps:s,needClip:i,clipPathId:t})}function on(e){var t=e.showLabels,n=e.children,r=e.points.map(e=>{var t={x:e.x??0,y:e.y??0,width:0,lowerWidth:0,upperWidth:0,height:0};return Z(Z({},t),{},{value:e.value,payload:e.payload,parentViewBox:void 0,viewBox:t,fill:void 0})});return G.createElement(h,{value:t?r:void 0},n)}function sn(e){var t=e.points,r=e.baseLine,i=e.needClip,a=e.clipPathId,o=e.props,s=e.animationElapsedTime,c=e.isAnimating,l=e.isEntrance,u=o.layout,d=o.type,f=o.stroke,p=o.connectNulls,m=o.isRange,h=o.shape,g=o.id,_=Jt(o,Gt),v=Z(Z({},n(_)),{},{id:g,points:t,connectNulls:p,type:d,baseLine:r,layout:u,stroke:f,isRange:m,animationElapsedTime:s,isAnimating:c,isEntrance:l});return G.createElement(G.Fragment,null,t?.length>1&&G.createElement(we,{clipPath:i?`url(#clipPath-${a})`:void 0},G.createElement(ne,{option:h,DefaultShape:en.shape,shapeProps:v})),G.createElement(an,{points:t,props:_,clipPathId:a}))}function cn(e,t,n){if(s(e)){var r=s(t)?t:void 0;return a(r,e,n)}if(l(e)||Ge(e)){var i=s(t)?t:void 0;return a(i,0,n)}return e}function ln(e){var t=e.needClip,n=e.clipPathId,i=e.props,a=e.previousPointsRef,o=e.previousBaselineRef,s=i.points,c=i.baseLine,l=i.isAnimationActive,u=i.animationBegin,d=i.animationDuration,f=i.animationEasing,p=i.animationMatchBy,m=i.animationInterpolateFn,h=K(()=>({points:s,baseLine:c}),[s,c]),_=Ye(h,o),v=Ee(),y=w(i.onAnimationStart,i.onAnimationEnd),b=y.isAnimating,x=y.handleAnimationStart,S=y.handleAnimationEnd,C=_.startValue;if(v==null)return null;var T=Array.isArray(c)&&Array.isArray(C)?r(C,c,p):Array.isArray(c)?r(null,c,p):null;return G.createElement(g,{animationInput:h,animationIdPrefix:`recharts-area-`,items:s,previousItemsRef:a,isAnimationActive:l,animationBegin:u,animationDuration:d,animationEasing:f,onAnimationStart:x,onAnimationEnd:S,animationInterpolateFn:m,animationMatchBy:p,layout:v},(e,r,a)=>{var o=r===1?c:Array.isArray(c)?m(T,r,v):a?c:cn(c,C,r);return _.syncStepValue(o,r),G.createElement(on,{showLabels:!b,points:s},i.children,G.createElement(sn,{points:e,baseLine:o,needClip:t,clipPathId:n,props:i,animationElapsedTime:r,isAnimating:b||r<1,isEntrance:a}),G.createElement(Fe,{label:i.label}))})}function un(e){var t=e.needClip,n=e.clipPathId,r=e.props,i=xt(null),a=xt();return G.createElement(ln,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}var dn=class extends yt{render(){var e=this.props,t=e.hide,n=e.dot,r=e.points,i=e.className,a=e.top,s=e.left,c=e.needClip,l=e.xAxisId,u=e.yAxisId,f=e.width,p=e.height,m=e.id,h=e.baseLine,g=e.zIndex;if(t)return null;var _=v(`recharts-area`,i),y=m,x=o(n),S=x.r,C=x.strokeWidth,w=d(n),T=S*2+C,E=c?`url(#clipPath-${w?``:`dots-`}${y})`:void 0;return G.createElement(re,{zIndex:g},G.createElement(we,{className:_},c&&G.createElement(`defs`,null,G.createElement(b,{clipPathId:y,xAxisId:l,yAxisId:u}),!w&&G.createElement(`clipPath`,{id:`clipPath-dots-${y}`},G.createElement(`rect`,{x:s-T/2,y:a-T/2,width:f+T,height:p+T}))),G.createElement(un,{needClip:c,clipPathId:y,props:this.props})),G.createElement(xe,{points:r,mainColor:tn(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:E}),this.props.isRange&&Array.isArray(h)&&G.createElement(xe,{points:h,mainColor:tn(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:E}))}};function fn(e){var t=e.activeDot,n=e.animationBegin,r=e.animationDuration,i=e.animationEasing,a=e.connectNulls,o=e.dot,s=e.fill,c=e.fillOpacity,l=e.hide,u=e.isAnimationActive,d=e.legendType,f=e.stroke,p=e.xAxisId,m=e.yAxisId,h=Jt(e,Kt),g=Ve(),v=ae(),y=Ce(p,m).needClip,b=me(),x=Ke(t=>Ft(t,e.id,b))??{},S=x.points,C=x.isRange,w=x.baseLine,T=_();if(g!==`horizontal`&&g!==`vertical`||T==null||v!==`AreaChart`&&v!==`ComposedChart`)return null;var E=T.height,D=T.width,O=T.x,ee=T.y;return!S||!S.length?null:G.createElement(dn,qt({},h,{activeDot:t,animationBegin:n,animationDuration:r,animationEasing:i,baseLine:w,connectNulls:a,dot:o,fill:s,fillOpacity:c,height:E,hide:l,layout:g,isAnimationActive:u,isRange:C,legendType:d,needClip:y,points:S,stroke:f,width:D,left:O,top:ee,xAxisId:p,yAxisId:m}))}var pn=(e,t,n,r,i)=>{var a=n??t;if(s(a))return a;var o=e===`horizontal`?i:r,c=o.scale.domain();if(o.type===`number`){var l=Math.max(c[0],c[1]),u=Math.min(c[0],c[1]);return a===`dataMin`?u:a===`dataMax`||l<0?l:Math.max(Math.min(c[0],c[1]),0)}return a===`dataMin`?c[0]:a===`dataMax`?c[1]:c[0]};function mn(e){var t=e.areaSettings,n=t.connectNulls,r=t.baseValue,i=t.dataKey,a=e.stackedData,o=e.layout,s=e.chartBaseValue,c=e.xAxis,l=e.yAxis,u=e.displayedData,d=e.dataStartIndex,f=e.xAxisTicks,p=e.yAxisTicks,m=e.bandSize,h=e.stackDataKeys,g=a&&a.length,_=pn(o,s,r,c,l),v=o===`horizontal`,y=!1,b=u.map((e,t)=>{var r;if(g)r=a[d+t];else{var o=se(e,i);Array.isArray(o)?(r=o,y=!0):r=[_,o]}var s=r?.[1]??null,u=se(e,i),b=g&&u==null&&h!=null&&h.length>0&&h.every(t=>se(e,t)==null),x=s==null||g&&!n&&u==null||b;return v?{x:Oe({axis:c,ticks:f,bandSize:m,entry:e,index:t}),y:x?null:l.scale.map(s)??null,value:r,payload:e}:{x:x?null:c.scale.map(s)??null,y:Oe({axis:l,ticks:p,bandSize:m,entry:e,index:t}),value:r,payload:e}});return{points:b,baseLine:(g||y?b.map(e=>{var t=Array.isArray(e.value)?e.value[0]:null;return v?{x:e.x,y:t!=null&&e.y!=null?l.scale.map(t)??null:null,payload:e.payload}:{x:t==null?null:c.scale.map(t)??null,y:e.y,payload:e.payload}}):v?l.scale.map(_):c.scale.map(_))??0,isRange:y}}function hn(e){var t=E(e,en),n=me();return G.createElement(u,{id:t.id,type:`area`},e=>G.createElement(G.Fragment,null,G.createElement(f,{legendPayload:nn(t)}),G.createElement(rn,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,formatter:t.formatter,tooltipType:t.tooltipType,id:e}),G.createElement(S,{type:`area`,id:e,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:ve(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),G.createElement(fn,qt({},t,{id:e}))))}var gn=G.memo(hn,Re);gn.displayName=`Area`;var _n=[`axis`],vn=bt((e,t)=>G.createElement(i,{chartName:`AreaChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:_n,tooltipPayloadSearcher:ie,categoricalChartProps:e,ref:t})),yn=[`axis`],bn=bt((e,t)=>G.createElement(i,{chartName:`ComposedChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:yn,tooltipPayloadSearcher:ie,categoricalChartProps:e,ref:t})),xn=53,Q=9,$=2,Sn=X.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
gap: ${$}px;
|
|
4
|
+
`,Cn=X.div`
|
|
5
|
+
display: grid;
|
|
6
|
+
grid-template-rows: repeat(7, ${Q}px);
|
|
7
|
+
gap: ${$}px;
|
|
8
|
+
padding-top: ${11}px;
|
|
9
|
+
font-size: 9px;
|
|
10
|
+
color: ${({theme:e})=>e.color.inkFaint};
|
|
11
|
+
`,wn=X.div`
|
|
12
|
+
line-height: ${Q}px;
|
|
13
|
+
padding-right: 2px;
|
|
14
|
+
text-align: right;
|
|
15
|
+
`,Tn=X.div`
|
|
16
|
+
display: grid;
|
|
17
|
+
grid-template-columns: repeat(${xn}, ${Q}px);
|
|
18
|
+
gap: ${$}px;
|
|
19
|
+
height: ${Q}px;
|
|
20
|
+
font-size: 9px;
|
|
21
|
+
color: ${({theme:e})=>e.color.inkFaint};
|
|
22
|
+
`,En=X.div`
|
|
23
|
+
white-space: nowrap;
|
|
24
|
+
line-height: ${Q}px;
|
|
25
|
+
`,Dn=X.div`
|
|
26
|
+
display: grid;
|
|
27
|
+
grid-template-columns: repeat(${xn}, ${Q}px);
|
|
28
|
+
gap: ${$}px;
|
|
29
|
+
`,On=X.div`
|
|
30
|
+
display: grid;
|
|
31
|
+
grid-template-rows: repeat(7, ${Q}px);
|
|
32
|
+
gap: ${$}px;
|
|
33
|
+
`,kn=X.div`
|
|
34
|
+
width: ${Q}px;
|
|
35
|
+
height: ${Q}px;
|
|
36
|
+
border-radius: 2px;
|
|
37
|
+
background: ${({$level:e})=>e===0?`var(--panel-sunk)`:`color-mix(in oklch, var(--accent) ${[0,24,46,70,100][e]??100}%, var(--panel-sunk))`};
|
|
38
|
+
border: 1px solid var(--rule);
|
|
39
|
+
visibility: ${({$future:e})=>e?`hidden`:`visible`};
|
|
40
|
+
|
|
41
|
+
&:hover,
|
|
42
|
+
&:focus-visible {
|
|
43
|
+
outline: 1px solid var(--ink-dim);
|
|
44
|
+
outline-offset: 1px;
|
|
45
|
+
}
|
|
46
|
+
`,An=X(z)`
|
|
47
|
+
gap: ${$}px;
|
|
48
|
+
`,jn=X(V)`
|
|
49
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
50
|
+
font-size: 11px;
|
|
51
|
+
`;function Mn(e){let t=e.filter(e=>e>0).sort((e,t)=>e-t);if(t.length===0)return[0,0,0];let n=e=>t[Math.min(t.length-1,Math.floor(t.length*e))]??0;return[n(.25),n(.5),n(.75)]}function Nn(e,[t,n,r]){return e<=0?0:e<=t?1:e<=n?2:e<=r?3:4}function Pn({days:e,now:t,dayOffsetMinutes:n=null}){let[r,i]=q(`tokens`),[a,o]=q(null),s=he(r),c=K(()=>{let r=new Map;for(let t of e){let e=Number(t.key);Number.isFinite(e)&&r.set(qe(e,n),{requests:t.requests,errors:t.errors,costUsd:t.costUsd,inputTokens:t.inputTokens,outputTokens:t.outputTokens,cacheReadTokens:t.cacheReadTokens,cacheWriteTokens:t.cacheWriteTokens,rtkSavedTokens:t.rtkSavedTokens,rtkAppliedRequests:t.rtkAppliedRequests,durationMsSum:t.durationMsSum})}let i=qe(t,n),a=le(i,6-De(i,n)-370,n);return Array.from({length:xn},()=>Array.from({length:7},()=>{let e=a;return a=le(a,1,n),{at:e,totals:r.get(e)??N,future:e>i}}))},[e,t,n]),l=c.flat(),u=Mn(l.map(e=>s.of({key:``,...e.totals}))),d=l.reduce((e,t)=>Te(e,M(t.totals)),N),f=l.reduce((e,t)=>e+ +(t.totals.requests>0),0),p=(e,t)=>`${e}: ${I(t.requests)} requests, ${I(P(t))} tokens, ${R(t.costUsd)}`;return J(ot,{legend:`Activity`,meta:a===null?`${I(f)} active days`:void 0,actions:J(gt,{children:Ie.map(e=>J(_t,{type:`button`,$size:`sm`,$on:e.id===r,"aria-pressed":e.id===r,onClick:()=>i(e.id),children:e.label},e.id))}),children:Y(B,{$gap:2,children:[J(it,{children:J(B,{$gap:1,style:{width:611},children:Y(Sn,{children:[J(Cn,{"aria-hidden":`true`,children:[``,`Mon`,``,`Wed`,``,`Fri`,``].map((e,t)=>J(wn,{children:e},t))}),Y(B,{$gap:1,children:[J(Tn,{"aria-hidden":`true`,children:c.map((e,t)=>{let n=e[0],r=c[t-1]?.[0],i=n!==void 0&&(r===void 0||new Date(r.at).getMonth()!==new Date(n.at).getMonth());return J(En,{children:i&&n!==void 0?new Date(n.at).toLocaleDateString(`en-GB`,{month:`short`}):``},n?.at??t)})}),J(Dn,{role:`grid`,"aria-label":`${s.label} per day over the last year`,children:c.map(e=>J(On,{role:`row`,children:e.map(e=>J(kn,{role:`gridcell`,tabIndex:-1,"aria-label":p(Ne(e.at),e.totals),title:p(Ne(e.at),e.totals),$future:e.future,$level:e.future?0:Nn(s.of({key:``,...e.totals}),u),onMouseEnter:()=>o(e),onMouseLeave:()=>o(null)},e.at))},e[0]?.at))})]})]})})}),Y(z,{$justify:`space-between`,$wrap:!0,children:[J(jn,{children:a===null?p(`Last 12 months`,d):p(Ne(a.at),a.totals)}),Y(z,{$gap:1,children:[J(ct,{children:`Less`}),J(An,{"aria-hidden":`true`,children:[0,1,2,3,4].map(e=>J(kn,{$level:e,$future:!1},e))}),J(ct,{children:`More`})]})]})]})})}function Fn({buckets:e,by:t,since:n,until:r,metric:i,names:a,dayOffsetMinutes:o}){let s=F(n,r,t,o),c=new Map,l=new Map;for(let n of e){let e=n.split??`unknown`;c.set(e,Te(c.get(e)??N,n));let r=l.get(e)??new Map,a=_e(n.key,t);r.set(a,(r.get(a)??0)+i.of(n)),l.set(e,r)}let u=[...c.entries()].sort((e,t)=>i.of(M(t[1]))-i.of(M(e[1])));return J(it,{children:Y(ht,{children:[J(`thead`,{children:Y(`tr`,{children:[J(U,{children:`Key`}),J(U,{children:`Trend`}),J(U,{$align:`right`,children:`Requests`}),J(U,{$align:`right`,children:`Failed`}),J(U,{$align:`right`,children:`Tokens`}),J(U,{$align:`right`,children:`Mean`}),J(U,{$align:`right`,children:`Cost`})]})}),J(`tbody`,{children:u.map(([e,t])=>{let n=l.get(e)??new Map,r=e===`unknown`?`Unattributed`:a.get(e)??e;return Y(mt,{children:[J(H,{children:J(at,{style:{display:`block`,maxWidth:`28ch`},children:r})}),J(H,{style:{width:120},children:J(ut,{values:s.map(e=>n.get(e)??0),height:20,label:`${r}: ${i.format(i.of(M(t)))} over the window`})}),J(H,{$align:`right`,$mono:!0,children:I(t.requests)}),J(H,{$align:`right`,$mono:!0,style:t.errors>0?{color:`var(--down)`}:void 0,children:Qe(t.requests===0?0:t.errors/t.requests,0)}),J(H,{$align:`right`,$mono:!0,children:I(P(t))}),J(H,{$align:`right`,$mono:!0,children:Ze(t.requests===0?null:t.durationMsSum/t.requests)}),J(H,{$align:`right`,$mono:!0,children:R(t.costUsd)})]},e)})})]})})}var In=6,Ln=`__other__`,Rn=`unknown`;function zn(e,t,n){let r=n.get(t);return r===void 0?e.find(e=>e.models.some(e=>e.id===t))?.id??null:r}function Bn(e,t){return e===null?`var(--ink-faint)`:`color-mix(in oklch, ${ft(e)} ${Math.max(30,100-t*22)}%, var(--panel))`}function Vn({buckets:e,by:n,since:r,until:i,dayOffsetMinutes:a,metric:o,providers:s}){let c=$e().data??[],l=[...pe(e,o).entries()],u=l.slice(0,In),d=l.slice(In),f=[...new Set(u.map(([e])=>zn(c,e,s)))].filter(e=>e!==null&&Xe(c,e)===void 0).sort(),p=[];for(let e of[...c.map(e=>e.id),...f,null])u.filter(([t])=>zn(c,t,s)===e).forEach(([t,n],r)=>{p.push({name:t,label:t===Rn?`Unresolved`:t,color:Bn(e,r),totals:n})});d.length>0&&p.push({name:Ln,label:`${d.length} more`,color:`var(--ink-faint)`,totals:d.reduce((e,[,t])=>Te(e,M(t)),N)});let h=new Set(u.map(([e])=>e)),g=new Map;for(let t of e){let e=t.split??Rn,r=`${_e(t.key,n)} ${h.has(e)?e:Ln}`;g.set(r,(g.get(r)??0)+o.of(t))}let _=F(r,i,n,a).map(e=>{let t={at:e};for(let n of p)t[n.name]=g.get(`${e} ${n.name}`)??0;return t}),v=new Map(p.map(e=>[e.name,e.label]));return Y(B,{$gap:2,children:[J(ze,{$height:220,children:J(de,{width:`100%`,height:`100%`,children:Y(vn,{data:_,margin:{top:4,right:4,bottom:4,left:4},children:[J(t,{stroke:`var(--rule)`,vertical:!1}),J(D,{dataKey:`at`,tickFormatter:e=>A(e,n),tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,interval:`preserveStartEnd`,minTickGap:28}),J(We,{tickFormatter:e=>o.format(e),tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,width:40}),J(m,{cursor:{stroke:`var(--rule-strong)`},content:({active:e,payload:t,label:r})=>{if(e!==!0||t===void 0||t.length===0)return null;let i=t.filter(e=>Number(e.value??0)>0);return Y(je,{children:[J(`div`,{children:A(Number(r),n)}),i.length===0?J(`div`,{children:`No ${o.label.toLowerCase()}`}):i.map(e=>Y(`div`,{children:[v.get(String(e.dataKey))??String(e.dataKey),` `,o.format(Number(e.value??0))]},String(e.dataKey)))]})}}),p.map(e=>J(gn,{type:`monotone`,dataKey:e.name,stackId:`models`,stroke:e.color,strokeWidth:2,fill:e.color,fillOpacity:.22,isAnimationActive:!1},e.name))]})})}),J(ke,{children:p.map(e=>Y(`span`,{children:[J(k,{$color:e.color}),` `,J(at,{title:`${e.label}: ${o.format(o.of(M(e.totals)))} ${o.label.toLowerCase()}`,style:{display:`inline-block`,maxWidth:`24ch`,verticalAlign:`bottom`},children:e.label})]},e.name))})]})}var Hn=`unknown`;function Un(e,t){return Xe(e,t)===void 0?`var(--ink-faint)`:ft(t)}function Wn(e,t){return t===Hn?`Unresolved`:Xe(e,t)?.label??t}function Gn({buckets:e,by:n,since:r,until:i,metric:a,dayOffsetMinutes:o}){let s=$e().data??[],c=pe(e,a),l=[...c.keys()].filter(e=>e!==Hn&&Xe(s,e)===void 0).sort(),u=[...s.map(e=>e.id),...l,Hn].map(e=>({name:e,totals:c.get(e)})).filter(e=>e.totals!==void 0),d=u.map(e=>e.name),f=F(r,i,n,o),p=He(e,f,n,a),h=[...c.values()].reduce((e,t)=>e+t.requests,0);return Y(B,{$gap:3,children:[J(ze,{$height:200,children:J(de,{width:`100%`,height:`100%`,children:Y(vn,{data:p,margin:{top:4,right:4,bottom:4,left:4},children:[J(t,{stroke:`var(--rule)`,vertical:!1}),J(D,{dataKey:`at`,tickFormatter:e=>A(e,n),tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,interval:`preserveStartEnd`,minTickGap:28}),J(We,{tickFormatter:e=>a.format(e),tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,width:48}),J(m,{cursor:{stroke:`var(--rule-strong)`},content:({active:e,payload:t,label:r})=>e!==!0||t===void 0||t.length===0?null:Y(je,{children:[J(`div`,{children:A(Number(r),n)}),t.map(e=>Y(`div`,{children:[Wn(s,String(e.dataKey)),` `,a.format(Number(e.value??0))]},String(e.dataKey)))]})}),d.map(e=>J(gn,{type:`monotone`,dataKey:e,stackId:`providers`,stroke:Un(s,e),strokeWidth:2,fill:Un(s,e),fillOpacity:.22,isAnimationActive:!1},e))]})})}),J(ke,{children:d.map(e=>Y(`span`,{children:[J(k,{$color:Un(s,e)}),` `,Wn(s,e)]},e))}),Y(ht,{children:[J(`thead`,{children:Y(`tr`,{children:[J(U,{children:`Provider`}),J(U,{$align:`right`,children:`Share`}),J(U,{$align:`right`,children:`Requests`}),J(U,{$align:`right`,children:`Failed`}),J(U,{$align:`right`,children:`Tokens`}),J(U,{$align:`right`,children:`Cost`})]})}),J(`tbody`,{children:u.map(({name:e,totals:t})=>Y(mt,{children:[Y(H,{children:[J(k,{$color:Un(s,e)}),` `,Wn(s,e)]}),J(H,{$align:`right`,$mono:!0,children:Qe(h===0?0:t.requests/h,0)}),J(H,{$align:`right`,$mono:!0,children:I(t.requests)}),J(H,{$align:`right`,$mono:!0,style:t.errors>0?{color:`var(--down)`}:void 0,children:I(t.errors)}),J(H,{$align:`right`,$mono:!0,children:I(P(t))}),J(H,{$align:`right`,$mono:!0,children:R(t.costUsd)})]},e))})]})]})}var Kn=X.li`
|
|
52
|
+
display: grid;
|
|
53
|
+
grid-template-columns: minmax(0, 20ch) 1fr auto;
|
|
54
|
+
align-items: center;
|
|
55
|
+
gap: ${({theme:e})=>e.space(2)};
|
|
56
|
+
`,qn=X.ol`
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
gap: ${({theme:e})=>e.space(2)};
|
|
60
|
+
`,Jn=X.div`
|
|
61
|
+
height: 8px;
|
|
62
|
+
border-radius: 2px;
|
|
63
|
+
background: ${({theme:e})=>e.color.panelSunk};
|
|
64
|
+
border: 1px solid ${({theme:e})=>e.color.rule};
|
|
65
|
+
overflow: hidden;
|
|
66
|
+
`,Yn=X.div`
|
|
67
|
+
width: ${({$share:e})=>`${Math.max(1.5,e*100)}%`};
|
|
68
|
+
height: 100%;
|
|
69
|
+
border-radius: 0 2px 2px 0;
|
|
70
|
+
background: ${({theme:e,$fault:t})=>t?e.color.down:e.color.accent};
|
|
71
|
+
opacity: 0.85;
|
|
72
|
+
`,Xn=X(at)`
|
|
73
|
+
display: block;
|
|
74
|
+
font-family: ${({theme:e})=>e.font.mono};
|
|
75
|
+
font-size: 12px;
|
|
76
|
+
`,Zn=12;function Qn({buckets:e,metric:t,names:n,unknownLabel:r}){let i=new Map;for(let t of e)i.set(t.key,Te(i.get(t.key)??N,t));let a=e=>e===`unknown`?r??`Unattributed`:n?.get(e)??e,o=[...i.entries()].map(([e,n])=>({name:a(e),entry:n,value:t.of(M(n))})).sort((e,t)=>t.value-e.value),s=o.slice(0,Zn),c=o.slice(Zn),l=s[0]?.value??0;return Y(B,{$gap:3,children:[J(qn,{children:s.map(({name:e,entry:n,value:r})=>Y(Kn,{children:[J(Xn,{title:e,children:e}),J(Jn,{children:J(Yn,{$share:l===0?0:r/l,$fault:n.requests>0&&n.errors===n.requests})}),Y(z,{$gap:2,children:[J(V,{$size:`12px`,children:t.format(r)}),J(V,{$size:`11px`,$dim:!0,children:R(n.costUsd)})]})]},e))}),c.length===0?null:J(V,{$size:`11px`,$dim:!0,children:`+ ${c.length} more, ${I(c.reduce((e,t)=>e+t.entry.requests,0))} requests`})]})}var $n=[{id:`inputTokens`,label:`Uncached input`,opacity:.95},{id:`outputTokens`,label:`Output`,opacity:.7},{id:`cacheReadTokens`,label:`Cache read`,opacity:.45},{id:`cacheWriteTokens`,label:`Cache write`,opacity:.22}];function er({buckets:e,by:n,since:r,until:i,dayOffsetMinutes:a}){let o=new Map;for(let t of e)o.set(_e(t.key,n),t);let s=F(r,i,n,a).map(e=>{let t=o.get(e);return{at:e,inputTokens:t?.inputTokens??0,outputTokens:t?.outputTokens??0,cacheReadTokens:t?.cacheReadTokens??0,cacheWriteTokens:t?.cacheWriteTokens??0}}),c=$n.map(e=>({...e,value:s.reduce((t,n)=>t+n[e.id],0)})),l=c.reduce((e,t)=>e+t.value,0);return Y(B,{$gap:3,children:[J(ze,{$height:200,children:J(de,{width:`100%`,height:`100%`,children:Y(vn,{data:s,margin:{top:4,right:4,bottom:4,left:4},children:[J(t,{stroke:`var(--rule)`,vertical:!1}),J(D,{dataKey:`at`,tickFormatter:e=>A(e,n),tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,interval:`preserveStartEnd`,minTickGap:28}),J(We,{tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,width:44,tickFormatter:e=>I(e)}),J(m,{cursor:{stroke:`var(--rule-strong)`},content:({active:e,payload:t,label:r})=>e!==!0||t===void 0||t.length===0?null:Y(je,{children:[J(`div`,{children:A(Number(r),n)}),$n.map(e=>Y(`div`,{children:[e.label,` `,I(Number(t.find(t=>t.dataKey===e.id)?.value??0))]},e.id))]})}),$n.map(e=>J(gn,{type:`monotone`,dataKey:e.id,stackId:`tokens`,stroke:`var(--accent)`,strokeOpacity:e.opacity,strokeWidth:1.5,fill:`var(--accent)`,fillOpacity:e.opacity*.5,isAnimationActive:!1},e.id))]})})}),J(ke,{children:c.map(e=>Y(z,{$gap:1,children:[J(k,{$color:`var(--accent)`,style:{opacity:e.opacity}}),J(`span`,{children:e.label}),J(V,{$size:`11px`,children:I(e.value)}),J(V,{$size:`11px`,$dim:!0,children:Qe(l===0?0:e.value/l,0)})]},e.id))})]})}function tr({buckets:e,by:n,since:r,until:i,dayOffsetMinutes:a}){let o=new Map;for(let t of e)o.set(_e(t.key,n),t);let s=F(r,i,n,a).map(e=>{let t=o.get(e);return{at:e,label:A(e,n),requests:t?.requests??0,errors:t?.errors??0,costUsd:t?.costUsd??0,tokens:t===void 0?0:P(t)}});return Y(B,{$gap:2,children:[J(ze,{$height:220,children:J(de,{width:`100%`,height:`100%`,children:Y(bn,{data:s,margin:{top:4,right:4,bottom:4,left:4},children:[J(t,{stroke:`var(--rule)`,vertical:!1}),J(D,{dataKey:`label`,tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,interval:`preserveStartEnd`,minTickGap:28}),J(We,{tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,width:40}),J(m,{cursor:{stroke:`var(--rule-strong)`},content:({active:e,payload:t})=>{if(e!==!0||t===void 0||t.length===0)return null;let n=t[0]?.payload;return n===void 0?null:Y(je,{children:[J(`div`,{children:n.label}),Y(`div`,{children:[I(n.requests),` requests`]}),Y(`div`,{children:[I(n.errors),` failed`]}),Y(`div`,{children:[I(n.tokens),` tokens`]}),J(`div`,{children:R(n.costUsd)})]})}}),J(gn,{type:`monotone`,dataKey:`requests`,stroke:`none`,fill:`var(--accent)`,fillOpacity:.12,isAnimationActive:!1}),J(c,{type:`monotone`,dataKey:`requests`,stroke:`var(--accent)`,strokeWidth:2,dot:!1,activeDot:{r:4,stroke:`var(--panel)`,strokeWidth:2},isAnimationActive:!1}),J(c,{type:`monotone`,dataKey:`errors`,stroke:`var(--down)`,strokeWidth:2,dot:!1,activeDot:{r:4,stroke:`var(--panel)`,strokeWidth:2},isAnimationActive:!1})]})})}),Y(ke,{children:[Y(`span`,{children:[J(k,{$color:`var(--accent)`}),` Requests`]}),Y(`span`,{children:[J(k,{$color:`var(--down)`}),` Failed`]})]})]})}var nr=864e5,rr=[{id:`requestedModel`,label:`As requested`,column:`Virtual model`},{id:`model`,label:`As served`,column:`Upstream model`}],ir=X(pt)`
|
|
77
|
+
width: auto;
|
|
78
|
+
`;function ar(){let{cadence:e}=lt(),[t,n]=q(`24h`),[r,i]=q(`tokens`),[a,o]=q(`model`),[s,c]=q(void 0),[l,u]=q(void 0),d=tt(),f=et(),p=oe(t),m=he(r),h=rt().data??null,g=K(()=>p.grain===`daily`?qe(Date.now()-p.ms,h):Math.floor((Date.now()-p.ms)/6e4)*6e4,[p,h]),_=K(()=>g+p.ms,[g,p]),v=K(()=>qe(Date.now()-371*nr,h),[h]),y=d.data?.find(e=>e.id===s),b=f.data?.find(e=>e.id===l);s!==void 0&&d.data!==void 0&&y===void 0&&c(void 0),l!==void 0&&f.data!==void 0&&b===void 0&&u(void 0);let x={...y===void 0?{}:{credentialId:y.id},...b===void 0?{}:{apiKeyId:b.id}},S=`${b===void 0?``:` for ${b.label}`}${y===void 0?``:` on ${y.label}`}`,C={since:g,grain:p.grain,...x},w=L({...C,groupBy:p.by},e(6e4,`res:usage`)),E=L({...C,groupBy:p.by,splitBy:`provider`},e(6e4,`res:usage`)),D=L({...C,groupBy:p.by,splitBy:`model`},e(6e4,`res:usage`)),O=L({...C,groupBy:p.by,splitBy:`apiKey`},e(6e4,`res:usage`)),ee=L({...C,groupBy:a},e(6e4,`res:usage`)),te=L({...C,groupBy:`credential`},e(6e4,`res:usage`)),ne=L({since:v,grain:`daily`,groupBy:`day`,...x},e(3e5,`res:usage`)),re=nt(),ie=K(()=>{let e=new Map;for(let t of re.data??[])for(let n of t.targets)e.set(n.model,n.provider);return e},[re.data]),ae=K(()=>{let e=new Map;for(let t of f.data??[])e.set(t.id,t.label);return e},[f.data]),se=K(()=>{let e=new Map;for(let t of d.data??[])e.set(t.id,t.label);return e},[d.data]),k=w.data??[],ce=T(k),A=P(ce),j={legend:`Nothing recorded`,message:`No requests landed in this window. Widen the range, or send traffic through the gateway.`};return Y(B,{$gap:4,children:[J(dt,{legend:`Usage`,title:`Requests, tokens, and spend`,summary:w.isLoading?`Reading usage…`:`${I(ce.requests)} requests and ${R(ce.costUsd)} over the last ${p.label}${S}.`,actions:Y(z,{$wrap:!0,children:[Y(ir,{"aria-label":`Account`,value:y?.id??``,onChange:e=>c(e.target.value||void 0),children:[J(`option`,{value:``,children:`All accounts`}),(d.data??[]).map(e=>J(`option`,{value:e.id,children:e.label},e.id))]}),Y(ir,{"aria-label":`Gateway key`,value:b?.id??``,onChange:e=>u(e.target.value||void 0),children:[J(`option`,{value:``,children:`All keys`}),(f.data??[]).map(e=>J(`option`,{value:e.id,children:e.label},e.id))]}),J(gt,{children:ye.map(e=>J(_t,{type:`button`,$size:`sm`,$on:e.id===t,"aria-pressed":e.id===t,onClick:()=>n(e.id),children:e.id},e.id))})]})}),J(vt,{buckets:k,since:g,until:_,by:p.by,rangeLabel:p.label,dayOffsetMinutes:h}),J(W,{legend:`Traffic`,meta:p.by===`hour`?`By hour`:`By day`,query:w,isEmpty:k.length===0,empty:j,children:J(tr,{buckets:k,by:p.by,since:g,until:_,dayOffsetMinutes:h})}),J(gt,{children:Ie.map(e=>J(_t,{type:`button`,$size:`sm`,$on:e.id===r,"aria-pressed":e.id===r,onClick:()=>i(e.id),children:`Rank by ${e.label.toLowerCase()}`},e.id))}),J(W,{legend:`Traffic by upstream model`,meta:`${m.label}, ${p.by===`hour`?`by hour`:`by day`}`,query:D,isEmpty:(D.data??[]).length===0,empty:j,children:J(Vn,{buckets:D.data??[],by:p.by,since:g,until:_,dayOffsetMinutes:h,metric:m,providers:ie})}),Y(st,{$min:`480px`,$gap:4,children:[Y(B,{$gap:4,children:[J(W,{legend:`Providers`,meta:m.label,query:E,isEmpty:(E.data??[]).length===0,empty:j,children:J(Gn,{buckets:E.data??[],by:p.by,since:g,until:_,dayOffsetMinutes:h,metric:m})}),J(Pn,{days:ne.data??[],now:Date.now(),dayOffsetMinutes:h})]}),Y(B,{$gap:4,children:[J(W,{legend:`Token mix`,meta:I(A),query:w,isEmpty:k.length===0,empty:j,children:J(er,{buckets:k,by:p.by,since:g,until:_,dayOffsetMinutes:h})}),J(W,{legend:`Models`,meta:rr.find(e=>e.id===a)?.column,query:ee,isEmpty:(ee.data??[]).length===0,empty:j,actions:J(gt,{children:rr.map(e=>J(_t,{type:`button`,$size:`sm`,$on:e.id===a,"aria-pressed":e.id===a,onClick:()=>o(e.id),children:e.label},e.id))}),children:J(Qn,{buckets:ee.data??[],metric:m})}),J(W,{legend:`Accounts`,meta:m.label,query:te,isEmpty:(te.data??[]).length===0,empty:j,children:J(Qn,{buckets:te.data??[],metric:m,names:se,unknownLabel:`No account`})})]})]}),J(W,{legend:`API keys`,meta:m.label,query:O,isEmpty:(O.data??[]).length===0,empty:j,children:J(Fn,{buckets:O.data??[],by:p.by,since:g,until:_,dayOffsetMinutes:h,metric:m,names:ae})})]})}var or=ar;export{or as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as e}from"./Rack-DMrfn4-H.js";var t={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};t.node;var n=e(t);export{n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as e}from"./Rack-DMrfn4-H.js";var t={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};t.node;var n=e(t);export{n as t};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import{_ as e,i as t,y as n}from"./shared-HVgLEGgl.js";import{J as r,K as i,L as a,N as o,R as s,U as ee,at as te,ct as ne,g as re,it as c,l as ie,nn as ae,nt as oe,ot as se,r as l,rt as u,st as ce,tt as le,u as ue,z as d}from"./Lamp-CL0i4yaa.js";import{A as f,C as p,S as m,T as h,b as g,k as _,o as de,r as fe,s as pe,x as v,y}from"./Panel-CsovmtxF.js";import{D as b,i as me,t as he,x}from"./Rack-DMrfn4-H.js";import{a as ge,i as _e,n as ve,r as ye,t as be}from"./RequestTable-CtuuMOT2.js";import{t as S}from"./chevron-down-3tlYNJqZ.js";import{t as C}from"./chevron-right-kvaJRnfj.js";import{i as w,r as T}from"./index-6rZSWe9j.js";import{i as xe}from"./Field-EvdVyEqx.js";import{t as E}from"./Meter-stpt3vQu.js";import{i as D,n as O,r as k,t as A}from"./Table-CVDZ69Zx.js";import{n as Se,r as j}from"./WindowChart-CaPUJ4GJ.js";import{c as Ce}from"./limits-iRyDMg04.js";import{i as M,n as N,r as we,t as Te}from"./SummaryDeck-DHsYYpYO.js";import{Fragment as P,useMemo as F,useState as I}from"react";import{Fragment as Ee,jsx as L,jsxs as R}from"react/jsx-runtime";import z from"styled-components";var B=z.div`
|
|
2
|
+
display: grid;
|
|
3
|
+
grid-template-areas:
|
|
4
|
+
"chassis"
|
|
5
|
+
"main";
|
|
6
|
+
grid-template-columns: minmax(0, 1fr);
|
|
7
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
8
|
+
height: 100vh;
|
|
9
|
+
min-height: 0;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
`,V=z.main`
|
|
12
|
+
grid-area: main;
|
|
13
|
+
padding: ${({theme:e})=>e.space(4)};
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
gap: ${({theme:e})=>e.space(4)};
|
|
17
|
+
min-width: 0;
|
|
18
|
+
min-height: 0;
|
|
19
|
+
overflow-y: auto;
|
|
20
|
+
|
|
21
|
+
@media (max-width: 720px) {
|
|
22
|
+
padding: ${({theme:e})=>e.space(3)};
|
|
23
|
+
}
|
|
24
|
+
`;function H({children:e}){let{cadence:t}=b(),n=u(),r=c(200,t(1e4,`res:logs`));return R(B,{"data-testid":`client-shell`,children:[L(x,{logs:r.data??[],logsFailed:r.isError,signOut:{pending:n.isPending,run:()=>{n.mutate(void 0,{onSuccess:()=>window.location.assign(`/login`)})}}}),L(V,{children:e})]})}var U=[20,50,100,250],De={"1m":`per minute`,"5h":`per 5 hours`,"1w":`per week`};function Oe({reading:e}){let t=e.window===null?`concurrent requests`:`${e.dimension} ${De[e.window]??e.window}`,n=e.model===null?t:`${t} for ${e.model}`,r=e.dimension===`spend`?d:o,i=e.used===null?null:e.limit===0?1:e.used/e.limit;return R(D,{children:[L(O,{children:t}),L(O,{$align:`right`,$mono:!0,children:e.used===null?L(v,{children:`unknown`}):r(e.used)}),L(O,{$align:`right`,$mono:!0,children:r(e.limit)}),L(O,{children:i===null?null:L(E,{fraction:i,label:`${n}, ${Math.round(Math.min(1,i)*100)}% used`})})]})}function ke(e){return{observedAt:e.observedAt,windowType:e.windowType,windowMs:e.windowMs,resetsAt:e.resetsAt,usedRatio:e.usedRatio}}function W(e){return{stale:e.stale,rolledOver:e.rolledOver,estimateStale:e.stale||e.rolledOver,survives:e.survives,exhaustsAt:e.exhaustsAt}}var Ae=z.p`
|
|
25
|
+
font-size: 12px;
|
|
26
|
+
line-height: 1.5;
|
|
27
|
+
color: ${({theme:e})=>e.color.ink};
|
|
28
|
+
white-space: pre-wrap;
|
|
29
|
+
overflow-wrap: anywhere;
|
|
30
|
+
max-width: 80ch;
|
|
31
|
+
`,G=z.div`
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
gap: 4px;
|
|
35
|
+
`,K=z.div`
|
|
36
|
+
display: grid;
|
|
37
|
+
/* Bar, figure, legend — the accounts page's own three columns, so the two
|
|
38
|
+
screens read the same way and the legends stay aligned down the stack. */
|
|
39
|
+
grid-template-columns: 96px 34px 1fr;
|
|
40
|
+
align-items: center;
|
|
41
|
+
min-width: 208px;
|
|
42
|
+
gap: 6px;
|
|
43
|
+
`,q=z(g)`
|
|
44
|
+
font-size: 11px;
|
|
45
|
+
text-align: right;
|
|
46
|
+
`;function je({windows:e,open:t,onToggle:n}){let r=e[0],i=e.filter(e=>e.usedRatio!==null);return R(D,{children:[L(O,{children:r.label}),L(O,{children:i.length===0?L(v,{children:`unknown`}):L(G,{children:i.map(e=>R(K,{children:[L(E,{fraction:e.usedRatio,label:`${e.label} ${e.windowType} window, ${Math.round(e.usedRatio*100)}% used`}),L(q,{children:a(e.usedRatio,0)}),L(y,{children:re(e,W(e),Date.now(),s)})]},e.windowType))})}),L(O,{$align:`right`,children:L(f,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-expanded":t,"aria-label":`${t?`Hide`:`Show`} quota history for ${r.label}`,title:`${t?`Hide`:`Show`} quota history for ${r.label}`,onClick:n,children:L(t?S:C,{})})})]})}function J(){let{cadence:s,live:re}=b(),[c,u]=I(`24h`),[f,x]=I(ge),[S,C]=I(U[0]),[w,T]=I(null),[E,z]=I(null),B=e(c),V=le().data??null,H=F(()=>B.grain===`daily`?n(Date.now()-B.ms,V):Math.floor((Date.now()-B.ms)/6e4)*6e4,[B,V]),De=F(()=>H+B.ms,[H,B]),W=ce(),G={since:H,grain:B.grain},K=ne({...G,groupBy:B.by},s(6e4,`res:usage`)),q=ne({...G,groupBy:`model`},s(6e4,`res:usage`)),J=oe(f,S,s(ee,`res:logs`)),Me=!i(J.data),Ne=ae(r.clientLogPages(f,S)),Y=te(6e4),X=Y.data??[],Pe=Ce(W.data?.limitUsage??[]),Fe=Pe.some(e=>e.model!==null),Ie=F(()=>{let e=new Map;for(let t of X){let n=e.get(t.provider)??new Map,r=n.get(t.credentialId);r===void 0?n.set(t.credentialId,[t]):r.push(t),e.set(t.provider,n)}return[...e.entries()].map(([e,t])=>[e,[...t.entries()].map(([e,t])=>({credentialId:e,windows:[...t].sort((e,t)=>l[e.windowType]-l[t.windowType])}))])},[X]),Z=X.map(e=>j(ke(e))).filter(e=>e!==null),Le=Z.length===0?0:Math.floor(Math.min(...Z)/6e4)*6e4,Re=se({since:Le},E!==null&&Z.length>0),Q=F(()=>(J.data?.pages??[]).flatMap(e=>e.logs),[J.data?.pages]),ze=ye(re&&Q.some(ue)),Be=Q.filter(ie).length,$=K.data??[],Ve=$.reduce((e,t)=>e+t.requests,0),He=$.reduce((e,t)=>e+t.costUsd,0);return R(h,{$gap:4,children:[L(he,{legend:`Client`,title:`Your usage`,summary:K.isLoading?`Reading your usage…`:`${o(Ve)} requests and ${d(He)} over the last ${B.label}.`,actions:L(N,{children:t.map(e=>L(we,{type:`button`,$size:`sm`,$on:e.id===c,"aria-pressed":e.id===c,onClick:()=>u(e.id),children:e.id},e.id))})}),L(fe,{legend:`Your key`,meta:W.data===void 0?void 0:R(g,{$dim:!0,children:[W.data.prefix,`…`]}),children:W.isPending?L(pe,{rows:2}):W.isError?L(de,{legend:`Could not read your key`,error:W.error}):R(h,{$gap:2,children:[R(m,{$gap:2,$wrap:!0,children:[L(y,{children:W.data.label}),W.data.bodyLoggingOptOut?L(v,{children:`Request bodies are never stored for this key.`}):null]}),W.data.modelAllowlist===null?L(v,{children:`Every model this gateway serves.`}):W.data.modelAllowlist.length===0?L(v,{children:`No models. This key cannot serve a request.`}):L(m,{$gap:1,$wrap:!0,children:W.data.modelAllowlist.map(e=>L(g,{children:e},e))}),W.data.guardrailPolicy===null?null:R(h,{$gap:1,children:[L(y,{children:`Usage policy`}),L(Ae,{children:W.data.guardrailPolicy}),L(v,{children:`Each request is checked against this before it is served, and the check is billed to this key. Requests outside it are refused.`})]})]})}),L(Te,{buckets:$,since:H,until:De,by:B.by,rangeLabel:B.label,dayOffsetMinutes:V}),L(M,{legend:`By model`,meta:B.label,query:{isLoading:q.isLoading,isError:q.isError,error:q.error,refetch:()=>void q.refetch()},failure:`Could not read usage`,empty:{legend:`No traffic`,message:`Nothing served in this window.`},isEmpty:(q.data??[]).length===0,children:L(p,{children:R(A,{children:[L(`thead`,{children:R(`tr`,{children:[L(k,{children:`Model`}),L(k,{$align:`right`,children:`Requests`}),L(k,{$align:`right`,children:`Tokens`}),L(k,{$align:`right`,children:`Spend`})]})}),L(`tbody`,{children:(q.data??[]).map(e=>R(D,{children:[L(O,{$mono:!0,children:e.key}),L(O,{$align:`right`,$mono:!0,children:o(e.requests)}),L(O,{$align:`right`,$mono:!0,children:o(e.inputTokens+e.outputTokens+e.cacheReadTokens+e.cacheWriteTokens)}),L(O,{$align:`right`,$mono:!0,children:d(e.costUsd)})]},e.key))})]})})}),L(M,{legend:`Your limits`,query:{isLoading:W.isLoading,isError:W.isError,error:W.error,refetch:()=>void W.refetch()},failure:`Could not read your limits`,empty:W.data?.limits===null?{legend:`Limits unreadable`,message:`This key's limits could not be read. Requests are refused until an operator repairs it.`}:{legend:`No limits`,message:`This key is not rate limited.`},isEmpty:W.data?.limits===null||(W.data?.limitUsage.length??0)===0,footer:L(v,{children:`Counted from completed requests, so a burst in flight right now may not be included yet.`}),children:L(p,{children:R(A,{children:[L(`thead`,{children:R(`tr`,{children:[L(k,{children:`Limit`}),L(k,{$align:`right`,children:`Used`}),L(k,{$align:`right`,children:`Ceiling`}),L(k,{$width:`30%`,children:`Consumption`})]})}),L(`tbody`,{children:Pe.map(e=>R(P,{children:[Fe?L(D,{children:L(k,{scope:`rowgroup`,colSpan:4,children:e.model??`Every model`})}):null,e.readings.map(e=>L(Oe,{reading:e},`${e.dimension}:${e.window??`gauge`}`))]},e.model??``))})]})})}),L(M,{legend:`Provider headroom`,query:{isLoading:Y.isLoading,isError:Y.isError,error:Y.error,refetch:()=>void Y.refetch()},failure:`Could not read provider headroom`,empty:{legend:`No data`,message:`No provider has reported a usage window.`},isEmpty:X.length===0,footer:L(v,{children:`What each account serving this gateway has left. A request is served by whichever account of a provider can take it.`}),children:L(h,{$gap:4,children:Ie.map(([e,t])=>R(h,{$gap:1,children:[L(y,{children:e}),L(p,{children:R(A,{children:[L(`thead`,{children:R(`tr`,{children:[L(k,{children:`Account`}),L(k,{$width:`60%`,children:`Quota`}),L(k,{})]})}),L(`tbody`,{children:t.map(({credentialId:e,windows:t})=>R(P,{children:[L(je,{windows:t,open:E===e,onToggle:()=>z(E===e?null:e)}),E===e?L(D,{children:L(O,{colSpan:3,children:L(h,{$gap:4,children:t.map(e=>{let t=ke(e),n=j(t),r=(Re.data?.samples??[]).filter(t=>t.credentialId===e.credentialId&&t.windowType===e.windowType&&t.observedAt>=(n??0));return L(Se,{live:t,samples:r.map(e=>({observedAt:e.observedAt,windowType:e.windowType,windowMs:e.windowMs,resetsAt:e.resetsAt,usedRatio:e.usedRatio})),since:n,now:Date.now(),truncated:Re.data?.truncated===!0&&n!==null&&r.length>0&&(r[0]?.observedAt??0)>n,ratePerHourRatio:e.ratePerHourRatio,exhaustsAt:e.exhaustsAt,survives:e.survives,stale:e.stale,rolledOver:e.rolledOver,spent:e.usedRatio===null?`no ceiling reported`:`${a(e.usedRatio,0)} used`,rateText:e.ratePerHourRatio===null?`unknown`:`${a(e.ratePerHourRatio,1)}/h`},e.windowType)})})})}):null]},e))})]})})]},e))})}),L(M,{legend:`Recent requests`,meta:`${Q.length} shown`,actions:R(N,{children:[L(_e,{filters:f,onChange:x}),L(xe,{value:S,"aria-label":`How many requests per page`,style:{width:`auto`},onChange:e=>C(Number(e.target.value)),children:U.map(e=>R(`option`,{value:e,children:[e,` per page`]},e))})]}),query:{isLoading:J.isLoading,isError:J.isError,error:J.error,refetch:()=>void J.refetch()},failure:`Could not read your requests`,empty:{legend:`No requests`,message:Object.keys(f).length===0?`Nothing served through this key yet.`:`No request served through this key matches these filters.`},isEmpty:Q.length===0,footer:R(m,{$gap:2,$wrap:!0,children:[R(v,{children:[o(Be),` of the `,o(Q.length),` loaded failed.`]}),J.hasNextPage?L(_,{type:`button`,$size:`sm`,disabled:J.isFetchingNextPage,onClick:()=>void J.fetchNextPage(),children:J.isFetchingNextPage?`Loading…`:`Load older`}):null,Me?R(Ee,{children:[L(v,{children:`Live updates are paused while older pages are loaded.`}),L(_,{type:`button`,$size:`sm`,onClick:Ne,children:`Back to live`})]}):null]}),children:L(p,{children:L(ve,{rows:Q,now:ze,onOpen:T})})}),L(me,{open:w!==null,onOpenChange:e=>{e||T(null)},title:`Request detail`,width:`640px`,footer:L(_,{type:`button`,onClick:()=>T(null),children:`Close`}),children:w===null?null:L(be,{log:w})})]})}var Me=()=>L(T,{children:L(w,{children:L(H,{children:L(J,{})})})});export{Me as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e}from"./Rack-
|
|
1
|
+
import{h as e}from"./Rack-DMrfn4-H.js";import*as t from"react";var n=Object.defineProperty,r=(e,t)=>n(e,`name`,{value:t,configurable:!0});function i(n){let[r,i]=t.useState(void 0);return e(()=>{if(n){i({width:n.offsetWidth,height:n.offsetHeight});let e=new ResizeObserver(e=>{if(!Array.isArray(e)||!e.length)return;let t=e[0],r,a;if(`borderBoxSize`in t){let e=t.borderBoxSize,n=Array.isArray(e)?e[0]:e;r=n.inlineSize,a=n.blockSize}else r=n.offsetWidth,a=n.offsetHeight;i({width:r,height:a})});return e.observe(n,{box:`border-box`}),()=>e.unobserve(n)}i(void 0)},[n]),r}r(i,`useSize`);export{i as t};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_app-CSru2YTE.js","assets/Panel-CsovmtxF.js","assets/client-B9t0CsmA.js","assets/shared-HVgLEGgl.js","assets/Lamp-CL0i4yaa.js","assets/Rack-DMrfn4-H.js","assets/RequestTable-CtuuMOT2.js","assets/TokenBreakdown-Bf0zsKcd.js","assets/chevron-right-kvaJRnfj.js","assets/dist-B8iuo_hI.js","assets/Chip-C3dIFd8s.js","assets/Field-EvdVyEqx.js","assets/Table-CVDZ69Zx.js","assets/chevron-down-3tlYNJqZ.js","assets/Meter-stpt3vQu.js","assets/WindowChart-CaPUJ4GJ.js","assets/limits-iRyDMg04.js","assets/SummaryDeck-DHsYYpYO.js","assets/Readout-DlT5oxGO.js","assets/login-NuwPF5SS.js","assets/reasons-Du1OBWAM.js","assets/_app.index-DW6wain4.js","assets/_app.accounts-xCJhRd32.js","assets/CopyValue-DG88CWpN.js","assets/plus-CVqm87L-.js","assets/rotate-ccw-Dionx_MW.js","assets/trash-Bsi60qJc.js","assets/Toggle-BTie3NY8.js","assets/_app.console-DS37cfIu.js","assets/_app.database-BCwEMrEA.js","assets/_app.keys-CCU2NB3-.js","assets/_app.logs-CRC5qDK3.js","assets/_app.models-B4brzRdK.js","assets/_app.settings-NJSb_L2B.js","assets/_app.usage-BR6a92zI.js","assets/_app.plugins._pluginId-CD9KXknf.js","assets/preload-helper-1xe0b53X.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{An as e,Cn as t,Dn as n,En as r,In as i,J as a,K as o,Ln as s,Mn as c,Nn as l,On as u,Pn as d,Pt as f,Rn as p,Sn as m,Vn as h,W as g,_n as _,bn as v,cn as y,dn as b,fn as x,hn as S,jn as C,kn as w,mn as T,pn as E,un as D,vn as ee,wn as te,xn as ne,yn as re,zn as ie}from"./Lamp-CL0i4yaa.js";import{a as ae,c as oe,i as se,n as O,o as ce,r as k,s as le,t as A}from"./preload-helper-1xe0b53X.js";import{M as ue,T as de,d as fe,j,k as pe,l as me,r as he,s as ge,y as _e}from"./Panel-CsovmtxF.js";import{C as ve,E as ye,T as be,n as xe}from"./Rack-DMrfn4-H.js";import{MutationCache as Se,QueryCache as Ce,QueryClient as we,QueryClientProvider as Te,useQueryClient as Ee}from"@tanstack/react-query";import*as M from"react";import{StrictMode as De,createContext as Oe,use as ke,useEffect as N,useRef as Ae,useState as je,useSyncExternalStore as Me}from"react";import{Fragment as Ne,jsx as P,jsxs as F}from"react/jsx-runtime";import{createRoot as Pe}from"react-dom/client";import Fe from"styled-components";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function I(e){return e?.isNotFound===!0}function Ie(){try{return sessionStorage}catch{return}}var Le=`tsr-scroll-restoration-v1_3`,Re=Ie();function ze(){try{return JSON.parse(Re?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function Be(){try{Re?.setItem(Le,JSON.stringify(L))}catch{}}var L=ze(),Ve=`data-scroll-restoration-id`,He=e=>e.state.__TSR_key||e.href;function Ue(e){let t=e.getAttribute(Ve);if(t)return`[${Ve}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var We=!1,Ge=`window`;function Ke(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function qe(e){let t=new Set;for(let n of e){if(n===Ge)continue;let e=Ke(n);e&&t.add(e)}return t}function Je(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||He,a=new Set,o=e=>{let t=L[e]||={};for(let e of a)e===document?t[Ge]={scrollX,scrollY}:e.isConnected&&(t[Ue(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.restoration&&(r.restoration=!0,We=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{We||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{o(i(e.stores.resolvedLocation.get()??e.stores.location.get())),Be()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c=r.hash,l;if(a.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.restoring&&d&&d!==u){let e=L[d];if(e){let t=L[u];for(let n in e){if(n===Ge){if(s)continue}else{let e=Ke(n);if(!e||s&&o&&(l??=qe(o),l.has(e)))continue}t||=L[u]={},t[n]??=e[n]}}}We=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=qe(o));let t=e&&i&&c,s=r.restoring?L[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===Ge){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=Ke(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{We=!1}}))}function Ye(e,t=String){let n;for(let r in e){let i=e[r];i!==void 0&&(n||=new URLSearchParams).set(r,t(i))}return n?n.toString():``}function Xe(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Ze(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=Xe(r):Array.isArray(t)?t.push(Xe(r)):n[e]=[t,Xe(r)]}return n}var Qe=/^(?:\s|["[{\d-]|fa|nu|tr)/,$e=tt(JSON.parse),et=nt(JSON.stringify,JSON.parse);function tt(e){let t=e===JSON.parse;return n=>{n[0]===`?`&&(n=n.substring(1));let r=Ze(n);for(let n in r){let i=r[n];if(typeof i==`string`){if(t&&!Qe.test(i))continue;try{r[n]=e(i)}catch{}}}return r}}function nt(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!Qe.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=Ye(e,r);return t?`?${t}`:``}}function rt(e){return{input:({url:t})=>{for(let n of e)t=at(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=ot(e[n],t);return t}}}function it(e){let t=S(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:t})=>{let a=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return a===r?t.pathname=`/`:a.startsWith(i)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=E([`/`,t,e.pathname]),e)}}function at(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function ot(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function st(e,t){let{createMutableStore:r,createReadonlyStore:i,batch:a}=t,o=new Map,s=r(`idle`),c=r(e),l=r(void 0),u=r([]),d=i(()=>u.get().map(e=>o.get(e).get())),f=i(()=>({status:s.get(),isLoading:s.get()===`pending`,matches:d.get(),location:c.get(),resolvedLocation:l.get()}));function p(e){let t=o.get(e);return t||(t=r(void 0),o.set(e,t)),t}let m={status:s,location:c,resolvedLocation:l,ids:u,matches:d,byRoute:o,__store:f,getMatchStore:p,setMatches:h};function h(e){let t=u.get(),r=e.map(e=>e.routeId);a(()=>{n(t,r)||u.set(r);for(let e of t)r.includes(e)||o.get(e).set(()=>void 0);for(let t of e){let e=p(t.routeId);e.get()!==t&&e.set(t)}})}return m}var R=`__TSR_index`,ct=`popstate`,lt=`beforeunload`,ut=/^[\x00-\x20]*(?:[\\/][\t\n\r]*){2,}/;function dt(e){let t=ut.exec(e);return t?`/`+e.slice(t[0].length):e}function ft(e){return/[\x00-\x1f\x7f]/.test(e)&&(e=e.replace(/[\x00-\x1f\x7f]/g,e=>`
|
|
3
|
+
\r`.includes(e)?``:encodeURIComponent(e))),dt(e)}function pt(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=gt(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[R];i=mt(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[R];i=mt(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t,n?.ignoreBlocker??!1),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[R]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r,_getBlockers:()=>e.getBlockers?.()??[]}}function mt(e,t){t||={};let n=_t();return{...t,key:n,__TSR_key:n,[R]:e}}function ht(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=t=>ft(e?.createHref?e.createHref(t):t),c=e?.parseLocation??(()=>gt(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=_t();t.history.replaceState({[R]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(S._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),S._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(t,n,r)=>{let i=e?.createHref?s(n):void 0,a=!!g;a||(u=l),l=gt(n,r),g=[i??l.href,r,g?.[2]||t],a||queueMicrotask(()=>_())},y=e=>{l=c(),S.notify({type:e})},b=async()=>{if(m=!1,f){f=!1;return}let e=c(),n=e.state[R]-l.state[R],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let r=a();if(typeof document<`u`&&r.length){for(let i of r)if(await i.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(-n),S.notify(u);return}}}l=c(),S.notify(u)},x=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},S=pt({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>v(!0,e,t),replaceState:(e,t)=>v(!1,e,t),back:e=>(e&&(p=!0,m=!0),t.history.back()),forward:e=>{e&&(p=!0,m=!0),t.history.forward()},go:(e,n)=>{d=!0,n&&(p=!0,m=!0),t.history.go(e)},createHref:e=>s(e),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(lt,x,{capture:!0}),t.removeEventListener(ct,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return S._ignoreNextBeforeUnload=e=>{m=!1;try{e=new URL(e,t.document.baseURI).href,m=/^https?:/.test(e)&&(!e.includes(`#`)||e.split(`#`)[0]!==t.location.href.split(`#`)[0])}catch{}},t.addEventListener(lt,x,{capture:!0}),t.addEventListener(ct,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return S._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return S._ignoreSubscribers||y(`REPLACE`),n},S}function gt(e,t){let n=ft(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=_t();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[R]:0,key:a,__TSR_key:a}}}function _t(){return(Math.random()+1).toString(36).substring(7)}function vt(e,t){return e.protocol!==`http:`&&e.protocol!==`https:`||e.origin!==t||!!e.username||!!e.password}function yt(e){return e.pathname+e.search+e.hash}function bt(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function xt(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function St({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function Ct(e){return e.findIndex(e=>e.status===`error`||e.status===`notFound`||e._notFound)+1}function wt(e,t,n,r,i,a){r&&(t=t.slice(0,r)),i&&(n=n.slice(0,i));for(let r of t){if(a&&e._tx!==a)return;n.some(e=>e.routeId===r.routeId)||e.routesById[r.routeId].options.onLeave?.(r)}for(let r of n){if(a&&e._tx!==a)return;e.routesById[r.routeId].options[t.some(e=>e.routeId===r.routeId)?`onStay`:`onEnter`]?.(r)}}var Tt=class{constructor(n,i){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=b(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:ht()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`,this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=te(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=st(this.latestLocation,e),Je(this)}let a=this.options.basepath??`/`,o=this.options.rewrite;if(r||n!==a||i!==o){this.basepath=a;let e=[],t=S(a);t&&t!==`/`&&e.push(it({basepath:a})),o&&e.push(o),this.rewrite=e.length===0?void 0:e.length===1?e[0]:rt(e),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=t(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&m(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{for(let t of this.subscribers)if(t.eventType===e.type)try{t.fn(e)}catch(e){console.error(e)}},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:u(e),external:!1,searchStr:o,search:s(t?.search,i),hash:u(r.slice(1)),state:ie(t?.state,a)}}let o=new URL(i,this.origin),c=at(this.rewrite,o),l=this.options.parseSearch(c.search),d=this.options.stringifySearch(l);return c.search=d,{href:c.href.replace(c.origin,``),publicHref:i,pathname:u(dt(c.pathname)),external:!!this.rewrite&&vt(c,this.origin),searchStr:d,search:s(t?.search,l),hash:u(c.hash.slice(1)),state:ie(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>T({base:e,to:t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>{let t=Object.create(null),n=v(_(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=t=>{let n=(n={})=>{if(n.href){let e=gt(n.href,{});n={...n,to:at(this.rewrite,new URL(e.pathname,this.origin)).pathname,search:this.options.parseSearch(e.search),hash:e.hash.slice(1)}}let r=n._fromLocation||this._pendingLocation||this.latestLocation,i=this.matchRoutesLightweight(r),a=n.unsafeRelative===`path`?r.pathname:n.from??i[1],o=i[2],c=i[3],d=this.resolvePathWithBase(a,n.to?`${n.to}`:`.`),f=Mt(n.params,c),p=this.routesByPath[_(d)],m;if(p)m=this.getRouteBranch(p);else if(d.includes(`$`))m=[];else{let[e,t,n]=this.getMatchedRoutes(d);m=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(m=[...m,this.options.notFoundRoute])}if(m.length&&l(f))for(let e of m){let t=e.options.params?.stringify??e.options.stringifyParams;if(t){f===c&&(f=Object.assign(Object.create(null),f));try{Object.assign(f,t(f))}catch{}}}let h=t.leaveParams?d:u(dt(x({path:d,params:f,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath)),g=o;if(t._includeValidateSearch&&this.options.search?.strict){let e={};m.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,kt(t.options.validateSearch,{...e,...g}))}catch{}}),g=e}g=At(g,n,m,t._includeValidateSearch),g=s(o,g);let v=this.options.stringifySearch(g),y=n.hash===!0?r.hash:n.hash?C(n.hash,r.hash):void 0,b=y?`#${y}`:``,S=n.state===!0?r.state:n.state?C(n.state,r.state):{};n.state&&(S=ie(r.state,S));let w=`${h}${v}${b}`,T,E,D=!1;if(this.rewrite){let e=new URL(w,this.origin),t=e.origin,n=ot(this.rewrite,e);T=yt(e),vt(n,t)?(E=n.href,D=!0):E=dt(yt(n))}else T=e(w),E=T;return{publicHref:E,href:T,pathname:h,search:g,searchStr:v,state:S,hash:y??``,external:D,unmaskOnReload:n.unmaskOnReload}},r=n(t);if(t.mask)r.maskedLocation=n({from:t.from,...t.mask});else if(this.options.routeMasks){let e=re(r.pathname,this.processedTree);if(e){let i=Object.assign(Object.create(null),e.rawParams),{from:a,params:o,...s}=e.route,c=Mt(o,i);r.maskedLocation=n({from:t.from,...s,params:c})}}return r},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=n.maskedLocation??n;if(r.external)return Et(this,r.publicHref,{replace:n.replace,ignoreBlocker:t});let i,a=_(this.latestLocation.href)===_(n.href)&&w(St(n.state),St(this.latestLocation.state)),o=this._commitPromise,s,c=new Promise(e=>{s=e});if(c.resolve=()=>{s(),o?.resolve()},this._commitPromise=c,a)this.load();else{let{maskedLocation:r,hashScrollIntoView:a,...o}=n;r&&(o={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,i=n.replace?`REPLACE`:`PUSH`,this.history[i===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.next=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,...a}={})=>{let o=this.buildLocation({...a,_includeValidateSearch:!0});this._pendingLocation=o;let s=this.commitLocation({...o,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this._pendingLocation===o&&(this._pendingLocation=void 0)}),s},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=n?c(n):void 0;if(a||t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i}),a=t.maskedLocation??t;n??=a.publicHref,r??=a.publicHref}let t=!a&&r?r:n;return Et(this,t,i)}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.hash=e.action.type===`PUSH`||e.action.type===`REPLACE`),await pn(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(xt(r,i)):t.types;if(a===!1)return e();n={update:e,types:a}}else n=e;return document.startViewTransition(n).updateCallbackDone}return e()},this.invalidate=e=>{let t=this._committed,n=e?.filter,r=this._preloads,i=new Set([...t,...this._cache.values(),...[...r?.values()??[]].flat(),...this._tx?.[3]??[]].filter(e=>!n||n(e)).map(e=>e.id)),a=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),a.push(e));let o=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&bt(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(o);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i)this._flights?.delete(e);for(let e of a)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.options,n=e.headers.get(`Location`)||t.href;if(!n){let e=this.buildLocation(t);n=(e.maskedLocation??e).publicHref||`/`}let r;if(p.test(n)||(r=c(n))&&!this.protocolAllowlist.has(r))throw Error(`Redirect blocked: unsafe protocol`);if(r===`http:`||r===`https:`){let e=new URL(n);e.pathname.startsWith(`//`)?n=e.href:vt(e,this.origin)||(n=yt(e),r=void 0)}return r&&(t.reloadDocument=!0),t.href=n,e.headers.set(`Location`,n),e},this.clearCache=e=>{let t=this._cache,n=this._preloads,r=e?.filter,i=[],a=[];for(let[e,n]of t)(!r||r(n))&&(a.push(e),i.push(n));let o=[];for(let[e,t]of n??[])(!r||t.some(r))&&(o.push(e),i.push(...t));for(let e of a)t.delete(e);for(let e of o)n.delete(e);for(let e of i){let t=e._flight;e._flight=void 0,t&&!--t[2]&&(this._flights?.get(e.id)===t&&this._flights.delete(e.id),o.push(t[1]))}for(let e of o)e.abort()},this.loadRouteChunk=z,this.preloadRoute=e=>mn(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=ne(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!w(o.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?w(a.search,r.search,{partial:!0})?o.rawParams:!1:o.rawParams},this.getStoreConfig=i,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...n,caseSensitive:n.caseSensitive??!1,notFoundMode:n.notFoundMode??`fuzzy`,stringifySearch:n.stringifySearch??et,parseSearch:n.parseSearch??$e,protocolAllowlist:n.protocolAllowlist??r}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=ee(e),this.routeBranchCache.set(e,t)),t}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:_(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let c=o?jt(this.options.notFoundMode,a):void 0,l=Array(a.length),u=this._committed,d=(e,t)=>{let n=u[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?u.find(t=>t.routeId===e.id):void 0},f;for(let n=0;n<a.length;n++){let i=a[n],o=l[n-1],u,p,m;{let n=o?.search??e.search,r=o?._strictSearch??void 0;try{let e=kt(i.options.validateSearch,{...n})??void 0;u={...n,...e},p={...r,...e}}catch(e){let r=e;if(e instanceof Dt||(r=new Dt(e.message,{cause:e})),t?.throwOnError)throw r;u=n,p={},m=r}}let h=``,g=``;try{h=i.options.loaderDeps?.({search:u})??``,g=h&&JSON.stringify(h)||``}catch(e){if(t?.throwOnError)throw e;m??=e}let{interpolatedPath:_,usedParams:v}=x({path:i.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),y=i.id+_+g,b=d(i,n),S=this._cache.get(y)??(b?.id===y?b:void 0);f=S?._strictParams??Object.assign(v,f);let C;if(!S)try{Nt(i,f)}catch(e){if(C=I(e)||ce(e)?e:new Ot(e.message,{cause:e}),t?.throwOnError)throw C}let w=b?`stay`:`enter`,T;if(S)T={...S,cause:w,search:s(b?b.search:S.search,u),_strictSearch:p,searchError:m};else{let e=bt(i)?`pending`:`success`;T={id:y,ssr:i.options.ssr,index:n,routeId:i.id,params:b?.params??f,_strictParams:f,pathname:_,updatedAt:Date.now(),search:b?s(b.search,u):u,_strictSearch:p,searchError:m,status:e,isFetching:!1,error:void 0,paramsError:C,context:{},abortController:t?._controller??new AbortController,cause:w,loaderDeps:b?ie(b.loaderDeps,h):h,invalid:!1,preload:!1,staticData:i.options.staticData||{},fullPath:i.fullPath}}let E=c===i.id;T._notFound&&!E&&(T.error=void 0),T._notFound=E,l[n]=T}for(let e=0;e<l.length;e++){let n=l[e];n.params=n.cause===`stay`?s(n.params,f):f,t?._controller&&(n.context={})}return l}matchRoutesLightweight(e){let t=i(this.stores.ids.get()),n=t?this.stores.byRoute.get(t).get():void 0,r=n?.id,a=this.lightweightCache.get(e);if(a&&a[0]===r)return a[1];let[o,s]=this.getMatchedRoutes(e.pathname),c=i(o),l={...e.search};for(let e of o)try{Object.assign(l,kt(e.options.validateSearch,l))}catch{}let u=n&&n.routeId===c.id&&n.pathname===e.pathname,d;if(u)d=n.params;else{let e=Object.assign(Object.create(null),s);for(let t of o)try{Nt(t,e)}catch{}d=e}let f=[o,c.fullPath,l,d];return this.lightweightCache.set(e,[r,f]),f}};async function Et(e,t,{replace:n,ignoreBlocker:r}){if(!d(t,e.protocolAllowlist)){if(!r){let t=e.history._getBlockers();for(let r of t)if(r?.blockerFn&&await r.blockerFn({currentLocation:e.history.location,nextLocation:e.history.location,action:n?`REPLACE`:`PUSH`}))return}e.history._ignoreNextBeforeUnload?.(t),n?window.location.replace(t):window.location.href=t}}var Dt=class extends Error{},Ot=class extends Error{};function kt(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Dt(`Async validation not supported`);if(n.issues)throw new Dt(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function At(e,t,n,r){let i=[];for(let e of n){let t=e.options;`search`in t?t.search?.middlewares&&i.push(...t.search.middlewares):(t.preSearchFilters||t.postSearchFilters)&&i.push(({search:e,next:n})=>{let r=n(t.preSearchFilters?t.preSearchFilters.reduce((e,t)=>t(e),e):e);return t.postSearchFilters?t.postSearchFilters.reduce((e,t)=>t(e),r):r});let n=t.validateSearch;r&&n&&i.push(({search:e,next:t,meta:r})=>{let i=t(e);try{let e=kt(n,i);if(r&&e)for(let t in e)t in i||(r.defaulted||=new Map).set(t,e[t]);return{...i,...e}}catch{}return i})}let a=(e,n,r)=>{if(e>=i.length){if(!t.search)return{};if(t.search===!0)return n;let e=C(t.search,n);return r&&(r.explicit=e),e}return i[e]({search:n,next:(t,n)=>{if(n){let n=r||{};return{search:a(e+1,t,n),meta:n}}return a(e+1,t,r)},meta:r})};return a(0,e)}function jt(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return oe}function Mt(e,t){if(e===!1||e===null)return Object.create(null);if((e??!0)===!0)return t;let n=Object.assign(Object.create(null),t);return Object.assign(n,C(e,n))}function Nt(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Pt(e,t){return e.options[t]?.preload?.()}function Ft(e,t){let n=Pt(e,`component`),r=Pt(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function z(e,t,n){let r=()=>t===!1?void 0:t?Pt(e,t):Ft(e,n),i=e._lazy;if(i)return i===!0?r():i.then(r);if(!e.lazyFn)return r();let a=e.lazyFn().then(t=>{{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazy=!0}},t=>{throw e._lazy=void 0,t});return e._lazy=a,a.then(r)}function It(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}var B=0,V=1,Lt=2,H=3,U=[4];function W(e){return typeof e[0]==`number`}function G(e,t){return t.aborted?Promise.race([Promise.reject(t),e]):new Promise((n,r)=>{let i=()=>r(t);t.addEventListener(`abort`,i,{once:!0}),Promise.resolve(e).then(n,r).then(()=>t.removeEventListener(`abort`,i))})}function K(e,t){return e.routesById[t.routeId]}function Rt(e,t,n){return ce(e)?[H,e]:I(e)?(e.routeId||=n,[Lt,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[V,e]):[B,e]}function zt(e,t){let n=Rt(t,!0,e.id);if(n[0]!==V)return n;try{e.options.onError?.(n[1])}catch(t){n=Rt(t,!0,e.id)}return n}function Bt(e,t,n,r,i){return i[0].signal.aborted?U:$t(e,t,n,zt(n,r),i)}async function Vt(e,t,n,r,i,a){let[o,s]=t,c=n[0].signal,l=!!n[3];for(let i=n[6]??0;i<r;i++){let r=s[i],u=K(e,r);r.abortController=n[0];let d=s[i-1]?.context??e.options.context??{},f={params:r.params,location:o,navigate:t=>e.navigate({...t,_fromLocation:o}),buildLocation:e.buildLocation,cause:l?`preload`:r.cause,abortController:n[0],preload:l,matches:s,routeId:u.id};try{let e=r._ctx||=u.options.context?u.options.context({...f,deps:r.loaderDeps,context:d})||{}:void 0;r.context={...d,...e}}catch(a){return q(e,r),[i,Bt(e,t,u,a,n)]}if(c.aborted)return[i,U];let p=r.paramsError??r.searchError;if(p!==void 0)return q(e,r),[i,Bt(e,t,u,p,n)];let m=u.options.beforeLoad;if(!m)continue;let h=r.status;i>=a&&(r.status=`pending`,n[7]?.());try{Wt(e,r,`beforeLoad`,n[0]);let a=m({...f,search:r.search,context:r.context,...e.options.additionalContext}),o=await(typeof a?.then==`function`?G(a,c):a);if(c.aborted)return[i,U];let s=$t(e,t,u,Rt(o,!1,u.id),n);if(s[0]!==B)return q(e,r),[i,s];r.context={...r.context,...o}}catch(a){return q(e,r),[i,Bt(e,t,u,a,n)]}finally{r.status=h,Wt(e,r,!1,n[0])}}i()}function Ht(e,t,n){if(!(!n||--n[2])){if(e._flights?.get(t.id)===n){let n=e._tx;if(n&&!n[0].signal.aborted&&!n[3].includes(t)&&n[3].some(e=>e.id===t.id)&&n[3].some(e=>e.isFetching===`beforeLoad`))return;e._flights.delete(t.id)}return n[1]}}function q(e,t){let n=t._flight;t._flight=void 0,Ht(e,t,n)?.abort()}function J(e,t,n,r){let i=[];for(let a of t)if(!n?.includes(a)){let t=a._flight;if(a._flight=void 0,r&&t?.[2]===1&&e._flights?.get(a.id)===t&&n?.some(e=>e.id===a.id))t[2]=0;else{let n=Ht(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function Ut(e){for(let t of e){let e=t._flight;e&&e[2]++}}function Wt(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function Gt(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:t=>e.navigate({...t,_fromLocation:s}),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function Kt(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return U;if(!i)return[B,void 0];let l=n._flight;Wt(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(Gt(e,t,n,r,s,a,!!o[3]))).then(e=>Rt(e,!1,r.id),e=>Rt(e,!0,r.id)).then(t=>(t[0]!==B&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===V&&l[2]?zt(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],$t(e,t,r,await G(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return q(e,n),U}finally{Wt(e,n,!1,s)}}function qt(e,t,n){t[0]!==H&&(e.status=`success`,e.error=void 0,t[0]===B?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function Jt(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&q(e,r)}function Yt(e,t){return t[0]===V||t[0]===Lt?{...e,status:t[0]===V?`error`:`notFound`,error:t[1],_flight:void 0}:e}function Xt(e,t,n,r,i,a,o){let s=t[1][n],c=K(e,s),l=!!a[3],u=e._cache.get(s.id),d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(Gt(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=U)),!p){if(s.status!==`success`)f=!0;else{let t=l||s.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;f=!!(s.invalid||d||d===void 0&&Date.now()-s.updatedAt>=t&&(a[5]||s.cause===`enter`||a[2].some(e=>e.routeId===s.routeId&&e.id!==s.id)))}}}catch(n){s.invalid=!0,q(e,s),p=Bt(e,t,c,n,a)}let m=c.options.loader,h=typeof m==`function`,g=h?m:m?.handler,_=!l||c.options.preload!==!1,v=_&&m?e._flights?.get(s.id):void 0;v===s._flight||p?v=void 0:v&&!f&&!l&&d===void 0?f=!0:f||(v=void 0);let y=!(!m||!f||s.status!==`success`||l||a[4]||((h?void 0:m.staleReloadMode)??e.options.defaultStaleReloadMode)===`blocking`),b=f&&_,x=b&&!y&&(s.status!==`success`||!!m),S=n>=o?a[7]:void 0,C=c.lazyFn&&c._lazy!==!0?S:void 0;if(b&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),v&&v[2]++,x){let t=s._flight;s._flight=v,Ht(e,s,t)?.abort(),n>=o&&(s.status=`pending`),S?.()}b||(s.isFetching=!1);let w=!p&&x?Kt(e,t,s,c,g,i,a).then(t=>(qt(s,t,l),t[0]===B&&(m&&!a[0].signal.aborted&&Jt(e,s,u),n>=o&&(s.status=`pending`)),t)):Promise.resolve(p??[B,s.loaderData]),T=(async()=>{try{let e=z(c,void 0,C);e&&await G(e,a[0].signal)}catch(r){if(!t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound)))return[n,Bt(e,t,c,r,a)]}let r=await w;x&&r[0]===B&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,S?.())})();if(r.push([n,w,T]),!y)return w.then(e=>Yt(s,e));let E={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let D=Kt(e,t,E,c,g,i,a).then(e=>(s.isFetching=!1,qt(E,e,!1),e));return(t[2]??=[]).push([n,D,T,E]),D.then(e=>Yt(E,e))}async function Zt(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=K(e,t[n]);try{let e=z(i,!1);e&&await G(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function Y(e,t){t[2]&&=(J(e,t[2].map(e=>e[3])),void 0)}async function Qt(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=H)throw[a,t];!i&&t[0]!==B&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===H)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function $t(e,t,n,r,i,a){for(;r[0]===H;){let o=r[1],s=o.options;try{if((s.href||o.headers.has(`Location`))&&(e.resolveRedirect(o),s.reloadDocument)||(s.reloadDocument?i[3]:i[1]>=20))return r;let n=e.buildLocation({...s,_fromLocation:t[0],_includeValidateSearch:!0}),a=n.maskedLocation??n;if(a.external){let t=o.clone();return t.options={...s},t.headers.set(`Location`,a.publicHref),e.resolveRedirect(t),i[3]?[H,t]:[H,t,a]}return[H,o,n]}catch(e){r=a?[V,e]:zt(n,e),a=!0}}return r}async function en(e,t,n,r,i,a){let o=t[1],s=await i,c=!1,l=o.findIndex(e=>e._notFound),u=t=>t[1][0]===Lt?Zt(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=H)d=0;else if(s){d=s[2]??=await u(s);for(let e of n){if(e[0]>=d)break;let t=await e[1];if(t[0]!==B&&t[0]<H&&!(`loaderData`in o[e[0]])){s=[e[0],t],d=s[2]=await u(s);break}}}for(let e of n){if(e[0]>=d)break;let t=await e[2];if(t){s=t;break}}if((s?.[1][0]??0)>=H){let n=s[1];if(n[0]!==H||n[1].options.reloadDocument||n[2])return Y(e,t),n;c=!0,s=[0,[V,Error(`Too many redirects`)]]}let f=s?s[2]??await u(s):l;if(f>=0){let i=s?.[1],l=i?.[0],u=o[f],d=i?.[1],p=()=>{i&&(u._notFound=void 0,l===V?u.status=`error`:(d.routeId=u.routeId,u.routeId===e.routeTree.id?(u.status=`success`,u._notFound=!0):u.status=`notFound`),u.error=d,u.isFetching=!1)};p(),i||a?.();let m=K(e,u);try{await G(i?Promise.resolve().then(()=>z(m,l===V?`errorComponent`:`notFoundComponent`)):Promise.all([z(m),z(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return Y(e,t),U}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),Y(e,t),J(e,o),p()):u.status=`success`}return t}async function tn(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;t<i;t++){let r=a[t],i=K(e,r).options;if(i.head||i.scripts)try{let t={ssr:e.options.ssr,matches:a,match:r,params:r.params,loaderData:r.loaderData},[o,s]=await G(Promise.all([i.head?.(t),i.scripts?.(t)]),n);r.meta=o?.meta,r.links=o?.links,r.headScripts=o?.scripts,r.styles=o?.styles,r.scripts=s}catch(e){if(e===n&&n.aborted)break;console.error(e)}if(r.status!==`success`||r._notFound)break}return t}async function nn(e,t,n,r){let i=[t,n],a=r[0].signal,o;try{let t=e.stores.matches.get(),s=n.findIndex(e=>e._notFound);if(e.options.notFoundMode!==`root`&&s>=0){let t=await Zt(e,n,void 0,a,s);n[s]._notFound=void 0,n[t]._notFound=!0,s=t}let c=s<0?n.length:s+1,l=0;for(;l<c&&l!==s;){let e=n[l],i=r[2][l],a=t[l];if(i?.id!==e.id||i.status!==`success`||e.preload||a?.id!==e.id||a.status!==`success`||(l++,i._notFound||a._notFound))break}let u=[],d=r[6]??0,f=d?Promise.resolve(n[d-1]):void 0,p=()=>{for(let t=d;t<c&&!a.aborted;t++)f=Xt(e,i,t,u,f,r,l)},m=await Vt(e,i,r,c,p,l);if(m){if(r[4]=!0,c=m[0],m[1][0]===Lt){let t=await Zt(e,n,m,a);m[2]=t,c=Math.min(c,t+1)}else m[1][0]>=H&&(c=0);p()}if(!a.aborted&&!r[3]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let h=en(e,i,u,r[0],Qt(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=Qt(i[2],void 0,void 0,h.then(e=>W(e)?0:It(n).length,()=>0))),o=await h}catch(t){if(Y(e,i),t===a&&a.aborted)return U;throw t}return W(o)?o:tn(e,o,a,r[6]===n.length?r[6]:0)}function rn(e,t){if(e._tx!==t)return;let n=t[3],r=e.stores.matches.get(),i=e._pending;for(let a=0;a<n.length;a++){let o=n[a],s=o.status===`success`&&!o._notFound,c=r[a]?.id===o.id&&r[a]?.status===`pending`;if(s&&!c)continue;let l=K(e,o),u=s||o.invalid?0:l.options.pendingMs??e.options.defaultPendingMs,d=l.options.pendingComponent??e.options.defaultPendingComponent;if(!d||typeof u!=`number`||u===1/0){i&&(i[0]=t,i[2]=0,i[4]=!0);return}let f=l.options.pendingMinMs??e.options.defaultPendingMinMs??0,p=!1;if(i?.[1]===o.id?(p=i[0]!==t,i[0]=t):(clearTimeout(i?.[3]),e._pending=i=void 0),i||(e._pending=i=[t,o.id,c?Date.now()+f:t[4]+u,void 0,c||void 0,d]),i[4]&&!p&&i[5]===d)return;if(i[5]=d,!i[4]){clearTimeout(i[3]);let n=i[2]-Date.now();if(n>0){i[3]=setTimeout(()=>rn(e,t),n);return}i[2]=0}let m=n.map(e=>({...e,_flight:void 0}));m[a].status=`pending`;let h=i[4]=e.startTransition(()=>e.stores.setMatches(m),m).then(t=>(t&&e._pending===i&&i[4]===h&&!i[2]&&(i[2]=Date.now()+f),t));return}}function an(e,t){let n=e._pending;(e._tx===t||!e._tx?.[3].some(e=>e.id===n?.[1]))&&(clearTimeout(n?.[3]),e._pending=void 0)}async function on(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!It(t[3]).some(e=>e.id===n[1]))return;let i;try{await G(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function sn(e,t){e._committed=t,e.stores.setMatches(t)}function cn(e,t,n,r){let i=e._committed,a=e._lifecycleEnd,o=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let s=It(n).length,c=new Map;{let t=Date.now(),r=new Set;for(let e=0;e<n.length;e++){let t=n[e];(e<s||t.status===`success`)&&r.add(t.id)}for(let n of[...i,...o.values()]){if(n.status!==`success`||r.has(n.id))continue;let i=K(e,n);!i.options.loader||t-n.updatedAt>=(n.preload?i.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:i.options.gcTime??e.options.defaultGcTime??3e5)||c.set(n.id,o.get(n.id)===n?n:{...n,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=c;let l=e._lifecycleEnd=Ct(n);sn(e,n),J(e,[...o.values(),...i].filter(e=>e._flight&&c.get(e.id)!==e),n),wt(e,i,n,a,l,t)}async function ln(e,t){let n=e._tx;for(;n&&n!==t;)t=n,await n[5],n=e._tx}function un(e,t,n){let r=n[1].options,i=n[2];if(!i)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:(i.maskedLocation??i).publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});i._redirects=t[1]+1,e._pendingLocation=i;let a=e.commitLocation({...i,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===i&&(e._pendingLocation=void 0)}),a}async function dn(e,t,n,r,i){let a=n.map(e=>({...e}));Ut(a);for(let t of r)q(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await en(e,o,r,t[0],i)}catch(t){throw J(e,a),t}if(W(s)){J(e,a),s[0]===H&&e._tx===t&&e._committed===n&&await un(e,t,s);return}if(await tn(e,s,t[0].signal),e._tx!==t||e._committed!==n){J(e,a);return}for(let t of a){let n=e._cache.get(t.id);n?._flight&&n._flight===t._flight&&(e._cache.delete(t.id),q(e,n))}sn(e,a),J(e,n,a)}async function fn(e,t,n,r,i,a){let o=await nn(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if(W(o)){let n=o[0]===H&&e._tx===t;if((!n||o[1].options.reloadDocument)&&an(e,t),J(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){an(e,t);return}await un(e,t,o);return}let s=o[1];if(e._tx===t&&await on(e,t),e._tx!==t){an(e,t),J(e,s),Y(e,o);return}let c=t[2],l=xt(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await on(e,t),e._tx!==t){an(e,t),J(e,s),Y(e,o);return}let n=await e.startTransition(()=>{an(e,t),cn(e,t,s,a),e._tx===t&&(e.emit({type:`onLoad`,...l}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...l}))},s);if(e._tx!==t){Y(e,o);return}u?.length&&dn(e,t,s,u,o[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(c),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...l}),n&&e._tx===t&&e.emit({type:`onRendered`,...l})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)})}async function pn(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),!u.signal.aborted){let t=xt(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await ln(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});Ut(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){J(e,m),await ln(e,n);return}e._preflight=void 0;let g,_=()=>fn(e,y,f,()=>rn(e,y),t?.sync,h),v=t?.sync?new Promise(e=>g=e):Promise.resolve().then(_),y=[p,s,a,m,Date.now(),v.then(()=>ln(e,y))];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&Wt(e,t,!1)}n[0].abort(),J(e,n[3],y[3],!0)}if(e._tx!==y){J(e,y[3]),y[3]=[],g?.(),await ln(e,y);return}e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),(h||!e._committed.length&&m[0]?.status!==`success`&&!m.some(e=>e._notFound))&&rn(e,y),g?.(_()),await y[5]}async function mn(e,t){let n=e.buildLocation(t);for(let t=0;;t++){let r=e._committed,i=new AbortController,a,o,s;try{try{a=e.matchRoutes(n,{_controller:i}),Ut(a),o=(e._preloads??=new Map).set(i,a),s=await nn(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),J(e,a)),i.abort()}if(!W(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){I(e)||console.error(e);return}}}var hn=class extends M.Component{constructor(...e){super(...e),this.state={error:0},this.reset=()=>{this.setState({error:0})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:0}:{resetKey:n}}static getDerivedStateFromError(e){return{error:[e]}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?M.createElement(this.props.errorComponent??gn,{error:e[0],reset:this.reset}):this.props.children}};function gn({error:e}){let[t,n]=M.useState(!1);return F(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[F(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[P(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),P(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),P(`div`,{style:{height:`.25rem`}}),t?P(`div`,{children:P(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e?.message?P(`code`,{children:e.message}):null})}):null]})}var X=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(X||{});function _n({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(1)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(1)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function vn(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var yn=[],bn=0,{link:xn,unlink:Sn,propagate:Cn,checkDirty:wn,shallowPropagate:Tn}=_n({update(e){return e._update()},notify(e){yn[Dn++]=e,e.flags&=~X.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=X.Mutable|X.Dirty,An(e))}}),En=0,Dn=0,Z,On=0;function kn(e){try{++On,e()}finally{--On||jn()}}function An(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=Sn(n,e)}function jn(){if(!(On>0)){for(;En<Dn;){let e=yn[En];yn[En++]=void 0,e.notify()}En=0,Dn=0}}function Mn(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?X.None:X.Mutable,get(){return Z!==void 0&&xn(i,Z,bn),i._snapshot},subscribe(e){let t=vn(e),n={current:!1},r=Nn(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=Z,o=t?.compare??Object.is;if(n)Z=i,++bn,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=X.Mutable|X.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{Z=a,n&&(i.flags&=~X.RecursedCheck),An(i)}}};return n?(i.flags=X.Mutable|X.Dirty,i.get=function(){let e=i.flags;if(e&X.Dirty||e&X.Pending&&wn(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&Tn(e)}}else e&X.Pending&&(i.flags=e&~X.Pending);return Z!==void 0&&xn(i,Z,bn),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(Cn(e),Tn(e),jn())}},i}function Nn(e){let t=()=>{let t=Z;Z=n,++bn,n.depsTail=void 0,n.flags=X.Watching|X.RecursedCheck;try{return e()}finally{Z=t,n.flags&=~X.RecursedCheck,An(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:X.Watching|X.RecursedCheck,notify(){let e=this.flags;e&X.Dirty||e&X.Pending&&wn(this.deps,this)?t():this.flags=X.Watching},stop(){this.flags=X.None,this.depsTail=void 0,An(this)}};return t(),n}function Pn(e){let t=j(),n=`not-found-${y(t.stores.location,e=>e.pathname)}-${y(t.stores.status,e=>e)}`;return P(hn,{getResetKey:()=>n,onCatch:(t,n)=>{if(I(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(I(t))return e.fallback?.(t);throw t},children:e.children})}function Fn(){return P(`p`,{children:`Not Found`})}function Q(e){return P(Ne,{children:e.children})}function In(e,t,n){return t.options.notFoundComponent?P(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?P(e.options.defaultNotFoundComponent,{...n}):P(Fn,{})}function Ln(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?P(n,{}):null}var Rn=(e,t)=>e[0]===t[0]&&e[1]===t[1],zn=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,Bn=M.memo(function({routeId:e}){let t=j();return P(Vn,{router:t,match:y(t.stores.getMatchStore(e),e=>e)})});function Vn({router:e,match:t}){let n=e.routesById[t.routeId],r=Ln(e,n),i=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,o=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,s=t.ssr===!1||t.ssr===`data-only`,c=zn(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||s))?M.Suspense:Q,l=i?hn:Q,u=o?Pn:Q;return F(n.isRoot?n.options.shellComponent??Q:Q,{children:[P(ae.Provider,{value:t.routeId,children:P(c,{fallback:r,children:P(l,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(I(e))throw e.routeId??=t.routeId,e;a?.(e,n)},children:P(u,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return M.createElement(o,e)},children:s?P(D,{fallback:r,children:P(Hn,{match:t})}):P(Hn,{match:t})})})})}),null]})}var Hn=M.memo(function({match:e}){let t=j(),n=e.routeId,r=t.routesById[n],i=M.useMemo(()=>{let i=(r.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,t.options.defaultRemountDeps]),a=M.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?P(e,{},i):P(Un,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!zn(t,r,e.ssr))return a;if(t._tx)throw t._tx[5];return Ln(t,r)}if(e.status===`notFound`)return In(t,r,e.error);if(e.status===`error`)throw e.error;return a}),Un=M.memo(function(){let e=j(),t=M.useContext(ae),n,r,i;{let a=e.stores.getMatchStore(t);[n,r]=y(a,e=>[!!e._notFound,e.error],Rn),i=y(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return In(e,e.routesById[t],r);if(!i)return null;let a=P(Bn,{routeId:i});return t===`__root__`?P(M.Suspense,{fallback:Ln(e),children:a}):a});function Wn(e,t){let n=e[1];e.length=0,n?.(t)}function Gn({t:e}){let t=j(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise(a=>{Wn(n,!1),n.push(i,a),e(t),M.startTransition(r)}),h(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(_(r.publicHref)!==_(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...xt(a,a)})}):t._tx||t.load({sync:!0}).catch(console.error),e},[t,t.history]),null}function Kn(){let e=j(),t=e.routesById[oe],n=Ln(e,t),r=e.ssr?Q:M.Suspense,i=F(Ne,{children:[P(Gn,{t:M.useState()[1]}),P(r,{fallback:n,children:P(qn,{})})]});return e.options.InnerWrap?P(e.options.InnerWrap,{children:i}):i}function qn(){let e=j(),t=e._rendered,n=y(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;h(()=>{t[0]===n&&Wn(t,!0)},[t,n]);let a=i?P(Bn,{routeId:i}):null;return P(ae.Provider,{value:i,children:e.options.disableGlobalCatchBoundary?a:P(hn,{getResetKey:()=>r,onCatch:void 0,children:a})})}var Jn=e=>({createMutableStore:Mn,createReadonlyStore:Mn,batch:kn}),Yn=e=>new Xn(e),Xn=class extends Tt{constructor(e){super(e,Jn)}};function Zn({router:e,children:t,...n}){l(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=P(ue.Provider,{value:e,children:t});return e.options.Wrap?P(e.options.Wrap,{children:r}):r}function Qn({router:e,...t}){return P(Zn,{router:e,...t,children:P(Kn,{})})}var $n=Fe.div`
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
min-height: 100vh;
|
|
8
|
+
padding: ${({theme:e})=>e.space(4)};
|
|
9
|
+
text-align: center;
|
|
10
|
+
`,er=Fe.p`
|
|
11
|
+
font-size: 13px;
|
|
12
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
13
|
+
max-width: 48ch;
|
|
14
|
+
`,tr=se()({component:Un,notFoundComponent:()=>P($n,{children:F(de,{$gap:3,style:{alignItems:`center`},children:[P(_e,{children:`Not found`}),P(er,{children:`This console has no screen at that address.`}),P(pe,{as:`a`,href:`/`,$variant:`primary`,$size:`sm`,children:`Back to the rack`})]})})}),nr=`stream:console`,rr={"res:usage":{predicate:e=>e.queryKey[0]===`usage`||e.queryKey[0]===`client`&&(e.queryKey[1]===`usage`||e.queryKey[1]===`summary`)},"res:logs":{predicate:e=>e.queryKey[0]===`logs`&&e.queryKey[1]!==`body`||e.queryKey[0]===`client`&&e.queryKey[1]===`logs`||(e.queryKey[0]===`logPages`||e.queryKey[0]===`client`&&e.queryKey[1]===`logPages`)&&o(e.state.data)},"res:credentials":{queryKey:a.credentials},"res:keys":{queryKey:a.keys},"res:settings":{queryKey:a.settings},"res:models":{queryKey:a.models},"res:quota":{predicate:e=>e.queryKey[0]===`quota-history`||e.queryKey[0]===`credentials`&&e.queryKey[1]===`health`},[nr]:{queryKey:[`console`]}},ir=Object.keys(rr),ar=ir.filter(e=>e.startsWith(`res:`)),or=ir.filter(e=>e.startsWith(`stream:`));function sr(e,t){if(t===`res:*`){lr(e);return}let n=rr[t];n!==void 0&&e.invalidateQueries(n)}function cr(e){for(let t of ir)sr(e,t)}function lr(e){e.invalidateQueries()}var ur=4401,dr=500,fr=3e4,pr=new Set([...ar,...or]),mr=3,hr=6e4,gr=(e,t)=>{let n=setTimeout(e,t);return()=>clearTimeout(n)};function _r(){let{protocol:e,host:t}=window.location;return`${e===`https:`?`wss:`:`ws:`}//${t}/api/stream`}function vr(e){if(typeof e!=`string`)return null;let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t||Array.isArray(t))return null;let n=t,{type:r,topic:i,seq:a}=n;return typeof r!=`string`||i!==void 0&&typeof i!=`string`||a!==void 0&&typeof a!=`number`?null:{type:r,...typeof i==`string`?{topic:i}:{},...typeof a==`number`?{seq:a}:{},...`payload`in n?{payload:n.payload}:{}}}function yr(e){let t=new Set,n=new Set,r=new Map,i=new Map,a=new Map,o=e=>a.has(e)||pr.has(e),s=[],c=null,l=!1,u=!1,d=!1,f=!1,p=!1,m=0,h=null,g={status:`poll`,pushed:()=>!1};function _(){let e=p?`offline`:u&&!f?`push`:`poll`,r=e===`push`;g={status:e,pushed:e=>r&&n.has(e)};for(let e of t)e()}function v(e){c?.send(JSON.stringify(e))}function y(e,t){let n=i.get(e);if(n===void 0||n.size===0)return!1;for(let e of[...n])e(t);return!0}function b(){for(let e of ar)v({type:`subscribe`,topic:e});for(let e of or){let t=r.get(e);v(t===void 0?{type:`subscribe`,topic:e}:{type:`subscribe`,topic:e,sinceSeq:t})}for(let e of a.keys())v({type:`subscribe`,topic:e})}function x(){u=!0,m=0,n.clear(),d&&cr(e.client),d=!0,b(),_()}function S(t){let i=vr(t.data);if(i===null)return;let{topic:a}=i;if(i.type===`ack`){a!==void 0&&o(a)&&(n.add(a),y(a,{kind:`open`}),_());return}if(i.type===`error`){a!==void 0&&(n.delete(a)&&_(),y(a,{kind:`refused`}));return}if(a!==void 0){if(i.type===`gap`){i.seq!==void 0&&r.set(a,i.seq),y(a,{kind:`gap`}),sr(e.client,a);return}if(i.type===`event`){if(a===`res:*`){lr(e.client);return}if(i.seq!==void 0){let t=r.get(a);if(r.set(a,i.seq),t!==void 0&&i.seq>t+1){y(a,{kind:`gap`}),sr(e.client,a);return}}i.payload!==void 0&&y(a,{kind:`frame`,payload:i.payload})||sr(e.client,a)}}}function C(t){let r=u;u=!1,c=null,n.clear();for(let e of[...i.keys()])y(e,{kind:`closed`});if(l){if(t.code===ur){p=!0,l=!1,_(),lr(e.client);return}if(!r)f=!0;else{let t=e.now();s=[...s.filter(e=>e>t-hr),t],s.length>=mr&&(f=!0)}_(),w()}}function w(){let t=Math.min(fr,dr*2**m);m+=1,h=e.timer(()=>{h=null,l&&T()},t)}function T(){let t=new WebSocket(e.url());c=t,t.addEventListener(`open`,x),t.addEventListener(`message`,S),t.addEventListener(`close`,C)}function E(e,t){let n=i.get(e)??new Set;return i.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&i.delete(e)}}return{subscribe(e){return t.add(e),()=>{t.delete(e)}},snapshot:()=>g,hold(e,t){let r=E(e,t),i=(a.get(e)??0)+1;a.set(e,i),i===1&&u&&v({type:`subscribe`,topic:e}),n.has(e)&&t({kind:`open`});let o=!1;return()=>{if(o)return;o=!0,r();let t=(a.get(e)??1)-1;if(t>0){a.set(e,t);return}a.delete(e),n.delete(e)&&_(),u&&v({type:`unsubscribe`,topic:e})}},publish(e,t){return!u||!n.has(e)?!1:(v({type:`send`,topic:e,payload:t}),!0)},onStream:E,start(){return l=!0,T(),()=>{l=!1,h?.(),h=null;let e=c;c=null,u=!1,e?.close()}}}}var br=Oe(null),xr=Oe(null),Sr=Oe(null),Cr={status:`poll`,pushed:()=>!1};function wr({children:e,enabled:t=!0,timer:n=gr,now:r=Date.now,url:i=_r}){let a=Ee(),[o]=je(()=>yr({client:a,timer:n,now:r,url:i})),[s]=je(()=>({subscribe:(e,t)=>o.hold(e,e=>{if(e.kind===`gap`){t({kind:`closed`});return}t(e)}),send:o.publish}));N(()=>{if(t)return o.start()},[o,t]);let c=Me(o.subscribe,o.snapshot,o.snapshot);return P(br,{value:c,children:P(xr,{value:o.onStream,children:P(Sr,{value:s,children:e})})})}function Tr(){return ke(br)??Cr}function Er(e,t){let n=ke(xr),r=Ae(t);N(()=>{r.current=t}),N(()=>{if(n!==null)return n(e,e=>r.current(e))},[n,e])}function Dr(e,t){let n=ke(Sr),r=Ae(t);N(()=>{r.current=t}),N(()=>{if(n!==null&&e!==null)return n.subscribe(e,e=>r.current(e))},[n,e])}function Or({children:e}){let t=Tr(),n=ke(Sr);return P(ye,{connection:t,...n===null?{}:{channels:n},children:e})}async function kr(e){return e.queryClient.ensureQueryData({queryKey:a.status,queryFn:()=>fe(`/api/status`),revalidateIfStale:!0})}function Ar(e){let t=e.principal;return e.authenticated!==!0||t==null?`/login`:t.kind===`client`?`/client`:t.kind===`admin`||t.kind===`viewer`?`/`:`/login`}function jr(e,t){let n=Ar(e);if(n===`/login`)throw le({to:`/login`,search:{next:t}});if(n!==`/`)throw le({to:n})}function Mr(e,t){let n=Ar(e);if(n===`/login`)throw le({to:`/login`,search:{next:t}});if(n!==`/client`)throw le({to:n})}var Nr=k(`/_app`)({beforeLoad:async({context:e,location:t})=>{jr(await kr(e),t.href),await e.queryClient.ensureQueryData(g)},pendingComponent:Pr,pendingMs:200,errorComponent:O(()=>A(()=>import(`./_app-CSru2YTE.js`),__vite__mapDeps([0,1])),`errorComponent`),component:Fr});function Pr(){return P(he,{legend:`Console`,children:P(ge,{rows:6})})}function Fr(){let e=f().data??[];return P(wr,{children:F(Or,{children:[P(be,{$providers:e}),P(xe,{children:P(Un,{})})]})})}var Ir=k(`/client`)({beforeLoad:async({context:e,location:t})=>{Mr(await kr(e),t.href)},component:O(()=>A(()=>import(`./client-B9t0CsmA.js`),__vite__mapDeps([2,3,4,1,5,6,7,8,9,10,11,12,13,14,15,16,17,18])),`component`)}),Lr=k(`/login`)({validateSearch:e=>({...typeof e.next==`string`?{next:e.next}:{},...typeof e.reason==`string`?{reason:e.reason}:{}}),component:O(()=>A(()=>import(`./login-NuwPF5SS.js`),__vite__mapDeps([19,4,1,11,20])),`component`)}),Rr=k(`/_app/`)({component:O(()=>A(()=>import(`./_app.index-DW6wain4.js`),__vite__mapDeps([21,4,1,5,7,10,14,12,18])),`component`)}),zr=k(`/_app/accounts`)({component:O(()=>A(()=>import(`./_app.accounts-xCJhRd32.js`),__vite__mapDeps([22,4,1,5,23,13,8,24,25,26,27,9,10,11,14,12,15,3])),`component`)}),Br=k(`/_app/console`)({component:O(()=>A(()=>import(`./_app.console-DS37cfIu.js`),__vite__mapDeps([28,4,1,5,11])),`component`)}),Vr=k(`/_app/database`)({component:O(()=>A(()=>import(`./_app.database-BCwEMrEA.js`),__vite__mapDeps([29,4,1,5,26,11,14,12,18,20])),`component`)}),Hr=k(`/_app/keys`)({component:O(()=>A(()=>import(`./_app.keys-CCU2NB3-.js`),__vite__mapDeps([30,4,1,5,23,13,8,24,27,9,10,11,14,12,16])),`component`)}),Ur=k(`/_app/logs`)({component:O(()=>A(()=>import(`./_app.logs-CRC5qDK3.js`),__vite__mapDeps([31,4,1,5,6,7,8,9,10,11,12])),`component`)}),Wr=k(`/_app/models`)({component:O(()=>A(()=>import(`./_app.models-B4brzRdK.js`),__vite__mapDeps([32,4,1,5,24,25,26,27,9,10,11,14])),`component`)}),Gr=k(`/_app/settings`)({component:O(()=>A(()=>import(`./_app.settings-NJSb_L2B.js`),__vite__mapDeps([33,4,1,5,27,9,11,14,20])),`component`)}),Kr=k(`/_app/usage`)({component:O(()=>A(()=>import(`./_app.usage-BR6a92zI.js`),__vite__mapDeps([34,3,4,1,5,11,12,17,18])),`component`)}),qr=k(`/_app/plugins/$pluginId`)({component:O(()=>A(()=>import(`./_app.plugins._pluginId-CD9KXknf.js`),__vite__mapDeps([35,4,1,36,5])),`component`)}),$=Nr.update({id:`/_app`,getParentRoute:()=>tr}),Jr=Ir.update({id:`/client`,path:`/client`,getParentRoute:()=>tr}),Yr=Lr.update({id:`/login`,path:`/login`,getParentRoute:()=>tr}),Xr=Rr.update({id:`/`,path:`/`,getParentRoute:()=>$}),Zr={AppAccountsRoute:zr.update({id:`/accounts`,path:`/accounts`,getParentRoute:()=>$}),AppConsoleRoute:Br.update({id:`/console`,path:`/console`,getParentRoute:()=>$}),AppDatabaseRoute:Vr.update({id:`/database`,path:`/database`,getParentRoute:()=>$}),AppKeysRoute:Hr.update({id:`/keys`,path:`/keys`,getParentRoute:()=>$}),AppLogsRoute:Ur.update({id:`/logs`,path:`/logs`,getParentRoute:()=>$}),AppModelsRoute:Wr.update({id:`/models`,path:`/models`,getParentRoute:()=>$}),AppSettingsRoute:Gr.update({id:`/settings`,path:`/settings`,getParentRoute:()=>$}),AppUsageRoute:Kr.update({id:`/usage`,path:`/usage`,getParentRoute:()=>$}),AppIndexRoute:Xr,AppPluginsPluginIdRoute:qr.update({id:`/plugins/$pluginId`,path:`/plugins/$pluginId`,getParentRoute:()=>$})},Qr={AppRoute:$._addFileChildren(Zr),ClientRoute:Jr,LoginRoute:Yr},$r=tr._addFileChildren(Qr)._addFileTypes();function ei(e){return{isLoginRoute:()=>e().state.location.pathname===`/login`,onUnauthenticated:()=>void e().navigate({to:`/login`,search:{next:e().state.location.href}})}}function ti(e){let t=t=>{t instanceof me&&t.isUnauthenticated&&(e.isLoginRoute()||e.onUnauthenticated())};return new we({queryCache:new Ce({onError:t}),mutationCache:new Se({onError:t}),defaultOptions:{queries:{retry:(e,t)=>t instanceof me&&t.isUnauthenticated?!1:e<2,staleTime:5e3,refetchOnWindowFocus:!0},mutations:{retry:!1}}})}var ni,ri=ti(ei(()=>ni));ni=Yn({routeTree:$r,context:{queryClient:ri}});var ii=document.getElementById(`root`);if(ii===null)throw Error(`#root is missing from index.html`);Pe(ii).render(P(De,{children:P(ve,{children:P(Te,{client:ri,children:P(Qn,{router:ni})})})}));export{Dr as a,sr as c,Or as i,Lr as n,Er as o,wr as r,nr as s,qr as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ot as e,Qt as t,sn as n,t as r,tn as i}from"./Lamp-CL0i4yaa.js";import{O as a,S as o,T as s,c,i as l,k as u,y as d}from"./Panel-CsovmtxF.js";import{n as f}from"./index-6rZSWe9j.js";import{n as p,t as m}from"./Field-EvdVyEqx.js";import{t as h}from"./reasons-Du1OBWAM.js";import{useState as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import y from"styled-components";var b=y.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
@@ -42,4 +42,4 @@ import{Et as e,Qt as t,Yt as n,in as r,t as i}from"./Lamp-Dk9XrTCg.js";import{O
|
|
|
42
42
|
font: inherit;
|
|
43
43
|
font-size: 12px;
|
|
44
44
|
cursor: pointer;
|
|
45
|
-
`;function O(){let a=
|
|
45
|
+
`;function O(){let a=n(),{next:l,reason:y}=f.useSearch(),O=i(),k=e(),A=t(),[j,M]=g(``),[N,P]=g(``),[F,I]=g(null),[L,R]=g(`admin`),z=O.data?.configured===!1,B=[{id:`admin`,label:`Operator`,blurb:`This console is for the operator of this gateway.`},...O.data?.viewerConfigured===!0?[{id:`viewer`,label:`Read-only`,blurb:`Everything the operator can see, and nothing they can change.`}]:[],{id:`client`,label:`API key`,blurb:`Your own usage, limits and requests. Sign in with a gateway API key.`}],V=L===`client`,H=h(y),U=k.isPending||A.isPending||O.isLoading,W=()=>{if(V){a({to:`/client`});return}a({to:l?.startsWith(`/`)===!0?l:`/`})};return _(b,{children:v(x,{children:[v(S,{children:[_(r,{state:O.isError?`down`:`ok`,label:O.isError?`gateway unreachable`:`gateway reachable`}),`Omnigateway`]}),v(C,{onSubmit:e=>{if(e.preventDefault(),I(null),z){if(j!==N){I(`The two passwords do not match.`);return}A.mutate(j,{onSuccess:W,onError:e=>I(c(e))});return}k.mutate({mode:L,secret:j},{onSuccess:W,onError:()=>I(V?`That API key was not accepted. It may have been revoked.`:`That password does not match. Try again.`)})},children:[O.isError?_(T,{children:`The gateway is not answering. Check that it is running, then reload.`}):null,H===null?null:_(E,{role:`status`,children:H}),v(s,{$gap:1,children:[_(d,{children:z?`First run`:`Sign in`}),_(w,{children:z?`Set the operator password for this gateway. It is the only account, and it is stored hashed.`:B.find(e=>e.id===L)?.blurb??``})]}),z||B.length<2?null:_(o,{$gap:1,$wrap:!0,role:`tablist`,"aria-label":`Sign in as`,children:B.map(e=>_(D,{type:`button`,role:`tab`,"aria-selected":e.id===L,$on:e.id===L,onClick:()=>{R(e.id),M(``),I(null)},children:e.label},e.id))}),_(m,{label:V?`API key`:`Password`,children:e=>_(p,{...e,type:`password`,autoFocus:!0,autoComplete:z?`new-password`:V?`off`:`current-password`,value:j,onChange:e=>M(e.target.value)})}),z?_(m,{label:`Confirm password`,children:e=>_(p,{...e,type:`password`,autoComplete:`new-password`,value:N,onChange:e=>P(e.target.value)})}):null,F===null?null:_(T,{role:`alert`,children:F}),_(o,{children:_(u,{type:`submit`,$variant:`primary`,disabled:U||j.length===0,children:z?`Set password and sign in`:`Sign in`})})]})]})})}export{O as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as e}from"./Rack-DMrfn4-H.js";var t={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};t.node;var n=e(t);export{n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Bn as e,Fn as t,Tn as n,_n as r,cn as i,gn as a,on as o,pn as s,sn as c,zn as l}from"./Lamp-CL0i4yaa.js";import{j as u}from"./Panel-CsovmtxF.js";import*as d from"react";import f from"react";import{jsx as p}from"react/jsx-runtime";var m=`__root__`;function h(e){e.statusCode=e.statusCode||e.code||307;let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function g(e){return e instanceof Response&&!!e.options}var _=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,i=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),i?this._path=m:this.parentRoute||n();let o=i?m:t?.path;o&&o!==`/`&&(o=a(o));let c=t?.id||o,l=i?m:s([this.parentRoute.id===`__root__`?``:this.parentRoute.id,c]);o===`__root__`&&(o=`/`),l!==`__root__`&&(l=s([`/`,l]));let u=l===`__root__`?`/`:s([this.parentRoute.fullPath,o]);this._path=o,this._id=l,this._fullPath=u,this._to=r(u)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>h({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},v=class extends _{constructor(e){super(e)}},y=d.createContext(void 0),b=d.createContext(void 0),x={};function S(e,t){let n=d.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=l(n.current,i):i}}function C(e){let t=u(),r=d.useContext(e.from?b:y),a=e.from??r,o=t.stores.getMatchStore(a),s=S(e,t),c=i(o,e=>e?s(e):x);if(c!==x)return c;(e.shouldThrow??!0)&&n()}function w(e){return C({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function T(e){let{select:t,...n}=e;return C({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function E(e){return C({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function D(e){return C({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function O(e){return C({...e,select:t=>e.select?e.select(t.context):t.context})}var k=class extends _{constructor(e){super(e),this.useMatch=e=>C({...e,from:this.id}),this.useRouteContext=e=>O({...e,from:this.id}),this.useSearch=e=>D({...e,from:this.id}),this.useParams=e=>E({...e,from:this.id}),this.useLoaderDeps=e=>T({...e,from:this.id}),this.useLoaderData=e=>w({...e,from:this.id}),this.useNavigate=()=>c({from:this.fullPath}),this.Link=f.forwardRef((e,t)=>p(o,{ref:t,from:this.fullPath,...e}))}};function A(e){return new k(e)}function j(){return e=>N(e)}var M=class extends v{constructor(e){super(e),this.useMatch=e=>C({...e,from:this.id}),this.useRouteContext=e=>O({...e,from:this.id}),this.useSearch=e=>D({...e,from:this.id}),this.useParams=e=>E({...e,from:this.id}),this.useLoaderDeps=e=>T({...e,from:this.id}),this.useLoaderData=e=>w({...e,from:this.id}),this.useNavigate=()=>c({from:this.fullPath}),this.Link=f.forwardRef((e,t)=>p(o,{ref:t,from:this.fullPath,...e}))}};function N(e){return new M(e)}function P(e){return e=>{let t=A(e);return t.isRoot=!1,t}}function F(n,r){let i,a,o,s=()=>(i||=(o=void 0,n().then(e=>{i=void 0,c.preload=void 0,a=e[r??`default`]}).catch(e=>{i=void 0,o=e})),i),c=function(n){if(o){if(t(o)&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${o.message}`;if(!sessionStorage.getItem(e))throw sessionStorage.setItem(e,`1`),window.location.reload(),new Promise(()=>{})}throw o}if(!a){if(e)e(s());else throw s()}return d.createElement(a,n)};return c.preload=s,c}var I=`modulepreload`,L=function(e){return`/`+e},R={},z=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=L(t,n),t=s(t),t in R)return;R[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:I,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};export{y as a,m as c,j as i,F as n,g as o,P as r,h as s,z as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e}from"./Rack-
|
|
1
|
+
import{A as e}from"./Rack-DMrfn4-H.js";var t={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};t.node;var n=e(t);export{n as t};
|