@flowllm-ai/axonx-studio 0.0.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.
Files changed (41) hide show
  1. package/LICENSE +204 -0
  2. package/README.md +35 -0
  3. package/dist/assets/AgentWorkspace-CFX9cOOZ.js +1 -0
  4. package/dist/assets/ApiWorkspace-nuk0izk4.js +1 -0
  5. package/dist/assets/BacktestChart-B2A5g1WP.js +1 -0
  6. package/dist/assets/BacktestView-gMr3Zzhd.js +1 -0
  7. package/dist/assets/FilePreview-CUhmqr1c.js +1 -0
  8. package/dist/assets/HomePage-DfqAqAoX.js +1 -0
  9. package/dist/assets/ResearchPage-C8utBx0S.js +2 -0
  10. package/dist/assets/RuntimeWorkspace-CuOILV19.js +1 -0
  11. package/dist/assets/SchemaField-DTKpNfN-.js +1 -0
  12. package/dist/assets/StrategyComparePage-C04eQjCX.js +1 -0
  13. package/dist/assets/SubmitPage-BvV71x4v.js +1 -0
  14. package/dist/assets/TrainingCurveChart-BQJ9RnCV.js +1 -0
  15. package/dist/assets/TushareBrowserPage-D8Li-RN1.js +2 -0
  16. package/dist/assets/api-gyN9gj0Q.js +1 -0
  17. package/dist/assets/arrow-down-BH_K5gzy.js +1 -0
  18. package/dist/assets/arrow-right-Bqs4l9-C.js +1 -0
  19. package/dist/assets/check-D-YJERlt.js +1 -0
  20. package/dist/assets/circle-check-CuU7pF2N.js +1 -0
  21. package/dist/assets/client-BfOnNqgS.js +1 -0
  22. package/dist/assets/createLucideIcon-3GmWj6nd.js +1 -0
  23. package/dist/assets/file-spreadsheet-CCWLaZh3.js +1 -0
  24. package/dist/assets/hard-drive-BPS9bHrX.js +1 -0
  25. package/dist/assets/i18n-Cg91z-Pm.js +1 -0
  26. package/dist/assets/index-CUghMSjC.css +1 -0
  27. package/dist/assets/index-Dds_R6_G.js +11 -0
  28. package/dist/assets/installCanvasRenderer-bcUHIcHi.js +18 -0
  29. package/dist/assets/jsx-runtime-g_EzXSjx.js +1 -0
  30. package/dist/assets/lib-BNb3H2Uy.js +29 -0
  31. package/dist/assets/plus-5N8AgcCa.js +1 -0
  32. package/dist/assets/refresh-cw-DbZV2zTG.js +1 -0
  33. package/dist/assets/search-DgRYeO6M.js +1 -0
  34. package/dist/assets/send-DmE0S-qF.js +1 -0
  35. package/dist/assets/sourceTasks-BvyYdRNC.js +1 -0
  36. package/dist/assets/square-check-BHpZrFnJ.js +1 -0
  37. package/dist/assets/trash-DLhoydbu.js +1 -0
  38. package/dist/axonx-icon.svg +21 -0
  39. package/dist/axonx-logo.svg +46 -0
  40. package/dist/index.html +31 -0
  41. package/package.json +57 -0
