@nextclaw/ui 0.27.3 → 0.27.5-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/.vite/manifest.json +416 -416
  3. package/dist/assets/{account-panel-DiKpSvqS.js → account-panel-DgqicWMm.js} +1 -1
  4. package/dist/assets/{agents-lT-bDFex.js → agents-CTSR4ZKb.js} +1 -1
  5. package/dist/assets/agents-i7167DcF.js +1 -0
  6. package/dist/assets/{api-BaML_txv.js → api-CXWxExzS.js} +2 -2
  7. package/dist/assets/app-presenter-provider-DdD2Q7jZ.js +29 -0
  8. package/dist/assets/{appearance-settings-page-BNIxFwEY.js → appearance-settings-page-CSWYLrsR.js} +1 -1
  9. package/dist/assets/apps-DUP3aPpu.js +1 -0
  10. package/dist/assets/{book-open-oG0GrLyy.js → book-open-B3Ac0voD.js} +1 -1
  11. package/dist/assets/{card-DxCOCY_7.js → card-eFBmxYiI.js} +1 -1
  12. package/dist/assets/{channels-list-page-UQ1xjKw9.js → channels-list-page-lQOINLW8.js} +1 -1
  13. package/dist/assets/{circle-dashed-pgOOTUik.js → circle-dashed-KGwElDWV.js} +1 -1
  14. package/dist/assets/{client-C1Z8ITVa.js → client-BDS360Kz.js} +1 -1
  15. package/dist/assets/{config-split-page-Cfozkh5B.js → config-split-page-BaHtm9OW.js} +1 -1
  16. package/dist/assets/{confirm-dialog-BdEQiFoD.js → confirm-dialog-jz2cQKId.js} +1 -1
  17. package/dist/assets/{context-menu-DVgLoPqH.js → context-menu-C0qywo73.js} +71 -72
  18. package/dist/assets/{createLucideIcon-D-7Sxfw7.js → createLucideIcon-C3LSyx-e.js} +1 -1
  19. package/dist/assets/cron-DPBUHn7j.js +1 -0
  20. package/dist/assets/{desktop-capabilities-page-gakZ5UKX.js → desktop-capabilities-page-CKq2Miye.js} +1 -1
  21. package/dist/assets/{desktop-update-config-CVUwJyV-.js → desktop-update-config-C_SBtjA1.js} +1 -1
  22. package/dist/assets/{dialog-InO6RVpm.js → dialog-DMKYZDFu.js} +1 -1
  23. package/dist/assets/dist-D9h2cWk3.js +41 -0
  24. package/dist/assets/doc-browser-C7kvXGc_.js +1 -0
  25. package/dist/assets/{doc-browser-context-Bs122rxO.js → doc-browser-context-CoVMIiU8.js} +1 -1
  26. package/dist/assets/{download-BN4aCzSx.js → download-C2gYe8n1.js} +1 -1
  27. package/dist/assets/{extensions-hxS830nS.js → extensions-DXDFcRVC.js} +1 -1
  28. package/dist/assets/{external-link-NwtWKzE2.js → external-link-DZzwHRHW.js} +1 -1
  29. package/dist/assets/{form-actions-XP38NiPw.js → form-actions-CZxcWXSm.js} +1 -1
  30. package/dist/assets/{i18n-Bzo4IocH.js → i18n-ByVUrt9w.js} +2 -2
  31. package/dist/assets/inbox-C09MQO9k.js +1 -0
  32. package/dist/assets/{inbox-DofXi7Xv.js → inbox-CI8ATevA.js} +1 -1
  33. package/dist/assets/{keyboard-shortcuts-settings-page-Cn3zyBq_.js → keyboard-shortcuts-settings-page-BCxB9m69.js} +1 -1
  34. package/dist/assets/{login-page-CkfjjXD2.js → login-page--Njgbmpm.js} +1 -1
  35. package/dist/assets/login-page-CzvxaAU8.js +1 -0
  36. package/dist/assets/{main-BI7BtvLx.js → main-C6VGoYNO.js} +2 -2
  37. package/dist/assets/main-i18n-catalog.config-_4gMZaNz.js +1 -0
  38. package/dist/assets/main-kp_0b1bg.css +1 -0
  39. package/dist/assets/marketplace-CXCLbyho.js +1 -0
  40. package/dist/assets/mcp-marketplace-page-ZAm380SB.js +1 -0
  41. package/dist/assets/{model-config-page-BCGCP2Wc.js → model-config-page-CeVvZ29o.js} +1 -1
  42. package/dist/assets/{navigation-link-tawg3qi2.js → navigation-link-O9Wm0epj.js} +1 -1
  43. package/dist/assets/panel-app-i18n-catalog.config-B9c87s2X.js +1 -0
  44. package/dist/assets/panel-apps-BQlyeAId.js +1 -0
  45. package/dist/assets/{panelStandalone-smtUeY2k.js → panelStandalone-DomappXm.js} +2 -2
  46. package/dist/assets/plus-C42o6xrD.js +1 -0
  47. package/dist/assets/{privacy-settings-page-D4TI_vdw.js → privacy-settings-page-CHDv9ppI.js} +1 -1
  48. package/dist/assets/{projects-Rm2oKUPt.js → projects-BWM-oEo0.js} +1 -1
  49. package/dist/assets/{provider-models-CWtoV3BJ.js → provider-models-D8WOdsdu.js} +1 -1
  50. package/dist/assets/{provider-scoped-model-input-DJzdGBE8.js → provider-scoped-model-input-BOPkUOtD.js} +1 -1
  51. package/dist/assets/{providers-config-page-gzLkTzMP.js → providers-config-page-BilPL0kF.js} +1 -1
  52. package/dist/assets/{puzzle-CXL_z0vz.js → puzzle-DmKVREoh.js} +1 -1
  53. package/dist/assets/{pwa-Blsqtn1m.js → pwa-Cp7pPvsZ.js} +1 -1
  54. package/dist/assets/{refresh-cw-CqsHJPqR.js → refresh-cw-DOg2pWGu.js} +1 -1
  55. package/dist/assets/remote-DngM8iep.js +1 -0
  56. package/dist/assets/{rotate-cw-DS-Gca0a.js → rotate-cw-CWFIat29.js} +1 -1
  57. package/dist/assets/{runtime-config-page-B5CCnrei.js → runtime-config-page-Dx6lWn3_.js} +1 -1
  58. package/dist/assets/{save-CwxRo7hc.js → save-C1G0ZU-G.js} +1 -1
  59. package/dist/assets/{search-Drx-sMCE.js → search-Dpgv--de.js} +1 -1
  60. package/dist/assets/{search-config-page-BjVONAIH.js → search-config-page-DevSv1ZK.js} +1 -1
  61. package/dist/assets/{secrets-config-page-BB32noHT.js → secrets-config-page-B4jWTV6V.js} +1 -1
  62. package/dist/assets/security-config-BGEs0SHi.js +1 -0
  63. package/dist/assets/{select-DHYR109w.js → select-BJ-EjmCz.js} +1 -1
  64. package/dist/assets/{service-apps-panel-DOKGtwsR.js → service-apps-panel-9khaUSFI.js} +1 -1
  65. package/dist/assets/{settings-2-DAPjKYtK.js → settings-2-D3-m8a3v.js} +1 -1
  66. package/dist/assets/{status-dot-xxVxbdQr.js → status-dot-DlELD18e.js} +1 -1
  67. package/dist/assets/{tag-chip-0lQj9HFa.js → tag-chip-DFzDSvcF.js} +1 -1
  68. package/dist/assets/{theme-provider-DDJOlUxn.js → theme-provider-BsJ6HxeX.js} +1 -1
  69. package/dist/assets/{trash-2-B8mbrtCx.js → trash-2-BVQs-0ji.js} +1 -1
  70. package/dist/assets/{use-config-BpKXDcM_.js → use-config-M1L4xn8c.js} +1 -1
  71. package/dist/assets/{use-desktop-capabilities-C1bXk7fx.js → use-desktop-capabilities-BO_2CXgu.js} +1 -1
  72. package/dist/assets/{use-viewport-layout-D6seoW0Z.js → use-viewport-layout-Bnm5W5Qz.js} +1 -1
  73. package/dist/assets/{x-DLvS4xvV.js → x-waP-WLuT.js} +1 -1
  74. package/dist/index.html +37 -37
  75. package/dist/panel-standalone.html +14 -14
  76. package/package.json +8 -8
  77. package/src/features/chat/features/conversation/components/__tests__/session-user-questions.test.tsx +98 -0
  78. package/src/features/chat/features/conversation/components/session-conversation-area.tsx +14 -3
  79. package/src/features/chat/features/conversation/components/session-user-questions.tsx +177 -0
  80. package/src/features/chat/features/conversation/hooks/use-session-user-questions.ts +100 -0
  81. package/src/features/chat/features/message/components/chat-message-list.container.tsx +7 -0
  82. package/src/features/chat/features/message/utils/__tests__/chat-message-timeline.utils.test.ts +16 -0
  83. package/src/features/chat/features/message/utils/__tests__/chat-message.utils.test.ts +62 -0
  84. package/src/features/chat/features/message/utils/chat-message-part.utils.ts +12 -0
  85. package/src/features/chat/features/message/utils/chat-message-timeline.utils.ts +3 -3
  86. package/src/features/chat/features/message/utils/chat-message.utils.ts +62 -9
  87. package/src/features/chat/features/message/utils/chat-user-question-timeline.utils.ts +42 -0
  88. package/src/shared/lib/i18n/locales/en-US/chat.json +16 -0
  89. package/src/shared/lib/i18n/locales/zh-CN/chat.json +16 -0
  90. package/dist/assets/agents-nyTxTl89.js +0 -1
  91. package/dist/assets/app-presenter-provider-DSlY9Lz6.js +0 -28
  92. package/dist/assets/apps-D7Se5AXs.js +0 -1
  93. package/dist/assets/cron-wSJKKm6g.js +0 -1
  94. package/dist/assets/dist-BxOjfeaD.js +0 -41
  95. package/dist/assets/doc-browser-Cuedjp9j.js +0 -1
  96. package/dist/assets/inbox-CnpKPeFb.js +0 -1
  97. package/dist/assets/login-page-3Yv6FU7k.js +0 -1
  98. package/dist/assets/main-D_zmSVS1.css +0 -1
  99. package/dist/assets/main-i18n-catalog.config-ykBbOfNP.js +0 -1
  100. package/dist/assets/marketplace-BkdTZexc.js +0 -1
  101. package/dist/assets/mcp-marketplace-page-BqFum360.js +0 -1
  102. package/dist/assets/panel-app-i18n-catalog.config-DEFg3R5S.js +0 -1
  103. package/dist/assets/panel-apps-CRjFqZZD.js +0 -1
  104. package/dist/assets/plus-v29lPO18.js +0 -1
  105. package/dist/assets/remote-DTe4pS7P.js +0 -1
  106. package/dist/assets/security-config--ilpaAEr.js +0 -1
