@undefineds.co/xpod 0.4.17 → 0.4.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/config/xpod.base.json +3 -0
  2. package/dist/components/context.jsonld +14 -0
  3. package/dist/identity/ValidatingIdentityProviderHttpHandler.d.ts +32 -1
  4. package/dist/identity/ValidatingIdentityProviderHttpHandler.js +53 -1
  5. package/dist/identity/ValidatingIdentityProviderHttpHandler.jsonld +53 -0
  6. package/node_modules/@undefineds.co/ai-connections/dist/AiClientConfigurationSection.js +39 -10
  7. package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsList.js +15 -4
  8. package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsPanel.d.ts +1 -1
  9. package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsPanel.js +4 -1
  10. package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayKeyRow.d.ts +5 -1
  11. package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayKeyRow.js +2 -2
  12. package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayKeysSection.js +5 -1
  13. package/node_modules/@undefineds.co/ai-connections/dist/controller.d.ts +4 -0
  14. package/node_modules/@undefineds.co/ai-connections/dist/controller.js +3 -1
  15. package/node_modules/@undefineds.co/extension-sdk/dist/layout.d.ts +39 -0
  16. package/node_modules/@undefineds.co/extension-sdk/dist/layout.js +40 -0
  17. package/node_modules/@undefineds.co/extension-sdk/dist/react/app-layout.d.ts +13 -1
  18. package/node_modules/@undefineds.co/extension-sdk/dist/react/app-layout.js +11 -3
  19. package/node_modules/@undefineds.co/extension-sdk/dist/react/workspace-layout.d.ts +13 -4
  20. package/node_modules/@undefineds.co/extension-sdk/dist/react/workspace-layout.js +68 -11
  21. package/node_modules/@undefineds.co/shared-ui/dist/auth-surface.js +6 -6
  22. package/node_modules/@undefineds.co/shared-ui/dist/dialog.js +4 -4
  23. package/node_modules/@undefineds.co/shared-ui/dist/login.js +1 -1
  24. package/node_modules/@undefineds.co/shared-ui/dist/theme.css +128 -79
  25. package/node_modules/@undefineds.co/shared-ui/dist/toast.js +1 -1
  26. package/node_modules/@undefineds.co/shared-ui/dist/tooltip.js +1 -1
  27. package/node_modules/@undefineds.co/solid-sdk/dist/access-route.cjs +87 -9
  28. package/node_modules/@undefineds.co/solid-sdk/dist/access-route.d.ts +31 -3
  29. package/node_modules/@undefineds.co/solid-sdk/dist/access-route.js +156 -14
  30. package/node_modules/@undefineds.co/solid-sdk/dist/index.cjs +86 -8
  31. package/package.json +2 -2
  32. package/static/app/assets/global.css +1 -0
  33. package/static/app/assets/{index-BCZVzMpj.js → index-BeAi28iA.js} +1 -1
  34. package/static/app/assets/inrupt-smoke.js +37 -36
  35. package/static/app/assets/main.js +3 -3
  36. package/static/app/index.html +2 -2
  37. package/static/app/inrupt-smoke.html +2 -1
  38. package/static/dashboard/assets/{AiConfigContext-BedwuLTE.js → AiConfigContext-DelSqO6L.js} +1 -1
  39. package/static/dashboard/assets/{AiConfigPage-hNTayf8G.js → AiConfigPage-dbg0aDvd.js} +1 -1
  40. package/static/dashboard/assets/DocumentProcessingPanel-0-3nlwQf.js +1 -0
  41. package/static/dashboard/assets/IndexLifecyclePanel-DOI3IxOD.js +1 -0
  42. package/static/dashboard/assets/{IndexSubjectPanel-Bv97-ouZ.js → IndexSubjectPanel-ClDgj0SY.js} +1 -1
  43. package/static/dashboard/assets/ModelAssignmentsPanel-BSWH19oT.js +1 -0
  44. package/static/dashboard/assets/ModelsPage-BrzxCkEl.js +11 -0
  45. package/static/{settings/assets/NetworkPage-D50kdbEu.js → dashboard/assets/NetworkPage-CxEKeaPz.js} +2 -2
  46. package/static/dashboard/assets/{PaneListHeader-ByqK_C6i.js → PaneListHeader-xEjcBu9g.js} +1 -1
  47. package/static/dashboard/assets/SearchIndexingPanel-BGlSvEl5.js +1 -0
  48. package/static/dashboard/assets/{StatusSubjectPanel-DPegcFpA.js → StatusSubjectPanel-6s3JXbOd.js} +1 -1
  49. package/static/dashboard/assets/StatusWorkspace-LYMDa4b0.js +1 -0
  50. package/static/dashboard/assets/{SystemSettingsPage-LyXmd6uP.js → SystemSettingsPage-CF_vH-qe.js} +1 -1
  51. package/static/dashboard/assets/SystemSettingsSubjectPanel-hsfHcJRV.js +33 -0
  52. package/static/dashboard/assets/{XpodAiConnectionsPodStore-DXNERI2-.js → XpodAiConnectionsPodStore-CHM-ZwI3.js} +1 -1
  53. package/static/dashboard/assets/{activity-BwRbcTha.js → activity-B7UdTZ1N.js} +1 -1
  54. package/static/dashboard/assets/{badge-BbRb9MsQ.js → badge-B6RuxNt1.js} +1 -1
  55. package/static/dashboard/assets/collection-runtime-CKBQm3Fl.js +1 -0
  56. package/static/dashboard/assets/dashboard-1zrtbMhM.css +1 -0
  57. package/static/dashboard/assets/{dashboard-D2ozrATv.js → dashboard-Dm_h60lA.js} +175 -135
  58. package/static/dashboard/assets/{download-SIHe8Y5t.js → download-BW035kpj.js} +1 -1
  59. package/static/dashboard/assets/{external-link-CiYw5Q4U.js → external-link-BMrNvf3c.js} +1 -1
  60. package/static/dashboard/assets/{index-DC1jRaVA.js → index-2jlFzexm.js} +1 -1
  61. package/static/dashboard/assets/index-CQDQ8WVr.js +4 -0
  62. package/static/dashboard/assets/{key-round-nKtxP6pb.js → key-round-C9vxhn7T.js} +1 -1
  63. package/static/dashboard/assets/{rotate-ccw-CQm5hHMN.js → rotate-ccw-8Vm0-INc.js} +1 -1
  64. package/static/dashboard/assets/{skeleton-TKyLbiPs.js → skeleton-CY_602wn.js} +1 -1
  65. package/static/dashboard/assets/{waypoints-BQS9t0ky.js → waypoints-DdEdgkxD.js} +1 -1
  66. package/static/dashboard/assets/workspace-layout-Wed840qR.js +1 -0
  67. package/static/dashboard/dashboard.html +2 -2
  68. package/static/settings/assets/{AiConfigContext-eLRkXFtH.js → AiConfigContext-CR3YhTA-.js} +1 -1
  69. package/static/settings/assets/AiConfigPage-DnOvX2Kx.js +1 -0
  70. package/static/settings/assets/DocumentProcessingPanel-CccpHBs3.js +1 -0
  71. package/static/settings/assets/IndexLifecyclePanel-BrECzBoM.js +1 -0
  72. package/static/settings/assets/{IndexSubjectPanel-DT0c11VQ.js → IndexSubjectPanel-CP84xXye.js} +1 -1
  73. package/static/settings/assets/ModelAssignmentsPanel-DbFi67Kk.js +1 -0
  74. package/static/settings/assets/ModelsPage-xjHA88qy.js +11 -0
  75. package/static/settings/assets/NetworkPage-Bj4wc0bh.js +2 -0
  76. package/static/settings/assets/{PaneListHeader-Da5jZFvG.js → PaneListHeader-Bz0UAhZr.js} +1 -1
  77. package/static/settings/assets/SearchIndexingPanel-ykhvw1Vl.js +1 -0
  78. package/static/settings/assets/{StatusSubjectPanel-Upqqlvon.js → StatusSubjectPanel-B2Y6ib3d.js} +1 -1
  79. package/static/settings/assets/StatusWorkspace-tx3Xg56J.js +1 -0
  80. package/static/settings/assets/SystemSettingsPage-BbFkv_Wn.js +1 -0
  81. package/static/settings/assets/SystemSettingsSubjectPanel-CcbpQmTc.js +33 -0
  82. package/static/settings/assets/{XpodAiConnectionsPodStore-nFgD_usD.js → XpodAiConnectionsPodStore-B11u0BOi.js} +2 -2
  83. package/static/settings/assets/{activity-CWy1W2W0.js → activity-BE8Hz8WF.js} +1 -1
  84. package/static/settings/assets/auth-callback-5waKJF0n.js +1 -0
  85. package/static/settings/assets/{badge-v30yFaaj.js → badge-xeRbYBMf.js} +1 -1
  86. package/static/settings/assets/collection-runtime-DIBObcT5.js +1 -0
  87. package/static/settings/assets/{download-C3Dzb60R.js → download-xI5yyfk7.js} +1 -1
  88. package/static/settings/assets/{external-link-DnkJGKNc.js → external-link-DmbiCMuc.js} +1 -1
  89. package/static/settings/assets/global-1zrtbMhM.css +1 -0
  90. package/static/settings/assets/{global-B_WO-aYY.js → global-BOl78fr8.js} +160 -120
  91. package/static/settings/assets/index-CFVXiUnV.js +4 -0
  92. package/static/settings/assets/index-DK6qlahe.js +1 -0
  93. package/static/settings/assets/{index-browser-DzhsXZHm.js → index-browser-Bk7jaLCd.js} +1 -1
  94. package/static/settings/assets/{key-round-DoDbsLae.js → key-round-B3VIp8oI.js} +1 -1
  95. package/static/settings/assets/{rotate-ccw-DNR_R3oT.js → rotate-ccw-DRzTN49Z.js} +1 -1
  96. package/static/settings/assets/{settings-BOznrBjy.js → settings-CCM17CMX.js} +1 -1
  97. package/static/settings/assets/{skeleton-BjHhu9qI.js → skeleton-Ckhw5HG7.js} +1 -1
  98. package/static/settings/assets/{waypoints-BXNph9Fd.js → waypoints-BFMI-qS6.js} +1 -1
  99. package/static/settings/assets/workspace-layout-Co0KpMKd.js +1 -0
  100. package/static/settings/auth-callback.html +3 -3
  101. package/static/settings/settings.html +3 -3
  102. package/static/app/assets/main.css +0 -1
  103. package/static/dashboard/assets/DocumentProcessingPanel-BSb_vOj7.js +0 -1
  104. package/static/dashboard/assets/IndexLifecyclePanel-DAHx-PBG.js +0 -1
  105. package/static/dashboard/assets/ModelAssignmentsPanel-CEJZs9At.js +0 -1
  106. package/static/dashboard/assets/ModelsPage-DkBVXmKT.js +0 -11
  107. package/static/dashboard/assets/NetworkPage-BDqKgRZQ.js +0 -2
  108. package/static/dashboard/assets/SearchIndexingPanel-M-WYaQP3.js +0 -1
  109. package/static/dashboard/assets/StatusWorkspace-CPIkjO9S.js +0 -1
  110. package/static/dashboard/assets/SystemSettingsSubjectPanel-CYHqNIn2.js +0 -33
  111. package/static/dashboard/assets/collection-runtime-BRfZD5oS.js +0 -1
  112. package/static/dashboard/assets/dashboard-rk080mvG.css +0 -1
  113. package/static/dashboard/assets/dialog-BbRbILBP.js +0 -1
  114. package/static/dashboard/assets/index-CExLoewO.js +0 -41
  115. package/static/dashboard/assets/index-CTgU8YW1.js +0 -4
  116. package/static/dashboard/assets/workspace-layout-Csbbr3vZ.js +0 -1
  117. package/static/settings/assets/AiConfigPage-BMO-ytdK.js +0 -1
  118. package/static/settings/assets/DocumentProcessingPanel-CH-HBRzQ.js +0 -1
  119. package/static/settings/assets/IndexLifecyclePanel-ChEMn9D8.js +0 -1
  120. package/static/settings/assets/ModelAssignmentsPanel-T59L_wOk.js +0 -1
  121. package/static/settings/assets/ModelsPage-m_SP4PdE.js +0 -11
  122. package/static/settings/assets/SearchIndexingPanel-DQQd3-Jw.js +0 -1
  123. package/static/settings/assets/StatusWorkspace-CPB49bGd.js +0 -1
  124. package/static/settings/assets/SystemSettingsPage-C0wrxcNw.js +0 -1
  125. package/static/settings/assets/SystemSettingsSubjectPanel-BOm7tUH1.js +0 -33
  126. package/static/settings/assets/auth-callback-HhgEuohz.js +0 -1
  127. package/static/settings/assets/collection-runtime-B7oomxic.js +0 -1
  128. package/static/settings/assets/dialog-BAe7moyL.js +0 -1
  129. package/static/settings/assets/global-rk080mvG.css +0 -1
  130. package/static/settings/assets/index-B51ot_m_.js +0 -1
  131. package/static/settings/assets/index-CHBQVfuZ.js +0 -41
  132. package/static/settings/assets/index-DbqRFton.js +0 -4
  133. package/static/settings/assets/workspace-layout-TZ7fteel.js +0 -1
  134. /package/static/app/assets/{_commonjsHelpers-B-UnjaXt.js → global-BGMlqT2c.js} +0 -0
