agim-cli 1.2.43 → 1.2.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/web/public/assets/{a2a-Dvz7ig4m.js → a2a-Bg_mT0z1.js} +2 -2
- package/dist/web/public/assets/{a2a-Dvz7ig4m.js.map → a2a-Bg_mT0z1.js.map} +1 -1
- package/dist/web/public/assets/{activity-BJqk7b-v.js → activity-U9AaNlDt.js} +2 -2
- package/dist/web/public/assets/{activity-BJqk7b-v.js.map → activity-U9AaNlDt.js.map} +1 -1
- package/dist/web/public/assets/{admins-DeiNQcMh.js → admins-BTC_YEK9.js} +2 -2
- package/dist/web/public/assets/{admins-DeiNQcMh.js.map → admins-BTC_YEK9.js.map} +1 -1
- package/dist/web/public/assets/{agents-DJGdXKLv.js → agents-o9odac79.js} +2 -2
- package/dist/web/public/assets/{agents-DJGdXKLv.js.map → agents-o9odac79.js.map} +1 -1
- package/dist/web/public/assets/{approvals-BOJ9et5G.js → approvals-Boj7iXz4.js} +2 -2
- package/dist/web/public/assets/{approvals-BOJ9et5G.js.map → approvals-Boj7iXz4.js.map} +1 -1
- package/dist/web/public/assets/{audit-Dnnevx6v.js → audit-MprCFoy_.js} +2 -2
- package/dist/web/public/assets/{audit-Dnnevx6v.js.map → audit-MprCFoy_.js.map} +1 -1
- package/dist/web/public/assets/{bgjobs-BZAxNFpA.js → bgjobs-B6XvxURz.js} +2 -2
- package/dist/web/public/assets/{bgjobs-BZAxNFpA.js.map → bgjobs-B6XvxURz.js.map} +1 -1
- package/dist/web/public/assets/{brain-fC59o4ZL.js → brain-C5HejASN.js} +2 -2
- package/dist/web/public/assets/{brain-fC59o4ZL.js.map → brain-C5HejASN.js.map} +1 -1
- package/dist/web/public/assets/{briefcase-DJRv77W6.js → briefcase-DkCTxO1A.js} +2 -2
- package/dist/web/public/assets/{briefcase-DJRv77W6.js.map → briefcase-DkCTxO1A.js.map} +1 -1
- package/dist/web/public/assets/{chevron-right-DzyVDoQs.js → chevron-right-DEyrYFz4.js} +2 -2
- package/dist/web/public/assets/{chevron-right-DzyVDoQs.js.map → chevron-right-DEyrYFz4.js.map} +1 -1
- package/dist/web/public/assets/{circle-check-B7B_CkmJ.js → circle-check-bADFEXGw.js} +2 -2
- package/dist/web/public/assets/{circle-check-B7B_CkmJ.js.map → circle-check-bADFEXGw.js.map} +1 -1
- package/dist/web/public/assets/{circle-check-big-dmFsJv6U.js → circle-check-big-U4xrkHiS.js} +2 -2
- package/dist/web/public/assets/{circle-check-big-dmFsJv6U.js.map → circle-check-big-U4xrkHiS.js.map} +1 -1
- package/dist/web/public/assets/{circle-x-epC-av6L.js → circle-x-C6qY5UUl.js} +2 -2
- package/dist/web/public/assets/{circle-x-epC-av6L.js.map → circle-x-C6qY5UUl.js.map} +1 -1
- package/dist/web/public/assets/{confirm-dialog-BEzhDlk7.js → confirm-dialog-B53cbWzX.js} +2 -2
- package/dist/web/public/assets/{confirm-dialog-BEzhDlk7.js.map → confirm-dialog-B53cbWzX.js.map} +1 -1
- package/dist/web/public/assets/{data-table-B_BxQrSj.js → data-table-BKTemkw9.js} +2 -2
- package/dist/web/public/assets/{data-table-B_BxQrSj.js.map → data-table-BKTemkw9.js.map} +1 -1
- package/dist/web/public/assets/{dialog-BAZNQtMt.js → dialog-Cevi7KvQ.js} +2 -2
- package/dist/web/public/assets/{dialog-BAZNQtMt.js.map → dialog-Cevi7KvQ.js.map} +1 -1
- package/dist/web/public/assets/{download-C08F-eA4.js → download-DwJNwdwV.js} +2 -2
- package/dist/web/public/assets/{download-C08F-eA4.js.map → download-DwJNwdwV.js.map} +1 -1
- package/dist/web/public/assets/{email-qzOnhITw.js → email-CZVaRhG_.js} +2 -2
- package/dist/web/public/assets/{email-qzOnhITw.js.map → email-CZVaRhG_.js.map} +1 -1
- package/dist/web/public/assets/{empty-state-BKs1qKHx.js → empty-state-C87S9Wor.js} +2 -2
- package/dist/web/public/assets/{empty-state-BKs1qKHx.js.map → empty-state-C87S9Wor.js.map} +1 -1
- package/dist/web/public/assets/{external-link-HML--jya.js → external-link-CIM1wjHP.js} +2 -2
- package/dist/web/public/assets/{external-link-HML--jya.js.map → external-link-CIM1wjHP.js.map} +1 -1
- package/dist/web/public/assets/{eye-C20O3zvh.js → eye-TUAOhz72.js} +2 -2
- package/dist/web/public/assets/{eye-C20O3zvh.js.map → eye-TUAOhz72.js.map} +1 -1
- package/dist/web/public/assets/{facts-B7VlqoVs.js → facts-ByM1VHCp.js} +2 -2
- package/dist/web/public/assets/{facts-B7VlqoVs.js.map → facts-ByM1VHCp.js.map} +1 -1
- package/dist/web/public/assets/{health-IF_VcgWW.js → health-B4GF06J-.js} +2 -2
- package/dist/web/public/assets/{health-IF_VcgWW.js.map → health-B4GF06J-.js.map} +1 -1
- package/dist/web/public/assets/{hot-D-aKQ8y2.js → hot-O9Z19xXa.js} +2 -2
- package/dist/web/public/assets/{hot-D-aKQ8y2.js.map → hot-O9Z19xXa.js.map} +1 -1
- package/dist/web/public/assets/{index-B48azMO-.js → index-CITyis5g.js} +4 -4
- package/dist/web/public/assets/{index-B48azMO-.js.map → index-CITyis5g.js.map} +1 -1
- package/dist/web/public/assets/{installed-CkiQRc89.js → installed-CM34mlDU.js} +2 -2
- package/dist/web/public/assets/{installed-CkiQRc89.js.map → installed-CM34mlDU.js.map} +1 -1
- package/dist/web/public/assets/{jobs-g1Wl8_zd.js → jobs-DwA9Ip87.js} +2 -2
- package/dist/web/public/assets/{jobs-g1Wl8_zd.js.map → jobs-DwA9Ip87.js.map} +1 -1
- package/dist/web/public/assets/{layout-D_CUXsIR.js → layout-BxrFilDN.js} +2 -2
- package/dist/web/public/assets/{layout-D_CUXsIR.js.map → layout-BxrFilDN.js.map} +1 -1
- package/dist/web/public/assets/{layout-ChcpcCB8.js → layout-CR5gLapT.js} +2 -2
- package/dist/web/public/assets/{layout-ChcpcCB8.js.map → layout-CR5gLapT.js.map} +1 -1
- package/dist/web/public/assets/{layout-CjLzz--E.js → layout-CcJQxFci.js} +2 -2
- package/dist/web/public/assets/{layout-CjLzz--E.js.map → layout-CcJQxFci.js.map} +1 -1
- package/dist/web/public/assets/{layout-CS9s-Q0a.js → layout-DRRveTaR.js} +2 -2
- package/dist/web/public/assets/{layout-CS9s-Q0a.js.map → layout-DRRveTaR.js.map} +1 -1
- package/dist/web/public/assets/{layout-fTZD9lJN.js → layout-zotlJ5fW.js} +2 -2
- package/dist/web/public/assets/{layout-fTZD9lJN.js.map → layout-zotlJ5fW.js.map} +1 -1
- package/dist/web/public/assets/{loader-circle-DBf4xFjo.js → loader-circle-BFp6Oc8_.js} +2 -2
- package/dist/web/public/assets/{loader-circle-DBf4xFjo.js.map → loader-circle-BFp6Oc8_.js.map} +1 -1
- package/dist/web/public/assets/{map-pin-BYR0Sf5r.js → map-pin-DPqnsBIG.js} +2 -2
- package/dist/web/public/assets/{map-pin-BYR0Sf5r.js.map → map-pin-DPqnsBIG.js.map} +1 -1
- package/dist/web/public/assets/{memos-ChfapnyG.js → memos-DCACQN26.js} +2 -2
- package/dist/web/public/assets/{memos-ChfapnyG.js.map → memos-DCACQN26.js.map} +1 -1
- package/dist/web/public/assets/{messengers-zBIYakPW.js → messengers-CwWP1qI4.js} +2 -2
- package/dist/web/public/assets/{messengers-zBIYakPW.js.map → messengers-CwWP1qI4.js.map} +1 -1
- package/dist/web/public/assets/{network-CEqTiog6.js → network-CrMEVz4-.js} +2 -2
- package/dist/web/public/assets/{network-CEqTiog6.js.map → network-CrMEVz4-.js.map} +1 -1
- package/dist/web/public/assets/{outbox-D4IQcACJ.js → outbox-C7FpZzwS.js} +2 -2
- package/dist/web/public/assets/{outbox-D4IQcACJ.js.map → outbox-C7FpZzwS.js.map} +1 -1
- package/dist/web/public/assets/{pagination-R9mql8VB.js → pagination-Cgt8W6EX.js} +2 -2
- package/dist/web/public/assets/{pagination-R9mql8VB.js.map → pagination-Cgt8W6EX.js.map} +1 -1
- package/dist/web/public/assets/{persona-Cj_C5frK.js → persona-Bjty6uqM.js} +2 -2
- package/dist/web/public/assets/{persona-Cj_C5frK.js.map → persona-Bjty6uqM.js.map} +1 -1
- package/dist/web/public/assets/{play-CTWqoMcj.js → play-CEoS1N8t.js} +2 -2
- package/dist/web/public/assets/{play-CTWqoMcj.js.map → play-CEoS1N8t.js.map} +1 -1
- package/dist/web/public/assets/{policy-BKEZ2ziu.js → policy-DwI-ov9J.js} +2 -2
- package/dist/web/public/assets/{policy-BKEZ2ziu.js.map → policy-DwI-ov9J.js.map} +1 -1
- package/dist/web/public/assets/{refresh-ccw-Clj5sQNF.js → refresh-ccw-CPSYEbgh.js} +2 -2
- package/dist/web/public/assets/{refresh-ccw-Clj5sQNF.js.map → refresh-ccw-CPSYEbgh.js.map} +1 -1
- package/dist/web/public/assets/{reminders-C5bVkLgj.js → reminders-X-QFSWvZ.js} +2 -2
- package/dist/web/public/assets/{reminders-C5bVkLgj.js.map → reminders-X-QFSWvZ.js.map} +1 -1
- package/dist/web/public/assets/{save-CAFra1jb.js → save-tS3IBPf3.js} +2 -2
- package/dist/web/public/assets/{save-CAFra1jb.js.map → save-tS3IBPf3.js.map} +1 -1
- package/dist/web/public/assets/{schedules-KQCD7978.js → schedules-CfCNvhCV.js} +2 -2
- package/dist/web/public/assets/{schedules-KQCD7978.js.map → schedules-CfCNvhCV.js.map} +1 -1
- package/dist/web/public/assets/{search-bDqizeZv.js → search-BPvPCccn.js} +2 -2
- package/dist/web/public/assets/{search-bDqizeZv.js.map → search-BPvPCccn.js.map} +1 -1
- package/dist/web/public/assets/{service-DTeMmX2u.js → service-DSitDFzD.js} +2 -2
- package/dist/web/public/assets/{service-DTeMmX2u.js.map → service-DSitDFzD.js.map} +1 -1
- package/dist/web/public/assets/{status-badge-_3Ve0Jef.js → status-badge-HSHkhdur.js} +2 -2
- package/dist/web/public/assets/{status-badge-_3Ve0Jef.js.map → status-badge-HSHkhdur.js.map} +1 -1
- package/dist/web/public/assets/{subtasks-DROeZcfT.js → subtasks-eKq_P0v6.js} +2 -2
- package/dist/web/public/assets/{subtasks-DROeZcfT.js.map → subtasks-eKq_P0v6.js.map} +1 -1
- package/dist/web/public/assets/{table-CZwKizat.js → table-BBISYTH-.js} +2 -2
- package/dist/web/public/assets/{table-CZwKizat.js.map → table-BBISYTH-.js.map} +1 -1
- package/dist/web/public/assets/{topn-DpErN6N8.js → topn-JA8llaUI.js} +2 -2
- package/dist/web/public/assets/{topn-DpErN6N8.js.map → topn-JA8llaUI.js.map} +1 -1
- package/dist/web/public/assets/{trash-2-BkZrVFdH.js → trash-2-D8F96aYm.js} +2 -2
- package/dist/web/public/assets/{trash-2-BkZrVFdH.js.map → trash-2-D8F96aYm.js.map} +1 -1
- package/dist/web/public/assets/{use-memory-CElm89Hg.js → use-memory-BDa1R8Tf.js} +2 -2
- package/dist/web/public/assets/{use-memory-CElm89Hg.js.map → use-memory-BDa1R8Tf.js.map} +1 -1
- package/dist/web/public/assets/{use-observability-D8qHfj0S.js → use-observability-XgxLMQsY.js} +2 -2
- package/dist/web/public/assets/{use-observability-D8qHfj0S.js.map → use-observability-XgxLMQsY.js.map} +1 -1
- package/dist/web/public/assets/{use-settings-DgU8YmGj.js → use-settings-Bc4s-JUD.js} +2 -2
- package/dist/web/public/assets/{use-settings-DgU8YmGj.js.map → use-settings-Bc4s-JUD.js.map} +1 -1
- package/dist/web/public/assets/{use-skills-Cp_ok0Uq.js → use-skills-DCOYAQ8s.js} +2 -2
- package/dist/web/public/assets/{use-skills-Cp_ok0Uq.js.map → use-skills-DCOYAQ8s.js.map} +1 -1
- package/dist/web/public/assets/{use-workspace-Dc6rNi5d.js → use-workspace-JalfqH6H.js} +2 -2
- package/dist/web/public/assets/{use-workspace-Dc6rNi5d.js.map → use-workspace-JalfqH6H.js.map} +1 -1
- package/dist/web/public/assets/{useQuery-BjFqOBV3.js → useQuery-DFryK9Pn.js} +2 -2
- package/dist/web/public/assets/{useQuery-BjFqOBV3.js.map → useQuery-DFryK9Pn.js.map} +1 -1
- package/dist/web/public/assets/{vector-Bb3l7TOa.js → vector-G2dN_aut.js} +2 -2
- package/dist/web/public/assets/{vector-Bb3l7TOa.js.map → vector-G2dN_aut.js.map} +1 -1
- package/dist/web/public/assets/viewer-DliYQkQQ.js +12 -0
- package/dist/web/public/assets/viewer-DliYQkQQ.js.map +1 -0
- package/dist/web/public/assets/{workspace-Du8va-tD.js → workspace-BaLZIgGn.js} +2 -2
- package/dist/web/public/assets/{workspace-Du8va-tD.js.map → workspace-BaLZIgGn.js.map} +1 -1
- package/dist/web/public/assets/{workspaces-BjgDtEnF.js → workspaces-cX_rV523.js} +2 -2
- package/dist/web/public/assets/{workspaces-BjgDtEnF.js.map → workspaces-cX_rV523.js.map} +1 -1
- package/dist/web/public/assets/{x-CHe1y-sG.js → x-D5196-9X.js} +2 -2
- package/dist/web/public/assets/{x-CHe1y-sG.js.map → x-D5196-9X.js.map} +1 -1
- package/dist/web/public/index.html +1 -1
- package/package.json +1 -1
- package/dist/web/public/assets/viewer-BeyW50lw.js +0 -12
- package/dist/web/public/assets/viewer-BeyW50lw.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/layout-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/layout-CcJQxFci.js","assets/react-C9F3QeMB.js","assets/jobs-DwA9Ip87.js","assets/data-table-BKTemkw9.js","assets/table-BBISYTH-.js","assets/empty-state-C87S9Wor.js","assets/status-badge-HSHkhdur.js","assets/pagination-Cgt8W6EX.js","assets/chevron-right-DEyrYFz4.js","assets/confirm-dialog-B53cbWzX.js","assets/dialog-Cevi7KvQ.js","assets/x-D5196-9X.js","assets/useQuery-DFryK9Pn.js","assets/use-event-stream-BGeFcayX.js","assets/loader-circle-BFp6Oc8_.js","assets/refresh-ccw-CPSYEbgh.js","assets/circle-x-C6qY5UUl.js","assets/briefcase-DkCTxO1A.js","assets/subtasks-eKq_P0v6.js","assets/bgjobs-B6XvxURz.js","assets/schedules-CfCNvhCV.js","assets/outbox-C7FpZzwS.js","assets/a2a-Bg_mT0z1.js","assets/approvals-Boj7iXz4.js","assets/reminders-X-QFSWvZ.js","assets/memos-DCACQN26.js","assets/trash-2-D8F96aYm.js","assets/search-BPvPCccn.js","assets/map-pin-DPqnsBIG.js","assets/layout-CR5gLapT.js","assets/use-memory-BDa1R8Tf.js","assets/facts-ByM1VHCp.js","assets/brain-C5HejASN.js","assets/persona-Bjty6uqM.js","assets/play-CEoS1N8t.js","assets/circle-check-big-U4xrkHiS.js","assets/vector-G2dN_aut.js","assets/use-settings-Bc4s-JUD.js","assets/save-tS3IBPf3.js","assets/eye-TUAOhz72.js","assets/download-DwJNwdwV.js","assets/layout-DRRveTaR.js","assets/installed-CM34mlDU.js","assets/use-skills-DCOYAQ8s.js","assets/hot-O9Z19xXa.js","assets/external-link-CIM1wjHP.js","assets/workspace-BaLZIgGn.js","assets/use-workspace-JalfqH6H.js","assets/layout-zotlJ5fW.js","assets/health-B4GF06J-.js","assets/use-observability-XgxLMQsY.js","assets/activity-U9AaNlDt.js","assets/topn-JA8llaUI.js","assets/audit-MprCFoy_.js","assets/layout-BxrFilDN.js","assets/messengers-CwWP1qI4.js","assets/email-CZVaRhG_.js","assets/circle-check-bADFEXGw.js","assets/viewer-DliYQkQQ.js","assets/agents-o9odac79.js","assets/network-CrMEVz4-.js","assets/policy-DwI-ov9J.js","assets/service-DSitDFzD.js","assets/admins-BTC_YEK9.js","assets/workspaces-cX_rV523.js","assets/browser-ponyfill-BOcGq8h9.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{e as h,r as ir,R as eo,b as Su,a as N,c as Oi}from"./react-C9F3QeMB.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(o){if(o.ep)return;o.ep=!0;const a=n(o);fetch(o.href,a)}})();var ki={exports:{}},to={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.min.js
|
|
@@ -161,6 +161,6 @@ import{e as h,r as ir,R as eo,b as Su,a as N,c as Oi}from"./react-C9F3QeMB.js";(
|
|
|
161
161
|
`)},ri=function(){var e=parseInt(document.body.getAttribute(Pn)||"0",10);return isFinite(e)?e:0},Gv=function(){h.useEffect(function(){return document.body.setAttribute(Pn,(ri()+1).toString()),function(){var e=ri()-1;e<=0?document.body.removeAttribute(Pn):document.body.setAttribute(Pn,e.toString())}},[])},Yv=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Gv();var a=h.useMemo(function(){return Wv(o)},[o]);return h.createElement(Kv,{styles:qv(a,!t,o,n?"":"!important")})},oa=!1;if(typeof window<"u")try{var Pr=Object.defineProperty({},"passive",{get:function(){return oa=!0,!0}});window.addEventListener("test",Pr,Pr),window.removeEventListener("test",Pr,Pr)}catch{oa=!1}var bn=oa?{passive:!1}:!1,Qv=function(e){return e.tagName==="TEXTAREA"},fc=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Qv(e)&&n[t]==="visible")},Xv=function(e){return fc(e,"overflowY")},Jv=function(e){return fc(e,"overflowX")},oi=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=hc(e,r);if(o){var a=pc(e,r),s=a[1],i=a[2];if(s>i)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Zv=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},ey=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},hc=function(e,t){return e==="v"?Xv(t):Jv(t)},pc=function(e,t){return e==="v"?Zv(t):ey(t)},ty=function(e,t){return e==="h"&&t==="rtl"?-1:1},ny=function(e,t,n,r,o){var a=ty(e,window.getComputedStyle(t).direction),s=a*r,i=n.target,l=t.contains(i),c=!1,u=s>0,f=0,p=0;do{if(!i)break;var d=pc(e,i),y=d[0],m=d[1],g=d[2],S=m-g-a*y;(y||S)&&hc(e,i)&&(f+=S,p+=y);var b=i.parentNode;i=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!l&&i!==document.body||l&&(t.contains(i)||t===i));return(u&&Math.abs(f)<1||!u&&Math.abs(p)<1)&&(c=!0),c},Ar=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ai=function(e){return[e.deltaX,e.deltaY]},si=function(e){return e&&"current"in e?e.current:e},ry=function(e,t){return e[0]===t[0]&&e[1]===t[1]},oy=function(e){return`
|
|
162
162
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
163
163
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
164
|
-
`)},ay=0,wn=[];function sy(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),o=h.useState(ay++)[0],a=h.useState(dc)[0],s=h.useRef(e);h.useEffect(function(){s.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=Av([e.lockRef.current],(e.shards||[]).map(si),!0).filter(Boolean);return m.forEach(function(g){return g.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var i=h.useCallback(function(m,g){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!s.current.allowPinchZoom;var S=Ar(m),b=n.current,C="deltaX"in m?m.deltaX:b[0]-S[0],R="deltaY"in m?m.deltaY:b[1]-S[1],A,T=m.target,w=Math.abs(C)>Math.abs(R)?"h":"v";if("touches"in m&&w==="h"&&T.type==="range")return!1;var O=window.getSelection(),H=O&&O.anchorNode,D=H?H===T||H.contains(T):!1;if(D)return!1;var F=oi(w,T);if(!F)return!0;if(F?A=w:(A=w==="v"?"h":"v",F=oi(w,T)),!F)return!1;if(!r.current&&"changedTouches"in m&&(C||R)&&(r.current=A),!A)return!0;var L=r.current||A;return ny(L,g,m,L==="h"?C:R)},[]),l=h.useCallback(function(m){var g=m;if(!(!wn.length||wn[wn.length-1]!==a)){var S="deltaY"in g?ai(g):Ar(g),b=t.current.filter(function(A){return A.name===g.type&&(A.target===g.target||g.target===A.shadowParent)&&ry(A.delta,S)})[0];if(b&&b.should){g.cancelable&&g.preventDefault();return}if(!b){var C=(s.current.shards||[]).map(si).filter(Boolean).filter(function(A){return A.contains(g.target)}),R=C.length>0?i(g,C[0]):!s.current.noIsolation;R&&g.cancelable&&g.preventDefault()}}},[]),c=h.useCallback(function(m,g,S,b){var C={name:m,delta:g,target:S,should:b,shadowParent:iy(S)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(R){return R!==C})},1)},[]),u=h.useCallback(function(m){n.current=Ar(m),r.current=void 0},[]),f=h.useCallback(function(m){c(m.type,ai(m),m.target,i(m,e.lockRef.current))},[]),p=h.useCallback(function(m){c(m.type,Ar(m),m.target,i(m,e.lockRef.current))},[]);h.useEffect(function(){return wn.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",l,bn),document.addEventListener("touchmove",l,bn),document.addEventListener("touchstart",u,bn),function(){wn=wn.filter(function(m){return m!==a}),document.removeEventListener("wheel",l,bn),document.removeEventListener("touchmove",l,bn),document.removeEventListener("touchstart",u,bn)}},[]);var d=e.removeScrollBar,y=e.inert;return h.createElement(h.Fragment,null,y?h.createElement(a,{styles:oy(o)}):null,d?h.createElement(Yv,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function iy(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const ly=_v(uc,sy);var mc=h.forwardRef(function(e,t){return h.createElement(ho,ct({},e,{ref:t,sideCar:ly}))});mc.classNames=ho.classNames;var cy=[" ","Enter","ArrowUp","ArrowDown"],uy=[" ","Enter"],un="Select",[po,mo,dy]=xm(un),[Mn]=so(un,[dy,fo]),go=fo(),[fy,Ht]=Mn(un),[hy,py]=Mn(un),gc=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:a,value:s,defaultValue:i,onValueChange:l,dir:c,name:u,autoComplete:f,disabled:p,required:d,form:y}=e,m=go(t),[g,S]=h.useState(null),[b,C]=h.useState(null),[R,A]=h.useState(!1),T=Em(c),[w,O]=ti({prop:r,defaultProp:o??!1,onChange:a,caller:un}),[H,D]=ti({prop:s,defaultProp:i,onChange:l,caller:un}),F=h.useRef(null),L=g?y||!!g.closest("form"):!0,[G,U]=h.useState(new Set),Q=Array.from(G).map(W=>W.props.value).join(";");return v.jsx(cv,{...m,children:v.jsxs(fy,{required:d,scope:t,trigger:g,onTriggerChange:S,valueNode:b,onValueNodeChange:C,valueNodeHasChildren:R,onValueNodeHasChildrenChange:A,contentId:Oa(),value:H,onValueChange:D,open:w,onOpenChange:O,dir:T,triggerPointerDownPosRef:F,disabled:p,children:[v.jsx(po.Provider,{scope:t,children:v.jsx(hy,{scope:e.__scopeSelect,onNativeOptionAdd:h.useCallback(W=>{U(Y=>new Set(Y).add(W))},[]),onNativeOptionRemove:h.useCallback(W=>{U(Y=>{const _=new Set(Y);return _.delete(W),_})},[]),children:n})}),L?v.jsxs(Uc,{"aria-hidden":!0,required:d,tabIndex:-1,name:u,autoComplete:f,value:H,onChange:W=>D(W.target.value),disabled:p,form:y,children:[H===void 0?v.jsx("option",{value:""}):null,Array.from(G)]},Q):null]})})};gc.displayName=un;var vc="SelectTrigger",yc=h.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,a=go(n),s=Ht(vc,n),i=s.disabled||r,l=De(t,s.onTriggerChange),c=mo(n),u=h.useRef("touch"),[f,p,d]=Bc(m=>{const g=c().filter(C=>!C.disabled),S=g.find(C=>C.value===s.value),b=Vc(g,m,S);b!==void 0&&s.onValueChange(b.value)}),y=m=>{i||(s.onOpenChange(!0),d()),m&&(s.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return v.jsx(tc,{asChild:!0,...a,children:v.jsx(Le.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":Hc(s.value)?"":void 0,...o,ref:l,onClick:Se(o.onClick,m=>{m.currentTarget.focus(),u.current!=="mouse"&&y(m)}),onPointerDown:Se(o.onPointerDown,m=>{u.current=m.pointerType;const g=m.target;g.hasPointerCapture(m.pointerId)&&g.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(y(m),m.preventDefault())}),onKeyDown:Se(o.onKeyDown,m=>{const g=f.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&p(m.key),!(g&&m.key===" ")&&cy.includes(m.key)&&(y(),m.preventDefault())})})})});yc.displayName=vc;var bc="SelectValue",wc=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:a,placeholder:s="",...i}=e,l=Ht(bc,n),{onValueNodeHasChildrenChange:c}=l,u=a!==void 0,f=De(t,l.onValueNodeChange);return $e(()=>{c(u)},[c,u]),v.jsx(Le.span,{...i,ref:f,style:{pointerEvents:"none"},children:Hc(l.value)?v.jsx(v.Fragment,{children:s}):a})});wc.displayName=bc;var my="SelectIcon",xc=h.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return v.jsx(Le.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});xc.displayName=my;var gy="SelectPortal",Sc=e=>v.jsx(oc,{asChild:!0,...e});Sc.displayName=gy;var dn="SelectContent",Ec=h.forwardRef((e,t)=>{const n=Ht(dn,e.__scopeSelect),[r,o]=h.useState();if($e(()=>{o(new DocumentFragment)},[]),!n.open){const a=r;return a?ir.createPortal(v.jsx(Cc,{scope:e.__scopeSelect,children:v.jsx(po.Slot,{scope:e.__scopeSelect,children:v.jsx("div",{children:e.children})})}),a):null}return v.jsx(Rc,{...e,ref:t})});Ec.displayName=dn;var et=10,[Cc,Bt]=Mn(dn),vy="SelectContentImpl",yy=dv("SelectContent.RemoveScroll"),Rc=h.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:a,onPointerDownOutside:s,side:i,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:d,sticky:y,hideWhenDetached:m,avoidCollisions:g,...S}=e,b=Ht(dn,n),[C,R]=h.useState(null),[A,T]=h.useState(null),w=De(t,M=>R(M)),[O,H]=h.useState(null),[D,F]=h.useState(null),L=mo(n),[G,U]=h.useState(!1),Q=h.useRef(!1);h.useEffect(()=>{if(C)return Pv(C)},[C]),Um();const W=h.useCallback(M=>{const[me,...Re]=L().map(oe=>oe.ref.current),[de]=Re.slice(-1),fe=document.activeElement;for(const oe of M)if(oe===fe||(oe?.scrollIntoView({block:"nearest"}),oe===me&&A&&(A.scrollTop=0),oe===de&&A&&(A.scrollTop=A.scrollHeight),oe?.focus(),document.activeElement!==fe))return},[L,A]),Y=h.useCallback(()=>W([O,C]),[W,O,C]);h.useEffect(()=>{G&&Y()},[G,Y]);const{onOpenChange:_,triggerPointerDownPosRef:I}=b;h.useEffect(()=>{if(C){let M={x:0,y:0};const me=de=>{M={x:Math.abs(Math.round(de.pageX)-(I.current?.x??0)),y:Math.abs(Math.round(de.pageY)-(I.current?.y??0))}},Re=de=>{M.x<=10&&M.y<=10?de.preventDefault():C.contains(de.target)||_(!1),document.removeEventListener("pointermove",me),I.current=null};return I.current!==null&&(document.addEventListener("pointermove",me),document.addEventListener("pointerup",Re,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",me),document.removeEventListener("pointerup",Re,{capture:!0})}}},[C,_,I]),h.useEffect(()=>{const M=()=>_(!1);return window.addEventListener("blur",M),window.addEventListener("resize",M),()=>{window.removeEventListener("blur",M),window.removeEventListener("resize",M)}},[_]);const[Z,le]=Bc(M=>{const me=L().filter(fe=>!fe.disabled),Re=me.find(fe=>fe.ref.current===document.activeElement),de=Vc(me,M,Re);de&&setTimeout(()=>de.ref.current.focus())}),X=h.useCallback((M,me,Re)=>{const de=!Q.current&&!Re;(b.value!==void 0&&b.value===me||de)&&(H(M),de&&(Q.current=!0))},[b.value]),se=h.useCallback(()=>C?.focus(),[C]),ie=h.useCallback((M,me,Re)=>{const de=!Q.current&&!Re;(b.value!==void 0&&b.value===me||de)&&F(M)},[b.value]),ue=r==="popper"?aa:Pc,Pe=ue===aa?{side:i,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:d,sticky:y,hideWhenDetached:m,avoidCollisions:g}:{};return v.jsx(Cc,{scope:n,content:C,viewport:A,onViewportChange:T,itemRefCallback:X,selectedItem:O,onItemLeave:se,itemTextRefCallback:ie,focusSelectedItem:Y,selectedItemText:D,position:r,isPositioned:G,searchRef:Z,children:v.jsx(mc,{as:yy,allowPinchZoom:!0,children:v.jsx(Nl,{asChild:!0,trapped:b.open,onMountAutoFocus:M=>{M.preventDefault()},onUnmountAutoFocus:Se(o,M=>{b.trigger?.focus({preventScroll:!0}),M.preventDefault()}),children:v.jsx(Ta,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:M=>M.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:v.jsx(ue,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:M=>M.preventDefault(),...S,...Pe,onPlaced:()=>U(!0),ref:w,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:Se(S.onKeyDown,M=>{const me=M.ctrlKey||M.altKey||M.metaKey;if(M.key==="Tab"&&M.preventDefault(),!me&&M.key.length===1&&le(M.key),["ArrowUp","ArrowDown","Home","End"].includes(M.key)){let de=L().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);if(["ArrowUp","End"].includes(M.key)&&(de=de.slice().reverse()),["ArrowUp","ArrowDown"].includes(M.key)){const fe=M.target,oe=de.indexOf(fe);de=de.slice(oe+1)}setTimeout(()=>W(de)),M.preventDefault()}})})})})})})});Rc.displayName=vy;var by="SelectItemAlignedPosition",Pc=h.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,a=Ht(dn,n),s=Bt(dn,n),[i,l]=h.useState(null),[c,u]=h.useState(null),f=De(t,w=>u(w)),p=mo(n),d=h.useRef(!1),y=h.useRef(!0),{viewport:m,selectedItem:g,selectedItemText:S,focusSelectedItem:b}=s,C=h.useCallback(()=>{if(a.trigger&&a.valueNode&&i&&c&&m&&g&&S){const w=a.trigger.getBoundingClientRect(),O=c.getBoundingClientRect(),H=a.valueNode.getBoundingClientRect(),D=S.getBoundingClientRect();if(a.dir!=="rtl"){const fe=D.left-O.left,oe=H.left-fe,Ae=w.left-oe,Ye=w.width+Ae,Vt=Math.max(Ye,O.width),He=window.innerWidth-et,zt=Ms(oe,[et,Math.max(et,He-Vt)]);i.style.minWidth=Ye+"px",i.style.left=zt+"px"}else{const fe=O.right-D.right,oe=window.innerWidth-H.right-fe,Ae=window.innerWidth-w.right-oe,Ye=w.width+Ae,Vt=Math.max(Ye,O.width),He=window.innerWidth-et,zt=Ms(oe,[et,Math.max(et,He-Vt)]);i.style.minWidth=Ye+"px",i.style.right=zt+"px"}const F=p(),L=window.innerHeight-et*2,G=m.scrollHeight,U=window.getComputedStyle(c),Q=parseInt(U.borderTopWidth,10),W=parseInt(U.paddingTop,10),Y=parseInt(U.borderBottomWidth,10),_=parseInt(U.paddingBottom,10),I=Q+W+G+_+Y,Z=Math.min(g.offsetHeight*5,I),le=window.getComputedStyle(m),X=parseInt(le.paddingTop,10),se=parseInt(le.paddingBottom,10),ie=w.top+w.height/2-et,ue=L-ie,Pe=g.offsetHeight/2,M=g.offsetTop+Pe,me=Q+W+M,Re=I-me;if(me<=ie){const fe=F.length>0&&g===F[F.length-1].ref.current;i.style.bottom="0px";const oe=c.clientHeight-m.offsetTop-m.offsetHeight,Ae=Math.max(ue,Pe+(fe?se:0)+oe+Y),Ye=me+Ae;i.style.height=Ye+"px"}else{const fe=F.length>0&&g===F[0].ref.current;i.style.top="0px";const Ae=Math.max(ie,Q+m.offsetTop+(fe?X:0)+Pe)+Re;i.style.height=Ae+"px",m.scrollTop=me-ie+m.offsetTop}i.style.margin=`${et}px 0`,i.style.minHeight=Z+"px",i.style.maxHeight=L+"px",r?.(),requestAnimationFrame(()=>d.current=!0)}},[p,a.trigger,a.valueNode,i,c,m,g,S,a.dir,r]);$e(()=>C(),[C]);const[R,A]=h.useState();$e(()=>{c&&A(window.getComputedStyle(c).zIndex)},[c]);const T=h.useCallback(w=>{w&&y.current===!0&&(C(),b?.(),y.current=!1)},[C,b]);return v.jsx(xy,{scope:n,contentWrapper:i,shouldExpandOnScrollRef:d,onScrollButtonChange:T,children:v.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R},children:v.jsx(Le.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Pc.displayName=by;var wy="SelectPopperPosition",aa=h.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=et,...a}=e,s=go(n);return v.jsx(nc,{...s,...a,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});aa.displayName=wy;var[xy,Fa]=Mn(dn,{}),sa="SelectViewport",Ac=h.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,a=Bt(sa,n),s=Fa(sa,n),i=De(t,a.onViewportChange),l=h.useRef(0);return v.jsxs(v.Fragment,{children:[v.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),v.jsx(po.Slot,{scope:n,children:v.jsx(Le.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Se(o.onScroll,c=>{const u=c.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:p}=s;if(p?.current&&f){const d=Math.abs(l.current-u.scrollTop);if(d>0){const y=window.innerHeight-et*2,m=parseFloat(f.style.minHeight),g=parseFloat(f.style.height),S=Math.max(m,g);if(S<y){const b=S+d,C=Math.min(y,b),R=b-C;f.style.height=C+"px",f.style.bottom==="0px"&&(u.scrollTop=R>0?R:0,f.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});Ac.displayName=sa;var Tc="SelectGroup",[Sy,Ey]=Mn(Tc),Cy=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Oa();return v.jsx(Sy,{scope:n,id:o,children:v.jsx(Le.div,{role:"group","aria-labelledby":o,...r,ref:t})})});Cy.displayName=Tc;var Oc="SelectLabel",kc=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ey(Oc,n);return v.jsx(Le.div,{id:o.id,...r,ref:t})});kc.displayName=Oc;var Kr="SelectItem",[Ry,Lc]=Mn(Kr),Nc=h.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:a,...s}=e,i=Ht(Kr,n),l=Bt(Kr,n),c=i.value===r,[u,f]=h.useState(a??""),[p,d]=h.useState(!1),y=De(t,b=>l.itemRefCallback?.(b,r,o)),m=Oa(),g=h.useRef("touch"),S=()=>{o||(i.onValueChange(r),i.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return v.jsx(Ry,{scope:n,value:r,disabled:o,textId:m,isSelected:c,onItemTextChange:h.useCallback(b=>{f(C=>C||(b?.textContent??"").trim())},[]),children:v.jsx(po.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:v.jsx(Le.div,{role:"option","aria-labelledby":m,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:y,onFocus:Se(s.onFocus,()=>d(!0)),onBlur:Se(s.onBlur,()=>d(!1)),onClick:Se(s.onClick,()=>{g.current!=="mouse"&&S()}),onPointerUp:Se(s.onPointerUp,()=>{g.current==="mouse"&&S()}),onPointerDown:Se(s.onPointerDown,b=>{g.current=b.pointerType}),onPointerMove:Se(s.onPointerMove,b=>{g.current=b.pointerType,o?l.onItemLeave?.():g.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Se(s.onPointerLeave,b=>{b.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:Se(s.onKeyDown,b=>{l.searchRef?.current!==""&&b.key===" "||(uy.includes(b.key)&&S(),b.key===" "&&b.preventDefault())})})})})});Nc.displayName=Kr;var Jn="SelectItemText",Ic=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...a}=e,s=Ht(Jn,n),i=Bt(Jn,n),l=Lc(Jn,n),c=py(Jn,n),[u,f]=h.useState(null),p=De(t,S=>f(S),l.onItemTextChange,S=>i.itemTextRefCallback?.(S,l.value,l.disabled)),d=u?.textContent,y=h.useMemo(()=>v.jsx("option",{value:l.value,disabled:l.disabled,children:d},l.value),[l.disabled,l.value,d]),{onNativeOptionAdd:m,onNativeOptionRemove:g}=c;return $e(()=>(m(y),()=>g(y)),[m,g,y]),v.jsxs(v.Fragment,{children:[v.jsx(Le.span,{id:l.textId,...a,ref:p}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?ir.createPortal(a.children,s.valueNode):null]})});Ic.displayName=Jn;var Dc="SelectItemIndicator",Mc=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Lc(Dc,n).isSelected?v.jsx(Le.span,{"aria-hidden":!0,...r,ref:t}):null});Mc.displayName=Dc;var ia="SelectScrollUpButton",_c=h.forwardRef((e,t)=>{const n=Bt(ia,e.__scopeSelect),r=Fa(ia,e.__scopeSelect),[o,a]=h.useState(!1),s=De(t,r.onScrollButtonChange);return $e(()=>{if(n.viewport&&n.isPositioned){let i=function(){const c=l.scrollTop>0;a(c)};const l=n.viewport;return i(),l.addEventListener("scroll",i),()=>l.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),o?v.jsx(Fc,{...e,ref:s,onAutoScroll:()=>{const{viewport:i,selectedItem:l}=n;i&&l&&(i.scrollTop=i.scrollTop-l.offsetHeight)}}):null});_c.displayName=ia;var la="SelectScrollDownButton",jc=h.forwardRef((e,t)=>{const n=Bt(la,e.__scopeSelect),r=Fa(la,e.__scopeSelect),[o,a]=h.useState(!1),s=De(t,r.onScrollButtonChange);return $e(()=>{if(n.viewport&&n.isPositioned){let i=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;a(u)};const l=n.viewport;return i(),l.addEventListener("scroll",i),()=>l.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),o?v.jsx(Fc,{...e,ref:s,onAutoScroll:()=>{const{viewport:i,selectedItem:l}=n;i&&l&&(i.scrollTop=i.scrollTop+l.offsetHeight)}}):null});jc.displayName=la;var Fc=h.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,a=Bt("SelectScrollButton",n),s=h.useRef(null),i=mo(n),l=h.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return h.useEffect(()=>()=>l(),[l]),$e(()=>{i().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[i]),v.jsx(Le.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:Se(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Se(o.onPointerMove,()=>{a.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Se(o.onPointerLeave,()=>{l()})})}),Py="SelectSeparator",$c=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return v.jsx(Le.div,{"aria-hidden":!0,...r,ref:t})});$c.displayName=Py;var ca="SelectArrow",Ay=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=go(n),a=Ht(ca,n),s=Bt(ca,n);return a.open&&s.position==="popper"?v.jsx(rc,{...o,...r,ref:t}):null});Ay.displayName=ca;var Ty="SelectBubbleInput",Uc=h.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=h.useRef(null),a=De(r,o),s=wv(t);return h.useEffect(()=>{const i=o.current;if(!i)return;const l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==t&&u){const f=new Event("change",{bubbles:!0});u.call(i,t),i.dispatchEvent(f)}},[s,t]),v.jsx(Le.select,{...n,style:{...ac,...n.style},ref:a,defaultValue:t})});Uc.displayName=Ty;function Hc(e){return e===""||e===void 0}function Bc(e){const t=ln(e),n=h.useRef(""),r=h.useRef(0),o=h.useCallback(s=>{const i=n.current+s;t(i),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(i)},[t]),a=h.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,a]}function Vc(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let s=Oy(e,Math.max(a,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Oy(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ky=gc,zc=yc,Ly=wc,Ny=xc,Iy=Sc,Wc=Ec,Dy=Ac,Kc=kc,qc=Nc,My=Ic,_y=Mc,Gc=_c,Yc=jc,Qc=$c;const ua=ky,da=Ly,qr=h.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(zc,{ref:r,className:we("flex h-8 w-full items-center justify-between gap-2","rounded-md border border-border bg-surface px-3 py-1 text-sm","placeholder:text-text-muted","focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-1 focus:ring-offset-bg","disabled:cursor-not-allowed disabled:opacity-55","[&>span]:line-clamp-1",e),...n,children:[t,v.jsx(Ny,{asChild:!0,children:v.jsx(el,{className:"h-4 w-4 opacity-60"})})]}));qr.displayName=zc.displayName;const Xc=h.forwardRef(({className:e,...t},n)=>v.jsx(Gc,{ref:n,className:we("flex cursor-default items-center justify-center py-1",e),...t,children:v.jsx(Bf,{className:"h-4 w-4"})}));Xc.displayName=Gc.displayName;const Jc=h.forwardRef(({className:e,...t},n)=>v.jsx(Yc,{ref:n,className:we("flex cursor-default items-center justify-center py-1",e),...t,children:v.jsx(el,{className:"h-4 w-4"})}));Jc.displayName=Yc.displayName;const Gr=h.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>v.jsx(Iy,{children:v.jsxs(Wc,{ref:o,position:n,className:we("relative z-50 max-h-96 min-w-[8rem] overflow-hidden","rounded-md border border-border bg-surface text-text shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",n==="popper"&&["data-[side=bottom]:translate-y-1","data-[side=top]:-translate-y-1","data-[side=left]:-translate-x-1","data-[side=right]:translate-x-1"],e),...r,children:[v.jsx(Xc,{}),v.jsx(Dy,{className:we("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),v.jsx(Jc,{})]})}));Gr.displayName=Wc.displayName;const jy=h.forwardRef(({className:e,...t},n)=>v.jsx(Kc,{ref:n,className:we("px-2 py-1.5 text-xs font-semibold uppercase tracking-wide text-text-muted",e),...t}));jy.displayName=Kc.displayName;const tn=h.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(qc,{ref:r,className:we("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-surface-hover focus:text-text","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[v.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:v.jsx(_y,{children:v.jsx(Hf,{className:"h-4 w-4"})})}),v.jsx(My,{children:t})]}));tn.displayName=qc.displayName;const Fy=h.forwardRef(({className:e,...t},n)=>v.jsx(Qc,{ref:n,className:we("-mx-1 my-1 h-px bg-border",e),...t}));Fy.displayName=Qc.displayName;function $y({agents:e,value:t,onChange:n}){return v.jsxs(ua,{value:t||void 0,onValueChange:n,children:[v.jsx(qr,{className:"h-7 w-28 sm:w-36 text-xs",children:v.jsx(da,{placeholder:e[0]??"—"})}),v.jsx(Gr,{children:e.map(r=>v.jsx(tn,{value:r,children:r},r))})]})}const fa="agim-theme",Zc="im-hub-lang";function Uy(){try{const e=localStorage.getItem(fa);if(e==="light"||e==="dark")return e}catch{}return"system"}function Hy(){try{const t=localStorage.getItem(Zc);if(t==="en"||t==="zh")return t}catch{}return(navigator.language||"en").toLowerCase().startsWith("zh")?"zh":"en"}function ii(e){try{e==="system"?localStorage.removeItem(fa):localStorage.setItem(fa,e)}catch{}}function By(e){try{localStorage.setItem(Zc,e)}catch{}}const En=Gi((e,t)=>({theme:Uy(),lang:Hy(),setTheme:n=>{ii(n),e({theme:n})},cycleTheme:()=>{const n=t().theme,r=n==="system"?"light":n==="light"?"dark":"system";ii(r),e({theme:r})},setLang:n=>{By(n),e({lang:n})}}));function li(e){e==="system"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",e)}function Vy(){const e=En(t=>t.theme);h.useEffect(()=>{if(li(e),e!=="system")return;const t=window.matchMedia("(prefers-color-scheme: dark)"),n=()=>li(e);return t.addEventListener("change",n),()=>t.removeEventListener("change",n)},[e])}function zy(){const{t:e}=pt(),t=En(a=>a.theme),n=En(a=>a.lang),r=En(a=>a.setTheme),o=En(a=>a.setLang);return v.jsxs(v.Fragment,{children:[v.jsxs(ua,{value:n,onValueChange:a=>o(a),children:[v.jsx(qr,{className:"h-7 w-16 sm:w-20 text-xs","aria-label":e("lang.label"),children:v.jsx(da,{})}),v.jsxs(Gr,{children:[v.jsx(tn,{value:"en",children:e("lang.en")}),v.jsx(tn,{value:"zh",children:e("lang.zh")})]})]}),v.jsxs(ua,{value:t,onValueChange:a=>r(a),children:[v.jsx(qr,{className:"h-7 w-16 text-xs sm:w-28","aria-label":e("theme.label"),children:v.jsx(da,{})}),v.jsxs(Gr,{children:[v.jsx(tn,{value:"system",children:v.jsxs("span",{className:"inline-flex items-center gap-2",children:[v.jsx(Kf,{className:"h-4 w-4"})," ",e("theme.system")]})}),v.jsx(tn,{value:"light",children:v.jsxs("span",{className:"inline-flex items-center gap-2",children:[v.jsx(Xf,{className:"h-4 w-4"})," ",e("theme.light")]})}),v.jsx(tn,{value:"dark",children:v.jsxs("span",{className:"inline-flex items-center gap-2",children:[v.jsx(Gf,{className:"h-4 w-4"})," ",e("theme.dark")]})})]})]})]})}function Wy(e){const[t,n]=h.useState(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(e).matches);return h.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const r=window.matchMedia(e),o=a=>n(a.matches);return n(r.matches),r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[e]),t}function Ky(){return Wy("(min-width: 640px)")}const qy=[{to:"/",i18nKey:"nav.chat",mounted:!0},{to:"/tasks",i18nKey:"nav.tasks",mounted:!0},{to:"/approvals",i18nKey:"nav.approvals",mounted:!0},{to:"/reminders",i18nKey:"nav.reminders",mounted:!0},{to:"/memos",i18nKey:"nav.memos",mounted:!0},{to:"/memory",i18nKey:"nav.memory",mounted:!0},{to:"/skills",i18nKey:"nav.skills",mounted:!0},{to:"/workspace",i18nKey:"nav.workspace",mounted:!0},{to:"/observability",i18nKey:"nav.observability",mounted:!0},{to:"/settings",i18nKey:"nav.settings",mounted:!0}];function eu({children:e}){const{t}=pt(),n=Ky(),r=v.jsx("nav",{className:we("flex flex-1 min-w-0 items-center gap-1","overflow-x-auto scrollbar-thin","[&::-webkit-scrollbar]:h-1 [&::-webkit-scrollbar-thumb]:bg-border"),"aria-label":t("appName"),children:qy.filter(o=>o.mounted).map(o=>v.jsx(cs,{to:o.to,end:o.to==="/",className:({isActive:a})=>we("shrink-0 rounded-md px-2.5 py-1.5 text-sm no-underline","transition-colors tap-target",a?"bg-accent-bg text-accent font-medium":"text-text-dim hover:bg-surface-hover hover:text-text"),children:t(o.i18nKey)},o.to))});return v.jsxs("header",{className:we("sticky top-0 z-20","flex flex-col sm:flex-row sm:items-center sm:gap-3","border-b border-border bg-surface","pt-safe","shadow-sm"),children:[v.jsxs("div",{className:we("flex items-center gap-2 sm:gap-3","overflow-x-hidden","px-3 sm:px-4 py-2 sm:py-2","sm:flex-1 sm:min-w-0"),children:[v.jsxs(cs,{to:"/",className:"flex shrink-0 items-center gap-1 text-md font-semibold no-underline",end:!0,children:[v.jsx("span",{"aria-hidden":"true",children:"🤖"}),v.jsx("span",{className:"hidden sm:inline",children:t("appName")})]}),n&&v.jsx("div",{className:"flex flex-1 min-w-0",children:r}),e&&v.jsx("div",{className:"flex items-center gap-2",children:e}),v.jsx("div",{className:"flex shrink-0 items-center gap-2",children:v.jsx(zy,{})})]}),!n&&v.jsx("div",{className:"border-t border-border px-3 py-1",children:r})]})}const Gy={open:"bg-success",connecting:"bg-warning animate-pulse",closed:"bg-text-muted",error:"bg-danger"};function Yy(){const{t:e}=pt(),{state:t,send:n,switchAgent:r,approvalClick:o,newConversation:a,clearError:s}=cm(),[i,l]=h.useState(""),c=h.useRef(null),u=h.useRef(null);h.useEffect(()=>{if(!c.current)return;const d=c.current;!(d.scrollHeight-d.scrollTop-d.clientHeight<200)&&t.currentReplyId==null||requestAnimationFrame(()=>{d.scrollTop=d.scrollHeight})},[t.messages,t.currentReplyId]),h.useEffect(()=>{t.error&&(Zn.error(t.error),s())},[t.error,s]);function f(d){d?.preventDefault();const y=i.trim();if(y){if(t.status!=="open"){Zn.error(e("chat.notConnected",{defaultValue:"Not connected. Reconnecting…"}));return}n(y),l(""),requestAnimationFrame(()=>u.current?.focus())}}function p(d){d.nativeEvent.isComposing||d.keyCode===229||d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),f())}return v.jsxs("div",{className:"flex h-dvh flex-col bg-bg",children:[v.jsxs(eu,{children:[v.jsx("span",{className:we("inline-block h-2 w-2 rounded-full",Gy[t.status]),title:t.status}),v.jsx("span",{className:"hidden text-xs text-text-dim sm:inline",children:t.status}),v.jsxs(ft,{variant:"ghost",size:"sm",onClick:()=>{a(),Zn.success(e("chat.newConvToast",{defaultValue:"Started a new conversation"})),requestAnimationFrame(()=>u.current?.focus())},disabled:t.status!=="open",title:e("chat.newConvHint",{defaultValue:"Clear messages and start a fresh session"}),"aria-label":e("chat.newConv",{defaultValue:"New conversation"}),children:[v.jsx(qf,{className:"h-4 w-4"}),v.jsx("span",{className:"hidden text-xs sm:inline",children:e("chat.newConv",{defaultValue:"New"})})]}),v.jsx($y,{agents:t.agents,value:t.agent,onChange:r})]}),v.jsx("div",{ref:c,className:"flex-1 overflow-y-auto",children:v.jsxs("div",{className:"mx-auto flex max-w-3xl flex-col gap-2 px-3 py-3 sm:px-4",children:[t.messages.length===0&&t.status==="open"&&v.jsxs("div",{className:"flex flex-col items-center gap-2 py-16 text-center",children:[v.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-surface-2 text-2xl",children:"💬"}),v.jsx("h2",{className:"text-base font-semibold",children:e("chat.welcomeTitle",{defaultValue:"Start a conversation"})}),v.jsx("p",{className:"max-w-md text-sm text-text-dim",children:e("chat.welcomeBody",{defaultValue:"Type a message to ask the active agent. Use the agent dropdown to switch."})})]}),t.messages.length===0&&t.status!=="open"&&v.jsxs("div",{className:"grid place-items-center py-16 text-center",children:[v.jsx(Vf,{className:"h-10 w-10 text-text-muted"}),v.jsx("p",{className:"mt-3 text-sm text-text-dim",children:t.status==="connecting"?e("chat.connecting",{defaultValue:"Connecting to agim…"}):e("chat.disconnected",{defaultValue:"Disconnected. Reconnecting automatically; you can keep typing."})})]}),t.messages.map(d=>v.jsx(dm,{msg:d,onApprove:(y,m,g)=>o(y,m,g)},d.id))]})}),v.jsxs("form",{onSubmit:f,className:"sticky bottom-0 border-t border-border bg-surface px-4 py-2 pb-safe sm:px-6",children:[v.jsxs("div",{className:"mx-auto flex max-w-3xl items-end gap-2",children:[v.jsx("textarea",{ref:u,value:i,onChange:d=>l(d.target.value),onKeyDown:p,placeholder:e("chat.inputPlaceholder",{defaultValue:"Message… (Enter sends, Shift+Enter newlines)"}),rows:1,className:we("flex-1 resize-none rounded-md border border-border bg-bg","px-3 py-1.5 text-sm leading-5","focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-1 focus:ring-offset-bg","max-h-32 min-h-8")}),v.jsx(ft,{type:"submit",disabled:!i.trim()||t.status!=="open","aria-label":e("chat.send",{defaultValue:"Send"}),className:"h-8 w-8 p-0",children:v.jsx(Qf,{className:"h-4 w-4"})})]}),t.currentReplyId&&v.jsx("div",{className:"mx-auto mt-2 flex max-w-3xl items-center gap-2",children:v.jsx(Mt,{variant:"info",children:e("chat.streaming",{defaultValue:"… streaming"})})})]})]})}function Qy(){const{t:e}=pt(),t=Ot();return v.jsxs("div",{className:"flex min-h-dvh flex-col bg-bg",children:[v.jsx(eu,{}),v.jsx("main",{className:"grid flex-1 place-items-center px-4 py-8 pb-safe",children:v.jsxs("div",{className:"flex max-w-md flex-col items-center gap-3 text-center",children:[v.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-surface-2 text-text-dim",children:v.jsx(zf,{className:"h-6 w-6"})}),v.jsx("div",{className:"text-6xl font-bold tracking-tight text-text-muted",children:"404"}),v.jsx("h1",{className:"text-xl font-semibold",children:e("notFound.title",{defaultValue:"Nothing here."})}),v.jsx("p",{className:"text-sm text-text-dim",children:e("notFound.description",{defaultValue:"The page you're looking for doesn't exist."})}),v.jsx("code",{className:"rounded bg-surface-2 px-2 py-0.5 text-xs text-text-muted",children:t.pathname}),v.jsx(ft,{asChild:!0,className:"mt-2",children:v.jsx(Sa,{to:"/",children:e("actions.back")})})]})})]})}function St(e){return async()=>{const n=(await e()).default;return{element:v.jsx(Yi,{children:v.jsx(n,{})})}}}function ke(e){return async()=>{const n=(await e()).default;return{element:v.jsx(n,{})}}}const Xy=Zd([{path:"/login",element:v.jsx(om,{})},{path:"/",element:v.jsx(Yi,{children:v.jsx(Yy,{})})},{path:"/tasks",lazy:St(()=>pe(()=>import("./layout-CjLzz--E.js"),__vite__mapDeps([0,1]))),children:[{index:!0,element:v.jsx(Jt,{to:"jobs",replace:!0})},{path:"jobs",lazy:ke(()=>pe(()=>import("./jobs-g1Wl8_zd.js"),__vite__mapDeps([2,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17])))},{path:"subtasks",lazy:ke(()=>pe(()=>import("./subtasks-DROeZcfT.js"),__vite__mapDeps([18,1,3,4,5,6,12,13,14,15])))},{path:"bgjobs",lazy:ke(()=>pe(()=>import("./bgjobs-BZAxNFpA.js"),__vite__mapDeps([19,1,3,4,5,6,12,14,15])))},{path:"schedules",lazy:ke(()=>pe(()=>import("./schedules-KQCD7978.js"),__vite__mapDeps([20,1,3,4,5,12,14,15])))},{path:"outbox",lazy:ke(()=>pe(()=>import("./outbox-D4IQcACJ.js"),__vite__mapDeps([21,1,3,4,5,6,9,10,11,12,14,15])))},{path:"a2a",lazy:ke(()=>pe(()=>import("./a2a-Dvz7ig4m.js"),__vite__mapDeps([22,1,3,4,5,6,12,13,14,15])))}]},{path:"/approvals",lazy:St(()=>pe(()=>import("./approvals-BOJ9et5G.js"),__vite__mapDeps([23,1,11,5,12,13,14,15])))},{path:"/reminders",lazy:St(()=>pe(()=>import("./reminders-C5bVkLgj.js"),__vite__mapDeps([24,1,3,4,5,6,9,10,11,12,14,15])))},{path:"/memos",lazy:St(()=>pe(()=>import("./memos-ChfapnyG.js"),__vite__mapDeps([25,1,3,4,5,9,10,11,8,12,26,15,27,28])))},{path:"/memory",lazy:St(()=>pe(()=>import("./layout-ChcpcCB8.js"),__vite__mapDeps([29,30,12,1]))),children:[{index:!0,element:v.jsx(Jt,{to:"facts",replace:!0})},{path:"facts",lazy:ke(()=>pe(()=>import("./facts-B7VlqoVs.js"),__vite__mapDeps([31,1,3,4,5,7,8,9,10,11,30,12,26,32,14,15,27])))},{path:"persona",lazy:ke(()=>pe(()=>import("./persona-Cj_C5frK.js"),__vite__mapDeps([33,1,5,9,10,11,30,12,32,14,15,34,35,16,26])))},{path:"vector",lazy:ke(()=>pe(()=>import("./vector-Bb3l7TOa.js"),__vite__mapDeps([36,1,37,12,30,14,38,39,9,10,11,5,16,15,34,40,26,35])))},{path:"skills",element:v.jsx(Jt,{to:"/skills/installed",replace:!0})}]},{path:"/skills",lazy:St(()=>pe(()=>import("./layout-CS9s-Q0a.js"),__vite__mapDeps([41,1]))),children:[{index:!0,element:v.jsx(Jt,{to:"installed",replace:!0})},{path:"installed",lazy:ke(()=>pe(()=>import("./installed-CkiQRc89.js"),__vite__mapDeps([42,1,5,10,11,43,12,14,15,27])))},{path:"hot",lazy:ke(()=>pe(()=>import("./hot-D-aKQ8y2.js"),__vite__mapDeps([44,1,5,10,11,43,12,45,14,15,27,40])))}]},{path:"/workspace",lazy:St(()=>pe(()=>import("./workspace-Du8va-tD.js"),__vite__mapDeps([46,1,5,47,12,14,15])))},{path:"/observability",lazy:St(()=>pe(()=>import("./layout-fTZD9lJN.js"),__vite__mapDeps([48,1]))),children:[{index:!0,element:v.jsx(Jt,{to:"health",replace:!0})},{path:"health",lazy:ke(()=>pe(()=>import("./health-IF_VcgWW.js"),__vite__mapDeps([49,1,5,4,50,12,14,15,51])))},{path:"topn",lazy:ke(()=>pe(()=>import("./topn-DpErN6N8.js"),__vite__mapDeps([52,5,4,1,50,12,14,15])))},{path:"audit",lazy:ke(()=>pe(()=>import("./audit-Dnnevx6v.js"),__vite__mapDeps([53,1,3,4,5,50,12,14,15,51])))}]},{path:"/settings",lazy:St(()=>pe(()=>import("./layout-D_CUXsIR.js"),__vite__mapDeps([54,1]))),children:[{index:!0,element:v.jsx(Jt,{to:"messengers",replace:!0})},{path:"messengers",lazy:ke(()=>pe(()=>import("./messengers-zBIYakPW.js"),__vite__mapDeps([55,1,10,11,37,12,14,15,38])))},{path:"email",lazy:ke(()=>pe(()=>import("./email-qzOnhITw.js"),__vite__mapDeps([56,1,37,12,14,16,57,15,39,11,38])))},{path:"viewer",lazy:ke(()=>pe(()=>import("./viewer-BeyW50lw.js"),__vite__mapDeps([58,1,37,12,39,14,15,57,45,11,38,28])))},{path:"agents",lazy:ke(()=>pe(()=>import("./agents-DJGdXKLv.js"),__vite__mapDeps([59,1,5,47,12,37,14,15,11,38,60,27,26])))},{path:"policy",lazy:ke(()=>pe(()=>import("./policy-BKEZ2ziu.js"),__vite__mapDeps([61,37,12,1,14,15])))},{path:"service",lazy:ke(()=>pe(()=>import("./service-DTeMmX2u.js"),__vite__mapDeps([62,1,9,10,11,37,12,14,15,34,60,38])))},{path:"admins",lazy:ke(()=>pe(()=>import("./admins-DeiNQcMh.js"),__vite__mapDeps([63,1,9,10,11,5,4,37,12,14,15,26])))},{path:"workspaces",lazy:ke(()=>pe(()=>import("./workspaces-BjgDtEnF.js"),__vite__mapDeps([64,1,5,4,37,12,14,15,17,38])))}]},{path:"*",element:v.jsx(Qy,{})}]);function Jy(){return v.jsx(Uh,{children:v.jsx(lf,{router:Xy})})}const Zy=new yp({defaultOptions:{queries:{staleTime:3e4,gcTime:5*6e4,retry:1,retryDelay:e=>Math.min(1e3*2**e,8e3),refetchOnWindowFocus:!1,refetchOnReconnect:!0},mutations:{retry:0}}}),te=e=>typeof e=="string",Qn=()=>{let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n},ci=e=>e==null?"":""+e,eb=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},tb=/###/g,ui=e=>e&&e.indexOf("###")>-1?e.replace(tb,"."):e,di=e=>!e||te(e),er=(e,t,n)=>{const r=te(t)?t.split("."):t;let o=0;for(;o<r.length-1;){if(di(e))return{};const a=ui(r[o]);!e[a]&&n&&(e[a]=new n),Object.prototype.hasOwnProperty.call(e,a)?e=e[a]:e={},++o}return di(e)?{}:{obj:e,k:ui(r[o])}},fi=(e,t,n)=>{const{obj:r,k:o}=er(e,t,Object);if(r!==void 0||t.length===1){r[o]=n;return}let a=t[t.length-1],s=t.slice(0,t.length-1),i=er(e,s,Object);for(;i.obj===void 0&&s.length;)a=`${s[s.length-1]}.${a}`,s=s.slice(0,s.length-1),i=er(e,s,Object),i?.obj&&typeof i.obj[`${i.k}.${a}`]<"u"&&(i.obj=void 0);i.obj[`${i.k}.${a}`]=n},nb=(e,t,n,r)=>{const{obj:o,k:a}=er(e,t,Object);o[a]=o[a]||[],o[a].push(n)},Yr=(e,t)=>{const{obj:n,k:r}=er(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},rb=(e,t,n)=>{const r=Yr(e,n);return r!==void 0?r:Yr(t,n)},tu=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?te(e[r])||e[r]instanceof String||te(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):tu(e[r],t[r],n):e[r]=t[r]);return e},xn=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var ob={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const ab=e=>te(e)?e.replace(/[&<>"'\/]/g,t=>ob[t]):e;class sb{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const ib=[" ",",","?","!",";"],lb=new sb(20),cb=(e,t,n)=>{t=t||"",n=n||"";const r=ib.filter(s=>t.indexOf(s)<0&&n.indexOf(s)<0);if(r.length===0)return!0;const o=lb.getRegExp(`(${r.map(s=>s==="?"?"\\?":s).join("|")})`);let a=!o.test(e);if(!a){const s=e.indexOf(n);s>0&&!o.test(e.substring(0,s))&&(a=!0)}return a},ha=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let o=e;for(let a=0;a<r.length;){if(!o||typeof o!="object")return;let s,i="";for(let l=a;l<r.length;++l)if(l!==a&&(i+=n),i+=r[l],s=o[i],s!==void 0){if(["string","number","boolean"].indexOf(typeof s)>-1&&l<r.length-1)continue;a+=l-a+1;break}o=s}return o},Qr=e=>e?.replace("_","-"),ub={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)}};class Xr{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||ub,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,o){return o&&!this.debug?null:(te(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new Xr(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Xr(this.logger,t)}}var dt=new Xr;class vo{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const o=this.observers[r].get(n)||0;this.observers[r].set(n,o+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];this.observers[t]&&Array.from(this.observers[t].entries()).forEach(s=>{let[i,l]=s;for(let c=0;c<l;c++)i(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(s=>{let[i,l]=s;for(let c=0;c<l;c++)i.apply(i,[t,...r])})}}class hi extends vo{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,s=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let i;t.indexOf(".")>-1?i=t.split("."):(i=[t,n],r&&(Array.isArray(r)?i.push(...r):te(r)&&a?i.push(...r.split(a)):i.push(r)));const l=Yr(this.data,i);return!l&&!n&&!r&&t.indexOf(".")>-1&&(t=i[0],n=i[1],r=i.slice(2).join(".")),l||!s||!te(r)?l:ha(this.data?.[t]?.[n],r,a)}addResource(t,n,r,o){let a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const s=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let i=[t,n];r&&(i=i.concat(s?r.split(s):r)),t.indexOf(".")>-1&&(i=t.split("."),o=n,n=i[1]),this.addNamespaces(n),fi(this.data,i,o),a.silent||this.emit("added",t,n,r,o)}addResources(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const a in r)(te(r[a])||Array.isArray(r[a]))&&this.addResource(t,n,a,r[a],{silent:!0});o.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,o,a){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},i=[t,n];t.indexOf(".")>-1&&(i=t.split("."),o=r,r=n,n=i[1]),this.addNamespaces(n);let l=Yr(this.data,i)||{};s.skipCopy||(r=JSON.parse(JSON.stringify(r))),o?tu(l,r,a):l={...l,...r},fi(this.data,i,l),s.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(o=>n[o]&&Object.keys(n[o]).length>0)}toJSON(){return this.data}}var nu={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(a=>{t=this.processors[a]?.process(t,n,r,o)??t}),t}};const pi={},mi=e=>!te(e)&&typeof e!="boolean"&&typeof e!="number";class Jr extends vo{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),eb(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=dt.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};return t==null?!1:this.resolve(t,n)?.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let a=n.ns||this.options.defaultNS||[];const s=r&&t.indexOf(r)>-1,i=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!cb(t,r,o);if(s&&!i){const l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:te(a)?[a]:a};const c=t.split(r);(r!==o||r===o&&this.options.ns.indexOf(c[0])>-1)&&(a=c.shift()),t=c.join(o)}return{key:t,namespaces:te(a)?[a]:a}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const o=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:s,namespaces:i}=this.extractFromKey(t[t.length-1],n),l=i[i.length-1],c=n.lng||this.language,u=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c?.toLowerCase()==="cimode"){if(u){const F=n.nsSeparator||this.options.nsSeparator;return o?{res:`${l}${F}${s}`,usedKey:s,exactUsedKey:s,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:`${l}${F}${s}`}return o?{res:s,usedKey:s,exactUsedKey:s,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:s}const f=this.resolve(t,n);let p=f?.res;const d=f?.usedKey||s,y=f?.exactUsedKey||s,m=["[object Number]","[object Function]","[object RegExp]"],g=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,S=!this.i18nFormat||this.i18nFormat.handleAsObject,b=n.count!==void 0&&!te(n.count),C=Jr.hasDefaultValue(n),R=b?this.pluralResolver.getSuffix(c,n.count,n):"",A=n.ordinal&&b?this.pluralResolver.getSuffix(c,n.count,{ordinal:!1}):"",T=b&&!n.ordinal&&n.count===0,w=T&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${R}`]||n[`defaultValue${A}`]||n.defaultValue;let O=p;S&&!p&&C&&(O=w);const H=mi(O),D=Object.prototype.toString.apply(O);if(S&&O&&H&&m.indexOf(D)<0&&!(te(g)&&Array.isArray(O))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const F=this.options.returnedObjectHandler?this.options.returnedObjectHandler(d,O,{...n,ns:i}):`key '${s} (${this.language})' returned an object instead of string.`;return o?(f.res=F,f.usedParams=this.getUsedParamsDetails(n),f):F}if(a){const F=Array.isArray(O),L=F?[]:{},G=F?y:d;for(const U in O)if(Object.prototype.hasOwnProperty.call(O,U)){const Q=`${G}${a}${U}`;C&&!p?L[U]=this.translate(Q,{...n,defaultValue:mi(w)?w[U]:void 0,joinArrays:!1,ns:i}):L[U]=this.translate(Q,{...n,joinArrays:!1,ns:i}),L[U]===Q&&(L[U]=O[U])}p=L}}else if(S&&te(g)&&Array.isArray(p))p=p.join(g),p&&(p=this.extendTranslation(p,t,n,r));else{let F=!1,L=!1;!this.isValidLookup(p)&&C&&(F=!0,p=w),this.isValidLookup(p)||(L=!0,p=s);const U=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&L?void 0:p,Q=C&&w!==p&&this.options.updateMissing;if(L||F||Q){if(this.logger.log(Q?"updateKey":"missingKey",c,l,s,Q?w:p),a){const I=this.resolve(s,{...n,keySeparator:!1});I&&I.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 W=[];const Y=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Y&&Y[0])for(let I=0;I<Y.length;I++)W.push(Y[I]);else this.options.saveMissingTo==="all"?W=this.languageUtils.toResolveHierarchy(n.lng||this.language):W.push(n.lng||this.language);const _=(I,Z,le)=>{const X=C&&le!==p?le:U;this.options.missingKeyHandler?this.options.missingKeyHandler(I,l,Z,X,Q,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(I,l,Z,X,Q,n),this.emit("missingKey",I,l,Z,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?W.forEach(I=>{const Z=this.pluralResolver.getSuffixes(I,n);T&&n[`defaultValue${this.options.pluralSeparator}zero`]&&Z.indexOf(`${this.options.pluralSeparator}zero`)<0&&Z.push(`${this.options.pluralSeparator}zero`),Z.forEach(le=>{_([I],s+le,n[`defaultValue${le}`]||w)})}):_(W,s,w))}p=this.extendTranslation(p,t,n,f,r),L&&p===s&&this.options.appendNamespaceToMissingKey&&(p=`${l}:${s}`),(L||F)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${s}`:s,F?p:void 0))}return o?(f.res=p,f.usedParams=this.getUsedParamsDetails(n),f):p}extendTranslation(t,n,r,o,a){var s=this;if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const c=te(t)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(c){const p=t.match(this.interpolator.nestingRegexp);u=p&&p.length}let f=r.replace&&!te(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(f={...this.options.interpolation.defaultVariables,...f}),t=this.interpolator.interpolate(t,f,r.lng||this.language||o.usedLng,r),c){const p=t.match(this.interpolator.nestingRegexp),d=p&&p.length;u<d&&(r.nest=!1)}!r.lng&&o&&o.res&&(r.lng=this.language||o.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var p=arguments.length,d=new Array(p),y=0;y<p;y++)d[y]=arguments[y];return a?.[0]===d[0]&&!r.context?(s.logger.warn(`It seems you are nesting recursively key: ${d[0]} in key: ${n[0]}`),null):s.translate(...d,n)},r)),r.interpolation&&this.interpolator.reset()}const i=r.postProcess||this.options.postProcess,l=te(i)?[i]:i;return t!=null&&l?.length&&r.applyPostProcessor!==!1&&(t=nu.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,o,a,s,i;return te(t)&&(t=[t]),t.forEach(l=>{if(this.isValidLookup(r))return;const c=this.extractFromKey(l,n),u=c.key;o=u;let f=c.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const p=n.count!==void 0&&!te(n.count),d=p&&!n.ordinal&&n.count===0,y=n.context!==void 0&&(te(n.context)||typeof n.context=="number")&&n.context!=="",m=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(g=>{this.isValidLookup(r)||(i=g,!pi[`${m[0]}-${g}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(i)&&(pi[`${m[0]}-${g}`]=!0,this.logger.warn(`key "${o}" for languages "${m.join(", ")}" won't get resolved as namespace "${i}" 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(S=>{if(this.isValidLookup(r))return;s=S;const b=[u];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(b,u,S,g,n);else{let R;p&&(R=this.pluralResolver.getSuffix(S,n.count,n));const A=`${this.options.pluralSeparator}zero`,T=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(b.push(u+R),n.ordinal&&R.indexOf(T)===0&&b.push(u+R.replace(T,this.options.pluralSeparator)),d&&b.push(u+A)),y){const w=`${u}${this.options.contextSeparator}${n.context}`;b.push(w),p&&(b.push(w+R),n.ordinal&&R.indexOf(T)===0&&b.push(w+R.replace(T,this.options.pluralSeparator)),d&&b.push(w+A))}}let C;for(;C=b.pop();)this.isValidLookup(r)||(a=C,r=this.getResource(S,g,C,n))}))})}),{res:r,usedKey:o,exactUsedKey:a,usedLng:s,usedNS:i}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,n,r,o):this.resourceStore.getResource(t,n,r,o)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!te(t.replace);let o=r?t.replace:t;if(r&&typeof t.count<"u"&&(o.count=t.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!r){o={...o};for(const a of n)delete o[a]}return o}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class gi{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=dt.create("languageUtils")}getScriptPartFromCode(t){if(t=Qr(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=Qr(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(te(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const o=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(o))&&(n=o)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(a=>{if(a===o)return a;if(!(a.indexOf("-")<0&&o.indexOf("-")<0)&&(a.indexOf("-")>0&&o.indexOf("-")<0&&a.substring(0,a.indexOf("-"))===o||a.indexOf(o)===0&&o.length>1))return a})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),te(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),o=[],a=s=>{s&&(this.isSupportedCode(s)?o.push(s):this.logger.warn(`rejecting language code not found in supportedLngs: ${s}`))};return te(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(t))):te(t)&&a(this.formatLanguageCode(t)),r.forEach(s=>{o.indexOf(s)<0&&a(this.formatLanguageCode(s))}),o}}const vi={zero:0,one:1,two:2,few:3,many:4,other:5},yi={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class db{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=dt.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=Qr(t==="dev"?"en":t),o=n.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:r,type:o});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let s;try{s=new Intl.PluralRules(r,{type:o})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),yi;if(!t.match(/-|_/))return yi;const l=this.languageUtils.getLanguagePartFromCode(t);s=this.getRule(l,n)}return this.pluralRulesCache[a]=s,s}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(o=>`${n}${o}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((o,a)=>vi[o]-vi[a]).map(o=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=this.getRule(t,r);return o?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${o.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const bi=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=rb(e,t,n);return!a&&o&&te(n)&&(a=ha(e,n,r),a===void 0&&(a=ha(t,n,r))),a},_o=e=>e.replace(/\$/g,"$$$$");class fb{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=dt.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:o,prefix:a,prefixEscaped:s,suffix:i,suffixEscaped:l,formatSeparator:c,unescapeSuffix:u,unescapePrefix:f,nestingPrefix:p,nestingPrefixEscaped:d,nestingSuffix:y,nestingSuffixEscaped:m,nestingOptionsSeparator:g,maxReplaces:S,alwaysFormat:b}=t.interpolation;this.escape=n!==void 0?n:ab,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=a?xn(a):s||"{{",this.suffix=i?xn(i):l||"}}",this.formatSeparator=c||",",this.unescapePrefix=u?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=p?xn(p):d||xn("$t("),this.nestingSuffix=y?xn(y):m||xn(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=S||1e3,this.alwaysFormat=b!==void 0?b:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n?.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,o){let a,s,i;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=d=>{if(d.indexOf(this.formatSeparator)<0){const S=bi(n,l,d,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(S,void 0,r,{...o,...n,interpolationkey:d}):S}const y=d.split(this.formatSeparator),m=y.shift().trim(),g=y.join(this.formatSeparator).trim();return this.format(bi(n,l,m,this.options.keySeparator,this.options.ignoreJSONStructure),g,r,{...o,...n,interpolationkey:m})};this.resetRegExp();const u=o?.missingInterpolationHandler||this.options.missingInterpolationHandler,f=o?.interpolation?.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:d=>_o(d)},{regex:this.regexp,safeValue:d=>this.escapeValue?_o(this.escape(d)):_o(d)}].forEach(d=>{for(i=0;a=d.regex.exec(t);){const y=a[1].trim();if(s=c(y),s===void 0)if(typeof u=="function"){const g=u(t,a,o);s=te(g)?g:""}else if(o&&Object.prototype.hasOwnProperty.call(o,y))s="";else if(f){s=a[0];continue}else this.logger.warn(`missed to pass in variable ${y} for interpolating ${t}`),s="";else!te(s)&&!this.useRawValueToEscape&&(s=ci(s));const m=d.safeValue(s);if(t=t.replace(a[0],m),f?(d.regex.lastIndex+=s.length,d.regex.lastIndex-=a[0].length):d.regex.lastIndex=0,i++,i>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,a,s;const i=(l,c)=>{const u=this.nestingOptionsSeparator;if(l.indexOf(u)<0)return l;const f=l.split(new RegExp(`${u}[ ]*{`));let p=`{${f[1]}`;l=f[0],p=this.interpolate(p,s);const d=p.match(/'/g),y=p.match(/"/g);((d?.length??0)%2===0&&!y||y.length%2!==0)&&(p=p.replace(/'/g,'"'));try{s=JSON.parse(p),c&&(s={...c,...s})}catch(m){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,m),`${l}${u}${p}`}return s.defaultValue&&s.defaultValue.indexOf(this.prefix)>-1&&delete s.defaultValue,l};for(;o=this.nestingRegexp.exec(t);){let l=[];s={...r},s=s.replace&&!te(s.replace)?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;let c=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){const u=o[1].split(this.formatSeparator).map(f=>f.trim());o[1]=u.shift(),l=u,c=!0}if(a=n(i.call(this,o[1].trim(),s),s),a&&o[0]===t&&!te(a))return a;te(a)||(a=ci(a)),a||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),a=""),c&&(a=l.reduce((u,f)=>this.format(u,f,r.lng,{...r,interpolationkey:o[1].trim()}),a.trim())),t=t.replace(o[0],a),this.regexp.lastIndex=0}return t}}const hb=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);t==="currency"&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):t==="relativetime"&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(s=>{if(s){const[i,...l]=s.split(":"),c=l.join(":").trim().replace(/^'+|'+$/g,""),u=i.trim();n[u]||(n[u]=c),c==="false"&&(n[u]=!1),c==="true"&&(n[u]=!0),isNaN(c)||(n[u]=parseInt(c,10))}})}return{formatName:t,formatOptions:n}},Sn=e=>{const t={};return(n,r,o)=>{let a=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(a={...a,[o.interpolationkey]:void 0});const s=r+JSON.stringify(a);let i=t[s];return i||(i=e(Qr(r),o),t[s]=i),i(n)}};class pb{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=dt.create("formatter"),this.options=t,this.formats={number:Sn((n,r)=>{const o=new Intl.NumberFormat(n,{...r});return a=>o.format(a)}),currency:Sn((n,r)=>{const o=new Intl.NumberFormat(n,{...r,style:"currency"});return a=>o.format(a)}),datetime:Sn((n,r)=>{const o=new Intl.DateTimeFormat(n,{...r});return a=>o.format(a)}),relativetime:Sn((n,r)=>{const o=new Intl.RelativeTimeFormat(n,{...r});return a=>o.format(a,r.range||"day")}),list:Sn((n,r)=>{const o=new Intl.ListFormat(n,{...r});return a=>o.format(a)})},this.init(t)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=n.interpolation.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=Sn(n)}format(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const a=n.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(i=>i.indexOf(")")>-1)){const i=a.findIndex(l=>l.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,i)].join(this.formatSeparator)}return a.reduce((i,l)=>{const{formatName:c,formatOptions:u}=hb(l);if(this.formats[c]){let f=i;try{const p=o?.formatParams?.[o.interpolationkey]||{},d=p.locale||p.lng||o.locale||o.lng||r;f=this.formats[c](i,d,{...u,...o,...p})}catch(p){this.logger.warn(p)}return f}else this.logger.warn(`there was no format function for ${c}`);return i},t)}}const mb=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class gb extends vo{constructor(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=o,this.logger=dt.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,o.backend,o)}queueLoad(t,n,r,o){const a={},s={},i={},l={};return t.forEach(c=>{let u=!0;n.forEach(f=>{const p=`${c}|${f}`;!r.reload&&this.store.hasResourceBundle(c,f)?this.state[p]=2:this.state[p]<0||(this.state[p]===1?s[p]===void 0&&(s[p]=!0):(this.state[p]=1,u=!1,s[p]===void 0&&(s[p]=!0),a[p]===void 0&&(a[p]=!0),l[f]===void 0&&(l[f]=!0)))}),u||(i[c]=!0)}),(Object.keys(a).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(a),pending:Object.keys(s),toLoadLanguages:Object.keys(i),toLoadNamespaces:Object.keys(l)}}loaded(t,n,r){const o=t.split("|"),a=o[0],s=o[1];n&&this.emit("failedLoading",a,s,n),!n&&r&&this.store.addResourceBundle(a,s,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const i={};this.queue.forEach(l=>{nb(l.loaded,[a],s),mb(l,t),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{i[c]||(i[c]={});const u=l.loaded[c];u.length&&u.forEach(f=>{i[c][f]===void 0&&(i[c][f]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",i),this.queue=this.queue.filter(l=>!l.done)}read(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,s=arguments.length>5?arguments[5]:void 0;if(!t.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:o,wait:a,callback:s});return}this.readingCalls++;const i=(c,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(c&&u&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,o+1,a*2,s)},a);return}s(c,u)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const c=l(t,n);c&&typeof c.then=="function"?c.then(u=>i(null,u)).catch(i):i(null,c)}catch(c){i(c)}return}return l(t,n,i)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();te(t)&&(t=this.languageUtils.toResolveHierarchy(t)),te(n)&&(n=[n]);const a=this.queueLoad(t,n,r,o);if(!a.toLoad.length)return a.pending.length||o(),null;a.toLoad.forEach(s=>{this.loadOne(s)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),o=r[0],a=r[1];this.read(o,a,"read",void 0,void 0,(s,i)=>{s&&this.logger.warn(`${n}loading namespace ${a} for language ${o} failed`,s),!s&&i&&this.logger.log(`${n}loaded namespace ${a} for language ${o}`,i),this.loaded(t,s,i)})}saveMissing(t,n,r,o,a){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},i=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" 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(!(r==null||r==="")){if(this.backend?.create){const l={...s,isUpdate:a},c=this.backend.create.bind(this.backend);if(c.length<6)try{let u;c.length===5?u=c(t,n,r,o,l):u=c(t,n,r,o),u&&typeof u.then=="function"?u.then(f=>i(null,f)).catch(i):i(null,u)}catch(u){i(u)}else c(t,n,r,o,i,l)}!t||!t[0]||this.store.addResource(t[0],n,r,o)}}}const wi=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",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]),te(e[1])&&(t.defaultValue=e[1]),te(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),xi=e=>(te(e.ns)&&(e.ns=[e.ns]),te(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),te(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e),Tr=()=>{},vb=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class ar extends vo{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=xi(t),this.services={},this.logger=dt,this.modules={external:[]},vb(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),n.defaultNS==null&&n.ns&&(te(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const o=wi();this.options={...o,...this.options,...xi(n)},this.options.interpolation={...o.interpolation,...this.options.interpolation},n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const a=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?dt.init(a(this.modules.logger),this.options):dt.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=pb;const f=new gi(this.options);this.store=new hi(this.options.resources,this.options);const p=this.services;p.logger=dt,p.resourceStore=this.store,p.languageUtils=f,p.pluralResolver=new db(f,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===o.interpolation.format)&&(p.formatter=a(u),p.formatter.init(p,this.options),this.options.interpolation.format=p.formatter.format.bind(p.formatter)),p.interpolator=new fb(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new gb(a(this.modules.backend),p.resourceStore,p,this.options),p.backendConnector.on("*",function(d){for(var y=arguments.length,m=new Array(y>1?y-1:0),g=1;g<y;g++)m[g-1]=arguments[g];t.emit(d,...m)}),this.modules.languageDetector&&(p.languageDetector=a(this.modules.languageDetector),p.languageDetector.init&&p.languageDetector.init(p,this.options.detection,this.options)),this.modules.i18nFormat&&(p.i18nFormat=a(this.modules.i18nFormat),p.i18nFormat.init&&p.i18nFormat.init(this)),this.translator=new Jr(this.services,this.options),this.translator.on("*",function(d){for(var y=arguments.length,m=new Array(y>1?y-1:0),g=1;g<y;g++)m[g-1]=arguments[g];t.emit(d,...m)}),this.modules.external.forEach(d=>{d.init&&d.init(this)})}if(this.format=this.options.interpolation.format,r||(r=Tr),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[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(u=>{this[u]=function(){return t.store[u](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=function(){return t.store[u](...arguments),t}});const l=Qn(),c=()=>{const u=(f,p)=>{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),l.resolve(p),r(f,p)};if(this.languages&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),l}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Tr;const o=te(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(o?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const a=[],s=i=>{if(!i||i==="cimode")return;this.services.languageUtils.toResolveHierarchy(i).forEach(c=>{c!=="cimode"&&a.indexOf(c)<0&&a.push(c)})};o?s(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>s(l)),this.options.preload?.forEach?.(i=>s(i)),this.services.backendConnector.load(a,this.options.ns,i=>{!i&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(i)})}else r(null)}reloadResources(t,n,r){const o=Qn();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=Tr),this.services.backendConnector.reload(t,n,a=>{o.resolve(),r(a)}),o}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&nu.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const o=Qn();this.emit("languageChanging",t);const a=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},s=(l,c)=>{c?(a(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,o.resolve(function(){return r.t(...arguments)}),n&&n(l,function(){return r.t(...arguments)})},i=l=>{!t&&!l&&this.services.languageDetector&&(l=[]);const c=te(l)?l:this.services.languageUtils.getBestMatchFromCodes(l);c&&(this.language||a(c),this.translator.language||this.translator.changeLanguage(c),this.services.languageDetector?.cacheUserLanguage?.(c)),this.loadResources(c,u=>{s(u,c)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?i(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(t),o}getFixedT(t,n,r){var o=this;const a=function(s,i){let l;if(typeof i!="object"){for(var c=arguments.length,u=new Array(c>2?c-2:0),f=2;f<c;f++)u[f-2]=arguments[f];l=o.options.overloadTranslationOptionHandler([s,i].concat(u))}else l={...i};l.lng=l.lng||a.lng,l.lngs=l.lngs||a.lngs,l.ns=l.ns||a.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||r||a.keyPrefix);const p=o.options.keySeparator||".";let d;return l.keyPrefix&&Array.isArray(s)?d=s.map(y=>`${l.keyPrefix}${p}${y}`):d=l.keyPrefix?`${l.keyPrefix}${p}${s}`:s,o.t(d,l)};return te(t)?a.lng=t:a.lngs=t,a.ns=n,a.keyPrefix=r,a}t(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.translator?.translate(...n)}exists(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.translator?.exists(...n)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};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;const r=n.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const s=(i,l)=>{const c=this.services.backendConnector.state[`${i}|${l}`];return c===-1||c===0||c===2};if(n.precheck){const i=n.precheck(this,s);if(i!==void 0)return i}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(r,t)&&(!o||s(a,t)))}loadNamespaces(t,n){const r=Qn();return this.options.ns?(te(t)&&(t=[t]),t.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=Qn();te(t)&&(t=[t]);const o=this.options.preload||[],a=t.filter(s=>o.indexOf(s)<0&&this.services.languageUtils.isSupportedCode(s));return a.length?(this.options.preload=o.concat(a),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["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"],r=this.services?.languageUtils||new gi(wi());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new ar(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Tr;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const o={...this.options,...t,isClone:!0},a=new ar(o);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),["store","services","language"].forEach(i=>{a[i]=this[i]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r){const i=Object.keys(this.store.data).reduce((l,c)=>(l[c]={...this.store.data[c]},Object.keys(l[c]).reduce((u,f)=>(u[f]={...l[c][f]},u),{})),{});a.store=new hi(i,o),a.services.resourceStore=a.store}return a.translator=new Jr(a.services,o),a.translator.on("*",function(i){for(var l=arguments.length,c=new Array(l>1?l-1:0),u=1;u<l;u++)c[u-1]=arguments[u];a.emit(i,...c)}),a.init(o,n),a.translator.options=o,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}}}const Me=ar.createInstance();Me.createInstance=ar.createInstance;Me.createInstance;Me.dir;Me.init;Me.loadResources;Me.reloadResources;Me.use;Me.changeLanguage;Me.getFixedT;Me.t;Me.exists;Me.setDefaultNamespace;Me.hasLoadedNamespace;Me.loadNamespaces;Me.loadLanguages;function yb(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=bb(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
165
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,s=!0,i=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return s=c.done,c},e:function(c){i=!0,a=c},f:function(){try{s||n.return==null||n.return()}finally{if(i)throw a}}}}function bb(e,t){if(e){if(typeof e=="string")return Si(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Si(e,t):void 0}}function Si(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function pa(e){"@babel/helpers - typeof";return pa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pa(e)}var ru=["__proto__","constructor","prototype"];function ou(e){return!(typeof e!="string"||e.length===0||e.length>128||ru.indexOf(e)>-1||e.indexOf("..")>-1||e.indexOf("\\")>-1||/[?#%\s@]/.test(e)||/[\x00-\x1F\x7F]/.test(e))}function au(e){return!(!ou(e)||e.indexOf("/")>-1)}function wb(e){return ou(e)}var xb={lng:au,ns:wb};function Or(e){return typeof e!="string"?e:e.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function Sb(e){if(typeof e!="string"||e.length===0)return e;try{var t=new URL(e);return t.username||t.password?(t.username="",t.password="",t.toString()):e}catch{return e.replace(/(\/\/)[^/@\s]+@/g,"$1")}}function su(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":pa(XMLHttpRequest))==="object"}function Eb(e){return!!e&&typeof e.then=="function"}function Cb(e){return Eb(e)?e:Promise.resolve(e)}var Rb=/\{\{(.+?)\}\}/g;function Ei(e,t){var n=!1,r=e.replace(Rb,function(o,a){var s=a.trim();if(ru.indexOf(s)>-1)return o;var i=t[s];if(i==null)return o;var l=xb[s]||au,c=String(i).split("+"),u=yb(c),f;try{for(u.s();!(f=u.n()).done;){var p=f.value;if(!l(p))return n=!0,o}}catch(d){u.e(d)}finally{u.f()}return c.join("+")});return n?null:r}function Ci(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Ri(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ci(Object(n),!0).forEach(function(r){Pb(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ci(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pb(e,t,n){return(t=Ab(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ab(e){var t=Tb(e,"string");return fn(t)=="symbol"?t:t+""}function Tb(e,t){if(fn(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(fn(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fn(e){"@babel/helpers - typeof";return fn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fn(e)}var $t=typeof fetch=="function"?fetch:void 0;typeof global<"u"&&global.fetch?$t=global.fetch:typeof window<"u"&&window.fetch&&($t=window.fetch);var sr;su()&&(typeof global<"u"&&global.XMLHttpRequest?sr=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(sr=window.XMLHttpRequest));var Zr;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?Zr=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(Zr=window.ActiveXObject));typeof $t!="function"&&($t=void 0);if(!$t&&!sr&&!Zr)try{pe(()=>import("./browser-ponyfill-BOcGq8h9.js").then(e=>e.b),__vite__mapDeps([65,1])).then(function(e){$t=e.default}).catch(function(){})}catch{}var iu=["__proto__","constructor","prototype"],ma=function(t,n){if(n&&fn(n)==="object"){for(var r="",o=0,a=Object.keys(n);o<a.length;o++){var s=a[o];iu.indexOf(s)>-1||(r+="&"+encodeURIComponent(s)+"="+encodeURIComponent(n[s]))}if(!r)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+r.slice(1)}return t},Pi=function(t,n,r,o){var a=function(l){if(!l.ok)return r(l.statusText||"Error",{status:l.status});l.text().then(function(c){r(null,{status:l.status,data:c})}).catch(r)};if(o){var s=o(t,n);if(s instanceof Promise){s.then(a).catch(r);return}}typeof fetch=="function"?fetch(t,n).then(a).catch(r):$t(t,n).then(a).catch(r)},Ob=function(t,n,r,o){t.queryStringParams&&(n=ma(n,t.queryStringParams));var a=Ri({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(a["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),r&&(a["Content-Type"]="application/json");var s=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,i=Ri({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:a},t._omitFetchOptions?{}:s),l=typeof t.alternateFetch=="function"&&t.alternateFetch.length>=1?t.alternateFetch:void 0;try{Pi(n,i,o,l)}catch(c){if(!s||Object.keys(s).length===0||!c.message||c.message.indexOf("not implemented")<0)return o(c);try{Object.keys(s).forEach(function(u){delete i[u]}),Pi(n,i,o,l),t._omitFetchOptions=!0}catch(u){o(u)}}},kb=function(t,n,r,o){r&&fn(r)==="object"&&(r=ma("",r).slice(1)),t.queryStringParams&&(n=ma(n,t.queryStringParams));try{var a=sr?new sr:new Zr("MSXML2.XMLHTTP.3.0");a.open(r?"POST":"GET",n,1),t.crossDomain||a.setRequestHeader("X-Requested-With","XMLHttpRequest"),a.withCredentials=!!t.withCredentials,r&&a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),a.overrideMimeType&&a.overrideMimeType("application/json");var s=t.customHeaders;if(s=typeof s=="function"?s():s,s)for(var i=0,l=Object.keys(s);i<l.length;i++){var c=l[i];iu.indexOf(c)>-1||a.setRequestHeader(c,s[c])}a.onreadystatechange=function(){a.readyState>3&&o(a.status>=400?a.statusText:null,{status:a.status,data:a.responseText})},a.send(r)}catch(u){console&&console.log(u)}},Lb=function(t,n,r,o){if(typeof r=="function"&&(o=r,r=void 0),o=o||function(){},$t&&n.indexOf("file:")!==0)return Ob(t,n,r,o);if(su()||typeof ActiveXObject=="function")return kb(t,n,r,o);o(new Error("No fetch and no xhr implementation found!"))};function On(e){"@babel/helpers - typeof";return On=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},On(e)}function Ai(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function jo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ai(Object(n),!0).forEach(function(r){lu(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ai(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ib(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,cu(r.key),r)}}function Db(e,t,n){return t&&Ib(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function lu(e,t,n){return(t=cu(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cu(e){var t=Mb(e,"string");return On(t)=="symbol"?t:t+""}function Mb(e,t){if(On(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(On(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var _b=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:function(n){return JSON.parse(n)},stringify:JSON.stringify,parsePayload:function(n,r,o){return lu({},r,o||"")},parseLoadPayload:function(n,r){},request:Lb,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},uu=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Nb(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return Db(e,[{key:"init",value:function(n){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=n,this.options=jo(jo(jo({},_b()),this.options||{}),o),this.allOptions=a,this.services&&this.options.reloadInterval){var s=setInterval(function(){return r.reload()},this.options.reloadInterval);On(s)==="object"&&typeof s.unref=="function"&&s.unref()}}},{key:"readMulti",value:function(n,r,o){this._readAny(n,n,r,r,o)}},{key:"read",value:function(n,r,o){this._readAny([n],n,[r],r,o)}},{key:"_readAny",value:function(n,r,o,a,s){var i=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,o)),l=Cb(l),l.then(function(c){if(!c)return s(null,{});var u=Ei(c,{lng:n.join("+"),ns:o.join("+")});if(u==null){var f=n.map(Or).join(", "),p=o.map(Or).join(", ");return s(new Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=["+f+"] namespaces=["+p+"]"),!1)}i.loadUrl(u,s,r,a)})}},{key:"loadUrl",value:function(n,r,o,a){var s=this,i=typeof o=="string"?[o]:o,l=typeof a=="string"?[a]:a,c=this.options.parseLoadPayload(i,l),u=Or(Sb(n));this.options.request(this.options,n,c,function(f,p){if(p&&(p.status>=500&&p.status<600||!p.status))return r("failed loading "+u+"; status code: "+p.status,!0);if(p&&p.status>=400&&p.status<500)return r("failed loading "+u+"; status code: "+p.status,!1);if(!p&&f&&f.message){var d=f.message.toLowerCase(),y=["failed","fetch","network","load"].find(function(S){return d.indexOf(S)>-1});if(y)return r("failed loading "+u+": "+Or(f.message),!0)}if(f)return r(f,!1);var m,g;try{typeof p.data=="string"?m=s.options.parse(p.data,o,a):m=p.data}catch{g="failed parsing "+u+" to json"}if(g)return r(g,!1);r(null,m)})}},{key:"create",value:function(n,r,o,a,s){var i=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,o,a),c=0,u=[],f=[];n.forEach(function(p){var d=i.options.addPath;typeof i.options.addPath=="function"&&(d=i.options.addPath(p,r));var y=Ei(d,{lng:p,ns:r});if(y==null){c+=1,s&&c===n.length&&s(u,f);return}i.options.request(i.options,y,l,function(m,g){c+=1,u.push(m),f.push(g),c===n.length&&typeof s=="function"&&s(u,f)})})}}},{key:"reload",value:function(){var n=this,r=this.services,o=r.backendConnector,a=r.languageUtils,s=r.logger,i=o.language;if(!(i&&i.toLowerCase()==="cimode")){var l=[],c=function(f){var p=a.toResolveHierarchy(f);p.forEach(function(d){l.indexOf(d)<0&&l.push(d)})};c(i),this.allOptions.preload&&this.allOptions.preload.forEach(function(u){return c(u)}),l.forEach(function(u){n.allOptions.ns.forEach(function(f){o.read(u,f,"read",null,null,function(p,d){p&&s.warn("loading namespace ".concat(f," for language ").concat(u," failed"),p),!p&&d&&s.log("loaded namespace ".concat(f," for language ").concat(u),d),o.loaded("".concat(u,"|").concat(f),p,d)})})})}}}])}();uu.type="backend";const jb="Agim",Fb={refresh:"Refresh",save:"Save",cancel:"Cancel",delete:"Delete",edit:"Edit",submit:"Submit",close:"Close",back:"Back",next:"Next",previous:"Previous",create:"Create",search:"Search",retry:"Retry",confirm:"Confirm"},$b={loading:"Loading…",empty:"No data",saving:"Saving…",saved:"Saved",error:"Something went wrong"},Ub={label:"Theme",system:"System",light:"Light",dark:"Dark",cycleHint:"Click to cycle theme"},Hb={label:"Language",en:"English",zh:"中文"},Bb={chat:"Chat",tasks:"Tasks",approvals:"Approvals",reminders:"Reminders",memos:"Memos",memory:"Memory",skills:"Skills",workspace:"Workspace",observability:"Observability",settings:"Settings"},Vb={deleteTitle:"Delete this item?",deleteDescription:"This cannot be undone.",destructiveAction:"Delete"},zb={label:"Pagination",perPage:"Per page",firstPage:"First page",lastPage:"Last page",pageOfTotal:"Page {{page}} of {{totalPages}}",range:"{{from}}–{{to}} of {{total}}"},Wb={selectAll:"Select all rows",selectRow:"Select row"},Kb={intro:"Paste your access token from ~/.agim/tokens.json or `agim token list`.",tokenLabel:"Access token",submit:"Sign in",hint:"Loopback (127.0.0.1) requests bypass this page; you only land here from another host or with IMHUB_TRUST_LOOPBACK=off."},qb={placeholder:"Signed in. The chat surface ships in PR-6; this route is intentionally blank for now.",healthCheck:"Backend reachable"},Gb={title:"Nothing here.",description:"The page you're looking for doesn't exist."},Yb={title:"Something went wrong.",description:"An unexpected error broke the page render. Try reloading or heading back to the home screen; if it persists, copy the message below and report it.",reload:"Reload",home:"Home"},Qb={send:"Send",streaming:"… streaming",notConnected:"Not connected. Reconnecting…",connecting:"Connecting to agim…",disconnected:"Disconnected. Reconnecting automatically; you can keep typing.",welcomeTitle:"Start a conversation",welcomeBody:"Type a message to ask the active agent. Use the agent dropdown to switch.",inputPlaceholder:"Message… (Enter sends, Shift+Enter newlines)",newConv:"New",newConvHint:"Clear messages and start a fresh session",newConvToast:"Started a new conversation",approvalTitle:"🔐 Tool approval",approvalAutoBadge:"auto-allow",approvalAutoIn:"Auto-allowing in {{count}}s — Deny to stop.",approvalAutoResolving:"Auto-allowing now…",approvalToolLabel:"Tool",approvalInputLabel:"Input",approvalAllow:"Allow",approvalAuto:"Auto for similar",approvalAutoTip:"Allow and auto-allow similar calls for the rest of the session",approvalDeny:"Deny",outcome:{allowed:"✅ Allowed",allowedPinned:"✅ Allowed + auto-allow further",denied:"❌ Denied",deniedRevoked:"❌ Denied (auto-allow revoked)",expired:"⏱ Timed out"}},Xb={appName:jb,actions:Fb,states:$b,theme:Ub,lang:Hb,nav:Bb,confirm:Vb,pagination:zb,table:Wb,login:Kb,home:qb,notFound:Gb,errorBoundary:Yb,chat:Qb},Jb="Agim",Zb={refresh:"刷新",save:"保存",cancel:"取消",delete:"删除",edit:"编辑",submit:"提交",close:"关闭",back:"返回",next:"下一页",previous:"上一页",create:"新建",search:"搜索",retry:"重试",confirm:"确定"},ew={loading:"加载中…",empty:"暂无数据",saving:"保存中…",saved:"已保存",error:"出错了"},tw={label:"主题",system:"跟随系统",light:"浅色",dark:"深色",cycleHint:"点击切换主题"},nw={label:"语言",en:"English",zh:"中文"},rw={chat:"对话",tasks:"任务",approvals:"审批",reminders:"提醒",memos:"备忘",memory:"记忆",skills:"技能",workspace:"工作区",observability:"观测",settings:"设置"},ow={deleteTitle:"确认删除?",deleteDescription:"操作不可撤销。",destructiveAction:"删除"},aw={label:"分页",perPage:"每页",firstPage:"首页",lastPage:"末页",pageOfTotal:"第 {{page}} / {{totalPages}} 页",range:"{{from}}–{{to}} / 共 {{total}}"},sw={selectAll:"全选",selectRow:"选中此行"},iw={intro:"粘贴 ~/.agim/tokens.json 里的访问令牌(或运行 `agim token list` 查看)。",tokenLabel:"访问令牌",submit:"登录",hint:"loopback(127.0.0.1)的请求会跳过此页;只有跨机访问或设置了 IMHUB_TRUST_LOOPBACK=off 时才会看到此页。"},lw={placeholder:"已登录。聊天界面将在 PR-6 落地;当前页暂为占位。",healthCheck:"后端可达"},cw={title:"什么也没找到。",description:"你要找的页面不存在。"},uw={title:"出错了。",description:"页面渲染过程中遇到了未预期的错误。可以尝试刷新或返回主页;若问题反复出现,请复制下方错误信息反馈。",reload:"刷新",home:"返回主页"},dw={send:"发送",streaming:"… 接收中",notConnected:"未连接,正在重连…",connecting:"正在连接 agim…",disconnected:"已断开,自动重连中;可以继续输入。",welcomeTitle:"开始对话",welcomeBody:"输入消息向当前 Agent 提问。点上方下拉可切换 Agent。",inputPlaceholder:"输入消息……(Enter 发送,Shift+Enter 换行)",newConv:"新对话",newConvHint:"清空消息并开启新会话",newConvToast:"已开启新对话",approvalTitle:"🔐 工具授权",approvalAutoBadge:"自动放行",approvalAutoIn:"{{count}} 秒后自动放行 — 点「拒绝」可中止。",approvalAutoResolving:"正在自动放行…",approvalToolLabel:"工具",approvalInputLabel:"输入",approvalAllow:"批准",approvalAuto:"本类自动放行",approvalAutoTip:"批准并对本会话内同类调用自动放行",approvalDeny:"拒绝",outcome:{allowed:"✅ 已批准",allowedPinned:"✅ 已批准 · 后续同类自动放行",denied:"❌ 已拒绝",deniedRevoked:"❌ 已拒绝(撤销自动放行)",expired:"⏱ 已超时"}},fw={appName:Jb,actions:Zb,states:ew,theme:tw,lang:nw,nav:rw,confirm:ow,pagination:aw,table:sw,login:iw,home:lw,notFound:cw,errorBoundary:uw,chat:dw},hw="Couldn't reach the server. Check your connection and retry.",pw="Your session expired. Please sign in again.",mw="Sign-in required.",gw="Auth token missing from request.",vw="Auth subsystem isn't ready yet. Retry in a moment.",yw="You don't have permission to do that.",bw="The requested resource wasn't found.",ww="That request is too big — try splitting it.",xw="The server rejected the request: {{detail}}",Sw="Request body wasn't valid JSON.",Ew="Configuration didn't validate. Check the form fields.",Cw="Couldn't save configuration: {{detail}}",Rw="Send an `updates` object to change env values.",Pw="None of the keys you sent are editable.",Aw="SMTP isn't configured. Save host / user / password first.",Tw="SMTP verify failed: {{detail}}",Ow="Provide a baseUrl to discover ACP agents.",kw="Provide an `endpoint` to test the agent.",Lw="ACP discovery failed: {{detail}}",Nw="ACP agent test failed: {{detail}}",Iw="A user_key (platform:userId) is required.",Dw="Something went wrong (code {{code}}).",Mw="Bad request.",_w="Sign-in required.",jw="Forbidden.",Fw="Not found.",$w="Conflict — refresh and try again.",Uw="Request too large.",Hw="Server error.",Bw="Gateway error.",Vw="Service unavailable.",zw="Gateway timeout.",Ww={NETWORK:hw,AUTH_INVALID:pw,AUTH_REQUIRED:mw,AUTH_TOKEN_REQUIRED:gw,AUTH_NOT_READY:vw,FORBIDDEN:yw,NOT_FOUND:bw,PAYLOAD_TOO_LARGE:ww,VALIDATION:xw,INVALID_JSON_BODY:Sw,CONFIG_INVALID:Ew,CONFIG_SAVE_FAILED:Cw,ENV_UPDATES_REQUIRED:Rw,ENV_NO_EDITABLE_KEYS:Pw,EMAIL_NOT_CONFIGURED:Aw,EMAIL_VERIFY_FAILED:Tw,ACP_BASEURL_REQUIRED:Ow,ACP_ENDPOINT_REQUIRED:kw,ACP_DISCOVER_FAILED:Lw,ACP_TEST_FAILED:Nw,MEMORY_USER_KEY_REQUIRED:Iw,UNKNOWN:Dw,HTTP_400:Mw,HTTP_401:_w,HTTP_403:jw,HTTP_404:Fw,HTTP_409:$w,HTTP_413:Uw,HTTP_500:Hw,HTTP_502:Bw,HTTP_503:Vw,HTTP_504:zw},Kw="无法访问服务器,请检查网络后重试。",qw="登录状态已过期,请重新登录。",Gw="请先登录。",Yw="请求缺少 auth token。",Qw="鉴权子系统尚未就绪,请稍后重试。",Xw="没有执行该操作的权限。",Jw="请求的资源不存在。",Zw="请求体过大,请拆分后重试。",ex="服务端拒绝了请求:{{detail}}",tx="请求体不是合法的 JSON。",nx="配置校验失败,请检查表单字段。",rx="保存配置失败:{{detail}}",ox="请在请求体中提供 `updates` 对象以修改 env。",ax="请求里的 key 均不可编辑。",sx="SMTP 未配置,请先保存 host / user / password。",ix="SMTP 连接测试失败:{{detail}}",lx="需要 baseUrl 才能发现 ACP Agent。",cx="需要 `endpoint` 才能测试该 Agent。",ux="ACP 发现失败:{{detail}}",dx="ACP Agent 测试失败:{{detail}}",fx="需要 user_key(形如 `platform:userId`)。",hx="出错了 (code {{code}})。",px="请求格式不正确。",mx="请先登录。",gx="没有权限。",vx="未找到。",yx="状态冲突,请刷新后重试。",bx="请求体过大。",wx="服务端出错。",xx="网关错误。",Sx="服务暂不可用。",Ex="网关超时。",Cx={NETWORK:Kw,AUTH_INVALID:qw,AUTH_REQUIRED:Gw,AUTH_TOKEN_REQUIRED:Yw,AUTH_NOT_READY:Qw,FORBIDDEN:Xw,NOT_FOUND:Jw,PAYLOAD_TOO_LARGE:Zw,VALIDATION:ex,INVALID_JSON_BODY:tx,CONFIG_INVALID:nx,CONFIG_SAVE_FAILED:rx,ENV_UPDATES_REQUIRED:ox,ENV_NO_EDITABLE_KEYS:ax,EMAIL_NOT_CONFIGURED:sx,EMAIL_VERIFY_FAILED:ix,ACP_BASEURL_REQUIRED:lx,ACP_ENDPOINT_REQUIRED:cx,ACP_DISCOVER_FAILED:ux,ACP_TEST_FAILED:dx,MEMORY_USER_KEY_REQUIRED:fx,UNKNOWN:hx,HTTP_400:px,HTTP_401:mx,HTTP_403:gx,HTTP_404:vx,HTTP_409:yx,HTTP_413:bx,HTTP_500:wx,HTTP_502:xx,HTTP_503:Sx,HTTP_504:Ex},Rx="Tasks",Px={jobs:"Jobs",subtasks:"Subtasks",bgjobs:"Background",schedules:"Schedules",outbox:"Outbox",a2a:"Agent ↔ Agent"},Ax={title:"Jobs",subtitle:"Long-running agent invocations and their results.",empty:{title:"No jobs yet",description:"Jobs are created when an agent runs in async mode — via `agim --invoke` or an inline /run command from chat."},filter:{status:"Status",statusAny:"Any status",agent:"Agent",agentAny:"Any agent",kind:"Kind",kindAny:"Any kind"},col:{id:"ID",agent:"Agent",prompt:"Prompt",status:"Status",createdAt:"Created",duration:"Duration",cost:"Cost"},status:{pending:"Pending",running:"Running",completed:"Completed",delivered:"Delivered",failed:"Failed",cancelled:"Cancelled",interrupted:"Interrupted",replaced:"Replaced",abandoned:"Abandoned"},kind:{job:"Job",inline:"Inline"},stats:{pending:"Pending",running:"Running",completed:"Completed",failed:"Failed"},batch:{selected:"{{count}} selected",cancel:"Cancel selected",rerun:"Re-run selected",confirmCancel:"Cancel {{count}} job(s)?",confirmCancelDesc:"Running jobs will be sent a stop signal. Already-completed jobs are unaffected.",confirmRerun:"Re-run {{count}} job(s)?",confirmRerunDesc:"New jobs will be created from the original prompts."},live:{connected:"● Live",connecting:"● Connecting",reconnecting:"● Reconnecting",closed:"● Offline"}},Tx={title:"Subtasks",subtitle:"Per-conversation child tasks spawned by the parent agent.",empty:{title:"No subtasks yet",description:"Subtasks appear when an agent dispatches work to another agent inside a chat thread."},filter:{agent:"Parent agent",agentAny:"Any agent"},col:{id:"ID",agent:"Agent",prompt:"Prompt",status:"Status",parent:"Parent",platform:"Platform",createdAt:"Created"},status:{pending:"Pending",running:"Running",completed:"Completed",failed:"Failed",cancelled:"Cancelled"}},Ox={title:"Background jobs",subtitle:"Long-running scripts the agent wrappers (Claude Code / opencode / codex) launched via bgjob.",empty:{title:"No background jobs",description:"Background jobs show up here once an agent has used its bgjob wrapper. Roots come from ~/.claude/bgjobs/, ~/.config/opencode/bgjobs/, ~/.codex/bgjobs/ (override via IMHUB_BGJOB_ROOTS)."},filter:{root:"Root",rootAny:"All roots"},col:{name:"Name",status:"Status",root:"Root",pid:"PID",startedAt:"Started",endedAt:"Ended",exit:"Exit"},exitOk:"ok",stillRunning:"—"},kx={title:"Schedules",subtitle:"Cron-style triggers that re-invoke an agent with a fixed prompt.",empty:{title:"No schedules configured",description:"Create a schedule from the agent's chat via `/cron set` or by running `agim cron create` in the CLI."},filter:{agent:"Agent",agentAny:"Any agent"},col:{id:"ID",name:"Name",agent:"Agent",cron:"Cron",prompt:"Prompt",enabled:"Enabled",nextRun:"Next run",lastRun:"Last run"},enabled:"On",disabled:"Off"},Lx={title:"Outbox",subtitle:"Pending IM-platform deliveries. The crash-safe queue retries on transient failures and parks unrecoverable ones in `giving_up`.",empty:{title:"Outbox is empty",description:"Messages move through the queue and are deleted on successful delivery. A non-empty outbox here means the queue is actively flushing or a delivery is stuck."},filter:{status:"Status",statusAny:"Any status",thread:"Thread key"},stats:{pending:"Pending",giving_up:"Giving up",delivered:"Delivered (lifetime)",lastDelivered:"Last delivery"},col:{id:"ID",status:"Status",platform:"Platform",preview:"Preview",thread:"Thread",kind:"Kind",attempts:"Attempts",createdAt:"Created",lastError:"Last error",jobId:"Job"},status:{pending:"Pending",delivered:"Delivered",giving_up:"Giving up"},action:{retry:"Retry",confirmRetry:"Re-queue this delivery?",confirmRetryDesc:"The row's status flips back to pending and the sender will attempt delivery again on the next tick."}},Nx={title:"Agent ↔ Agent",subtitle:"Recent inline jobs spawned with a parent (one agent invoking another).",empty:{title:"No agent-to-agent calls yet",description:"Inline a2a calls appear here once an agent uses the `agim --invoke` tool with a parent context."},stats:{total:"Total",recent24h:"Last 24h",maxDepth:"Max depth"},col:{id:"ID",agent:"Agent",parent:"Parent",depth:"Depth",status:"Status",prompt:"Prompt",createdAt:"Created"}},Ix={pageTitle:Rx,subnav:Px,jobs:Ax,subtasks:Tx,bgjobs:Ox,schedules:kx,outbox:Lx,a2a:Nx},Dx="任务",Mx={jobs:"作业",subtasks:"子任务",bgjobs:"后台脚本",schedules:"定时任务",outbox:"投递队列",a2a:"Agent 互调"},_x={title:"作业",subtitle:"Agent 的长任务调用与结果。",empty:{title:"暂无作业",description:"通过 `agim --invoke` 或聊天里的 /run 命令异步启动 Agent 时会自动生成作业记录。"},filter:{status:"状态",statusAny:"全部状态",agent:"Agent",agentAny:"全部 Agent",kind:"类型",kindAny:"全部类型"},col:{id:"ID",agent:"Agent",prompt:"Prompt",status:"状态",createdAt:"创建时间",duration:"耗时",cost:"成本"},status:{pending:"等待中",running:"运行中",completed:"已完成",delivered:"已送达",failed:"失败",cancelled:"已取消",interrupted:"已中断",replaced:"已替换",abandoned:"已放弃"},kind:{job:"作业",inline:"即时"},stats:{pending:"等待中",running:"运行中",completed:"已完成",failed:"失败"},batch:{selected:"已选 {{count}} 项",cancel:"取消所选",rerun:"重跑所选",confirmCancel:"确认取消 {{count}} 个作业?",confirmCancelDesc:"运行中的作业会收到停止信号。已完成的作业不受影响。",confirmRerun:"确认重跑 {{count}} 个作业?",confirmRerunDesc:"将根据原 Prompt 重新创建作业。"},live:{connected:"● 实时",connecting:"● 连接中",reconnecting:"● 重连中",closed:"● 离线"}},jx={title:"子任务",subtitle:"由父 Agent 在对话内派发出的子任务列表。",empty:{title:"暂无子任务",description:"当 Agent 在聊天线程内向其他 Agent 委派工作时,子任务会出现在这里。"},filter:{agent:"父 Agent",agentAny:"全部 Agent"},col:{id:"ID",agent:"Agent",prompt:"Prompt",status:"状态",parent:"父级",platform:"平台",createdAt:"创建时间"},status:{pending:"等待中",running:"运行中",completed:"已完成",failed:"失败",cancelled:"已取消"}},Fx={title:"后台脚本",subtitle:"Agent 封装(Claude Code / opencode / codex)通过 bgjob 启动的长任务进程。",empty:{title:"暂无后台脚本",description:"当 Agent 使用其 bgjob 封装时,记录会在这里出现。Root 路径默认取 ~/.claude/bgjobs/、~/.config/opencode/bgjobs/、~/.codex/bgjobs/(可通过 IMHUB_BGJOB_ROOTS 覆盖)。"},filter:{root:"Root",rootAny:"全部 Root"},col:{name:"名称",status:"状态",root:"Root",pid:"PID",startedAt:"开始时间",endedAt:"结束时间",exit:"退出码"},exitOk:"ok",stillRunning:"—"},$x={title:"定时任务",subtitle:"Cron 触发的 Agent 调用 — 按固定 Prompt 重新执行。",empty:{title:"暂无定时任务",description:"可在聊天中通过 `/cron set` 或 CLI `agim cron create` 创建定时任务。"},filter:{agent:"Agent",agentAny:"全部 Agent"},col:{id:"ID",name:"名称",agent:"Agent",cron:"Cron",prompt:"Prompt",enabled:"启用",nextRun:"下次运行",lastRun:"上次运行"},enabled:"开",disabled:"关"},Ux={title:"投递队列",subtitle:"面向 IM 平台的待投递消息队列。瞬态失败会自动重试;不可恢复的会停在 giving_up。",empty:{title:"投递队列为空",description:"消息成功投递后会被删除。如果这里非空,说明队列正在刷出消息,或某条消息卡住了。"},filter:{status:"状态",statusAny:"全部状态",thread:"Thread 标识"},stats:{pending:"待发送",giving_up:"放弃中",delivered:"已投递(累计)",lastDelivered:"最近投递"},col:{id:"ID",status:"状态",platform:"平台",preview:"内容",thread:"Thread",kind:"类型",attempts:"尝试次数",createdAt:"创建时间",lastError:"最后错误",jobId:"Job"},status:{pending:"待发送",delivered:"已投递",giving_up:"放弃中"},action:{retry:"重试",confirmRetry:"重新入队这条投递?",confirmRetryDesc:"状态会切回 pending,发送器会在下一轮 tick 再次尝试投递。"}},Hx={title:"Agent 互调",subtitle:"带父级 ID 的最近 inline 作业(一个 Agent 调用另一个 Agent 的记录)。",empty:{title:"暂无 Agent 互调记录",description:"当某 Agent 使用 `agim --invoke` 工具并带上父级上下文时,这里会出现 inline a2a 调用记录。"},stats:{total:"累计",recent24h:"近 24 小时",maxDepth:"最大深度"},col:{id:"ID",agent:"Agent",parent:"父级",depth:"深度",status:"状态",prompt:"Prompt",createdAt:"创建时间"}},Bx={pageTitle:Dx,subnav:Mx,jobs:_x,subtasks:jx,bgjobs:Fx,schedules:$x,outbox:Ux,a2a:Hx},Vx="Approvals",zx="Pending tool invocations the agent is asking permission for.",Wx={connected:"● Live",connecting:"● Connecting",reconnecting:"● Reconnecting",closed:"● Offline"},Kx={pending:"Pending",totalAllowed:"Total allowed",totalDenied:"Total denied",totalTimedOut:"Timed out",totalReadonly:"Read-only auto-allowed"},qx={title:"No approvals waiting",description:"The queue is empty. Tool requests show up here when an agent calls a tool that's not on its allow-list yet."},Gx="Thread",Yx="auto-allow",Qx="Backend auto-allowed this read-only tool; the card is shown for visibility only.",Xx="Allow",Jx="Deny",Zx={allowedShort:"Allowed",deniedShort:"Denied"},e0={pageTitle:Vx,subtitle:zx,live:Wx,stats:Kx,empty:qx,threadLabel:Gx,autoAllowedTag:Yx,autoAllowedTitle:Qx,allow:Xx,deny:Jx,toast:Zx},t0="审批",n0="Agent 等待批准的工具调用。",r0={connected:"● 实时",connecting:"● 连接中",reconnecting:"● 重连中",closed:"● 离线"},o0={pending:"待审批",totalAllowed:"累计放行",totalDenied:"累计拒绝",totalTimedOut:"超时",totalReadonly:"只读自动放行"},a0={title:"暂无待审批请求",description:"队列为空。当 Agent 调用尚未加入白名单的工具时,请求会在这里出现。"},s0="Thread",i0="自动放行",l0="后端已对该只读工具自动放行;此处仅供可见性展示。",c0="放行",u0="拒绝",d0={allowedShort:"已放行",deniedShort:"已拒绝"},f0={pageTitle:t0,subtitle:n0,live:r0,stats:o0,empty:a0,threadLabel:s0,autoAllowedTag:i0,autoAllowedTitle:l0,allow:c0,deny:u0,toast:d0},h0="Reminders",p0="Queued reminders waiting to fire. Cancel or snooze pending ones; fired and cancelled rows are kept for audit.",m0={status:"Status",statusAny:"Any status"},g0={pending:"Pending",firing:"Firing",fired:"Fired",cancelled:"Cancelled",failed:"Failed"},v0={slash:"/remind",mcp:"MCP",api:"API"},y0={literal:"Literal",llm:"LLM"},b0={title:"Nothing scheduled",description:"Reminders show up here once an agent (via /remind, MCP, or API) queues one. Filter by status to see fired or cancelled ones."},w0={id:"ID",fireAt:"Fires",text:"Text",status:"Status",platform:"Platform",thread:"Thread",source:"Source",recurrence:"Recurrence",createdAt:"Created"},x0={cancel:"Cancel",snooze:"Snooze",confirmCancel:"Cancel this reminder?",confirmCancelDesc:"The reminder is removed from the queue. Recurring reminders won't fire again unless re-created."},S0={title:"Snooze reminder",description:"How long should it be pushed back?",preset5m:"5 minutes",preset30m:"30 minutes",preset1h:"1 hour",preset1d:"1 day",submit:"Snooze",toastOk:"Snoozed for {{duration}}"},E0={cancelled:"Reminder cancelled"},C0={pageTitle:h0,subtitle:p0,filter:m0,status:g0,source:v0,promptMode:y0,empty:b0,col:w0,action:x0,snooze:S0,toast:E0},R0="提醒",P0="排队待触发的提醒。可对 pending 的提醒做取消 / 延后;已触发与已取消的记录保留以备审计。",A0={status:"状态",statusAny:"全部状态"},T0={pending:"等待中",firing:"触发中",fired:"已触发",cancelled:"已取消",failed:"失败"},O0={slash:"/remind",mcp:"MCP",api:"API"},k0={literal:"原文",llm:"LLM"},L0={title:"暂无提醒",description:"当 Agent 通过 /remind、MCP 或 API 创建提醒时,记录会出现在这里。可切换状态查看已触发或已取消的记录。"},N0={id:"ID",fireAt:"触发时间",text:"内容",status:"状态",platform:"平台",thread:"Thread",source:"来源",recurrence:"周期",createdAt:"创建时间"},I0={cancel:"取消",snooze:"延后",confirmCancel:"确认取消这条提醒?",confirmCancelDesc:"该提醒会被移出队列。周期提醒在未重新创建前不会再触发。"},D0={title:"延后提醒",description:"延后多久?",preset5m:"5 分钟",preset30m:"30 分钟",preset1h:"1 小时",preset1d:"1 天",submit:"确认延后",toastOk:"已延后 {{duration}}"},M0={cancelled:"已取消"},_0={pageTitle:R0,subtitle:P0,filter:A0,status:T0,source:O0,promptMode:k0,empty:L0,col:N0,action:I0,snooze:D0,toast:M0},j0="Memos",F0="Long-term notes the operator captured for the agent — searchable by content, person, or location.",$0={placeholder:"Search memos…",who:"Who",what:"What",hasLocation:"Has location",includeExpired:"Include expired"},U0={title:"No memos match",description:"Memos are created from chat via `/memo` or auto-extracted by the memory subsystem. Try clearing filters or widening the search."},H0={id:"ID",what:"What",who:"Who",when:"When",where:"Where",platform:"Platform",createdAt:"Created",expiresAt:"Expires"},B0={delete:"Delete",confirmDelete:"Delete this memo?",confirmDeleteDesc:"This cannot be undone. The memory subsystem still has any embeddings derived from this memo until a backfill prune lands."},V0={label:"Open map",baidu:"Baidu Maps",apple:"Apple Maps",google:"Google Maps",osm:"OpenStreetMap"},z0={deleted:"Memo deleted"},W0={pageTitle:j0,subtitle:F0,search:$0,empty:U0,col:H0,action:B0,openMap:V0,toast:z0},K0="备忘",q0="操作员为 Agent 记下的长期备忘 — 可按内容、人物、地点检索。",G0={placeholder:"搜索备忘…",who:"谁",what:"做什么",hasLocation:"含位置",includeExpired:"包含过期"},Y0={title:"未匹配到备忘",description:"备忘通过聊天中的 `/memo` 命令或记忆子系统自动抽取生成。可清空筛选或放宽搜索条件再试。"},Q0={id:"ID",what:"事项",who:"对象",when:"时间",where:"地点",platform:"平台",createdAt:"创建时间",expiresAt:"过期时间"},X0={delete:"删除",confirmDelete:"确认删除此备忘?",confirmDeleteDesc:"操作不可撤销。记忆子系统中由此备忘衍生的 embedding 在下一次 backfill 清理前仍会保留。"},J0={label:"在地图中打开",baidu:"百度地图",apple:"Apple 地图",google:"Google 地图",osm:"OpenStreetMap"},Z0={deleted:"已删除"},eS={pageTitle:K0,subtitle:q0,search:G0,empty:Y0,col:Q0,action:X0,openMap:J0,toast:Z0},tS="Memory",nS="Per-user facts the agent has accumulated. Long-term memory that survives session resets.",rS={label:"User",placeholder:"Pick a user",factsLabel:"{{count}} facts",personaTag:"persona"},oS={title:"Pick a user to view their memory",description:"Memory is partitioned per user_key (platform:userId). The dropdown above lists every user whose memory has any rows in the bank."},aS={facts:"Facts",persona:"Persona",vector:"Vector",skills:"Skills"},sS={title:"Facts",empty:{title:"No facts yet",description:"Facts accumulate as the agent extracts them from chat history during memory consolidation. Triggering `/memory consolidate` from chat (or the Persona tab's button when it lands) seeds this list."},filter:{search:"Search",category:"Category",categoryAny:"Any category"},category:{fact:"Fact",preference:"Preference",goal:"Goal",history:"History",profile:"Profile"},col:{id:"ID",what:"What",category:"Category",confidence:"Confidence",source:"Source",createdAt:"Created"},batch:{selected:"{{count}} selected",deleteSelected:"Delete selected",confirmDelete:"Delete {{count}} fact(s)?",confirmDeleteDesc:"This removes the rows from the bank. The vector index keeps any embedding derived from these rows until the next backfill prune."},action:{delete:"Delete",confirmDelete:"Delete this fact?",confirmDeleteDesc:"This row is removed permanently. The vector index retains its embedding until the next backfill prune."},toast:{deletedOne:"Fact deleted",deletedMany:"Deleted {{count}} facts"}},iS={title:"Persona",subtitle:"Long-form summary of who this user is, refined by periodic consolidation of their facts.",empty:{title:"No persona yet",description:"Personas are written by the consolidation pass — run it from the button below once enough facts have accumulated."},updated:"Updated {{at}}",editorLabel:"Persona summary",save:"Save",saved:"Saved",delete:"Delete persona",confirmDelete:"Delete this persona?",confirmDeleteDesc:"The persona summary is removed from the bank. Facts the persona was derived from stay in place; the next consolidate pass will rewrite a fresh one.",consolidate:{trigger:"Run consolidation",triggering:"Starting…",running:"Consolidation running…",doneOk:"Consolidation complete",doneFailed:"Consolidation failed",lastRun:"Last run {{at}}",result:"Processed {{users}} user(s), {{updated}} persona(s) updated"}},lS={title:"Vector backend",subtitle:"Embeddings power hybrid recall on memory facts. The active backend, model, and per-user coverage live here.",config:{title:"Backend configuration",hint:"Backend selection + OpenAI / local-model parameters live in env. Edit `~/.agim/env` on the host (or set systemd `Environment=`); the `IMHUB_MEMORY_VECTOR_*` keys are listed below.",editLink:"env file"},form:{title:"Backend configuration",hint:"Pick a backend, fill in the parameters, then save & test. Changes hit the env file and reload in-process; a restart re-reads them.",dirty:"Unsaved changes",discard:"Discard",saveAndTest:"Save & test",savedToast:"Saved — running test…",nothingChanged:"Nothing to save",backend:"Backend",backendHelp:"off = vector recall disabled; local = on-device BGE; openai = OpenAI-compatible remote endpoint",backendOff:"Off",backendLocal:"Local (BGE)",backendOpenai:"OpenAI-compatible",localModel:"Local model",localModelHelp:"Xenova model id, defaults to Xenova/bge-base-zh-v1.5. First-time use needs a manual download.",openaiBaseUrl:"Base URL",openaiBaseUrlHelp:"OpenAI-compatible endpoint root, e.g. https://api.openai.com/v1 or your self-hosted gateway.",openaiModel:"Model",openaiModelHelp:"Embedding model id, defaults to text-embedding-3-small. Match your provider's docs for other endpoints.",openaiApiKey:"API key",apiKeyKeepHint:"Leave blank to keep the existing key (placeholder shows the masked value); typing replaces it.",apiKeyNewHint:"Paste your OpenAI-compatible API key (only the server sees the raw value after save).",toggleApiKey:"Show / hide API key",batchSize:"Batch size",batchSizeHelp:"Max texts per embed call, 1–1024 (default 32).",hybridWeight:"Hybrid weight",hybridWeightHelp:"Vector branch weight when fusing with FTS5 recall, 0–1 (default 0.5).",errors:{baseUrlRequired:"Base URL is required",baseUrlInvalid:"Base URL is not a valid URL",openaiModelRequired:"Embedding model id is required",apiKeyRequired:"API key is required for the OpenAI backend on first setup",localModelRequired:"Local model id is required",batchSizeRange:"Batch size must be between 1 and 1024",hybridWeightRange:"Hybrid weight must be between 0 and 1"}},backendLabel:"Backend",modelLabel:"Model",dimsLabel:"Dimensions",readyTrue:"Ready",readyFalse:"Not ready",downloadedTrue:"Files on disk",lastError:"Last error",coverage:{title:"Coverage",total:"Facts",withEmbedding:"Embedded",withDifferentModel:"Mismatched model",scope_user:"for {{userKey}}",scope_global:"across every user"},actions:{title:"Maintenance",test:"Test",testOk:"Backend test OK",testFail:"Backend test failed: {{detail}}",download:"Download model",downloadStarted:"Download started",downloadAlreadyReady:"Model is already ready",backfill:"Backfill embeddings",backfillStarted:"Backfill started",backfillNotReady:"Backend not ready — run download first",clear:"Clear embeddings",clearStarted:"Cleared {{count}} embedding(s)",confirmClear:"Clear all embeddings?",confirmClearDesc:"Drops the embedding column for {{scope}}. Facts themselves stay; you'll need to backfill again before vector recall works."},jobs:{title:"Recent jobs",empty:"No recent jobs",phase:{running:"Running",done:"Done",failed:"Failed"}}},cS={title:"Skills",subtitle:"SKILL.md files the host agents pick up from ~/.claude/skills/ + ~/.config/opencode/skills/.",empty:{title:"No skills installed",description:"Drop a SKILL.md (with `name` and `description` frontmatter) under one of the configured roots and refresh."},filter:{search:"Search",category:"Category",categoryAny:"All categories"},sources:{title:"Source directories",claude:"Claude Code",opencode:"opencode"},agentTag:{claude:"claude",opencode:"opencode"},detail:{loading:"Loading SKILL.md…",loadFailed:"Failed to load skill detail",metadataLabel:"Metadata",agentsLabel:"Available to"}},uS={pageTitle:tS,subtitle:nS,userPicker:rS,noUserSelected:oS,tabs:aS,facts:sS,persona:iS,vector:lS,skills:cS},dS="记忆",fS="Agent 为每个用户积累的事实库。跨会话保留的长期记忆。",hS={label:"用户",placeholder:"选择一个用户",factsLabel:"{{count}} 条事实",personaTag:"persona"},pS={title:"选择一个用户查看其记忆",description:"记忆按 user_key(platform:userId)分隔。上方下拉列出每位在库中有任何记忆数据的用户。"},mS={facts:"事实",persona:"Persona",vector:"向量",skills:"技能"},gS={title:"事实",empty:{title:"暂无事实",description:"Agent 在记忆整理过程中会从聊天历史中抽取事实。可在聊天里运行 `/memory consolidate` 或后续 Persona 子页内的按钮触发整理。"},filter:{search:"搜索",category:"类别",categoryAny:"全部类别"},category:{fact:"事实",preference:"偏好",goal:"目标",history:"历史",profile:"档案"},col:{id:"ID",what:"内容",category:"类别",confidence:"置信度",source:"来源",createdAt:"创建时间"},batch:{selected:"已选 {{count}} 项",deleteSelected:"删除所选",confirmDelete:"确认删除 {{count}} 条事实?",confirmDeleteDesc:"记忆库中的这些行将被删除。向量索引中相应的 embedding 在下一次 backfill 清理前仍会保留。"},action:{delete:"删除",confirmDelete:"确认删除此事实?",confirmDeleteDesc:"该行被永久删除。向量索引会在下一次 backfill 清理前保留对应 embedding。"},toast:{deletedOne:"已删除",deletedMany:"已删除 {{count}} 条"}},vS={title:"Persona",subtitle:"该用户的长篇画像,由记忆整理任务从事实库中提炼。",empty:{title:"暂无 Persona",description:"Persona 由整理任务生成。当事实积累到一定量后,点击下方按钮运行整理。"},updated:"更新于 {{at}}",editorLabel:"Persona 内容",save:"保存",saved:"已保存",delete:"删除 Persona",confirmDelete:"确认删除此 Persona?",confirmDeleteDesc:"Persona 概要会从库中删除。生成它的事实仍保留,下一次整理会重新生成。",consolidate:{trigger:"运行整理",triggering:"启动中…",running:"整理进行中…",doneOk:"整理完成",doneFailed:"整理失败",lastRun:"上次运行:{{at}}",result:"处理 {{users}} 位用户,更新 {{updated}} 条 Persona"}},yS={title:"向量后端",subtitle:"Embedding 驱动事实库的混合检索。当前后端、模型与每位用户的覆盖情况都在这里。",config:{title:"后端配置",hint:"后端选择与 OpenAI / 本地模型的参数都通过环境变量配置。请在宿主机直接编辑 `~/.agim/env`(或 systemd unit 的 `Environment=`),下方列出的 `IMHUB_MEMORY_VECTOR_*` 系列 key 即对应字段。",editLink:"env file"},form:{title:"后端配置",hint:"选好后端、填好参数 → 保存并测试。配置只对本进程生效,重启服务后从 env 文件重新加载。",dirty:"有未保存的改动",discard:"放弃改动",saveAndTest:"保存并测试",savedToast:"已保存,正在测试…",nothingChanged:"没有需要保存的改动",backend:"后端",backendHelp:"off = 关闭向量召回;local = 本地 BGE 模型;openai = 调远程 OpenAI 协议端点",backendOff:"关闭",backendLocal:"本地(BGE)",backendOpenai:"OpenAI 协议远程",localModel:"本地模型",localModelHelp:"Xenova 仓库的 model id,默认 Xenova/bge-base-zh-v1.5;首次使用需手动触发下载。",openaiBaseUrl:"Base URL",openaiBaseUrlHelp:"OpenAI 兼容端点根路径,例如 https://api.openai.com/v1 或自部署网关。",openaiModel:"模型",openaiModelHelp:"Embedding 模型 id,默认 text-embedding-3-small;用其他兼容端点请按其文档填写。",openaiApiKey:"API Key",apiKeyKeepHint:"留空 = 保留当前 key(占位显示为脱敏值);填了就会覆盖。",apiKeyNewHint:"粘贴你的 OpenAI 兼容 API Key(保存后只在服务端可见)。",toggleApiKey:"显示 / 隐藏 API Key",batchSize:"批大小",batchSizeHelp:"单次嵌入的最大文本数,1–1024,默认 32。",hybridWeight:"混合权重",hybridWeightHelp:"FTS5 与向量召回融合时向量分支的权重,0–1,默认 0.5。",errors:{baseUrlRequired:"Base URL 不能为空",baseUrlInvalid:"Base URL 不是合法 URL",openaiModelRequired:"Embedding 模型 id 不能为空",apiKeyRequired:"首次使用 OpenAI 后端需要填 API Key",localModelRequired:"本地模型 id 不能为空",batchSizeRange:"批大小需在 1–1024 之间",hybridWeightRange:"混合权重需在 0–1 之间"}},backendLabel:"后端",modelLabel:"模型",dimsLabel:"维度",readyTrue:"就绪",readyFalse:"未就绪",downloadedTrue:"已下载",lastError:"最近错误",coverage:{title:"覆盖率",total:"事实总数",withEmbedding:"已嵌入",withDifferentModel:"模型不匹配",scope_user:"(针对 {{userKey}})",scope_global:"(全部用户)"},actions:{title:"维护",test:"测试",testOk:"后端测试通过",testFail:"后端测试失败:{{detail}}",download:"下载模型",downloadStarted:"下载已开始",downloadAlreadyReady:"模型已就绪",backfill:"回填 embedding",backfillStarted:"回填已开始",backfillNotReady:"后端未就绪 — 请先下载",clear:"清空 embedding",clearStarted:"已清空 {{count}} 条",confirmClear:"确认清空全部 embedding?",confirmClearDesc:"会丢弃 {{scope}} 的 embedding 列。事实本身保留;下次回填前向量检索不可用。"},jobs:{title:"近期任务",empty:"暂无任务",phase:{running:"运行中",done:"完成",failed:"失败"}}},bS={title:"技能",subtitle:"宿主 Agent 从 ~/.claude/skills/ + ~/.config/opencode/skills/ 中识别的 SKILL.md 文件。",empty:{title:"暂无技能",description:"在已配置的 root 目录下放一个带 `name` + `description` frontmatter 的 SKILL.md,然后刷新。"},filter:{search:"搜索",category:"类别",categoryAny:"全部类别"},sources:{title:"源目录",claude:"Claude Code",opencode:"opencode"},agentTag:{claude:"claude",opencode:"opencode"},detail:{loading:"正在加载 SKILL.md…",loadFailed:"加载技能详情失败",metadataLabel:"元数据",agentsLabel:"可用于"}},wS={pageTitle:dS,subtitle:fS,userPicker:hS,noUserSelected:pS,tabs:mS,facts:gS,persona:vS,vector:yS,skills:bS},xS="Skills",SS={installed:"Installed",hot:"Hot on skillhub.cn"},ES={title:"Installed skills",subtitle:"SKILL.md files the host agents pick up from ~/.claude/skills/ + ~/.config/opencode/skills/.",empty:{title:"No skills",description:"Drop a SKILL.md with `name` + `description` frontmatter under a configured root and refresh."},filter:{search:"Search",category:"Category",categoryAny:"Any category"},sources:{title:"Sources",claude:"Claude Code",opencode:"opencode"},agentTag:{claude:"claude",opencode:"opencode"},detail:{loading:"Loading SKILL.md…",loadFailed:"Failed to load skill detail",metadataLabel:"Metadata",agentsLabel:"Picked up by"}},CS={title:"Hot on skillhub.cn",subtitle:"Live top entries from skillhub.cn (cached 5 min on the server). Click a row for the install commands. agim never auto-runs installs — you copy the command and paste into shell or IM.",openHub:"Open skillhub.cn",loading:"Loading…",empty:"No data",cached:"cache hit",stale:"upstream unreachable — serving stale",updatedAt:"updated {{at}}",col:{slug:"slug",name:"Name / description",stars:"stars",installs:"installs"},detail:{version:"Version",category:"Category",stars:"Stars",installs:"Installs",downloads:"Downloads",howInstall:"How to install (pick one; agim never auto-runs)",copy:"Copy",copied:"Copied",label:{cliInstall:"On host (recommended)",cliSearch:"Dry-run first",imAsk:"Ask an IM agent"},hint:"The two CLI commands need skillhub CLI installed on the host first. See docs/skills.md or skillhub.cn."}},RS={pageTitle:xS,subnav:SS,installed:ES,hot:CS},PS="技能",AS={installed:"已安装",hot:"skillhub.cn 热门"},TS={title:"已安装的技能",subtitle:"宿主 Agent 从 ~/.claude/skills/ + ~/.config/opencode/skills/ 中识别的 SKILL.md 文件。",empty:{title:"暂无技能",description:"在已配置的 root 目录下放一个带 `name` + `description` frontmatter 的 SKILL.md,然后刷新。"},filter:{search:"搜索",category:"类别",categoryAny:"全部类别"},sources:{title:"源目录",claude:"Claude Code",opencode:"opencode"},agentTag:{claude:"claude",opencode:"opencode"},detail:{loading:"正在加载 SKILL.md…",loadFailed:"加载技能详情失败",metadataLabel:"元数据",agentsLabel:"可用于"}},OS={title:"skillhub.cn 热门",subtitle:"实时拉取 skillhub.cn 热门下载(服务端 5 分钟缓存)。点击任意条目查看安装命令。agim 不会自动跑安装——命令复制后由你贴去 shell 或 IM 触发。",openHub:"前往 skillhub.cn",loading:"正在加载…",empty:"暂无数据",cached:"缓存命中",stale:"上游不可达,使用旧数据",updatedAt:"更新于 {{at}}",col:{slug:"slug",name:"名称 / 描述",stars:"stars",installs:"installs"},detail:{version:"版本",category:"类别",stars:"stars",installs:"installs",downloads:"downloads",howInstall:"安装方式(任选一个;agim 不会自动跑)",copy:"复制",copied:"已复制",label:{cliInstall:"Host 上跑(推荐)",cliSearch:"先查再装",imAsk:"在 IM 里让 agent 装"},hint:"前两条要先在 host 上安装 skillhub CLI。详见 docs/skills.md 或 skillhub.cn。"}},kS={pageTitle:PS,subnav:AS,installed:TS,hot:OS},LS="Workspace",NS="Read and edit files in the per-agent working directories (`AGENT_CWD`).",IS={label:"Agent",placeholder:"Pick an agent",online:"online",offline:"offline"},DS={title:"Pick an agent to browse its workspace",description:"Each registered agent runs from its own CWD. The picker lists every agent the registry knows about; the green dot next to a name means it reports available."},MS={title:"Files",loading:"Loading…",empty:"(empty directory)",up:"Up",rootLabel:"(workspace root)",binary:"binary",symlinkEscape:"symlink → outside workspace, hidden",broken:"unreadable"},_S={noFile:"Select a file from the tree to view or edit it.",binary:"This file looks binary (base64-encoded) — editing not supported.",truncated:"File is over 1 MiB; only the first 1 MiB is shown. Saving from here would replace the whole file with the truncated content — close without saving.",save:"Save",saving:"Saving…",savedMeta:"Saved · {{size}} bytes · {{at}}",dirtyHint:"Unsaved changes",loadFailed:"Failed to load file"},jS={saved:"Saved {{path}}"},FS={pageTitle:LS,subtitle:NS,agentPicker:IS,noAgent:DS,tree:MS,editor:_S,toast:jS},$S="工作区",US="在每个 Agent 的工作目录(`AGENT_CWD`)下浏览与编辑文件。",HS={label:"Agent",placeholder:"选择一个 Agent",online:"在线",offline:"离线"},BS={title:"选择一个 Agent 来浏览其工作区",description:"每个已注册的 Agent 都有自己的 CWD。下拉列出注册表中所有已知的 Agent;名字旁的绿点表示该 Agent 当前可用。"},VS={title:"文件",loading:"加载中…",empty:"(目录为空)",up:"返回上级",rootLabel:"(工作区根目录)",binary:"二进制",symlinkEscape:"符号链接指向工作区外,已隐藏",broken:"不可读"},zS={noFile:"从左侧选择一个文件查看或编辑。",binary:"该文件是二进制(base64 编码)— 不支持编辑。",truncated:"文件超过 1 MiB;仅显示前 1 MiB。直接保存会用截断内容覆盖整个文件 — 请关闭而不要保存。",save:"保存",saving:"保存中…",savedMeta:"已保存 · {{size}} 字节 · {{at}}",dirtyHint:"有未保存的修改",loadFailed:"加载文件失败"},WS={saved:"已保存 {{path}}"},KS={pageTitle:$S,subtitle:US,agentPicker:HS,noAgent:BS,tree:VS,editor:zS,toast:WS},qS="Observability",GS="Operational health: invocation totals, top-N leaderboards, and the audit timeline.",YS={health:"Health",topn:"Top-N",audit:"Audit"},QS={label:"Window",days_one:"{{count}} day",days_other:"{{count}} days"},XS={title:"Health",totals:"Totals",byDay:"By day",kpi:{calls:"Calls",cost:"Cost",errors:"Errors",errorRate:"Error rate",avgLatencyMs:"Avg latency",p95LatencyMs:"P95 latency"},byDayCol:{date:"Date",calls:"Calls",cost:"Cost",errors:"Errors",avgLatencyMs:"Avg latency"},empty:{title:"No data in this window",description:"No invocations recorded in the selected time window. Widen the window or wait for an agent call to fire."}},JS={title:"Top-N",filter:{dim:"Group by",metric:"Rank by"},dim:{user:"User",agent:"Agent",platform:"Platform",intent:"Intent"},metric:{cost:"Cost",calls:"Calls",errors:"Errors",avg_latency:"Avg latency"},col:{rank:"#",key:"Key",calls:"Calls",cost:"Cost",errors:"Errors",avgLatencyMs:"Avg latency"},empty:{title:"No data",description:"No invocations matched the filters."}},ZS={title:"Audit",stats:{total:"Total",totalCost:"Total cost"},filter:{agent:"Agent",platform:"Platform",user:"User",intent:"Intent"},col:{ts:"Time",trace:"Trace",agent:"Agent",platform:"Platform",user:"User",intent:"Intent",duration:"Duration",cost:"Cost",outcome:"Outcome"},outcome:{ok:"ok",fail:"fail"},empty:{title:"No invocations",description:"Audit rows appear here when an agent is invoked. Adjust filters or widen the window."}},eE={pageTitle:qS,subtitle:GS,tabs:YS,window:QS,health:XS,topn:JS,audit:ZS},tE="观测",nE="运行健康:调用总量、Top-N 排行与审计时间线。",rE={health:"健康",topn:"Top-N",audit:"审计"},oE={label:"时间窗口",days_one:"{{count}} 天",days_other:"{{count}} 天"},aE={title:"健康",totals:"总览",byDay:"每日明细",kpi:{calls:"调用",cost:"成本",errors:"错误",errorRate:"错误率",avgLatencyMs:"平均延迟",p95LatencyMs:"P95 延迟"},byDayCol:{date:"日期",calls:"调用",cost:"成本",errors:"错误",avgLatencyMs:"平均延迟"},empty:{title:"时间窗口内无数据",description:"所选时间范围内没有任何调用记录。可以放宽时间窗口或等待 Agent 被调用。"}},sE={title:"Top-N",filter:{dim:"分组维度",metric:"排序依据"},dim:{user:"用户",agent:"Agent",platform:"平台",intent:"意图"},metric:{cost:"成本",calls:"调用",errors:"错误",avg_latency:"平均延迟"},col:{rank:"#",key:"Key",calls:"调用",cost:"成本",errors:"错误",avgLatencyMs:"平均延迟"},empty:{title:"暂无数据",description:"当前筛选下没有调用记录。"}},iE={title:"审计",stats:{total:"累计",totalCost:"累计成本"},filter:{agent:"Agent",platform:"平台",user:"用户",intent:"意图"},col:{ts:"时间",trace:"Trace",agent:"Agent",platform:"平台",user:"用户",intent:"意图",duration:"耗时",cost:"成本",outcome:"结果"},outcome:{ok:"成功",fail:"失败"},empty:{title:"暂无调用",description:"当 Agent 被调用时,审计记录会出现在这里。可调整筛选或放宽时间窗口。"}},lE={pageTitle:tE,subtitle:nE,tabs:rE,window:oE,health:aE,topn:sE,audit:iE},cE="Settings",uE="Operational configuration: environment variables and service lifecycle.",dE={messengers:"Messengers",email:"Email (SMTP)",viewer:"Viewer & Maps",agents:"Agents",policy:"Policy",workspaces:"Workspaces",admins:"Admins",service:"Service"},fE={title:"Agents",subtitle:"Built-in agent adapters. Enable the ones whose CLI is installed on this host; pick which one handles unrouted messages by default.",installHint:"Not installed. `npm install -g {{pkg}}` on the host.",aliasesLabel:"Aliases",online:"online",offline:"offline",defaultAgent:"Default agent",defaultAgentHint:"Used when the intent classifier has no preference (new web threads, etc.). Only enabled + online agents appear here.",noEligible:"No eligible default",saveBtn:"Save",saving:"Saving…",dirtyHint:"Unsaved changes",discard:"Discard",toast:{saved:"Saved"},acp:{title:"Remote agents (ACP)",subtitle:"Agents reachable over HTTP via the Agent Communication Protocol. Each entry persists in config and registers on the next service restart.",discoverBtn:"Discover",runDiscover:"Probe",baseUrl:"Discovery URL",baseUrlHint:"Probes `<base>/.well-known/acp` and adds the entries it lists. Skips names already present.",addTitle:"Add agent",name:"Name",nameHint:"Stable identifier; letters, digits, `._-`.",aliases:"Aliases",aliasesHint:"Comma-separated; routed via `/alias` in chat.",endpoint:"Endpoint",endpointHint:"Base URL of the agent's ACP root (no trailing `/`).",authType:"Auth",auth:{none:"None",apikey:"API key",bearer:"Bearer"},token:"Token",tokenPlaceholder:"Paste token",testBtn:"Test",addBtn:"Add",removeBtn:"Remove",on:"on",off:"off",dupName:"An agent with this name already exists.",empty:{title:"No remote agents",description:"Add an ACP endpoint below or use Discover for a `.well-known/acp` directory."},toast:{staged:"Staged. Save to persist.",testOk:"Reached `{{name}}`",testMasked:"Save first — token is masked, can't test in place.",discoverEmpty:"Nothing new to add.",discoverAdded_one:"Added {{count}} agent.",discoverAdded_other:"Added {{count}} agents."}}},hE={title:"Policy & toggles",subtitle:"Frequently-flipped switches that operate on env values under the hood. Each toggle persists immediately; the change applies on the next service restart unless the relevant module supports hot-reload (most do).",savingToast:"Saved",safety:{title:"Skip permissions (DANGEROUS)",description:"When ON, the Claude Code adapter passes `--dangerously-skip-permissions` to the wrapped CLI, bypassing every tool-use confirmation. Recommended OFF for production. Only enable for trusted, isolated workspaces.",envKey:"IMHUB_DANGEROUSLY_SKIP_PERMISSIONS",tagWarn:"production deployments should keep this OFF"},approval:{title:"Approval timeout default",description:'What the approval bus does when a pending tool-use request expires with no human reply. `Deny` is the safe default and keeps write-side calls (Bash / Edit / Write) gated; `Allow` is "user away" mode and lets the agent keep moving.',envKey:"IMHUB_TIMEOUT_DEFAULT",valDeny:"Deny on timeout",valAllow:"Allow on timeout"},memory:{title:"Long-term memory",description:"Master switch for the per-user memory subsystem (facts + persona + vector retrieval). Disabling stops new fact extraction and persona consolidation; the existing bank stays on disk.",envKey:"IMHUB_MEMORY_ENABLED"},viewer:{title:"Long-message viewer",description:"When ON, IM replies that exceed the viewer threshold are uploaded to the local paste store and the IM message becomes a short URL the user can click. Without it, long replies get truncated by the messenger.",envKey:"IMHUB_VIEWER_ENABLED"},a2aNotify:{title:"A2A notify mode",description:"How verbose the bus is when one agent calls another. `essential` (default) sends only headline events; `verbose` includes every transition; `off` silences cross-agent notifications entirely.",envKey:"IMHUB_A2A_NOTIFY_MODE",valEssential:"Essential",valVerbose:"Verbose",valOff:"Off"}},pE={title:"Messengers",subtitle:"Per-IM-platform connection settings. Toggle a platform on, fill in its credentials, and Save. The next service restart picks up the new config.",saveAll:"Save all",saving:"Saving…",savedToast:"Configuration saved",discardAll:"Discard changes",dirtyHint:"Unsaved changes",platform:{wechat:"WeChat",telegram:"Telegram",feishu:"Feishu (Lark)",dingtalk:"DingTalk",discord:"Discord"},hint:{wechat:"iLink-based QR login. Click Scan, scan the QR with your phone WeChat, confirm — the bot logs in as that account.",telegram:"Bot API token from @BotFather; channel id is optional and only used when targeting a specific chat.",feishu:"App credentials from the Lark developer console. App must have the messaging scopes.",dingtalk:"Stream API client credentials from the DingTalk developer console.",discord:"Bot token from the Discord developer portal. The bot must be invited to the target channel."},enabled:"Enabled",disabled:"Disabled",scanQr:"Scan QR",fields:{botToken:"Bot token",appId:"App ID",appSecret:"App secret",clientId:"Client ID",clientSecret:"Client secret",channelId:"Channel ID"},dingtalk:{dmPolicy:"DM policy",groupPolicy:"Group policy",allowFrom:"DM allowFrom (staffIds, comma-separated)",groupAllowFrom:"Group allowFrom (staffIds, comma-separated)",ackReaction:"Ack-reaction",policy:{open:"open — anyone may talk",pairing:"pairing — first DMer pinned",allowlist:"allowlist — only listed IDs",disabled:"disabled — bot ignores groups"},ack:{off:"off — no ack glyph",emoji:"emoji ⏳→✅",kaomoji:"kaomoji (text-face)"},accountsTitle:"Extra accounts",accountDisabled:"disabled",accountsHint:"Each entry starts its own DWClient with isolated dmPolicy / allowFrom / ack-reaction. Restart agim after Save for new accounts to take effect.",accountsEmpty:"No extra accounts yet. Click ‘+ add account’ to wire another DingTalk bot.",addAccount:"Add account",accountName:"Display name (optional)",accountRenameCollision:'An account with id "{{id}}" already exists; pick another id.'},qr:{title:"Scan WeChat QR",description:"Open WeChat on your phone, scan this code, then confirm the login prompt inside WeChat.",starting:"Starting QR session…",loadFailed:"Failed to start QR session",expired:"QR code expired — close and start a new one.",cancelled:"Cancelled.",confirmed:"Login confirmed — wechat-ilink will start on the next service restart."}},mE={title:"Email (SMTP)",subtitle:"Outbound mail delivery for `/remind email me@x.com …`. Credentials persist to `~/.agim/.env`. Leave blank to disable.",cardTitle:"SMTP credentials",statusOn:"configured",statusOff:"disabled",host:"Host",hostHint:"Mail server hostname (e.g. `smtp.gmail.com`).",port:"Port",portHint:"Usually 465 (SSL) or 587 (STARTTLS).",user:"Username",userHint:"Login email; often the sender address too.",pass:"Password / app token",passHint:"Stored in `~/.agim/.env` (chmod 600). Masked unless Reveal is on.",from:"From",fromHint:"Sender header. Defaults to the username when blank.",secure:"TLS mode",secureHint:"`auto` follows the port; force SSL or STARTTLS if your provider requires it.",secureAuto:"auto (port-based)",secureTrue:"true (SSL, port 465)",secureFalse:"false (STARTTLS, port 587)",reveal:"Reveal",hide:"Hide",testBtn:"Test connection",testNeedsConfigured:"Save host / user / password first.",disableBtn:"Disable SMTP",saveBtn:"Save",saving:"Saving…",discard:"Discard",toast:{saved:"SMTP saved",disabled:"SMTP disabled",noChanges:"Nothing to save"}},gE={title:"Viewer & Maps",subtitle:"Public-facing surfaces: the long-message Viewer (turns >threshold replies into a `/v/<id>` short link) and Baidu Maps AK (drives `/memo` address geocoding).",reveal:"Reveal",hide:"Hide",save:"Save",saving:"Saving…",discard:"Discard",dirtyHint:"Unsaved changes",toast:{saved:"Viewer settings saved"},viewer:{title:"Viewer (long-message links)",subtitle:"Replies longer than the chars / lines threshold are uploaded to the local paste store and the IM message becomes a short `/v/<id>` link.",on:"enabled",off:"disabled",enableLabel:"Enable the long-message Viewer",publicUrl:"Public base URL",publicUrlHint:"What the operator's reverse proxy / tunnel exposes. Used to build `/v/<id>` links.",tunnelMode:"Tunnel mode",tunnelOff:"off (use Public base URL)",tunnelQuick:"quick (cloudflared)",tunnelHint:"`quick` launches a Cloudflare quick tunnel and uses its URL when the operator hasn't fronted agim themselves.",tunnelStatus:"Tunnel status",refreshTunnel:"Refresh",tunnelRunning:"Running",yes:"yes",no:"no",tunnelUrl:"Live URL",effectiveUrl:"Effective URL",binary:"cloudflared binary",binaryMissing:"not found in PATH — install from cloudflare/cloudflared releases",lastError:"Last error",tunnelLoading:"Loading tunnel status…",thresholds:"Thresholds",chars:"Max chars",charsHint:"Replies above this length route through Viewer.",lines:"Max lines",linesHint:"Same routing decision, on line count.",codeLines:"Max code lines",codeLinesHint:"Lower threshold for replies inside code fences.",maxPastes:"Paste store cap",maxPastesHint:"Older pastes are evicted FIFO once the count exceeds this."},baidu:{title:"Baidu Maps AK",subtitle:"Enables `/memo` address-to-coords lookup. Without it, /memo still works via raw coords or browser GPS share. Free AK: lbsyun.baidu.com → Console → Application → Server-side API.",configured:"configured",empty:"not set",placeholder:"32-char AK starting with a non-digit",hint:"Stored in `~/.agim/.env` (chmod 600). Masked unless Reveal is on.",suspicious:"AK length is {{length}} — usually a Baidu AK is 32 characters. Double-check?",clear:"Clear AK",toast:{saved:"Baidu Maps AK saved",cleared:"Baidu Maps AK cleared"}}},vE={title:"Workspaces",subtitle:"Multi-tenant workspace registry. Each workspace has its own agent whitelist, rate-limit, and (optionally) member list. The `default` workspace catches every unrouted user.",empty:{title:"Only the default workspace",description:"Add a workspace below to partition a team / project / customer. Each one gets its own agent whitelist + rate-limit."},col:{id:"ID",name:"Name",agents:"Agents",members:"Members",rateLimit:"Rate limit"},rateLimitFormat:"{{rate}} per {{intervalSec}}s, burst {{burst}}",membersOpen:"open (any user)",membersCount_one:"{{count}} member",membersCount_other:"{{count}} members",edit:"Edit",form:{title:"Add or edit a workspace",subtitleEdit:"Editing existing workspace — change id to clone, keep to upsert.",id:"ID",idHint:"Stable identifier; [a-zA-Z0-9_-]+; the special name `default` is reserved.",name:"Display name",agents:"Agent whitelist",agentsHint:"Comma-separated; empty = allow every registered agent.",members:"Member user IDs",membersHint:"Comma-separated `platform:userId`; empty = open workspace.",rateLimit:"Rate limit (optional)",rate:"Calls",intervalSec:"Per (seconds)",burst:"Burst",submit:"Save workspace",reset:"Clear form"},toast:{saved:"Workspace saved"}},yE={title:"Service",subtitle:"Inspect the running agim process + start, stop, or restart it.",modeLabel:"Mode",pidLabel:"PID",uptimeLabel:"Uptime",webLabel:"Web",bootPhaseLabel:"Boot phase",mode:{systemd:"systemd",background:"background",foreground:"foreground",none:"not running"},actions:{start:"Start",stop:"Stop",restart:"Restart",confirmStop:"Stop the agim service?",confirmStopDesc:"The web console, the messenger adapters, and any in-flight job will all stop. You'll need to start the service again before you can use it.",confirmRestart:"Restart the agim service?",confirmRestartDesc:"The process stops and re-starts. In-flight jobs are cancelled; outbox + queued reminders survive the bounce. The web console will be unreachable for ~5-30 seconds."},toast:{started:"Service started",stopped:"Service stopped",restarted:"Service restarted"},ports:{title:"Ports",subtitle:"Which ports agim binds when started. Leave blank to use the default. Changes apply on the next service restart (use the Restart button below after saving).",webPort:"Web port",webPortHint:"HTTP server for the chat UI + REST API. Default: {{default}}.",acpPort:"ACP port",acpPortHint:"Agent Communication Protocol server (remote agent surface). Default: {{default}}.",invalidPort:"Must be a number between 1 and 65535.",restartRequired:"Restart required",save:"Save",saving:"Saving…",discard:"Discard",toast:{saved:"Ports saved — restart agim to bind the new ports"}}},bE={title:"Admin allowlist",subtitle:"IM-side users who can run admin-tier commands (`/admin promote`, `/admin token`, etc.). The list lives in `IMHUB_ADMIN_USERS`; this editor only works when the agim web port is bound locally.",configured:"Allowlist configured",notConfigured:"Allowlist not configured — anyone with the CLI bootstrap token can self-promote.",bootstrapAvailable:"Bootstrap token file present",bootstrapPath:"Token path",empty:"No admins added yet.",col:{platform:"Platform",userId:"User ID"},add:{title:"Add admin",platform:"Platform",userId:"User ID",submit:"Add"},remove:{label:"Remove",confirmTitle:"Remove this admin?",confirmDescription:"They lose access to all admin-tier commands. Re-add to restore."},toast:{added:"Admin added",removed:"Admin removed"}},wE={pageTitle:cE,subtitle:uE,tabs:dE,agents:fE,policy:hE,messengers:pE,email:mE,viewerSettings:gE,workspaces:vE,service:yE,admins:bE},xE="设置",SE="运维配置:环境变量与服务生命周期。",EE={messengers:"IM 平台",email:"邮件 (SMTP)",viewer:"Viewer & 地图",agents:"Agent",policy:"策略",workspaces:"工作区",admins:"管理员",env:"环境变量",service:"服务"},CE={title:"Agent",subtitle:"内置 Agent 适配器。启用宿主机已安装 CLI 的;并选择一个作为默认 Agent(用于路由无法判定的消息)。",installHint:"未安装。在宿主机执行 `npm install -g {{pkg}}`。",aliasesLabel:"别名",online:"在线",offline:"未就绪",defaultAgent:"默认 Agent",defaultAgentHint:"意图分类无判定时使用(新建 web 线程等)。下拉只列出已启用且在线的 Agent。",noEligible:"无可选默认",saveBtn:"保存",saving:"保存中…",dirtyHint:"有未保存改动",discard:"放弃改动",toast:{saved:"已保存"},acp:{title:"远程 Agent (ACP)",subtitle:"通过 Agent Communication Protocol 接入的 HTTP Agent。每个条目持久化到 config,下次服务重启时注册。",discoverBtn:"批量发现",runDiscover:"探测",baseUrl:"发现地址",baseUrlHint:"探测 `<base>/.well-known/acp` 并追加返回的 Agent;同名条目自动跳过。",addTitle:"新增 Agent",name:"名称",nameHint:"稳定标识;只允许 字母 数字 `._-`。",aliases:"别名",aliasesHint:"逗号分隔;在 IM 内通过 `/alias` 路由。",endpoint:"Endpoint",endpointHint:"Agent 的 ACP 根路径(不带尾部 `/`)。",authType:"鉴权",auth:{none:"无",apikey:"API key",bearer:"Bearer"},token:"Token",tokenPlaceholder:"粘贴 token",testBtn:"测试",addBtn:"新增",removeBtn:"移除",on:"已启用",off:"已停用",dupName:"已存在同名 Agent。",empty:{title:"暂无远程 Agent",description:"下方填写 ACP endpoint 新增,或使用「批量发现」自动从 `.well-known/acp` 导入。"},toast:{staged:"已暂存,点击「保存」生效。",testOk:"已联通 `{{name}}`",testMasked:"Token 是掩码态,请先保存后再测试。",discoverEmpty:"没有可新增的 Agent。",discoverAdded_one:"已新增 {{count}} 个 Agent。",discoverAdded_other:"已新增 {{count}} 个 Agent。"}}},RE={title:"策略与开关",subtitle:"高频切换的开关,底层操作的是 env 值。每个开关变更后立即持久化;多数模块支持热加载,少数需要等下次服务重启。",savingToast:"已保存",safety:{title:"跳过权限确认(危险)",description:"打开后,Claude Code 适配器会向 CLI 传递 `--dangerously-skip-permissions`,跳过所有工具调用确认。生产环境强烈建议保持关闭;仅在隔离的可信工作区内启用。",envKey:"IMHUB_DANGEROUSLY_SKIP_PERMISSIONS",tagWarn:"生产部署建议保持关闭"},approval:{title:"审批超时默认行为",description:'当 pending 的工具调用无人响应而超时时审批 bus 的行为。`拒绝` 是安全默认值,会让 Bash / Edit / Write 等写入调用保持阻断;`放行` 是"用户离开"模式,让 Agent 继续运行。',envKey:"IMHUB_TIMEOUT_DEFAULT",valDeny:"超时拒绝",valAllow:"超时放行"},memory:{title:"长期记忆",description:"每用户记忆子系统(事实 + persona + 向量检索)的总开关。关闭后停止抽取新事实和 persona 整理;已有数据保留在磁盘。",envKey:"IMHUB_MEMORY_ENABLED"},viewer:{title:"长消息查看器",description:"打开后,超过阈值的 IM 回复会被上传到本地 paste 存储,IM 消息变成一个可点击的短链。关闭则消息会被 IM 平台截断。",envKey:"IMHUB_VIEWER_ENABLED"},a2aNotify:{title:"A2A 通知模式",description:"Agent 间互相调用时 bus 的提示详细程度。`essential`(默认)仅发关键事件;`verbose` 包含每次状态切换;`off` 完全静默跨 Agent 通知。",envKey:"IMHUB_A2A_NOTIFY_MODE",valEssential:"关键事件",valVerbose:"详细",valOff:"关闭"}},PE={title:"IM 平台",subtitle:"各 IM 平台的连接配置。打开开关、填写凭据、保存;下次服务重启即生效。",saveAll:"全部保存",saving:"保存中…",savedToast:"配置已保存",discardAll:"放弃改动",dirtyHint:"有未保存的改动",platform:{wechat:"微信",telegram:"Telegram",feishu:"飞书",dingtalk:"钉钉",discord:"Discord"},hint:{wechat:'基于 iLink 的扫码登录。点击 "扫码登录",用手机微信扫码并在弹窗中确认;机器人以该微信账号登录。',telegram:"@BotFather 申请的 Bot Token;Channel ID 可选,仅用于定向到特定群组。",feishu:"飞书开放平台的应用凭据。应用需开启消息权限。",dingtalk:"钉钉开发者后台的 Stream API 客户端凭据。",discord:"Discord 开发者门户的 Bot Token。需将机器人邀请到目标频道。"},enabled:"已启用",disabled:"未启用",scanQr:"扫码登录",fields:{botToken:"Bot Token",appId:"App ID",appSecret:"App Secret",clientId:"Client ID",clientSecret:"Client Secret",channelId:"Channel ID"},dingtalk:{dmPolicy:"私聊访问策略",groupPolicy:"群聊访问策略",allowFrom:"私聊白名单(staffId,英文逗号分隔)",groupAllowFrom:"群聊白名单(staffId,英文逗号分隔)",ackReaction:"ack 反馈方式",policy:{open:"open — 任何人都能对话",pairing:"pairing — 第一个私聊的人锁定为唯一对端",allowlist:"allowlist — 只允许名单中的 ID",disabled:"disabled — 机器人完全忽略群聊"},ack:{off:"off — 不发标记",emoji:"emoji ⏳→✅",kaomoji:"kaomoji(纯文本颜文字)"},accountsTitle:"多账号 / 多机器人",accountDisabled:"已禁用",accountsHint:"每个 entry 启动独立的 DWClient,dmPolicy / allowFrom / ack-reaction 全部隔离。保存后请重启 agim 让新账号生效。",accountsEmpty:"还没有额外账号。点「+ 添加账号」接入另一个钉钉机器人。",addAccount:"添加账号",accountName:"显示名(可选)",accountRenameCollision:'已存在 id 为 "{{id}}" 的账号;请换一个 id。'},qr:{title:"扫码登录微信",description:"打开手机微信扫一扫这个二维码,然后在微信内确认登录。",starting:"正在启动 QR 会话…",loadFailed:"QR 启动失败",expired:"二维码已过期 — 关闭并重新发起。",cancelled:"已取消。",confirmed:"登录成功 — wechat-ilink 将在下次服务重启后启用。"}},AE={title:"邮件 (SMTP)",subtitle:"用于 `/remind email me@x.com …` 的对外邮件投递。凭据保存在 `~/.agim/.env`,留空即停用。",cardTitle:"SMTP 凭据",statusOn:"已配置",statusOff:"未配置",host:"Host",hostHint:"邮件服务器域名(如 `smtp.gmail.com`)。",port:"Port",portHint:"通常 465 (SSL) 或 587 (STARTTLS)。",user:"用户名",userHint:"登录邮箱;通常也是发件人地址。",pass:"密码 / 应用 Token",passHint:"保存到 `~/.agim/.env`(chmod 600)。默认遮罩,按「显示」可查看。",from:"发件人",fromHint:"发件 header;为空则使用用户名。",secure:"TLS 模式",secureHint:"`auto` 按端口判定;如运营商要求可强制 SSL 或 STARTTLS。",secureAuto:"auto(按端口)",secureTrue:"true(SSL,对应 465)",secureFalse:"false(STARTTLS,对应 587)",reveal:"显示",hide:"隐藏",testBtn:"测试连接",testNeedsConfigured:"请先保存 host / user / password。",disableBtn:"停用 SMTP",saveBtn:"保存",saving:"保存中…",discard:"放弃改动",toast:{saved:"SMTP 已保存",disabled:"SMTP 已停用",noChanges:"无可保存的改动"}},TE={title:"Viewer & 地图",subtitle:"公开访问的两个外设:长消息 Viewer(超过阈值的回复转成 `/v/<id>` 短链)+ Baidu Maps AK(驱动 `/memo` 地址解析)。",reveal:"显示",hide:"隐藏",save:"保存",saving:"保存中…",discard:"放弃改动",dirtyHint:"有未保存改动",toast:{saved:"Viewer 设置已保存"},viewer:{title:"Viewer(长消息短链)",subtitle:"超过字符 / 行数阈值的回复会被上传到本地 paste 存储,IM 消息变成一条 `/v/<id>` 短链。",on:"已启用",off:"未启用",enableLabel:"启用长消息 Viewer",publicUrl:"公开基础 URL",publicUrlHint:"反代 / 隧道暴露给外网的地址。用于拼接 `/v/<id>` 短链。",tunnelMode:"隧道模式",tunnelOff:"关闭(使用上方公开 URL)",tunnelQuick:"quick(cloudflared 临时隧道)",tunnelHint:"`quick` 会本地拉起 Cloudflare quick tunnel;当运营商自己没有反代 agim 时启用。",tunnelStatus:"隧道状态",refreshTunnel:"刷新",tunnelRunning:"运行中",yes:"是",no:"否",tunnelUrl:"实时 URL",effectiveUrl:"生效 URL",binary:"cloudflared 二进制",binaryMissing:"PATH 中未找到 — 请从 cloudflare/cloudflared releases 安装",lastError:"最近一次错误",tunnelLoading:"正在加载隧道状态…",thresholds:"路由阈值",chars:"字符上限",charsHint:"回复超过此长度走 Viewer。",lines:"行数上限",linesHint:"相同的路由判定,按行数。",codeLines:"代码行数上限",codeLinesHint:"代码块内回复的更低阈值。",maxPastes:"Paste 存储上限",maxPastesHint:"超过此数量后按 FIFO 淘汰旧 paste。"},baidu:{title:"Baidu Maps AK",subtitle:"启用 `/memo` 的地址→坐标解析。不配置 AK,/memo 仍可通过裸坐标或浏览器 GPS 分享工作。免费 AK:lbsyun.baidu.com → 控制台 → 应用管理 → 创建应用 → 服务端 API。",configured:"已配置",empty:"未配置",placeholder:"32 位 AK,首字符非数字",hint:"保存到 `~/.agim/.env`(chmod 600),默认遮罩,按「显示」可查看。",suspicious:"AK 长度为 {{length}},通常 Baidu AK 是 32 位 — 请核对。",clear:"清除 AK",toast:{saved:"Baidu Maps AK 已保存",cleared:"Baidu Maps AK 已清除"}}},OE={title:"工作区",subtitle:"多租户工作区注册表。每个工作区有独立的 Agent 白名单、限流配置以及(可选的)成员名单。`default` 工作区承接所有未匹配的用户。",empty:{title:"只有默认工作区",description:"在下方添加工作区,可按团队 / 项目 / 客户分隔。每个工作区有独立的 Agent 白名单与限流。"},col:{id:"ID",name:"名称",agents:"Agent 白名单",members:"成员",rateLimit:"限流"},rateLimitFormat:"{{rate}} / {{intervalSec}}s,突发 {{burst}}",membersOpen:"开放(任何用户)",membersCount_one:"{{count}} 位成员",membersCount_other:"{{count}} 位成员",edit:"编辑",form:{title:"新增或编辑工作区",subtitleEdit:"编辑已有工作区 — 改 ID 可克隆,保持原 ID 即 upsert。",id:"ID",idHint:"稳定标识符;只允许 [a-zA-Z0-9_-]+;`default` 为保留名。",name:"显示名",agents:"Agent 白名单",agentsHint:"逗号分隔;为空 = 允许所有已注册 Agent。",members:"成员用户 ID",membersHint:"逗号分隔,形如 `platform:userId`;为空 = 开放工作区。",rateLimit:"限流(可选)",rate:"调用数",intervalSec:"周期(秒)",burst:"突发上限",submit:"保存工作区",reset:"清空表单"},toast:{saved:"工作区已保存"}},kE={title:"服务",subtitle:"查看运行中的 agim 进程,并启动 / 停止 / 重启它。",modeLabel:"运行模式",pidLabel:"PID",uptimeLabel:"运行时长",webLabel:"Web 端口",bootPhaseLabel:"启动阶段",mode:{systemd:"systemd",background:"后台",foreground:"前台",none:"未运行"},actions:{start:"启动",stop:"停止",restart:"重启",confirmStop:"停止 agim 服务?",confirmStopDesc:"Web 控制台、消息适配器、所有正在进行的作业都会停止。需要重新启动后才能继续使用。",confirmRestart:"重启 agim 服务?",confirmRestartDesc:"进程会先停止再启动。进行中的作业会被取消;投递队列与已排队的提醒会保留。重启期间 Web 控制台不可达,通常 5-30 秒。"},toast:{started:"服务已启动",stopped:"服务已停止",restarted:"服务已重启"},ports:{title:"端口",subtitle:"agim 启动时监听的端口。留空使用默认值;改动需下次服务重启生效(保存后点下方「重启」按钮)。",webPort:"Web 端口",webPortHint:"聊天 UI + REST API 的 HTTP 服务端口。默认 {{default}}。",acpPort:"ACP 端口",acpPortHint:"Agent Communication Protocol 服务端口(远程 Agent 接入面)。默认 {{default}}。",invalidPort:"需为 1-65535 之间的数字。",restartRequired:"需重启生效",save:"保存",saving:"保存中…",discard:"放弃改动",toast:{saved:"端口已保存 — 重启 agim 以绑定新端口"}}},LE={title:"管理员名单",subtitle:"可执行管理员级命令的 IM 用户(`/admin promote`、`/admin token` 等)。名单保存在 `IMHUB_ADMIN_USERS` 环境变量;仅当 agim Web 端口本地绑定时才能在此编辑。",configured:"名单已配置",notConfigured:"尚未配置名单 — 任何持有 CLI bootstrap token 的人都可自我提权。",bootstrapAvailable:"Bootstrap token 文件存在",bootstrapPath:"文件路径",empty:"暂无管理员。",col:{platform:"平台",userId:"用户 ID"},add:{title:"添加管理员",platform:"平台",userId:"用户 ID",submit:"添加"},remove:{label:"移除",confirmTitle:"确认移除该管理员?",confirmDescription:"该用户将失去所有管理员命令访问权限。可再次添加恢复。"},toast:{added:"已添加",removed:"已移除"}},NE={pageTitle:xE,subtitle:SE,tabs:EE,agents:CE,policy:RE,messengers:PE,email:AE,viewerSettings:TE,workspaces:OE,service:kE,admins:LE};Me.use(uu).use(If).init({resources:{en:{common:Xb,errors:Ww,tasks:Ix,approvals:e0,reminders:C0,memos:W0,memory:uS,skills:RS,workspace:FS,observability:eE,settings:wE},zh:{common:fw,errors:Cx,tasks:Bx,approvals:f0,reminders:_0,memos:eS,memory:wS,skills:kS,workspace:KS,observability:lE,settings:NE}},lng:IE(),fallbackLng:"en",supportedLngs:["en","zh"],ns:["common","errors","tasks","approvals","reminders","memos","memory","skills","workspace","observability","settings"],defaultNS:"common",interpolation:{escapeValue:!1},react:{useSuspense:!1},backend:{loadPath:"/locales/{{lng}}/{{ns}}.json"},detection:{order:[],caches:[]}});function IE(){try{const e=localStorage.getItem("im-hub-lang");if(e==="en"||e==="zh")return e}catch{}return(navigator.language||"en").toLowerCase().startsWith("zh")?"zh":"en"}function DE(e){Me.language!==e&&Me.changeLanguage(e)}function ME(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var du=e=>{const{present:t,children:n}=e,r=_E(t),o=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),a=De(r.ref,jE(o));return typeof n=="function"||r.isPresent?h.cloneElement(o,{ref:a}):null};du.displayName="Presence";function _E(e){const[t,n]=h.useState(),r=h.useRef(null),o=h.useRef(e),a=h.useRef("none"),s=e?"mounted":"unmounted",[i,l]=ME(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const c=kr(r.current);a.current=i==="mounted"?c:"none"},[i]),$e(()=>{const c=r.current,u=o.current;if(u!==e){const p=a.current,d=kr(c);e?l("MOUNT"):d==="none"||c?.display==="none"?l("UNMOUNT"):l(u&&p!==d?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),$e(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,f=d=>{const m=kr(r.current).includes(CSS.escape(d.animationName));if(d.target===t&&m&&(l("ANIMATION_END"),!o.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},p=d=>{d.target===t&&(a.current=kr(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:h.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function kr(e){return e?.animationName||"none"}function jE(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var FE=Symbol("radix.slottable");function $E(e){const t=({children:n})=>v.jsx(v.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=FE,t}var[yo]=so("Tooltip",[fo]),$a=fo(),fu="TooltipProvider",UE=700,Ti="tooltip.open",[HE,hu]=yo(fu),pu=e=>{const{__scopeTooltip:t,delayDuration:n=UE,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:a}=e,s=h.useRef(!0),i=h.useRef(!1),l=h.useRef(0);return h.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),v.jsx(HE,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:h.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:h.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:i,onPointerInTransitChange:h.useCallback(c=>{i.current=c},[]),disableHoverableContent:o,children:a})};pu.displayName=fu;var mu="Tooltip",[pC,bo]=yo(mu),ga="TooltipTrigger",BE=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=bo(ga,n),a=hu(ga,n),s=$a(n),i=h.useRef(null),l=De(t,i,o.onTriggerChange),c=h.useRef(!1),u=h.useRef(!1),f=h.useCallback(()=>c.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),v.jsx(tc,{asChild:!0,...s,children:v.jsx(Le.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:Se(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:Se(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:Se(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Se(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:Se(e.onBlur,o.onClose),onClick:Se(e.onClick,o.onClose)})})});BE.displayName=ga;var VE="TooltipPortal",[mC,zE]=yo(VE,{forceMount:void 0}),kn="TooltipContent",gu=h.forwardRef((e,t)=>{const n=zE(kn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...a}=e,s=bo(kn,e.__scopeTooltip);return v.jsx(du,{present:r||s.open,children:s.disableHoverableContent?v.jsx(vu,{side:o,...a,ref:t}):v.jsx(WE,{side:o,...a,ref:t})})}),WE=h.forwardRef((e,t)=>{const n=bo(kn,e.__scopeTooltip),r=hu(kn,e.__scopeTooltip),o=h.useRef(null),a=De(t,o),[s,i]=h.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:f}=r,p=h.useCallback(()=>{i(null),f(!1)},[f]),d=h.useCallback((y,m)=>{const g=y.currentTarget,S={x:y.clientX,y:y.clientY},b=QE(S,g.getBoundingClientRect()),C=XE(S,b),R=JE(m.getBoundingClientRect()),A=eC([...C,...R]);i(A),f(!0)},[f]);return h.useEffect(()=>()=>p(),[p]),h.useEffect(()=>{if(l&&u){const y=g=>d(g,u),m=g=>d(g,l);return l.addEventListener("pointerleave",y),u.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",y),u.removeEventListener("pointerleave",m)}}},[l,u,d,p]),h.useEffect(()=>{if(s){const y=m=>{const g=m.target,S={x:m.clientX,y:m.clientY},b=l?.contains(g)||u?.contains(g),C=!ZE(S,s);b?p():C&&(p(),c())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[l,u,s,c,p]),v.jsx(vu,{...e,ref:a})}),[KE,qE]=yo(mu,{isInside:!1}),GE=$E("TooltipContent"),vu=h.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:s,...i}=e,l=bo(kn,n),c=$a(n),{onClose:u}=l;return h.useEffect(()=>(document.addEventListener(Ti,u),()=>document.removeEventListener(Ti,u)),[u]),h.useEffect(()=>{if(l.trigger){const f=p=>{p.target?.contains(l.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,u]),v.jsx(Ta,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:u,children:v.jsxs(nc,{"data-state":l.stateAttribute,...c,...i,ref:t,style:{...i.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[v.jsx(GE,{children:r}),v.jsx(KE,{scope:n,isInside:!0,children:v.jsx(Sv,{id:l.contentId,role:"tooltip",children:o||r})})]})})});gu.displayName=kn;var yu="TooltipArrow",YE=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=$a(n);return qE(yu,n).isInside?null:v.jsx(rc,{...o,...r,ref:t})});YE.displayName=yu;function QE(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,o,a)){case a:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function XE(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function JE(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function ZE(e,t){const{x:n,y:r}=e;let o=!1;for(let a=0,s=t.length-1;a<t.length;s=a++){const i=t[a],l=t[s],c=i.x,u=i.y,f=l.x,p=l.y;u>r!=p>r&&n<(f-c)*(r-u)/(p-u)+c&&(o=!o)}return o}function eC(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),tC(t)}function tC(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const a=t[t.length-1],s=t[t.length-2];if((a.x-s.x)*(o.y-s.y)>=(a.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const a=n[n.length-1],s=n[n.length-2];if((a.x-s.x)*(o.y-s.y)>=(a.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var nC=pu,bu=gu;const rC=nC,oC=h.forwardRef(({className:e,sideOffset:t=4,...n},r)=>v.jsx(bu,{ref:r,sideOffset:t,className:we("z-50 overflow-hidden rounded-md","bg-text text-bg px-2 py-1 text-xs font-medium shadow-md","data-[state=delayed-open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=delayed-open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=delayed-open]:zoom-in-95",e),...n}));oC.displayName=bu.displayName;function aC(e){return v.jsx(Gp,{position:"top-center",richColors:!0,closeButton:!0,toastOptions:{classNames:{toast:"border border-border bg-surface text-text shadow-md",title:"font-medium",description:"text-text-dim text-sm",actionButton:"bg-accent text-accent-fg rounded-md",cancelButton:"bg-surface-2 text-text rounded-md",error:"bg-danger-bg text-danger border-danger",success:"bg-success-bg text-success border-success",warning:"bg-warning-bg text-warning border-warning",info:"bg-info-bg text-info border-info"}},...e})}function sC({children:e}){const t=En(r=>r.lang),{i18n:n}=pt();return h.useEffect(()=>{n.language!==t&&DE(t)},[t,n]),v.jsx(v.Fragment,{children:e})}function iC({children:e}){return Vy(),v.jsx(v.Fragment,{children:e})}function lC({children:e}){return h.useEffect(()=>xf(),[]),v.jsx(v.Fragment,{children:e})}function cC({children:e}){return v.jsx(wp,{client:Zy,children:v.jsx(sC,{children:v.jsx(iC,{children:v.jsx(lC,{children:v.jsxs(rC,{children:[e,v.jsx(aC,{})]})})})})})}const wu=document.getElementById("root");if(!wu)throw new Error("agim: #root not found in index.html");Fo.createRoot(wu).render(v.jsx(N.StrictMode,{children:v.jsx(cC,{children:v.jsx(Jy,{})})}));export{rp as $,tc as A,Mt as B,Hf as C,Ta as D,Lm as E,Nl as F,hl as G,hp as H,Pl as I,ul as J,Pv as K,Ol as L,Gh as M,cs as N,dC as O,oc as P,v as Q,mc as R,ua as S,eu as T,Xe as U,je as V,ap as W,ep as X,Qh as Y,Yo as Z,Jh as _,Zo as a,Yh as a0,Go as a1,Zn as a2,ln as a3,De as a4,ti as a5,Em as a6,Um as a7,Oa as a8,xp as a9,bp as aa,mf as ab,pt as ac,rc as b,ft as c,Bf as d,nc as e,du as f,Le as g,cv as h,Yf as i,Gr as j,tn as k,qr as l,da as m,Qf as n,ur as o,Jf as p,Xp as q,we as r,Se as s,cr as t,xm as u,hC as v,so as w,Ge as x,fo as y,Jp as z};
|
|
166
|
-
//# sourceMappingURL=index-
|
|
164
|
+
`)},ay=0,wn=[];function sy(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),o=h.useState(ay++)[0],a=h.useState(dc)[0],s=h.useRef(e);h.useEffect(function(){s.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=Av([e.lockRef.current],(e.shards||[]).map(si),!0).filter(Boolean);return m.forEach(function(g){return g.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var i=h.useCallback(function(m,g){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!s.current.allowPinchZoom;var S=Ar(m),b=n.current,C="deltaX"in m?m.deltaX:b[0]-S[0],R="deltaY"in m?m.deltaY:b[1]-S[1],A,T=m.target,w=Math.abs(C)>Math.abs(R)?"h":"v";if("touches"in m&&w==="h"&&T.type==="range")return!1;var O=window.getSelection(),H=O&&O.anchorNode,D=H?H===T||H.contains(T):!1;if(D)return!1;var F=oi(w,T);if(!F)return!0;if(F?A=w:(A=w==="v"?"h":"v",F=oi(w,T)),!F)return!1;if(!r.current&&"changedTouches"in m&&(C||R)&&(r.current=A),!A)return!0;var L=r.current||A;return ny(L,g,m,L==="h"?C:R)},[]),l=h.useCallback(function(m){var g=m;if(!(!wn.length||wn[wn.length-1]!==a)){var S="deltaY"in g?ai(g):Ar(g),b=t.current.filter(function(A){return A.name===g.type&&(A.target===g.target||g.target===A.shadowParent)&&ry(A.delta,S)})[0];if(b&&b.should){g.cancelable&&g.preventDefault();return}if(!b){var C=(s.current.shards||[]).map(si).filter(Boolean).filter(function(A){return A.contains(g.target)}),R=C.length>0?i(g,C[0]):!s.current.noIsolation;R&&g.cancelable&&g.preventDefault()}}},[]),c=h.useCallback(function(m,g,S,b){var C={name:m,delta:g,target:S,should:b,shadowParent:iy(S)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(R){return R!==C})},1)},[]),u=h.useCallback(function(m){n.current=Ar(m),r.current=void 0},[]),f=h.useCallback(function(m){c(m.type,ai(m),m.target,i(m,e.lockRef.current))},[]),p=h.useCallback(function(m){c(m.type,Ar(m),m.target,i(m,e.lockRef.current))},[]);h.useEffect(function(){return wn.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",l,bn),document.addEventListener("touchmove",l,bn),document.addEventListener("touchstart",u,bn),function(){wn=wn.filter(function(m){return m!==a}),document.removeEventListener("wheel",l,bn),document.removeEventListener("touchmove",l,bn),document.removeEventListener("touchstart",u,bn)}},[]);var d=e.removeScrollBar,y=e.inert;return h.createElement(h.Fragment,null,y?h.createElement(a,{styles:oy(o)}):null,d?h.createElement(Yv,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function iy(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const ly=_v(uc,sy);var mc=h.forwardRef(function(e,t){return h.createElement(ho,ct({},e,{ref:t,sideCar:ly}))});mc.classNames=ho.classNames;var cy=[" ","Enter","ArrowUp","ArrowDown"],uy=[" ","Enter"],un="Select",[po,mo,dy]=xm(un),[Mn]=so(un,[dy,fo]),go=fo(),[fy,Ht]=Mn(un),[hy,py]=Mn(un),gc=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:a,value:s,defaultValue:i,onValueChange:l,dir:c,name:u,autoComplete:f,disabled:p,required:d,form:y}=e,m=go(t),[g,S]=h.useState(null),[b,C]=h.useState(null),[R,A]=h.useState(!1),T=Em(c),[w,O]=ti({prop:r,defaultProp:o??!1,onChange:a,caller:un}),[H,D]=ti({prop:s,defaultProp:i,onChange:l,caller:un}),F=h.useRef(null),L=g?y||!!g.closest("form"):!0,[G,U]=h.useState(new Set),Q=Array.from(G).map(W=>W.props.value).join(";");return v.jsx(cv,{...m,children:v.jsxs(fy,{required:d,scope:t,trigger:g,onTriggerChange:S,valueNode:b,onValueNodeChange:C,valueNodeHasChildren:R,onValueNodeHasChildrenChange:A,contentId:Oa(),value:H,onValueChange:D,open:w,onOpenChange:O,dir:T,triggerPointerDownPosRef:F,disabled:p,children:[v.jsx(po.Provider,{scope:t,children:v.jsx(hy,{scope:e.__scopeSelect,onNativeOptionAdd:h.useCallback(W=>{U(Y=>new Set(Y).add(W))},[]),onNativeOptionRemove:h.useCallback(W=>{U(Y=>{const _=new Set(Y);return _.delete(W),_})},[]),children:n})}),L?v.jsxs(Uc,{"aria-hidden":!0,required:d,tabIndex:-1,name:u,autoComplete:f,value:H,onChange:W=>D(W.target.value),disabled:p,form:y,children:[H===void 0?v.jsx("option",{value:""}):null,Array.from(G)]},Q):null]})})};gc.displayName=un;var vc="SelectTrigger",yc=h.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,a=go(n),s=Ht(vc,n),i=s.disabled||r,l=De(t,s.onTriggerChange),c=mo(n),u=h.useRef("touch"),[f,p,d]=Bc(m=>{const g=c().filter(C=>!C.disabled),S=g.find(C=>C.value===s.value),b=Vc(g,m,S);b!==void 0&&s.onValueChange(b.value)}),y=m=>{i||(s.onOpenChange(!0),d()),m&&(s.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return v.jsx(tc,{asChild:!0,...a,children:v.jsx(Le.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":Hc(s.value)?"":void 0,...o,ref:l,onClick:Se(o.onClick,m=>{m.currentTarget.focus(),u.current!=="mouse"&&y(m)}),onPointerDown:Se(o.onPointerDown,m=>{u.current=m.pointerType;const g=m.target;g.hasPointerCapture(m.pointerId)&&g.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(y(m),m.preventDefault())}),onKeyDown:Se(o.onKeyDown,m=>{const g=f.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&p(m.key),!(g&&m.key===" ")&&cy.includes(m.key)&&(y(),m.preventDefault())})})})});yc.displayName=vc;var bc="SelectValue",wc=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:a,placeholder:s="",...i}=e,l=Ht(bc,n),{onValueNodeHasChildrenChange:c}=l,u=a!==void 0,f=De(t,l.onValueNodeChange);return $e(()=>{c(u)},[c,u]),v.jsx(Le.span,{...i,ref:f,style:{pointerEvents:"none"},children:Hc(l.value)?v.jsx(v.Fragment,{children:s}):a})});wc.displayName=bc;var my="SelectIcon",xc=h.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return v.jsx(Le.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});xc.displayName=my;var gy="SelectPortal",Sc=e=>v.jsx(oc,{asChild:!0,...e});Sc.displayName=gy;var dn="SelectContent",Ec=h.forwardRef((e,t)=>{const n=Ht(dn,e.__scopeSelect),[r,o]=h.useState();if($e(()=>{o(new DocumentFragment)},[]),!n.open){const a=r;return a?ir.createPortal(v.jsx(Cc,{scope:e.__scopeSelect,children:v.jsx(po.Slot,{scope:e.__scopeSelect,children:v.jsx("div",{children:e.children})})}),a):null}return v.jsx(Rc,{...e,ref:t})});Ec.displayName=dn;var et=10,[Cc,Bt]=Mn(dn),vy="SelectContentImpl",yy=dv("SelectContent.RemoveScroll"),Rc=h.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:a,onPointerDownOutside:s,side:i,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:d,sticky:y,hideWhenDetached:m,avoidCollisions:g,...S}=e,b=Ht(dn,n),[C,R]=h.useState(null),[A,T]=h.useState(null),w=De(t,M=>R(M)),[O,H]=h.useState(null),[D,F]=h.useState(null),L=mo(n),[G,U]=h.useState(!1),Q=h.useRef(!1);h.useEffect(()=>{if(C)return Pv(C)},[C]),Um();const W=h.useCallback(M=>{const[me,...Re]=L().map(oe=>oe.ref.current),[de]=Re.slice(-1),fe=document.activeElement;for(const oe of M)if(oe===fe||(oe?.scrollIntoView({block:"nearest"}),oe===me&&A&&(A.scrollTop=0),oe===de&&A&&(A.scrollTop=A.scrollHeight),oe?.focus(),document.activeElement!==fe))return},[L,A]),Y=h.useCallback(()=>W([O,C]),[W,O,C]);h.useEffect(()=>{G&&Y()},[G,Y]);const{onOpenChange:_,triggerPointerDownPosRef:I}=b;h.useEffect(()=>{if(C){let M={x:0,y:0};const me=de=>{M={x:Math.abs(Math.round(de.pageX)-(I.current?.x??0)),y:Math.abs(Math.round(de.pageY)-(I.current?.y??0))}},Re=de=>{M.x<=10&&M.y<=10?de.preventDefault():C.contains(de.target)||_(!1),document.removeEventListener("pointermove",me),I.current=null};return I.current!==null&&(document.addEventListener("pointermove",me),document.addEventListener("pointerup",Re,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",me),document.removeEventListener("pointerup",Re,{capture:!0})}}},[C,_,I]),h.useEffect(()=>{const M=()=>_(!1);return window.addEventListener("blur",M),window.addEventListener("resize",M),()=>{window.removeEventListener("blur",M),window.removeEventListener("resize",M)}},[_]);const[Z,le]=Bc(M=>{const me=L().filter(fe=>!fe.disabled),Re=me.find(fe=>fe.ref.current===document.activeElement),de=Vc(me,M,Re);de&&setTimeout(()=>de.ref.current.focus())}),X=h.useCallback((M,me,Re)=>{const de=!Q.current&&!Re;(b.value!==void 0&&b.value===me||de)&&(H(M),de&&(Q.current=!0))},[b.value]),se=h.useCallback(()=>C?.focus(),[C]),ie=h.useCallback((M,me,Re)=>{const de=!Q.current&&!Re;(b.value!==void 0&&b.value===me||de)&&F(M)},[b.value]),ue=r==="popper"?aa:Pc,Pe=ue===aa?{side:i,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:d,sticky:y,hideWhenDetached:m,avoidCollisions:g}:{};return v.jsx(Cc,{scope:n,content:C,viewport:A,onViewportChange:T,itemRefCallback:X,selectedItem:O,onItemLeave:se,itemTextRefCallback:ie,focusSelectedItem:Y,selectedItemText:D,position:r,isPositioned:G,searchRef:Z,children:v.jsx(mc,{as:yy,allowPinchZoom:!0,children:v.jsx(Nl,{asChild:!0,trapped:b.open,onMountAutoFocus:M=>{M.preventDefault()},onUnmountAutoFocus:Se(o,M=>{b.trigger?.focus({preventScroll:!0}),M.preventDefault()}),children:v.jsx(Ta,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:M=>M.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:v.jsx(ue,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:M=>M.preventDefault(),...S,...Pe,onPlaced:()=>U(!0),ref:w,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:Se(S.onKeyDown,M=>{const me=M.ctrlKey||M.altKey||M.metaKey;if(M.key==="Tab"&&M.preventDefault(),!me&&M.key.length===1&&le(M.key),["ArrowUp","ArrowDown","Home","End"].includes(M.key)){let de=L().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);if(["ArrowUp","End"].includes(M.key)&&(de=de.slice().reverse()),["ArrowUp","ArrowDown"].includes(M.key)){const fe=M.target,oe=de.indexOf(fe);de=de.slice(oe+1)}setTimeout(()=>W(de)),M.preventDefault()}})})})})})})});Rc.displayName=vy;var by="SelectItemAlignedPosition",Pc=h.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,a=Ht(dn,n),s=Bt(dn,n),[i,l]=h.useState(null),[c,u]=h.useState(null),f=De(t,w=>u(w)),p=mo(n),d=h.useRef(!1),y=h.useRef(!0),{viewport:m,selectedItem:g,selectedItemText:S,focusSelectedItem:b}=s,C=h.useCallback(()=>{if(a.trigger&&a.valueNode&&i&&c&&m&&g&&S){const w=a.trigger.getBoundingClientRect(),O=c.getBoundingClientRect(),H=a.valueNode.getBoundingClientRect(),D=S.getBoundingClientRect();if(a.dir!=="rtl"){const fe=D.left-O.left,oe=H.left-fe,Ae=w.left-oe,Ye=w.width+Ae,Vt=Math.max(Ye,O.width),He=window.innerWidth-et,zt=Ms(oe,[et,Math.max(et,He-Vt)]);i.style.minWidth=Ye+"px",i.style.left=zt+"px"}else{const fe=O.right-D.right,oe=window.innerWidth-H.right-fe,Ae=window.innerWidth-w.right-oe,Ye=w.width+Ae,Vt=Math.max(Ye,O.width),He=window.innerWidth-et,zt=Ms(oe,[et,Math.max(et,He-Vt)]);i.style.minWidth=Ye+"px",i.style.right=zt+"px"}const F=p(),L=window.innerHeight-et*2,G=m.scrollHeight,U=window.getComputedStyle(c),Q=parseInt(U.borderTopWidth,10),W=parseInt(U.paddingTop,10),Y=parseInt(U.borderBottomWidth,10),_=parseInt(U.paddingBottom,10),I=Q+W+G+_+Y,Z=Math.min(g.offsetHeight*5,I),le=window.getComputedStyle(m),X=parseInt(le.paddingTop,10),se=parseInt(le.paddingBottom,10),ie=w.top+w.height/2-et,ue=L-ie,Pe=g.offsetHeight/2,M=g.offsetTop+Pe,me=Q+W+M,Re=I-me;if(me<=ie){const fe=F.length>0&&g===F[F.length-1].ref.current;i.style.bottom="0px";const oe=c.clientHeight-m.offsetTop-m.offsetHeight,Ae=Math.max(ue,Pe+(fe?se:0)+oe+Y),Ye=me+Ae;i.style.height=Ye+"px"}else{const fe=F.length>0&&g===F[0].ref.current;i.style.top="0px";const Ae=Math.max(ie,Q+m.offsetTop+(fe?X:0)+Pe)+Re;i.style.height=Ae+"px",m.scrollTop=me-ie+m.offsetTop}i.style.margin=`${et}px 0`,i.style.minHeight=Z+"px",i.style.maxHeight=L+"px",r?.(),requestAnimationFrame(()=>d.current=!0)}},[p,a.trigger,a.valueNode,i,c,m,g,S,a.dir,r]);$e(()=>C(),[C]);const[R,A]=h.useState();$e(()=>{c&&A(window.getComputedStyle(c).zIndex)},[c]);const T=h.useCallback(w=>{w&&y.current===!0&&(C(),b?.(),y.current=!1)},[C,b]);return v.jsx(xy,{scope:n,contentWrapper:i,shouldExpandOnScrollRef:d,onScrollButtonChange:T,children:v.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R},children:v.jsx(Le.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Pc.displayName=by;var wy="SelectPopperPosition",aa=h.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=et,...a}=e,s=go(n);return v.jsx(nc,{...s,...a,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});aa.displayName=wy;var[xy,Fa]=Mn(dn,{}),sa="SelectViewport",Ac=h.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,a=Bt(sa,n),s=Fa(sa,n),i=De(t,a.onViewportChange),l=h.useRef(0);return v.jsxs(v.Fragment,{children:[v.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),v.jsx(po.Slot,{scope:n,children:v.jsx(Le.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Se(o.onScroll,c=>{const u=c.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:p}=s;if(p?.current&&f){const d=Math.abs(l.current-u.scrollTop);if(d>0){const y=window.innerHeight-et*2,m=parseFloat(f.style.minHeight),g=parseFloat(f.style.height),S=Math.max(m,g);if(S<y){const b=S+d,C=Math.min(y,b),R=b-C;f.style.height=C+"px",f.style.bottom==="0px"&&(u.scrollTop=R>0?R:0,f.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});Ac.displayName=sa;var Tc="SelectGroup",[Sy,Ey]=Mn(Tc),Cy=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Oa();return v.jsx(Sy,{scope:n,id:o,children:v.jsx(Le.div,{role:"group","aria-labelledby":o,...r,ref:t})})});Cy.displayName=Tc;var Oc="SelectLabel",kc=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ey(Oc,n);return v.jsx(Le.div,{id:o.id,...r,ref:t})});kc.displayName=Oc;var Kr="SelectItem",[Ry,Lc]=Mn(Kr),Nc=h.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:a,...s}=e,i=Ht(Kr,n),l=Bt(Kr,n),c=i.value===r,[u,f]=h.useState(a??""),[p,d]=h.useState(!1),y=De(t,b=>l.itemRefCallback?.(b,r,o)),m=Oa(),g=h.useRef("touch"),S=()=>{o||(i.onValueChange(r),i.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return v.jsx(Ry,{scope:n,value:r,disabled:o,textId:m,isSelected:c,onItemTextChange:h.useCallback(b=>{f(C=>C||(b?.textContent??"").trim())},[]),children:v.jsx(po.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:v.jsx(Le.div,{role:"option","aria-labelledby":m,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:y,onFocus:Se(s.onFocus,()=>d(!0)),onBlur:Se(s.onBlur,()=>d(!1)),onClick:Se(s.onClick,()=>{g.current!=="mouse"&&S()}),onPointerUp:Se(s.onPointerUp,()=>{g.current==="mouse"&&S()}),onPointerDown:Se(s.onPointerDown,b=>{g.current=b.pointerType}),onPointerMove:Se(s.onPointerMove,b=>{g.current=b.pointerType,o?l.onItemLeave?.():g.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Se(s.onPointerLeave,b=>{b.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:Se(s.onKeyDown,b=>{l.searchRef?.current!==""&&b.key===" "||(uy.includes(b.key)&&S(),b.key===" "&&b.preventDefault())})})})})});Nc.displayName=Kr;var Jn="SelectItemText",Ic=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...a}=e,s=Ht(Jn,n),i=Bt(Jn,n),l=Lc(Jn,n),c=py(Jn,n),[u,f]=h.useState(null),p=De(t,S=>f(S),l.onItemTextChange,S=>i.itemTextRefCallback?.(S,l.value,l.disabled)),d=u?.textContent,y=h.useMemo(()=>v.jsx("option",{value:l.value,disabled:l.disabled,children:d},l.value),[l.disabled,l.value,d]),{onNativeOptionAdd:m,onNativeOptionRemove:g}=c;return $e(()=>(m(y),()=>g(y)),[m,g,y]),v.jsxs(v.Fragment,{children:[v.jsx(Le.span,{id:l.textId,...a,ref:p}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?ir.createPortal(a.children,s.valueNode):null]})});Ic.displayName=Jn;var Dc="SelectItemIndicator",Mc=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Lc(Dc,n).isSelected?v.jsx(Le.span,{"aria-hidden":!0,...r,ref:t}):null});Mc.displayName=Dc;var ia="SelectScrollUpButton",_c=h.forwardRef((e,t)=>{const n=Bt(ia,e.__scopeSelect),r=Fa(ia,e.__scopeSelect),[o,a]=h.useState(!1),s=De(t,r.onScrollButtonChange);return $e(()=>{if(n.viewport&&n.isPositioned){let i=function(){const c=l.scrollTop>0;a(c)};const l=n.viewport;return i(),l.addEventListener("scroll",i),()=>l.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),o?v.jsx(Fc,{...e,ref:s,onAutoScroll:()=>{const{viewport:i,selectedItem:l}=n;i&&l&&(i.scrollTop=i.scrollTop-l.offsetHeight)}}):null});_c.displayName=ia;var la="SelectScrollDownButton",jc=h.forwardRef((e,t)=>{const n=Bt(la,e.__scopeSelect),r=Fa(la,e.__scopeSelect),[o,a]=h.useState(!1),s=De(t,r.onScrollButtonChange);return $e(()=>{if(n.viewport&&n.isPositioned){let i=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;a(u)};const l=n.viewport;return i(),l.addEventListener("scroll",i),()=>l.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),o?v.jsx(Fc,{...e,ref:s,onAutoScroll:()=>{const{viewport:i,selectedItem:l}=n;i&&l&&(i.scrollTop=i.scrollTop+l.offsetHeight)}}):null});jc.displayName=la;var Fc=h.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,a=Bt("SelectScrollButton",n),s=h.useRef(null),i=mo(n),l=h.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return h.useEffect(()=>()=>l(),[l]),$e(()=>{i().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[i]),v.jsx(Le.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:Se(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Se(o.onPointerMove,()=>{a.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Se(o.onPointerLeave,()=>{l()})})}),Py="SelectSeparator",$c=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return v.jsx(Le.div,{"aria-hidden":!0,...r,ref:t})});$c.displayName=Py;var ca="SelectArrow",Ay=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=go(n),a=Ht(ca,n),s=Bt(ca,n);return a.open&&s.position==="popper"?v.jsx(rc,{...o,...r,ref:t}):null});Ay.displayName=ca;var Ty="SelectBubbleInput",Uc=h.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=h.useRef(null),a=De(r,o),s=wv(t);return h.useEffect(()=>{const i=o.current;if(!i)return;const l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==t&&u){const f=new Event("change",{bubbles:!0});u.call(i,t),i.dispatchEvent(f)}},[s,t]),v.jsx(Le.select,{...n,style:{...ac,...n.style},ref:a,defaultValue:t})});Uc.displayName=Ty;function Hc(e){return e===""||e===void 0}function Bc(e){const t=ln(e),n=h.useRef(""),r=h.useRef(0),o=h.useCallback(s=>{const i=n.current+s;t(i),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(i)},[t]),a=h.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,a]}function Vc(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let s=Oy(e,Math.max(a,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Oy(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ky=gc,zc=yc,Ly=wc,Ny=xc,Iy=Sc,Wc=Ec,Dy=Ac,Kc=kc,qc=Nc,My=Ic,_y=Mc,Gc=_c,Yc=jc,Qc=$c;const ua=ky,da=Ly,qr=h.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(zc,{ref:r,className:we("flex h-8 w-full items-center justify-between gap-2","rounded-md border border-border bg-surface px-3 py-1 text-sm","placeholder:text-text-muted","focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-1 focus:ring-offset-bg","disabled:cursor-not-allowed disabled:opacity-55","[&>span]:line-clamp-1",e),...n,children:[t,v.jsx(Ny,{asChild:!0,children:v.jsx(el,{className:"h-4 w-4 opacity-60"})})]}));qr.displayName=zc.displayName;const Xc=h.forwardRef(({className:e,...t},n)=>v.jsx(Gc,{ref:n,className:we("flex cursor-default items-center justify-center py-1",e),...t,children:v.jsx(Bf,{className:"h-4 w-4"})}));Xc.displayName=Gc.displayName;const Jc=h.forwardRef(({className:e,...t},n)=>v.jsx(Yc,{ref:n,className:we("flex cursor-default items-center justify-center py-1",e),...t,children:v.jsx(el,{className:"h-4 w-4"})}));Jc.displayName=Yc.displayName;const Gr=h.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>v.jsx(Iy,{children:v.jsxs(Wc,{ref:o,position:n,className:we("relative z-50 max-h-96 min-w-[8rem] overflow-hidden","rounded-md border border-border bg-surface text-text shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",n==="popper"&&["data-[side=bottom]:translate-y-1","data-[side=top]:-translate-y-1","data-[side=left]:-translate-x-1","data-[side=right]:translate-x-1"],e),...r,children:[v.jsx(Xc,{}),v.jsx(Dy,{className:we("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),v.jsx(Jc,{})]})}));Gr.displayName=Wc.displayName;const jy=h.forwardRef(({className:e,...t},n)=>v.jsx(Kc,{ref:n,className:we("px-2 py-1.5 text-xs font-semibold uppercase tracking-wide text-text-muted",e),...t}));jy.displayName=Kc.displayName;const tn=h.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(qc,{ref:r,className:we("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-surface-hover focus:text-text","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[v.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:v.jsx(_y,{children:v.jsx(Hf,{className:"h-4 w-4"})})}),v.jsx(My,{children:t})]}));tn.displayName=qc.displayName;const Fy=h.forwardRef(({className:e,...t},n)=>v.jsx(Qc,{ref:n,className:we("-mx-1 my-1 h-px bg-border",e),...t}));Fy.displayName=Qc.displayName;function $y({agents:e,value:t,onChange:n}){return v.jsxs(ua,{value:t||void 0,onValueChange:n,children:[v.jsx(qr,{className:"h-7 w-28 sm:w-36 text-xs",children:v.jsx(da,{placeholder:e[0]??"—"})}),v.jsx(Gr,{children:e.map(r=>v.jsx(tn,{value:r,children:r},r))})]})}const fa="agim-theme",Zc="im-hub-lang";function Uy(){try{const e=localStorage.getItem(fa);if(e==="light"||e==="dark")return e}catch{}return"system"}function Hy(){try{const t=localStorage.getItem(Zc);if(t==="en"||t==="zh")return t}catch{}return(navigator.language||"en").toLowerCase().startsWith("zh")?"zh":"en"}function ii(e){try{e==="system"?localStorage.removeItem(fa):localStorage.setItem(fa,e)}catch{}}function By(e){try{localStorage.setItem(Zc,e)}catch{}}const En=Gi((e,t)=>({theme:Uy(),lang:Hy(),setTheme:n=>{ii(n),e({theme:n})},cycleTheme:()=>{const n=t().theme,r=n==="system"?"light":n==="light"?"dark":"system";ii(r),e({theme:r})},setLang:n=>{By(n),e({lang:n})}}));function li(e){e==="system"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",e)}function Vy(){const e=En(t=>t.theme);h.useEffect(()=>{if(li(e),e!=="system")return;const t=window.matchMedia("(prefers-color-scheme: dark)"),n=()=>li(e);return t.addEventListener("change",n),()=>t.removeEventListener("change",n)},[e])}function zy(){const{t:e}=pt(),t=En(a=>a.theme),n=En(a=>a.lang),r=En(a=>a.setTheme),o=En(a=>a.setLang);return v.jsxs(v.Fragment,{children:[v.jsxs(ua,{value:n,onValueChange:a=>o(a),children:[v.jsx(qr,{className:"h-7 w-16 sm:w-20 text-xs","aria-label":e("lang.label"),children:v.jsx(da,{})}),v.jsxs(Gr,{children:[v.jsx(tn,{value:"en",children:e("lang.en")}),v.jsx(tn,{value:"zh",children:e("lang.zh")})]})]}),v.jsxs(ua,{value:t,onValueChange:a=>r(a),children:[v.jsx(qr,{className:"h-7 w-16 text-xs sm:w-28","aria-label":e("theme.label"),children:v.jsx(da,{})}),v.jsxs(Gr,{children:[v.jsx(tn,{value:"system",children:v.jsxs("span",{className:"inline-flex items-center gap-2",children:[v.jsx(Kf,{className:"h-4 w-4"})," ",e("theme.system")]})}),v.jsx(tn,{value:"light",children:v.jsxs("span",{className:"inline-flex items-center gap-2",children:[v.jsx(Xf,{className:"h-4 w-4"})," ",e("theme.light")]})}),v.jsx(tn,{value:"dark",children:v.jsxs("span",{className:"inline-flex items-center gap-2",children:[v.jsx(Gf,{className:"h-4 w-4"})," ",e("theme.dark")]})})]})]})]})}function Wy(e){const[t,n]=h.useState(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(e).matches);return h.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const r=window.matchMedia(e),o=a=>n(a.matches);return n(r.matches),r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[e]),t}function Ky(){return Wy("(min-width: 640px)")}const qy=[{to:"/",i18nKey:"nav.chat",mounted:!0},{to:"/tasks",i18nKey:"nav.tasks",mounted:!0},{to:"/approvals",i18nKey:"nav.approvals",mounted:!0},{to:"/reminders",i18nKey:"nav.reminders",mounted:!0},{to:"/memos",i18nKey:"nav.memos",mounted:!0},{to:"/memory",i18nKey:"nav.memory",mounted:!0},{to:"/skills",i18nKey:"nav.skills",mounted:!0},{to:"/workspace",i18nKey:"nav.workspace",mounted:!0},{to:"/observability",i18nKey:"nav.observability",mounted:!0},{to:"/settings",i18nKey:"nav.settings",mounted:!0}];function eu({children:e}){const{t}=pt(),n=Ky(),r=v.jsx("nav",{className:we("flex flex-1 min-w-0 items-center gap-1","overflow-x-auto scrollbar-thin","[&::-webkit-scrollbar]:h-1 [&::-webkit-scrollbar-thumb]:bg-border"),"aria-label":t("appName"),children:qy.filter(o=>o.mounted).map(o=>v.jsx(cs,{to:o.to,end:o.to==="/",className:({isActive:a})=>we("shrink-0 rounded-md px-2.5 py-1.5 text-sm no-underline","transition-colors tap-target",a?"bg-accent-bg text-accent font-medium":"text-text-dim hover:bg-surface-hover hover:text-text"),children:t(o.i18nKey)},o.to))});return v.jsxs("header",{className:we("sticky top-0 z-20","flex flex-col sm:flex-row sm:items-center sm:gap-3","border-b border-border bg-surface","pt-safe","shadow-sm"),children:[v.jsxs("div",{className:we("flex items-center gap-2 sm:gap-3","overflow-x-hidden","px-3 sm:px-4 py-2 sm:py-2","sm:flex-1 sm:min-w-0"),children:[v.jsxs(cs,{to:"/",className:"flex shrink-0 items-center gap-1 text-md font-semibold no-underline",end:!0,children:[v.jsx("span",{"aria-hidden":"true",children:"🤖"}),v.jsx("span",{className:"hidden sm:inline",children:t("appName")})]}),n&&v.jsx("div",{className:"flex flex-1 min-w-0",children:r}),e&&v.jsx("div",{className:"flex items-center gap-2",children:e}),v.jsx("div",{className:"flex shrink-0 items-center gap-2",children:v.jsx(zy,{})})]}),!n&&v.jsx("div",{className:"border-t border-border px-3 py-1",children:r})]})}const Gy={open:"bg-success",connecting:"bg-warning animate-pulse",closed:"bg-text-muted",error:"bg-danger"};function Yy(){const{t:e}=pt(),{state:t,send:n,switchAgent:r,approvalClick:o,newConversation:a,clearError:s}=cm(),[i,l]=h.useState(""),c=h.useRef(null),u=h.useRef(null);h.useEffect(()=>{if(!c.current)return;const d=c.current;!(d.scrollHeight-d.scrollTop-d.clientHeight<200)&&t.currentReplyId==null||requestAnimationFrame(()=>{d.scrollTop=d.scrollHeight})},[t.messages,t.currentReplyId]),h.useEffect(()=>{t.error&&(Zn.error(t.error),s())},[t.error,s]);function f(d){d?.preventDefault();const y=i.trim();if(y){if(t.status!=="open"){Zn.error(e("chat.notConnected",{defaultValue:"Not connected. Reconnecting…"}));return}n(y),l(""),requestAnimationFrame(()=>u.current?.focus())}}function p(d){d.nativeEvent.isComposing||d.keyCode===229||d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),f())}return v.jsxs("div",{className:"flex h-dvh flex-col bg-bg",children:[v.jsxs(eu,{children:[v.jsx("span",{className:we("inline-block h-2 w-2 rounded-full",Gy[t.status]),title:t.status}),v.jsx("span",{className:"hidden text-xs text-text-dim sm:inline",children:t.status}),v.jsxs(ft,{variant:"ghost",size:"sm",onClick:()=>{a(),Zn.success(e("chat.newConvToast",{defaultValue:"Started a new conversation"})),requestAnimationFrame(()=>u.current?.focus())},disabled:t.status!=="open",title:e("chat.newConvHint",{defaultValue:"Clear messages and start a fresh session"}),"aria-label":e("chat.newConv",{defaultValue:"New conversation"}),children:[v.jsx(qf,{className:"h-4 w-4"}),v.jsx("span",{className:"hidden text-xs sm:inline",children:e("chat.newConv",{defaultValue:"New"})})]}),v.jsx($y,{agents:t.agents,value:t.agent,onChange:r})]}),v.jsx("div",{ref:c,className:"flex-1 overflow-y-auto",children:v.jsxs("div",{className:"mx-auto flex max-w-3xl flex-col gap-2 px-3 py-3 sm:px-4",children:[t.messages.length===0&&t.status==="open"&&v.jsxs("div",{className:"flex flex-col items-center gap-2 py-16 text-center",children:[v.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-surface-2 text-2xl",children:"💬"}),v.jsx("h2",{className:"text-base font-semibold",children:e("chat.welcomeTitle",{defaultValue:"Start a conversation"})}),v.jsx("p",{className:"max-w-md text-sm text-text-dim",children:e("chat.welcomeBody",{defaultValue:"Type a message to ask the active agent. Use the agent dropdown to switch."})})]}),t.messages.length===0&&t.status!=="open"&&v.jsxs("div",{className:"grid place-items-center py-16 text-center",children:[v.jsx(Vf,{className:"h-10 w-10 text-text-muted"}),v.jsx("p",{className:"mt-3 text-sm text-text-dim",children:t.status==="connecting"?e("chat.connecting",{defaultValue:"Connecting to agim…"}):e("chat.disconnected",{defaultValue:"Disconnected. Reconnecting automatically; you can keep typing."})})]}),t.messages.map(d=>v.jsx(dm,{msg:d,onApprove:(y,m,g)=>o(y,m,g)},d.id))]})}),v.jsxs("form",{onSubmit:f,className:"sticky bottom-0 border-t border-border bg-surface px-4 py-2 pb-safe sm:px-6",children:[v.jsxs("div",{className:"mx-auto flex max-w-3xl items-end gap-2",children:[v.jsx("textarea",{ref:u,value:i,onChange:d=>l(d.target.value),onKeyDown:p,placeholder:e("chat.inputPlaceholder",{defaultValue:"Message… (Enter sends, Shift+Enter newlines)"}),rows:1,className:we("flex-1 resize-none rounded-md border border-border bg-bg","px-3 py-1.5 text-sm leading-5","focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-1 focus:ring-offset-bg","max-h-32 min-h-8")}),v.jsx(ft,{type:"submit",disabled:!i.trim()||t.status!=="open","aria-label":e("chat.send",{defaultValue:"Send"}),className:"h-8 w-8 p-0",children:v.jsx(Qf,{className:"h-4 w-4"})})]}),t.currentReplyId&&v.jsx("div",{className:"mx-auto mt-2 flex max-w-3xl items-center gap-2",children:v.jsx(Mt,{variant:"info",children:e("chat.streaming",{defaultValue:"… streaming"})})})]})]})}function Qy(){const{t:e}=pt(),t=Ot();return v.jsxs("div",{className:"flex min-h-dvh flex-col bg-bg",children:[v.jsx(eu,{}),v.jsx("main",{className:"grid flex-1 place-items-center px-4 py-8 pb-safe",children:v.jsxs("div",{className:"flex max-w-md flex-col items-center gap-3 text-center",children:[v.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-surface-2 text-text-dim",children:v.jsx(zf,{className:"h-6 w-6"})}),v.jsx("div",{className:"text-6xl font-bold tracking-tight text-text-muted",children:"404"}),v.jsx("h1",{className:"text-xl font-semibold",children:e("notFound.title",{defaultValue:"Nothing here."})}),v.jsx("p",{className:"text-sm text-text-dim",children:e("notFound.description",{defaultValue:"The page you're looking for doesn't exist."})}),v.jsx("code",{className:"rounded bg-surface-2 px-2 py-0.5 text-xs text-text-muted",children:t.pathname}),v.jsx(ft,{asChild:!0,className:"mt-2",children:v.jsx(Sa,{to:"/",children:e("actions.back")})})]})})]})}function St(e){return async()=>{const n=(await e()).default;return{element:v.jsx(Yi,{children:v.jsx(n,{})})}}}function ke(e){return async()=>{const n=(await e()).default;return{element:v.jsx(n,{})}}}const Xy=Zd([{path:"/login",element:v.jsx(om,{})},{path:"/",element:v.jsx(Yi,{children:v.jsx(Yy,{})})},{path:"/tasks",lazy:St(()=>pe(()=>import("./layout-CcJQxFci.js"),__vite__mapDeps([0,1]))),children:[{index:!0,element:v.jsx(Jt,{to:"jobs",replace:!0})},{path:"jobs",lazy:ke(()=>pe(()=>import("./jobs-DwA9Ip87.js"),__vite__mapDeps([2,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17])))},{path:"subtasks",lazy:ke(()=>pe(()=>import("./subtasks-eKq_P0v6.js"),__vite__mapDeps([18,1,3,4,5,6,12,13,14,15])))},{path:"bgjobs",lazy:ke(()=>pe(()=>import("./bgjobs-B6XvxURz.js"),__vite__mapDeps([19,1,3,4,5,6,12,14,15])))},{path:"schedules",lazy:ke(()=>pe(()=>import("./schedules-CfCNvhCV.js"),__vite__mapDeps([20,1,3,4,5,12,14,15])))},{path:"outbox",lazy:ke(()=>pe(()=>import("./outbox-C7FpZzwS.js"),__vite__mapDeps([21,1,3,4,5,6,9,10,11,12,14,15])))},{path:"a2a",lazy:ke(()=>pe(()=>import("./a2a-Bg_mT0z1.js"),__vite__mapDeps([22,1,3,4,5,6,12,13,14,15])))}]},{path:"/approvals",lazy:St(()=>pe(()=>import("./approvals-Boj7iXz4.js"),__vite__mapDeps([23,1,11,5,12,13,14,15])))},{path:"/reminders",lazy:St(()=>pe(()=>import("./reminders-X-QFSWvZ.js"),__vite__mapDeps([24,1,3,4,5,6,9,10,11,12,14,15])))},{path:"/memos",lazy:St(()=>pe(()=>import("./memos-DCACQN26.js"),__vite__mapDeps([25,1,3,4,5,9,10,11,8,12,26,15,27,28])))},{path:"/memory",lazy:St(()=>pe(()=>import("./layout-CR5gLapT.js"),__vite__mapDeps([29,30,12,1]))),children:[{index:!0,element:v.jsx(Jt,{to:"facts",replace:!0})},{path:"facts",lazy:ke(()=>pe(()=>import("./facts-ByM1VHCp.js"),__vite__mapDeps([31,1,3,4,5,7,8,9,10,11,30,12,26,32,14,15,27])))},{path:"persona",lazy:ke(()=>pe(()=>import("./persona-Bjty6uqM.js"),__vite__mapDeps([33,1,5,9,10,11,30,12,32,14,15,34,35,16,26])))},{path:"vector",lazy:ke(()=>pe(()=>import("./vector-G2dN_aut.js"),__vite__mapDeps([36,1,37,12,30,14,38,39,9,10,11,5,16,15,34,40,26,35])))},{path:"skills",element:v.jsx(Jt,{to:"/skills/installed",replace:!0})}]},{path:"/skills",lazy:St(()=>pe(()=>import("./layout-DRRveTaR.js"),__vite__mapDeps([41,1]))),children:[{index:!0,element:v.jsx(Jt,{to:"installed",replace:!0})},{path:"installed",lazy:ke(()=>pe(()=>import("./installed-CM34mlDU.js"),__vite__mapDeps([42,1,5,10,11,43,12,14,15,27])))},{path:"hot",lazy:ke(()=>pe(()=>import("./hot-O9Z19xXa.js"),__vite__mapDeps([44,1,5,10,11,43,12,45,14,15,27,40])))}]},{path:"/workspace",lazy:St(()=>pe(()=>import("./workspace-BaLZIgGn.js"),__vite__mapDeps([46,1,5,47,12,14,15])))},{path:"/observability",lazy:St(()=>pe(()=>import("./layout-zotlJ5fW.js"),__vite__mapDeps([48,1]))),children:[{index:!0,element:v.jsx(Jt,{to:"health",replace:!0})},{path:"health",lazy:ke(()=>pe(()=>import("./health-B4GF06J-.js"),__vite__mapDeps([49,1,5,4,50,12,14,15,51])))},{path:"topn",lazy:ke(()=>pe(()=>import("./topn-JA8llaUI.js"),__vite__mapDeps([52,5,4,1,50,12,14,15])))},{path:"audit",lazy:ke(()=>pe(()=>import("./audit-MprCFoy_.js"),__vite__mapDeps([53,1,3,4,5,50,12,14,15,51])))}]},{path:"/settings",lazy:St(()=>pe(()=>import("./layout-BxrFilDN.js"),__vite__mapDeps([54,1]))),children:[{index:!0,element:v.jsx(Jt,{to:"messengers",replace:!0})},{path:"messengers",lazy:ke(()=>pe(()=>import("./messengers-CwWP1qI4.js"),__vite__mapDeps([55,1,10,11,37,12,14,15,38])))},{path:"email",lazy:ke(()=>pe(()=>import("./email-CZVaRhG_.js"),__vite__mapDeps([56,1,37,12,14,16,57,15,39,11,38])))},{path:"viewer",lazy:ke(()=>pe(()=>import("./viewer-DliYQkQQ.js"),__vite__mapDeps([58,1,37,12,39,14,15,57,45,11,38,28])))},{path:"agents",lazy:ke(()=>pe(()=>import("./agents-o9odac79.js"),__vite__mapDeps([59,1,5,47,12,37,14,15,11,38,60,27,26])))},{path:"policy",lazy:ke(()=>pe(()=>import("./policy-DwI-ov9J.js"),__vite__mapDeps([61,37,12,1,14,15])))},{path:"service",lazy:ke(()=>pe(()=>import("./service-DSitDFzD.js"),__vite__mapDeps([62,1,9,10,11,37,12,14,15,34,60,38])))},{path:"admins",lazy:ke(()=>pe(()=>import("./admins-BTC_YEK9.js"),__vite__mapDeps([63,1,9,10,11,5,4,37,12,14,15,26])))},{path:"workspaces",lazy:ke(()=>pe(()=>import("./workspaces-cX_rV523.js"),__vite__mapDeps([64,1,5,4,37,12,14,15,17,38])))}]},{path:"*",element:v.jsx(Qy,{})}]);function Jy(){return v.jsx(Uh,{children:v.jsx(lf,{router:Xy})})}const Zy=new yp({defaultOptions:{queries:{staleTime:3e4,gcTime:5*6e4,retry:1,retryDelay:e=>Math.min(1e3*2**e,8e3),refetchOnWindowFocus:!1,refetchOnReconnect:!0},mutations:{retry:0}}}),te=e=>typeof e=="string",Qn=()=>{let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n},ci=e=>e==null?"":""+e,eb=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},tb=/###/g,ui=e=>e&&e.indexOf("###")>-1?e.replace(tb,"."):e,di=e=>!e||te(e),er=(e,t,n)=>{const r=te(t)?t.split("."):t;let o=0;for(;o<r.length-1;){if(di(e))return{};const a=ui(r[o]);!e[a]&&n&&(e[a]=new n),Object.prototype.hasOwnProperty.call(e,a)?e=e[a]:e={},++o}return di(e)?{}:{obj:e,k:ui(r[o])}},fi=(e,t,n)=>{const{obj:r,k:o}=er(e,t,Object);if(r!==void 0||t.length===1){r[o]=n;return}let a=t[t.length-1],s=t.slice(0,t.length-1),i=er(e,s,Object);for(;i.obj===void 0&&s.length;)a=`${s[s.length-1]}.${a}`,s=s.slice(0,s.length-1),i=er(e,s,Object),i?.obj&&typeof i.obj[`${i.k}.${a}`]<"u"&&(i.obj=void 0);i.obj[`${i.k}.${a}`]=n},nb=(e,t,n,r)=>{const{obj:o,k:a}=er(e,t,Object);o[a]=o[a]||[],o[a].push(n)},Yr=(e,t)=>{const{obj:n,k:r}=er(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},rb=(e,t,n)=>{const r=Yr(e,n);return r!==void 0?r:Yr(t,n)},tu=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?te(e[r])||e[r]instanceof String||te(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):tu(e[r],t[r],n):e[r]=t[r]);return e},xn=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var ob={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const ab=e=>te(e)?e.replace(/[&<>"'\/]/g,t=>ob[t]):e;class sb{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const ib=[" ",",","?","!",";"],lb=new sb(20),cb=(e,t,n)=>{t=t||"",n=n||"";const r=ib.filter(s=>t.indexOf(s)<0&&n.indexOf(s)<0);if(r.length===0)return!0;const o=lb.getRegExp(`(${r.map(s=>s==="?"?"\\?":s).join("|")})`);let a=!o.test(e);if(!a){const s=e.indexOf(n);s>0&&!o.test(e.substring(0,s))&&(a=!0)}return a},ha=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let o=e;for(let a=0;a<r.length;){if(!o||typeof o!="object")return;let s,i="";for(let l=a;l<r.length;++l)if(l!==a&&(i+=n),i+=r[l],s=o[i],s!==void 0){if(["string","number","boolean"].indexOf(typeof s)>-1&&l<r.length-1)continue;a+=l-a+1;break}o=s}return o},Qr=e=>e?.replace("_","-"),ub={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)}};class Xr{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||ub,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,o){return o&&!this.debug?null:(te(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new Xr(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Xr(this.logger,t)}}var dt=new Xr;class vo{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const o=this.observers[r].get(n)||0;this.observers[r].set(n,o+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];this.observers[t]&&Array.from(this.observers[t].entries()).forEach(s=>{let[i,l]=s;for(let c=0;c<l;c++)i(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(s=>{let[i,l]=s;for(let c=0;c<l;c++)i.apply(i,[t,...r])})}}class hi extends vo{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,s=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let i;t.indexOf(".")>-1?i=t.split("."):(i=[t,n],r&&(Array.isArray(r)?i.push(...r):te(r)&&a?i.push(...r.split(a)):i.push(r)));const l=Yr(this.data,i);return!l&&!n&&!r&&t.indexOf(".")>-1&&(t=i[0],n=i[1],r=i.slice(2).join(".")),l||!s||!te(r)?l:ha(this.data?.[t]?.[n],r,a)}addResource(t,n,r,o){let a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const s=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let i=[t,n];r&&(i=i.concat(s?r.split(s):r)),t.indexOf(".")>-1&&(i=t.split("."),o=n,n=i[1]),this.addNamespaces(n),fi(this.data,i,o),a.silent||this.emit("added",t,n,r,o)}addResources(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const a in r)(te(r[a])||Array.isArray(r[a]))&&this.addResource(t,n,a,r[a],{silent:!0});o.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,o,a){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},i=[t,n];t.indexOf(".")>-1&&(i=t.split("."),o=r,r=n,n=i[1]),this.addNamespaces(n);let l=Yr(this.data,i)||{};s.skipCopy||(r=JSON.parse(JSON.stringify(r))),o?tu(l,r,a):l={...l,...r},fi(this.data,i,l),s.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(o=>n[o]&&Object.keys(n[o]).length>0)}toJSON(){return this.data}}var nu={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(a=>{t=this.processors[a]?.process(t,n,r,o)??t}),t}};const pi={},mi=e=>!te(e)&&typeof e!="boolean"&&typeof e!="number";class Jr extends vo{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),eb(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=dt.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};return t==null?!1:this.resolve(t,n)?.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let a=n.ns||this.options.defaultNS||[];const s=r&&t.indexOf(r)>-1,i=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!cb(t,r,o);if(s&&!i){const l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:te(a)?[a]:a};const c=t.split(r);(r!==o||r===o&&this.options.ns.indexOf(c[0])>-1)&&(a=c.shift()),t=c.join(o)}return{key:t,namespaces:te(a)?[a]:a}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const o=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:s,namespaces:i}=this.extractFromKey(t[t.length-1],n),l=i[i.length-1],c=n.lng||this.language,u=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c?.toLowerCase()==="cimode"){if(u){const F=n.nsSeparator||this.options.nsSeparator;return o?{res:`${l}${F}${s}`,usedKey:s,exactUsedKey:s,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:`${l}${F}${s}`}return o?{res:s,usedKey:s,exactUsedKey:s,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:s}const f=this.resolve(t,n);let p=f?.res;const d=f?.usedKey||s,y=f?.exactUsedKey||s,m=["[object Number]","[object Function]","[object RegExp]"],g=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,S=!this.i18nFormat||this.i18nFormat.handleAsObject,b=n.count!==void 0&&!te(n.count),C=Jr.hasDefaultValue(n),R=b?this.pluralResolver.getSuffix(c,n.count,n):"",A=n.ordinal&&b?this.pluralResolver.getSuffix(c,n.count,{ordinal:!1}):"",T=b&&!n.ordinal&&n.count===0,w=T&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${R}`]||n[`defaultValue${A}`]||n.defaultValue;let O=p;S&&!p&&C&&(O=w);const H=mi(O),D=Object.prototype.toString.apply(O);if(S&&O&&H&&m.indexOf(D)<0&&!(te(g)&&Array.isArray(O))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const F=this.options.returnedObjectHandler?this.options.returnedObjectHandler(d,O,{...n,ns:i}):`key '${s} (${this.language})' returned an object instead of string.`;return o?(f.res=F,f.usedParams=this.getUsedParamsDetails(n),f):F}if(a){const F=Array.isArray(O),L=F?[]:{},G=F?y:d;for(const U in O)if(Object.prototype.hasOwnProperty.call(O,U)){const Q=`${G}${a}${U}`;C&&!p?L[U]=this.translate(Q,{...n,defaultValue:mi(w)?w[U]:void 0,joinArrays:!1,ns:i}):L[U]=this.translate(Q,{...n,joinArrays:!1,ns:i}),L[U]===Q&&(L[U]=O[U])}p=L}}else if(S&&te(g)&&Array.isArray(p))p=p.join(g),p&&(p=this.extendTranslation(p,t,n,r));else{let F=!1,L=!1;!this.isValidLookup(p)&&C&&(F=!0,p=w),this.isValidLookup(p)||(L=!0,p=s);const U=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&L?void 0:p,Q=C&&w!==p&&this.options.updateMissing;if(L||F||Q){if(this.logger.log(Q?"updateKey":"missingKey",c,l,s,Q?w:p),a){const I=this.resolve(s,{...n,keySeparator:!1});I&&I.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 W=[];const Y=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Y&&Y[0])for(let I=0;I<Y.length;I++)W.push(Y[I]);else this.options.saveMissingTo==="all"?W=this.languageUtils.toResolveHierarchy(n.lng||this.language):W.push(n.lng||this.language);const _=(I,Z,le)=>{const X=C&&le!==p?le:U;this.options.missingKeyHandler?this.options.missingKeyHandler(I,l,Z,X,Q,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(I,l,Z,X,Q,n),this.emit("missingKey",I,l,Z,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?W.forEach(I=>{const Z=this.pluralResolver.getSuffixes(I,n);T&&n[`defaultValue${this.options.pluralSeparator}zero`]&&Z.indexOf(`${this.options.pluralSeparator}zero`)<0&&Z.push(`${this.options.pluralSeparator}zero`),Z.forEach(le=>{_([I],s+le,n[`defaultValue${le}`]||w)})}):_(W,s,w))}p=this.extendTranslation(p,t,n,f,r),L&&p===s&&this.options.appendNamespaceToMissingKey&&(p=`${l}:${s}`),(L||F)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${s}`:s,F?p:void 0))}return o?(f.res=p,f.usedParams=this.getUsedParamsDetails(n),f):p}extendTranslation(t,n,r,o,a){var s=this;if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const c=te(t)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(c){const p=t.match(this.interpolator.nestingRegexp);u=p&&p.length}let f=r.replace&&!te(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(f={...this.options.interpolation.defaultVariables,...f}),t=this.interpolator.interpolate(t,f,r.lng||this.language||o.usedLng,r),c){const p=t.match(this.interpolator.nestingRegexp),d=p&&p.length;u<d&&(r.nest=!1)}!r.lng&&o&&o.res&&(r.lng=this.language||o.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var p=arguments.length,d=new Array(p),y=0;y<p;y++)d[y]=arguments[y];return a?.[0]===d[0]&&!r.context?(s.logger.warn(`It seems you are nesting recursively key: ${d[0]} in key: ${n[0]}`),null):s.translate(...d,n)},r)),r.interpolation&&this.interpolator.reset()}const i=r.postProcess||this.options.postProcess,l=te(i)?[i]:i;return t!=null&&l?.length&&r.applyPostProcessor!==!1&&(t=nu.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,o,a,s,i;return te(t)&&(t=[t]),t.forEach(l=>{if(this.isValidLookup(r))return;const c=this.extractFromKey(l,n),u=c.key;o=u;let f=c.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const p=n.count!==void 0&&!te(n.count),d=p&&!n.ordinal&&n.count===0,y=n.context!==void 0&&(te(n.context)||typeof n.context=="number")&&n.context!=="",m=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(g=>{this.isValidLookup(r)||(i=g,!pi[`${m[0]}-${g}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(i)&&(pi[`${m[0]}-${g}`]=!0,this.logger.warn(`key "${o}" for languages "${m.join(", ")}" won't get resolved as namespace "${i}" 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(S=>{if(this.isValidLookup(r))return;s=S;const b=[u];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(b,u,S,g,n);else{let R;p&&(R=this.pluralResolver.getSuffix(S,n.count,n));const A=`${this.options.pluralSeparator}zero`,T=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(b.push(u+R),n.ordinal&&R.indexOf(T)===0&&b.push(u+R.replace(T,this.options.pluralSeparator)),d&&b.push(u+A)),y){const w=`${u}${this.options.contextSeparator}${n.context}`;b.push(w),p&&(b.push(w+R),n.ordinal&&R.indexOf(T)===0&&b.push(w+R.replace(T,this.options.pluralSeparator)),d&&b.push(w+A))}}let C;for(;C=b.pop();)this.isValidLookup(r)||(a=C,r=this.getResource(S,g,C,n))}))})}),{res:r,usedKey:o,exactUsedKey:a,usedLng:s,usedNS:i}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,n,r,o):this.resourceStore.getResource(t,n,r,o)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!te(t.replace);let o=r?t.replace:t;if(r&&typeof t.count<"u"&&(o.count=t.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!r){o={...o};for(const a of n)delete o[a]}return o}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class gi{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=dt.create("languageUtils")}getScriptPartFromCode(t){if(t=Qr(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=Qr(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(te(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const o=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(o))&&(n=o)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(a=>{if(a===o)return a;if(!(a.indexOf("-")<0&&o.indexOf("-")<0)&&(a.indexOf("-")>0&&o.indexOf("-")<0&&a.substring(0,a.indexOf("-"))===o||a.indexOf(o)===0&&o.length>1))return a})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),te(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),o=[],a=s=>{s&&(this.isSupportedCode(s)?o.push(s):this.logger.warn(`rejecting language code not found in supportedLngs: ${s}`))};return te(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(t))):te(t)&&a(this.formatLanguageCode(t)),r.forEach(s=>{o.indexOf(s)<0&&a(this.formatLanguageCode(s))}),o}}const vi={zero:0,one:1,two:2,few:3,many:4,other:5},yi={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class db{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=dt.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=Qr(t==="dev"?"en":t),o=n.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:r,type:o});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let s;try{s=new Intl.PluralRules(r,{type:o})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),yi;if(!t.match(/-|_/))return yi;const l=this.languageUtils.getLanguagePartFromCode(t);s=this.getRule(l,n)}return this.pluralRulesCache[a]=s,s}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(o=>`${n}${o}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((o,a)=>vi[o]-vi[a]).map(o=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=this.getRule(t,r);return o?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${o.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const bi=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=rb(e,t,n);return!a&&o&&te(n)&&(a=ha(e,n,r),a===void 0&&(a=ha(t,n,r))),a},_o=e=>e.replace(/\$/g,"$$$$");class fb{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=dt.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:o,prefix:a,prefixEscaped:s,suffix:i,suffixEscaped:l,formatSeparator:c,unescapeSuffix:u,unescapePrefix:f,nestingPrefix:p,nestingPrefixEscaped:d,nestingSuffix:y,nestingSuffixEscaped:m,nestingOptionsSeparator:g,maxReplaces:S,alwaysFormat:b}=t.interpolation;this.escape=n!==void 0?n:ab,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=a?xn(a):s||"{{",this.suffix=i?xn(i):l||"}}",this.formatSeparator=c||",",this.unescapePrefix=u?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=p?xn(p):d||xn("$t("),this.nestingSuffix=y?xn(y):m||xn(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=S||1e3,this.alwaysFormat=b!==void 0?b:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n?.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,o){let a,s,i;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=d=>{if(d.indexOf(this.formatSeparator)<0){const S=bi(n,l,d,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(S,void 0,r,{...o,...n,interpolationkey:d}):S}const y=d.split(this.formatSeparator),m=y.shift().trim(),g=y.join(this.formatSeparator).trim();return this.format(bi(n,l,m,this.options.keySeparator,this.options.ignoreJSONStructure),g,r,{...o,...n,interpolationkey:m})};this.resetRegExp();const u=o?.missingInterpolationHandler||this.options.missingInterpolationHandler,f=o?.interpolation?.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:d=>_o(d)},{regex:this.regexp,safeValue:d=>this.escapeValue?_o(this.escape(d)):_o(d)}].forEach(d=>{for(i=0;a=d.regex.exec(t);){const y=a[1].trim();if(s=c(y),s===void 0)if(typeof u=="function"){const g=u(t,a,o);s=te(g)?g:""}else if(o&&Object.prototype.hasOwnProperty.call(o,y))s="";else if(f){s=a[0];continue}else this.logger.warn(`missed to pass in variable ${y} for interpolating ${t}`),s="";else!te(s)&&!this.useRawValueToEscape&&(s=ci(s));const m=d.safeValue(s);if(t=t.replace(a[0],m),f?(d.regex.lastIndex+=s.length,d.regex.lastIndex-=a[0].length):d.regex.lastIndex=0,i++,i>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,a,s;const i=(l,c)=>{const u=this.nestingOptionsSeparator;if(l.indexOf(u)<0)return l;const f=l.split(new RegExp(`${u}[ ]*{`));let p=`{${f[1]}`;l=f[0],p=this.interpolate(p,s);const d=p.match(/'/g),y=p.match(/"/g);((d?.length??0)%2===0&&!y||y.length%2!==0)&&(p=p.replace(/'/g,'"'));try{s=JSON.parse(p),c&&(s={...c,...s})}catch(m){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,m),`${l}${u}${p}`}return s.defaultValue&&s.defaultValue.indexOf(this.prefix)>-1&&delete s.defaultValue,l};for(;o=this.nestingRegexp.exec(t);){let l=[];s={...r},s=s.replace&&!te(s.replace)?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;let c=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){const u=o[1].split(this.formatSeparator).map(f=>f.trim());o[1]=u.shift(),l=u,c=!0}if(a=n(i.call(this,o[1].trim(),s),s),a&&o[0]===t&&!te(a))return a;te(a)||(a=ci(a)),a||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),a=""),c&&(a=l.reduce((u,f)=>this.format(u,f,r.lng,{...r,interpolationkey:o[1].trim()}),a.trim())),t=t.replace(o[0],a),this.regexp.lastIndex=0}return t}}const hb=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);t==="currency"&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):t==="relativetime"&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(s=>{if(s){const[i,...l]=s.split(":"),c=l.join(":").trim().replace(/^'+|'+$/g,""),u=i.trim();n[u]||(n[u]=c),c==="false"&&(n[u]=!1),c==="true"&&(n[u]=!0),isNaN(c)||(n[u]=parseInt(c,10))}})}return{formatName:t,formatOptions:n}},Sn=e=>{const t={};return(n,r,o)=>{let a=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(a={...a,[o.interpolationkey]:void 0});const s=r+JSON.stringify(a);let i=t[s];return i||(i=e(Qr(r),o),t[s]=i),i(n)}};class pb{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=dt.create("formatter"),this.options=t,this.formats={number:Sn((n,r)=>{const o=new Intl.NumberFormat(n,{...r});return a=>o.format(a)}),currency:Sn((n,r)=>{const o=new Intl.NumberFormat(n,{...r,style:"currency"});return a=>o.format(a)}),datetime:Sn((n,r)=>{const o=new Intl.DateTimeFormat(n,{...r});return a=>o.format(a)}),relativetime:Sn((n,r)=>{const o=new Intl.RelativeTimeFormat(n,{...r});return a=>o.format(a,r.range||"day")}),list:Sn((n,r)=>{const o=new Intl.ListFormat(n,{...r});return a=>o.format(a)})},this.init(t)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=n.interpolation.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=Sn(n)}format(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const a=n.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(i=>i.indexOf(")")>-1)){const i=a.findIndex(l=>l.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,i)].join(this.formatSeparator)}return a.reduce((i,l)=>{const{formatName:c,formatOptions:u}=hb(l);if(this.formats[c]){let f=i;try{const p=o?.formatParams?.[o.interpolationkey]||{},d=p.locale||p.lng||o.locale||o.lng||r;f=this.formats[c](i,d,{...u,...o,...p})}catch(p){this.logger.warn(p)}return f}else this.logger.warn(`there was no format function for ${c}`);return i},t)}}const mb=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class gb extends vo{constructor(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=o,this.logger=dt.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,o.backend,o)}queueLoad(t,n,r,o){const a={},s={},i={},l={};return t.forEach(c=>{let u=!0;n.forEach(f=>{const p=`${c}|${f}`;!r.reload&&this.store.hasResourceBundle(c,f)?this.state[p]=2:this.state[p]<0||(this.state[p]===1?s[p]===void 0&&(s[p]=!0):(this.state[p]=1,u=!1,s[p]===void 0&&(s[p]=!0),a[p]===void 0&&(a[p]=!0),l[f]===void 0&&(l[f]=!0)))}),u||(i[c]=!0)}),(Object.keys(a).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(a),pending:Object.keys(s),toLoadLanguages:Object.keys(i),toLoadNamespaces:Object.keys(l)}}loaded(t,n,r){const o=t.split("|"),a=o[0],s=o[1];n&&this.emit("failedLoading",a,s,n),!n&&r&&this.store.addResourceBundle(a,s,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const i={};this.queue.forEach(l=>{nb(l.loaded,[a],s),mb(l,t),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{i[c]||(i[c]={});const u=l.loaded[c];u.length&&u.forEach(f=>{i[c][f]===void 0&&(i[c][f]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",i),this.queue=this.queue.filter(l=>!l.done)}read(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,s=arguments.length>5?arguments[5]:void 0;if(!t.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:o,wait:a,callback:s});return}this.readingCalls++;const i=(c,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(c&&u&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,o+1,a*2,s)},a);return}s(c,u)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const c=l(t,n);c&&typeof c.then=="function"?c.then(u=>i(null,u)).catch(i):i(null,c)}catch(c){i(c)}return}return l(t,n,i)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();te(t)&&(t=this.languageUtils.toResolveHierarchy(t)),te(n)&&(n=[n]);const a=this.queueLoad(t,n,r,o);if(!a.toLoad.length)return a.pending.length||o(),null;a.toLoad.forEach(s=>{this.loadOne(s)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),o=r[0],a=r[1];this.read(o,a,"read",void 0,void 0,(s,i)=>{s&&this.logger.warn(`${n}loading namespace ${a} for language ${o} failed`,s),!s&&i&&this.logger.log(`${n}loaded namespace ${a} for language ${o}`,i),this.loaded(t,s,i)})}saveMissing(t,n,r,o,a){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},i=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" 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(!(r==null||r==="")){if(this.backend?.create){const l={...s,isUpdate:a},c=this.backend.create.bind(this.backend);if(c.length<6)try{let u;c.length===5?u=c(t,n,r,o,l):u=c(t,n,r,o),u&&typeof u.then=="function"?u.then(f=>i(null,f)).catch(i):i(null,u)}catch(u){i(u)}else c(t,n,r,o,i,l)}!t||!t[0]||this.store.addResource(t[0],n,r,o)}}}const wi=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",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]),te(e[1])&&(t.defaultValue=e[1]),te(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),xi=e=>(te(e.ns)&&(e.ns=[e.ns]),te(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),te(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e),Tr=()=>{},vb=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class ar extends vo{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=xi(t),this.services={},this.logger=dt,this.modules={external:[]},vb(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),n.defaultNS==null&&n.ns&&(te(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const o=wi();this.options={...o,...this.options,...xi(n)},this.options.interpolation={...o.interpolation,...this.options.interpolation},n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const a=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?dt.init(a(this.modules.logger),this.options):dt.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=pb;const f=new gi(this.options);this.store=new hi(this.options.resources,this.options);const p=this.services;p.logger=dt,p.resourceStore=this.store,p.languageUtils=f,p.pluralResolver=new db(f,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===o.interpolation.format)&&(p.formatter=a(u),p.formatter.init(p,this.options),this.options.interpolation.format=p.formatter.format.bind(p.formatter)),p.interpolator=new fb(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new gb(a(this.modules.backend),p.resourceStore,p,this.options),p.backendConnector.on("*",function(d){for(var y=arguments.length,m=new Array(y>1?y-1:0),g=1;g<y;g++)m[g-1]=arguments[g];t.emit(d,...m)}),this.modules.languageDetector&&(p.languageDetector=a(this.modules.languageDetector),p.languageDetector.init&&p.languageDetector.init(p,this.options.detection,this.options)),this.modules.i18nFormat&&(p.i18nFormat=a(this.modules.i18nFormat),p.i18nFormat.init&&p.i18nFormat.init(this)),this.translator=new Jr(this.services,this.options),this.translator.on("*",function(d){for(var y=arguments.length,m=new Array(y>1?y-1:0),g=1;g<y;g++)m[g-1]=arguments[g];t.emit(d,...m)}),this.modules.external.forEach(d=>{d.init&&d.init(this)})}if(this.format=this.options.interpolation.format,r||(r=Tr),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[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(u=>{this[u]=function(){return t.store[u](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=function(){return t.store[u](...arguments),t}});const l=Qn(),c=()=>{const u=(f,p)=>{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),l.resolve(p),r(f,p)};if(this.languages&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),l}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Tr;const o=te(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(o?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const a=[],s=i=>{if(!i||i==="cimode")return;this.services.languageUtils.toResolveHierarchy(i).forEach(c=>{c!=="cimode"&&a.indexOf(c)<0&&a.push(c)})};o?s(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>s(l)),this.options.preload?.forEach?.(i=>s(i)),this.services.backendConnector.load(a,this.options.ns,i=>{!i&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(i)})}else r(null)}reloadResources(t,n,r){const o=Qn();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=Tr),this.services.backendConnector.reload(t,n,a=>{o.resolve(),r(a)}),o}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&nu.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const o=Qn();this.emit("languageChanging",t);const a=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},s=(l,c)=>{c?(a(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,o.resolve(function(){return r.t(...arguments)}),n&&n(l,function(){return r.t(...arguments)})},i=l=>{!t&&!l&&this.services.languageDetector&&(l=[]);const c=te(l)?l:this.services.languageUtils.getBestMatchFromCodes(l);c&&(this.language||a(c),this.translator.language||this.translator.changeLanguage(c),this.services.languageDetector?.cacheUserLanguage?.(c)),this.loadResources(c,u=>{s(u,c)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?i(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(t),o}getFixedT(t,n,r){var o=this;const a=function(s,i){let l;if(typeof i!="object"){for(var c=arguments.length,u=new Array(c>2?c-2:0),f=2;f<c;f++)u[f-2]=arguments[f];l=o.options.overloadTranslationOptionHandler([s,i].concat(u))}else l={...i};l.lng=l.lng||a.lng,l.lngs=l.lngs||a.lngs,l.ns=l.ns||a.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||r||a.keyPrefix);const p=o.options.keySeparator||".";let d;return l.keyPrefix&&Array.isArray(s)?d=s.map(y=>`${l.keyPrefix}${p}${y}`):d=l.keyPrefix?`${l.keyPrefix}${p}${s}`:s,o.t(d,l)};return te(t)?a.lng=t:a.lngs=t,a.ns=n,a.keyPrefix=r,a}t(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.translator?.translate(...n)}exists(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.translator?.exists(...n)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};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;const r=n.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const s=(i,l)=>{const c=this.services.backendConnector.state[`${i}|${l}`];return c===-1||c===0||c===2};if(n.precheck){const i=n.precheck(this,s);if(i!==void 0)return i}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(r,t)&&(!o||s(a,t)))}loadNamespaces(t,n){const r=Qn();return this.options.ns?(te(t)&&(t=[t]),t.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=Qn();te(t)&&(t=[t]);const o=this.options.preload||[],a=t.filter(s=>o.indexOf(s)<0&&this.services.languageUtils.isSupportedCode(s));return a.length?(this.options.preload=o.concat(a),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["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"],r=this.services?.languageUtils||new gi(wi());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new ar(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Tr;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const o={...this.options,...t,isClone:!0},a=new ar(o);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),["store","services","language"].forEach(i=>{a[i]=this[i]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r){const i=Object.keys(this.store.data).reduce((l,c)=>(l[c]={...this.store.data[c]},Object.keys(l[c]).reduce((u,f)=>(u[f]={...l[c][f]},u),{})),{});a.store=new hi(i,o),a.services.resourceStore=a.store}return a.translator=new Jr(a.services,o),a.translator.on("*",function(i){for(var l=arguments.length,c=new Array(l>1?l-1:0),u=1;u<l;u++)c[u-1]=arguments[u];a.emit(i,...c)}),a.init(o,n),a.translator.options=o,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}}}const Me=ar.createInstance();Me.createInstance=ar.createInstance;Me.createInstance;Me.dir;Me.init;Me.loadResources;Me.reloadResources;Me.use;Me.changeLanguage;Me.getFixedT;Me.t;Me.exists;Me.setDefaultNamespace;Me.hasLoadedNamespace;Me.loadNamespaces;Me.loadLanguages;function yb(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=bb(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
165
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,s=!0,i=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return s=c.done,c},e:function(c){i=!0,a=c},f:function(){try{s||n.return==null||n.return()}finally{if(i)throw a}}}}function bb(e,t){if(e){if(typeof e=="string")return Si(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Si(e,t):void 0}}function Si(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function pa(e){"@babel/helpers - typeof";return pa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pa(e)}var ru=["__proto__","constructor","prototype"];function ou(e){return!(typeof e!="string"||e.length===0||e.length>128||ru.indexOf(e)>-1||e.indexOf("..")>-1||e.indexOf("\\")>-1||/[?#%\s@]/.test(e)||/[\x00-\x1F\x7F]/.test(e))}function au(e){return!(!ou(e)||e.indexOf("/")>-1)}function wb(e){return ou(e)}var xb={lng:au,ns:wb};function Or(e){return typeof e!="string"?e:e.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function Sb(e){if(typeof e!="string"||e.length===0)return e;try{var t=new URL(e);return t.username||t.password?(t.username="",t.password="",t.toString()):e}catch{return e.replace(/(\/\/)[^/@\s]+@/g,"$1")}}function su(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":pa(XMLHttpRequest))==="object"}function Eb(e){return!!e&&typeof e.then=="function"}function Cb(e){return Eb(e)?e:Promise.resolve(e)}var Rb=/\{\{(.+?)\}\}/g;function Ei(e,t){var n=!1,r=e.replace(Rb,function(o,a){var s=a.trim();if(ru.indexOf(s)>-1)return o;var i=t[s];if(i==null)return o;var l=xb[s]||au,c=String(i).split("+"),u=yb(c),f;try{for(u.s();!(f=u.n()).done;){var p=f.value;if(!l(p))return n=!0,o}}catch(d){u.e(d)}finally{u.f()}return c.join("+")});return n?null:r}function Ci(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Ri(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ci(Object(n),!0).forEach(function(r){Pb(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ci(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pb(e,t,n){return(t=Ab(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ab(e){var t=Tb(e,"string");return fn(t)=="symbol"?t:t+""}function Tb(e,t){if(fn(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(fn(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fn(e){"@babel/helpers - typeof";return fn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fn(e)}var $t=typeof fetch=="function"?fetch:void 0;typeof global<"u"&&global.fetch?$t=global.fetch:typeof window<"u"&&window.fetch&&($t=window.fetch);var sr;su()&&(typeof global<"u"&&global.XMLHttpRequest?sr=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(sr=window.XMLHttpRequest));var Zr;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?Zr=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(Zr=window.ActiveXObject));typeof $t!="function"&&($t=void 0);if(!$t&&!sr&&!Zr)try{pe(()=>import("./browser-ponyfill-BOcGq8h9.js").then(e=>e.b),__vite__mapDeps([65,1])).then(function(e){$t=e.default}).catch(function(){})}catch{}var iu=["__proto__","constructor","prototype"],ma=function(t,n){if(n&&fn(n)==="object"){for(var r="",o=0,a=Object.keys(n);o<a.length;o++){var s=a[o];iu.indexOf(s)>-1||(r+="&"+encodeURIComponent(s)+"="+encodeURIComponent(n[s]))}if(!r)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+r.slice(1)}return t},Pi=function(t,n,r,o){var a=function(l){if(!l.ok)return r(l.statusText||"Error",{status:l.status});l.text().then(function(c){r(null,{status:l.status,data:c})}).catch(r)};if(o){var s=o(t,n);if(s instanceof Promise){s.then(a).catch(r);return}}typeof fetch=="function"?fetch(t,n).then(a).catch(r):$t(t,n).then(a).catch(r)},Ob=function(t,n,r,o){t.queryStringParams&&(n=ma(n,t.queryStringParams));var a=Ri({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(a["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),r&&(a["Content-Type"]="application/json");var s=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,i=Ri({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:a},t._omitFetchOptions?{}:s),l=typeof t.alternateFetch=="function"&&t.alternateFetch.length>=1?t.alternateFetch:void 0;try{Pi(n,i,o,l)}catch(c){if(!s||Object.keys(s).length===0||!c.message||c.message.indexOf("not implemented")<0)return o(c);try{Object.keys(s).forEach(function(u){delete i[u]}),Pi(n,i,o,l),t._omitFetchOptions=!0}catch(u){o(u)}}},kb=function(t,n,r,o){r&&fn(r)==="object"&&(r=ma("",r).slice(1)),t.queryStringParams&&(n=ma(n,t.queryStringParams));try{var a=sr?new sr:new Zr("MSXML2.XMLHTTP.3.0");a.open(r?"POST":"GET",n,1),t.crossDomain||a.setRequestHeader("X-Requested-With","XMLHttpRequest"),a.withCredentials=!!t.withCredentials,r&&a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),a.overrideMimeType&&a.overrideMimeType("application/json");var s=t.customHeaders;if(s=typeof s=="function"?s():s,s)for(var i=0,l=Object.keys(s);i<l.length;i++){var c=l[i];iu.indexOf(c)>-1||a.setRequestHeader(c,s[c])}a.onreadystatechange=function(){a.readyState>3&&o(a.status>=400?a.statusText:null,{status:a.status,data:a.responseText})},a.send(r)}catch(u){console&&console.log(u)}},Lb=function(t,n,r,o){if(typeof r=="function"&&(o=r,r=void 0),o=o||function(){},$t&&n.indexOf("file:")!==0)return Ob(t,n,r,o);if(su()||typeof ActiveXObject=="function")return kb(t,n,r,o);o(new Error("No fetch and no xhr implementation found!"))};function On(e){"@babel/helpers - typeof";return On=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},On(e)}function Ai(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function jo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ai(Object(n),!0).forEach(function(r){lu(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ai(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ib(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,cu(r.key),r)}}function Db(e,t,n){return t&&Ib(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function lu(e,t,n){return(t=cu(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cu(e){var t=Mb(e,"string");return On(t)=="symbol"?t:t+""}function Mb(e,t){if(On(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(On(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var _b=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:function(n){return JSON.parse(n)},stringify:JSON.stringify,parsePayload:function(n,r,o){return lu({},r,o||"")},parseLoadPayload:function(n,r){},request:Lb,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},uu=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Nb(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return Db(e,[{key:"init",value:function(n){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=n,this.options=jo(jo(jo({},_b()),this.options||{}),o),this.allOptions=a,this.services&&this.options.reloadInterval){var s=setInterval(function(){return r.reload()},this.options.reloadInterval);On(s)==="object"&&typeof s.unref=="function"&&s.unref()}}},{key:"readMulti",value:function(n,r,o){this._readAny(n,n,r,r,o)}},{key:"read",value:function(n,r,o){this._readAny([n],n,[r],r,o)}},{key:"_readAny",value:function(n,r,o,a,s){var i=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,o)),l=Cb(l),l.then(function(c){if(!c)return s(null,{});var u=Ei(c,{lng:n.join("+"),ns:o.join("+")});if(u==null){var f=n.map(Or).join(", "),p=o.map(Or).join(", ");return s(new Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=["+f+"] namespaces=["+p+"]"),!1)}i.loadUrl(u,s,r,a)})}},{key:"loadUrl",value:function(n,r,o,a){var s=this,i=typeof o=="string"?[o]:o,l=typeof a=="string"?[a]:a,c=this.options.parseLoadPayload(i,l),u=Or(Sb(n));this.options.request(this.options,n,c,function(f,p){if(p&&(p.status>=500&&p.status<600||!p.status))return r("failed loading "+u+"; status code: "+p.status,!0);if(p&&p.status>=400&&p.status<500)return r("failed loading "+u+"; status code: "+p.status,!1);if(!p&&f&&f.message){var d=f.message.toLowerCase(),y=["failed","fetch","network","load"].find(function(S){return d.indexOf(S)>-1});if(y)return r("failed loading "+u+": "+Or(f.message),!0)}if(f)return r(f,!1);var m,g;try{typeof p.data=="string"?m=s.options.parse(p.data,o,a):m=p.data}catch{g="failed parsing "+u+" to json"}if(g)return r(g,!1);r(null,m)})}},{key:"create",value:function(n,r,o,a,s){var i=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,o,a),c=0,u=[],f=[];n.forEach(function(p){var d=i.options.addPath;typeof i.options.addPath=="function"&&(d=i.options.addPath(p,r));var y=Ei(d,{lng:p,ns:r});if(y==null){c+=1,s&&c===n.length&&s(u,f);return}i.options.request(i.options,y,l,function(m,g){c+=1,u.push(m),f.push(g),c===n.length&&typeof s=="function"&&s(u,f)})})}}},{key:"reload",value:function(){var n=this,r=this.services,o=r.backendConnector,a=r.languageUtils,s=r.logger,i=o.language;if(!(i&&i.toLowerCase()==="cimode")){var l=[],c=function(f){var p=a.toResolveHierarchy(f);p.forEach(function(d){l.indexOf(d)<0&&l.push(d)})};c(i),this.allOptions.preload&&this.allOptions.preload.forEach(function(u){return c(u)}),l.forEach(function(u){n.allOptions.ns.forEach(function(f){o.read(u,f,"read",null,null,function(p,d){p&&s.warn("loading namespace ".concat(f," for language ").concat(u," failed"),p),!p&&d&&s.log("loaded namespace ".concat(f," for language ").concat(u),d),o.loaded("".concat(u,"|").concat(f),p,d)})})})}}}])}();uu.type="backend";const jb="Agim",Fb={refresh:"Refresh",save:"Save",cancel:"Cancel",delete:"Delete",edit:"Edit",submit:"Submit",close:"Close",back:"Back",next:"Next",previous:"Previous",create:"Create",search:"Search",retry:"Retry",confirm:"Confirm"},$b={loading:"Loading…",empty:"No data",saving:"Saving…",saved:"Saved",error:"Something went wrong"},Ub={label:"Theme",system:"System",light:"Light",dark:"Dark",cycleHint:"Click to cycle theme"},Hb={label:"Language",en:"English",zh:"中文"},Bb={chat:"Chat",tasks:"Tasks",approvals:"Approvals",reminders:"Reminders",memos:"Memos",memory:"Memory",skills:"Skills",workspace:"Workspace",observability:"Observability",settings:"Settings"},Vb={deleteTitle:"Delete this item?",deleteDescription:"This cannot be undone.",destructiveAction:"Delete"},zb={label:"Pagination",perPage:"Per page",firstPage:"First page",lastPage:"Last page",pageOfTotal:"Page {{page}} of {{totalPages}}",range:"{{from}}–{{to}} of {{total}}"},Wb={selectAll:"Select all rows",selectRow:"Select row"},Kb={intro:"Paste your access token from ~/.agim/tokens.json or `agim token list`.",tokenLabel:"Access token",submit:"Sign in",hint:"Loopback (127.0.0.1) requests bypass this page; you only land here from another host or with IMHUB_TRUST_LOOPBACK=off."},qb={placeholder:"Signed in. The chat surface ships in PR-6; this route is intentionally blank for now.",healthCheck:"Backend reachable"},Gb={title:"Nothing here.",description:"The page you're looking for doesn't exist."},Yb={title:"Something went wrong.",description:"An unexpected error broke the page render. Try reloading or heading back to the home screen; if it persists, copy the message below and report it.",reload:"Reload",home:"Home"},Qb={send:"Send",streaming:"… streaming",notConnected:"Not connected. Reconnecting…",connecting:"Connecting to agim…",disconnected:"Disconnected. Reconnecting automatically; you can keep typing.",welcomeTitle:"Start a conversation",welcomeBody:"Type a message to ask the active agent. Use the agent dropdown to switch.",inputPlaceholder:"Message… (Enter sends, Shift+Enter newlines)",newConv:"New",newConvHint:"Clear messages and start a fresh session",newConvToast:"Started a new conversation",approvalTitle:"🔐 Tool approval",approvalAutoBadge:"auto-allow",approvalAutoIn:"Auto-allowing in {{count}}s — Deny to stop.",approvalAutoResolving:"Auto-allowing now…",approvalToolLabel:"Tool",approvalInputLabel:"Input",approvalAllow:"Allow",approvalAuto:"Auto for similar",approvalAutoTip:"Allow and auto-allow similar calls for the rest of the session",approvalDeny:"Deny",outcome:{allowed:"✅ Allowed",allowedPinned:"✅ Allowed + auto-allow further",denied:"❌ Denied",deniedRevoked:"❌ Denied (auto-allow revoked)",expired:"⏱ Timed out"}},Xb={appName:jb,actions:Fb,states:$b,theme:Ub,lang:Hb,nav:Bb,confirm:Vb,pagination:zb,table:Wb,login:Kb,home:qb,notFound:Gb,errorBoundary:Yb,chat:Qb},Jb="Agim",Zb={refresh:"刷新",save:"保存",cancel:"取消",delete:"删除",edit:"编辑",submit:"提交",close:"关闭",back:"返回",next:"下一页",previous:"上一页",create:"新建",search:"搜索",retry:"重试",confirm:"确定"},ew={loading:"加载中…",empty:"暂无数据",saving:"保存中…",saved:"已保存",error:"出错了"},tw={label:"主题",system:"跟随系统",light:"浅色",dark:"深色",cycleHint:"点击切换主题"},nw={label:"语言",en:"English",zh:"中文"},rw={chat:"对话",tasks:"任务",approvals:"审批",reminders:"提醒",memos:"备忘",memory:"记忆",skills:"技能",workspace:"工作区",observability:"观测",settings:"设置"},ow={deleteTitle:"确认删除?",deleteDescription:"操作不可撤销。",destructiveAction:"删除"},aw={label:"分页",perPage:"每页",firstPage:"首页",lastPage:"末页",pageOfTotal:"第 {{page}} / {{totalPages}} 页",range:"{{from}}–{{to}} / 共 {{total}}"},sw={selectAll:"全选",selectRow:"选中此行"},iw={intro:"粘贴 ~/.agim/tokens.json 里的访问令牌(或运行 `agim token list` 查看)。",tokenLabel:"访问令牌",submit:"登录",hint:"loopback(127.0.0.1)的请求会跳过此页;只有跨机访问或设置了 IMHUB_TRUST_LOOPBACK=off 时才会看到此页。"},lw={placeholder:"已登录。聊天界面将在 PR-6 落地;当前页暂为占位。",healthCheck:"后端可达"},cw={title:"什么也没找到。",description:"你要找的页面不存在。"},uw={title:"出错了。",description:"页面渲染过程中遇到了未预期的错误。可以尝试刷新或返回主页;若问题反复出现,请复制下方错误信息反馈。",reload:"刷新",home:"返回主页"},dw={send:"发送",streaming:"… 接收中",notConnected:"未连接,正在重连…",connecting:"正在连接 agim…",disconnected:"已断开,自动重连中;可以继续输入。",welcomeTitle:"开始对话",welcomeBody:"输入消息向当前 Agent 提问。点上方下拉可切换 Agent。",inputPlaceholder:"输入消息……(Enter 发送,Shift+Enter 换行)",newConv:"新对话",newConvHint:"清空消息并开启新会话",newConvToast:"已开启新对话",approvalTitle:"🔐 工具授权",approvalAutoBadge:"自动放行",approvalAutoIn:"{{count}} 秒后自动放行 — 点「拒绝」可中止。",approvalAutoResolving:"正在自动放行…",approvalToolLabel:"工具",approvalInputLabel:"输入",approvalAllow:"批准",approvalAuto:"本类自动放行",approvalAutoTip:"批准并对本会话内同类调用自动放行",approvalDeny:"拒绝",outcome:{allowed:"✅ 已批准",allowedPinned:"✅ 已批准 · 后续同类自动放行",denied:"❌ 已拒绝",deniedRevoked:"❌ 已拒绝(撤销自动放行)",expired:"⏱ 已超时"}},fw={appName:Jb,actions:Zb,states:ew,theme:tw,lang:nw,nav:rw,confirm:ow,pagination:aw,table:sw,login:iw,home:lw,notFound:cw,errorBoundary:uw,chat:dw},hw="Couldn't reach the server. Check your connection and retry.",pw="Your session expired. Please sign in again.",mw="Sign-in required.",gw="Auth token missing from request.",vw="Auth subsystem isn't ready yet. Retry in a moment.",yw="You don't have permission to do that.",bw="The requested resource wasn't found.",ww="That request is too big — try splitting it.",xw="The server rejected the request: {{detail}}",Sw="Request body wasn't valid JSON.",Ew="Configuration didn't validate. Check the form fields.",Cw="Couldn't save configuration: {{detail}}",Rw="Send an `updates` object to change env values.",Pw="None of the keys you sent are editable.",Aw="SMTP isn't configured. Save host / user / password first.",Tw="SMTP verify failed: {{detail}}",Ow="Provide a baseUrl to discover ACP agents.",kw="Provide an `endpoint` to test the agent.",Lw="ACP discovery failed: {{detail}}",Nw="ACP agent test failed: {{detail}}",Iw="A user_key (platform:userId) is required.",Dw="Something went wrong (code {{code}}).",Mw="Bad request.",_w="Sign-in required.",jw="Forbidden.",Fw="Not found.",$w="Conflict — refresh and try again.",Uw="Request too large.",Hw="Server error.",Bw="Gateway error.",Vw="Service unavailable.",zw="Gateway timeout.",Ww={NETWORK:hw,AUTH_INVALID:pw,AUTH_REQUIRED:mw,AUTH_TOKEN_REQUIRED:gw,AUTH_NOT_READY:vw,FORBIDDEN:yw,NOT_FOUND:bw,PAYLOAD_TOO_LARGE:ww,VALIDATION:xw,INVALID_JSON_BODY:Sw,CONFIG_INVALID:Ew,CONFIG_SAVE_FAILED:Cw,ENV_UPDATES_REQUIRED:Rw,ENV_NO_EDITABLE_KEYS:Pw,EMAIL_NOT_CONFIGURED:Aw,EMAIL_VERIFY_FAILED:Tw,ACP_BASEURL_REQUIRED:Ow,ACP_ENDPOINT_REQUIRED:kw,ACP_DISCOVER_FAILED:Lw,ACP_TEST_FAILED:Nw,MEMORY_USER_KEY_REQUIRED:Iw,UNKNOWN:Dw,HTTP_400:Mw,HTTP_401:_w,HTTP_403:jw,HTTP_404:Fw,HTTP_409:$w,HTTP_413:Uw,HTTP_500:Hw,HTTP_502:Bw,HTTP_503:Vw,HTTP_504:zw},Kw="无法访问服务器,请检查网络后重试。",qw="登录状态已过期,请重新登录。",Gw="请先登录。",Yw="请求缺少 auth token。",Qw="鉴权子系统尚未就绪,请稍后重试。",Xw="没有执行该操作的权限。",Jw="请求的资源不存在。",Zw="请求体过大,请拆分后重试。",ex="服务端拒绝了请求:{{detail}}",tx="请求体不是合法的 JSON。",nx="配置校验失败,请检查表单字段。",rx="保存配置失败:{{detail}}",ox="请在请求体中提供 `updates` 对象以修改 env。",ax="请求里的 key 均不可编辑。",sx="SMTP 未配置,请先保存 host / user / password。",ix="SMTP 连接测试失败:{{detail}}",lx="需要 baseUrl 才能发现 ACP Agent。",cx="需要 `endpoint` 才能测试该 Agent。",ux="ACP 发现失败:{{detail}}",dx="ACP Agent 测试失败:{{detail}}",fx="需要 user_key(形如 `platform:userId`)。",hx="出错了 (code {{code}})。",px="请求格式不正确。",mx="请先登录。",gx="没有权限。",vx="未找到。",yx="状态冲突,请刷新后重试。",bx="请求体过大。",wx="服务端出错。",xx="网关错误。",Sx="服务暂不可用。",Ex="网关超时。",Cx={NETWORK:Kw,AUTH_INVALID:qw,AUTH_REQUIRED:Gw,AUTH_TOKEN_REQUIRED:Yw,AUTH_NOT_READY:Qw,FORBIDDEN:Xw,NOT_FOUND:Jw,PAYLOAD_TOO_LARGE:Zw,VALIDATION:ex,INVALID_JSON_BODY:tx,CONFIG_INVALID:nx,CONFIG_SAVE_FAILED:rx,ENV_UPDATES_REQUIRED:ox,ENV_NO_EDITABLE_KEYS:ax,EMAIL_NOT_CONFIGURED:sx,EMAIL_VERIFY_FAILED:ix,ACP_BASEURL_REQUIRED:lx,ACP_ENDPOINT_REQUIRED:cx,ACP_DISCOVER_FAILED:ux,ACP_TEST_FAILED:dx,MEMORY_USER_KEY_REQUIRED:fx,UNKNOWN:hx,HTTP_400:px,HTTP_401:mx,HTTP_403:gx,HTTP_404:vx,HTTP_409:yx,HTTP_413:bx,HTTP_500:wx,HTTP_502:xx,HTTP_503:Sx,HTTP_504:Ex},Rx="Tasks",Px={jobs:"Jobs",subtasks:"Subtasks",bgjobs:"Background",schedules:"Schedules",outbox:"Outbox",a2a:"Agent ↔ Agent"},Ax={title:"Jobs",subtitle:"Long-running agent invocations and their results.",empty:{title:"No jobs yet",description:"Jobs are created when an agent runs in async mode — via `agim --invoke` or an inline /run command from chat."},filter:{status:"Status",statusAny:"Any status",agent:"Agent",agentAny:"Any agent",kind:"Kind",kindAny:"Any kind"},col:{id:"ID",agent:"Agent",prompt:"Prompt",status:"Status",createdAt:"Created",duration:"Duration",cost:"Cost"},status:{pending:"Pending",running:"Running",completed:"Completed",delivered:"Delivered",failed:"Failed",cancelled:"Cancelled",interrupted:"Interrupted",replaced:"Replaced",abandoned:"Abandoned"},kind:{job:"Job",inline:"Inline"},stats:{pending:"Pending",running:"Running",completed:"Completed",failed:"Failed"},batch:{selected:"{{count}} selected",cancel:"Cancel selected",rerun:"Re-run selected",confirmCancel:"Cancel {{count}} job(s)?",confirmCancelDesc:"Running jobs will be sent a stop signal. Already-completed jobs are unaffected.",confirmRerun:"Re-run {{count}} job(s)?",confirmRerunDesc:"New jobs will be created from the original prompts."},live:{connected:"● Live",connecting:"● Connecting",reconnecting:"● Reconnecting",closed:"● Offline"}},Tx={title:"Subtasks",subtitle:"Per-conversation child tasks spawned by the parent agent.",empty:{title:"No subtasks yet",description:"Subtasks appear when an agent dispatches work to another agent inside a chat thread."},filter:{agent:"Parent agent",agentAny:"Any agent"},col:{id:"ID",agent:"Agent",prompt:"Prompt",status:"Status",parent:"Parent",platform:"Platform",createdAt:"Created"},status:{pending:"Pending",running:"Running",completed:"Completed",failed:"Failed",cancelled:"Cancelled"}},Ox={title:"Background jobs",subtitle:"Long-running scripts the agent wrappers (Claude Code / opencode / codex) launched via bgjob.",empty:{title:"No background jobs",description:"Background jobs show up here once an agent has used its bgjob wrapper. Roots come from ~/.claude/bgjobs/, ~/.config/opencode/bgjobs/, ~/.codex/bgjobs/ (override via IMHUB_BGJOB_ROOTS)."},filter:{root:"Root",rootAny:"All roots"},col:{name:"Name",status:"Status",root:"Root",pid:"PID",startedAt:"Started",endedAt:"Ended",exit:"Exit"},exitOk:"ok",stillRunning:"—"},kx={title:"Schedules",subtitle:"Cron-style triggers that re-invoke an agent with a fixed prompt.",empty:{title:"No schedules configured",description:"Create a schedule from the agent's chat via `/cron set` or by running `agim cron create` in the CLI."},filter:{agent:"Agent",agentAny:"Any agent"},col:{id:"ID",name:"Name",agent:"Agent",cron:"Cron",prompt:"Prompt",enabled:"Enabled",nextRun:"Next run",lastRun:"Last run"},enabled:"On",disabled:"Off"},Lx={title:"Outbox",subtitle:"Pending IM-platform deliveries. The crash-safe queue retries on transient failures and parks unrecoverable ones in `giving_up`.",empty:{title:"Outbox is empty",description:"Messages move through the queue and are deleted on successful delivery. A non-empty outbox here means the queue is actively flushing or a delivery is stuck."},filter:{status:"Status",statusAny:"Any status",thread:"Thread key"},stats:{pending:"Pending",giving_up:"Giving up",delivered:"Delivered (lifetime)",lastDelivered:"Last delivery"},col:{id:"ID",status:"Status",platform:"Platform",preview:"Preview",thread:"Thread",kind:"Kind",attempts:"Attempts",createdAt:"Created",lastError:"Last error",jobId:"Job"},status:{pending:"Pending",delivered:"Delivered",giving_up:"Giving up"},action:{retry:"Retry",confirmRetry:"Re-queue this delivery?",confirmRetryDesc:"The row's status flips back to pending and the sender will attempt delivery again on the next tick."}},Nx={title:"Agent ↔ Agent",subtitle:"Recent inline jobs spawned with a parent (one agent invoking another).",empty:{title:"No agent-to-agent calls yet",description:"Inline a2a calls appear here once an agent uses the `agim --invoke` tool with a parent context."},stats:{total:"Total",recent24h:"Last 24h",maxDepth:"Max depth"},col:{id:"ID",agent:"Agent",parent:"Parent",depth:"Depth",status:"Status",prompt:"Prompt",createdAt:"Created"}},Ix={pageTitle:Rx,subnav:Px,jobs:Ax,subtasks:Tx,bgjobs:Ox,schedules:kx,outbox:Lx,a2a:Nx},Dx="任务",Mx={jobs:"作业",subtasks:"子任务",bgjobs:"后台脚本",schedules:"定时任务",outbox:"投递队列",a2a:"Agent 互调"},_x={title:"作业",subtitle:"Agent 的长任务调用与结果。",empty:{title:"暂无作业",description:"通过 `agim --invoke` 或聊天里的 /run 命令异步启动 Agent 时会自动生成作业记录。"},filter:{status:"状态",statusAny:"全部状态",agent:"Agent",agentAny:"全部 Agent",kind:"类型",kindAny:"全部类型"},col:{id:"ID",agent:"Agent",prompt:"Prompt",status:"状态",createdAt:"创建时间",duration:"耗时",cost:"成本"},status:{pending:"等待中",running:"运行中",completed:"已完成",delivered:"已送达",failed:"失败",cancelled:"已取消",interrupted:"已中断",replaced:"已替换",abandoned:"已放弃"},kind:{job:"作业",inline:"即时"},stats:{pending:"等待中",running:"运行中",completed:"已完成",failed:"失败"},batch:{selected:"已选 {{count}} 项",cancel:"取消所选",rerun:"重跑所选",confirmCancel:"确认取消 {{count}} 个作业?",confirmCancelDesc:"运行中的作业会收到停止信号。已完成的作业不受影响。",confirmRerun:"确认重跑 {{count}} 个作业?",confirmRerunDesc:"将根据原 Prompt 重新创建作业。"},live:{connected:"● 实时",connecting:"● 连接中",reconnecting:"● 重连中",closed:"● 离线"}},jx={title:"子任务",subtitle:"由父 Agent 在对话内派发出的子任务列表。",empty:{title:"暂无子任务",description:"当 Agent 在聊天线程内向其他 Agent 委派工作时,子任务会出现在这里。"},filter:{agent:"父 Agent",agentAny:"全部 Agent"},col:{id:"ID",agent:"Agent",prompt:"Prompt",status:"状态",parent:"父级",platform:"平台",createdAt:"创建时间"},status:{pending:"等待中",running:"运行中",completed:"已完成",failed:"失败",cancelled:"已取消"}},Fx={title:"后台脚本",subtitle:"Agent 封装(Claude Code / opencode / codex)通过 bgjob 启动的长任务进程。",empty:{title:"暂无后台脚本",description:"当 Agent 使用其 bgjob 封装时,记录会在这里出现。Root 路径默认取 ~/.claude/bgjobs/、~/.config/opencode/bgjobs/、~/.codex/bgjobs/(可通过 IMHUB_BGJOB_ROOTS 覆盖)。"},filter:{root:"Root",rootAny:"全部 Root"},col:{name:"名称",status:"状态",root:"Root",pid:"PID",startedAt:"开始时间",endedAt:"结束时间",exit:"退出码"},exitOk:"ok",stillRunning:"—"},$x={title:"定时任务",subtitle:"Cron 触发的 Agent 调用 — 按固定 Prompt 重新执行。",empty:{title:"暂无定时任务",description:"可在聊天中通过 `/cron set` 或 CLI `agim cron create` 创建定时任务。"},filter:{agent:"Agent",agentAny:"全部 Agent"},col:{id:"ID",name:"名称",agent:"Agent",cron:"Cron",prompt:"Prompt",enabled:"启用",nextRun:"下次运行",lastRun:"上次运行"},enabled:"开",disabled:"关"},Ux={title:"投递队列",subtitle:"面向 IM 平台的待投递消息队列。瞬态失败会自动重试;不可恢复的会停在 giving_up。",empty:{title:"投递队列为空",description:"消息成功投递后会被删除。如果这里非空,说明队列正在刷出消息,或某条消息卡住了。"},filter:{status:"状态",statusAny:"全部状态",thread:"Thread 标识"},stats:{pending:"待发送",giving_up:"放弃中",delivered:"已投递(累计)",lastDelivered:"最近投递"},col:{id:"ID",status:"状态",platform:"平台",preview:"内容",thread:"Thread",kind:"类型",attempts:"尝试次数",createdAt:"创建时间",lastError:"最后错误",jobId:"Job"},status:{pending:"待发送",delivered:"已投递",giving_up:"放弃中"},action:{retry:"重试",confirmRetry:"重新入队这条投递?",confirmRetryDesc:"状态会切回 pending,发送器会在下一轮 tick 再次尝试投递。"}},Hx={title:"Agent 互调",subtitle:"带父级 ID 的最近 inline 作业(一个 Agent 调用另一个 Agent 的记录)。",empty:{title:"暂无 Agent 互调记录",description:"当某 Agent 使用 `agim --invoke` 工具并带上父级上下文时,这里会出现 inline a2a 调用记录。"},stats:{total:"累计",recent24h:"近 24 小时",maxDepth:"最大深度"},col:{id:"ID",agent:"Agent",parent:"父级",depth:"深度",status:"状态",prompt:"Prompt",createdAt:"创建时间"}},Bx={pageTitle:Dx,subnav:Mx,jobs:_x,subtasks:jx,bgjobs:Fx,schedules:$x,outbox:Ux,a2a:Hx},Vx="Approvals",zx="Pending tool invocations the agent is asking permission for.",Wx={connected:"● Live",connecting:"● Connecting",reconnecting:"● Reconnecting",closed:"● Offline"},Kx={pending:"Pending",totalAllowed:"Total allowed",totalDenied:"Total denied",totalTimedOut:"Timed out",totalReadonly:"Read-only auto-allowed"},qx={title:"No approvals waiting",description:"The queue is empty. Tool requests show up here when an agent calls a tool that's not on its allow-list yet."},Gx="Thread",Yx="auto-allow",Qx="Backend auto-allowed this read-only tool; the card is shown for visibility only.",Xx="Allow",Jx="Deny",Zx={allowedShort:"Allowed",deniedShort:"Denied"},e0={pageTitle:Vx,subtitle:zx,live:Wx,stats:Kx,empty:qx,threadLabel:Gx,autoAllowedTag:Yx,autoAllowedTitle:Qx,allow:Xx,deny:Jx,toast:Zx},t0="审批",n0="Agent 等待批准的工具调用。",r0={connected:"● 实时",connecting:"● 连接中",reconnecting:"● 重连中",closed:"● 离线"},o0={pending:"待审批",totalAllowed:"累计放行",totalDenied:"累计拒绝",totalTimedOut:"超时",totalReadonly:"只读自动放行"},a0={title:"暂无待审批请求",description:"队列为空。当 Agent 调用尚未加入白名单的工具时,请求会在这里出现。"},s0="Thread",i0="自动放行",l0="后端已对该只读工具自动放行;此处仅供可见性展示。",c0="放行",u0="拒绝",d0={allowedShort:"已放行",deniedShort:"已拒绝"},f0={pageTitle:t0,subtitle:n0,live:r0,stats:o0,empty:a0,threadLabel:s0,autoAllowedTag:i0,autoAllowedTitle:l0,allow:c0,deny:u0,toast:d0},h0="Reminders",p0="Queued reminders waiting to fire. Cancel or snooze pending ones; fired and cancelled rows are kept for audit.",m0={status:"Status",statusAny:"Any status"},g0={pending:"Pending",firing:"Firing",fired:"Fired",cancelled:"Cancelled",failed:"Failed"},v0={slash:"/remind",mcp:"MCP",api:"API"},y0={literal:"Literal",llm:"LLM"},b0={title:"Nothing scheduled",description:"Reminders show up here once an agent (via /remind, MCP, or API) queues one. Filter by status to see fired or cancelled ones."},w0={id:"ID",fireAt:"Fires",text:"Text",status:"Status",platform:"Platform",thread:"Thread",source:"Source",recurrence:"Recurrence",createdAt:"Created"},x0={cancel:"Cancel",snooze:"Snooze",confirmCancel:"Cancel this reminder?",confirmCancelDesc:"The reminder is removed from the queue. Recurring reminders won't fire again unless re-created."},S0={title:"Snooze reminder",description:"How long should it be pushed back?",preset5m:"5 minutes",preset30m:"30 minutes",preset1h:"1 hour",preset1d:"1 day",submit:"Snooze",toastOk:"Snoozed for {{duration}}"},E0={cancelled:"Reminder cancelled"},C0={pageTitle:h0,subtitle:p0,filter:m0,status:g0,source:v0,promptMode:y0,empty:b0,col:w0,action:x0,snooze:S0,toast:E0},R0="提醒",P0="排队待触发的提醒。可对 pending 的提醒做取消 / 延后;已触发与已取消的记录保留以备审计。",A0={status:"状态",statusAny:"全部状态"},T0={pending:"等待中",firing:"触发中",fired:"已触发",cancelled:"已取消",failed:"失败"},O0={slash:"/remind",mcp:"MCP",api:"API"},k0={literal:"原文",llm:"LLM"},L0={title:"暂无提醒",description:"当 Agent 通过 /remind、MCP 或 API 创建提醒时,记录会出现在这里。可切换状态查看已触发或已取消的记录。"},N0={id:"ID",fireAt:"触发时间",text:"内容",status:"状态",platform:"平台",thread:"Thread",source:"来源",recurrence:"周期",createdAt:"创建时间"},I0={cancel:"取消",snooze:"延后",confirmCancel:"确认取消这条提醒?",confirmCancelDesc:"该提醒会被移出队列。周期提醒在未重新创建前不会再触发。"},D0={title:"延后提醒",description:"延后多久?",preset5m:"5 分钟",preset30m:"30 分钟",preset1h:"1 小时",preset1d:"1 天",submit:"确认延后",toastOk:"已延后 {{duration}}"},M0={cancelled:"已取消"},_0={pageTitle:R0,subtitle:P0,filter:A0,status:T0,source:O0,promptMode:k0,empty:L0,col:N0,action:I0,snooze:D0,toast:M0},j0="Memos",F0="Long-term notes the operator captured for the agent — searchable by content, person, or location.",$0={placeholder:"Search memos…",who:"Who",what:"What",hasLocation:"Has location",includeExpired:"Include expired"},U0={title:"No memos match",description:"Memos are created from chat via `/memo` or auto-extracted by the memory subsystem. Try clearing filters or widening the search."},H0={id:"ID",what:"What",who:"Who",when:"When",where:"Where",platform:"Platform",createdAt:"Created",expiresAt:"Expires"},B0={delete:"Delete",confirmDelete:"Delete this memo?",confirmDeleteDesc:"This cannot be undone. The memory subsystem still has any embeddings derived from this memo until a backfill prune lands."},V0={label:"Open map",baidu:"Baidu Maps",apple:"Apple Maps",google:"Google Maps",osm:"OpenStreetMap"},z0={deleted:"Memo deleted"},W0={pageTitle:j0,subtitle:F0,search:$0,empty:U0,col:H0,action:B0,openMap:V0,toast:z0},K0="备忘",q0="操作员为 Agent 记下的长期备忘 — 可按内容、人物、地点检索。",G0={placeholder:"搜索备忘…",who:"谁",what:"做什么",hasLocation:"含位置",includeExpired:"包含过期"},Y0={title:"未匹配到备忘",description:"备忘通过聊天中的 `/memo` 命令或记忆子系统自动抽取生成。可清空筛选或放宽搜索条件再试。"},Q0={id:"ID",what:"事项",who:"对象",when:"时间",where:"地点",platform:"平台",createdAt:"创建时间",expiresAt:"过期时间"},X0={delete:"删除",confirmDelete:"确认删除此备忘?",confirmDeleteDesc:"操作不可撤销。记忆子系统中由此备忘衍生的 embedding 在下一次 backfill 清理前仍会保留。"},J0={label:"在地图中打开",baidu:"百度地图",apple:"Apple 地图",google:"Google 地图",osm:"OpenStreetMap"},Z0={deleted:"已删除"},eS={pageTitle:K0,subtitle:q0,search:G0,empty:Y0,col:Q0,action:X0,openMap:J0,toast:Z0},tS="Memory",nS="Per-user facts the agent has accumulated. Long-term memory that survives session resets.",rS={label:"User",placeholder:"Pick a user",factsLabel:"{{count}} facts",personaTag:"persona"},oS={title:"Pick a user to view their memory",description:"Memory is partitioned per user_key (platform:userId). The dropdown above lists every user whose memory has any rows in the bank."},aS={facts:"Facts",persona:"Persona",vector:"Vector",skills:"Skills"},sS={title:"Facts",empty:{title:"No facts yet",description:"Facts accumulate as the agent extracts them from chat history during memory consolidation. Triggering `/memory consolidate` from chat (or the Persona tab's button when it lands) seeds this list."},filter:{search:"Search",category:"Category",categoryAny:"Any category"},category:{fact:"Fact",preference:"Preference",goal:"Goal",history:"History",profile:"Profile"},col:{id:"ID",what:"What",category:"Category",confidence:"Confidence",source:"Source",createdAt:"Created"},batch:{selected:"{{count}} selected",deleteSelected:"Delete selected",confirmDelete:"Delete {{count}} fact(s)?",confirmDeleteDesc:"This removes the rows from the bank. The vector index keeps any embedding derived from these rows until the next backfill prune."},action:{delete:"Delete",confirmDelete:"Delete this fact?",confirmDeleteDesc:"This row is removed permanently. The vector index retains its embedding until the next backfill prune."},toast:{deletedOne:"Fact deleted",deletedMany:"Deleted {{count}} facts"}},iS={title:"Persona",subtitle:"Long-form summary of who this user is, refined by periodic consolidation of their facts.",empty:{title:"No persona yet",description:"Personas are written by the consolidation pass — run it from the button below once enough facts have accumulated."},updated:"Updated {{at}}",editorLabel:"Persona summary",save:"Save",saved:"Saved",delete:"Delete persona",confirmDelete:"Delete this persona?",confirmDeleteDesc:"The persona summary is removed from the bank. Facts the persona was derived from stay in place; the next consolidate pass will rewrite a fresh one.",consolidate:{trigger:"Run consolidation",triggering:"Starting…",running:"Consolidation running…",doneOk:"Consolidation complete",doneFailed:"Consolidation failed",lastRun:"Last run {{at}}",result:"Processed {{users}} user(s), {{updated}} persona(s) updated"}},lS={title:"Vector backend",subtitle:"Embeddings power hybrid recall on memory facts. The active backend, model, and per-user coverage live here.",config:{title:"Backend configuration",hint:"Backend selection + OpenAI / local-model parameters live in env. Edit `~/.agim/env` on the host (or set systemd `Environment=`); the `IMHUB_MEMORY_VECTOR_*` keys are listed below.",editLink:"env file"},form:{title:"Backend configuration",hint:"Pick a backend, fill in the parameters, then save & test. Changes hit the env file and reload in-process; a restart re-reads them.",dirty:"Unsaved changes",discard:"Discard",saveAndTest:"Save & test",savedToast:"Saved — running test…",nothingChanged:"Nothing to save",backend:"Backend",backendHelp:"off = vector recall disabled; local = on-device BGE; openai = OpenAI-compatible remote endpoint",backendOff:"Off",backendLocal:"Local (BGE)",backendOpenai:"OpenAI-compatible",localModel:"Local model",localModelHelp:"Xenova model id, defaults to Xenova/bge-base-zh-v1.5. First-time use needs a manual download.",openaiBaseUrl:"Base URL",openaiBaseUrlHelp:"OpenAI-compatible endpoint root, e.g. https://api.openai.com/v1 or your self-hosted gateway.",openaiModel:"Model",openaiModelHelp:"Embedding model id, defaults to text-embedding-3-small. Match your provider's docs for other endpoints.",openaiApiKey:"API key",apiKeyKeepHint:"Leave blank to keep the existing key (placeholder shows the masked value); typing replaces it.",apiKeyNewHint:"Paste your OpenAI-compatible API key (only the server sees the raw value after save).",toggleApiKey:"Show / hide API key",batchSize:"Batch size",batchSizeHelp:"Max texts per embed call, 1–1024 (default 32).",hybridWeight:"Hybrid weight",hybridWeightHelp:"Vector branch weight when fusing with FTS5 recall, 0–1 (default 0.5).",errors:{baseUrlRequired:"Base URL is required",baseUrlInvalid:"Base URL is not a valid URL",openaiModelRequired:"Embedding model id is required",apiKeyRequired:"API key is required for the OpenAI backend on first setup",localModelRequired:"Local model id is required",batchSizeRange:"Batch size must be between 1 and 1024",hybridWeightRange:"Hybrid weight must be between 0 and 1"}},backendLabel:"Backend",modelLabel:"Model",dimsLabel:"Dimensions",readyTrue:"Ready",readyFalse:"Not ready",downloadedTrue:"Files on disk",lastError:"Last error",coverage:{title:"Coverage",total:"Facts",withEmbedding:"Embedded",withDifferentModel:"Mismatched model",scope_user:"for {{userKey}}",scope_global:"across every user"},actions:{title:"Maintenance",test:"Test",testOk:"Backend test OK",testFail:"Backend test failed: {{detail}}",download:"Download model",downloadStarted:"Download started",downloadAlreadyReady:"Model is already ready",backfill:"Backfill embeddings",backfillStarted:"Backfill started",backfillNotReady:"Backend not ready — run download first",clear:"Clear embeddings",clearStarted:"Cleared {{count}} embedding(s)",confirmClear:"Clear all embeddings?",confirmClearDesc:"Drops the embedding column for {{scope}}. Facts themselves stay; you'll need to backfill again before vector recall works."},jobs:{title:"Recent jobs",empty:"No recent jobs",phase:{running:"Running",done:"Done",failed:"Failed"}}},cS={title:"Skills",subtitle:"SKILL.md files the host agents pick up from ~/.claude/skills/ + ~/.config/opencode/skills/.",empty:{title:"No skills installed",description:"Drop a SKILL.md (with `name` and `description` frontmatter) under one of the configured roots and refresh."},filter:{search:"Search",category:"Category",categoryAny:"All categories"},sources:{title:"Source directories",claude:"Claude Code",opencode:"opencode"},agentTag:{claude:"claude",opencode:"opencode"},detail:{loading:"Loading SKILL.md…",loadFailed:"Failed to load skill detail",metadataLabel:"Metadata",agentsLabel:"Available to"}},uS={pageTitle:tS,subtitle:nS,userPicker:rS,noUserSelected:oS,tabs:aS,facts:sS,persona:iS,vector:lS,skills:cS},dS="记忆",fS="Agent 为每个用户积累的事实库。跨会话保留的长期记忆。",hS={label:"用户",placeholder:"选择一个用户",factsLabel:"{{count}} 条事实",personaTag:"persona"},pS={title:"选择一个用户查看其记忆",description:"记忆按 user_key(platform:userId)分隔。上方下拉列出每位在库中有任何记忆数据的用户。"},mS={facts:"事实",persona:"Persona",vector:"向量",skills:"技能"},gS={title:"事实",empty:{title:"暂无事实",description:"Agent 在记忆整理过程中会从聊天历史中抽取事实。可在聊天里运行 `/memory consolidate` 或后续 Persona 子页内的按钮触发整理。"},filter:{search:"搜索",category:"类别",categoryAny:"全部类别"},category:{fact:"事实",preference:"偏好",goal:"目标",history:"历史",profile:"档案"},col:{id:"ID",what:"内容",category:"类别",confidence:"置信度",source:"来源",createdAt:"创建时间"},batch:{selected:"已选 {{count}} 项",deleteSelected:"删除所选",confirmDelete:"确认删除 {{count}} 条事实?",confirmDeleteDesc:"记忆库中的这些行将被删除。向量索引中相应的 embedding 在下一次 backfill 清理前仍会保留。"},action:{delete:"删除",confirmDelete:"确认删除此事实?",confirmDeleteDesc:"该行被永久删除。向量索引会在下一次 backfill 清理前保留对应 embedding。"},toast:{deletedOne:"已删除",deletedMany:"已删除 {{count}} 条"}},vS={title:"Persona",subtitle:"该用户的长篇画像,由记忆整理任务从事实库中提炼。",empty:{title:"暂无 Persona",description:"Persona 由整理任务生成。当事实积累到一定量后,点击下方按钮运行整理。"},updated:"更新于 {{at}}",editorLabel:"Persona 内容",save:"保存",saved:"已保存",delete:"删除 Persona",confirmDelete:"确认删除此 Persona?",confirmDeleteDesc:"Persona 概要会从库中删除。生成它的事实仍保留,下一次整理会重新生成。",consolidate:{trigger:"运行整理",triggering:"启动中…",running:"整理进行中…",doneOk:"整理完成",doneFailed:"整理失败",lastRun:"上次运行:{{at}}",result:"处理 {{users}} 位用户,更新 {{updated}} 条 Persona"}},yS={title:"向量后端",subtitle:"Embedding 驱动事实库的混合检索。当前后端、模型与每位用户的覆盖情况都在这里。",config:{title:"后端配置",hint:"后端选择与 OpenAI / 本地模型的参数都通过环境变量配置。请在宿主机直接编辑 `~/.agim/env`(或 systemd unit 的 `Environment=`),下方列出的 `IMHUB_MEMORY_VECTOR_*` 系列 key 即对应字段。",editLink:"env file"},form:{title:"后端配置",hint:"选好后端、填好参数 → 保存并测试。配置只对本进程生效,重启服务后从 env 文件重新加载。",dirty:"有未保存的改动",discard:"放弃改动",saveAndTest:"保存并测试",savedToast:"已保存,正在测试…",nothingChanged:"没有需要保存的改动",backend:"后端",backendHelp:"off = 关闭向量召回;local = 本地 BGE 模型;openai = 调远程 OpenAI 协议端点",backendOff:"关闭",backendLocal:"本地(BGE)",backendOpenai:"OpenAI 协议远程",localModel:"本地模型",localModelHelp:"Xenova 仓库的 model id,默认 Xenova/bge-base-zh-v1.5;首次使用需手动触发下载。",openaiBaseUrl:"Base URL",openaiBaseUrlHelp:"OpenAI 兼容端点根路径,例如 https://api.openai.com/v1 或自部署网关。",openaiModel:"模型",openaiModelHelp:"Embedding 模型 id,默认 text-embedding-3-small;用其他兼容端点请按其文档填写。",openaiApiKey:"API Key",apiKeyKeepHint:"留空 = 保留当前 key(占位显示为脱敏值);填了就会覆盖。",apiKeyNewHint:"粘贴你的 OpenAI 兼容 API Key(保存后只在服务端可见)。",toggleApiKey:"显示 / 隐藏 API Key",batchSize:"批大小",batchSizeHelp:"单次嵌入的最大文本数,1–1024,默认 32。",hybridWeight:"混合权重",hybridWeightHelp:"FTS5 与向量召回融合时向量分支的权重,0–1,默认 0.5。",errors:{baseUrlRequired:"Base URL 不能为空",baseUrlInvalid:"Base URL 不是合法 URL",openaiModelRequired:"Embedding 模型 id 不能为空",apiKeyRequired:"首次使用 OpenAI 后端需要填 API Key",localModelRequired:"本地模型 id 不能为空",batchSizeRange:"批大小需在 1–1024 之间",hybridWeightRange:"混合权重需在 0–1 之间"}},backendLabel:"后端",modelLabel:"模型",dimsLabel:"维度",readyTrue:"就绪",readyFalse:"未就绪",downloadedTrue:"已下载",lastError:"最近错误",coverage:{title:"覆盖率",total:"事实总数",withEmbedding:"已嵌入",withDifferentModel:"模型不匹配",scope_user:"(针对 {{userKey}})",scope_global:"(全部用户)"},actions:{title:"维护",test:"测试",testOk:"后端测试通过",testFail:"后端测试失败:{{detail}}",download:"下载模型",downloadStarted:"下载已开始",downloadAlreadyReady:"模型已就绪",backfill:"回填 embedding",backfillStarted:"回填已开始",backfillNotReady:"后端未就绪 — 请先下载",clear:"清空 embedding",clearStarted:"已清空 {{count}} 条",confirmClear:"确认清空全部 embedding?",confirmClearDesc:"会丢弃 {{scope}} 的 embedding 列。事实本身保留;下次回填前向量检索不可用。"},jobs:{title:"近期任务",empty:"暂无任务",phase:{running:"运行中",done:"完成",failed:"失败"}}},bS={title:"技能",subtitle:"宿主 Agent 从 ~/.claude/skills/ + ~/.config/opencode/skills/ 中识别的 SKILL.md 文件。",empty:{title:"暂无技能",description:"在已配置的 root 目录下放一个带 `name` + `description` frontmatter 的 SKILL.md,然后刷新。"},filter:{search:"搜索",category:"类别",categoryAny:"全部类别"},sources:{title:"源目录",claude:"Claude Code",opencode:"opencode"},agentTag:{claude:"claude",opencode:"opencode"},detail:{loading:"正在加载 SKILL.md…",loadFailed:"加载技能详情失败",metadataLabel:"元数据",agentsLabel:"可用于"}},wS={pageTitle:dS,subtitle:fS,userPicker:hS,noUserSelected:pS,tabs:mS,facts:gS,persona:vS,vector:yS,skills:bS},xS="Skills",SS={installed:"Installed",hot:"Hot on skillhub.cn"},ES={title:"Installed skills",subtitle:"SKILL.md files the host agents pick up from ~/.claude/skills/ + ~/.config/opencode/skills/.",empty:{title:"No skills",description:"Drop a SKILL.md with `name` + `description` frontmatter under a configured root and refresh."},filter:{search:"Search",category:"Category",categoryAny:"Any category"},sources:{title:"Sources",claude:"Claude Code",opencode:"opencode"},agentTag:{claude:"claude",opencode:"opencode"},detail:{loading:"Loading SKILL.md…",loadFailed:"Failed to load skill detail",metadataLabel:"Metadata",agentsLabel:"Picked up by"}},CS={title:"Hot on skillhub.cn",subtitle:"Live top entries from skillhub.cn (cached 5 min on the server). Click a row for the install commands. agim never auto-runs installs — you copy the command and paste into shell or IM.",openHub:"Open skillhub.cn",loading:"Loading…",empty:"No data",cached:"cache hit",stale:"upstream unreachable — serving stale",updatedAt:"updated {{at}}",col:{slug:"slug",name:"Name / description",stars:"stars",installs:"installs"},detail:{version:"Version",category:"Category",stars:"Stars",installs:"Installs",downloads:"Downloads",howInstall:"How to install (pick one; agim never auto-runs)",copy:"Copy",copied:"Copied",label:{cliInstall:"On host (recommended)",cliSearch:"Dry-run first",imAsk:"Ask an IM agent"},hint:"The two CLI commands need skillhub CLI installed on the host first. See docs/skills.md or skillhub.cn."}},RS={pageTitle:xS,subnav:SS,installed:ES,hot:CS},PS="技能",AS={installed:"已安装",hot:"skillhub.cn 热门"},TS={title:"已安装的技能",subtitle:"宿主 Agent 从 ~/.claude/skills/ + ~/.config/opencode/skills/ 中识别的 SKILL.md 文件。",empty:{title:"暂无技能",description:"在已配置的 root 目录下放一个带 `name` + `description` frontmatter 的 SKILL.md,然后刷新。"},filter:{search:"搜索",category:"类别",categoryAny:"全部类别"},sources:{title:"源目录",claude:"Claude Code",opencode:"opencode"},agentTag:{claude:"claude",opencode:"opencode"},detail:{loading:"正在加载 SKILL.md…",loadFailed:"加载技能详情失败",metadataLabel:"元数据",agentsLabel:"可用于"}},OS={title:"skillhub.cn 热门",subtitle:"实时拉取 skillhub.cn 热门下载(服务端 5 分钟缓存)。点击任意条目查看安装命令。agim 不会自动跑安装——命令复制后由你贴去 shell 或 IM 触发。",openHub:"前往 skillhub.cn",loading:"正在加载…",empty:"暂无数据",cached:"缓存命中",stale:"上游不可达,使用旧数据",updatedAt:"更新于 {{at}}",col:{slug:"slug",name:"名称 / 描述",stars:"stars",installs:"installs"},detail:{version:"版本",category:"类别",stars:"stars",installs:"installs",downloads:"downloads",howInstall:"安装方式(任选一个;agim 不会自动跑)",copy:"复制",copied:"已复制",label:{cliInstall:"Host 上跑(推荐)",cliSearch:"先查再装",imAsk:"在 IM 里让 agent 装"},hint:"前两条要先在 host 上安装 skillhub CLI。详见 docs/skills.md 或 skillhub.cn。"}},kS={pageTitle:PS,subnav:AS,installed:TS,hot:OS},LS="Workspace",NS="Read and edit files in the per-agent working directories (`AGENT_CWD`).",IS={label:"Agent",placeholder:"Pick an agent",online:"online",offline:"offline"},DS={title:"Pick an agent to browse its workspace",description:"Each registered agent runs from its own CWD. The picker lists every agent the registry knows about; the green dot next to a name means it reports available."},MS={title:"Files",loading:"Loading…",empty:"(empty directory)",up:"Up",rootLabel:"(workspace root)",binary:"binary",symlinkEscape:"symlink → outside workspace, hidden",broken:"unreadable"},_S={noFile:"Select a file from the tree to view or edit it.",binary:"This file looks binary (base64-encoded) — editing not supported.",truncated:"File is over 1 MiB; only the first 1 MiB is shown. Saving from here would replace the whole file with the truncated content — close without saving.",save:"Save",saving:"Saving…",savedMeta:"Saved · {{size}} bytes · {{at}}",dirtyHint:"Unsaved changes",loadFailed:"Failed to load file"},jS={saved:"Saved {{path}}"},FS={pageTitle:LS,subtitle:NS,agentPicker:IS,noAgent:DS,tree:MS,editor:_S,toast:jS},$S="工作区",US="在每个 Agent 的工作目录(`AGENT_CWD`)下浏览与编辑文件。",HS={label:"Agent",placeholder:"选择一个 Agent",online:"在线",offline:"离线"},BS={title:"选择一个 Agent 来浏览其工作区",description:"每个已注册的 Agent 都有自己的 CWD。下拉列出注册表中所有已知的 Agent;名字旁的绿点表示该 Agent 当前可用。"},VS={title:"文件",loading:"加载中…",empty:"(目录为空)",up:"返回上级",rootLabel:"(工作区根目录)",binary:"二进制",symlinkEscape:"符号链接指向工作区外,已隐藏",broken:"不可读"},zS={noFile:"从左侧选择一个文件查看或编辑。",binary:"该文件是二进制(base64 编码)— 不支持编辑。",truncated:"文件超过 1 MiB;仅显示前 1 MiB。直接保存会用截断内容覆盖整个文件 — 请关闭而不要保存。",save:"保存",saving:"保存中…",savedMeta:"已保存 · {{size}} 字节 · {{at}}",dirtyHint:"有未保存的修改",loadFailed:"加载文件失败"},WS={saved:"已保存 {{path}}"},KS={pageTitle:$S,subtitle:US,agentPicker:HS,noAgent:BS,tree:VS,editor:zS,toast:WS},qS="Observability",GS="Operational health: invocation totals, top-N leaderboards, and the audit timeline.",YS={health:"Health",topn:"Top-N",audit:"Audit"},QS={label:"Window",days_one:"{{count}} day",days_other:"{{count}} days"},XS={title:"Health",totals:"Totals",byDay:"By day",kpi:{calls:"Calls",cost:"Cost",errors:"Errors",errorRate:"Error rate",avgLatencyMs:"Avg latency",p95LatencyMs:"P95 latency"},byDayCol:{date:"Date",calls:"Calls",cost:"Cost",errors:"Errors",avgLatencyMs:"Avg latency"},empty:{title:"No data in this window",description:"No invocations recorded in the selected time window. Widen the window or wait for an agent call to fire."}},JS={title:"Top-N",filter:{dim:"Group by",metric:"Rank by"},dim:{user:"User",agent:"Agent",platform:"Platform",intent:"Intent"},metric:{cost:"Cost",calls:"Calls",errors:"Errors",avg_latency:"Avg latency"},col:{rank:"#",key:"Key",calls:"Calls",cost:"Cost",errors:"Errors",avgLatencyMs:"Avg latency"},empty:{title:"No data",description:"No invocations matched the filters."}},ZS={title:"Audit",stats:{total:"Total",totalCost:"Total cost"},filter:{agent:"Agent",platform:"Platform",user:"User",intent:"Intent"},col:{ts:"Time",trace:"Trace",agent:"Agent",platform:"Platform",user:"User",intent:"Intent",duration:"Duration",cost:"Cost",outcome:"Outcome"},outcome:{ok:"ok",fail:"fail"},empty:{title:"No invocations",description:"Audit rows appear here when an agent is invoked. Adjust filters or widen the window."}},eE={pageTitle:qS,subtitle:GS,tabs:YS,window:QS,health:XS,topn:JS,audit:ZS},tE="观测",nE="运行健康:调用总量、Top-N 排行与审计时间线。",rE={health:"健康",topn:"Top-N",audit:"审计"},oE={label:"时间窗口",days_one:"{{count}} 天",days_other:"{{count}} 天"},aE={title:"健康",totals:"总览",byDay:"每日明细",kpi:{calls:"调用",cost:"成本",errors:"错误",errorRate:"错误率",avgLatencyMs:"平均延迟",p95LatencyMs:"P95 延迟"},byDayCol:{date:"日期",calls:"调用",cost:"成本",errors:"错误",avgLatencyMs:"平均延迟"},empty:{title:"时间窗口内无数据",description:"所选时间范围内没有任何调用记录。可以放宽时间窗口或等待 Agent 被调用。"}},sE={title:"Top-N",filter:{dim:"分组维度",metric:"排序依据"},dim:{user:"用户",agent:"Agent",platform:"平台",intent:"意图"},metric:{cost:"成本",calls:"调用",errors:"错误",avg_latency:"平均延迟"},col:{rank:"#",key:"Key",calls:"调用",cost:"成本",errors:"错误",avgLatencyMs:"平均延迟"},empty:{title:"暂无数据",description:"当前筛选下没有调用记录。"}},iE={title:"审计",stats:{total:"累计",totalCost:"累计成本"},filter:{agent:"Agent",platform:"平台",user:"用户",intent:"意图"},col:{ts:"时间",trace:"Trace",agent:"Agent",platform:"平台",user:"用户",intent:"意图",duration:"耗时",cost:"成本",outcome:"结果"},outcome:{ok:"成功",fail:"失败"},empty:{title:"暂无调用",description:"当 Agent 被调用时,审计记录会出现在这里。可调整筛选或放宽时间窗口。"}},lE={pageTitle:tE,subtitle:nE,tabs:rE,window:oE,health:aE,topn:sE,audit:iE},cE="Settings",uE="Operational configuration: environment variables and service lifecycle.",dE={messengers:"Messengers",email:"Email (SMTP)",viewer:"Viewer & Maps",agents:"Agents",policy:"Policy",workspaces:"Workspaces",admins:"Admins",service:"Service"},fE={title:"Agents",subtitle:"Built-in agent adapters. Enable the ones whose CLI is installed on this host; pick which one handles unrouted messages by default.",installHint:"Not installed. `npm install -g {{pkg}}` on the host.",aliasesLabel:"Aliases",online:"online",offline:"offline",defaultAgent:"Default agent",defaultAgentHint:"Used when the intent classifier has no preference (new web threads, etc.). Only enabled + online agents appear here.",noEligible:"No eligible default",saveBtn:"Save",saving:"Saving…",dirtyHint:"Unsaved changes",discard:"Discard",toast:{saved:"Saved"},acp:{title:"Remote agents (ACP)",subtitle:"Agents reachable over HTTP via the Agent Communication Protocol. Each entry persists in config and registers on the next service restart.",discoverBtn:"Discover",runDiscover:"Probe",baseUrl:"Discovery URL",baseUrlHint:"Probes `<base>/.well-known/acp` and adds the entries it lists. Skips names already present.",addTitle:"Add agent",name:"Name",nameHint:"Stable identifier; letters, digits, `._-`.",aliases:"Aliases",aliasesHint:"Comma-separated; routed via `/alias` in chat.",endpoint:"Endpoint",endpointHint:"Base URL of the agent's ACP root (no trailing `/`).",authType:"Auth",auth:{none:"None",apikey:"API key",bearer:"Bearer"},token:"Token",tokenPlaceholder:"Paste token",testBtn:"Test",addBtn:"Add",removeBtn:"Remove",on:"on",off:"off",dupName:"An agent with this name already exists.",empty:{title:"No remote agents",description:"Add an ACP endpoint below or use Discover for a `.well-known/acp` directory."},toast:{staged:"Staged. Save to persist.",testOk:"Reached `{{name}}`",testMasked:"Save first — token is masked, can't test in place.",discoverEmpty:"Nothing new to add.",discoverAdded_one:"Added {{count}} agent.",discoverAdded_other:"Added {{count}} agents."}}},hE={title:"Policy & toggles",subtitle:"Frequently-flipped switches that operate on env values under the hood. Each toggle persists immediately; the change applies on the next service restart unless the relevant module supports hot-reload (most do).",savingToast:"Saved",safety:{title:"Skip permissions (DANGEROUS)",description:"When ON, the Claude Code adapter passes `--dangerously-skip-permissions` to the wrapped CLI, bypassing every tool-use confirmation. Recommended OFF for production. Only enable for trusted, isolated workspaces.",envKey:"IMHUB_DANGEROUSLY_SKIP_PERMISSIONS",tagWarn:"production deployments should keep this OFF"},approval:{title:"Approval timeout default",description:'What the approval bus does when a pending tool-use request expires with no human reply. `Deny` is the safe default and keeps write-side calls (Bash / Edit / Write) gated; `Allow` is "user away" mode and lets the agent keep moving.',envKey:"IMHUB_TIMEOUT_DEFAULT",valDeny:"Deny on timeout",valAllow:"Allow on timeout"},memory:{title:"Long-term memory",description:"Master switch for the per-user memory subsystem (facts + persona + vector retrieval). Disabling stops new fact extraction and persona consolidation; the existing bank stays on disk.",envKey:"IMHUB_MEMORY_ENABLED"},viewer:{title:"Long-message viewer",description:"When ON, IM replies that exceed the viewer threshold are uploaded to the local paste store and the IM message becomes a short URL the user can click. Without it, long replies get truncated by the messenger.",envKey:"IMHUB_VIEWER_ENABLED"},a2aNotify:{title:"A2A notify mode",description:"How verbose the bus is when one agent calls another. `essential` (default) sends only headline events; `verbose` includes every transition; `off` silences cross-agent notifications entirely.",envKey:"IMHUB_A2A_NOTIFY_MODE",valEssential:"Essential",valVerbose:"Verbose",valOff:"Off"}},pE={title:"Messengers",subtitle:"Per-IM-platform connection settings. Toggle a platform on, fill in its credentials, and Save. The next service restart picks up the new config.",saveAll:"Save all",saving:"Saving…",savedToast:"Configuration saved",discardAll:"Discard changes",dirtyHint:"Unsaved changes",platform:{wechat:"WeChat",telegram:"Telegram",feishu:"Feishu (Lark)",dingtalk:"DingTalk",discord:"Discord"},hint:{wechat:"iLink-based QR login. Click Scan, scan the QR with your phone WeChat, confirm — the bot logs in as that account.",telegram:"Bot API token from @BotFather; channel id is optional and only used when targeting a specific chat.",feishu:"App credentials from the Lark developer console. App must have the messaging scopes.",dingtalk:"Stream API client credentials from the DingTalk developer console.",discord:"Bot token from the Discord developer portal. The bot must be invited to the target channel."},enabled:"Enabled",disabled:"Disabled",scanQr:"Scan QR",fields:{botToken:"Bot token",appId:"App ID",appSecret:"App secret",clientId:"Client ID",clientSecret:"Client secret",channelId:"Channel ID"},dingtalk:{dmPolicy:"DM policy",groupPolicy:"Group policy",allowFrom:"DM allowFrom (staffIds, comma-separated)",groupAllowFrom:"Group allowFrom (staffIds, comma-separated)",ackReaction:"Ack-reaction",policy:{open:"open — anyone may talk",pairing:"pairing — first DMer pinned",allowlist:"allowlist — only listed IDs",disabled:"disabled — bot ignores groups"},ack:{off:"off — no ack glyph",emoji:"emoji ⏳→✅",kaomoji:"kaomoji (text-face)"},accountsTitle:"Extra accounts",accountDisabled:"disabled",accountsHint:"Each entry starts its own DWClient with isolated dmPolicy / allowFrom / ack-reaction. Restart agim after Save for new accounts to take effect.",accountsEmpty:"No extra accounts yet. Click ‘+ add account’ to wire another DingTalk bot.",addAccount:"Add account",accountName:"Display name (optional)",accountRenameCollision:'An account with id "{{id}}" already exists; pick another id.'},qr:{title:"Scan WeChat QR",description:"Open WeChat on your phone, scan this code, then confirm the login prompt inside WeChat.",starting:"Starting QR session…",loadFailed:"Failed to start QR session",expired:"QR code expired — close and start a new one.",cancelled:"Cancelled.",confirmed:"Login confirmed — wechat-ilink will start on the next service restart."}},mE={title:"Email (SMTP)",subtitle:"Outbound mail delivery for `/remind email me@x.com …`. Credentials persist to `~/.agim/.env`. Leave blank to disable.",cardTitle:"SMTP credentials",statusOn:"configured",statusOff:"disabled",host:"Host",hostHint:"Mail server hostname (e.g. `smtp.gmail.com`).",port:"Port",portHint:"Usually 465 (SSL) or 587 (STARTTLS).",user:"Username",userHint:"Login email; often the sender address too.",pass:"Password / app token",passHint:"Stored in `~/.agim/.env` (chmod 600). Masked unless Reveal is on.",from:"From",fromHint:"Sender header. Defaults to the username when blank.",secure:"TLS mode",secureHint:"`auto` follows the port; force SSL or STARTTLS if your provider requires it.",secureAuto:"auto (port-based)",secureTrue:"true (SSL, port 465)",secureFalse:"false (STARTTLS, port 587)",reveal:"Reveal",hide:"Hide",testBtn:"Test connection",testNeedsConfigured:"Save host / user / password first.",disableBtn:"Disable SMTP",saveBtn:"Save",saving:"Saving…",discard:"Discard",toast:{saved:"SMTP saved",disabled:"SMTP disabled",noChanges:"Nothing to save"}},gE={title:"Viewer & Maps",subtitle:"Public-facing surfaces: the long-message Viewer (turns >threshold replies into a `/v/<id>` short link) and Baidu Maps AK (drives `/memo` address geocoding).",reveal:"Reveal",hide:"Hide",save:"Save",saving:"Saving…",discard:"Discard",dirtyHint:"Unsaved changes",toast:{saved:"Viewer settings saved"},viewer:{title:"Viewer (long-message links)",subtitle:"Replies longer than the chars / lines threshold are uploaded to the local paste store and the IM message becomes a short `/v/<id>` link.",on:"enabled",off:"disabled",enableLabel:"Enable the long-message Viewer",publicUrl:"Public base URL",publicUrlHint:"What the operator's reverse proxy / tunnel exposes. Used to build `/v/<id>` links.",tunnelMode:"Tunnel mode",tunnelOff:"off (use Public base URL)",tunnelQuick:"quick (cloudflared)",tunnelHint:"`quick` launches a Cloudflare quick tunnel and uses its URL when the operator hasn't fronted agim themselves.",remotePasteUrl:"Remote paste URL",remotePasteUrlHint:"POST markdown here to get a public URL back; overrides Public base URL + tunnel. Leave empty to use the community default https://viewer.iclaw.host/paste.",remotePasteToken:"Remote paste bearer token",remotePasteTokenHint:"Optional bearer token sent to the remote paste server. Required only if your paste server protects POSTs.",noDefaultRemote:"Disable community default",noDefaultRemoteLabel:"Don't fall back to viewer.iclaw.host when nothing else is configured",noDefaultRemoteHint:"v1.2.43+: when no mode is configured, agim defaults to remote mode against viewer.iclaw.host. Check this to disable that fallback (markdown stays inline if no other mode is set).",tunnelStatus:"Tunnel status",refreshTunnel:"Refresh",tunnelRunning:"Running",yes:"yes",no:"no",tunnelUrl:"Live URL",effectiveUrl:"Effective URL",binary:"cloudflared binary",binaryMissing:"not found in PATH — install from cloudflare/cloudflared releases",lastError:"Last error",tunnelLoading:"Loading tunnel status…",thresholds:"Thresholds",chars:"Max chars",charsHint:"Replies above this length route through Viewer.",lines:"Max lines",linesHint:"Same routing decision, on line count.",codeLines:"Max code lines",codeLinesHint:"Lower threshold for replies inside code fences.",maxPastes:"Paste store cap",maxPastesHint:"Older pastes are evicted FIFO once the count exceeds this."},baidu:{title:"Baidu Maps AK",subtitle:"Enables `/memo` address-to-coords lookup. Without it, /memo still works via raw coords or browser GPS share. Free AK: lbsyun.baidu.com → Console → Application → Server-side API.",configured:"configured",empty:"not set",placeholder:"32-char AK starting with a non-digit",hint:"Stored in `~/.agim/.env` (chmod 600). Masked unless Reveal is on.",suspicious:"AK length is {{length}} — usually a Baidu AK is 32 characters. Double-check?",clear:"Clear AK",toast:{saved:"Baidu Maps AK saved",cleared:"Baidu Maps AK cleared"}}},vE={title:"Workspaces",subtitle:"Multi-tenant workspace registry. Each workspace has its own agent whitelist, rate-limit, and (optionally) member list. The `default` workspace catches every unrouted user.",empty:{title:"Only the default workspace",description:"Add a workspace below to partition a team / project / customer. Each one gets its own agent whitelist + rate-limit."},col:{id:"ID",name:"Name",agents:"Agents",members:"Members",rateLimit:"Rate limit"},rateLimitFormat:"{{rate}} per {{intervalSec}}s, burst {{burst}}",membersOpen:"open (any user)",membersCount_one:"{{count}} member",membersCount_other:"{{count}} members",edit:"Edit",form:{title:"Add or edit a workspace",subtitleEdit:"Editing existing workspace — change id to clone, keep to upsert.",id:"ID",idHint:"Stable identifier; [a-zA-Z0-9_-]+; the special name `default` is reserved.",name:"Display name",agents:"Agent whitelist",agentsHint:"Comma-separated; empty = allow every registered agent.",members:"Member user IDs",membersHint:"Comma-separated `platform:userId`; empty = open workspace.",rateLimit:"Rate limit (optional)",rate:"Calls",intervalSec:"Per (seconds)",burst:"Burst",submit:"Save workspace",reset:"Clear form"},toast:{saved:"Workspace saved"}},yE={title:"Service",subtitle:"Inspect the running agim process + start, stop, or restart it.",modeLabel:"Mode",pidLabel:"PID",uptimeLabel:"Uptime",webLabel:"Web",bootPhaseLabel:"Boot phase",mode:{systemd:"systemd",background:"background",foreground:"foreground",none:"not running"},actions:{start:"Start",stop:"Stop",restart:"Restart",confirmStop:"Stop the agim service?",confirmStopDesc:"The web console, the messenger adapters, and any in-flight job will all stop. You'll need to start the service again before you can use it.",confirmRestart:"Restart the agim service?",confirmRestartDesc:"The process stops and re-starts. In-flight jobs are cancelled; outbox + queued reminders survive the bounce. The web console will be unreachable for ~5-30 seconds."},toast:{started:"Service started",stopped:"Service stopped",restarted:"Service restarted"},ports:{title:"Ports",subtitle:"Which ports agim binds when started. Leave blank to use the default. Changes apply on the next service restart (use the Restart button below after saving).",webPort:"Web port",webPortHint:"HTTP server for the chat UI + REST API. Default: {{default}}.",acpPort:"ACP port",acpPortHint:"Agent Communication Protocol server (remote agent surface). Default: {{default}}.",invalidPort:"Must be a number between 1 and 65535.",restartRequired:"Restart required",save:"Save",saving:"Saving…",discard:"Discard",toast:{saved:"Ports saved — restart agim to bind the new ports"}}},bE={title:"Admin allowlist",subtitle:"IM-side users who can run admin-tier commands (`/admin promote`, `/admin token`, etc.). The list lives in `IMHUB_ADMIN_USERS`; this editor only works when the agim web port is bound locally.",configured:"Allowlist configured",notConfigured:"Allowlist not configured — anyone with the CLI bootstrap token can self-promote.",bootstrapAvailable:"Bootstrap token file present",bootstrapPath:"Token path",empty:"No admins added yet.",col:{platform:"Platform",userId:"User ID"},add:{title:"Add admin",platform:"Platform",userId:"User ID",submit:"Add"},remove:{label:"Remove",confirmTitle:"Remove this admin?",confirmDescription:"They lose access to all admin-tier commands. Re-add to restore."},toast:{added:"Admin added",removed:"Admin removed"}},wE={pageTitle:cE,subtitle:uE,tabs:dE,agents:fE,policy:hE,messengers:pE,email:mE,viewerSettings:gE,workspaces:vE,service:yE,admins:bE},xE="设置",SE="运维配置:环境变量与服务生命周期。",EE={messengers:"IM 平台",email:"邮件 (SMTP)",viewer:"Viewer & 地图",agents:"Agent",policy:"策略",workspaces:"工作区",admins:"管理员",env:"环境变量",service:"服务"},CE={title:"Agent",subtitle:"内置 Agent 适配器。启用宿主机已安装 CLI 的;并选择一个作为默认 Agent(用于路由无法判定的消息)。",installHint:"未安装。在宿主机执行 `npm install -g {{pkg}}`。",aliasesLabel:"别名",online:"在线",offline:"未就绪",defaultAgent:"默认 Agent",defaultAgentHint:"意图分类无判定时使用(新建 web 线程等)。下拉只列出已启用且在线的 Agent。",noEligible:"无可选默认",saveBtn:"保存",saving:"保存中…",dirtyHint:"有未保存改动",discard:"放弃改动",toast:{saved:"已保存"},acp:{title:"远程 Agent (ACP)",subtitle:"通过 Agent Communication Protocol 接入的 HTTP Agent。每个条目持久化到 config,下次服务重启时注册。",discoverBtn:"批量发现",runDiscover:"探测",baseUrl:"发现地址",baseUrlHint:"探测 `<base>/.well-known/acp` 并追加返回的 Agent;同名条目自动跳过。",addTitle:"新增 Agent",name:"名称",nameHint:"稳定标识;只允许 字母 数字 `._-`。",aliases:"别名",aliasesHint:"逗号分隔;在 IM 内通过 `/alias` 路由。",endpoint:"Endpoint",endpointHint:"Agent 的 ACP 根路径(不带尾部 `/`)。",authType:"鉴权",auth:{none:"无",apikey:"API key",bearer:"Bearer"},token:"Token",tokenPlaceholder:"粘贴 token",testBtn:"测试",addBtn:"新增",removeBtn:"移除",on:"已启用",off:"已停用",dupName:"已存在同名 Agent。",empty:{title:"暂无远程 Agent",description:"下方填写 ACP endpoint 新增,或使用「批量发现」自动从 `.well-known/acp` 导入。"},toast:{staged:"已暂存,点击「保存」生效。",testOk:"已联通 `{{name}}`",testMasked:"Token 是掩码态,请先保存后再测试。",discoverEmpty:"没有可新增的 Agent。",discoverAdded_one:"已新增 {{count}} 个 Agent。",discoverAdded_other:"已新增 {{count}} 个 Agent。"}}},RE={title:"策略与开关",subtitle:"高频切换的开关,底层操作的是 env 值。每个开关变更后立即持久化;多数模块支持热加载,少数需要等下次服务重启。",savingToast:"已保存",safety:{title:"跳过权限确认(危险)",description:"打开后,Claude Code 适配器会向 CLI 传递 `--dangerously-skip-permissions`,跳过所有工具调用确认。生产环境强烈建议保持关闭;仅在隔离的可信工作区内启用。",envKey:"IMHUB_DANGEROUSLY_SKIP_PERMISSIONS",tagWarn:"生产部署建议保持关闭"},approval:{title:"审批超时默认行为",description:'当 pending 的工具调用无人响应而超时时审批 bus 的行为。`拒绝` 是安全默认值,会让 Bash / Edit / Write 等写入调用保持阻断;`放行` 是"用户离开"模式,让 Agent 继续运行。',envKey:"IMHUB_TIMEOUT_DEFAULT",valDeny:"超时拒绝",valAllow:"超时放行"},memory:{title:"长期记忆",description:"每用户记忆子系统(事实 + persona + 向量检索)的总开关。关闭后停止抽取新事实和 persona 整理;已有数据保留在磁盘。",envKey:"IMHUB_MEMORY_ENABLED"},viewer:{title:"长消息查看器",description:"打开后,超过阈值的 IM 回复会被上传到本地 paste 存储,IM 消息变成一个可点击的短链。关闭则消息会被 IM 平台截断。",envKey:"IMHUB_VIEWER_ENABLED"},a2aNotify:{title:"A2A 通知模式",description:"Agent 间互相调用时 bus 的提示详细程度。`essential`(默认)仅发关键事件;`verbose` 包含每次状态切换;`off` 完全静默跨 Agent 通知。",envKey:"IMHUB_A2A_NOTIFY_MODE",valEssential:"关键事件",valVerbose:"详细",valOff:"关闭"}},PE={title:"IM 平台",subtitle:"各 IM 平台的连接配置。打开开关、填写凭据、保存;下次服务重启即生效。",saveAll:"全部保存",saving:"保存中…",savedToast:"配置已保存",discardAll:"放弃改动",dirtyHint:"有未保存的改动",platform:{wechat:"微信",telegram:"Telegram",feishu:"飞书",dingtalk:"钉钉",discord:"Discord"},hint:{wechat:'基于 iLink 的扫码登录。点击 "扫码登录",用手机微信扫码并在弹窗中确认;机器人以该微信账号登录。',telegram:"@BotFather 申请的 Bot Token;Channel ID 可选,仅用于定向到特定群组。",feishu:"飞书开放平台的应用凭据。应用需开启消息权限。",dingtalk:"钉钉开发者后台的 Stream API 客户端凭据。",discord:"Discord 开发者门户的 Bot Token。需将机器人邀请到目标频道。"},enabled:"已启用",disabled:"未启用",scanQr:"扫码登录",fields:{botToken:"Bot Token",appId:"App ID",appSecret:"App Secret",clientId:"Client ID",clientSecret:"Client Secret",channelId:"Channel ID"},dingtalk:{dmPolicy:"私聊访问策略",groupPolicy:"群聊访问策略",allowFrom:"私聊白名单(staffId,英文逗号分隔)",groupAllowFrom:"群聊白名单(staffId,英文逗号分隔)",ackReaction:"ack 反馈方式",policy:{open:"open — 任何人都能对话",pairing:"pairing — 第一个私聊的人锁定为唯一对端",allowlist:"allowlist — 只允许名单中的 ID",disabled:"disabled — 机器人完全忽略群聊"},ack:{off:"off — 不发标记",emoji:"emoji ⏳→✅",kaomoji:"kaomoji(纯文本颜文字)"},accountsTitle:"多账号 / 多机器人",accountDisabled:"已禁用",accountsHint:"每个 entry 启动独立的 DWClient,dmPolicy / allowFrom / ack-reaction 全部隔离。保存后请重启 agim 让新账号生效。",accountsEmpty:"还没有额外账号。点「+ 添加账号」接入另一个钉钉机器人。",addAccount:"添加账号",accountName:"显示名(可选)",accountRenameCollision:'已存在 id 为 "{{id}}" 的账号;请换一个 id。'},qr:{title:"扫码登录微信",description:"打开手机微信扫一扫这个二维码,然后在微信内确认登录。",starting:"正在启动 QR 会话…",loadFailed:"QR 启动失败",expired:"二维码已过期 — 关闭并重新发起。",cancelled:"已取消。",confirmed:"登录成功 — wechat-ilink 将在下次服务重启后启用。"}},AE={title:"邮件 (SMTP)",subtitle:"用于 `/remind email me@x.com …` 的对外邮件投递。凭据保存在 `~/.agim/.env`,留空即停用。",cardTitle:"SMTP 凭据",statusOn:"已配置",statusOff:"未配置",host:"Host",hostHint:"邮件服务器域名(如 `smtp.gmail.com`)。",port:"Port",portHint:"通常 465 (SSL) 或 587 (STARTTLS)。",user:"用户名",userHint:"登录邮箱;通常也是发件人地址。",pass:"密码 / 应用 Token",passHint:"保存到 `~/.agim/.env`(chmod 600)。默认遮罩,按「显示」可查看。",from:"发件人",fromHint:"发件 header;为空则使用用户名。",secure:"TLS 模式",secureHint:"`auto` 按端口判定;如运营商要求可强制 SSL 或 STARTTLS。",secureAuto:"auto(按端口)",secureTrue:"true(SSL,对应 465)",secureFalse:"false(STARTTLS,对应 587)",reveal:"显示",hide:"隐藏",testBtn:"测试连接",testNeedsConfigured:"请先保存 host / user / password。",disableBtn:"停用 SMTP",saveBtn:"保存",saving:"保存中…",discard:"放弃改动",toast:{saved:"SMTP 已保存",disabled:"SMTP 已停用",noChanges:"无可保存的改动"}},TE={title:"Viewer & 地图",subtitle:"公开访问的两个外设:长消息 Viewer(超过阈值的回复转成 `/v/<id>` 短链)+ Baidu Maps AK(驱动 `/memo` 地址解析)。",reveal:"显示",hide:"隐藏",save:"保存",saving:"保存中…",discard:"放弃改动",dirtyHint:"有未保存改动",toast:{saved:"Viewer 设置已保存"},viewer:{title:"Viewer(长消息短链)",subtitle:"超过字符 / 行数阈值的回复会被上传到本地 paste 存储,IM 消息变成一条 `/v/<id>` 短链。",on:"已启用",off:"未启用",enableLabel:"启用长消息 Viewer",publicUrl:"公开基础 URL",publicUrlHint:"反代 / 隧道暴露给外网的地址。用于拼接 `/v/<id>` 短链。",remotePasteUrl:"远端 paste URL",remotePasteUrlHint:"POST markdown 到这个地址换公网链接;优先级高于 Public base URL 和 quick 隧道。留空使用社区默认 https://viewer.iclaw.host/paste。",remotePasteToken:"远端 paste Bearer Token",remotePasteTokenHint:"可选;只在你的 paste 服务要求鉴权时需要填。",noDefaultRemote:"禁用社区默认",noDefaultRemoteLabel:"未配置任何模式时不回退到 viewer.iclaw.host",noDefaultRemoteHint:"v1.2.43+:未配置任何模式时,agim 默认走 remote 模式上传到 viewer.iclaw.host。勾选此项可关闭该回退(这时长内容会直接 inline)。",tunnelMode:"隧道模式",tunnelOff:"关闭(使用上方公开 URL)",tunnelQuick:"quick(cloudflared 临时隧道)",tunnelHint:"`quick` 会本地拉起 Cloudflare quick tunnel;当运营商自己没有反代 agim 时启用。",tunnelStatus:"隧道状态",refreshTunnel:"刷新",tunnelRunning:"运行中",yes:"是",no:"否",tunnelUrl:"实时 URL",effectiveUrl:"生效 URL",binary:"cloudflared 二进制",binaryMissing:"PATH 中未找到 — 请从 cloudflare/cloudflared releases 安装",lastError:"最近一次错误",tunnelLoading:"正在加载隧道状态…",thresholds:"路由阈值",chars:"字符上限",charsHint:"回复超过此长度走 Viewer。",lines:"行数上限",linesHint:"相同的路由判定,按行数。",codeLines:"代码行数上限",codeLinesHint:"代码块内回复的更低阈值。",maxPastes:"Paste 存储上限",maxPastesHint:"超过此数量后按 FIFO 淘汰旧 paste。"},baidu:{title:"Baidu Maps AK",subtitle:"启用 `/memo` 的地址→坐标解析。不配置 AK,/memo 仍可通过裸坐标或浏览器 GPS 分享工作。免费 AK:lbsyun.baidu.com → 控制台 → 应用管理 → 创建应用 → 服务端 API。",configured:"已配置",empty:"未配置",placeholder:"32 位 AK,首字符非数字",hint:"保存到 `~/.agim/.env`(chmod 600),默认遮罩,按「显示」可查看。",suspicious:"AK 长度为 {{length}},通常 Baidu AK 是 32 位 — 请核对。",clear:"清除 AK",toast:{saved:"Baidu Maps AK 已保存",cleared:"Baidu Maps AK 已清除"}}},OE={title:"工作区",subtitle:"多租户工作区注册表。每个工作区有独立的 Agent 白名单、限流配置以及(可选的)成员名单。`default` 工作区承接所有未匹配的用户。",empty:{title:"只有默认工作区",description:"在下方添加工作区,可按团队 / 项目 / 客户分隔。每个工作区有独立的 Agent 白名单与限流。"},col:{id:"ID",name:"名称",agents:"Agent 白名单",members:"成员",rateLimit:"限流"},rateLimitFormat:"{{rate}} / {{intervalSec}}s,突发 {{burst}}",membersOpen:"开放(任何用户)",membersCount_one:"{{count}} 位成员",membersCount_other:"{{count}} 位成员",edit:"编辑",form:{title:"新增或编辑工作区",subtitleEdit:"编辑已有工作区 — 改 ID 可克隆,保持原 ID 即 upsert。",id:"ID",idHint:"稳定标识符;只允许 [a-zA-Z0-9_-]+;`default` 为保留名。",name:"显示名",agents:"Agent 白名单",agentsHint:"逗号分隔;为空 = 允许所有已注册 Agent。",members:"成员用户 ID",membersHint:"逗号分隔,形如 `platform:userId`;为空 = 开放工作区。",rateLimit:"限流(可选)",rate:"调用数",intervalSec:"周期(秒)",burst:"突发上限",submit:"保存工作区",reset:"清空表单"},toast:{saved:"工作区已保存"}},kE={title:"服务",subtitle:"查看运行中的 agim 进程,并启动 / 停止 / 重启它。",modeLabel:"运行模式",pidLabel:"PID",uptimeLabel:"运行时长",webLabel:"Web 端口",bootPhaseLabel:"启动阶段",mode:{systemd:"systemd",background:"后台",foreground:"前台",none:"未运行"},actions:{start:"启动",stop:"停止",restart:"重启",confirmStop:"停止 agim 服务?",confirmStopDesc:"Web 控制台、消息适配器、所有正在进行的作业都会停止。需要重新启动后才能继续使用。",confirmRestart:"重启 agim 服务?",confirmRestartDesc:"进程会先停止再启动。进行中的作业会被取消;投递队列与已排队的提醒会保留。重启期间 Web 控制台不可达,通常 5-30 秒。"},toast:{started:"服务已启动",stopped:"服务已停止",restarted:"服务已重启"},ports:{title:"端口",subtitle:"agim 启动时监听的端口。留空使用默认值;改动需下次服务重启生效(保存后点下方「重启」按钮)。",webPort:"Web 端口",webPortHint:"聊天 UI + REST API 的 HTTP 服务端口。默认 {{default}}。",acpPort:"ACP 端口",acpPortHint:"Agent Communication Protocol 服务端口(远程 Agent 接入面)。默认 {{default}}。",invalidPort:"需为 1-65535 之间的数字。",restartRequired:"需重启生效",save:"保存",saving:"保存中…",discard:"放弃改动",toast:{saved:"端口已保存 — 重启 agim 以绑定新端口"}}},LE={title:"管理员名单",subtitle:"可执行管理员级命令的 IM 用户(`/admin promote`、`/admin token` 等)。名单保存在 `IMHUB_ADMIN_USERS` 环境变量;仅当 agim Web 端口本地绑定时才能在此编辑。",configured:"名单已配置",notConfigured:"尚未配置名单 — 任何持有 CLI bootstrap token 的人都可自我提权。",bootstrapAvailable:"Bootstrap token 文件存在",bootstrapPath:"文件路径",empty:"暂无管理员。",col:{platform:"平台",userId:"用户 ID"},add:{title:"添加管理员",platform:"平台",userId:"用户 ID",submit:"添加"},remove:{label:"移除",confirmTitle:"确认移除该管理员?",confirmDescription:"该用户将失去所有管理员命令访问权限。可再次添加恢复。"},toast:{added:"已添加",removed:"已移除"}},NE={pageTitle:xE,subtitle:SE,tabs:EE,agents:CE,policy:RE,messengers:PE,email:AE,viewerSettings:TE,workspaces:OE,service:kE,admins:LE};Me.use(uu).use(If).init({resources:{en:{common:Xb,errors:Ww,tasks:Ix,approvals:e0,reminders:C0,memos:W0,memory:uS,skills:RS,workspace:FS,observability:eE,settings:wE},zh:{common:fw,errors:Cx,tasks:Bx,approvals:f0,reminders:_0,memos:eS,memory:wS,skills:kS,workspace:KS,observability:lE,settings:NE}},lng:IE(),fallbackLng:"en",supportedLngs:["en","zh"],ns:["common","errors","tasks","approvals","reminders","memos","memory","skills","workspace","observability","settings"],defaultNS:"common",interpolation:{escapeValue:!1},react:{useSuspense:!1},backend:{loadPath:"/locales/{{lng}}/{{ns}}.json"},detection:{order:[],caches:[]}});function IE(){try{const e=localStorage.getItem("im-hub-lang");if(e==="en"||e==="zh")return e}catch{}return(navigator.language||"en").toLowerCase().startsWith("zh")?"zh":"en"}function DE(e){Me.language!==e&&Me.changeLanguage(e)}function ME(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var du=e=>{const{present:t,children:n}=e,r=_E(t),o=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),a=De(r.ref,jE(o));return typeof n=="function"||r.isPresent?h.cloneElement(o,{ref:a}):null};du.displayName="Presence";function _E(e){const[t,n]=h.useState(),r=h.useRef(null),o=h.useRef(e),a=h.useRef("none"),s=e?"mounted":"unmounted",[i,l]=ME(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const c=kr(r.current);a.current=i==="mounted"?c:"none"},[i]),$e(()=>{const c=r.current,u=o.current;if(u!==e){const p=a.current,d=kr(c);e?l("MOUNT"):d==="none"||c?.display==="none"?l("UNMOUNT"):l(u&&p!==d?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),$e(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,f=d=>{const m=kr(r.current).includes(CSS.escape(d.animationName));if(d.target===t&&m&&(l("ANIMATION_END"),!o.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},p=d=>{d.target===t&&(a.current=kr(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:h.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function kr(e){return e?.animationName||"none"}function jE(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var FE=Symbol("radix.slottable");function $E(e){const t=({children:n})=>v.jsx(v.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=FE,t}var[yo]=so("Tooltip",[fo]),$a=fo(),fu="TooltipProvider",UE=700,Ti="tooltip.open",[HE,hu]=yo(fu),pu=e=>{const{__scopeTooltip:t,delayDuration:n=UE,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:a}=e,s=h.useRef(!0),i=h.useRef(!1),l=h.useRef(0);return h.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),v.jsx(HE,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:h.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:h.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:i,onPointerInTransitChange:h.useCallback(c=>{i.current=c},[]),disableHoverableContent:o,children:a})};pu.displayName=fu;var mu="Tooltip",[pC,bo]=yo(mu),ga="TooltipTrigger",BE=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=bo(ga,n),a=hu(ga,n),s=$a(n),i=h.useRef(null),l=De(t,i,o.onTriggerChange),c=h.useRef(!1),u=h.useRef(!1),f=h.useCallback(()=>c.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),v.jsx(tc,{asChild:!0,...s,children:v.jsx(Le.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:Se(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:Se(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:Se(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Se(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:Se(e.onBlur,o.onClose),onClick:Se(e.onClick,o.onClose)})})});BE.displayName=ga;var VE="TooltipPortal",[mC,zE]=yo(VE,{forceMount:void 0}),kn="TooltipContent",gu=h.forwardRef((e,t)=>{const n=zE(kn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...a}=e,s=bo(kn,e.__scopeTooltip);return v.jsx(du,{present:r||s.open,children:s.disableHoverableContent?v.jsx(vu,{side:o,...a,ref:t}):v.jsx(WE,{side:o,...a,ref:t})})}),WE=h.forwardRef((e,t)=>{const n=bo(kn,e.__scopeTooltip),r=hu(kn,e.__scopeTooltip),o=h.useRef(null),a=De(t,o),[s,i]=h.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:f}=r,p=h.useCallback(()=>{i(null),f(!1)},[f]),d=h.useCallback((y,m)=>{const g=y.currentTarget,S={x:y.clientX,y:y.clientY},b=QE(S,g.getBoundingClientRect()),C=XE(S,b),R=JE(m.getBoundingClientRect()),A=eC([...C,...R]);i(A),f(!0)},[f]);return h.useEffect(()=>()=>p(),[p]),h.useEffect(()=>{if(l&&u){const y=g=>d(g,u),m=g=>d(g,l);return l.addEventListener("pointerleave",y),u.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",y),u.removeEventListener("pointerleave",m)}}},[l,u,d,p]),h.useEffect(()=>{if(s){const y=m=>{const g=m.target,S={x:m.clientX,y:m.clientY},b=l?.contains(g)||u?.contains(g),C=!ZE(S,s);b?p():C&&(p(),c())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[l,u,s,c,p]),v.jsx(vu,{...e,ref:a})}),[KE,qE]=yo(mu,{isInside:!1}),GE=$E("TooltipContent"),vu=h.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:s,...i}=e,l=bo(kn,n),c=$a(n),{onClose:u}=l;return h.useEffect(()=>(document.addEventListener(Ti,u),()=>document.removeEventListener(Ti,u)),[u]),h.useEffect(()=>{if(l.trigger){const f=p=>{p.target?.contains(l.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,u]),v.jsx(Ta,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:u,children:v.jsxs(nc,{"data-state":l.stateAttribute,...c,...i,ref:t,style:{...i.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[v.jsx(GE,{children:r}),v.jsx(KE,{scope:n,isInside:!0,children:v.jsx(Sv,{id:l.contentId,role:"tooltip",children:o||r})})]})})});gu.displayName=kn;var yu="TooltipArrow",YE=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=$a(n);return qE(yu,n).isInside?null:v.jsx(rc,{...o,...r,ref:t})});YE.displayName=yu;function QE(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,o,a)){case a:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function XE(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function JE(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function ZE(e,t){const{x:n,y:r}=e;let o=!1;for(let a=0,s=t.length-1;a<t.length;s=a++){const i=t[a],l=t[s],c=i.x,u=i.y,f=l.x,p=l.y;u>r!=p>r&&n<(f-c)*(r-u)/(p-u)+c&&(o=!o)}return o}function eC(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),tC(t)}function tC(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const a=t[t.length-1],s=t[t.length-2];if((a.x-s.x)*(o.y-s.y)>=(a.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const a=n[n.length-1],s=n[n.length-2];if((a.x-s.x)*(o.y-s.y)>=(a.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var nC=pu,bu=gu;const rC=nC,oC=h.forwardRef(({className:e,sideOffset:t=4,...n},r)=>v.jsx(bu,{ref:r,sideOffset:t,className:we("z-50 overflow-hidden rounded-md","bg-text text-bg px-2 py-1 text-xs font-medium shadow-md","data-[state=delayed-open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=delayed-open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=delayed-open]:zoom-in-95",e),...n}));oC.displayName=bu.displayName;function aC(e){return v.jsx(Gp,{position:"top-center",richColors:!0,closeButton:!0,toastOptions:{classNames:{toast:"border border-border bg-surface text-text shadow-md",title:"font-medium",description:"text-text-dim text-sm",actionButton:"bg-accent text-accent-fg rounded-md",cancelButton:"bg-surface-2 text-text rounded-md",error:"bg-danger-bg text-danger border-danger",success:"bg-success-bg text-success border-success",warning:"bg-warning-bg text-warning border-warning",info:"bg-info-bg text-info border-info"}},...e})}function sC({children:e}){const t=En(r=>r.lang),{i18n:n}=pt();return h.useEffect(()=>{n.language!==t&&DE(t)},[t,n]),v.jsx(v.Fragment,{children:e})}function iC({children:e}){return Vy(),v.jsx(v.Fragment,{children:e})}function lC({children:e}){return h.useEffect(()=>xf(),[]),v.jsx(v.Fragment,{children:e})}function cC({children:e}){return v.jsx(wp,{client:Zy,children:v.jsx(sC,{children:v.jsx(iC,{children:v.jsx(lC,{children:v.jsxs(rC,{children:[e,v.jsx(aC,{})]})})})})})}const wu=document.getElementById("root");if(!wu)throw new Error("agim: #root not found in index.html");Fo.createRoot(wu).render(v.jsx(N.StrictMode,{children:v.jsx(cC,{children:v.jsx(Jy,{})})}));export{rp as $,tc as A,Mt as B,Hf as C,Ta as D,Lm as E,Nl as F,hl as G,hp as H,Pl as I,ul as J,Pv as K,Ol as L,Gh as M,cs as N,dC as O,oc as P,v as Q,mc as R,ua as S,eu as T,Xe as U,je as V,ap as W,ep as X,Qh as Y,Yo as Z,Jh as _,Zo as a,Yh as a0,Go as a1,Zn as a2,ln as a3,De as a4,ti as a5,Em as a6,Um as a7,Oa as a8,xp as a9,bp as aa,mf as ab,pt as ac,rc as b,ft as c,Bf as d,nc as e,du as f,Le as g,cv as h,Yf as i,Gr as j,tn as k,qr as l,da as m,Qf as n,ur as o,Jf as p,Xp as q,we as r,Se as s,cr as t,xm as u,hC as v,so as w,Ge as x,fo as y,Jp as z};
|
|
166
|
+
//# sourceMappingURL=index-CITyis5g.js.map
|