@@ -0,0 +1 @@
1
+ import{a as e,c as t,n,t as r}from"./jsx-runtime-g_EzXSjx.js";import{t as i}from"./createLucideIcon-3GmWj6nd.js";import{i as a}from"./client-BfOnNqgS.js";import{t as o}from"./refresh-cw-DbZV2zTG.js";import{t as s}from"./search-DgRYeO6M.js";import{a as c,i as l,n as u}from"./api-gyN9gj0Q.js";import{D as ee}from"./index-Dds_R6_G.js";import{t as d}from"./sourceTasks-BvyYdRNC.js";import{r as te,t as ne}from"./BacktestChart-B2A5g1WP.js";var f={name:`arrow-left-right`,size:24,node:[[`path`,{d:`M8 3 4 7l4 4`,key:`9rb6wj`}],[`path`,{d:`M4 7h16`,key:`6tx8e3`}],[`path`,{d:`m16 21 4-4-4-4`,key:`siv7j2`}],[`path`,{d:`M20 17H4`,key:`h6l3hr`}]]};f.node;var re=i(f),p={name:`calendar-days`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 13h.01`,key:`1sbv64`}],[`path`,{d:`M12 13h.01`,key:`y0uutt`}],[`path`,{d:`M16 13h.01`,key:`wip0gl`}],[`path`,{d:`M8 17h.01`,key:`p3bg7i`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M16 17h.01`,key:`ql8jdd`}]]};p.node;var m=i(p),h=t(e(),1),g=e=>e==null||e===``?NaN:Number(e);function ie(e,t,n){let r=new Map(t.map(e=>[e.trade_date,e]));return e.flatMap(e=>{let t=r.get(e.trade_date);return t&&Number.isFinite(g(e[`top${n}_net_return`]))&&Number.isFinite(g(t[`top${n}_net_return`]))?[{date:e.trade_date,a:e,b:t}]:[]}).sort((e,t)=>e.date.localeCompare(t.date))}function ae(e,t,n=`net`){let r=+(n===`net`),i=+(n===`net`);return[{date:`__start__`,a:0,b:0},...e.map(e=>{let a=g(e.a[`top${t}_${n}_return`]),o=g(e.b[`top${t}_${n}_return`]);return Number.isFinite(a)&&(r=n===`net`?r*(1+a):r+a),Number.isFinite(o)&&(i=n===`net`?i*(1+o):i+o),{date:e.date,a:n===`net`?r-1:r,b:n===`net`?i-1:i}})]}function _(e,t,n,r=252){let i=e.map(e=>g(e[t][`top${n}_net_return`])).filter(Number.isFinite),a=1,o=1,s=0;i.forEach(e=>{a*=1+e,o=Math.max(o,a),s=Math.min(s,a/o-1)});let c=i.length?i.reduce((e,t)=>e+t,0)/i.length:NaN,l=i.length>1?i.reduce((e,t)=>e+(t-c)**2,0)/(i.length-1):NaN,u=e.map(e=>g(e[t][`top${n}_turnover`])).filter(Number.isFinite);return{cumulative:i.length?a-1:NaN,annualized:i.length&&a>0?a**(r/i.length)-1:NaN,volatility:Math.sqrt(l)*Math.sqrt(r),maxDrawdown:i.length?s:NaN,winRate:i.length?i.filter(e=>e>0).length/i.length:NaN,turnover:u.length?u.reduce((e,t)=>e+t,0)/u.length:NaN}}function v(e,t){let n=e.slice(0,4),r=Number(e.slice(4,6));return t===`year`?n:t===`quarter`?`${n}Q${Math.ceil(r/3)}`:`${n}-${String(r).padStart(2,`0`)}`}function oe(e,t,n){let r=new Map;return e.forEach(e=>{let t=v(e.date,n);r.set(t,[...r.get(t)||[],e])}),[...r].map(([e,n])=>({period:e,days:n.length,a:_(n,`a`,t).cumulative,b:_(n,`b`,t).cumulative}))}function se(e,t){let n=e.filter(e=>Number.isFinite(g(e.a[t]))&&Number.isFinite(g(e.b[t]))),r=e=>n.length?n.reduce((n,r)=>n+g(r[e][t]),0)/n.length:NaN;return{a:r(`a`),b:r(`b`),days:n.length}}function ce(e,t,n=252){let r=e.filter(e=>Number.isFinite(g(e.a[t]))&&Number.isFinite(g(e.b[t]))),i=e=>{let i=r.map(n=>g(n[e][t]));if(i.length<2)return NaN;let a=i.reduce((e,t)=>e+t,0)/i.length,o=i.reduce((e,t)=>e+(t-a)**2,0)/(i.length-1);return o>0?a/Math.sqrt(o)*Math.sqrt(n):NaN};return{a:i(`a`),b:i(`b`),days:r.length}}function le(e,t,n=20){return e.map((r,i)=>{let a=e.slice(Math.max(0,i-n+1),i+1),o=e=>{let n=a.map(n=>g(n[e][t])).filter(Number.isFinite);return n.length?n.reduce((e,t)=>e+t,0)/n.length:null};return{date:r.date,a:o(`a`),b:o(`b`)}})}function ue(e,t){let n=new Set(e.map(e=>e.ts_code)),r=new Set(t.map(e=>e.ts_code)),i=[...n].filter(e=>r.has(e)),a=new Set([...n,...r]).size;return{common:i,onlyA:e.filter(e=>!r.has(e.ts_code)),onlyB:t.filter(e=>!n.has(e.ts_code)),ratio:a?i.length/a:NaN}}var y=r(),b=e=>{let t=g(e);return Number.isFinite(t)?t:NaN},x=e=>Number.isFinite(e)?`${(e*100).toFixed(2)}%`:`—`,de=(e,t=3)=>Number.isFinite(e)?e.toFixed(t):`—`,S=e=>`${e.slice(0,4)}-${e.slice(4,6)}-${e.slice(6,8)}`,fe=e=>e.replaceAll(`-`,``);async function pe(e,t){let n=await u(`backtest`,e,t);return(await Promise.all(n.entries.filter(e=>e.kind===`directory`).map(async n=>{try{let r=await l(`${n.path}/metadata.json`,0,200,e,t);if(r.kind!==`json`||!r.data||typeof r.data!=`object`||Array.isArray(r.data))return null;let i=r.data,a=i.input_params||{},o=i.output_params||{},s=o.artifacts;return s?.daily?.path?{_path:n.path,task_key:String(i.reg_name||`backtest`),created_at:String(i.created_at||``),config:{task_id:String(i.task_id||n.name),task_type:`backtest`,task_name:String(a.task_name||`backtest`)},artifacts:s,dimensions:o.dimensions,date_range:o.date_range,days:b(o.days),source:d(a.source_tasks),settings:{transactionCost:b(a.transaction_cost_rate),annualizationDays:b(a.annualization_days),riskFreeRate:b(a.annual_risk_free_rate)}}:null}catch{return null}}))).filter(e=>e!==null).sort((e,t)=>t.created_at.localeCompare(e.created_at))}function C({rows:e}){let{t}=n();return(0,y.jsx)(`div`,{className:`compare-table-wrap`,children:(0,y.jsxs)(`table`,{className:`compare-table`,children:[(0,y.jsx)(`thead`,{children:(0,y.jsxs)(`tr`,{children:[(0,y.jsx)(`th`,{children:t(`compare.metric`)}),(0,y.jsx)(`th`,{children:`A`}),(0,y.jsx)(`th`,{children:`B`}),(0,y.jsx)(`th`,{children:t(`compare.difference_b_a`)})]})}),(0,y.jsx)(`tbody`,{children:e.map(e=>(0,y.jsxs)(`tr`,{children:[(0,y.jsx)(`th`,{scope:`row`,children:e.label}),(0,y.jsx)(`td`,{children:e.format(e.a)}),(0,y.jsx)(`td`,{children:e.format(e.b)}),(0,y.jsx)(`td`,{className:`compare-difference`,children:e.format(e.b-e.a)})]},e.label))})]})})}function w({title:e,rows:t,series:r,percentAxis:i=!0}){let{t:a}=n();return(0,y.jsxs)(`section`,{className:`viz-card compare-chart-card`,children:[(0,y.jsx)(`header`,{children:(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`small`,{children:a(`compare.common_window`)}),(0,y.jsx)(`h3`,{children:e})]})}),(0,y.jsx)(ne,{rows:t,series:r,percent:i,zoom:!0})]})}function me(e,t){let n=1,r=1,i=1,a=1;return e.map(e=>(n*=1+b(e.a[`top${t}_net_return`]),r*=1+b(e.b[`top${t}_net_return`]),i=Math.max(i,n),a=Math.max(a,r),{date:e.date,a:n/i-1,b:r/a-1}))}function he({target:e,initialTaskId:t,onConnection:r}){let{t:i,i18n:l}=n(),u=l.resolvedLanguage===`zh`?`zh-CN`:`en-US`,[d,ne]=(0,h.useState)([]),[f,p]=(0,h.useState)(!0),[g,v]=(0,h.useState)(``),[b,he]=(0,h.useState)(0),[ge,_e]=(0,h.useState)(``),[T,E]=(0,h.useState)(t||``),[D,O]=(0,h.useState)(``),[k,ve]=(0,h.useState)([]),[A,ye]=(0,h.useState)([]),[be,xe]=(0,h.useState)(!1),[Se,Ce]=(0,h.useState)(``),[we,Te]=(0,h.useState)(``),[Ee,De]=(0,h.useState)(30),[j,M]=(0,h.useState)(``),[N,P]=(0,h.useState)(``),[F,Oe]=(0,h.useState)(`overview`),[I,ke]=(0,h.useState)(`net`),[Ae,je]=(0,h.useState)(`year`),[L,Me]=(0,h.useState)(`rank_ic`),[Ne,Pe]=(0,h.useState)(``),Fe=e=>{T===e?E(``):D===e?O(``):T?O(e):E(e),M(``),P(``),Pe(``)};(0,h.useEffect)(()=>{t&&E(t)},[t]),(0,h.useEffect)(()=>{let t=new AbortController;return p(!0),v(``),pe(e,t.signal).then(e=>{t.signal.aborted||(ne(e),r(!0))}).catch(e=>{t.signal.aborted||(v(String(e)),r(!1))}).finally(()=>{t.signal.aborted||p(!1)}),()=>t.abort()},[e,b,r]);let R=d.find(e=>e.config.task_id===T),z=d.find(e=>e.config.task_id===D);(0,h.useEffect)(()=>{if(!R||!z||T===D){ve([]),ye([]),Te(``);return}let t=new AbortController;return xe(!0),Ce(``),Promise.all([te(R,e,t.signal),te(z,e,t.signal)]).then(([e,t])=>{ve(e),ye(t),Te(`${T}\n${D}`),r(!0)}).catch(e=>{t.signal.aborted||(Ce(String(e)),r(!1))}).finally(()=>{t.signal.aborted||xe(!1)}),()=>t.abort()},[R,z,T,D,e,r]);let B=R&&z?(R.dimensions?.top_ns||[1,2,3,5,10,15,20,30]).filter(e=>(z.dimensions?.top_ns||[1,2,3,5,10,15,20,30]).includes(e)):[],V=B.includes(Ee)?Ee:B.at(-1)||30,H=(0,h.useMemo)(()=>ie(k,A,V),[k,A,V]),U=(0,h.useMemo)(()=>H.filter(e=>(!j||e.date>=fe(j))&&(!N||e.date<=fe(N))),[H,j,N]),W=R&&z&&Number.isFinite(R.settings.annualizationDays)&&R.settings.annualizationDays===z.settings.annualizationDays?R.settings.annualizationDays:252,G=(0,h.useMemo)(()=>_(U,`a`,V,W),[U,V,W]),K=(0,h.useMemo)(()=>_(U,`b`,V,W),[U,V,W]),q=[{key:`a`,label:`A`},{key:`b`,label:`B`}],Ie=e=>e.map(e=>e.date===`__start__`?{...e,date:i(`common.start`)}:e),Le=d.filter(e=>`${e.config.task_id} ${e.config.task_name}`.toLowerCase().includes(ge.toLowerCase())),Re=[`overview`,`returns`,`periods`,`quality`,`trading`],J=[];R&&z&&(Number.isFinite(R.settings.transactionCost)&&Number.isFinite(z.settings.transactionCost)&&R.settings.transactionCost!==z.settings.transactionCost&&J.push(i(`compare.transaction_costs_differ`)),Number.isFinite(R.settings.annualizationDays)&&Number.isFinite(z.settings.annualizationDays)&&R.settings.annualizationDays!==z.settings.annualizationDays&&J.push(i(`compare.annualization_differs_comparison_uses_252`)),(R.source||[]).join()!==(z.source||[]).join()&&J.push(i(`compare.prediction_sources_differ`)),(k.length!==H.length||A.length!==H.length)&&J.push(i(`compare.only_shared_days_with_valid`)));let Y=[{label:i(`compare.net_cumulative_return`),a:G.cumulative,b:K.cumulative,format:x},{label:i(`compare.net_annualized_return`),a:G.annualized,b:K.annualized,format:x},{label:i(`compare.annualized_volatility`),a:G.volatility,b:K.volatility,format:x},{label:i(`compare.max_drawdown`),a:G.maxDrawdown,b:K.maxDrawdown,format:x},{label:i(`compare.win_rate`),a:G.winRate,b:K.winRate,format:x},{label:i(`compare.average_turnover`),a:G.turnover,b:K.turnover,format:x}],X=[{key:`ic`,label:`IC`,digits:4},{key:`rank_ic`,label:`RankIC`,digits:4},{key:`top${V}_ndcg`,label:`NDCG@${V}`,digits:4}],Z=U.find(e=>e.date===Ne)||U.at(-1),ze=Z?.a.top30_holdings||[],Q=Z?.b.top30_holdings||[],$=ue(ze,Q);return(0,y.jsxs)(`section`,{className:`workspace-page strategy-compare-page`,children:[(0,y.jsx)(`div`,{className:`page-heading`,children:(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`p`,{className:`eyebrow`,children:`RESEARCH / COMPARE`}),(0,y.jsx)(`h1`,{children:i(`compare.strategy_comparison`)}),(0,y.jsx)(`span`,{children:i(`compare.compare_backtests_on_shared_trading`)})]})}),(0,y.jsxs)(`div`,{className:`compare-layout`,children:[(0,y.jsxs)(`aside`,{className:`compare-picker rail-panel run-index`,children:[(0,y.jsxs)(`header`,{className:`run-index-header rail-header`,children:[(0,y.jsxs)(`div`,{className:`run-index-heading rail-heading`,children:[(0,y.jsx)(`small`,{children:`TASK VERSIONS`}),(0,y.jsx)(`strong`,{children:i(`compare.task_versions`)})]}),(0,y.jsxs)(`div`,{className:`run-index-tools`,children:[(0,y.jsx)(`em`,{children:d.length}),(0,y.jsx)(`button`,{type:`button`,className:`run-index-refresh rail-refresh`,onClick:()=>he(e=>e+1),"aria-label":i(`compare.refresh_tasks`),children:(0,y.jsx)(o,{className:f?`spin`:``})})]})]}),(0,y.jsxs)(`label`,{className:`run-index-search rail-search`,children:[(0,y.jsx)(s,{}),(0,y.jsx)(`input`,{value:ge,onChange:e=>_e(e.target.value),placeholder:i(`compare.search_task_id`)})]}),(0,y.jsxs)(`div`,{className:`compare-picker-list rail-scroll`,children:[(0,y.jsx)(`p`,{className:`compare-picker-hint`,children:i(`compare.click_two_versions_to_compare`)}),f&&(0,y.jsxs)(`p`,{className:`compare-state`,children:[(0,y.jsx)(a,{className:`spin`}),i(`compare.loading_tasks`)]}),g&&(0,y.jsxs)(`p`,{className:`compare-state error`,children:[(0,y.jsx)(c,{}),g]}),!f&&!g&&!d.length&&(0,y.jsx)(`p`,{className:`compare-state`,children:i(`compare.no_backtests_available`)}),Le.map(e=>(0,y.jsx)(`article`,{className:T===e.config.task_id||D===e.config.task_id?`active`:``,children:(0,y.jsxs)(`button`,{className:`run-main rail-list-item compare-run-item`,type:`button`,"aria-pressed":T===e.config.task_id||D===e.config.task_id,onClick:()=>Fe(e.config.task_id),children:[(0,y.jsx)(`span`,{className:`run-item-avatar rail-avatar run-kind-backtest`,children:e.task_key.slice(0,1).toUpperCase()}),(0,y.jsxs)(`span`,{className:`rail-item-copy`,children:[(0,y.jsx)(`strong`,{children:e.task_key}),(0,y.jsx)(`code`,{title:e.config.task_id,children:e.config.task_id}),(0,y.jsx)(`small`,{children:e.created_at?new Date(e.created_at).toLocaleString(u):i(`compare.metadata_unavailable`)})]}),(0,y.jsx)(`span`,{className:`compare-slot-badge${T===e.config.task_id?` slot-a`:D===e.config.task_id?` slot-b`:``}`,children:T===e.config.task_id?`A`:D===e.config.task_id?`B`:`+`})]})},e.config.task_id))]})]}),(0,y.jsxs)(`main`,{className:`compare-main`,children:[(0,y.jsxs)(`div`,{className:`compare-selection`,children:[[R,z].map((e,t)=>(0,y.jsxs)(`div`,{className:`compare-selected compare-side-${t===0?`a`:`b`}`,children:[(0,y.jsx)(`span`,{children:t===0?`A`:`B`}),(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`small`,{children:i(`compare.backtest_task`)}),(0,y.jsx)(`strong`,{title:e?.config.task_id,children:e?.config.task_id||i(`compare.choose_from_the_list`)})]})]},t)),(0,y.jsx)(`button`,{type:`button`,className:`compare-swap`,disabled:!T||!D,onClick:()=>{E(D),O(T)},"aria-label":i(`compare.swap_a_and_b`),children:(0,y.jsx)(re,{})})]}),!R||!z?(0,y.jsxs)(`div`,{className:`compare-empty`,children:[(0,y.jsx)(ee,{}),(0,y.jsx)(`strong`,{children:i(`compare.select_two_backtests_to_compare`)}),(0,y.jsx)(`span`,{children:d.length===1?i(`compare.only_one_backtest_is_available`):i(`compare.click_two_task_versions_on`)})]}):Se?(0,y.jsxs)(`div`,{className:`compare-empty error`,children:[(0,y.jsx)(c,{}),(0,y.jsx)(`strong`,{children:i(`compare.unable_to_load_backtests`)}),(0,y.jsx)(`span`,{children:Se})]}):be||we!==`${T}\n${D}`?(0,y.jsxs)(`div`,{className:`compare-empty`,children:[(0,y.jsx)(a,{className:`spin`}),(0,y.jsx)(`strong`,{children:i(`compare.calculating_shared_window`)})]}):B.length?H.length?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:`compare-controls`,children:[(0,y.jsxs)(`div`,{className:`compare-window`,children:[(0,y.jsx)(m,{}),(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`small`,{children:i(`compare.shared_window`)}),(0,y.jsxs)(`strong`,{children:[H[0].date,` — `,H.at(-1)?.date,` · `,H.length,` `,i(`compare.days`)]})]})]}),(0,y.jsxs)(`label`,{children:[`Top N`,(0,y.jsx)(`select`,{value:V,onChange:e=>De(Number(e.target.value)),children:B.map(e=>(0,y.jsxs)(`option`,{value:e,children:[`Top `,e]},e))})]}),(0,y.jsxs)(`label`,{children:[i(`compare.from`),(0,y.jsx)(`input`,{type:`date`,min:S(H[0].date),max:S(H.at(-1).date),value:j,onChange:e=>M(e.target.value)})]}),(0,y.jsxs)(`label`,{children:[i(`compare.to`),(0,y.jsx)(`input`,{type:`date`,min:S(H[0].date),max:S(H.at(-1).date),value:N,onChange:e=>P(e.target.value)})]}),(j||N)&&(0,y.jsx)(`button`,{type:`button`,onClick:()=>{M(``),P(``)},children:i(`compare.reset_dates`)})]}),J.length>0&&(0,y.jsxs)(`div`,{className:`compare-warnings`,children:[(0,y.jsx)(c,{}),J.map(e=>(0,y.jsx)(`span`,{children:e},e))]}),U.length?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`nav`,{className:`compare-tabs`,"aria-label":i(`compare.comparison_dimensions`),children:Re.map(e=>(0,y.jsx)(`button`,{type:`button`,className:F===e?`active`:``,onClick:()=>Oe(e),children:i(`compare.tabs.${e}`)},e))}),F===`overview`&&(0,y.jsxs)(`div`,{className:`compare-content`,children:[(0,y.jsx)(`div`,{className:`compare-kpis`,children:Y.slice(0,4).map(e=>(0,y.jsxs)(`article`,{children:[(0,y.jsx)(`small`,{children:e.label}),(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(`span`,{children:[`A `,(0,y.jsx)(`strong`,{children:e.format(e.a)})]}),(0,y.jsxs)(`span`,{children:[`B `,(0,y.jsx)(`strong`,{children:e.format(e.b)})]})]}),(0,y.jsxs)(`em`,{children:[i(`compare.difference`),` `,e.format(e.b-e.a)]})]},e.label))}),(0,y.jsx)(w,{title:i(`compare.cumulative_net_return_shared_start`),rows:Ie(ae(U,V)),series:q}),(0,y.jsx)(C,{rows:Y})]}),F===`returns`&&(0,y.jsxs)(`div`,{className:`compare-content`,children:[(0,y.jsxs)(`div`,{className:`compare-toolbar`,children:[(0,y.jsx)(`span`,{children:i(`compare.return_basis`)}),(0,y.jsx)(`button`,{type:`button`,className:I===`net`?`active`:``,onClick:()=>ke(`net`),children:i(`compare.net`)}),(0,y.jsx)(`button`,{type:`button`,className:I===`gross`?`active`:``,onClick:()=>ke(`gross`),children:i(`compare.gross`)})]}),(0,y.jsx)(w,{title:i(I===`net`?`compare.cumulative_net_return`:`compare.cumulative_gross_return`),rows:Ie(ae(U,V,I)),series:q}),(0,y.jsx)(w,{title:i(`compare.net_drawdown`),rows:me(U,V),series:q}),(0,y.jsx)(C,{rows:Y})]}),F===`periods`&&(0,y.jsxs)(`div`,{className:`compare-content`,children:[(0,y.jsxs)(`div`,{className:`compare-toolbar`,children:[(0,y.jsx)(`span`,{children:i(`compare.period`)}),[`year`,`quarter`,`month`].map(e=>(0,y.jsx)(`button`,{type:`button`,className:Ae===e?`active`:``,onClick:()=>je(e),children:i(e===`year`?`compare.year`:e===`quarter`?`compare.quarter`:`compare.month`)},e))]}),(0,y.jsx)(`div`,{className:`compare-table-wrap`,children:(0,y.jsxs)(`table`,{className:`compare-table`,children:[(0,y.jsx)(`thead`,{children:(0,y.jsxs)(`tr`,{children:[(0,y.jsx)(`th`,{children:i(`compare.period`)}),(0,y.jsx)(`th`,{children:i(`compare.days_2`)}),(0,y.jsxs)(`th`,{children:[`A · `,i(`compare.net_return`)]}),(0,y.jsxs)(`th`,{children:[`B · `,i(`compare.net_return`)]}),(0,y.jsx)(`th`,{children:i(`compare.difference_b_a`)})]})}),(0,y.jsx)(`tbody`,{children:oe(U,V,Ae).map(e=>(0,y.jsxs)(`tr`,{children:[(0,y.jsx)(`th`,{scope:`row`,children:e.period}),(0,y.jsx)(`td`,{children:e.days}),(0,y.jsx)(`td`,{children:x(e.a)}),(0,y.jsx)(`td`,{children:x(e.b)}),(0,y.jsx)(`td`,{children:(0,y.jsxs)(`div`,{className:`compare-period-delta`,children:[(0,y.jsx)(`span`,{style:{width:`${Math.min(100,Math.abs(e.b-e.a)*250)}%`},className:e.b>=e.a?`positive`:`negative`}),x(e.b-e.a)]})})]},e.period))})]})})]}),F===`quality`&&(0,y.jsxs)(`div`,{className:`compare-content`,children:[(0,y.jsxs)(`div`,{className:`compare-toolbar`,children:[(0,y.jsx)(`span`,{children:i(`compare.signal_trend`)}),(0,y.jsx)(`select`,{value:L,onChange:e=>Me(e.target.value),children:X.map(e=>(0,y.jsx)(`option`,{value:e.key,children:e.label},e.key))})]}),(0,y.jsx)(w,{title:`${X.find(e=>e.key===L)?.label||L} · MA20`,rows:le(U,L),series:q.map(e=>({...e,format:`precise`})),percentAxis:!1}),(0,y.jsx)(C,{rows:[...X.map(e=>{let t=se(U,e.key);return{label:`${e.label} ${i(`compare.mean`)}`,a:t.a,b:t.b,format:t=>de(t,e.digits)}}),...[`ic`,`rank_ic`].map(e=>{let t=ce(U,e,W);return{label:e===`ic`?`ICIR`:`RankICIR`,a:t.a,b:t.b,format:e=>de(e,2)}})]})]}),F===`trading`&&(0,y.jsxs)(`div`,{className:`compare-content`,children:[(0,y.jsx)(C,{rows:[Y[5],{label:i(`compare.average_daily_cost`),a:G.turnover*(R.settings.transactionCost??NaN),b:K.turnover*(z.settings.transactionCost??NaN),format:x}]}),(0,y.jsx)(w,{title:i(`compare.daily_turnover`),rows:U.map(e=>({date:e.date,a:e.a[`top${V}_turnover`],b:e.b[`top${V}_turnover`]})),series:q}),(0,y.jsxs)(`section`,{className:`viz-card compare-holdings`,children:[(0,y.jsxs)(`header`,{children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`small`,{children:`TOP 30 HOLDINGS`}),(0,y.jsx)(`h3`,{children:i(`compare.holdings_comparison`)})]}),(0,y.jsxs)(`label`,{children:[i(`compare.trading_day`),(0,y.jsx)(`select`,{value:Z?.date||``,onChange:e=>Pe(e.target.value),children:U.map(e=>(0,y.jsx)(`option`,{value:e.date,children:e.date},e.date))})]})]}),(0,y.jsxs)(`div`,{className:`compare-overlap`,children:[(0,y.jsxs)(`strong`,{children:[i(`compare.shared_holdings`),` `,$.common.length]}),(0,y.jsxs)(`span`,{children:[i(`compare.overlap`),` `,x($.ratio)]}),(0,y.jsxs)(`span`,{children:[`A `,i(`compare.only`),` `,$.onlyA.length]}),(0,y.jsxs)(`span`,{children:[`B `,i(`compare.only`),` `,$.onlyB.length]})]}),(0,y.jsx)(`div`,{className:`compare-holdings-grid`,children:[ze,Q].map((e,t)=>(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(`h4`,{children:[t===0?`A`:`B`,` · Top 30`]}),(0,y.jsx)(`div`,{className:`compare-table-wrap`,children:(0,y.jsxs)(`table`,{className:`compare-table`,children:[(0,y.jsx)(`thead`,{children:(0,y.jsxs)(`tr`,{children:[(0,y.jsx)(`th`,{children:`#`}),(0,y.jsx)(`th`,{children:i(`compare.code`)}),(0,y.jsx)(`th`,{children:i(`compare.name`)}),(0,y.jsx)(`th`,{children:i(`compare.daily_return`)})]})}),(0,y.jsx)(`tbody`,{children:e.map(e=>(0,y.jsxs)(`tr`,{className:$.common.includes(e.ts_code)?`shared`:``,children:[(0,y.jsx)(`td`,{children:e.rank}),(0,y.jsx)(`td`,{children:(0,y.jsx)(`code`,{children:e.ts_code})}),(0,y.jsx)(`td`,{children:e.name}),(0,y.jsx)(`td`,{children:x(e.daily_return)})]},e.ts_code))})]})})]},t))})]})]})]}):(0,y.jsxs)(`div`,{className:`compare-empty`,children:[(0,y.jsx)(m,{}),(0,y.jsx)(`strong`,{children:i(`compare.no_shared_days_in_this`)})]})]}):(0,y.jsxs)(`div`,{className:`compare-empty error`,children:[(0,y.jsx)(m,{}),(0,y.jsx)(`strong`,{children:i(`compare.no_shared_valid_trading_days`)})]}):(0,y.jsxs)(`div`,{className:`compare-empty error`,children:[(0,y.jsx)(c,{}),(0,y.jsx)(`strong`,{children:i(`compare.no_shared_top_n`)})]})]})]})]})}export{he as default};
@@ -0,0 +1 @@
1
+ import{a as e,c as t,n,t as r}from"./jsx-runtime-g_EzXSjx.js";import{t as i}from"./createLucideIcon-3GmWj6nd.js";import{t as a}from"./arrow-right-Bqs4l9-C.js";import{i as o,n as s,r as c,t as l}from"./SchemaField-DTKpNfN-.js";import{t as u}from"./check-D-YJERlt.js";import{i as d}from"./client-BfOnNqgS.js";import{t as f}from"./refresh-cw-DbZV2zTG.js";import{t as p}from"./search-DgRYeO6M.js";import{t as m}from"./send-DmE0S-qF.js";import{N as h,P as g,S as _,c as v,i as y,y as b}from"./index-Dds_R6_G.js";var x={name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};x.node;var S=i(x),C=t(e(),1),w=r();function T({target:e,initialName:t,onSelected:r,onOptionsChange:i,onViewTasks:h,onConnection:x}){let{t:T}=n(),[D,O]=(0,C.useState)([]),[k,A]=(0,C.useState)(``),[j,M]=(0,C.useState)(``),[N,P]=(0,C.useState)(!0),[F,I]=(0,C.useState)(``),[L,R]=(0,C.useState)({}),[z,B]=(0,C.useState)({}),[V,H]=(0,C.useState)(!1),[U,W]=(0,C.useState)(!1),[G,K]=(0,C.useState)(new Set),q=(0,C.useCallback)(async()=>{P(!0),I(``);try{let t=await y(e);O(t),A(e=>t.some(t=>t.name===e)?e:``),x(!0)}catch(e){I(e instanceof Error?e.message:String(e)),x(!1)}finally{P(!1)}},[x,e]);(0,C.useEffect)(()=>{q()},[q]),(0,C.useEffect)(()=>{t&&D.some(e=>e.name===t)&&A(t)},[t,D]),(0,C.useEffect)(()=>{i?.(D.map(e=>({value:e.name,label:e.name,detail:T(`types.${e.task_type}`,e.task_type)})))},[D,T,i]);let J=D.find(e=>e.name===k),Y=(0,C.useMemo)(()=>D.filter(e=>`${e.name} ${e.task_type} ${e.description}`.toLowerCase().includes(j.toLowerCase())),[D,j]),X=(0,C.useMemo)(()=>{let e=new Map;for(let t of Y){if(t.source!==`plugin`)continue;let n=t.plugin||T(`pluginTasks`),r=e.get(n)||[];r.push(t),e.set(n,r)}return[{id:`native`,label:T(`nativeTasks`),tasks:Y.filter(e=>e.source!==`plugin`)},...Array.from(e,([e,t])=>({id:`plugin:${e}`,label:e,tasks:t})).sort((e,t)=>e.label.localeCompare(t.label))]},[Y,T]);(0,C.useEffect)(()=>{J&&(R(s(J.input_schema)),B({}),W(!1))},[k,J]);let Z=e=>{A(e),W(!1),r?.(e)},Q=e=>K(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),$=async t=>{if(t.preventDefault(),!J)return;let{data:n,errors:r}=c(J.input_schema,L,{required:T(`required`),invalidJson:T(`jsonHint`)});if(B(r),!Object.keys(r).length){H(!0),I(``);try{await v(J.name,n,e),W(!0),x(!0)}catch(e){I(e instanceof Error?e.message:String(e)),x(!1)}finally{H(!1)}}};return(0,w.jsxs)(`section`,{className:`workspace-page submit-workspace`,children:[(0,w.jsx)(`div`,{className:`page-heading`,children:(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`eyebrow`,children:`TASK LAUNCHER / 02`}),(0,w.jsx)(`h1`,{children:T(`submitTitle`)}),(0,w.jsx)(`span`,{children:T(`submitLead`)})]})}),(0,w.jsxs)(`div`,{className:`submit-layout`,children:[(0,w.jsxs)(`aside`,{className:`catalog-panel rail-panel`,children:[(0,w.jsxs)(`header`,{className:`catalog-header rail-header`,children:[(0,w.jsxs)(`div`,{className:`catalog-heading rail-heading`,children:[(0,w.jsx)(`strong`,{children:T(`taskCatalog`)}),(0,w.jsx)(`span`,{children:T(`tasksAvailable`,{count:D.length})})]}),(0,w.jsx)(`button`,{className:`catalog-refresh rail-refresh`,onClick:()=>void q(),"aria-label":T(`refresh`),children:(0,w.jsx)(f,{className:N?`spin`:``})})]}),(0,w.jsxs)(`label`,{className:`context-search rail-search`,children:[(0,w.jsx)(p,{}),(0,w.jsx)(`input`,{value:j,onChange:e=>M(e.target.value),placeholder:T(`findTask`)})]}),(0,w.jsxs)(`div`,{className:`task-catalog rail-scroll`,children:[X.map(e=>{if(!e.tasks.length)return null;let t=(e.id===`native`?!G.has(e.id):G.has(e.id))||!!j.trim(),n=`task-group-${e.id}`;return(0,w.jsxs)(`section`,{className:`task-catalog-group ${t?`expanded`:`collapsed`}`,children:[(0,w.jsxs)(`button`,{type:`button`,className:`catalog-group-toggle`,"aria-expanded":t,"aria-controls":n,onClick:()=>Q(e.id),children:[(0,w.jsxs)(`span`,{children:[(0,w.jsx)(g,{}),e.label]}),(0,w.jsx)(`small`,{children:e.tasks.length})]}),t&&(0,w.jsx)(`div`,{className:`task-catalog-items`,id:n,children:e.tasks.map(e=>(0,w.jsx)(E,{task:e,typeLabel:T(`types.${e.task_type}`,e.task_type),active:k===e.name,onChoose:Z},e.name))})]},e.id)}),!N&&!Y.length&&(0,w.jsx)(`div`,{className:`catalog-empty`,children:T(`noInstalled`)})]})]}),(0,w.jsx)(b,{min:180,max:460,className:`context-resizer`}),(0,w.jsxs)(`div`,{className:`form-panel`,children:[N&&!J&&(0,w.jsxs)(`div`,{className:`loading-state tall`,children:[(0,w.jsx)(d,{className:`spin`}),` `,T(`submitPage.loadingCatalog`)]}),F&&!J&&(0,w.jsxs)(`div`,{className:`form-message error`,children:[(0,w.jsx)(o,{}),(0,w.jsx)(`h2`,{children:T(`catalogFailed`)}),(0,w.jsx)(`p`,{children:F}),(0,w.jsx)(`button`,{className:`secondary-button`,onClick:()=>void q(),children:T(`retry`)})]}),!N&&!F&&!J&&(0,w.jsxs)(`div`,{className:`empty-workspace`,children:[(0,w.jsx)(_,{}),(0,w.jsx)(`strong`,{children:T(`submitPage.selectTask`)}),(0,w.jsx)(`span`,{children:T(`submitPage.selectTaskHint`)})]}),J&&!U&&(0,w.jsxs)(`form`,{onSubmit:e=>void $(e),children:[(0,w.jsxs)(`header`,{className:`task-form-header type-${J.task_type}`,children:[(0,w.jsx)(`div`,{className:`large-task-icon`,children:(0,w.jsx)(_,{})}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`span`,{className:`type-label`,children:T(`types.${J.task_type}`,J.task_type)}),(0,w.jsx)(`h2`,{children:J.name}),(0,w.jsx)(`p`,{children:J.description})]})]}),(0,w.jsxs)(`section`,{className:`configuration-card`,children:[(0,w.jsxs)(`div`,{className:`form-section-heading`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`span`,{className:`section-heading-icon`,children:(0,w.jsx)(S,{})}),(0,w.jsx)(`span`,{children:T(`configure`)})]}),(0,w.jsxs)(`small`,{children:[Object.keys(J.input_schema.properties||{}).length,` `,`fields`]})]}),(0,w.jsx)(`div`,{className:`dynamic-form`,children:Object.entries(J.input_schema.properties||{}).map(([e,t])=>(0,w.jsx)(l,{name:e,schema:t,required:(J.input_schema.required||[]).includes(e),value:L[e]??``,error:z[e],onChange:t=>R(n=>({...n,[e]:t}))},e))})]}),!!Object.keys(J.output_schema.properties||{}).length&&(0,w.jsxs)(`div`,{className:`output-preview`,children:[(0,w.jsxs)(`span`,{children:[(0,w.jsx)(o,{}),T(`output`)]}),(0,w.jsx)(`div`,{children:Object.keys(J.output_schema.properties||{}).map(e=>(0,w.jsx)(`code`,{children:e},e))})]}),F&&(0,w.jsx)(`div`,{className:`inline-error`,children:F}),(0,w.jsxs)(`footer`,{className:`form-footer`,children:[(0,w.jsx)(`span`,{children:`POST /jobs/submit`}),(0,w.jsxs)(`button`,{className:`primary-button submit-button`,disabled:V,children:[V?(0,w.jsx)(d,{className:`spin`}):(0,w.jsx)(m,{}),` `,T(V?`submitting`:`submit`),(0,w.jsx)(a,{})]})]})]}),J&&U&&(0,w.jsxs)(`div`,{className:`success-state`,children:[(0,w.jsxs)(`span`,{className:`success-rings`,children:[(0,w.jsx)(`i`,{}),(0,w.jsx)(`i`,{}),(0,w.jsx)(u,{})]}),(0,w.jsx)(`p`,{children:`SUBMITTED`}),(0,w.jsx)(`h2`,{children:T(`submitted`)}),(0,w.jsx)(`span`,{children:T(`submittedHint`)}),(0,w.jsx)(`code`,{children:J.name}),(0,w.jsxs)(`button`,{className:`primary-button`,onClick:h,children:[T(`viewTasks`),(0,w.jsx)(a,{})]}),(0,w.jsx)(`button`,{className:`link-button`,onClick:()=>W(!1),children:T(`submitPage.submitAnother`)})]})]})]})]})}function E({task:e,typeLabel:t,active:n,onChoose:r}){return(0,w.jsxs)(`button`,{type:`button`,className:`catalog-task rail-list-item${n?` active`:``}`,"aria-pressed":n,onClick:()=>r(e.name),children:[(0,w.jsx)(`span`,{className:`catalog-icon rail-avatar type-${e.task_type}`,children:e.name.trim().slice(0,1).toUpperCase()}),(0,w.jsxs)(`span`,{className:`catalog-task-copy rail-item-copy`,children:[(0,w.jsx)(`strong`,{title:e.name,children:e.name}),(0,w.jsx)(`small`,{children:t})]}),(0,w.jsx)(h,{})]})}export{T as default};
@@ -0,0 +1 @@
1
+ import{a as e,c as t,n,t as r}from"./jsx-runtime-g_EzXSjx.js";import{a as i,i as a,n as o,o as s,r as c,s as l,t as u,v as d}from"./installCanvasRenderer-bcUHIcHi.js";var f=t(e(),1),p=r();s([d,o,i,c,a,u]);function m({curve:e}){let{t}=n(),r=(0,f.useRef)(null),[i,a]=(0,f.useState)(()=>document.documentElement.dataset.theme);return(0,f.useEffect)(()=>{let e=new MutationObserver(()=>a(document.documentElement.dataset.theme));return e.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]}),()=>e.disconnect()},[]),(0,f.useEffect)(()=>{if(!r.current)return;let n=getComputedStyle(r.current),i=e=>n.getPropertyValue(e).trim(),a=Object.entries(e.y_left).filter(([,t])=>t.length===e.x.length),o=Object.entries(e.y_right).filter(([,t])=>t.length===e.x.length),s=o.length>0,c=a.length>0&&a.every(([e])=>e.endsWith(`_l2`)),u=o.length>0&&o.every(([e])=>e.endsWith(`_l1`)),d=(t,n=0,r=100)=>{let i=Math.floor(n/100*Math.max(e.x.length-1,0)),a=Math.ceil(r/100*Math.max(e.x.length-1,0))+1,o=1/0,s=-1/0;for(let[,e]of t)for(let t of e.slice(i,a))Number.isFinite(t)&&(o=Math.min(o,t),s=Math.max(s,t));if(!Number.isFinite(o))return{};let c=Math.max((s-o)*.12,Math.abs(s)*.001,1e-6);return{min:o-c,max:s+c}},f=(e,n)=>({type:`value`,position:n,scale:!0,name:n===`left`?c?`L2 · MSE`:t(`trainingCurve.left_axis`):u?`L1 · MAE`:t(`trainingCurve.right_axis`),nameTextStyle:{color:i(`--muted`),fontSize:11},...d(e),axisLabel:{color:i(`--faint`),formatter:e=>Number(e).toPrecision(4)},splitLine:{show:n===`left`,lineStyle:{color:i(`--line`),opacity:.65}}}),p=e=>e.replace(/^train_/,t(`trainingCurve.train`)).replace(/^validation_/,t(`trainingCurve.validation`)).replace(/_l([12])$/,` L$1`),m=e.x.length>80,h=l(r.current,void 0,{renderer:`canvas`});h.setOption({animation:!1,grid:{left:78,right:s?78:24,top:66,bottom:m?76:42},legend:{type:`scroll`,top:10,textStyle:{color:i(`--muted`),fontSize:11}},tooltip:{trigger:`axis`,backgroundColor:i(`--surface`),borderColor:i(`--line`),textStyle:{color:i(`--ink`)},valueFormatter:e=>Number(e).toPrecision(6)},xAxis:{type:`category`,boundaryGap:!1,data:e.x,axisLabel:{color:i(`--faint`),hideOverlap:!0},axisLine:{lineStyle:{color:i(`--line`)}}},yAxis:[f(a,`left`),...s?[f(o,`right`)]:[]],...m?{dataZoom:[{type:`inside`,start:0,end:100},{type:`slider`,start:0,end:100,bottom:12,height:20,borderColor:i(`--line`),fillerColor:i(`--accent-soft`),handleStyle:{color:i(`--accent`)},textStyle:{color:i(`--faint`)}}]}:{},series:[...a.map(([e,t],n)=>({name:e,values:t,index:n,axis:0})),...o.map(([e,t],n)=>({name:e,values:t,index:n,axis:1}))].map(({name:e,values:t,index:n,axis:r})=>({name:p(e),type:`line`,yAxisIndex:r,itemStyle:{color:i(`--chart-${r===0?n%2?3:2:n%2?1:4}`)},data:t.map(e=>Number.isFinite(e)?e:null),showSymbol:!1,connectNulls:!1,lineStyle:{width:2,type:e.startsWith(`validation_`)?`dashed`:`solid`},emphasis:{focus:`series`}}))}),m&&h.on(`datazoom`,()=>{let e=h.getOption().dataZoom?.[0],t=e?.start??0,n=e?.end??100;h.setOption({yAxis:[{...d(a,t,n)},...s?[{...d(o,t,n)}]:[]]},{lazyUpdate:!0})});let g=new ResizeObserver(()=>h.resize());return g.observe(r.current),()=>{g.disconnect(),h.dispose()}},[e,i,t]),(0,p.jsx)(`div`,{className:`train-curve-chart`,ref:r})}export{m as TrainingCurveChart};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FilePreview-CUhmqr1c.js","assets/jsx-runtime-g_EzXSjx.js","assets/file-spreadsheet-CCWLaZh3.js","assets/createLucideIcon-3GmWj6nd.js","assets/api-gyN9gj0Q.js","assets/client-BfOnNqgS.js","assets/index-Dds_R6_G.js","assets/i18n-Cg91z-Pm.js","assets/index-CUghMSjC.css","assets/lib-BNb3H2Uy.js"])))=>i.map(i=>d[i]);
2
+ import{a as e,c as t,n,s as r,t as i}from"./jsx-runtime-g_EzXSjx.js";import{t as a}from"./createLucideIcon-3GmWj6nd.js";import{n as o,r as s,t as c}from"./hard-drive-BPS9bHrX.js";import{t as l}from"./file-spreadsheet-CCWLaZh3.js";import{i as u}from"./client-BfOnNqgS.js";import{t as d}from"./refresh-cw-DbZV2zTG.js";import{a as f,i as p,r as m}from"./api-gyN9gj0Q.js";import{A as h,N as g,P as _,g as v,j as y,u as b,y as x}from"./index-Dds_R6_G.js";var S={name:`file`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]};S.node;var C=a(S),w={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};w.node;var T=a(w),E=r({default:()=>M}),D=t(e(),1),O=i(),k=(0,D.lazy)(()=>b(()=>import(`./FilePreview-CUhmqr1c.js`).then(e=>({default:e.FilePreview})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))),A=`tushare`;function j(e){return e.kind===`directory`?T:e.preview_kind===`markdown`?o:e.preview_kind===`json`||e.preview_kind===`yaml`?s:e.preview_kind===`csv`?l:e.preview_kind===`parquet`?y:e.preview_kind===`text`?h:C}function M({target:e,initialPath:t,onConnection:r,onPathChange:i,onOptionsChange:a}){let{t:o}=n(),[s,l]=(0,D.useState)({}),[h,y]=(0,D.useState)(()=>new Set([A])),[b,S]=(0,D.useState)(()=>new Set),[C,w]=(0,D.useState)(null),[E,M]=(0,D.useState)(null),[N,P]=(0,D.useState)(``),[F,I]=(0,D.useState)(``),[L,R]=(0,D.useState)(!1),z=(0,D.useRef)(0),B=(0,D.useCallback)(async(t,n)=>{S(e=>new Set(e).add(t));try{let i=await m(t,e,n);l(e=>({...e,[t]:i})),P(``),r(!0)}catch(e){e?.name!==`AbortError`&&(P(e instanceof Error?e.message:String(e)),r(!1))}finally{S(e=>{let n=new Set(e);return n.delete(t),n})}},[e,r]),V=(0,D.useCallback)(async(t,n=0)=>{let i=++z.current;w(t),M(null),I(``),R(!0);try{let a=await p(t.path,n,200,e);i===z.current&&(M(a),r(!0))}catch(e){i===z.current&&(I(e instanceof Error?e.message:String(e)),r(!1))}finally{i===z.current&&R(!1)}},[e,r]),H=(0,D.useCallback)(e=>{i?.(e.path),V(e)},[V,i]),U=(0,D.useCallback)(e=>{y(t=>{let n=new Set(t);return n.has(e.path)?n.delete(e.path):n.add(e.path),n}),i?.(e.path),s[e.path]||B(e.path)},[s,B,i]),W=(0,D.useCallback)(()=>{z.current+=1,l({}),y(new Set([A])),w(null),M(null),I(``),P(``),B(A)},[B]);(0,D.useEffect)(()=>{let e=new AbortController;return l({}),y(new Set([A])),w(null),M(null),P(``),B(A,e.signal),()=>{e.abort(),z.current+=1}},[e,B]),(0,D.useEffect)(()=>{if(!t||!t.startsWith(A)||t===A)return;let n=!0;return(async()=>{try{let i=t.split(`/`).filter(Boolean),a={},o=new Set([A]),s=A,c;for(let t of i.slice(1)){let n=a[s]||await m(s,e);if(a[s]=n,c=n.entries.find(e=>e.name===t),!c)return;c.kind===`directory`&&(s=c.path,o.add(s))}if(!n||!c)return;c.kind===`directory`&&(a[c.path]=await m(c.path,e)),l(e=>({...e,...a})),y(o),r(!0),c.kind===`file`&&V(c)}catch(e){n&&(P(e instanceof Error?e.message:String(e)),r(!1))}})(),()=>{n=!1}},[t,e,V,r]),(0,D.useEffect)(()=>{let e=new Map;Object.values(s).flatMap(e=>e.entries).filter(e=>e.kind!==`symlink`).forEach(t=>e.set(t.path,{value:t.path,label:t.name,detail:t.kind===`directory`?o(`workspace.folder`):t.preview_kind||`File`})),a?.([...e.values()])},[s,a,o]);let G=(e,t)=>{let n=s[e];if(!n&&b.has(e))return(0,O.jsx)(`div`,{className:`tushare-tree-loading`,style:{"--tree-level":t},children:(0,O.jsx)(u,{className:`spin`})});if(!n)return null;let r=[...n.entries].sort((e,t)=>Number(t.kind===`directory`)-Number(e.kind===`directory`)||e.name.localeCompare(t.name));return r.length?r.map(e=>{let n=j(e),r=e.kind===`directory`,i=h.has(e.path);return(0,O.jsxs)(`div`,{className:`tushare-tree-node`,children:[(0,O.jsxs)(`button`,{className:C?.path===e.path?`active`:``,style:{"--tree-level":t},onClick:()=>r?U(e):e.kind===`file`&&H(e),disabled:e.kind===`symlink`,title:e.path,children:[(0,O.jsx)(`span`,{className:`tree-disclosure`,children:r?i?(0,O.jsx)(_,{}):(0,O.jsx)(g,{}):null}),(0,O.jsx)(n,{}),(0,O.jsx)(`span`,{children:e.name}),e.kind===`file`&&(0,O.jsx)(`small`,{children:v(e.size)})]}),r&&i&&G(e.path,t+1)]},e.path)}):(0,O.jsx)(`div`,{className:`tushare-tree-empty`,style:{"--tree-level":t},children:o(`workspace.empty`)})};return(0,O.jsxs)(`section`,{className:`workspace-page workspace-browser-page`,children:[N&&(0,O.jsxs)(`div`,{className:`error-banner`,children:[(0,O.jsx)(f,{}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`strong`,{children:o(`workspace.loadFailed`)}),(0,O.jsx)(`span`,{children:N})]}),(0,O.jsx)(`button`,{onClick:W,children:o(`refresh`)})]}),(0,O.jsxs)(`div`,{className:`workspace-browser tushare-browser`,children:[(0,O.jsxs)(`aside`,{className:`workspace-explorer tushare-tree-panel`,children:[(0,O.jsxs)(`header`,{children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(T,{}),(0,O.jsxs)(`span`,{children:[(0,O.jsx)(`strong`,{children:`tushare`}),(0,O.jsx)(`small`,{children:`workspace_dir/tushare`})]})]}),(0,O.jsx)(`button`,{onClick:W,"aria-label":o(`refresh`),children:(0,O.jsx)(d,{className:b.has(A)?`spin`:``})})]}),(0,O.jsx)(`nav`,{children:G(A,0)})]}),(0,O.jsx)(x,{min:180,max:520,className:`context-resizer`}),(0,O.jsx)(`div`,{className:`workspace-preview-panel`,children:C?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`header`,{className:`workspace-file-header`,children:[(0,O.jsxs)(`div`,{children:[(()=>{let e=j(C);return(0,O.jsx)(e,{})})(),(0,O.jsxs)(`span`,{children:[(0,O.jsx)(`strong`,{children:C.name}),(0,O.jsx)(`small`,{children:C.path})]})]}),(0,O.jsx)(`div`,{children:(0,O.jsxs)(`span`,{children:[o(`workspace.size`),(0,O.jsx)(`strong`,{children:v(C.size)})]})})]}),L?(0,O.jsx)(`div`,{className:`workspace-preview-loading`,children:(0,O.jsx)(u,{className:`spin`})}):F?(0,O.jsxs)(`div`,{className:`workspace-preview-message error`,children:[(0,O.jsx)(f,{}),(0,O.jsx)(`strong`,{children:o(`workspace.previewFailed`)}),(0,O.jsx)(`span`,{children:F})]}):E&&(0,O.jsx)(D.Suspense,{fallback:(0,O.jsx)(`div`,{className:`workspace-preview-loading`,children:(0,O.jsx)(u,{className:`spin`})}),children:(0,O.jsx)(k,{preview:E,onPage:e=>void V(C,e)})})]}):(0,O.jsxs)(`div`,{className:`workspace-preview-empty`,children:[(0,O.jsx)(`div`,{children:(0,O.jsx)(c,{})}),(0,O.jsx)(`small`,{children:`FILE PREVIEW`}),(0,O.jsx)(`strong`,{children:o(`workspace.select`)}),(0,O.jsx)(`span`,{children:`CSV\xA0\xA0·\xA0\xA0PARQUET\xA0\xA0·\xA0\xA0JSON`})]})})]})]})}export{M as default,C as n,E as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-3GmWj6nd.js";import{n as t}from"./client-BfOnNqgS.js";var n={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};n.node;var r=e(n),i=(e=``,n,r)=>t.invoke(`list_entries`,{path:e},{target:n,signal:r}),a=(e,n,r)=>t.invoke(`list_task_runs`,{task_type:e},{target:n,signal:r}),o=(e,n=0,r=200,i,a)=>t.invoke(`preview_file`,{path:e,offset:n,limit:r},{target:i,signal:a}),s=(e,n)=>t.invoke(`delete_entries`,{paths:e},{target:n});export{r as a,o as i,a as n,i as r,s as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-3GmWj6nd.js";var t={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};t.node;var n=e(t);export{n as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-3GmWj6nd.js";var t={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};t.node;var n=e(t);export{n as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-3GmWj6nd.js";var t={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};t.node;var n=e(t);export{n as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-3GmWj6nd.js";var t={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};t.node;var n=e(t);export{n as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-3GmWj6nd.js";var t={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};t.node;var n=e(t),r=`axonx-service-token`;function i(){try{return localStorage.getItem(r)?.trim()||``}catch{return``}}var a=class extends Error{status;constructor(e,t){super(e),this.status=t,this.name=`AxonXError`}};async function o(e){try{return await e.json()}catch{throw new a(`Invalid server response (HTTP ${e.status})`,e.status)}}async function s(e){let t=await o(e);if(!e.ok){let n=t&&typeof t==`object`&&`detail`in t?t.detail:void 0;throw new a(typeof n==`string`?n:n==null?`HTTP ${e.status}`:JSON.stringify(n),e.status)}if(!t||typeof t!=`object`||!(`success`in t))throw new a(`Invalid AxonX response envelope`,e.status);let n=t;if(!n.success)throw new a(String(n.answer||`Job failed`),e.status);return n.answer}var c=new class{token=i();setToken(e){this.token=e.trim();try{this.token?localStorage.setItem(r,this.token):localStorage.removeItem(r)}catch{}}hasToken(){return!!this.token}requestHeaders(e){let t=new Headers(e);return this.token&&t.set(`Authorization`,`Bearer ${this.token}`),t}invocation(e,t){return{arguments:e,target:t}}async invoke(e,t={},n={}){return s(await fetch(`/jobs/${encodeURIComponent(e)}`,{method:`POST`,headers:this.requestHeaders({"Content-Type":`application/json`}),body:JSON.stringify(this.invocation(t,n.target)),signal:n.signal}))}async jobs(e={}){let t=e.target?`?${new URLSearchParams({target:e.target})}`:``;return s(await fetch(`/jobs${t}`,{headers:this.requestHeaders(),signal:e.signal}))}eventsUrl(e){return`/jobs/${encodeURIComponent(e)}/events`}};export{n as i,c as n,s as r,a as t};
@@ -0,0 +1 @@
1
+ import{a as e,c as t}from"./jsx-runtime-g_EzXSjx.js";var n=t(e(),1),r=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function i(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:r(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var a=e=>{let t=``,n=!1;for(let r of e){if(r===`-`||r===`_`||r<=` `){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t},o=e=>{let t=a(e);return t.charAt(0).toUpperCase()+t.slice(1)},s=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),c={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function l(e){return e!=null}function u(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??c.width,a=e.size??e.height??c.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],u=[...e.name?[`lucide-${e.name}`]:[],...o],d=t.className?.split(` `).filter(Boolean)??[],f=t.includeDefaultClasses===!1?s(...d):s(`lucide`,...u,...d),p=t.absoluteStrokeWidth?Number(t.strokeWidth??c[`stroke-width`])*Number(e.size??e.width??c.width)/Number(t.size??t.width??c.width):t.strokeWidth??c[`stroke-width`];return[`svg`,{...Object.entries(c).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&l(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&l(t.width)&&{[r(`width`)]:t.width},...`height`in t&&l(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:p,...f&&{[r(`class`)]:f},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function d(e,t={}){return u(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var f=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},p=(0,n.createContext)({}),m=()=>(0,n.useContext)(p),h=(0,n.forwardRef)(({color:e,size:t,width:r,height:i,strokeWidth:a,absoluteStrokeWidth:o,nonScalingStroke:c,className:l=``,children:u,iconNode:p=[],icon:h={node:p,aliases:[],size:24},...g},_)=>{let{size:v=24,strokeWidth:y=2,absoluteStrokeWidth:b=!1,nonScalingStroke:x=!1,color:S=`currentColor`,className:C=``}=m()??{},w=!!u||f(g),[T,E,D=[]]=d(h,{color:e??S,width:r??t??v,height:i??t??v,strokeWidth:a??y,absoluteStrokeWidth:o??b,nonScalingStroke:c??x,className:s(C,l),hasA11yProp:w,attributes:g});return(0,n.createElement)(T,{ref:_,...E},[...D.map(([e,t])=>(0,n.createElement)(e,t)),...Array.isArray(u)?u:[u]])});function g(e,t=[],r=[]){let a=typeof e==`string`?i(e,t,r):e,s=(0,n.forwardRef)(({className:e,...t},r)=>(0,n.createElement)(h,{ref:r,icon:a,className:e,...t}));return a.name&&(s.displayName=o(a.name)),s}export{g as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-3GmWj6nd.js";var t={name:`file-spreadsheet`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]]};t.node;var n=e(t);export{n as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-3GmWj6nd.js";var t={name:`file-braces`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`1oajmo`}],[`path`,{d:`M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`mpwhp6`}]],aliases:[`file-json`]};t.node;var n=e(t),r={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};r.node;var i=e(r),a={name:`hard-drive`,size:24,node:[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]};a.node;var o=e(a);export{i as n,n as r,o as t};
@@ -0,0 +1 @@
1
+ import{i as e,r as t}from"./jsx-runtime-g_EzXSjx.js";var n=e=>typeof e==`string`,r=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},i=e=>e==null?``:String(e),a=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},o=/###/g,s=e=>e&&e.includes(`###`)?e.replace(o,`.`):e,c=e=>!e||n(e),l=(e,t,r)=>{let i=n(t)?t.split(`.`):t,a=0;for(;a<i.length-1;){if(c(e))return{};let t=s(i[a]);!e[t]&&r&&(e[t]=new r),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++a}return c(e)?{}:{obj:e,k:s(i[a])}},u=(e,t,n)=>{let{obj:r,k:i}=l(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=l(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=l(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},d=(e,t,n,r)=>{let{obj:i,k:a}=l(e,t,Object);i[a]=i[a]||[],i[a].push(n)},f=(e,t)=>{let{obj:n,k:r}=l(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},p=(e,t,n)=>{let r=f(e,n);return r===void 0?f(t,n):r},m=(e,t,r)=>{for(let i in t)i!==`__proto__`&&i!==`constructor`&&(Object.prototype.hasOwnProperty.call(e,i)?n(e[i])||e[i]instanceof String||n(t[i])||t[i]instanceof String?r&&(e[i]=t[i]):m(e[i],t[i],r):e[i]=t[i]);return e},h=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),g={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`,"/":`&#x2F;`},_=e=>n(e)?e.replace(/[&<>"'\/]/g,e=>g[e]):e,v=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}},y=[` `,`,`,`?`,`!`,`;`],b=new v(20),x=(e,t,n)=>{t||=``,n||=``;let r=y.filter(e=>!t.includes(e)&&!n.includes(e));if(r.length===0)return!0;let i=b.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},S=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].includes(typeof t)&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},C=e=>e?.replace(/_/g,`-`),w={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},T=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||w,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,`log`,``,!0)}warn(...e){return this.forward(e,`warn`,``,!0)}error(...e){return this.forward(e,`error`,``)}deprecate(...e){return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,r,i){return i&&!this.debug?null:(e=e.map(e=>n(e)?e.replace(/[\r\n\x00-\x1F\x7F]/g,` `):e),n(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},E=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}once(e,t){let n=(...r)=>{t(...r),this.off(e,n)};return this.on(e,n),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n(e,...t)})}},D=class extends E{constructor(e,t={ns:[`translation`],defaultNS:`translation`}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,r,i={}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=i.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:i.ignoreJSONStructure,s;e.includes(`.`)?s=e.split(`.`):(s=[e,t],r&&(Array.isArray(r)?s.push(...r):n(r)&&a?s.push(...r.split(a)):s.push(r)));let c=f(this.data,s);return!c&&!t&&!r&&e.includes(`.`)&&(e=s[0],t=s[1],r=s.slice(2).join(`.`)),c||!o||!n(r)?c:S(this.data?.[e]?.[t],r,a)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.includes(`.`)&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),u(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,r,i={silent:!1}){for(let i in r)(n(r[i])||Array.isArray(r[i]))&&this.addResource(e,t,i,r[i],{silent:!0});i.silent||this.emit(`added`,e,t,r)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.includes(`.`)&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=f(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?m(s,n,i):s={...s,...n},u(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},O={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},k=Symbol(`i18next/PATH_KEY`);function A(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===k?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function j(e,t){let{[k]:n}=e(A()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`,a=t?.enableSelector===`strict`;if(n.length>1&&i){let e=t?.ns,o=a?Array.isArray(e)?e:e?[e]:null:Array.isArray(e)?e:null;if(o&&(a?o:o.length>1?o.slice(1):[]).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var M=e=>!n(e)&&typeof e!=`boolean`&&typeof e!=`number`,N=class e extends E{constructor(e,t={}){super(),a([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=T.create(`translator`),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=M(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let r=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;r===void 0&&(r=`:`);let i=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,a=t.ns||this.options.defaultNS||[],o=r&&e.includes(r),s=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!x(e,r,i);if(o&&!s){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:n(a)?[a]:a};let o=e.split(r);(r!==i||r===i&&this.options.ns.includes(o[0]))&&(a=o.shift()),e=o.join(i)}return{key:e,namespaces:n(a)?[a]:a}}translate(t,r,i){let a=typeof r==`object`?{...r}:r;if(typeof a!=`object`&&this.options.overloadTranslationOptionHandler&&(a=this.options.overloadTranslationOptionHandler(arguments)),typeof a==`object`&&(a={...a}),a||={},t==null)return``;typeof t==`function`&&(t=j(t,{...this.options,...a})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?j(e,{...this.options,...a}):String(e));let o=a.returnDetails===void 0?this.options.returnDetails:a.returnDetails,s=a.keySeparator===void 0?this.options.keySeparator:a.keySeparator,{key:c,namespaces:l}=this.extractFromKey(t[t.length-1],a),u=l[l.length-1],d=a.nsSeparator===void 0?this.options.nsSeparator:a.nsSeparator;d===void 0&&(d=`:`);let f=a.lng||this.language,p=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(f?.toLowerCase()===`cimode`)return p?o?{res:`${u}${d}${c}`,usedKey:c,exactUsedKey:c,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(a)}:`${u}${d}${c}`:o?{res:c,usedKey:c,exactUsedKey:c,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(a)}:c;let m=this.resolve(t,a),h=m?.res,g=m?.usedKey||c,_=m?.exactUsedKey||c,v=[`[object Number]`,`[object Function]`,`[object RegExp]`],y=a.joinArrays===void 0?this.options.joinArrays:a.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,x=a.count!==void 0&&!n(a.count),S=e.hasDefaultValue(a),C=x?this.pluralResolver.getSuffix(f,a.count,a):``,w=a.ordinal&&x?this.pluralResolver.getSuffix(f,a.count,{ordinal:!1}):``,T=x&&!a.ordinal&&a.count===0,E=T&&a[`defaultValue${this.options.pluralSeparator}zero`]||a[`defaultValue${C}`]||a[`defaultValue${w}`]||a.defaultValue,D=h;b&&!h&&S&&(D=E);let O=M(D),k=Object.prototype.toString.apply(D);if(b&&D&&O&&!v.includes(k)&&!(n(y)&&Array.isArray(D))){if(!a.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,D,{...a,ns:l}):`key '${c} (${this.language})' returned an object instead of string.`;return o?(m.res=e,m.usedParams=this.getUsedParamsDetails(a),m):e}if(s){let e=Array.isArray(D),t=e?[]:{},n=e?_:g;for(let e in D)if(Object.prototype.hasOwnProperty.call(D,e)){let r=`${n}${s}${e}`;t[e]=S&&!h?this.translate(r,{...a,defaultValue:M(E)?E[e]:void 0,joinArrays:!1,ns:l}):this.translate(r,{...a,joinArrays:!1,ns:l}),t[e]===r&&(t[e]=D[e])}h=t}}else if(b&&n(y)&&Array.isArray(h))h=h.join(y),h&&=this.extendTranslation(h,t,a,i);else{let e=!1,n=!1;!this.isValidLookup(h)&&S&&(e=!0,h=E),this.isValidLookup(h)||(n=!0,h=c);let r=(a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:h,o=S&&E!==h&&this.options.updateMissing;if(n||e||o){if(this.logger.log(o?`updateKey`:`missingKey`,f,u,x&&!o?`${c}${this.pluralResolver.getSuffix(f,a.count,a)}`:c,o?E:h),s){let e=this.resolve(c,{...a,keySeparator:!1});e&&e.res&&this.logger.warn(`Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.`)}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(a.lng||this.language):e.push(a.lng||this.language);let n=(e,t,n)=>{let i=S&&n!==h?n:r;this.options.missingKeyHandler?this.options.missingKeyHandler(e,u,t,i,o,a):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,u,t,i,o,a),this.emit(`missingKey`,e,u,t,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&x?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,a);T&&a[`defaultValue${this.options.pluralSeparator}zero`]&&!t.includes(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],c+t,a[`defaultValue${t}`]||E)})}):n(e,c,E))}h=this.extendTranslation(h,t,a,m,i),n&&h===c&&this.options.appendNamespaceToMissingKey&&(h=`${u}${d}${c}`),(n||e)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${d}${c}`:c,e?h:void 0,a))}return o?(m.res=h,m.usedParams=this.getUsedParamsDetails(a),m):h}extendTranslation(e,t,r,i,a){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});let o=n(e)&&(r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables),s;if(o){let t=e.match(this.interpolator.nestingRegexp);s=t&&t.length}let c=r.replace&&!n(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(c={...this.options.interpolation.defaultVariables,...c}),e=this.interpolator.interpolate(e,c,r.lng||this.language||i.usedLng,r),o){let t=e.match(this.interpolator.nestingRegexp),n=t&&t.length;s<n&&(r.nest=!1)}!r.lng&&i&&i.res&&(r.lng=this.language||i.usedLng),r.nest!==!1&&(e=this.interpolator.nest(e,(...e)=>a?.[0]===e[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),r)),r.interpolation&&this.interpolator.reset()}let o=r.postProcess||this.options.postProcess,s=n(o)?[o]:o;return e!=null&&s?.length&&r.applyPostProcessor!==!1&&(e=O.handle(s,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e,t={}){let r,i,a,o,s;return n(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?j(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(r))return;let c=this.extractFromKey(e,t),l=c.key;i=l;let u=c.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));let d=t.count!==void 0&&!n(t.count),f=d&&!t.ordinal&&t.count===0,p=t.context!==void 0&&(n(t.context)||typeof t.context==`number`)&&t.context!==``,m=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);u.forEach(e=>{this.isValidLookup(r)||(s=e,!this.checkedLoadedFor[`${m[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(s)&&(this.checkedLoadedFor[`${m[0]}-${e}`]=!0,this.logger.warn(`key "${i}" for languages "${m.join(`, `)}" won't get resolved as namespace "${s}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)),m.forEach(n=>{if(this.isValidLookup(r))return;o=n;let i=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(i,l,n,e,t);else{let e;d&&(e=this.pluralResolver.getSuffix(n,t.count,t));let r=`${this.options.pluralSeparator}zero`,a=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(t.ordinal&&e.startsWith(a)&&i.push(l+e.replace(a,this.options.pluralSeparator)),i.push(l+e),f&&i.push(l+r)),p){let n=`${l}${this.options.contextSeparator||`_`}${t.context}`;i.push(n),d&&(t.ordinal&&e.startsWith(a)&&i.push(n+e.replace(a,this.options.pluralSeparator)),i.push(n+e),f&&i.push(n+r))}}let s;for(;s=i.pop();)this.isValidLookup(r)||(a=s,r=this.getResource(n,e,s,t))}))})}),{res:r,usedKey:i,exactUsedKey:a,usedLng:o,usedNS:s}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],r=e.replace&&!n(e.replace),i=r?e.replace:e;if(r&&e.count!==void 0&&(i={...i,count:e.count}),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(let e of t)delete i[e]}return i}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.startsWith(`defaultValue`)&&e[t]!==void 0)return!0;return!1}},P=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=T.create(`languageUtils`),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(e){if(e=C(e),!e||!e.includes(`-`))return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=C(e),!e||!e.includes(`-`))return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(n(e)&&e.includes(`-`)){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load===`languageOnly`||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>e===r?!0:!e.includes(`-`)&&!r.includes(`-`)?!1:!!(e.includes(`-`)&&!r.includes(`-`)&&e.slice(0,e.indexOf(`-`))===r||e.startsWith(r)&&r.length>1))}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),n(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let r=e[t];return r||=e[this.getScriptPartFromCode(t)],r||=e[this.formatLanguageCode(t)],r||=e[this.getLanguagePartFromCode(t)],r||=e.default,r||[]}toResolveHierarchy(e,t){let r=this.options.fallbackLng,i=Array.isArray(r)?r.join(`|`):r;i!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=i);let a=t===void 0||t===!1||n(t),o=t===void 0&&typeof this.options.fallbackLng==`function`,s=n(e)&&a&&!o,c=null;if(s){let n;n=t===void 0?`undefined`:t===!1?`boolean:false`:`string:${t}`,c=`${e.length}:${e}|${n}`}if(c!==null){let e=this.resolveHierarchyCache[c];if(e!==void 0)return e.slice()}let l=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),u=[],d=e=>{e&&(this.isSupportedCode(e)?u.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return n(e)&&(e.includes(`-`)||e.includes(`_`))?(this.options.load!==`languageOnly`&&d(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&d(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&d(this.getLanguagePartFromCode(e))):n(e)&&d(this.formatLanguageCode(e)),l.forEach(e=>{u.includes(e)||d(this.formatLanguageCode(e))}),c===null?u:(this.resolveHierarchyCache[c]=u,u.slice())}},F={zero:0,one:1,two:2,few:3,many:4,other:5},I={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},L=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=T.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=C(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),I;if(!e.match(/-|_/))return I;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>F[e]-F[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},R=(e,t,r,i=`.`,a=!0)=>{let o=p(e,t,r);return!o&&a&&n(r)&&(o=S(e,r,i),o===void 0&&(o=S(t,r,i))),o},z=e=>e.replace(/\$/g,`$$$$`),B=class{constructor(e={}){this.logger=T.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:g,maxReplaces:v,alwaysFormat:y}=e.interpolation;this.escape=t===void 0?_:t,this.escapeValue=n===void 0||n,this.useRawValueToEscape=r!==void 0&&r,this.prefix=i?h(i):a||`{{`,this.suffix=o?h(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u?h(u):`-`,this.unescapeSuffix=this.unescapePrefix?``:l?h(l):``,this.nestingPrefix=d?h(d):f||h(`$t(`),this.nestingSuffix=p?h(p):m||h(`)`),this.nestingOptionsSeparator=g||`,`,this.maxReplaces=v||1e3,this.alwaysFormat=y!==void 0&&y,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,r,a){let o,s,c,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=e=>{if(!e.includes(this.formatSeparator)){let n=R(t,l,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(n,void 0,r,{...a,...t,interpolationkey:e}):n}let n=e.split(this.formatSeparator),i=n.shift().trim(),o=n.join(this.formatSeparator).trim();return this.format(R(t,l,i,this.options.keySeparator,this.options.ignoreJSONStructure),o,r,{...a,...t,interpolationkey:i})};this.resetRegExp(),!this.escapeValue&&typeof e==`string`&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn(`nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.`);let d=a?.missingInterpolationHandler||this.options.missingInterpolationHandler,f=a?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:a.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>e},{regex:this.regexp,safeValue:e=>this.escapeValue?this.escape(e):e}].forEach(t=>{for(c=0;o=t.regex.exec(e);){let r=o[1].trim();if(s=u(r),s===void 0){if(typeof d==`function`){let t=d(e,o,a);s=n(t)?t:``}else if(a&&Object.prototype.hasOwnProperty.call(a,r))s=``;else if(f){s=o[0];continue}else this.logger.warn(`missed to pass in variable ${r} for interpolating ${e}`),s=``}else!n(s)&&!this.useRawValueToEscape&&(s=i(s));let l=t.safeValue(s);if(e=e.replace(o[0],z(l)),f?(t.regex.lastIndex+=l.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,c++,c>=this.maxReplaces)break}}),e}nest(e,t,r={}){let a,o,s,c=(e,t)=>{let n=this.nestingOptionsSeparator;if(!e.includes(n))return e;let r=e.split(RegExp(`${h(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,s);let a=i.match(/'/g),o=i.match(/"/g);((a?.length??0)%2==0&&!o||(o?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{s=JSON.parse(i),t&&(s={...t,...s})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return s.defaultValue&&s.defaultValue.includes(this.prefix)&&delete s.defaultValue,e};for(;a=this.nestingRegexp.exec(e);){let l=[];s={...r},s=s.replace&&!n(s.replace)?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;let u=/{.*}/s.test(a[1])?a[1].lastIndexOf(`}`)+1:a[1].indexOf(this.formatSeparator);if(u!==-1&&(l=a[1].slice(u).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),a[1]=a[1].slice(0,u)),o=t(c.call(this,a[1].trim(),s),s),o&&a[0]===e&&!n(o))return o;n(o)||(o=i(o)),o||=(this.logger.warn(`missed to resolve ${a[1]} for nesting ${e}`),``),l.length&&(o=l.reduce((e,t)=>this.format(e,t,r.lng,{...r,interpolationkey:a[1].trim()}),o.trim())),e=e.replace(a[0],z(i(o))),this.regexp.lastIndex=0}return e}},V=e=>{let t=e.toLowerCase().trim(),n={};if(e.includes(`(`)){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].slice(0,-1);t===`currency`&&!i.includes(`:`)?n.currency||=i.trim():t===`relativetime`&&!i.includes(`:`)?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},H=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(C(r),i),t[o]=s),s(n)}},U=e=>(t,n,r)=>e(C(n),r)(t),W=class{constructor(e={}){this.logger=T.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?H:U;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=H(t)}format(e,t,n,r={}){if(!t||e==null)return e;let i=t.split(this.formatSeparator),a=[];for(let e=0;e<i.length;e++){let t=i[e];for(;t.indexOf(`(`)>-1&&!t.includes(`)`)&&e+1<i.length;)t=`${t}${this.formatSeparator}${i[++e]}`;a.push(t)}return a.reduce((e,t)=>{let{formatName:i,formatOptions:a}=V(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${i}`),e},e)}},G=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},K=class extends E{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=T.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{d(n.loaded,[i],a),G(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read(e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t,r={},i){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),i&&i();n(e)&&(e=this.languageUtils.toResolveHierarchy(e)),n(t)&&(t=[t]);let a=this.queueLoad(e,t,r,i);if(!a.toLoad.length)return a.pending.length||i(),null;a.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);return}if(n!=null&&n!==``){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}},q=()=>({debug:!1,initAsync:!0,ns:[`translation`],defaultNS:[`translation`],fallbackLng:[`dev`],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:`all`,preload:!1,keySeparator:`.`,nsSeparator:`:`,pluralSeparator:`_`,contextSeparator:`_`,enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:`fallback`,saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]==`object`&&(t=e[1]),n(e[1])&&(t.defaultValue=e[1]),n(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),J=e=>(n(e.ns)&&(e.ns=[e.ns]),n(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),n(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes(`cimode`)&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),e),Y=()=>{},X=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},Z=class e extends E{constructor(e={},t){if(super(),this.options=J(e),this.services={},this.logger=T,this.modules={external:[]},X(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&(n(e.ns)?e.defaultNS=e.ns:e.ns.includes(`translation`)||(e.defaultNS=e.ns[0]));let i=q();this.options={...i,...this.options,...J(e)},this.options.interpolation={...i.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!=`function`&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler);let a=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?T.init(a(this.modules.logger),this.options):T.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:W;let t=new P(this.options);this.store=new D(this.options.resources,this.options);let n=this.services;n.logger=T,n.resourceStore=this.store,n.languageUtils=t,n.pluralResolver=new L(t,{prepend:this.options.pluralSeparator}),e&&(n.formatter=a(e),n.formatter.init&&n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new B(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new K(a(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(n.languageDetector=a(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=a(this.modules.i18nFormat),n.i18nFormat.init&&n.i18nFormat.init(this)),this.translator=new N(this.services,this.options),this.translator.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||=Y,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn(`init: no languageDetector is used and no lng is defined`),[`getResource`,`hasResourceBundle`,`getResourceBundle`,`getDataByLanguage`].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let o=r(),s=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn(`init: i18next is already initialized. You should call init just once!`),this.isInitialized=!0,this.options.isClone||this.logger.log(`initialized`,this.options),this.emit(`initialized`,this.options),o.resolve(n),t(e,n)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?s():setTimeout(s,0),o}loadResources(e,t=Y){let r=t,i=n(e)?e:this.language;if(typeof e==`function`&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(i?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return r();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&(e.includes(t)||e.push(t))})};i?t(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(e)})}else r(null)}reloadResources(e,t,n){let i=r();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=Y,this.services.backendConnector.reload(e,t,e=>{i.resolve(),n(e)}),i}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&O.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&![`cimode`,`dev`].includes(e)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(![`cimode`,`dev`].includes(t)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&!this.languages.includes(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let i=r();this.emit(`languageChanging`,e);let a=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},o=(n,r)=>{r?this.isLanguageChangingTo===e&&(a(r),this.translator.changeLanguage(r),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,r),this.logger.log(`languageChanged`,r)):this.isLanguageChangingTo=void 0,i.resolve((...e)=>this.t(...e)),t&&t(n,(...e)=>this.t(...e))},s=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let r=n(t)?t:t&&t[0],i=this.store.hasLanguageSomeTranslations(r)?r:this.services.languageUtils.getBestMatchFromCodes(n(t)?[t]:t);i&&(this.language||a(i),this.translator.language||this.translator.changeLanguage(i),this.services.languageDetector?.cacheUserLanguage?.(i)),this.loadResources(i,e=>{o(e,i)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(e),i}getFixedT(e,t,r,i){let a=i?.scopeNs,o=(e,t,...n)=>{let i;i=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(n)),i.lng=i.lng||o.lng,i.lngs=i.lngs||o.lngs;let s=i.ns!==void 0&&i.ns!==null;i.ns=i.ns||o.ns,i.keyPrefix!==``&&(i.keyPrefix=i.keyPrefix||r||o.keyPrefix);let c={...this.options,...i};Array.isArray(a)&&!s&&(c.ns=a),typeof i.keyPrefix==`function`&&(i.keyPrefix=j(i.keyPrefix,c));let l=this.options.keySeparator||`.`,u;return i.keyPrefix&&Array.isArray(e)?u=e.map(e=>(typeof e==`function`&&(e=j(e,c)),`${i.keyPrefix}${l}${e}`)):(typeof e==`function`&&(e=j(e,c)),u=i.keyPrefix?`${i.keyPrefix}${l}${e}`:e),this.t(u,i)};return n(e)?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=r,o}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn(`hasLoadedNamespace: i18next was not initialized`,this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`,this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let i=r();return this.options.ns?(n(e)&&(e=[e]),e.forEach(e=>{this.options.ns.includes(e)||this.options.ns.push(e)}),this.loadResources(e=>{i.resolve(),t&&t(e)}),i):(t&&t(),Promise.resolve())}loadLanguages(e,t){let i=r();n(e)&&(e=[e]);let a=this.options.preload||[],o=e.filter(e=>!a.includes(e)&&this.services.languageUtils.isSupportedCode(e));return o.length?(this.options.preload=a.concat(o),this.loadResources(e=>{i.resolve(),t&&t(e)}),i):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`),n=this.services?.languageUtils||new P(q());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.includes(n.getLanguagePartFromCode(e))||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=Y){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new D(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...q().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new B(n)}return a.translator=new N(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();Z.createInstance,Z.dir,Z.init,Z.loadResources,Z.reloadResources,Z.use,Z.changeLanguage,Z.getFixedT,Z.t,Z.exists,Z.setDefaultNamespace,Z.hasLoadedNamespace,Z.loadNamespaces,Z.loadLanguages;var Q={type:`3rdParty`,init(n){e(n.options.react),t(n)}},ee={shell:{currentPath:`Current path`,local:`Local`,online:`Online`,offline:`Offline`,connecting:`Connecting`,selectResource:`Select resource`,filePreview:`File preview`,dataPreview:`Data preview`,apiCall:`API call`,configureSubmit:`Configure & submit`,openSettings:`Open settings`,settings:`Settings`,expandNavigation:`Expand navigation`,collapseNavigation:`Collapse navigation`,openNavigation:`Open navigation`,closeNavigation:`Close navigation`,loading:`Loading…`,groups:{run:`Run`,submit:`Submit`,research:`Research`},navigation:{tasks:`Task management`,resources:`Machine resources`,agent:`Agent`,taskDefs:`Submit task`,apis:`API interfaces`,raw:`Tushare data`,etl:`ETL`,factors:`Factor analysis`,train:`Model training`,predict:`Offline prediction`,backtest:`Offline backtest`,compare:`Strategy comparison`},switchLanguageLabel:`中文`},pages:{submit:`Submit Task`},taskTitle:`Task operations`,taskLead:`Follow every compute run from queue to output.`,refresh:`Refresh`,refreshNow:`Refresh now`,autoRefresh:`Auto refresh`,nextRefresh:`Refresh in {{seconds}}s`,search:`Search Task ID, type, or PID`,allStates:`All states`,allTypes:`All types`,active:`In progress`,succeeded:`Succeeded`,attention:`Needs attention`,taskId:`TASK ID`,type:`TYPE`,state:`STATUS`,progress:`PROGRESS`,step:`Step`,started:`STARTED`,duration:`DURATION`,formats:{duration:{seconds:`{{seconds}}s`,minutesSeconds:`{{minutes}}m {{seconds}}s`,hoursMinutes:`{{hours}}h {{minutes}}m`}},details:`Details`,cancel:`Terminate Task`,cancelling:`Terminating`,copyTaskId:`Copy Task ID`,copied:`Copied`,selectAll:`Select all deletable tasks`,selectTask:`Select task {{taskId}}`,enableMultiSelect:`Select multiple`,finishSelection:`Done`,selectedCount:`{{count}} selected`,deleteConfirm:`Permanently delete {{count}} selected tasks?`,deleteHint:`Task directories, status, artifacts, and dedicated logs will be removed.`,confirmDelete:`Delete`,deleting:`Deleting`,deletePartial:`Deleted {{deleted}}/{{total}} records; the rest may still be running or no longer exist`,noTasks:`No task runs yet`,noTasksHint:`Submit a Task and its status will appear here automatically.`,noMatches:`No tasks match these filters`,requestFailed:`Unable to load task status`,staleHint:`Showing the last successfully loaded data.`,retry:`Retry`,taskDetails:`Task details`,close:`Close`,steps:`Execution steps`,result:`Output`,error:`Error`,notStarted:`Not started`,cancelConfirm:`Terminate this running Task?`,confirmCancel:`Terminate Task`,cancelFailed:`Task termination failed: the process may have exited or is no longer managed by this service`,submitTitle:`Launch a new task`,submitLead:`Choose an installed Task, configure its inputs, and hand it to AxonX for isolated execution.`,taskCatalog:`INSTALLED TASKS`,tasksAvailable:`{{count}} available`,findTask:`Search installed Tasks`,nativeTasks:`Native tasks`,pluginTasks:`Plugin tasks`,configure:`Run configuration`,output:`Expected output`,required:`Required`,optional:`Optional`,choose:`Choose an option`,jsonHint:`Enter valid JSON`,submit:`Submit run`,submitting:`Submitting`,submitted:`Task handed to AxonX`,submittedHint:`Its runtime status will appear in Task management after the worker starts.`,viewTasks:`View task status`,catalogFailed:`Unable to load installed Tasks`,noInstalled:`No installed Tasks found`,system:`System`,light:`Light`,dark:`Dark`,cpuCapacity:`CPU cores`,memoryCapacity:`Total memory`,online:`Online`,offline:`Offline`,cpuUsage:`CPU usage`,memoryUsage:`Memory usage`,coresUsed:`Cores used`,available:`Available`,totalCores:`Logical cores`,physicalCores:`Physical cores`,usedMemory:`Used memory`,totalMemory:`Total capacity`,gpuResources:`GPU resources`,noGpu:`GPU metrics are unavailable on this platform`,noGpuHint:`macOS or virtualized environments may not expose stable GPU telemetry.`,gpuUtilization:`Compute usage`,gpuMemory:`Memory usage`,states:{queued:`Queued`,running:`Running`,succeeded:`Succeeded`,failed:`Failed`,cancelled:`Cancelled`},types:{base:`Base`,api:`API download`,etl:`ETL`,analysis:`Analysis`,train:`Training`,predict:`Prediction`,inference:`Inference`,backtest:`Backtest`},submitPage:{selectTask:`Select a Task`,selectTaskHint:`Review its inputs and submit a run`,submitAnother:`Submit another`,loadingCatalog:`Loading Task catalog…`},schemaForm:{sourceTasksPlaceholder:`Task IDs separated by commas (optional)`},machine:{cpuMemory:`CPU & memory`},tasks:{loadingRuntime:`Loading AxonX runtime…`},taskDetail:{refreshLog:`Refresh log`,openResearch:`View research`,loadEarlier:`Load earlier`,follow:`Follow tail`,copy:`Copy`,copied:`Copied`,logEmpty:`The log is empty for now`,logUnavailable:`No readable log is attached to this task`,logError:`Unable to read log`,loaded:`Loaded`,of:`/`,bounded:`The browser keeps about 512 KB; older content is discarded automatically.`,back:`Back to task runs`,refreshing:`Refreshing`,taskMissing:`Unable to load task details`,config:`Task configuration`,configSummary:`{{count}} execution parameters`,noConfig:`This task has no additional configuration`,copyConfig:`Copy config`,runDetails:`Run details`,completedSteps:`steps completed`,logs:`Logs`,relations:`Relationships`,relationsSummary:`Inspect upstream and downstream lineage`,task:`Task`,snapshot:`Snapshot`},api:{interfaces:`Interfaces`,search:`Search APIs`,select:`Select an API`,noDescription:`No description`,available:`Available`,requestParameters:`Request parameters`,calling:`Calling`,call:`Call API`,response:`Response`},runtimeSettings:{close:`Close settings`,authentication:`AUTHENTICATION`,serviceToken:`Local service token`,tokenRequired:`This service requires a Bearer token. Enter the token.`,tokenInvalid:`The token is invalid. Enter the new token.`,tokenHelp:`Saved in this browser for the local backend. Remote tokens are managed by the backend targets configuration.`,tokenConfigured:`Token configured`,tokenPlaceholder:`Enter Bearer token`,applyToken:`Apply`,clearToken:`Clear`,currentMachine:`CURRENT MACHINE`,environment:`Environment`,versionSource:`Version and source details`,loading:`Loading environment…`,unavailable:`Environment unavailable`,axonxVersion:`AXONX VERSION`,endpoint:`ENDPOINT`},runtime:{environment:`Environment`,environmentLead:`AxonX and source revision for the current machine`,environmentUnavailable:`Environment unavailable`,versionInformation:`Version information`,axonxVersion:`AXONX VERSION`,endpoint:`ENDPOINT`,machineResources:`Machine resources`,refreshMachine:`Refresh machine resources`,machineUnavailable:`Machine unavailable`},home:{quantAria:`Quant research framework`,quantTitle:`Quant research`,quantLead:`From market data to strategy validation`,brandAria:`AxonX Agent-Native Quant Harness`,brandTitle:`A harness for quant research`,brandLead:`Package research capabilities as plugins and connect Agents to Jobs through CLI and MCP, closing the loop from code changes to Task execution and result validation.`,submitTask:`Submit Task`,manageTasks:`Manage Tasks`,capabilitiesAria:`Harness framework capabilities`,capabilitiesTitle:`Harness capabilities`,capabilitiesLead:`A plugin-driven, Agent-assisted research loop`,steps:{raw:{title:`Market data`,detail:`Prices and fundamentals`},etl:{title:`ETL features`,detail:`Clean data and build features`},factors:{title:`Factor analysis`,detail:`Evaluate factor performance`},train:{title:`Model training`,detail:`Fit and evaluate models`},predict:{title:`Prediction`,detail:`Generate predictions`},backtest:{title:`Backtesting`,detail:`Validate strategy performance`}},features:{plugin:{title:`Plugin extensions`,detail:`Local changes · independent install · capability registration`},machine:{title:`Multiple machines`,detail:`Resource monitoring · remote runs · unified management`},job:{title:`Declarative Job API`,detail:`Schema-driven · CLI / MCP access`},task:{title:`Task lifecycle`,detail:`Submit · status and logs · cancel and clean up`},agent:{title:`Agent research workflow`,detail:`Understand context · edit code · invoke AxonX`},feedback:{title:`Execution feedback loop`,detail:`Diagnose logs · inspect artifacts · iterate`}}},workspace:{folder:`Folder`,empty:`This folder is empty`,select:`Select a file to preview it`,loadFailed:`Unable to read the Tushare directory`,previewFailed:`Unable to preview file`,size:`Size`},workspacePreview:{unsupported:`Preview is not supported for this file`,parquet:`Parquet data preview`,rowCount:`Rows`,rowGroups:`Row groups`,fields:`Fields`,schema:`Schema`,truncated:`Large file: showing the first 512 KiB`,invalidJson:`Invalid JSON`,invalidYaml:`Invalid YAML`,frontmatter:`Frontmatter`,rows:`rows`,previous:`Previous`,next:`Next`,size:`File size`,list:`List`,dict:`Dict`,items:`items`,keys:`keys`},research:{pages:{analysis:{title:`Analysis results`,lead:`Inspect analysis scores and artifacts`},backtest:{title:`Backtest analytics`,lead:`Equity curves, performance metrics, and daily holdings`},etl:{title:`ETL datasets`,lead:`Inspect dataset size, columns, and artifacts`},train:{title:`Model registry`,lead:`Inspect models, metrics, and effective parameters`},predict:{title:`Predictions`,lead:`Inspect sample coverage, columns, and artifacts`}},columns:{trade_date:`Trading date`,ts_code:`Stock code`,pred:`Model ranking score`,actual_return:`Next day adjusted return · decimal`,label_valid:`Whether realized return is valid`,name:`Stock name`,is_buyable:`Whether buyable on this date`},noKindTasks:`No {{kind}} tasks`,refresh:`Refresh`,unable_to_load_artifacts:`Unable to load artifacts`,retry:`Retry`,task_versions:`Task versions`,search_task_id:`Search task_id`,select:`Select`,metadata_unavailable:`Metadata unavailable`,selected:` selected`,done:`Done`,deselect:`Deselect`,select_all:`Select all`,delete:`Delete`,select_a_task_version:`Select a task version`,its_data_and_artifacts_will:`Its data and artifacts will appear here.`,task_artifacts_will_appear_here:`Task artifacts will appear here automatically.`,cancel:`Cancel`,delete_selected_task_versions:`Delete selected task versions?`,delete_this_task_version:`Delete this task version?`,the_task_directories_and_all:`The task directories and all artifact files inside them will be permanently deleted. This cannot be undone.`,delete_failed:`Delete failed`,deleting:`Deleting…`,copy_task_id:`Copy Task ID`,compare:`Compare`,artifacts_ready:`Artifacts ready`,upstream_tasks:`UPSTREAM TASKS`,open_upstream_task:`Open upstream task`,copy_upstream_task_id:`Copy upstream task ID`,factor_scores:`Factor scores`,metric:`Metric`,label:`Label`,factor:`Factor`,magnitude:`Magnitude`,score:`Score`,prediction_overview:`Prediction overview`,prediction_score_mean:`Prediction score · mean`,min:`Min`,median:`Median`,max:`Max`,sample_coverage:`Sample coverage`,symbols_days:`Symbols / days`,buyable:`Buyable`,valid_return:`Valid return`,backtest_candidates:`Backtest candidates`,index_weights:`Index weights`,symbols:`symbols`,days:`days`,result_columns:`Result columns`,index_weight_decimal:`Index weight · decimal`,pred_is_a_ranking_score:`pred is a ranking score, not an expected return or probability.`,train_rows:`TRAIN ROWS`,days_2:`DAYS`,prediction_rows:`PREDICTION ROWS`,rows:`ROWS`,feature_columns:`Feature columns`,label_columns:`Label columns`,target_columns:`Target columns`,model:`MODEL`,start:`START`,end:`END`,artifacts:`ARTIFACTS`,effective_parameters:`Effective parameters`,training_curves:`Training curves`,no_training_curve_is_available:`No training curve is available for this task`,left_axis_l2_mean_squared:`Left axis L2: mean squared error; right axis L1: mean absolute error. Solid lines show training, dashed lines validation. Do not compare heights across axes.`,output_files:`Output files`,input_directory:`Input directory`,artifacts_2:`Artifacts`},compare:{tabs:{overview:`Overview`,returns:`Return & risk`,periods:`Periods`,quality:`Signal quality`,trading:`Trading & holdings`},metric:`Metric`,difference_b_a:`Difference B − A`,common_window:`COMMON WINDOW`,transaction_costs_differ:`Transaction costs differ`,annualization_differs_comparison_uses_252:`Annualization differs; comparison uses 252 days`,prediction_sources_differ:`Prediction sources differ`,only_shared_days_with_valid:`Only shared days with valid returns are compared`,net_cumulative_return:`Net cumulative return`,net_annualized_return:`Net annualized return`,annualized_volatility:`Annualized volatility`,max_drawdown:`Max drawdown`,win_rate:`Win rate`,average_turnover:`Average turnover`,strategy_comparison:`Strategy comparison`,compare_backtests_on_shared_trading:`Compare backtests on shared trading days and portfolio size`,task_versions:`Task versions`,refresh_tasks:`Refresh tasks`,search_task_id:`Search task_id`,click_two_versions_to_compare:`Click two versions to compare; click again to remove`,loading_tasks:`Loading tasks`,no_backtests_available:`No backtests available`,metadata_unavailable:`Metadata unavailable`,backtest_task:`Backtest task`,choose_from_the_list:`Choose from the list`,swap_a_and_b:`Swap A and B`,select_two_backtests_to_compare:`Select two backtests to compare`,only_one_backtest_is_available:`Only one backtest is available; run another to compare`,click_two_task_versions_on:`Click two task versions on the left to assign A and B`,unable_to_load_backtests:`Unable to load backtests`,calculating_shared_window:`Calculating shared window`,no_shared_top_n:`No shared Top N`,no_shared_valid_trading_days:`No shared valid trading days`,shared_window:`Shared window`,days:`days`,from:`From`,to:`To`,reset_dates:`Reset dates`,no_shared_days_in_this:`No shared days in this date range`,comparison_dimensions:`Comparison dimensions`,difference:`Difference`,cumulative_net_return_shared_start:`Cumulative net return · shared start`,return_basis:`Return basis`,net:`Net`,gross:`Gross`,cumulative_net_return:`Cumulative net return`,cumulative_gross_return:`Cumulative gross return`,net_drawdown:`Net drawdown`,period:`Period`,year:`Year`,quarter:`Quarter`,month:`Month`,days_2:`Days`,net_return:`Net return`,signal_trend:`Signal trend`,mean:`mean`,average_daily_cost:`Average daily cost`,daily_turnover:`Daily turnover`,holdings_comparison:`Holdings comparison`,trading_day:`Trading day`,shared_holdings:`Shared holdings`,overlap:`Overlap`,only:`only`,code:`Code`,name:`Name`,daily_return:`Daily return`},backtest:{dateRange:{start:`Start date`,end:`End date`},sortBy:`Sort {{label}} {{direction}}`,ascending:`ascending`,descending:`descending`,topNAllMetrics:`Top {{topN}} · All metrics`,metrics:{net_cumulative_return:`Net cumulative return`,net_annualized_return:`Net annualized return`,net_annualized_volatility:`Annualized volatility`,net_max_drawdown:`Max drawdown`,net_win_rate:`Win rate`,average_turnover:`Average turnover`,gross_cumulative_return:`Gross cumulative return`,gross_sharpe:`Sharpe`,trading_days:`Trading days`,ic_mean:`IC mean`,icir:`ICIR`,rank_ic_mean:`RankIC mean`,rank_icir:`RankICIR`},marketAverage:`Market average`,errors:{parquetRequired:`Backtest artifacts must be Parquet files`,missingDailySummary:`Backtest metadata is missing daily or summary artifacts`,missingDaily:`Backtest metadata is missing the daily artifact`},noSummaryData:`NO SUMMARY DATA`,daily_mean_in_range:`Daily mean in range`,unable_to_load_backtest_artifacts:`Unable to load backtest artifacts`,daily_parquet_is_empty:`daily.parquet is empty`,gross_return:`Gross return`,net_return:`Net return`,model_quality:`Model quality`,overall:`Overall`,yearly:`Yearly`,quarterly:`Quarterly`,monthly:`Monthly`,from:`From`,to:`To`,days:`days`,reset:`Reset`,cumulative_gross_return:`Cumulative gross return`,arithmetic_sum_rebased_to_zero:`Arithmetic sum rebased to zero`,compounded_net_return:`Compounded net return`,strategies_include_turnover_costs:`Strategies include turnover costs`,candidate_universe:`Candidate universe`,return_percentile_relevance:`Return-percentile relevance`,stocks:`stocks`,reset_holdings_sorting:`Reset holdings sorting`,reset_sorting:`Reset sorting`,reset_sort:`Reset sort`,unlock:`Unlock`,show_the_latest_day_in:`Show the latest day in the selected range`,latest:`Latest`,code:`Code`,name:`Name`,prediction:`Prediction`,return:`Return`,weight:`Weight`,select_top_n:`Select Top N`,independent_of_top_n:`INDEPENDENT OF TOP N`,overall_metrics:`Overall metrics`,overall_metric_details:`Overall metric details`,reset_overall_metric_sorting:`Reset overall metric sorting`,period:`Period`,filter_by_portfolio_size:`FILTER BY PORTFOLIO SIZE`,metrics_2:`metrics`,all_top_n_metrics:`All Top N metrics`,scroll_sideways:`Scroll sideways`,reset_table_sorting:`Reset table sorting`,overall_metrics_by_top_n:`Overall metrics by Top N`,top_n_period_metric_details:`Top N period metric details`},agent:{sessions:`Sessions`,newChat:`New chat`,noSessions:`No sessions yet`,conversation:`AxonX conversation`,loadingConversation:`Restoring conversation…`,welcomeTitle:`Start with your workspace`,welcomeLead:`Ask about code, tasks, logs, and artifacts. AxonX will use workspace tools as needed.`,working:`AxonX is working`,composerPlaceholder:`Message AxonX…`,composerHint:`Enter to send, Shift + Enter for a new line`,send:`Send`,stop:`Stop generation`,cancelled:`This turn was cancelled`,closeSessions:`Close session list`,sessionMenu:`Session actions`,rename:`Rename`,tag:`Set tag`,fork:`Fork`,delete:`Delete session`,renamePrompt:`Enter a new session title`,tagPrompt:`Enter a tag; leave blank to clear it`,deleteConfirm:`Permanently delete this session?`,interpretTask:`Ask AxonX`,taskPrompt:`Analyze task {{taskId}}: call get_task_context first, inspect metadata or logs as needed, then summarize its status, dependencies, risks, and next steps.`,roles:{user:`You`,assistant:`AxonX`,system:`System`}},taskGraph:{copy_task_id:`Copy task ID`,kinds:{base:`Base task`,api:`API`,etl:`ETL`,analysis:`Factor analysis`,train:`Training`,predict:`Prediction`,inference:`Inference`,backtest:`Backtest`},loading_task_relationships:`Loading task relationships…`,unable_to_load_relationships:`Unable to load relationships`,locate_current_task:`Locate current task`,some_tasks_use_provisional_relationships:`Some tasks use provisional relationships until final metadata is available.`,open_task:`Open task`},trainingCurve:{left_axis:`Left axis`,right_axis:`Right axis`,train:`Train `,validation:`Validation `},common:{start:`Start`,resizePanel:`Resize panel`,true:`True`,false:`False`}},te={shell:{currentPath:`当前位置`,local:`本机`,online:`在线`,offline:`离线`,connecting:`连接中`,selectResource:`选择资源`,filePreview:`文件预览`,dataPreview:`数据预览`,apiCall:`接口调用`,configureSubmit:`参数与提交`,openSettings:`打开设置`,settings:`设置`,expandNavigation:`展开导航`,collapseNavigation:`收起导航`,openNavigation:`打开导航`,closeNavigation:`关闭导航`,loading:`正在加载…`,groups:{run:`运行`,submit:`提交`,research:`研究`},navigation:{tasks:`任务管理`,resources:`机器资源`,agent:`智能体`,taskDefs:`提交任务`,apis:`API接口`,raw:`Tushare数据`,etl:`ETL`,factors:`因子分析`,train:`模型训练`,predict:`离线预测`,backtest:`离线回测`,compare:`策略对比`},switchLanguageLabel:`EN`},pages:{submit:`提交任务`},taskTitle:`任务运行中心`,taskLead:`观察每一次计算,从排队到产出。`,refresh:`刷新`,refreshNow:`立即刷新`,autoRefresh:`自动刷新`,nextRefresh:`{{seconds}} 秒后刷新`,search:`搜索 Task ID、类型或 PID`,allStates:`全部状态`,allTypes:`全部类型`,active:`进行中`,succeeded:`已成功`,attention:`需关注`,taskId:`TASK ID`,type:`类型`,state:`状态`,progress:`进度`,step:`步骤`,started:`开始时间`,duration:`耗时`,formats:{duration:{seconds:`{{seconds}} 秒`,minutesSeconds:`{{minutes}} 分 {{seconds}} 秒`,hoursMinutes:`{{hours}} 小时 {{minutes}} 分`}},details:`详情`,cancel:`终止任务`,cancelling:`终止中`,copyTaskId:`复制 Task ID`,copied:`已复制`,selectAll:`选择全部可删除任务`,selectTask:`选择任务 {{taskId}}`,enableMultiSelect:`开启多选`,finishSelection:`完成多选`,selectedCount:`已选 {{count}} 项`,deleteConfirm:`确定彻底删除选中的 {{count}} 个任务?`,deleteHint:`任务目录、状态、产物及其独占日志会一并删除。`,confirmDelete:`确认删除`,deleting:`删除中`,deletePartial:`仅删除了 {{deleted}}/{{total}} 条记录,其余任务可能仍在运行或已不存在`,noTasks:`暂无运行记录`,noTasksHint:`提交一个 Task 后,状态会自动出现在这里。`,noMatches:`没有符合筛选条件的任务`,requestFailed:`无法读取任务状态`,staleHint:`当前显示最近一次成功获取的数据。`,retry:`重试`,taskDetails:`Task 详情`,close:`关闭`,steps:`执行步骤`,result:`输出结果`,error:`错误信息`,notStarted:`尚未开始`,cancelConfirm:`确定终止这个运行中的 Task?`,confirmCancel:`确认终止`,cancelFailed:`任务终止失败:进程可能已退出或不再由当前服务管理`,submitTitle:`启动一个新任务`,submitLead:`选择已安装的 Task,配置参数,然后交给 AxonX 独立执行。`,taskCatalog:`已安装 TASK`,tasksAvailable:`{{count}} 个可用`,findTask:`搜索已安装 Task`,nativeTasks:`原生任务`,pluginTasks:`插件任务`,configure:`运行配置`,output:`预期输出`,required:`必填`,optional:`选填`,choose:`请选择`,jsonHint:`请输入合法 JSON`,submit:`提交运行`,submitting:`正在提交`,submitted:`任务已交给 AxonX`,submittedHint:`工作进程启动后,运行状态会自动出现在任务管理页。`,viewTasks:`查看任务状态`,catalogFailed:`无法读取已安装的 Task`,noInstalled:`没有发现已安装的 Task`,system:`跟随系统`,light:`浅色`,dark:`深色`,cpuCapacity:`CPU 核心`,memoryCapacity:`总内存`,online:`在线`,offline:`离线`,cpuUsage:`CPU 使用率`,memoryUsage:`内存使用率`,coresUsed:`已用核心`,available:`可用`,totalCores:`逻辑核心`,physicalCores:`物理核心`,usedMemory:`已使用`,totalMemory:`总容量`,gpuResources:`GPU 资源`,noGpu:`当前平台未提供 GPU 指标`,noGpuHint:`macOS 或虚拟化环境可能无法提供稳定的 GPU 指标。`,gpuUtilization:`计算使用率`,gpuMemory:`显存使用率`,states:{queued:`排队中`,running:`运行中`,succeeded:`成功`,failed:`失败`,cancelled:`已取消`},types:{base:`基础`,api:`API 数据下载`,etl:`数据处理`,analysis:`分析`,train:`训练`,predict:`预测`,inference:`在线推理`,backtest:`回测`},submitPage:{selectTask:`选择一个 Task`,selectTaskHint:`查看说明、配置参数并提交运行`,submitAnother:`再提交一次`,loadingCatalog:`正在加载 Task 目录…`},schemaForm:{sourceTasksPlaceholder:`多个 Task ID 用英文逗号分隔,可留空`},machine:{cpuMemory:`CPU 与内存`},tasks:{loadingRuntime:`正在加载 AxonX 运行状态…`},taskDetail:{refreshLog:`刷新日志`,openResearch:`查看研究`,loadEarlier:`加载更早日志`,follow:`跟随末尾`,copy:`复制`,copied:`已复制`,logEmpty:`日志暂时为空`,logUnavailable:`该任务没有可读取的日志`,logError:`日志读取失败`,loaded:`已加载`,of:`/`,bounded:`浏览器最多保留约 512 KB,较早内容会自动丢弃。`,back:`返回任务列表`,refreshing:`刷新中`,taskMissing:`无法读取任务详情`,config:`任务配置`,configSummary:`{{count}} 项执行参数`,noConfig:`本任务没有额外配置参数`,copyConfig:`复制配置`,runDetails:`运行详情`,completedSteps:`个步骤已完成`,logs:`日志`,relations:`关系`,relationsSummary:`查看上下游任务血缘`,task:`任务`,snapshot:`完整快照`},api:{interfaces:`接口`,search:`搜索 API`,select:`选择一个 API`,noDescription:`无接口说明`,available:`可调用`,requestParameters:`请求参数`,calling:`调用中`,call:`调用 API`,response:`响应`},runtimeSettings:{close:`关闭设置`,authentication:`身份验证`,serviceToken:`本机服务令牌`,tokenRequired:`此服务需要 Bearer Token,请输入令牌。`,tokenInvalid:`令牌已失效,请输入新令牌。`,tokenHelp:`用于连接本机后端,保存在此浏览器中。远程令牌由后端 targets 配置管理。`,tokenConfigured:`已配置令牌`,tokenPlaceholder:`输入 Bearer Token`,applyToken:`应用`,clearToken:`清除`,currentMachine:`当前机器`,environment:`运行环境`,versionSource:`版本与代码信息`,loading:`正在读取运行环境…`,unavailable:`无法读取运行环境`,axonxVersion:`AxonX 版本`,endpoint:`服务地址`},runtime:{environment:`运行环境`,environmentLead:`当前机器的 AxonX 与代码版本信息`,environmentUnavailable:`无法读取运行环境`,versionInformation:`版本信息`,axonxVersion:`AxonX 版本`,endpoint:`服务地址`,machineResources:`机器资源`,refreshMachine:`刷新机器资源`,machineUnavailable:`无法连接当前机器`},home:{quantAria:`量化基础框架`,quantTitle:`量化基础框架`,quantLead:`从数据准备到策略验证`,brandAria:`AxonX Agent 原生量化 Harness 框架`,brandTitle:`量化 Harness 框架`,brandLead:`以插件承载研究能力,通过 CLI / MCP 连接 Agent 与 Job,形成代码修改、任务运行与效果验证闭环。`,submitTask:`提交任务`,manageTasks:`任务管理`,capabilitiesAria:`Harness 框架能力`,capabilitiesTitle:`Harness 框架能力`,capabilitiesLead:`插件驱动、Agent 协作的研发闭环`,steps:{raw:{title:`Tushare 数据`,detail:`行情与基础数据`},etl:{title:`ETL 特征构建`,detail:`清洗数据,生成特征`},factors:{title:`因子分析`,detail:`检验因子表现`},train:{title:`模型训练`,detail:`拟合模型,评估效果`},predict:{title:`离线预测`,detail:`生成预测结果`},backtest:{title:`离线回测`,detail:`验证策略表现`}},features:{plugin:{title:`插件化扩展`,detail:`局部开发 · 独立安装 · 能力注册`},machine:{title:`多机器节点`,detail:`资源监测 · 远端运行 · 统一管理`},job:{title:`声明式 Job 接口`,detail:`Schema 驱动 · CLI / MCP 双入口`},task:{title:`Task 生命周期`,detail:`提交执行 · 状态日志 · 取消清理`},agent:{title:`Agent 研发协作`,detail:`理解上下文 · 修改代码 · 调用框架`},feedback:{title:`运行效果闭环`,detail:`日志诊断 · 产物查看 · 迭代验证`}}},workspace:{folder:`目录`,empty:`目录为空`,select:`选择文件查看内容`,loadFailed:`无法读取 Tushare 目录`,previewFailed:`无法预览文件`,size:`文件大小`},workspacePreview:{unsupported:`暂不支持预览此文件`,parquet:`Parquet 数据预览`,rowCount:`总行数`,rowGroups:`Row Groups`,fields:`字段数`,schema:`字段结构`,truncated:`内容过大,仅展示前 512 KiB`,invalidJson:`JSON 格式有误`,invalidYaml:`YAML 格式有误`,frontmatter:`Frontmatter`,rows:`行`,previous:`上一页`,next:`下一页`,size:`文件大小`,list:`列表`,dict:`字典`,items:`项`,keys:`键`},research:{pages:{analysis:{title:`分析结果`,lead:`查看分析指标与产物`},backtest:{title:`回测分析`,lead:`收益曲线、绩效指标与每日持仓检查`},etl:{title:`ETL 数据集`,lead:`查看数据规模、列信息与产物`},train:{title:`模型管理`,lead:`查看模型、指标与生效参数`},predict:{title:`预测结果`,lead:`查看样本范围、列信息与产物`}},columns:{trade_date:`交易日期`,ts_code:`股票代码`,pred:`模型排名分数`,actual_return:`下一交易日复权收益率 · 小数`,label_valid:`实际收益率是否有效`,name:`股票名称`,is_buyable:`当日是否满足可买条件`},noKindTasks:`暂无 {{kind}} 任务`,refresh:`刷新`,unable_to_load_artifacts:`无法读取任务产物`,retry:`重试`,task_versions:`任务版本`,search_task_id:`搜索 task_id`,select:`多选`,metadata_unavailable:`元数据不可用`,selected:` 个已选`,done:`完成`,deselect:`取消全选`,select_all:`全选`,delete:`确认删除`,select_a_task_version:`选择一个任务版本`,its_data_and_artifacts_will:`右侧将显示该任务的数据与产物。`,task_artifacts_will_appear_here:`任务产出后会自动出现在这里。`,cancel:`取消`,delete_selected_task_versions:`删除所选任务版本?`,delete_this_task_version:`删除这个任务版本?`,the_task_directories_and_all:`对应任务目录及其中的产物文件会被永久删除,此操作无法撤销。`,delete_failed:`删除失败`,deleting:`删除中…`,copy_task_id:`复制 Task ID`,compare:`加入对比`,artifacts_ready:`产物就绪`,upstream_tasks:`上游任务`,open_upstream_task:`打开上游任务`,copy_upstream_task_id:`复制上游 Task ID`,factor_scores:`因子评分`,metric:`指标`,label:`标签`,factor:`因子`,magnitude:`分布`,score:`评分`,prediction_overview:`预测结果概览`,prediction_score_mean:`预测分数 · 均值`,min:`最小`,median:`中位`,max:`最大`,sample_coverage:`样本覆盖`,symbols_days:`股票 / 交易日`,buyable:`可买`,valid_return:`收益有效`,backtest_candidates:`可回测`,index_weights:`指数权重`,symbols:`只股票`,days:`天`,result_columns:`结果列`,index_weight_decimal:`指数成分权重 · 小数`,pred_is_a_ranking_score:`pred 是排名分数,不代表预期收益率或概率。`,train_rows:`训练行数`,days_2:`回测天数`,prediction_rows:`预测行数`,rows:`数据行数`,feature_columns:`特征列`,label_columns:`标签列`,target_columns:`目标列`,model:`模型名称`,start:`开始日期`,end:`结束日期`,artifacts:`产物数`,effective_parameters:`生效参数`,training_curves:`训练曲线`,no_training_curve_is_available:`当前任务未提供训练曲线`,left_axis_l2_mean_squared:`左轴 L2:均方误差;右轴 L1:平均绝对误差。实线为训练,虚线为验证;两轴数值不可直接比较。`,output_files:`输出文件`,input_directory:`输入目录`,artifacts_2:`产物清单`},compare:{tabs:{overview:`概览`,returns:`收益与风险`,periods:`分期表现`,quality:`信号质量`,trading:`交易与持仓`},metric:`指标`,difference_b_a:`差值 B − A`,common_window:`共同区间`,transaction_costs_differ:`手续费参数不同`,annualization_differs_comparison_uses_252:`原任务年化天数不同;对比统一按 252 天计算`,prediction_sources_differ:`上游预测任务不同`,only_shared_days_with_valid:`比较仅使用共同且收益有效的交易日`,net_cumulative_return:`净累计收益`,net_annualized_return:`净年化收益`,annualized_volatility:`年化波动率`,max_drawdown:`最大回撤`,win_rate:`胜率`,average_turnover:`平均换手率`,strategy_comparison:`策略对比`,compare_backtests_on_shared_trading:`在相同交易日和持仓数量下,观察两份回测的差异`,task_versions:`任务版本`,refresh_tasks:`刷新任务`,search_task_id:`搜索 task_id`,click_two_versions_to_compare:`点击两个版本进行对比;再次点击可取消`,loading_tasks:`正在读取任务`,no_backtests_available:`暂无可用回测任务`,metadata_unavailable:`元数据不可用`,backtest_task:`回测任务`,choose_from_the_list:`从左侧选择`,swap_a_and_b:`交换 A 和 B`,select_two_backtests_to_compare:`选择两份回测任务开始对比`,only_one_backtest_is_available:`目前只有一份回测任务;需要再运行一份回测才能比较`,click_two_task_versions_on:`点击左侧两个任务版本,分别设为 A 和 B`,unable_to_load_backtests:`无法读取回测数据`,calculating_shared_window:`正在计算共同区间`,no_shared_top_n:`没有共同的 Top N`,no_shared_valid_trading_days:`没有共同且有效的交易日`,shared_window:`共同区间`,days:`日`,from:`开始`,to:`结束`,reset_dates:`重置日期`,no_shared_days_in_this:`所选日期范围没有共同交易日`,comparison_dimensions:`对比维度`,difference:`差值`,cumulative_net_return_shared_start:`净收益累计 · 同起点`,return_basis:`收益口径`,net:`净收益`,gross:`毛收益`,cumulative_net_return:`净收益累计`,cumulative_gross_return:`毛收益算术累计`,net_drawdown:`净值回撤`,period:`时间`,year:`分年`,quarter:`分季度`,month:`分月`,days_2:`交易日`,net_return:`净收益`,signal_trend:`信号走势`,mean:`均值`,average_daily_cost:`平均日交易成本`,daily_turnover:`每日换手率`,holdings_comparison:`持仓对照`,trading_day:`交易日`,shared_holdings:`共同持仓`,overlap:`重合度`,only:`独有`,code:`代码`,name:`名称`,daily_return:`当日收益`},backtest:{dateRange:{start:`开始日期`,end:`结束日期`},sortBy:`按{{label}}{{direction}}排列`,ascending:`升序`,descending:`降序`,topNAllMetrics:`Top {{topN}} · 全部指标`,metrics:{net_cumulative_return:`净累计收益`,net_annualized_return:`净年化收益`,net_annualized_volatility:`年化波动率`,net_max_drawdown:`最大回撤`,net_win_rate:`胜率`,average_turnover:`平均换手率`,gross_cumulative_return:`毛累计收益`,gross_sharpe:`Sharpe`,trading_days:`交易日数`,ic_mean:`IC 均值`,icir:`ICIR`,rank_ic_mean:`RankIC 均值`,rank_icir:`RankICIR`},marketAverage:`全市场平均`,errors:{parquetRequired:`回测产物必须是 Parquet 文件`,missingDailySummary:`回测 metadata 缺少 daily 或 summary 产物`,missingDaily:`回测 metadata 缺少 daily 产物`},noSummaryData:`暂无汇总数据`,daily_mean_in_range:`区间日均`,unable_to_load_backtest_artifacts:`无法读取新版回测产物`,daily_parquet_is_empty:`daily.parquet 为空`,gross_return:`毛收益`,net_return:`净收益`,model_quality:`模型质量`,overall:`总体`,yearly:`分年`,quarterly:`分季度`,monthly:`分月`,from:`开始日期`,to:`结束日期`,days:`个交易日`,reset:`恢复全部`,cumulative_gross_return:`毛收益累计`,arithmetic_sum_rebased_to_zero:`日收益算术累加,区间起点归零`,compounded_net_return:`净收益复利`,strategies_include_turnover_costs:`策略扣除换手手续费,基准不扣费`,candidate_universe:`候选股票池内计算`,return_percentile_relevance:`实际收益截面百分位 relevance`,stocks:`只股票`,reset_holdings_sorting:`重置持仓表排序`,reset_sorting:`重置排序`,reset_sort:`重置排序`,unlock:`取消锁定`,show_the_latest_day_in:`回到所选区间的最后一个交易日`,latest:`回到最新`,code:`代码`,name:`名称`,prediction:`预测值`,return:`当日收益`,weight:`权重`,select_top_n:`选择 Top N`,independent_of_top_n:`与 Top N 无关`,overall_metrics:`整体指标`,overall_metric_details:`整体指标明细`,reset_overall_metric_sorting:`重置整体指标排序`,period:`时间`,filter_by_portfolio_size:`按持仓数量筛选`,metrics_2:`指标`,all_top_n_metrics:`各 Top N · 全部指标`,scroll_sideways:`左右滑动查看`,reset_table_sorting:`重置表格排序`,overall_metrics_by_top_n:`各 Top N 总体指标`,top_n_period_metric_details:`Top N 分期指标明细`},agent:{sessions:`会话`,newChat:`新建会话`,noSessions:`还没有会话`,conversation:`AxonX 对话`,loadingConversation:`正在恢复会话…`,welcomeTitle:`从工作区开始分析`,welcomeLead:`询问代码、任务、日志和产物,AxonX 会按需使用工作区工具。`,working:`AxonX 正在处理`,composerPlaceholder:`向 AxonX 发送消息…`,composerHint:`Enter 发送,Shift + Enter 换行`,send:`发送`,stop:`停止生成`,cancelled:`本轮生成已取消`,closeSessions:`关闭会话列表`,sessionMenu:`会话操作`,rename:`重命名`,tag:`设置标签`,fork:`创建分支`,delete:`删除会话`,renamePrompt:`输入新的会话标题`,tagPrompt:`输入标签;留空将清除标签`,deleteConfirm:`确定永久删除这个会话?`,interpretTask:`AxonX 解读`,taskPrompt:`解读任务 {{taskId}}:先调用 get_task_context,再按需查看 metadata 或 log,总结状态、依赖、风险和下一步。`,roles:{user:`你`,assistant:`AxonX`,system:`系统`}},taskGraph:{copy_task_id:`复制任务 ID`,kinds:{base:`基础任务`,api:`API`,etl:`ETL`,analysis:`因子分析`,train:`模型训练`,predict:`离线预测`,inference:`在线推理`,backtest:`离线回测`},loading_task_relationships:`正在加载任务关系…`,unable_to_load_relationships:`无法读取任务关系`,locate_current_task:`定位当前任务`,some_tasks_use_provisional_relationships:`包含尚未生成正式元数据的任务,关系会随运行结果更新。`,open_task:`打开任务`},trainingCurve:{left_axis:`左轴`,right_axis:`右轴`,train:`训练 `,validation:`验证 `},common:{start:`起点`,resizePanel:`调整面板大小`,true:`是`,false:`否`}},ne=[`en`,`zh`];function $(){let e=typeof localStorage>`u`?null:localStorage.getItem(`language`);return e===`en`||e===`zh`?e:typeof navigator<`u`&&navigator.language.toLowerCase().startsWith(`zh`)?`zh`:`en`}Z.use(Q).init({resources:{en:{translation:ee},zh:{translation:te}},lng:$(),fallbackLng:`en`,supportedLngs:ne,nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1},returnNull:!1});async function re(e){await Z.changeLanguage(e),typeof localStorage<`u`&&localStorage.setItem(`language`,e),typeof document<`u`&&(document.documentElement.lang=e===`zh`?`zh-CN`:`en`)}function ie(){return Z.resolvedLanguage===`zh`?`zh-CN`:`en-US`}typeof document<`u`&&(document.documentElement.lang=$()===`zh`?`zh-CN`:`en`);var ae=Z;export{ae as n,ie as r,re as t};