@@ -0,0 +1,4 @@
1
+ var Lt=t=>{throw TypeError(t)};var Rt=(t,s,n)=>s.has(t)||Lt("Cannot "+n);var xe=(t,s,n)=>(Rt(t,s,"read from private field"),n?n.call(t):s.get(t)),Pt=(t,s,n)=>s.has(t)?Lt("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(t):s.set(t,n),lt=(t,s,n,o)=>(Rt(t,s,"write to private field"),o?o.call(t,n):s.set(t,n),n);import{r as a,c as Le,j as e,$ as le,R as bt,w as Ts,Q as _s,O as Ls,u as ss,_ as Dt,a0 as Rs,W as je,V as jt,a1 as ze,Y as Re,a2 as ve,a3 as Ps,T as Xe,a4 as Ds,X as yt,a5 as ns,U as os,a6 as ks,a7 as Os,a8 as Is,a9 as As,aa as qs,ab as kt,ac as Ms}from"./dashboard-Dm_h60lA.js";import{g as $s,f as Ot,i as Us,s as Fs,j as Bs,a as Hs,k as Vs,c as Ks,e as zs,h as Xs,u as Gs,t as Ws}from"./admin-C6qCRFiY.js";import{A as Qs}from"./activity-B7UdTZ1N.js";import{E as Ys}from"./external-link-BMrNvf3c.js";import{A as Js,c as cs,C as Zs,V as en,R as tn}from"./index-2jlFzexm.js";import{D as sn}from"./download-BW035kpj.js";import{K as nn}from"./key-round-C9vxhn7T.js";var on=Object.defineProperty,cn=(t,s)=>on(t,"name",{value:s,configurable:!0}),rn=a.createContext(void 0);function rs(t){const s=a.useContext(rn);return t||s||"ltr"}cn(rs,"useDirection");var an=Object.defineProperty,ln=(t,s)=>an(t,"name",{value:s,configurable:!0});function ft(t,[s,n]){return Math.min(n,Math.max(s,t))}ln(ft,"clamp");const dn=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],un=Le("chart-column",dn);const pn=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],mn=Le("check",pn);const fn=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],hn=Le("chevron-down",fn);const xn=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]],gn=Le("file-down",xn);const vn=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],bn=Le("pause",vn);const jn=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],yn=Le("play",jn);const Nn=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],It=Le("search",Nn);const wn=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Sn=Le("trash-2",wn);const Cn=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Nt=Le("triangle-alert",Cn);const En=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Tn=Le("x",En);function he(t){const{className:s,variant:n="default",size:o="default",children:c,...r}=t,d="inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus:outline-none focus:ring-0 focus-visible:outline-none active:translate-y-px disabled:opacity-50 disabled:pointer-events-none",m={default:"bg-primary text-primary-foreground hover:bg-primary/90 focus-visible:bg-primary/80",secondary:"bg-muted text-foreground hover:bg-muted/80 focus-visible:bg-muted/60",ghost:"bg-transparent hover:bg-muted focus-visible:bg-muted text-foreground"},h={default:"h-10 px-4 py-2",sm:"h-8 px-3",icon:"h-9 w-9 p-0"};return e.jsx("button",{className:le(d,m[n],h[o],s),...r,children:c})}function z(t){const{className:s,variant:n,children:o}=t;return e.jsx("div",{className:le("rounded-xl bg-background",n==="bordered"&&"border border-border",s),children:o})}function ne(t){const{className:s,children:n}=t;return e.jsx("div",{className:le("px-5 pt-5",s),children:n})}function oe(t){const{className:s,children:n}=t;return e.jsx("div",{className:le("text-base font-semibold",s),children:n})}function X(t){const{className:s,children:n}=t;return e.jsx("div",{className:le("px-5 pb-5 pt-4",s),children:n})}function st(t){const{className:s,...n}=t;return e.jsx("input",{className:le("w-full h-10 rounded-md border border-input bg-background px-3 py-2 text-sm","placeholder:text-muted-foreground","focus:outline-none focus-visible:border-primary",s),...n})}function Ie(t){const{className:s,...n}=t;return e.jsx("label",{className:le("text-sm font-medium text-foreground",s),...n})}const _n={"not-cloud":"非 Cloud 模式","missing-sparql-endpoint":"缺少 PostgreSQL 端点","unsupported-sparql-endpoint":"非 PostgreSQL 端点"};function Ln(t){const s=t.trim();return s?{cacheScopeQuery:s,cacheScopeLimit:50}:{}}function kF(){const[t,s]=a.useState(null),[n,o]=a.useState(!0),[c,r]=a.useState(!1),[d,m]=a.useState(""),[h,f]=a.useState(""),[b,S]=a.useState(""),w=a.useRef(!1),E=a.useCallback(async(g=!1,C=b)=>{g?o(!0):r(!0),m("");try{const v=await $s(Ln(C));v?s(v):m("RDF 统计不可用")}finally{o(!1),r(!1)}},[b]);a.useEffect(()=>{w.current||(w.current=!0,E(!0))},[E]),a.useEffect(()=>{const g=setInterval(()=>{E(!1)},1e4);return()=>clearInterval(g)},[E]);const R=g=>{g.preventDefault();const C=h.trim();S(C),E(!1,C)},_=()=>{f(""),S(""),E(!1,"")},x=t?nt(t.generatedAt):"-";return n?e.jsx("div",{className:"p-8 text-foreground",children:"加载中..."}):e.jsxs("div",{className:"p-8",children:[e.jsxs("div",{className:"mb-6 flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"type-h1",children:"RDF 索引"}),e.jsxs("div",{className:"mt-1 text-sm text-muted-foreground",children:["更新时间 ",x]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("form",{className:"flex min-w-0 items-center gap-2",onSubmit:R,children:[e.jsxs("div",{className:"relative w-72 max-w-[70vw]",children:[e.jsx(It,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(st,{value:h,onChange:g=>f(g.target.value),className:"pl-9",placeholder:"principal / base / version"})]}),e.jsxs(he,{type:"submit",variant:"secondary",size:"sm",className:"gap-2",children:[e.jsx(It,{className:"h-4 w-4"}),"搜索"]}),b&&e.jsx(he,{type:"button",variant:"ghost",size:"sm",onClick:_,"aria-label":"清除 scope 搜索",children:e.jsx(Tn,{className:"h-4 w-4"})})]}),e.jsxs(he,{type:"button",variant:"secondary",size:"sm",onClick:()=>{E(!1)},disabled:c,className:"gap-2",children:[e.jsx(bt,{className:le("h-4 w-4",c&&"animate-spin")}),"刷新"]})]})]}),d&&e.jsx("div",{className:"mb-5 rounded-md border border-destructive/30 bg-destructive/5 px-4 py-3 text-sm text-destructive",children:d}),t?.available?e.jsx(Rn,{snapshot:t,scopeQuery:b}):e.jsxs(e.Fragment,{children:[e.jsx(Pn,{snapshot:t}),e.jsx("div",{className:"mt-8",children:e.jsx(as,{snapshot:t?.benchmarkReports})})]})]})}function Rn(t){const{snapshot:s,scopeQuery:n}=t,o=s.stats,c=o.rdf3x,r=o.slowQueries?.entries??[],d=o.derivedCache,m=d?.scopeEntries??[],h=o.pgAcceleration,f=o.lifecycle,b=f?.coldStart,S=b?.phases.reduce((w,E)=>E.durationMs>w.durationMs?E:w,{name:"-",durationMs:0});return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-8 grid grid-cols-1 gap-5 md:grid-cols-2 xl:grid-cols-5",children:[e.jsx(He,{icon:Ts,label:"引擎",value:s.engine,detail:h?.profile??"baseline",tone:h?.enabled?"good":"neutral"}),e.jsx(He,{icon:Qs,label:"RDF-3X",value:c?.syncedWithFacts?"已同步":`${c?.refreshLag??0} 版本延迟`,detail:`facts ${c?.factsDataVersion??0} / rdf3x ${c?.rdf3xFactsDataVersion??0} / pending ${c?.pendingSources??0}`,tone:c?.syncedWithFacts?"good":"warn"}),e.jsx(He,{icon:_s,label:"存储",value:me(o.totalBytes),detail:`facts ${me(o.factsBytes)} / derived ${me(o.derivedBytes)}`,tone:"neutral"}),e.jsx(He,{icon:bt,label:"冷启动",value:_e(b?.durationMs??f?.lastOpenDurationMs??0),detail:`${f?.status??"unknown"} / open ${f?.openCount??0}`,tone:f?.status==="failed"?"warn":"neutral"}),e.jsx(He,{icon:Nt,label:"慢查询",value:`${o.slowQueries?.entryCount??0}`,detail:`保留 ${o.slowQueries?.maxEntries??0} 条`,tone:(o.slowQueries?.entryCount??0)>0?"warn":"good"})]}),e.jsxs("div",{className:"mb-8 grid grid-cols-1 gap-5 xl:grid-cols-5",children:[e.jsxs(z,{variant:"bordered",children:[e.jsx(ne,{children:e.jsx(oe,{children:"空间占用"})}),e.jsxs(X,{className:"space-y-3",children:[e.jsx(M,{label:"derived/facts",value:ht(o.derivedToFactsRatio)}),e.jsx(M,{label:"total/facts",value:ht(o.totalToFactsRatio)}),e.jsx(M,{label:"result cache",value:me(o.queryResultCache?.totalBytes??0)}),e.jsx(M,{label:"materialized",value:me(o.materializedResultCache?.totalBytes??0)}),e.jsx(M,{label:"template",value:me(o.queryTemplateCache?.totalBytes??0)})]})]}),e.jsxs(z,{variant:"bordered",children:[e.jsx(ne,{children:e.jsx(oe,{children:"Cache"})}),e.jsxs(X,{className:"space-y-3",children:[e.jsx(M,{label:"result entries",value:`${o.queryResultCache?.entryCount??0}`}),e.jsx(M,{label:"result scopes",value:`${o.queryResultCache?.scopeCount??0}`}),e.jsx(M,{label:"materialized entries",value:`${o.materializedResultCache?.entryCount??0}`}),e.jsx(M,{label:"materialized scopes",value:`${o.materializedResultCache?.scopeCount??0}`}),e.jsx(M,{label:"result hit rate",value:qt(o.queryResultCache)}),e.jsx(M,{label:"materialized hit rate",value:qt(o.materializedResultCache)}),e.jsx(M,{label:"template entries",value:`${o.queryTemplateCache?.entryCount??0}`}),e.jsx(M,{label:"cache pressure",value:Ge(d?.cachePressure??0)})]})]}),e.jsxs(z,{variant:"bordered",children:[e.jsx(ne,{children:e.jsx(oe,{children:"生命周期"})}),e.jsxs(X,{className:"space-y-3",children:[e.jsx(M,{label:"driver",value:f?.driver??"-"}),e.jsx(M,{label:"ready at",value:f?.lastReadyAt?nt(f.lastReadyAt):"-"}),e.jsx(M,{label:"slowest phase",value:`${S?.name??"-"} ${_e(S?.durationMs??0)}`}),e.jsx(M,{label:"dirty sources",value:`${c?.pendingSources??0}`}),e.jsx(M,{label:"custom index",value:b?b.customIndexDeferred?"deferred":"startup":"-"}),e.jsx(M,{label:"maintenance",value:b?b.maintenanceEnabled?"enabled":"disabled":"-"})]})]}),e.jsxs(z,{variant:"bordered",children:[e.jsx(ne,{children:e.jsx(oe,{children:"权限 Scope"})}),e.jsxs(X,{className:"space-y-3",children:[e.jsx(M,{label:"scope versions",value:`${d?.scopeVersionCount??0}`}),e.jsx(M,{label:"max scope",value:me(d?.maxScopeBytes??0)}),e.jsx(M,{label:"largest scope",value:me(d?.largestScopeBytes??0)}),e.jsx(M,{label:"scope pressure",value:Ge(d?.largestScopePressure??0)}),e.jsx(M,{label:"scope hash",value:We(d?.largestScopeHash??"-")}),e.jsx(M,{label:"facts version",value:`${d?.largestScopeFactsDataVersion??"-"}`})]})]}),e.jsxs(z,{variant:"bordered",children:[e.jsx(ne,{children:e.jsx(oe,{children:"PG 加速"})}),e.jsxs(X,{className:"space-y-3",children:[e.jsx(M,{label:"profile",value:h?.profile??"baseline"}),e.jsx(M,{label:"provider",value:h?.provider??"-"}),e.jsx(M,{label:"enabled",value:h?.enabled?"true":"false"}),e.jsx(M,{label:"capabilities",value:`${h?.capabilities?.length??0}`}),e.jsx(M,{label:"active operators",value:Qe(h?.activeOperators)}),e.jsx(M,{label:"missing caps",value:Qe(h?.missingCapabilities)}),e.jsx(M,{label:"fallback",value:h?.fallbackReason??"-"})]})]})]}),e.jsxs("div",{className:"mb-8 grid grid-cols-1 gap-5 xl:grid-cols-2",children:[e.jsxs(z,{variant:"bordered",children:[e.jsx(ne,{children:e.jsx(oe,{children:"Cache 淘汰"})}),e.jsxs(X,{className:"space-y-3",children:[e.jsx(M,{label:"total",value:`${d?.evictionCount??0}`}),e.jsx(In,{evictions:d?.evictions})]})]}),e.jsxs(z,{variant:"bordered",children:[e.jsx(ne,{children:e.jsx(oe,{children:"Cache 载荷"})}),e.jsxs(X,{className:"space-y-3",children:[e.jsx(M,{label:"result payload",value:me(d?.queryResultPayloadBytes??0)}),e.jsx(M,{label:"materialized payload",value:me(d?.materializedResultPayloadBytes??0)}),e.jsx(M,{label:"template bytes",value:me(d?.queryTemplateBytes??0)}),e.jsx(M,{label:"result table/index",value:`${me(o.queryResultCache?.tableBytes??0)} / ${me(o.queryResultCache?.indexBytes??0)}`}),e.jsx(M,{label:"materialized table/index",value:`${me(o.materializedResultCache?.tableBytes??0)} / ${me(o.materializedResultCache?.indexBytes??0)}`})]})]})]}),e.jsx("div",{className:"mb-8",children:e.jsx(On,{entries:m,totalCount:d?.scopeVersionCount??0,query:n})}),e.jsx("div",{className:"mb-8",children:e.jsx(as,{snapshot:s.benchmarkReports})}),e.jsx(Dn,{entries:r})]})}function Pn(t){const{snapshot:s}=t,n=s?.available===!1?_n[s.reason]:"无数据";return e.jsx(z,{variant:"bordered",children:e.jsx(X,{children:e.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground",children:[e.jsx(Nt,{className:"h-5 w-5 text-warning"}),e.jsx("span",{children:n})]})})})}function He(t){const s=t.icon;return e.jsx(z,{variant:"bordered",children:e.jsxs(X,{children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:t.label}),e.jsx(s,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsx("div",{className:le("text-xl font-semibold",t.tone==="good"&&"text-success",t.tone==="warn"&&"text-warning"),children:t.value}),e.jsx("div",{className:"mt-1 truncate text-sm text-muted-foreground",children:t.detail})]})})}function M(t){return e.jsxs("div",{className:"flex items-center justify-between gap-4 text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:t.label}),e.jsx("span",{className:"min-w-0 truncate font-mono",children:t.value})]})}function Dn(t){return e.jsxs(z,{variant:"bordered",children:[e.jsx(ne,{children:e.jsx(oe,{children:"最近慢查询"})}),e.jsx(X,{className:"p-0",children:t.entries.length===0?e.jsx("div",{className:"px-5 pb-5 pt-4 text-sm text-muted-foreground",children:"暂无慢查询"}):e.jsx("div",{className:"overflow-auto",children:e.jsxs("table",{className:"w-full min-w-[920px] border-collapse text-left text-sm",children:[e.jsx("thead",{className:"border-b border-border text-muted-foreground",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-5 py-3 font-medium",children:"时间"}),e.jsx("th",{className:"px-5 py-3 font-medium",children:"路径"}),e.jsx("th",{className:"px-5 py-3 font-medium",children:"耗时"}),e.jsx("th",{className:"px-5 py-3 font-medium",children:"扫描"}),e.jsx("th",{className:"px-5 py-3 font-medium",children:"Cache"}),e.jsx("th",{className:"px-5 py-3 font-medium",children:"原因"})]})}),e.jsx("tbody",{children:t.entries.map(s=>e.jsxs("tr",{className:"border-b border-border/60 last:border-0",children:[e.jsx("td",{className:"whitespace-nowrap px-5 py-3 font-mono text-xs",children:nt(s.generatedAt)}),e.jsxs("td",{className:"px-5 py-3",children:[e.jsx("div",{className:"font-medium",children:s.selectedPath}),e.jsx("div",{className:"mt-1 max-w-[240px] truncate font-mono text-xs text-muted-foreground",children:We(s.queryKey)})]}),e.jsx("td",{className:"whitespace-nowrap px-5 py-3 font-mono",children:_e(s.runtime.durationMs)}),e.jsxs("td",{className:"whitespace-nowrap px-5 py-3 font-mono",children:[ue(s.runtime.scannedRows)," / ",ue(s.runtime.returnedRows)]}),e.jsxs("td",{className:"px-5 py-3",children:[e.jsxs("div",{className:"font-mono text-xs",children:["tpl ",s.cache.templateStatus??"-"," / res ",s.cache.resultStatus??"-"," / mat ",s.cache.materializedStatus??"-"]}),e.jsx("div",{className:"mt-1 max-w-[220px] truncate font-mono text-xs text-muted-foreground",children:Mn(s)}),e.jsx("div",{className:"mt-1 max-w-[220px] truncate text-xs text-muted-foreground",children:$n(s)}),e.jsx("div",{className:"mt-1 max-w-[220px] truncate text-xs text-muted-foreground",children:s.cache.scopeBasePath??s.cache.scopeHash}),s.cache.scopePrincipal&&e.jsx("div",{className:"mt-1 max-w-[220px] truncate text-xs text-muted-foreground",children:s.cache.scopePrincipal})]}),e.jsxs("td",{className:"px-5 py-3",children:[e.jsx(qn,{reasons:s.slowQuery.reasons}),e.jsx(kn,{entry:s})]})]},`${s.generatedAt}-${s.queryKey}`))})]})})})]})}function kn(t){const s=Un(t.entry),n=Fn(t.entry);return!s&&!n?null:e.jsxs("div",{className:"mt-2 max-w-[320px] space-y-1 text-xs text-muted-foreground",children:[s&&e.jsx("div",{className:"truncate",children:s}),n&&e.jsx("div",{className:"truncate",children:n})]})}function On(t){return e.jsxs(z,{variant:"bordered",children:[e.jsxs(ne,{className:"flex flex-row items-start justify-between gap-3",children:[e.jsx(oe,{children:"权限 Scope 明细"}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:[ue(t.entries.length)," / ",ue(t.totalCount)]})]}),e.jsx(X,{className:"p-0",children:t.entries.length===0?e.jsx("div",{className:"px-5 pb-5 pt-4 text-sm text-muted-foreground",children:t.query?"没有匹配的缓存 scope":"暂无缓存 scope"}):e.jsx("div",{className:"overflow-auto",children:e.jsxs("table",{className:"w-full min-w-[1020px] border-collapse text-left text-sm",children:[e.jsx("thead",{className:"border-b border-border text-muted-foreground",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-5 py-3 font-medium",children:"Scope"}),e.jsx("th",{className:"px-5 py-3 font-medium",children:"Principal"}),e.jsx("th",{className:"px-5 py-3 font-medium",children:"Base"}),e.jsx("th",{className:"px-5 py-3 font-medium",children:"权限"}),e.jsx("th",{className:"px-5 py-3 font-medium",children:"版本"}),e.jsx("th",{className:"px-5 py-3 font-medium",children:"Payload"}),e.jsx("th",{className:"px-5 py-3 font-medium",children:"Entries"})]})}),e.jsx("tbody",{children:t.entries.map(s=>e.jsxs("tr",{className:"border-b border-border/60 last:border-0",children:[e.jsxs("td",{className:"whitespace-nowrap px-5 py-3 font-mono text-xs",children:[e.jsx("div",{children:We(s.scopeHash)}),e.jsxs("div",{className:"mt-1 text-muted-foreground",children:["facts ",s.factsDataVersion]})]}),e.jsx("td",{className:"px-5 py-3",children:e.jsx("div",{className:"max-w-[220px] truncate",children:s.principal??"-"})}),e.jsx("td",{className:"px-5 py-3",children:e.jsx("div",{className:"max-w-[260px] truncate",children:s.basePath??"-"})}),e.jsxs("td",{className:"whitespace-nowrap px-5 py-3 font-mono text-xs",children:[s.authorizationModel??"-","/",s.mode??"-"]}),e.jsx("td",{className:"px-5 py-3",children:e.jsx("div",{className:"max-w-[180px] truncate font-mono text-xs",children:s.permissionVersion??"-"})}),e.jsxs("td",{className:"whitespace-nowrap px-5 py-3 font-mono",children:[e.jsx("div",{children:me(s.payloadBytes)}),e.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:["r ",me(s.queryResultPayloadBytes)," / m ",me(s.materializedResultPayloadBytes)]})]}),e.jsxs("td",{className:"whitespace-nowrap px-5 py-3 font-mono",children:[ue(s.queryResultEntries)," / ",ue(s.materializedResultEntries)]})]},`${s.scopeHash}-${s.factsDataVersion}`))})]})})})]})}function In(t){const s=Object.entries(t.evictions??{}).filter(([,n])=>n>0);return s.length===0?e.jsx("div",{className:"text-sm text-muted-foreground",children:"暂无淘汰"}):e.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:s.map(([n,o])=>e.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md bg-muted px-3 py-2 text-sm",children:[e.jsx("span",{className:"min-w-0 truncate text-muted-foreground",children:n}),e.jsx("span",{className:"font-mono",children:ue(o)})]},n))})}function as(t){const s=t.snapshot?.reports??[],n=t.snapshot?.errors??[];return e.jsxs(z,{variant:"bordered",children:[e.jsxs(ne,{className:"flex flex-row items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(oe,{children:"Benchmark 报告"}),e.jsx("div",{className:"mt-1 max-w-[720px] truncate text-sm text-muted-foreground",children:(t.snapshot?.roots??[]).join(", ")||"未配置目录"})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(un,{className:"h-4 w-4"}),ue(t.snapshot?.reportCount??s.length)]})]}),e.jsxs(X,{className:"p-0",children:[n.length>0&&e.jsxs("div",{className:"border-b border-border px-5 py-3 text-sm text-warning",children:[ue(n.length)," 个报告读取失败,最近一个:",n[0].path," - ",n[0].message]}),s.length===0?e.jsx("div",{className:"px-5 pb-5 pt-4 text-sm text-muted-foreground",children:"暂无 benchmark report"}):e.jsx("div",{className:"overflow-auto",children:e.jsxs("table",{className:"w-full min-w-[1180px] border-collapse text-left text-sm",children:[e.jsx("thead",{className:"border-b border-border text-muted-foreground",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-5 py-3 font-medium",children:"时间"}),e.jsx("th",{className:"px-5 py-3 font-medium",children:"Profile"}),e.jsx("th",{className:"px-5 py-3 font-medium",children:"规模"}),e.jsx("th",{className:"px-5 py-3 font-medium",children:"Gate"}),e.jsx("th",{className:"px-5 py-3 font-medium",children:"Ingest"}),e.jsx("th",{className:"px-5 py-3 font-medium",children:"Refresh"}),e.jsx("th",{className:"px-5 py-3 font-medium",children:"Cold / Warm"}),e.jsx("th",{className:"px-5 py-3 font-medium",children:"Storage"})]})}),e.jsx("tbody",{children:s.map(o=>e.jsx(An,{report:o},`${o.path}-${o.generatedAt}`))})]})})]})]})}function An(t){const s=t.report,n=s.failedPlanCases.length,o=s.failedConcurrencyCases.length;return e.jsxs("tr",{className:"border-b border-border/60 last:border-0",children:[e.jsxs("td",{className:"whitespace-nowrap px-5 py-3",children:[e.jsx("div",{className:"font-mono text-xs",children:nt(s.generatedAt)}),e.jsx("div",{className:"mt-1 max-w-[220px] truncate font-mono text-xs text-muted-foreground",children:s.path})]}),e.jsxs("td",{className:"px-5 py-3",children:[e.jsx("div",{className:"font-medium",children:s.rdfAccelerationProfile??s.engine}),e.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:[s.driver??s.engine," / ",s.caseProfile??"-"]}),e.jsx("div",{className:"mt-1 max-w-[220px] truncate text-xs text-muted-foreground",children:s.pgAccelerationFallbackReason??Qe(s.pgActiveOperators)})]}),e.jsxs("td",{className:"whitespace-nowrap px-5 py-3 font-mono",children:[e.jsxs("div",{children:[ue(s.seedQuadCount??0)," / ",ue(s.targetQuadCount??0)]}),e.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:[s.scale??"-"," / ",s.fullScale===!1?"partial":"full"]})]}),e.jsxs("td",{className:"px-5 py-3",children:[e.jsx(At,{ok:s.planMatched!==!1&&n===0,label:`plan ${s.planMatched===!1?"fail":"ok"}`}),e.jsx("div",{className:"mt-1",children:e.jsx(At,{ok:s.concurrencyMatched!==!1&&o===0,label:`conc ${s.concurrency??1}`})}),(n>0||o>0)&&e.jsxs("div",{className:"mt-1 text-xs text-warning",children:["fail ",ue(n+o)]})]}),e.jsxs("td",{className:"whitespace-nowrap px-5 py-3 font-mono",children:[e.jsx("div",{children:_e(s.ingestDurationMs??0)}),e.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:["COPY ",ue(s.copyRows??0)," / fb ",ue(s.copyFallbacks??0)]})]}),e.jsxs("td",{className:"whitespace-nowrap px-5 py-3 font-mono",children:[e.jsx("div",{children:_e(s.refreshDurationMs??0)}),e.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:["planner ",_e(s.plannerStatsDurationMs??0)," / ",ue(s.plannerStatsAnalyzedTables?.length??0)]})]}),e.jsxs("td",{className:"whitespace-nowrap px-5 py-3 font-mono",children:[e.jsxs("div",{children:[_e(s.coldStartDurationMs??0)," / ",_e(s.firstQueryDurationMs??0)]}),e.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:["p50/p95 ",_e(s.warmP50DurationMs??0)," / ",_e(s.warmP95DurationMs??0)]})]}),e.jsxs("td",{className:"whitespace-nowrap px-5 py-3 font-mono",children:[e.jsx("div",{children:ht(s.storageTotalToFactsRatio??0)}),e.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:me(s.storageTotalBytes??0)})]})]})}function At(t){return e.jsx("span",{className:le("inline-flex rounded-md px-2 py-0.5 text-xs",t.ok?"bg-success/15 text-success":"bg-warning/15 text-warning"),children:t.label})}function qn(t){return e.jsx("div",{className:"flex max-w-[320px] flex-wrap gap-1.5",children:t.reasons.map(s=>e.jsx("span",{className:"rounded-md bg-warning/15 px-2 py-0.5 text-xs text-warning",children:s},s))})}function me(t){if(!Number.isFinite(t)||t<=0)return"0 B";const s=["B","KiB","MiB","GiB","TiB"];let n=t,o=0;for(;n>=1024&&o<s.length-1;)n/=1024,o+=1;return`${n>=10||o===0?n.toFixed(0):n.toFixed(1)} ${s[o]}`}function ht(t){return Number.isFinite(t)?`${t.toFixed(2)}x`:"0.00x"}function Ge(t){return Number.isFinite(t)?`${Math.round(t*100)}%`:"0%"}function qt(t){const s=t?.hitCount??0,n=t?.missCount??0,o=s+n;return o<=0?"-":`${Ge(s/o)} (${ue(s)}/${ue(o)})`}function Mn(t){const s=t.cache.materialized?.key;if(s)return`mat ${We(s)}`;const n=t.cache.result?.key??t.queryKey;return`res ${We(n)}`}function $n(t){const s=t.derivedCache,n=Ge(s.cachePressure),o=Ge(s.largestScopePressure),c=s.evictionCount;return`pressure ${n} / scope ${o} / evict ${ue(c)}`}function Un(t){const s=t.histogramHints??[];if(s.length===0)return"";const n=s.map(o=>`${o.kind}:${ue(o.quadCount)}`);return`hist ${ue(s.length)} ${Qe(n)}`}function Fn(t){const s=t.rejectedNativeOperators??[];if(s.length===0)return"";const n=s.map(o=>`${o.capability}:${o.reason}`);return`native rejected ${ue(s.length)} ${Qe(n)}`}function _e(t){return Number.isFinite(t)?`${Math.round(t)} ms`:"0 ms"}function ue(t){return Number.isFinite(t)?new Intl.NumberFormat().format(t):"0"}function nt(t){const s=new Date(t);return Number.isNaN(s.getTime())?t:s.toLocaleString()}function We(t){return t.length<=16?t:`${t.slice(0,12)}...${t.slice(-4)}`}function Qe(t){return t?.length?t.length<=2?t.join(", "):`${t.slice(0,2).join(", ")} +${t.length-2}`:"-"}function OF(){return e.jsx(Ls,{})}async function is({webId:t,podUrl:s,authenticatedFetch:n}){const o=new URL("/",s).origin,c=await n(`${o}/api/pod/settings/status`,{method:"GET",credentials:"include",headers:{accept:"application/json"}});if(!c.ok)throw await c.arrayBuffer(),new Error("Pod settings request failed. Please try again.");if(!c.headers.get("content-type")?.includes("application/json"))throw await c.arrayBuffer(),new Error("Pod settings request failed. Please try again.");const r=await c.json();if(r.identity?.webId!==t)throw new Error("Pod settings response does not match the current Solid session.");return r}function Fe(t){if(!Number.isFinite(t)||t<0)return"未知";const s=["B","KiB","MiB","GiB","TiB"];let n=t,o=0;for(;n>=1024&&o<s.length-1;)n/=1024,o+=1;return`${o===0?n:n.toFixed(1)} ${s[o]}`}function Mt(t){return!Number.isFinite(t)||t<0?"未知":t<60?`${t} 秒`:t<3600?`${(t/60).toFixed(1)} 分钟`:`${(t/3600).toFixed(1)} 小时`}function Je(t,s){return t===null?"不限":s(t)}function Bn(t){return t===null?"用量正在读取":t.status!=="available"?t.status==="unsupported"?"此部署不提供用量":"用量未知":`已用 ${Fe(t.usage.storageBytes)}`}const Hn={healthy:"border-success/40 bg-success/10 text-success dark:border-success/40 dark:bg-success/40 dark:text-success",degraded:"border-warning/40 bg-warning/10 text-warning dark:border-warning/40 dark:bg-warning/40 dark:text-warning",failed:"border-destructive/30 bg-destructive/10 text-destructive",unknown:"border-border bg-muted text-muted-foreground"};function Ve(t){const{state:s,children:n,className:o}=t;return e.jsx("span",{className:le("inline-flex items-center rounded-md border px-2 py-1 text-xs font-medium",Hn[s],o),children:n})}const Vn=a.createContext(null);function ls(){return a.useContext(Vn)}function Kn(t,s,n,o=[]){const c=zn(t.XPOD_TUNNEL_PROFILES,n);if(c)return c;const r=o.find(d=>d.id===s);for(const d of r?.legacyPublicUrlKeys??[])if(t[d])return t[d];return"未配置"}function zn(t,s){if(!t||!s||s==="none")return"";try{const n=JSON.parse(t);if(!Array.isArray(n))return"";const o=n.find(r=>r&&typeof r=="object"&&!Array.isArray(r)&&r.id===s);return(typeof o?.publicUrl=="string"?o.publicUrl.trim():"")||""}catch{return""}}function Ke(t){switch(t){case"healthy":return"可用";case"degraded":return"降级";case"failed":return"失败";default:return"未知"}}function $t(t){return t?t.status==="running"?"healthy":t.status==="starting"?"degraded":"failed":"unknown"}function Xn(t,s){return t?s?"healthy":"failed":"unknown"}function Ut(t){if(!t)return"未知";const s=Math.floor(t/1e3),n=Math.floor(s/60),o=Math.floor(n/60);return o>0?`${o}h ${n%60}m`:n>0?`${n}m ${s%60}s`:`${s}s`}function Gn(t){return["Public","User tunnel","LAN","Loopback"].map(n=>t.find(o=>o.name===n&&o.state==="healthy")).find(n=>!!n)??t.find(n=>n.state==="degraded")??t.find(n=>n.state==="unknown")??null}function Wn(t){try{const s=new URL(t).hostname;if(s==="localhost"||s==="::1"||s.startsWith("127.")||s.startsWith("10.")||s.startsWith("192.168."))return!0;const n=s.match(/^172\.(\d+)\./u);return n?Number(n[1])>=16&&Number(n[1])<=31:!1}catch{return!1}}function Qn(t){return e.jsxs(z,{variant:"bordered",children:[e.jsx(ne,{children:e.jsx(oe,{children:"访问路径"})}),e.jsx(X,{children:e.jsx("div",{"data-testid":"runtime-access-path-list",className:"divide-y divide-border rounded-xl border border-border",children:t.routes.map(s=>e.jsxs("div",{"data-testid":"runtime-access-path-row","data-route-name":s.name,className:"flex min-w-0 flex-col gap-3 p-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium",children:s.label}),e.jsx("div",{className:"mt-1 min-w-0 break-all font-mono text-xs text-muted-foreground",title:s.target,children:s.target}),e.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:s.detail})]}),e.jsx("div",{className:"shrink-0 sm:self-start",children:e.jsx(Ve,{state:s.state,children:s.statusLabel??Ke(s.state)})})]},s.name))})})]})}function Yn(t){return e.jsxs(z,{variant:"bordered",children:[e.jsx(ne,{children:e.jsx(oe,{children:"完整路径详情"})}),e.jsx(X,{children:e.jsx("div",{className:"overflow-x-auto rounded-md border border-border",children:e.jsxs("table",{className:"w-full min-w-[720px] text-sm",children:[e.jsx("thead",{className:"bg-muted/60 text-muted-foreground",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"路径"}),e.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"目标"}),e.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"状态"}),e.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"证据"})]})}),e.jsx("tbody",{className:"divide-y divide-border",children:t.routes.map(s=>e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2 font-medium",children:s.label}),e.jsx("td",{className:"px-3 py-2 font-mono text-xs break-all",children:s.target}),e.jsx("td",{className:"px-3 py-2",children:e.jsx(Ve,{state:s.state,children:s.statusLabel??Ke(s.state)})}),e.jsx("td",{className:"px-3 py-2 text-muted-foreground",children:s.detail})]},s.name))})]})})})]})}function Jn(t){const[s,...n]=t.problems;return s?e.jsxs(z,{variant:"bordered",className:"border-warning/40 bg-warning/60 dark:border-warning/40 dark:bg-warning/20",children:[e.jsx(ne,{children:e.jsx(oe,{children:s.title})}),e.jsxs(X,{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-warning dark:text-warning",children:s.message}),e.jsx(he,{variant:"secondary",onClick:()=>window.location.assign(s.href),children:s.actionLabel}),n.length>0?e.jsxs("div",{"data-testid":"overview-more-problems",className:"text-sm text-muted-foreground",children:["还有 ",n.length," 项:",n.map((o,c)=>e.jsxs("span",{children:[c>0?"、":"",e.jsx("a",{className:"text-primary underline-offset-4 hover:underline",href:o.href,children:o.title})]},o.id))]}):null]})]}):null}function IF(){const t=ls(),[s,n]=a.useState(null),[o,c]=a.useState(null),[r,d]=a.useState(null),[m,h]=a.useState(null),[f,b]=a.useState(null),[S,w]=a.useState(!0),[E,R]=a.useState(""),[_,x]=a.useState(""),[g,C]=a.useState(null),v=ss(),[j,A]=a.useState(null),P=a.useCallback(l=>{n(l.servicesData),c(l.adminData),d(l.configData),h(l.ddnsData),b(l.publicCheck),C(l.checkedAt),x(""),w(!1)},[]),q=a.useCallback(async()=>{try{P(await Ot())}catch{x("状态加载失败,请查看日志或稍后刷新。"),w(!1)}},[P]),D=a.useCallback(async()=>{w(!0),await q()},[q]);a.useEffect(()=>{if(t)return;let l=!1;return Ot().then(k=>{l||P(k)}).catch(()=>{l||(x("状态加载失败,请查看日志或稍后刷新。"),w(!1))}),()=>{l=!0}},[P,t]);const I=t?.snapshot,Y=I?.servicesData??s,te=I?.adminData??o,i=I?.configData??r,u=I?.ddnsData??m,p=I?.publicCheck??f,N=I?.checkedAt??g,L=t?t.loading&&!I:S,y=t?.error??_,U=Y?.find(l=>l.name==="css"),G=Y?.find(l=>l.name==="api"),F=Y?"healthy":"unknown",ce=$t(U),B=$t(G),ee=ce==="healthy"&&B==="healthy",W=i?.env??{},ae=W.XPOD_TUNNEL_PROVIDER||u?.tunnelProvider||"none",de=W.XPOD_TUNNEL_ACTIVE_PROFILE_ID||ae,re=Us(W,u,window.location.origin),T=Wn(re),$=Kn(W,ae,de,i?.providers),H=a.useMemo(()=>{const l=p?.status==="pass"?"healthy":T?"unknown":p?.status==="fail"?"failed":"unknown",k=ae==="none"?"unknown":u?.mode==="tunnel"||$!=="未配置"?"healthy":"degraded";return[{name:"Loopback",label:"本机",target:`http://127.0.0.1:${W.CSS_PORT||"3000"}`,state:Xn(Y,ee),detail:Y?ee?"当前设备可以使用。":"核心服务未运行。":"正在检查本机服务。"},{name:"LAN",label:"局域网",target:u?.ipv4?`http://${u.ipv4}:${W.CSS_PORT||"3000"}`:"等待本机地址上报",state:u?.ipv4&&ee?"healthy":"unknown",detail:u?.ipv4?"同一网络中的设备可以使用这个地址。":"尚未发现局域网地址。"},{name:"Public",label:"公网",target:re,state:l,statusLabel:T?"未配置":void 0,detail:T?"尚未开放公网访问。目前可以在本机或局域网使用。":p?.detail||"尚未检查外网是否可以访问。"},{name:"User tunnel",label:"用户隧道",target:$,state:k,statusLabel:ae==="none"?"未启用":void 0,detail:ae==="none"?"未启用远程访问隧道。":`已启用 ${ae}。`},{name:"P2P backup",label:"P2P 备用",target:"信令协调的原生客户端",state:"unknown",statusLabel:"备用",detail:"备用连接方式,浏览器不会默认使用。"}]},[ee,re,u,W.CSS_PORT,T,p,Y,ae,$]),K=!T&&H.some(l=>(l.name==="Public"||l.name==="User tunnel")&&l.state==="failed"),V=Y?ee?K?"degraded":"healthy":"failed":"unknown",O=Gn(H);a.useEffect(()=>{if(!v.webId||!v.podUrl)return;let l=!1;return is({webId:v.webId,podUrl:v.podUrl,authenticatedFetch:v.fetch}).then(k=>{l||A(k.storage)}).catch(()=>{l||A({status:"error"})}),()=>{l=!0}},[v.webId,v.podUrl,v.fetch]);const se=[{name:"Gateway",state:F,detail:Y?"当前控制台可访问":"等待网关状态上报",uptime:N?`检查于 ${N.toLocaleTimeString()}`:"等待检查"},{name:"Solid Server",state:ce,detail:U?.pid?`PID ${U.pid}`:"CSS 请求处理与 Pod 数据服务",uptime:Ut(U?.uptime)},{name:"API Server",state:B,detail:G?.pid?`PID ${G.pid}`:"管理 API 与本机控制能力",uptime:Ut(G?.uptime)}],ie=se.filter(l=>l.state==="healthy").length,ye=!Y,Ne=ye&&!y?{tone:"unknown",headline:"状态无法确认",detail:"还没有读到本机服务状态;下面是上次可信结果,不当作当前结论。"}:y||!ee?{tone:"attention",headline:ee?"部分信息读取失败":"核心服务未全部运行",detail:y??"本机服务未就绪,先按需处理事项恢复。"}:K?{tone:"attention",headline:"本机可用,对外访问需要检查",detail:"核心服务正常;对外访问方式有问题时会先影响外部设备。"}:{tone:"normal",headline:"当前可用",detail:O?`${O.label}:${O.detail}`:"核心服务正常,可以继续使用。"},Pe=[...ye?[]:[...ee?[]:[{id:"services",title:"服务异常",message:"Solid Server 或 API Server 未运行,当前无法正常使用 Xpod。请先查看日志。",actionLabel:"查看日志",href:"/status/logs"}],...K?[{id:"public-access",title:"外部访问异常",message:"Xpod 在本机运行正常,但从外网暂时无法访问。请检查公网域名、端口映射或用户隧道。",actionLabel:"打开网络设置",href:"/network"}]:[]],...y?[{id:"load",title:"部分信息读取失败",message:y,actionLabel:"重新检查",href:"/status/overview"}]:[]],rt=[{label:"实例",value:re||"等待稳定入口"},{label:"核心服务",value:ye?"状态无法确认":`${ie}/${se.length} 正常`},{label:"访问与空间",value:`${O?.label??"正在检查"} · ${Bn(j)}`},{label:"上次检查",value:N?N.toLocaleString():"尚未检查"}],at=async()=>{const l={lastCheckedAt:N?.toISOString()??null,services:Y,adminStatus:te,ddnsStatus:u,publicIpCheck:p,routes:H,stableDataUrl:re,recommendedRoute:O,sanitizedConfig:i?{env:i.env,secrets:i.secrets??{}}:null};await navigator.clipboard.writeText(JSON.stringify(l,null,2)),R("状态 JSON 已复制")},it=async()=>{await navigator.clipboard.writeText(re),R("稳定资料入口已复制")};return e.jsxs("div",{className:"p-4 sm:p-8 max-w-6xl space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"type-h1",children:"状态"}),e.jsx("p",{className:"mt-2 max-w-[65ch] text-sm text-muted-foreground",children:"查看 Xpod 是否正常运行,以及当前可以从哪里访问。"})]}),e.jsxs("div",{"data-testid":"status-page-actions",className:"flex items-center gap-1 self-end lg:shrink-0 lg:self-start",children:[e.jsx(he,{type:"button",variant:"ghost",size:"icon","aria-label":"刷新状态",title:"刷新状态",onClick:()=>t?t.refresh():void D(),disabled:L||t?.refreshing,children:e.jsx(bt,{className:`h-4 w-4 ${L||t?.refreshing?"animate-spin":""}`,"aria-hidden":"true"})}),e.jsx(he,{type:"button",variant:"ghost",size:"icon","aria-label":"复制状态 JSON",title:"复制状态 JSON",onClick:()=>{at()},children:e.jsx(Dt,{className:"h-4 w-4","aria-hidden":"true"})})]})]}),E?e.jsx("p",{className:"text-sm text-success dark:text-success",children:E}):null,y?e.jsx("div",{className:"rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:y}):null,e.jsxs("section",{"data-testid":"overview-conclusion","data-conclusion-tone":Ne.tone,className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Ve,{state:V,children:Ke(V)}),e.jsx("h2",{className:"text-2xl font-semibold",children:Ne.headline})]}),e.jsx("p",{className:"max-w-[65ch] text-sm text-muted-foreground",children:Ne.detail}),e.jsx("div",{"data-testid":"overview-facts",className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:rt.map(l=>e.jsxs("div",{"data-testid":"overview-fact","data-fact-label":l.label,className:"rounded-lg border border-border bg-card p-3",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:l.label}),e.jsx("div",{className:"mt-1 break-all text-sm",children:l.value})]},l.label))})]}),e.jsx(z,{variant:"bordered",children:e.jsx(X,{className:"pt-5",children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ve,{state:V,children:Ke(V)}),e.jsx("div",{className:"text-2xl font-semibold",children:"Xpod runtime"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:N?`最后检查: ${N.toLocaleString()}`:"等待第一次检查。"}),e.jsxs("div",{className:"pt-3",children:[e.jsx("div",{className:"text-sm font-medium",children:"稳定资料入口"}),e.jsxs("div",{"data-testid":"stable-entry-row",className:"mt-1 flex min-w-0 items-center gap-1 rounded-md border border-border bg-muted/30 p-1 pl-3",children:[e.jsx("div",{className:"min-w-0 flex-1 break-all font-mono text-sm",children:re||"等待稳定入口"}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[e.jsx(he,{type:"button",variant:"ghost",size:"icon","aria-label":"复制入口 URL",title:"复制入口 URL",onClick:()=>{it()},disabled:!re,children:e.jsx(Dt,{className:"h-4 w-4","aria-hidden":"true"})}),e.jsx(he,{type:"button",variant:"ghost",size:"icon","aria-label":"打开入口",title:"打开入口",onClick:()=>window.open(re,"_blank"),disabled:!re,children:e.jsx(Ys,{className:"h-4 w-4","aria-hidden":"true"})})]})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium",children:"当前建议路径"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:O?`${O.label}: ${O.detail}`:"正在检查可用的访问方式。"})]})]}),e.jsxs("details",{"data-testid":"overview-details",className:"border-t border-border pt-5",children:[e.jsx("summary",{className:"cursor-pointer text-sm font-medium",children:"专业详情(服务、路径、Cloud 与配置)"}),e.jsxs("div",{className:"pt-5",children:[e.jsxs("div",{className:"mb-3",children:[e.jsx("div",{className:"text-base font-semibold",children:"Services"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"核心运行服务,不包含访问路径或隧道。"})]}),e.jsx("div",{"data-testid":"runtime-services-list",className:"divide-y divide-border rounded-xl border border-border",children:se.map(l=>e.jsxs("div",{"data-testid":"runtime-service-row","data-service-name":l.name,className:"flex min-w-0 flex-col gap-2 p-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:l.name}),e.jsx(Ve,{state:l.state,children:Ke(l.state)})]}),e.jsx("div",{className:"mt-1 break-words text-xs text-muted-foreground",children:l.detail})]}),e.jsxs("div",{className:"shrink-0 text-xs text-muted-foreground sm:text-right",children:[e.jsx("span",{className:"text-muted-foreground",children:"uptime"}),e.jsx("span",{className:"ml-2 font-mono",children:l.uptime})]})]},l.name))})]})]})]})})}),e.jsx(Jn,{problems:Pe}),e.jsxs("details",{"data-testid":"overview-access-details",children:[e.jsx("summary",{className:"cursor-pointer text-sm font-medium",children:"专业详情:访问路径"}),e.jsxs("div",{className:"mt-4 space-y-6",children:[e.jsx("div",{"data-testid":"runtime-access-paths",children:e.jsx(Qn,{routes:H})}),e.jsx(Yn,{routes:H})]})]}),e.jsxs("details",{"data-testid":"overview-runtime-details",children:[e.jsx("summary",{className:"cursor-pointer text-sm font-medium",children:"专业详情:Cloud 与配置"}),e.jsxs("div",{className:"mt-4 space-y-6",children:[e.jsxs(z,{variant:"bordered",children:[e.jsx(ne,{children:e.jsx(oe,{children:"Cloud 协调"})}),e.jsxs(X,{className:"space-y-2 text-sm",children:[e.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-2",children:[e.jsx("span",{className:"text-muted-foreground",children:"nodeId"}),e.jsx("span",{className:"font-mono break-all",children:W.XPOD_NODE_ID||"未上报"})]}),e.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-2",children:[e.jsx("span",{className:"text-muted-foreground",children:"spDomain"}),e.jsx("span",{className:"font-mono break-all",children:W.XPOD_SP_DOMAIN||u?.fqdn||"未分配"})]}),e.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-2",children:[e.jsx("span",{className:"text-muted-foreground",children:"DDNS"}),e.jsx("span",{children:u?.detail||"未上报"})]}),e.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-2",children:[e.jsx("span",{className:"text-muted-foreground",children:"heartbeat"}),e.jsx("span",{children:u?.enabled?"已启用":"未启用或未上报"})]}),e.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-2",children:[e.jsx("span",{className:"text-muted-foreground",children:"模式"}),e.jsx("span",{children:u?.mode||"unknown"})]}),e.jsx("p",{className:"pt-2 text-muted-foreground",children:"Cloud 负责稳定域名和 IDP,本地 SP 负责数据存储与实际接入。"})]})]}),e.jsxs(z,{variant:"bordered",className:"bg-muted/30",children:[e.jsx(ne,{children:e.jsx(oe,{children:"配置摘要"})}),e.jsxs(X,{className:"space-y-2 text-sm",children:[e.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-2",children:[e.jsx("span",{className:"text-muted-foreground",children:"edition"}),e.jsx("span",{children:te?.env.XPOD_EDITION||"local"})]}),e.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-2",children:[e.jsx("span",{className:"text-muted-foreground",children:"baseUrl"}),e.jsx("span",{className:"font-mono break-all",children:re})]}),e.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-2",children:[e.jsx("span",{className:"text-muted-foreground",children:"storage"}),e.jsx("span",{className:"font-mono break-all",children:W.CSS_ROOT_FILE_PATH||"./data"})]}),e.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-2",children:[e.jsx("span",{className:"text-muted-foreground",children:"provider"}),e.jsx("span",{children:ae})]}),e.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-2",children:[e.jsx("span",{className:"text-muted-foreground",children:"tunnelProfile"}),e.jsx("span",{children:de})]}),e.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-2",children:[e.jsx("span",{className:"text-muted-foreground",children:"secrets"}),e.jsxs("span",{children:[Object.entries(i?.secrets??{}).filter(([,l])=>l.configured).length," 个已配置"]})]})]})]}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:["修改运行方式时,请进入 ",e.jsx(Rs,{className:"text-primary underline-offset-4 hover:underline",to:"/services/configuration",children:"配置"}),"。"]})]})]})]})}var Zn=Object.defineProperty,fe=(t,s)=>Zn(t,"name",{value:s,configurable:!0});function ds(t){const s=t+"CollectionProvider",[n,o]=jt(s),[c,r]=n(s,{collectionRef:{current:null},itemMap:new Map}),d=fe(_=>{const{scope:x,children:g}=_,C=a.useRef(null),v=a.useRef(new Map).current;return e.jsx(c,{scope:x,itemMap:v,collectionRef:C,children:g})},"CollectionProvider");d.displayName=s;const m=t+"CollectionSlot",h=ze(m),f=a.forwardRef((_,x)=>{const{scope:g,children:C}=_,v=r(m,g),j=je(x,v.collectionRef);return e.jsx(h,{ref:j,children:C})});f.displayName=m;const b=t+"CollectionItemSlot",S="data-radix-collection-item",w=ze(b),E=a.forwardRef((_,x)=>{const{scope:g,children:C,...v}=_,j=a.useRef(null),A=je(x,j),P=r(b,g);return a.useEffect(()=>(P.itemMap.set(j,{ref:j,...v}),()=>{P.itemMap.delete(j)})),e.jsx(w,{[S]:"",ref:A,children:C})});E.displayName=b;function R(_){const x=r(t+"CollectionConsumer",_);return a.useCallback(()=>{const C=x.collectionRef.current;if(!C)return[];const v=Array.from(C.querySelectorAll(`[${S}]`));return Array.from(x.itemMap.values()).sort((P,q)=>v.indexOf(P.ref.current)-v.indexOf(q.ref.current))},[x.collectionRef,x.itemMap])}return fe(R,"useCollection"),[{Provider:d,Slot:f,ItemSlot:E},R,o]}fe(ds,"createCollection");var Ft=new WeakMap,pe,be,dt=(be=class extends Map{constructor(n){super(n);Pt(this,pe);lt(this,pe,[...super.keys()]),Ft.set(this,!0)}set(n,o){return Ft.get(this)&&(this.has(n)?xe(this,pe)[xe(this,pe).indexOf(n)]=n:xe(this,pe).push(n)),super.set(n,o),this}insert(n,o,c){const r=this.has(o),d=xe(this,pe).length,m=wt(n);let h=m>=0?m:d+m;const f=h<0||h>=d?-1:h;if(f===this.size||r&&f===this.size-1||f===-1)return this.set(o,c),this;const b=this.size+(r?0:1);m<0&&h++;const S=[...xe(this,pe)];let w,E=!1;for(let R=h;R<b;R++)if(h===R){let _=S[R];S[R]===o&&(_=S[R+1]),r&&this.delete(o),w=this.get(_),this.set(o,c)}else{!E&&S[R-1]===o&&(E=!0);const _=S[E?R:R-1],x=w;w=this.get(_),this.delete(_),this.set(_,x)}return this}with(n,o,c){const r=new be(this);return r.insert(n,o,c),r}before(n){const o=xe(this,pe).indexOf(n)-1;if(!(o<0))return this.entryAt(o)}setBefore(n,o,c){const r=xe(this,pe).indexOf(n);return r===-1?this:this.insert(r,o,c)}after(n){let o=xe(this,pe).indexOf(n);if(o=o===-1||o===this.size-1?-1:o+1,o!==-1)return this.entryAt(o)}setAfter(n,o,c){const r=xe(this,pe).indexOf(n);return r===-1?this:this.insert(r+1,o,c)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return lt(this,pe,[]),super.clear()}delete(n){const o=super.delete(n);return o&&xe(this,pe).splice(xe(this,pe).indexOf(n),1),o}deleteAt(n){const o=this.keyAt(n);return o!==void 0?this.delete(o):!1}at(n){const o=tt(xe(this,pe),n);if(o!==void 0)return this.get(o)}entryAt(n){const o=tt(xe(this,pe),n);if(o!==void 0)return[o,this.get(o)]}indexOf(n){return xe(this,pe).indexOf(n)}keyAt(n){return tt(xe(this,pe),n)}from(n,o){const c=this.indexOf(n);if(c===-1)return;let r=c+o;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(n,o){const c=this.indexOf(n);if(c===-1)return;let r=c+o;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(n,o){let c=0;for(const r of this){if(Reflect.apply(n,o,[r,c,this]))return r;c++}}findIndex(n,o){let c=0;for(const r of this){if(Reflect.apply(n,o,[r,c,this]))return c;c++}return-1}filter(n,o){const c=[];let r=0;for(const d of this)Reflect.apply(n,o,[d,r,this])&&c.push(d),r++;return new be(c)}map(n,o){const c=[];let r=0;for(const d of this)c.push([d[0],Reflect.apply(n,o,[d,r,this])]),r++;return new be(c)}reduce(...n){const[o,c]=n;let r=0,d=c??this.at(0);for(const m of this)r===0&&n.length===1?d=m:d=Reflect.apply(o,this,[d,m,r,this]),r++;return d}reduceRight(...n){const[o,c]=n;let r=c??this.at(-1);for(let d=this.size-1;d>=0;d--){const m=this.at(d);d===this.size-1&&n.length===1?r=m:r=Reflect.apply(o,this,[r,m,d,this])}return r}toSorted(n){const o=[...this.entries()].sort(n);return new be(o)}toReversed(){const n=new be;for(let o=this.size-1;o>=0;o--){const c=this.keyAt(o),r=this.get(c);n.set(c,r)}return n}toSpliced(...n){const o=[...this.entries()];return o.splice(...n),new be(o)}slice(n,o){const c=new be;let r=this.size-1;if(n===void 0)return c;n<0&&(n=n+this.size),o!==void 0&&o>0&&(r=o-1);for(let d=n;d<=r;d++){const m=this.keyAt(d),h=this.get(m);c.set(m,h)}return c}every(n,o){let c=0;for(const r of this){if(!Reflect.apply(n,o,[r,c,this]))return!1;c++}return!0}some(n,o){let c=0;for(const r of this){if(Reflect.apply(n,o,[r,c,this]))return!0;c++}return!1}},pe=new WeakMap,fe(be,"OrderedDict"),be);function tt(t,s){if("at"in Array.prototype)return Array.prototype.at.call(t,s);const n=us(t,s);return n===-1?void 0:t[n]}fe(tt,"at");function us(t,s){const n=t.length,o=wt(s),c=o>=0?o:n+o;return c<0||c>=n?-1:c}fe(us,"toSafeIndex");function wt(t){return t!==t||t===0?0:Math.trunc(t)}fe(wt,"toSafeInteger");function eo(t){const s=t+"CollectionProvider",[n,o]=jt(s),[c,r]=n(s,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new dt,setItemMap:fe(()=>{},"setItemMap")}),d=fe(({state:v,...j})=>v?e.jsx(h,{...j,state:v}):e.jsx(m,{...j}),"CollectionProvider");d.displayName=s;const m=fe(v=>{const j=x();return e.jsx(h,{...v,state:j})},"CollectionInit");m.displayName=s+"Init";const h=fe(v=>{const{scope:j,children:A,state:P}=v,q=a.useRef(null),[D,I]=a.useState(null),Y=je(q,I),[te,i]=P;return a.useEffect(()=>{if(!D)return;const u=fs(()=>{});return u.observe(D,{childList:!0,subtree:!0}),()=>{u.disconnect()}},[D]),e.jsx(c,{scope:j,itemMap:te,setItemMap:i,collectionRef:Y,collectionRefObject:q,collectionElement:D,children:A})},"CollectionProviderImpl");h.displayName=s+"Impl";const f=t+"CollectionSlot",b=ze(f),S=a.forwardRef((v,j)=>{const{scope:A,children:P}=v,q=r(f,A),D=je(j,q.collectionRef);return e.jsx(b,{ref:D,children:P})});S.displayName=f;const w=t+"CollectionItemSlot",E="data-radix-collection-item",R=ze(w),_=a.forwardRef((v,j)=>{const{scope:A,children:P,...q}=v,D=a.useRef(null),[I,Y]=a.useState(null),te=je(j,D,Y),i=r(w,A),{setItemMap:u}=i,p=a.useRef(q);ps(p.current,q)||(p.current=q);const N=p.current;return a.useEffect(()=>{const L=N;return u(y=>I?y.has(I)?y.set(I,{...L,element:I}).toSorted(xt):(y.set(I,{...L,element:I}),y.toSorted(xt)):y),()=>{u(y=>!I||!y.has(I)?y:(y.delete(I),new dt(y)))}},[I,N,u]),e.jsx(R,{[E]:"",ref:te,children:P})});_.displayName=w;function x(){return a.useState(new dt)}fe(x,"useInitCollection");function g(v){const{itemMap:j}=r(t+"CollectionConsumer",v);return j}return fe(g,"useCollection"),[{Provider:d,Slot:S,ItemSlot:_},{createCollectionScope:o,useCollection:g,useInitCollection:x}]}fe(eo,"createCollection");function ps(t,s){if(t===s)return!0;if(typeof t!="object"||typeof s!="object"||t==null||s==null)return!1;const n=Object.keys(t),o=Object.keys(s);if(n.length!==o.length)return!1;for(const c of n)if(!Object.prototype.hasOwnProperty.call(s,c)||t[c]!==s[c])return!1;return!0}fe(ps,"shallowEqual");function ms(t,s){return!!(s.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}fe(ms,"isElementPreceding");function xt(t,s){return!t[1].element||!s[1].element?0:ms(t[1].element,s[1].element)?-1:1}fe(xt,"sortByDocumentPosition");function fs(t){return new MutationObserver(n=>{for(const o of n)if(o.type==="childList"){t();return}})}fe(fs,"getChildListObserver");var to=Object.defineProperty,so=(t,s)=>to(t,"name",{value:s,configurable:!0});function hs(t){const s=a.useRef({value:t,previous:t});return a.useMemo(()=>(s.current.value!==t&&(s.current.previous=s.current.value,s.current.value=t),s.current.previous),[t])}so(hs,"usePrevious");var no=Object.defineProperty,Q=(t,s)=>no(t,"name",{value:s,configurable:!0}),oo=[" ","Enter","ArrowUp","ArrowDown"],co=[" ","Enter"],Be="Select",[ot,St,ro]=ds(Be),[$e,AF]=jt(Be,[ro,cs]),Ct=cs(),[ao,Oe]=$e(Be),[io,lo]=$e(Be);function xs(t){const{__scopeSelect:s,children:n,open:o,defaultOpen:c,onOpenChange:r,value:d,defaultValue:m,onValueChange:h,dir:f,name:b,autoComplete:S,disabled:w,required:E,form:R,internal_do_not_use_render:_}=t,x=Ct(s),[g,C]=a.useState(null),[v,j]=a.useState(null),[A,P]=a.useState(!1),q=rs(f),[D,I]=kt({prop:o,defaultProp:c??!1,onChange:r,caller:Be}),[Y,te]=kt({prop:d,defaultProp:m,onChange:h,caller:Be}),i=a.useRef(null),u=a.useRef(Y);a.useEffect(()=>{const B=R?g?.ownerDocument.getElementById(R):g?.form;if(B instanceof HTMLFormElement){const ee=Q(()=>te(u.current),"reset");return B.addEventListener("reset",ee),()=>B.removeEventListener("reset",ee)}},[R,g,te]);const p=g?!!R||!!g.closest("form"):!0,[N,L]=a.useState(new Set),y=ns(),U=Array.from(N).map(B=>B.props.value).join(";"),G=a.useCallback(B=>{L(ee=>new Set(ee).add(B))},[]),F=a.useCallback(B=>{L(ee=>{const W=new Set(ee);return W.delete(B),W})},[]),ce={required:E,trigger:g,onTriggerChange:C,valueNode:v,onValueNodeChange:j,valueNodeHasChildren:A,onValueNodeHasChildrenChange:P,contentId:y,value:Y,onValueChange:te,open:D,onOpenChange:I,dir:q,triggerPointerDownPosRef:i,disabled:w,name:b,autoComplete:S,form:R,nativeOptions:N,nativeSelectKey:U,isFormControl:p};return e.jsx(tn,{...x,children:e.jsx(ao,{scope:s,...ce,children:e.jsx(ot.Provider,{scope:s,children:e.jsx(io,{scope:s,onNativeOptionAdd:G,onNativeOptionRemove:F,children:ws(_)?_(ce):n})})})})}Q(xs,"SelectProvider");var uo=Q(t=>{const{__scopeSelect:s,children:n,...o}=t;return e.jsx(xs,{__scopeSelect:s,...o,internal_do_not_use_render:({isFormControl:c})=>e.jsxs(e.Fragment,{children:[n,c?e.jsx(Io,{__scopeSelect:s}):null]})})},"Select"),po="SelectTrigger",gs=a.forwardRef(Q(function(s,n){const{__scopeSelect:o,disabled:c=!1,...r}=s,d=Ct(o),m=Oe(po,o),h=m.disabled||c,f=je(n,m.onTriggerChange),b=St(o),S=a.useRef("touch"),[w,E,R]=Et(x=>{const g=b().filter(j=>!j.disabled),C=g.find(j=>j.value===m.value),v=Tt(g,x,C);v!==void 0&&m.onValueChange(v.value)}),_=Q(x=>{h||(m.onOpenChange(!0),R()),x&&(m.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})},"handleOpen");return e.jsx(Js,{asChild:!0,...d,children:e.jsx(Re.button,{type:"button",role:"combobox","aria-controls":m.open?m.contentId:void 0,"aria-expanded":m.open,"aria-required":m.required,"aria-autocomplete":"none",dir:m.dir,"data-state":m.open?"open":"closed",disabled:h,"data-disabled":h?"":void 0,"data-placeholder":Ye(m.value)?"":void 0,...r,ref:f,onClick:ve(r.onClick,x=>{x.currentTarget.focus(),S.current!=="mouse"&&_(x)}),onPointerDown:ve(r.onPointerDown,x=>{S.current=x.pointerType;const g=x.target;g.hasPointerCapture(x.pointerId)&&g.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(_(x),x.preventDefault())}),onKeyDown:ve(r.onKeyDown,x=>{const g=w.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&E(x.key),!(g&&x.key===" ")&&oo.includes(x.key)&&(_(),x.preventDefault())})})})},"SelectTrigger")),mo="SelectValue",fo=a.forwardRef(Q(function(s,n){const{__scopeSelect:o,className:c,style:r,children:d,placeholder:m="",...h}=s,f=Oe(mo,o),{onValueNodeHasChildrenChange:b}=f,S=d!==void 0,w=je(n,f.onValueNodeChange);Xe(()=>{b(S)},[b,S]);const E=Ye(f.value);return e.jsx(Re.span,{...h,asChild:E?!1:h.asChild,ref:w,style:{pointerEvents:"none"},children:e.jsx(a.Fragment,{children:E?m:d},E?"placeholder":"value")})},"SelectValue")),ho=a.forwardRef(Q(function(s,n){const{__scopeSelect:o,children:c,...r}=s;return e.jsx(Re.span,{"aria-hidden":!0,...r,ref:n,children:c||"▼"})},"SelectIcon")),xo="SelectPortal",[go,vo]=$e(xo,{forceMount:void 0}),bo=Q(t=>{const{__scopeSelect:s,forceMount:n,...o}=t;return e.jsx(go,{scope:t.__scopeSelect,forceMount:n,children:e.jsx(Ps,{asChild:!0,...o})})},"SelectPortal"),Me="SelectContent",vs=a.forwardRef(Q(function(s,n){const o=vo(Me,s.__scopeSelect),{forceMount:c=o.forceMount,...r}=s,d=Oe(Me,s.__scopeSelect),[m,h]=a.useState();return Xe(()=>{h(new DocumentFragment)},[]),e.jsx(Ds,{present:c||d.open,children:({present:f})=>f?e.jsx(No,{...r,ref:n}):e.jsx(jo,{...r,fragment:m})})},"SelectContent")),jo=a.forwardRef(Q(function(s,n){const{__scopeSelect:o,children:c,fragment:r}=s;return r?os.createPortal(e.jsx(bs,{scope:o,children:e.jsx(ot.Slot,{scope:o,children:e.jsx("div",{ref:n,children:c})})}),r):null},"SelectContentFragment")),Ce=10,[bs,ct]=$e(Me),yo=ze("SelectContent.RemoveScroll"),No=a.forwardRef(Q(function(s,n){const{__scopeSelect:o}=s,{position:c="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:d,onPointerDownOutside:m,side:h,sideOffset:f,align:b,alignOffset:S,arrowPadding:w,collisionBoundary:E,collisionPadding:R,sticky:_,hideWhenDetached:x,avoidCollisions:g,...C}=s,v=Oe(Me,o),[j,A]=a.useState(null),[P,q]=a.useState(null),D=je(n,A),[I,Y]=a.useState(null),[te,i]=a.useState(null),u=St(o),[p,N]=a.useState(!1),L=a.useRef(!1);a.useEffect(()=>{if(j)return ks(j)},[j]),Os();const y=a.useCallback(T=>{const[$,...H]=u().map(O=>O.ref.current),[K]=H.slice(-1),V=document.activeElement;for(const O of T)if(O===V||(O?.scrollIntoView({block:"nearest"}),O===$&&P&&(P.scrollTop=0),O===K&&P&&(P.scrollTop=P.scrollHeight),O?.focus(),document.activeElement!==V))return},[u,P]),U=a.useCallback(()=>y([I,j]),[y,I,j]);a.useEffect(()=>{p&&U()},[p,U]);const{onOpenChange:G,triggerPointerDownPosRef:F}=v;a.useEffect(()=>{if(j){let T={x:0,y:0};const $=Q(K=>{T={x:Math.abs(Math.round(K.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(K.pageY)-(F.current?.y??0))}},"handlePointerMove"),H=Q(K=>{T.x<=10&&T.y<=10?K.preventDefault():K.composedPath().includes(j)||G(!1),document.removeEventListener("pointermove",$),F.current=null},"handlePointerUp");return F.current!==null&&(document.addEventListener("pointermove",$),document.addEventListener("pointerup",H,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",$),document.removeEventListener("pointerup",H,{capture:!0})}}},[j,G,F]),a.useEffect(()=>{const T=Q(()=>G(!1),"close");return window.addEventListener("blur",T),window.addEventListener("resize",T),()=>{window.removeEventListener("blur",T),window.removeEventListener("resize",T)}},[G]);const[ce,B]=Et(T=>{const $=u().filter(V=>!V.disabled),H=$.find(V=>V.ref.current===document.activeElement),K=Tt($,T,H);K&&setTimeout(()=>K.ref.current?.focus())}),ee=a.useCallback((T,$,H)=>{const K=!L.current&&!H;(v.value!==void 0&&v.value===$||K)&&(Y(T),K&&(L.current=!0))},[v.value]),W=a.useCallback(()=>j?.focus(),[j]),ae=a.useCallback((T,$,H)=>{const K=!L.current&&!H;(v.value!==void 0&&v.value===$||K)&&i(T)},[v.value]),de=c==="popper"?Bt:wo,re=de===Bt?{side:h,sideOffset:f,align:b,alignOffset:S,arrowPadding:w,collisionBoundary:E,collisionPadding:R,sticky:_,hideWhenDetached:x,avoidCollisions:g}:{};return e.jsx(bs,{scope:o,content:j,viewport:P,onViewportChange:q,itemRefCallback:ee,selectedItem:I,onItemLeave:W,itemTextRefCallback:ae,focusSelectedItem:U,selectedItemText:te,position:c,isPositioned:p,searchRef:ce,children:e.jsx(Is,{as:yo,allowPinchZoom:!0,children:e.jsx(As,{asChild:!0,trapped:v.open,onMountAutoFocus:T=>{T.preventDefault()},onUnmountAutoFocus:ve(r,T=>{v.trigger?.focus({preventScroll:!0}),T.preventDefault()}),children:e.jsx(qs,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:T=>T.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:e.jsx(de,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:T=>T.preventDefault(),...C,...re,onPlaced:()=>N(!0),ref:D,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:ve(C.onKeyDown,T=>{const $=T.ctrlKey||T.altKey||T.metaKey;if(T.key==="Tab"&&T.preventDefault(),!$&&T.key.length===1&&B(T.key),["ArrowUp","ArrowDown","Home","End"].includes(T.key)){let K=u().filter(V=>!V.disabled).map(V=>V.ref.current);if(["ArrowUp","End"].includes(T.key)&&(K=K.slice().reverse()),["ArrowUp","ArrowDown"].includes(T.key)){const V=T.target,O=K.indexOf(V);K=K.slice(O+1)}setTimeout(()=>y(K)),T.preventDefault()}})})})})})})},"SelectContentImpl")),wo=a.forwardRef(Q(function(s,n){const{__scopeSelect:o,onPlaced:c,...r}=s,d=Oe(Me,o),m=ct(Me,o),[h,f]=a.useState(null),[b,S]=a.useState(null),w=je(n,S),E=St(o),R=a.useRef(!1),_=a.useRef(!0),{viewport:x,selectedItem:g,selectedItemText:C,focusSelectedItem:v}=m,j=a.useCallback(()=>{if(d.trigger&&d.valueNode&&h&&b&&x&&g&&C){const D=d.trigger.getBoundingClientRect(),I=b.getBoundingClientRect(),Y=d.valueNode.getBoundingClientRect(),te=C.getBoundingClientRect();if(d.dir!=="rtl"){const V=te.left-I.left,O=Y.left-V,se=D.left-O,ie=D.width+se,ye=Math.max(ie,I.width),Ne=window.innerWidth-Ce,Pe=ft(O,[Ce,Math.max(Ce,Ne-ye)]);h.style.minWidth=ie+"px",h.style.left=Pe+"px"}else{const V=I.right-te.right,O=window.innerWidth-Y.right-V,se=window.innerWidth-D.right-O,ie=D.width+se,ye=Math.max(ie,I.width),Ne=window.innerWidth-Ce,Pe=ft(O,[Ce,Math.max(Ce,Ne-ye)]);h.style.minWidth=ie+"px",h.style.right=Pe+"px"}const i=E(),u=window.innerHeight-Ce*2,p=x.scrollHeight,N=window.getComputedStyle(b),L=parseInt(N.borderTopWidth,10),y=parseInt(N.paddingTop,10),U=parseInt(N.borderBottomWidth,10),G=parseInt(N.paddingBottom,10),F=L+y+p+G+U,ce=Math.min(g.offsetHeight*5,F),B=window.getComputedStyle(x),ee=parseInt(B.paddingTop,10),W=parseInt(B.paddingBottom,10),ae=D.top+D.height/2-Ce,de=u-ae,re=g.offsetHeight/2,T=g.offsetTop+re,$=L+y+T,H=F-$;if($<=ae){const V=i.length>0&&g===i[i.length-1].ref.current;h.style.bottom="0px";const O=b.clientHeight-x.offsetTop-x.offsetHeight,se=Math.max(de,re+(V?W:0)+O+U),ie=$+se;h.style.height=ie+"px"}else{const V=i.length>0&&g===i[0].ref.current;h.style.top="0px";const se=Math.max(ae,L+x.offsetTop+(V?ee:0)+re)+H;h.style.height=se+"px",x.scrollTop=$-ae+x.offsetTop}h.style.margin=`${Ce}px 0`,h.style.minHeight=ce+"px",h.style.maxHeight=u+"px",c?.(),requestAnimationFrame(()=>R.current=!0)}},[E,d.trigger,d.valueNode,h,b,x,g,C,d.dir,c]);Xe(()=>j(),[j]);const[A,P]=a.useState();Xe(()=>{b&&P(window.getComputedStyle(b).zIndex)},[b]);const q=a.useCallback(D=>{D&&_.current===!0&&(j(),v?.(),_.current=!1)},[j,v]);return e.jsx(So,{scope:o,contentWrapper:h,shouldExpandOnScrollRef:R,onScrollButtonChange:q,children:e.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:e.jsx(Re.div,{...r,ref:w,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})},"SelectItemAlignedPosition")),Bt=a.forwardRef(Q(function(s,n){const{__scopeSelect:o,align:c="start",collisionPadding:r=Ce,...d}=s,m=Ct(o);return e.jsx(Zs,{...m,...d,ref:n,align:c,collisionPadding:r,style:{boxSizing:"border-box",...d.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)"}})},"SelectPopperPosition")),[So,Co]=$e(Me,{}),Ht="SelectViewport",Eo=a.forwardRef(Q(function(s,n){const{__scopeSelect:o,nonce:c,...r}=s,d=ct(Ht,o),m=Co(Ht,o),h=je(n,d.onViewportChange),f=a.useRef(0);return e.jsxs(e.Fragment,{children:[e.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:c}),e.jsx(ot.Slot,{scope:o,children:e.jsx(Re.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:h,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:ve(r.onScroll,b=>{const S=b.currentTarget,{contentWrapper:w,shouldExpandOnScrollRef:E}=m;if(E?.current&&w){const R=Math.abs(f.current-S.scrollTop);if(R>0){const _=window.innerHeight-Ce*2,x=parseFloat(w.style.minHeight),g=parseFloat(w.style.height),C=Math.max(x,g);if(C<_){const v=C+R,j=Math.min(_,v),A=v-j;w.style.height=j+"px",w.style.bottom==="0px"&&(S.scrollTop=A>0?A:0,w.style.justifyContent="flex-end")}}}f.current=S.scrollTop})})})]})},"SelectViewport")),To="SelectGroup",[qF,_o]=$e(To),Lo="SelectLabel",js=a.forwardRef(Q(function(s,n){const{__scopeSelect:o,...c}=s,r=_o(Lo,o);return e.jsx(Re.div,{id:r.id,...c,ref:n})},"SelectLabel")),gt="SelectItem",[Ro,ys]=$e(gt),Ns=a.forwardRef(Q(function(s,n){const{__scopeSelect:o,value:c,disabled:r=!1,textValue:d,...m}=s,h=Oe(gt,o),f=ct(gt,o),b=h.value===c,[S,w]=a.useState(d??""),[E,R]=a.useState(!1),_=yt(j=>f.itemRefCallback?.(j,c,r)),x=je(n,_),g=ns(),C=a.useRef("touch"),v=Q(()=>{r||(h.onValueChange(c),h.onOpenChange(!1))},"handleSelect");return e.jsx(Ro,{scope:o,value:c,disabled:r,textId:g,isSelected:b,onItemTextChange:a.useCallback(j=>{w(A=>A||(j?.textContent??"").trim())},[]),children:e.jsx(ot.ItemSlot,{scope:o,value:c,disabled:r,textValue:S,children:e.jsx(Re.div,{role:"option","aria-labelledby":g,"data-highlighted":E?"":void 0,"aria-selected":b&&E,"data-state":b?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...m,ref:x,onFocus:ve(m.onFocus,()=>R(!0)),onBlur:ve(m.onBlur,()=>R(!1)),onClick:ve(m.onClick,()=>{C.current!=="mouse"&&v()}),onPointerUp:ve(m.onPointerUp,()=>{C.current==="mouse"&&v()}),onPointerDown:ve(m.onPointerDown,j=>{C.current=j.pointerType}),onPointerMove:ve(m.onPointerMove,j=>{C.current=j.pointerType,r?f.onItemLeave?.():C.current==="mouse"&&j.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ve(m.onPointerLeave,j=>{j.currentTarget===document.activeElement&&f.onItemLeave?.()}),onKeyDown:ve(m.onKeyDown,j=>{r||j.target!==j.currentTarget||f.searchRef?.current!==""&&j.key===" "||(co.includes(j.key)&&v(),j.key===" "&&j.preventDefault())})})})})},"SelectItem")),Ze="SelectItemText",Po=a.forwardRef(Q(function(s,n){const{__scopeSelect:o,className:c,style:r,...d}=s,m=Oe(Ze,o),h=ct(Ze,o),f=ys(Ze,o),b=lo(Ze,o),[S,w]=a.useState(null),E=yt(v=>h.itemTextRefCallback?.(v,f.value,f.disabled)),R=je(n,w,f.onItemTextChange,E),_=S?.textContent,x=a.useMemo(()=>e.jsx("option",{value:f.value,disabled:f.disabled,children:_},f.value),[f.disabled,f.value,_]),{onNativeOptionAdd:g,onNativeOptionRemove:C}=b;return Xe(()=>(g(x),()=>C(x)),[g,C,x]),e.jsxs(e.Fragment,{children:[e.jsx(Re.span,{id:f.textId,...d,ref:R}),f.isSelected&&m.valueNode&&!m.valueNodeHasChildren&&!Ye(m.value)?os.createPortal(d.children,m.valueNode):null]})},"SelectItemText")),Do="SelectItemIndicator",ko=a.forwardRef(Q(function(s,n){const{__scopeSelect:o,...c}=s;return ys(Do,o).isSelected?e.jsx(Re.span,{"aria-hidden":!0,...c,ref:n}):null},"SelectItemIndicator")),Oo="SelectBubbleInput",Io=a.forwardRef(Q(function({__scopeSelect:s,...n},o){const c=Oe(Oo,s),{value:r,onValueChange:d,required:m,disabled:h,name:f,autoComplete:b,form:S}=c,{nativeOptions:w,nativeSelectKey:E}=c,R=a.useRef(null),_=je(o,R),x=r??"",g=hs(x),C=Array.from(w).some(v=>(v.props.value??"")==="");return a.useEffect(()=>{const v=R.current;if(!v)return;const j=window.HTMLSelectElement.prototype,P=Object.getOwnPropertyDescriptor(j,"value").set;if(g!==x&&P){const q=new Event("change",{bubbles:!0});P.call(v,x),v.dispatchEvent(q)}},[g,x]),e.jsxs(Re.select,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:b,disabled:h,form:S,onChange:v=>d(v.target.value),...n,style:{...en,...n.style},ref:_,defaultValue:x,children:[Ye(r)&&!C?e.jsx("option",{value:""}):null,Array.from(w)]},E)},"SelectBubbleInput"));function ws(t){return typeof t=="function"}Q(ws,"isFunction");function Ye(t){return t===""||t===void 0}Q(Ye,"shouldShowPlaceholder");function Et(t){const s=yt(t),n=a.useRef(""),o=a.useRef(0),c=a.useCallback(d=>{const m=n.current+d;s(m),Q((function h(f){n.current=f,window.clearTimeout(o.current),f!==""&&(o.current=window.setTimeout(()=>h(""),1e3))}),"updateSearch")(m)},[s]),r=a.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return a.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,c,r]}Q(Et,"useTypeaheadSearch");function Tt(t,s,n){const c=s.length>1&&Array.from(s).every(f=>f===s[0])?s[0]:s,r=n?t.indexOf(n):-1;let d=Ss(t,Math.max(r,0));c.length===1&&(d=d.filter(f=>f!==n));const h=d.find(f=>f.textValue.toLowerCase().startsWith(c.toLowerCase()));return h!==n?h:void 0}Q(Tt,"findNextItem");function Ss(t,s){return t.map((n,o)=>t[(s+o)%t.length])}Q(Ss,"wrapArray");const Ae=uo,qe=fo,De=a.forwardRef(({className:t,children:s,...n},o)=>e.jsxs(gs,{ref:o,className:le("flex h-9 items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm","placeholder:text-muted-foreground focus:outline-none focus-visible:border-primary","disabled:cursor-not-allowed disabled:opacity-50",t),...n,children:[s,e.jsx(ho,{asChild:!0,children:e.jsx(hn,{className:"h-4 w-4 opacity-50"})})]}));De.displayName=gs.displayName;const ke=a.forwardRef(({className:t,children:s,position:n="popper",...o},c)=>e.jsx(bo,{children:e.jsx(vs,{ref:c,className:le("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground 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","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...o,children:e.jsx(Eo,{className:le("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:s})})}));ke.displayName=vs.displayName;const Ao=a.forwardRef(({className:t,...s},n)=>e.jsx(js,{ref:n,className:le("px-2 py-1.5 text-sm font-semibold",t),...s}));Ao.displayName=js.displayName;const Z=a.forwardRef(({className:t,children:s,...n},o)=>e.jsxs(Ns,{ref:o,className:le("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[e.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(ko,{children:e.jsx(mn,{className:"h-4 w-4"})})}),e.jsx(Po,{children:s})]}));Z.displayName=Ns.displayName;var ut={},Se={};const qo="Á",Mo="á",$o="Ă",Uo="ă",Fo="∾",Bo="∿",Ho="∾̳",Vo="Â",Ko="â",zo="´",Xo="А",Go="а",Wo="Æ",Qo="æ",Yo="⁡",Jo="𝔄",Zo="𝔞",ec="À",tc="à",sc="ℵ",nc="ℵ",oc="Α",cc="α",rc="Ā",ac="ā",ic="⨿",lc="&",dc="&",uc="⩕",pc="⩓",mc="∧",fc="⩜",hc="⩘",xc="⩚",gc="∠",vc="⦤",bc="∠",jc="⦨",yc="⦩",Nc="⦪",wc="⦫",Sc="⦬",Cc="⦭",Ec="⦮",Tc="⦯",_c="∡",Lc="∟",Rc="⊾",Pc="⦝",Dc="∢",kc="Å",Oc="⍼",Ic="Ą",Ac="ą",qc="𝔸",Mc="𝕒",$c="⩯",Uc="≈",Fc="⩰",Bc="≊",Hc="≋",Vc="'",Kc="⁡",zc="≈",Xc="≊",Gc="Å",Wc="å",Qc="𝒜",Yc="𝒶",Jc="≔",Zc="*",er="≈",tr="≍",sr="Ã",nr="ã",or="Ä",cr="ä",rr="∳",ar="⨑",ir="≌",lr="϶",dr="‵",ur="∽",pr="⋍",mr="∖",fr="⫧",hr="⊽",xr="⌅",gr="⌆",vr="⌅",br="⎵",jr="⎶",yr="≌",Nr="Б",wr="б",Sr="„",Cr="∵",Er="∵",Tr="∵",_r="⦰",Lr="϶",Rr="ℬ",Pr="ℬ",Dr="Β",kr="β",Or="ℶ",Ir="≬",Ar="𝔅",qr="𝔟",Mr="⋂",$r="◯",Ur="⋃",Fr="⨀",Br="⨁",Hr="⨂",Vr="⨆",Kr="★",zr="▽",Xr="△",Gr="⨄",Wr="⋁",Qr="⋀",Yr="⤍",Jr="⧫",Zr="▪",ea="▴",ta="▾",sa="◂",na="▸",oa="␣",ca="▒",ra="░",aa="▓",ia="█",la="=⃥",da="≡⃥",ua="⫭",pa="⌐",ma="𝔹",fa="𝕓",ha="⊥",xa="⊥",ga="⋈",va="⧉",ba="┐",ja="╕",ya="╖",Na="╗",wa="┌",Sa="╒",Ca="╓",Ea="╔",Ta="─",_a="═",La="┬",Ra="╤",Pa="╥",Da="╦",ka="┴",Oa="╧",Ia="╨",Aa="╩",qa="⊟",Ma="⊞",$a="⊠",Ua="┘",Fa="╛",Ba="╜",Ha="╝",Va="└",Ka="╘",za="╙",Xa="╚",Ga="│",Wa="║",Qa="┼",Ya="╪",Ja="╫",Za="╬",ei="┤",ti="╡",si="╢",ni="╣",oi="├",ci="╞",ri="╟",ai="╠",ii="‵",li="˘",di="˘",ui="¦",pi="𝒷",mi="ℬ",fi="⁏",hi="∽",xi="⋍",gi="⧅",vi="\\",bi="⟈",ji="•",yi="•",Ni="≎",wi="⪮",Si="≏",Ci="≎",Ei="≏",Ti="Ć",_i="ć",Li="⩄",Ri="⩉",Pi="⩋",Di="∩",ki="⋒",Oi="⩇",Ii="⩀",Ai="ⅅ",qi="∩︀",Mi="⁁",$i="ˇ",Ui="ℭ",Fi="⩍",Bi="Č",Hi="č",Vi="Ç",Ki="ç",zi="Ĉ",Xi="ĉ",Gi="∰",Wi="⩌",Qi="⩐",Yi="Ċ",Ji="ċ",Zi="¸",el="¸",tl="⦲",sl="¢",nl="·",ol="·",cl="𝔠",rl="ℭ",al="Ч",il="ч",ll="✓",dl="✓",ul="Χ",pl="χ",ml="ˆ",fl="≗",hl="↺",xl="↻",gl="⊛",vl="⊚",bl="⊝",jl="⊙",yl="®",Nl="Ⓢ",wl="⊖",Sl="⊕",Cl="⊗",El="○",Tl="⧃",_l="≗",Ll="⨐",Rl="⫯",Pl="⧂",Dl="∲",kl="”",Ol="’",Il="♣",Al="♣",ql=":",Ml="∷",$l="⩴",Ul="≔",Fl="≔",Bl=",",Hl="@",Vl="∁",Kl="∘",zl="∁",Xl="ℂ",Gl="≅",Wl="⩭",Ql="≡",Yl="∮",Jl="∯",Zl="∮",ed="𝕔",td="ℂ",sd="∐",nd="∐",od="©",cd="©",rd="℗",ad="∳",id="↵",ld="✗",dd="⨯",ud="𝒞",pd="𝒸",md="⫏",fd="⫑",hd="⫐",xd="⫒",gd="⋯",vd="⤸",bd="⤵",jd="⋞",yd="⋟",Nd="↶",wd="⤽",Sd="⩈",Cd="⩆",Ed="≍",Td="∪",_d="⋓",Ld="⩊",Rd="⊍",Pd="⩅",Dd="∪︀",kd="↷",Od="⤼",Id="⋞",Ad="⋟",qd="⋎",Md="⋏",$d="¤",Ud="↶",Fd="↷",Bd="⋎",Hd="⋏",Vd="∲",Kd="∱",zd="⌭",Xd="†",Gd="‡",Wd="ℸ",Qd="↓",Yd="↡",Jd="⇓",Zd="‐",eu="⫤",tu="⊣",su="⤏",nu="˝",ou="Ď",cu="ď",ru="Д",au="д",iu="‡",lu="⇊",du="ⅅ",uu="ⅆ",pu="⤑",mu="⩷",fu="°",hu="∇",xu="Δ",gu="δ",vu="⦱",bu="⥿",ju="𝔇",yu="𝔡",Nu="⥥",wu="⇃",Su="⇂",Cu="´",Eu="˙",Tu="˝",_u="`",Lu="˜",Ru="⋄",Pu="⋄",Du="⋄",ku="♦",Ou="♦",Iu="¨",Au="ⅆ",qu="ϝ",Mu="⋲",$u="÷",Uu="÷",Fu="⋇",Bu="⋇",Hu="Ђ",Vu="ђ",Ku="⌞",zu="⌍",Xu="$",Gu="𝔻",Wu="𝕕",Qu="¨",Yu="˙",Ju="⃜",Zu="≐",ep="≑",tp="≐",sp="∸",np="∔",op="⊡",cp="⌆",rp="∯",ap="¨",ip="⇓",lp="⇐",dp="⇔",up="⫤",pp="⟸",mp="⟺",fp="⟹",hp="⇒",xp="⊨",gp="⇑",vp="⇕",bp="∥",jp="⤓",yp="↓",Np="↓",wp="⇓",Sp="⇵",Cp="̑",Ep="⇊",Tp="⇃",_p="⇂",Lp="⥐",Rp="⥞",Pp="⥖",Dp="↽",kp="⥟",Op="⥗",Ip="⇁",Ap="↧",qp="⊤",Mp="⤐",$p="⌟",Up="⌌",Fp="𝒟",Bp="𝒹",Hp="Ѕ",Vp="ѕ",Kp="⧶",zp="Đ",Xp="đ",Gp="⋱",Wp="▿",Qp="▾",Yp="⇵",Jp="⥯",Zp="⦦",em="Џ",tm="џ",sm="⟿",nm="É",om="é",cm="⩮",rm="Ě",am="ě",im="Ê",lm="ê",dm="≖",um="≕",pm="Э",mm="э",fm="⩷",hm="Ė",xm="ė",gm="≑",vm="ⅇ",bm="≒",jm="𝔈",ym="𝔢",Nm="⪚",wm="È",Sm="è",Cm="⪖",Em="⪘",Tm="⪙",_m="∈",Lm="⏧",Rm="ℓ",Pm="⪕",Dm="⪗",km="Ē",Om="ē",Im="∅",Am="∅",qm="◻",Mm="∅",$m="▫",Um=" ",Fm=" ",Bm=" ",Hm="Ŋ",Vm="ŋ",Km=" ",zm="Ę",Xm="ę",Gm="𝔼",Wm="𝕖",Qm="⋕",Ym="⧣",Jm="⩱",Zm="ε",ef="Ε",tf="ε",sf="ϵ",nf="≖",of="≕",cf="≂",rf="⪖",af="⪕",lf="⩵",df="=",uf="≂",pf="≟",mf="⇌",ff="≡",hf="⩸",xf="⧥",gf="⥱",vf="≓",bf="ℯ",jf="ℰ",yf="≐",Nf="⩳",wf="≂",Sf="Η",Cf="η",Ef="Ð",Tf="ð",_f="Ë",Lf="ë",Rf="€",Pf="!",Df="∃",kf="∃",Of="ℰ",If="ⅇ",Af="ⅇ",qf="≒",Mf="Ф",$f="ф",Uf="♀",Ff="ffi",Bf="ff",Hf="ffl",Vf="𝔉",Kf="𝔣",zf="fi",Xf="◼",Gf="▪",Wf="fj",Qf="♭",Yf="fl",Jf="▱",Zf="ƒ",eh="𝔽",th="𝕗",sh="∀",nh="∀",oh="⋔",ch="⫙",rh="ℱ",ah="⨍",ih="½",lh="⅓",dh="¼",uh="⅕",ph="⅙",mh="⅛",fh="⅔",hh="⅖",xh="¾",gh="⅗",vh="⅜",bh="⅘",jh="⅚",yh="⅝",Nh="⅞",wh="⁄",Sh="⌢",Ch="𝒻",Eh="ℱ",Th="ǵ",_h="Γ",Lh="γ",Rh="Ϝ",Ph="ϝ",Dh="⪆",kh="Ğ",Oh="ğ",Ih="Ģ",Ah="Ĝ",qh="ĝ",Mh="Г",$h="г",Uh="Ġ",Fh="ġ",Bh="≥",Hh="≧",Vh="⪌",Kh="⋛",zh="≥",Xh="≧",Gh="⩾",Wh="⪩",Qh="⩾",Yh="⪀",Jh="⪂",Zh="⪄",ex="⋛︀",tx="⪔",sx="𝔊",nx="𝔤",ox="≫",cx="⋙",rx="⋙",ax="ℷ",ix="Ѓ",lx="ѓ",dx="⪥",ux="≷",px="⪒",mx="⪤",fx="⪊",hx="⪊",xx="⪈",gx="≩",vx="⪈",bx="≩",jx="⋧",yx="𝔾",Nx="𝕘",wx="`",Sx="≥",Cx="⋛",Ex="≧",Tx="⪢",_x="≷",Lx="⩾",Rx="≳",Px="𝒢",Dx="ℊ",kx="≳",Ox="⪎",Ix="⪐",Ax="⪧",qx="⩺",Mx=">",$x=">",Ux="≫",Fx="⋗",Bx="⦕",Hx="⩼",Vx="⪆",Kx="⥸",zx="⋗",Xx="⋛",Gx="⪌",Wx="≷",Qx="≳",Yx="≩︀",Jx="≩︀",Zx="ˇ",eg=" ",tg="½",sg="ℋ",ng="Ъ",og="ъ",cg="⥈",rg="↔",ag="⇔",ig="↭",lg="^",dg="ℏ",ug="Ĥ",pg="ĥ",mg="♥",fg="♥",hg="…",xg="⊹",gg="𝔥",vg="ℌ",bg="ℋ",jg="⤥",yg="⤦",Ng="⇿",wg="∻",Sg="↩",Cg="↪",Eg="𝕙",Tg="ℍ",_g="―",Lg="─",Rg="𝒽",Pg="ℋ",Dg="ℏ",kg="Ħ",Og="ħ",Ig="≎",Ag="≏",qg="⁃",Mg="‐",$g="Í",Ug="í",Fg="⁣",Bg="Î",Hg="î",Vg="И",Kg="и",zg="İ",Xg="Е",Gg="е",Wg="¡",Qg="⇔",Yg="𝔦",Jg="ℑ",Zg="Ì",ev="ì",tv="ⅈ",sv="⨌",nv="∭",ov="⧜",cv="℩",rv="IJ",av="ij",iv="Ī",lv="ī",dv="ℑ",uv="ⅈ",pv="ℐ",mv="ℑ",fv="ı",hv="ℑ",xv="⊷",gv="Ƶ",vv="⇒",bv="℅",jv="∞",yv="⧝",Nv="ı",wv="⊺",Sv="∫",Cv="∬",Ev="ℤ",Tv="∫",_v="⊺",Lv="⋂",Rv="⨗",Pv="⨼",Dv="⁣",kv="⁢",Ov="Ё",Iv="ё",Av="Į",qv="į",Mv="𝕀",$v="𝕚",Uv="Ι",Fv="ι",Bv="⨼",Hv="¿",Vv="𝒾",Kv="ℐ",zv="∈",Xv="⋵",Gv="⋹",Wv="⋴",Qv="⋳",Yv="∈",Jv="⁢",Zv="Ĩ",eb="ĩ",tb="І",sb="і",nb="Ï",ob="ï",cb="Ĵ",rb="ĵ",ab="Й",ib="й",lb="𝔍",db="𝔧",ub="ȷ",pb="𝕁",mb="𝕛",fb="𝒥",hb="𝒿",xb="Ј",gb="ј",vb="Є",bb="є",jb="Κ",yb="κ",Nb="ϰ",wb="Ķ",Sb="ķ",Cb="К",Eb="к",Tb="𝔎",_b="𝔨",Lb="ĸ",Rb="Х",Pb="х",Db="Ќ",kb="ќ",Ob="𝕂",Ib="𝕜",Ab="𝒦",qb="𝓀",Mb="⇚",$b="Ĺ",Ub="ĺ",Fb="⦴",Bb="ℒ",Hb="Λ",Vb="λ",Kb="⟨",zb="⟪",Xb="⦑",Gb="⟨",Wb="⪅",Qb="ℒ",Yb="«",Jb="⇤",Zb="⤟",ej="←",tj="↞",sj="⇐",nj="⤝",oj="↩",cj="↫",rj="⤹",aj="⥳",ij="↢",lj="⤙",dj="⤛",uj="⪫",pj="⪭",mj="⪭︀",fj="⤌",hj="⤎",xj="❲",gj="{",vj="[",bj="⦋",jj="⦏",yj="⦍",Nj="Ľ",wj="ľ",Sj="Ļ",Cj="ļ",Ej="⌈",Tj="{",_j="Л",Lj="л",Rj="⤶",Pj="“",Dj="„",kj="⥧",Oj="⥋",Ij="↲",Aj="≤",qj="≦",Mj="⟨",$j="⇤",Uj="←",Fj="←",Bj="⇐",Hj="⇆",Vj="↢",Kj="⌈",zj="⟦",Xj="⥡",Gj="⥙",Wj="⇃",Qj="⌊",Yj="↽",Jj="↼",Zj="⇇",ey="↔",ty="↔",sy="⇔",ny="⇆",oy="⇋",cy="↭",ry="⥎",ay="↤",iy="⊣",ly="⥚",dy="⋋",uy="⧏",py="⊲",my="⊴",fy="⥑",hy="⥠",xy="⥘",gy="↿",vy="⥒",by="↼",jy="⪋",yy="⋚",Ny="≤",wy="≦",Sy="⩽",Cy="⪨",Ey="⩽",Ty="⩿",_y="⪁",Ly="⪃",Ry="⋚︀",Py="⪓",Dy="⪅",ky="⋖",Oy="⋚",Iy="⪋",Ay="⋚",qy="≦",My="≶",$y="≶",Uy="⪡",Fy="≲",By="⩽",Hy="≲",Vy="⥼",Ky="⌊",zy="𝔏",Xy="𝔩",Gy="≶",Wy="⪑",Qy="⥢",Yy="↽",Jy="↼",Zy="⥪",eN="▄",tN="Љ",sN="љ",nN="⇇",oN="≪",cN="⋘",rN="⌞",aN="⇚",iN="⥫",lN="◺",dN="Ŀ",uN="ŀ",pN="⎰",mN="⎰",fN="⪉",hN="⪉",xN="⪇",gN="≨",vN="⪇",bN="≨",jN="⋦",yN="⟬",NN="⇽",wN="⟦",SN="⟵",CN="⟵",EN="⟸",TN="⟷",_N="⟷",LN="⟺",RN="⟼",PN="⟶",DN="⟶",kN="⟹",ON="↫",IN="↬",AN="⦅",qN="𝕃",MN="𝕝",$N="⨭",UN="⨴",FN="∗",BN="_",HN="↙",VN="↘",KN="◊",zN="◊",XN="⧫",GN="(",WN="⦓",QN="⇆",YN="⌟",JN="⇋",ZN="⥭",ew="‎",tw="⊿",sw="‹",nw="𝓁",ow="ℒ",cw="↰",rw="↰",aw="≲",iw="⪍",lw="⪏",dw="[",uw="‘",pw="‚",mw="Ł",fw="ł",hw="⪦",xw="⩹",gw="<",vw="<",bw="≪",jw="⋖",yw="⋋",Nw="⋉",ww="⥶",Sw="⩻",Cw="◃",Ew="⊴",Tw="◂",_w="⦖",Lw="⥊",Rw="⥦",Pw="≨︀",Dw="≨︀",kw="¯",Ow="♂",Iw="✠",Aw="✠",qw="↦",Mw="↦",$w="↧",Uw="↤",Fw="↥",Bw="▮",Hw="⨩",Vw="М",Kw="м",zw="—",Xw="∺",Gw="∡",Ww=" ",Qw="ℳ",Yw="𝔐",Jw="𝔪",Zw="℧",eS="µ",tS="*",sS="⫰",nS="∣",oS="·",cS="⊟",rS="−",aS="∸",iS="⨪",lS="∓",dS="⫛",uS="…",pS="∓",mS="⊧",fS="𝕄",hS="𝕞",xS="∓",gS="𝓂",vS="ℳ",bS="∾",jS="Μ",yS="μ",NS="⊸",wS="⊸",SS="∇",CS="Ń",ES="ń",TS="∠⃒",_S="≉",LS="⩰̸",RS="≋̸",PS="ʼn",DS="≉",kS="♮",OS="ℕ",IS="♮",AS=" ",qS="≎̸",MS="≏̸",$S="⩃",US="Ň",FS="ň",BS="Ņ",HS="ņ",VS="≇",KS="⩭̸",zS="⩂",XS="Н",GS="н",WS="–",QS="⤤",YS="↗",JS="⇗",ZS="↗",e0="≠",t0="≐̸",s0="​",n0="​",o0="​",c0="​",r0="≢",a0="⤨",i0="≂̸",l0="≫",d0="≪",u0=`
2
+ `,p0="∄",m0="∄",f0="𝔑",h0="𝔫",x0="≧̸",g0="≱",v0="≱",b0="≧̸",j0="⩾̸",y0="⩾̸",N0="⋙̸",w0="≵",S0="≫⃒",C0="≯",E0="≯",T0="≫̸",_0="↮",L0="⇎",R0="⫲",P0="∋",D0="⋼",k0="⋺",O0="∋",I0="Њ",A0="њ",q0="↚",M0="⇍",$0="‥",U0="≦̸",F0="≰",B0="↚",H0="⇍",V0="↮",K0="⇎",z0="≰",X0="≦̸",G0="⩽̸",W0="⩽̸",Q0="≮",Y0="⋘̸",J0="≴",Z0="≪⃒",e1="≮",t1="⋪",s1="⋬",n1="≪̸",o1="∤",c1="⁠",r1=" ",a1="𝕟",i1="ℕ",l1="⫬",d1="¬",u1="≢",p1="≭",m1="∦",f1="∉",h1="≠",x1="≂̸",g1="∄",v1="≯",b1="≱",j1="≧̸",y1="≫̸",N1="≹",w1="⩾̸",S1="≵",C1="≎̸",E1="≏̸",T1="∉",_1="⋵̸",L1="⋹̸",R1="∉",P1="⋷",D1="⋶",k1="⧏̸",O1="⋪",I1="⋬",A1="≮",q1="≰",M1="≸",$1="≪̸",U1="⩽̸",F1="≴",B1="⪢̸",H1="⪡̸",V1="∌",K1="∌",z1="⋾",X1="⋽",G1="⊀",W1="⪯̸",Q1="⋠",Y1="∌",J1="⧐̸",Z1="⋫",eC="⋭",tC="⊏̸",sC="⋢",nC="⊐̸",oC="⋣",cC="⊂⃒",rC="⊈",aC="⊁",iC="⪰̸",lC="⋡",dC="≿̸",uC="⊃⃒",pC="⊉",mC="≁",fC="≄",hC="≇",xC="≉",gC="∤",vC="∦",bC="∦",jC="⫽⃥",yC="∂̸",NC="⨔",wC="⊀",SC="⋠",CC="⊀",EC="⪯̸",TC="⪯̸",_C="⤳̸",LC="↛",RC="⇏",PC="↝̸",DC="↛",kC="⇏",OC="⋫",IC="⋭",AC="⊁",qC="⋡",MC="⪰̸",$C="𝒩",UC="𝓃",FC="∤",BC="∦",HC="≁",VC="≄",KC="≄",zC="∤",XC="∦",GC="⋢",WC="⋣",QC="⊄",YC="⫅̸",JC="⊈",ZC="⊂⃒",eE="⊈",tE="⫅̸",sE="⊁",nE="⪰̸",oE="⊅",cE="⫆̸",rE="⊉",aE="⊃⃒",iE="⊉",lE="⫆̸",dE="≹",uE="Ñ",pE="ñ",mE="≸",fE="⋪",hE="⋬",xE="⋫",gE="⋭",vE="Ν",bE="ν",jE="#",yE="№",NE=" ",wE="≍⃒",SE="⊬",CE="⊭",EE="⊮",TE="⊯",_E="≥⃒",LE=">⃒",RE="⤄",PE="⧞",DE="⤂",kE="≤⃒",OE="<⃒",IE="⊴⃒",AE="⤃",qE="⊵⃒",ME="∼⃒",$E="⤣",UE="↖",FE="⇖",BE="↖",HE="⤧",VE="Ó",KE="ó",zE="⊛",XE="Ô",GE="ô",WE="⊚",QE="О",YE="о",JE="⊝",ZE="Ő",eT="ő",tT="⨸",sT="⊙",nT="⦼",oT="Œ",cT="œ",rT="⦿",aT="𝔒",iT="𝔬",lT="˛",dT="Ò",uT="ò",pT="⧁",mT="⦵",fT="Ω",hT="∮",xT="↺",gT="⦾",vT="⦻",bT="‾",jT="⧀",yT="Ō",NT="ō",wT="Ω",ST="ω",CT="Ο",ET="ο",TT="⦶",_T="⊖",LT="𝕆",RT="𝕠",PT="⦷",DT="“",kT="‘",OT="⦹",IT="⊕",AT="↻",qT="⩔",MT="∨",$T="⩝",UT="ℴ",FT="ℴ",BT="ª",HT="º",VT="⊶",KT="⩖",zT="⩗",XT="⩛",GT="Ⓢ",WT="𝒪",QT="ℴ",YT="Ø",JT="ø",ZT="⊘",e_="Õ",t_="õ",s_="⨶",n_="⨷",o_="⊗",c_="Ö",r_="ö",a_="⌽",i_="‾",l_="⏞",d_="⎴",u_="⏜",p_="¶",m_="∥",f_="∥",h_="⫳",x_="⫽",g_="∂",v_="∂",b_="П",j_="п",y_="%",N_=".",w_="‰",S_="⊥",C_="‱",E_="𝔓",T_="𝔭",__="Φ",L_="φ",R_="ϕ",P_="ℳ",D_="☎",k_="Π",O_="π",I_="⋔",A_="ϖ",q_="ℏ",M_="ℎ",$_="ℏ",U_="⨣",F_="⊞",B_="⨢",H_="+",V_="∔",K_="⨥",z_="⩲",X_="±",G_="±",W_="⨦",Q_="⨧",Y_="±",J_="ℌ",Z_="⨕",eL="𝕡",tL="ℙ",sL="£",nL="⪷",oL="⪻",cL="≺",rL="≼",aL="⪷",iL="≺",lL="≼",dL="≺",uL="⪯",pL="≼",mL="≾",fL="⪯",hL="⪹",xL="⪵",gL="⋨",vL="⪯",bL="⪳",jL="≾",yL="′",NL="″",wL="ℙ",SL="⪹",CL="⪵",EL="⋨",TL="∏",_L="∏",LL="⌮",RL="⌒",PL="⌓",DL="∝",kL="∝",OL="∷",IL="∝",AL="≾",qL="⊰",ML="𝒫",$L="𝓅",UL="Ψ",FL="ψ",BL=" ",HL="𝔔",VL="𝔮",KL="⨌",zL="𝕢",XL="ℚ",GL="⁗",WL="𝒬",QL="𝓆",YL="ℍ",JL="⨖",ZL="?",eR="≟",tR='"',sR='"',nR="⇛",oR="∽̱",cR="Ŕ",rR="ŕ",aR="√",iR="⦳",lR="⟩",dR="⟫",uR="⦒",pR="⦥",mR="⟩",fR="»",hR="⥵",xR="⇥",gR="⤠",vR="⤳",bR="→",jR="↠",yR="⇒",NR="⤞",wR="↪",SR="↬",CR="⥅",ER="⥴",TR="⤖",_R="↣",LR="↝",RR="⤚",PR="⤜",DR="∶",kR="ℚ",OR="⤍",IR="⤏",AR="⤐",qR="❳",MR="}",$R="]",UR="⦌",FR="⦎",BR="⦐",HR="Ř",VR="ř",KR="Ŗ",zR="ŗ",XR="⌉",GR="}",WR="Р",QR="р",YR="⤷",JR="⥩",ZR="”",eP="”",tP="↳",sP="ℜ",nP="ℛ",oP="ℜ",cP="ℝ",rP="ℜ",aP="▭",iP="®",lP="®",dP="∋",uP="⇋",pP="⥯",mP="⥽",fP="⌋",hP="𝔯",xP="ℜ",gP="⥤",vP="⇁",bP="⇀",jP="⥬",yP="Ρ",NP="ρ",wP="ϱ",SP="⟩",CP="⇥",EP="→",TP="→",_P="⇒",LP="⇄",RP="↣",PP="⌉",DP="⟧",kP="⥝",OP="⥕",IP="⇂",AP="⌋",qP="⇁",MP="⇀",$P="⇄",UP="⇌",FP="⇉",BP="↝",HP="↦",VP="⊢",KP="⥛",zP="⋌",XP="⧐",GP="⊳",WP="⊵",QP="⥏",YP="⥜",JP="⥔",ZP="↾",eD="⥓",tD="⇀",sD="˚",nD="≓",oD="⇄",cD="⇌",rD="‏",aD="⎱",iD="⎱",lD="⫮",dD="⟭",uD="⇾",pD="⟧",mD="⦆",fD="𝕣",hD="ℝ",xD="⨮",gD="⨵",vD="⥰",bD=")",jD="⦔",yD="⨒",ND="⇉",wD="⇛",SD="›",CD="𝓇",ED="ℛ",TD="↱",_D="↱",LD="]",RD="’",PD="’",DD="⋌",kD="⋊",OD="▹",ID="⊵",AD="▸",qD="⧎",MD="⧴",$D="⥨",UD="℞",FD="Ś",BD="ś",HD="‚",VD="⪸",KD="Š",zD="š",XD="⪼",GD="≻",WD="≽",QD="⪰",YD="⪴",JD="Ş",ZD="ş",ek="Ŝ",tk="ŝ",sk="⪺",nk="⪶",ok="⋩",ck="⨓",rk="≿",ak="С",ik="с",lk="⊡",dk="⋅",uk="⩦",pk="⤥",mk="↘",fk="⇘",hk="↘",xk="§",gk=";",vk="⤩",bk="∖",jk="∖",yk="✶",Nk="𝔖",wk="𝔰",Sk="⌢",Ck="♯",Ek="Щ",Tk="щ",_k="Ш",Lk="ш",Rk="↓",Pk="←",Dk="∣",kk="∥",Ok="→",Ik="↑",Ak="­",qk="Σ",Mk="σ",$k="ς",Uk="ς",Fk="∼",Bk="⩪",Hk="≃",Vk="≃",Kk="⪞",zk="⪠",Xk="⪝",Gk="⪟",Wk="≆",Qk="⨤",Yk="⥲",Jk="←",Zk="∘",eO="∖",tO="⨳",sO="⧤",nO="∣",oO="⌣",cO="⪪",rO="⪬",aO="⪬︀",iO="Ь",lO="ь",dO="⌿",uO="⧄",pO="/",mO="𝕊",fO="𝕤",hO="♠",xO="♠",gO="∥",vO="⊓",bO="⊓︀",jO="⊔",yO="⊔︀",NO="√",wO="⊏",SO="⊑",CO="⊏",EO="⊑",TO="⊐",_O="⊒",LO="⊐",RO="⊒",PO="□",DO="□",kO="⊓",OO="⊏",IO="⊑",AO="⊐",qO="⊒",MO="⊔",$O="▪",UO="□",FO="▪",BO="→",HO="𝒮",VO="𝓈",KO="∖",zO="⌣",XO="⋆",GO="⋆",WO="☆",QO="★",YO="ϵ",JO="ϕ",ZO="¯",eI="⊂",tI="⋐",sI="⪽",nI="⫅",oI="⊆",cI="⫃",rI="⫁",aI="⫋",iI="⊊",lI="⪿",dI="⥹",uI="⊂",pI="⋐",mI="⊆",fI="⫅",hI="⊆",xI="⊊",gI="⫋",vI="⫇",bI="⫕",jI="⫓",yI="⪸",NI="≻",wI="≽",SI="≻",CI="⪰",EI="≽",TI="≿",_I="⪰",LI="⪺",RI="⪶",PI="⋩",DI="≿",kI="∋",OI="∑",II="∑",AI="♪",qI="¹",MI="²",$I="³",UI="⊃",FI="⋑",BI="⪾",HI="⫘",VI="⫆",KI="⊇",zI="⫄",XI="⊃",GI="⊇",WI="⟉",QI="⫗",YI="⥻",JI="⫂",ZI="⫌",eA="⊋",tA="⫀",sA="⊃",nA="⋑",oA="⊇",cA="⫆",rA="⊋",aA="⫌",iA="⫈",lA="⫔",dA="⫖",uA="⤦",pA="↙",mA="⇙",fA="↙",hA="⤪",xA="ß",gA=" ",vA="⌖",bA="Τ",jA="τ",yA="⎴",NA="Ť",wA="ť",SA="Ţ",CA="ţ",EA="Т",TA="т",_A="⃛",LA="⌕",RA="𝔗",PA="𝔱",DA="∴",kA="∴",OA="∴",IA="Θ",AA="θ",qA="ϑ",MA="ϑ",$A="≈",UA="∼",FA="  ",BA=" ",HA=" ",VA="≈",KA="∼",zA="Þ",XA="þ",GA="˜",WA="∼",QA="≃",YA="≅",JA="≈",ZA="⨱",e2="⊠",t2="×",s2="⨰",n2="∭",o2="⤨",c2="⌶",r2="⫱",a2="⊤",i2="𝕋",l2="𝕥",d2="⫚",u2="⤩",p2="‴",m2="™",f2="™",h2="▵",x2="▿",g2="◃",v2="⊴",b2="≜",j2="▹",y2="⊵",N2="◬",w2="≜",S2="⨺",C2="⃛",E2="⨹",T2="⧍",_2="⨻",L2="⏢",R2="𝒯",P2="𝓉",D2="Ц",k2="ц",O2="Ћ",I2="ћ",A2="Ŧ",q2="ŧ",M2="≬",$2="↞",U2="↠",F2="Ú",B2="ú",H2="↑",V2="↟",K2="⇑",z2="⥉",X2="Ў",G2="ў",W2="Ŭ",Q2="ŭ",Y2="Û",J2="û",Z2="У",eq="у",tq="⇅",sq="Ű",nq="ű",oq="⥮",cq="⥾",rq="𝔘",aq="𝔲",iq="Ù",lq="ù",dq="⥣",uq="↿",pq="↾",mq="▀",fq="⌜",hq="⌜",xq="⌏",gq="◸",vq="Ū",bq="ū",jq="¨",yq="_",Nq="⏟",wq="⎵",Sq="⏝",Cq="⋃",Eq="⊎",Tq="Ų",_q="ų",Lq="𝕌",Rq="𝕦",Pq="⤒",Dq="↑",kq="↑",Oq="⇑",Iq="⇅",Aq="↕",qq="↕",Mq="⇕",$q="⥮",Uq="↿",Fq="↾",Bq="⊎",Hq="↖",Vq="↗",Kq="υ",zq="ϒ",Xq="ϒ",Gq="Υ",Wq="υ",Qq="↥",Yq="⊥",Jq="⇈",Zq="⌝",eM="⌝",tM="⌎",sM="Ů",nM="ů",oM="◹",cM="𝒰",rM="𝓊",aM="⋰",iM="Ũ",lM="ũ",dM="▵",uM="▴",pM="⇈",mM="Ü",fM="ü",hM="⦧",xM="⦜",gM="ϵ",vM="ϰ",bM="∅",jM="ϕ",yM="ϖ",NM="∝",wM="↕",SM="⇕",CM="ϱ",EM="ς",TM="⊊︀",_M="⫋︀",LM="⊋︀",RM="⫌︀",PM="ϑ",DM="⊲",kM="⊳",OM="⫨",IM="⫫",AM="⫩",qM="В",MM="в",$M="⊢",UM="⊨",FM="⊩",BM="⊫",HM="⫦",VM="⊻",KM="∨",zM="⋁",XM="≚",GM="⋮",WM="|",QM="‖",YM="|",JM="‖",ZM="∣",e$="|",t$="❘",s$="≀",n$=" ",o$="𝔙",c$="𝔳",r$="⊲",a$="⊂⃒",i$="⊃⃒",l$="𝕍",d$="𝕧",u$="∝",p$="⊳",m$="𝒱",f$="𝓋",h$="⫋︀",x$="⊊︀",g$="⫌︀",v$="⊋︀",b$="⊪",j$="⦚",y$="Ŵ",N$="ŵ",w$="⩟",S$="∧",C$="⋀",E$="≙",T$="℘",_$="𝔚",L$="𝔴",R$="𝕎",P$="𝕨",D$="℘",k$="≀",O$="≀",I$="𝒲",A$="𝓌",q$="⋂",M$="◯",$$="⋃",U$="▽",F$="𝔛",B$="𝔵",H$="⟷",V$="⟺",K$="Ξ",z$="ξ",X$="⟵",G$="⟸",W$="⟼",Q$="⋻",Y$="⨀",J$="𝕏",Z$="𝕩",eU="⨁",tU="⨂",sU="⟶",nU="⟹",oU="𝒳",cU="𝓍",rU="⨆",aU="⨄",iU="△",lU="⋁",dU="⋀",uU="Ý",pU="ý",mU="Я",fU="я",hU="Ŷ",xU="ŷ",gU="Ы",vU="ы",bU="¥",jU="𝔜",yU="𝔶",NU="Ї",wU="ї",SU="𝕐",CU="𝕪",EU="𝒴",TU="𝓎",_U="Ю",LU="ю",RU="ÿ",PU="Ÿ",DU="Ź",kU="ź",OU="Ž",IU="ž",AU="З",qU="з",MU="Ż",$U="ż",UU="ℨ",FU="​",BU="Ζ",HU="ζ",VU="𝔷",KU="ℨ",zU="Ж",XU="ж",GU="⇝",WU="𝕫",QU="ℤ",YU="𝒵",JU="𝓏",ZU="‍",e3="‌",Cs={Aacute:qo,aacute:Mo,Abreve:$o,abreve:Uo,ac:Fo,acd:Bo,acE:Ho,Acirc:Vo,acirc:Ko,acute:zo,Acy:Xo,acy:Go,AElig:Wo,aelig:Qo,af:Yo,Afr:Jo,afr:Zo,Agrave:ec,agrave:tc,alefsym:sc,aleph:nc,Alpha:oc,alpha:cc,Amacr:rc,amacr:ac,amalg:ic,amp:lc,AMP:dc,andand:uc,And:pc,and:mc,andd:fc,andslope:hc,andv:xc,ang:gc,ange:vc,angle:bc,angmsdaa:jc,angmsdab:yc,angmsdac:Nc,angmsdad:wc,angmsdae:Sc,angmsdaf:Cc,angmsdag:Ec,angmsdah:Tc,angmsd:_c,angrt:Lc,angrtvb:Rc,angrtvbd:Pc,angsph:Dc,angst:kc,angzarr:Oc,Aogon:Ic,aogon:Ac,Aopf:qc,aopf:Mc,apacir:$c,ap:Uc,apE:Fc,ape:Bc,apid:Hc,apos:Vc,ApplyFunction:Kc,approx:zc,approxeq:Xc,Aring:Gc,aring:Wc,Ascr:Qc,ascr:Yc,Assign:Jc,ast:Zc,asymp:er,asympeq:tr,Atilde:sr,atilde:nr,Auml:or,auml:cr,awconint:rr,awint:ar,backcong:ir,backepsilon:lr,backprime:dr,backsim:ur,backsimeq:pr,Backslash:mr,Barv:fr,barvee:hr,barwed:xr,Barwed:gr,barwedge:vr,bbrk:br,bbrktbrk:jr,bcong:yr,Bcy:Nr,bcy:wr,bdquo:Sr,becaus:Cr,because:Er,Because:Tr,bemptyv:_r,bepsi:Lr,bernou:Rr,Bernoullis:Pr,Beta:Dr,beta:kr,beth:Or,between:Ir,Bfr:Ar,bfr:qr,bigcap:Mr,bigcirc:$r,bigcup:Ur,bigodot:Fr,bigoplus:Br,bigotimes:Hr,bigsqcup:Vr,bigstar:Kr,bigtriangledown:zr,bigtriangleup:Xr,biguplus:Gr,bigvee:Wr,bigwedge:Qr,bkarow:Yr,blacklozenge:Jr,blacksquare:Zr,blacktriangle:ea,blacktriangledown:ta,blacktriangleleft:sa,blacktriangleright:na,blank:oa,blk12:ca,blk14:ra,blk34:aa,block:ia,bne:la,bnequiv:da,bNot:ua,bnot:pa,Bopf:ma,bopf:fa,bot:ha,bottom:xa,bowtie:ga,boxbox:va,boxdl:ba,boxdL:ja,boxDl:ya,boxDL:Na,boxdr:wa,boxdR:Sa,boxDr:Ca,boxDR:Ea,boxh:Ta,boxH:_a,boxhd:La,boxHd:Ra,boxhD:Pa,boxHD:Da,boxhu:ka,boxHu:Oa,boxhU:Ia,boxHU:Aa,boxminus:qa,boxplus:Ma,boxtimes:$a,boxul:Ua,boxuL:Fa,boxUl:Ba,boxUL:Ha,boxur:Va,boxuR:Ka,boxUr:za,boxUR:Xa,boxv:Ga,boxV:Wa,boxvh:Qa,boxvH:Ya,boxVh:Ja,boxVH:Za,boxvl:ei,boxvL:ti,boxVl:si,boxVL:ni,boxvr:oi,boxvR:ci,boxVr:ri,boxVR:ai,bprime:ii,breve:li,Breve:di,brvbar:ui,bscr:pi,Bscr:mi,bsemi:fi,bsim:hi,bsime:xi,bsolb:gi,bsol:vi,bsolhsub:bi,bull:ji,bullet:yi,bump:Ni,bumpE:wi,bumpe:Si,Bumpeq:Ci,bumpeq:Ei,Cacute:Ti,cacute:_i,capand:Li,capbrcup:Ri,capcap:Pi,cap:Di,Cap:ki,capcup:Oi,capdot:Ii,CapitalDifferentialD:Ai,caps:qi,caret:Mi,caron:$i,Cayleys:Ui,ccaps:Fi,Ccaron:Bi,ccaron:Hi,Ccedil:Vi,ccedil:Ki,Ccirc:zi,ccirc:Xi,Cconint:Gi,ccups:Wi,ccupssm:Qi,Cdot:Yi,cdot:Ji,cedil:Zi,Cedilla:el,cemptyv:tl,cent:sl,centerdot:nl,CenterDot:ol,cfr:cl,Cfr:rl,CHcy:al,chcy:il,check:ll,checkmark:dl,Chi:ul,chi:pl,circ:ml,circeq:fl,circlearrowleft:hl,circlearrowright:xl,circledast:gl,circledcirc:vl,circleddash:bl,CircleDot:jl,circledR:yl,circledS:Nl,CircleMinus:wl,CirclePlus:Sl,CircleTimes:Cl,cir:El,cirE:Tl,cire:_l,cirfnint:Ll,cirmid:Rl,cirscir:Pl,ClockwiseContourIntegral:Dl,CloseCurlyDoubleQuote:kl,CloseCurlyQuote:Ol,clubs:Il,clubsuit:Al,colon:ql,Colon:Ml,Colone:$l,colone:Ul,coloneq:Fl,comma:Bl,commat:Hl,comp:Vl,compfn:Kl,complement:zl,complexes:Xl,cong:Gl,congdot:Wl,Congruent:Ql,conint:Yl,Conint:Jl,ContourIntegral:Zl,copf:ed,Copf:td,coprod:sd,Coproduct:nd,copy:od,COPY:cd,copysr:rd,CounterClockwiseContourIntegral:ad,crarr:id,cross:ld,Cross:dd,Cscr:ud,cscr:pd,csub:md,csube:fd,csup:hd,csupe:xd,ctdot:gd,cudarrl:vd,cudarrr:bd,cuepr:jd,cuesc:yd,cularr:Nd,cularrp:wd,cupbrcap:Sd,cupcap:Cd,CupCap:Ed,cup:Td,Cup:_d,cupcup:Ld,cupdot:Rd,cupor:Pd,cups:Dd,curarr:kd,curarrm:Od,curlyeqprec:Id,curlyeqsucc:Ad,curlyvee:qd,curlywedge:Md,curren:$d,curvearrowleft:Ud,curvearrowright:Fd,cuvee:Bd,cuwed:Hd,cwconint:Vd,cwint:Kd,cylcty:zd,dagger:Xd,Dagger:Gd,daleth:Wd,darr:Qd,Darr:Yd,dArr:Jd,dash:Zd,Dashv:eu,dashv:tu,dbkarow:su,dblac:nu,Dcaron:ou,dcaron:cu,Dcy:ru,dcy:au,ddagger:iu,ddarr:lu,DD:du,dd:uu,DDotrahd:pu,ddotseq:mu,deg:fu,Del:hu,Delta:xu,delta:gu,demptyv:vu,dfisht:bu,Dfr:ju,dfr:yu,dHar:Nu,dharl:wu,dharr:Su,DiacriticalAcute:Cu,DiacriticalDot:Eu,DiacriticalDoubleAcute:Tu,DiacriticalGrave:_u,DiacriticalTilde:Lu,diam:Ru,diamond:Pu,Diamond:Du,diamondsuit:ku,diams:Ou,die:Iu,DifferentialD:Au,digamma:qu,disin:Mu,div:$u,divide:Uu,divideontimes:Fu,divonx:Bu,DJcy:Hu,djcy:Vu,dlcorn:Ku,dlcrop:zu,dollar:Xu,Dopf:Gu,dopf:Wu,Dot:Qu,dot:Yu,DotDot:Ju,doteq:Zu,doteqdot:ep,DotEqual:tp,dotminus:sp,dotplus:np,dotsquare:op,doublebarwedge:cp,DoubleContourIntegral:rp,DoubleDot:ap,DoubleDownArrow:ip,DoubleLeftArrow:lp,DoubleLeftRightArrow:dp,DoubleLeftTee:up,DoubleLongLeftArrow:pp,DoubleLongLeftRightArrow:mp,DoubleLongRightArrow:fp,DoubleRightArrow:hp,DoubleRightTee:xp,DoubleUpArrow:gp,DoubleUpDownArrow:vp,DoubleVerticalBar:bp,DownArrowBar:jp,downarrow:yp,DownArrow:Np,Downarrow:wp,DownArrowUpArrow:Sp,DownBreve:Cp,downdownarrows:Ep,downharpoonleft:Tp,downharpoonright:_p,DownLeftRightVector:Lp,DownLeftTeeVector:Rp,DownLeftVectorBar:Pp,DownLeftVector:Dp,DownRightTeeVector:kp,DownRightVectorBar:Op,DownRightVector:Ip,DownTeeArrow:Ap,DownTee:qp,drbkarow:Mp,drcorn:$p,drcrop:Up,Dscr:Fp,dscr:Bp,DScy:Hp,dscy:Vp,dsol:Kp,Dstrok:zp,dstrok:Xp,dtdot:Gp,dtri:Wp,dtrif:Qp,duarr:Yp,duhar:Jp,dwangle:Zp,DZcy:em,dzcy:tm,dzigrarr:sm,Eacute:nm,eacute:om,easter:cm,Ecaron:rm,ecaron:am,Ecirc:im,ecirc:lm,ecir:dm,ecolon:um,Ecy:pm,ecy:mm,eDDot:fm,Edot:hm,edot:xm,eDot:gm,ee:vm,efDot:bm,Efr:jm,efr:ym,eg:Nm,Egrave:wm,egrave:Sm,egs:Cm,egsdot:Em,el:Tm,Element:_m,elinters:Lm,ell:Rm,els:Pm,elsdot:Dm,Emacr:km,emacr:Om,empty:Im,emptyset:Am,EmptySmallSquare:qm,emptyv:Mm,EmptyVerySmallSquare:$m,emsp13:Um,emsp14:Fm,emsp:Bm,ENG:Hm,eng:Vm,ensp:Km,Eogon:zm,eogon:Xm,Eopf:Gm,eopf:Wm,epar:Qm,eparsl:Ym,eplus:Jm,epsi:Zm,Epsilon:ef,epsilon:tf,epsiv:sf,eqcirc:nf,eqcolon:of,eqsim:cf,eqslantgtr:rf,eqslantless:af,Equal:lf,equals:df,EqualTilde:uf,equest:pf,Equilibrium:mf,equiv:ff,equivDD:hf,eqvparsl:xf,erarr:gf,erDot:vf,escr:bf,Escr:jf,esdot:yf,Esim:Nf,esim:wf,Eta:Sf,eta:Cf,ETH:Ef,eth:Tf,Euml:_f,euml:Lf,euro:Rf,excl:Pf,exist:Df,Exists:kf,expectation:Of,exponentiale:If,ExponentialE:Af,fallingdotseq:qf,Fcy:Mf,fcy:$f,female:Uf,ffilig:Ff,fflig:Bf,ffllig:Hf,Ffr:Vf,ffr:Kf,filig:zf,FilledSmallSquare:Xf,FilledVerySmallSquare:Gf,fjlig:Wf,flat:Qf,fllig:Yf,fltns:Jf,fnof:Zf,Fopf:eh,fopf:th,forall:sh,ForAll:nh,fork:oh,forkv:ch,Fouriertrf:rh,fpartint:ah,frac12:ih,frac13:lh,frac14:dh,frac15:uh,frac16:ph,frac18:mh,frac23:fh,frac25:hh,frac34:xh,frac35:gh,frac38:vh,frac45:bh,frac56:jh,frac58:yh,frac78:Nh,frasl:wh,frown:Sh,fscr:Ch,Fscr:Eh,gacute:Th,Gamma:_h,gamma:Lh,Gammad:Rh,gammad:Ph,gap:Dh,Gbreve:kh,gbreve:Oh,Gcedil:Ih,Gcirc:Ah,gcirc:qh,Gcy:Mh,gcy:$h,Gdot:Uh,gdot:Fh,ge:Bh,gE:Hh,gEl:Vh,gel:Kh,geq:zh,geqq:Xh,geqslant:Gh,gescc:Wh,ges:Qh,gesdot:Yh,gesdoto:Jh,gesdotol:Zh,gesl:ex,gesles:tx,Gfr:sx,gfr:nx,gg:ox,Gg:cx,ggg:rx,gimel:ax,GJcy:ix,gjcy:lx,gla:dx,gl:ux,glE:px,glj:mx,gnap:fx,gnapprox:hx,gne:xx,gnE:gx,gneq:vx,gneqq:bx,gnsim:jx,Gopf:yx,gopf:Nx,grave:wx,GreaterEqual:Sx,GreaterEqualLess:Cx,GreaterFullEqual:Ex,GreaterGreater:Tx,GreaterLess:_x,GreaterSlantEqual:Lx,GreaterTilde:Rx,Gscr:Px,gscr:Dx,gsim:kx,gsime:Ox,gsiml:Ix,gtcc:Ax,gtcir:qx,gt:Mx,GT:$x,Gt:Ux,gtdot:Fx,gtlPar:Bx,gtquest:Hx,gtrapprox:Vx,gtrarr:Kx,gtrdot:zx,gtreqless:Xx,gtreqqless:Gx,gtrless:Wx,gtrsim:Qx,gvertneqq:Yx,gvnE:Jx,Hacek:Zx,hairsp:eg,half:tg,hamilt:sg,HARDcy:ng,hardcy:og,harrcir:cg,harr:rg,hArr:ag,harrw:ig,Hat:lg,hbar:dg,Hcirc:ug,hcirc:pg,hearts:mg,heartsuit:fg,hellip:hg,hercon:xg,hfr:gg,Hfr:vg,HilbertSpace:bg,hksearow:jg,hkswarow:yg,hoarr:Ng,homtht:wg,hookleftarrow:Sg,hookrightarrow:Cg,hopf:Eg,Hopf:Tg,horbar:_g,HorizontalLine:Lg,hscr:Rg,Hscr:Pg,hslash:Dg,Hstrok:kg,hstrok:Og,HumpDownHump:Ig,HumpEqual:Ag,hybull:qg,hyphen:Mg,Iacute:$g,iacute:Ug,ic:Fg,Icirc:Bg,icirc:Hg,Icy:Vg,icy:Kg,Idot:zg,IEcy:Xg,iecy:Gg,iexcl:Wg,iff:Qg,ifr:Yg,Ifr:Jg,Igrave:Zg,igrave:ev,ii:tv,iiiint:sv,iiint:nv,iinfin:ov,iiota:cv,IJlig:rv,ijlig:av,Imacr:iv,imacr:lv,image:dv,ImaginaryI:uv,imagline:pv,imagpart:mv,imath:fv,Im:hv,imof:xv,imped:gv,Implies:vv,incare:bv,in:"∈",infin:jv,infintie:yv,inodot:Nv,intcal:wv,int:Sv,Int:Cv,integers:Ev,Integral:Tv,intercal:_v,Intersection:Lv,intlarhk:Rv,intprod:Pv,InvisibleComma:Dv,InvisibleTimes:kv,IOcy:Ov,iocy:Iv,Iogon:Av,iogon:qv,Iopf:Mv,iopf:$v,Iota:Uv,iota:Fv,iprod:Bv,iquest:Hv,iscr:Vv,Iscr:Kv,isin:zv,isindot:Xv,isinE:Gv,isins:Wv,isinsv:Qv,isinv:Yv,it:Jv,Itilde:Zv,itilde:eb,Iukcy:tb,iukcy:sb,Iuml:nb,iuml:ob,Jcirc:cb,jcirc:rb,Jcy:ab,jcy:ib,Jfr:lb,jfr:db,jmath:ub,Jopf:pb,jopf:mb,Jscr:fb,jscr:hb,Jsercy:xb,jsercy:gb,Jukcy:vb,jukcy:bb,Kappa:jb,kappa:yb,kappav:Nb,Kcedil:wb,kcedil:Sb,Kcy:Cb,kcy:Eb,Kfr:Tb,kfr:_b,kgreen:Lb,KHcy:Rb,khcy:Pb,KJcy:Db,kjcy:kb,Kopf:Ob,kopf:Ib,Kscr:Ab,kscr:qb,lAarr:Mb,Lacute:$b,lacute:Ub,laemptyv:Fb,lagran:Bb,Lambda:Hb,lambda:Vb,lang:Kb,Lang:zb,langd:Xb,langle:Gb,lap:Wb,Laplacetrf:Qb,laquo:Yb,larrb:Jb,larrbfs:Zb,larr:ej,Larr:tj,lArr:sj,larrfs:nj,larrhk:oj,larrlp:cj,larrpl:rj,larrsim:aj,larrtl:ij,latail:lj,lAtail:dj,lat:uj,late:pj,lates:mj,lbarr:fj,lBarr:hj,lbbrk:xj,lbrace:gj,lbrack:vj,lbrke:bj,lbrksld:jj,lbrkslu:yj,Lcaron:Nj,lcaron:wj,Lcedil:Sj,lcedil:Cj,lceil:Ej,lcub:Tj,Lcy:_j,lcy:Lj,ldca:Rj,ldquo:Pj,ldquor:Dj,ldrdhar:kj,ldrushar:Oj,ldsh:Ij,le:Aj,lE:qj,LeftAngleBracket:Mj,LeftArrowBar:$j,leftarrow:Uj,LeftArrow:Fj,Leftarrow:Bj,LeftArrowRightArrow:Hj,leftarrowtail:Vj,LeftCeiling:Kj,LeftDoubleBracket:zj,LeftDownTeeVector:Xj,LeftDownVectorBar:Gj,LeftDownVector:Wj,LeftFloor:Qj,leftharpoondown:Yj,leftharpoonup:Jj,leftleftarrows:Zj,leftrightarrow:ey,LeftRightArrow:ty,Leftrightarrow:sy,leftrightarrows:ny,leftrightharpoons:oy,leftrightsquigarrow:cy,LeftRightVector:ry,LeftTeeArrow:ay,LeftTee:iy,LeftTeeVector:ly,leftthreetimes:dy,LeftTriangleBar:uy,LeftTriangle:py,LeftTriangleEqual:my,LeftUpDownVector:fy,LeftUpTeeVector:hy,LeftUpVectorBar:xy,LeftUpVector:gy,LeftVectorBar:vy,LeftVector:by,lEg:jy,leg:yy,leq:Ny,leqq:wy,leqslant:Sy,lescc:Cy,les:Ey,lesdot:Ty,lesdoto:_y,lesdotor:Ly,lesg:Ry,lesges:Py,lessapprox:Dy,lessdot:ky,lesseqgtr:Oy,lesseqqgtr:Iy,LessEqualGreater:Ay,LessFullEqual:qy,LessGreater:My,lessgtr:$y,LessLess:Uy,lesssim:Fy,LessSlantEqual:By,LessTilde:Hy,lfisht:Vy,lfloor:Ky,Lfr:zy,lfr:Xy,lg:Gy,lgE:Wy,lHar:Qy,lhard:Yy,lharu:Jy,lharul:Zy,lhblk:eN,LJcy:tN,ljcy:sN,llarr:nN,ll:oN,Ll:cN,llcorner:rN,Lleftarrow:aN,llhard:iN,lltri:lN,Lmidot:dN,lmidot:uN,lmoustache:pN,lmoust:mN,lnap:fN,lnapprox:hN,lne:xN,lnE:gN,lneq:vN,lneqq:bN,lnsim:jN,loang:yN,loarr:NN,lobrk:wN,longleftarrow:SN,LongLeftArrow:CN,Longleftarrow:EN,longleftrightarrow:TN,LongLeftRightArrow:_N,Longleftrightarrow:LN,longmapsto:RN,longrightarrow:PN,LongRightArrow:DN,Longrightarrow:kN,looparrowleft:ON,looparrowright:IN,lopar:AN,Lopf:qN,lopf:MN,loplus:$N,lotimes:UN,lowast:FN,lowbar:BN,LowerLeftArrow:HN,LowerRightArrow:VN,loz:KN,lozenge:zN,lozf:XN,lpar:GN,lparlt:WN,lrarr:QN,lrcorner:YN,lrhar:JN,lrhard:ZN,lrm:ew,lrtri:tw,lsaquo:sw,lscr:nw,Lscr:ow,lsh:cw,Lsh:rw,lsim:aw,lsime:iw,lsimg:lw,lsqb:dw,lsquo:uw,lsquor:pw,Lstrok:mw,lstrok:fw,ltcc:hw,ltcir:xw,lt:gw,LT:vw,Lt:bw,ltdot:jw,lthree:yw,ltimes:Nw,ltlarr:ww,ltquest:Sw,ltri:Cw,ltrie:Ew,ltrif:Tw,ltrPar:_w,lurdshar:Lw,luruhar:Rw,lvertneqq:Pw,lvnE:Dw,macr:kw,male:Ow,malt:Iw,maltese:Aw,Map:"⤅",map:qw,mapsto:Mw,mapstodown:$w,mapstoleft:Uw,mapstoup:Fw,marker:Bw,mcomma:Hw,Mcy:Vw,mcy:Kw,mdash:zw,mDDot:Xw,measuredangle:Gw,MediumSpace:Ww,Mellintrf:Qw,Mfr:Yw,mfr:Jw,mho:Zw,micro:eS,midast:tS,midcir:sS,mid:nS,middot:oS,minusb:cS,minus:rS,minusd:aS,minusdu:iS,MinusPlus:lS,mlcp:dS,mldr:uS,mnplus:pS,models:mS,Mopf:fS,mopf:hS,mp:xS,mscr:gS,Mscr:vS,mstpos:bS,Mu:jS,mu:yS,multimap:NS,mumap:wS,nabla:SS,Nacute:CS,nacute:ES,nang:TS,nap:_S,napE:LS,napid:RS,napos:PS,napprox:DS,natural:kS,naturals:OS,natur:IS,nbsp:AS,nbump:qS,nbumpe:MS,ncap:$S,Ncaron:US,ncaron:FS,Ncedil:BS,ncedil:HS,ncong:VS,ncongdot:KS,ncup:zS,Ncy:XS,ncy:GS,ndash:WS,nearhk:QS,nearr:YS,neArr:JS,nearrow:ZS,ne:e0,nedot:t0,NegativeMediumSpace:s0,NegativeThickSpace:n0,NegativeThinSpace:o0,NegativeVeryThinSpace:c0,nequiv:r0,nesear:a0,nesim:i0,NestedGreaterGreater:l0,NestedLessLess:d0,NewLine:u0,nexist:p0,nexists:m0,Nfr:f0,nfr:h0,ngE:x0,nge:g0,ngeq:v0,ngeqq:b0,ngeqslant:j0,nges:y0,nGg:N0,ngsim:w0,nGt:S0,ngt:C0,ngtr:E0,nGtv:T0,nharr:_0,nhArr:L0,nhpar:R0,ni:P0,nis:D0,nisd:k0,niv:O0,NJcy:I0,njcy:A0,nlarr:q0,nlArr:M0,nldr:$0,nlE:U0,nle:F0,nleftarrow:B0,nLeftarrow:H0,nleftrightarrow:V0,nLeftrightarrow:K0,nleq:z0,nleqq:X0,nleqslant:G0,nles:W0,nless:Q0,nLl:Y0,nlsim:J0,nLt:Z0,nlt:e1,nltri:t1,nltrie:s1,nLtv:n1,nmid:o1,NoBreak:c1,NonBreakingSpace:r1,nopf:a1,Nopf:i1,Not:l1,not:d1,NotCongruent:u1,NotCupCap:p1,NotDoubleVerticalBar:m1,NotElement:f1,NotEqual:h1,NotEqualTilde:x1,NotExists:g1,NotGreater:v1,NotGreaterEqual:b1,NotGreaterFullEqual:j1,NotGreaterGreater:y1,NotGreaterLess:N1,NotGreaterSlantEqual:w1,NotGreaterTilde:S1,NotHumpDownHump:C1,NotHumpEqual:E1,notin:T1,notindot:_1,notinE:L1,notinva:R1,notinvb:P1,notinvc:D1,NotLeftTriangleBar:k1,NotLeftTriangle:O1,NotLeftTriangleEqual:I1,NotLess:A1,NotLessEqual:q1,NotLessGreater:M1,NotLessLess:$1,NotLessSlantEqual:U1,NotLessTilde:F1,NotNestedGreaterGreater:B1,NotNestedLessLess:H1,notni:V1,notniva:K1,notnivb:z1,notnivc:X1,NotPrecedes:G1,NotPrecedesEqual:W1,NotPrecedesSlantEqual:Q1,NotReverseElement:Y1,NotRightTriangleBar:J1,NotRightTriangle:Z1,NotRightTriangleEqual:eC,NotSquareSubset:tC,NotSquareSubsetEqual:sC,NotSquareSuperset:nC,NotSquareSupersetEqual:oC,NotSubset:cC,NotSubsetEqual:rC,NotSucceeds:aC,NotSucceedsEqual:iC,NotSucceedsSlantEqual:lC,NotSucceedsTilde:dC,NotSuperset:uC,NotSupersetEqual:pC,NotTilde:mC,NotTildeEqual:fC,NotTildeFullEqual:hC,NotTildeTilde:xC,NotVerticalBar:gC,nparallel:vC,npar:bC,nparsl:jC,npart:yC,npolint:NC,npr:wC,nprcue:SC,nprec:CC,npreceq:EC,npre:TC,nrarrc:_C,nrarr:LC,nrArr:RC,nrarrw:PC,nrightarrow:DC,nRightarrow:kC,nrtri:OC,nrtrie:IC,nsc:AC,nsccue:qC,nsce:MC,Nscr:$C,nscr:UC,nshortmid:FC,nshortparallel:BC,nsim:HC,nsime:VC,nsimeq:KC,nsmid:zC,nspar:XC,nsqsube:GC,nsqsupe:WC,nsub:QC,nsubE:YC,nsube:JC,nsubset:ZC,nsubseteq:eE,nsubseteqq:tE,nsucc:sE,nsucceq:nE,nsup:oE,nsupE:cE,nsupe:rE,nsupset:aE,nsupseteq:iE,nsupseteqq:lE,ntgl:dE,Ntilde:uE,ntilde:pE,ntlg:mE,ntriangleleft:fE,ntrianglelefteq:hE,ntriangleright:xE,ntrianglerighteq:gE,Nu:vE,nu:bE,num:jE,numero:yE,numsp:NE,nvap:wE,nvdash:SE,nvDash:CE,nVdash:EE,nVDash:TE,nvge:_E,nvgt:LE,nvHarr:RE,nvinfin:PE,nvlArr:DE,nvle:kE,nvlt:OE,nvltrie:IE,nvrArr:AE,nvrtrie:qE,nvsim:ME,nwarhk:$E,nwarr:UE,nwArr:FE,nwarrow:BE,nwnear:HE,Oacute:VE,oacute:KE,oast:zE,Ocirc:XE,ocirc:GE,ocir:WE,Ocy:QE,ocy:YE,odash:JE,Odblac:ZE,odblac:eT,odiv:tT,odot:sT,odsold:nT,OElig:oT,oelig:cT,ofcir:rT,Ofr:aT,ofr:iT,ogon:lT,Ograve:dT,ograve:uT,ogt:pT,ohbar:mT,ohm:fT,oint:hT,olarr:xT,olcir:gT,olcross:vT,oline:bT,olt:jT,Omacr:yT,omacr:NT,Omega:wT,omega:ST,Omicron:CT,omicron:ET,omid:TT,ominus:_T,Oopf:LT,oopf:RT,opar:PT,OpenCurlyDoubleQuote:DT,OpenCurlyQuote:kT,operp:OT,oplus:IT,orarr:AT,Or:qT,or:MT,ord:$T,order:UT,orderof:FT,ordf:BT,ordm:HT,origof:VT,oror:KT,orslope:zT,orv:XT,oS:GT,Oscr:WT,oscr:QT,Oslash:YT,oslash:JT,osol:ZT,Otilde:e_,otilde:t_,otimesas:s_,Otimes:n_,otimes:o_,Ouml:c_,ouml:r_,ovbar:a_,OverBar:i_,OverBrace:l_,OverBracket:d_,OverParenthesis:u_,para:p_,parallel:m_,par:f_,parsim:h_,parsl:x_,part:g_,PartialD:v_,Pcy:b_,pcy:j_,percnt:y_,period:N_,permil:w_,perp:S_,pertenk:C_,Pfr:E_,pfr:T_,Phi:__,phi:L_,phiv:R_,phmmat:P_,phone:D_,Pi:k_,pi:O_,pitchfork:I_,piv:A_,planck:q_,planckh:M_,plankv:$_,plusacir:U_,plusb:F_,pluscir:B_,plus:H_,plusdo:V_,plusdu:K_,pluse:z_,PlusMinus:X_,plusmn:G_,plussim:W_,plustwo:Q_,pm:Y_,Poincareplane:J_,pointint:Z_,popf:eL,Popf:tL,pound:sL,prap:nL,Pr:oL,pr:cL,prcue:rL,precapprox:aL,prec:iL,preccurlyeq:lL,Precedes:dL,PrecedesEqual:uL,PrecedesSlantEqual:pL,PrecedesTilde:mL,preceq:fL,precnapprox:hL,precneqq:xL,precnsim:gL,pre:vL,prE:bL,precsim:jL,prime:yL,Prime:NL,primes:wL,prnap:SL,prnE:CL,prnsim:EL,prod:TL,Product:_L,profalar:LL,profline:RL,profsurf:PL,prop:DL,Proportional:kL,Proportion:OL,propto:IL,prsim:AL,prurel:qL,Pscr:ML,pscr:$L,Psi:UL,psi:FL,puncsp:BL,Qfr:HL,qfr:VL,qint:KL,qopf:zL,Qopf:XL,qprime:GL,Qscr:WL,qscr:QL,quaternions:YL,quatint:JL,quest:ZL,questeq:eR,quot:tR,QUOT:sR,rAarr:nR,race:oR,Racute:cR,racute:rR,radic:aR,raemptyv:iR,rang:lR,Rang:dR,rangd:uR,range:pR,rangle:mR,raquo:fR,rarrap:hR,rarrb:xR,rarrbfs:gR,rarrc:vR,rarr:bR,Rarr:jR,rArr:yR,rarrfs:NR,rarrhk:wR,rarrlp:SR,rarrpl:CR,rarrsim:ER,Rarrtl:TR,rarrtl:_R,rarrw:LR,ratail:RR,rAtail:PR,ratio:DR,rationals:kR,rbarr:OR,rBarr:IR,RBarr:AR,rbbrk:qR,rbrace:MR,rbrack:$R,rbrke:UR,rbrksld:FR,rbrkslu:BR,Rcaron:HR,rcaron:VR,Rcedil:KR,rcedil:zR,rceil:XR,rcub:GR,Rcy:WR,rcy:QR,rdca:YR,rdldhar:JR,rdquo:ZR,rdquor:eP,rdsh:tP,real:sP,realine:nP,realpart:oP,reals:cP,Re:rP,rect:aP,reg:iP,REG:lP,ReverseElement:dP,ReverseEquilibrium:uP,ReverseUpEquilibrium:pP,rfisht:mP,rfloor:fP,rfr:hP,Rfr:xP,rHar:gP,rhard:vP,rharu:bP,rharul:jP,Rho:yP,rho:NP,rhov:wP,RightAngleBracket:SP,RightArrowBar:CP,rightarrow:EP,RightArrow:TP,Rightarrow:_P,RightArrowLeftArrow:LP,rightarrowtail:RP,RightCeiling:PP,RightDoubleBracket:DP,RightDownTeeVector:kP,RightDownVectorBar:OP,RightDownVector:IP,RightFloor:AP,rightharpoondown:qP,rightharpoonup:MP,rightleftarrows:$P,rightleftharpoons:UP,rightrightarrows:FP,rightsquigarrow:BP,RightTeeArrow:HP,RightTee:VP,RightTeeVector:KP,rightthreetimes:zP,RightTriangleBar:XP,RightTriangle:GP,RightTriangleEqual:WP,RightUpDownVector:QP,RightUpTeeVector:YP,RightUpVectorBar:JP,RightUpVector:ZP,RightVectorBar:eD,RightVector:tD,ring:sD,risingdotseq:nD,rlarr:oD,rlhar:cD,rlm:rD,rmoustache:aD,rmoust:iD,rnmid:lD,roang:dD,roarr:uD,robrk:pD,ropar:mD,ropf:fD,Ropf:hD,roplus:xD,rotimes:gD,RoundImplies:vD,rpar:bD,rpargt:jD,rppolint:yD,rrarr:ND,Rrightarrow:wD,rsaquo:SD,rscr:CD,Rscr:ED,rsh:TD,Rsh:_D,rsqb:LD,rsquo:RD,rsquor:PD,rthree:DD,rtimes:kD,rtri:OD,rtrie:ID,rtrif:AD,rtriltri:qD,RuleDelayed:MD,ruluhar:$D,rx:UD,Sacute:FD,sacute:BD,sbquo:HD,scap:VD,Scaron:KD,scaron:zD,Sc:XD,sc:GD,sccue:WD,sce:QD,scE:YD,Scedil:JD,scedil:ZD,Scirc:ek,scirc:tk,scnap:sk,scnE:nk,scnsim:ok,scpolint:ck,scsim:rk,Scy:ak,scy:ik,sdotb:lk,sdot:dk,sdote:uk,searhk:pk,searr:mk,seArr:fk,searrow:hk,sect:xk,semi:gk,seswar:vk,setminus:bk,setmn:jk,sext:yk,Sfr:Nk,sfr:wk,sfrown:Sk,sharp:Ck,SHCHcy:Ek,shchcy:Tk,SHcy:_k,shcy:Lk,ShortDownArrow:Rk,ShortLeftArrow:Pk,shortmid:Dk,shortparallel:kk,ShortRightArrow:Ok,ShortUpArrow:Ik,shy:Ak,Sigma:qk,sigma:Mk,sigmaf:$k,sigmav:Uk,sim:Fk,simdot:Bk,sime:Hk,simeq:Vk,simg:Kk,simgE:zk,siml:Xk,simlE:Gk,simne:Wk,simplus:Qk,simrarr:Yk,slarr:Jk,SmallCircle:Zk,smallsetminus:eO,smashp:tO,smeparsl:sO,smid:nO,smile:oO,smt:cO,smte:rO,smtes:aO,SOFTcy:iO,softcy:lO,solbar:dO,solb:uO,sol:pO,Sopf:mO,sopf:fO,spades:hO,spadesuit:xO,spar:gO,sqcap:vO,sqcaps:bO,sqcup:jO,sqcups:yO,Sqrt:NO,sqsub:wO,sqsube:SO,sqsubset:CO,sqsubseteq:EO,sqsup:TO,sqsupe:_O,sqsupset:LO,sqsupseteq:RO,square:PO,Square:DO,SquareIntersection:kO,SquareSubset:OO,SquareSubsetEqual:IO,SquareSuperset:AO,SquareSupersetEqual:qO,SquareUnion:MO,squarf:$O,squ:UO,squf:FO,srarr:BO,Sscr:HO,sscr:VO,ssetmn:KO,ssmile:zO,sstarf:XO,Star:GO,star:WO,starf:QO,straightepsilon:YO,straightphi:JO,strns:ZO,sub:eI,Sub:tI,subdot:sI,subE:nI,sube:oI,subedot:cI,submult:rI,subnE:aI,subne:iI,subplus:lI,subrarr:dI,subset:uI,Subset:pI,subseteq:mI,subseteqq:fI,SubsetEqual:hI,subsetneq:xI,subsetneqq:gI,subsim:vI,subsub:bI,subsup:jI,succapprox:yI,succ:NI,succcurlyeq:wI,Succeeds:SI,SucceedsEqual:CI,SucceedsSlantEqual:EI,SucceedsTilde:TI,succeq:_I,succnapprox:LI,succneqq:RI,succnsim:PI,succsim:DI,SuchThat:kI,sum:OI,Sum:II,sung:AI,sup1:qI,sup2:MI,sup3:$I,sup:UI,Sup:FI,supdot:BI,supdsub:HI,supE:VI,supe:KI,supedot:zI,Superset:XI,SupersetEqual:GI,suphsol:WI,suphsub:QI,suplarr:YI,supmult:JI,supnE:ZI,supne:eA,supplus:tA,supset:sA,Supset:nA,supseteq:oA,supseteqq:cA,supsetneq:rA,supsetneqq:aA,supsim:iA,supsub:lA,supsup:dA,swarhk:uA,swarr:pA,swArr:mA,swarrow:fA,swnwar:hA,szlig:xA,Tab:gA,target:vA,Tau:bA,tau:jA,tbrk:yA,Tcaron:NA,tcaron:wA,Tcedil:SA,tcedil:CA,Tcy:EA,tcy:TA,tdot:_A,telrec:LA,Tfr:RA,tfr:PA,there4:DA,therefore:kA,Therefore:OA,Theta:IA,theta:AA,thetasym:qA,thetav:MA,thickapprox:$A,thicksim:UA,ThickSpace:FA,ThinSpace:BA,thinsp:HA,thkap:VA,thksim:KA,THORN:zA,thorn:XA,tilde:GA,Tilde:WA,TildeEqual:QA,TildeFullEqual:YA,TildeTilde:JA,timesbar:ZA,timesb:e2,times:t2,timesd:s2,tint:n2,toea:o2,topbot:c2,topcir:r2,top:a2,Topf:i2,topf:l2,topfork:d2,tosa:u2,tprime:p2,trade:m2,TRADE:f2,triangle:h2,triangledown:x2,triangleleft:g2,trianglelefteq:v2,triangleq:b2,triangleright:j2,trianglerighteq:y2,tridot:N2,trie:w2,triminus:S2,TripleDot:C2,triplus:E2,trisb:T2,tritime:_2,trpezium:L2,Tscr:R2,tscr:P2,TScy:D2,tscy:k2,TSHcy:O2,tshcy:I2,Tstrok:A2,tstrok:q2,twixt:M2,twoheadleftarrow:$2,twoheadrightarrow:U2,Uacute:F2,uacute:B2,uarr:H2,Uarr:V2,uArr:K2,Uarrocir:z2,Ubrcy:X2,ubrcy:G2,Ubreve:W2,ubreve:Q2,Ucirc:Y2,ucirc:J2,Ucy:Z2,ucy:eq,udarr:tq,Udblac:sq,udblac:nq,udhar:oq,ufisht:cq,Ufr:rq,ufr:aq,Ugrave:iq,ugrave:lq,uHar:dq,uharl:uq,uharr:pq,uhblk:mq,ulcorn:fq,ulcorner:hq,ulcrop:xq,ultri:gq,Umacr:vq,umacr:bq,uml:jq,UnderBar:yq,UnderBrace:Nq,UnderBracket:wq,UnderParenthesis:Sq,Union:Cq,UnionPlus:Eq,Uogon:Tq,uogon:_q,Uopf:Lq,uopf:Rq,UpArrowBar:Pq,uparrow:Dq,UpArrow:kq,Uparrow:Oq,UpArrowDownArrow:Iq,updownarrow:Aq,UpDownArrow:qq,Updownarrow:Mq,UpEquilibrium:$q,upharpoonleft:Uq,upharpoonright:Fq,uplus:Bq,UpperLeftArrow:Hq,UpperRightArrow:Vq,upsi:Kq,Upsi:zq,upsih:Xq,Upsilon:Gq,upsilon:Wq,UpTeeArrow:Qq,UpTee:Yq,upuparrows:Jq,urcorn:Zq,urcorner:eM,urcrop:tM,Uring:sM,uring:nM,urtri:oM,Uscr:cM,uscr:rM,utdot:aM,Utilde:iM,utilde:lM,utri:dM,utrif:uM,uuarr:pM,Uuml:mM,uuml:fM,uwangle:hM,vangrt:xM,varepsilon:gM,varkappa:vM,varnothing:bM,varphi:jM,varpi:yM,varpropto:NM,varr:wM,vArr:SM,varrho:CM,varsigma:EM,varsubsetneq:TM,varsubsetneqq:_M,varsupsetneq:LM,varsupsetneqq:RM,vartheta:PM,vartriangleleft:DM,vartriangleright:kM,vBar:OM,Vbar:IM,vBarv:AM,Vcy:qM,vcy:MM,vdash:$M,vDash:UM,Vdash:FM,VDash:BM,Vdashl:HM,veebar:VM,vee:KM,Vee:zM,veeeq:XM,vellip:GM,verbar:WM,Verbar:QM,vert:YM,Vert:JM,VerticalBar:ZM,VerticalLine:e$,VerticalSeparator:t$,VerticalTilde:s$,VeryThinSpace:n$,Vfr:o$,vfr:c$,vltri:r$,vnsub:a$,vnsup:i$,Vopf:l$,vopf:d$,vprop:u$,vrtri:p$,Vscr:m$,vscr:f$,vsubnE:h$,vsubne:x$,vsupnE:g$,vsupne:v$,Vvdash:b$,vzigzag:j$,Wcirc:y$,wcirc:N$,wedbar:w$,wedge:S$,Wedge:C$,wedgeq:E$,weierp:T$,Wfr:_$,wfr:L$,Wopf:R$,wopf:P$,wp:D$,wr:k$,wreath:O$,Wscr:I$,wscr:A$,xcap:q$,xcirc:M$,xcup:$$,xdtri:U$,Xfr:F$,xfr:B$,xharr:H$,xhArr:V$,Xi:K$,xi:z$,xlarr:X$,xlArr:G$,xmap:W$,xnis:Q$,xodot:Y$,Xopf:J$,xopf:Z$,xoplus:eU,xotime:tU,xrarr:sU,xrArr:nU,Xscr:oU,xscr:cU,xsqcup:rU,xuplus:aU,xutri:iU,xvee:lU,xwedge:dU,Yacute:uU,yacute:pU,YAcy:mU,yacy:fU,Ycirc:hU,ycirc:xU,Ycy:gU,ycy:vU,yen:bU,Yfr:jU,yfr:yU,YIcy:NU,yicy:wU,Yopf:SU,yopf:CU,Yscr:EU,yscr:TU,YUcy:_U,yucy:LU,yuml:RU,Yuml:PU,Zacute:DU,zacute:kU,Zcaron:OU,zcaron:IU,Zcy:AU,zcy:qU,Zdot:MU,zdot:$U,zeetrf:UU,ZeroWidthSpace:FU,Zeta:BU,zeta:HU,zfr:VU,Zfr:KU,ZHcy:zU,zhcy:XU,zigrarr:GU,zopf:WU,Zopf:QU,Zscr:YU,zscr:JU,zwj:ZU,zwnj:e3},t3="Á",s3="á",n3="Â",o3="â",c3="´",r3="Æ",a3="æ",i3="À",l3="à",d3="&",u3="&",p3="Å",m3="å",f3="Ã",h3="ã",x3="Ä",g3="ä",v3="¦",b3="Ç",j3="ç",y3="¸",N3="¢",w3="©",S3="©",C3="¤",E3="°",T3="÷",_3="É",L3="é",R3="Ê",P3="ê",D3="È",k3="è",O3="Ð",I3="ð",A3="Ë",q3="ë",M3="½",$3="¼",U3="¾",F3=">",B3=">",H3="Í",V3="í",K3="Î",z3="î",X3="¡",G3="Ì",W3="ì",Q3="¿",Y3="Ï",J3="ï",Z3="«",e4="<",t4="<",s4="¯",n4="µ",o4="·",c4=" ",r4="¬",a4="Ñ",i4="ñ",l4="Ó",d4="ó",u4="Ô",p4="ô",m4="Ò",f4="ò",h4="ª",x4="º",g4="Ø",v4="ø",b4="Õ",j4="õ",y4="Ö",N4="ö",w4="¶",S4="±",C4="£",E4='"',T4='"',_4="»",L4="®",R4="®",P4="§",D4="­",k4="¹",O4="²",I4="³",A4="ß",q4="Þ",M4="þ",$4="×",U4="Ú",F4="ú",B4="Û",H4="û",V4="Ù",K4="ù",z4="¨",X4="Ü",G4="ü",W4="Ý",Q4="ý",Y4="¥",J4="ÿ",Z4={Aacute:t3,aacute:s3,Acirc:n3,acirc:o3,acute:c3,AElig:r3,aelig:a3,Agrave:i3,agrave:l3,amp:d3,AMP:u3,Aring:p3,aring:m3,Atilde:f3,atilde:h3,Auml:x3,auml:g3,brvbar:v3,Ccedil:b3,ccedil:j3,cedil:y3,cent:N3,copy:w3,COPY:S3,curren:C3,deg:E3,divide:T3,Eacute:_3,eacute:L3,Ecirc:R3,ecirc:P3,Egrave:D3,egrave:k3,ETH:O3,eth:I3,Euml:A3,euml:q3,frac12:M3,frac14:$3,frac34:U3,gt:F3,GT:B3,Iacute:H3,iacute:V3,Icirc:K3,icirc:z3,iexcl:X3,Igrave:G3,igrave:W3,iquest:Q3,Iuml:Y3,iuml:J3,laquo:Z3,lt:e4,LT:t4,macr:s4,micro:n4,middot:o4,nbsp:c4,not:r4,Ntilde:a4,ntilde:i4,Oacute:l4,oacute:d4,Ocirc:u4,ocirc:p4,Ograve:m4,ograve:f4,ordf:h4,ordm:x4,Oslash:g4,oslash:v4,Otilde:b4,otilde:j4,Ouml:y4,ouml:N4,para:w4,plusmn:S4,pound:C4,quot:E4,QUOT:T4,raquo:_4,reg:L4,REG:R4,sect:P4,shy:D4,sup1:k4,sup2:O4,sup3:I4,szlig:A4,THORN:q4,thorn:M4,times:$4,Uacute:U4,uacute:F4,Ucirc:B4,ucirc:H4,Ugrave:V4,ugrave:K4,uml:z4,Uuml:X4,uuml:G4,Yacute:W4,yacute:Q4,yen:Y4,yuml:J4},eF="&",tF="'",sF=">",nF="<",oF='"',Es={amp:eF,apos:tF,gt:sF,lt:nF,quot:oF};var Ue={};const cF={0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376};var Vt;function rF(){if(Vt)return Ue;Vt=1;var t=Ue&&Ue.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(Ue,"__esModule",{value:!0});var s=t(cF),n=String.fromCodePoint||function(c){var r="";return c>65535&&(c-=65536,r+=String.fromCharCode(c>>>10&1023|55296),c=56320|c&1023),r+=String.fromCharCode(c),r};function o(c){return c>=55296&&c<=57343||c>1114111?"�":(c in s.default&&(c=s.default[c]),n(c))}return Ue.default=o,Ue}var Kt;function zt(){if(Kt)return Se;Kt=1;var t=Se&&Se.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(Se,"__esModule",{value:!0}),Se.decodeHTML=Se.decodeHTMLStrict=Se.decodeXML=void 0;var s=t(Cs),n=t(Z4),o=t(Es),c=t(rF()),r=/&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g;Se.decodeXML=d(o.default),Se.decodeHTMLStrict=d(s.default);function d(f){var b=h(f);return function(S){return String(S).replace(r,b)}}var m=function(f,b){return f<b?1:-1};Se.decodeHTML=(function(){for(var f=Object.keys(n.default).sort(m),b=Object.keys(s.default).sort(m),S=0,w=0;S<b.length;S++)f[w]===b[S]?(b[S]+=";?",w++):b[S]+=";";var E=new RegExp("&(?:"+b.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),R=h(s.default);function _(x){return x.substr(-1)!==";"&&(x+=";"),R(x)}return function(x){return String(x).replace(E,_)}})();function h(f){return function(S){if(S.charAt(1)==="#"){var w=S.charAt(2);return w==="X"||w==="x"?c.default(parseInt(S.substr(3),16)):c.default(parseInt(S.substr(2),10))}return f[S.slice(1,-1)]||S}}return Se}var ge={},Xt;function Gt(){if(Xt)return ge;Xt=1;var t=ge&&ge.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(ge,"__esModule",{value:!0}),ge.escapeUTF8=ge.escape=ge.encodeNonAsciiHTML=ge.encodeHTML=ge.encodeXML=void 0;var s=t(Es),n=m(s.default),o=h(n);ge.encodeXML=x(n);var c=t(Cs),r=m(c.default),d=h(r);ge.encodeHTML=w(r,d),ge.encodeNonAsciiHTML=x(r);function m(g){return Object.keys(g).sort().reduce(function(C,v){return C[g[v]]="&"+v+";",C},{})}function h(g){for(var C=[],v=[],j=0,A=Object.keys(g);j<A.length;j++){var P=A[j];P.length===1?C.push("\\"+P):v.push(P)}C.sort();for(var q=0;q<C.length-1;q++){for(var D=q;D<C.length-1&&C[D].charCodeAt(1)+1===C[D+1].charCodeAt(1);)D+=1;var I=1+D-q;I<3||C.splice(q,I,C[q]+"-"+C[D])}return v.unshift("["+C.join("")+"]"),new RegExp(v.join("|"),"g")}var f=/(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g,b=String.prototype.codePointAt!=null?function(g){return g.codePointAt(0)}:function(g){return(g.charCodeAt(0)-55296)*1024+g.charCodeAt(1)-56320+65536};function S(g){return"&#x"+(g.length>1?b(g):g.charCodeAt(0)).toString(16).toUpperCase()+";"}function w(g,C){return function(v){return v.replace(C,function(j){return g[j]}).replace(f,S)}}var E=new RegExp(o.source+"|"+f.source,"g");function R(g){return g.replace(E,S)}ge.escape=R;function _(g){return g.replace(o,S)}ge.escapeUTF8=_;function x(g){return function(C){return C.replace(E,function(v){return g[v]||S(v)})}}return ge}var Wt;function aF(){return Wt||(Wt=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.decodeXMLStrict=t.decodeHTML5Strict=t.decodeHTML4Strict=t.decodeHTML5=t.decodeHTML4=t.decodeHTMLStrict=t.decodeHTML=t.decodeXML=t.encodeHTML5=t.encodeHTML4=t.escapeUTF8=t.escape=t.encodeNonAsciiHTML=t.encodeHTML=t.encodeXML=t.encode=t.decodeStrict=t.decode=void 0;var s=zt(),n=Gt();function o(h,f){return(!f||f<=0?s.decodeXML:s.decodeHTML)(h)}t.decode=o;function c(h,f){return(!f||f<=0?s.decodeXML:s.decodeHTMLStrict)(h)}t.decodeStrict=c;function r(h,f){return(!f||f<=0?n.encodeXML:n.encodeHTML)(h)}t.encode=r;var d=Gt();Object.defineProperty(t,"encodeXML",{enumerable:!0,get:function(){return d.encodeXML}}),Object.defineProperty(t,"encodeHTML",{enumerable:!0,get:function(){return d.encodeHTML}}),Object.defineProperty(t,"encodeNonAsciiHTML",{enumerable:!0,get:function(){return d.encodeNonAsciiHTML}}),Object.defineProperty(t,"escape",{enumerable:!0,get:function(){return d.escape}}),Object.defineProperty(t,"escapeUTF8",{enumerable:!0,get:function(){return d.escapeUTF8}}),Object.defineProperty(t,"encodeHTML4",{enumerable:!0,get:function(){return d.encodeHTML}}),Object.defineProperty(t,"encodeHTML5",{enumerable:!0,get:function(){return d.encodeHTML}});var m=zt();Object.defineProperty(t,"decodeXML",{enumerable:!0,get:function(){return m.decodeXML}}),Object.defineProperty(t,"decodeHTML",{enumerable:!0,get:function(){return m.decodeHTML}}),Object.defineProperty(t,"decodeHTMLStrict",{enumerable:!0,get:function(){return m.decodeHTMLStrict}}),Object.defineProperty(t,"decodeHTML4",{enumerable:!0,get:function(){return m.decodeHTML}}),Object.defineProperty(t,"decodeHTML5",{enumerable:!0,get:function(){return m.decodeHTML}}),Object.defineProperty(t,"decodeHTML4Strict",{enumerable:!0,get:function(){return m.decodeHTMLStrict}}),Object.defineProperty(t,"decodeHTML5Strict",{enumerable:!0,get:function(){return m.decodeHTMLStrict}}),Object.defineProperty(t,"decodeXMLStrict",{enumerable:!0,get:function(){return m.decodeXML}})})(ut)),ut}var pt,Qt;function iF(){if(Qt)return pt;Qt=1;function t(i,u){if(!(i instanceof u))throw new TypeError("Cannot call a class as a function")}function s(i,u){for(var p=0;p<u.length;p++){var N=u[p];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(i,N.key,N)}}function n(i,u,p){return u&&s(i.prototype,u),i}function o(i,u){var p=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(!p){if(Array.isArray(i)||(p=c(i))||u){p&&(i=p);var N=0,L=function(){};return{s:L,n:function(){return N>=i.length?{done:!0}:{done:!1,value:i[N++]}},e:function(ce){throw ce},f:L}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var y=!0,U=!1,G;return{s:function(){p=p.call(i)},n:function(){var ce=p.next();return y=ce.done,ce},e:function(ce){U=!0,G=ce},f:function(){try{!y&&p.return!=null&&p.return()}finally{if(U)throw G}}}}function c(i,u){if(i){if(typeof i=="string")return r(i,u);var p=Object.prototype.toString.call(i).slice(8,-1);if(p==="Object"&&i.constructor&&(p=i.constructor.name),p==="Map"||p==="Set")return Array.from(i);if(p==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(p))return r(i,u)}}function r(i,u){(u==null||u>i.length)&&(u=i.length);for(var p=0,N=new Array(u);p<u;p++)N[p]=i[p];return N}var d=aF(),m={fg:"#FFF",bg:"#000",newline:!1,escapeXML:!1,stream:!1,colors:h()};function h(){var i={0:"#000",1:"#A00",2:"#0A0",3:"#A50",4:"#00A",5:"#A0A",6:"#0AA",7:"#AAA",8:"#555",9:"#F55",10:"#5F5",11:"#FF5",12:"#55F",13:"#F5F",14:"#5FF",15:"#FFF"};return x(0,5).forEach(function(u){x(0,5).forEach(function(p){x(0,5).forEach(function(N){return f(u,p,N,i)})})}),x(0,23).forEach(function(u){var p=u+232,N=b(u*10+8);i[p]="#"+N+N+N}),i}function f(i,u,p,N){var L=16+i*36+u*6+p,y=i>0?i*40+55:0,U=u>0?u*40+55:0,G=p>0?p*40+55:0;N[L]=S([y,U,G])}function b(i){for(var u=i.toString(16);u.length<2;)u="0"+u;return u}function S(i){var u=[],p=o(i),N;try{for(p.s();!(N=p.n()).done;){var L=N.value;u.push(b(L))}}catch(y){p.e(y)}finally{p.f()}return"#"+u.join("")}function w(i,u,p,N){var L;return u==="text"?L=v(p,N):u==="display"?L=R(i,p,N):u==="xterm256Foreground"?L=P(i,N.colors[p]):u==="xterm256Background"?L=q(i,N.colors[p]):u==="rgb"&&(L=E(i,p)),L}function E(i,u){u=u.substring(2).slice(0,-1);var p=+u.substr(0,2),N=u.substring(5).split(";"),L=N.map(function(y){return("0"+Number(y).toString(16)).substr(-2)}).join("");return A(i,(p===38?"color:#":"background-color:#")+L)}function R(i,u,p){u=parseInt(u,10);var N={"-1":function(){return"<br/>"},0:function(){return i.length&&_(i)},1:function(){return j(i,"b")},3:function(){return j(i,"i")},4:function(){return j(i,"u")},8:function(){return A(i,"display:none")},9:function(){return j(i,"strike")},22:function(){return A(i,"font-weight:normal;text-decoration:none;font-style:normal")},23:function(){return D(i,"i")},24:function(){return D(i,"u")},39:function(){return P(i,p.fg)},49:function(){return q(i,p.bg)},53:function(){return A(i,"text-decoration:overline")}},L;return N[u]?L=N[u]():4<u&&u<7?L=j(i,"blink"):29<u&&u<38?L=P(i,p.colors[u-30]):39<u&&u<48?L=q(i,p.colors[u-40]):89<u&&u<98?L=P(i,p.colors[8+(u-90)]):99<u&&u<108&&(L=q(i,p.colors[8+(u-100)])),L}function _(i){var u=i.slice(0);return i.length=0,u.reverse().map(function(p){return"</"+p+">"}).join("")}function x(i,u){for(var p=[],N=i;N<=u;N++)p.push(N);return p}function g(i){return function(u){return(i===null||u.category!==i)&&i!=="all"}}function C(i){i=parseInt(i,10);var u=null;return i===0?u="all":i===1?u="bold":2<i&&i<5?u="underline":4<i&&i<7?u="blink":i===8?u="hide":i===9?u="strike":29<i&&i<38||i===39||89<i&&i<98?u="foreground-color":(39<i&&i<48||i===49||99<i&&i<108)&&(u="background-color"),u}function v(i,u){return u.escapeXML?d.encodeXML(i):i}function j(i,u,p){return p||(p=""),i.push(u),"<".concat(u).concat(p?' style="'.concat(p,'"'):"",">")}function A(i,u){return j(i,"span",u)}function P(i,u){return j(i,"span","color:"+u)}function q(i,u){return j(i,"span","background-color:"+u)}function D(i,u){var p;if(i.slice(-1)[0]===u&&(p=i.pop()),p)return"</"+u+">"}function I(i,u,p){var N=!1,L=3;function y(){return""}function U(O,se){return p("xterm256Foreground",se),""}function G(O,se){return p("xterm256Background",se),""}function F(O){return u.newline?p("display",-1):p("text",O),""}function ce(O,se){N=!0,se.trim().length===0&&(se="0"),se=se.trimRight(";").split(";");var ie=o(se),ye;try{for(ie.s();!(ye=ie.n()).done;){var Ne=ye.value;p("display",Ne)}}catch(Pe){ie.e(Pe)}finally{ie.f()}return""}function B(O){return p("text",O),""}function ee(O){return p("rgb",O),""}var W=[{pattern:/^\x08+/,sub:y},{pattern:/^\x1b\[[012]?K/,sub:y},{pattern:/^\x1b\[\(B/,sub:y},{pattern:/^\x1b\[[34]8;2;\d+;\d+;\d+m/,sub:ee},{pattern:/^\x1b\[38;5;(\d+)m/,sub:U},{pattern:/^\x1b\[48;5;(\d+)m/,sub:G},{pattern:/^\n/,sub:F},{pattern:/^\r+\n/,sub:F},{pattern:/^\r/,sub:F},{pattern:/^\x1b\[((?:\d{1,3};?)+|)m/,sub:ce},{pattern:/^\x1b\[\d?J/,sub:y},{pattern:/^\x1b\[\d{0,3};\d{0,3}f/,sub:y},{pattern:/^\x1b\[?[\d;]{0,3}/,sub:y},{pattern:/^(([^\x1b\x08\r\n])+)/,sub:B}];function ae(O,se){se>L&&N||(N=!1,i=i.replace(O.pattern,O.sub))}var de=[],re=i,T=re.length;e:for(;T>0;){for(var $=0,H=0,K=W.length;H<K;$=++H){var V=W[$];if(ae(V,$),i.length!==T){T=i.length;continue e}}if(i.length===T)break;de.push(0),T=i.length}return de}function Y(i,u,p){return u!=="text"&&(i=i.filter(g(C(p))),i.push({token:u,data:p,category:C(p)})),i}var te=(function(){function i(u){t(this,i),u=u||{},u.colors&&(u.colors=Object.assign({},m.colors,u.colors)),this.options=Object.assign({},m,u),this.stack=[],this.stickyStack=[]}return n(i,[{key:"toHtml",value:function(p){var N=this;p=typeof p=="string"?[p]:p;var L=this.stack,y=this.options,U=[];return this.stickyStack.forEach(function(G){var F=w(L,G.token,G.data,y);F&&U.push(F)}),I(p.join(""),y,function(G,F){var ce=w(L,G,F,y);ce&&U.push(ce),y.stream&&(N.stickyStack=Y(N.stickyStack,G,F))}),L.length&&U.push(_(L)),U.join("")}}]),i})();return pt=te,pt}var lF=iF();const dF=Ms(lF),uF={"15m":900*1e3,"1h":3600*1e3,"24h":1440*60*1e3};function pF(t,s){const n=s.keyword.trim().toLowerCase(),o=s.timeRange==="all"?null:(s.now??new Date).getTime()-uF[s.timeRange];return t.filter(c=>{const r=mF(c,s.source),d=s.level==="all"||c.level===s.level,m=!n||`${c.timestamp} ${c.level} ${c.source} ${c.message}`.toLowerCase().includes(n),h=Date.parse(c.timestamp),f=o==null||Number.isFinite(h)&&h>=o;return r&&d&&m&&f})}function mF(t,s){return s==="all"?!0:s==="errors"?t.level==="error":s==="solid-server"?t.source==="css"||t.source==="solid-server":s==="runtime"?t.source==="xpod"||t.source==="runtime":t.source===s}const fF=new dF({fg:"hsl(var(--foreground))",bg:"hsl(var(--background))",newline:!0,escapeXML:!0});function hF(t){return t.includes("ERR_NGROK_8001")?"ERR_NGROK_8001: ngrok agent 无法连到 ngrok edge,通常是本机网络或代理限制。":t.includes("ERR_NGROK_9009")?"ERR_NGROK_9009: 当前 ngrok 计划或代理路径不允许该用法。":t.includes("DNS")||t.includes("DDNS")?"DNS/DDNS 相关错误:检查 Cloud 协调状态和当前公网地址。":null}function xF(t){return e.jsxs(z,{variant:"bordered",className:"mb-4",children:[e.jsx(ne,{className:"pb-2",children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsx(oe,{children:"诊断导出"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"导出可交给开发者的脱敏运行时证据,默认不包含用户 Pod 内容。"})]}),e.jsxs(he,{onClick:t.onExport,disabled:t.exporting,className:"gap-2",children:[e.jsx(gn,{className:"h-4 w-4"}),"导出诊断"]})]})}),e.jsxs(X,{className:"grid gap-3 text-sm lg:grid-cols-[1fr_auto] lg:items-end",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"包含:"}),e.jsx("span",{className:"text-muted-foreground",children:"/service/status、隧道、DDNS、运行时配置摘要、最近错误和日志尾部。"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"排除:"}),e.jsx("span",{className:"text-muted-foreground",children:"Token、API key、数据库密码、认证 cookie、client secret、用户 Pod 内容。"})]})]}),e.jsxs("div",{className:"text-xs text-muted-foreground lg:text-right",children:["日志文件: ",t.logFileInfo]})]})]})}function MF(){const[t,s]=a.useState([]),[n,o]=a.useState(()=>new URLSearchParams(window.location.search).get("source")||"all"),[c,r]=a.useState("all"),[d,m]=a.useState("all"),[h,f]=a.useState(""),[b,S]=a.useState(!1),[w,E]=a.useState(!0),[R,_]=a.useState(""),[x,g]=a.useState(!1),[C,v]=a.useState("未读取"),j=a.useRef(null),A=a.useRef(null);a.useEffect(()=>{(async()=>{const N=await Hs({limit:500});s(N);const L=await Vs({lines:20});v(L?.file??"未找到日志文件")})()},[]),a.useEffect(()=>{if(b){A.current?.(),A.current=null;return}const p=Fs(N=>{_(""),s(L=>[...L,...N].slice(-500))},()=>{_("日志流连接异常,已保留当前视图。")});return A.current=p,()=>{p(),A.current=null}},[b]),a.useEffect(()=>{w&&!b&&j.current?.scrollIntoView({block:"end"})},[t,b,w]);const P=a.useMemo(()=>pF(t,{source:n,level:c,keyword:h,timeRange:d}),[t,n,c,h,d]),q=a.useCallback(()=>{s([])},[]),D=a.useCallback(()=>{const p=P.map(U=>`[${U.timestamp}] [${U.level.toUpperCase()}] [${U.source}] ${U.message}`).join(`
4
+ `),N=new Blob([p],{type:"text/plain"}),L=URL.createObjectURL(N),y=document.createElement("a");y.href=L,y.download=`xpod-logs-${new Date().toISOString().slice(0,10)}.txt`,y.click(),URL.revokeObjectURL(L)},[P]),I=a.useCallback(async()=>{g(!0);try{const p=await Bs(),N=new Blob([JSON.stringify(p,null,2)],{type:"application/json"}),L=URL.createObjectURL(N),y=document.createElement("a");y.href=L,y.download=`xpod-diagnostics-${new Date().toISOString().slice(0,10)}.json`,y.click(),URL.revokeObjectURL(L)}finally{g(!1)}},[]),Y=p=>{try{return new Date(p).toLocaleTimeString()}catch{return p}},te=p=>{switch(p){case"error":return"text-destructive";case"warn":return"text-warning dark:text-warning";case"debug":return"text-muted-foreground";default:return"text-foreground"}},i=p=>{switch(p){case"xpod":return"text-primary";case"css":return"text-success dark:text-success";case"api":return"text-primary dark:text-primary";case"gateway":return"text-warning dark:text-warning";default:return"text-muted-foreground"}},u=P.map(p=>hF(p.message)).find(Boolean);return e.jsxs("div",{className:"p-4 sm:p-8 h-full flex flex-col max-w-6xl",children:[e.jsxs("div",{className:"flex flex-col gap-4 mb-6 lg:flex-row lg:items-start lg:justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"type-h1",children:"日志"}),e.jsx("p",{className:"mt-2 max-w-[65ch] text-sm text-muted-foreground",children:"实时检查运行时输出,并导出不包含 secret 的诊断证据。"})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0 flex-wrap",children:[e.jsxs(he,{variant:"ghost",size:"sm",onClick:()=>S(!b),className:"gap-1.5 whitespace-nowrap",children:[b?e.jsx(yn,{className:"w-4 h-4"}):e.jsx(bn,{className:"w-4 h-4"}),b?"继续":"暂停"]}),e.jsxs(he,{variant:"ghost",size:"sm",onClick:D,className:"gap-1.5 whitespace-nowrap",children:[e.jsx(sn,{className:"w-4 h-4"}),"导出日志"]}),e.jsxs(he,{variant:"ghost",size:"sm",onClick:q,className:"gap-1.5 whitespace-nowrap",children:[e.jsx(Sn,{className:"w-4 h-4"}),"清空视图"]})]})]}),e.jsx(xF,{onExport:I,exporting:x,logFileInfo:C}),e.jsxs("div",{className:"mb-4 grid gap-3 lg:grid-cols-[170px_140px_140px_1fr_auto]",children:[e.jsxs(Ae,{value:n,onValueChange:p=>o(p),children:[e.jsx(De,{className:"h-9 text-sm",children:e.jsx(qe,{})}),e.jsxs(ke,{children:[e.jsx(Z,{value:"all",children:"All Sources"}),e.jsx(Z,{value:"runtime",children:"Xpod Runtime"}),e.jsx(Z,{value:"gateway",children:"Gateway"}),e.jsx(Z,{value:"solid-server",children:"Solid Server"}),e.jsx(Z,{value:"api",children:"API Server"}),e.jsx(Z,{value:"errors",children:"Errors"})]})]}),e.jsxs(Ae,{value:d,onValueChange:p=>m(p),children:[e.jsx(De,{className:"h-9 text-sm",children:e.jsx(qe,{})}),e.jsxs(ke,{children:[e.jsx(Z,{value:"all",children:"All time"}),e.jsx(Z,{value:"15m",children:"Last 15 min"}),e.jsx(Z,{value:"1h",children:"Last hour"}),e.jsx(Z,{value:"24h",children:"Last 24 hours"})]})]}),e.jsxs(Ae,{value:c,onValueChange:p=>r(p),children:[e.jsx(De,{className:"h-9 text-sm",children:e.jsx(qe,{})}),e.jsxs(ke,{children:[e.jsx(Z,{value:"all",children:"全部等级"}),e.jsx(Z,{value:"error",children:"错误"}),e.jsx(Z,{value:"warn",children:"警告"}),e.jsx(Z,{value:"info",children:"信息"}),e.jsx(Z,{value:"debug",children:"调试"})]})]}),e.jsxs("div",{children:[e.jsx(Ie,{htmlFor:"keywordFilter",className:"sr-only",children:"关键词"}),e.jsx(st,{id:"keywordFilter",value:h,onChange:p=>f(p.target.value),placeholder:"按关键词过滤",className:"h-9"})]}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx("input",{type:"checkbox",checked:w,onChange:p=>E(p.target.checked)}),"自动滚动"]})]}),R?e.jsx("div",{className:"mb-3 rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:R}):null,u?e.jsx("div",{className:"mb-3 rounded-md border border-warning/40 bg-warning/10 px-3 py-2 text-sm text-warning dark:border-warning/40 dark:bg-warning/20 dark:text-warning",children:u}):null,e.jsx(z,{variant:"bordered",className:"flex-1 min-h-[420px] overflow-hidden",children:e.jsx(X,{className:"h-full p-0",children:e.jsx("div",{className:"h-full overflow-auto font-mono text-sm bg-background",children:P.length===0?e.jsx("div",{className:"p-6 text-muted-foreground text-center",children:"暂无日志"}):e.jsxs("div",{className:"p-4 space-y-1 min-w-max",children:[P.map((p,N)=>e.jsxs("div",{className:"flex gap-2 hover:bg-muted px-2 py-0.5 rounded w-max min-w-full",children:[e.jsx("span",{className:"text-muted-foreground shrink-0 w-20",children:Y(p.timestamp)}),e.jsxs("span",{className:le("shrink-0 w-14 font-semibold",te(p.level)),children:["[",p.level.toUpperCase(),"]"]}),e.jsxs("span",{className:le("shrink-0 w-20",i(p.source)),children:["[",p.source,"]"]}),e.jsx("span",{className:"text-foreground whitespace-pre",dangerouslySetInnerHTML:{__html:fF.toHtml(p.message)}})]},`${p.timestamp}-${N}`)),e.jsx("div",{ref:j})]})})})})]})}function gF(t){const{changes:s,onReset:n}=t;return e.jsxs(z,{variant:"bordered",className:"mb-6",children:[e.jsx(ne,{className:"pb-2",children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx(oe,{children:"待应用变更"}),e.jsx(he,{type:"button",variant:"ghost",size:"sm",onClick:n,disabled:s.length===0,children:"重置未保存"})]})}),e.jsx(X,{children:s.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"没有未保存的变更。"}):e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-warning dark:text-warning",children:"保存后需要重启运行时才能完全生效。"}),e.jsx("div",{className:"divide-y divide-border rounded-md border border-border",children:s.map(o=>e.jsxs("div",{className:"grid gap-1 px-3 py-2 text-sm sm:grid-cols-[180px_1fr]",children:[e.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:o.key}),e.jsxs("span",{className:"font-mono text-xs text-foreground break-all",children:[o.from||"∅"," → ",o.to||"∅"]})]},o.key))})]})})]})}function et(t){const{id:s,label:n,configured:o,value:c,onChange:r,placeholder:d,helper:m}=t;return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(Ie,{htmlFor:s,children:n}),e.jsxs("span",{className:le("inline-flex items-center gap-1.5 rounded-md border px-2 py-1 text-xs",o?"border-success/40 text-success dark:border-success/40 dark:text-success":"border-border text-muted-foreground"),children:[e.jsx(nn,{className:"h-3.5 w-3.5"}),o?"已配置":"未配置"]})]}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[e.jsx(st,{id:s,type:"password",autoComplete:"new-password",value:c,onChange:h=>r(h.target.value),placeholder:d??"填写新 secret","aria-describedby":m?`${s}-helper`:void 0}),c?e.jsx(he,{type:"button",variant:"ghost",onClick:()=>r(""),className:"shrink-0",children:"清除替换值"}):null]}),m?e.jsx("p",{id:`${s}-helper`,className:"text-xs text-muted-foreground",children:m}):null]})}const mt=["XPOD_DEPLOY_MODE","CSS_ROOT_FILE_PATH","CSS_BASE_URL","XPOD_TUNNEL_PROVIDER","XPOD_TUNNEL_ACTIVE_PROFILE_ID","XPOD_TUNNEL_PROFILES","XPOD_TUNNEL_PUBLIC_URL","CLOUDFLARE_TUNNEL_URL","SAKURA_TUNNEL_URL","CLOUDFLARE_TUNNEL_TOKEN","SAKURA_TUNNEL_TOKEN","NGROK_AUTHTOKEN","NGROK_URL","FRP_TUNNEL_TOKEN","FRP_TUNNEL_URL","XPOD_HTTPS_MODE","XPOD_HTTPS_CERT_PATH","XPOD_HTTPS_KEY_PATH","XPOD_CLOUD_API_ENDPOINT","XPOD_NODE_ID","XPOD_SP_DOMAIN","XPOD_NODE_TOKEN","XPOD_SERVICE_TOKEN","CSS_PORT","CSS_SPARQL_ENDPOINT","CSS_IDENTITY_DB_URL","CSS_LOGGING_LEVEL","CSS_SHOW_STACK_TRACE"],vF=new Set(["CLOUDFLARE_TUNNEL_TOKEN","SAKURA_TUNNEL_TOKEN","NGROK_AUTHTOKEN","FRP_TUNNEL_TOKEN","XPOD_NODE_TOKEN","XPOD_SERVICE_TOKEN","CSS_IDENTITY_DB_URL"]),vt={ngrok:{publicEndpointKey:"NGROK_URL",publicEndpointLabel:"ngrok 固定入口 URL",publicEndpointPlaceholder:"https://example.ngrok-free.dev",credentialKey:"NGROK_AUTHTOKEN",credentialLabel:"ngrok authtoken"},cloudflare:{publicEndpointKey:"CLOUDFLARE_TUNNEL_URL",publicEndpointLabel:"Cloudflare Tunnel 公开入口",publicEndpointPlaceholder:"https://example.trycloudflare.com",credentialKey:"CLOUDFLARE_TUNNEL_TOKEN",credentialLabel:"Cloudflare Tunnel Token"},sakura_frp:{publicEndpointKey:"SAKURA_TUNNEL_URL",publicEndpointLabel:"Sakura FRP 公开入口 URL",publicEndpointPlaceholder:"https://example.example.com",credentialKey:"SAKURA_TUNNEL_TOKEN",credentialLabel:"Sakura FRP Token"},frp:{publicEndpointKey:"FRP_TUNNEL_URL",publicEndpointLabel:"FRP 公开入口 URL",publicEndpointPlaceholder:"https://example.example.com",credentialKey:"FRP_TUNNEL_TOKEN",credentialLabel:"FRP Token"}};function bF(t){return t==="none"?null:vt[t]}const jF=["ngrok","cloudflare","sakura_frp","frp"];function _t(t){return t==="ngrok"||t==="cloudflare"||t==="sakura_frp"||t==="frp"?t:t==="sakura-frp"?"sakura_frp":"none"}function Yt(t){switch(t){case"ngrok":return"ngrok";case"cloudflare":return"Cloudflare";case"sakura_frp":return"Sakura FRP";case"frp":return"FRP"}}function yF(t,s,n){const o=[],c=new Set,r=new Map((n??[]).map(d=>[d.id,d]));for(const d of NF(t.XPOD_TUNNEL_PROFILES)){const m=vt[d.provider],h=r.get(d.id),f=h?.credentialEnvKey??d.credentialEnvKey??m.credentialKey,b=h?.publicUrl??d.publicUrl??Jt(t,d.provider,m),S=h?.credentialConfigured??s(f);o.push({id:d.id,provider:d.provider,label:h?.label||d.label||Yt(d.provider),publicEndpointUrl:b,credentialConfigured:S,configured:!0,active:h?.active??!1,credentialEnvKey:f,...h?.parameters??d.parameters?{parameters:h?.parameters??d.parameters}:{},...m,credentialKey:f}),c.add(d.id)}for(const d of jF){if(c.has(d))continue;const m=vt[d],h=Jt(t,d,m),f=s(m.credentialKey),b=r.get(d);o.push({id:d,provider:d,label:Yt(d),publicEndpointUrl:b?.publicUrl??h,credentialConfigured:b?.credentialConfigured??f,configured:!!(h||f||_t(t.XPOD_TUNNEL_PROVIDER)===d),active:b?.active??!1,credentialEnvKey:b?.credentialEnvKey??m.credentialKey,...b?.parameters?{parameters:b.parameters}:{},...m})}return o}function NF(t){if(!t?.trim())return[];try{const s=JSON.parse(t);return Array.isArray(s)?s.flatMap(n=>{if(!n||typeof n!="object"||Array.isArray(n))return[];const o=n,c=typeof o.id=="string"&&o.id.trim()?o.id.trim():"",r=_t(typeof o.provider=="string"?o.provider:void 0);return!c||r==="none"?[]:[{id:c,provider:r,label:typeof o.label=="string"?o.label:void 0,publicUrl:typeof o.publicUrl=="string"?o.publicUrl:void 0,credentialEnvKey:typeof o.credentialEnvKey=="string"?o.credentialEnvKey:void 0}]}):[]}catch{return[]}}function Jt(t,s,n){const o=(s==="cloudflare"||s==="sakura_frp")&&t.XPOD_TUNNEL_PUBLIC_URL||"";return t[n.publicEndpointKey]||o||""}function Zt(t){const s=t.filter(n=>n.configured).map(n=>({id:n.id,provider:n.provider,label:n.label,publicUrl:n.publicEndpointUrl,...n.parameters&&Object.keys(n.parameters).length>0?{parameters:n.parameters}:{}}));return s.length>0?JSON.stringify(s):""}function wF(t,s,n){const o=t.XPOD_TUNNEL_ACTIVE_PROFILE_ID?.trim();return o||(s!=="none"?s:n.find(c=>c.configured)?.id??"none")}function es(t){return vF.has(t)}function ts(t,s,n){return{...t,[s]:n}}function Ee(t){return e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ie,{htmlFor:t.id,children:t.label}),e.jsx(st,{id:t.id,value:t.value,onChange:s=>t.onChange(s.target.value),placeholder:t.placeholder,readOnly:t.readOnly,"aria-readonly":t.readOnly||void 0}),t.helper?e.jsx("p",{className:"text-xs text-muted-foreground",children:t.helper}):null]})}function $F(){const t=ls(),[s,n]=a.useState({}),[o,c]=a.useState({}),[r,d]=a.useState({}),[m,h]=a.useState({}),[f,b]=a.useState([]),[S,w]=a.useState([]),[E,R]=a.useState(null),[_,x]=a.useState(null),[g,C]=a.useState(!0),[v,j]=a.useState(!1),[A,P]=a.useState(!1),[q,D]=a.useState(""),[I,Y]=a.useState(!1),te=s.XPOD_DEPLOY_MODE==="standalone"?"standalone":"local",i=_t(s.XPOD_TUNNEL_PROVIDER),u=["none","acme","manual"].includes(s.XPOD_HTTPS_MODE)?s.XPOD_HTTPS_MODE:"none",p=E?.status??"unknown",N=te==="local",L=!!s.XPOD_CLOUD_API_ENDPOINT,y=N&&L,U=_?.baseUrl||s.CSS_BASE_URL||(_?.fqdn?`https://${_.fqdn}/`:""),G=a.useCallback(async()=>{try{const l=await Ks();x(l)}catch(l){console.error("Failed to load ddns status:",l),x(null)}},[]),F=a.useCallback(async()=>{try{const l=await zs(),k={...l?.env??{}};n(k),c(k),d({}),h(l?.secrets??{}),b(l?.tunnelProfiles??[]),w(l?.providers??[])}catch(l){console.error("Failed to load config:",l)}finally{C(!1)}},[]),ce=a.useCallback(async l=>{P(!0);try{const k=await Xs(l);R(k)}catch(k){console.error("Failed to refresh public ip check:",k),R(null)}finally{P(!1)}},[]);a.useEffect(()=>{let l=!0;return Promise.resolve().then(()=>{l&&F()}),()=>{l=!1}},[F]),a.useEffect(()=>{if(g)return;let l=!0;return Promise.resolve().then(()=>{l&&ce(y?U:s.CSS_BASE_URL)}),()=>{l=!1}},[s.CSS_BASE_URL,y,U,te,g,ce]),a.useEffect(()=>{if(g)return;let l=!0;return y?Promise.resolve().then(()=>{l&&G()}):Promise.resolve().then(()=>{l&&x(null)}),()=>{l=!1}},[y,G,g]);const B=(l,k)=>{n(J=>ts(J,l,k))},ee=(l,k)=>{d(J=>ts(J,l,k))},W=a.useCallback(l=>!!m[l]?.configured,[m]),ae=a.useCallback(l=>W(l)||!!r[l],[W,r]),de=a.useMemo(()=>yF(s,ae,f),[s,ae,f]),re=wF(s,i,de),T=de.find(l=>l.id===re),$=T?.provider??"none",H=bF($),K=(S??[]).find(l=>l.id===$),V=K?K.endpointSource==="declared":!0,O=l=>{const k=de.find(J=>J.id===l);n(J=>({...J,XPOD_TUNNEL_ACTIVE_PROFILE_ID:k?k.id:"",XPOD_TUNNEL_PROVIDER:k?.provider??"none"}))},se=(l,k)=>{const J=de.map(we=>we.id===l.id?{...we,publicEndpointUrl:k,configured:!0}:we);n(we=>({...we,[l.publicEndpointKey]:k,XPOD_TUNNEL_PROFILES:Zt(J)}))},ie=a.useMemo(()=>{if(H){if(V&&!(T?.publicEndpointUrl||"").trim())return`请填写 ${H.publicEndpointLabel}`;if(!ae(H.credentialKey))return`请填写 ${H.credentialLabel}`}if(y&&_?.mode==="tunnel"&&$==="none")return"当前网络不可直连,必须启用一个隧道供应商。";const k=(s.CSS_BASE_URL||"").trim().startsWith("https://");return!y&&k&&$==="none"&&u==="none"?"独立部署使用 https:// Base URL 时,需要配置 HTTPS 或启用隧道。":""},[T?.publicEndpointUrl,$,_?.mode,V,s.CSS_BASE_URL,u,y,H,ae]),ye=a.useMemo(()=>{const l=[];for(const k of mt){const J=s[k],we=o[k];if(es(k)){r[k]&&l.push({key:k,from:W(k)?"[configured]":"",to:"[replace]"});continue}(J??"")!==(we??"")&&l.push({key:k,from:we??"",to:J??""})}for(const k of de){const J=k.credentialEnvKey;mt.includes(J)||!r[J]||l.push({key:J,from:k.credentialConfigured?"[configured]":"",to:"[replace]"})}return l},[s,o,W,r,de]),Ne=async()=>{if(ie)return D(ie),!1;j(!0),D("");try{const l={};for(const J of mt)es(J)?r[J]&&(l[J]=r[J]):J in s&&(l[J]=s[J]);l.XPOD_TUNNEL_ACTIVE_PROFILE_ID=$==="none"?"":re,l.XPOD_TUNNEL_PROVIDER=$,l.XPOD_TUNNEL_PROFILES=Zt(de);for(const J of de){const we=r[J.credentialEnvKey];we&&(l[J.credentialEnvKey]=we)}const k=await Gs(l);return k?(D("配置已保存,需要重启服务生效"),await F()):D("保存失败"),!!k}catch{return D("保存失败"),!1}finally{j(!1)}},Pe=async()=>{if(t&&!t.restartCapability.supported){D("当前入口不支持重启操作。请在本机或携带管理 Token 操作。");return}D("正在重启服务..."),await Ws()?(D("重启信号已发送,请稍候..."),setTimeout(()=>window.location.reload(),3e3)):D("重启失败。远程访问时默认禁止重启,请在本机或携带管理 Token 操作。")},rt=async()=>{if(t&&!t.configurationWriteCapability.supported){D("当前入口不支持保存运行时配置。请在本机或携带管理 Token 操作。");return}await Ne()&&await Pe()},at=()=>{n(o),d({}),D("未保存变更已重置")},it=a.useMemo(()=>A?"检测中...":p==="pass"?"可直连":p==="fail"?"不可直连":"未知",[A,p]);return g?e.jsxs("div",{className:"p-4 sm:p-8 max-w-4xl space-y-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"type-h1",children:"设置"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"正在读取运行时配置。"})]}),e.jsx(z,{variant:"bordered",children:e.jsxs(X,{className:"space-y-3 pt-5",children:[e.jsx("div",{className:"h-4 w-40 rounded bg-muted"}),e.jsx("div",{className:"h-10 rounded bg-muted"}),e.jsx("div",{className:"h-10 rounded bg-muted"})]})})]}):e.jsxs("div",{className:"p-4 sm:p-8 max-w-4xl",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h1",{className:"type-h1",children:"设置"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"高级运行时设置。大多数用户应在常规设置中完成配置。"})]}),e.jsx("div",{className:"mb-6 rounded-xl border border-warning/40 bg-warning/70 p-4 text-sm text-warning dark:border-warning/40 dark:bg-warning/20 dark:text-warning",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx(Nt,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:"高级运行时设置"}),e.jsx("p",{className:"mt-1",children:"这里修改的是本地 Xpod 运行时,不是用户 Pod 资料,也不是 Cloud IDP 账号设置。"})]})]})}),e.jsxs(z,{variant:"bordered",className:"mb-6",children:[e.jsx(ne,{children:e.jsx(oe,{children:"运行时"})}),e.jsxs(X,{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ie,{children:"部署模式"}),e.jsxs(Ae,{value:te,onValueChange:l=>B("XPOD_DEPLOY_MODE",l),children:[e.jsx(De,{children:e.jsx(qe,{})}),e.jsxs(ke,{children:[e.jsx(Z,{value:"local",children:"边缘部署"}),e.jsx(Z,{value:"standalone",children:"独立部署"})]})]})]}),e.jsx(Ee,{id:"storageRoot",label:"存储目录",value:s.CSS_ROOT_FILE_PATH||"./data",onChange:l=>B("CSS_ROOT_FILE_PATH",l)})]}),e.jsx(Ee,{id:"baseUrl",label:"资料入口 URL",value:y?U:s.CSS_BASE_URL||"http://127.0.0.1:3000",onChange:l=>B("CSS_BASE_URL",l),readOnly:y,helper:y?"托管模式下由 Cloud 分配稳定域名,本地只上报状态和隧道入口。":"独立部署需要保证该 URL 可被目标客户端访问。"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:te==="local"?"边缘部署:Cloud IDP 和稳定域名在云端,数据/SP 保留在本地。":"独立部署:域名、身份认证和证书都由本机或用户自管。"})]})]}),e.jsxs(z,{variant:"bordered",className:"mb-6",children:[e.jsx(ne,{className:"pb-2",children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx(oe,{children:"网络访问"}),e.jsxs("span",{className:"text-sm",children:["外网: ",e.jsx("span",{className:le(p==="pass"?"text-success dark:text-success":p==="fail"?"text-destructive":"text-muted-foreground"),children:it})]})]})}),e.jsxs(X,{className:"space-y-4",children:[y&&_?.mode==="tunnel"&&$==="none"?e.jsx("div",{className:"rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:"当前网络不可直连,请启用一个隧道供应商。"}):null,e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ie,{children:"当前生效"}),e.jsxs(Ae,{value:re,onValueChange:O,children:[e.jsx(De,{children:e.jsx(qe,{})}),e.jsxs(ke,{children:[e.jsx(Z,{value:"none",children:"不使用隧道"}),de.map(l=>e.jsx(Z,{value:l.id,children:l.label},l.id))]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"可以记录多个隧道配置,但同一时间只启用当前选择的一个。公网、局域网、本机和 P2P 由状态页判断最优接入。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm font-medium",children:"已记录隧道"}),e.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:de.map(l=>{const k=l.id===re;return e.jsxs("div",{className:le("rounded-xl border p-3",k?"border-primary bg-primary/5":"border-border"),children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:l.label}),e.jsx(he,{type:"button",variant:k?"secondary":"ghost",size:"sm",onClick:()=>O(l.id),disabled:k,children:k?"当前生效":"设为当前"})]}),e.jsx("div",{className:"mt-2 break-all font-mono text-xs text-muted-foreground",children:l.publicEndpointUrl||"未配置入口"}),e.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:l.credentialConfigured?"密钥已配置":"未配置密钥"})]},l.id)})})]}),T&&H?e.jsxs("div",{className:"space-y-4 rounded-xl border border-border p-4",children:[e.jsx("div",{className:"text-sm font-medium",children:"编辑当前隧道"}),V?e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:"隧道入口 URL"}),e.jsx(Ee,{id:"tunnelPublicEndpoint",label:H.publicEndpointLabel,value:T.publicEndpointUrl,onChange:l=>se(T,l),placeholder:H.publicEndpointPlaceholder,helper:"这是实际数据面入口,不替代上方的稳定资料 URL。"})]}):e.jsxs("div",{className:"rounded-md border border-border bg-muted/30 px-3 py-2 text-xs text-muted-foreground",children:["入口由 ",T.label," 分配,运行时自动读取,无需填写。"]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:"访问密钥"}),e.jsx(et,{id:"tunnelCredential",label:H.credentialLabel,configured:W(H.credentialKey),value:r[T.credentialEnvKey]||"",onChange:l=>ee(T.credentialEnvKey,l)})]})]}):e.jsx("div",{className:"rounded-md border border-border bg-muted/30 px-3 py-2 text-sm text-muted-foreground",children:"不使用隧道时,不填写隧道入口 URL 或访问密钥。"})]})]}),e.jsxs(z,{variant:"bordered",className:"mb-6",children:[e.jsx(ne,{children:e.jsx(oe,{children:"Cloud 协调"})}),e.jsxs(X,{className:"space-y-4",children:[e.jsx(Ee,{id:"cloudEndpoint",label:"Cloud API endpoint",value:s.XPOD_CLOUD_API_ENDPOINT||"",onChange:l=>B("XPOD_CLOUD_API_ENDPOINT",l)}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(Ee,{id:"nodeId",label:"nodeId",value:s.XPOD_NODE_ID||"",onChange:l=>B("XPOD_NODE_ID",l)}),e.jsx(Ee,{id:"spDomain",label:"spDomain",value:s.XPOD_SP_DOMAIN||"",onChange:l=>B("XPOD_SP_DOMAIN",l)})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(et,{id:"nodeToken",label:"Node token",configured:W("XPOD_NODE_TOKEN"),value:r.XPOD_NODE_TOKEN||"",onChange:l=>ee("XPOD_NODE_TOKEN",l)}),e.jsx(et,{id:"serviceToken",label:"Service token",configured:W("XPOD_SERVICE_TOKEN"),value:r.XPOD_SERVICE_TOKEN||"",onChange:l=>ee("XPOD_SERVICE_TOKEN",l)})]})]})]}),te==="standalone"?e.jsxs(z,{variant:"bordered",className:"mb-6",children:[e.jsx(ne,{children:e.jsx(oe,{children:"HTTPS"})}),e.jsxs(X,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ie,{children:"HTTPS 模式"}),e.jsxs(Ae,{value:u,onValueChange:l=>B("XPOD_HTTPS_MODE",l),children:[e.jsx(De,{children:e.jsx(qe,{})}),e.jsxs(ke,{children:[e.jsx(Z,{value:"none",children:"关闭"}),e.jsx(Z,{value:"acme",children:"自动申请 ACME"}),e.jsx(Z,{value:"manual",children:"手动证书"})]})]})]}),u==="manual"?e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(Ee,{id:"certPath",label:"证书路径",value:s.XPOD_HTTPS_CERT_PATH||"",onChange:l=>B("XPOD_HTTPS_CERT_PATH",l)}),e.jsx(Ee,{id:"keyPath",label:"私钥路径",value:s.XPOD_HTTPS_KEY_PATH||"",onChange:l=>B("XPOD_HTTPS_KEY_PATH",l)})]}):null]})]}):null,e.jsx("div",{className:"mb-6",children:e.jsx(he,{variant:"ghost",size:"sm",onClick:()=>Y(l=>!l),children:I?"收起高级设置":"展开高级设置"})}),I?e.jsxs(z,{variant:"bordered",className:"mb-6",children:[e.jsx(ne,{children:e.jsx(oe,{children:"高级设置"})}),e.jsxs(X,{className:"space-y-4",children:[e.jsx(Ee,{id:"cssPort",label:"端口",value:s.CSS_PORT||"3000",onChange:l=>B("CSS_PORT",l)}),e.jsx(Ee,{id:"sparqlEndpoint",label:"SPARQL 存储",value:s.CSS_SPARQL_ENDPOINT||"",onChange:l=>B("CSS_SPARQL_ENDPOINT",l)}),e.jsx(et,{id:"identityDb",label:"身份数据库 URL",configured:W("CSS_IDENTITY_DB_URL"),value:r.CSS_IDENTITY_DB_URL||"",onChange:l=>ee("CSS_IDENTITY_DB_URL",l)}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ie,{children:"日志级别"}),e.jsxs(Ae,{value:s.CSS_LOGGING_LEVEL||"info",onValueChange:l=>B("CSS_LOGGING_LEVEL",l),children:[e.jsx(De,{className:"w-40",children:e.jsx(qe,{})}),e.jsxs(ke,{children:[e.jsx(Z,{value:"error",children:"error"}),e.jsx(Z,{value:"warn",children:"warn"}),e.jsx(Z,{value:"info",children:"info"}),e.jsx(Z,{value:"debug",children:"debug"})]})]})]}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-foreground",children:[e.jsx("input",{type:"checkbox",id:"showStackTrace",checked:s.CSS_SHOW_STACK_TRACE==="true",onChange:l=>B("CSS_SHOW_STACK_TRACE",l.target.checked?"true":"false"),className:"rounded border-input"}),"显示错误堆栈"]})]})]}):null,e.jsx(gF,{changes:ye,onReset:at}),t&&!t.configurationWriteCapability.supported?e.jsxs("div",{className:"rounded-md border border-border bg-muted/40 px-3 py-2 text-sm text-muted-foreground",children:["Configuration changes are not supported from this host capability",t.configurationWriteCapability.reason?`: ${t.configurationWriteCapability.reason}`:"","."]}):e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx(he,{onClick:()=>{Ne()},disabled:v||!!ie,children:v?"保存中...":"保存配置"}),t&&!t.restartCapability.supported?null:e.jsx(he,{variant:"secondary",onClick:()=>{rt()},disabled:v||!!ie,children:"保存并重启"})]}),q||ie?e.jsx("div",{className:le("mt-4 rounded-md border px-3 py-2 text-sm",ie||q&&q.includes("失败")?"border-destructive/30 bg-destructive/10 text-destructive":"border-success/40 bg-success/10 text-success dark:border-success/40 dark:bg-success/20 dark:text-success"),children:q||ie}):null]})}const SF={overview:"用量",storage:"存储用量",bandwidth:"带宽用量",ai:"AI 用量","index-storage":"索引占用"};function Te({label:t,value:s}){return e.jsxs("div",{"data-testid":"usage-fact","data-fact-label":t,className:"rounded-lg border border-border bg-card p-3",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:t}),e.jsx("div",{className:"mt-1 break-all text-sm",children:s})]})}function UF({kind:t="overview"}){const s=ss(),[n,o]=a.useState(null),[c,r]=a.useState(void 0),[d,m]=a.useState(0);a.useEffect(()=>{if(!s.webId||!s.podUrl){o({status:"error",reason:"尚未确认当前 WebID 与存储空间。"});return}let w=!1;return o(null),is({webId:s.webId,podUrl:s.podUrl,authenticatedFetch:s.fetch}).then(E=>{w||(r(E.generatedAt),o(E.storage))}).catch(E=>{w||o({status:"error",reason:E instanceof Error?E.message:"读取失败"})}),()=>{w=!0}},[s.webId,s.podUrl,s.fetch,d]);const h=SF[t];if(n===null)return e.jsxs("div",{className:"p-4 sm:p-8 max-w-6xl space-y-6",children:[e.jsx("h1",{className:"type-h1",children:h}),e.jsx("div",{role:"status",className:"text-sm text-muted-foreground",children:"正在读取用量…"})]});if(n.status!=="available"){const w=n.status==="unsupported";return e.jsxs("div",{className:"p-4 sm:p-8 max-w-6xl space-y-6",children:[e.jsx("h1",{className:"type-h1",children:h}),e.jsx(z,{variant:"bordered",children:e.jsxs(X,{className:"space-y-2 pt-5 text-sm",children:[e.jsx("div",{"data-testid":"usage-state","data-usage-state":n.status,className:"font-medium",children:w?"此部署不提供用量数据":"状态无法确认"}),n.reason?e.jsx("p",{className:"text-muted-foreground",children:n.reason}):null,w?null:e.jsx("button",{type:"button",className:"text-primary underline-offset-4 hover:underline",onClick:()=>m(E=>E+1),children:"重新读取"})]})})]})}const{usage:f,limits:b}=n,S=w=>t==="overview"||t===w||t==="index-storage"&&w==="storage";return e.jsxs("div",{className:"p-4 sm:p-8 max-w-6xl space-y-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"type-h1",children:h}),e.jsx("p",{className:"mt-2 max-w-[65ch] text-sm text-muted-foreground",children:n.source?`来源:${n.source}`:"来源:当前存储空间的用量记录"})]}),t==="index-storage"?e.jsx(z,{variant:"bordered",children:e.jsx(X,{className:"pt-5 text-sm text-muted-foreground",children:"索引占用尚无独立数据来源;当前只能看到存储空间的总用量。"})}):null,S("storage")?e.jsxs(z,{variant:"bordered",children:[e.jsx(ne,{children:e.jsx(oe,{children:"存储"})}),e.jsx(X,{children:e.jsxs("div",{"data-testid":"usage-storage",className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:[e.jsx(Te,{label:"已用",value:Fe(f.storageBytes)}),e.jsx(Te,{label:"存储上限",value:Je(b.storageLimitBytes,Fe)}),e.jsx(Te,{label:"记录时间",value:c??"未标注"})]})})]}):null,S("bandwidth")?e.jsxs(z,{variant:"bordered",children:[e.jsx(ne,{children:e.jsx(oe,{children:"带宽"})}),e.jsx(X,{children:e.jsxs("div",{"data-testid":"usage-bandwidth",className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:[e.jsx(Te,{label:"入站",value:Fe(f.ingressBytes)}),e.jsx(Te,{label:"出站",value:Fe(f.egressBytes)}),e.jsx(Te,{label:"带宽上限",value:Je(b.bandwidthLimitBps,w=>`${Fe(w)}/s`)})]})})]}):null,S("ai")?e.jsxs(z,{variant:"bordered",children:[e.jsx(ne,{children:e.jsx(oe,{children:"AI"})}),e.jsx(X,{children:e.jsxs("div",{"data-testid":"usage-ai",className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:[e.jsx(Te,{label:"计算时长",value:Mt(f.computeSeconds)}),e.jsx(Te,{label:"计算上限",value:Je(b.computeLimitSeconds,Mt)}),e.jsx(Te,{label:"本月 tokens",value:String(f.tokensUsed)}),e.jsx(Te,{label:"tokens 上限",value:Je(b.tokenLimitMonthly,w=>String(w))})]})})]}):null]})}export{OF as AdminLayout,MF as LogsPage,kF as RdfPage,$F as SettingsPage,IF as StatusPage,UF as UsagePage};
@@ -1 +1 @@
1
- import{c}from"./dashboard-D2ozrATv.js";const e=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],a=c("key-round",e);export{a as K};
1
+ import{c}from"./dashboard-Dm_h60lA.js";const e=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],a=c("key-round",e);export{a as K};
@@ -1 +1 @@
1
- import{c as t}from"./dashboard-D2ozrATv.js";const c=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],o=t("rotate-ccw",c);export{o as R};
1
+ import{c as t}from"./dashboard-Dm_h60lA.js";const c=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],o=t("rotate-ccw",c);export{o as R};
@@ -1 +1 @@
1
- import{j as t,f as n}from"./dashboard-D2ozrATv.js";function m({className:e,...s}){return t.jsx("div",{className:n("animate-pulse rounded-md bg-muted/50",e),...s})}export{m as S};
1
+ import{j as t,f as n}from"./dashboard-Dm_h60lA.js";function m({className:e,...s}){return t.jsx("div",{className:n("animate-pulse rounded-md bg-muted/50",e),...s})}export{m as S};
@@ -1 +1 @@
1
- import{c}from"./dashboard-D2ozrATv.js";const e=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],r=c("network",e);const t=[["path",{d:"m10.586 5.414-5.172 5.172",key:"4mc350"}],["path",{d:"m18.586 13.414-5.172 5.172",key:"8c96vv"}],["path",{d:"M6 12h12",key:"8npq4p"}],["circle",{cx:"12",cy:"20",r:"2",key:"144qzu"}],["circle",{cx:"12",cy:"4",r:"2",key:"muu5ef"}],["circle",{cx:"20",cy:"12",r:"2",key:"1xzzfp"}],["circle",{cx:"4",cy:"12",r:"2",key:"1hvhnz"}]],h=c("waypoints",t);export{r as N,h as W};
1
+ import{c}from"./dashboard-Dm_h60lA.js";const e=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],r=c("network",e);const t=[["path",{d:"m10.586 5.414-5.172 5.172",key:"4mc350"}],["path",{d:"m18.586 13.414-5.172 5.172",key:"8c96vv"}],["path",{d:"M6 12h12",key:"8npq4p"}],["circle",{cx:"12",cy:"20",r:"2",key:"144qzu"}],["circle",{cx:"12",cy:"4",r:"2",key:"muu5ef"}],["circle",{cx:"20",cy:"12",r:"2",key:"1xzzfp"}],["circle",{cx:"4",cy:"12",r:"2",key:"1hvhnz"}]],h=c("waypoints",t);export{r as N,h as W};
@@ -0,0 +1 @@
1
+ import{r as n,j as r,f as k}from"./dashboard-Dm_h60lA.js";function U(e){if(!E(e))throw new Error("Applet layout descriptor must be an object");if(typeof e.type!="string")throw new Error("Applet layout descriptor type must be a string");switch(e.type){case"single-pane":case"two-pane":return v(e.context),e;case"three-pane":return v(e.context),e;default:throw new Error(`Unsupported applet layout type: ${e.type}`)}}function E(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function v(e){if(e!==void 0){if(!E(e))throw new Error("Applet layout descriptor context must be an object");if("collapsible"in e&&typeof e.collapsible!="boolean")throw new Error("Applet layout descriptor context.collapsible must be a boolean");if("initiallyCollapsed"in e&&typeof e.initiallyCollapsed!="boolean")throw new Error("Applet layout descriptor context.initiallyCollapsed must be a boolean")}}const M=184,p={narrow:768,wideObjects:1100};function P(e){const{pageType:t,contentWidth:a}=e,c=e.hasObjectCollection===!0;if(!Number.isFinite(a)||a<=0)throw new Error("Applet pane plan needs a positive contentWidth");return a<p.narrow?{pageType:t,navigation:"task-bar",panes:"single",showObjectColumn:!1}:a>=p.wideObjects&&t==="collection"&&c?{pageType:t,navigation:"rail",panes:"list-detail",showObjectColumn:!0}:{pageType:t,navigation:"rail",panes:t==="collection"&&a<p.wideObjects?"stack":"single",showObjectColumn:!1}}const L=n.createContext(null);function Q(){const e=n.useContext(L);if(!e)throw new Error("useWorkspaceLayout must be used inside TwoPaneLayout");return e}const A="(max-width: 767px)",R={gridTemplateColumns:"210px minmax(0, 1fr)"};function N(e){return e==="context"?"main":e}function S(e){if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};const t=window.matchMedia(A);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function T(){return typeof window>"u"||typeof window.matchMedia!="function"?"split":window.matchMedia(A).matches?"stack":"split"}function W(){return"split"}const O=`(min-width: ${p.wideObjects+M}px)`;function D(){return n.useSyncExternalStore(e=>{if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};const t=window.matchMedia(O);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},()=>typeof window>"u"||typeof window.matchMedia!="function"?!0:window.matchMedia(O).matches,()=>!0)}function F(e){const t=n.useSyncExternalStore(S,T,W)==="stack",c=D()?p.wideObjects:t?p.narrow-1:p.narrow,l=P({pageType:e.pageType,contentWidth:c,hasObjectCollection:e.hasObjectCollection}),u=l.panes==="list-detail"?"split":"stack";return{resolvedMode:e.mode==="auto"?u:e.mode,showObjectColumn:l.showObjectColumn}}function H({resolvedMode:e,history:t,resolvePane:a}){const[c,l]=n.useState("list"),u=n.useRef(null),j=n.useRef(null),h=n.useRef(null),b=n.useRef(null),s=n.useMemo(()=>({list:j,main:h,context:b}),[]),o=n.useCallback((i,x={})=>{const w=a?.(i)??i;l(w),e==="stack"&&(u.current=w,x.fromHistory||t?.push(w))},[t,a,e]),f=n.useCallback(()=>o("list"),[o]),y=n.useCallback(()=>o("main"),[o]),m=n.useCallback(()=>o("context"),[o]);return n.useLayoutEffect(()=>{if(e!=="stack"){u.current=null;return}const i=u.current;i&&(u.current=null,s[i].current?.focus())},[c,s,e]),n.useLayoutEffect(()=>{if(!(e!=="stack"||!t))return t.subscribe(i=>{o(i,{fromHistory:!0})})},[t,o,e]),{activePane:c,paneRefs:s,openList:f,openMain:y,openContext:m}}function X({listHeader:e,list:t,mainHeader:a,main:c,mode:l="auto",history:u,className:j,pageType:h="collection",hasObjectCollection:b=!0}){const{resolvedMode:s}=F({mode:l,pageType:h,hasObjectCollection:b}),o=h==="collection"&&b,{activePane:f,paneRefs:y,openList:m,openMain:i,openContext:x}=H({resolvedMode:s,history:u,resolvePane:N}),w=n.useMemo(()=>({mode:s,activePane:f,openList:m,openMain:i,openContext:x}),[f,x,m,i,s]),d=o&&s==="stack",g=!o||d&&f!=="list",C=d&&f!=="main";return r.jsx(L.Provider,{value:w,children:r.jsx("section",{className:k("flex min-h-0 flex-1 flex-col bg-background",j),"data-workspace-layout":"two-pane","data-workspace-mode":s,children:r.jsxs("div",{className:k("grid min-h-0 flex-1",d||!o?"grid-cols-1":null),style:d||!o?void 0:R,"data-workspace-layout-mode":l,"data-workspace-object-column":o&&s==="split"?"shown":"hidden","data-workspace-active-pane":f,children:[r.jsxs("aside",{ref:y.list,className:k("min-h-0 flex-col overflow-hidden bg-layout-list-item @container",g?"hidden":"flex",d?"border-r-0":"border-r border-border"),"data-testid":"workspace-list-pane","data-workspace-pane":"list",hidden:g,tabIndex:d?-1:void 0,children:[r.jsx("header",{className:"h-12 shrink-0 border-b border-border bg-layout-list-header","data-workspace-list-header":"true",children:e}),r.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:t})]}),r.jsxs("main",{ref:y.main,className:k("min-h-0 flex-col overflow-hidden bg-layout-content @container",C?"hidden":"flex"),"data-testid":"workspace-main-pane","data-workspace-pane":"main",hidden:C,tabIndex:d?-1:void 0,children:[r.jsx("header",{className:"h-12 shrink-0 border-b border-border bg-layout-content","data-workspace-main-header":"true",children:a}),r.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[d?r.jsx("button",{type:"button",className:"inline-flex items-center px-4 py-3 text-sm text-muted-foreground hover:text-foreground",onClick:m,children:"返回列表"}):null,c]})]})]})})})}export{X as T,L as W,U as d,Q as u};
@@ -5,8 +5,8 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <script src="/dashboard/theme-init.js"></script>
7
7
  <title>Xpod Dashboard</title>