@@ -1 +1 @@
1
- import{i as e}from"./chunk-DF37yw5_.js";import{xr as t}from"./api-BaML_txv.js";var n=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),r=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),i={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},a=e(t()),o=(0,a.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:s=``,children:c,iconNode:l,...u},d)=>(0,a.createElement)(`svg`,{ref:d,...i,width:t,height:t,stroke:e,strokeWidth:o?Number(n)*24/Number(t):n,className:r(`lucide`,s),...u},[...l.map(([e,t])=>(0,a.createElement)(e,t)),...Array.isArray(c)?c:[c]])),s=(e,t)=>{let i=(0,a.forwardRef)(({className:i,...s},c)=>(0,a.createElement)(o,{ref:c,iconNode:t,className:r(`lucide-${n(e)}`,i),...s}));return i.displayName=`${e}`,i};export{s as t};
1
+ import{i as e}from"./chunk-DF37yw5_.js";import{xr as t}from"./api-CXWxExzS.js";var n=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),r=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),i={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},a=e(t()),o=(0,a.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:s=``,children:c,iconNode:l,...u},d)=>(0,a.createElement)(`svg`,{ref:d,...i,width:t,height:t,stroke:e,strokeWidth:o?Number(n)*24/Number(t):n,className:r(`lucide`,s),...u},[...l.map(([e,t])=>(0,a.createElement)(e,t)),...Array.isArray(c)?c:[c]])),s=(e,t)=>{let i=(0,a.forwardRef)(({className:i,...s},c)=>(0,a.createElement)(o,{ref:c,iconNode:t,className:r(`lucide-${n(e)}`,i),...s}));return i.displayName=`${e}`,i};export{s as t};
@@ -0,0 +1 @@
1
+ import{K as e}from"./app-presenter-provider-DdD2Q7jZ.js";export{e as CronJobResource};
@@ -1 +1 @@
1
- import{Jt as e,Kt as t,Yt as n,Zt as r,qt as i,ur as a}from"./api-BaML_txv.js";import{s as o}from"./i18n-Bzo4IocH.js";import{a as s,i as c,n as l,o as u,r as d}from"./use-desktop-capabilities-C1bXk7fx.js";var f=a();function p(){let a=d(),p=l(),h=s(),v=c(),y=u(),b=a.data,x=h.isPending||v.isPending;return(0,f.jsxs)(r,{title:o(`desktopCapabilitiesPageTitle`),description:o(`desktopCapabilitiesPageDescription`),children:[(0,f.jsx)(e,{title:o(`desktopCapabilitiesSystemTitle`),description:o(`desktopCapabilitiesSystemDescription`),children:(0,f.jsxs)(i,{children:[(0,f.jsx)(t,{title:o(`desktopCapabilitiesHostStatus`),description:a.isLoading?o(`loading`):b?.online?o(`desktopCapabilitiesHostOnline`):o(`desktopCapabilitiesHostOffline`),control:(0,f.jsx)(n,{type:`button`,variant:`outline`,size:`sm`,disabled:a.isFetching,onClick:()=>void a.refetch(),children:o(`desktopCapabilitiesRecheck`)})}),(0,f.jsx)(t,{title:o(`desktopCapabilitiesAccessibility`),description:g(b?.permissions.accessibility),control:(0,f.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,f.jsx)(n,{type:`button`,variant:`outline`,size:`sm`,disabled:x,onClick:()=>v.mutate(),children:o(`desktopCapabilitiesOpenSettings`)}),(0,f.jsx)(n,{type:`button`,size:`sm`,disabled:x,onClick:()=>h.mutate(),children:o(`desktopCapabilitiesRequestPermission`)})]})})]})}),(0,f.jsx)(e,{title:o(`desktopCapabilitiesGrantsTitle`),description:o(`desktopCapabilitiesGrantsDescription`),children:(0,f.jsx)(i,{children:p.isLoading?(0,f.jsx)(t,{title:o(`loading`)}):p.data?.length?p.data.map(e=>(0,f.jsx)(m,{grant:e,disabled:y.isPending,onRevoke:()=>y.mutate(e)},_(e))):(0,f.jsx)(t,{title:o(`desktopCapabilitiesNoGrants`),description:o(`desktopCapabilitiesNoGrantsDescription`)})})})]})}function m({disabled:e,grant:r,onRevoke:i}){let a=h(r.resource.target);return(0,f.jsx)(t,{title:r.subject.type===`agent`?`${o(`desktopCapabilitiesAgent`)} · ${r.subject.id}`:`${o(`desktopCapabilitiesExtension`)} · ${r.subject.id}`,description:`${a} · ${r.access.join(`, `)}`,control:(0,f.jsx)(n,{type:`button`,variant:`destructive`,size:`sm`,disabled:e,onClick:i,children:o(`desktopCapabilitiesRevoke`)})})}function h(e){if(!e||typeof e!=`object`||Array.isArray(e))return o(`desktopCapabilitiesUnknownApplication`);let{applicationId:t}=e;return typeof t==`string`&&t.trim()?t.trim():o(`desktopCapabilitiesUnknownApplication`)}function g(e){switch(e){case`granted`:return o(`desktopCapabilitiesPermissionGranted`);case`not_granted`:return o(`desktopCapabilitiesPermissionNotGranted`);case`not_supported`:return o(`desktopCapabilitiesPermissionNotSupported`);default:return o(`desktopCapabilitiesPermissionUnknown`)}}function _(e){return`${e.subject.type}:${e.subject.id}:${JSON.stringify(e.resource.target)}:${e.access.join(`,`)}`}export{p as DesktopCapabilitiesPage};
1
+ import{Jt as e,Kt as t,Yt as n,Zt as r,qt as i,ur as a}from"./api-CXWxExzS.js";import{s as o}from"./i18n-ByVUrt9w.js";import{a as s,i as c,n as l,o as u,r as d}from"./use-desktop-capabilities-BO_2CXgu.js";var f=a();function p(){let a=d(),p=l(),h=s(),v=c(),y=u(),b=a.data,x=h.isPending||v.isPending;return(0,f.jsxs)(r,{title:o(`desktopCapabilitiesPageTitle`),description:o(`desktopCapabilitiesPageDescription`),children:[(0,f.jsx)(e,{title:o(`desktopCapabilitiesSystemTitle`),description:o(`desktopCapabilitiesSystemDescription`),children:(0,f.jsxs)(i,{children:[(0,f.jsx)(t,{title:o(`desktopCapabilitiesHostStatus`),description:a.isLoading?o(`loading`):b?.online?o(`desktopCapabilitiesHostOnline`):o(`desktopCapabilitiesHostOffline`),control:(0,f.jsx)(n,{type:`button`,variant:`outline`,size:`sm`,disabled:a.isFetching,onClick:()=>void a.refetch(),children:o(`desktopCapabilitiesRecheck`)})}),(0,f.jsx)(t,{title:o(`desktopCapabilitiesAccessibility`),description:g(b?.permissions.accessibility),control:(0,f.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,f.jsx)(n,{type:`button`,variant:`outline`,size:`sm`,disabled:x,onClick:()=>v.mutate(),children:o(`desktopCapabilitiesOpenSettings`)}),(0,f.jsx)(n,{type:`button`,size:`sm`,disabled:x,onClick:()=>h.mutate(),children:o(`desktopCapabilitiesRequestPermission`)})]})})]})}),(0,f.jsx)(e,{title:o(`desktopCapabilitiesGrantsTitle`),description:o(`desktopCapabilitiesGrantsDescription`),children:(0,f.jsx)(i,{children:p.isLoading?(0,f.jsx)(t,{title:o(`loading`)}):p.data?.length?p.data.map(e=>(0,f.jsx)(m,{grant:e,disabled:y.isPending,onRevoke:()=>y.mutate(e)},_(e))):(0,f.jsx)(t,{title:o(`desktopCapabilitiesNoGrants`),description:o(`desktopCapabilitiesNoGrantsDescription`)})})})]})}function m({disabled:e,grant:r,onRevoke:i}){let a=h(r.resource.target);return(0,f.jsx)(t,{title:r.subject.type===`agent`?`${o(`desktopCapabilitiesAgent`)} · ${r.subject.id}`:`${o(`desktopCapabilitiesExtension`)} · ${r.subject.id}`,description:`${a} · ${r.access.join(`, `)}`,control:(0,f.jsx)(n,{type:`button`,variant:`destructive`,size:`sm`,disabled:e,onClick:i,children:o(`desktopCapabilitiesRevoke`)})})}function h(e){if(!e||typeof e!=`object`||Array.isArray(e))return o(`desktopCapabilitiesUnknownApplication`);let{applicationId:t}=e;return typeof t==`string`&&t.trim()?t.trim():o(`desktopCapabilitiesUnknownApplication`)}function g(e){switch(e){case`granted`:return o(`desktopCapabilitiesPermissionGranted`);case`not_granted`:return o(`desktopCapabilitiesPermissionNotGranted`);case`not_supported`:return o(`desktopCapabilitiesPermissionNotSupported`);default:return o(`desktopCapabilitiesPermissionUnknown`)}}function _(e){return`${e.subject.type}:${e.subject.id}:${JSON.stringify(e.resource.target)}:${e.access.join(`,`)}`}export{p as DesktopCapabilitiesPage};
@@ -1 +1 @@
1
- import{Jt as e,Kt as t,Qn as n,Yt as r,Zt as i,_n as a,an as o,nn as s,on as c,qt as l,rn as u,tn as d,ur as f}from"./api-BaML_txv.js";import{t as p}from"./navigation-link-tawg3qi2.js";import{t as m}from"./download-BN4aCzSx.js";import{t as h}from"./refresh-cw-CqsHJPqR.js";import{t as g}from"./rotate-cw-DS-Gca0a.js";import{l as _,n as v,s as y}from"./i18n-Bzo4IocH.js";import{a as b,i as x,n as S,r as C,t as w}from"./select-DHYR109w.js";import{a as T,i as E,n as D,r as O,t as k}from"./card-DxCOCY_7.js";var A=f(),j=`https://github.com/Peiiii/nextclaw/releases`,M={checking:`desktopUpdatesStatusChecking`,"update-available":`desktopUpdatesStatusAvailable`,downloading:`desktopUpdatesStatusDownloading`,downloaded:`desktopUpdatesStatusDownloaded`,applying:`desktopUpdatesStatusApplying`,"restart-required":`desktopUpdatesStatusRestartRequired`,"up-to-date":`desktopUpdatesStatusUpToDate`,blocked:`desktopUpdatesStatusBlocked`,failed:`desktopUpdatesStatusFailed`},N={feature:`desktopUpdatesReleaseNotesFeature`,enhancement:`desktopUpdatesReleaseNotesEnhancement`,fix:`desktopUpdatesReleaseNotesFix`,compatibility:`desktopUpdatesReleaseNotesCompatibility`};function P({snapshot:e}){return(0,A.jsx)(`span`,{className:a(`inline-flex rounded-full px-3 py-1 text-xs font-medium ring-1`,U(e.status)),children:H(e)})}function F({label:e,value:t}){return(0,A.jsxs)(`div`,{className:`rounded-lg bg-background/70 p-3`,children:[(0,A.jsx)(`p`,{className:`text-[11px] font-medium uppercase tracking-[0.08em] text-muted-foreground`,children:e}),(0,A.jsx)(`p`,{className:`mt-1 text-sm font-semibold text-foreground`,children:t})]})}function I({snapshot:e}){if(e.status!==`downloading`)return null;let t=e.progress?.percent,n=t==null?y(`desktopUpdatesDownloadProgressUnknown`):y(`desktopUpdatesDownloadProgressPercent`).replace(`{percent}`,String(t)),r=z(e.progress?.downloadedBytes??0,e.progress?.totalBytes??null);return(0,A.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 p-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,A.jsx)(`p`,{className:`text-sm font-semibold text-amber-800`,children:n}),(0,A.jsx)(`p`,{className:`text-xs font-medium text-amber-700`,children:r})]}),(0,A.jsx)(`div`,{className:`mt-3 h-2 overflow-hidden rounded-full bg-amber-100`,children:(0,A.jsx)(`div`,{className:`h-full rounded-full bg-amber-500 transition-[width]`,style:{width:`${t??0}%`}})})]})}function L(e){return e?.trim()||`-`}function R(e){return e?v(e):`-`}function z(e,t){let n=B(e);return t&&t>0?`${n} / ${B(t)}`:n}function B(e){if(!Number.isFinite(e)||e<=0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n>=10||r===0?n.toFixed(0):n.toFixed(1)} ${t[r]}`}function V(e){return y(e===`beta`?`desktopUpdatesChannelBeta`:`desktopUpdatesChannelStable`)}function H(e){return e.status===`failed`&&e.failureStage?y(`desktopUpdatesFailureStage.${e.failureStage}`):y(M[e.status]??`desktopUpdatesStatusIdle`)}function U(e){return e===`downloaded`||e===`restart-required`?`bg-emerald-50 text-emerald-700 ring-emerald-100`:e===`update-available`||e===`downloading`||e===`checking`?`bg-amber-50 text-amber-700 ring-amber-100`:e===`failed`||e===`blocked`?`bg-red-50 text-red-700 ring-red-100`:`bg-gray-100 text-gray-700 ring-gray-200`}function W(e){return e.status===`blocked`&&e.installationKind===`desktop-bundle`&&e.blockReason===`unsupported-installation`}function G(){return _()===`zh`?`zh-CN`:`en-US`}function K(e,t){return s(e.title,t)??y(N[e.kind]??`desktopUpdatesReleaseNotesEnhancement`)}function q({snapshot:e}){let t=u(e),r=G(),i=n({queryKey:[`runtime-release-notes`,t],queryFn:async()=>await d(t??``),enabled:!!t,retry:!1,staleTime:300*1e3}),a=i.data,o=s(a?.title,r)??y(`desktopUpdatesReleaseNotesPreviewTitle`),c=s(a?.summary,r)??y(`desktopUpdatesReleaseNotesPreviewDescription`);return e.releaseNotesUrl?(0,A.jsxs)(k,{children:[(0,A.jsx)(E,{children:(0,A.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,A.jsxs)(`div`,{className:`space-y-1`,children:[(0,A.jsx)(T,{children:o}),(0,A.jsx)(O,{children:c})]}),(0,A.jsx)(p,{href:e.releaseNotesUrl,external:!0,children:y(`desktopUpdatesReleaseNotes`)})]})}),(0,A.jsxs)(D,{className:`space-y-4`,children:[i.isLoading?(0,A.jsx)(`p`,{className:`text-sm text-gray-500`,children:y(`desktopUpdatesReleaseNotesPreviewLoading`)}):null,!t||i.isError?(0,A.jsx)(`p`,{className:`text-sm text-gray-500`,children:y(`desktopUpdatesReleaseNotesPreviewUnavailable`)}):null,a?(0,A.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:a.sections.map(e=>(0,A.jsxs)(`div`,{className:`rounded-xl border border-gray-200 bg-gray-50/60 p-4`,children:[(0,A.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:K(e,r)}),(0,A.jsx)(`ul`,{className:`mt-3 space-y-3`,children:e.items.map((t,n)=>{let i=s(t.title,r),a=s(t.body,r);return(0,A.jsxs)(`li`,{className:`space-y-1`,children:[i?(0,A.jsx)(`p`,{className:`text-sm font-medium text-gray-800`,children:i}):null,a?(0,A.jsx)(`p`,{className:`text-sm leading-5 text-gray-600`,children:a}):null]},`${i??e.kind}-${n}`)})})]},e.kind))}):null]})]}):null}function J(){return(0,A.jsx)(i,{title:y(`runtimeUpdatesPageTitle`),description:y(`runtimeUpdatesPageDescription`),children:(0,A.jsx)(e,{title:y(`runtimeUpdatesUnavailableTitle`),description:y(`runtimeUpdatesUnavailableDescription`),children:(0,A.jsx)(l,{children:(0,A.jsx)(`p`,{className:`p-4 text-sm text-muted-foreground`,children:y(`runtimeUpdatesUnavailableHint`)})})})})}function Y(){let{supported:n,initialized:s,busyAction:u,snapshot:d}=c();if(!s)return(0,A.jsx)(i,{title:y(`runtimeUpdatesPageTitle`),description:y(`runtimeUpdatesPageDescription`),children:(0,A.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:y(`loading`)})});if(!n||!d)return(0,A.jsx)(J,{});let f=u===`checking`,_=u===`downloading`,v=u===`applying`,T=u===`updating`,E=u===`switching-channel`,D=(d.status===`update-available`||d.status===`downloaded`)&&!_&&!v&&!T,O=[[y(`runtimeUpdatesHostVersion`),L(d.hostVersion)],[y(`desktopUpdatesCurrentBundleVersion`),L(d.currentVersion)],[y(`desktopUpdatesAvailableVersion`),L(d.availableVersion)],[y(`desktopUpdatesLastCheckedAt`),R(d.lastCheckedAt)],[y(`desktopUpdatesCurrentChannel`),V(d.channel)]];return(0,A.jsxs)(i,{title:y(`runtimeUpdatesPageTitle`),description:y(`runtimeUpdatesPageDescription`),actions:(0,A.jsxs)(r,{variant:`outline`,onClick:()=>void o.checkForUpdates(),disabled:f||_||v||T,children:[(0,A.jsx)(h,{className:a(`mr-2 h-4 w-4`,f&&`animate-spin`)}),y(`desktopUpdatesCheckNow`)]}),children:[(0,A.jsx)(e,{title:y(`desktopUpdatesOverviewTitle`),description:y(`desktopUpdatesOverviewDescription`),children:(0,A.jsx)(l,{children:(0,A.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,A.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:y(`desktopUpdatesStatusLabel`)}),(0,A.jsx)(P,{snapshot:d})]}),(0,A.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-5`,children:O.map(([e,t])=>(0,A.jsx)(F,{label:e,value:t},e))}),d.channel===`beta`?(0,A.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 p-4`,children:[(0,A.jsx)(`p`,{className:`text-sm font-semibold text-amber-800`,children:y(`desktopUpdatesBetaBadgeTitle`)}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-amber-700`,children:y(`desktopUpdatesBetaBadgeDescription`)})]}):null,d.downloadedVersion?(0,A.jsxs)(`div`,{className:`rounded-2xl border border-emerald-200 bg-emerald-50/70 p-4`,children:[(0,A.jsx)(`p`,{className:`text-sm font-semibold text-emerald-800`,children:y(`desktopUpdatesDownloadedBannerTitle`)}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-emerald-700`,children:y(`runtimeUpdatesDownloadedBannerDescription`).replace(`{version}`,d.downloadedVersion)})]}):null,(0,A.jsx)(I,{snapshot:d}),d.status===`blocked`?(0,A.jsxs)(`div`,{className:`rounded-2xl border border-red-200 bg-red-50/70 p-4`,children:[(0,A.jsx)(`p`,{className:`text-sm font-semibold text-red-800`,children:y(`desktopUpdatesBlockedTitle`)}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-red-700`,children:d.errorMessage??y(`desktopUpdatesBlockedDescription`)}),d.recoveryCommand?(0,A.jsx)(`code`,{className:`mt-3 block rounded-lg bg-white/70 px-3 py-2 text-xs text-red-800`,children:d.recoveryCommand}):null,W(d)?(0,A.jsx)(p,{href:j,external:!0,icon:m,className:`mt-3 rounded-full border border-red-300 bg-white/70 px-3 py-2 text-red-800 no-underline hover:bg-white hover:text-red-900 hover:no-underline`,children:y(`desktopUpdatesManualPortableDownload`)}):null]}):null,d.errorMessage&&d.status!==`blocked`?(0,A.jsx)(`div`,{className:`rounded-2xl border border-red-200 bg-red-50/70 p-4 text-sm text-red-700`,children:d.errorMessage}):null]})})}),(0,A.jsx)(q,{snapshot:d}),(0,A.jsx)(e,{title:y(`desktopUpdatesChannelSettingsTitle`),description:y(`desktopUpdatesChannelSettingsDescription`),children:(0,A.jsx)(l,{children:(0,A.jsx)(t,{title:y(`desktopUpdatesReleaseChannel`),description:y(`desktopUpdatesReleaseChannelHelp`),layout:`stacked`,children:(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsxs)(w,{value:d.channel,disabled:E||f||_||v||T,onValueChange:e=>void o.updateChannel(e),children:[(0,A.jsx)(x,{className:`w-full max-w-sm`,children:(0,A.jsx)(b,{placeholder:y(`desktopUpdatesReleaseChannel`)})}),(0,A.jsxs)(S,{children:[(0,A.jsx)(C,{value:`stable`,children:y(`desktopUpdatesChannelStable`)}),(0,A.jsx)(C,{value:`beta`,children:y(`desktopUpdatesChannelBeta`)})]})]}),(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:y(`desktopUpdatesReleaseChannelDowngradeHint`)})]})})})}),(0,A.jsx)(e,{title:y(`desktopUpdatesActionsTitle`),description:y(`runtimeUpdatesActionsDescription`),children:(0,A.jsx)(l,{children:(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 p-4`,children:[(0,A.jsxs)(r,{variant:`outline`,onClick:()=>void o.checkForUpdates(),disabled:f||_||v||T,children:[(0,A.jsx)(h,{className:a(`mr-2 h-4 w-4`,f&&`animate-spin`)}),y(`desktopUpdatesCheckNow`)]}),(0,A.jsxs)(r,{onClick:()=>void o.updateNow(),disabled:!D,children:[(0,A.jsx)(g,{className:a(`mr-2 h-4 w-4`,T&&`animate-spin`)}),y(`runtimeUpdatesApplyNow`)]})]})})})]})}export{Y as DesktopUpdateConfig};
1
+ import{Jt as e,Kt as t,Qn as n,Yt as r,Zt as i,_n as a,an as o,nn as s,on as c,qt as l,rn as u,tn as d,ur as f}from"./api-CXWxExzS.js";import{t as p}from"./navigation-link-O9Wm0epj.js";import{t as m}from"./download-C2gYe8n1.js";import{t as h}from"./refresh-cw-DOg2pWGu.js";import{t as g}from"./rotate-cw-CWFIat29.js";import{l as _,n as v,s as y}from"./i18n-ByVUrt9w.js";import{a as b,i as x,n as S,r as C,t as w}from"./select-BJ-EjmCz.js";import{a as T,i as E,n as D,r as O,t as k}from"./card-eFBmxYiI.js";var A=f(),j=`https://github.com/Peiiii/nextclaw/releases`,M={checking:`desktopUpdatesStatusChecking`,"update-available":`desktopUpdatesStatusAvailable`,downloading:`desktopUpdatesStatusDownloading`,downloaded:`desktopUpdatesStatusDownloaded`,applying:`desktopUpdatesStatusApplying`,"restart-required":`desktopUpdatesStatusRestartRequired`,"up-to-date":`desktopUpdatesStatusUpToDate`,blocked:`desktopUpdatesStatusBlocked`,failed:`desktopUpdatesStatusFailed`},N={feature:`desktopUpdatesReleaseNotesFeature`,enhancement:`desktopUpdatesReleaseNotesEnhancement`,fix:`desktopUpdatesReleaseNotesFix`,compatibility:`desktopUpdatesReleaseNotesCompatibility`};function P({snapshot:e}){return(0,A.jsx)(`span`,{className:a(`inline-flex rounded-full px-3 py-1 text-xs font-medium ring-1`,U(e.status)),children:H(e)})}function F({label:e,value:t}){return(0,A.jsxs)(`div`,{className:`rounded-lg bg-background/70 p-3`,children:[(0,A.jsx)(`p`,{className:`text-[11px] font-medium uppercase tracking-[0.08em] text-muted-foreground`,children:e}),(0,A.jsx)(`p`,{className:`mt-1 text-sm font-semibold text-foreground`,children:t})]})}function I({snapshot:e}){if(e.status!==`downloading`)return null;let t=e.progress?.percent,n=t==null?y(`desktopUpdatesDownloadProgressUnknown`):y(`desktopUpdatesDownloadProgressPercent`).replace(`{percent}`,String(t)),r=z(e.progress?.downloadedBytes??0,e.progress?.totalBytes??null);return(0,A.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 p-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,A.jsx)(`p`,{className:`text-sm font-semibold text-amber-800`,children:n}),(0,A.jsx)(`p`,{className:`text-xs font-medium text-amber-700`,children:r})]}),(0,A.jsx)(`div`,{className:`mt-3 h-2 overflow-hidden rounded-full bg-amber-100`,children:(0,A.jsx)(`div`,{className:`h-full rounded-full bg-amber-500 transition-[width]`,style:{width:`${t??0}%`}})})]})}function L(e){return e?.trim()||`-`}function R(e){return e?v(e):`-`}function z(e,t){let n=B(e);return t&&t>0?`${n} / ${B(t)}`:n}function B(e){if(!Number.isFinite(e)||e<=0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n>=10||r===0?n.toFixed(0):n.toFixed(1)} ${t[r]}`}function V(e){return y(e===`beta`?`desktopUpdatesChannelBeta`:`desktopUpdatesChannelStable`)}function H(e){return e.status===`failed`&&e.failureStage?y(`desktopUpdatesFailureStage.${e.failureStage}`):y(M[e.status]??`desktopUpdatesStatusIdle`)}function U(e){return e===`downloaded`||e===`restart-required`?`bg-emerald-50 text-emerald-700 ring-emerald-100`:e===`update-available`||e===`downloading`||e===`checking`?`bg-amber-50 text-amber-700 ring-amber-100`:e===`failed`||e===`blocked`?`bg-red-50 text-red-700 ring-red-100`:`bg-gray-100 text-gray-700 ring-gray-200`}function W(e){return e.status===`blocked`&&e.installationKind===`desktop-bundle`&&e.blockReason===`unsupported-installation`}function G(){return _()===`zh`?`zh-CN`:`en-US`}function K(e,t){return s(e.title,t)??y(N[e.kind]??`desktopUpdatesReleaseNotesEnhancement`)}function q({snapshot:e}){let t=u(e),r=G(),i=n({queryKey:[`runtime-release-notes`,t],queryFn:async()=>await d(t??``),enabled:!!t,retry:!1,staleTime:300*1e3}),a=i.data,o=s(a?.title,r)??y(`desktopUpdatesReleaseNotesPreviewTitle`),c=s(a?.summary,r)??y(`desktopUpdatesReleaseNotesPreviewDescription`);return e.releaseNotesUrl?(0,A.jsxs)(k,{children:[(0,A.jsx)(E,{children:(0,A.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,A.jsxs)(`div`,{className:`space-y-1`,children:[(0,A.jsx)(T,{children:o}),(0,A.jsx)(O,{children:c})]}),(0,A.jsx)(p,{href:e.releaseNotesUrl,external:!0,children:y(`desktopUpdatesReleaseNotes`)})]})}),(0,A.jsxs)(D,{className:`space-y-4`,children:[i.isLoading?(0,A.jsx)(`p`,{className:`text-sm text-gray-500`,children:y(`desktopUpdatesReleaseNotesPreviewLoading`)}):null,!t||i.isError?(0,A.jsx)(`p`,{className:`text-sm text-gray-500`,children:y(`desktopUpdatesReleaseNotesPreviewUnavailable`)}):null,a?(0,A.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:a.sections.map(e=>(0,A.jsxs)(`div`,{className:`rounded-xl border border-gray-200 bg-gray-50/60 p-4`,children:[(0,A.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:K(e,r)}),(0,A.jsx)(`ul`,{className:`mt-3 space-y-3`,children:e.items.map((t,n)=>{let i=s(t.title,r),a=s(t.body,r);return(0,A.jsxs)(`li`,{className:`space-y-1`,children:[i?(0,A.jsx)(`p`,{className:`text-sm font-medium text-gray-800`,children:i}):null,a?(0,A.jsx)(`p`,{className:`text-sm leading-5 text-gray-600`,children:a}):null]},`${i??e.kind}-${n}`)})})]},e.kind))}):null]})]}):null}function J(){return(0,A.jsx)(i,{title:y(`runtimeUpdatesPageTitle`),description:y(`runtimeUpdatesPageDescription`),children:(0,A.jsx)(e,{title:y(`runtimeUpdatesUnavailableTitle`),description:y(`runtimeUpdatesUnavailableDescription`),children:(0,A.jsx)(l,{children:(0,A.jsx)(`p`,{className:`p-4 text-sm text-muted-foreground`,children:y(`runtimeUpdatesUnavailableHint`)})})})})}function Y(){let{supported:n,initialized:s,busyAction:u,snapshot:d}=c();if(!s)return(0,A.jsx)(i,{title:y(`runtimeUpdatesPageTitle`),description:y(`runtimeUpdatesPageDescription`),children:(0,A.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:y(`loading`)})});if(!n||!d)return(0,A.jsx)(J,{});let f=u===`checking`,_=u===`downloading`,v=u===`applying`,T=u===`updating`,E=u===`switching-channel`,D=(d.status===`update-available`||d.status===`downloaded`)&&!_&&!v&&!T,O=[[y(`runtimeUpdatesHostVersion`),L(d.hostVersion)],[y(`desktopUpdatesCurrentBundleVersion`),L(d.currentVersion)],[y(`desktopUpdatesAvailableVersion`),L(d.availableVersion)],[y(`desktopUpdatesLastCheckedAt`),R(d.lastCheckedAt)],[y(`desktopUpdatesCurrentChannel`),V(d.channel)]];return(0,A.jsxs)(i,{title:y(`runtimeUpdatesPageTitle`),description:y(`runtimeUpdatesPageDescription`),actions:(0,A.jsxs)(r,{variant:`outline`,onClick:()=>void o.checkForUpdates(),disabled:f||_||v||T,children:[(0,A.jsx)(h,{className:a(`mr-2 h-4 w-4`,f&&`animate-spin`)}),y(`desktopUpdatesCheckNow`)]}),children:[(0,A.jsx)(e,{title:y(`desktopUpdatesOverviewTitle`),description:y(`desktopUpdatesOverviewDescription`),children:(0,A.jsx)(l,{children:(0,A.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,A.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:y(`desktopUpdatesStatusLabel`)}),(0,A.jsx)(P,{snapshot:d})]}),(0,A.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-5`,children:O.map(([e,t])=>(0,A.jsx)(F,{label:e,value:t},e))}),d.channel===`beta`?(0,A.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 p-4`,children:[(0,A.jsx)(`p`,{className:`text-sm font-semibold text-amber-800`,children:y(`desktopUpdatesBetaBadgeTitle`)}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-amber-700`,children:y(`desktopUpdatesBetaBadgeDescription`)})]}):null,d.downloadedVersion?(0,A.jsxs)(`div`,{className:`rounded-2xl border border-emerald-200 bg-emerald-50/70 p-4`,children:[(0,A.jsx)(`p`,{className:`text-sm font-semibold text-emerald-800`,children:y(`desktopUpdatesDownloadedBannerTitle`)}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-emerald-700`,children:y(`runtimeUpdatesDownloadedBannerDescription`).replace(`{version}`,d.downloadedVersion)})]}):null,(0,A.jsx)(I,{snapshot:d}),d.status===`blocked`?(0,A.jsxs)(`div`,{className:`rounded-2xl border border-red-200 bg-red-50/70 p-4`,children:[(0,A.jsx)(`p`,{className:`text-sm font-semibold text-red-800`,children:y(`desktopUpdatesBlockedTitle`)}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-red-700`,children:d.errorMessage??y(`desktopUpdatesBlockedDescription`)}),d.recoveryCommand?(0,A.jsx)(`code`,{className:`mt-3 block rounded-lg bg-white/70 px-3 py-2 text-xs text-red-800`,children:d.recoveryCommand}):null,W(d)?(0,A.jsx)(p,{href:j,external:!0,icon:m,className:`mt-3 rounded-full border border-red-300 bg-white/70 px-3 py-2 text-red-800 no-underline hover:bg-white hover:text-red-900 hover:no-underline`,children:y(`desktopUpdatesManualPortableDownload`)}):null]}):null,d.errorMessage&&d.status!==`blocked`?(0,A.jsx)(`div`,{className:`rounded-2xl border border-red-200 bg-red-50/70 p-4 text-sm text-red-700`,children:d.errorMessage}):null]})})}),(0,A.jsx)(q,{snapshot:d}),(0,A.jsx)(e,{title:y(`desktopUpdatesChannelSettingsTitle`),description:y(`desktopUpdatesChannelSettingsDescription`),children:(0,A.jsx)(l,{children:(0,A.jsx)(t,{title:y(`desktopUpdatesReleaseChannel`),description:y(`desktopUpdatesReleaseChannelHelp`),layout:`stacked`,children:(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsxs)(w,{value:d.channel,disabled:E||f||_||v||T,onValueChange:e=>void o.updateChannel(e),children:[(0,A.jsx)(x,{className:`w-full max-w-sm`,children:(0,A.jsx)(b,{placeholder:y(`desktopUpdatesReleaseChannel`)})}),(0,A.jsxs)(S,{children:[(0,A.jsx)(C,{value:`stable`,children:y(`desktopUpdatesChannelStable`)}),(0,A.jsx)(C,{value:`beta`,children:y(`desktopUpdatesChannelBeta`)})]})]}),(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:y(`desktopUpdatesReleaseChannelDowngradeHint`)})]})})})}),(0,A.jsx)(e,{title:y(`desktopUpdatesActionsTitle`),description:y(`runtimeUpdatesActionsDescription`),children:(0,A.jsx)(l,{children:(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 p-4`,children:[(0,A.jsxs)(r,{variant:`outline`,onClick:()=>void o.checkForUpdates(),disabled:f||_||v||T,children:[(0,A.jsx)(h,{className:a(`mr-2 h-4 w-4`,f&&`animate-spin`)}),y(`desktopUpdatesCheckNow`)]}),(0,A.jsxs)(r,{onClick:()=>void o.updateNow(),disabled:!D,children:[(0,A.jsx)(g,{className:a(`mr-2 h-4 w-4`,T&&`animate-spin`)}),y(`runtimeUpdatesApplyNow`)]})]})})})]})}export{Y as DesktopUpdateConfig};
@@ -1 +1 @@
1
- import{i as e}from"./chunk-DF37yw5_.js";import{_n as t,ur as n,xr as r}from"./api-BaML_txv.js";import{B as i,C as a,D as o,E as s,H as c,O as l,T as u,U as d,V as f,h as p,k as m,r as h,w as g,z as _}from"./context-menu-DVgLoPqH.js";import{t as v}from"./x-DLvS4xvV.js";import{s as y}from"./i18n-Bzo4IocH.js";var b=e(r(),1),x=n(),S=f,C=c,w=b.forwardRef(({onFocus:e,...t},n)=>(0,x.jsx)(d,{ref:n,onFocus:t=>{e?.(t),!t.defaultPrevented&&!t.currentTarget.matches(`:focus-visible`)&&t.preventDefault()},...t}));w.displayName=d.displayName;var T=b.forwardRef(({className:e,side:n=`top`,sideOffset:r=4,...a},o)=>(0,x.jsx)(i,{children:(0,x.jsx)(_,{ref:o,"data-theme-overlay":`tooltip`,sideOffset:r,side:n,className:t(`z-[var(--z-tooltip,10150)] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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`,e),...a})}));T.displayName=_.displayName;var E={sm:`h-6 w-6 rounded-md p-1`,md:`h-7 w-7 rounded-md p-1.5`,lg:`h-8 w-8 rounded-lg p-1.5`};function D({children:e,className:n,...r}){return(0,x.jsx)(`div`,{...r,className:t(`flex shrink-0 items-center gap-1 max-md:gap-0`,n),children:e})}var O=b.forwardRef(({className:e,disabled:n=!1,icon:r,label:i,size:a=`md`,tone:o=`default`,tooltip:s,tooltipSide:c,...l},u)=>{let d=(0,x.jsx)(`button`,{...l,ref:u,type:`button`,disabled:n,"aria-label":i,"data-tone":o,className:t(`relative inline-flex shrink-0 items-center justify-center transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border disabled:cursor-not-allowed`,E[a],`text-muted-foreground hover:text-accent-foreground disabled:text-muted-foreground/45 disabled:hover:text-muted-foreground/45`,p.icon,a===`sm`?`max-md:h-8 max-md:w-8`:`max-md:h-[var(--icon-control-size)] max-md:w-[var(--icon-control-size)]`,`before:pointer-events-none before:absolute before:inset-0 before:rounded-[inherit] before:transition-colors before:content-[''] max-md:before:inset-auto max-md:before:h-[var(--icon-feedback-size)] max-md:before:w-[var(--icon-feedback-size)]`,a===`sm`&&`max-md:before:h-7 max-md:before:w-7`,e),children:(0,x.jsx)(`span`,{className:`relative inline-flex items-center justify-center`,children:r})}),f=s===!1?null:s??i;return f?(0,x.jsx)(S,{delayDuration:250,children:(0,x.jsxs)(C,{disableHoverableContent:!0,children:[(0,x.jsx)(w,{asChild:!0,children:n?(0,x.jsx)(`span`,{className:`inline-flex`,children:d}):d}),(0,x.jsx)(T,{side:c,className:`text-xs`,children:f})]})}):d});O.displayName=`IconActionButton`;var k=l,A=o,j=b.forwardRef(({className:e,...n},r)=>(0,x.jsx)(s,{ref:r,"data-theme-overlay":`modal-backdrop`,className:t(`fixed inset-0 z-[var(--z-modal-backdrop,10000)] bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...n}));j.displayName=s.displayName;var M=b.forwardRef(({className:e,children:n,...r},i)=>(0,x.jsxs)(A,{children:[(0,x.jsx)(j,{}),(0,x.jsx)(g,{ref:i,"data-theme-overlay":`dialog`,className:t(`fixed left-[50%] top-[50%] z-[var(--z-modal,10050)] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 rounded-2xl border border-border bg-popover p-6 text-popover-foreground shadow-xl duration-base 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]`,`max-md:max-w-[calc(100vw-1.5rem)] max-h-[calc(100dvh-1.5rem)] max-md:max-h-[calc(100dvh-env(safe-area-inset-top,0px)-env(safe-area-inset-bottom,0px)-1.5rem)] overflow-y-auto overscroll-contain`,e),...r,onEscapeKeyDown:e=>{h(e)||r.onEscapeKeyDown?.(e)},children:n})]}));M.displayName=g.displayName;var N=({className:e,children:n,actions:r,showClose:i=!0,...o})=>(0,x.jsxs)(`div`,{"data-slot":`dialog-header`,className:t(`grid shrink-0 grid-cols-[minmax(0,1fr)_auto] items-start gap-3 text-left`,e),...o,children:[(0,x.jsx)(`div`,{className:`min-w-0 space-y-2 break-words`,children:n}),(0,x.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,"data-slot":`dialog-header-controls`,children:[r?(0,x.jsx)(`div`,{className:`flex items-center gap-1`,"data-slot":`dialog-header-actions`,children:r}):null,i?(0,x.jsx)(`div`,{className:t(`flex shrink-0`,r&&`pl-2`),children:(0,x.jsx)(a,{asChild:!0,children:(0,x.jsx)(O,{size:`sm`,label:y(`close`),icon:(0,x.jsx)(v,{className:`h-4 w-4`}),className:`max-md:h-11 max-md:w-11`})})}):null]})]});N.displayName=`DialogHeader`;var P=({className:e,...n})=>(0,x.jsx)(`div`,{className:t(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end sm:gap-3`,e),...n});P.displayName=`DialogFooter`;var F=b.forwardRef(({className:e,...n},r)=>(0,x.jsx)(m,{ref:r,className:t(`text-lg font-semibold leading-tight tracking-tight text-foreground`,e),...n}));F.displayName=m.displayName;var I=b.forwardRef(({className:e,...n},r)=>(0,x.jsx)(u,{ref:r,className:t(`text-sm text-muted-foreground leading-relaxed`,e),...n}));I.displayName=u.displayName;export{N as a,D as c,S as d,w as f,P as i,C as l,M as n,F as o,I as r,O as s,k as t,T as u};
1
+ import{i as e}from"./chunk-DF37yw5_.js";import{_n as t,ur as n,xr as r}from"./api-CXWxExzS.js";import{B as i,C as a,D as o,E as s,H as c,O as l,T as u,U as d,V as f,h as p,k as m,r as h,w as g,z as _}from"./context-menu-C0qywo73.js";import{t as v}from"./x-waP-WLuT.js";import{s as y}from"./i18n-ByVUrt9w.js";var b=e(r(),1),x=n(),S=f,C=c,w=b.forwardRef(({onFocus:e,...t},n)=>(0,x.jsx)(d,{ref:n,onFocus:t=>{e?.(t),!t.defaultPrevented&&!t.currentTarget.matches(`:focus-visible`)&&t.preventDefault()},...t}));w.displayName=d.displayName;var T=b.forwardRef(({className:e,side:n=`top`,sideOffset:r=4,...a},o)=>(0,x.jsx)(i,{children:(0,x.jsx)(_,{ref:o,"data-theme-overlay":`tooltip`,sideOffset:r,side:n,className:t(`z-[var(--z-tooltip,10150)] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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`,e),...a})}));T.displayName=_.displayName;var E={sm:`h-6 w-6 rounded-md p-1`,md:`h-7 w-7 rounded-md p-1.5`,lg:`h-8 w-8 rounded-lg p-1.5`};function D({children:e,className:n,...r}){return(0,x.jsx)(`div`,{...r,className:t(`flex shrink-0 items-center gap-1 max-md:gap-0`,n),children:e})}var O=b.forwardRef(({className:e,disabled:n=!1,icon:r,label:i,size:a=`md`,tone:o=`default`,tooltip:s,tooltipSide:c,...l},u)=>{let d=(0,x.jsx)(`button`,{...l,ref:u,type:`button`,disabled:n,"aria-label":i,"data-tone":o,className:t(`relative inline-flex shrink-0 items-center justify-center transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border disabled:cursor-not-allowed`,E[a],`text-muted-foreground hover:text-accent-foreground disabled:text-muted-foreground/45 disabled:hover:text-muted-foreground/45`,p.icon,a===`sm`?`max-md:h-8 max-md:w-8`:`max-md:h-[var(--icon-control-size)] max-md:w-[var(--icon-control-size)]`,`before:pointer-events-none before:absolute before:inset-0 before:rounded-[inherit] before:transition-colors before:content-[''] max-md:before:inset-auto max-md:before:h-[var(--icon-feedback-size)] max-md:before:w-[var(--icon-feedback-size)]`,a===`sm`&&`max-md:before:h-7 max-md:before:w-7`,e),children:(0,x.jsx)(`span`,{className:`relative inline-flex items-center justify-center`,children:r})}),f=s===!1?null:s??i;return f?(0,x.jsx)(S,{delayDuration:250,children:(0,x.jsxs)(C,{disableHoverableContent:!0,children:[(0,x.jsx)(w,{asChild:!0,children:n?(0,x.jsx)(`span`,{className:`inline-flex`,children:d}):d}),(0,x.jsx)(T,{side:c,className:`text-xs`,children:f})]})}):d});O.displayName=`IconActionButton`;var k=l,A=o,j=b.forwardRef(({className:e,...n},r)=>(0,x.jsx)(s,{ref:r,"data-theme-overlay":`modal-backdrop`,className:t(`fixed inset-0 z-[var(--z-modal-backdrop,10000)] bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...n}));j.displayName=s.displayName;var M=b.forwardRef(({className:e,children:n,...r},i)=>(0,x.jsxs)(A,{children:[(0,x.jsx)(j,{}),(0,x.jsx)(g,{ref:i,"data-theme-overlay":`dialog`,className:t(`fixed left-[50%] top-[50%] z-[var(--z-modal,10050)] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 rounded-2xl border border-border bg-popover p-6 text-popover-foreground shadow-xl duration-base 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]`,`max-md:max-w-[calc(100vw-1.5rem)] max-h-[calc(100dvh-1.5rem)] max-md:max-h-[calc(100dvh-env(safe-area-inset-top,0px)-env(safe-area-inset-bottom,0px)-1.5rem)] overflow-y-auto overscroll-contain`,e),...r,onEscapeKeyDown:e=>{h(e)||r.onEscapeKeyDown?.(e)},children:n})]}));M.displayName=g.displayName;var N=({className:e,children:n,actions:r,showClose:i=!0,...o})=>(0,x.jsxs)(`div`,{"data-slot":`dialog-header`,className:t(`grid shrink-0 grid-cols-[minmax(0,1fr)_auto] items-start gap-3 text-left`,e),...o,children:[(0,x.jsx)(`div`,{className:`min-w-0 space-y-2 break-words`,children:n}),(0,x.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,"data-slot":`dialog-header-controls`,children:[r?(0,x.jsx)(`div`,{className:`flex items-center gap-1`,"data-slot":`dialog-header-actions`,children:r}):null,i?(0,x.jsx)(`div`,{className:t(`flex shrink-0`,r&&`pl-2`),children:(0,x.jsx)(a,{asChild:!0,children:(0,x.jsx)(O,{size:`sm`,label:y(`close`),icon:(0,x.jsx)(v,{className:`h-4 w-4`}),className:`max-md:h-11 max-md:w-11`})})}):null]})]});N.displayName=`DialogHeader`;var P=({className:e,...n})=>(0,x.jsx)(`div`,{className:t(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end sm:gap-3`,e),...n});P.displayName=`DialogFooter`;var F=b.forwardRef(({className:e,...n},r)=>(0,x.jsx)(m,{ref:r,className:t(`text-lg font-semibold leading-tight tracking-tight text-foreground`,e),...n}));F.displayName=m.displayName;var I=b.forwardRef(({className:e,...n},r)=>(0,x.jsx)(u,{ref:r,className:t(`text-sm text-muted-foreground leading-relaxed`,e),...n}));I.displayName=u.displayName;export{N as a,D as c,S as d,w as f,P as i,C as l,M as n,F as o,I as r,O as s,k as t,T as u};
@@ -0,0 +1,41 @@
1
+ import{i as e}from"./chunk-DF37yw5_.js";import{br as t,ur as n,xr as r}from"./api-CXWxExzS.js";import{t as i}from"./createLucideIcon-C3LSyx-e.js";var a=i(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),o=i(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),s=i(`ChevronUp`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]);typeof window<`u`&&window.document&&window.document.createElement;function c(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var l=e(r(),1);function u(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function d(...e){return t=>{let n=!1,r=e.map(e=>{let r=u(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():u(e[t],null)}}}}function f(...e){return l.useCallback(d(...e),e)}var p=n();function m(e,t){let n=l.createContext(t),r=e=>{let{children:t,...r}=e,i=l.useMemo(()=>r,Object.values(r));return(0,p.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=l.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function h(e,t=[]){let n=[];function r(t,r){let i=l.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=l.useMemo(()=>o,Object.values(o));return(0,p.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=l.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>l.createContext(e));return function(n){let r=n?.[e]||t;return l.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,g(i,...t)]}function g(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function _(e){let t=v(e),n=l.forwardRef((e,n)=>{let{children:r,...i}=e,a=l.Children.toArray(r),o=a.find(x);if(o){let e=o.props.children,r=a.map(t=>t===o?l.Children.count(e)>1?l.Children.only(null):l.isValidElement(e)?e.props.children:null:t);return(0,p.jsx)(t,{...i,ref:n,children:l.isValidElement(e)?l.cloneElement(e,void 0,r):null})}return(0,p.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function v(e){let t=l.forwardRef((e,t)=>{let{children:n,...r}=e;if(l.isValidElement(n)){let e=C(n),i=S(r,n.props);return n.type!==l.Fragment&&(i.ref=t?d(t,e):e),l.cloneElement(n,i)}return l.Children.count(n)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var y=Symbol(`radix.slottable`);function b(e){let t=({children:e})=>(0,p.jsx)(p.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=y,t}function x(e){return l.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===y}function S(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function C(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var w=e(t(),1),T=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=_(`Primitive.${t}`),r=l.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,p.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function E(e,t){e&&w.flushSync(()=>e.dispatchEvent(t))}function D(e){let t=l.useRef(e);return l.useEffect(()=>{t.current=e}),l.useMemo(()=>(...e)=>t.current?.(...e),[])}function O(e,t=globalThis?.document){let n=D(e);l.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var k=`DismissableLayer`,A=`dismissableLayer.update`,j=`dismissableLayer.pointerDownOutside`,M=`dismissableLayer.focusOutside`,N,P=l.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ee=l.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...u}=e,d=l.useContext(P),[m,h]=l.useState(null),g=m?.ownerDocument??globalThis?.document,[,_]=l.useState({}),v=f(t,e=>h(e)),y=Array.from(d.layers),[b]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=y.indexOf(b),S=m?y.indexOf(m):-1,C=d.layersWithOutsidePointerEventsDisabled.size>0,w=S>=x,E=re(e=>{let t=e.target,n=[...d.branches].some(e=>e.contains(t));!w||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},g),D=F(e=>{let t=e.target;[...d.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},g);return O(e=>{S===d.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},g),l.useEffect(()=>{if(m)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(N=g.body.style.pointerEvents,g.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(m)),d.layers.add(m),I(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=N)}},[m,g,n,d]),l.useEffect(()=>()=>{m&&(d.layers.delete(m),d.layersWithOutsidePointerEventsDisabled.delete(m),I())},[m,d]),l.useEffect(()=>{let e=()=>_({});return document.addEventListener(A,e),()=>document.removeEventListener(A,e)},[]),(0,p.jsx)(T.div,{...u,ref:v,style:{pointerEvents:C?w?`auto`:`none`:void 0,...e.style},onFocusCapture:c(e.onFocusCapture,D.onFocusCapture),onBlurCapture:c(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:c(e.onPointerDownCapture,E.onPointerDownCapture)})});ee.displayName=k;var te=`DismissableLayerBranch`,ne=l.forwardRef((e,t)=>{let n=l.useContext(P),r=l.useRef(null),i=f(t,r);return l.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,p.jsx)(T.div,{...e,ref:i})});ne.displayName=te;function re(e,t=globalThis?.document){let n=D(e),r=l.useRef(!1),i=l.useRef(()=>{});return l.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){ie(j,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function F(e,t=globalThis?.document){let n=D(e),r=l.useRef(!1);return l.useEffect(()=>{let e=e=>{e.target&&!r.current&&ie(M,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function I(){let e=new CustomEvent(A);document.dispatchEvent(e)}function ie(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?E(i,a):i.dispatchEvent(a)}var L=globalThis?.document?l.useLayoutEffect:()=>{},ae=l.useId||(()=>void 0),oe=0;function se(e){let[t,n]=l.useState(ae());return L(()=>{e||n(e=>e??String(oe++))},[e]),e||(t?`radix-${t}`:``)}var ce=[`top`,`right`,`bottom`,`left`],R=Math.min,z=Math.max,le=Math.round,ue=Math.floor,B=e=>({x:e,y:e}),de={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function fe(e,t,n){return z(e,R(t,n))}function V(e,t){return typeof e==`function`?e(t):e}function H(e){return e.split(`-`)[0]}function pe(e){return e.split(`-`)[1]}function me(e){return e===`x`?`y`:`x`}function he(e){return e===`y`?`height`:`width`}function U(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ge(e){return me(U(e))}function _e(e,t,n){n===void 0&&(n=!1);let r=pe(e),i=ge(e),a=he(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Ee(o)),[o,Ee(o)]}function ve(e){let t=Ee(e);return[ye(e),t,ye(t)]}function ye(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var be=[`left`,`right`],xe=[`right`,`left`],Se=[`top`,`bottom`],Ce=[`bottom`,`top`];function we(e,t,n){switch(e){case`top`:case`bottom`:return n?t?xe:be:t?be:xe;case`left`:case`right`:return t?Se:Ce;default:return[]}}function Te(e,t,n,r){let i=pe(e),a=we(H(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(ye)))),a}function Ee(e){let t=H(e);return de[t]+e.slice(t.length)}function De(e){return{top:0,right:0,bottom:0,left:0,...e}}function Oe(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:De(e)}function ke(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Ae(e,t,n){let{reference:r,floating:i}=e,a=U(t),o=ge(t),s=he(o),c=H(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(pe(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function je(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=V(t,e),p=Oe(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ke(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=ke(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Me=50,Ne=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:je},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Ae(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Me&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Ae(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Pe=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=V(e,t)||{};if(l==null)return{};let d=Oe(u),f={x:n,y:r},p=ge(i),m=he(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=R(d[_],T),D=R(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=fe(O,A,k),M=!c.arrow&&pe(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),Fe=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=V(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=H(r),_=U(o),v=H(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Ee(o)]:ve(o)),x=p!==`none`;!d&&x&&b.push(...Te(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=_e(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==U(t))||T.every(e=>U(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=U(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Ie(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Le(e){return ce.some(t=>e[t]>=0)}var Re=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=V(e,t);switch(i){case`referenceHidden`:{let e=Ie(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Le(e)}}}case`escaped`:{let e=Ie(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Le(e)}}}default:return{}}}}},ze=new Set([`left`,`top`]);async function Be(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=H(n),s=pe(n),c=U(n)===`y`,l=ze.has(o)?-1:1,u=a&&c?-1:1,d=V(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Ve=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Be(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},He=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=V(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=U(H(i)),p=me(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=fe(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=fe(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Ue=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=V(e,t),u={x:n,y:r},d=U(i),f=me(d),p=u[f],m=u[d],h=V(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=ze.has(H(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},We=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=V(e,t),u=await o.detectOverflow(t,l),d=H(i),f=pe(i),p=U(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=R(h-u[g],v),x=R(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=z(u.left,0),t=z(u.right,0),n=z(u.top,0),r=z(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:z(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:z(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Ge(){return typeof window<`u`}function Ke(e){return qe(e)?(e.nodeName||``).toLowerCase():`#document`}function W(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function G(e){return((qe(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function qe(e){return Ge()?e instanceof Node||e instanceof W(e).Node:!1}function K(e){return Ge()?e instanceof Element||e instanceof W(e).Element:!1}function q(e){return Ge()?e instanceof HTMLElement||e instanceof W(e).HTMLElement:!1}function Je(e){return!Ge()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof W(e).ShadowRoot}function Ye(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=J(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Xe(e){return/^(table|td|th)$/.test(Ke(e))}function Ze(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Qe=/transform|translate|scale|rotate|perspective|filter/,$e=/paint|layout|strict|content/,et=e=>!!e&&e!==`none`,tt;function nt(e){let t=K(e)?J(e):e;return et(t.transform)||et(t.translate)||et(t.scale)||et(t.rotate)||et(t.perspective)||!it()&&(et(t.backdropFilter)||et(t.filter))||Qe.test(t.willChange||``)||$e.test(t.contain||``)}function rt(e){let t=Y(e);for(;q(t)&&!at(t);){if(nt(t))return t;if(Ze(t))return null;t=Y(t)}return null}function it(){return tt??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),tt}function at(e){return/^(html|body|#document)$/.test(Ke(e))}function J(e){return W(e).getComputedStyle(e)}function ot(e){return K(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Y(e){if(Ke(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Je(e)&&e.host||G(e);return Je(t)?t.host:t}function st(e){let t=Y(e);return at(t)?e.ownerDocument?e.ownerDocument.body:e.body:q(t)&&Ye(t)?t:st(t)}function ct(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=st(e),i=r===e.ownerDocument?.body,a=W(r);if(i){let e=lt(a);return t.concat(a,a.visualViewport||[],Ye(r)?r:[],e&&n?ct(e):[])}else return t.concat(r,ct(r,[],n))}function lt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ut(e){let t=J(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=q(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=le(n)!==a||le(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function dt(e){return K(e)?e:e.contextElement}function ft(e){let t=dt(e);if(!q(t))return B(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ut(t),o=(a?le(n.width):n.width)/r,s=(a?le(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var pt=B(0);function mt(e){let t=W(e);return!it()||!t.visualViewport?pt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ht(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==W(e)?!1:t}function gt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=dt(e),o=B(1);t&&(r?K(r)&&(o=ft(r)):o=ft(e));let s=ht(a,n,r)?mt(a):B(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=W(a),t=r&&K(r)?W(r):r,n=e,i=lt(n);for(;i&&r&&t!==n;){let e=ft(i),t=i.getBoundingClientRect(),r=J(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=W(i),i=lt(n)}}return ke({width:u,height:d,x:c,y:l})}function _t(e,t){let n=ot(e).scrollLeft;return t?t.left+n:gt(G(e)).left+n}function vt(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-_t(e,n),y:n.top+t.scrollTop}}function yt(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=G(r),s=t?Ze(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=B(1),u=B(0),d=q(r);if((d||!d&&!a)&&((Ke(r)!==`body`||Ye(o))&&(c=ot(r)),d)){let e=gt(r);l=ft(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?vt(o,c):B(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function bt(e){return Array.from(e.getClientRects())}function xt(e){let t=G(e),n=ot(e),r=e.ownerDocument.body,i=z(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=z(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+_t(e),s=-n.scrollTop;return J(r).direction===`rtl`&&(o+=z(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var St=25;function Ct(e,t){let n=W(e),r=G(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=it();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=_t(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=St&&(a-=o)}else l<=St&&(a+=l);return{width:a,height:o,x:s,y:c}}function wt(e,t){let n=gt(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=q(e)?ft(e):B(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Tt(e,t,n){let r;if(t===`viewport`)r=Ct(e,n);else if(t===`document`)r=xt(G(e));else if(K(t))r=wt(t,n);else{let n=mt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ke(r)}function Et(e,t){let n=Y(e);return n===t||!K(n)||at(n)?!1:J(n).position===`fixed`||Et(n,t)}function Dt(e,t){let n=t.get(e);if(n)return n;let r=ct(e,[],!1).filter(e=>K(e)&&Ke(e)!==`body`),i=null,a=J(e).position===`fixed`,o=a?Y(e):e;for(;K(o)&&!at(o);){let t=J(o),n=nt(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Ye(o)&&!n&&Et(e,o))?r=r.filter(e=>e!==o):i=t,o=Y(o)}return t.set(e,r),r}function Ot(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Ze(t)?[]:Dt(t,this._c):[].concat(n),r],o=Tt(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Tt(t,a[e],i);s=z(n.top,s),c=R(n.right,c),l=R(n.bottom,l),u=z(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function kt(e){let{width:t,height:n}=ut(e);return{width:t,height:n}}function At(e,t,n){let r=q(t),i=G(t),a=n===`fixed`,o=gt(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=B(0);function l(){c.x=_t(i)}if(r||!r&&!a)if((Ke(t)!==`body`||Ye(i))&&(s=ot(t)),r){let e=gt(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?vt(i,s):B(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function jt(e){return J(e).position===`static`}function Mt(e,t){if(!q(e)||J(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return G(e)===n&&(n=n.ownerDocument.body),n}function Nt(e,t){let n=W(e);if(Ze(e))return n;if(!q(e)){let t=Y(e);for(;t&&!at(t);){if(K(t)&&!jt(t))return t;t=Y(t)}return n}let r=Mt(e,t);for(;r&&Xe(r)&&jt(r);)r=Mt(r,t);return r&&at(r)&&jt(r)&&!nt(r)?n:r||rt(e)||n}var Pt=async function(e){let t=this.getOffsetParent||Nt,n=this.getDimensions,r=await n(e.floating);return{reference:At(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ft(e){return J(e).direction===`rtl`}var It={convertOffsetParentRelativeRectToViewportRelativeRect:yt,getDocumentElement:G,getClippingRect:Ot,getOffsetParent:Nt,getElementRects:Pt,getClientRects:bt,getDimensions:kt,getScale:ft,isElement:K,isRTL:Ft};function Lt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Rt(e,t){let n=null,r,i=G(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=ue(d),h=ue(i.clientWidth-(u+f)),g=ue(i.clientHeight-(d+p)),_=ue(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:z(0,R(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Lt(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function zt(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=dt(e),u=i||a?[...l?ct(l):[],...t?ct(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Rt(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?gt(e):null;c&&g();function g(){let t=gt(e);h&&!Lt(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Bt=Ve,Vt=He,Ht=Fe,Ut=We,Wt=Re,Gt=Pe,Kt=Ue,qt=(e,t,n)=>{let r=new Map,i={platform:It,...n},a={...i.platform,_c:r};return Ne(e,t,{...i,platform:a})},Jt=typeof document<`u`?l.useLayoutEffect:function(){};function Yt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Yt(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Yt(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Xt(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Zt(e,t){let n=Xt(e);return Math.round(t*n)/n}function Qt(e){let t=l.useRef(e);return Jt(()=>{t.current=e}),t}function $t(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:u}=e,[d,f]=l.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=l.useState(r);Yt(p,r)||m(r);let[h,g]=l.useState(null),[_,v]=l.useState(null),y=l.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=l.useCallback(e=>{e!==T.current&&(T.current=e,v(e))},[]),x=a||h,S=o||_,C=l.useRef(null),T=l.useRef(null),E=l.useRef(d),D=c!=null,O=Qt(c),k=Qt(i),A=Qt(u),j=l.useCallback(()=>{if(!C.current||!T.current)return;let e={placement:t,strategy:n,middleware:p};k.current&&(e.platform=k.current),qt(C.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!Yt(E.current,t)&&(E.current=t,w.flushSync(()=>{f(t)}))})},[p,t,n,k,A]);Jt(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);let M=l.useRef(!1);Jt(()=>(M.current=!0,()=>{M.current=!1}),[]),Jt(()=>{if(x&&(C.current=x),S&&(T.current=S),x&&S){if(O.current)return O.current(x,S,j);j()}},[x,S,j,O,D]);let N=l.useMemo(()=>({reference:C,floating:T,setReference:y,setFloating:b}),[y,b]),P=l.useMemo(()=>({reference:x,floating:S}),[x,S]),ee=l.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Zt(P.floating,d.x),r=Zt(P.floating,d.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Xt(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,d.x,d.y]);return l.useMemo(()=>({...d,update:j,refs:N,elements:P,floatingStyles:ee}),[d,j,N,P,ee])}var en=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Gt({element:r.current,padding:i}).fn(n):r?Gt({element:r,padding:i}).fn(n):{}}}},tn=(e,t)=>({...Bt(e),options:[e,t]}),nn=(e,t)=>({...Vt(e),options:[e,t]}),rn=(e,t)=>({...Kt(e),options:[e,t]}),an=(e,t)=>({...Ht(e),options:[e,t]}),on=(e,t)=>({...Ut(e),options:[e,t]}),sn=(e,t)=>({...Wt(e),options:[e,t]}),cn=(e,t)=>({...en(e),options:[e,t]}),ln=`Arrow`,un=l.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,p.jsx)(T.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,p.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});un.displayName=ln;var dn=un;function fn(e){let[t,n]=l.useState(void 0);return L(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var pn=`Popper`,[mn,hn]=h(pn),[gn,_n]=mn(pn),vn=e=>{let{__scopePopper:t,children:n}=e,[r,i]=l.useState(null);return(0,p.jsx)(gn,{scope:t,anchor:r,onAnchorChange:i,children:n})};vn.displayName=pn;var yn=`PopperAnchor`,bn=l.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=_n(yn,n),o=l.useRef(null),s=f(t,o),c=l.useRef(null);return l.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,p.jsx)(T.div,{...i,ref:s})});bn.displayName=yn;var xn=`PopperContent`,[Sn,Cn]=mn(xn),wn=l.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:m=`partial`,hideWhenDetached:h=!1,updatePositionStrategy:g=`optimized`,onPlaced:_,...v}=e,y=_n(xn,n),[b,x]=l.useState(null),S=f(t,e=>x(e)),[C,w]=l.useState(null),E=fn(C),O=E?.width??0,k=E?.height??0,A=r+(a===`center`?``:`-`+a),j=typeof d==`number`?d:{top:0,right:0,bottom:0,left:0,...d},M=Array.isArray(u)?u:[u],N=M.length>0,P={padding:j,boundary:M.filter(On),altBoundary:N},{refs:ee,floatingStyles:te,placement:ne,isPositioned:re,middlewareData:F}=$t({strategy:`fixed`,placement:A,whileElementsMounted:(...e)=>zt(...e,{animationFrame:g===`always`}),elements:{reference:y.anchor},middleware:[tn({mainAxis:i+k,alignmentAxis:o}),c&&nn({mainAxis:!0,crossAxis:!1,limiter:m===`partial`?rn():void 0,...P}),c&&an({...P}),on({...P,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),C&&cn({element:C,padding:s}),kn({arrowWidth:O,arrowHeight:k}),h&&sn({strategy:`referenceHidden`,...P})]}),[I,ie]=An(ne),ae=D(_);L(()=>{re&&ae?.()},[re,ae]);let oe=F.arrow?.x,se=F.arrow?.y,ce=F.arrow?.centerOffset!==0,[R,z]=l.useState();return L(()=>{b&&z(window.getComputedStyle(b).zIndex)},[b]),(0,p.jsx)(`div`,{ref:ee.setFloating,"data-radix-popper-content-wrapper":``,style:{...te,transform:re?te.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:R,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(` `),...F.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,p.jsx)(Sn,{scope:n,placedSide:I,onArrowChange:w,arrowX:oe,arrowY:se,shouldHideArrow:ce,children:(0,p.jsx)(T.div,{"data-side":I,"data-align":ie,...v,ref:S,style:{...v.style,animation:re?void 0:`none`}})})})});wn.displayName=xn;var Tn=`PopperArrow`,En={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Dn=l.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Cn(Tn,n),a=En[i.placedSide];return(0,p.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,p.jsx)(dn,{...r,ref:t,style:{...r.style,display:`block`}})})});Dn.displayName=Tn;function On(e){return e!==null}var kn=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=An(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function An(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var jn=vn,Mn=bn,Nn=wn,Pn=Dn,Fn=`Portal`,In=l.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=l.useState(!1);L(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?w.createPortal((0,p.jsx)(T.div,{...r,ref:t}),o):null});In.displayName=Fn;var Ln=l.useInsertionEffect||L;function Rn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=zn({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=l.useRef(e!==void 0);l.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,l.useCallback(t=>{if(s){let n=Bn(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function zn({defaultProp:e,onChange:t}){let[n,r]=l.useState(e),i=l.useRef(n),a=l.useRef(t);return Ln(()=>{a.current=t},[t]),l.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Bn(e){return typeof e==`function`}var Vn=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Hn=`VisuallyHidden`,Un=l.forwardRef((e,t)=>(0,p.jsx)(T.span,{...e,ref:t,style:{...Vn,...e.style}}));Un.displayName=Hn;var Wn=Un,Gn=`focusScope.autoFocusOnMount`,Kn=`focusScope.autoFocusOnUnmount`,qn={bubbles:!1,cancelable:!0},Jn=`FocusScope`,Yn=l.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=l.useState(null),u=D(i),d=D(a),m=l.useRef(null),h=f(t,e=>c(e)),g=l.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;l.useEffect(()=>{if(r){let e=function(e){if(g.paused||!s)return;let t=e.target;s.contains(t)?m.current=t:X(m.current,{select:!0})},t=function(e){if(g.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||X(m.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&X(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,g.paused]),l.useEffect(()=>{if(s){nr.add(g);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Gn,qn);s.addEventListener(Gn,u),s.dispatchEvent(t),t.defaultPrevented||(Xn(ar(Qn(s)),{select:!0}),document.activeElement===e&&X(s))}return()=>{s.removeEventListener(Gn,u),setTimeout(()=>{let t=new CustomEvent(Kn,qn);s.addEventListener(Kn,d),s.dispatchEvent(t),t.defaultPrevented||X(e??document.body,{select:!0}),s.removeEventListener(Kn,d),nr.remove(g)},0)}}},[s,u,d,g]);let _=l.useCallback(e=>{if(!n&&!r||g.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Zn(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&X(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&X(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,p.jsx)(T.div,{tabIndex:-1,...o,ref:h,onKeyDown:_})});Yn.displayName=Jn;function Xn(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(X(r,{select:t}),document.activeElement!==n)return}function Zn(e){let t=Qn(e);return[$n(t,e),$n(t.reverse(),e)]}function Qn(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function $n(e,t){for(let n of e)if(!er(n,{upTo:t}))return n}function er(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function tr(e){return e instanceof HTMLInputElement&&`select`in e}function X(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&tr(e)&&t&&e.select()}}var nr=rr();function rr(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=ir(e,t),e.unshift(t)},remove(t){e=ir(e,t),e[0]?.resume()}}}function ir(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ar(e){return e.filter(e=>e.tagName!==`A`)}var or=0;function sr(){l.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??cr()),document.body.insertAdjacentElement(`beforeend`,e[1]??cr()),or++,()=>{or===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),or--}},[])}function cr(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var Z=function(){return Z=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Z.apply(this,arguments)};function lr(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function ur(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var dr=`right-scroll-bar-position`,fr=`width-before-scroll-bar`,pr=`with-scroll-bars-hidden`,mr=`--removed-body-scroll-bar-size`;function hr(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function gr(e,t){var n=(0,l.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var _r=typeof window<`u`?l.useLayoutEffect:l.useEffect,vr=new WeakMap;function yr(e,t){var n=gr(t||null,function(t){return e.forEach(function(e){return hr(e,t)})});return _r(function(){var t=vr.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||hr(e,null)}),i.forEach(function(e){r.has(e)||hr(e,a)})}vr.set(n,e)},[e]),n}function br(e){return e}function xr(e,t){t===void 0&&(t=br);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Sr(e){e===void 0&&(e={});var t=xr(null);return t.options=Z({async:!0,ssr:!1},e),t}var Cr=function(e){var t=e.sideCar,n=lr(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return l.createElement(r,Z({},n))};Cr.isSideCarExport=!0;function wr(e,t){return e.useMedium(t),Cr}var Tr=Sr(),Er=function(){},Dr=l.forwardRef(function(e,t){var n=l.useRef(null),r=l.useState({onScrollCapture:Er,onWheelCapture:Er,onTouchMoveCapture:Er}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=lr(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=yr([n,t]),w=Z(Z({},x),i);return l.createElement(l.Fragment,null,d&&l.createElement(S,{sideCar:Tr,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?l.cloneElement(l.Children.only(s),Z(Z({},w),{ref:C})):l.createElement(y,Z({},w,{className:c,ref:C}),s))});Dr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Dr.classNames={fullWidth:fr,zeroRight:dr};var Or,kr=function(){if(Or)return Or;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Ar(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=kr();return t&&e.setAttribute(`nonce`,t),e}function jr(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Mr(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Nr=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ar())&&(jr(t,n),Mr(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Pr=function(){var e=Nr();return function(t,n){l.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Fr=function(){var e=Pr();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Ir={left:0,top:0,right:0,gap:0},Lr=function(e){return parseInt(e||``,10)||0},Rr=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Lr(n),Lr(r),Lr(i)]},zr=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Ir;var t=Rr(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Br=Fr(),Vr=`data-scroll-locked`,Hr=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
+ .${pr} {
3
+ overflow: hidden ${r};
4
+ padding-right: ${s}px ${r};
5
+ }
6
+ body[${Vr}] {
7
+ overflow: hidden ${r};
8
+ overscroll-behavior: contain;
9
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
10
+ padding-left: ${i}px;
11
+ padding-top: ${a}px;
12
+ padding-right: ${o}px;
13
+ margin-left:0;
14
+ margin-top:0;
15
+ margin-right: ${s}px ${r};
16
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
17
+ }
18
+
19
+ .${dr} {
20
+ right: ${s}px ${r};
21
+ }
22
+
23
+ .${fr} {
24
+ margin-right: ${s}px ${r};
25
+ }
26
+
27
+ .${dr} .${dr} {
28
+ right: 0 ${r};
29
+ }
30
+
31
+ .${fr} .${fr} {
32
+ margin-right: 0 ${r};
33
+ }
34
+
35
+ body[${Vr}] {
36
+ ${mr}: ${s}px;
37
+ }
38
+ `},Ur=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Wr=function(){l.useEffect(function(){return document.body.setAttribute(Vr,(Ur()+1).toString()),function(){var e=Ur()-1;e<=0?document.body.removeAttribute(Vr):document.body.setAttribute(Vr,e.toString())}},[])},Gr=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Wr();var a=l.useMemo(function(){return zr(i)},[i]);return l.createElement(Br,{styles:Hr(a,!t,i,n?``:`!important`)})},Kr=!1;if(typeof window<`u`)try{var qr=Object.defineProperty({},`passive`,{get:function(){return Kr=!0,!0}});window.addEventListener(`test`,qr,qr),window.removeEventListener(`test`,qr,qr)}catch{Kr=!1}var Jr=Kr?{passive:!1}:!1,Yr=function(e){return e.tagName===`TEXTAREA`},Xr=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Yr(e)&&n[t]===`visible`)},Zr=function(e){return Xr(e,`overflowY`)},Qr=function(e){return Xr(e,`overflowX`)},$r=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),ni(e,r)){var i=ri(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ei=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},ti=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},ni=function(e,t){return e===`v`?Zr(t):Qr(t)},ri=function(e,t){return e===`v`?ei(t):ti(t)},ii=function(e,t){return e===`h`&&t===`rtl`?-1:1},ai=function(e,t,n,r,i){var a=ii(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=ri(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&ni(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},oi=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},si=function(e){return[e.deltaX,e.deltaY]},ci=function(e){return e&&`current`in e?e.current:e},li=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ui=function(e){return`
39
+ .block-interactivity-${e} {pointer-events: none;}
40
+ .allow-interactivity-${e} {pointer-events: all;}
41
+ `},di=0,fi=[];function pi(e){var t=l.useRef([]),n=l.useRef([0,0]),r=l.useRef(),i=l.useState(di++)[0],a=l.useState(Fr)[0],o=l.useRef(e);l.useEffect(function(){o.current=e},[e]),l.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=ur([e.lockRef.current],(e.shards||[]).map(ci),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=l.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=oi(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=$r(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=$r(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return ai(h,t,e,h===`h`?s:c,!0)},[]),c=l.useCallback(function(e){var n=e;if(!(!fi.length||fi[fi.length-1]!==a)){var r=`deltaY`in n?si(n):oi(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&li(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(ci).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=l.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:mi(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=l.useCallback(function(e){n.current=oi(e),r.current=void 0},[]),f=l.useCallback(function(t){u(t.type,si(t),t.target,s(t,e.lockRef.current))},[]),p=l.useCallback(function(t){u(t.type,oi(t),t.target,s(t,e.lockRef.current))},[]);l.useEffect(function(){return fi.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,c,Jr),document.addEventListener(`touchmove`,c,Jr),document.addEventListener(`touchstart`,d,Jr),function(){fi=fi.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Jr),document.removeEventListener(`touchmove`,c,Jr),document.removeEventListener(`touchstart`,d,Jr)}},[]);var m=e.removeScrollBar,h=e.inert;return l.createElement(l.Fragment,null,h?l.createElement(a,{styles:ui(i)}):null,m?l.createElement(Gr,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function mi(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var hi=wr(Tr,pi),gi=l.forwardRef(function(e,t){return l.createElement(Dr,Z({},e,{ref:t,sideCar:hi}))});gi.classNames=Dr.classNames;var _i=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},vi=new WeakMap,yi=new WeakMap,bi={},xi=0,Si=function(e){return e&&(e.host||Si(e.parentNode))},Ci=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Si(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},wi=function(e,t,n,r){var i=Ci(t,Array.isArray(e)?e:[e]);bi[n]||(bi[n]=new WeakMap);var a=bi[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(vi.get(e)||0)+1,l=(a.get(e)||0)+1;vi.set(e,c),a.set(e,l),o.push(e),c===1&&i&&yi.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),xi++,function(){o.forEach(function(e){var t=vi.get(e)-1,i=a.get(e)-1;vi.set(e,t),a.set(e,i),t||(yi.has(e)||e.removeAttribute(r),yi.delete(e)),i||e.removeAttribute(n)}),xi--,xi||(vi=new WeakMap,vi=new WeakMap,yi=new WeakMap,bi={})}},Ti=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||_i(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),wi(r,i,n,`aria-hidden`)):function(){return null}};function Ei(e,[t,n]){return Math.min(n,Math.max(t,e))}function Di(e){let t=e+`CollectionProvider`,[n,r]=h(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=l.useRef(null),a=l.useRef(new Map).current;return(0,p.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=_(s),u=l.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,p.jsx)(c,{ref:f(t,a(s,n).collectionRef),children:r})});u.displayName=s;let d=e+`CollectionItemSlot`,m=`data-radix-collection-item`,g=_(d),v=l.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=l.useRef(null),s=f(t,o),c=a(d,n);return l.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,p.jsx)(g,{[m]:``,ref:s,children:r})});v.displayName=d;function y(t){let n=a(e+`CollectionConsumer`,t);return l.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${m}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:u,ItemSlot:v},y,r]}var Oi=l.createContext(void 0);function ki(e){let t=l.useContext(Oi);return e||t||`ltr`}function Ai(e){let t=l.useRef({value:e,previous:e});return l.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var ji=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Mi=[` `,`Enter`],Ni=`Select`,[Pi,Fi,Ii]=Di(Ni),[Li,Ri]=h(Ni,[Ii,hn]),zi=hn(),[Bi,Q]=Li(Ni),[Vi,Hi]=Li(Ni),Ui=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:m,required:h,form:g}=e,_=zi(t),[v,y]=l.useState(null),[b,x]=l.useState(null),[S,C]=l.useState(!1),w=ki(u),[T,E]=Rn({prop:r,defaultProp:i??!1,onChange:a,caller:Ni}),[D,O]=Rn({prop:o,defaultProp:s,onChange:c,caller:Ni}),k=l.useRef(null),A=v?g||!!v.closest(`form`):!0,[j,M]=l.useState(new Set),N=Array.from(j).map(e=>e.props.value).join(`;`);return(0,p.jsx)(jn,{..._,children:(0,p.jsxs)(Bi,{required:h,scope:t,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:se(),value:D,onValueChange:O,open:T,onOpenChange:E,dir:w,triggerPointerDownPosRef:k,disabled:m,children:[(0,p.jsx)(Pi.Provider,{scope:t,children:(0,p.jsx)(Vi,{scope:e.__scopeSelect,onNativeOptionAdd:l.useCallback(e=>{M(t=>new Set(t).add(e))},[]),onNativeOptionRemove:l.useCallback(e=>{M(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),A?(0,p.jsxs)(La,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:f,value:D,onChange:e=>O(e.target.value),disabled:m,form:g,children:[D===void 0?(0,p.jsx)(`option`,{value:``}):null,Array.from(j)]},N):null]})})};Ui.displayName=Ni;var Wi=`SelectTrigger`,Gi=l.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=zi(n),o=Q(Wi,n),s=o.disabled||r,u=f(t,o.onTriggerChange),d=Fi(n),m=l.useRef(`touch`),[h,g,_]=za(e=>{let t=d().filter(e=>!e.disabled),n=Ba(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),v=e=>{s||(o.onOpenChange(!0),_()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,p.jsx)(Mn,{asChild:!0,...a,children:(0,p.jsx)(T.button,{type:`button`,role:`combobox`,"aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":Ra(o.value)?``:void 0,...i,ref:u,onClick:c(i.onClick,e=>{e.currentTarget.focus(),m.current!==`mouse`&&v(e)}),onPointerDown:c(i.onPointerDown,e=>{m.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(v(e),e.preventDefault())}),onKeyDown:c(i.onKeyDown,e=>{let t=h.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&g(e.key),!(t&&e.key===` `)&&ji.includes(e.key)&&(v(),e.preventDefault())})})})});Gi.displayName=Wi;var Ki=`SelectValue`,qi=l.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=Q(Ki,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=f(t,c.onValueNodeChange);return L(()=>{l(u)},[l,u]),(0,p.jsx)(T.span,{...s,ref:d,style:{pointerEvents:`none`},children:Ra(c.value)?(0,p.jsx)(p.Fragment,{children:o}):a})});qi.displayName=Ki;var Ji=`SelectIcon`,Yi=l.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,p.jsx)(T.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});Yi.displayName=Ji;var Xi=`SelectPortal`,Zi=e=>(0,p.jsx)(In,{asChild:!0,...e});Zi.displayName=Xi;var Qi=`SelectContent`,$i=l.forwardRef((e,t)=>{let n=Q(Qi,e.__scopeSelect),[r,i]=l.useState();if(L(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?w.createPortal((0,p.jsx)(ea,{scope:e.__scopeSelect,children:(0,p.jsx)(Pi.Slot,{scope:e.__scopeSelect,children:(0,p.jsx)(`div`,{children:e.children})})}),t):null}return(0,p.jsx)(ia,{...e,ref:t})});$i.displayName=Qi;var $=10,[ea,ta]=Li(Qi),na=`SelectContentImpl`,ra=_(`SelectContent.RemoveScroll`),ia=l.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:u,align:d,alignOffset:m,arrowPadding:h,collisionBoundary:g,collisionPadding:_,sticky:v,hideWhenDetached:y,avoidCollisions:b,...x}=e,S=Q(Qi,n),[C,w]=l.useState(null),[T,E]=l.useState(null),D=f(t,e=>w(e)),[O,k]=l.useState(null),[A,j]=l.useState(null),M=Fi(n),[N,P]=l.useState(!1),te=l.useRef(!1);l.useEffect(()=>{if(C)return Ti(C)},[C]),sr();let ne=l.useCallback(e=>{let[t,...n]=M().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&T&&(T.scrollTop=0),n===r&&T&&(T.scrollTop=T.scrollHeight),n?.focus(),document.activeElement!==i))return},[M,T]),re=l.useCallback(()=>ne([O,C]),[ne,O,C]);l.useEffect(()=>{N&&re()},[N,re]);let{onOpenChange:F,triggerPointerDownPosRef:I}=S;l.useEffect(()=>{if(C){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(I.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(I.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():C.contains(n.target)||F(!1),document.removeEventListener(`pointermove`,t),I.current=null};return I.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[C,F,I]),l.useEffect(()=>{let e=()=>F(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[F]);let[ie,L]=za(e=>{let t=M().filter(e=>!e.disabled),n=Ba(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ae=l.useCallback((e,t,n)=>{let r=!te.current&&!n;(S.value!==void 0&&S.value===t||r)&&(k(e),r&&(te.current=!0))},[S.value]),oe=l.useCallback(()=>C?.focus(),[C]),se=l.useCallback((e,t,n)=>{let r=!te.current&&!n;(S.value!==void 0&&S.value===t||r)&&j(e)},[S.value]),ce=r===`popper`?ca:oa,R=ce===ca?{side:s,sideOffset:u,align:d,alignOffset:m,arrowPadding:h,collisionBoundary:g,collisionPadding:_,sticky:v,hideWhenDetached:y,avoidCollisions:b}:{};return(0,p.jsx)(ea,{scope:n,content:C,viewport:T,onViewportChange:E,itemRefCallback:ae,selectedItem:O,onItemLeave:oe,itemTextRefCallback:se,focusSelectedItem:re,selectedItemText:A,position:r,isPositioned:N,searchRef:ie,children:(0,p.jsx)(gi,{as:ra,allowPinchZoom:!0,children:(0,p.jsx)(Yn,{asChild:!0,trapped:S.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:c(i,e=>{S.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,p.jsx)(ee,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>S.onOpenChange(!1),children:(0,p.jsx)(ce,{role:`listbox`,id:S.contentId,"data-state":S.open?`open`:`closed`,dir:S.dir,onContextMenu:e=>e.preventDefault(),...x,...R,onPlaced:()=>P(!0),ref:D,style:{display:`flex`,flexDirection:`column`,outline:`none`,...x.style},onKeyDown:c(x.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&L(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=M().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>ne(t)),e.preventDefault()}})})})})})})});ia.displayName=na;var aa=`SelectItemAlignedPosition`,oa=l.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=Q(Qi,n),o=ta(Qi,n),[s,c]=l.useState(null),[u,d]=l.useState(null),m=f(t,e=>d(e)),h=Fi(n),g=l.useRef(!1),_=l.useRef(!0),{viewport:v,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=o,S=l.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&u&&v&&y&&b){let e=a.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=b.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-$,d=Ei(a,[$,Math.max($,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-$,d=Ei(a,[$,Math.max($,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=h(),c=window.innerHeight-$*2,l=v.scrollHeight,d=window.getComputedStyle(u),f=parseInt(d.borderTopWidth,10),p=parseInt(d.paddingTop,10),m=parseInt(d.borderBottomWidth,10),_=parseInt(d.paddingBottom,10),x=f+p+l+_+m,S=Math.min(y.offsetHeight*5,x),C=window.getComputedStyle(v),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-$,D=c-E,O=y.offsetHeight/2,k=y.offsetTop+O,A=f+p+k,j=x-A;if(A<=E){let e=o.length>0&&y===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=u.clientHeight-v.offsetTop-v.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+m);s.style.height=n+`px`}else{let e=o.length>0&&y===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,f+v.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,v.scrollTop=A-E+v.offsetTop}s.style.margin=`${$}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>g.current=!0)}},[h,a.trigger,a.valueNode,s,u,v,y,b,a.dir,r]);L(()=>S(),[S]);let[C,w]=l.useState();return L(()=>{u&&w(window.getComputedStyle(u).zIndex)},[u]),(0,p.jsx)(la,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:g,onScrollButtonChange:l.useCallback(e=>{e&&_.current===!0&&(S(),x?.(),_.current=!1)},[S,x]),children:(0,p.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:C},children:(0,p.jsx)(T.div,{...i,ref:m,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});oa.displayName=aa;var sa=`SelectPopperPosition`,ca=l.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=$,...a}=e,o=zi(n);return(0,p.jsx)(Nn,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});ca.displayName=sa;var[la,ua]=Li(Qi,{}),da=`SelectViewport`,fa=l.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=ta(da,n),o=ua(da,n),s=f(t,a.onViewportChange),u=l.useRef(0);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,p.jsx)(Pi.Slot,{scope:n,children:(0,p.jsx)(T.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:c(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(u.current-t.scrollTop);if(e>0){let r=window.innerHeight-$*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}u.current=t.scrollTop})})})]})});fa.displayName=da;var pa=`SelectGroup`,[ma,ha]=Li(pa),ga=l.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=se();return(0,p.jsx)(ma,{scope:n,id:i,children:(0,p.jsx)(T.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});ga.displayName=pa;var _a=`SelectLabel`,va=l.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=ha(_a,n);return(0,p.jsx)(T.div,{id:i.id,...r,ref:t})});va.displayName=_a;var ya=`SelectItem`,[ba,xa]=Li(ya),Sa=l.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=Q(ya,n),u=ta(ya,n),d=s.value===r,[m,h]=l.useState(a??``),[g,_]=l.useState(!1),v=f(t,e=>u.itemRefCallback?.(e,r,i)),y=se(),b=l.useRef(`touch`),x=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,p.jsx)(ba,{scope:n,value:r,disabled:i,textId:y,isSelected:d,onItemTextChange:l.useCallback(e=>{h(t=>t||(e?.textContent??``).trim())},[]),children:(0,p.jsx)(Pi.ItemSlot,{scope:n,value:r,disabled:i,textValue:m,children:(0,p.jsx)(T.div,{role:`option`,"aria-labelledby":y,"data-highlighted":g?``:void 0,"aria-selected":d&&g,"data-state":d?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:v,onFocus:c(o.onFocus,()=>_(!0)),onBlur:c(o.onBlur,()=>_(!1)),onClick:c(o.onClick,()=>{b.current!==`mouse`&&x()}),onPointerUp:c(o.onPointerUp,()=>{b.current===`mouse`&&x()}),onPointerDown:c(o.onPointerDown,e=>{b.current=e.pointerType}),onPointerMove:c(o.onPointerMove,e=>{b.current=e.pointerType,i?u.onItemLeave?.():b.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:c(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:c(o.onKeyDown,e=>{u.searchRef?.current!==``&&e.key===` `||(Mi.includes(e.key)&&x(),e.key===` `&&e.preventDefault())})})})})});Sa.displayName=ya;var Ca=`SelectItemText`,wa=l.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=Q(Ca,n),s=ta(Ca,n),c=xa(Ca,n),u=Hi(Ca,n),[d,m]=l.useState(null),h=f(t,e=>m(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),g=d?.textContent,_=l.useMemo(()=>(0,p.jsx)(`option`,{value:c.value,disabled:c.disabled,children:g},c.value),[c.disabled,c.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=u;return L(()=>(v(_),()=>y(_)),[v,y,_]),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(T.span,{id:c.textId,...a,ref:h}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?w.createPortal(a.children,o.valueNode):null]})});wa.displayName=Ca;var Ta=`SelectItemIndicator`,Ea=l.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return xa(Ta,n).isSelected?(0,p.jsx)(T.span,{"aria-hidden":!0,...r,ref:t}):null});Ea.displayName=Ta;var Da=`SelectScrollUpButton`,Oa=l.forwardRef((e,t)=>{let n=ta(Da,e.__scopeSelect),r=ua(Da,e.__scopeSelect),[i,a]=l.useState(!1),o=f(t,r.onScrollButtonChange);return L(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,p.jsx)(ja,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Oa.displayName=Da;var ka=`SelectScrollDownButton`,Aa=l.forwardRef((e,t)=>{let n=ta(ka,e.__scopeSelect),r=ua(ka,e.__scopeSelect),[i,a]=l.useState(!1),o=f(t,r.onScrollButtonChange);return L(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,p.jsx)(ja,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});Aa.displayName=ka;var ja=l.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=ta(`SelectScrollButton`,n),o=l.useRef(null),s=Fi(n),u=l.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return l.useEffect(()=>()=>u(),[u]),L(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,p.jsx)(T.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:c(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:c(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:c(i.onPointerLeave,()=>{u()})})}),Ma=`SelectSeparator`,Na=l.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,p.jsx)(T.div,{"aria-hidden":!0,...r,ref:t})});Na.displayName=Ma;var Pa=`SelectArrow`,Fa=l.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=zi(n),a=Q(Pa,n),o=ta(Pa,n);return a.open&&o.position===`popper`?(0,p.jsx)(Pn,{...i,...r,ref:t}):null});Fa.displayName=Pa;var Ia=`SelectBubbleInput`,La=l.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=l.useRef(null),a=f(r,i),o=Ai(t);return l.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,p.jsx)(T.select,{...n,style:{...Vn,...n.style},ref:a,defaultValue:t})});La.displayName=Ia;function Ra(e){return e===``||e===void 0}function za(e){let t=D(e),n=l.useRef(``),r=l.useRef(0),i=l.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=l.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return l.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function Ba(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Va(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Va(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Ha=Ui,Ua=Gi,Wa=qi,Ga=Yi,Ka=Zi,qa=$i,Ja=fa,Ya=ga,Xa=va,Za=Sa,Qa=wa,$a=Ea,eo=Oa,to=Aa,no=Na;export{ee as A,a as B,Mn as C,hn as D,jn as E,h as F,f as I,c as L,_ as M,b as N,se as O,m as P,s as R,In as S,Nn as T,gi as _,$a as a,Wn as b,Ka as c,eo as d,no as f,Ti as g,Ja as h,Za as i,T as j,L as k,Ha as l,Wa as m,Ya as n,Qa as o,Ua as p,Ga as r,Xa as s,qa as t,to as u,sr as v,Pn as w,Rn as x,Yn as y,o as z};
@@ -0,0 +1 @@
1
+ import{St as e}from"./app-presenter-provider-DdD2Q7jZ.js";export{e as DocBrowser};
@@ -1 +1 @@
1
- import{i as e}from"./chunk-DF37yw5_.js";import{An as t,Pn as n,_n as r,fn as i,jn as a,ur as o,xr as s}from"./api-BaML_txv.js";import{l as c,s as l}from"./i18n-Bzo4IocH.js";import{n as u,t as d}from"./middleware-B--6mAUM.js";import{o as f,t as p}from"./navigation-history-CCnxsAKR.js";var m=`global-resources`,h=`floating-conversation`,g={placement:`docked`,minimized:!1,maximized:!1,rect:{x:80,y:80,w:560,h:640},layer:0};function _(e){if(!e||typeof e!=`object`||!(`surfaces`in e)||!e.surfaces||typeof e.surfaces!=`object`)return{};let t={};for(let[n,r]of Object.entries(e.surfaces).slice(-64)){if(!r||typeof r!=`object`)continue;let{placement:e,rect:i}=r;e!==`docked`&&e!==`floating`||!i||![`x`,`y`,`w`,`h`].every(e=>typeof i[e]==`number`&&Number.isFinite(i[e]))||(t[n]={...g,placement:e,rect:i})}return t}function v(){try{if(JSON.parse(window.localStorage.getItem(`nextclaw.doc-browser.state`)??`null`)?.state?.snapshot?.mode===`floating`)return{[m]:{...g,placement:`floating`}}}catch{}return{}}var y=i()(u(()=>({surfaces:v(),visibleSurfaceIds:[]}),{name:`nextclaw.workbench.layout`,version:1,storage:d(()=>new p),partialize:({surfaces:e})=>({surfaces:Object.fromEntries(Object.entries(e).slice(-64).map(([e,t])=>[e,{...t,minimized:!1,maximized:!1,layer:0}]))}),merge:(e,t)=>({...t,surfaces:{...t.surfaces,..._(e)}})})),b=o();function x({className:e,...t}){return(0,b.jsx)(`div`,{"aria-hidden":`true`,className:r(`motion-safe:animate-pulse rounded-md bg-foreground/[0.06]`,e),...t})}function ee({className:e,...t}){return(0,b.jsxs)(`div`,{className:r(`flex items-start gap-3 py-5`,e),"aria-hidden":`true`,...t,children:[(0,b.jsx)(x,{className:`h-10 w-10 shrink-0 rounded-xl`}),(0,b.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-3 pt-1`,children:[(0,b.jsx)(x,{className:`h-3.5 w-28 max-w-[55%]`}),(0,b.jsx)(x,{className:`h-2.5 w-3/4 max-w-72`}),(0,b.jsx)(x,{className:`h-2.5 w-1/2 max-w-48`})]})]})}var S=`docs.nextclaw.io`,C=`docs.nextclaw.net`,w=`nextclaw-docs.pages.dev`,T=new Set([S,`www.${S}`,C,`www.${C}`,w,`www.${w}`]),E=`https://${S}`,D=`https://${C}`,O=`home`,k=`nextclaw://new-tab`,A=`/guide/getting-started`;function j(e){return e===`zh`?`zh`:`en`}function M(e,t){let n=e.startsWith(`/`)?e:`/${e}`;return n===`/`||n===``?`/${t}/`:/^\/(en|zh)(\/|$)/.test(n)?n:`/${t}${n}`}function N(e){let t=e?.trim();if(t)try{return new URL(t).origin}catch{return}}function te(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone??``}catch{return``}}function ne(e){return/^[a-z][a-z\d+.-]*:/i.test(e.trim())}function re(){return c()===`zh`||te()===`Asia/Shanghai`}function ie(){return N(void 0)||(re()?N(void 0)??D:E)}function P(e){let t=j(c()),n=ie();try{let r=new URL(e,n),i=new URL(n);return!ne(e)||T.has(r.hostname)||r.origin===i.origin?(r.protocol=i.protocol,r.host=i.host,r.pathname=M(r.pathname,t),r.toString()):r.toString()}catch{return new URL(`/${t}${A}`,n).toString()}}function ae(){return P(A)}function oe(e){return P(e)}function F(e){try{let t=new URL(e);return`${t.pathname.replace(/\.html$/,``).replace(/\/$/,``)}${t.search}${t.hash}`}catch{return e}}function I(e,t,n=`Docs`){try{let r=new URL(e,E);if(r.protocol===`data:`)return t===`docs`?n:`Detail`;let i=r.pathname.split(`/`).filter(Boolean),a=i[i.length-1]??n;return decodeURIComponent(a).replace(/[-_]/g,` `).slice(0,40)||n}catch{return n}}function L(e){try{let t=typeof window<`u`?window.location.origin:E,n=new URL(e,t);return T.has(n.hostname)}catch{return!1}}function R(e,t){return t===`docs`?P(e):e}var z=0;function B(e){return typeof e==`number`&&Number.isFinite(e)?Math.min(860,Math.max(320,e)):420}function V(){return z+=1,`doc-tab-${Date.now()}-${z}`}function H(e,t,n,r,i,a,o,s){let c=n?.trim()||I(e,t,t===`docs`?l(`docBrowserHelp`):`Detail`),u=i?.trim();return{id:V(),kind:t,title:c,currentUrl:e,resourceUri:u||void 0,contentParams:o,viewState:s,dockIcon:a,dedupeKey:r,history:[e],historyIndex:0,navVersion:0}}function U(e,t){let n=f({entries:e.history,index:e.historyIndex},t);return{history:[...n.entries],historyIndex:n.index}}function W(e,t,r,i,a){let o={...t,title:i?.title||r.title||t.title,kind:r.kind,resourceUri:r.resourceUri??r.url,dockIcon:i?.dockIcon??r.dockIcon,dedupeKey:a,contentParams:r.contentParams,viewState:i?.viewState??r.viewState??t.viewState},s=e.areUrlsEquivalent(t.currentUrl,r.url,t.kind,r.kind);return s&&n(t.contentParams)===n(r.contentParams)?o:s?{...o,navVersion:t.navVersion+1}:{...o,currentUrl:r.url,...U(t,r.url),navVersion:t.navVersion+1}}function G(e){return{kind:e.kind,resourceUri:e.resourceUri,tabId:e.id,url:e.currentUrl}}function K(){let e=H(k,O,l(`docBrowserHomeTitle`));return{isOpen:!1,dockedWidth:420,tabs:[e],activeTabId:e.id,activeHistory:[G(e)],activeHistoryIndex:0}}var se=`nextclaw.doc-browser.state`,ce=1,q=8;function J(e){return!!e&&typeof e==`object`}function le(e,t){if(!Array.isArray(e))return[t];let n=e.filter(e=>typeof e==`string`&&e.trim().length>0);return n.length>0?n:[t]}function Y(e,t,n,r){return typeof e==`number`&&Number.isFinite(e)?Math.min(n,Math.max(t,e)):r}function ue(e){if(!(!J(e)||typeof e.type!=`string`)){if(e.type===`builtin`&&typeof e.name==`string`&&e.name.trim().length>0)return{type:`builtin`,name:e.name.trim()};if(e.type===`url`&&typeof e.url==`string`&&e.url.trim().length>0)return{type:`url`,url:e.url.trim()};if(e.type===`text`&&typeof e.value==`string`&&e.value.trim().length>0)return{type:`text`,value:e.value.trim()}}}function de(e){if(!J(e)||typeof e.id!=`string`||typeof e.kind!=`string`||typeof e.title!=`string`||typeof e.currentUrl!=`string`||e.currentUrl.trim().length===0)return null;let n=le(e.history,e.currentUrl),r=Y(e.historyIndex,0,n.length-1,n.length-1),i=Y(e.navVersion,0,2**53-1,0),o=typeof e.dedupeKey==`string`&&e.dedupeKey.trim().length>0?e.dedupeKey:void 0,s=typeof e.resourceUri==`string`&&e.resourceUri.trim().length>0?e.resourceUri.trim():void 0,c=ue(e.dockIcon),l=n[r]??e.currentUrl,u=a(s??l),d=u?t(u):void 0;return{id:e.id,kind:d?`chat-session`:e.kind,title:e.title,currentUrl:d??l,resourceUri:d??s,dockIcon:c,viewState:e.viewState,dedupeKey:d??o,history:n,historyIndex:r,navVersion:i}}function fe(e){return{kind:e.kind,resourceUri:e.resourceUri,tabId:e.id,url:e.currentUrl}}function X(e,n){if(!J(e)||typeof e.tabId!=`string`||typeof e.kind!=`string`||typeof e.url!=`string`||e.url.trim().length===0||!n.has(e.tabId))return null;let r=typeof e.resourceUri==`string`&&e.resourceUri.trim().length>0?e.resourceUri.trim():void 0,i=a(r??e.url),o=i?t(i):void 0;return{kind:o?`chat-session`:e.kind,resourceUri:o??r,tabId:e.tabId,url:o??e.url}}function pe(e){if(!J(e))return null;let t=Array.isArray(e.tabs)?e.tabs.map(de).filter(e=>e!==null).slice(-q):[];if(t.length===0)return null;let n=typeof e.activeTabId==`string`?e.activeTabId:null,r=t.some(e=>e.id===n)?n??t[0].id:t[0].id,i=new Map(t.map(e=>[e.id,e])),a=Array.isArray(e.activeHistory)?e.activeHistory.map(e=>X(e,i)).filter(e=>e!==null):[],o=[fe(i.get(r)??t[0])],s=a.length>0?a:o,c=Y(e.activeHistoryIndex,0,s.length-1,s.length-1),l=s[c],u=i.has(l.tabId)?l.tabId:r;return{isOpen:e.isOpen===!0,dockedWidth:B(e.dockedWidth),tabs:t,activeTabId:u,activeHistory:s,activeHistoryIndex:c}}function me(e,t){return typeof t==`function`?t(e):t}var Z=i()(u(e=>({snapshot:K(),setSnapshot:t=>e(e=>({snapshot:me(e.snapshot,t)}))}),{name:se,version:ce,storage:d(()=>new p),partialize:e=>({snapshot:{isOpen:e.snapshot.isOpen,dockedWidth:e.snapshot.dockedWidth,tabs:e.snapshot.tabs.slice(-q),activeTabId:e.snapshot.activeTabId,activeHistory:e.snapshot.activeHistory,activeHistoryIndex:e.snapshot.activeHistoryIndex}}),merge:(e,t)=>{let n=pe(J(e)?e.snapshot:null);return n?{...t,snapshot:n}:t}})),Q=e(s(),1),$=(0,Q.createContext)(null);function he(){let e=(0,Q.useContext)($);if(!e)throw Error(`useDocBrowser must be used within DocBrowserProvider`);return e}function ge({children:e,manager:t}){let n=y(e=>e.surfaces[`global-resources`]?.placement??`docked`),r=Z(e=>e.snapshot),i=(0,Q.useMemo)(()=>r.tabs.find(e=>e.id===r.activeTabId)??r.tabs[0],[r.activeTabId,r.tabs]),a=(0,Q.useMemo)(()=>({...r,mode:n,currentTab:i,open:t.open,openTarget:t.openTarget,openNewTab:t.openNewTab,close:t.close,toggleMode:t.toggleMode,setDockedWidth:t.setDockedWidth,navigate:t.navigate,syncUrl:t.syncUrl,goBack:t.goBack,goForward:t.goForward,closeTab:t.closeTab,setActiveTab:t.setActiveTab}),[i,t,r,n]);return(0,b.jsx)($.Provider,{value:a,children:e})}export{m as C,g as S,F as _,K as a,ee as b,B as c,O as d,k as f,L as g,I as h,U as i,W as l,oe as m,he as n,G as o,ae as p,Z as r,H as s,ge as t,E as u,R as v,h as w,y as x,x as y};
1
+ import{i as e}from"./chunk-DF37yw5_.js";import{An as t,Pn as n,_n as r,fn as i,jn as a,ur as o,xr as s}from"./api-CXWxExzS.js";import{l as c,s as l}from"./i18n-ByVUrt9w.js";import{n as u,t as d}from"./middleware-B--6mAUM.js";import{o as f,t as p}from"./navigation-history-CCnxsAKR.js";var m=`global-resources`,h=`floating-conversation`,g={placement:`docked`,minimized:!1,maximized:!1,rect:{x:80,y:80,w:560,h:640},layer:0};function _(e){if(!e||typeof e!=`object`||!(`surfaces`in e)||!e.surfaces||typeof e.surfaces!=`object`)return{};let t={};for(let[n,r]of Object.entries(e.surfaces).slice(-64)){if(!r||typeof r!=`object`)continue;let{placement:e,rect:i}=r;e!==`docked`&&e!==`floating`||!i||![`x`,`y`,`w`,`h`].every(e=>typeof i[e]==`number`&&Number.isFinite(i[e]))||(t[n]={...g,placement:e,rect:i})}return t}function v(){try{if(JSON.parse(window.localStorage.getItem(`nextclaw.doc-browser.state`)??`null`)?.state?.snapshot?.mode===`floating`)return{[m]:{...g,placement:`floating`}}}catch{}return{}}var y=i()(u(()=>({surfaces:v(),visibleSurfaceIds:[]}),{name:`nextclaw.workbench.layout`,version:1,storage:d(()=>new p),partialize:({surfaces:e})=>({surfaces:Object.fromEntries(Object.entries(e).slice(-64).map(([e,t])=>[e,{...t,minimized:!1,maximized:!1,layer:0}]))}),merge:(e,t)=>({...t,surfaces:{...t.surfaces,..._(e)}})})),b=o();function x({className:e,...t}){return(0,b.jsx)(`div`,{"aria-hidden":`true`,className:r(`motion-safe:animate-pulse rounded-md bg-foreground/[0.06]`,e),...t})}function ee({className:e,...t}){return(0,b.jsxs)(`div`,{className:r(`flex items-start gap-3 py-5`,e),"aria-hidden":`true`,...t,children:[(0,b.jsx)(x,{className:`h-10 w-10 shrink-0 rounded-xl`}),(0,b.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-3 pt-1`,children:[(0,b.jsx)(x,{className:`h-3.5 w-28 max-w-[55%]`}),(0,b.jsx)(x,{className:`h-2.5 w-3/4 max-w-72`}),(0,b.jsx)(x,{className:`h-2.5 w-1/2 max-w-48`})]})]})}var S=`docs.nextclaw.io`,C=`docs.nextclaw.net`,w=`nextclaw-docs.pages.dev`,T=new Set([S,`www.${S}`,C,`www.${C}`,w,`www.${w}`]),E=`https://${S}`,D=`https://${C}`,O=`home`,k=`nextclaw://new-tab`,A=`/guide/getting-started`;function j(e){return e===`zh`?`zh`:`en`}function M(e,t){let n=e.startsWith(`/`)?e:`/${e}`;return n===`/`||n===``?`/${t}/`:/^\/(en|zh)(\/|$)/.test(n)?n:`/${t}${n}`}function N(e){let t=e?.trim();if(t)try{return new URL(t).origin}catch{return}}function te(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone??``}catch{return``}}function ne(e){return/^[a-z][a-z\d+.-]*:/i.test(e.trim())}function re(){return c()===`zh`||te()===`Asia/Shanghai`}function ie(){return N(void 0)||(re()?N(void 0)??D:E)}function P(e){let t=j(c()),n=ie();try{let r=new URL(e,n),i=new URL(n);return!ne(e)||T.has(r.hostname)||r.origin===i.origin?(r.protocol=i.protocol,r.host=i.host,r.pathname=M(r.pathname,t),r.toString()):r.toString()}catch{return new URL(`/${t}${A}`,n).toString()}}function ae(){return P(A)}function oe(e){return P(e)}function F(e){try{let t=new URL(e);return`${t.pathname.replace(/\.html$/,``).replace(/\/$/,``)}${t.search}${t.hash}`}catch{return e}}function I(e,t,n=`Docs`){try{let r=new URL(e,E);if(r.protocol===`data:`)return t===`docs`?n:`Detail`;let i=r.pathname.split(`/`).filter(Boolean),a=i[i.length-1]??n;return decodeURIComponent(a).replace(/[-_]/g,` `).slice(0,40)||n}catch{return n}}function L(e){try{let t=typeof window<`u`?window.location.origin:E,n=new URL(e,t);return T.has(n.hostname)}catch{return!1}}function R(e,t){return t===`docs`?P(e):e}var z=0;function B(e){return typeof e==`number`&&Number.isFinite(e)?Math.min(860,Math.max(320,e)):420}function V(){return z+=1,`doc-tab-${Date.now()}-${z}`}function H(e,t,n,r,i,a,o,s){let c=n?.trim()||I(e,t,t===`docs`?l(`docBrowserHelp`):`Detail`),u=i?.trim();return{id:V(),kind:t,title:c,currentUrl:e,resourceUri:u||void 0,contentParams:o,viewState:s,dockIcon:a,dedupeKey:r,history:[e],historyIndex:0,navVersion:0}}function U(e,t){let n=f({entries:e.history,index:e.historyIndex},t);return{history:[...n.entries],historyIndex:n.index}}function W(e,t,r,i,a){let o={...t,title:i?.title||r.title||t.title,kind:r.kind,resourceUri:r.resourceUri??r.url,dockIcon:i?.dockIcon??r.dockIcon,dedupeKey:a,contentParams:r.contentParams,viewState:i?.viewState??r.viewState??t.viewState},s=e.areUrlsEquivalent(t.currentUrl,r.url,t.kind,r.kind);return s&&n(t.contentParams)===n(r.contentParams)?o:s?{...o,navVersion:t.navVersion+1}:{...o,currentUrl:r.url,...U(t,r.url),navVersion:t.navVersion+1}}function G(e){return{kind:e.kind,resourceUri:e.resourceUri,tabId:e.id,url:e.currentUrl}}function K(){let e=H(k,O,l(`docBrowserHomeTitle`));return{isOpen:!1,dockedWidth:420,tabs:[e],activeTabId:e.id,activeHistory:[G(e)],activeHistoryIndex:0}}var se=`nextclaw.doc-browser.state`,ce=1,q=8;function J(e){return!!e&&typeof e==`object`}function le(e,t){if(!Array.isArray(e))return[t];let n=e.filter(e=>typeof e==`string`&&e.trim().length>0);return n.length>0?n:[t]}function Y(e,t,n,r){return typeof e==`number`&&Number.isFinite(e)?Math.min(n,Math.max(t,e)):r}function ue(e){if(!(!J(e)||typeof e.type!=`string`)){if(e.type===`builtin`&&typeof e.name==`string`&&e.name.trim().length>0)return{type:`builtin`,name:e.name.trim()};if(e.type===`url`&&typeof e.url==`string`&&e.url.trim().length>0)return{type:`url`,url:e.url.trim()};if(e.type===`text`&&typeof e.value==`string`&&e.value.trim().length>0)return{type:`text`,value:e.value.trim()}}}function de(e){if(!J(e)||typeof e.id!=`string`||typeof e.kind!=`string`||typeof e.title!=`string`||typeof e.currentUrl!=`string`||e.currentUrl.trim().length===0)return null;let n=le(e.history,e.currentUrl),r=Y(e.historyIndex,0,n.length-1,n.length-1),i=Y(e.navVersion,0,2**53-1,0),o=typeof e.dedupeKey==`string`&&e.dedupeKey.trim().length>0?e.dedupeKey:void 0,s=typeof e.resourceUri==`string`&&e.resourceUri.trim().length>0?e.resourceUri.trim():void 0,c=ue(e.dockIcon),l=n[r]??e.currentUrl,u=a(s??l),d=u?t(u):void 0;return{id:e.id,kind:d?`chat-session`:e.kind,title:e.title,currentUrl:d??l,resourceUri:d??s,dockIcon:c,viewState:e.viewState,dedupeKey:d??o,history:n,historyIndex:r,navVersion:i}}function fe(e){return{kind:e.kind,resourceUri:e.resourceUri,tabId:e.id,url:e.currentUrl}}function X(e,n){if(!J(e)||typeof e.tabId!=`string`||typeof e.kind!=`string`||typeof e.url!=`string`||e.url.trim().length===0||!n.has(e.tabId))return null;let r=typeof e.resourceUri==`string`&&e.resourceUri.trim().length>0?e.resourceUri.trim():void 0,i=a(r??e.url),o=i?t(i):void 0;return{kind:o?`chat-session`:e.kind,resourceUri:o??r,tabId:e.tabId,url:o??e.url}}function pe(e){if(!J(e))return null;let t=Array.isArray(e.tabs)?e.tabs.map(de).filter(e=>e!==null).slice(-q):[];if(t.length===0)return null;let n=typeof e.activeTabId==`string`?e.activeTabId:null,r=t.some(e=>e.id===n)?n??t[0].id:t[0].id,i=new Map(t.map(e=>[e.id,e])),a=Array.isArray(e.activeHistory)?e.activeHistory.map(e=>X(e,i)).filter(e=>e!==null):[],o=[fe(i.get(r)??t[0])],s=a.length>0?a:o,c=Y(e.activeHistoryIndex,0,s.length-1,s.length-1),l=s[c],u=i.has(l.tabId)?l.tabId:r;return{isOpen:e.isOpen===!0,dockedWidth:B(e.dockedWidth),tabs:t,activeTabId:u,activeHistory:s,activeHistoryIndex:c}}function me(e,t){return typeof t==`function`?t(e):t}var Z=i()(u(e=>({snapshot:K(),setSnapshot:t=>e(e=>({snapshot:me(e.snapshot,t)}))}),{name:se,version:ce,storage:d(()=>new p),partialize:e=>({snapshot:{isOpen:e.snapshot.isOpen,dockedWidth:e.snapshot.dockedWidth,tabs:e.snapshot.tabs.slice(-q),activeTabId:e.snapshot.activeTabId,activeHistory:e.snapshot.activeHistory,activeHistoryIndex:e.snapshot.activeHistoryIndex}}),merge:(e,t)=>{let n=pe(J(e)?e.snapshot:null);return n?{...t,snapshot:n}:t}})),Q=e(s(),1),$=(0,Q.createContext)(null);function he(){let e=(0,Q.useContext)($);if(!e)throw Error(`useDocBrowser must be used within DocBrowserProvider`);return e}function ge({children:e,manager:t}){let n=y(e=>e.surfaces[`global-resources`]?.placement??`docked`),r=Z(e=>e.snapshot),i=(0,Q.useMemo)(()=>r.tabs.find(e=>e.id===r.activeTabId)??r.tabs[0],[r.activeTabId,r.tabs]),a=(0,Q.useMemo)(()=>({...r,mode:n,currentTab:i,open:t.open,openTarget:t.openTarget,openNewTab:t.openNewTab,close:t.close,toggleMode:t.toggleMode,setDockedWidth:t.setDockedWidth,navigate:t.navigate,syncUrl:t.syncUrl,goBack:t.goBack,goForward:t.goForward,closeTab:t.closeTab,setActiveTab:t.setActiveTab}),[i,t,r,n]);return(0,b.jsx)($.Provider,{value:a,children:e})}export{m as C,g as S,F as _,K as a,ee as b,B as c,O as d,k as f,L as g,I as h,U as i,W as l,oe as m,he as n,G as o,ae as p,Z as r,H as s,ge as t,E as u,R as v,h as w,y as x,x as y};
@@ -1 +1 @@
1
- import{t as e}from"./createLucideIcon-D-7Sxfw7.js";var t=e(`Download`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`7 10 12 15 17 10`,key:`2ggqvy`}],[`line`,{x1:`12`,x2:`12`,y1:`15`,y2:`3`,key:`1vk2je`}]]);export{t};
1
+ import{t as e}from"./createLucideIcon-C3LSyx-e.js";var t=e(`Download`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`7 10 12 15 17 10`,key:`2ggqvy`}],[`line`,{x1:`12`,x2:`12`,y1:`15`,y2:`3`,key:`1vk2je`}]]);export{t};
@@ -1 +1 @@
1
- import{Qn as e,Yt as t,Zt as n,_n as r,f as i,ur as a}from"./api-BaML_txv.js";import{n as o,t as s}from"./puzzle-CXL_z0vz.js";import{n as c,t as l}from"./inbox-DofXi7Xv.js";import{t as u}from"./refresh-cw-CqsHJPqR.js";import{s as d}from"./i18n-Bzo4IocH.js";function f(){return e({queryKey:[`extension-catalog`],queryFn:i,staleTime:5e3,refetchOnWindowFocus:!0})}var p=a(),m={running:`bg-emerald-50 text-emerald-700`,starting:`bg-amber-50 text-amber-700`,stopping:`bg-amber-50 text-amber-700`,stopped:`bg-muted text-muted-foreground`,failed:`bg-rose-50 text-rose-700`};function h({state:e}){return(0,p.jsx)(`span`,{className:r(`rounded-full px-2 py-1 text-xs font-medium`,m[e]),children:d(`extensionsState${e[0].toUpperCase()}${e.slice(1)}`)})}function g({label:e,value:t}){return(0,p.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card px-4 py-3`,children:[(0,p.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e}),(0,p.jsx)(`div`,{className:`mt-1 text-2xl font-semibold tabular-nums text-foreground`,children:t})]})}function _({extension:e}){return(0,p.jsxs)(`article`,{className:`rounded-xl border border-border/70 bg-card p-4`,children:[(0,p.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,p.jsx)(`span`,{className:`inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary`,children:(0,p.jsx)(s,{className:`h-5 w-5`})}),(0,p.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,p.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,p.jsx)(`h2`,{className:`truncate font-semibold text-foreground`,children:e.name}),(0,p.jsx)(h,{state:e.state})]}),(0,p.jsxs)(`p`,{className:`mt-1 break-all text-xs text-muted-foreground`,children:[e.id,e.version?` · v${e.version}`:``]})]})]}),(0,p.jsxs)(`div`,{className:`mt-4 grid gap-2 sm:grid-cols-2`,children:[(0,p.jsxs)(`div`,{className:`rounded-lg bg-muted/40 px-3 py-2`,children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium text-foreground`,children:[(0,p.jsx)(c,{className:`h-3.5 w-3.5`}),d(`extensionsObservationCapabilities`)]}),(0,p.jsxs)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:[e.observations.context?d(`extensionsContextCapability`):null,e.observations.context&&e.observations.events?` · `:null,e.observations.events?d(`extensionsEventsCapability`):null,!e.observations.context&&!e.observations.events?d(`extensionsNone`):null]})]}),(0,p.jsxs)(`div`,{className:`rounded-lg bg-muted/40 px-3 py-2`,children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium text-foreground`,children:[(0,p.jsx)(l,{className:`h-3.5 w-3.5`}),d(`extensionsChannelCapabilities`)]}),(0,p.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:e.channels.length>0?e.channels.map(e=>e.name||e.id).join(` · `):d(`extensionsNone`)})]})]}),(0,p.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:[(0,p.jsxs)(`span`,{children:[d(`extensionsLeaseCount`),`: `,e.leaseCount]}),e.pid?(0,p.jsxs)(`span`,{children:[d(`extensionsProcess`),`: `,e.pid]}):null,e.startedAt?(0,p.jsxs)(`span`,{children:[d(`extensionsStartedAt`),`: `,new Date(e.startedAt).toLocaleString()]}):null]})]})}function v(){let e=f(),i=e.data;return(0,p.jsxs)(n,{title:d(`extensionsPageTitle`),description:d(`extensionsPageDescription`),actions:(0,p.jsxs)(t,{type:`button`,variant:`outline`,size:`sm`,disabled:e.isFetching,onClick:()=>void e.refetch(),children:[(0,p.jsx)(u,{className:r(`mr-2 h-4 w-4`,e.isFetching&&`animate-spin`)}),d(`extensionsRefresh`)]}),children:[(0,p.jsx)(`div`,{className:`rounded-xl border border-primary/20 bg-primary/5 px-4 py-3 text-sm text-muted-foreground`,children:(0,p.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,p.jsx)(o,{className:`mt-0.5 h-4 w-4 shrink-0 text-primary`}),(0,p.jsx)(`p`,{children:d(`extensionsLifecycleDescription`)})]})}),e.isPending?(0,p.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:d(`extensionsLoading`)}):e.isError?(0,p.jsxs)(`div`,{className:`rounded-xl border border-rose-200 bg-rose-50 px-4 py-5 text-sm text-rose-700`,children:[(0,p.jsx)(`p`,{children:d(`extensionsLoadFailed`)}),(0,p.jsx)(t,{className:`mt-3`,type:`button`,variant:`outline`,size:`sm`,onClick:()=>void e.refetch(),children:d(`extensionsRetry`)})]}):i?.extensions.length?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 lg:grid-cols-4`,children:[(0,p.jsx)(g,{label:d(`extensionsTotal`),value:i.counts.total}),(0,p.jsx)(g,{label:d(`extensionsRunning`),value:i.counts.running}),(0,p.jsx)(g,{label:d(`extensionsWithObservations`),value:i.counts.withObservations}),(0,p.jsx)(g,{label:d(`extensionsWithChannels`),value:i.counts.withChannels})]}),(0,p.jsx)(`div`,{className:`space-y-3`,children:i.extensions.map(e=>(0,p.jsx)(_,{extension:e},e.id))})]}):(0,p.jsxs)(`div`,{className:`rounded-xl border border-dashed border-border px-4 py-8 text-center text-sm text-muted-foreground`,children:[(0,p.jsx)(s,{className:`mx-auto h-5 w-5 text-muted-foreground/50`}),(0,p.jsx)(`p`,{className:`mt-2 font-medium text-foreground`,children:d(`extensionsEmpty`)}),(0,p.jsx)(`p`,{className:`mt-1`,children:d(`extensionsEmptyDescription`)})]})]})}export{v as ExtensionsConfigPage};
1
+ import{Qn as e,Yt as t,Zt as n,_n as r,f as i,ur as a}from"./api-CXWxExzS.js";import{n as o,t as s}from"./puzzle-DmKVREoh.js";import{n as c,t as l}from"./inbox-CI8ATevA.js";import{t as u}from"./refresh-cw-DOg2pWGu.js";import{s as d}from"./i18n-ByVUrt9w.js";function f(){return e({queryKey:[`extension-catalog`],queryFn:i,staleTime:5e3,refetchOnWindowFocus:!0})}var p=a(),m={running:`bg-emerald-50 text-emerald-700`,starting:`bg-amber-50 text-amber-700`,stopping:`bg-amber-50 text-amber-700`,stopped:`bg-muted text-muted-foreground`,failed:`bg-rose-50 text-rose-700`};function h({state:e}){return(0,p.jsx)(`span`,{className:r(`rounded-full px-2 py-1 text-xs font-medium`,m[e]),children:d(`extensionsState${e[0].toUpperCase()}${e.slice(1)}`)})}function g({label:e,value:t}){return(0,p.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card px-4 py-3`,children:[(0,p.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e}),(0,p.jsx)(`div`,{className:`mt-1 text-2xl font-semibold tabular-nums text-foreground`,children:t})]})}function _({extension:e}){return(0,p.jsxs)(`article`,{className:`rounded-xl border border-border/70 bg-card p-4`,children:[(0,p.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,p.jsx)(`span`,{className:`inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary`,children:(0,p.jsx)(s,{className:`h-5 w-5`})}),(0,p.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,p.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,p.jsx)(`h2`,{className:`truncate font-semibold text-foreground`,children:e.name}),(0,p.jsx)(h,{state:e.state})]}),(0,p.jsxs)(`p`,{className:`mt-1 break-all text-xs text-muted-foreground`,children:[e.id,e.version?` · v${e.version}`:``]})]})]}),(0,p.jsxs)(`div`,{className:`mt-4 grid gap-2 sm:grid-cols-2`,children:[(0,p.jsxs)(`div`,{className:`rounded-lg bg-muted/40 px-3 py-2`,children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium text-foreground`,children:[(0,p.jsx)(c,{className:`h-3.5 w-3.5`}),d(`extensionsObservationCapabilities`)]}),(0,p.jsxs)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:[e.observations.context?d(`extensionsContextCapability`):null,e.observations.context&&e.observations.events?` · `:null,e.observations.events?d(`extensionsEventsCapability`):null,!e.observations.context&&!e.observations.events?d(`extensionsNone`):null]})]}),(0,p.jsxs)(`div`,{className:`rounded-lg bg-muted/40 px-3 py-2`,children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium text-foreground`,children:[(0,p.jsx)(l,{className:`h-3.5 w-3.5`}),d(`extensionsChannelCapabilities`)]}),(0,p.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:e.channels.length>0?e.channels.map(e=>e.name||e.id).join(` · `):d(`extensionsNone`)})]})]}),(0,p.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:[(0,p.jsxs)(`span`,{children:[d(`extensionsLeaseCount`),`: `,e.leaseCount]}),e.pid?(0,p.jsxs)(`span`,{children:[d(`extensionsProcess`),`: `,e.pid]}):null,e.startedAt?(0,p.jsxs)(`span`,{children:[d(`extensionsStartedAt`),`: `,new Date(e.startedAt).toLocaleString()]}):null]})]})}function v(){let e=f(),i=e.data;return(0,p.jsxs)(n,{title:d(`extensionsPageTitle`),description:d(`extensionsPageDescription`),actions:(0,p.jsxs)(t,{type:`button`,variant:`outline`,size:`sm`,disabled:e.isFetching,onClick:()=>void e.refetch(),children:[(0,p.jsx)(u,{className:r(`mr-2 h-4 w-4`,e.isFetching&&`animate-spin`)}),d(`extensionsRefresh`)]}),children:[(0,p.jsx)(`div`,{className:`rounded-xl border border-primary/20 bg-primary/5 px-4 py-3 text-sm text-muted-foreground`,children:(0,p.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,p.jsx)(o,{className:`mt-0.5 h-4 w-4 shrink-0 text-primary`}),(0,p.jsx)(`p`,{children:d(`extensionsLifecycleDescription`)})]})}),e.isPending?(0,p.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:d(`extensionsLoading`)}):e.isError?(0,p.jsxs)(`div`,{className:`rounded-xl border border-rose-200 bg-rose-50 px-4 py-5 text-sm text-rose-700`,children:[(0,p.jsx)(`p`,{children:d(`extensionsLoadFailed`)}),(0,p.jsx)(t,{className:`mt-3`,type:`button`,variant:`outline`,size:`sm`,onClick:()=>void e.refetch(),children:d(`extensionsRetry`)})]}):i?.extensions.length?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 lg:grid-cols-4`,children:[(0,p.jsx)(g,{label:d(`extensionsTotal`),value:i.counts.total}),(0,p.jsx)(g,{label:d(`extensionsRunning`),value:i.counts.running}),(0,p.jsx)(g,{label:d(`extensionsWithObservations`),value:i.counts.withObservations}),(0,p.jsx)(g,{label:d(`extensionsWithChannels`),value:i.counts.withChannels})]}),(0,p.jsx)(`div`,{className:`space-y-3`,children:i.extensions.map(e=>(0,p.jsx)(_,{extension:e},e.id))})]}):(0,p.jsxs)(`div`,{className:`rounded-xl border border-dashed border-border px-4 py-8 text-center text-sm text-muted-foreground`,children:[(0,p.jsx)(s,{className:`mx-auto h-5 w-5 text-muted-foreground/50`}),(0,p.jsx)(`p`,{className:`mt-2 font-medium text-foreground`,children:d(`extensionsEmpty`)}),(0,p.jsx)(`p`,{className:`mt-1`,children:d(`extensionsEmptyDescription`)})]})]})}export{v as ExtensionsConfigPage};
@@ -1 +1 @@
1
- import{t as e}from"./createLucideIcon-D-7Sxfw7.js";var t=e(`ExternalLink`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]);export{t};
1
+ import{t as e}from"./createLucideIcon-C3LSyx-e.js";var t=e(`ExternalLink`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]);export{t};
@@ -1 +1 @@
1
- import{_n as e,ur as t}from"./api-BaML_txv.js";var n=t();function r({align:t=`end`,className:r,...i}){return(0,n.jsx)(`div`,{className:e(`flex flex-wrap items-center gap-2`,t===`start`&&`justify-start`,t===`end`&&`justify-end`,t===`between`&&`justify-between`,r),...i})}export{r as t};
1
+ import{_n as e,ur as t}from"./api-CXWxExzS.js";var n=t();function r({align:t=`end`,className:r,...i}){return(0,n.jsx)(`div`,{className:e(`flex flex-wrap items-center gap-2`,t===`start`&&`justify-start`,t===`end`&&`justify-end`,t===`between`&&`justify-between`,r),...i})}export{r as t};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/main-i18n-catalog.config-ykBbOfNP.js","assets/panel-app-BBTg0tVp.js","assets/panel-app-i18n-catalog.config-DEFg3R5S.js"])))=>i.map(i=>d[i]);
2
- import{t as e}from"./preload-helper-DWTEM3RW.js";var t=`nextclaw.ui.language`,n={en:`en-US`,zh:`zh-CN`},r=[{value:`en`,label:`English`},{value:`zh`,label:`中文`}],i=new class{constructor(){this.activeLanguage=`en`,this.initialized=!1,this.listeners=new Set,this.isLanguage=e=>e===`en`||e===`zh`,this.detectBrowserLanguage=()=>typeof navigator>`u`?`en`:(navigator.language?.toLowerCase()??`en`).startsWith(`zh`)?`zh`:`en`,this.getDesktopBridge=()=>typeof window>`u`?null:window.nextclawDesktop??null,this.resolveInitialLanguage=()=>{if(typeof window>`u`)return`en`;let e=this.getDesktopBridge();if(e)return this.isLanguage(e.localePreference)?e.localePreference:this.detectBrowserLanguage();try{let e=window.localStorage.getItem(t);if(this.isLanguage(e))return e}catch{}return this.detectBrowserLanguage()},this.initialize=()=>(this.initialized||=(this.activeLanguage=this.resolveInitialLanguage(),!0),this.activeLanguage),this.getLanguage=()=>this.initialized?this.activeLanguage:this.initialize(),this.setLanguage=e=>{if(this.initialize(),this.activeLanguage===e)return;this.activeLanguage=e;let n=this.getDesktopBridge();if(n)n.setLocalePreference?.(e);else if(typeof window<`u`)try{window.localStorage.setItem(t,e)}catch{}this.listeners.forEach(t=>t(e))},this.subscribeLanguageChange=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)}),this.getLocale=(e=this.getLanguage())=>n[e]}},{resolveInitialLanguage:a}=i,o=i.initialize,{getLanguage:s}=i,{setLanguage:c}=i,{subscribeLanguageChange:l}=i,{getLocale:u}=i,d={zh:{},en:{}},f={};function p(e){Object.assign(d.zh,e.zh),Object.assign(d.en,e.en);for(let e of new Set([...Object.keys(d.zh),...Object.keys(d.en)]))f[e]={zh:d.zh[e]??d.en[e]??e,en:d.en[e]??e}}async function m(){(await e(()=>import(`./main-i18n-catalog.config-ykBbOfNP.js`),__vite__mapDeps([0,1]))).installMainI18nCatalog()}async function h(){(await e(()=>import(`./panel-app-i18n-catalog.config-DEFg3R5S.js`),__vite__mapDeps([2,1]))).installPanelAppI18nCatalog()}function g(e,t=s()){if(!e)return`-`;let n=e instanceof Date?e:new Date(e);return Number.isNaN(n.getTime())?typeof e==`string`?e:`-`:n.toLocaleString(u(t))}function _(e,t=s()){if(!e)return`-`;let n=e instanceof Date?e:new Date(e);return Number.isNaN(n.getTime())?typeof e==`string`?e:`-`:new Intl.DateTimeFormat(u(t),{year:`numeric`,month:`2-digit`,day:`2-digit`}).format(n)}function v(e,t=s()){return new Intl.NumberFormat(u(t)).format(e)}function y(e,t=s()){return d[t]?.[e]??d.en[e]??e}export{h as a,r as c,o as d,c as f,m as i,s as l,g as n,p as o,l as p,v as r,y as s,_ as t,u};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/main-i18n-catalog.config-_4gMZaNz.js","assets/panel-app-BBTg0tVp.js","assets/panel-app-i18n-catalog.config-B9c87s2X.js"])))=>i.map(i=>d[i]);
2
+ import{t as e}from"./preload-helper-DWTEM3RW.js";var t=`nextclaw.ui.language`,n={en:`en-US`,zh:`zh-CN`},r=[{value:`en`,label:`English`},{value:`zh`,label:`中文`}],i=new class{constructor(){this.activeLanguage=`en`,this.initialized=!1,this.listeners=new Set,this.isLanguage=e=>e===`en`||e===`zh`,this.detectBrowserLanguage=()=>typeof navigator>`u`?`en`:(navigator.language?.toLowerCase()??`en`).startsWith(`zh`)?`zh`:`en`,this.getDesktopBridge=()=>typeof window>`u`?null:window.nextclawDesktop??null,this.resolveInitialLanguage=()=>{if(typeof window>`u`)return`en`;let e=this.getDesktopBridge();if(e)return this.isLanguage(e.localePreference)?e.localePreference:this.detectBrowserLanguage();try{let e=window.localStorage.getItem(t);if(this.isLanguage(e))return e}catch{}return this.detectBrowserLanguage()},this.initialize=()=>(this.initialized||=(this.activeLanguage=this.resolveInitialLanguage(),!0),this.activeLanguage),this.getLanguage=()=>this.initialized?this.activeLanguage:this.initialize(),this.setLanguage=e=>{if(this.initialize(),this.activeLanguage===e)return;this.activeLanguage=e;let n=this.getDesktopBridge();if(n)n.setLocalePreference?.(e);else if(typeof window<`u`)try{window.localStorage.setItem(t,e)}catch{}this.listeners.forEach(t=>t(e))},this.subscribeLanguageChange=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)}),this.getLocale=(e=this.getLanguage())=>n[e]}},{resolveInitialLanguage:a}=i,o=i.initialize,{getLanguage:s}=i,{setLanguage:c}=i,{subscribeLanguageChange:l}=i,{getLocale:u}=i,d={zh:{},en:{}},f={};function p(e){Object.assign(d.zh,e.zh),Object.assign(d.en,e.en);for(let e of new Set([...Object.keys(d.zh),...Object.keys(d.en)]))f[e]={zh:d.zh[e]??d.en[e]??e,en:d.en[e]??e}}async function m(){(await e(()=>import(`./main-i18n-catalog.config-_4gMZaNz.js`),__vite__mapDeps([0,1]))).installMainI18nCatalog()}async function h(){(await e(()=>import(`./panel-app-i18n-catalog.config-B9c87s2X.js`),__vite__mapDeps([2,1]))).installPanelAppI18nCatalog()}function g(e,t=s()){if(!e)return`-`;let n=e instanceof Date?e:new Date(e);return Number.isNaN(n.getTime())?typeof e==`string`?e:`-`:n.toLocaleString(u(t))}function _(e,t=s()){if(!e)return`-`;let n=e instanceof Date?e:new Date(e);return Number.isNaN(n.getTime())?typeof e==`string`?e:`-`:new Intl.DateTimeFormat(u(t),{year:`numeric`,month:`2-digit`,day:`2-digit`}).format(n)}function v(e,t=s()){return new Intl.NumberFormat(u(t)).format(e)}function y(e,t=s()){return d[t]?.[e]??d.en[e]??e}export{h as a,r as c,o as d,c as f,m as i,s as l,g as n,p as o,l as p,v as r,y as s,_ as t,u};
@@ -0,0 +1 @@
1
+ import{z as e}from"./app-presenter-provider-DdD2Q7jZ.js";export{e as InboxPage};
@@ -1 +1 @@
1
- import{t as e}from"./createLucideIcon-D-7Sxfw7.js";var t=e(`Eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),n=e(`Inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]);export{t as n,n as t};
1
+ import{t as e}from"./createLucideIcon-C3LSyx-e.js";var t=e(`Eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),n=e(`Inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]);export{t as n,n as t};
@@ -1 +1 @@
1
- import{Jt as e,Kt as t,Zt as n,qt as r,ur as i}from"./api-BaML_txv.js";import{et as a}from"./app-presenter-provider-DSlY9Lz6.js";import{t as o}from"./use-viewport-layout-D6seoW0Z.js";import{s}from"./i18n-Bzo4IocH.js";var c=i();function l(){let{isMobile:i}=o();return(0,c.jsx)(n,{title:s(`keyboardShortcuts`),children:i?(0,c.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:s(`keyboardShortcutsDesktopOnly`)}):(0,c.jsx)(e,{children:(0,c.jsx)(r,{children:(0,c.jsx)(t,{title:s(`chatInputVoice`),layout:`stacked`,children:(0,c.jsx)(a,{})})})})})}export{l as KeyboardShortcutsSettingsPage};
1
+ import{Jt as e,Kt as t,Zt as n,qt as r,ur as i}from"./api-CXWxExzS.js";import{et as a}from"./app-presenter-provider-DdD2Q7jZ.js";import{t as o}from"./use-viewport-layout-Bnm5W5Qz.js";import{s}from"./i18n-ByVUrt9w.js";var c=i();function l(){let{isMobile:i}=o();return(0,c.jsx)(n,{title:s(`keyboardShortcuts`),children:i?(0,c.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:s(`keyboardShortcutsDesktopOnly`)}):(0,c.jsx)(e,{children:(0,c.jsx)(r,{children:(0,c.jsx)(t,{title:s(`chatInputVoice`),layout:`stacked`,children:(0,c.jsx)(a,{})})})})})}export{l as KeyboardShortcutsSettingsPage};
@@ -1 +1 @@
1
- import{i as e}from"./chunk-DF37yw5_.js";import{Bt as t,Gt as n,Yt as r,ur as i,xr as a}from"./api-BaML_txv.js";import{s as o}from"./i18n-Bzo4IocH.js";import{a as s,i as c,n as l,r as u,t as d}from"./card-DxCOCY_7.js";var f=e(a(),1),p=i();function m({username:e}){let i=t(),[a,m]=(0,f.useState)(e??``),[h,g]=(0,f.useState)(``),_=a.trim().length>0&&h.length>0&&!i.isPending;return(0,p.jsx)(`main`,{className:`flex min-h-screen items-center justify-center bg-secondary px-6 py-10`,children:(0,p.jsxs)(d,{hover:!1,className:`w-full max-w-md shadow-card-hover`,children:[(0,p.jsxs)(c,{children:[(0,p.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-gray-500`,children:o(`authBrand`)}),(0,p.jsx)(s,{className:`text-2xl`,children:o(`authLoginTitle`)}),(0,p.jsx)(u,{children:o(`authLoginDescription`)})]}),(0,p.jsx)(l,{children:(0,p.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e?.preventDefault(),_&&i.mutate({username:a.trim(),password:h})},children:[(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(`label`,{className:`text-sm font-medium text-gray-800`,children:o(`authUsername`)}),(0,p.jsx)(n,{value:a,onChange:e=>m(e.target.value),placeholder:o(`authUsernamePlaceholder`),autoFocus:!0})]}),(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(`label`,{className:`text-sm font-medium text-gray-800`,children:o(`authPassword`)}),(0,p.jsx)(n,{type:`password`,value:h,onChange:e=>g(e.target.value),placeholder:o(`authPasswordPlaceholder`)})]}),(0,p.jsx)(r,{type:`submit`,className:`w-full`,disabled:!_,children:i.isPending?o(`authLoggingIn`):o(`authLoginAction`)})]})})]})})}export{m as t};
1
+ import{i as e}from"./chunk-DF37yw5_.js";import{Bt as t,Gt as n,Yt as r,ur as i,xr as a}from"./api-CXWxExzS.js";import{s as o}from"./i18n-ByVUrt9w.js";import{a as s,i as c,n as l,r as u,t as d}from"./card-eFBmxYiI.js";var f=e(a(),1),p=i();function m({username:e}){let i=t(),[a,m]=(0,f.useState)(e??``),[h,g]=(0,f.useState)(``),_=a.trim().length>0&&h.length>0&&!i.isPending;return(0,p.jsx)(`main`,{className:`flex min-h-screen items-center justify-center bg-secondary px-6 py-10`,children:(0,p.jsxs)(d,{hover:!1,className:`w-full max-w-md shadow-card-hover`,children:[(0,p.jsxs)(c,{children:[(0,p.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-gray-500`,children:o(`authBrand`)}),(0,p.jsx)(s,{className:`text-2xl`,children:o(`authLoginTitle`)}),(0,p.jsx)(u,{children:o(`authLoginDescription`)})]}),(0,p.jsx)(l,{children:(0,p.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e?.preventDefault(),_&&i.mutate({username:a.trim(),password:h})},children:[(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(`label`,{className:`text-sm font-medium text-gray-800`,children:o(`authUsername`)}),(0,p.jsx)(n,{value:a,onChange:e=>m(e.target.value),placeholder:o(`authUsernamePlaceholder`),autoFocus:!0})]}),(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(`label`,{className:`text-sm font-medium text-gray-800`,children:o(`authPassword`)}),(0,p.jsx)(n,{type:`password`,value:h,onChange:e=>g(e.target.value),placeholder:o(`authPasswordPlaceholder`)})]}),(0,p.jsx)(r,{type:`submit`,className:`w-full`,disabled:!_,children:i.isPending?o(`authLoggingIn`):o(`authLoginAction`)})]})})]})})}export{m as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./login-page--Njgbmpm.js";export{e as LoginPage};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/projects-Rm2oKUPt.js","assets/chunk-DF37yw5_.js","assets/dist-BxOjfeaD.js","assets/api-BaML_txv.js","assets/i18n-Bzo4IocH.js","assets/preload-helper-DWTEM3RW.js","assets/createLucideIcon-D-7Sxfw7.js","assets/app-presenter-provider-DSlY9Lz6.js","assets/context-menu-DVgLoPqH.js","assets/katex-BzT-4KBu.js","assets/search-Drx-sMCE.js","assets/external-link-NwtWKzE2.js","assets/inbox-DofXi7Xv.js","assets/x-DLvS4xvV.js","assets/plus-v29lPO18.js","assets/context-menu-DEcVZfaU.css","assets/puzzle-CXL_z0vz.js","assets/book-open-oG0GrLyy.js","assets/theme-provider-DDJOlUxn.js","assets/dialog-InO6RVpm.js","assets/navigation-history-CCnxsAKR.js","assets/download-BN4aCzSx.js","assets/use-viewport-layout-D6seoW0Z.js","assets/middleware-B--6mAUM.js","assets/refresh-cw-CqsHJPqR.js","assets/trash-2-B8mbrtCx.js","assets/navigation-link-tawg3qi2.js","assets/host-capabilities-B107nwS3.js","assets/use-desktop-capabilities-C1bXk7fx.js","assets/status-dot-xxVxbdQr.js","assets/doc-browser-context-Bs122rxO.js","assets/tag-chip-0lQj9HFa.js","assets/card-DxCOCY_7.js","assets/confirm-dialog-BdEQiFoD.js","assets/provider-models-CWtoV3BJ.js","assets/select-DHYR109w.js","assets/use-config-BpKXDcM_.js","assets/app-presenter-provider-D3BuuOyZ.css","assets/circle-dashed-pgOOTUik.js","assets/settings-2-DAPjKYtK.js","assets/model-config-page-BCGCP2Wc.js","assets/provider-scoped-model-input-DJzdGBE8.js","assets/form-actions-XP38NiPw.js","assets/config-hints-CaB3I7KP.js","assets/appearance-settings-page-BNIxFwEY.js","assets/keyboard-shortcuts-settings-page-Cn3zyBq_.js","assets/search-config-page-BjVONAIH.js","assets/config-split-page-Cfozkh5B.js","assets/providers-config-page-gzLkTzMP.js","assets/extensions-hxS830nS.js","assets/channels-list-page-UQ1xjKw9.js","assets/runtime-config-page-B5CCnrei.js","assets/rotate-cw-DS-Gca0a.js","assets/save-CwxRo7hc.js","assets/pwa-Blsqtn1m.js","assets/desktop-update-config-CVUwJyV-.js","assets/security-config--ilpaAEr.js","assets/secrets-config-page-BB32noHT.js","assets/privacy-settings-page-D4TI_vdw.js","assets/desktop-capabilities-page-gakZ5UKX.js","assets/remote-DTe4pS7P.js","assets/mcp-marketplace-page-BqFum360.js"])))=>i.map(i=>d[i]);
2
- import{i as e}from"./chunk-DF37yw5_.js";import{t}from"./client-C1Z8ITVa.js";import{E as n,O as r,a as i,n as a,o,r as s,t as c}from"./theme-provider-DDJOlUxn.js";import{i as l,n as u,t as d}from"./pwa-Blsqtn1m.js";import{Ht as f,Jn as p,Lt as m,Vt as ee,Yn as te,an as h,cr as ne,dn as g,qn as _,un as v,ur as re,x as y,xr as ie}from"./api-BaML_txv.js";import{t as b}from"./preload-helper-DWTEM3RW.js";import{c as ae,i as x,l as S,n as C,o as w,s as T}from"./navigation-link-tawg3qi2.js";import{B as oe,C as se,J as ce,Jt as E,Rt as le,S as ue,St as de,T as fe,W as D,Xt as O,Yt as k,_ as A,a as j,b as M,g as N,h as P,i as F,l as I,n as L,o as R,p as z,rt as B,s as V,t as pe,u as H,w as me,x as he,xt as ge,y as _e,z as ve}from"./app-presenter-provider-DSlY9Lz6.js";import{f as ye}from"./context-menu-DVgLoPqH.js";import{t as be}from"./agents-lT-bDFex.js";import{t as U}from"./use-viewport-layout-D6seoW0Z.js";import{i as xe,s as W}from"./i18n-Bzo4IocH.js";import{n as Se,t as Ce}from"./doc-browser-context-Bs122rxO.js";import{t as we}from"./login-page-CkfjjXD2.js";var G=n();if(l.syncTheme(G),r(G)===`island`){let e=document.createElement(`link`);e.rel=`preload`,e.as=`image`,e.href=`/themes/island/island-atmosphere-7a037243.webp`,e.fetchPriority=`high`,document.head.appendChild(e)}var Te=t(),K=e(ie(),1);function Ee(){let e=L();return(0,K.useEffect)(()=>(e.chatCompletionNotificationManager.start(),()=>{e.chatCompletionNotificationManager.stop()}),[e.chatCompletionNotificationManager]),null}var De=`NextClaw`,Oe=[{prefix:`/resource`,key:`resourcePageTitle`},{prefix:`/marketplace/mcp`,key:`marketplaceMcpPageTitle`},{prefix:`/marketplace/skills`,key:`marketplaceSkillsPageTitle`},{prefix:`/marketplace`,key:`marketplace`},{prefix:`/skills`,key:`marketplaceSkillsPageTitle`},{prefix:`/cron`,key:`cronPageTitle`},{prefix:`/agents`,key:`agentsPageTitle`},{prefix:`/projects`,key:`projectsTitle`},{prefix:`/chat`,key:`chat`},{prefix:`/model`,key:`modelPageTitle`},{prefix:`/search`,key:`searchPageTitle`},{prefix:`/providers`,key:`providersPageTitle`},{prefix:`/channels`,key:`channelsPageTitle`},{prefix:`/runtime`,key:`runtimePageTitle`},{prefix:`/updates`,key:`runtimeUpdatesPageTitle`},{prefix:`/remote`,key:`remotePageTitle`},{prefix:`/security`,key:`authSecurityTitle`},{prefix:`/secrets`,key:`secretsPageTitle`}];function ke(e,t){return e===t||e.startsWith(`${t}/`)}function Ae(e){let t=e.toLowerCase();for(let{prefix:e,key:n}of Oe)if(ke(t,e))return W(n);return W(`settings`)}function je(e){let t=e.toLowerCase();return t===`localhost`||t.endsWith(`.localhost`)||t===`::1`||t===`[::1]`||t.startsWith(`127.`)}function Me(e){let t=e?.host.trim(),n=e?.hostname.trim(),r=e?.port.trim();return!t||!n?null:je(n)?r||null:t}function Ne(e,t){let n=Me(t);return`${De}${n?` ${n}`:``} - ${Ae(e)}`}var q=re(),Pe=e=>(0,q.jsx)(N,{uri:e});function Fe({children:e,sideDockManager:t}){let{isOpen:n,mode:r}=Se();de();let{pathname:i}=S(),{language:a}=o(),{isMobile:s}=U(),c=me(),l=R(e=>e.isVisible);R(e=>e.pinnedItems);let u={getDockState:t.getDockState,pinTab:t.pinTab,unpinTab:t.unpinTab},d=z(),f=e=>d(P(e),`global`);return(0,K.useEffect)(()=>{document.title=Ne(i,window.location)},[i,a]),s&&c!==`win32`?(0,q.jsx)(se,{pathname:i,isDocBrowserOpen:n,docBrowserDockControls:u,docBrowserRenderers:H,docBrowserTabMenuGroups:f,topbarLeadingInset:c===`darwin`?`4.75rem`:void 0,children:e}):(0,q.jsx)(M,{pathname:i,isMobileLayout:s,isDocBrowserOpen:n,docBrowserMode:r,docBrowserDockControls:u,docBrowserRenderers:H,docBrowserTabMenuGroups:f,sideDock:l?(0,q.jsx)(j,{manager:t,getItemMenuGroups:e=>{let t=F().pageResourceManager.resolve(e.target.type===`right-panel-resource`?e.target.uri:e.target.url);return t?d(t):[]}}):null,children:e})}function Ie({children:e}){let t=F();return(0,q.jsx)(Ce,{manager:t.docBrowserManager,children:(0,q.jsx)(ye,{renderIcon:Pe,children:(0,q.jsx)(Fe,{sideDockManager:t.sideDockManager,children:e})})})}function Le(){let{isMobile:e}=U();return e?(0,q.jsx)(ue,{}):(0,q.jsx)(w,{to:`/model`,replace:!0})}var Re=(0,K.lazy)(async()=>({default:(await b(async()=>{let{ProjectsPage:e}=await import(`./projects-Rm2oKUPt.js`);return{ProjectsPage:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39]))).ProjectsPage})),J=`max-w-[min(1180px,100%)]`;function ze(e){return e===`projects`?`relative flex flex-1 min-h-0 overflow-hidden bg-background`:`flex-1 min-h-0 overflow-hidden bg-background`}function Be(e){let{routeSessionKey:t,syncRouteSessionSelection:n}=e;(0,K.useLayoutEffect)(()=>{n(t)},[t,n])}function Ve({view:e}){let{onScroll:t,scrollRef:n}=le({restorationKey:e===`cron`||e===`agents`?`main-page:${e}`:null});switch(e){case`resource`:return(0,q.jsx)(I,{});case`projects`:return(0,q.jsx)(K.Suspense,{fallback:(0,q.jsx)(`div`,{className:`h-full animate-pulse bg-card/30`}),children:(0,q.jsx)(Re,{})});case`panel-app`:return(0,q.jsx)(B,{});case`inbox`:return(0,q.jsx)(`div`,{className:`mx-auto flex h-full min-h-0 w-full flex-col md:px-6 md:py-5 ${J}`,children:(0,q.jsx)(ve,{})});case`cron`:case`agents`:return(0,q.jsx)(`div`,{ref:n,onScroll:t,className:`h-full overflow-auto custom-scrollbar`,children:(0,q.jsx)(`div`,{className:`mx-auto w-full px-4 py-4 sm:px-6 sm:py-5 ${J}`,children:e===`cron`?(0,q.jsx)(ce,{}):(0,q.jsx)(be,{})})});default:return(0,q.jsx)(`div`,{className:`mx-auto flex h-full min-h-0 w-full flex-col px-4 py-4 sm:px-6 sm:py-5 ${J}`,children:(0,q.jsx)(ge,{forcedType:`skills`})})}}function He({view:e,confirmDialog:t}){let{isMobile:n}=U();return(0,q.jsxs)(`div`,{className:`h-full flex`,children:[n?null:(0,q.jsx)(_e,{}),e===`chat`?n?(0,q.jsx)(he,{}):(0,q.jsx)(D,{}):(0,q.jsx)(`section`,{"data-theme-surface":`workspace`,className:`${ze(e)} flex flex-col`,children:(0,q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,q.jsx)(Ve,{view:e})})}),t]})}function Ue(){let e=k();(0,K.useEffect)(()=>m.eventBus.on(_.uiShowContent,t=>{e.chatThreadManager.handleUiShowContentEvent(t)}),[e])}function We({view:e}){let t=k(),{pathname:n}=S();return Be({routeSessionKey:O(n.startsWith(`/chat/`)?n.slice(6):void 0),syncRouteSessionSelection:t.chatSessionListManager.syncRouteSessionSelection}),Ue(),(0,q.jsx)(He,{view:e})}function Y({view:e}){return(0,q.jsx)(We,{view:e})}function Ge(e){let t=e.trim().toLowerCase();return t?!t.startsWith(`skills`):!0}function Ke(e,t){t.startsWith(`mcp`)&&(e?.invalidateQueries({queryKey:[`marketplace-mcp-installed`]}),e?.invalidateQueries({queryKey:[`marketplace-mcp-items`]}),e?.invalidateQueries({queryKey:[`marketplace-mcp-doctor`]}))}function qe(e,t){e&&Ge(t)&&e.invalidateQueries({queryKey:[`config`]}),Ke(e,t)}function X(e){let t=e.trim().replace(/\\/g,`/`).replace(/\/+$/g,``);return/^[a-z]:/i.test(t)?t.toLowerCase():t}function Je(e,t){if(!e)return;let n=X(t);e.invalidateQueries({predicate:e=>e.queryKey[0]===`server-path-browse`&&typeof e.queryKey[1]==`string`&&X(e.queryKey[1])===n})}function Ye(e){let t=(0,K.useRef)(!1);(0,K.useEffect)(()=>{let n=m.eventBus.on(_.connectionOpen,()=>{g.handleConnectionRestored(),h.refreshAfterRealtimeReconnect(),t.current&&(t.current=!1,E.getState().clearSessionRunStatuses(),e?.invalidateQueries({queryKey:[`ncp-sessions`]}),e?.invalidateQueries({queryKey:[`ncp-session-pages`]}))}),r=m.eventBus.on(_.connectionClose,()=>{g.handleConnectionInterrupted(null),t.current=!0}),i=m.eventBus.on(_.connectionError,e=>{g.handleConnectionInterrupted(e?.message??null),t.current=!0}),a=m.eventBus.on(_.configUpdated,({path:t})=>{qe(e,t)}),o=m.eventBus.on(_.serverPathChanged,({directoryPath:t})=>Je(e,t)),s=m.eventBus.on(_.runtimeUpdateSnapshot,e=>{h.reportSnapshot(e)}),c=m.eventBus.on(_.sessionRunStatus,t=>{E.getState().setSessionRunStatus(t.sessionKey,t.status),y(e,{type:`session.run-status`,payload:t})}),l=m.eventBus.on(_.sessionSummaryUpsert,t=>{y(e,{type:`session.summary.upsert`,payload:t})}),u=m.eventBus.on(_.sessionSummaryDelete,t=>{E.getState().setSessionRunStatus(t.sessionKey,`idle`),y(e,{type:`session.summary.delete`,payload:t})}),d=m.eventBus.on(_.error,e=>{console.error(`Realtime transport error:`,e.message)});return()=>{n(),r(),i(),a(),o(),s(),c(),l(),u(),d()}},[e])}var Xe={"--width":`320px`},Ze=(0,K.lazy)(async()=>({default:(await V()).AccountPanel})),Qe=(0,K.lazy)(async()=>({default:(await b(async()=>{let{ModelConfigPage:e}=await import(`./model-config-page-BCGCP2Wc.js`);return{ModelConfigPage:e}},__vite__mapDeps([40,1,3,4,5,17,6,41,2,34,8,9,10,11,12,13,14,15,35,26,27,30,23,20,42,36,43]))).ModelConfigPage})),$e=(0,K.lazy)(async()=>({default:(await b(async()=>{let{AppearanceSettingsPage:e}=await import(`./appearance-settings-page-BNIxFwEY.js`);return{AppearanceSettingsPage:e}},__vite__mapDeps([44,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37]))).AppearanceSettingsPage})),et=(0,K.lazy)(async()=>({default:(await b(async()=>{let{KeyboardShortcutsSettingsPage:e}=await import(`./keyboard-shortcuts-settings-page-Cn3zyBq_.js`);return{KeyboardShortcutsSettingsPage:e}},__vite__mapDeps([45,7,1,5,2,3,4,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37]))).KeyboardShortcutsSettingsPage})),tt=(0,K.lazy)(async()=>({default:(await b(async()=>{let{SearchConfigPage:e}=await import(`./search-config-page-BjVONAIH.js`);return{SearchConfigPage:e}},__vite__mapDeps([46,1,3,4,5,10,6,22,23,26,11,27,47,42,35,2,36]))).SearchConfigPage})),nt=(0,K.lazy)(async()=>({default:(await b(async()=>{let{ProvidersConfigPage:e}=await import(`./providers-config-page-gzLkTzMP.js`);return{ProvidersConfigPage:e}},__vite__mapDeps([48,1,2,3,4,5,6,8,9,10,11,12,13,14,15,22,23,24,39,25,29,47,42,33,19,34,35,36,43,27]))).ProvidersConfigPage})),rt=(0,K.lazy)(async()=>({default:(await b(async()=>{let{ExtensionsConfigPage:e}=await import(`./extensions-hxS830nS.js`);return{ExtensionsConfigPage:e}},__vite__mapDeps([49,3,1,4,5,16,6,12,24]))).ExtensionsConfigPage})),it=(0,K.lazy)(async()=>({default:(await b(async()=>{let{ChannelsList:e}=await import(`./channels-list-page-UQ1xjKw9.js`);return{ChannelsList:e}},__vite__mapDeps([50,1,2,3,4,5,6,10,17,11,13,22,23,26,27,29,47,31,42,35,36,43]))).ChannelsList})),at=(0,K.lazy)(async()=>({default:(await b(async()=>{let{RuntimeConfig:e}=await import(`./runtime-config-page-B5CCnrei.js`);return{RuntimeConfig:e}},__vite__mapDeps([51,1,7,5,2,3,4,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,52,53,54,42]))).RuntimeConfig})),ot=(0,K.lazy)(async()=>({default:(await b(async()=>{let{DesktopUpdateConfig:e}=await import(`./desktop-update-config-CVUwJyV-.js`);return{DesktopUpdateConfig:e}},__vite__mapDeps([55,3,1,4,5,21,6,24,52,26,11,27,32,35,2]))).DesktopUpdateConfig})),st=(0,K.lazy)(async()=>({default:(await b(async()=>{let{SecurityConfig:e}=await import(`./security-config--ilpaAEr.js`);return{SecurityConfig:e}},__vite__mapDeps([56,3,1,4,5]))).SecurityConfig})),ct=(0,K.lazy)(async()=>({default:(await b(async()=>{let{SecretsConfigPage:e}=await import(`./secrets-config-page-BB32noHT.js`);return{SecretsConfigPage:e}},__vite__mapDeps([57,1,3,4,5,14,6,53,25,42,35,2,36]))).SecretsConfigPage})),Z=(0,K.lazy)(async()=>({default:(await b(async()=>{let{PrivacySettingsPage:e}=await import(`./privacy-settings-page-D4TI_vdw.js`);return{PrivacySettingsPage:e}},__vite__mapDeps([58,3,1,4,5,35,2,6,36]))).PrivacySettingsPage})),lt=(0,K.lazy)(async()=>({default:(await b(async()=>{let{DesktopCapabilitiesPage:e}=await import(`./desktop-capabilities-page-gakZ5UKX.js`);return{DesktopCapabilitiesPage:e}},__vite__mapDeps([59,3,1,4,5,28]))).DesktopCapabilitiesPage})),ut=(0,K.lazy)(async()=>({default:(await b(async()=>{let{RemoteAccessPage:e}=await import(`./remote-DTe4pS7P.js`);return{RemoteAccessPage:e}},__vite__mapDeps([60,7,1,5,2,3,4,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37]))).RemoteAccessPage})),dt=(0,K.lazy)(async()=>({default:(await b(async()=>{let{McpMarketplacePage:e}=await import(`./mcp-marketplace-page-BqFum360.js`);return{McpMarketplacePage:e}},__vite__mapDeps([61,7,1,5,2,3,4,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37]))).McpMarketplacePage}));function ft(){return(0,q.jsx)(`div`,{className:`h-full w-full animate-pulse rounded-2xl border border-border/40 bg-card/40`})}function pt({children:e}){return(0,q.jsx)(K.Suspense,{fallback:(0,q.jsx)(ft,{}),children:e})}function Q(e){return(0,q.jsx)(pt,{children:e})}var mt=[{path:`/resource`,element:Q((0,q.jsx)(Y,{view:`resource`}))},{path:`/projects/:projectId/:tab`,element:Q((0,q.jsx)(Y,{view:`projects`}))},{path:`/projects`,element:Q((0,q.jsx)(Y,{view:`projects`}))},{path:`/chat/skills`,redirectTo:`/skills`},{path:`/chat/cron`,redirectTo:`/cron`},{path:`/chat/agents`,redirectTo:`/agents`},{path:`/chat/:sessionId?`,element:Q((0,q.jsx)(Y,{view:`chat`}))},{path:`/agents`,element:Q((0,q.jsx)(Y,{view:`agents`}))},{path:`/skills`,element:Q((0,q.jsx)(Y,{view:`skills`}))},{path:`/skills/scenes/:scene`,element:Q((0,q.jsx)(Y,{view:`skills`}))},{path:`/cron`,element:Q((0,q.jsx)(Y,{view:`cron`}))},{path:`/inbox/:deliveryId?`,element:Q((0,q.jsx)(Y,{view:`inbox`}))},{path:`/apps/panel/:appId`,element:Q((0,q.jsx)(Y,{view:`panel-app`}))},{path:`/appearance`,element:Q((0,q.jsx)($e,{}))},{path:`/keyboard-shortcuts`,element:Q((0,q.jsx)(et,{}))},{path:`/model`,element:Q((0,q.jsx)(Qe,{}))},{path:`/search`,element:Q((0,q.jsx)(tt,{}))},{path:`/providers`,element:Q((0,q.jsx)(nt,{}))},{path:`/extensions`,element:Q((0,q.jsx)(rt,{}))},{path:`/channels`,element:Q((0,q.jsx)(it,{}))},{path:`/runtime`,element:Q((0,q.jsx)(at,{}))},{path:`/updates`,element:Q((0,q.jsx)(ot,{}))},{path:`/remote`,element:Q((0,q.jsx)(ut,{}))},{path:`/security`,element:Q((0,q.jsx)(st,{}))},{path:`/privacy`,element:Q((0,q.jsx)(Z,{}))},{path:`/desktop-capabilities`,element:Q((0,q.jsx)(lt,{}))},{path:`/secrets`,element:Q((0,q.jsx)(ct,{}))},{path:`/settings`,element:(0,q.jsx)(Le,{})},{path:`/marketplace/skills`,redirectTo:`/skills`},{path:`/marketplace`,redirectTo:`/skills`},{path:`/marketplace/mcp`,element:Q((0,q.jsx)(dt,{}))},{path:`/`,redirectTo:`/chat`},{path:`*`,redirectTo:`/chat`}];function ht(e){return`redirectTo`in e?(0,q.jsx)(T,{path:e.path,element:(0,q.jsx)(w,{to:e.redirectTo,replace:!0})},e.path):(0,q.jsx)(T,{path:e.path,element:e.element},e.path)}function gt(){return(0,q.jsx)(ae,{children:mt.map(ht)})}function $(){return Ye(p),v(),(0,K.useEffect)(()=>(h.start(),()=>{h.stop()}),[]),(0,q.jsx)(pe,{children:(0,q.jsxs)(A,{children:[(0,q.jsx)(Ee,{}),(0,q.jsx)(oe,{}),(0,q.jsx)(Ie,{children:(0,q.jsx)(gt,{})}),(0,q.jsx)(K.Suspense,{fallback:null,children:(0,q.jsx)(Ze,{})}),(0,q.jsx)(s,{}),(0,q.jsx)(fe,{})]})})}function _t(){let e=f(),t=e.isError&&ee(e.error);return e.isLoading&&!e.isError||t||e.isError?(0,q.jsx)($,{}):e.data?.enabled&&!e.data.authenticated?(0,q.jsx)(we,{username:e.data.username}):(0,q.jsx)($,{})}function vt(){let{theme:e}=a();return(0,K.useEffect)(()=>{d()},[]),(0,K.useEffect)(()=>{l.syncTheme(e)},[e]),(0,q.jsxs)(ne,{client:p,children:[(0,q.jsx)(_t,{}),(0,q.jsx)(u,{}),(0,q.jsx)(te,{position:`top-right`,richColors:!0,offset:{top:window.nextclawDesktop?.platform===`win32`?56:44,right:72},mobileOffset:window.nextclawDesktop?.platform===`win32`?56:void 0,style:Xe})]})}await xe();var yt=window.nextclawDesktop?.platform===`win32`?x:C;(0,Te.createRoot)(document.getElementById(`root`)).render((0,q.jsx)(K.StrictMode,{children:(0,q.jsx)(c,{children:(0,q.jsx)(i,{children:(0,q.jsx)(yt,{children:(0,q.jsx)(vt,{})})})})}));
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/projects-BWM-oEo0.js","assets/chunk-DF37yw5_.js","assets/dist-D9h2cWk3.js","assets/api-CXWxExzS.js","assets/i18n-ByVUrt9w.js","assets/preload-helper-DWTEM3RW.js","assets/createLucideIcon-C3LSyx-e.js","assets/app-presenter-provider-DdD2Q7jZ.js","assets/context-menu-C0qywo73.js","assets/katex-BzT-4KBu.js","assets/search-Dpgv--de.js","assets/external-link-DZzwHRHW.js","assets/inbox-CI8ATevA.js","assets/x-waP-WLuT.js","assets/plus-C42o6xrD.js","assets/context-menu-DEcVZfaU.css","assets/puzzle-DmKVREoh.js","assets/book-open-B3Ac0voD.js","assets/theme-provider-BsJ6HxeX.js","assets/dialog-DMKYZDFu.js","assets/navigation-history-CCnxsAKR.js","assets/download-C2gYe8n1.js","assets/use-viewport-layout-Bnm5W5Qz.js","assets/middleware-B--6mAUM.js","assets/refresh-cw-DOg2pWGu.js","assets/trash-2-BVQs-0ji.js","assets/navigation-link-O9Wm0epj.js","assets/host-capabilities-B107nwS3.js","assets/use-desktop-capabilities-BO_2CXgu.js","assets/status-dot-DlELD18e.js","assets/doc-browser-context-CoVMIiU8.js","assets/tag-chip-DFzDSvcF.js","assets/card-eFBmxYiI.js","assets/confirm-dialog-jz2cQKId.js","assets/provider-models-D8WOdsdu.js","assets/select-BJ-EjmCz.js","assets/use-config-M1L4xn8c.js","assets/app-presenter-provider-D3BuuOyZ.css","assets/circle-dashed-KGwElDWV.js","assets/settings-2-D3-m8a3v.js","assets/model-config-page-CeVvZ29o.js","assets/provider-scoped-model-input-BOPkUOtD.js","assets/form-actions-CZxcWXSm.js","assets/config-hints-CaB3I7KP.js","assets/appearance-settings-page-CSWYLrsR.js","assets/keyboard-shortcuts-settings-page-BCxB9m69.js","assets/search-config-page-DevSv1ZK.js","assets/config-split-page-BaHtm9OW.js","assets/providers-config-page-BilPL0kF.js","assets/extensions-DXDFcRVC.js","assets/channels-list-page-lQOINLW8.js","assets/runtime-config-page-Dx6lWn3_.js","assets/rotate-cw-CWFIat29.js","assets/save-C1G0ZU-G.js","assets/pwa-Cp7pPvsZ.js","assets/desktop-update-config-C_SBtjA1.js","assets/security-config-BGEs0SHi.js","assets/secrets-config-page-B4jWTV6V.js","assets/privacy-settings-page-CHDv9ppI.js","assets/desktop-capabilities-page-CKq2Miye.js","assets/remote-DngM8iep.js","assets/mcp-marketplace-page-ZAm380SB.js"])))=>i.map(i=>d[i]);
2
+ import{i as e}from"./chunk-DF37yw5_.js";import{t}from"./client-BDS360Kz.js";import{E as n,O as r,a as i,n as a,o,r as s,t as c}from"./theme-provider-BsJ6HxeX.js";import{i as l,n as u,t as d}from"./pwa-Cp7pPvsZ.js";import{Ht as f,Jn as p,Lt as m,Vt as ee,Yn as te,an as h,cr as ne,dn as g,qn as _,un as v,ur as re,x as y,xr as ie}from"./api-CXWxExzS.js";import{t as b}from"./preload-helper-DWTEM3RW.js";import{c as ae,i as x,l as S,n as C,o as w,s as T}from"./navigation-link-O9Wm0epj.js";import{B as oe,C as se,J as ce,Jt as E,Lt as le,S as ue,T as de,W as fe,Xt as D,Yt as O,_ as k,a as A,b as j,bt as M,g as N,h as P,i as F,l as I,n as L,nt as R,o as z,p as B,s as V,t as pe,u as H,w as me,x as he,xt as ge,y as _e,z as ve}from"./app-presenter-provider-DdD2Q7jZ.js";import{f as ye}from"./context-menu-C0qywo73.js";import{t as be}from"./agents-CTSR4ZKb.js";import{t as U}from"./use-viewport-layout-Bnm5W5Qz.js";import{i as xe,s as W}from"./i18n-ByVUrt9w.js";import{n as Se,t as Ce}from"./doc-browser-context-CoVMIiU8.js";import{t as we}from"./login-page--Njgbmpm.js";var G=n();if(l.syncTheme(G),r(G)===`island`){let e=document.createElement(`link`);e.rel=`preload`,e.as=`image`,e.href=`/themes/island/island-atmosphere-7a037243.webp`,e.fetchPriority=`high`,document.head.appendChild(e)}var Te=t(),K=e(ie(),1);function Ee(){let e=L();return(0,K.useEffect)(()=>(e.chatCompletionNotificationManager.start(),()=>{e.chatCompletionNotificationManager.stop()}),[e.chatCompletionNotificationManager]),null}var De=`NextClaw`,Oe=[{prefix:`/resource`,key:`resourcePageTitle`},{prefix:`/marketplace/mcp`,key:`marketplaceMcpPageTitle`},{prefix:`/marketplace/skills`,key:`marketplaceSkillsPageTitle`},{prefix:`/marketplace`,key:`marketplace`},{prefix:`/skills`,key:`marketplaceSkillsPageTitle`},{prefix:`/cron`,key:`cronPageTitle`},{prefix:`/agents`,key:`agentsPageTitle`},{prefix:`/projects`,key:`projectsTitle`},{prefix:`/chat`,key:`chat`},{prefix:`/model`,key:`modelPageTitle`},{prefix:`/search`,key:`searchPageTitle`},{prefix:`/providers`,key:`providersPageTitle`},{prefix:`/channels`,key:`channelsPageTitle`},{prefix:`/runtime`,key:`runtimePageTitle`},{prefix:`/updates`,key:`runtimeUpdatesPageTitle`},{prefix:`/remote`,key:`remotePageTitle`},{prefix:`/security`,key:`authSecurityTitle`},{prefix:`/secrets`,key:`secretsPageTitle`}];function ke(e,t){return e===t||e.startsWith(`${t}/`)}function Ae(e){let t=e.toLowerCase();for(let{prefix:e,key:n}of Oe)if(ke(t,e))return W(n);return W(`settings`)}function je(e){let t=e.toLowerCase();return t===`localhost`||t.endsWith(`.localhost`)||t===`::1`||t===`[::1]`||t.startsWith(`127.`)}function Me(e){let t=e?.host.trim(),n=e?.hostname.trim(),r=e?.port.trim();return!t||!n?null:je(n)?r||null:t}function Ne(e,t){let n=Me(t);return`${De}${n?` ${n}`:``} - ${Ae(e)}`}var q=re(),Pe=e=>(0,q.jsx)(N,{uri:e});function Fe({children:e,sideDockManager:t}){let{isOpen:n,mode:r}=Se();ge();let{pathname:i}=S(),{language:a}=o(),{isMobile:s}=U(),c=me(),l=z(e=>e.isVisible);z(e=>e.pinnedItems);let u={getDockState:t.getDockState,pinTab:t.pinTab,unpinTab:t.unpinTab},d=B(),f=e=>d(P(e),`global`);return(0,K.useEffect)(()=>{document.title=Ne(i,window.location)},[i,a]),s&&c!==`win32`?(0,q.jsx)(se,{pathname:i,isDocBrowserOpen:n,docBrowserDockControls:u,docBrowserRenderers:H,docBrowserTabMenuGroups:f,topbarLeadingInset:c===`darwin`?`4.75rem`:void 0,children:e}):(0,q.jsx)(j,{pathname:i,isMobileLayout:s,isDocBrowserOpen:n,docBrowserMode:r,docBrowserDockControls:u,docBrowserRenderers:H,docBrowserTabMenuGroups:f,sideDock:l?(0,q.jsx)(A,{manager:t,getItemMenuGroups:e=>{let t=F().pageResourceManager.resolve(e.target.type===`right-panel-resource`?e.target.uri:e.target.url);return t?d(t):[]}}):null,children:e})}function Ie({children:e}){let t=F();return(0,q.jsx)(Ce,{manager:t.docBrowserManager,children:(0,q.jsx)(ye,{renderIcon:Pe,children:(0,q.jsx)(Fe,{sideDockManager:t.sideDockManager,children:e})})})}function Le(){let{isMobile:e}=U();return e?(0,q.jsx)(ue,{}):(0,q.jsx)(w,{to:`/model`,replace:!0})}var Re=(0,K.lazy)(async()=>({default:(await b(async()=>{let{ProjectsPage:e}=await import(`./projects-BWM-oEo0.js`);return{ProjectsPage:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39]))).ProjectsPage})),J=`max-w-[min(1180px,100%)]`;function ze(e){return e===`projects`?`relative flex flex-1 min-h-0 overflow-hidden bg-background`:`flex-1 min-h-0 overflow-hidden bg-background`}function Be(e){let{routeSessionKey:t,syncRouteSessionSelection:n}=e;(0,K.useLayoutEffect)(()=>{n(t)},[t,n])}function Ve({view:e}){let{onScroll:t,scrollRef:n}=le({restorationKey:e===`cron`||e===`agents`?`main-page:${e}`:null});switch(e){case`resource`:return(0,q.jsx)(I,{});case`projects`:return(0,q.jsx)(K.Suspense,{fallback:(0,q.jsx)(`div`,{className:`h-full animate-pulse bg-card/30`}),children:(0,q.jsx)(Re,{})});case`panel-app`:return(0,q.jsx)(R,{});case`inbox`:return(0,q.jsx)(`div`,{className:`mx-auto flex h-full min-h-0 w-full flex-col md:px-6 md:py-5 ${J}`,children:(0,q.jsx)(ve,{})});case`cron`:case`agents`:return(0,q.jsx)(`div`,{ref:n,onScroll:t,className:`h-full overflow-auto custom-scrollbar`,children:(0,q.jsx)(`div`,{className:`mx-auto w-full px-4 py-4 sm:px-6 sm:py-5 ${J}`,children:e===`cron`?(0,q.jsx)(ce,{}):(0,q.jsx)(be,{})})});default:return(0,q.jsx)(`div`,{className:`mx-auto flex h-full min-h-0 w-full flex-col px-4 py-4 sm:px-6 sm:py-5 ${J}`,children:(0,q.jsx)(M,{forcedType:`skills`})})}}function He({view:e,confirmDialog:t}){let{isMobile:n}=U();return(0,q.jsxs)(`div`,{className:`h-full flex`,children:[n?null:(0,q.jsx)(_e,{}),e===`chat`?n?(0,q.jsx)(he,{}):(0,q.jsx)(fe,{}):(0,q.jsx)(`section`,{"data-theme-surface":`workspace`,className:`${ze(e)} flex flex-col`,children:(0,q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,q.jsx)(Ve,{view:e})})}),t]})}function Ue(){let e=O();(0,K.useEffect)(()=>m.eventBus.on(_.uiShowContent,t=>{e.chatThreadManager.handleUiShowContentEvent(t)}),[e])}function We({view:e}){let t=O(),{pathname:n}=S();return Be({routeSessionKey:D(n.startsWith(`/chat/`)?n.slice(6):void 0),syncRouteSessionSelection:t.chatSessionListManager.syncRouteSessionSelection}),Ue(),(0,q.jsx)(He,{view:e})}function Y({view:e}){return(0,q.jsx)(We,{view:e})}function Ge(e){let t=e.trim().toLowerCase();return t?!t.startsWith(`skills`):!0}function Ke(e,t){t.startsWith(`mcp`)&&(e?.invalidateQueries({queryKey:[`marketplace-mcp-installed`]}),e?.invalidateQueries({queryKey:[`marketplace-mcp-items`]}),e?.invalidateQueries({queryKey:[`marketplace-mcp-doctor`]}))}function qe(e,t){e&&Ge(t)&&e.invalidateQueries({queryKey:[`config`]}),Ke(e,t)}function X(e){let t=e.trim().replace(/\\/g,`/`).replace(/\/+$/g,``);return/^[a-z]:/i.test(t)?t.toLowerCase():t}function Je(e,t){if(!e)return;let n=X(t);e.invalidateQueries({predicate:e=>e.queryKey[0]===`server-path-browse`&&typeof e.queryKey[1]==`string`&&X(e.queryKey[1])===n})}function Ye(e){let t=(0,K.useRef)(!1);(0,K.useEffect)(()=>{let n=m.eventBus.on(_.connectionOpen,()=>{g.handleConnectionRestored(),h.refreshAfterRealtimeReconnect(),t.current&&(t.current=!1,E.getState().clearSessionRunStatuses(),e?.invalidateQueries({queryKey:[`ncp-sessions`]}),e?.invalidateQueries({queryKey:[`ncp-session-pages`]}))}),r=m.eventBus.on(_.connectionClose,()=>{g.handleConnectionInterrupted(null),t.current=!0}),i=m.eventBus.on(_.connectionError,e=>{g.handleConnectionInterrupted(e?.message??null),t.current=!0}),a=m.eventBus.on(_.configUpdated,({path:t})=>{qe(e,t)}),o=m.eventBus.on(_.serverPathChanged,({directoryPath:t})=>Je(e,t)),s=m.eventBus.on(_.runtimeUpdateSnapshot,e=>{h.reportSnapshot(e)}),c=m.eventBus.on(_.sessionRunStatus,t=>{E.getState().setSessionRunStatus(t.sessionKey,t.status),y(e,{type:`session.run-status`,payload:t})}),l=m.eventBus.on(_.sessionSummaryUpsert,t=>{y(e,{type:`session.summary.upsert`,payload:t})}),u=m.eventBus.on(_.sessionSummaryDelete,t=>{E.getState().setSessionRunStatus(t.sessionKey,`idle`),y(e,{type:`session.summary.delete`,payload:t})}),d=m.eventBus.on(_.error,e=>{console.error(`Realtime transport error:`,e.message)});return()=>{n(),r(),i(),a(),o(),s(),c(),l(),u(),d()}},[e])}var Xe={"--width":`320px`},Ze=(0,K.lazy)(async()=>({default:(await V()).AccountPanel})),Qe=(0,K.lazy)(async()=>({default:(await b(async()=>{let{ModelConfigPage:e}=await import(`./model-config-page-CeVvZ29o.js`);return{ModelConfigPage:e}},__vite__mapDeps([40,1,3,4,5,17,6,41,2,34,8,9,10,11,12,13,14,15,35,26,27,30,23,20,42,36,43]))).ModelConfigPage})),$e=(0,K.lazy)(async()=>({default:(await b(async()=>{let{AppearanceSettingsPage:e}=await import(`./appearance-settings-page-CSWYLrsR.js`);return{AppearanceSettingsPage:e}},__vite__mapDeps([44,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37]))).AppearanceSettingsPage})),et=(0,K.lazy)(async()=>({default:(await b(async()=>{let{KeyboardShortcutsSettingsPage:e}=await import(`./keyboard-shortcuts-settings-page-BCxB9m69.js`);return{KeyboardShortcutsSettingsPage:e}},__vite__mapDeps([45,7,1,5,2,3,4,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37]))).KeyboardShortcutsSettingsPage})),tt=(0,K.lazy)(async()=>({default:(await b(async()=>{let{SearchConfigPage:e}=await import(`./search-config-page-DevSv1ZK.js`);return{SearchConfigPage:e}},__vite__mapDeps([46,1,3,4,5,10,6,22,23,26,11,27,47,42,35,2,36]))).SearchConfigPage})),nt=(0,K.lazy)(async()=>({default:(await b(async()=>{let{ProvidersConfigPage:e}=await import(`./providers-config-page-BilPL0kF.js`);return{ProvidersConfigPage:e}},__vite__mapDeps([48,1,2,3,4,5,6,8,9,10,11,12,13,14,15,22,23,24,39,25,29,47,42,33,19,34,35,36,43,27]))).ProvidersConfigPage})),rt=(0,K.lazy)(async()=>({default:(await b(async()=>{let{ExtensionsConfigPage:e}=await import(`./extensions-DXDFcRVC.js`);return{ExtensionsConfigPage:e}},__vite__mapDeps([49,3,1,4,5,16,6,12,24]))).ExtensionsConfigPage})),it=(0,K.lazy)(async()=>({default:(await b(async()=>{let{ChannelsList:e}=await import(`./channels-list-page-lQOINLW8.js`);return{ChannelsList:e}},__vite__mapDeps([50,1,2,3,4,5,6,10,17,11,13,22,23,26,27,29,47,31,42,35,36,43]))).ChannelsList})),at=(0,K.lazy)(async()=>({default:(await b(async()=>{let{RuntimeConfig:e}=await import(`./runtime-config-page-Dx6lWn3_.js`);return{RuntimeConfig:e}},__vite__mapDeps([51,1,7,5,2,3,4,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,52,53,54,42]))).RuntimeConfig})),ot=(0,K.lazy)(async()=>({default:(await b(async()=>{let{DesktopUpdateConfig:e}=await import(`./desktop-update-config-C_SBtjA1.js`);return{DesktopUpdateConfig:e}},__vite__mapDeps([55,3,1,4,5,21,6,24,52,26,11,27,32,35,2]))).DesktopUpdateConfig})),st=(0,K.lazy)(async()=>({default:(await b(async()=>{let{SecurityConfig:e}=await import(`./security-config-BGEs0SHi.js`);return{SecurityConfig:e}},__vite__mapDeps([56,3,1,4,5]))).SecurityConfig})),ct=(0,K.lazy)(async()=>({default:(await b(async()=>{let{SecretsConfigPage:e}=await import(`./secrets-config-page-B4jWTV6V.js`);return{SecretsConfigPage:e}},__vite__mapDeps([57,1,3,4,5,14,6,53,25,42,35,2,36]))).SecretsConfigPage})),Z=(0,K.lazy)(async()=>({default:(await b(async()=>{let{PrivacySettingsPage:e}=await import(`./privacy-settings-page-CHDv9ppI.js`);return{PrivacySettingsPage:e}},__vite__mapDeps([58,3,1,4,5,35,2,6,36]))).PrivacySettingsPage})),lt=(0,K.lazy)(async()=>({default:(await b(async()=>{let{DesktopCapabilitiesPage:e}=await import(`./desktop-capabilities-page-CKq2Miye.js`);return{DesktopCapabilitiesPage:e}},__vite__mapDeps([59,3,1,4,5,28]))).DesktopCapabilitiesPage})),ut=(0,K.lazy)(async()=>({default:(await b(async()=>{let{RemoteAccessPage:e}=await import(`./remote-DngM8iep.js`);return{RemoteAccessPage:e}},__vite__mapDeps([60,7,1,5,2,3,4,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37]))).RemoteAccessPage})),dt=(0,K.lazy)(async()=>({default:(await b(async()=>{let{McpMarketplacePage:e}=await import(`./mcp-marketplace-page-ZAm380SB.js`);return{McpMarketplacePage:e}},__vite__mapDeps([61,7,1,5,2,3,4,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37]))).McpMarketplacePage}));function ft(){return(0,q.jsx)(`div`,{className:`h-full w-full animate-pulse rounded-2xl border border-border/40 bg-card/40`})}function pt({children:e}){return(0,q.jsx)(K.Suspense,{fallback:(0,q.jsx)(ft,{}),children:e})}function Q(e){return(0,q.jsx)(pt,{children:e})}var mt=[{path:`/resource`,element:Q((0,q.jsx)(Y,{view:`resource`}))},{path:`/projects/:projectId/:tab`,element:Q((0,q.jsx)(Y,{view:`projects`}))},{path:`/projects`,element:Q((0,q.jsx)(Y,{view:`projects`}))},{path:`/chat/skills`,redirectTo:`/skills`},{path:`/chat/cron`,redirectTo:`/cron`},{path:`/chat/agents`,redirectTo:`/agents`},{path:`/chat/:sessionId?`,element:Q((0,q.jsx)(Y,{view:`chat`}))},{path:`/agents`,element:Q((0,q.jsx)(Y,{view:`agents`}))},{path:`/skills`,element:Q((0,q.jsx)(Y,{view:`skills`}))},{path:`/skills/scenes/:scene`,element:Q((0,q.jsx)(Y,{view:`skills`}))},{path:`/cron`,element:Q((0,q.jsx)(Y,{view:`cron`}))},{path:`/inbox/:deliveryId?`,element:Q((0,q.jsx)(Y,{view:`inbox`}))},{path:`/apps/panel/:appId`,element:Q((0,q.jsx)(Y,{view:`panel-app`}))},{path:`/appearance`,element:Q((0,q.jsx)($e,{}))},{path:`/keyboard-shortcuts`,element:Q((0,q.jsx)(et,{}))},{path:`/model`,element:Q((0,q.jsx)(Qe,{}))},{path:`/search`,element:Q((0,q.jsx)(tt,{}))},{path:`/providers`,element:Q((0,q.jsx)(nt,{}))},{path:`/extensions`,element:Q((0,q.jsx)(rt,{}))},{path:`/channels`,element:Q((0,q.jsx)(it,{}))},{path:`/runtime`,element:Q((0,q.jsx)(at,{}))},{path:`/updates`,element:Q((0,q.jsx)(ot,{}))},{path:`/remote`,element:Q((0,q.jsx)(ut,{}))},{path:`/security`,element:Q((0,q.jsx)(st,{}))},{path:`/privacy`,element:Q((0,q.jsx)(Z,{}))},{path:`/desktop-capabilities`,element:Q((0,q.jsx)(lt,{}))},{path:`/secrets`,element:Q((0,q.jsx)(ct,{}))},{path:`/settings`,element:(0,q.jsx)(Le,{})},{path:`/marketplace/skills`,redirectTo:`/skills`},{path:`/marketplace`,redirectTo:`/skills`},{path:`/marketplace/mcp`,element:Q((0,q.jsx)(dt,{}))},{path:`/`,redirectTo:`/chat`},{path:`*`,redirectTo:`/chat`}];function ht(e){return`redirectTo`in e?(0,q.jsx)(T,{path:e.path,element:(0,q.jsx)(w,{to:e.redirectTo,replace:!0})},e.path):(0,q.jsx)(T,{path:e.path,element:e.element},e.path)}function gt(){return(0,q.jsx)(ae,{children:mt.map(ht)})}function $(){return Ye(p),v(),(0,K.useEffect)(()=>(h.start(),()=>{h.stop()}),[]),(0,q.jsx)(pe,{children:(0,q.jsxs)(k,{children:[(0,q.jsx)(Ee,{}),(0,q.jsx)(oe,{}),(0,q.jsx)(Ie,{children:(0,q.jsx)(gt,{})}),(0,q.jsx)(K.Suspense,{fallback:null,children:(0,q.jsx)(Ze,{})}),(0,q.jsx)(s,{}),(0,q.jsx)(de,{})]})})}function _t(){let e=f(),t=e.isError&&ee(e.error);return e.isLoading&&!e.isError||t||e.isError?(0,q.jsx)($,{}):e.data?.enabled&&!e.data.authenticated?(0,q.jsx)(we,{username:e.data.username}):(0,q.jsx)($,{})}function vt(){let{theme:e}=a();return(0,K.useEffect)(()=>{d()},[]),(0,K.useEffect)(()=>{l.syncTheme(e)},[e]),(0,q.jsxs)(ne,{client:p,children:[(0,q.jsx)(_t,{}),(0,q.jsx)(u,{}),(0,q.jsx)(te,{position:`top-right`,richColors:!0,offset:{top:window.nextclawDesktop?.platform===`win32`?56:44,right:72},mobileOffset:window.nextclawDesktop?.platform===`win32`?56:void 0,style:Xe})]})}await xe();var yt=window.nextclawDesktop?.platform===`win32`?x:C;(0,Te.createRoot)(document.getElementById(`root`)).render((0,q.jsx)(K.StrictMode,{children:(0,q.jsx)(c,{children:(0,q.jsx)(i,{children:(0,q.jsx)(yt,{children:(0,q.jsx)(vt,{})})})})}));