@yansigit/opencodex 2.36.1-dev.20260829.48 → 2.36.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/gui/dist/assets/{ApiKeys-LOOFiZfv.js → ApiKeys-CsmNyf4I.js} +1 -1
- package/gui/dist/assets/{Claude-BwKzpXe3.js → Claude-B4sHsGTD.js} +1 -1
- package/gui/dist/assets/{CodexSet-B5qi9KeE.js → CodexSet-BuAQ4YQn.js} +1 -1
- package/gui/dist/assets/{FileIntegrationPage-B0sUef6W.js → FileIntegrationPage-BC65sEaS.js} +1 -1
- package/gui/dist/assets/{Grok-bsb4n-f4.js → Grok-DNJWlISf.js} +1 -1
- package/gui/dist/assets/{Integrations-CSMwFDvM.js → Integrations-vGJshFZK.js} +2 -2
- package/gui/dist/assets/{IntegrationsOverview-CTORdKJA.js → IntegrationsOverview-DYMkDFHE.js} +1 -1
- package/gui/dist/assets/{Logs-BWYbfELf.js → Logs-Coc7_RPP.js} +1 -1
- package/gui/dist/assets/{Models-CexEtdT1.js → Models-CKVT8Meb.js} +1 -1
- package/gui/dist/assets/{NumberStepper-BapSFQnW.js → NumberStepper-Dug4wR8n.js} +1 -1
- package/gui/dist/assets/{Providers-BwUFeAgA.js → Providers-DyaCHRWL.js} +1 -1
- package/gui/dist/assets/{RestoreDialog-CD8piq90.js → RestoreDialog-BpuvVU2w.js} +1 -1
- package/gui/dist/assets/{Startup-BgX731C2.js → Startup-DAUQqNEN.js} +1 -1
- package/gui/dist/assets/{Storage-Bgq7HphP.js → Storage-DfP95SlJ.js} +1 -1
- package/gui/dist/assets/{Subagents-ChxItbeF.js → Subagents-CMNsZLfk.js} +1 -1
- package/gui/dist/assets/{Usage-BkylzP50.js → Usage-ESFRfBMO.js} +1 -1
- package/gui/dist/assets/{codex-stale-banner-D4gvSWnO.js → codex-stale-banner-W4FhikN7.js} +1 -1
- package/gui/dist/assets/{data-surface-BtO3lwam.js → data-surface-B8PX8rjm.js} +1 -1
- package/gui/dist/assets/{data-surface-pCXChiBf.js → data-surface-CETFXqiA.js} +1 -1
- package/gui/dist/assets/{index-CNopOid3.js → index-DHQHBRhb.js} +3 -3
- package/gui/dist/assets/{model-display-CiUpg8T9.js → model-display-OBTJhQwT.js} +1 -1
- package/gui/dist/assets/{provider-payload-b2jlS-On.js → provider-payload-CJRJUn7w.js} +1 -1
- package/gui/dist/assets/{section-tabs-BP7gEPK6.js → section-tabs-B8sLMiz6.js} +1 -1
- package/gui/dist/assets/shared-DI18-uF7.js +69 -0
- package/gui/dist/index.html +2 -2
- package/package.json +3 -1
- package/src/adapters/base.ts +26 -0
- package/src/adapters/cursor/catalog.ts +541 -0
- package/src/adapters/cursor/cursor-errors.ts +15 -0
- package/src/adapters/cursor/discovery.ts +34 -41
- package/src/adapters/cursor/envelope-echo.ts +128 -0
- package/src/adapters/cursor/request-builder.ts +19 -12
- package/src/adapters/cursor/tool-definitions.ts +2 -1
- package/src/adapters/cursor/tool-result-normalize.ts +23 -31
- package/src/adapters/cursor.ts +21 -2
- package/src/adapters/exec-tool-result-normalize.ts +99 -0
- package/src/adapters/google-antigravity-replay.ts +71 -2
- package/src/adapters/google.ts +19 -4
- package/src/adapters/kiro-constants.ts +12 -0
- package/src/adapters/kiro.ts +128 -11
- package/src/adapters/openai-chat.ts +16 -2
- package/src/adapters/openai-responses.ts +15 -2
- package/src/adapters/tool-catalog-nudge.ts +2 -1
- package/src/adapters/xai-web-search.ts +10 -14
- package/src/claude/outbound.ts +14 -3
- package/src/cli/access.ts +46 -3
- package/src/cli/account-api.ts +93 -16
- package/src/cli/account-extended.ts +262 -36
- package/src/cli/account-main.ts +12 -12
- package/src/cli/account.ts +40 -10
- package/src/cli/agent.ts +8 -1
- package/src/cli/capabilities-command.ts +94 -0
- package/src/cli/capabilities.ts +535 -0
- package/src/cli/claude-desktop.ts +31 -11
- package/src/cli/dispatch.ts +195 -27
- package/src/cli/doctor.ts +100 -1
- package/src/cli/help.ts +11 -2
- package/src/cli/index.ts +19 -3
- package/src/cli/inspect.ts +230 -0
- package/src/cli/observe.ts +11 -3
- package/src/cli/registry.ts +34 -2
- package/src/cli/runtime-api.ts +51 -7
- package/src/cli/status.ts +16 -0
- package/src/cli/storage.ts +234 -0
- package/src/cli/system-command.ts +16 -0
- package/src/cli/usage-report.ts +52 -2
- package/src/cli/version-skew.ts +46 -0
- package/src/codex/account-label.ts +21 -0
- package/src/codex/catalog/provider-fetch.ts +4 -0
- package/src/codex/transition-state.ts +12 -3
- package/src/compatibility/openai-responses.ts +9 -1
- package/src/generated/compatibility-version.json +94 -58
- package/src/integrations/ownership-policy.ts +24 -5
- package/src/integrations/ownership.ts +36 -2
- package/src/integrations/state.ts +40 -7
- package/src/integrations/writer.ts +21 -3
- package/src/lib/admin-secrets.ts +24 -0
- package/src/lib/errors.ts +25 -1
- package/src/lib/service-secrets.ts +15 -0
- package/src/oauth/store.ts +16 -6
- package/src/providers/label.ts +34 -1
- package/src/responses/turn-termination.ts +107 -0
- package/src/server/management/logs-usage-routes.ts +5 -27
- package/src/server/management/route-registry.ts +317 -0
- package/src/server/proxy-liveness.ts +27 -4
- package/src/server/request-log.ts +37 -17
- package/src/server/responses/core.ts +80 -4
- package/src/server/responses/policy-fallback.ts +1 -1
- package/src/service.ts +34 -0
- package/src/storage/policy-job.ts +14 -4
- package/src/storage/policy.ts +79 -33
- package/src/usage/log.ts +32 -6
- package/src/usage/summary.ts +22 -34
- package/gui/dist/assets/shared-BdYGV-yJ.js +0 -69
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,h as t,m as n,n as r,s as i}from"./shared-BdYGV-yJ.js";import{C as a,F as o,L as s,P as c,St as l,_ as u,bt as d,dt as f,h as p,p as m,v as h,x as g,xt as _,yt as v}from"./index-CNopOid3.js";import{t as y}from"./data-surface-pCXChiBf.js";import{t as ee}from"./data-surface-BtO3lwam.js";import{t as b}from"./model-display-CiUpg8T9.js";var x=e(t(),1),S=l();function C(e,t,n){let r=Array(e);return new Proxy(r,{get(r,i,a){if(typeof i==`string`){let a=i.charCodeAt(0);if(a>=48&&a<=57){let a=+i;if(Number.isInteger(a)&&a>=0&&a<e){let e=r[a];if(!e){let i=t[a*2];e=r[a]={index:a,key:n(a),start:i,size:t[a*2+1],end:i+t[a*2+1],lane:0}}return e}}if(i===`length`)return e}return Reflect.get(r,i,a)}})}function w(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return o.length!==r.length||o.some((e,t)=>r[t]!==e)?(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i):i}return o.updateDeps=e=>{r=e},o}function T(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var E=(e,t)=>Math.abs(e-t)<1.01,D=(e,t,n)=>{let r;return Object.assign(function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)},{cancel:()=>{e.clearTimeout(r)}})},O,k=()=>{if(O!==void 0)return O;if(typeof navigator>`u`)return O=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return O=!0;let e=navigator.maxTouchPoints;return O=navigator.platform===`MacIntel`&&e!==void 0&&e>0},A=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},j=e=>e,M=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},N=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(A(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(A(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},P={passive:!0},F=typeof window>`u`||`onscrollend`in window,I=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&F,o=0,s=a?null:D(i,()=>t(o,!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,P),a&&r.addEventListener(`scrollend`,u,P),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u),s?.cancel()}},L=(e,t)=>I(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),R=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},z=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})},B=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.isIndexInRange(n)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:j,rangeExtractor:M,onChange:()=>{},measureElement:R,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=e>0?s[0]?.key??n.getItemKey(0):null,l=e>0?s[e-1]?.key??n.getItemKey(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==c||t.getItemKey(o-1)!==l)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>e&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==l)&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=!1,s=0;if(r&&this.scrollOffset!==null){let[e,t]=r,n=this.getMeasurements(),{count:i,getItemKey:a}=this.options,c=0;for(;c<i&&a(c)!==e;)c++;if(c<i){let e=n[c];if(e){let n=Math.max(0,e.start+t);n!==this.scrollOffset&&(s=n-this.scrollOffset,this.scrollOffset=n,o=!0)}}}(o||i)&&(this.pendingScrollAnchor=[o?r[0]:null,o?r[1]:0,i,s])},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=w(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.targetWindow=this.scrollElement&&`ownerDocument`in this.scrollElement?this.scrollElement.ownerDocument.defaultView:this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{if(t&&this._intendedScrollOffset===null&&e===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;let n=this.getScrollOffset();this.scrollDirection=t?n===e?this.scrollDirection:n<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,!(!k()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,P),e.addEventListener(`touchend`,n,P),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let t=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled){let[e,n,r,i]=t;e!==null&&!r&&(k()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?i!==0&&(this._iosDeferredAdjustment+=i):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),r&&this.scrollToEnd({behavior:r})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;if(this._iosDeferredAdjustment<0&&e>=t-1){this._iosDeferredAdjustment=0;return}let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=w(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,n,r,i,a,o,s)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s}),{key:!1}),this.isIndexInRange=e=>e>=0&&e<this.options.count,this.getMeasurements=w(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s},c)=>{let l=this.itemSizeCache;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=e*2,a=this._flatMeasurements;if(!a||a.length<i){let e=new Float64Array(i);a&&u>0&&e.set(a.subarray(0,u*2)),a=e,this._flatMeasurements=a}let o;if(u===0)o=t+n;else{let e=u-1;o=a[e*2]+a[e*2+1]+s}for(let t=u;t<e;t++){let e=r(t),n=l.get(e),i=typeof n==`number`?n:this.options.estimateSize(t);a[t*2]=o,a[t*2+1]=i,o+=i+s}let c=C(e,a,r);return this.measurementsCache=c,c}let d=this.measurementsCache.slice(0,u),f=Array(a).fill(void 0),p=new Float64Array(a),m=0;for(let e=0;e<u;e++){let t=d[e];t&&(f[t.lane]===void 0&&m++,f[t.lane]=e,p[t.lane]=t.end)}for(let i=u;i<e;i++){let e=r(i),c=this.laneAssignments.get(i),u,h,g=o===`estimate`||l.has(e);if(c!==void 0&&this.options.lanes>1){u=c;let e=f[u],r=e===void 0?void 0:d[e];h=r?r.end+s:t+n}else if(m===a){let e=0,t=p[0],n=f[0];for(let r=1;r<a;r++){let i=p[r];(i<t||i===t&&f[r]<n)&&(e=r,t=i,n=f[r])}u=e,h=t+s,g&&this.laneAssignments.set(i,u)}else u=i%this.options.lanes,h=t+n,g&&this.laneAssignments.set(i,u);let _=l.get(e),v=typeof _==`number`?_:this.options.estimateSize(i),y=h+v;d[i]={index:i,start:h,size:v,end:y,key:e,lane:u},f[u]===void 0&&m++,f[u]=i,p[u]=y}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=w(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>e.length===0||t===0?(this.range=null,null):(this.range=te(e,t,n,r,r===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=w(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e);if(!this.isIndexInRange(t))return;let n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(!this.isIndexInRange(e))return;let n,r,i,a=this._flatMeasurements;if(this.options.lanes===1&&a!==null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=this.itemSizeCache.get(i)??n,s=t-o;if(s!==0){let a=this.options.anchorTo===`end`&&this.scrollState?.behavior!==`smooth`&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,c=a?this.getTotalSize():0,l=this.getScrollOffset()+this.scrollAdjustments,u=this.itemSizeCache.has(i)?r+o<=l&&this.scrollDirection!==`backward`:r<l,d=this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?u:this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},s,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++;let f=!1;a?f=this.applyScrollAdjustment(this.getTotalSize()-c):d&&(f=this.applyScrollAdjustment(s)),this.notify(f)}},this.getVirtualItems=w(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._flatMeasurements,r=this.options.lanes===1&&n!=null;return T(t[V(0,t.length-1,r?e=>n[e*2]:e=>T(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`){if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t]}if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{this._iosDeferredAdjustment=0;let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{this._iosDeferredAdjustment=0,e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e=`auto`}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:`end`,behavior:e});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._flatMeasurements;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){return e===0?!1:k()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=e,!1):(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&E(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}},V=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function H(e,t,n){let r=0;for(;r<=t;){let i=(r+t)/2|0,a=e[i*2];if(a<n)r=i+1;else if(a>n)t=i-1;else return i}return r>0?r-1:0}function te(e,t,n,r,i){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&i!==null){let e=H(i,a,n),r=e,o=n+t;for(;r<a&&i[r*2]+i[r*2+1]<o;)r++;return{startIndex:e,endIndex:r}}let o=V(0,a,t=>e[t].start,n),s=o;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){let i=Array(r).fill(0);for(;s<a&&i.some(e=>e<n+t);){let t=e[s];i[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var U=typeof document<`u`?x.useLayoutEffect:x.useEffect;function W({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n=`transform`,...r}){let i=x.useReducer(e=>e+1,0)[1],a=x.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;let o=e=>{let t=a.current;if(!t.enabled||!t.container)return;let n=e.getTotalSize();if(n!==t.lastSize){t.lastSize=n;let r=e.options.horizontal?`width`:`height`;t.container.style[r]=`${n}px`}},s=e=>{let t=a.current;if(!t.enabled||!t.container)return;o(e);let n=!!e.options.horizontal,r=t.mode===`transform`,i=n?`left`:`top`,s=e.options.scrollMargin,c=e.getVirtualItems();for(let a of c){let o=a.start-s,c=e.elementsCache.get(a.key);c&&t.lastPositions.get(c)!==o&&(t.lastPositions.set(c,o),r?c.style.transform=n?`translate3d(${o}px, 0, 0)`:`translate3d(0, ${o}px, 0)`:c.style[i]=`${o}px`)}},c={...r,onChange:(t,n)=>{var o;let c=a.current,l=!0;if(c.enabled){s(t);let e=t.range,n=c.prevRange;l=!n||n.isScrolling!==t.isScrolling||n.startIndex!==e?.startIndex||n.endIndex!==e?.endIndex,l&&(c.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}l&&(e&&n?(0,S.flushSync)(i):i()),(o=r.onChange)==null||o.call(r,t,n)}},[l]=x.useState(()=>{let e=new B(c);return Object.assign(e,{containerRef:t=>{let n=a.current;if(n.container=t,n.lastSize=null,t&&n.enabled){let r=e.getTotalSize();n.lastSize=r;let i=e.options.horizontal?`width`:`height`;t.style[i]=`${r}px`}}})});return l.setOptions(c),U(()=>l._didMount(),[]),U(()=>(o(l),l._willUpdate())),U(()=>{s(l)}),l}function ne(e){return W({observeElementRect:N,observeElementOffset:L,scrollToFn:z,...e})}var G=32;function K(e){return[...new Uint8Array(e)].map(e=>e.toString(16).padStart(2,`0`)).join(``)}function q(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<=31||n===127)return!0}return!1}async function re(e){let t=e.trim();if(t&&!q(t)&&!(t.length>4096))return K(await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(t))).slice(0,G)}function J(e,t,n){if(!e)return!1;let r=t.trim();return r?e===r||n!==void 0&&e===n:!1}var Y={400:{en:{label:`Bad request`,description:`The proxy could not understand the request. Check the model, message shape, headers, and JSON body before retrying.`},fr:{label:`Requête incorrecte`,description:`Le proxy n’a pas pu comprendre la requête. Vérifiez le modèle, la structure des messages, les en-têtes et le corps JSON avant de réessayer.`},ko:{label:`잘못된 요청`,description:`프록시가 요청을 이해할 수 없습니다. 재시도 전에 모델, 메시지 형식, 헤더, JSON 본문을 확인해야 합니다.`},zh:{label:`错误请求`,description:`代理无法理解该请求。重试前请检查模型、消息结构、标头和 JSON 正文。`},"zh-TW":{label:`錯誤請求`,description:`代理無法理解該請求。重試前請檢查模型、訊息結構、標頭和 JSON 本文。`},de:{label:`Ungültige Anfrage`,description:`Der Proxy konnte die Anfrage nicht verstehen. Prüfe Modell, Nachrichtenformat, Header und JSON-Body vor einem erneuten Versuch.`},ru:{label:`Некорректный запрос`,description:`Прокси не смог интерпретировать запрос. Перед повторной попыткой проверьте модель, формат сообщений, заголовки и тело JSON.`},ja:{label:`不正なリクエスト`,description:`プロキシがリクエストを解釈できませんでした。再試行前にモデル、メッセージ形式、ヘッダー、JSON 本文を確認してください。`},tr:{label:`Hatalı istek`,description:`Proxy isteği anlayamadı. Yeniden denemeden önce modeli, mesaj yapısını, başlıkları ve JSON gövdesini kontrol edin.`}},401:{en:{label:`Unauthorized`,description:`Credentials are missing, expired, or invalid. Re-login or refresh the account/provider credentials used by opencodex.`},fr:{label:`Non autorisé`,description:`Les identifiants sont absents, expirés ou non valides. Reconnectez-vous ou actualisez les identifiants du compte ou du fournisseur utilisés par opencodex.`},ko:{label:`인증 필요`,description:`자격 증명이 없거나 만료되었거나 유효하지 않습니다. opencodex에서 사용하는 계정 또는 제공자 자격 증명을 다시 로그인하거나 갱신해야 합니다.`},zh:{label:`未授权`,description:`凭据缺失、已过期或无效。请重新登录,或刷新 opencodex 使用的账号/提供商凭据。`},"zh-TW":{label:`未授權`,description:`憑證缺失、已過期或無效。請重新登入,或重新整理 opencodex 使用的帳號/供應商憑證。`},de:{label:`Nicht autorisiert`,description:`Anmeldedaten fehlen, sind abgelaufen oder ungültig. Melde dich erneut an oder aktualisiere die von opencodex genutzten Konto-/Anbieter-Zugangsdaten.`},ru:{label:`Не авторизован`,description:`Учётные данные отсутствуют, истекли или недействительны. Войдите заново или обновите учётные данные аккаунта или провайдера, которые использует opencodex.`},ja:{label:`認証が必要`,description:`認証情報が不在・期限切れ・無効です。opencodex が使用するアカウントまたはプロバイダー認証情報を再ログインまたは更新してください。`},tr:{label:`Yetkisiz erişim`,description:`Kimlik bilgileri eksik, süresi dolmuş veya geçersiz. opencodex tarafından kullanılan hesap veya sağlayıcı kimlik bilgilerini yeniden doğrulayın.`}},402:{en:{label:`Payment required`,description:`The upstream provider rejected the request because billing, credits, or plan access is not available. Add credits, update billing, or switch provider.`},fr:{label:`Paiement requis`,description:`Le fournisseur en amont a rejeté la requête, car la facturation, les crédits ou l’accès à l’offre ne sont pas disponibles. Ajoutez des crédits, mettez à jour la facturation ou changez de fournisseur.`},ko:{label:`결제 필요`,description:`청구, 크레딧, 플랜 접근 권한 문제로 업스트림 제공자가 요청을 거부했습니다. 크레딧 추가, 결제 정보 갱신, 제공자 전환이 필요합니다.`},zh:{label:`需要付款`,description:`上游提供商因账单、额度或套餐权限不可用而拒绝了请求。请充值、更新账单信息或切换提供商。`},"zh-TW":{label:`需要付款`,description:`上游供應商因帳單、額度或方案許可權不可用而拒絕了請求。請儲值、更新帳單資訊或切換供應商。`},de:{label:`Zahlung erforderlich`,description:`Der Upstream-Anbieter hat die Anfrage abgelehnt, weil Abrechnung, Guthaben oder Planzugriff nicht verfügbar ist. Guthaben aufladen, Abrechnung aktualisieren oder Anbieter wechseln.`},ru:{label:`Требуется оплата`,description:`Вышестоящий провайдер отклонил запрос из-за проблем с оплатой, кредитами или доступом по тарифному плану. Пополните баланс, обновите платёжные данные или переключитесь на другого провайдера.`},ja:{label:`支払いが必要`,description:`課金、クレジット、プランアクセスが利用できないため上流プロバイダーがリクエストを拒否しました。クレジット追加、支払い情報更新、プロバイダー切替が必要です。`},tr:{label:`Ödeme gerekli`,description:`Yukarı akış sağlayıcısı faturalandırma, kredi veya plan erişimi bulunmadığından isteği reddetti. Kredi ekleyin, ödeme bilgilerini güncelleyin veya sağlayıcı değiştirin.`}},403:{en:{label:`Forbidden`,description:`The account is authenticated but not allowed to use this model or operation. Often a plan/subscription gate (e.g. Ollama Cloud Pro), org policy, or model permission — not necessarily a bad API key.`},fr:{label:`Accès interdit`,description:`Le compte est authentifié, mais n’est pas autorisé à utiliser ce modèle ou cette opération. Il s’agit souvent d’une restriction liée à l’offre ou à l’abonnement (p. ex. Ollama Cloud Pro), à la politique de l’organisation ou aux autorisations du modèle — pas nécessairement d’une clé API incorrecte.`},ko:{label:`권한 없음`,description:`계정 인증은 되었지만 이 모델 또는 작업을 사용할 권한이 없습니다. 플랜/구독 제한(예: Ollama Cloud Pro), 조직 정책, 모델 권한 문제인 경우가 많으며 API 키가 잘못된 것은 아닐 수 있습니다.`},zh:{label:`禁止访问`,description:`账号已认证,但无权使用此模型或操作。常见原因是套餐/订阅限制(例如 Ollama Cloud Pro)、组织策略或模型权限——不一定是 API 密钥无效。`},"zh-TW":{label:`禁止存取`,description:`帳號已認證,但無權使用此模型或操作。常見原因是方案/訂閱限制(例如 Ollama Cloud Pro)、組織策略或模型許可權——不一定是 API 金鑰無效。`},de:{label:`Verboten`,description:`Das Konto ist authentifiziert, darf dieses Modell oder diese Operation aber nicht nutzen. Oft Plan-/Abo-Sperre (z. B. Ollama Cloud Pro), Organisationsrichtlinie oder Modellrecht — nicht zwingend ein ungültiger API-Key.`},ru:{label:`Доступ запрещён`,description:`Аккаунт аутентифицирован, но не имеет права использовать эту модель или операцию. Часто причина — ограничение тарифа или подписки (например, Ollama Cloud Pro), политика организации или права доступа к модели, а не обязательно неверный API-ключ.`},ja:{label:`アクセス禁止`,description:`アカウントは認証済みですがこのモデルや操作の使用が許可されていません。多くはプラン/サブスクリプション制限(例: Ollama Cloud Pro)、組織ポリシー、モデル権限であり、API キーが不正とは限りません。`},tr:{label:`Erişim yasaklandı`,description:`Hesabın kimliği doğrulandı ancak bu modeli veya işlemi kullanma izni yok. Genellikle plan/abonelik sınırı (örn. Ollama Cloud Pro), organizasyon politikası veya model izni kaynaklıdır.`}},404:{en:{label:`Not found`,description:`The requested route, model, account, or upstream resource was not found. Verify the model name and opencodex provider configuration.`},fr:{label:`Introuvable`,description:`La route, le modèle, le compte ou la ressource en amont demandés sont introuvables. Vérifiez le nom du modèle et la configuration du fournisseur opencodex.`},ko:{label:`찾을 수 없음`,description:`요청한 경로, 모델, 계정 또는 업스트림 리소스를 찾을 수 없습니다. 모델 이름과 opencodex 제공자 설정을 확인해야 합니다.`},zh:{label:`未找到`,description:`找不到请求的路由、模型、账号或上游资源。请确认模型名称和 opencodex 提供商配置。`},"zh-TW":{label:`未找到`,description:`找不到請求的路由、模型、帳號或上游資源。請確認模型名稱和 opencodex 供應商配置。`},de:{label:`Nicht gefunden`,description:`Die angeforderte Route, das Modell, das Konto oder die Upstream-Ressource wurde nicht gefunden. Prüfe Modellname und opencodex-Anbieterkonfiguration.`},ru:{label:`Не найдено`,description:`Запрошенный маршрут, модель, аккаунт или вышестоящий ресурс не найден. Проверьте имя модели и конфигурацию провайдера в opencodex.`},ja:{label:`見つかりません`,description:`要求されたルート、モデル、アカウント、上流リソースが見つかりませんでした。モデル名と opencodex プロバイダー設定を確認してください。`},tr:{label:`Bulunamadı`,description:`İstenen rota, model, hesap veya yukarı akış kaynağı bulunamadı. Model adını ve opencodex sağlayıcı yapılandırmasını doğrulayın.`}},408:{en:{label:`Request timeout`,description:`The request took too long before the proxy or upstream provider could complete it. Retry with a smaller request or a different provider.`},fr:{label:`Délai d’attente de la requête dépassé`,description:`La requête a pris trop de temps pour que le proxy ou le fournisseur en amont puisse la traiter. Réessayez avec une requête plus petite ou un autre fournisseur.`},ko:{label:`요청 시간 초과`,description:`프록시 또는 업스트림 제공자가 요청을 완료하기 전에 시간이 초과되었습니다. 더 작은 요청으로 재시도하거나 다른 제공자로 전환해야 합니다.`},zh:{label:`请求超时`,description:`代理或上游提供商未能在限定时间内完成请求。请缩小请求后重试,或切换提供商。`},"zh-TW":{label:`請求逾時`,description:`代理或上游供應商未能在限定時間內完成請求。請縮小請求後重試,或切換供應商。`},de:{label:`Anfrage-Timeout`,description:`Die Anfrage dauerte zu lange, bevor Proxy oder Upstream-Anbieter sie abschließen konnten. Mit kleinerer Anfrage oder anderem Anbieter erneut versuchen.`},ru:{label:`Тайм-аут запроса`,description:`Обработка запроса заняла слишком много времени, и прокси или вышестоящий провайдер не успел её завершить. Повторите попытку с меньшим запросом или через другого провайдера.`},ja:{label:`リクエストタイムアウト`,description:`プロキシまたは上流プロバイダーがリクエストを完了する前に時間切れになりました。より小さいリクエストで再試行するか、別のプロバイダーに切り替えてください。`},tr:{label:`İstek zaman aşımı`,description:`Proxy veya yukarı akış sağlayıcısı isteği tamamlayamadan zaman aşımına uğradı. Daha küçük bir istek veya farklı bir sağlayıcı ile tekrar deneyin.`}},409:{en:{label:`Conflict`,description:`The request conflicts with the current account, session, or provider state. Refresh the session or retry after the active operation finishes.`},fr:{label:`Conflit`,description:`La requête entre en conflit avec l’état actuel du compte, de la session ou du fournisseur. Actualisez la session ou réessayez une fois l’opération en cours terminée.`},ko:{label:`상태 충돌`,description:`요청이 현재 계정, 세션 또는 제공자 상태와 충돌합니다. 세션을 갱신하거나 진행 중인 작업이 끝난 뒤 재시도해야 합니다.`},zh:{label:`状态冲突`,description:`请求与当前账号、会话或提供商状态冲突。请刷新会话,或等待当前操作完成后重试。`},"zh-TW":{label:`狀態衝突`,description:`請求與當前帳號、會話或供應商狀態衝突。請重新整理會話,或等待當前操作完成後重試。`},de:{label:`Konflikt`,description:`Die Anfrage kollidiert mit dem aktuellen Konto-, Sitzungs- oder Anbieterstatus. Sitzung aktualisieren oder nach Abschluss der laufenden Operation erneut versuchen.`},ru:{label:`Конфликт`,description:`Запрос конфликтует с текущим состоянием аккаунта, сессии или провайдера. Обновите сессию или повторите попытку после завершения текущей операции.`},ja:{label:`状態の衝突`,description:`リクエストが現在のアカウント、セッション、プロバイダー状態と衝突しています。セッションを更新するか、進行中の操作が終わった後に再試行してください。`},tr:{label:`Durum çakışması`,description:`İstek mevcut hesap, oturum veya sağlayıcı durumuyla çakışıyor. Oturumu yenileyin veya aktif işlem bittikten sonra tekrar deneyin.`}},413:{en:{label:`Request too large`,description:`The prompt, attachments, or generated payload exceeds a proxy or upstream limit. Reduce tokens, file size, or conversation history.`},fr:{label:`Requête trop volumineuse`,description:`L’invite, les pièces jointes ou la charge utile générée dépassent une limite du proxy ou du fournisseur en amont. Réduisez le nombre de jetons, la taille des fichiers ou l’historique de la conversation.`},ko:{label:`요청 과대`,description:`프롬프트, 첨부 파일 또는 생성 페이로드가 프록시나 업스트림 한도를 초과했습니다. 토큰, 파일 크기, 대화 기록을 줄여야 합니다.`},zh:{label:`请求过大`,description:`提示、附件或生成的负载超过了代理或上游限制。请减少 token、文件大小或对话历史。`},"zh-TW":{label:`請求過大`,description:`提示、附件或生成的負載超過了代理或上游限制。請減少 token、檔案大小或對話歷史。`},de:{label:`Anfrage zu groß`,description:`Prompt, Anhänge oder generierte Nutzlast überschreiten ein Proxy- oder Upstream-Limit. Tokens, Dateigröße oder Verlauf reduzieren.`},ru:{label:`Слишком большой запрос`,description:`Промпт, вложения или сформированная полезная нагрузка превышают лимит прокси или вышестоящего провайдера. Сократите количество токенов, размер файлов или историю диалога.`},ja:{label:`リクエストが大きすぎます`,description:`プロンプト、添付ファイル、生成ペイロードがプロキシまたは上流の制限を超えました。トークン、ファイルサイズ、会話履歴を減らしてください。`},tr:{label:`İstek çok büyük`,description:`İstemi, ekler veya oluşturulan veri proxy ya da yukarı akış sınırını aşıyor. Jeton sayısını, dosya boyutunu veya sohbet geçmişini azaltın.`}},422:{en:{label:`Invalid content`,description:`The provider accepted the request format but rejected its contents. Check model options, tool definitions, message roles, and unsupported fields.`},fr:{label:`Contenu non valide`,description:`Le fournisseur a accepté le format de la requête, mais en a rejeté le contenu. Vérifiez les options du modèle, les définitions des outils, les rôles des messages et les champs non pris en charge.`},ko:{label:`내용 검증 실패`,description:`제공자가 요청 형식은 받았지만 내용을 거부했습니다. 모델 옵션, 도구 정의, 메시지 역할, 지원되지 않는 필드를 확인해야 합니다.`},zh:{label:`内容无效`,description:`提供商接受了请求格式,但拒绝了其中的内容。请检查模型选项、工具定义、消息角色和不支持的字段。`},"zh-TW":{label:`內容無效`,description:`供應商接受了請求格式,但拒絕了其中的內容。請檢查模型選項、工具定義、訊息角色和不支援的欄位。`},de:{label:`Ungültiger Inhalt`,description:`Der Anbieter akzeptierte das Anfrageformat, lehnte den Inhalt aber ab. Prüfe Modelloptionen, Tool-Definitionen, Nachrichtenrollen und nicht unterstützte Felder.`},ru:{label:`Недопустимое содержимое`,description:`Провайдер принял формат запроса, но отклонил его содержимое. Проверьте параметры модели, определения инструментов, роли сообщений и неподдерживаемые поля.`},ja:{label:`内容の検証失敗`,description:`プロバイダーはリクエスト形式を受け付けましたが内容を拒否しました。モデルオプション、ツール定義、メッセージロール、未サポートのフィールドを確認してください。`},tr:{label:`Geçersiz içerik`,description:`Sağlayıcı istek formatını kabul etti ancak içeriğini reddetti. Model seçeneklerini, araç tanımlarını, mesaj rollerini ve desteklenmeyen alanları kontrol edin.`}},424:{en:{label:`Provider dependency failed`,description:`A required upstream dependency failed while opencodex was routing the request. Retry later or switch to another configured provider.`},fr:{label:`Échec d’une dépendance du fournisseur`,description:`Une dépendance en amont requise a échoué pendant le routage de la requête par opencodex. Réessayez plus tard ou sélectionnez un autre fournisseur configuré.`},ko:{label:`제공자 의존성 실패`,description:`opencodex가 요청을 라우팅하는 동안 필요한 업스트림 의존성이 실패했습니다. 나중에 재시도하거나 다른 설정된 제공자로 전환해야 합니다.`},zh:{label:`提供商依赖失败`,description:`opencodex 路由请求时,必需的上游依赖失败。请稍后重试,或切换到另一个已配置的提供商。`},"zh-TW":{label:`供應商依賴失敗`,description:`opencodex 路由請求時,必需的上游依賴失敗。請稍後重試,或切換到另一個已配置的供應商。`},de:{label:`Anbieter-Abhängigkeit fehlgeschlagen`,description:`Eine erforderliche Upstream-Abhängigkeit ist fehlgeschlagen, während opencodex die Anfrage geroutet hat. Später erneut versuchen oder zu einem anderen Anbieter wechseln.`},ru:{label:`Сбой зависимости провайдера`,description:`Необходимая вышестоящая зависимость дала сбой, пока opencodex маршрутизировал запрос. Повторите попытку позже или переключитесь на другого настроенного провайдера.`},ja:{label:`プロバイダー依存の失敗`,description:`opencodex がリクエストをルーティング中に必要な上流依存が失敗しました。後で再試行するか、別の設定済みプロバイダーに切り替えてください。`},tr:{label:`Sağlayıcı bağımlılığı başarısız`,description:`opencodex isteği yönlendirirken gerekli bir yukarı akış bağımlılığı başarısız oldu. Daha sonra tekrar deneyin veya başka bir sağlayıcıya geçin.`}},429:{en:{label:`Rate limited`,description:`The upstream provider rate or quota limit has been reached. Wait for the quota window to reset or switch account/provider.`},fr:{label:`Limite de débit atteinte`,description:`La limite de débit ou de quota du fournisseur en amont a été atteinte. Attendez la réinitialisation de la fenêtre de quota ou changez de compte ou de fournisseur.`},ko:{label:`한도 초과`,description:`업스트림 제공자의 속도 또는 할당량 한도에 도달했습니다. 한도 창이 초기화될 때까지 기다리거나 계정/제공자를 전환해야 합니다.`},zh:{label:`限流`,description:`已达到上游提供商的速率或额度限制。请等待额度窗口重置,或切换账号/提供商。`},"zh-TW":{label:`限流`,description:`已達到上游供應商的速率或額度限制。請等待額度視窗重設,或切換帳號/供應商。`},de:{label:`Ratenlimit erreicht`,description:`Das Raten- oder Kontingentlimit des Upstream-Anbieters ist erreicht. Auf Reset des Kontingentfensters warten oder Konto/Anbieter wechseln.`},ru:{label:`Превышен лимит запросов`,description:`Достигнут лимит скорости или квота вышестоящего провайдера. Дождитесь сброса окна квоты или переключитесь на другой аккаунт или провайдера.`},ja:{label:`レート制限`,description:`上流プロバイダーのレートまたはクォータ制限に達しました。クォータウィンドウがリセットされるまで待つか、アカウント/プロバイダーを切り替えてください。`},tr:{label:`Oran sınırı aşıldı`,description:`Yukarı akış sağlayıcısının hız veya kota sınırına ulaşıldı. Kota penceresinin sıfırlanmasını bekleyin ya da hesap/sağlayıcı değiştirin.`}},499:{en:{label:`Client closed request`,description:`The client disconnected or canceled the request before opencodex finished routing it. Retry if the cancellation was accidental.`},fr:{label:`Requête fermée par le client`,description:`Le client s’est déconnecté ou a annulé la requête avant la fin de son routage par opencodex. Réessayez si l’annulation était involontaire.`},ko:{label:`클라이언트 취소`,description:`opencodex가 라우팅을 끝내기 전에 클라이언트 연결이 끊기거나 요청이 취소되었습니다. 의도한 취소가 아니면 다시 시도해야 합니다.`},zh:{label:`客户端已取消`,description:`opencodex 完成路由前,客户端已断开连接或取消请求。如果不是有意取消,请重试。`},"zh-TW":{label:`客戶端已取消`,description:`opencodex 完成路由前,客戶端已斷開連線或取消請求。如果不是有意取消,請重試。`},de:{label:`Client hat Anfrage geschlossen`,description:`Der Client hat die Verbindung getrennt oder die Anfrage abgebrochen, bevor opencodex das Routing abgeschlossen hat. Bei versehentlichem Abbruch erneut versuchen.`},ru:{label:`Запрос закрыт клиентом`,description:`Клиент отключился или отменил запрос до того, как opencodex завершил его маршрутизацию. Если отмена была случайной, повторите попытку.`},ja:{label:`クライアントがリクエストをクローズ`,description:`opencodex がルーティングを終える前にクライアントが切断またはキャンセルしました。意図しないキャンセルなら再試行してください。`},tr:{label:`İstemci isteği kapattı`,description:`opencodex yönlendirmeyi bitirmeden önce istemci bağlantıyı kesti veya isteği iptal etti. İptal kazara yapıldıysa tekrar deneyin.`}},500:{en:{label:`Proxy error`,description:`opencodex hit an internal error while handling the request. Retry once, then check proxy logs if it repeats.`},fr:{label:`Erreur du proxy`,description:`opencodex a rencontré une erreur interne lors du traitement de la requête. Réessayez une fois, puis consultez les journaux du proxy si l’erreur se reproduit.`},ko:{label:`프록시 오류`,description:`opencodex가 요청을 처리하는 동안 내부 오류가 발생했습니다. 한 번 재시도하고 반복되면 프록시 로그를 확인해야 합니다.`},zh:{label:`代理错误`,description:`opencodex 处理请求时发生内部错误。请先重试一次;如果重复出现,请检查代理日志。`},"zh-TW":{label:`代理錯誤`,description:`opencodex 處理請求時發生內部錯誤。請先重試一次;如果重複出現,請檢查代理日誌。`},de:{label:`Proxy-Fehler`,description:`opencodex ist bei der Anfragebearbeitung auf einen internen Fehler gestoßen. Einmal erneut versuchen, bei Wiederholung Proxy-Logs prüfen.`},ru:{label:`Ошибка прокси`,description:`В opencodex произошла внутренняя ошибка при обработке запроса. Повторите попытку один раз; если ошибка повторяется, проверьте логи прокси.`},ja:{label:`プロキシエラー`,description:`opencodex がリクエスト処理中に内部エラーに遭遇しました。1 回再試行し、繰り返す場合はプロキシログを確認してください。`},tr:{label:`Proxy hatası`,description:`opencodex isteği işlerken dahili bir hatayla karşılaştı. Bir kez tekrar deneyin, tekrarlarsa proxy günlüklerini kontrol edin.`}},502:{en:{label:`Bad upstream response`,description:`The upstream provider returned an invalid or failed response through the proxy. Retry or route the request to another provider.`},fr:{label:`Réponse incorrecte du fournisseur en amont`,description:`Le fournisseur en amont a renvoyé une réponse non valide ou en échec par l’intermédiaire du proxy. Réessayez ou acheminez la requête vers un autre fournisseur.`},ko:{label:`업스트림 응답 오류`,description:`업스트림 제공자가 프록시를 통해 유효하지 않거나 실패한 응답을 반환했습니다. 재시도하거나 다른 제공자로 라우팅해야 합니다.`},zh:{label:`上游响应错误`,description:`上游提供商通过代理返回了无效或失败的响应。请重试,或将请求路由到其他提供商。`},"zh-TW":{label:`上游回應錯誤`,description:`上游供應商透過代理返回了無效或失敗的回應。請重試,或將請求路由到其他供應商。`},de:{label:`Ungültige Upstream-Antwort`,description:`Der Upstream-Anbieter lieferte über den Proxy eine ungültige oder fehlgeschlagene Antwort. Erneut versuchen oder zu einem anderen Anbieter routen.`},ru:{label:`Некорректный ответ провайдера`,description:`Вышестоящий провайдер вернул через прокси недействительный или ошибочный ответ. Повторите попытку или направьте запрос другому провайдеру.`},ja:{label:`上流レスポンス不良`,description:`上流プロバイダーがプロキシ経由で無効または失敗したレスポンスを返しました。再試行するか、リクエストを別のプロバイダーにルーティングしてください。`},tr:{label:`Kötü yukarı akış yanıtı`,description:`Yukarı akış sağlayıcısı proxy üzerinden geçersiz veya başarısız bir yanıt döndürdü. Tekrar deneyin veya isteği başka bir sağlayıcıya yönlendirin.`}},503:{en:{label:`Provider unavailable`,description:`The proxy or upstream provider is temporarily unavailable or overloaded. Wait briefly, then retry or switch provider.`},fr:{label:`Fournisseur indisponible`,description:`Le proxy ou le fournisseur en amont est temporairement indisponible ou surchargé. Patientez un instant, puis réessayez ou changez de fournisseur.`},ko:{label:`제공자 사용 불가`,description:`프록시 또는 업스트림 제공자가 일시적으로 사용할 수 없거나 과부하 상태입니다. 잠시 기다린 뒤 재시도하거나 제공자를 전환해야 합니다.`},zh:{label:`提供商不可用`,description:`代理或上游提供商暂时不可用或过载。请稍后重试,或切换提供商。`},"zh-TW":{label:`供應商不可用`,description:`代理或上游供應商暫時不可用或過載。請稍後重試,或切換供應商。`},de:{label:`Anbieter nicht verfügbar`,description:`Proxy oder Upstream-Anbieter ist vorübergehend nicht verfügbar oder überlastet. Kurz warten, dann erneut versuchen oder Anbieter wechseln.`},ru:{label:`Провайдер недоступен`,description:`Прокси или вышестоящий провайдер временно недоступен или перегружен. Немного подождите, затем повторите попытку или смените провайдера.`},ja:{label:`プロバイダー利用不可`,description:`プロキシまたは上流プロバイダーが一時的に利用不可または過負荷です。少し待ってから再試行するか、プロバイダーを切り替えてください。`},tr:{label:`Sağlayıcı kullanılamıyor`,description:`Proxy veya yukarı akış sağlayıcısı geçici olarak kullanılamıyor veya aşırı yüklü. Kısa bir süre bekleyip tekrar deneyin ya da sağlayıcı değiştirin.`}},504:{en:{label:`Upstream timeout`,description:`The upstream provider did not respond before the proxy timeout. Retry with a smaller request or choose a faster provider.`},fr:{label:`Délai d’attente du fournisseur en amont dépassé`,description:`Le fournisseur en amont n’a pas répondu avant l’expiration du délai du proxy. Réessayez avec une requête plus petite ou choisissez un fournisseur plus rapide.`},ko:{label:`업스트림 시간 초과`,description:`프록시 시간 제한 전에 업스트림 제공자가 응답하지 않았습니다. 더 작은 요청으로 재시도하거나 더 빠른 제공자를 선택해야 합니다.`},zh:{label:`上游超时`,description:`上游提供商未在代理超时前响应。请缩小请求后重试,或选择响应更快的提供商。`},"zh-TW":{label:`上游逾時`,description:`上游供應商未在代理逾時前回應。請縮小請求後重試,或選擇回應更快的供應商。`},de:{label:`Upstream-Timeout`,description:`Der Upstream-Anbieter antwortete nicht vor dem Proxy-Timeout. Mit kleinerer Anfrage erneut versuchen oder schnelleren Anbieter wählen.`},ru:{label:`Тайм-аут вышестоящего провайдера`,description:`Вышестоящий провайдер не ответил до истечения тайм-аута прокси. Повторите попытку с меньшим запросом или выберите более быстрого провайдера.`},ja:{label:`上流タイムアウト`,description:`上流プロバイダーがプロキシタイムアウト前に応答しませんでした。より小さいリクエストで再試行するか、より速いプロバイダーを選んでください。`},tr:{label:`Yukarı akış zaman aşımı`,description:`Yukarı akış sağlayıcısı proxy zaman aşımı süresinden önce yanıt vermedi. Daha küçük bir istekle tekrar deneyin veya daha hızlı bir sağlayıcı seçin.`}},529:{en:{label:`Provider overloaded`,description:`The upstream provider is overloaded or capacity-limited. Wait and retry, or switch to another account/provider.`},fr:{label:`Fournisseur surchargé`,description:`Le fournisseur en amont est surchargé ou sa capacité est limitée. Patientez et réessayez, ou changez de compte ou de fournisseur.`},ko:{label:`제공자 과부하`,description:`업스트림 제공자가 과부하 상태이거나 처리 용량이 제한되었습니다. 기다렸다가 재시도하거나 다른 계정/제공자로 전환해야 합니다.`},zh:{label:`提供商过载`,description:`上游提供商过载或容量受限。请等待后重试,或切换到其他账号/提供商。`},"zh-TW":{label:`供應商過載`,description:`上游供應商過載或容量受限。請等待後重試,或切換到其他帳號/供應商。`},de:{label:`Anbieter überlastet`,description:`Der Upstream-Anbieter ist überlastet oder kapazitätsbegrenzt. Warten und erneut versuchen oder anderes Konto/Anbieter nutzen.`},ru:{label:`Провайдер перегружен`,description:`Вышестоящий провайдер перегружен или ограничен по мощности. Подождите и повторите попытку либо переключитесь на другой аккаунт или провайдера.`},ja:{label:`プロバイダー過負荷`,description:`上流プロバイダーが過負荷または容量制限されています。待ってから再試行するか、別のアカウント/プロバイダーに切り替えてください。`},tr:{label:`Sağlayıcı aşırı yüklü`,description:`Yukarı akış sağlayıcısı aşırı yüklü veya kapasitesi sınırlı. Bekleyip tekrar deneyin veya başka bir hesap/sağlayıcıya geçin.`}}},ie={client:{en:{label:`Request error`,description:`The proxy or upstream provider rejected the request. Check the request shape, credentials, model name, and provider configuration.`},fr:{label:`Erreur de requête`,description:`Le proxy ou le fournisseur en amont a rejeté la requête. Vérifiez sa structure, les identifiants, le nom du modèle et la configuration du fournisseur.`},ko:{label:`요청 오류`,description:`프록시 또는 업스트림 제공자가 요청을 거부했습니다. 요청 형식, 자격 증명, 모델 이름, 제공자 설정을 확인해야 합니다.`},zh:{label:`请求错误`,description:`代理或上游提供商拒绝了该请求。请检查请求结构、凭据、模型名称和提供商配置。`},"zh-TW":{label:`請求錯誤`,description:`代理或上游供應商拒絕了該請求。請檢查請求結構、憑證、模型名稱和供應商配置。`},de:{label:`Anfragefehler`,description:`Der Proxy oder Upstream-Anbieter hat die Anfrage abgelehnt. Prüfe Anfrageformat, Anmeldedaten, Modellname und Anbieterkonfiguration.`},ru:{label:`Ошибка запроса`,description:`Прокси или вышестоящий провайдер отклонил запрос. Проверьте структуру запроса, учётные данные, имя модели и конфигурацию провайдера.`},ja:{label:`リクエストエラー`,description:`プロキシまたは上流プロバイダーがリクエストを拒否しました。リクエスト形式、認証情報、モデル名、プロバイダー設定を確認してください。`},tr:{label:`İstek hatası`,description:`Proxy veya yukarı akış sağlayıcısı isteği reddetti. İstek yapısını, kimlik bilgilerini, model adını ve sağlayıcı yapılandırmasını kontrol edin.`}},server:{en:{label:`Server or upstream error`,description:`opencodex or an upstream provider failed while processing the request. Retry later or route the request to another provider.`},fr:{label:`Erreur du serveur ou du fournisseur en amont`,description:`opencodex ou un fournisseur en amont a échoué lors du traitement de la requête. Réessayez plus tard ou acheminez la requête vers un autre fournisseur.`},ko:{label:`서버 또는 업스트림 오류`,description:`opencodex 또는 업스트림 제공자가 요청 처리 중 실패했습니다. 나중에 재시도하거나 다른 제공자로 라우팅해야 합니다.`},zh:{label:`服务器或上游错误`,description:`opencodex 或上游提供商处理请求时失败。请稍后重试,或将请求路由到其他提供商。`},"zh-TW":{label:`伺服器或上游錯誤`,description:`opencodex 或上游供應商處理請求時失敗。請稍後重試,或將請求路由到其他供應商。`},de:{label:`Server- oder Upstream-Fehler`,description:`opencodex oder ein Upstream-Anbieter ist bei der Anfragebearbeitung fehlgeschlagen. Später erneut versuchen oder zu einem anderen Anbieter routen.`},ru:{label:`Ошибка сервера или провайдера`,description:`opencodex или вышестоящий провайдер завершил обработку запроса с ошибкой. Повторите попытку позже или направьте запрос другому провайдеру.`},ja:{label:`サーバーまたは上流エラー`,description:`opencodex または上流プロバイダーがリクエスト処理中に失敗しました。後で再試行するか、リクエストを別のプロバイダーにルーティングしてください。`},tr:{label:`Sunucu veya yukarı akış hatası`,description:`opencodex veya bir yukarı akış sağlayıcısı isteği işlerken başarısız oldu. Daha sonra tekrar deneyin veya isteği başka bir sağlayıcıya yönlendirin.`}}};function ae(e){return e.toLowerCase().startsWith(`fr`)?`fr`:e===`de`||e===`ko`||e===`zh`||e===`zh-TW`||e===`ru`||e===`ja`||e===`tr`?e:`en`}function oe(e,t){if(e<400)return null;let n=ae(t);return(Y[Math.trunc(e)]??(e<500?ie.client:ie.server))[n]}var se=[`provider`,`usage`,`injection`];function ce(e){return e>0?`[${new Date(e).toLocaleTimeString()}] `:``}function le(e){return new Date(e).toLocaleTimeString()}function ue(e,t){return t===`provider`?!!e?.enabled:t===`usage`?!!e?.usage:!!e?.injection}function de(e,t){return t===`debug`?e.enabled:t===`usage`?e.usage:t===`injection`?e.injection:e.claude}var X=n();function fe({entries:e}){let{t}=i();return(0,X.jsxs)(`div`,{className:`card`,style:{marginBottom:16,padding:`12px 14px`},children:[(0,X.jsx)(`div`,{className:`font-semibold`,style:{marginBottom:4},children:t(`debug.claudeInbound.title`)}),(0,X.jsx)(`div`,{className:`muted text-control`,style:{marginBottom:10},children:t(`debug.claudeInbound.sub`)}),e.length===0?(0,X.jsx)(`div`,{className:`muted text-control`,children:t(`debug.claudeInbound.empty`)}):(0,X.jsx)(`div`,{style:{overflowX:`auto`},children:(0,X.jsxs)(`table`,{className:`table text-label`,children:[(0,X.jsx)(`thead`,{children:(0,X.jsxs)(`tr`,{children:[(0,X.jsx)(`th`,{children:t(`debug.claudeInbound.time`)}),(0,X.jsx)(`th`,{children:t(`debug.claudeInbound.endpoint`)}),(0,X.jsx)(`th`,{children:t(`debug.claudeInbound.model`)}),(0,X.jsx)(`th`,{children:`thinking`}),(0,X.jsx)(`th`,{children:`effort`}),(0,X.jsx)(`th`,{children:`beta`}),(0,X.jsx)(`th`,{children:`metadata`}),(0,X.jsx)(`th`,{children:`system`})]})}),(0,X.jsx)(`tbody`,{children:e.map(e=>(0,X.jsxs)(`tr`,{children:[(0,X.jsx)(`td`,{className:`muted mono`,children:le(e.at)}),(0,X.jsx)(`td`,{className:`mono`,children:e.endpoint}),(0,X.jsxs)(`td`,{className:`mono`,title:e.resolvedModel,children:[e.model,e.resolvedModel&&e.resolvedModel!==e.model&&(0,X.jsxs)(`span`,{className:`muted`,children:[` → `,e.resolvedModel]})]}),(0,X.jsxs)(`td`,{className:`mono`,children:[e.thinkingType??`-`,e.thinkingBudgetTokens!==void 0&&(0,X.jsxs)(`span`,{className:`muted`,children:[` (`,e.thinkingBudgetTokens,`)`]})]}),(0,X.jsx)(`td`,{className:`mono`,children:e.outputConfigEffort??`-`}),(0,X.jsx)(`td`,{className:`mono`,title:e.anthropicBeta,style:{maxWidth:160,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.anthropicBeta??`-`}),(0,X.jsx)(`td`,{className:`mono`,title:e.metadataKeys?.join(`, `),children:e.hasMetadataUserId?`user_id ${e.userIdTag??``}`:t(`debug.claudeInbound.none`)}),(0,X.jsx)(`td`,{className:`mono`,children:e.hasSystem?e.systemTag??`yes`:t(`debug.claudeInbound.none`)})]},e.id))})]})})]})}function pe({debug:e,stream:t,streamEnabled:n,entries:r,scrollContainerRef:a,lineVirtualizer:o}){let{t:s}=i();return e?n?r.length===0?(0,X.jsxs)(`div`,{className:`empty`,children:[(0,X.jsx)(`div`,{className:`font-semibold`,style:{marginBottom:6},children:s(`debug.noLinesTitle`)}),(0,X.jsx)(`div`,{className:`muted text-control`,style:{maxWidth:560,marginInline:`auto`},children:s(`debug.noLines.${t}`)})]}):(0,X.jsx)(`div`,{ref:a,className:`log-detail-json`,style:{maxHeight:`calc(100vh - 280px)`,overflow:`auto`},children:(0,X.jsx)(`div`,{style:{position:`relative`,height:o.getTotalSize(),width:`100%`},children:o.getVirtualItems().map(e=>(0,X.jsx)(`div`,{ref:o.measureElement,"data-index":e.index,style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${e.start}px)`},children:`${ce(r[e.index].at)}${r[e.index].line}`},e.key))})}):(0,X.jsxs)(`div`,{className:`empty`,children:[(0,X.jsx)(`div`,{className:`font-semibold`,style:{marginBottom:6},children:s(`debug.emptyTitle`)}),(0,X.jsx)(`div`,{className:`muted text-control`,style:{maxWidth:560,marginInline:`auto`},children:s(`debug.empty`)})]}):null}function me({debug:e,debugBusy:t,stream:n,onSetFlag:r,onReset:a,onStreamChange:o}){let{t:c}=i();return(0,X.jsxs)(`div`,{className:`card`,style:{marginBottom:16,padding:`12px 14px`},children:[(0,X.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,flexWrap:`wrap`},children:[(0,X.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:16},children:[`debug`,`usage`,`injection`,`claude`].map(n=>{let i=de(e,n);return(0,X.jsxs)(`div`,{style:{display:`inline-flex`,alignItems:`center`,gap:10,minWidth:220},children:[(0,X.jsx)(s,{on:i,disabled:t,label:c(`debug.${n}`),onClick:()=>r(n,!i)}),(0,X.jsx)(`span`,{className:`text-control`,children:c(`debug.${n}`)})]},n)})}),(0,X.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,disabled:t,onClick:a,children:c(`debug.reset`)})]}),(e.enabled||e.usage||e.injection)&&(0,X.jsxs)(`div`,{style:{display:`inline-flex`,gap:6,marginTop:12},children:[e.enabled&&(0,X.jsx)(`button`,{type:`button`,className:`btn btn-sm${n===`provider`?` btn-primary`:` btn-ghost`}`,onClick:()=>o(`provider`),children:c(`debug.streamProvider`)}),e.usage&&(0,X.jsx)(`button`,{type:`button`,className:`btn btn-sm${n===`usage`?` btn-primary`:` btn-ghost`}`,onClick:()=>o(`usage`),children:c(`debug.streamUsage`)}),e.injection&&(0,X.jsx)(`button`,{type:`button`,className:`btn btn-sm${n===`injection`?` btn-primary`:` btn-ghost`}`,onClick:()=>o(`injection`),children:c(`debug.streamInjection`)})]})]})}function he({embedded:e,refreshing:t,streamEnabled:n,follow:r,onRefresh:a,onFollowChange:o}){let{t:s}=i();return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:e?`row`:`page-head`,style:e?{justifyContent:`flex-end`,marginBottom:4}:void 0,children:[!e&&(0,X.jsx)(`h2`,{children:s(`debug.title`)}),(0,X.jsxs)(`div`,{style:{display:`inline-flex`,alignItems:`center`,gap:12},children:[(0,X.jsxs)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,disabled:t||!n,onClick:a,children:[(0,X.jsx)(f,{}),` `,s(`debug.refresh`)]}),(0,X.jsxs)(`label`,{className:`muted text-control`,style:{cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6},children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:r,onChange:e=>o(e.target.checked)}),s(`debug.follow`)]})]})]}),(0,X.jsx)(`p`,{className:`page-sub`,children:s(`debug.subtitle`)})]})}function ge(e){return`debug-settings:${e}`}function _e({apiBase:e,embedded:t,active:n=!0}){let{t:r}=i(),a=`ocx.debug.settings.v1:${e}`,s=m(a),c=ge(e),[l,f]=(0,x.useState)(!1),[g,v]=(0,x.useState)(`provider`),[b,S]=(0,x.useState)([]),[C,w]=(0,x.useState)(!0),[T,E]=(0,x.useState)(!1),D=(0,x.useRef)(0),O=(0,x.useRef)(0),k=(0,x.useRef)(0),A=(0,x.useRef)(null),j=(0,x.useRef)(null),M=(0,x.useRef)(null),N=y(c,[e],async t=>{let n=await fetch(`${e}/api/debug`,{signal:t});if(!n.ok)throw Error(String(n.status));let r=await n.json();return p(a,r),r},{pollMs:2e3,enabled:n,isEmpty:()=>!1,initialData:s??void 0}),P=N.state,F=N.data??s??null,I=_(`debug-claude-inbound:${e}`,[e,F?.claude],async t=>{let n=await fetch(`${e}/api/claude/inbound-debug`,{signal:t});if(!n.ok)return[];let r=await n.json();return Array.isArray(r.entries)?r.entries:[]},{pollMs:2e3,enabled:n&&!!F?.claude}).data??[],L=ne({count:b.length,getScrollElement:()=>j.current,estimateSize:()=>20,overscan:30,getItemKey:e=>b[e].seq}),R=(0,x.useCallback)(e=>ue(F,e),[F]);(0,x.useEffect)(()=>{if(!F||R(g))return;let e=se.find(R);if(!e)return;let t=window.setTimeout(()=>v(e),0);return()=>window.clearTimeout(t)},[F,g,R]);let z=R(g),B=g===`provider`?`${e}/api/debug/logs`:g===`usage`?`${e}/api/debug/usage-logs`:`${e}/api/debug/injection-logs`,V=(0,x.useCallback)(async(e,t)=>{let n=++k.current;if(!z){n===k.current&&(S([]),D.current=0);return}E(!0);try{let r=new URLSearchParams({limit:`500`});!e&&D.current>0&&r.set(`after`,String(D.current));let i=await fetch(`${B}?${r}`,{signal:t});if(!i.ok||t?.aborted||n!==k.current)return;let a=await i.json();if(t?.aborted||n!==k.current||a.length===0)return;S(t=>(e?a:[...t,...a]).slice(-2e3)),D.current=a[a.length-1].seq}catch{}finally{n===k.current&&E(!1)}},[B,z]);(0,x.useEffect)(()=>{if(!n)return;let t=`${e}:${g}:${z}`,r=M.current!==t;if(M.current=t,!r&&b.length>0)return;D.current=0;let i=new AbortController,a=window.setTimeout(()=>{r&&S([]),V(!0,i.signal)},0);return()=>{window.clearTimeout(a),k.current+=1,i.abort()}},[n,e,g,z]);let H=(0,x.useRef)(!1),te=(0,x.useEffectEvent)(()=>{if(H.current)return;H.current=!0;let e=h(1e4);V(!1,e.signal).finally(()=>{e.clear(),H.current=!1})});(0,x.useEffect)(()=>{if(!(!n||!C||!z))return u(()=>te(),1e3)},[n,C,z]),(0,x.useEffect)(()=>{C&&b.length>0&&L.scrollToIndex(b.length-1,{align:`end`})},[b,C,L]);let U=async t=>{let n=++O.current;f(!0);let r=async()=>{try{let r=await fetch(`${e}/api/debug`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify(t)});if(!r.ok)return;let i=await r.json();if(n!==O.current)return;p(a,i),d(c,i)}catch{}},i=(A.current??Promise.resolve()).then(r,r);A.current=i.then(()=>void 0,()=>void 0);try{await i}finally{n===O.current&&f(!1)}},W=async(e,t)=>{await U({[e]:t})},G=async()=>{await U({reset:!0})};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(he,{embedded:t,refreshing:T,streamEnabled:z,follow:C,onRefresh:()=>void V(!0),onFollowChange:w}),!F&&P.showError?(0,X.jsxs)(`div`,{className:`notice notice-err`,role:`alert`,children:[(0,X.jsx)(`span`,{children:r(`debug.loadFailed`)}),(0,X.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>N.refresh(),children:r(`common.retry`)})]}):P.showSkeleton&&!F?(0,X.jsx)(ee,{label:r(`debug.loading`),rows:3}):F?(0,X.jsx)(me,{debug:F,debugBusy:l,stream:g,onSetFlag:(e,t)=>{W(e,t)},onReset:()=>{G()},onStreamChange:v}):null,F&&P.showError&&(0,X.jsx)(o,{tone:`err`,children:r(`debug.loadFailed`)}),F?.claude&&(0,X.jsx)(fe,{entries:I}),(0,X.jsx)(pe,{debug:!!F,stream:g,streamEnabled:z,entries:b,scrollContainerRef:j,lineVirtualizer:L})]})}function ve({filters:e,options:t,hasActiveFilters:n,filteredCount:r,totalCount:i,t:o,onFilterChange:s,onResetFilters:c}){let l=e.maxTokPerSec===15?`slow`:e.minTokPerSec===15&&e.maxTokPerSec===50?`medium`:e.minTokPerSec===50?`fast`:`all`,u=t=>{s(t===`slow`?{...e,minTokPerSec:void 0,maxTokPerSec:15}:t===`medium`?{...e,minTokPerSec:15,maxTokPerSec:50}:t===`fast`?{...e,minTokPerSec:50,maxTokPerSec:void 0}:{...e,minTokPerSec:void 0,maxTokPerSec:void 0})};return(0,X.jsxs)(`div`,{className:`logs-filter-container`,children:[(0,X.jsxs)(`div`,{className:`logs-toolbar`,children:[(0,X.jsx)(`span`,{className:`muted text-control`,children:o(`logs.filter.surface.label`)}),(0,X.jsx)(`div`,{className:`segmented logs-segmented`,role:`radiogroup`,"aria-label":o(`logs.filter.surface.label`),children:[`all`,`claude`,`codex`,`grok`].map(t=>(0,X.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":e.surface===t,className:`btn btn-sm${e.surface===t?` btn-primary`:` btn-ghost`}`,style:{background:e.surface===t?void 0:`transparent`,color:e.surface===t?void 0:`var(--muted)`},onClick:()=>s({...e,surface:t}),children:o(`logs.filter.surface.${t}`)},t))}),(0,X.jsxs)(`label`,{className:`muted text-control logs-filter-field`,children:[o(`logs.filter.provider.label`),(0,X.jsxs)(`select`,{className:`input select-sm`,value:e.provider,"aria-label":o(`logs.filter.provider.label`),onChange:t=>s({...e,provider:t.target.value}),children:[(0,X.jsx)(`option`,{value:``,children:o(`logs.filter.provider.all`)}),t.providers.map(e=>(0,X.jsx)(`option`,{value:e,children:a(e,o)},e))]})]}),(0,X.jsxs)(`label`,{className:`muted text-control logs-filter-field`,children:[o(`logs.filter.agent.label`),(0,X.jsxs)(`select`,{className:`input select-sm`,value:e.agentKind,"aria-label":o(`logs.filter.agent.label`),onChange:t=>s({...e,agentKind:t.target.value}),children:[(0,X.jsx)(`option`,{value:`all`,children:o(`logs.filter.agent.all`)}),(0,X.jsx)(`option`,{value:`main`,children:o(`logs.filter.agent.main`)}),(0,X.jsx)(`option`,{value:`subagent`,children:o(`logs.filter.agent.subagent`)}),(0,X.jsx)(`option`,{value:`internal`,children:o(`logs.filter.agent.internal`)}),(0,X.jsx)(`option`,{value:`unknown`,children:o(`logs.filter.agent.unknown`)})]})]}),(0,X.jsxs)(`label`,{className:`muted text-control logs-filter-field`,children:[o(`logs.filter.model.label`),(0,X.jsxs)(`select`,{className:`input select-sm`,value:e.model,"aria-label":o(`logs.filter.model.label`),onChange:t=>s({...e,model:t.target.value}),children:[(0,X.jsx)(`option`,{value:``,children:o(`logs.filter.model.all`)}),t.models.map(e=>(0,X.jsx)(`option`,{value:e,children:e},e))]})]}),(0,X.jsxs)(`label`,{className:`muted text-control logs-filter-field`,children:[o(`logs.filter.time.label`),(0,X.jsxs)(`select`,{className:`input select-sm`,value:e.timeWindow,"aria-label":o(`logs.filter.time.label`),onChange:t=>s({...e,timeWindow:t.target.value}),children:[(0,X.jsx)(`option`,{value:`all`,children:o(`logs.filter.time.all`)}),(0,X.jsx)(`option`,{value:`15m`,children:o(`logs.filter.time.15m`)}),(0,X.jsx)(`option`,{value:`1h`,children:o(`logs.filter.time.1h`)}),(0,X.jsx)(`option`,{value:`24h`,children:o(`logs.filter.time.24h`)})]})]}),(0,X.jsxs)(`label`,{className:`muted text-control logs-filter-field`,children:[o(`logs.filter.speed.label`),(0,X.jsxs)(`select`,{className:`input select-sm`,value:l,"aria-label":o(`logs.filter.speed.label`),onChange:e=>u(e.target.value),children:[(0,X.jsx)(`option`,{value:`all`,children:o(`logs.filter.speed.all`)}),(0,X.jsx)(`option`,{value:`slow`,children:o(`logs.filter.speed.slow`)}),(0,X.jsx)(`option`,{value:`medium`,children:o(`logs.filter.speed.medium`)}),(0,X.jsx)(`option`,{value:`fast`,children:o(`logs.filter.speed.fast`)})]})]}),(0,X.jsxs)(`label`,{className:`muted text-control logs-filter-field`,children:[o(`logs.filter.status.label`),(0,X.jsxs)(`select`,{className:`input select-sm`,value:e.statusFilter,"aria-label":o(`logs.filter.status.label`),onChange:t=>s({...e,statusFilter:t.target.value}),children:[(0,X.jsx)(`option`,{value:`all`,children:o(`logs.filter.status.all`)}),(0,X.jsx)(`option`,{value:`success`,children:o(`logs.filter.status.success`)}),(0,X.jsx)(`option`,{value:`errors`,children:o(`logs.filter.status.errors`)})]})]})]}),(0,X.jsxs)(`div`,{className:`logs-toolbar logs-toolbar-secondary`,children:[(0,X.jsxs)(`label`,{className:`muted text-control logs-filter-field`,children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:e.interceptedHelpersOnly,onChange:t=>s({...e,interceptedHelpersOnly:t.target.checked})}),o(`logs.filter.interceptedHelpersOnly`)]}),(0,X.jsxs)(`label`,{className:`muted text-control logs-filter-field`,children:[o(`logs.filter.conversation.label`),(0,X.jsx)(`input`,{type:`search`,className:`input mono select-sm`,value:e.conversationId,onChange:t=>s({...e,conversationId:t.target.value}),placeholder:o(`logs.filter.conversation.placeholder`),"aria-label":o(`logs.filter.conversation.label`)})]}),n&&(0,X.jsxs)(`div`,{className:`logs-filter-status`,children:[(0,X.jsx)(`span`,{className:`muted text-control`,children:o(`logs.filter.showingCount`,{count:r,total:i})}),(0,X.jsxs)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:c,children:[(0,X.jsx)(v,{}),` `,o(`logs.filter.reset`)]})]})]})]})}function ye(e,t){return t===`all`?!0:t===`claude`?e.surface===`claude`||e.surface===`claude-desktop`:t===`grok`?e.surface===`grok`:e.surface===void 0}function be(e){return e===`main`||e===`subagent`||e===`internal`?e:`unknown`}var xe={surface:`all`,model:``,provider:``,agentKind:`all`,statusFilter:`all`,timeWindow:`all`,interceptedHelpersOnly:!1,conversationId:``};function Se(e){return e.surface!==`all`||e.model!==``||e.provider!==``||e.agentKind!==`all`||e.statusFilter!==`all`||e.timeWindow!==`all`||e.minTokPerSec!==void 0||e.maxTokPerSec!==void 0||e.interceptedHelpersOnly||e.conversationId.trim()!==``}function Ce(e,t,n=Date.now()){let r=t.model.trim().toLowerCase(),i=t.provider.trim().toLowerCase(),a=t.conversationId.trim(),o=0;return t.timeWindow===`15m`?o=n-9e5:t.timeWindow===`1h`?o=n-36e5:t.timeWindow===`24h`&&(o=n-864e5),e.filter(e=>{if(!ye(e,t.surface)||t.agentKind!==`all`&&be(e.agentKind)!==t.agentKind||t.interceptedHelpersOnly&&!e.shadowCallRewrittenFrom&&e.shadowCallSource!==`agent-helper`||a&&!J(e.conversationId,a,t.conversationQueryHash)||t.statusFilter===`success`&&(typeof e.status!=`number`||e.status<200||e.status>=300)||t.statusFilter===`errors`&&(typeof e.status!=`number`||e.status<400)||r&&!(e.model?.toLowerCase()===r||e.resolvedModel?.toLowerCase()===r||e.attempts?.some(e=>e.model?.toLowerCase()===r))||i&&!(e.provider?.toLowerCase()===i||e.attempts?.some(e=>e.provider?.toLowerCase()===i))||o>0&&typeof e.timestamp==`number`&&e.timestamp<o)return!1;let n=e.displayMetrics?.tokPerSecond?.kind===`value`?e.displayMetrics.tokPerSecond.value:void 0;return!(t.minTokPerSec!==void 0&&(n===void 0||n<t.minTokPerSec)||t.maxTokPerSec!==void 0&&(n===void 0||n>t.maxTokPerSec))})}function we(e){let t=new Set,n=new Set;for(let r of e)if(r.model&&t.add(r.model),r.resolvedModel&&t.add(r.resolvedModel),r.provider&&n.add(r.provider),r.attempts)for(let e of r.attempts)e.model&&t.add(e.model),e.provider&&n.add(e.provider);return{models:Array.from(t).sort(),providers:Array.from(n).sort()}}function Z(){return window.location.hash.replace(/^#\/?/,``)===`logs/debug`?`debug`:`logs`}function Te(e){window.location.hash=e===`debug`?`logs/debug`:`logs`}function Ee(e){e.key===`ArrowLeft`||e.key===`Home`?(e.preventDefault(),Te(`logs`),document.getElementById(`logs-tab-logs`)?.focus()):(e.key===`ArrowRight`||e.key===`End`)&&(e.preventDefault(),Te(`debug`),document.getElementById(`logs-tab-debug`)?.focus())}function De(e,t){return[`${t(`logs.modelTooltip.model`)}=${e.model}`,e.resolvedModel?`${t(`logs.modelTooltip.resolvedModel`)}=${e.resolvedModel}`:void 0,e.requestedServiceTier?`${t(`logs.modelTooltip.requestedTier`)}=${e.requestedServiceTier}`:void 0,e.configuredServiceTier?`${t(`logs.modelTooltip.configuredTier`)}=${e.configuredServiceTier}`:void 0,e.responseServiceTier?`${t(`logs.modelTooltip.responseTier`)}=${e.responseServiceTier}`:void 0,e.modelSupportsServiceTier===void 0?void 0:`${t(`logs.modelTooltip.supportsTier`)}=${e.modelSupportsServiceTier}`].filter(Boolean).join(` · `)}function Oe(e){return e.requestedSpeedLabel||void 0}function Q(e,t,n,r=!1){if(!Number.isFinite(e)||e<0)return t(`logs.cost.unavailable`);let i=new Intl.NumberFormat(n,{style:`currency`,currency:`USD`,minimumFractionDigits:4,maximumFractionDigits:4}).format(e);return t(r?`logs.cost.lowerBound`:`logs.cost.approximate`,{amount:i})}function ke(e,t,n){return!e||e.kind===`unavailable`?t(`logs.cost.unavailable`):Q(e.estimate.cost.total,t,n,e.estimate.priorityLowerBound)}function Ae(e){let t=0,n=!0,r=0,i=0,a=0;for(let o of e){if(o.usageStatus===`unsupported`){a+=1;continue}let e=o.displayMetrics?.cost;if(e?.kind===`value`){let i=e.estimate.cost.total;if(Number.isFinite(i)&&i>=0){t+=i,r+=1,n&&=e.estimate.priorityLowerBound===!0;continue}}i+=1}return{estimatedCostUsd:t,priorityLowerBound:r>0&&n,unpricedRequests:i,unmeteredRequests:a}}function je(e){return e===`cursor`||e.startsWith(`cursor-`)}function Me(e){let t=e.usage;if(!t)return{};let n=typeof t.cacheCreationInputTokens==`number`?t.cacheCreationInputTokens:void 0;return{read:typeof t.cacheReadInputTokens==`number`?t.cacheReadInputTokens:typeof t.cachedInputTokens==`number`&&n!==void 0?Math.max(0,t.cachedInputTokens-n):t.cachedInputTokens,write:n}}function Ne(e,t){if(!e.usage)return;let n=Me(e),r=[`${t(`logs.tokens.input`)}=${e.usage.inputTokens}`,`${t(`logs.tokens.output`)}=${e.usage.outputTokens}`];return n.read!==void 0&&r.push(`${t(`logs.tokens.cacheRead`)}=${n.read}`),n.write!==void 0&&r.push(`${t(`logs.tokens.cacheWrite`)}=${n.write}`),typeof e.usage.contextTotalTokens==`number`&&r.push(`${t(`logs.tokens.contextTotal`)}=${e.usage.contextTotalTokens}`),typeof e.usage.reasoningOutputTokens==`number`&&r.push(`${t(`logs.tokens.reasoning`)}=${e.usage.reasoningOutputTokens}`),e.usageStatus===`estimated`&&r.push(t(`logs.tokens.estimatedNote`)),e.usageStatus===`estimated`&&n.read===void 0&&n.write===void 0&&r.push(t(je(e.provider)?`logs.tokens.noCacheCursorNote`:`logs.tokens.noCacheNote`)),r.join(` · `)}function $(e){return e===void 0||typeof e==`string`}function Pe(e){if(e===void 0)return!0;if(!e||typeof e!=`object`||!$(e.routeKind)||e.profile!==void 0&&(!e.profile||typeof e.profile!=`object`||!$(e.profile.id)||!$(e.profile.revision))||e.selected!==void 0&&(!e.selected||typeof e.selected!=`object`||!$(e.selected.provider)||!$(e.selected.model)||!$(e.selected.reason)))return!1;if(e.candidates===void 0)return!0;if(!Array.isArray(e.candidates))return!1;for(let t of e.candidates){if(!t||typeof t!=`object`||!$(t.provider)||!$(t.model)||t.eligible!==void 0&&typeof t.eligible!=`boolean`)return!1;if(t.exclusions!==void 0){if(!Array.isArray(t.exclusions))return!1;for(let e of t.exclusions)if(!e||typeof e!=`object`||!$(e.code))return!1}}return!0}function Fe(e){if(e.routeDecision===void 0||Pe(e.routeDecision))return e;let t={...e};return delete t.routeDecision,t}function Ie(e){return`ocx.logs.list.v1:${e}`}var Le=[];function Re(e){return{main:`logs.agent.main`,subagent:`logs.agent.subagent`,internal:`logs.agent.internal`,unknown:`logs.agent.unknown`}[be(e)]}function ze({kind:e,t}){return(0,X.jsx)(`span`,{className:`badge badge-muted`,title:t(`logs.agent.badgeTitle`),children:t(Re(e))})}function Be(e){if(!Array.isArray(e))return null;for(let t of e)if(!t||typeof t!=`object`||typeof t.timestamp!=`number`||typeof t.model!=`string`||typeof t.provider!=`string`||typeof t.status!=`number`||typeof t.durationMs!=`number`||t.shadowCallRewrittenFrom!==void 0&&typeof t.shadowCallRewrittenFrom!=`string`||!Pe(t.routeDecision))return null;return e}function Ve(e){if(!e.usage)return typeof e.totalTokens==`number`?e.totalTokens:void 0;let t=e.usage.inputTokens+e.usage.outputTokens,n=e.usage.totalTokens??e.totalTokens;return typeof n==`number`?Math.max(n,t):t}function He(e){let t=Ve(e),n=e.usage?.contextTotalTokens;return typeof n==`number`?Math.max(t??0,n)||void 0:t}function Ue(e){let t=e.requestedEffort?.replace(/\s*->\s*/g,` → `),n=e.effectiveEffort;return t?!n||t===n||t.split(` → `).at(-1)===n?t:`${t} → ${n}`:n??`-`}function We(e){if(!(!e.reasoningWireField||e.reasoningWireValue===void 0))return`${e.reasoningWireField}=${e.reasoningWireValue}`}function Ge(e,t){if(!e||e.kind===`unavailable`||!Number.isFinite(e.value)||e.value<=0)return`—`;let n=e.value>=100?0:1,r=new Intl.NumberFormat(t,{minimumFractionDigits:n,maximumFractionDigits:n}).format(e.value);return`${e.estimated?`~`:``}${r}`}var Ke=3,qe={usage_missing:`logs.detail.reason.usage_missing`,usage_unsupported:`logs.detail.reason.usage_unsupported`,output_missing:`logs.detail.reason.output_missing`,invalid_duration:`logs.detail.reason.invalid_duration`,price_unmatched:`logs.detail.reason.price_unmatched`,invalid_cache_breakdown:`logs.detail.reason.invalid_cache_breakdown`,invalid_usage:`logs.detail.reason.invalid_usage`,combo_attempt_unavailable:`logs.detail.reason.combo_attempt_unavailable`},Je={usage_estimated:`logs.detail.estimate.usage_estimated`,cache_detail_missing:`logs.detail.estimate.cache_detail_missing`,expected_price_overlay:`logs.detail.estimate.expected_price_overlay`,provider_cost_overlay:`logs.detail.estimate.provider_cost_overlay`,priority_lower_bound:`logs.detail.estimate.priority_lower_bound`},Ye={"transient-5xx":`logs.detail.attempt.recovery.transient5xx`,"connection-reset":`logs.detail.attempt.recovery.connectionReset`,"oauth-401":`logs.detail.attempt.recovery.oauth401`,"key-429":`logs.detail.attempt.recovery.key429`,"rate-limit-429":`logs.detail.attempt.recovery.rateLimit429`,"anthropic-oauth-429":`logs.detail.attempt.recovery.anthropicOauth429`,"image-413":`logs.detail.attempt.recovery.image413`,"empty-completion":`logs.detail.attempt.recovery.emptyCompletion`};function Xe(e){return qe[e]}function Ze(e){return Je[e]}function Qe(e){return Ye[e]??`logs.detail.attempt.recovery.unknown`}function $e(e){return e===`verified`?`logs.detail.verification.verified`:`logs.detail.verification.derived`}function et(e){return e>=200&&e<300?`var(--green)`:e>=400?`var(--red)`:`var(--amber)`}function tt(e,t,n){let r=n?{timeZone:n}:void 0;try{return{date:new Date(e).toLocaleDateString(t,r),time:new Date(e).toLocaleTimeString(t,r)}}catch{return{date:new Date(e).toLocaleDateString(t),time:new Date(e).toLocaleTimeString(t)}}}function nt(e,t,n){let{date:r,time:i}=tt(e,t,n);return`${r} ${i}`}function rt(e){let t=0;for(let n of e){let e=Ve(n);e!==void 0&&(t+=e)}return{requests:e.length,totalTokens:t,...Ae(e)}}function it({apiBase:e}){let{t,locale:n}=i(),s=Ie(e),l=Be(m(s)),[u,d]=(0,x.useState)(!0),[f,h]=(0,x.useState)(null),[_,v]=(0,x.useState)(xe),S=(0,x.useRef)(null),C=r.find(e=>e.code===n)?.htmlLang,[w,T]=(0,x.useState)();(0,x.useEffect)(()=>{let t=new AbortController,n=!1;return fetch(`${e}/api/settings`,{signal:t.signal}).then(e=>e.ok?e.json():null).then(e=>{n||!e||typeof e.timeZone==`string`&&e.timeZone.trim()&&T(e.timeZone.trim())}).catch(()=>{}),()=>{n=!0,t.abort()}},[e]);let[E,D]=(0,x.useState)(Z),[O,k]=(0,x.useState)(()=>Z()===`debug`);(0,x.useEffect)(()=>{let e=()=>D(Z());return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]),(0,x.useEffect)(()=>{E===`debug`&&k(!0)},[E]);let A=Te,j=(0,x.useCallback)(async t=>{let n=await fetch(`${e}/api/logs?limit=2000`,{signal:t});if(!n.ok)throw Error(`${n.status} ${n.statusText}`.trim());let r=await n.json(),i=(Array.isArray(r)?r:r.logs??[]).map(Fe);return p(s,i),i},[e,s]),M=y(s,[e],j,{isEmpty:e=>e.length===0,enabled:E===`logs`,pollMs:u?2e3:void 0,initialData:l??void 0}),N=M.state,P=N.data??l??Le,F=M.refresh,I=!M.refreshing&&N.showError,L=!M.refreshing&&!N.showError&&N.data!==void 0,[R,z]=(0,x.useState)({error:null,count:0});L&&R.count!==0?z({error:null,count:0}):I&&R.error!==N.error&&z(e=>({error:N.error,count:e.count+1}));let B=R.count>=Ke||!u&&I,V=f?oe(f.status,n):null,H=_.conversationId.trim();(0,x.useEffect)(()=>{let e=!1;if(!H){v(e=>e.conversationQueryHash===void 0?e:{...e,conversationQueryHash:void 0});return}return re(H).then(t=>{e||v(e=>e.conversationQueryHash===t?e:{...e,conversationQueryHash:t})}),()=>{e=!0}},[H]);let te=(0,x.useMemo)(()=>we(P),[P]),U=Se(_),W=(0,x.useMemo)(()=>Ce(P,_),[P,_]),G=H?rt(W):null,K=ne({count:W.length,getScrollElement:()=>S.current,estimateSize:()=>44,overscan:15}),q=K.getVirtualItems(),J=q.length>0?q[0].start:0,Y=q.length>0?K.getTotalSize()-q[q.length-1].end:0;return(0,X.jsxs)(`div`,{className:`logs-page`,children:[(0,X.jsxs)(`div`,{className:`page-head`,children:[(0,X.jsx)(`h2`,{children:t(`nav.logs`)}),E===`logs`&&(0,X.jsxs)(`label`,{className:`muted text-control logs-auto-refresh`,children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:u,onChange:e=>d(e.target.checked)}),t(`logs.autoRefresh`)]})]}),(0,X.jsxs)(`div`,{className:`page-tabs`,role:`tablist`,"aria-label":t(`nav.logs`),children:[(0,X.jsx)(`button`,{type:`button`,role:`tab`,id:`logs-tab-logs`,"aria-selected":E===`logs`,"aria-controls":`logs-panel-logs`,tabIndex:E===`logs`?0:-1,className:`page-tab${E===`logs`?` page-tab--active`:``}`,onClick:()=>A(`logs`),onKeyDown:Ee,children:t(`logs.tabLogs`)}),(0,X.jsx)(`button`,{type:`button`,role:`tab`,id:`logs-tab-debug`,"aria-selected":E===`debug`,"aria-controls":`logs-panel-debug`,tabIndex:E===`debug`?0:-1,className:`page-tab${E===`debug`?` page-tab--active`:``}`,onClick:()=>A(`debug`),onKeyDown:Ee,children:t(`logs.tabDebug`)})]}),O&&(0,X.jsx)(`div`,{role:`tabpanel`,id:`logs-panel-debug`,"aria-labelledby":`logs-tab-debug`,hidden:E!==`debug`,children:(0,X.jsx)(_e,{apiBase:e,embedded:!0,active:E===`debug`})}),(0,X.jsxs)(`div`,{role:`tabpanel`,id:`logs-panel-logs`,"aria-labelledby":`logs-tab-logs`,hidden:E!==`logs`,children:[(0,X.jsx)(`p`,{className:`page-sub`,children:t(`logs.subtitle`)}),(0,X.jsx)(ve,{filters:_,options:te,hasActiveFilters:U,filteredCount:W.length,totalCount:P.length,t,onFilterChange:v,onResetFilters:()=>v(xe)}),G&&(0,X.jsx)(`div`,{className:`logs-conversation-totals`,children:(0,X.jsxs)(o,{tone:`ok`,children:[t(`logs.conversation.totals`,{requests:G.requests,tokens:g(G.totalTokens,C??n),cost:Q(G.estimatedCostUsd,t,C,G.priorityLowerBound)}),` `,(0,X.jsxs)(`span`,{className:`muted`,children:[t(`logs.conversation.scope`),G.unpricedRequests+G.unmeteredRequests>0?` ${t(`logs.conversation.excluded`,{unpriced:G.unpricedRequests,unmetered:G.unmeteredRequests})}`:``]})]})}),N.kind===`failed-cold`&&(0,X.jsxs)(o,{tone:`err`,children:[N.error instanceof Error?`${t(`logs.loadError`)} ${N.error.message}`:t(`logs.loadError`),` `,(0,X.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>F({forceLoading:!0}),disabled:N.refreshing,children:t(`common.retry`)})]}),B&&P.length>0&&(0,X.jsxs)(o,{tone:`err`,children:[t(`logs.loadError`),` `,(0,X.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>F({forceLoading:!0}),disabled:M.refreshing,children:t(`common.retry`)})]}),N.kind===`failed-cold`?null:N.showSkeleton&&P.length===0?(0,X.jsx)(ee,{label:t(`common.loading`),rows:6}):W.length===0?(0,X.jsx)(c,{title:t(`logs.noRequests`)}):(0,X.jsx)(X.Fragment,{children:(0,X.jsx)(`div`,{ref:S,className:`tbl-wrap logs-table-wrap`,children:(0,X.jsxs)(`table`,{className:`tbl logs-table`,children:[(0,X.jsx)(`thead`,{children:(0,X.jsxs)(`tr`,{children:[(0,X.jsx)(`th`,{children:t(`logs.col.time`)}),(0,X.jsx)(`th`,{className:`num log-col-tokens`,children:t(`logs.col.tokens`)}),(0,X.jsx)(`th`,{className:`num log-col-rate`,title:t(`logs.metric.tokPerSecTitle`),children:t(`logs.col.tokPerSec`)}),(0,X.jsx)(`th`,{className:`num log-col-cost`,title:t(`logs.metric.estimatedCostTitle`),children:t(`logs.col.estimatedCost`)}),(0,X.jsx)(`th`,{className:`log-col-model`,children:t(`logs.col.model`)}),(0,X.jsx)(`th`,{children:t(`logs.col.effort`)}),(0,X.jsx)(`th`,{children:t(`logs.col.provider`)}),(0,X.jsx)(`th`,{children:t(`logs.col.status`)}),(0,X.jsx)(`th`,{children:t(`logs.col.request`)}),(0,X.jsx)(`th`,{className:`num log-col-duration`,children:t(`logs.col.duration`)})]})}),(0,X.jsxs)(`tbody`,{children:[J>0&&(0,X.jsx)(`tr`,{children:(0,X.jsx)(`td`,{colSpan:10,className:`logs-virtual-spacer`,style:{height:J}})}),q.map(e=>{let r=W[W.length-1-e.index],i=We(r),o=tt(r.timestamp,C,w);return(0,X.jsxs)(`tr`,{"data-index":e.index,ref:K.measureElement,children:[(0,X.jsx)(`td`,{className:`muted mono log-col-time`,children:(0,X.jsxs)(`span`,{className:`logs-stack-start`,children:[(0,X.jsx)(`span`,{children:o.date}),(0,X.jsx)(`span`,{children:o.time})]})}),(0,X.jsx)(`td`,{className:`num mono log-col-tokens`,title:Ne(r,t),children:(()=>{let e=He(r),{read:i,write:a}=Me(r);return e===void 0?(0,X.jsx)(`span`,{className:`muted`,children:t(`logs.tokens.${r.usageStatus??`unreported`}`)}):(0,X.jsxs)(`span`,{className:`logs-stack-end`,children:[(0,X.jsxs)(`span`,{children:[r.usageStatus===`estimated`?`~`:``,g(e,n)]}),i!==void 0&&i>0&&(0,X.jsxs)(`span`,{className:`muted text-caption leading-tight`,children:[`c `,g(i,n)]}),a!==void 0&&a>0&&(0,X.jsxs)(`span`,{className:`muted text-caption leading-tight`,children:[`w `,g(a,n)]}),r.usageStatus===`estimated`&&i===void 0&&a===void 0&&(0,X.jsx)(`span`,{className:`muted text-caption leading-tight`,children:t(je(r.provider)?`logs.tokens.noCacheCursor`:`logs.tokens.noCache`)})]})})()}),(0,X.jsx)(`td`,{className:`num mono log-col-rate`,children:Ge(r.displayMetrics?.tokPerSecond,C)}),(0,X.jsx)(`td`,{className:`num mono log-col-cost`,children:ke(r.displayMetrics?.cost,t,C)}),(0,X.jsx)(`td`,{className:`mono log-col-model`,title:De(r,t),children:(0,X.jsxs)(`span`,{className:`logs-model-cell`,children:[(0,X.jsx)(`span`,{children:b(r.resolvedModel??r.model)}),(0,X.jsx)(ze,{kind:r.agentKind,t}),r.shadowCallRewrittenFrom&&(0,X.jsx)(`span`,{className:`badge badge-muted`,style:{whiteSpace:`nowrap`},title:t(`logs.badge.interceptedHelperTitle`),children:t(`logs.badge.interceptedHelper`,{model:r.shadowCallRewrittenFrom})}),(r.surface===`claude`||r.surface===`claude-desktop`)&&(0,X.jsx)(`span`,{className:`badge badge-accent`,children:t(`logs.badge.claude`)}),r.surface===`grok`&&(0,X.jsx)(`span`,{className:`badge badge-accent`,children:t(`logs.badge.grok`)}),Oe(r)&&(0,X.jsx)(`span`,{className:`badge badge-amber`,children:Oe(r)})]})}),(0,X.jsx)(`td`,{className:`mono log-reasoning-cell`,title:i,children:(0,X.jsxs)(`span`,{className:`logs-stack-start`,children:[(0,X.jsx)(`span`,{children:Ue(r)}),i&&(0,X.jsx)(`span`,{className:`muted text-caption leading-tight`,children:i})]})}),(0,X.jsx)(`td`,{className:`muted`,children:a(r.provider,t)}),(0,X.jsx)(`td`,{children:(0,X.jsxs)(`span`,{className:`log-status-cell`,children:[(0,X.jsx)(`span`,{className:`mono font-semibold`,style:{color:et(r.status)},children:r.status}),(0,X.jsx)(`button`,{type:`button`,className:`log-detail-btn`,onClick:()=>h(r),"aria-label":`${t(`logs.details`)}: ${r.requestId??r.status}`,children:t(`logs.details`)})]})}),(0,X.jsx)(`td`,{className:`muted mono`,children:(0,X.jsx)(`span`,{className:`log-reqid`,title:r.requestId,children:r.requestId??`-`})}),(0,X.jsxs)(`td`,{className:`num log-col-duration`,children:[r.durationMs,`ms`]})]},r.requestId??`${r.timestamp}-${e.index}`)}),Y>0&&(0,X.jsx)(`tr`,{children:(0,X.jsx)(`td`,{colSpan:10,className:`logs-virtual-spacer`,style:{height:Y}})})]})]})})}),f&&(0,X.jsx)(ot,{detail:f,detailInfo:V,localeCode:n,localeTag:C,serverTimeZone:w,t,onClose:()=>h(null),onFilterConversation:e=>{v(t=>({...t,conversationId:e})),h(null)}})]})]})}function at(e){let t=(0,x.useRef)(null);return(0,x.useEffect)(()=>{let n=t.current;n&&(e&&!n.open?n.showModal():!e&&n.open&&n.close())},[e]),t}function ot({detail:e,detailInfo:t,localeCode:n,localeTag:r,serverTimeZone:i,t:o,onClose:s,onFilterConversation:c}){let l=at(!0),[u,d]=(0,x.useState)(!1),f=Me(e),p=e.displayMetrics?.cost,m=We(e),h=async()=>{if(e.requestId)try{await navigator.clipboard.writeText(e.requestId),d(!0),window.setTimeout(()=>d(!1),1200)}catch{}};return(0,X.jsxs)(`dialog`,{ref:l,className:`modal-overlay`,"aria-labelledby":`log-detail-title`,onCancel:e=>{e.preventDefault(),s()},children:[(0,X.jsx)(`button`,{type:`button`,className:`modal-backdrop-dismiss`,"aria-label":o(`common.close`),tabIndex:-1,onClick:s}),(0,X.jsxs)(`div`,{className:`modal-card log-detail-card`,onClick:e=>e.stopPropagation(),role:`document`,children:[(0,X.jsxs)(`div`,{className:`modal-head`,children:[(0,X.jsxs)(`h3`,{id:`log-detail-title`,children:[(0,X.jsx)(`span`,{className:`mono`,style:{color:et(e.status)},children:e.status}),t&&(0,X.jsx)(`span`,{className:`logs-detail-info`,children:t.label})]}),(0,X.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:s,"aria-label":o(`common.cancel`),children:(0,X.jsx)(v,{})})]}),t&&(0,X.jsx)(`p`,{className:`modal-desc`,children:t.description}),(0,X.jsxs)(`section`,{className:`log-detail-section`,"aria-labelledby":`log-detail-basic`,children:[(0,X.jsx)(`h4`,{id:`log-detail-basic`,className:`log-detail-section-title`,children:o(`logs.detail.section.basic`)}),(0,X.jsxs)(`div`,{className:`log-detail-grid`,children:[(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.col.time`)}),(0,X.jsx)(`span`,{className:`mono`,children:nt(e.timestamp,r,i)}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.col.request`)}),(0,X.jsxs)(`span`,{className:`log-detail-request-row`,children:[(0,X.jsx)(`span`,{className:`mono log-detail-break`,children:e.requestId??`—`}),e.requestId&&(0,X.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>void h(),children:o(u?`logs.detail.copied`:`logs.detail.copyRequestId`)})]}),e.conversationId&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.detail.conversation`)}),(0,X.jsxs)(`span`,{className:`log-detail-request-row`,children:[(0,X.jsx)(`span`,{className:`mono log-detail-break`,children:e.conversationId}),c&&(0,X.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>c(e.conversationId),children:o(`logs.filter.conversation.apply`)})]})]}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.col.model`)}),(0,X.jsx)(`span`,{className:`mono`,children:b(e.resolvedModel??e.model)}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.col.provider`)}),(0,X.jsx)(`span`,{children:a(e.provider,o)}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.filter.agent.label`)}),(0,X.jsx)(ze,{kind:e.agentKind,t:o}),(e.requestedEffort||e.effectiveEffort)&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.col.effort`)}),(0,X.jsxs)(`span`,{className:`mono`,children:[Ue(e),m?` (${m})`:``]})]}),e.errorCode&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.col.error`)}),(0,X.jsx)(`span`,{className:`mono`,children:e.errorCode})]}),e.upstreamError&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.col.upstreamReason`)}),(0,X.jsx)(`span`,{className:`mono log-detail-break`,children:e.upstreamError})]})]})]}),(0,X.jsxs)(`section`,{className:`log-detail-section`,"aria-labelledby":`log-detail-route`,children:[(0,X.jsx)(`h4`,{id:`log-detail-route`,className:`log-detail-section-title`,children:o(`logs.detail.route.section`)}),e.routeDecision?(0,X.jsxs)(`div`,{className:`log-detail-grid`,children:[(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.detail.route.kind`)}),(0,X.jsx)(`span`,{className:`mono`,children:e.routeDecision.routeKind??`–`}),e.routeDecision.profile?.id&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.detail.route.profile`)}),(0,X.jsxs)(`span`,{className:`mono`,children:[e.routeDecision.profile.id,` (`,e.routeDecision.profile.revision,`)`]})]}),e.routeDecision.selected?.provider&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.detail.route.selected`)}),(0,X.jsxs)(`span`,{className:`mono`,children:[e.routeDecision.selected.provider,`/`,e.routeDecision.selected.model,e.routeDecision.selected.reason?` — ${e.routeDecision.selected.reason}`:``]})]}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.detail.route.candidates`)}),(0,X.jsx)(`span`,{className:`mono`,children:(e.routeDecision.candidates??[]).map(e=>`${typeof e.provider==`string`&&e.provider.length>0?e.provider:`–`}/${typeof e.model==`string`&&e.model.length>0?e.model:`–`}${e.eligible===!0?` ✓`:e.eligible===!1?` ✗`:` ?`}`).join(` `)||`–`})]}):(0,X.jsx)(`p`,{className:`log-detail-notes-line muted`,children:o(`logs.detail.route.unknown`)})]}),(0,X.jsxs)(`section`,{className:`log-detail-section`,"aria-labelledby":`log-detail-performance`,children:[(0,X.jsx)(`h4`,{id:`log-detail-performance`,className:`log-detail-section-title`,children:o(`logs.detail.section.performance`)}),(0,X.jsxs)(`div`,{className:`log-detail-grid`,children:[(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.col.duration`)}),(0,X.jsxs)(`span`,{className:`mono`,children:[e.durationMs,`ms`]}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.col.tokPerSec`)}),(0,X.jsx)(`span`,{className:`mono`,children:Ge(e.displayMetrics?.tokPerSecond,r)}),e.firstOutputMs!==void 0&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.detail.ttft`)}),(0,X.jsxs)(`span`,{className:`mono`,children:[e.firstOutputMs,`ms`]})]})]}),e.displayMetrics?.tokPerSecond.kind===`unavailable`&&(0,X.jsx)(`p`,{className:`log-detail-notes-line muted`,children:o(Xe(e.displayMetrics.tokPerSecond.reason))})]}),(0,X.jsxs)(`section`,{className:`log-detail-section`,"aria-labelledby":`log-detail-cost`,children:[(0,X.jsx)(`h4`,{id:`log-detail-cost`,className:`log-detail-section-title`,children:o(`logs.detail.section.cost`)}),(0,X.jsx)(`p`,{className:`log-detail-notes-line muted`,children:o(`usage.cost.disclaimer`)}),p?.kind===`value`?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`log-detail-grid`,children:[(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.detail.costTotal`)}),(0,X.jsx)(`span`,{className:`mono`,children:Q(p.estimate.cost.total,o,r,p.estimate.priorityLowerBound)}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.tokens.input`)}),(0,X.jsx)(`span`,{className:`mono`,children:Q(p.estimate.cost.input,o,r,p.estimate.priorityLowerBound)}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.tokens.cacheRead`)}),(0,X.jsx)(`span`,{className:`mono`,children:Q(p.estimate.cost.cacheRead,o,r,p.estimate.priorityLowerBound)}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.tokens.cacheWrite`)}),(0,X.jsx)(`span`,{className:`mono`,children:Q(p.estimate.cost.cacheWrite,o,r,p.estimate.priorityLowerBound)}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.tokens.output`)}),(0,X.jsx)(`span`,{className:`mono`,children:Q(p.estimate.cost.output,o,r,p.estimate.priorityLowerBound)}),p.estimate.price&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.detail.matchedKey`)}),(0,X.jsxs)(`span`,{className:`mono log-detail-break`,children:[p.estimate.price.jawcodeProvider??p.estimate.price.provider,`/`,p.estimate.price.modelId]}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.detail.priceSource`)}),(0,X.jsxs)(`span`,{children:[o(`logs.detail.source.${p.estimate.price.source}`),` · `,o($e(p.estimate.price.status))]})]})]}),p.estimateReasons.length>0&&(0,X.jsx)(`ul`,{className:`log-detail-notes`,children:p.estimateReasons.map(e=>(0,X.jsx)(`li`,{children:o(Ze(e))},e))})]}):(0,X.jsxs)(`div`,{className:`log-detail-grid`,children:[(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.detail.costTotal`)}),(0,X.jsx)(`span`,{className:`mono`,children:o(`logs.cost.unavailable`)}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.detail.unavailableReason`)}),(0,X.jsx)(`span`,{children:p?.kind===`unavailable`?o(Xe(p.reason)):o(`logs.detail.reason.usage_missing`)})]})]}),e.attempts?.length?(0,X.jsxs)(`section`,{className:`log-detail-section`,"aria-labelledby":`log-detail-attempts`,children:[(0,X.jsx)(`h4`,{id:`log-detail-attempts`,className:`log-detail-section-title`,children:o(`logs.detail.section.attempts`)}),(0,X.jsx)(`p`,{className:`log-detail-notes-line muted`,children:o(`logs.detail.attempt.e2eNote`)}),(0,X.jsx)(`div`,{className:`log-detail-attempts-wrap`,children:(0,X.jsxs)(`table`,{className:`tbl log-detail-attempts`,children:[(0,X.jsx)(`thead`,{children:(0,X.jsxs)(`tr`,{children:[(0,X.jsx)(`th`,{className:`num`,children:`#`}),(0,X.jsx)(`th`,{children:o(`logs.detail.attempt.target`)}),(0,X.jsx)(`th`,{className:`num`,children:o(`logs.col.duration`)}),(0,X.jsx)(`th`,{className:`num`,children:o(`logs.col.tokPerSec`)}),(0,X.jsx)(`th`,{className:`num`,children:o(`logs.col.estimatedCost`)}),(0,X.jsx)(`th`,{children:o(`logs.detail.attempt.reason`)})]})}),(0,X.jsx)(`tbody`,{children:e.attempts.toSorted((e,t)=>e.ordinal-t.ordinal).map(e=>{let t=e.displayMetrics?.cost,n=We(e),i=t?.kind===`value`?t.estimate.price:void 0,s=e.errorCode??(e.recoveryKinds.length?e.recoveryKinds.map(e=>o(Qe(e))).join(`, `):void 0)??(t?.kind===`unavailable`?o(Xe(t.reason)):o(`logs.detail.attempt.completed`));return(0,X.jsxs)(`tr`,{children:[(0,X.jsx)(`td`,{className:`num mono`,children:e.ordinal}),(0,X.jsxs)(`td`,{children:[(0,X.jsx)(`span`,{children:a(e.provider,o)}),(0,X.jsx)(`br`,{}),(0,X.jsx)(`span`,{className:`mono muted log-detail-break`,children:e.model}),(e.requestedEffort||e.effectiveEffort)&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`br`,{}),(0,X.jsxs)(`span`,{className:`mono muted text-caption log-detail-break`,children:[Ue(e),n?` (${n})`:``]})]}),i&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`br`,{}),(0,X.jsxs)(`span`,{className:`muted text-caption log-detail-break`,children:[i.jawcodeProvider??i.provider,`/`,i.modelId,` · `,o(`logs.detail.source.${i.source}`),` · `,o($e(i.status))]})]})]}),(0,X.jsxs)(`td`,{className:`num mono`,children:[e.durationMs,`ms`]}),(0,X.jsx)(`td`,{className:`num mono`,children:Ge(e.displayMetrics?.tokPerSecond,r)}),(0,X.jsx)(`td`,{className:`num mono`,children:ke(t,o,r)}),(0,X.jsx)(`td`,{className:`log-detail-break`,children:s})]},`${e.ordinal}-${e.provider}-${e.model}`)})})]})})]}):null,(0,X.jsxs)(`section`,{className:`log-detail-section`,"aria-labelledby":`log-detail-usage`,children:[(0,X.jsx)(`h4`,{id:`log-detail-usage`,className:`log-detail-section-title`,children:o(`logs.detail.section.usage`)}),(0,X.jsxs)(`div`,{className:`log-detail-grid`,children:[(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.tokens.input`)}),(0,X.jsx)(`span`,{className:`mono`,children:e.usage?g(e.usage.inputTokens,n):`—`}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.tokens.output`)}),(0,X.jsx)(`span`,{className:`mono`,children:e.usage?g(e.usage.outputTokens,n):`—`}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.tokens.cacheRead`)}),(0,X.jsx)(`span`,{className:`mono`,children:f.read===void 0?`—`:g(f.read,n)}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.tokens.cacheWrite`)}),(0,X.jsx)(`span`,{className:`mono`,children:f.write===void 0?`—`:g(f.write,n)}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.tokens.reasoning`)}),(0,X.jsx)(`span`,{className:`mono`,children:e.usage?.reasoningOutputTokens===void 0?`—`:g(e.usage.reasoningOutputTokens,n)}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.detail.totalTokens`)}),(0,X.jsx)(`span`,{className:`mono`,children:He(e)===void 0?`—`:g(He(e),n)}),e.usage?.contextTotalTokens!==void 0&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.tokens.contextTotal`)}),(0,X.jsx)(`span`,{className:`mono`,children:g(e.usage.contextTotalTokens,n)})]})]}),e.usageStatus===`estimated`&&(0,X.jsx)(`p`,{className:`log-detail-notes-line muted`,children:o(`logs.tokens.estimatedNote`)})]}),(0,X.jsxs)(`details`,{className:`log-detail-raw`,children:[(0,X.jsx)(`summary`,{children:o(`logs.detailRaw`)}),(0,X.jsx)(`pre`,{className:`log-detail-json`,children:JSON.stringify(e,null,2)})]})]})]})}export{it as default};
|
|
1
|
+
import{_ as e,h as t,m as n,n as r,s as i}from"./shared-DI18-uF7.js";import{C as a,F as o,L as s,P as c,St as l,_ as u,bt as d,dt as f,h as p,p as m,v as h,x as g,xt as _,yt as v}from"./index-DHQHBRhb.js";import{t as y}from"./data-surface-CETFXqiA.js";import{t as ee}from"./data-surface-B8PX8rjm.js";import{t as b}from"./model-display-OBTJhQwT.js";var x=e(t(),1),S=l();function C(e,t,n){let r=Array(e);return new Proxy(r,{get(r,i,a){if(typeof i==`string`){let a=i.charCodeAt(0);if(a>=48&&a<=57){let a=+i;if(Number.isInteger(a)&&a>=0&&a<e){let e=r[a];if(!e){let i=t[a*2];e=r[a]={index:a,key:n(a),start:i,size:t[a*2+1],end:i+t[a*2+1],lane:0}}return e}}if(i===`length`)return e}return Reflect.get(r,i,a)}})}function w(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return o.length!==r.length||o.some((e,t)=>r[t]!==e)?(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i):i}return o.updateDeps=e=>{r=e},o}function T(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var E=(e,t)=>Math.abs(e-t)<1.01,D=(e,t,n)=>{let r;return Object.assign(function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)},{cancel:()=>{e.clearTimeout(r)}})},O,k=()=>{if(O!==void 0)return O;if(typeof navigator>`u`)return O=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return O=!0;let e=navigator.maxTouchPoints;return O=navigator.platform===`MacIntel`&&e!==void 0&&e>0},A=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},j=e=>e,M=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},N=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(A(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(A(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},P={passive:!0},F=typeof window>`u`||`onscrollend`in window,I=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&F,o=0,s=a?null:D(i,()=>t(o,!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,P),a&&r.addEventListener(`scrollend`,u,P),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u),s?.cancel()}},L=(e,t)=>I(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),R=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},z=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})},B=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.isIndexInRange(n)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:j,rangeExtractor:M,onChange:()=>{},measureElement:R,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=e>0?s[0]?.key??n.getItemKey(0):null,l=e>0?s[e-1]?.key??n.getItemKey(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==c||t.getItemKey(o-1)!==l)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>e&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==l)&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=!1,s=0;if(r&&this.scrollOffset!==null){let[e,t]=r,n=this.getMeasurements(),{count:i,getItemKey:a}=this.options,c=0;for(;c<i&&a(c)!==e;)c++;if(c<i){let e=n[c];if(e){let n=Math.max(0,e.start+t);n!==this.scrollOffset&&(s=n-this.scrollOffset,this.scrollOffset=n,o=!0)}}}(o||i)&&(this.pendingScrollAnchor=[o?r[0]:null,o?r[1]:0,i,s])},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=w(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.targetWindow=this.scrollElement&&`ownerDocument`in this.scrollElement?this.scrollElement.ownerDocument.defaultView:this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{if(t&&this._intendedScrollOffset===null&&e===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;let n=this.getScrollOffset();this.scrollDirection=t?n===e?this.scrollDirection:n<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,!(!k()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,P),e.addEventListener(`touchend`,n,P),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let t=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled){let[e,n,r,i]=t;e!==null&&!r&&(k()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?i!==0&&(this._iosDeferredAdjustment+=i):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),r&&this.scrollToEnd({behavior:r})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;if(this._iosDeferredAdjustment<0&&e>=t-1){this._iosDeferredAdjustment=0;return}let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=w(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,n,r,i,a,o,s)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s}),{key:!1}),this.isIndexInRange=e=>e>=0&&e<this.options.count,this.getMeasurements=w(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s},c)=>{let l=this.itemSizeCache;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=e*2,a=this._flatMeasurements;if(!a||a.length<i){let e=new Float64Array(i);a&&u>0&&e.set(a.subarray(0,u*2)),a=e,this._flatMeasurements=a}let o;if(u===0)o=t+n;else{let e=u-1;o=a[e*2]+a[e*2+1]+s}for(let t=u;t<e;t++){let e=r(t),n=l.get(e),i=typeof n==`number`?n:this.options.estimateSize(t);a[t*2]=o,a[t*2+1]=i,o+=i+s}let c=C(e,a,r);return this.measurementsCache=c,c}let d=this.measurementsCache.slice(0,u),f=Array(a).fill(void 0),p=new Float64Array(a),m=0;for(let e=0;e<u;e++){let t=d[e];t&&(f[t.lane]===void 0&&m++,f[t.lane]=e,p[t.lane]=t.end)}for(let i=u;i<e;i++){let e=r(i),c=this.laneAssignments.get(i),u,h,g=o===`estimate`||l.has(e);if(c!==void 0&&this.options.lanes>1){u=c;let e=f[u],r=e===void 0?void 0:d[e];h=r?r.end+s:t+n}else if(m===a){let e=0,t=p[0],n=f[0];for(let r=1;r<a;r++){let i=p[r];(i<t||i===t&&f[r]<n)&&(e=r,t=i,n=f[r])}u=e,h=t+s,g&&this.laneAssignments.set(i,u)}else u=i%this.options.lanes,h=t+n,g&&this.laneAssignments.set(i,u);let _=l.get(e),v=typeof _==`number`?_:this.options.estimateSize(i),y=h+v;d[i]={index:i,start:h,size:v,end:y,key:e,lane:u},f[u]===void 0&&m++,f[u]=i,p[u]=y}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=w(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>e.length===0||t===0?(this.range=null,null):(this.range=te(e,t,n,r,r===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=w(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e);if(!this.isIndexInRange(t))return;let n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(!this.isIndexInRange(e))return;let n,r,i,a=this._flatMeasurements;if(this.options.lanes===1&&a!==null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=this.itemSizeCache.get(i)??n,s=t-o;if(s!==0){let a=this.options.anchorTo===`end`&&this.scrollState?.behavior!==`smooth`&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,c=a?this.getTotalSize():0,l=this.getScrollOffset()+this.scrollAdjustments,u=this.itemSizeCache.has(i)?r+o<=l&&this.scrollDirection!==`backward`:r<l,d=this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?u:this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},s,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++;let f=!1;a?f=this.applyScrollAdjustment(this.getTotalSize()-c):d&&(f=this.applyScrollAdjustment(s)),this.notify(f)}},this.getVirtualItems=w(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._flatMeasurements,r=this.options.lanes===1&&n!=null;return T(t[V(0,t.length-1,r?e=>n[e*2]:e=>T(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`){if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t]}if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{this._iosDeferredAdjustment=0;let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{this._iosDeferredAdjustment=0,e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e=`auto`}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:`end`,behavior:e});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._flatMeasurements;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){return e===0?!1:k()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=e,!1):(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&E(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}},V=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function H(e,t,n){let r=0;for(;r<=t;){let i=(r+t)/2|0,a=e[i*2];if(a<n)r=i+1;else if(a>n)t=i-1;else return i}return r>0?r-1:0}function te(e,t,n,r,i){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&i!==null){let e=H(i,a,n),r=e,o=n+t;for(;r<a&&i[r*2]+i[r*2+1]<o;)r++;return{startIndex:e,endIndex:r}}let o=V(0,a,t=>e[t].start,n),s=o;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){let i=Array(r).fill(0);for(;s<a&&i.some(e=>e<n+t);){let t=e[s];i[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var U=typeof document<`u`?x.useLayoutEffect:x.useEffect;function W({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n=`transform`,...r}){let i=x.useReducer(e=>e+1,0)[1],a=x.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;let o=e=>{let t=a.current;if(!t.enabled||!t.container)return;let n=e.getTotalSize();if(n!==t.lastSize){t.lastSize=n;let r=e.options.horizontal?`width`:`height`;t.container.style[r]=`${n}px`}},s=e=>{let t=a.current;if(!t.enabled||!t.container)return;o(e);let n=!!e.options.horizontal,r=t.mode===`transform`,i=n?`left`:`top`,s=e.options.scrollMargin,c=e.getVirtualItems();for(let a of c){let o=a.start-s,c=e.elementsCache.get(a.key);c&&t.lastPositions.get(c)!==o&&(t.lastPositions.set(c,o),r?c.style.transform=n?`translate3d(${o}px, 0, 0)`:`translate3d(0, ${o}px, 0)`:c.style[i]=`${o}px`)}},c={...r,onChange:(t,n)=>{var o;let c=a.current,l=!0;if(c.enabled){s(t);let e=t.range,n=c.prevRange;l=!n||n.isScrolling!==t.isScrolling||n.startIndex!==e?.startIndex||n.endIndex!==e?.endIndex,l&&(c.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}l&&(e&&n?(0,S.flushSync)(i):i()),(o=r.onChange)==null||o.call(r,t,n)}},[l]=x.useState(()=>{let e=new B(c);return Object.assign(e,{containerRef:t=>{let n=a.current;if(n.container=t,n.lastSize=null,t&&n.enabled){let r=e.getTotalSize();n.lastSize=r;let i=e.options.horizontal?`width`:`height`;t.style[i]=`${r}px`}}})});return l.setOptions(c),U(()=>l._didMount(),[]),U(()=>(o(l),l._willUpdate())),U(()=>{s(l)}),l}function ne(e){return W({observeElementRect:N,observeElementOffset:L,scrollToFn:z,...e})}var G=32;function K(e){return[...new Uint8Array(e)].map(e=>e.toString(16).padStart(2,`0`)).join(``)}function q(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<=31||n===127)return!0}return!1}async function re(e){let t=e.trim();if(t&&!q(t)&&!(t.length>4096))return K(await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(t))).slice(0,G)}function J(e,t,n){if(!e)return!1;let r=t.trim();return r?e===r||n!==void 0&&e===n:!1}var Y={400:{en:{label:`Bad request`,description:`The proxy could not understand the request. Check the model, message shape, headers, and JSON body before retrying.`},fr:{label:`Requête incorrecte`,description:`Le proxy n’a pas pu comprendre la requête. Vérifiez le modèle, la structure des messages, les en-têtes et le corps JSON avant de réessayer.`},ko:{label:`잘못된 요청`,description:`프록시가 요청을 이해할 수 없습니다. 재시도 전에 모델, 메시지 형식, 헤더, JSON 본문을 확인해야 합니다.`},zh:{label:`错误请求`,description:`代理无法理解该请求。重试前请检查模型、消息结构、标头和 JSON 正文。`},"zh-TW":{label:`錯誤請求`,description:`代理無法理解該請求。重試前請檢查模型、訊息結構、標頭和 JSON 本文。`},de:{label:`Ungültige Anfrage`,description:`Der Proxy konnte die Anfrage nicht verstehen. Prüfe Modell, Nachrichtenformat, Header und JSON-Body vor einem erneuten Versuch.`},ru:{label:`Некорректный запрос`,description:`Прокси не смог интерпретировать запрос. Перед повторной попыткой проверьте модель, формат сообщений, заголовки и тело JSON.`},ja:{label:`不正なリクエスト`,description:`プロキシがリクエストを解釈できませんでした。再試行前にモデル、メッセージ形式、ヘッダー、JSON 本文を確認してください。`},tr:{label:`Hatalı istek`,description:`Proxy isteği anlayamadı. Yeniden denemeden önce modeli, mesaj yapısını, başlıkları ve JSON gövdesini kontrol edin.`}},401:{en:{label:`Unauthorized`,description:`Credentials are missing, expired, or invalid. Re-login or refresh the account/provider credentials used by opencodex.`},fr:{label:`Non autorisé`,description:`Les identifiants sont absents, expirés ou non valides. Reconnectez-vous ou actualisez les identifiants du compte ou du fournisseur utilisés par opencodex.`},ko:{label:`인증 필요`,description:`자격 증명이 없거나 만료되었거나 유효하지 않습니다. opencodex에서 사용하는 계정 또는 제공자 자격 증명을 다시 로그인하거나 갱신해야 합니다.`},zh:{label:`未授权`,description:`凭据缺失、已过期或无效。请重新登录,或刷新 opencodex 使用的账号/提供商凭据。`},"zh-TW":{label:`未授權`,description:`憑證缺失、已過期或無效。請重新登入,或重新整理 opencodex 使用的帳號/供應商憑證。`},de:{label:`Nicht autorisiert`,description:`Anmeldedaten fehlen, sind abgelaufen oder ungültig. Melde dich erneut an oder aktualisiere die von opencodex genutzten Konto-/Anbieter-Zugangsdaten.`},ru:{label:`Не авторизован`,description:`Учётные данные отсутствуют, истекли или недействительны. Войдите заново или обновите учётные данные аккаунта или провайдера, которые использует opencodex.`},ja:{label:`認証が必要`,description:`認証情報が不在・期限切れ・無効です。opencodex が使用するアカウントまたはプロバイダー認証情報を再ログインまたは更新してください。`},tr:{label:`Yetkisiz erişim`,description:`Kimlik bilgileri eksik, süresi dolmuş veya geçersiz. opencodex tarafından kullanılan hesap veya sağlayıcı kimlik bilgilerini yeniden doğrulayın.`}},402:{en:{label:`Payment required`,description:`The upstream provider rejected the request because billing, credits, or plan access is not available. Add credits, update billing, or switch provider.`},fr:{label:`Paiement requis`,description:`Le fournisseur en amont a rejeté la requête, car la facturation, les crédits ou l’accès à l’offre ne sont pas disponibles. Ajoutez des crédits, mettez à jour la facturation ou changez de fournisseur.`},ko:{label:`결제 필요`,description:`청구, 크레딧, 플랜 접근 권한 문제로 업스트림 제공자가 요청을 거부했습니다. 크레딧 추가, 결제 정보 갱신, 제공자 전환이 필요합니다.`},zh:{label:`需要付款`,description:`上游提供商因账单、额度或套餐权限不可用而拒绝了请求。请充值、更新账单信息或切换提供商。`},"zh-TW":{label:`需要付款`,description:`上游供應商因帳單、額度或方案許可權不可用而拒絕了請求。請儲值、更新帳單資訊或切換供應商。`},de:{label:`Zahlung erforderlich`,description:`Der Upstream-Anbieter hat die Anfrage abgelehnt, weil Abrechnung, Guthaben oder Planzugriff nicht verfügbar ist. Guthaben aufladen, Abrechnung aktualisieren oder Anbieter wechseln.`},ru:{label:`Требуется оплата`,description:`Вышестоящий провайдер отклонил запрос из-за проблем с оплатой, кредитами или доступом по тарифному плану. Пополните баланс, обновите платёжные данные или переключитесь на другого провайдера.`},ja:{label:`支払いが必要`,description:`課金、クレジット、プランアクセスが利用できないため上流プロバイダーがリクエストを拒否しました。クレジット追加、支払い情報更新、プロバイダー切替が必要です。`},tr:{label:`Ödeme gerekli`,description:`Yukarı akış sağlayıcısı faturalandırma, kredi veya plan erişimi bulunmadığından isteği reddetti. Kredi ekleyin, ödeme bilgilerini güncelleyin veya sağlayıcı değiştirin.`}},403:{en:{label:`Forbidden`,description:`The account is authenticated but not allowed to use this model or operation. Often a plan/subscription gate (e.g. Ollama Cloud Pro), org policy, or model permission — not necessarily a bad API key.`},fr:{label:`Accès interdit`,description:`Le compte est authentifié, mais n’est pas autorisé à utiliser ce modèle ou cette opération. Il s’agit souvent d’une restriction liée à l’offre ou à l’abonnement (p. ex. Ollama Cloud Pro), à la politique de l’organisation ou aux autorisations du modèle — pas nécessairement d’une clé API incorrecte.`},ko:{label:`권한 없음`,description:`계정 인증은 되었지만 이 모델 또는 작업을 사용할 권한이 없습니다. 플랜/구독 제한(예: Ollama Cloud Pro), 조직 정책, 모델 권한 문제인 경우가 많으며 API 키가 잘못된 것은 아닐 수 있습니다.`},zh:{label:`禁止访问`,description:`账号已认证,但无权使用此模型或操作。常见原因是套餐/订阅限制(例如 Ollama Cloud Pro)、组织策略或模型权限——不一定是 API 密钥无效。`},"zh-TW":{label:`禁止存取`,description:`帳號已認證,但無權使用此模型或操作。常見原因是方案/訂閱限制(例如 Ollama Cloud Pro)、組織策略或模型許可權——不一定是 API 金鑰無效。`},de:{label:`Verboten`,description:`Das Konto ist authentifiziert, darf dieses Modell oder diese Operation aber nicht nutzen. Oft Plan-/Abo-Sperre (z. B. Ollama Cloud Pro), Organisationsrichtlinie oder Modellrecht — nicht zwingend ein ungültiger API-Key.`},ru:{label:`Доступ запрещён`,description:`Аккаунт аутентифицирован, но не имеет права использовать эту модель или операцию. Часто причина — ограничение тарифа или подписки (например, Ollama Cloud Pro), политика организации или права доступа к модели, а не обязательно неверный API-ключ.`},ja:{label:`アクセス禁止`,description:`アカウントは認証済みですがこのモデルや操作の使用が許可されていません。多くはプラン/サブスクリプション制限(例: Ollama Cloud Pro)、組織ポリシー、モデル権限であり、API キーが不正とは限りません。`},tr:{label:`Erişim yasaklandı`,description:`Hesabın kimliği doğrulandı ancak bu modeli veya işlemi kullanma izni yok. Genellikle plan/abonelik sınırı (örn. Ollama Cloud Pro), organizasyon politikası veya model izni kaynaklıdır.`}},404:{en:{label:`Not found`,description:`The requested route, model, account, or upstream resource was not found. Verify the model name and opencodex provider configuration.`},fr:{label:`Introuvable`,description:`La route, le modèle, le compte ou la ressource en amont demandés sont introuvables. Vérifiez le nom du modèle et la configuration du fournisseur opencodex.`},ko:{label:`찾을 수 없음`,description:`요청한 경로, 모델, 계정 또는 업스트림 리소스를 찾을 수 없습니다. 모델 이름과 opencodex 제공자 설정을 확인해야 합니다.`},zh:{label:`未找到`,description:`找不到请求的路由、模型、账号或上游资源。请确认模型名称和 opencodex 提供商配置。`},"zh-TW":{label:`未找到`,description:`找不到請求的路由、模型、帳號或上游資源。請確認模型名稱和 opencodex 供應商配置。`},de:{label:`Nicht gefunden`,description:`Die angeforderte Route, das Modell, das Konto oder die Upstream-Ressource wurde nicht gefunden. Prüfe Modellname und opencodex-Anbieterkonfiguration.`},ru:{label:`Не найдено`,description:`Запрошенный маршрут, модель, аккаунт или вышестоящий ресурс не найден. Проверьте имя модели и конфигурацию провайдера в opencodex.`},ja:{label:`見つかりません`,description:`要求されたルート、モデル、アカウント、上流リソースが見つかりませんでした。モデル名と opencodex プロバイダー設定を確認してください。`},tr:{label:`Bulunamadı`,description:`İstenen rota, model, hesap veya yukarı akış kaynağı bulunamadı. Model adını ve opencodex sağlayıcı yapılandırmasını doğrulayın.`}},408:{en:{label:`Request timeout`,description:`The request took too long before the proxy or upstream provider could complete it. Retry with a smaller request or a different provider.`},fr:{label:`Délai d’attente de la requête dépassé`,description:`La requête a pris trop de temps pour que le proxy ou le fournisseur en amont puisse la traiter. Réessayez avec une requête plus petite ou un autre fournisseur.`},ko:{label:`요청 시간 초과`,description:`프록시 또는 업스트림 제공자가 요청을 완료하기 전에 시간이 초과되었습니다. 더 작은 요청으로 재시도하거나 다른 제공자로 전환해야 합니다.`},zh:{label:`请求超时`,description:`代理或上游提供商未能在限定时间内完成请求。请缩小请求后重试,或切换提供商。`},"zh-TW":{label:`請求逾時`,description:`代理或上游供應商未能在限定時間內完成請求。請縮小請求後重試,或切換供應商。`},de:{label:`Anfrage-Timeout`,description:`Die Anfrage dauerte zu lange, bevor Proxy oder Upstream-Anbieter sie abschließen konnten. Mit kleinerer Anfrage oder anderem Anbieter erneut versuchen.`},ru:{label:`Тайм-аут запроса`,description:`Обработка запроса заняла слишком много времени, и прокси или вышестоящий провайдер не успел её завершить. Повторите попытку с меньшим запросом или через другого провайдера.`},ja:{label:`リクエストタイムアウト`,description:`プロキシまたは上流プロバイダーがリクエストを完了する前に時間切れになりました。より小さいリクエストで再試行するか、別のプロバイダーに切り替えてください。`},tr:{label:`İstek zaman aşımı`,description:`Proxy veya yukarı akış sağlayıcısı isteği tamamlayamadan zaman aşımına uğradı. Daha küçük bir istek veya farklı bir sağlayıcı ile tekrar deneyin.`}},409:{en:{label:`Conflict`,description:`The request conflicts with the current account, session, or provider state. Refresh the session or retry after the active operation finishes.`},fr:{label:`Conflit`,description:`La requête entre en conflit avec l’état actuel du compte, de la session ou du fournisseur. Actualisez la session ou réessayez une fois l’opération en cours terminée.`},ko:{label:`상태 충돌`,description:`요청이 현재 계정, 세션 또는 제공자 상태와 충돌합니다. 세션을 갱신하거나 진행 중인 작업이 끝난 뒤 재시도해야 합니다.`},zh:{label:`状态冲突`,description:`请求与当前账号、会话或提供商状态冲突。请刷新会话,或等待当前操作完成后重试。`},"zh-TW":{label:`狀態衝突`,description:`請求與當前帳號、會話或供應商狀態衝突。請重新整理會話,或等待當前操作完成後重試。`},de:{label:`Konflikt`,description:`Die Anfrage kollidiert mit dem aktuellen Konto-, Sitzungs- oder Anbieterstatus. Sitzung aktualisieren oder nach Abschluss der laufenden Operation erneut versuchen.`},ru:{label:`Конфликт`,description:`Запрос конфликтует с текущим состоянием аккаунта, сессии или провайдера. Обновите сессию или повторите попытку после завершения текущей операции.`},ja:{label:`状態の衝突`,description:`リクエストが現在のアカウント、セッション、プロバイダー状態と衝突しています。セッションを更新するか、進行中の操作が終わった後に再試行してください。`},tr:{label:`Durum çakışması`,description:`İstek mevcut hesap, oturum veya sağlayıcı durumuyla çakışıyor. Oturumu yenileyin veya aktif işlem bittikten sonra tekrar deneyin.`}},413:{en:{label:`Request too large`,description:`The prompt, attachments, or generated payload exceeds a proxy or upstream limit. Reduce tokens, file size, or conversation history.`},fr:{label:`Requête trop volumineuse`,description:`L’invite, les pièces jointes ou la charge utile générée dépassent une limite du proxy ou du fournisseur en amont. Réduisez le nombre de jetons, la taille des fichiers ou l’historique de la conversation.`},ko:{label:`요청 과대`,description:`프롬프트, 첨부 파일 또는 생성 페이로드가 프록시나 업스트림 한도를 초과했습니다. 토큰, 파일 크기, 대화 기록을 줄여야 합니다.`},zh:{label:`请求过大`,description:`提示、附件或生成的负载超过了代理或上游限制。请减少 token、文件大小或对话历史。`},"zh-TW":{label:`請求過大`,description:`提示、附件或生成的負載超過了代理或上游限制。請減少 token、檔案大小或對話歷史。`},de:{label:`Anfrage zu groß`,description:`Prompt, Anhänge oder generierte Nutzlast überschreiten ein Proxy- oder Upstream-Limit. Tokens, Dateigröße oder Verlauf reduzieren.`},ru:{label:`Слишком большой запрос`,description:`Промпт, вложения или сформированная полезная нагрузка превышают лимит прокси или вышестоящего провайдера. Сократите количество токенов, размер файлов или историю диалога.`},ja:{label:`リクエストが大きすぎます`,description:`プロンプト、添付ファイル、生成ペイロードがプロキシまたは上流の制限を超えました。トークン、ファイルサイズ、会話履歴を減らしてください。`},tr:{label:`İstek çok büyük`,description:`İstemi, ekler veya oluşturulan veri proxy ya da yukarı akış sınırını aşıyor. Jeton sayısını, dosya boyutunu veya sohbet geçmişini azaltın.`}},422:{en:{label:`Invalid content`,description:`The provider accepted the request format but rejected its contents. Check model options, tool definitions, message roles, and unsupported fields.`},fr:{label:`Contenu non valide`,description:`Le fournisseur a accepté le format de la requête, mais en a rejeté le contenu. Vérifiez les options du modèle, les définitions des outils, les rôles des messages et les champs non pris en charge.`},ko:{label:`내용 검증 실패`,description:`제공자가 요청 형식은 받았지만 내용을 거부했습니다. 모델 옵션, 도구 정의, 메시지 역할, 지원되지 않는 필드를 확인해야 합니다.`},zh:{label:`内容无效`,description:`提供商接受了请求格式,但拒绝了其中的内容。请检查模型选项、工具定义、消息角色和不支持的字段。`},"zh-TW":{label:`內容無效`,description:`供應商接受了請求格式,但拒絕了其中的內容。請檢查模型選項、工具定義、訊息角色和不支援的欄位。`},de:{label:`Ungültiger Inhalt`,description:`Der Anbieter akzeptierte das Anfrageformat, lehnte den Inhalt aber ab. Prüfe Modelloptionen, Tool-Definitionen, Nachrichtenrollen und nicht unterstützte Felder.`},ru:{label:`Недопустимое содержимое`,description:`Провайдер принял формат запроса, но отклонил его содержимое. Проверьте параметры модели, определения инструментов, роли сообщений и неподдерживаемые поля.`},ja:{label:`内容の検証失敗`,description:`プロバイダーはリクエスト形式を受け付けましたが内容を拒否しました。モデルオプション、ツール定義、メッセージロール、未サポートのフィールドを確認してください。`},tr:{label:`Geçersiz içerik`,description:`Sağlayıcı istek formatını kabul etti ancak içeriğini reddetti. Model seçeneklerini, araç tanımlarını, mesaj rollerini ve desteklenmeyen alanları kontrol edin.`}},424:{en:{label:`Provider dependency failed`,description:`A required upstream dependency failed while opencodex was routing the request. Retry later or switch to another configured provider.`},fr:{label:`Échec d’une dépendance du fournisseur`,description:`Une dépendance en amont requise a échoué pendant le routage de la requête par opencodex. Réessayez plus tard ou sélectionnez un autre fournisseur configuré.`},ko:{label:`제공자 의존성 실패`,description:`opencodex가 요청을 라우팅하는 동안 필요한 업스트림 의존성이 실패했습니다. 나중에 재시도하거나 다른 설정된 제공자로 전환해야 합니다.`},zh:{label:`提供商依赖失败`,description:`opencodex 路由请求时,必需的上游依赖失败。请稍后重试,或切换到另一个已配置的提供商。`},"zh-TW":{label:`供應商依賴失敗`,description:`opencodex 路由請求時,必需的上游依賴失敗。請稍後重試,或切換到另一個已配置的供應商。`},de:{label:`Anbieter-Abhängigkeit fehlgeschlagen`,description:`Eine erforderliche Upstream-Abhängigkeit ist fehlgeschlagen, während opencodex die Anfrage geroutet hat. Später erneut versuchen oder zu einem anderen Anbieter wechseln.`},ru:{label:`Сбой зависимости провайдера`,description:`Необходимая вышестоящая зависимость дала сбой, пока opencodex маршрутизировал запрос. Повторите попытку позже или переключитесь на другого настроенного провайдера.`},ja:{label:`プロバイダー依存の失敗`,description:`opencodex がリクエストをルーティング中に必要な上流依存が失敗しました。後で再試行するか、別の設定済みプロバイダーに切り替えてください。`},tr:{label:`Sağlayıcı bağımlılığı başarısız`,description:`opencodex isteği yönlendirirken gerekli bir yukarı akış bağımlılığı başarısız oldu. Daha sonra tekrar deneyin veya başka bir sağlayıcıya geçin.`}},429:{en:{label:`Rate limited`,description:`The upstream provider rate or quota limit has been reached. Wait for the quota window to reset or switch account/provider.`},fr:{label:`Limite de débit atteinte`,description:`La limite de débit ou de quota du fournisseur en amont a été atteinte. Attendez la réinitialisation de la fenêtre de quota ou changez de compte ou de fournisseur.`},ko:{label:`한도 초과`,description:`업스트림 제공자의 속도 또는 할당량 한도에 도달했습니다. 한도 창이 초기화될 때까지 기다리거나 계정/제공자를 전환해야 합니다.`},zh:{label:`限流`,description:`已达到上游提供商的速率或额度限制。请等待额度窗口重置,或切换账号/提供商。`},"zh-TW":{label:`限流`,description:`已達到上游供應商的速率或額度限制。請等待額度視窗重設,或切換帳號/供應商。`},de:{label:`Ratenlimit erreicht`,description:`Das Raten- oder Kontingentlimit des Upstream-Anbieters ist erreicht. Auf Reset des Kontingentfensters warten oder Konto/Anbieter wechseln.`},ru:{label:`Превышен лимит запросов`,description:`Достигнут лимит скорости или квота вышестоящего провайдера. Дождитесь сброса окна квоты или переключитесь на другой аккаунт или провайдера.`},ja:{label:`レート制限`,description:`上流プロバイダーのレートまたはクォータ制限に達しました。クォータウィンドウがリセットされるまで待つか、アカウント/プロバイダーを切り替えてください。`},tr:{label:`Oran sınırı aşıldı`,description:`Yukarı akış sağlayıcısının hız veya kota sınırına ulaşıldı. Kota penceresinin sıfırlanmasını bekleyin ya da hesap/sağlayıcı değiştirin.`}},499:{en:{label:`Client closed request`,description:`The client disconnected or canceled the request before opencodex finished routing it. Retry if the cancellation was accidental.`},fr:{label:`Requête fermée par le client`,description:`Le client s’est déconnecté ou a annulé la requête avant la fin de son routage par opencodex. Réessayez si l’annulation était involontaire.`},ko:{label:`클라이언트 취소`,description:`opencodex가 라우팅을 끝내기 전에 클라이언트 연결이 끊기거나 요청이 취소되었습니다. 의도한 취소가 아니면 다시 시도해야 합니다.`},zh:{label:`客户端已取消`,description:`opencodex 完成路由前,客户端已断开连接或取消请求。如果不是有意取消,请重试。`},"zh-TW":{label:`客戶端已取消`,description:`opencodex 完成路由前,客戶端已斷開連線或取消請求。如果不是有意取消,請重試。`},de:{label:`Client hat Anfrage geschlossen`,description:`Der Client hat die Verbindung getrennt oder die Anfrage abgebrochen, bevor opencodex das Routing abgeschlossen hat. Bei versehentlichem Abbruch erneut versuchen.`},ru:{label:`Запрос закрыт клиентом`,description:`Клиент отключился или отменил запрос до того, как opencodex завершил его маршрутизацию. Если отмена была случайной, повторите попытку.`},ja:{label:`クライアントがリクエストをクローズ`,description:`opencodex がルーティングを終える前にクライアントが切断またはキャンセルしました。意図しないキャンセルなら再試行してください。`},tr:{label:`İstemci isteği kapattı`,description:`opencodex yönlendirmeyi bitirmeden önce istemci bağlantıyı kesti veya isteği iptal etti. İptal kazara yapıldıysa tekrar deneyin.`}},500:{en:{label:`Proxy error`,description:`opencodex hit an internal error while handling the request. Retry once, then check proxy logs if it repeats.`},fr:{label:`Erreur du proxy`,description:`opencodex a rencontré une erreur interne lors du traitement de la requête. Réessayez une fois, puis consultez les journaux du proxy si l’erreur se reproduit.`},ko:{label:`프록시 오류`,description:`opencodex가 요청을 처리하는 동안 내부 오류가 발생했습니다. 한 번 재시도하고 반복되면 프록시 로그를 확인해야 합니다.`},zh:{label:`代理错误`,description:`opencodex 处理请求时发生内部错误。请先重试一次;如果重复出现,请检查代理日志。`},"zh-TW":{label:`代理錯誤`,description:`opencodex 處理請求時發生內部錯誤。請先重試一次;如果重複出現,請檢查代理日誌。`},de:{label:`Proxy-Fehler`,description:`opencodex ist bei der Anfragebearbeitung auf einen internen Fehler gestoßen. Einmal erneut versuchen, bei Wiederholung Proxy-Logs prüfen.`},ru:{label:`Ошибка прокси`,description:`В opencodex произошла внутренняя ошибка при обработке запроса. Повторите попытку один раз; если ошибка повторяется, проверьте логи прокси.`},ja:{label:`プロキシエラー`,description:`opencodex がリクエスト処理中に内部エラーに遭遇しました。1 回再試行し、繰り返す場合はプロキシログを確認してください。`},tr:{label:`Proxy hatası`,description:`opencodex isteği işlerken dahili bir hatayla karşılaştı. Bir kez tekrar deneyin, tekrarlarsa proxy günlüklerini kontrol edin.`}},502:{en:{label:`Bad upstream response`,description:`The upstream provider returned an invalid or failed response through the proxy. Retry or route the request to another provider.`},fr:{label:`Réponse incorrecte du fournisseur en amont`,description:`Le fournisseur en amont a renvoyé une réponse non valide ou en échec par l’intermédiaire du proxy. Réessayez ou acheminez la requête vers un autre fournisseur.`},ko:{label:`업스트림 응답 오류`,description:`업스트림 제공자가 프록시를 통해 유효하지 않거나 실패한 응답을 반환했습니다. 재시도하거나 다른 제공자로 라우팅해야 합니다.`},zh:{label:`上游响应错误`,description:`上游提供商通过代理返回了无效或失败的响应。请重试,或将请求路由到其他提供商。`},"zh-TW":{label:`上游回應錯誤`,description:`上游供應商透過代理返回了無效或失敗的回應。請重試,或將請求路由到其他供應商。`},de:{label:`Ungültige Upstream-Antwort`,description:`Der Upstream-Anbieter lieferte über den Proxy eine ungültige oder fehlgeschlagene Antwort. Erneut versuchen oder zu einem anderen Anbieter routen.`},ru:{label:`Некорректный ответ провайдера`,description:`Вышестоящий провайдер вернул через прокси недействительный или ошибочный ответ. Повторите попытку или направьте запрос другому провайдеру.`},ja:{label:`上流レスポンス不良`,description:`上流プロバイダーがプロキシ経由で無効または失敗したレスポンスを返しました。再試行するか、リクエストを別のプロバイダーにルーティングしてください。`},tr:{label:`Kötü yukarı akış yanıtı`,description:`Yukarı akış sağlayıcısı proxy üzerinden geçersiz veya başarısız bir yanıt döndürdü. Tekrar deneyin veya isteği başka bir sağlayıcıya yönlendirin.`}},503:{en:{label:`Provider unavailable`,description:`The proxy or upstream provider is temporarily unavailable or overloaded. Wait briefly, then retry or switch provider.`},fr:{label:`Fournisseur indisponible`,description:`Le proxy ou le fournisseur en amont est temporairement indisponible ou surchargé. Patientez un instant, puis réessayez ou changez de fournisseur.`},ko:{label:`제공자 사용 불가`,description:`프록시 또는 업스트림 제공자가 일시적으로 사용할 수 없거나 과부하 상태입니다. 잠시 기다린 뒤 재시도하거나 제공자를 전환해야 합니다.`},zh:{label:`提供商不可用`,description:`代理或上游提供商暂时不可用或过载。请稍后重试,或切换提供商。`},"zh-TW":{label:`供應商不可用`,description:`代理或上游供應商暫時不可用或過載。請稍後重試,或切換供應商。`},de:{label:`Anbieter nicht verfügbar`,description:`Proxy oder Upstream-Anbieter ist vorübergehend nicht verfügbar oder überlastet. Kurz warten, dann erneut versuchen oder Anbieter wechseln.`},ru:{label:`Провайдер недоступен`,description:`Прокси или вышестоящий провайдер временно недоступен или перегружен. Немного подождите, затем повторите попытку или смените провайдера.`},ja:{label:`プロバイダー利用不可`,description:`プロキシまたは上流プロバイダーが一時的に利用不可または過負荷です。少し待ってから再試行するか、プロバイダーを切り替えてください。`},tr:{label:`Sağlayıcı kullanılamıyor`,description:`Proxy veya yukarı akış sağlayıcısı geçici olarak kullanılamıyor veya aşırı yüklü. Kısa bir süre bekleyip tekrar deneyin ya da sağlayıcı değiştirin.`}},504:{en:{label:`Upstream timeout`,description:`The upstream provider did not respond before the proxy timeout. Retry with a smaller request or choose a faster provider.`},fr:{label:`Délai d’attente du fournisseur en amont dépassé`,description:`Le fournisseur en amont n’a pas répondu avant l’expiration du délai du proxy. Réessayez avec une requête plus petite ou choisissez un fournisseur plus rapide.`},ko:{label:`업스트림 시간 초과`,description:`프록시 시간 제한 전에 업스트림 제공자가 응답하지 않았습니다. 더 작은 요청으로 재시도하거나 더 빠른 제공자를 선택해야 합니다.`},zh:{label:`上游超时`,description:`上游提供商未在代理超时前响应。请缩小请求后重试,或选择响应更快的提供商。`},"zh-TW":{label:`上游逾時`,description:`上游供應商未在代理逾時前回應。請縮小請求後重試,或選擇回應更快的供應商。`},de:{label:`Upstream-Timeout`,description:`Der Upstream-Anbieter antwortete nicht vor dem Proxy-Timeout. Mit kleinerer Anfrage erneut versuchen oder schnelleren Anbieter wählen.`},ru:{label:`Тайм-аут вышестоящего провайдера`,description:`Вышестоящий провайдер не ответил до истечения тайм-аута прокси. Повторите попытку с меньшим запросом или выберите более быстрого провайдера.`},ja:{label:`上流タイムアウト`,description:`上流プロバイダーがプロキシタイムアウト前に応答しませんでした。より小さいリクエストで再試行するか、より速いプロバイダーを選んでください。`},tr:{label:`Yukarı akış zaman aşımı`,description:`Yukarı akış sağlayıcısı proxy zaman aşımı süresinden önce yanıt vermedi. Daha küçük bir istekle tekrar deneyin veya daha hızlı bir sağlayıcı seçin.`}},529:{en:{label:`Provider overloaded`,description:`The upstream provider is overloaded or capacity-limited. Wait and retry, or switch to another account/provider.`},fr:{label:`Fournisseur surchargé`,description:`Le fournisseur en amont est surchargé ou sa capacité est limitée. Patientez et réessayez, ou changez de compte ou de fournisseur.`},ko:{label:`제공자 과부하`,description:`업스트림 제공자가 과부하 상태이거나 처리 용량이 제한되었습니다. 기다렸다가 재시도하거나 다른 계정/제공자로 전환해야 합니다.`},zh:{label:`提供商过载`,description:`上游提供商过载或容量受限。请等待后重试,或切换到其他账号/提供商。`},"zh-TW":{label:`供應商過載`,description:`上游供應商過載或容量受限。請等待後重試,或切換到其他帳號/供應商。`},de:{label:`Anbieter überlastet`,description:`Der Upstream-Anbieter ist überlastet oder kapazitätsbegrenzt. Warten und erneut versuchen oder anderes Konto/Anbieter nutzen.`},ru:{label:`Провайдер перегружен`,description:`Вышестоящий провайдер перегружен или ограничен по мощности. Подождите и повторите попытку либо переключитесь на другой аккаунт или провайдера.`},ja:{label:`プロバイダー過負荷`,description:`上流プロバイダーが過負荷または容量制限されています。待ってから再試行するか、別のアカウント/プロバイダーに切り替えてください。`},tr:{label:`Sağlayıcı aşırı yüklü`,description:`Yukarı akış sağlayıcısı aşırı yüklü veya kapasitesi sınırlı. Bekleyip tekrar deneyin veya başka bir hesap/sağlayıcıya geçin.`}}},ie={client:{en:{label:`Request error`,description:`The proxy or upstream provider rejected the request. Check the request shape, credentials, model name, and provider configuration.`},fr:{label:`Erreur de requête`,description:`Le proxy ou le fournisseur en amont a rejeté la requête. Vérifiez sa structure, les identifiants, le nom du modèle et la configuration du fournisseur.`},ko:{label:`요청 오류`,description:`프록시 또는 업스트림 제공자가 요청을 거부했습니다. 요청 형식, 자격 증명, 모델 이름, 제공자 설정을 확인해야 합니다.`},zh:{label:`请求错误`,description:`代理或上游提供商拒绝了该请求。请检查请求结构、凭据、模型名称和提供商配置。`},"zh-TW":{label:`請求錯誤`,description:`代理或上游供應商拒絕了該請求。請檢查請求結構、憑證、模型名稱和供應商配置。`},de:{label:`Anfragefehler`,description:`Der Proxy oder Upstream-Anbieter hat die Anfrage abgelehnt. Prüfe Anfrageformat, Anmeldedaten, Modellname und Anbieterkonfiguration.`},ru:{label:`Ошибка запроса`,description:`Прокси или вышестоящий провайдер отклонил запрос. Проверьте структуру запроса, учётные данные, имя модели и конфигурацию провайдера.`},ja:{label:`リクエストエラー`,description:`プロキシまたは上流プロバイダーがリクエストを拒否しました。リクエスト形式、認証情報、モデル名、プロバイダー設定を確認してください。`},tr:{label:`İstek hatası`,description:`Proxy veya yukarı akış sağlayıcısı isteği reddetti. İstek yapısını, kimlik bilgilerini, model adını ve sağlayıcı yapılandırmasını kontrol edin.`}},server:{en:{label:`Server or upstream error`,description:`opencodex or an upstream provider failed while processing the request. Retry later or route the request to another provider.`},fr:{label:`Erreur du serveur ou du fournisseur en amont`,description:`opencodex ou un fournisseur en amont a échoué lors du traitement de la requête. Réessayez plus tard ou acheminez la requête vers un autre fournisseur.`},ko:{label:`서버 또는 업스트림 오류`,description:`opencodex 또는 업스트림 제공자가 요청 처리 중 실패했습니다. 나중에 재시도하거나 다른 제공자로 라우팅해야 합니다.`},zh:{label:`服务器或上游错误`,description:`opencodex 或上游提供商处理请求时失败。请稍后重试,或将请求路由到其他提供商。`},"zh-TW":{label:`伺服器或上游錯誤`,description:`opencodex 或上游供應商處理請求時失敗。請稍後重試,或將請求路由到其他供應商。`},de:{label:`Server- oder Upstream-Fehler`,description:`opencodex oder ein Upstream-Anbieter ist bei der Anfragebearbeitung fehlgeschlagen. Später erneut versuchen oder zu einem anderen Anbieter routen.`},ru:{label:`Ошибка сервера или провайдера`,description:`opencodex или вышестоящий провайдер завершил обработку запроса с ошибкой. Повторите попытку позже или направьте запрос другому провайдеру.`},ja:{label:`サーバーまたは上流エラー`,description:`opencodex または上流プロバイダーがリクエスト処理中に失敗しました。後で再試行するか、リクエストを別のプロバイダーにルーティングしてください。`},tr:{label:`Sunucu veya yukarı akış hatası`,description:`opencodex veya bir yukarı akış sağlayıcısı isteği işlerken başarısız oldu. Daha sonra tekrar deneyin veya isteği başka bir sağlayıcıya yönlendirin.`}}};function ae(e){return e.toLowerCase().startsWith(`fr`)?`fr`:e===`de`||e===`ko`||e===`zh`||e===`zh-TW`||e===`ru`||e===`ja`||e===`tr`?e:`en`}function oe(e,t){if(e<400)return null;let n=ae(t);return(Y[Math.trunc(e)]??(e<500?ie.client:ie.server))[n]}var se=[`provider`,`usage`,`injection`];function ce(e){return e>0?`[${new Date(e).toLocaleTimeString()}] `:``}function le(e){return new Date(e).toLocaleTimeString()}function ue(e,t){return t===`provider`?!!e?.enabled:t===`usage`?!!e?.usage:!!e?.injection}function de(e,t){return t===`debug`?e.enabled:t===`usage`?e.usage:t===`injection`?e.injection:e.claude}var X=n();function fe({entries:e}){let{t}=i();return(0,X.jsxs)(`div`,{className:`card`,style:{marginBottom:16,padding:`12px 14px`},children:[(0,X.jsx)(`div`,{className:`font-semibold`,style:{marginBottom:4},children:t(`debug.claudeInbound.title`)}),(0,X.jsx)(`div`,{className:`muted text-control`,style:{marginBottom:10},children:t(`debug.claudeInbound.sub`)}),e.length===0?(0,X.jsx)(`div`,{className:`muted text-control`,children:t(`debug.claudeInbound.empty`)}):(0,X.jsx)(`div`,{style:{overflowX:`auto`},children:(0,X.jsxs)(`table`,{className:`table text-label`,children:[(0,X.jsx)(`thead`,{children:(0,X.jsxs)(`tr`,{children:[(0,X.jsx)(`th`,{children:t(`debug.claudeInbound.time`)}),(0,X.jsx)(`th`,{children:t(`debug.claudeInbound.endpoint`)}),(0,X.jsx)(`th`,{children:t(`debug.claudeInbound.model`)}),(0,X.jsx)(`th`,{children:`thinking`}),(0,X.jsx)(`th`,{children:`effort`}),(0,X.jsx)(`th`,{children:`beta`}),(0,X.jsx)(`th`,{children:`metadata`}),(0,X.jsx)(`th`,{children:`system`})]})}),(0,X.jsx)(`tbody`,{children:e.map(e=>(0,X.jsxs)(`tr`,{children:[(0,X.jsx)(`td`,{className:`muted mono`,children:le(e.at)}),(0,X.jsx)(`td`,{className:`mono`,children:e.endpoint}),(0,X.jsxs)(`td`,{className:`mono`,title:e.resolvedModel,children:[e.model,e.resolvedModel&&e.resolvedModel!==e.model&&(0,X.jsxs)(`span`,{className:`muted`,children:[` → `,e.resolvedModel]})]}),(0,X.jsxs)(`td`,{className:`mono`,children:[e.thinkingType??`-`,e.thinkingBudgetTokens!==void 0&&(0,X.jsxs)(`span`,{className:`muted`,children:[` (`,e.thinkingBudgetTokens,`)`]})]}),(0,X.jsx)(`td`,{className:`mono`,children:e.outputConfigEffort??`-`}),(0,X.jsx)(`td`,{className:`mono`,title:e.anthropicBeta,style:{maxWidth:160,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.anthropicBeta??`-`}),(0,X.jsx)(`td`,{className:`mono`,title:e.metadataKeys?.join(`, `),children:e.hasMetadataUserId?`user_id ${e.userIdTag??``}`:t(`debug.claudeInbound.none`)}),(0,X.jsx)(`td`,{className:`mono`,children:e.hasSystem?e.systemTag??`yes`:t(`debug.claudeInbound.none`)})]},e.id))})]})})]})}function pe({debug:e,stream:t,streamEnabled:n,entries:r,scrollContainerRef:a,lineVirtualizer:o}){let{t:s}=i();return e?n?r.length===0?(0,X.jsxs)(`div`,{className:`empty`,children:[(0,X.jsx)(`div`,{className:`font-semibold`,style:{marginBottom:6},children:s(`debug.noLinesTitle`)}),(0,X.jsx)(`div`,{className:`muted text-control`,style:{maxWidth:560,marginInline:`auto`},children:s(`debug.noLines.${t}`)})]}):(0,X.jsx)(`div`,{ref:a,className:`log-detail-json`,style:{maxHeight:`calc(100vh - 280px)`,overflow:`auto`},children:(0,X.jsx)(`div`,{style:{position:`relative`,height:o.getTotalSize(),width:`100%`},children:o.getVirtualItems().map(e=>(0,X.jsx)(`div`,{ref:o.measureElement,"data-index":e.index,style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${e.start}px)`},children:`${ce(r[e.index].at)}${r[e.index].line}`},e.key))})}):(0,X.jsxs)(`div`,{className:`empty`,children:[(0,X.jsx)(`div`,{className:`font-semibold`,style:{marginBottom:6},children:s(`debug.emptyTitle`)}),(0,X.jsx)(`div`,{className:`muted text-control`,style:{maxWidth:560,marginInline:`auto`},children:s(`debug.empty`)})]}):null}function me({debug:e,debugBusy:t,stream:n,onSetFlag:r,onReset:a,onStreamChange:o}){let{t:c}=i();return(0,X.jsxs)(`div`,{className:`card`,style:{marginBottom:16,padding:`12px 14px`},children:[(0,X.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,flexWrap:`wrap`},children:[(0,X.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:16},children:[`debug`,`usage`,`injection`,`claude`].map(n=>{let i=de(e,n);return(0,X.jsxs)(`div`,{style:{display:`inline-flex`,alignItems:`center`,gap:10,minWidth:220},children:[(0,X.jsx)(s,{on:i,disabled:t,label:c(`debug.${n}`),onClick:()=>r(n,!i)}),(0,X.jsx)(`span`,{className:`text-control`,children:c(`debug.${n}`)})]},n)})}),(0,X.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,disabled:t,onClick:a,children:c(`debug.reset`)})]}),(e.enabled||e.usage||e.injection)&&(0,X.jsxs)(`div`,{style:{display:`inline-flex`,gap:6,marginTop:12},children:[e.enabled&&(0,X.jsx)(`button`,{type:`button`,className:`btn btn-sm${n===`provider`?` btn-primary`:` btn-ghost`}`,onClick:()=>o(`provider`),children:c(`debug.streamProvider`)}),e.usage&&(0,X.jsx)(`button`,{type:`button`,className:`btn btn-sm${n===`usage`?` btn-primary`:` btn-ghost`}`,onClick:()=>o(`usage`),children:c(`debug.streamUsage`)}),e.injection&&(0,X.jsx)(`button`,{type:`button`,className:`btn btn-sm${n===`injection`?` btn-primary`:` btn-ghost`}`,onClick:()=>o(`injection`),children:c(`debug.streamInjection`)})]})]})}function he({embedded:e,refreshing:t,streamEnabled:n,follow:r,onRefresh:a,onFollowChange:o}){let{t:s}=i();return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:e?`row`:`page-head`,style:e?{justifyContent:`flex-end`,marginBottom:4}:void 0,children:[!e&&(0,X.jsx)(`h2`,{children:s(`debug.title`)}),(0,X.jsxs)(`div`,{style:{display:`inline-flex`,alignItems:`center`,gap:12},children:[(0,X.jsxs)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,disabled:t||!n,onClick:a,children:[(0,X.jsx)(f,{}),` `,s(`debug.refresh`)]}),(0,X.jsxs)(`label`,{className:`muted text-control`,style:{cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6},children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:r,onChange:e=>o(e.target.checked)}),s(`debug.follow`)]})]})]}),(0,X.jsx)(`p`,{className:`page-sub`,children:s(`debug.subtitle`)})]})}function ge(e){return`debug-settings:${e}`}function _e({apiBase:e,embedded:t,active:n=!0}){let{t:r}=i(),a=`ocx.debug.settings.v1:${e}`,s=m(a),c=ge(e),[l,f]=(0,x.useState)(!1),[g,v]=(0,x.useState)(`provider`),[b,S]=(0,x.useState)([]),[C,w]=(0,x.useState)(!0),[T,E]=(0,x.useState)(!1),D=(0,x.useRef)(0),O=(0,x.useRef)(0),k=(0,x.useRef)(0),A=(0,x.useRef)(null),j=(0,x.useRef)(null),M=(0,x.useRef)(null),N=y(c,[e],async t=>{let n=await fetch(`${e}/api/debug`,{signal:t});if(!n.ok)throw Error(String(n.status));let r=await n.json();return p(a,r),r},{pollMs:2e3,enabled:n,isEmpty:()=>!1,initialData:s??void 0}),P=N.state,F=N.data??s??null,I=_(`debug-claude-inbound:${e}`,[e,F?.claude],async t=>{let n=await fetch(`${e}/api/claude/inbound-debug`,{signal:t});if(!n.ok)return[];let r=await n.json();return Array.isArray(r.entries)?r.entries:[]},{pollMs:2e3,enabled:n&&!!F?.claude}).data??[],L=ne({count:b.length,getScrollElement:()=>j.current,estimateSize:()=>20,overscan:30,getItemKey:e=>b[e].seq}),R=(0,x.useCallback)(e=>ue(F,e),[F]);(0,x.useEffect)(()=>{if(!F||R(g))return;let e=se.find(R);if(!e)return;let t=window.setTimeout(()=>v(e),0);return()=>window.clearTimeout(t)},[F,g,R]);let z=R(g),B=g===`provider`?`${e}/api/debug/logs`:g===`usage`?`${e}/api/debug/usage-logs`:`${e}/api/debug/injection-logs`,V=(0,x.useCallback)(async(e,t)=>{let n=++k.current;if(!z){n===k.current&&(S([]),D.current=0);return}E(!0);try{let r=new URLSearchParams({limit:`500`});!e&&D.current>0&&r.set(`after`,String(D.current));let i=await fetch(`${B}?${r}`,{signal:t});if(!i.ok||t?.aborted||n!==k.current)return;let a=await i.json();if(t?.aborted||n!==k.current||a.length===0)return;S(t=>(e?a:[...t,...a]).slice(-2e3)),D.current=a[a.length-1].seq}catch{}finally{n===k.current&&E(!1)}},[B,z]);(0,x.useEffect)(()=>{if(!n)return;let t=`${e}:${g}:${z}`,r=M.current!==t;if(M.current=t,!r&&b.length>0)return;D.current=0;let i=new AbortController,a=window.setTimeout(()=>{r&&S([]),V(!0,i.signal)},0);return()=>{window.clearTimeout(a),k.current+=1,i.abort()}},[n,e,g,z]);let H=(0,x.useRef)(!1),te=(0,x.useEffectEvent)(()=>{if(H.current)return;H.current=!0;let e=h(1e4);V(!1,e.signal).finally(()=>{e.clear(),H.current=!1})});(0,x.useEffect)(()=>{if(!(!n||!C||!z))return u(()=>te(),1e3)},[n,C,z]),(0,x.useEffect)(()=>{C&&b.length>0&&L.scrollToIndex(b.length-1,{align:`end`})},[b,C,L]);let U=async t=>{let n=++O.current;f(!0);let r=async()=>{try{let r=await fetch(`${e}/api/debug`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify(t)});if(!r.ok)return;let i=await r.json();if(n!==O.current)return;p(a,i),d(c,i)}catch{}},i=(A.current??Promise.resolve()).then(r,r);A.current=i.then(()=>void 0,()=>void 0);try{await i}finally{n===O.current&&f(!1)}},W=async(e,t)=>{await U({[e]:t})},G=async()=>{await U({reset:!0})};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(he,{embedded:t,refreshing:T,streamEnabled:z,follow:C,onRefresh:()=>void V(!0),onFollowChange:w}),!F&&P.showError?(0,X.jsxs)(`div`,{className:`notice notice-err`,role:`alert`,children:[(0,X.jsx)(`span`,{children:r(`debug.loadFailed`)}),(0,X.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>N.refresh(),children:r(`common.retry`)})]}):P.showSkeleton&&!F?(0,X.jsx)(ee,{label:r(`debug.loading`),rows:3}):F?(0,X.jsx)(me,{debug:F,debugBusy:l,stream:g,onSetFlag:(e,t)=>{W(e,t)},onReset:()=>{G()},onStreamChange:v}):null,F&&P.showError&&(0,X.jsx)(o,{tone:`err`,children:r(`debug.loadFailed`)}),F?.claude&&(0,X.jsx)(fe,{entries:I}),(0,X.jsx)(pe,{debug:!!F,stream:g,streamEnabled:z,entries:b,scrollContainerRef:j,lineVirtualizer:L})]})}function ve({filters:e,options:t,hasActiveFilters:n,filteredCount:r,totalCount:i,t:o,onFilterChange:s,onResetFilters:c}){let l=e.maxTokPerSec===15?`slow`:e.minTokPerSec===15&&e.maxTokPerSec===50?`medium`:e.minTokPerSec===50?`fast`:`all`,u=t=>{s(t===`slow`?{...e,minTokPerSec:void 0,maxTokPerSec:15}:t===`medium`?{...e,minTokPerSec:15,maxTokPerSec:50}:t===`fast`?{...e,minTokPerSec:50,maxTokPerSec:void 0}:{...e,minTokPerSec:void 0,maxTokPerSec:void 0})};return(0,X.jsxs)(`div`,{className:`logs-filter-container`,children:[(0,X.jsxs)(`div`,{className:`logs-toolbar`,children:[(0,X.jsx)(`span`,{className:`muted text-control`,children:o(`logs.filter.surface.label`)}),(0,X.jsx)(`div`,{className:`segmented logs-segmented`,role:`radiogroup`,"aria-label":o(`logs.filter.surface.label`),children:[`all`,`claude`,`codex`,`grok`].map(t=>(0,X.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":e.surface===t,className:`btn btn-sm${e.surface===t?` btn-primary`:` btn-ghost`}`,style:{background:e.surface===t?void 0:`transparent`,color:e.surface===t?void 0:`var(--muted)`},onClick:()=>s({...e,surface:t}),children:o(`logs.filter.surface.${t}`)},t))}),(0,X.jsxs)(`label`,{className:`muted text-control logs-filter-field`,children:[o(`logs.filter.provider.label`),(0,X.jsxs)(`select`,{className:`input select-sm`,value:e.provider,"aria-label":o(`logs.filter.provider.label`),onChange:t=>s({...e,provider:t.target.value}),children:[(0,X.jsx)(`option`,{value:``,children:o(`logs.filter.provider.all`)}),t.providers.map(e=>(0,X.jsx)(`option`,{value:e,children:a(e,o)},e))]})]}),(0,X.jsxs)(`label`,{className:`muted text-control logs-filter-field`,children:[o(`logs.filter.agent.label`),(0,X.jsxs)(`select`,{className:`input select-sm`,value:e.agentKind,"aria-label":o(`logs.filter.agent.label`),onChange:t=>s({...e,agentKind:t.target.value}),children:[(0,X.jsx)(`option`,{value:`all`,children:o(`logs.filter.agent.all`)}),(0,X.jsx)(`option`,{value:`main`,children:o(`logs.filter.agent.main`)}),(0,X.jsx)(`option`,{value:`subagent`,children:o(`logs.filter.agent.subagent`)}),(0,X.jsx)(`option`,{value:`internal`,children:o(`logs.filter.agent.internal`)}),(0,X.jsx)(`option`,{value:`unknown`,children:o(`logs.filter.agent.unknown`)})]})]}),(0,X.jsxs)(`label`,{className:`muted text-control logs-filter-field`,children:[o(`logs.filter.model.label`),(0,X.jsxs)(`select`,{className:`input select-sm`,value:e.model,"aria-label":o(`logs.filter.model.label`),onChange:t=>s({...e,model:t.target.value}),children:[(0,X.jsx)(`option`,{value:``,children:o(`logs.filter.model.all`)}),t.models.map(e=>(0,X.jsx)(`option`,{value:e,children:e},e))]})]}),(0,X.jsxs)(`label`,{className:`muted text-control logs-filter-field`,children:[o(`logs.filter.time.label`),(0,X.jsxs)(`select`,{className:`input select-sm`,value:e.timeWindow,"aria-label":o(`logs.filter.time.label`),onChange:t=>s({...e,timeWindow:t.target.value}),children:[(0,X.jsx)(`option`,{value:`all`,children:o(`logs.filter.time.all`)}),(0,X.jsx)(`option`,{value:`15m`,children:o(`logs.filter.time.15m`)}),(0,X.jsx)(`option`,{value:`1h`,children:o(`logs.filter.time.1h`)}),(0,X.jsx)(`option`,{value:`24h`,children:o(`logs.filter.time.24h`)})]})]}),(0,X.jsxs)(`label`,{className:`muted text-control logs-filter-field`,children:[o(`logs.filter.speed.label`),(0,X.jsxs)(`select`,{className:`input select-sm`,value:l,"aria-label":o(`logs.filter.speed.label`),onChange:e=>u(e.target.value),children:[(0,X.jsx)(`option`,{value:`all`,children:o(`logs.filter.speed.all`)}),(0,X.jsx)(`option`,{value:`slow`,children:o(`logs.filter.speed.slow`)}),(0,X.jsx)(`option`,{value:`medium`,children:o(`logs.filter.speed.medium`)}),(0,X.jsx)(`option`,{value:`fast`,children:o(`logs.filter.speed.fast`)})]})]}),(0,X.jsxs)(`label`,{className:`muted text-control logs-filter-field`,children:[o(`logs.filter.status.label`),(0,X.jsxs)(`select`,{className:`input select-sm`,value:e.statusFilter,"aria-label":o(`logs.filter.status.label`),onChange:t=>s({...e,statusFilter:t.target.value}),children:[(0,X.jsx)(`option`,{value:`all`,children:o(`logs.filter.status.all`)}),(0,X.jsx)(`option`,{value:`success`,children:o(`logs.filter.status.success`)}),(0,X.jsx)(`option`,{value:`errors`,children:o(`logs.filter.status.errors`)})]})]})]}),(0,X.jsxs)(`div`,{className:`logs-toolbar logs-toolbar-secondary`,children:[(0,X.jsxs)(`label`,{className:`muted text-control logs-filter-field`,children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:e.interceptedHelpersOnly,onChange:t=>s({...e,interceptedHelpersOnly:t.target.checked})}),o(`logs.filter.interceptedHelpersOnly`)]}),(0,X.jsxs)(`label`,{className:`muted text-control logs-filter-field`,children:[o(`logs.filter.conversation.label`),(0,X.jsx)(`input`,{type:`search`,className:`input mono select-sm`,value:e.conversationId,onChange:t=>s({...e,conversationId:t.target.value}),placeholder:o(`logs.filter.conversation.placeholder`),"aria-label":o(`logs.filter.conversation.label`)})]}),n&&(0,X.jsxs)(`div`,{className:`logs-filter-status`,children:[(0,X.jsx)(`span`,{className:`muted text-control`,children:o(`logs.filter.showingCount`,{count:r,total:i})}),(0,X.jsxs)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:c,children:[(0,X.jsx)(v,{}),` `,o(`logs.filter.reset`)]})]})]})]})}function ye(e,t){return t===`all`?!0:t===`claude`?e.surface===`claude`||e.surface===`claude-desktop`:t===`grok`?e.surface===`grok`:e.surface===void 0}function be(e){return e===`main`||e===`subagent`||e===`internal`?e:`unknown`}var xe={surface:`all`,model:``,provider:``,agentKind:`all`,statusFilter:`all`,timeWindow:`all`,interceptedHelpersOnly:!1,conversationId:``};function Se(e){return e.surface!==`all`||e.model!==``||e.provider!==``||e.agentKind!==`all`||e.statusFilter!==`all`||e.timeWindow!==`all`||e.minTokPerSec!==void 0||e.maxTokPerSec!==void 0||e.interceptedHelpersOnly||e.conversationId.trim()!==``}function Ce(e,t,n=Date.now()){let r=t.model.trim().toLowerCase(),i=t.provider.trim().toLowerCase(),a=t.conversationId.trim(),o=0;return t.timeWindow===`15m`?o=n-9e5:t.timeWindow===`1h`?o=n-36e5:t.timeWindow===`24h`&&(o=n-864e5),e.filter(e=>{if(!ye(e,t.surface)||t.agentKind!==`all`&&be(e.agentKind)!==t.agentKind||t.interceptedHelpersOnly&&!e.shadowCallRewrittenFrom&&e.shadowCallSource!==`agent-helper`||a&&!J(e.conversationId,a,t.conversationQueryHash)||t.statusFilter===`success`&&(typeof e.status!=`number`||e.status<200||e.status>=300)||t.statusFilter===`errors`&&(typeof e.status!=`number`||e.status<400)||r&&!(e.model?.toLowerCase()===r||e.resolvedModel?.toLowerCase()===r||e.attempts?.some(e=>e.model?.toLowerCase()===r))||i&&!(e.provider?.toLowerCase()===i||e.attempts?.some(e=>e.provider?.toLowerCase()===i))||o>0&&typeof e.timestamp==`number`&&e.timestamp<o)return!1;let n=e.displayMetrics?.tokPerSecond?.kind===`value`?e.displayMetrics.tokPerSecond.value:void 0;return!(t.minTokPerSec!==void 0&&(n===void 0||n<t.minTokPerSec)||t.maxTokPerSec!==void 0&&(n===void 0||n>t.maxTokPerSec))})}function we(e){let t=new Set,n=new Set;for(let r of e)if(r.model&&t.add(r.model),r.resolvedModel&&t.add(r.resolvedModel),r.provider&&n.add(r.provider),r.attempts)for(let e of r.attempts)e.model&&t.add(e.model),e.provider&&n.add(e.provider);return{models:Array.from(t).sort(),providers:Array.from(n).sort()}}function Z(){return window.location.hash.replace(/^#\/?/,``)===`logs/debug`?`debug`:`logs`}function Te(e){window.location.hash=e===`debug`?`logs/debug`:`logs`}function Ee(e){e.key===`ArrowLeft`||e.key===`Home`?(e.preventDefault(),Te(`logs`),document.getElementById(`logs-tab-logs`)?.focus()):(e.key===`ArrowRight`||e.key===`End`)&&(e.preventDefault(),Te(`debug`),document.getElementById(`logs-tab-debug`)?.focus())}function De(e,t){return[`${t(`logs.modelTooltip.model`)}=${e.model}`,e.resolvedModel?`${t(`logs.modelTooltip.resolvedModel`)}=${e.resolvedModel}`:void 0,e.requestedServiceTier?`${t(`logs.modelTooltip.requestedTier`)}=${e.requestedServiceTier}`:void 0,e.configuredServiceTier?`${t(`logs.modelTooltip.configuredTier`)}=${e.configuredServiceTier}`:void 0,e.responseServiceTier?`${t(`logs.modelTooltip.responseTier`)}=${e.responseServiceTier}`:void 0,e.modelSupportsServiceTier===void 0?void 0:`${t(`logs.modelTooltip.supportsTier`)}=${e.modelSupportsServiceTier}`].filter(Boolean).join(` · `)}function Oe(e){return e.requestedSpeedLabel||void 0}function Q(e,t,n,r=!1){if(!Number.isFinite(e)||e<0)return t(`logs.cost.unavailable`);let i=new Intl.NumberFormat(n,{style:`currency`,currency:`USD`,minimumFractionDigits:4,maximumFractionDigits:4}).format(e);return t(r?`logs.cost.lowerBound`:`logs.cost.approximate`,{amount:i})}function ke(e,t,n){return!e||e.kind===`unavailable`?t(`logs.cost.unavailable`):Q(e.estimate.cost.total,t,n,e.estimate.priorityLowerBound)}function Ae(e){let t=0,n=!0,r=0,i=0,a=0;for(let o of e){if(o.usageStatus===`unsupported`){a+=1;continue}let e=o.displayMetrics?.cost;if(e?.kind===`value`){let i=e.estimate.cost.total;if(Number.isFinite(i)&&i>=0){t+=i,r+=1,n&&=e.estimate.priorityLowerBound===!0;continue}}i+=1}return{estimatedCostUsd:t,priorityLowerBound:r>0&&n,unpricedRequests:i,unmeteredRequests:a}}function je(e){return e===`cursor`||e.startsWith(`cursor-`)}function Me(e){let t=e.usage;if(!t)return{};let n=typeof t.cacheCreationInputTokens==`number`?t.cacheCreationInputTokens:void 0;return{read:typeof t.cacheReadInputTokens==`number`?t.cacheReadInputTokens:typeof t.cachedInputTokens==`number`&&n!==void 0?Math.max(0,t.cachedInputTokens-n):t.cachedInputTokens,write:n}}function Ne(e,t){if(!e.usage)return;let n=Me(e),r=[`${t(`logs.tokens.input`)}=${e.usage.inputTokens}`,`${t(`logs.tokens.output`)}=${e.usage.outputTokens}`];return n.read!==void 0&&r.push(`${t(`logs.tokens.cacheRead`)}=${n.read}`),n.write!==void 0&&r.push(`${t(`logs.tokens.cacheWrite`)}=${n.write}`),typeof e.usage.contextTotalTokens==`number`&&r.push(`${t(`logs.tokens.contextTotal`)}=${e.usage.contextTotalTokens}`),typeof e.usage.reasoningOutputTokens==`number`&&r.push(`${t(`logs.tokens.reasoning`)}=${e.usage.reasoningOutputTokens}`),e.usageStatus===`estimated`&&r.push(t(`logs.tokens.estimatedNote`)),e.usageStatus===`estimated`&&n.read===void 0&&n.write===void 0&&r.push(t(je(e.provider)?`logs.tokens.noCacheCursorNote`:`logs.tokens.noCacheNote`)),r.join(` · `)}function $(e){return e===void 0||typeof e==`string`}function Pe(e){if(e===void 0)return!0;if(!e||typeof e!=`object`||!$(e.routeKind)||e.profile!==void 0&&(!e.profile||typeof e.profile!=`object`||!$(e.profile.id)||!$(e.profile.revision))||e.selected!==void 0&&(!e.selected||typeof e.selected!=`object`||!$(e.selected.provider)||!$(e.selected.model)||!$(e.selected.reason)))return!1;if(e.candidates===void 0)return!0;if(!Array.isArray(e.candidates))return!1;for(let t of e.candidates){if(!t||typeof t!=`object`||!$(t.provider)||!$(t.model)||t.eligible!==void 0&&typeof t.eligible!=`boolean`)return!1;if(t.exclusions!==void 0){if(!Array.isArray(t.exclusions))return!1;for(let e of t.exclusions)if(!e||typeof e!=`object`||!$(e.code))return!1}}return!0}function Fe(e){if(e.routeDecision===void 0||Pe(e.routeDecision))return e;let t={...e};return delete t.routeDecision,t}function Ie(e){return`ocx.logs.list.v1:${e}`}var Le=[];function Re(e){return{main:`logs.agent.main`,subagent:`logs.agent.subagent`,internal:`logs.agent.internal`,unknown:`logs.agent.unknown`}[be(e)]}function ze({kind:e,t}){return(0,X.jsx)(`span`,{className:`badge badge-muted`,title:t(`logs.agent.badgeTitle`),children:t(Re(e))})}function Be(e){if(!Array.isArray(e))return null;for(let t of e)if(!t||typeof t!=`object`||typeof t.timestamp!=`number`||typeof t.model!=`string`||typeof t.provider!=`string`||typeof t.status!=`number`||typeof t.durationMs!=`number`||t.shadowCallRewrittenFrom!==void 0&&typeof t.shadowCallRewrittenFrom!=`string`||!Pe(t.routeDecision))return null;return e}function Ve(e){if(!e.usage)return typeof e.totalTokens==`number`?e.totalTokens:void 0;let t=e.usage.inputTokens+e.usage.outputTokens,n=e.usage.totalTokens??e.totalTokens;return typeof n==`number`?Math.max(n,t):t}function He(e){let t=Ve(e),n=e.usage?.contextTotalTokens;return typeof n==`number`?Math.max(t??0,n)||void 0:t}function Ue(e){let t=e.requestedEffort?.replace(/\s*->\s*/g,` → `),n=e.effectiveEffort;return t?!n||t===n||t.split(` → `).at(-1)===n?t:`${t} → ${n}`:n??`-`}function We(e){if(!(!e.reasoningWireField||e.reasoningWireValue===void 0))return`${e.reasoningWireField}=${e.reasoningWireValue}`}function Ge(e,t){if(!e||e.kind===`unavailable`||!Number.isFinite(e.value)||e.value<=0)return`—`;let n=e.value>=100?0:1,r=new Intl.NumberFormat(t,{minimumFractionDigits:n,maximumFractionDigits:n}).format(e.value);return`${e.estimated?`~`:``}${r}`}var Ke=3,qe={usage_missing:`logs.detail.reason.usage_missing`,usage_unsupported:`logs.detail.reason.usage_unsupported`,output_missing:`logs.detail.reason.output_missing`,invalid_duration:`logs.detail.reason.invalid_duration`,price_unmatched:`logs.detail.reason.price_unmatched`,invalid_cache_breakdown:`logs.detail.reason.invalid_cache_breakdown`,invalid_usage:`logs.detail.reason.invalid_usage`,combo_attempt_unavailable:`logs.detail.reason.combo_attempt_unavailable`},Je={usage_estimated:`logs.detail.estimate.usage_estimated`,cache_detail_missing:`logs.detail.estimate.cache_detail_missing`,expected_price_overlay:`logs.detail.estimate.expected_price_overlay`,provider_cost_overlay:`logs.detail.estimate.provider_cost_overlay`,priority_lower_bound:`logs.detail.estimate.priority_lower_bound`},Ye={"transient-5xx":`logs.detail.attempt.recovery.transient5xx`,"connection-reset":`logs.detail.attempt.recovery.connectionReset`,"oauth-401":`logs.detail.attempt.recovery.oauth401`,"key-429":`logs.detail.attempt.recovery.key429`,"rate-limit-429":`logs.detail.attempt.recovery.rateLimit429`,"anthropic-oauth-429":`logs.detail.attempt.recovery.anthropicOauth429`,"image-413":`logs.detail.attempt.recovery.image413`,"empty-completion":`logs.detail.attempt.recovery.emptyCompletion`};function Xe(e){return qe[e]}function Ze(e){return Je[e]}function Qe(e){return Ye[e]??`logs.detail.attempt.recovery.unknown`}function $e(e){return e===`verified`?`logs.detail.verification.verified`:`logs.detail.verification.derived`}function et(e){return e>=200&&e<300?`var(--green)`:e>=400?`var(--red)`:`var(--amber)`}function tt(e,t,n){let r=n?{timeZone:n}:void 0;try{return{date:new Date(e).toLocaleDateString(t,r),time:new Date(e).toLocaleTimeString(t,r)}}catch{return{date:new Date(e).toLocaleDateString(t),time:new Date(e).toLocaleTimeString(t)}}}function nt(e,t,n){let{date:r,time:i}=tt(e,t,n);return`${r} ${i}`}function rt(e){let t=0;for(let n of e){let e=Ve(n);e!==void 0&&(t+=e)}return{requests:e.length,totalTokens:t,...Ae(e)}}function it({apiBase:e}){let{t,locale:n}=i(),s=Ie(e),l=Be(m(s)),[u,d]=(0,x.useState)(!0),[f,h]=(0,x.useState)(null),[_,v]=(0,x.useState)(xe),S=(0,x.useRef)(null),C=r.find(e=>e.code===n)?.htmlLang,[w,T]=(0,x.useState)();(0,x.useEffect)(()=>{let t=new AbortController,n=!1;return fetch(`${e}/api/settings`,{signal:t.signal}).then(e=>e.ok?e.json():null).then(e=>{n||!e||typeof e.timeZone==`string`&&e.timeZone.trim()&&T(e.timeZone.trim())}).catch(()=>{}),()=>{n=!0,t.abort()}},[e]);let[E,D]=(0,x.useState)(Z),[O,k]=(0,x.useState)(()=>Z()===`debug`);(0,x.useEffect)(()=>{let e=()=>D(Z());return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]),(0,x.useEffect)(()=>{E===`debug`&&k(!0)},[E]);let A=Te,j=(0,x.useCallback)(async t=>{let n=await fetch(`${e}/api/logs?limit=2000`,{signal:t});if(!n.ok)throw Error(`${n.status} ${n.statusText}`.trim());let r=await n.json(),i=(Array.isArray(r)?r:r.logs??[]).map(Fe);return p(s,i),i},[e,s]),M=y(s,[e],j,{isEmpty:e=>e.length===0,enabled:E===`logs`,pollMs:u?2e3:void 0,initialData:l??void 0}),N=M.state,P=N.data??l??Le,F=M.refresh,I=!M.refreshing&&N.showError,L=!M.refreshing&&!N.showError&&N.data!==void 0,[R,z]=(0,x.useState)({error:null,count:0});L&&R.count!==0?z({error:null,count:0}):I&&R.error!==N.error&&z(e=>({error:N.error,count:e.count+1}));let B=R.count>=Ke||!u&&I,V=f?oe(f.status,n):null,H=_.conversationId.trim();(0,x.useEffect)(()=>{let e=!1;if(!H){v(e=>e.conversationQueryHash===void 0?e:{...e,conversationQueryHash:void 0});return}return re(H).then(t=>{e||v(e=>e.conversationQueryHash===t?e:{...e,conversationQueryHash:t})}),()=>{e=!0}},[H]);let te=(0,x.useMemo)(()=>we(P),[P]),U=Se(_),W=(0,x.useMemo)(()=>Ce(P,_),[P,_]),G=H?rt(W):null,K=ne({count:W.length,getScrollElement:()=>S.current,estimateSize:()=>44,overscan:15}),q=K.getVirtualItems(),J=q.length>0?q[0].start:0,Y=q.length>0?K.getTotalSize()-q[q.length-1].end:0;return(0,X.jsxs)(`div`,{className:`logs-page`,children:[(0,X.jsxs)(`div`,{className:`page-head`,children:[(0,X.jsx)(`h2`,{children:t(`nav.logs`)}),E===`logs`&&(0,X.jsxs)(`label`,{className:`muted text-control logs-auto-refresh`,children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:u,onChange:e=>d(e.target.checked)}),t(`logs.autoRefresh`)]})]}),(0,X.jsxs)(`div`,{className:`page-tabs`,role:`tablist`,"aria-label":t(`nav.logs`),children:[(0,X.jsx)(`button`,{type:`button`,role:`tab`,id:`logs-tab-logs`,"aria-selected":E===`logs`,"aria-controls":`logs-panel-logs`,tabIndex:E===`logs`?0:-1,className:`page-tab${E===`logs`?` page-tab--active`:``}`,onClick:()=>A(`logs`),onKeyDown:Ee,children:t(`logs.tabLogs`)}),(0,X.jsx)(`button`,{type:`button`,role:`tab`,id:`logs-tab-debug`,"aria-selected":E===`debug`,"aria-controls":`logs-panel-debug`,tabIndex:E===`debug`?0:-1,className:`page-tab${E===`debug`?` page-tab--active`:``}`,onClick:()=>A(`debug`),onKeyDown:Ee,children:t(`logs.tabDebug`)})]}),O&&(0,X.jsx)(`div`,{role:`tabpanel`,id:`logs-panel-debug`,"aria-labelledby":`logs-tab-debug`,hidden:E!==`debug`,children:(0,X.jsx)(_e,{apiBase:e,embedded:!0,active:E===`debug`})}),(0,X.jsxs)(`div`,{role:`tabpanel`,id:`logs-panel-logs`,"aria-labelledby":`logs-tab-logs`,hidden:E!==`logs`,children:[(0,X.jsx)(`p`,{className:`page-sub`,children:t(`logs.subtitle`)}),(0,X.jsx)(ve,{filters:_,options:te,hasActiveFilters:U,filteredCount:W.length,totalCount:P.length,t,onFilterChange:v,onResetFilters:()=>v(xe)}),G&&(0,X.jsx)(`div`,{className:`logs-conversation-totals`,children:(0,X.jsxs)(o,{tone:`ok`,children:[t(`logs.conversation.totals`,{requests:G.requests,tokens:g(G.totalTokens,C??n),cost:Q(G.estimatedCostUsd,t,C,G.priorityLowerBound)}),` `,(0,X.jsxs)(`span`,{className:`muted`,children:[t(`logs.conversation.scope`),G.unpricedRequests+G.unmeteredRequests>0?` ${t(`logs.conversation.excluded`,{unpriced:G.unpricedRequests,unmetered:G.unmeteredRequests})}`:``]})]})}),N.kind===`failed-cold`&&(0,X.jsxs)(o,{tone:`err`,children:[N.error instanceof Error?`${t(`logs.loadError`)} ${N.error.message}`:t(`logs.loadError`),` `,(0,X.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>F({forceLoading:!0}),disabled:N.refreshing,children:t(`common.retry`)})]}),B&&P.length>0&&(0,X.jsxs)(o,{tone:`err`,children:[t(`logs.loadError`),` `,(0,X.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>F({forceLoading:!0}),disabled:M.refreshing,children:t(`common.retry`)})]}),N.kind===`failed-cold`?null:N.showSkeleton&&P.length===0?(0,X.jsx)(ee,{label:t(`common.loading`),rows:6}):W.length===0?(0,X.jsx)(c,{title:t(`logs.noRequests`)}):(0,X.jsx)(X.Fragment,{children:(0,X.jsx)(`div`,{ref:S,className:`tbl-wrap logs-table-wrap`,children:(0,X.jsxs)(`table`,{className:`tbl logs-table`,children:[(0,X.jsx)(`thead`,{children:(0,X.jsxs)(`tr`,{children:[(0,X.jsx)(`th`,{children:t(`logs.col.time`)}),(0,X.jsx)(`th`,{className:`num log-col-tokens`,children:t(`logs.col.tokens`)}),(0,X.jsx)(`th`,{className:`num log-col-rate`,title:t(`logs.metric.tokPerSecTitle`),children:t(`logs.col.tokPerSec`)}),(0,X.jsx)(`th`,{className:`num log-col-cost`,title:t(`logs.metric.estimatedCostTitle`),children:t(`logs.col.estimatedCost`)}),(0,X.jsx)(`th`,{className:`log-col-model`,children:t(`logs.col.model`)}),(0,X.jsx)(`th`,{children:t(`logs.col.effort`)}),(0,X.jsx)(`th`,{children:t(`logs.col.provider`)}),(0,X.jsx)(`th`,{children:t(`logs.col.status`)}),(0,X.jsx)(`th`,{children:t(`logs.col.request`)}),(0,X.jsx)(`th`,{className:`num log-col-duration`,children:t(`logs.col.duration`)})]})}),(0,X.jsxs)(`tbody`,{children:[J>0&&(0,X.jsx)(`tr`,{children:(0,X.jsx)(`td`,{colSpan:10,className:`logs-virtual-spacer`,style:{height:J}})}),q.map(e=>{let r=W[W.length-1-e.index],i=We(r),o=tt(r.timestamp,C,w);return(0,X.jsxs)(`tr`,{"data-index":e.index,ref:K.measureElement,children:[(0,X.jsx)(`td`,{className:`muted mono log-col-time`,children:(0,X.jsxs)(`span`,{className:`logs-stack-start`,children:[(0,X.jsx)(`span`,{children:o.date}),(0,X.jsx)(`span`,{children:o.time})]})}),(0,X.jsx)(`td`,{className:`num mono log-col-tokens`,title:Ne(r,t),children:(()=>{let e=He(r),{read:i,write:a}=Me(r);return e===void 0?(0,X.jsx)(`span`,{className:`muted`,children:t(`logs.tokens.${r.usageStatus??`unreported`}`)}):(0,X.jsxs)(`span`,{className:`logs-stack-end`,children:[(0,X.jsxs)(`span`,{children:[r.usageStatus===`estimated`?`~`:``,g(e,n)]}),i!==void 0&&i>0&&(0,X.jsxs)(`span`,{className:`muted text-caption leading-tight`,children:[`c `,g(i,n)]}),a!==void 0&&a>0&&(0,X.jsxs)(`span`,{className:`muted text-caption leading-tight`,children:[`w `,g(a,n)]}),r.usageStatus===`estimated`&&i===void 0&&a===void 0&&(0,X.jsx)(`span`,{className:`muted text-caption leading-tight`,children:t(je(r.provider)?`logs.tokens.noCacheCursor`:`logs.tokens.noCache`)})]})})()}),(0,X.jsx)(`td`,{className:`num mono log-col-rate`,children:Ge(r.displayMetrics?.tokPerSecond,C)}),(0,X.jsx)(`td`,{className:`num mono log-col-cost`,children:ke(r.displayMetrics?.cost,t,C)}),(0,X.jsx)(`td`,{className:`mono log-col-model`,title:De(r,t),children:(0,X.jsxs)(`span`,{className:`logs-model-cell`,children:[(0,X.jsx)(`span`,{children:b(r.resolvedModel??r.model)}),(0,X.jsx)(ze,{kind:r.agentKind,t}),r.shadowCallRewrittenFrom&&(0,X.jsx)(`span`,{className:`badge badge-muted`,style:{whiteSpace:`nowrap`},title:t(`logs.badge.interceptedHelperTitle`),children:t(`logs.badge.interceptedHelper`,{model:r.shadowCallRewrittenFrom})}),(r.surface===`claude`||r.surface===`claude-desktop`)&&(0,X.jsx)(`span`,{className:`badge badge-accent`,children:t(`logs.badge.claude`)}),r.surface===`grok`&&(0,X.jsx)(`span`,{className:`badge badge-accent`,children:t(`logs.badge.grok`)}),Oe(r)&&(0,X.jsx)(`span`,{className:`badge badge-amber`,children:Oe(r)})]})}),(0,X.jsx)(`td`,{className:`mono log-reasoning-cell`,title:i,children:(0,X.jsxs)(`span`,{className:`logs-stack-start`,children:[(0,X.jsx)(`span`,{children:Ue(r)}),i&&(0,X.jsx)(`span`,{className:`muted text-caption leading-tight`,children:i})]})}),(0,X.jsx)(`td`,{className:`muted`,children:a(r.provider,t)}),(0,X.jsx)(`td`,{children:(0,X.jsxs)(`span`,{className:`log-status-cell`,children:[(0,X.jsx)(`span`,{className:`mono font-semibold`,style:{color:et(r.status)},children:r.status}),(0,X.jsx)(`button`,{type:`button`,className:`log-detail-btn`,onClick:()=>h(r),"aria-label":`${t(`logs.details`)}: ${r.requestId??r.status}`,children:t(`logs.details`)})]})}),(0,X.jsx)(`td`,{className:`muted mono`,children:(0,X.jsx)(`span`,{className:`log-reqid`,title:r.requestId,children:r.requestId??`-`})}),(0,X.jsxs)(`td`,{className:`num log-col-duration`,children:[r.durationMs,`ms`]})]},r.requestId??`${r.timestamp}-${e.index}`)}),Y>0&&(0,X.jsx)(`tr`,{children:(0,X.jsx)(`td`,{colSpan:10,className:`logs-virtual-spacer`,style:{height:Y}})})]})]})})}),f&&(0,X.jsx)(ot,{detail:f,detailInfo:V,localeCode:n,localeTag:C,serverTimeZone:w,t,onClose:()=>h(null),onFilterConversation:e=>{v(t=>({...t,conversationId:e})),h(null)}})]})]})}function at(e){let t=(0,x.useRef)(null);return(0,x.useEffect)(()=>{let n=t.current;n&&(e&&!n.open?n.showModal():!e&&n.open&&n.close())},[e]),t}function ot({detail:e,detailInfo:t,localeCode:n,localeTag:r,serverTimeZone:i,t:o,onClose:s,onFilterConversation:c}){let l=at(!0),[u,d]=(0,x.useState)(!1),f=Me(e),p=e.displayMetrics?.cost,m=We(e),h=async()=>{if(e.requestId)try{await navigator.clipboard.writeText(e.requestId),d(!0),window.setTimeout(()=>d(!1),1200)}catch{}};return(0,X.jsxs)(`dialog`,{ref:l,className:`modal-overlay`,"aria-labelledby":`log-detail-title`,onCancel:e=>{e.preventDefault(),s()},children:[(0,X.jsx)(`button`,{type:`button`,className:`modal-backdrop-dismiss`,"aria-label":o(`common.close`),tabIndex:-1,onClick:s}),(0,X.jsxs)(`div`,{className:`modal-card log-detail-card`,onClick:e=>e.stopPropagation(),role:`document`,children:[(0,X.jsxs)(`div`,{className:`modal-head`,children:[(0,X.jsxs)(`h3`,{id:`log-detail-title`,children:[(0,X.jsx)(`span`,{className:`mono`,style:{color:et(e.status)},children:e.status}),t&&(0,X.jsx)(`span`,{className:`logs-detail-info`,children:t.label})]}),(0,X.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:s,"aria-label":o(`common.cancel`),children:(0,X.jsx)(v,{})})]}),t&&(0,X.jsx)(`p`,{className:`modal-desc`,children:t.description}),(0,X.jsxs)(`section`,{className:`log-detail-section`,"aria-labelledby":`log-detail-basic`,children:[(0,X.jsx)(`h4`,{id:`log-detail-basic`,className:`log-detail-section-title`,children:o(`logs.detail.section.basic`)}),(0,X.jsxs)(`div`,{className:`log-detail-grid`,children:[(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.col.time`)}),(0,X.jsx)(`span`,{className:`mono`,children:nt(e.timestamp,r,i)}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.col.request`)}),(0,X.jsxs)(`span`,{className:`log-detail-request-row`,children:[(0,X.jsx)(`span`,{className:`mono log-detail-break`,children:e.requestId??`—`}),e.requestId&&(0,X.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>void h(),children:o(u?`logs.detail.copied`:`logs.detail.copyRequestId`)})]}),e.conversationId&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.detail.conversation`)}),(0,X.jsxs)(`span`,{className:`log-detail-request-row`,children:[(0,X.jsx)(`span`,{className:`mono log-detail-break`,children:e.conversationId}),c&&(0,X.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>c(e.conversationId),children:o(`logs.filter.conversation.apply`)})]})]}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.col.model`)}),(0,X.jsx)(`span`,{className:`mono`,children:b(e.resolvedModel??e.model)}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.col.provider`)}),(0,X.jsx)(`span`,{children:a(e.provider,o)}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.filter.agent.label`)}),(0,X.jsx)(ze,{kind:e.agentKind,t:o}),(e.requestedEffort||e.effectiveEffort)&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.col.effort`)}),(0,X.jsxs)(`span`,{className:`mono`,children:[Ue(e),m?` (${m})`:``]})]}),e.errorCode&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.col.error`)}),(0,X.jsx)(`span`,{className:`mono`,children:e.errorCode})]}),e.upstreamError&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.col.upstreamReason`)}),(0,X.jsx)(`span`,{className:`mono log-detail-break`,children:e.upstreamError})]})]})]}),(0,X.jsxs)(`section`,{className:`log-detail-section`,"aria-labelledby":`log-detail-route`,children:[(0,X.jsx)(`h4`,{id:`log-detail-route`,className:`log-detail-section-title`,children:o(`logs.detail.route.section`)}),e.routeDecision?(0,X.jsxs)(`div`,{className:`log-detail-grid`,children:[(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.detail.route.kind`)}),(0,X.jsx)(`span`,{className:`mono`,children:e.routeDecision.routeKind??`–`}),e.routeDecision.profile?.id&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.detail.route.profile`)}),(0,X.jsxs)(`span`,{className:`mono`,children:[e.routeDecision.profile.id,` (`,e.routeDecision.profile.revision,`)`]})]}),e.routeDecision.selected?.provider&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.detail.route.selected`)}),(0,X.jsxs)(`span`,{className:`mono`,children:[e.routeDecision.selected.provider,`/`,e.routeDecision.selected.model,e.routeDecision.selected.reason?` — ${e.routeDecision.selected.reason}`:``]})]}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.detail.route.candidates`)}),(0,X.jsx)(`span`,{className:`mono`,children:(e.routeDecision.candidates??[]).map(e=>`${typeof e.provider==`string`&&e.provider.length>0?e.provider:`–`}/${typeof e.model==`string`&&e.model.length>0?e.model:`–`}${e.eligible===!0?` ✓`:e.eligible===!1?` ✗`:` ?`}`).join(` `)||`–`})]}):(0,X.jsx)(`p`,{className:`log-detail-notes-line muted`,children:o(`logs.detail.route.unknown`)})]}),(0,X.jsxs)(`section`,{className:`log-detail-section`,"aria-labelledby":`log-detail-performance`,children:[(0,X.jsx)(`h4`,{id:`log-detail-performance`,className:`log-detail-section-title`,children:o(`logs.detail.section.performance`)}),(0,X.jsxs)(`div`,{className:`log-detail-grid`,children:[(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.col.duration`)}),(0,X.jsxs)(`span`,{className:`mono`,children:[e.durationMs,`ms`]}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.col.tokPerSec`)}),(0,X.jsx)(`span`,{className:`mono`,children:Ge(e.displayMetrics?.tokPerSecond,r)}),e.firstOutputMs!==void 0&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.detail.ttft`)}),(0,X.jsxs)(`span`,{className:`mono`,children:[e.firstOutputMs,`ms`]})]})]}),e.displayMetrics?.tokPerSecond.kind===`unavailable`&&(0,X.jsx)(`p`,{className:`log-detail-notes-line muted`,children:o(Xe(e.displayMetrics.tokPerSecond.reason))})]}),(0,X.jsxs)(`section`,{className:`log-detail-section`,"aria-labelledby":`log-detail-cost`,children:[(0,X.jsx)(`h4`,{id:`log-detail-cost`,className:`log-detail-section-title`,children:o(`logs.detail.section.cost`)}),(0,X.jsx)(`p`,{className:`log-detail-notes-line muted`,children:o(`usage.cost.disclaimer`)}),p?.kind===`value`?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`log-detail-grid`,children:[(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.detail.costTotal`)}),(0,X.jsx)(`span`,{className:`mono`,children:Q(p.estimate.cost.total,o,r,p.estimate.priorityLowerBound)}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.tokens.input`)}),(0,X.jsx)(`span`,{className:`mono`,children:Q(p.estimate.cost.input,o,r,p.estimate.priorityLowerBound)}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.tokens.cacheRead`)}),(0,X.jsx)(`span`,{className:`mono`,children:Q(p.estimate.cost.cacheRead,o,r,p.estimate.priorityLowerBound)}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.tokens.cacheWrite`)}),(0,X.jsx)(`span`,{className:`mono`,children:Q(p.estimate.cost.cacheWrite,o,r,p.estimate.priorityLowerBound)}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.tokens.output`)}),(0,X.jsx)(`span`,{className:`mono`,children:Q(p.estimate.cost.output,o,r,p.estimate.priorityLowerBound)}),p.estimate.price&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.detail.matchedKey`)}),(0,X.jsxs)(`span`,{className:`mono log-detail-break`,children:[p.estimate.price.jawcodeProvider??p.estimate.price.provider,`/`,p.estimate.price.modelId]}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.detail.priceSource`)}),(0,X.jsxs)(`span`,{children:[o(`logs.detail.source.${p.estimate.price.source}`),` · `,o($e(p.estimate.price.status))]})]})]}),p.estimateReasons.length>0&&(0,X.jsx)(`ul`,{className:`log-detail-notes`,children:p.estimateReasons.map(e=>(0,X.jsx)(`li`,{children:o(Ze(e))},e))})]}):(0,X.jsxs)(`div`,{className:`log-detail-grid`,children:[(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.detail.costTotal`)}),(0,X.jsx)(`span`,{className:`mono`,children:o(`logs.cost.unavailable`)}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.detail.unavailableReason`)}),(0,X.jsx)(`span`,{children:p?.kind===`unavailable`?o(Xe(p.reason)):o(`logs.detail.reason.usage_missing`)})]})]}),e.attempts?.length?(0,X.jsxs)(`section`,{className:`log-detail-section`,"aria-labelledby":`log-detail-attempts`,children:[(0,X.jsx)(`h4`,{id:`log-detail-attempts`,className:`log-detail-section-title`,children:o(`logs.detail.section.attempts`)}),(0,X.jsx)(`p`,{className:`log-detail-notes-line muted`,children:o(`logs.detail.attempt.e2eNote`)}),(0,X.jsx)(`div`,{className:`log-detail-attempts-wrap`,children:(0,X.jsxs)(`table`,{className:`tbl log-detail-attempts`,children:[(0,X.jsx)(`thead`,{children:(0,X.jsxs)(`tr`,{children:[(0,X.jsx)(`th`,{className:`num`,children:`#`}),(0,X.jsx)(`th`,{children:o(`logs.detail.attempt.target`)}),(0,X.jsx)(`th`,{className:`num`,children:o(`logs.col.duration`)}),(0,X.jsx)(`th`,{className:`num`,children:o(`logs.col.tokPerSec`)}),(0,X.jsx)(`th`,{className:`num`,children:o(`logs.col.estimatedCost`)}),(0,X.jsx)(`th`,{children:o(`logs.detail.attempt.reason`)})]})}),(0,X.jsx)(`tbody`,{children:e.attempts.toSorted((e,t)=>e.ordinal-t.ordinal).map(e=>{let t=e.displayMetrics?.cost,n=We(e),i=t?.kind===`value`?t.estimate.price:void 0,s=e.errorCode??(e.recoveryKinds.length?e.recoveryKinds.map(e=>o(Qe(e))).join(`, `):void 0)??(t?.kind===`unavailable`?o(Xe(t.reason)):o(`logs.detail.attempt.completed`));return(0,X.jsxs)(`tr`,{children:[(0,X.jsx)(`td`,{className:`num mono`,children:e.ordinal}),(0,X.jsxs)(`td`,{children:[(0,X.jsx)(`span`,{children:a(e.provider,o)}),(0,X.jsx)(`br`,{}),(0,X.jsx)(`span`,{className:`mono muted log-detail-break`,children:e.model}),(e.requestedEffort||e.effectiveEffort)&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`br`,{}),(0,X.jsxs)(`span`,{className:`mono muted text-caption log-detail-break`,children:[Ue(e),n?` (${n})`:``]})]}),i&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`br`,{}),(0,X.jsxs)(`span`,{className:`muted text-caption log-detail-break`,children:[i.jawcodeProvider??i.provider,`/`,i.modelId,` · `,o(`logs.detail.source.${i.source}`),` · `,o($e(i.status))]})]})]}),(0,X.jsxs)(`td`,{className:`num mono`,children:[e.durationMs,`ms`]}),(0,X.jsx)(`td`,{className:`num mono`,children:Ge(e.displayMetrics?.tokPerSecond,r)}),(0,X.jsx)(`td`,{className:`num mono`,children:ke(t,o,r)}),(0,X.jsx)(`td`,{className:`log-detail-break`,children:s})]},`${e.ordinal}-${e.provider}-${e.model}`)})})]})})]}):null,(0,X.jsxs)(`section`,{className:`log-detail-section`,"aria-labelledby":`log-detail-usage`,children:[(0,X.jsx)(`h4`,{id:`log-detail-usage`,className:`log-detail-section-title`,children:o(`logs.detail.section.usage`)}),(0,X.jsxs)(`div`,{className:`log-detail-grid`,children:[(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.tokens.input`)}),(0,X.jsx)(`span`,{className:`mono`,children:e.usage?g(e.usage.inputTokens,n):`—`}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.tokens.output`)}),(0,X.jsx)(`span`,{className:`mono`,children:e.usage?g(e.usage.outputTokens,n):`—`}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.tokens.cacheRead`)}),(0,X.jsx)(`span`,{className:`mono`,children:f.read===void 0?`—`:g(f.read,n)}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.tokens.cacheWrite`)}),(0,X.jsx)(`span`,{className:`mono`,children:f.write===void 0?`—`:g(f.write,n)}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.tokens.reasoning`)}),(0,X.jsx)(`span`,{className:`mono`,children:e.usage?.reasoningOutputTokens===void 0?`—`:g(e.usage.reasoningOutputTokens,n)}),(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.detail.totalTokens`)}),(0,X.jsx)(`span`,{className:`mono`,children:He(e)===void 0?`—`:g(He(e),n)}),e.usage?.contextTotalTokens!==void 0&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`muted`,children:o(`logs.tokens.contextTotal`)}),(0,X.jsx)(`span`,{className:`mono`,children:g(e.usage.contextTotalTokens,n)})]})]}),e.usageStatus===`estimated`&&(0,X.jsx)(`p`,{className:`log-detail-notes-line muted`,children:o(`logs.tokens.estimatedNote`)})]}),(0,X.jsxs)(`details`,{className:`log-detail-raw`,children:[(0,X.jsx)(`summary`,{children:o(`logs.detailRaw`)}),(0,X.jsx)(`pre`,{className:`log-detail-json`,children:JSON.stringify(e,null,2)})]})]})]})}export{it as default};
|