8
- <script type="module" crossorigin src="/dashboard/assets/dashboard-D2ozrATv.js"></script>
9
- <link rel="stylesheet" crossorigin href="/dashboard/assets/dashboard-rk080mvG.css">
8
+ <script type="module" crossorigin src="/dashboard/assets/dashboard-Dm_h60lA.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/dashboard/assets/dashboard-1zrtbMhM.css">
10
10
  </head>
11
11
  <body class="bg-background text-foreground">
12
12
  <div id="root"></div>
@@ -1 +1 @@
1
- import{t as J,r as a,j as V,v as X}from"./global-B_WO-aYY.js";import{a as $}from"./ai-connections-DexTPyfC.js";import{d as D}from"./XpodAiConnectionsPodStore-nFgD_usD.js";async function R(t){return k(t(h("/api/ai/config"),{method:"GET",credentials:"include",headers:{accept:"application/json"}}))}async function G(t,e){return k(t(h("/api/ai/config"),{method:"PATCH",credentials:"include",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(e)}))}async function H(t,e){const o=await t(h("/api/ai/config/rebuild"),{method:"POST",credentials:"include",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({target:e})}),s=await o.json().catch(()=>{});if(!o.ok||!s?.job)throw new Error(s?.error??"Index rebuild request failed");return s.job}async function ee(t,e){const o=e.capabilities.some(i=>i.toLowerCase()==="embedding"),s=await t(h(o?"/v1/embeddings":"/v1/chat/completions"),{method:"POST",credentials:"include",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(o?{model:e.id,input:"xpod readiness probe"}:{model:e.id,messages:[{role:"user",content:"Reply OK."}],max_tokens:1,stream:!1})});if(!s.ok){const i=await s.json().catch(()=>{}),d=typeof i?.error=="string"?i.error:i?.error?.message;throw new Error(d??"Model readiness probe failed")}await s.arrayBuffer()}function h(t){if(typeof window>"u")throw new Error("AI Config API requires the current browser origin");return new URL(t,window.location.origin).toString()}async function k(t){const e=await t,o=await e.json().catch(()=>{});if(!e.ok||!o?.config||!o.capabilities)throw new Error(o?.error??"AI Config request failed");return o}const L=a.createContext(void 0),K=2e3;function te({children:t}){const e=J(),[o,s]=a.useState(),[i,d]=a.useState(),[c,p]=a.useState([]),[y,g]=a.useState(),[O,v]=a.useState(!0),[C,M]=a.useState(!1),[I,P]=a.useState(!1),[S,u]=a.useState(),[N,T]=a.useState(0),q=!!(e.webId&&e.currentPod);a.useEffect(()=>{if(!e.webId||!e.currentPod)return;let r=!1;return queueMicrotask(()=>{if(r||!e.webId||!e.currentPod)return;v(!0),u(void 0);const n=$({webId:e.webId,podUrl:e.currentPod.podUrl,authenticatedFetch:e.fetch}),_=D({database:e.currentPod.database,authenticatedFetch:e.fetch,podUrl:e.currentPod.podUrl,webId:e.currentPod.webId}).listModels?.()?.catch(()=>[])??Promise.resolve([]);Promise.all([R(e.fetch),n.listModels().catch(()=>[]),_]).then(([l,B,F])=>{r||(s(l.config),d(l.capabilities),g(l.lifecycle),p(Q(z(F,B))))}).catch(l=>{r||u(l instanceof Error?l.message:String(l))}).finally(()=>{r||v(!1)})}),()=>{r=!0}},[N,e.currentPod,e.fetch,e.webId]);const A=a.useCallback(()=>{T(r=>r+1)},[]),j=y?.pending??0;a.useEffect(()=>{if(j<=0||!e.webId||!e.currentPod)return;let r=!1;const n=setInterval(()=>{R(e.fetch).then(f=>{r||g(f.lifecycle)}).catch(()=>{})},K);return()=>{r=!0,clearInterval(n)}},[j,e.currentPod,e.fetch,e.webId]);const b=a.useCallback(async r=>{M(!0),u(void 0);try{const n=await G(e.fetch,r);s(n.config),d(n.capabilities),g(n.lifecycle)}catch(n){throw u(n instanceof Error?n.message:String(n)),n}finally{M(!1)}},[e.fetch]),m=a.useCallback(async r=>{P(!0),u(void 0);try{const n=await H(e.fetch,r);g(f=>({configurationVersion:f?.configurationVersion,pending:(f?.pending??0)+1,recent:[n,...f?.recent??[]].slice(0,20)}))}catch(n){throw u(n instanceof Error?n.message:String(n)),n}finally{P(!1)}},[e.fetch]),E=a.useCallback(async(r,n)=>{await b(r),await m(n)},[m,b]),x=q?O:!1,U=a.useMemo(()=>({config:o,capabilities:i,lifecycle:y,models:c,loading:x,saving:C,rebuilding:I,error:S,reload:A,save:b,rebuild:m,saveAndRebuild:E}),[i,o,x,S,y,c,m,I,A,b,E,C]);return V.jsx(L.Provider,{value:U,children:t})}function z(t,e){const o=new Map,s=i=>`${i.provider}\0${w(i.id)}`;for(const i of[...t,...e]){const d=s(i),c=o.get(d);if(!c){o.set(d,{...i,id:w(i.id)});continue}const p=[...new Set([...c.capabilities??[],...i.capabilities??[]])];o.set(d,{...c,...i,id:w(i.id),resourceId:c.resourceId??i.resourceId,displayName:c.displayName??i.displayName,availability:c.availability==="available"?c.availability:i.availability,modelType:c.modelType??i.modelType,...p.length>0?{capabilities:p}:{},...c.inputModalities??i.inputModalities?{inputModalities:c.inputModalities??i.inputModalities}:{}})}return[...o.values()]}function w(t){const e=t.lastIndexOf("#");return e>=0?t.slice(e+1):t}function Q(t){return t.map(e=>({id:e.id,displayName:e.displayName,owner:e.provider,ref:X(e.provider,e.id),capabilities:e.capabilities??[]}))}function ie(t,e){const s={chatModel:["chat"],ocrModel:["ocr"],readerModel:["document-understanding","documentunderstanding"],embeddingModel:["embedding"],indexerModel:["indexing"],rerankerModel:["reranking","reranker"]}[e];return s?t.filter(i=>i.capabilities.some(d=>s.includes(d.toLowerCase()))):t}function ne(){const t=a.useContext(L);if(!t)throw new Error("useAiConfig must be used within AiConfigProvider");return t}export{te as A,ie as m,ee as t,ne as u};
1
+ import{u as J,r as a,j as V,o as X}from"./global-BOl78fr8.js";import{a as $}from"./ai-connections-DexTPyfC.js";import{d as D}from"./XpodAiConnectionsPodStore-B11u0BOi.js";async function R(t){return k(t(h("/api/ai/config"),{method:"GET",credentials:"include",headers:{accept:"application/json"}}))}async function G(t,e){return k(t(h("/api/ai/config"),{method:"PATCH",credentials:"include",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(e)}))}async function H(t,e){const o=await t(h("/api/ai/config/rebuild"),{method:"POST",credentials:"include",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({target:e})}),s=await o.json().catch(()=>{});if(!o.ok||!s?.job)throw new Error(s?.error??"Index rebuild request failed");return s.job}async function ee(t,e){const o=e.capabilities.some(i=>i.toLowerCase()==="embedding"),s=await t(h(o?"/v1/embeddings":"/v1/chat/completions"),{method:"POST",credentials:"include",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(o?{model:e.id,input:"xpod readiness probe"}:{model:e.id,messages:[{role:"user",content:"Reply OK."}],max_tokens:1,stream:!1})});if(!s.ok){const i=await s.json().catch(()=>{}),d=typeof i?.error=="string"?i.error:i?.error?.message;throw new Error(d??"Model readiness probe failed")}await s.arrayBuffer()}function h(t){if(typeof window>"u")throw new Error("AI Config API requires the current browser origin");return new URL(t,window.location.origin).toString()}async function k(t){const e=await t,o=await e.json().catch(()=>{});if(!e.ok||!o?.config||!o.capabilities)throw new Error(o?.error??"AI Config request failed");return o}const L=a.createContext(void 0),K=2e3;function te({children:t}){const e=J(),[o,s]=a.useState(),[i,d]=a.useState(),[c,p]=a.useState([]),[y,g]=a.useState(),[O,v]=a.useState(!0),[C,M]=a.useState(!1),[I,P]=a.useState(!1),[S,u]=a.useState(),[N,T]=a.useState(0),q=!!(e.webId&&e.currentPod);a.useEffect(()=>{if(!e.webId||!e.currentPod)return;let r=!1;return queueMicrotask(()=>{if(r||!e.webId||!e.currentPod)return;v(!0),u(void 0);const n=$({webId:e.webId,podUrl:e.currentPod.podUrl,authenticatedFetch:e.fetch}),_=D({database:e.currentPod.database,authenticatedFetch:e.fetch,podUrl:e.currentPod.podUrl,webId:e.currentPod.webId}).listModels?.()?.catch(()=>[])??Promise.resolve([]);Promise.all([R(e.fetch),n.listModels().catch(()=>[]),_]).then(([l,B,F])=>{r||(s(l.config),d(l.capabilities),g(l.lifecycle),p(Q(z(F,B))))}).catch(l=>{r||u(l instanceof Error?l.message:String(l))}).finally(()=>{r||v(!1)})}),()=>{r=!0}},[N,e.currentPod,e.fetch,e.webId]);const A=a.useCallback(()=>{T(r=>r+1)},[]),j=y?.pending??0;a.useEffect(()=>{if(j<=0||!e.webId||!e.currentPod)return;let r=!1;const n=setInterval(()=>{R(e.fetch).then(f=>{r||g(f.lifecycle)}).catch(()=>{})},K);return()=>{r=!0,clearInterval(n)}},[j,e.currentPod,e.fetch,e.webId]);const b=a.useCallback(async r=>{M(!0),u(void 0);try{const n=await G(e.fetch,r);s(n.config),d(n.capabilities),g(n.lifecycle)}catch(n){throw u(n instanceof Error?n.message:String(n)),n}finally{M(!1)}},[e.fetch]),m=a.useCallback(async r=>{P(!0),u(void 0);try{const n=await H(e.fetch,r);g(f=>({configurationVersion:f?.configurationVersion,pending:(f?.pending??0)+1,recent:[n,...f?.recent??[]].slice(0,20)}))}catch(n){throw u(n instanceof Error?n.message:String(n)),n}finally{P(!1)}},[e.fetch]),E=a.useCallback(async(r,n)=>{await b(r),await m(n)},[m,b]),x=q?O:!1,U=a.useMemo(()=>({config:o,capabilities:i,lifecycle:y,models:c,loading:x,saving:C,rebuilding:I,error:S,reload:A,save:b,rebuild:m,saveAndRebuild:E}),[i,o,x,S,y,c,m,I,A,b,E,C]);return V.jsx(L.Provider,{value:U,children:t})}function z(t,e){const o=new Map,s=i=>`${i.provider}\0${w(i.id)}`;for(const i of[...t,...e]){const d=s(i),c=o.get(d);if(!c){o.set(d,{...i,id:w(i.id)});continue}const p=[...new Set([...c.capabilities??[],...i.capabilities??[]])];o.set(d,{...c,...i,id:w(i.id),resourceId:c.resourceId??i.resourceId,displayName:c.displayName??i.displayName,availability:c.availability==="available"?c.availability:i.availability,modelType:c.modelType??i.modelType,...p.length>0?{capabilities:p}:{},...c.inputModalities??i.inputModalities?{inputModalities:c.inputModalities??i.inputModalities}:{}})}return[...o.values()]}function w(t){const e=t.lastIndexOf("#");return e>=0?t.slice(e+1):t}function Q(t){return t.map(e=>({id:e.id,displayName:e.displayName,owner:e.provider,ref:X(e.provider,e.id),capabilities:e.capabilities??[]}))}function ie(t,e){const s={chatModel:["chat"],ocrModel:["ocr"],readerModel:["document-understanding","documentunderstanding"],embeddingModel:["embedding"],indexerModel:["indexing"],rerankerModel:["reranking","reranker"]}[e];return s?t.filter(i=>i.capabilities.some(d=>s.includes(d.toLowerCase()))):t}function ne(){const t=a.useContext(L);if(!t)throw new Error("useAiConfig must be used within AiConfigProvider");return t}export{te as A,ie as m,ee as t,ne as u};
@@ -0,0 +1 @@
1
+ import{c as d,j as e,Z as x,r as p,_ as g,$ as f,a0 as y,a1 as b}from"./global-BOl78fr8.js";import{P as v}from"./PaneListHeader-Bz0UAhZr.js";import{A as j,u as k}from"./AiConfigContext-CR3YhTA-.js";import{T as N,u as w}from"./workspace-layout-Co0KpMKd.js";import"./ai-connections-DexTPyfC.js";import"./XpodAiConnectionsPodStore-B11u0BOi.js";import"./index-browser-Bk7jaLCd.js";const M=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"11.5",cy:"14.5",r:"2.5",key:"1bq0ko"}],["path",{d:"M13.3 16.3 15 18",key:"2quom7"}]],C=d("file-search",M);const A=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M7 12H3",key:"13ou7f"}],["path",{d:"M7 19H3",key:"wbqt3n"}],["path",{d:"M12 18a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L11 14",key:"qth677"}],["path",{d:"M11 10v4h4",key:"172dkj"}]],I=d("list-restart",A);const L=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 8h8",key:"1jbsf9"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M7 16h6",key:"1vyc9m"}]],H=d("scan-text",L);const _=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],q=d("sliders-horizontal",_);function o(s,a,t,n,i){return{id:s,label:a,path:t,href:`/ai-config/${t}`,end:!0,description:n,icon:i}}const l=[o("model-assignments","Model Assignments","model-assignments","Choose the model used by each Xpod capability.",q),o("document-processing","Document Processing","document-processing","Control OCR and structured document reading.",H),o("search-indexing","Search & Indexing","search-indexing","Enable FTS, vector retrieval, and backend selection.",C),o("index-lifecycle","Index Lifecycle","index-lifecycle","Control automatic indexing and derived-index rebuilds.",I)];function O(){return e.jsx(j,{children:e.jsx(S,{})})}function S(){const s=x(),{config:a,loading:t,saving:n,error:i,reload:m}=k(),[u,c]=p.useState(!1),h=l.find(r=>s.pathname.endsWith(r.path))??l[0];return e.jsx(N,{mode:"auto",listHeader:e.jsx(v,{title:"AI Config"}),list:e.jsx(T,{}),mainHeader:e.jsx("div",{className:"flex h-full min-w-0 items-center px-4",children:e.jsxs("div",{className:"min-w-0",children:[e.jsxs("h1",{className:"text-sm font-semibold text-foreground",children:["AI Config · ",h.label]}),e.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Pod-level AI and derived-index policy"})]})}),main:e.jsxs("section",{className:"min-h-full bg-background",children:[n&&e.jsx("div",{role:"status","aria-live":"polite",className:"border-b border-border px-6 py-2 text-xs text-muted-foreground",children:"Saving AI configuration…"}),i?e.jsx(z,{error:i,showTechnicalDetails:u,onToggleTechnicalDetails:()=>c(r=>!r),onRetry:()=>{c(!1),m()}}):t||!a?e.jsx(P,{}):e.jsx(g,{})]}),className:"min-h-full"})}function z({error:s,showTechnicalDetails:a,onToggleTechnicalDetails:t,onRetry:n}){return e.jsx("div",{className:"mx-auto w-full max-w-4xl p-6",children:e.jsxs("div",{role:"alert","aria-live":"assertive",className:"rounded-lg border border-destructive/30 bg-destructive/5 p-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-foreground",children:"AI configuration could not be loaded"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Xpod could not read this Pod’s AI settings. Your existing settings were not changed."}),e.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[e.jsx("button",{type:"button",onClick:n,className:"h-9 rounded-md bg-primary px-3 text-sm font-medium text-primary-foreground hover:bg-primary/90",children:"Try again"}),e.jsx("button",{type:"button","aria-expanded":a,onClick:t,className:"h-9 rounded-md border border-input bg-background px-3 text-sm font-medium text-foreground hover:bg-accent",children:a?"Hide details":"Show details"})]}),a&&e.jsx("p",{className:"mt-3 break-words font-mono text-xs text-muted-foreground",children:s})]})})}function P(){return e.jsxs("div",{role:"status","aria-live":"polite",className:"mx-auto w-full max-w-4xl p-6",children:[e.jsx("div",{className:"h-7 w-52 animate-pulse rounded bg-muted"}),e.jsx("div",{className:"mt-3 h-4 w-80 max-w-full animate-pulse rounded bg-muted"}),e.jsx("div",{className:"mt-6 divide-y divide-border overflow-hidden rounded-xl border border-border",children:Array.from({length:4},(s,a)=>e.jsxs("div",{className:"grid gap-4 p-4 lg:grid-cols-[minmax(220px,1fr)_minmax(320px,440px)]",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-4 w-28 animate-pulse rounded bg-muted"}),e.jsx("div",{className:"h-3 w-52 animate-pulse rounded bg-muted"})]}),e.jsx("div",{className:"h-10 animate-pulse rounded-md bg-muted"})]},a))}),e.jsx("span",{className:"sr-only",children:"Loading AI configuration…"})]})}function T(){const s=w();return e.jsx("aside",{className:"h-full border-r border-border bg-muted/20 py-2",children:e.jsx("nav",{"aria-label":"AI Config sections","data-list-navigation":!0,children:l.map(a=>{const t=a.icon;return e.jsxs(f,{to:a.path,end:a.end,onClick:()=>s.openMain(),onKeyDown:y,className:({isActive:n})=>b(n,{compact:!1}),children:[e.jsx(t,{className:"mt-0.5 h-4 w-4 shrink-0","aria-hidden":"true"}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block text-sm font-medium",children:a.label}),e.jsx("span",{className:"mt-0.5 block text-xs leading-4 text-muted-foreground",children:a.description})]})]},a.id)})})})}export{O as default};