libre-webui 0.42.0 → 0.43.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.
- package/README.md +1 -0
- package/backend/dist/db.d.ts.map +1 -1
- package/backend/dist/db.js +12 -1
- package/backend/dist/db.js.map +1 -1
- package/backend/dist/services/agentCliService.d.ts +22 -1
- package/backend/dist/services/agentCliService.d.ts.map +1 -1
- package/backend/dist/services/agentCliService.js +110 -3
- package/backend/dist/services/agentCliService.js.map +1 -1
- package/backend/dist/services/agentCliUsage.d.ts +3 -2
- package/backend/dist/services/agentCliUsage.d.ts.map +1 -1
- package/backend/dist/services/agentCliUsage.js +19 -1
- package/backend/dist/services/agentCliUsage.js.map +1 -1
- package/backend/dist/services/workAgentAccessService.js +1 -1
- package/backend/dist/services/workAgentCatalog.d.ts +15 -3
- package/backend/dist/services/workAgentCatalog.d.ts.map +1 -1
- package/backend/dist/services/workAgentCatalog.js +28 -0
- package/backend/dist/services/workAgentCatalog.js.map +1 -1
- package/backend/dist/services/workAgentCliRunner.d.ts +1 -0
- package/backend/dist/services/workAgentCliRunner.d.ts.map +1 -1
- package/backend/dist/services/workAgentCliRunner.js +31 -1
- package/backend/dist/services/workAgentCliRunner.js.map +1 -1
- package/backend/dist/services/workAgentHostLogins.d.ts +37 -0
- package/backend/dist/services/workAgentHostLogins.d.ts.map +1 -1
- package/backend/dist/services/workAgentHostLogins.js +190 -0
- package/backend/dist/services/workAgentHostLogins.js.map +1 -1
- package/backend/dist/services/workAgentService.d.ts +2 -0
- package/backend/dist/services/workAgentService.d.ts.map +1 -1
- package/backend/dist/services/workAgentService.js +10 -2
- package/backend/dist/services/workAgentService.js.map +1 -1
- package/backend/dist/services/workAgentStream.d.ts +4 -0
- package/backend/dist/services/workAgentStream.d.ts.map +1 -1
- package/backend/dist/services/workAgentStream.js +80 -0
- package/backend/dist/services/workAgentStream.js.map +1 -1
- package/backend/dist/services/workAgentToolchainService.d.ts.map +1 -1
- package/backend/dist/services/workAgentToolchainService.js +22 -5
- package/backend/dist/services/workAgentToolchainService.js.map +1 -1
- package/backend/dist/services/workEgressRelay.d.ts.map +1 -1
- package/backend/dist/services/workEgressRelay.js +19 -4
- package/backend/dist/services/workEgressRelay.js.map +1 -1
- package/backend/dist/services/workRuntimeService.d.ts.map +1 -1
- package/backend/dist/services/workRuntimeService.js +26 -8
- package/backend/dist/services/workRuntimeService.js.map +1 -1
- package/backend/dist/types/work.d.ts +2 -2
- package/backend/dist/types/work.d.ts.map +1 -1
- package/backend/dist/utils/pluginChatAdapter.d.ts.map +1 -1
- package/backend/dist/utils/pluginChatAdapter.js +2 -1
- package/backend/dist/utils/pluginChatAdapter.js.map +1 -1
- package/backend/dist/utils/pluginDefinitionTrust.d.ts.map +1 -1
- package/backend/dist/utils/pluginDefinitionTrust.js +1 -0
- package/backend/dist/utils/pluginDefinitionTrust.js.map +1 -1
- package/backend/package.json +1 -1
- package/frontend/dist/artifact-runtime/.build-fingerprint +1 -1
- package/frontend/dist/artifact-runtime/babel.js +15 -15
- package/frontend/dist/artifact-runtime/chart.js +2 -2
- package/frontend/dist/artifact-runtime/d3.js +2 -2
- package/frontend/dist/artifact-runtime/framer-motion.js +5 -5
- package/frontend/dist/artifact-runtime/lodash.js +2 -2
- package/frontend/dist/artifact-runtime/lucide-react.js +1 -1
- package/frontend/dist/artifact-runtime/mathjs.js +4 -4
- package/frontend/dist/artifact-runtime/mermaid.js +360 -360
- package/frontend/dist/artifact-runtime/papaparse.js +1 -1
- package/frontend/dist/artifact-runtime/plotly.js +146 -20
- package/frontend/dist/artifact-runtime/react.js +2 -2
- package/frontend/dist/artifact-runtime/recharts.js +8 -8
- package/frontend/dist/artifact-runtime/tailwind.js +1 -1
- package/frontend/dist/artifact-runtime/three.js +2 -2
- package/frontend/dist/artifact-runtime/tone.js +3 -3
- package/frontend/dist/assets/index-BnbO3eTY.js +83 -0
- package/frontend/dist/index.html +33 -33
- package/frontend/dist/js/{ArtifactContainer-D5wijGHA.js → ArtifactContainer-C0R4kYVM.js} +1 -1
- package/frontend/dist/js/{ArtifactDemoPage-DwQzUFI-.js → ArtifactDemoPage-BQmbCyat.js} +1 -1
- package/frontend/dist/js/{ArtifactSandboxFrame-CQCAALvW.js → ArtifactSandboxFrame-CkDkrHpg.js} +1 -1
- package/frontend/dist/js/{ArtifactSlideOutPanel-Cn6Rp7Yx.js → ArtifactSlideOutPanel-DZnVzC0c.js} +1 -1
- package/frontend/dist/js/{AutomationModal-mgkoNA-S.js → AutomationModal-Cx1e_4df.js} +1 -1
- package/frontend/dist/js/AutomationsPage-D7UtYZ_0.js +1 -0
- package/frontend/dist/js/{AvatarUpload-BFU2a_eT.js → AvatarUpload-DGRQC20B.js} +1 -1
- package/frontend/dist/js/{Button-D_msp6KT.js → Button-DwZ26Lqc.js} +1 -1
- package/frontend/dist/js/{CalendarPage-DT6_t4fJ.js → CalendarPage-WmA1i7MQ.js} +1 -1
- package/frontend/dist/js/ChannelsPage-Bq4JQPR_.js +1 -0
- package/frontend/dist/js/ChatPage-Cd3fxx-N.js +14 -0
- package/frontend/dist/js/ConnectModels-BYul-veF.js +1 -0
- package/frontend/dist/js/EvaluationsPage-CV_Terzn.js +2 -0
- package/frontend/dist/js/FirstTimeSetup-CFhGy9a8.js +1 -0
- package/frontend/dist/js/GalleryPage-BRKZyq1w.js +1 -0
- package/frontend/dist/js/{HomePage-CXG83Qjk.js → HomePage-DdpnBu-Z.js} +1 -1
- package/frontend/dist/js/{LanguageSwitcher-DK5aMjVJ.js → LanguageSwitcher-CASJ8p5d.js} +1 -1
- package/frontend/dist/js/{Logo--9H7Lqkg.js → Logo-C-qwuy58.js} +1 -1
- package/frontend/dist/js/{LogoMark-DNzLawJz.js → LogoMark-zP-mitdI.js} +1 -1
- package/frontend/dist/js/{ModelManagerModals-MjJMyvPJ.js → ModelManagerModals-BYhFWv22.js} +1 -1
- package/frontend/dist/js/NotesPage-CmvVoWcH.js +3 -0
- package/frontend/dist/js/{OptimizedSyntaxHighlighter-Cruo0gJb.js → OptimizedSyntaxHighlighter-B8vbflQA.js} +1 -1
- package/frontend/dist/js/{OptimizedSyntaxHighlighter-BCkQOsIb.js → OptimizedSyntaxHighlighter-DoJF0j0l.js} +1 -1
- package/frontend/dist/js/{PasswordStrengthMeter-CEmuISNU.js → PasswordStrengthMeter-Dow8ZeTs.js} +1 -1
- package/frontend/dist/js/PersonasPage-BYKtoKWl.js +13 -0
- package/frontend/dist/js/PluginUsagePage-BVTOCxoE.js +1 -0
- package/frontend/dist/js/{RichMessageContent-CQY0R6rI.js → RichMessageContent-Bwpg3rfV.js} +3 -3
- package/frontend/dist/js/{RichMessageContent-B1TrzEbs.js → RichMessageContent-DJTLGpws.js} +1 -1
- package/frontend/dist/js/SettingsModal-CGyVfxOz.js +19 -0
- package/frontend/dist/js/{SettingsToggle-CjckNl8v.js → SettingsToggle-BpD6NSri.js} +1 -1
- package/frontend/dist/js/{ShareDialog-DiXoIWJx.js → ShareDialog-DYwyeyaI.js} +1 -1
- package/frontend/dist/js/{StrandsPage-BQ-PMkvY.js → StrandsPage-CvXeYOYR.js} +1 -1
- package/frontend/dist/js/SystemPage-B4qFsAsb.js +1 -0
- package/frontend/dist/js/{TurnstileWidget-J61wYyqA.js → TurnstileWidget-xx9lQV0b.js} +1 -1
- package/frontend/dist/js/UserManagementPage-DhMRuhqj.js +1 -0
- package/frontend/dist/js/UserManagementPanel-BVLSvRwa.js +1 -0
- package/frontend/dist/js/{WhatsNewModal-DcAyhGzi.js → WhatsNewModal-DfR7W93-.js} +1 -1
- package/frontend/dist/js/WorkPage-DSKBQEW0.js +7 -0
- package/frontend/dist/js/api-C5ps_CWQ.js +1 -0
- package/frontend/dist/js/{api-D3RzHftc.js → api-D6IF0v9_.js} +1 -1
- package/frontend/dist/js/{appNavigation-Df-xsLY5.js → appNavigation-BifMRN3D.js} +1 -1
- package/frontend/dist/js/{appStore-qi0l_wou.js → appStore-B6pAGo3p.js} +2 -2
- package/frontend/dist/js/appVersion-9UMn7b1T.js +1 -0
- package/frontend/dist/js/authStore-CDo5Co2D.js +1 -0
- package/frontend/dist/js/{authStore-BhwtFhS3.js → authStore-DdIb6km_.js} +3 -3
- package/frontend/dist/js/babel-BaOs8qJH.js +16 -0
- package/frontend/dist/js/{chatStore-mB6kXQVu.js → chatStore-hzQyRM9H.js} +3 -3
- package/frontend/dist/js/{client-tVKsnAVI.js → client-D_F_0LqX.js} +2 -2
- package/frontend/dist/js/{config-bhyjjacC.js → config-CHUQTU6j.js} +1 -1
- package/frontend/dist/js/{estree-BmKwYjuD.js → estree-Cw-tQG5d.js} +1 -1
- package/frontend/dist/js/{evaluationsApi-DxuXU4NS.js → evaluationsApi-C0FKNJua.js} +1 -1
- package/frontend/dist/js/{markdown-D-PuDeiZ.js → markdown-C7cnJl_Q.js} +5 -5
- package/frontend/dist/js/{markdown-core-D-4xNKNv.js → markdown-core-CGWDtd6X.js} +5 -5
- package/frontend/dist/js/{markdown-html-Cd75Y-85.js → markdown-html-BdYVneHE.js} +1 -1
- package/frontend/dist/js/{markdown-math-DUQvxNgB.js → markdown-math-BzLEmswF.js} +1 -1
- package/frontend/dist/js/{markdownHtml-mmK-QYY6.js → markdownHtml-B1Ll_Qgp.js} +1 -1
- package/frontend/dist/js/markdownMath-aI8uDQmz.js +1 -0
- package/frontend/dist/js/{messageCodeStyles-nVE1JYdR.js → messageCodeStyles-DVYyK8wm.js} +2 -2
- package/frontend/dist/js/{postcss-CU3LgMVN.js → postcss-DB_e0nkW.js} +1 -1
- package/frontend/dist/js/{react-vendor-GLIQTwVZ.js → react-vendor-C1iE8mnY.js} +2 -2
- package/frontend/dist/js/rfb-IV07oQgM.js +5 -0
- package/frontend/dist/js/rolldown-runtime-XKyaHtl9.js +1 -0
- package/frontend/dist/js/router-vendor-qltZAWoz.js +1 -0
- package/frontend/dist/js/{strandsApi-C04kQWMg.js → strandsApi-CeJLezXW.js} +1 -1
- package/frontend/dist/js/{syntax-highlight-BlVvro-Z.js → syntax-highlight-CemL-n1v.js} +2 -2
- package/frontend/dist/js/{teamEventStream-Cf62joPP.js → teamEventStream-DOMyufrH.js} +1 -1
- package/frontend/dist/js/{typescript-C28ytPnl.js → typescript-2anSzo_N.js} +2 -2
- package/frontend/dist/js/ui-D4Ytvr6d.js +2 -0
- package/frontend/dist/js/ui-vendor-BTcw5yZ6.js +1 -0
- package/frontend/dist/js/{useChat-BWWunIVw.js → useChat-BEbNywiP.js} +4 -4
- package/frontend/dist/js/{useDialogFocus-Dfa5Utj4.js → useDialogFocus-DpTun-ZV.js} +1 -1
- package/frontend/dist/js/useDictation-jTaorrHm.js +1 -0
- package/frontend/dist/js/useQuery-2_pQiHbl.js +1 -0
- package/frontend/dist/js/{useTranslation-B69j_cNd.js → useTranslation-D9EScZXH.js} +1 -1
- package/frontend/dist/js/utils-BvvV-Cka.js +1 -0
- package/frontend/dist/js/{utils-vendor-DWQLsiSj.js → utils-vendor-CsC5rH1J.js} +1 -1
- package/frontend/dist/js/workAnnouncements--WBYN99v.js +1 -0
- package/frontend/dist/js/workApi-CGvfDTRY.js +1 -0
- package/frontend/dist/js/{workApi-CMbUePsX.js → workApi-_0oxRyak.js} +1 -1
- package/frontend/dist/js/xterm-BMsy1fDS.js +16 -0
- package/frontend/dist/js/{yaml-uvx2gM_u.js → yaml-Breo7DWT.js} +1 -1
- package/package.json +4 -4
- package/plugins/meta.json +77 -0
- package/frontend/dist/assets/index-BvQepfeH.js +0 -53
- package/frontend/dist/js/AutomationsPage-CsaCHmN_.js +0 -1
- package/frontend/dist/js/ChannelsPage-DXD6PlTg.js +0 -1
- package/frontend/dist/js/ChatPage-C7NQy4ts.js +0 -14
- package/frontend/dist/js/ConnectModels-De18RKwJ.js +0 -1
- package/frontend/dist/js/EvaluationsPage-BCVJse6N.js +0 -2
- package/frontend/dist/js/FirstTimeSetup-M3iWWKTn.js +0 -1
- package/frontend/dist/js/GalleryPage-C-F45c09.js +0 -1
- package/frontend/dist/js/NotesPage-Dd2N_7zQ.js +0 -3
- package/frontend/dist/js/PersonasPage-DONF1JmU.js +0 -13
- package/frontend/dist/js/PluginUsagePage-Bu4pTUjq.js +0 -1
- package/frontend/dist/js/SettingsModal-Dabi8xVs.js +0 -19
- package/frontend/dist/js/SystemPage-CCCL2ByV.js +0 -1
- package/frontend/dist/js/UserManagementPage-H_uXYSnx.js +0 -1
- package/frontend/dist/js/UserManagementPanel-B2cJLYCP.js +0 -1
- package/frontend/dist/js/WorkPage-B1Rt99I9.js +0 -7
- package/frontend/dist/js/api-BU9PuoZz.js +0 -1
- package/frontend/dist/js/appVersion-CVfieEPW.js +0 -1
- package/frontend/dist/js/authStore-dszH-1C-.js +0 -1
- package/frontend/dist/js/babel-Dxd799BX.js +0 -16
- package/frontend/dist/js/markdownMath-Cf7jtPFB.js +0 -1
- package/frontend/dist/js/rfb-CtGtw_KV.js +0 -5
- package/frontend/dist/js/rolldown-runtime-hePW80VL.js +0 -1
- package/frontend/dist/js/router-vendor-BHaThOyH.js +0 -1
- package/frontend/dist/js/ui-DF-BqCU3.js +0 -2
- package/frontend/dist/js/ui-vendor--a64oKSu.js +0 -1
- package/frontend/dist/js/useDictation-Dxq5DG5V.js +0 -1
- package/frontend/dist/js/useQuery-Cv6hRATl.js +0 -1
- package/frontend/dist/js/utils-BCv-T6HP.js +0 -1
- package/frontend/dist/js/workAnnouncements-C2Cd6YCk.js +0 -1
- package/frontend/dist/js/workApi-CsmIQW0M.js +0 -1
- package/frontend/dist/js/xterm-CerOhKYV.js +0 -16
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["js/OptimizedSyntaxHighlighter-DoJF0j0l.js","js/OptimizedSyntaxHighlighter-B8vbflQA.js","js/rolldown-runtime-XKyaHtl9.js","js/react-vendor-C1iE8mnY.js","js/syntax-highlight-CemL-n1v.js","js/markdown-core-CGWDtd6X.js","js/RichMessageContent-DJTLGpws.js","js/RichMessageContent-Bwpg3rfV.js","js/utils-BvvV-Cka.js","js/utils-vendor-CsC5rH1J.js","js/logger-rEW7uQ8m.js","js/appStore-B6pAGo3p.js","js/messageCodeStyles-DVYyK8wm.js","js/useTranslation-D9EScZXH.js","js/ui-vendor-BTcw5yZ6.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,r as n,t as r}from"./react-vendor-C1iE8mnY.js";import{t as i}from"./utils-BvvV-Cka.js";import{t as a}from"./useTranslation-D9EScZXH.js";import{o}from"./logger-rEW7uQ8m.js";import{t as s}from"./appStore-B6pAGo3p.js";import{n as c,qn as l,zt as u}from"./ui-vendor-BTcw5yZ6.js";import{t as d}from"./Button-DwZ26Lqc.js";import{t as f}from"./useDialogFocus-DpTun-ZV.js";import{a as p,c as m,i as h,n as g,o as _,r as v,t as y}from"./messageCodeStyles-DVYyK8wm.js";var b=e(t(),1),x=n(),S=r(),C=`w-full rounded-lg border border-line bg-surface-raised px-2.5 py-1.5 text-[13px] text-ink placeholder:text-ink-muted transition-[border-color,box-shadow] duration-150 focus:border-primary-500 focus:outline-hidden focus:ring-2 focus:ring-primary-500/30 dark:focus:border-primary-400 dark:focus:ring-primary-400/30`,w=`mb-1 block text-[11px] font-medium uppercase tracking-wide text-ink-muted rtl:normal-case rtl:tracking-normal`,T=({titleId:e,title:t,subtitle:n,onClose:r,children:a,footer:o,widthClassName:s=`max-w-lg`,testId:c})=>{let l=(0,b.useRef)(null),u=(0,b.useRef)(!1);return f(l,{onClose:r}),(0,x.createPortal)((0,S.jsx)(`div`,{className:`fixed inset-0 z-2147483647 flex items-center justify-center bg-gray-950/55 p-4 backdrop-blur-md`,onMouseDown:e=>{u.current=e.target===e.currentTarget},onClick:e=>{u.current&&e.target===e.currentTarget&&r(),u.current=!1},children:(0,S.jsx)(`div`,{ref:l,tabIndex:-1,role:`dialog`,"aria-modal":`true`,"aria-labelledby":e,"data-testid":c,className:i(`flex max-h-[90vh] w-full flex-col overflow-hidden rounded-3xl border border-black/[0.07] bg-white shadow-[0_24px_80px_rgba(0,0,0,0.24)] animate-scale-in dark:border-white/8 dark:bg-dark-25`,s),onClick:e=>e.stopPropagation(),children:(0,S.jsxs)(`div`,{"data-testid":`modal-scroll-region`,className:`min-h-0 overflow-y-auto p-6 scrollbar-thin`,children:[(0,S.jsx)(E,{titleId:e,title:t,subtitle:n,onClose:r}),a&&(0,S.jsx)(`div`,{className:`space-y-4`,children:a}),o&&(0,S.jsx)(`div`,{className:`mt-5 flex justify-end gap-3 border-t border-line pt-4`,children:o})]})})}),document.body)},E=({titleId:e,title:t,subtitle:n,onClose:r})=>{let{t:i}=a();return(0,S.jsxs)(`div`,{className:`mb-4 flex items-start justify-between gap-4`,children:[(0,S.jsxs)(`div`,{className:`min-w-0`,children:[(0,S.jsx)(`h3`,{id:e,className:`text-lg font-medium tracking-[-0.02em] text-ink`,children:t}),n&&(0,S.jsx)(`p`,{className:`mt-1 text-[12px] leading-5 text-ink-muted`,children:n})]}),(0,S.jsx)(`button`,{type:`button`,onClick:r,"aria-label":i(`common.close`),className:`shrink-0 rounded-xl p-2 transition-colors text-ink-muted hover:bg-interactive-hover hover:text-ink focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-500`,children:(0,S.jsx)(c,{size:20})})]})},D=({label:e,error:t,helper:n,className:r,id:a,...o})=>{let s=(0,b.useId)(),c=a||`input-${s}`,l=`${c}-feedback`,u=[o[`aria-describedby`],(t||n)&&l].filter(Boolean).join(` `)||void 0;return(0,S.jsxs)(`div`,{className:`space-y-1.5`,children:[e&&(0,S.jsx)(`label`,{htmlFor:c,className:`block text-sm font-medium tracking-[-0.005em] text-ink-muted`,children:e}),(0,S.jsx)(`input`,{id:c,className:i(`block w-full rounded-xl border border-line bg-surface-raised px-3.5 py-2.5 text-base text-ink shadow-none`,`placeholder:text-ink-muted transition-[background-color,border-color,box-shadow,color] duration-150 ease-out`,`focus:border-primary-500 focus:outline-hidden focus:ring-2 focus:ring-primary-500/30 focus-visible:outline-hidden dark:focus:border-primary-400 dark:focus:ring-primary-400/30`,`disabled:cursor-not-allowed disabled:bg-surface-subtle disabled:text-ink-subtle disabled:opacity-70`,t&&`border-error-500 focus:border-error-500 focus:ring-error-500/20`,r),...o,"aria-invalid":t?!0:o[`aria-invalid`],"aria-describedby":u}),t&&(0,S.jsx)(`p`,{id:l,role:`alert`,className:`text-xs leading-relaxed text-error-600 dark:text-error-400`,children:t}),n&&!t&&(0,S.jsx)(`p`,{id:l,className:`text-xs leading-relaxed text-ink-muted`,children:n})]})},O=b.forwardRef(({label:e,error:t,helper:n,className:r,id:a,...o},s)=>{let c=(0,b.useId)(),l=a||`textarea-${c}`,u=`${l}-feedback`,d=[o[`aria-describedby`],(t||n)&&u].filter(Boolean).join(` `)||void 0;return(0,S.jsxs)(`div`,{className:`space-y-1.5`,children:[e&&(0,S.jsx)(`label`,{htmlFor:l,className:`block text-sm font-medium tracking-[-0.005em] text-ink-muted`,children:e}),(0,S.jsx)(`textarea`,{ref:s,id:l,className:i(`block w-full resize-none rounded-xl border border-line bg-surface-raised px-3.5 py-2.5 text-base text-ink shadow-none`,`placeholder:text-ink-muted transition-[background-color,border-color,box-shadow,color] duration-150 ease-out`,`focus:border-primary-500 focus:outline-hidden focus:ring-2 focus:ring-primary-500/30 focus-visible:outline-hidden dark:focus:border-primary-400 dark:focus:ring-primary-400/30`,`disabled:cursor-not-allowed disabled:bg-surface-subtle disabled:text-ink-subtle disabled:opacity-70`,t&&`border-error-500 focus:border-error-500 focus:ring-error-500/20`,r),...o,"aria-invalid":t?!0:o[`aria-invalid`],"aria-describedby":d}),t&&(0,S.jsx)(`p`,{id:u,role:`alert`,className:`text-xs leading-relaxed text-error-600 dark:text-error-400`,children:t}),n&&!t&&(0,S.jsx)(`p`,{id:u,className:`text-xs leading-relaxed text-ink-muted`,children:n})]})});O.displayName=`Textarea`;var k=({label:e,error:t,helper:n,options:r,className:a,id:o,...s})=>{let c=(0,b.useId)(),l=o||`select-${c}`,u=`${l}-feedback`,d=[s[`aria-describedby`],(t||n)&&u].filter(Boolean).join(` `)||void 0;return(0,S.jsxs)(`div`,{className:`space-y-1.5`,children:[e&&(0,S.jsx)(`label`,{htmlFor:l,className:`block text-sm font-medium tracking-[-0.005em] text-ink-muted`,children:e}),(0,S.jsx)(`select`,{id:l,className:i(`block w-full rounded-xl border border-line bg-surface-raised px-3.5 py-2.5 text-base text-ink shadow-none`,`transition-[background-color,border-color,box-shadow,color] duration-150 ease-out`,`focus:border-primary-500 focus:outline-hidden focus:ring-2 focus:ring-primary-500/30 focus-visible:outline-hidden dark:focus:border-primary-400 dark:focus:ring-primary-400/30`,`disabled:cursor-not-allowed disabled:bg-surface-subtle disabled:text-ink-subtle disabled:opacity-70`,t&&`border-error-500 focus:border-error-500 focus:ring-error-500/20`,a),...s,"aria-invalid":t?!0:s[`aria-invalid`],"aria-describedby":d,children:r.map((e,t)=>(0,S.jsx)(`option`,{value:e.value,children:e.label},e.key??`${e.value}-${t}`))}),t&&(0,S.jsx)(`p`,{id:u,role:`alert`,className:`text-xs leading-relaxed text-error-600 dark:text-error-400`,children:t}),n&&!t&&(0,S.jsx)(`p`,{id:u,className:`text-xs leading-relaxed text-ink-muted`,children:n})]})},A=({className:e,...t})=>(0,S.jsx)(u,{...t,"aria-hidden":`true`,className:i(`h-3.5 w-3.5 shrink-0 animate-spin text-ink-subtle motion-reduce:animate-none`,e)}),j=b.lazy(()=>o(()=>import(`./OptimizedSyntaxHighlighter-DoJF0j0l.js`),__vite__mapDeps([0,1,2,3,4,5]))),M=8e4;function N({content:e}){return e?(0,S.jsx)(`div`,{dir:`auto`,className:`whitespace-pre-wrap wrap-break-word leading-relaxed`,children:e}):null}function P({content:e,language:t,complete:n}){let r=n?e.replace(/\r?\n$/,``):e,i=s(e=>e.theme.mode!==`light`),a=b.useRef(null),o=b.useRef(!0),c=b.useDeferredValue(r),l=r.length<=M,u=b.useCallback(e=>{a.current=e,e&&o.current&&(e.scrollTop=e.scrollHeight)},[]);b.useLayoutEffect(()=>{let e=a.current;e&&o.current&&(e.scrollTop=e.scrollHeight)},[r,c]);let d=b.useCallback(()=>{let e=a.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight;o.current=t<24},[]),f=b.useMemo(()=>({children:e,...t})=>(0,S.jsx)(`pre`,{...t,ref:u,onScroll:e=>{d(),t.onScroll?.(e)},children:e}),[u,d]),m=(0,S.jsx)(`pre`,{ref:u,onScroll:d,className:v,children:(0,S.jsx)(`code`,{children:r})});return(0,S.jsx)(p,{code:r,language:t,state:n?`complete`:`streaming`,children:l?(0,S.jsx)(b.Suspense,{fallback:m,children:(0,S.jsx)(j,{language:t||`text`,isDark:i,codeTheme:`night`,backgroundColor:i?y:g,borderRadius:0,customStyle:h,className:`m-0! rounded-none! border-none!`,showLineNumbers:!0,preTag:f,children:c})}):m})}var F=b.memo(({content:e,className:t,segments:n,isStreaming:r=!0})=>{let a=b.useMemo(()=>n??_(e),[e,n]),o=a[a.length-1],s=o?.type===`code`&&!o.complete;return(0,S.jsxs)(`div`,{className:i(`text-sm leading-relaxed text-ink`,t),children:[a.map((e,t)=>e.type===`code`?(0,S.jsx)(P,{...e},`${e.type}-${t}`):(0,S.jsx)(N,{content:e.content},`${e.type}-${t}`)),r&&!s&&(0,S.jsx)(A,{"data-testid":`message-streaming-cursor`,className:`ms-1 inline-block align-text-bottom`})]})});F.displayName=`StreamingMessageContent`;var I=b.lazy(()=>o(()=>import(`./RichMessageContent-DJTLGpws.js`),__vite__mapDeps([6,7,2,3,8,9,10,11,12,13,14,5])));function L({content:e,className:t}){return(0,S.jsx)(`div`,{dir:`auto`,className:i(`text-sm leading-relaxed text-ink whitespace-pre-wrap wrap-break-word`,t),children:e})}var R=b.memo(({content:e,className:t,isStreaming:n=!1})=>{let r=b.useMemo(()=>n?_(e):[],[e,n]),i=r.some(e=>e.type===`code`);if(n&&i)return(0,S.jsx)(F,{content:e,className:t,segments:r});let a;return a=m(e)?(0,S.jsx)(b.Suspense,{fallback:(0,S.jsx)(F,{content:e,className:t,isStreaming:!1}),children:(0,S.jsx)(I,{content:e,className:t})}):(0,S.jsx)(L,{content:e,className:t}),(0,S.jsxs)(S.Fragment,{children:[a,n&&(0,S.jsx)(`span`,{"data-testid":`message-streaming-cursor`,"aria-hidden":`true`,className:`ms-1 inline-block h-5 w-1 animate-pulse rounded-full bg-primary-500 align-text-bottom`})]})});R.displayName=`MessageContent`;var z=({children:e,htmlFor:t,className:n=``,required:r=!1})=>(0,S.jsxs)(`label`,{htmlFor:t,className:i(`text-sm font-medium tracking-[-0.005em] text-ink-muted`,n),children:[e,r&&(0,S.jsx)(`span`,{"aria-hidden":`true`,className:`ms-0.5 text-error-700 dark:text-error-400`,children:`*`})]}),B=({checked:e,onChange:t,disabled:n=!1,className:r=``,id:a,"aria-label":o,"aria-labelledby":s,"aria-describedby":c,"data-testid":l})=>(0,S.jsx)(`button`,{type:`button`,role:`switch`,id:a,"aria-checked":e,"aria-label":o,"aria-labelledby":s,"aria-describedby":c,"aria-disabled":n||void 0,"data-testid":l,disabled:n,onClick:()=>t(!e),className:i(`relative inline-flex h-6 w-11 shrink-0 items-center justify-center rounded-full bg-transparent`,`focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 focus-visible:ring-offset-canvas dark:focus-visible:ring-primary-400`,n?`cursor-not-allowed opacity-50`:`cursor-pointer`,r),children:(0,S.jsx)(`span`,{"aria-hidden":`true`,className:i(`relative inline-flex h-6 w-11 items-center rounded-full border shadow-inner`,`transition-[background-color,border-color] duration-150 ease-out motion-reduce:transition-none`,e?`border-primary-600/70 bg-primary-600`:`border-line-strong bg-surface-subtle`),children:(0,S.jsx)(`span`,{className:i(`inline-block h-4 w-4 rounded-full bg-white shadow-subtle ring-1 ring-black/5`,`transform transition-transform duration-150 ease-out motion-reduce:transition-none`,e?`translate-x-6 rtl:-translate-x-6`:`translate-x-1 rtl:-translate-x-1`)})})}),V={narrow:`max-w-4xl`,default:`max-w-6xl`,wide:`max-w-7xl`},H=({children:e,width:t=`default`,className:n,contentClassName:r,...a})=>(0,S.jsx)(`div`,{"data-testid":`page-scroll-region`,className:i(`scroll-region h-full min-h-0 scrollbar-thin`,n),...a,children:(0,S.jsx)(`div`,{className:i(`mx-auto w-full px-4 pb-16 pt-7 sm:px-6 sm:pb-20 sm:pt-10 lg:px-8`,V[t],r),children:e})}),U=({title:e,description:t,eyebrow:n,actions:r,meta:a,className:o,...s})=>(0,S.jsxs)(`header`,{className:i(`mb-8 flex flex-col gap-6 border-b border-line pb-7 text-start sm:mb-10 sm:pb-9 md:flex-row md:items-end md:justify-between`,o),...s,children:[(0,S.jsxs)(`div`,{className:`min-w-0 max-w-3xl`,children:[n&&(0,S.jsx)(`div`,{className:`mb-3 text-[11px] font-medium uppercase tracking-[0.18em] text-ink-muted rtl:tracking-normal`,children:n}),(0,S.jsx)(`h1`,{className:`text-balance text-3xl font-normal leading-[1.02] tracking-[-0.04em] text-ink sm:text-5xl sm:leading-none rtl:leading-[1.15] rtl:tracking-normal`,children:e}),t&&(0,S.jsx)(`p`,{className:`mt-4 max-w-2xl text-sm leading-6 text-ink-muted sm:text-base sm:leading-7`,children:t}),a&&(0,S.jsx)(`div`,{className:`mt-4`,children:a})]}),r&&(0,S.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 md:justify-end`,children:r})]}),W=({icon:e,label:t,destructive:n,disabled:r,testId:a,onClick:o})=>(0,S.jsx)(`button`,{type:`button`,onClick:o,disabled:r,title:t,"aria-label":t,"data-testid":a,className:i(`inline-flex h-8 w-8 items-center justify-center rounded-lg text-ink-muted transition-colors duration-150 disabled:cursor-not-allowed disabled:opacity-50`,n?`hover:bg-error-500/10 hover:text-error-600 dark:hover:text-error-400`:`hover:bg-interactive-hover hover:text-ink`),children:(0,S.jsx)(e,{className:`h-4 w-4`})}),G=({title:e,icon:t,description:n,actions:r,children:a,className:o,...s})=>(0,S.jsxs)(`div`,{className:i(`flex flex-wrap items-center justify-between gap-x-3 gap-y-2 border-b border-line px-4 py-3 text-start`,o),...s,children:[(0,S.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,S.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[t&&(0,S.jsx)(t,{className:`h-4 w-4 shrink-0 text-ink-muted`,"aria-hidden":`true`}),(0,S.jsxs)(`div`,{className:`min-w-0`,children:[(0,S.jsx)(`h1`,{className:`text-base font-semibold tracking-[-0.01em] text-ink rtl:tracking-normal`,children:e}),n&&(0,S.jsx)(`p`,{className:`mt-0.5 text-xs text-ink-muted`,children:n})]})]}),a]}),r&&(0,S.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:r})]}),K={sm:{root:`gap-1.5 px-3 py-6`,tile:`h-9 w-9`,icon:`h-4 w-4`,title:`text-sm`,text:`text-xs`},md:{root:`gap-2 px-4 py-16`,tile:`h-12 w-12`,icon:`h-5 w-5`,title:`text-base`,text:`text-sm`}},q=({icon:e,title:t,description:n,action:r,titleAs:a=`p`,size:o=`md`,testId:s,className:c})=>{let l=K[o];return(0,S.jsxs)(`div`,{"data-testid":s,className:i(`flex flex-col items-center text-center`,l.root,c),children:[(0,S.jsx)(`div`,{className:i(`mb-1 flex items-center justify-center rounded-xl bg-surface-subtle text-ink-muted`,l.tile),children:(0,S.jsx)(e,{className:l.icon,"aria-hidden":`true`})}),(0,S.jsx)(a,{className:i(`font-medium text-ink`,l.title),children:t}),n&&(0,S.jsx)(`p`,{className:i(`max-w-sm text-ink-muted`,l.text),children:n}),r&&(0,S.jsx)(`div`,{className:`mt-2`,children:r})]})},J={sm:{root:`gap-2 py-6`,spinner:`h-4 w-4`,text:`text-xs`},md:{root:`gap-3 py-16`,spinner:`h-6 w-6`,text:`text-sm`}},Y=({label:e,srOnly:t=!1,size:n=`md`,testId:r,className:o})=>{let{t:s}=a(),c=J[n];return(0,S.jsxs)(`div`,{role:`status`,"data-testid":r,className:i(`flex flex-col items-center justify-center text-center`,c.root,o),children:[(0,S.jsx)(`span`,{"aria-hidden":`true`,className:i(`animate-spin rounded-full border-2 border-line border-t-primary-500`,c.spinner)}),(0,S.jsx)(`span`,{className:t?`sr-only`:i(`text-ink-muted`,c.text),children:e??s(`common.loading`)})]})},X={sm:{root:`gap-2 px-3 py-6`,icon:`h-4 w-4`,text:`text-xs`},md:{root:`gap-3 px-4 py-16`,icon:`h-5 w-5`,text:`text-sm`}},Z=({message:e,icon:t=l,onRetry:n,size:r=`md`,testId:o,className:s})=>{let{t:c}=a(),u=X[r];return(0,S.jsxs)(`div`,{role:`alert`,"data-testid":o,className:i(`flex flex-col items-center justify-center text-center`,u.root,s),children:[(0,S.jsx)(t,{className:i(`text-error-600 dark:text-error-400`,u.icon),"aria-hidden":`true`}),(0,S.jsx)(`p`,{className:i(`max-w-sm text-ink`,u.text),children:e}),n&&(0,S.jsx)(d,{type:`button`,variant:`secondary`,size:`sm`,onClick:n,children:c(`common.retry`)})]})};export{C as _,W as a,B as c,F as d,A as f,T as g,D as h,G as i,z as l,O as m,Y as n,U as o,k as p,q as r,H as s,Z as t,R as u,w as v};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t}from"./react-vendor-C1iE8mnY.js";import{_ as n,g as r,h as i,m as a}from"./appStore-B6pAGo3p.js";var o=e(t(),1),s=e=>typeof e==`function`,c=(e,t)=>s(e)?e(t):e,l=(()=>{let e=0;return()=>(++e).toString()})(),u=(()=>{let e;return()=>{if(e===void 0&&typeof window<`u`){let t=matchMedia(`(prefers-reduced-motion: reduce)`);e=!t||t.matches}return e}})(),d=20,f=`default`,p=(e,t)=>{let{toastLimit:n}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,n)};case 1:return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case 2:let{toast:r}=t;return p(e,{type:+!!e.toasts.find(e=>e.id===r.id),toast:r});case 3:let{toastId:i}=t;return{...e,toasts:e.toasts.map(e=>e.id===i||i===void 0?{...e,dismissed:!0,visible:!1}:e)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let a=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(e=>({...e,pauseDuration:e.pauseDuration+a}))}}},m=[],h={toasts:[],pausedAt:void 0,settings:{toastLimit:d}},g={},_=(e,t=f)=>{g[t]=p(g[t]||h,e),m.forEach(([e,n])=>{e===t&&n(g[t])})},v=e=>Object.keys(g).forEach(t=>_(e,t)),y=e=>Object.keys(g).find(t=>g[t].toasts.some(t=>t.id===e)),b=(e=f)=>t=>{_(t,e)},x={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},S=(e={},t=f)=>{let[n,r]=(0,o.useState)(g[t]||h),i=(0,o.useRef)(g[t]);(0,o.useEffect)(()=>(i.current!==g[t]&&r(g[t]),m.push([t,r]),()=>{let e=m.findIndex(([e])=>e===t);e>-1&&m.splice(e,1)}),[t]);let a=n.toasts.map(t=>({...e,...e[t.type],...t,removeDelay:t.removeDelay||e[t.type]?.removeDelay||e?.removeDelay,duration:t.duration||e[t.type]?.duration||e?.duration||x[t.type],style:{...e.style,...e[t.type]?.style,...t.style}}));return{...n,toasts:a}},C=(e,t=`blank`,n)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:`status`,"aria-live":`polite`},message:e,pauseDuration:0,...n,id:n?.id||l()}),w=e=>(t,n)=>{let r=C(t,e,n);return b(r.toasterId||y(r.id))({type:2,toast:r}),r.id},T=(e,t)=>w(`blank`)(e,t);T.error=w(`error`),T.success=w(`success`),T.loading=w(`loading`),T.custom=w(`custom`),T.dismiss=(e,t)=>{let n={type:3,toastId:e};t?b(t)(n):v(n)},T.dismissAll=e=>T.dismiss(void 0,e),T.remove=(e,t)=>{let n={type:4,toastId:e};t?b(t)(n):v(n)},T.removeAll=e=>T.remove(void 0,e),T.promise=(e,t,n)=>{let r=T.loading(t.loading,{...n,...n?.loading});return typeof e==`function`&&(e=e()),e.then(e=>{let i=t.success?c(t.success,e):void 0;return i?T.success(i,{id:r,...n,...n?.success}):T.dismiss(r),e}).catch(e=>{let i=t.error?c(t.error,e):void 0;i?T.error(i,{id:r,...n,...n?.error}):T.dismiss(r)}),e};var ee=1e3,te=(e,t=`default`)=>{let{toasts:n,pausedAt:r}=S(e,t),i=(0,o.useRef)(new Map).current,a=(0,o.useCallback)((e,t=ee)=>{if(i.has(e))return;let n=setTimeout(()=>{i.delete(e),s({type:4,toastId:e})},t);i.set(e,n)},[]);(0,o.useEffect)(()=>{if(r)return;let e=Date.now(),i=n.map(n=>{if(n.duration===1/0)return;let r=(n.duration||0)+n.pauseDuration-(e-n.createdAt);if(r<0)n.visible&&T.dismiss(n.id);else return setTimeout(()=>T.dismiss(n.id,t),r)});return()=>{i.forEach(e=>e&&clearTimeout(e))}},[n,r,t]);let s=(0,o.useCallback)(b(t),[t]),c=(0,o.useCallback)(()=>{s({type:5,time:Date.now()})},[s]),l=(0,o.useCallback)((e,t)=>{s({type:1,toast:{id:e,height:t}})},[s]),u=(0,o.useCallback)(()=>{r&&s({type:6,time:Date.now()})},[r,s]),d=(0,o.useCallback)((e,t)=>{let{reverseOrder:r=!1,gutter:i=8,defaultPosition:a}=t||{},o=n.filter(t=>(t.position||a)===(e.position||a)&&t.height),s=o.findIndex(t=>t.id===e.id),c=o.filter((e,t)=>t<s&&e.visible).length;return o.filter(e=>e.visible).slice(...r?[c+1]:[0,c]).reduce((e,t)=>e+(t.height||0)+i,0)},[n]);return(0,o.useEffect)(()=>{n.forEach(e=>{if(e.dismissed)a(e.id,e.removeDelay);else{let t=i.get(e.id);t&&(clearTimeout(t),i.delete(e.id))}})},[n,a]),{toasts:n,handlers:{updateHeight:l,startPause:c,endPause:u,calculateOffset:d}}},ne=a` from { transform: scale(0) rotate(45deg); opacity: 0; } to { transform: scale(1) rotate(45deg); opacity: 1; }`,re=a` from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; }`,ie=a` from { transform: scale(0) rotate(90deg); opacity: 0; } to { transform: scale(1) rotate(90deg); opacity: 1; }`,ae=n(`div`)` width: 20px; opacity: 0; height: 20px; border-radius: 10px; background: ${e=>e.primary||`#ff4b4b`}; position: relative; transform: rotate(45deg); animation: ${ne} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after, &:before { content: ''; animation: ${re} 0.15s ease-out forwards; animation-delay: 150ms; position: absolute; border-radius: 3px; opacity: 0; background: ${e=>e.secondary||`#fff`}; bottom: 9px; left: 4px; height: 2px; width: 12px; } &:before { animation: ${ie} 0.15s ease-out forwards; animation-delay: 180ms; transform: rotate(90deg); } `,oe=a` from { transform: rotate(0deg); } to { transform: rotate(360deg); } `,se=n(`div`)` width: 12px; height: 12px; box-sizing: border-box; border: 2px solid; border-radius: 100%; border-color: ${e=>e.secondary||`#e0e0e0`}; border-right-color: ${e=>e.primary||`#616161`}; animation: ${oe} 1s linear infinite; `,ce=a` from { transform: scale(0) rotate(45deg); opacity: 0; } to { transform: scale(1) rotate(45deg); opacity: 1; }`,le=a` 0% { height: 0; width: 0; opacity: 0; } 40% { height: 0; width: 6px; opacity: 1; } 100% { opacity: 1; height: 10px; }`,ue=n(`div`)` width: 20px; opacity: 0; height: 20px; border-radius: 10px; background: ${e=>e.primary||`#61d345`}; position: relative; transform: rotate(45deg); animation: ${ce} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after { content: ''; box-sizing: border-box; animation: ${le} 0.2s ease-out forwards; opacity: 0; animation-delay: 200ms; position: absolute; border-right: 2px solid; border-bottom: 2px solid; border-color: ${e=>e.secondary||`#fff`}; bottom: 6px; left: 6px; height: 10px; width: 6px; } `,de=n(`div`)` position: absolute; `,fe=n(`div`)` position: relative; display: flex; justify-content: center; align-items: center; min-width: 20px; min-height: 20px; `,pe=a` from { transform: scale(0.6); opacity: 0.4; } to { transform: scale(1); opacity: 1; }`,me=n(`div`)` position: relative; transform: scale(0.6); opacity: 0.4; min-width: 20px; animation: ${pe} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; `,he=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t===void 0?n===`blank`?null:o.createElement(fe,null,o.createElement(se,{...r}),n!==`loading`&&o.createElement(de,null,n===`error`?o.createElement(ae,{...r}):o.createElement(ue,{...r}))):typeof t==`string`?o.createElement(me,null,t):t},ge=e=>` 0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;} 100% {transform: translate3d(0,0,0) scale(1); opacity:1;} `,_e=e=>` 0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;} 100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;} `,ve=`0%{opacity:0;} 100%{opacity:1;}`,ye=`0%{opacity:1;} 100%{opacity:0;}`,be=n(`div`)` :where(&) { display: flex; align-items: center; background: #fff; color: #363636; line-height: 1.3; will-change: transform; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05); max-width: 350px; pointer-events: auto; padding: 8px 10px; border-radius: 8px; } `,xe=n(`div`)` display: flex; justify-content: center; margin: 4px 10px; color: inherit; flex: 1 1 auto; white-space: pre-line; `,Se=(e,t)=>{let n=e.includes(`top`)?1:-1,[r,i]=u()?[ve,ye]:[ge(n),_e(n)];return{animation:t?`${a(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${a(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},E=o.memo(({toast:e,position:t,style:n,children:r})=>{let i=e.height?Se(e.position||t||`top-center`,e.visible):{opacity:0},a=o.createElement(he,{toast:e}),s=o.createElement(xe,{...e.ariaProps},c(e.message,e));return o.createElement(be,{className:e.className,style:{...i,...n,...e.style}},typeof r==`function`?r({icon:a,message:s}):o.createElement(o.Fragment,null,a,s))});i(o.createElement);var Ce=({id:e,className:t,style:n,onHeightUpdate:r,children:i})=>{let a=o.useCallback(t=>{if(t){let n=()=>{let n=t.getBoundingClientRect().height;r(e,n)};n(),new MutationObserver(n).observe(t,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return o.createElement(`div`,{ref:a,className:t,style:n},i)},we=(e,t)=>{let n=e.includes(`top`),r=n?{top:0}:{bottom:0},i=e.includes(`center`)?{justifyContent:`center`}:e.includes(`right`)?{justifyContent:`flex-end`}:{};return{left:0,right:0,display:`flex`,position:`absolute`,transition:u()?void 0:`all 230ms cubic-bezier(.21,1.02,.73,1)`,transform:`translateY(${t*(n?1:-1)}px)`,...r,...i}},Te=r` z-index: 9999; > * { pointer-events: auto; } `,D=16,Ee=({reverseOrder:e,position:t=`top-center`,toastOptions:n,gutter:r,children:i,toasterId:a,containerStyle:s,containerClassName:l})=>{let{toasts:u,handlers:d}=te(n,a);return o.createElement(`div`,{"data-rht-toaster":a||``,style:{position:`fixed`,zIndex:9999,top:D,left:D,right:D,bottom:D,pointerEvents:`none`,...s},className:l,onMouseEnter:d.startPause,onMouseLeave:d.endPause},u.map(n=>{let a=n.position||t,s=we(a,d.calculateOffset(n,{reverseOrder:e,gutter:r,defaultPosition:t}));return o.createElement(Ce,{id:n.id,key:n.id,onHeightUpdate:d.updateHeight,className:n.visible?Te:``,style:s},n.type===`custom`?c(n.message,n):i?i(n):o.createElement(E,{toast:n,position:a}))}))},De=T,Oe=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function ke(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Oe(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var Ae=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},je=e=>{let t=Ae(e);return t.charAt(0).toUpperCase()+t.slice(1)},O=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),k={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function A(e){return e!=null}function Me(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??k.width,a=e.size??e.height??k.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?O(...c):O(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??k[`stroke-width`])*Number(e.size??e.width??k.width)/Number(t.size??t.width??k.width):t.strokeWidth??k[`stroke-width`];return[`svg`,{...Object.entries(k).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&A(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&A(t.width)&&{[r(`width`)]:t.width},...`height`in t&&A(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function Ne(e,t={}){return Me(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var Pe=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Fe=(0,o.createContext)({}),Ie=()=>(0,o.useContext)(Fe),Le=(0,o.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:s,className:c=``,children:l,iconNode:u=[],icon:d={node:u,aliases:[],size:24},...f},p)=>{let{size:m=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,nonScalingStroke:_=!1,color:v=`currentColor`,className:y=``}=Ie()??{},b=!!l||Pe(f),[x,S,C=[]]=Ne(d,{color:e??v,width:n??t??m,height:r??t??m,strokeWidth:i??h,absoluteStrokeWidth:a??g,nonScalingStroke:s??_,className:O(y,c),hasA11yProp:b,attributes:f});return(0,o.createElement)(x,{ref:p,...S},[...C.map(([e,t])=>(0,o.createElement)(e,t)),...Array.isArray(l)?l:[l]])});function j(e,t=[],n=[]){let r=typeof e==`string`?ke(e,t,n):e,i=(0,o.forwardRef)(({className:e,...t},n)=>(0,o.createElement)(Le,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=je(r.name)),i}var M={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};M.node;var Re=j(M),N={name:`archive-restore`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]};N.node;var ze=j(N),P={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};P.node;var Be=j(P),F={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};F.node;var Ve=j(F),I={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};I.node;var He=j(I),L={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};L.node;var Ue=j(L),R={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};R.node;var We=j(R),z={name:`audio-lines`,size:24,node:[[`path`,{d:`M2 10v3`,key:`1fnikh`}],[`path`,{d:`M6 6v11`,key:`11sgs0`}],[`path`,{d:`M10 3v18`,key:`yhl04a`}],[`path`,{d:`M14 8v7`,key:`3a1oy3`}],[`path`,{d:`M18 5v13`,key:`123xd1`}],[`path`,{d:`M22 10v3`,key:`154ddg`}]]};z.node;var Ge=j(z),B={name:`bell-ring`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M22 8c0-2.3-.8-4.3-2-6`,key:`5bb3ad`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}],[`path`,{d:`M4 2C2.8 3.7 2 5.7 2 8`,key:`tap9e0`}]]};B.node;var Ke=j(B),V={name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]};V.node;var qe=j(V),H={name:`book-open`,size:24,node:[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]};H.node;var Je=j(H),U={name:`book-text`,size:24,node:[[`path`,{d:`M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20`,key:`k3hazp`}],[`path`,{d:`M8 11h8`,key:`vwpz6n`}],[`path`,{d:`M8 7h6`,key:`1f0q6e`}]]};U.node;var Ye=j(U),W={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};W.node;var Xe=j(W),G={name:`box`,size:24,node:[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]};G.node;var Ze=j(G),K={name:`boxes`,size:24,node:[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]};K.node;var Qe=j(K),q={name:`braces`,size:24,node:[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]],aliases:[`curly-braces`]};q.node;var $e=j(q),J={name:`brain`,size:24,node:[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 01-3-4 4.17 4.17 0 01-3 4`,key:`5nuw1p`}],[`path`,{d:`M17.707 6.294A3 3 0 1012 5a3 3 0 10-5.707 1.294`,key:`18ldcf`}],[`path`,{d:`M17.996 5.125a4 4 0 012.526 5.77`,key:`1sdu8q`}],[`path`,{d:`M18 18a4 4 0 002-7.465`,key:`7xqqvr`}],[`path`,{d:`M19.967 17.482a4 4 0 11-7.967.517 4 4 0 11-7.967-.517`,key:`t46ysz`}],[`path`,{d:`M6 18a4 4 0 01-2-7.465`,key:`1y2m15`}],[`path`,{d:`M6.004 5.125a4 4 0 00-2.526 5.77`,key:`3cw1ss`}]]};J.node;var et=j(J),Y={name:`briefcase`,size:24,node:[[`path`,{d:`M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16`,key:`jecpp`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]};Y.node;var tt=j(Y),X={name:`calendar-clock`,size:24,node:[[`path`,{d:`M16 14v2.2l1.6 1`,key:`fo4ql5`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338`,key:`7hb8p4`}],[`path`,{d:`M3 9h5.859`,key:`numkqi`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]};X.node;var nt=j(X),Z={name:`calendar-days`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 13h.01`,key:`1sbv64`}],[`path`,{d:`M12 13h.01`,key:`y0uutt`}],[`path`,{d:`M16 13h.01`,key:`wip0gl`}],[`path`,{d:`M8 17h.01`,key:`p3bg7i`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M16 17h.01`,key:`ql8jdd`}]]};Z.node;var rt=j(Z),Q={name:`camera`,size:24,node:[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]};Q.node;var it=j(Q),at={name:`chart-no-axes-combined`,size:24,node:[[`path`,{d:`M12 16v5`,key:`zza2cw`}],[`path`,{d:`M16 14.639V21`,key:`1s85h0`}],[`path`,{d:`M20 10.656V21`,key:`q45596`}],[`path`,{d:`m22 3-8.646 8.646a.5.5 0 0 1-.708 0L9.354 8.354a.5.5 0 0 0-.707 0L2 15`,key:`1fw8x9`}],[`path`,{d:`M4 18.463V21`,key:`1otddq`}],[`path`,{d:`M8 14.656V21`,key:`1t2idw`}]]};at.node;var ot=j(at),st={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};st.node;var ct=j(st),lt={name:`check-check`,size:24,node:[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]};lt.node;var ut=j(lt),dt={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};dt.node;var ft=j(dt),pt={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};pt.node;var mt=j(pt),ht={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};ht.node;var gt=j(ht),_t={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};_t.node;var vt=j(_t),yt={name:`chevrons-down-up`,size:24,node:[[`path`,{d:`m7 20 5-5 5 5`,key:`13a0gw`}],[`path`,{d:`m7 4 5 5 5-5`,key:`1kwcof`}]]};yt.node;var bt=j(yt),xt={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]};xt.node;var St=j(xt),Ct={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};Ct.node;var wt=j(Ct),Tt={name:`circle-arrow-up`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 12-4-4-4 4`,key:`177agl`}],[`path`,{d:`M12 16V8`,key:`1sbj14`}]],aliases:[`arrow-up-circle`]};Tt.node;var Et=j(Tt),Dt={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};Dt.node;var Ot=j(Dt),kt={name:`circle-slash`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]};kt.node;var At=j(kt),jt={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};jt.node;var Mt=j(jt),Nt={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Nt.node;var Pt=j(Nt),Ft={name:`clock-3`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]};Ft.node;var It=j(Ft),Lt={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};Lt.node;var Rt=j(Lt),zt={name:`cloud`,size:24,node:[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]};zt.node;var Bt=j(zt),Vt={name:`code-xml`,size:24,node:[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]],aliases:[`code-2`]};Vt.node;var Ht=j(Vt),Ut={name:`code`,size:24,node:[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]};Ut.node;var Wt=j(Ut),Gt={name:`columns-2`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]],aliases:[`columns`]};Gt.node;var Kt=j(Gt),qt={name:`compass`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]};qt.node;var Jt=j(qt),Yt={name:`container`,size:24,node:[[`path`,{d:`M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z`,key:`1t2lqe`}],[`path`,{d:`M10 21.9V14L2.1 9.1`,key:`o7czzq`}],[`path`,{d:`m10 14 11.9-6.9`,key:`zm5e20`}],[`path`,{d:`M14 19.8v-8.1`,key:`159ecu`}],[`path`,{d:`M18 17.5V9.4`,key:`11uown`}]]};Yt.node;var Xt=j(Yt),Zt={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};Zt.node;var Qt=j(Zt),$t={name:`cpu`,size:24,node:[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]};$t.node;var en=j($t),tn={name:`database`,size:24,node:[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]};tn.node;var nn=j(tn),rn={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};rn.node;var an=j(rn),on={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};on.node;var sn=j(on),cn={name:`eraser`,size:24,node:[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]};cn.node;var ln=j(cn),un={name:`external-link`,size:24,node:[[`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`}]]};un.node;var dn=j(un),fn={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};fn.node;var pn=j(fn),mn={name:`eye`,size:24,node:[[`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`}]]};mn.node;var hn=j(mn),gn={name:`face-slightly-smiling-plus`,size:24,node:[[`path`,{d:`M13.267 2.08a10 10 0 108.653 8.653`,key:`1wbpyh`}],[`path`,{d:`M15 10V9`,key:`4dkmfx`}],[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M16.472 15a6 6 0 01-8.943 0`,key:`7qomzy`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M9 10V9`,key:`1lazqi`}]],aliases:[`smile-plus`]};gn.node;var _n=j(gn),vn={name:`file-code`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]};vn.node;var yn=j(vn),bn={name:`file-diff`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}]]};bn.node;var xn=j(bn),Sn={name:`file-down`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}],[`path`,{d:`m9 15 3 3 3-3`,key:`1npd3o`}]]};Sn.node;var Cn=j(Sn),wn={name:`file-plus-corner`,size:24,node:[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]],aliases:[`file-plus-2`]};wn.node;var Tn=j(wn),En={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};En.node;var Dn=j(En),On={name:`files`,size:24,node:[[`path`,{d:`M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8`,key:`14sh0y`}],[`path`,{d:`M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z`,key:`1970lx`}],[`path`,{d:`M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1`,key:`l4dndm`}]]};On.node;var kn=j(On),An={name:`film`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 3v18`,key:`bbkbws`}],[`path`,{d:`M3 7.5h4`,key:`zfgn84`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 16.5h4`,key:`1230mu`}],[`path`,{d:`M17 3v18`,key:`in4fa5`}],[`path`,{d:`M17 7.5h4`,key:`myr1c1`}],[`path`,{d:`M17 16.5h4`,key:`go4c1d`}]]};An.node;var jn=j(An),Mn={name:`file`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]};Mn.node;var Nn=j(Mn),Pn={name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]};Pn.node;var Fn=j(Pn),In={name:`folder-plus`,size:24,node:[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};In.node;var Ln=j(In),Rn={name:`folder-up`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}],[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`m9 13 3-3 3 3`,key:`1pxg3c`}]]};Rn.node;var zn=j(Rn),Bn={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};Bn.node;var Vn=j(Bn),Hn={name:`funnel`,size:24,node:[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]],aliases:[`filter`]};Hn.node;var Un=j(Hn),Wn={name:`gauge`,size:24,node:[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]};Wn.node;var Gn=j(Wn),Kn={name:`ghost`,size:24,node:[[`path`,{d:`M15 10v1`,key:`oj8wfp`}],[`path`,{d:`M7.528 20.472a1.6 1.6 0 012.277 0l1.057 1.056a1.6 1.6 0 002.276 0l1.057-1.056a1.6 1.6 0 012.277 0l1.114 1.114a1.4 1.4 0 002.414-1V10a8 8 0 00-16 0v10.586a1.4 1.4 0 002.414 1z`,key:`13lou3`}],[`path`,{d:`M9 10v1`,key:`1e14fa`}]]};Kn.node;var qn=j(Kn),Jn={name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]};Jn.node;var Yn=j(Jn),Xn={name:`git-commit-horizontal`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]],aliases:[`git-commit`]};Xn.node;var Zn=j(Xn),Qn={name:`git-compare-arrows`,size:24,node:[[`circle`,{cx:`5`,cy:`6`,r:`3`,key:`1qnov2`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v7`,key:`1yj91y`}],[`path`,{d:`m15 9-3-3 3-3`,key:`1lwv8l`}],[`circle`,{cx:`19`,cy:`18`,r:`3`,key:`1qljk2`}],[`path`,{d:`M12 18H7a2 2 0 0 1-2-2V9`,key:`16sdep`}],[`path`,{d:`m9 15 3 3-3 3`,key:`1m3kbl`}]]};Qn.node;var $n=j(Qn),er={name:`git-fork`,size:24,node:[[`circle`,{cx:`12`,cy:`18`,r:`3`,key:`1mpf1b`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`path`,{d:`M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9`,key:`1uq4wg`}],[`path`,{d:`M12 12v3`,key:`158kv8`}]]};er.node;var tr=j(er),nr={name:`git-merge`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]};nr.node;var rr=j(nr),ir={name:`globe`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]};ir.node;var ar=j(ir),or={name:`graduation-cap`,size:24,node:[[`path`,{d:`M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z`,key:`j76jl0`}],[`path`,{d:`M22 10v6`,key:`1lu8f3`}],[`path`,{d:`M6 12.5V16a6 3 0 0 0 12 0v-3.5`,key:`1r8lef`}]]};or.node;var sr=j(or),cr={name:`grip-vertical`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]};cr.node;var lr=j(cr),ur={name:`hand`,size:24,node:[[`path`,{d:`M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2`,key:`1fvzgz`}],[`path`,{d:`M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2`,key:`1kc0my`}],[`path`,{d:`M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8`,key:`10h0bg`}],[`path`,{d:`M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`,key:`1s1gnw`}]]};ur.node;var dr=j(ur),fr={name:`hard-drive`,size:24,node:[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]};fr.node;var pr=j(fr),mr={name:`hash`,size:24,node:[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]};mr.node;var hr=j(mr),gr={name:`heart`,size:24,node:[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}]]};gr.node;var _r=j(gr),vr={name:`house`,size:24,node:[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]],aliases:[`home`]};vr.node;var yr=j(vr),br={name:`image-off`,size:24,node:[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M10.41 10.41a2 2 0 1 1-2.83-2.83`,key:`1bzlo9`}],[`line`,{x1:`13.5`,x2:`6`,y1:`13.5`,y2:`21`,key:`1q0aeu`}],[`line`,{x1:`18`,x2:`21`,y1:`12`,y2:`15`,key:`5mozeu`}],[`path`,{d:`M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59`,key:`mmje98`}],[`path`,{d:`M21 15V5a2 2 0 0 0-2-2H9`,key:`43el77`}]]};br.node;var xr=j(br),Sr={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]};Sr.node;var Cr=j(Sr),wr={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};wr.node;var Tr=j(wr),Er={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};Er.node;var Dr=j(Er),Or={name:`key`,size:24,node:[[`path`,{d:`m2 21 9.6-9.6`,key:`9l79m3`}],[`path`,{d:`m7.5 15.5 2.3 2.3a1 1 0 0 1 0 1.4l-2.1 2.1a1 1 0 0 1-1.4 0L4 19`,key:`fw8biw`}],[`circle`,{cx:`15.5`,cy:`7.5`,r:`5.5`,key:`4wxmhb`}]]};Or.node;var kr=j(Or),$={name:`keyboard`,size:24,node:[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]};$.node;var Ar=j($),jr={name:`layers`,size:24,node:[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]],aliases:[`layers-3`]};jr.node;var Mr=j(jr),Nr={name:`link-2`,size:24,node:[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]};Nr.node;var Pr=j(Nr),Fr={name:`link`,size:24,node:[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]};Fr.node;var Ir=j(Fr),Lr={name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]};Lr.node;var Rr=j(Lr),zr={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};zr.node;var Br=j(zr),Vr={name:`list-x`,size:24,node:[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M11 12H3`,key:`51ecnj`}],[`path`,{d:`M16 19H3`,key:`zzsher`}],[`path`,{d:`m15.5 9.5 5 5`,key:`ytk86i`}],[`path`,{d:`m20.5 9.5-5 5`,key:`17o44f`}]]};Vr.node;var Hr=j(Vr),Ur={name:`loader`,size:24,node:[[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m16.2 7.8 2.9-2.9`,key:`r700ao`}],[`path`,{d:`M18 12h4`,key:`wj9ykh`}],[`path`,{d:`m16.2 16.2 2.9 2.9`,key:`1bxg5t`}],[`path`,{d:`M12 18v4`,key:`jadmvz`}],[`path`,{d:`m4.9 19.1 2.9-2.9`,key:`bwix9q`}],[`path`,{d:`M2 12h4`,key:`j09sii`}],[`path`,{d:`m4.9 4.9 2.9 2.9`,key:`giyufr`}]]};Ur.node;var Wr=j(Ur),Gr={name:`lock`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]};Gr.node;var Kr=j(Gr),qr={name:`log-in`,size:24,node:[[`path`,{d:`m10 17 5-5-5-5`,key:`1bsop3`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`,key:`u53s6r`}]]};qr.node;var Jr=j(qr),Yr={name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]};Yr.node;var Xr=j(Yr),Zr={name:`mail`,size:24,node:[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]};Zr.node;var Qr=j(Zr),$r={name:`maximize-2`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]};$r.node;var ei=j($r),ti={name:`memory-stick`,size:24,node:[[`path`,{d:`M12 12v-2`,key:`fwoke6`}],[`path`,{d:`M12 18v-2`,key:`qj6yno`}],[`path`,{d:`M16 12v-2`,key:`heuere`}],[`path`,{d:`M16 18v-2`,key:`s1ct0w`}],[`path`,{d:`M2 11h1.5`,key:`15p63e`}],[`path`,{d:`M20 18v-2`,key:`12ehxp`}],[`path`,{d:`M20.5 11H22`,key:`khsy7a`}],[`path`,{d:`M4 18v-2`,key:`1c3oqr`}],[`path`,{d:`M8 12v-2`,key:`1mwtfd`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`rect`,{x:`2`,y:`6`,width:`20`,height:`10`,rx:`2`,key:`1qcswk`}]]};ti.node;var ni=j(ti),ri={name:`message-circle`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]};ri.node;var ii=j(ri),ai={name:`message-square-plus`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]};ai.node;var oi=j(ai),si={name:`message-square-text`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]};si.node;var ci=j(si),li={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]};li.node;var ui=j(li),di={name:`messages-square`,size:24,node:[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]};di.node;var fi=j(di),pi={name:`mic-off`,size:24,node:[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M15 9.34V5a3 3 0 0 0-5.68-1.33`,key:`1gzdoj`}],[`path`,{d:`M16.95 16.95A7 7 0 0 1 5 12v-2`,key:`cqa7eg`}],[`path`,{d:`M18.89 13.23A7 7 0 0 0 19 12v-2`,key:`16hl24`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v3a3 3 0 0 0 5.12 2.12`,key:`r2i35w`}]]};pi.node;var mi=j(pi),hi={name:`mic`,size:24,node:[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]};hi.node;var gi=j(hi),_i={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};_i.node;var vi=j(_i),yi={name:`monitor-play`,size:24,node:[[`path`,{d:`M15.033 9.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56V7.648a.645.645 0 0 1 .967-.56z`,key:`vbtd3f`}],[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`rect`,{x:`2`,y:`3`,width:`20`,height:`14`,rx:`2`,key:`x3v2xh`}]]};yi.node;var bi=j(yi),xi={name:`monitor-smartphone`,size:24,node:[[`path`,{d:`M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8`,key:`10dyio`}],[`path`,{d:`M10 19v-3.96 3.15`,key:`1irgej`}],[`path`,{d:`M7 19h5`,key:`qswx4l`}],[`rect`,{width:`6`,height:`10`,x:`16`,y:`12`,rx:`2`,key:`1egngj`}]]};xi.node;var Si=j(xi),Ci={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};Ci.node;var wi=j(Ci),Ti={name:`moon-star`,size:24,node:[[`path`,{d:`M18 5h4`,key:`1lhgn2`}],[`path`,{d:`M20 3v4`,key:`1olli1`}],[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};Ti.node;var Ei=j(Ti),Di={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};Di.node;var Oi=j(Di),ki={name:`mouse-pointer-click`,size:24,node:[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]};ki.node;var Ai=j(ki),ji={name:`network`,size:24,node:[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]};ji.node;var Mi=j(ji),Ni={name:`notebook-pen`,size:24,node:[[`path`,{d:`M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4`,key:`re6nr2`}],[`path`,{d:`M2 6h4`,key:`aawbzj`}],[`path`,{d:`M2 10h4`,key:`l0bgd4`}],[`path`,{d:`M2 14h4`,key:`1gsvsf`}],[`path`,{d:`M2 18h4`,key:`1bu2t1`}],[`path`,{d:`M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z`,key:`pqwjuv`}]]};Ni.node;var Pi=j(Ni),Fi={name:`package`,size:24,node:[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]};Fi.node;var Ii=j(Fi),Li={name:`palette`,size:24,node:[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]};Li.node;var Ri=j(Li),zi={name:`panel-left`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]],aliases:[`sidebar`]};zi.node;var Bi=j(zi),Vi={name:`panel-right-close`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]};Vi.node;var Hi=j(Vi),Ui={name:`paperclip`,size:24,node:[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]};Ui.node;var Wi=j(Ui),Gi={name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]};Gi.node;var Ki=j(Gi),qi={name:`pen-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]],aliases:[`edit-3`]};qi.node;var Ji=j(qi),Yi={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};Yi.node;var Xi=j(Yi),Zi={name:`pin-off`,size:24,node:[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]};Zi.node;var Qi=j(Zi),$i={name:`pin`,size:24,node:[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]};$i.node;var ea=j($i),ta={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};ta.node;var na=j(ta),ra={name:`plug`,size:24,node:[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]};ra.node;var ia=j(ra),aa={name:`plug-zap`,size:24,node:[[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m18 3-4 4h6l-4 4`,key:`16psg9`}]],aliases:[`plug-zap-2`]};aa.node;var oa=j(aa),sa={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};sa.node;var ca=j(sa),la={name:`power-off`,size:24,node:[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};la.node;var ua=j(la),da={name:`puzzle`,size:24,node:[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]};da.node;var fa=j(da),pa={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};pa.node;var ma=j(pa),ha={name:`rocket`,size:24,node:[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]};ha.node;var ga=j(ha),_a={name:`rotate-ccw-clock`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]};_a.node;var va=j(_a),ya={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};ya.node;var ba=j(ya),xa={name:`save`,size:24,node:[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]};xa.node;var Sa=j(xa),Ca={name:`scroll-text`,size:24,node:[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]};Ca.node;var wa=j(Ca),Ta={name:`search-x`,size:24,node:[[`path`,{d:`m13.5 8.5-5 5`,key:`1cs55j`}],[`path`,{d:`m8.5 8.5 5 5`,key:`a8mexj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]};Ta.node;var Ea=j(Ta),Da={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};Da.node;var Oa=j(Da),ka={name:`send`,size:24,node:[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]};ka.node;var Aa=j(ka),ja={name:`server`,size:24,node:[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]};ja.node;var Ma=j(ja),Na={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};Na.node;var Pa=j(Na),Fa={name:`settings-2`,size:24,node:[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]};Fa.node;var Ia=j(Fa),La={name:`share-2`,size:24,node:[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]};La.node;var Ra=j(La),za={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};za.node;var Ba=j(za),Va={name:`shield-off`,size:24,node:[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71`,key:`1jlk70`}],[`path`,{d:`M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264`,key:`18rp1v`}]]};Va.node;var Ha=j(Va),Ua={name:`shield-question-mark`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`shield-question`]};Ua.node;var Wa=j(Ua),Ga={name:`shield`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]};Ga.node;var Ka=j(Ga),qa={name:`skip-forward`,size:24,node:[[`path`,{d:`M21 4v16`,key:`7j8fe9`}],[`path`,{d:`M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z`,key:`zs4d6`}]]};qa.node;var Ja=j(qa),Ya={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};Ya.node;var Xa=j(Ya),Za={name:`sliders-vertical`,size:24,node:[[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M12 21v-9`,key:`17s77i`}],[`path`,{d:`M12 8V3`,key:`13r4qs`}],[`path`,{d:`M17 16h4`,key:`h1uq16`}],[`path`,{d:`M19 12V3`,key:`o1uvq1`}],[`path`,{d:`M19 21v-5`,key:`qua636`}],[`path`,{d:`M3 14h4`,key:`bcjad9`}],[`path`,{d:`M5 10V3`,key:`cb8scm`}],[`path`,{d:`M5 21v-7`,key:`1w1uti`}]],aliases:[`sliders`]};Za.node;var Qa=j(Za),$a={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};$a.node;var eo=j($a),to={name:`square-pen`,size:24,node:[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]],aliases:[`pen-box`,`edit`,`pen-square`]};to.node;var no=j(to),ro={name:`square-terminal`,size:24,node:[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]],aliases:[`terminal-square`]};ro.node;var io=j(ro),ao={name:`square-x`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-square`]};ao.node;var oo=j(ao),so={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};so.node;var co=j(so),lo={name:`star`,size:24,node:[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]};lo.node;var uo=j(lo),fo={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};fo.node;var po=j(fo),mo={name:`sunrise`,size:24,node:[[`path`,{d:`M12 2v8`,key:`1q4o3n`}],[`path`,{d:`m4.93 10.93 1.41 1.41`,key:`2a7f42`}],[`path`,{d:`M2 18h2`,key:`j10viu`}],[`path`,{d:`M20 18h2`,key:`wocana`}],[`path`,{d:`m19.07 10.93-1.41 1.41`,key:`15zs5n`}],[`path`,{d:`M22 22H2`,key:`19qnx5`}],[`path`,{d:`m8 6 4-4 4 4`,key:`ybng9g`}],[`path`,{d:`M16 18a4 4 0 0 0-8 0`,key:`1lzouq`}]]};mo.node;var ho=j(mo),go={name:`sunset`,size:24,node:[[`path`,{d:`M12 10V2`,key:`16sf7g`}],[`path`,{d:`m4.93 10.93 1.41 1.41`,key:`2a7f42`}],[`path`,{d:`M2 18h2`,key:`j10viu`}],[`path`,{d:`M20 18h2`,key:`wocana`}],[`path`,{d:`m19.07 10.93-1.41 1.41`,key:`15zs5n`}],[`path`,{d:`M22 22H2`,key:`19qnx5`}],[`path`,{d:`m16 6-4 4-4-4`,key:`6wukr`}],[`path`,{d:`M16 18a4 4 0 0 0-8 0`,key:`1lzouq`}]]};go.node;var _o=j(go),vo={name:`swords`,size:24,node:[[`path`,{d:`m13 19 6-6`,key:`gj6q8g`}],[`path`,{d:`M14.5 17.5 3.586 6.586A2 2 0 013 5.172V3h2.172a2 2 0 011.414.586L17.5 14.5`,key:`uwfxh8`}],[`path`,{d:`m14.828 6.172 2.586-2.586A2 2 0 0118.828 3H21v2.172a2 2 0 01-.586 1.414l-2.586 2.586`,key:`1f17hx`}],[`path`,{d:`m16 16 4 4`,key:`up5ibb`}],[`path`,{d:`m19 21 2-2`,key:`1phfkn`}],[`path`,{d:`m5 14 4 4`,key:`1gk0qx`}],[`path`,{d:`m5 21-2-2`,key:`1kw20b`}],[`path`,{d:`M7.5 16.5 4 20`,key:`14nozp`}]]};vo.node;var yo=j(vo),bo={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};bo.node;var xo=j(bo),So={name:`test-tube`,size:24,node:[[`path`,{d:`M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5c-1.4 0-2.5-1.1-2.5-2.5V2`,key:`125lnx`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}],[`path`,{d:`M14.5 16h-5`,key:`1ox875`}]]};So.node;var Co=j(So),wo={name:`thumbs-down`,size:24,node:[[`path`,{d:`M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z`,key:`m61m77`}],[`path`,{d:`M17 14V2`,key:`8ymqnk`}]]};wo.node;var To=j(wo),Eo={name:`thumbs-up`,size:24,node:[[`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`,key:`emmmcr`}],[`path`,{d:`M7 10v12`,key:`1qc93n`}]]};Eo.node;var Do=j(Eo),Oo={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};Oo.node;var ko=j(Oo),Ao={name:`trending-up`,size:24,node:[[`path`,{d:`M16 7h6v6`,key:`box55l`}],[`path`,{d:`m22 7-8.5 8.5-5-5L2 17`,key:`1t1m79`}]]};Ao.node;var jo=j(Ao),Mo={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};Mo.node;var No=j(Mo),Po={name:`trophy`,size:24,node:[[`path`,{d:`M10 14.66V17a1 1 0 0 1-1 1 2 2 0 0 0-2 2v2`,key:`pwuv1l`}],[`path`,{d:`M14 14.66V17a1 1 0 0 0 1 1 2 2 0 0 1 2 2v2`,key:`1y54w1`}],[`path`,{d:`M17.916 10H19.5A2.5 2.5 0 0 0 22 7.5V5a1 1 0 0 0-1-1h-3`,key:`e30mpu`}],[`path`,{d:`M4 22h16`,key:`57wxv0`}],[`path`,{d:`M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z`,key:`1mhfuq`}],[`path`,{d:`M6.084 10H4.5A2.5 2.5 0 0 1 2 7.5V5a1 1 0 0 1 1-1h3`,key:`i0yafy`}]]};Po.node;var Fo=j(Po),Io={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};Io.node;var Lo=j(Io),Ro={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]};Ro.node;var zo=j(Ro),Bo={name:`user-check`,size:24,node:[[`path`,{d:`m16 11 2 2 4-4`,key:`9rsbq5`}],[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]};Bo.node;var Vo=j(Bo),Ho={name:`user-minus`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]};Ho.node;var Uo=j(Ho),Wo={name:`user-plus`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]};Wo.node;var Go=j(Wo),Ko={name:`user-round`,size:24,node:[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]],aliases:[`user-2`]};Ko.node;var qo=j(Ko),Jo={name:`user`,size:24,node:[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]};Jo.node;var Yo=j(Jo),Xo={name:`users`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]};Xo.node;var Zo=j(Xo),Qo={name:`volume-2`,size:24,node:[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]};Qo.node;var $o=j(Qo),es={name:`volume-x`,size:24,node:[[`path`,{d:`M11 4.702a.7.7 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.7.7 0 0 0 11 19.298z`,key:`1p7khw`}],[`path`,{d:`m16.5 14.5 5-5`,key:`cul3yw`}],[`path`,{d:`m16.5 9.5 5 5`,key:`1akey5`}]]};es.node;var ts=j(es),ns={name:`wand-sparkles`,size:24,node:[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]],aliases:[`wand-2`]};ns.node;var rs=j(ns),is={name:`wrench`,size:24,node:[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]};is.node;var as=j(is),os={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};os.node;var ss=j(os),cs={name:`zap`,size:24,node:[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]};cs.node;var ls=j(cs);export{fa as $,ft as $n,pr as $t,io as A,an as An,ii as At,Ra as B,Rt as Bn,Rr as Bt,yo as C,yn as Cn,Re as Cr,vi as Ct,uo as D,dn as Dn,T as Dr,ui as Dt,po as E,pn as En,c as Er,fi as Et,Ja as F,Jt as Fn,Jr as Ft,Oa as G,Ot as Gn,kr as Gt,Pa as H,Pt as Hn,Pr as Ht,Ka as I,Kt as In,Kr as It,Sa as J,St as Jn,Cr as Jt,Ea as K,Et as Kn,Dr as Kt,Wa as L,Wt as Ln,Wr as Lt,eo as M,en as Mn,ei as Mt,Qa as N,Qt as Nn,Qr as Nt,co as O,ln as On,De as Or,ci as Ot,Xa as P,Xt as Pn,Xr as Pt,ma as Q,mt as Qn,hr as Qt,Ha as R,Ht as Rn,Hr as Rt,xo as S,xn as Sn,ze as Sr,bi as St,ho as T,hn as Tn,E as Tr,mi as Tt,Ma as U,Mt as Un,Mr as Ut,Ia as V,It as Vn,Ir as Vt,Aa as W,At as Wn,Ar as Wt,va as X,vt as Xn,yr as Xt,ba as Y,bt as Yn,xr as Yt,ga as Z,gt as Zn,_r as Zt,jo as _,jn as _n,We as _r,Ai as _t,ts as a,tr as an,nt as ar,ea as at,To as b,Tn as bn,Ve as br,wi as bt,Yo as c,Yn as cn,$e as cr,Ji as ct,Uo as d,Un as dn,Xe as dr,Hi as dt,dr as en,ut as er,ua as et,Vo as f,Vn as fn,Ye as fr,Bi as ft,No as g,Nn as gn,Ge as gr,Mi as gt,Fo as h,Fn as hn,Ke as hr,Pi as ht,rs as i,rr as in,rt as ir,na as it,no as j,nn as jn,ni as jt,oo as k,sn as kn,oi as kt,qo as l,qn as ln,Qe as lr,Ki as lt,Lo as m,Ln as mn,qe as mr,Ii as mt,ss as n,sr as nn,ot as nr,oa as nt,$o as o,$n as on,tt as or,Qi as ot,zo as p,zn as pn,Je as pr,Ri as pt,wa as q,wt as qn,Tr as qt,as as r,ar as rn,it as rr,ia as rt,Zo as s,Zn as sn,et as sr,Xi as st,ls as t,lr as tn,ct as tr,ca as tt,Go as u,Gn as un,Ze as ur,Wi as ut,ko as v,kn as vn,Ue as vr,Oi as vt,_o as w,_n as wn,Ee as wr,gi as wt,Co as x,Cn as xn,Be as xr,Si as xt,Do as y,Dn as yn,He as yr,Ei as yt,Ba as z,Bt as zn,Br as zt};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-
|
|
2
|
-
`).slice(-3).reverse();for(let e of n){let t=e.trim().replace(/^#{1,6}\s*/,``).replace(/^[-*]\s*/,``).replace(/[::]\s*$/,``).match(b);if(t)return P(t[0])}}function P(e){return e.replace(/^["'`]+|["'`:]+$/g,``)}function F(e){return e?.match(/\.([a-z0-9]+)$/i)?.[1]}function I(e){return e?.split(/[\\/]/).pop()}function L(e){let t=I(e);if(!t)return null;let n=t.replace(/\.[^.]+$/,``);return/^(index|main|app)$/i.test(n)?null:n.replace(/[-_]+/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function R(e){let t=Date.now();return{...e,id:`artifact-${t}-${
|
|
3
|
-
`).length,n=e.trim().length,r=/function|class|def |import |from |const |let |var |if |for |while |try |catch/.test(e);return(n>500||t>15)&&r}return e.trim().length>200}function se(e){let t=[],n=e;for(let e of ne){e.regex.lastIndex=0;let r=[],i;for(;(i=e.regex.exec(n))!==null;){let n=e.extract(i);q(n.content,n.type)&&(t.push(R({type:n.type,title:n.title,content:n.content})),r.push({start:i.index,end:i.index+i[0].length}))}n=G(n,r)}let r=U(n);for(;r;)t.push(r.artifact),n=G(n,r.ranges),r=U(n);let i=W(n);i&&(t.push(i.artifact),n=G(n,i.ranges));let a=M(n),o=[];for(let e of a){let n=z(e);n&&q(e.content,n.type)&&(t.push(R({type:n.type,title:n.title,content:e.content,language:n.language})),o.push(e))}return n=G(n,o),{content:n.trim(),artifacts:t}}var J=new Map;function ce(e,t,n=``){let r=J.get(e);if(n){if((!r||r.state===`none`)&&(J.set(e,{state:`open`,startedAt:Date.now()}),!t))return;let n=J.get(e);t&&n?.state===`open`&&J.set(e,{state:`done`,durationMs:Date.now()-n.startedAt});return}if(r&&r.state!==`open`||!t)return;let i
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t}from"./react-vendor-C1iE8mnY.js";import{a as n,c as r,s as i}from"./utils-BvvV-Cka.js";import{t as a}from"./useTranslation-D9EScZXH.js";import{g as o,t as s}from"./chatStore-hzQyRM9H.js";import{a as c,t as l}from"./logger-rEW7uQ8m.js";import{t as u}from"./appStore-B6pAGo3p.js";import{Or as d}from"./ui-vendor-BTcw5yZ6.js";import{t as f}from"./liveAnnouncerStore-B6mS-JWC.js";import{t as p}from"./config-CHUQTU6j.js";import{N as m,d as ee}from"./api-D6IF0v9_.js";import{n as h}from"./authStore-DdIb6km_.js";import{c as te,s as g}from"./artifactHtml-DDmfpcB0.js";var _=e(t(),1),v=/```([^\n`]*)\n([\s\S]*?)\n```/g,y=/^(?:%%|flowchart|graph|sequenceDiagram|classDiagram|stateDiagram(?:-v2)?|erDiagram|journey|gantt|pie|mindmap|timeline|gitGraph|quadrantChart|requirementDiagram|sankey-beta|xychart-beta|block-beta|architecture-beta|packet-beta|kanban|radar-beta|treemap-beta|C4Context)\b/i,b=/[\w@./-]+\.(?:html?|css|mjs|js|jsx|ts|tsx|svg|json|py)/i,x=[`html`,`react`,`svg`,`mermaid`,`chart`,`code`,`text`,`json`],ne=[{regex:/<artifact\s+type="([^"]+)"\s+title="([^"]+)"[^>]*>([\s\S]*?)<\/artifact>/gi,extract:e=>({type:A(e[1]),title:S(e[2]).trim()||`Artifact`,content:e[3].trim()})},{regex:/<artifact\s+type="([^"]+)"[^>]*>([\s\S]*?)<\/artifact>/gi,extract:e=>{let t=A(e[1]);return{type:t,title:`${t.toUpperCase()} Artifact`,content:e[2].trim()}}}];function S(e){if(typeof document<`u`){let t=document.createElement(`div`);return t.innerHTML=e,t.textContent||t.innerText||``}return w(C(e))}function C(e){return e.replace(/&(lt|gt|quot|apos|#39);/gi,(e,t)=>{switch(t.toLowerCase()){case`lt`:return`<`;case`gt`:return`>`;case`quot`:return`"`;case`apos`:case`#39`:return`'`;default:return``}}).replace(/&/gi,`&`)}function w(e){let t=``,n=!1,r=null;for(let i=0;i<e.length;i+=1){let a=e[i];if(n){if(r){a===r&&(r=null);continue}if(a===`"`||a===`'`){r=a;continue}a===`>`&&(n=!1)}else{if(a===`<`){let t=e[i+1];if(t&&/[!/A-Za-z?]/.test(t)){n=!0;continue}}t+=a}}return t}function T(e){let t=e.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(t)return S(t[1]).trim()||null;let n=e.match(/<h1[^>]*>([\s\S]*?)<\/h1>/i);return n&&S(n[1]).trim()||null}function E(e){for(let t of[/export\s+default\s+(?:function|class)\s+([A-Z]\w*)/,/export\s+default\s+([A-Z]\w*)\s*(?:;|$)/m,/(?:function|class)\s+([A-Z]\w*)/,/const\s+([A-Z]\w*)\s*[:=]/,/(?:function|const|class)\s+(\w+)/]){let n=e.match(t);if(n)return n[1]}return null}function D(e){let t=e.match(/^\s*title\s+(.+)$/im);if(t)return t[1].trim();let n=e.trim().match(/^([A-Za-z][\w-]*)/);if(!n)return null;let r=n[1].replace(/-(?:beta|v2)$/i,``).replace(/([a-z])([A-Z])/g,`$1 $2`);return`${r.charAt(0).toUpperCase()}${r.slice(1)}`}function O(e){if(e.includes(`def main(`))return`Python Script`;let t=e.match(/class\s+(\w+)/);if(t)return`${t[1]} Class`;let n=e.match(/def\s+(\w+)/);return n&&n[1]!==`__init__`?`${n[1]} Function`:null}function k(e){let t=e.match(/function\s+(\w+)/);if(t)return`${t[1]} Function`;let n=e.match(/(?:const|let)\s+(\w+)\s*=/);return n?n[1]:null}function A(e){let t=e.trim().toLowerCase();return x.includes(t)?t:`text`}function j(e){if(!e)return;let t=e.trim().toLowerCase().replace(/^\./,``).replace(/[,:;]+$/,``);switch(t){case`htm`:case`html`:return`html`;case`js`:case`mjs`:case`javascript`:return`javascript`;case`jsx`:case`tsx`:case`react`:return`react`;case`ts`:case`typescript`:return`typescript`;case`py`:case`python`:return`python`;case`css`:case`svg`:case`json`:return t;default:return t||void 0}}function M(e){let t=[],n=new RegExp(v),r;for(;(r=n.exec(e))!==null;){let n=r[1].trim(),i=N(n,ie(e,r.index));t.push({raw:r[0],info:n,content:r[2].trim(),start:r.index,end:r.index+r[0].length,language:i.language,fileName:i.fileName})}return t}function N(e,t){let n=re(e)||t,r=e.split(/\s+/).filter(Boolean)[0]?.replace(/[{}[\]()]/g,``);return{language:(r&&!b.test(r)&&!r.includes(`=`)?j(r):void 0)||j(F(n)),fileName:n}}function re(e){let t=e.match(/(?:file(?:name)?|path|name)\s*=\s*["']?([^"'\s]+)["']?/i);if(t&&b.test(t[1]))return P(t[1]);let n=e.match(b);return n?P(n[0]):void 0}function ie(e,t){let n=e.slice(Math.max(0,t-180),t).split(`
|
|
2
|
+
`).slice(-3).reverse();for(let e of n){let t=e.trim().replace(/^#{1,6}\s*/,``).replace(/^[-*]\s*/,``).replace(/[::]\s*$/,``).match(b);if(t)return P(t[0])}}function P(e){return e.replace(/^["'`]+|["'`:]+$/g,``)}function F(e){return e?.match(/\.([a-z0-9]+)$/i)?.[1]}function I(e){return e?.split(/[\\/]/).pop()}function L(e){let t=I(e);if(!t)return null;let n=t.replace(/\.[^.]+$/,``);return/^(index|main|app)$/i.test(n)?null:n.replace(/[-_]+/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function R(e){let t=Date.now();return{...e,id:`artifact-${t}-${r(9)}`,createdAt:t,updatedAt:t}}function z(e){let t=j(e.language)||j(F(e.fileName));switch(t){case`html`:return{type:`html`,title:T(e.content)||L(e.fileName)||`HTML Document`};case`svg`:return{type:`svg`,title:L(e.fileName)||`SVG Image`};case`react`:return{type:`react`,title:E(e.content)||L(e.fileName)||`React Component`,language:`jsx`};case`mermaid`:return{type:`mermaid`,title:D(e.content)||`Diagram`,language:`mermaid`};case`json`:return{type:`json`,title:L(e.fileName)||`JSON Data`};case`python`:return{type:`code`,title:O(e.content)||L(e.fileName)||`Python Code`,language:`python`};case`css`:return{type:`code`,title:L(e.fileName)||`CSS Styles`,language:`css`};case`javascript`:return{type:`code`,title:k(e.content)||L(e.fileName)||`JavaScript Code`,language:`javascript`};case`typescript`:return{type:`code`,title:L(e.fileName)||`TypeScript Code`,language:`typescript`};default:return t?{type:`code`,title:L(e.fileName)||`${t.toUpperCase()} Code`,language:t}:null}}function B(e){return(j(e.language)||j(F(e.fileName)))===`html`}function V(e){return(j(e.language)||j(F(e.fileName)))===`css`}function H(e){return(j(e.language)||j(F(e.fileName)))===`javascript`}function U(e){let t=M(e),n=t.filter(B);if(n.length===0)return null;let r=t.filter(V),i=t.filter(H);if(r.length===0&&i.length===0)return null;let a=n.find(e=>/(^|[/\\])index\.html?$/i.test(e.fileName||``))||n[0],o=ae(a.content,r,i),s=te(o,r.map(e=>e.content),i.map(e=>e.content));return q(s,`html`)?{artifact:R({type:`html`,title:T(s)||L(a.fileName)||`Interactive HTML App`,description:`Bundled generated HTML, CSS, and JavaScript files into one runnable artifact.`,content:s}),ranges:[a,...r,...i]}:null}function ae(e,t,n){let r=e;for(let e of t){let t=I(e.fileName);t&&(r=r.replace(RegExp(`<link\\b[^>]*href=["'][^"']*${K(t)}["'][^>]*>`,`gi`),``))}for(let e of n){let t=I(e.fileName);t&&(r=r.replace(RegExp(`<script\\b[^>]*src=["'][^"']*${K(t)}["'][^>]*>\\s*<\\/script>`,`gi`),``))}return r}function W(e){let t=/<!doctype\s+html|<html[\s>]/i.exec(e);if(!t||t.index===void 0)return null;let n=M(e);if(oe(t.index,n))return null;let r=t.index,i=/<\/html>/gi;i.lastIndex=r;let a=i.exec(e),o=a?a.index+a[0].length:e.length,s=e.slice(r,o).trim();return q(s,`html`)?{artifact:R({type:`html`,title:T(s)||`HTML Document`,content:s}),ranges:[{start:r,end:o}]}:null}function oe(e,t){return t.some(t=>e>=t.start&&e<=t.end)}function G(e,t){return[...t].sort((e,t)=>t.start-e.start).reduce((e,t)=>`${e.slice(0,t.start)}${e.slice(t.end)}`,e)}function K(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function q(e,t){if(t===`html`){let t=e.trim(),n=/<[^>]+>/.test(t),r=/<(canvas|script|style|button|form|input|select|textarea|video|audio)\b/i.test(t)||/\bon(?:click|input|submit|keydown|keyup|mousemove)=/i.test(t);return n&&(g(t)||t.length>160||r)}if(t===`svg`)return/<svg[^>]*>/.test(e);if(t===`react`)return/<[A-Za-z][^>]*>/.test(e)&&/\b(?:export\s+default|return\s*[(<]|=>\s*[(<]|createRoot|render\s*\()/.test(e);if(t===`mermaid`)return y.test(e.trim());if(t===`json`)try{return JSON.parse(e),e.trim().length>100}catch{return!1}if(t===`code`){let t=e.split(`
|
|
3
|
+
`).length,n=e.trim().length,r=/function|class|def |import |from |const |let |var |if |for |while |try |catch/.test(e);return(n>500||t>15)&&r}return e.trim().length>200}function se(e){let t=[],n=e;for(let e of ne){e.regex.lastIndex=0;let r=[],i;for(;(i=e.regex.exec(n))!==null;){let n=e.extract(i);q(n.content,n.type)&&(t.push(R({type:n.type,title:n.title,content:n.content})),r.push({start:i.index,end:i.index+i[0].length}))}n=G(n,r)}let r=U(n);for(;r;)t.push(r.artifact),n=G(n,r.ranges),r=U(n);let i=W(n);i&&(t.push(i.artifact),n=G(n,i.ranges));let a=M(n),o=[];for(let e of a){let n=z(e);n&&q(e.content,n.type)&&(t.push(R({type:n.type,title:n.title,content:e.content,language:n.language})),o.push(e))}return n=G(n,o),{content:n.trim(),artifacts:t}}var J=new Map;function ce(e,t,n=``){let r=J.get(e);if(n){if((!r||r.state===`none`)&&(J.set(e,{state:`open`,startedAt:Date.now()}),!t))return;let n=J.get(e);t&&n?.state===`open`&&J.set(e,{state:`done`,durationMs:Date.now()-n.startedAt});return}if(r&&r.state!==`open`||!t)return;let a=i(t);r?a.thinkingComplete&&J.set(e,{state:`done`,durationMs:Date.now()-r.startedAt}):a.thinkingComplete?J.set(e,{state:`none`}):J.set(e,{state:`open`,startedAt:Date.now()})}function le(e){let t=J.get(e);if(t){if(t.state===`done`)return t.durationMs;if(t.state===`open`)return Date.now()-t.startedAt}}function ue(e){let t=J.get(e);if(J.delete(e),t){if(t.state===`done`)return t.durationMs;if(t.state===`open`)return Date.now()-t.startedAt}}function Y(e){let t=e/1e3;if(t<.95)return`${Math.max(.1,Math.round(t*10)/10)}s`;if(t<60)return`${Math.round(t)}s`;let n=Math.floor(t/60),r=Math.round(t%60);return r>0?`${n}m ${r}s`:`${n}m`}var de=(e,t)=>{s.setState(n=>{let r=n=>n&&n.id===e?{...n,settings:{...n.settings,...t.length>0?{promptQueue:t}:{promptQueue:void 0}}}:n;return{currentSession:r(n.currentSession),sessions:n.sessions.map(e=>r(e))}})},fe=`…`,pe=/^[ \t]{0,3}(`{3,}|~{3,})/,me=(e,t)=>{let n=[],r=null;for(let i of e.split(`
|
|
4
4
|
`))if(r===null){let e=pe.exec(i);e?(r=e[1],n.push(`${t}.`)):n.push(i)}else RegExp(`^[ \\t]{0,3}${r[0]}{${r.length},}[ \\t]*$`).test(i)&&(r=null);return n.join(`
|
|
5
5
|
`)},he=(e,t)=>{let n=Array.from(e);if(n.length<=t)return e;let r=Math.max(1,t-1),i=n.slice(0,r).join(``),a=i.lastIndexOf(` `);return a>r*.6&&(i=i.slice(0,a)),`${i.replace(/[\s.,;:!?-]+$/,``)}${fe}`};function ge(e,{codeBlockLabel:t,maxLength:n=600}){return he(me(e.replace(/\r\n?/g,`
|
|
6
6
|
`),t).replace(/!\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/\[([^\]]+)\]\([^)]*\)/g,`$1`).replace(/\[([^\]]+)\]\[[^\]]*\]/g,`$1`).replace(/^[ \t]*\[[^\]]+\]:\s+\S+.*$/gm,``).replace(/<!--[\s\S]*?-->/g,` `).replace(/<\/?[A-Za-z][^>\n]*>/g,` `).replace(/`+([^`\n]+)`+/g,`$1`).replace(/^[ \t]*([-*_])([ \t]*\1){2,}[ \t]*$/gm,` `).replace(/^[ \t]*\|?[ \t]*:?-{2,}:?[ \t]*(\|[ \t]*:?-{2,}:?[ \t]*)*\|?[ \t]*$/gm,` `).replace(/^[ \t]{0,3}#{1,6}[ \t]+/gm,``).replace(/[ \t]+#+[ \t]*$/gm,``).replace(/^[ \t]*(?:>[ \t]?)+/gm,``).replace(/^[ \t]*(?:[-*+]|\d+[.)])[ \t]+(?:\[[ xX]\][ \t]+)?/gm,``).replace(/^\|/gm,``).replace(/\|[ \t]*$/gm,``).replace(/[ \t]*\|[ \t]*/g,`, `).replace(/\*\*(?=\S)([\s\S]*?\S)\*\*/g,`$1`).replace(/(?<!\w)__(?=\S)([\s\S]*?\S)__(?!\w)/g,`$1`).replace(/\*(?=\S)([^*\n]*?\S)\*/g,`$1`).replace(/(?<!\w)_(?=\S)([^_\n]*?\S)_(?!\w)/g,`$1`).replace(/~~(?=\S)([\s\S]*?\S)~~/g,`$1`).replace(/\\([\\`*_{}[\]()#+\-.!|>~])/g,`$1`).replace(/\s+/g,` `).trim(),n)}var _e=(e,t)=>{t?.add(e.assistantMessageId),e.cancelRequested=!0,e.jobId&&e.abort.abort()},ve=async e=>{if(!e.cancelledMessageIds.has(e.assistantMessageId))return!1;try{let t=await(e.cancelByIdentity??Q)(e.sessionId,e.assistantMessageId);await e.settle(t)}catch(t){e.onError?.(t)}return!0},ye=e=>{e.retainForContinuation||e.cancelledMessageIds.delete(e.assistantMessageId)},be=async(e,t,n={})=>{if(e.jobId=t.jobId,!e.cancelRequested)return`stream`;e.abort.abort();let[,r]=await Promise.allSettled([(n.byJob??Te)(t.jobId),(n.byIdentity??Q)(e.sessionId,e.assistantMessageId)]);if(r.status===`rejected`)throw r.reason;return r.value.completed?`completed`:`cancelled`},xe=async e=>{let t=await e.loadSession(e.sessionId);if(t.id!==e.sessionId)throw Error(`Reloaded chat session does not match the completed turn.`);if(!t.messages.find(t=>t.id===e.assistantMessageId&&t.role===`assistant`))throw Error(`Completed assistant message is absent from chat storage.`);return e.applySession(t),t},X=async e=>{try{let t=await e.json(),n=typeof t.error==`string`?t.error:typeof t.message==`string`?t.message:void 0;if(n)return Error(n)}catch{}return Error(`Chat event request failed with status ${e.status}.`)},Z=()=>{let e=localStorage.getItem(`auth-token`);return e?{Authorization:`Bearer ${e}`}:{}},Se=async e=>{let t=await fetch(`${p}/chat/sessions/${encodeURIComponent(e.sessionId)}/generations`,{method:`POST`,headers:{"Content-Type":`application/json`,...Z()},credentials:`same-origin`,signal:e.signal,body:JSON.stringify({message:e.message,images:e.images,userMessageId:e.userMessageId,assistantMessageId:e.assistantMessageId,options:e.options,webSearch:e.webSearch,tools:e.tools===!0,...e.toolSelection?{toolSelection:e.toolSelection}:{},regenerate:e.regenerate===!0,originalMessageId:e.originalMessageId,...e.modelOverride?{modelOverride:e.modelOverride}:{},...e.compare?{compare:!0}:{}})});if(!t.ok)throw await X(t);let n=await t.json();if(!n.data?.jobId)throw Error(`Chat generation response did not include a durable job.`);return n.data},Ce=async(e,t)=>{if(!e.body)throw Error(`Chat event stream has no response body.`);let n=e.body.getReader(),r=new TextDecoder,i=``,a=0,o=!1,s=e=>{let n,r=[];for(let t of e.split(`
|
|
@@ -10,4 +10,4 @@ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./react-ve
|
|
|
10
10
|
|
|
11
11
|
`);for(;a>=0;)s(i.slice(0,a)),i=i.slice(a+2),a=i.indexOf(`
|
|
12
12
|
|
|
13
|
-
`);if(e||o)break}}finally{await n.cancel().catch(()=>void 0),n.releaseLock()}return{cursor:a,terminal:o}},we=async e=>{let t=0,n=0;for(;!e.signal.aborted;){let r=new URL(`${p}/chat/sessions/${encodeURIComponent(e.sessionId)}/events`,window.location.origin);r.searchParams.set(`after`,String(t)),r.searchParams.set(`generation`,e.assistantMessageId);try{let i=await fetch(r,{headers:{Accept:`text/event-stream`,...Z()},credentials:`same-origin`,cache:`no-store`,signal:e.signal});if(!i.ok)throw await X(i);if((await Ce(i,(n,r)=>{e.onEvent(r),t=n})).terminal)return;n=0}catch(t){if(e.signal.aborted||(n+=1,n>8))throw t}await new Promise((t,r)=>{let i=window.setTimeout(()=>{e.signal.removeEventListener(`abort`,a),t()},Math.min(5e3,n*500+250)),a=()=>{window.clearTimeout(i),e.signal.removeEventListener(`abort`,a),r(e.signal.reason??Error(`Chat stream cancelled`))};e.signal.addEventListener(`abort`,a,{once:!0})})}},Te=async e=>{let t=await fetch(`${p}/jobs/${encodeURIComponent(e)}/cancel`,{method:`POST`,headers:Z(),credentials:`same-origin`});if(!t.ok)throw await X(t)},Q=async(e,t)=>{let n=await fetch(`${p}/chat/sessions/${encodeURIComponent(e)}/generations/${encodeURIComponent(t)}/cancel`,{method:`POST`,headers:Z(),credentials:`same-origin`});if(!n.ok)throw await X(n);let r=(await n.json()).data;if(!r)throw Error(`Chat cancellation response did not include a decision.`);let i=typeof r.jobId==`string`?r.jobId:void 0;if(r.completed!==!0&&r.pending!==!0&&!i)throw Error(`Chat cancellation response did not include a decision.`);return{completed:r.completed===!0,pending:r.pending===!0,...i?{jobId:i}:{},...typeof r.state==`string`?{state:r.state}:{}}},$=r(`use-chat`),Ee=new Set([`New Chat`,`New Demo Session`]),De=e=>!e||Ee.has(e),Oe=e=>{let t=l.getState();return t.currentSession?.id===e?t.currentSession.title:t.sessions.find(t=>t.id===e)?.title},ke=e=>{let t=l.getState(),n=t.getCurrentPersona();if(n?.name)return n.name;let r=t.currentSession?.model??``;return!r||r.startsWith(`persona:`)?e:(t.modelMetadata[r]??Object.entries(t.modelMetadata).find(([e])=>e.slice(e.indexOf(`/`)+1)===r)?.[1])?.label||r},Ae=e=>{let{t}=s(),r=(0,_.useCallback)(e=>{let n=ke(t(`chatMessage.assistant`)),r=ge(o(e).content,{codeBlockLabel:t(`chat.announce.codeBlock`)});f(r?t(`chat.announce.replyFinished`,{name:n,text:r}):t(`chat.announce.replyFinishedNoText`,{name:n}))},[t]),[a,p]=(0,_.useState)(``),[te,g]=(0,_.useState)(``),[v,y]=(0,_.useState)(null),[b,x]=(0,_.useState)(!1),[ne,S]=(0,_.useState)([]),[C,w]=(0,_.useState)([]),[T,E]=(0,_.useState)(null),{addMessage:D,updateMessage:O,updateMessageWithStatistics:k,applySessionTitle:A,setGeneratingTitleForSession:j,removeMessage:M}=l(),{setIsGenerating:N}=u(),re=(0,_.useRef)(null),ie=(0,_.useRef)(new Map),P=(0,_.useRef)(null),F=(0,_.useRef)(new Set),I=(0,_.useRef)(null),L=(0,_.useRef)(null),R=(0,_.useRef)(``),z=(0,_.useRef)(``),B=(0,_.useRef)(0),V=(0,_.useRef)(void 0),H=(0,_.useRef)(null),U=(0,_.useRef)(``),ae=(0,_.useRef)(``),W=(0,_.useCallback)(()=>{H.current!==null&&typeof window<`u`&&window.cancelAnimationFrame(H.current),H.current=null},[]),oe=(0,_.useCallback)((e,t=!1,n=``)=>{U.current=e,ae.current=n,t||typeof window>`u`?(W(),p(e),g(n)):H.current===null&&(H.current=window.requestAnimationFrame(()=>{H.current=null,p(U.current),g(ae.current)}))},[W]),G=(0,_.useCallback)(()=>{W(),U.current=``,ae.current=``,p(``),g(``)},[W]),K=(0,_.useCallback)((e,t)=>{l.setState(n=>{let r=n.currentSession?.id===e.id?n.currentSession:n.sessions.find(t=>t.id===e.id),i=r&&t!==void 0&&r.title!==t?{...e,title:r.title,updatedAt:Math.max(r.updatedAt,e.updatedAt)}:e;return{sessions:n.sessions.some(t=>t.id===e.id)?n.sessions.map(t=>t.id===e.id?i:t):[i,...n.sessions],currentSession:n.currentSession?.id===e.id?i:n.currentSession}})},[]),q=(0,_.useCallback)(async(e,t)=>{let n=Oe(e);await xe({sessionId:e,assistantMessageId:t,loadSession:async e=>{let t=await m.getSession(e);if(!t.success||!t.data)throw Error(t.error||`Completed chat session could not be reloaded.`);return t.data},applySession:e=>K(e,n)})},[K]),J=(0,_.useCallback)(async(e,t,n,r={})=>{n.completed?await q(e,t):M(e,t),ye({assistantMessageId:t,cancelledMessageIds:F.current,decision:n,retainForContinuation:r.retainForContinuation})},[q,M]),le=(0,_.useCallback)(async(e,n)=>{let r=u.getState().preferences.titleSettings;if(n&&r?.autoTitle&&r?.taskModel){$.debug(`Triggering auto-title generation...`),j(e);try{let i=await m.generateTitle(e,r.taskModel,n,r.taskProviderType,r.taskProviderId);if($.debug(`Title generation response:`,i),!i.success||!i.data?.title)throw Error(i.error||`Title generation returned no title`);A(e,i.data.title,i.data.updatedAt),i.data.source===`fallback`?d.error(t(`chat.toasts.titlePreviewFallback`)):d.success(t(`chat.toasts.titleGenerated`))}catch(e){$.error(`Failed to generate title:`,e),d.error(t(`chat.toasts.titleGenerationFailed`))}finally{l.getState().generatingTitleForSession===e&&j(null)}}},[A,j,t]);(0,_.useEffect)(()=>{let t=F.current;return()=>{let n=P.current,r=L.current;if(r){let e=!r.jobId;_e(r,t),Q(r.sessionId,r.assistantMessageId).then(t=>J(r.sessionId,r.assistantMessageId,t,{retainForContinuation:e})).catch(e=>$.error(`Failed to cancel durable chat generation:`,e)),r.jobId&&Te(r.jobId).catch(e=>$.error(`Failed to cancel durable chat generation:`,e)),L.current=null}n&&e&&!r&&h.send({type:`chat_cancel`,data:{sessionId:e,assistantMessageId:n}}),h.offMessage(`user_message`),h.offMessage(`assistant_chunk`),h.offMessage(`assistant_complete`),h.offMessage(`assistant_cancelled`),h.offMessage(`tool_status`),h.offMessage(`error`)}},[e,J]),(0,_.useEffect)(()=>{if(!e)h.offMessage(`user_message`),h.offMessage(`assistant_chunk`),h.offMessage(`assistant_complete`),h.offMessage(`assistant_cancelled`),h.offMessage(`tool_status`),h.offMessage(`tool_event`),h.offMessage(`error`);else return h.onMessage(`user_message`,()=>{}),h.onMessage(`assistant_chunk`,t=>{let n=t,r=n.messageId||P.current;r&&F.current.has(r)||r&&P.current&&r!==P.current||r&&(typeof n.total==`string`?R.current=n.total:typeof n.content==`string`&&(R.current+=n.content),typeof n.thinkingTotal==`string`?z.current=n.thinkingTotal:typeof n.thinking==`string`&&(z.current+=n.thinking),ce(r,R.current,z.current),oe(R.current,n.done,z.current),V.current&&clearTimeout(V.current),V.current=setTimeout(()=>{O(e,r,R.current),B.current=Date.now()},n.done?0:200))}),h.onMessage(`tool_status`,e=>{let t=e;S(e=>e.find(e=>e.toolCallId===t.toolCallId)?e.map(e=>e.toolCallId===t.toolCallId?{...e,phase:t.phase}:e):[...e,{toolCallId:t.toolCallId,name:t.name,phase:t.phase,startedAt:Date.now()}])}),h.onMessage(`tool_event`,e=>{let t=e;if(t.type&&t.messageId&&!(P.current&&t.messageId!==P.current)){if(t.type===`chat.tool-call.v1`&&t.toolCall){let e=t.toolCall;w(t=>t.find(t=>t.id===e.id)?t.map(t=>t.id===e.id?e:t):[...t,e])}else if(t.type===`chat.tool-result.v1`&&t.toolCallId)w(e=>e.map(e=>e.id===t.toolCallId?{...e,status:t.status??e.status,resultPreview:t.preview,isError:t.isError===!0,finishedAt:Date.now()}:e)),E(e=>e&&e.toolCall.id===t.toolCallId?null:e);else if(t.type===`chat.approval.v1`&&t.approvalId&&t.toolCall){let e=t.toolCall;w(t=>t.find(t=>t.id===e.id)?t.map(t=>t.id===e.id?e:t):[...t,e]),E({approvalId:t.approvalId,messageId:t.messageId,toolCall:e,expiresAt:t.expiresAt??Date.now()+12e4})}}}),h.onMessage(`assistant_complete`,t=>{let n=t;$.debug(`Hook: Received assistant_complete for session:`,e,`messageId:`,n.messageId,`with statistics:`,!!n.statistics);let i=n.messageId||P.current,a=!i||i===P.current;if(i&&F.current.delete(i),!a){if(n.truncated&&i){q(e,i);return}i&&k(e,i,n.content,n.statistics,n.providerMetadata,n.thinking);return}let s=P.current!==null;if(x(!1),G(),N(!1),S([]),w([]),E(null),n&&i){let t=R.current||n.content,a=z.current||n.thinking,c=ue(i),l=n.statistics?.thinking_duration_ms===void 0&&c!==void 0?{...n.statistics,thinking_duration_ms:c}:n.statistics;k(e,i,t,l,n.providerMetadata,a),s&&r(t);let{preferences:d,openArtifactPanel:f}=u.getState();if(d.autoOpenArtifactPanel!==!1){let{artifacts:e}=se(o(t).content);e.length>0&&f(e[e.length-1])}}P.current=null,R.current=``,z.current=``,window.setTimeout(()=>{re.current?.()},0),V.current&&clearTimeout(V.current),B.current=0}),h.onMessage(`assistant_cancelled`,t=>{let n=t,r=n.assistantMessageId;r&&n.sessionId===e&&F.current.has(r)&&(F.current.delete(r),M(e,r),P.current===r&&(x(!1),G(),y(null),N(!1),S([]),w([]),E(null),P.current=null,R.current=``,z.current=``))}),h.onMessage(`error`,e=>{let n=e;x(!1),G(),N(!1),w([]),E(null),P.current=null,z.current=``,n.code===`SESSION_NOT_FOUND`?($.warn(`Session not found, redirecting to create new session...`),d.error(t(`chat.toasts.sessionNotFoundRedirect`)),window.location.href=`/`):d.error(n.error)}),x(!1),G(),P.current=null,z.current=``,()=>{V.current&&clearTimeout(V.current),W()}},[e,O,k,N,oe,G,W,M,q,r,t]);let Y=(0,_.useCallback)(async(a,o,s,u,f,p,m)=>{if(!e||!a.trim()&&(!o||o.length===0))return;let ee;try{let te=l.getState(),g=te.currentSession,_={model:g?.personaId?`persona:${g.personaId}`:g?.model||``,providerType:g?.providerType,providerId:g?.providerId};if(!c(te.models,_)){d.error(t(`chat.model.selectBeforeSending`));return}N(!0),x(!0),G(),w([]),E(null),R.current=``,z.current=``,V.current&&clearTimeout(V.current),B.current=Date.now();let v=g?.isPrivate===!0,b=g?.messages?.some(e=>e.role===`user`),ne=!v&&!b&&De(g?.title),S=i();D(e,{id:S,role:`user`,content:a.trim(),images:o});let C=i();if(ee=C,P.current=C,z.current=``,y(C),D(e,{role:`assistant`,content:``,id:C}),ne&&le(e,a.trim()),n()){let t=`Demo response for: ${a.trim()}`;I.current=window.setTimeout(()=>{I.current=null,!F.current.has(C)&&(O(e,C,t),r(t),x(!1),G(),y(null),N(!1),P.current=null,R.current=``,z.current=``)},500);return}if(!v){let n=new AbortController,r={sessionId:e,assistantMessageId:C,abort:n};L.current=r;let c=await be(r,await Se({sessionId:e,message:a.trim(),images:o,userMessageId:S,assistantMessageId:C,options:{...g?.settings?.generationOptions??{},...s===void 0?{}:{format:s}},webSearch:u===!0,tools:f===!0,...f===!0&&p?{toolSelection:p}:{},signal:n.signal}));if(c!==`stream`){await J(e,C,{completed:c===`completed`,pending:!1,state:c===`completed`?`succeeded`:`cancelled`}),L.current===r&&(L.current=null);return}for(let n of m??[]){let r=i(),c=new AbortController;ie.current.set(r,c),l.getState().addPendingComparison({sessionId:e,assistantMessageId:r,model:n.model}),(async()=>{try{await Se({sessionId:e,message:a.trim(),images:o,userMessageId:S,assistantMessageId:r,options:{...g?.settings?.generationOptions??{},...s===void 0?{}:{format:s}},webSearch:!1,compare:!0,modelOverride:n,signal:c.signal}),await we({sessionId:e,assistantMessageId:r,signal:c.signal,onEvent:i=>{i.type===`done`?q(e,r):i.type===`error`&&d.error(t(`chat.toasts.comparisonError`,{model:n.model,error:String(i.error??t(`chat.toasts.generationFailed`))}))}})}catch(e){c.signal.aborted||($.error(`Comparison generation failed:`,e),d.error(t(`chat.toasts.comparisonError`,{model:n.model,error:t(`chat.toasts.comparisonFailed`)})))}finally{ie.current.delete(r),l.getState().removePendingComparison(r)}})()}await we({sessionId:e,assistantMessageId:C,signal:n.signal,onEvent:t=>{t.type===`chunk`?h.dispatchMessage(`assistant_chunk`,t):t.type===`done`?h.dispatchMessage(`assistant_complete`,t):typeof t.type==`string`&&(t.type.startsWith(`chat.tool`)||t.type.startsWith(`chat.approval`))?h.dispatchMessage(`tool_event`,t):t.type===`error`&&h.dispatchMessage(`error`,{...t,sessionId:e})}}),L.current?.assistantMessageId===C&&(L.current=null);return}h.isConnected||await h.connect();let T=v?g?.messages?.filter(e=>e.role!==`system`&&e.id!==C).map(e=>({role:e.role,content:e.content,thinking:e.thinking,images:e.images,providerMetadata:e.providerMetadata})):void 0;h.send({type:`chat_stream`,data:{sessionId:e,content:a.trim(),images:o,format:s,options:g?.settings?.generationOptions??{},assistantMessageId:C,isPrivate:v,...u===!0?{webSearch:!0}:{},...v?{model:g?.model,providerType:g?.providerType,providerId:g?.providerId,messageHistory:T}:{}}})}catch(n){let r=ee;if(r&&await ve({sessionId:e,assistantMessageId:r,cancelledMessageIds:F.current,settle:t=>J(e,r,t),onError:e=>$.error(`Failed to resolve cancelled durable chat generation:`,e)})){L.current?.assistantMessageId===r&&(L.current=null);return}if(n instanceof DOMException&&n.name===`AbortError`)return;$.error(`Failed to send message:`,n),x(!1),G(),y(null),N(!1),P.current=null,z.current=``,d.error(t(`chat.toasts.sendFailed`))}},[e,D,O,N,G,le,J,q,r,t]),fe=(0,_.useCallback)(()=>{let n=P.current;if(n){if(f(t(`chat.announce.generationStopped`)),F.current.add(n),I.current!==null)window.clearTimeout(I.current),I.current=null,M(e,n),F.current.delete(n);else if(L.current?.assistantMessageId===n){let t=L.current,r=!t.jobId;_e(t),Q(e,n).then(async i=>{await J(e,n,i,{retainForContinuation:r}),L.current===t&&(L.current=null)}).catch(e=>$.error(`Failed to cancel durable chat generation:`,e)),t.jobId&&Te(t.jobId).catch(e=>$.error(`Failed to cancel durable chat generation:`,e))}else h.send({type:`chat_cancel`,data:{sessionId:e,assistantMessageId:n}})||(M(e,n),F.current.delete(n))}V.current&&=(clearTimeout(V.current),void 0),x(!1),G(),y(null),N(!1),P.current=null,R.current=``,z.current=``},[N,G,M,e,J,t]),pe=(0,_.useCallback)(async()=>{let n=l.getState(),r=n.currentSession;if(!r||!e)return;if(!c(n.models,{model:r.personaId?`persona:${r.personaId}`:r.model,providerType:r.providerType,providerId:r.providerId})){d.error(t(`chat.model.selectBeforeRegenerating`));return}let a=r.messages,o=-1,s=-1;for(let e=a.length-1;e>=0;e--)if(a[e].role===`assistant`){s=e;break}if(s>0){for(let e=s-1;e>=0;e--)if(a[e].role===`user`){o=e;break}}if(o===-1||s===-1){d.error(t(`chat.toasts.noMessageToRegenerate`));return}let u=a[o],f=a[s],p;try{N(!0),x(!0),G(),R.current=``,z.current=``,V.current&&clearTimeout(V.current),B.current=Date.now();let t=i();p=t,P.current=t,z.current=``,y(t),D(e,{role:`assistant`,content:``,id:t,parentId:f.parentId||f.id,branchIndex:f.siblingCount||1,isActive:!0});let n=r.isPrivate===!0;if(!n){let n=new AbortController,i={sessionId:e,assistantMessageId:t,abort:n};L.current=i;let a=await be(i,await Se({sessionId:e,message:u.content,images:u.images,userMessageId:u.id,assistantMessageId:t,options:r.settings?.generationOptions??{},webSearch:!1,regenerate:!0,originalMessageId:f.id,signal:n.signal}));if(a!==`stream`){await J(e,t,{completed:a===`completed`,pending:!1,state:a===`completed`?`succeeded`:`cancelled`}),L.current===i&&(L.current=null);return}await we({sessionId:e,assistantMessageId:t,signal:n.signal,onEvent:t=>{t.type===`chunk`?h.dispatchMessage(`assistant_chunk`,t):t.type===`done`?h.dispatchMessage(`assistant_complete`,t):t.type===`error`&&h.dispatchMessage(`error`,{...t,sessionId:e})}}),L.current?.assistantMessageId===t&&(L.current=null);return}h.isConnected||await h.connect();let o=n?a.filter(e=>e.role!==`system`).map(e=>({role:e.role,content:e.content,thinking:e.thinking,images:e.images,providerMetadata:e.providerMetadata})):void 0;h.send({type:`chat_stream`,data:{sessionId:e,content:u.content,images:u.images,options:r.settings?.generationOptions??{},assistantMessageId:t,regenerate:!0,originalMessageId:f.id,isPrivate:n,...n?{model:r.model,providerType:r.providerType,providerId:r.providerId,messageHistory:o}:{}}})}catch(n){let r=p;if(r&&await ve({sessionId:e,assistantMessageId:r,cancelledMessageIds:F.current,settle:t=>J(e,r,t),onError:e=>$.error(`Failed to resolve cancelled durable chat regeneration:`,e)})){L.current?.assistantMessageId===r&&(L.current=null);return}$.error(`Failed to regenerate message:`,n),r&&M(e,r);try{let t=Oe(e),n=await m.getSession(e);n.success&&n.data&&K(n.data,t)}catch(e){$.error(`Failed to reload session after regenerate:`,e)}x(!1),G(),y(null),N(!1),P.current=null,z.current=``,d.error(t(`chat.toasts.regenerateFailed`))}},[e,N,G,D,M,K,J,t]),me=(0,_.useCallback)(async n=>{let r=l.getState().currentSession;if(!r||!e)return;let i=r.messages.find(e=>e.id===n);if(!i){d.error(t(`chat.toasts.messageNotFound`));return}if(i.isActive!==!1)return;let a=i.parentId||i.id,o=i.branchIndex||0;try{let i=await m.switchMessageBranch(e,n,o);if(i.success&&i.data){let i=r.messages.map(e=>e.id===a||e.parentId===a?{...e,isActive:e.id===n}:e),s={...r,messages:i,updatedAt:Date.now()};l.setState(t=>({sessions:t.sessions.map(t=>t.id===e?s:t),currentSession:s})),d.success(t(`chat.toasts.branchSwitched`,{number:o+1}))}else d.error(i.error||t(`chat.toasts.branchSelectFailed`))}catch(e){$.error(`Failed to select branch:`,e),d.error(t(`chat.toasts.branchSelectFailed`))}},[e,t]),he=(0,_.useCallback)(async(n,r)=>{if(!e||!r.trim())return;let i=l.getState(),a=i.currentSession;if(!a||a.id!==e)return;let o=a.messages.findIndex(e=>e.id===n);if(o===-1||a.messages[o].role!==`user`)return;let s=a.messages[o];try{if(!a.isPrivate){let t=await m.truncateMessagesFrom(e,n);if(!t.success)throw Error(t.error||`Failed to truncate session`)}i.truncateMessagesFrom(e,n),await Y(r,s.images)}catch(e){$.error(`Failed to edit message:`,e),d.error(t(`chat.toasts.editFailed`))}},[e,Y,t]),X=(0,_.useCallback)(async(e,n,r)=>{try{await ee.decideApproval(e,n,r),E(t=>t&&t.approvalId===e?null:t)}catch(e){$.error(`Failed to record the tool decision:`,e),d.error(t(`chat.toasts.toolDecisionFailed`))}},[t]),Z=(0,_.useCallback)(async()=>{if(!e)return;let t=l.getState().currentSession;if(!t||t.id!==e||t.isPrivate||u.getState().isGenerating)return;let n=t.settings?.promptQueue;if(n&&n.length!==0)try{let t=await m.claimQueuedPrompt(e,n[0].id);if(!t.success||!t.data)return;de(e,t.data.queue),await Y(t.data.entry.content)}catch(e){$.error(`Prompt queue drain failed:`,e)}},[e,Y]);return(0,_.useEffect)(()=>{re.current=Z},[Z]),(0,_.useEffect)(()=>{if(!e)return;let t=window.setTimeout(()=>{re.current?.()},400);return()=>window.clearTimeout(t)},[e]),{sendMessage:Y,stopGeneration:fe,cancelComparison:(0,_.useCallback)(async t=>{if(e){ie.current.get(t)?.abort();try{await Q(e,t)}catch(e){$.error(`Failed to cancel the comparison generation:`,e)}finally{l.getState().removePendingComparison(t)}}},[e]),regenerateLastMessage:pe,editAndResendMessage:he,selectBranch:me,isStreaming:b,streamingMessage:a,streamingThinking:te,streamingMessageId:v,toolActivities:ne,activeToolCalls:C,pendingToolApproval:T,decideToolApproval:X}};export{le as a,Y as i,Ae as n,se as o,de as r,De as t};
|
|
13
|
+
`);if(e||o)break}}finally{await n.cancel().catch(()=>void 0),n.releaseLock()}return{cursor:a,terminal:o}},we=async e=>{let t=0,n=0;for(;!e.signal.aborted;){let r=new URL(`${p}/chat/sessions/${encodeURIComponent(e.sessionId)}/events`,window.location.origin);r.searchParams.set(`after`,String(t)),r.searchParams.set(`generation`,e.assistantMessageId);try{let i=await fetch(r,{headers:{Accept:`text/event-stream`,...Z()},credentials:`same-origin`,cache:`no-store`,signal:e.signal});if(!i.ok)throw await X(i);if((await Ce(i,(n,r)=>{e.onEvent(r),t=n})).terminal)return;n=0}catch(t){if(e.signal.aborted||(n+=1,n>8))throw t}await new Promise((t,r)=>{let i=window.setTimeout(()=>{e.signal.removeEventListener(`abort`,a),t()},Math.min(5e3,n*500+250)),a=()=>{window.clearTimeout(i),e.signal.removeEventListener(`abort`,a),r(e.signal.reason??Error(`Chat stream cancelled`))};e.signal.addEventListener(`abort`,a,{once:!0})})}},Te=async e=>{let t=await fetch(`${p}/jobs/${encodeURIComponent(e)}/cancel`,{method:`POST`,headers:Z(),credentials:`same-origin`});if(!t.ok)throw await X(t)},Q=async(e,t)=>{let n=await fetch(`${p}/chat/sessions/${encodeURIComponent(e)}/generations/${encodeURIComponent(t)}/cancel`,{method:`POST`,headers:Z(),credentials:`same-origin`});if(!n.ok)throw await X(n);let r=(await n.json()).data;if(!r)throw Error(`Chat cancellation response did not include a decision.`);let i=typeof r.jobId==`string`?r.jobId:void 0;if(r.completed!==!0&&r.pending!==!0&&!i)throw Error(`Chat cancellation response did not include a decision.`);return{completed:r.completed===!0,pending:r.pending===!0,...i?{jobId:i}:{},...typeof r.state==`string`?{state:r.state}:{}}},$=l(`use-chat`),Ee=new Set([`New Chat`,`New Demo Session`]),De=e=>!e||Ee.has(e),Oe=e=>{let t=s.getState();return t.currentSession?.id===e?t.currentSession.title:t.sessions.find(t=>t.id===e)?.title},ke=e=>{let t=s.getState(),n=t.getCurrentPersona();if(n?.name)return n.name;let r=t.currentSession?.model??``;return!r||r.startsWith(`persona:`)?e:(t.modelMetadata[r]??Object.entries(t.modelMetadata).find(([e])=>e.slice(e.indexOf(`/`)+1)===r)?.[1])?.label||r},Ae=e=>{let{t}=a(),r=(0,_.useCallback)(e=>{let n=ke(t(`chatMessage.assistant`)),r=ge(i(e).content,{codeBlockLabel:t(`chat.announce.codeBlock`)});f(r?t(`chat.announce.replyFinished`,{name:n,text:r}):t(`chat.announce.replyFinishedNoText`,{name:n}))},[t]),[l,p]=(0,_.useState)(``),[te,g]=(0,_.useState)(``),[v,y]=(0,_.useState)(null),[b,x]=(0,_.useState)(!1),[ne,S]=(0,_.useState)([]),[C,w]=(0,_.useState)([]),[T,E]=(0,_.useState)(null),{addMessage:D,updateMessage:O,updateMessageWithStatistics:k,applySessionTitle:A,setGeneratingTitleForSession:j,removeMessage:M}=s(),{setIsGenerating:N}=u(),re=(0,_.useRef)(null),ie=(0,_.useRef)(new Map),P=(0,_.useRef)(null),F=(0,_.useRef)(new Set),I=(0,_.useRef)(null),L=(0,_.useRef)(null),R=(0,_.useRef)(``),z=(0,_.useRef)(``),B=(0,_.useRef)(0),V=(0,_.useRef)(void 0),H=(0,_.useRef)(null),U=(0,_.useRef)(``),ae=(0,_.useRef)(``),W=(0,_.useCallback)(()=>{H.current!==null&&typeof window<`u`&&window.cancelAnimationFrame(H.current),H.current=null},[]),oe=(0,_.useCallback)((e,t=!1,n=``)=>{U.current=e,ae.current=n,t||typeof window>`u`?(W(),p(e),g(n)):H.current===null&&(H.current=window.requestAnimationFrame(()=>{H.current=null,p(U.current),g(ae.current)}))},[W]),G=(0,_.useCallback)(()=>{W(),U.current=``,ae.current=``,p(``),g(``)},[W]),K=(0,_.useCallback)((e,t)=>{s.setState(n=>{let r=n.currentSession?.id===e.id?n.currentSession:n.sessions.find(t=>t.id===e.id),i=r&&t!==void 0&&r.title!==t?{...e,title:r.title,updatedAt:Math.max(r.updatedAt,e.updatedAt)}:e;return{sessions:n.sessions.some(t=>t.id===e.id)?n.sessions.map(t=>t.id===e.id?i:t):[i,...n.sessions],currentSession:n.currentSession?.id===e.id?i:n.currentSession}})},[]),q=(0,_.useCallback)(async(e,t)=>{let n=Oe(e);await xe({sessionId:e,assistantMessageId:t,loadSession:async e=>{let t=await m.getSession(e);if(!t.success||!t.data)throw Error(t.error||`Completed chat session could not be reloaded.`);return t.data},applySession:e=>K(e,n)})},[K]),J=(0,_.useCallback)(async(e,t,n,r={})=>{n.completed?await q(e,t):M(e,t),ye({assistantMessageId:t,cancelledMessageIds:F.current,decision:n,retainForContinuation:r.retainForContinuation})},[q,M]),le=(0,_.useCallback)(async(e,n)=>{let r=u.getState().preferences.titleSettings;if(n&&r?.autoTitle&&r?.taskModel){$.debug(`Triggering auto-title generation...`),j(e);try{let i=await m.generateTitle(e,r.taskModel,n,r.taskProviderType,r.taskProviderId);if($.debug(`Title generation response:`,i),!i.success||!i.data?.title)throw Error(i.error||`Title generation returned no title`);A(e,i.data.title,i.data.updatedAt),i.data.source===`fallback`?d.error(t(`chat.toasts.titlePreviewFallback`)):d.success(t(`chat.toasts.titleGenerated`))}catch(e){$.error(`Failed to generate title:`,e),d.error(t(`chat.toasts.titleGenerationFailed`))}finally{s.getState().generatingTitleForSession===e&&j(null)}}},[A,j,t]);(0,_.useEffect)(()=>{let t=F.current;return()=>{let n=P.current,r=L.current;if(r){let e=!r.jobId;_e(r,t),Q(r.sessionId,r.assistantMessageId).then(t=>J(r.sessionId,r.assistantMessageId,t,{retainForContinuation:e})).catch(e=>$.error(`Failed to cancel durable chat generation:`,e)),r.jobId&&Te(r.jobId).catch(e=>$.error(`Failed to cancel durable chat generation:`,e)),L.current=null}n&&e&&!r&&h.send({type:`chat_cancel`,data:{sessionId:e,assistantMessageId:n}}),h.offMessage(`user_message`),h.offMessage(`assistant_chunk`),h.offMessage(`assistant_complete`),h.offMessage(`assistant_cancelled`),h.offMessage(`tool_status`),h.offMessage(`error`)}},[e,J]),(0,_.useEffect)(()=>{if(!e)h.offMessage(`user_message`),h.offMessage(`assistant_chunk`),h.offMessage(`assistant_complete`),h.offMessage(`assistant_cancelled`),h.offMessage(`tool_status`),h.offMessage(`tool_event`),h.offMessage(`error`);else return h.onMessage(`user_message`,()=>{}),h.onMessage(`assistant_chunk`,t=>{let n=t,r=n.messageId||P.current;r&&F.current.has(r)||r&&P.current&&r!==P.current||r&&(typeof n.total==`string`?R.current=n.total:typeof n.content==`string`&&(R.current+=n.content),typeof n.thinkingTotal==`string`?z.current=n.thinkingTotal:typeof n.thinking==`string`&&(z.current+=n.thinking),ce(r,R.current,z.current),oe(R.current,n.done,z.current),V.current&&clearTimeout(V.current),V.current=setTimeout(()=>{O(e,r,R.current),B.current=Date.now()},n.done?0:200))}),h.onMessage(`tool_status`,e=>{let t=e;S(e=>e.find(e=>e.toolCallId===t.toolCallId)?e.map(e=>e.toolCallId===t.toolCallId?{...e,phase:t.phase}:e):[...e,{toolCallId:t.toolCallId,name:t.name,phase:t.phase,startedAt:Date.now()}])}),h.onMessage(`tool_event`,e=>{let t=e;if(t.type&&t.messageId&&!(P.current&&t.messageId!==P.current)){if(t.type===`chat.tool-call.v1`&&t.toolCall){let e=t.toolCall;w(t=>t.find(t=>t.id===e.id)?t.map(t=>t.id===e.id?e:t):[...t,e])}else if(t.type===`chat.tool-result.v1`&&t.toolCallId)w(e=>e.map(e=>e.id===t.toolCallId?{...e,status:t.status??e.status,resultPreview:t.preview,isError:t.isError===!0,finishedAt:Date.now()}:e)),E(e=>e&&e.toolCall.id===t.toolCallId?null:e);else if(t.type===`chat.approval.v1`&&t.approvalId&&t.toolCall){let e=t.toolCall;w(t=>t.find(t=>t.id===e.id)?t.map(t=>t.id===e.id?e:t):[...t,e]),E({approvalId:t.approvalId,messageId:t.messageId,toolCall:e,expiresAt:t.expiresAt??Date.now()+12e4})}}}),h.onMessage(`assistant_complete`,t=>{let n=t;$.debug(`Hook: Received assistant_complete for session:`,e,`messageId:`,n.messageId,`with statistics:`,!!n.statistics);let a=n.messageId||P.current,o=!a||a===P.current;if(a&&F.current.delete(a),!o){if(n.truncated&&a){q(e,a);return}a&&k(e,a,n.content,n.statistics,n.providerMetadata,n.thinking);return}let s=P.current!==null;if(x(!1),G(),N(!1),S([]),w([]),E(null),n&&a){let t=R.current||n.content,o=z.current||n.thinking,c=ue(a),l=n.statistics?.thinking_duration_ms===void 0&&c!==void 0?{...n.statistics,thinking_duration_ms:c}:n.statistics;k(e,a,t,l,n.providerMetadata,o),s&&r(t);let{preferences:d,openArtifactPanel:f}=u.getState();if(d.autoOpenArtifactPanel!==!1){let{artifacts:e}=se(i(t).content);e.length>0&&f(e[e.length-1])}}P.current=null,R.current=``,z.current=``,window.setTimeout(()=>{re.current?.()},0),V.current&&clearTimeout(V.current),B.current=0}),h.onMessage(`assistant_cancelled`,t=>{let n=t,r=n.assistantMessageId;r&&n.sessionId===e&&F.current.has(r)&&(F.current.delete(r),M(e,r),P.current===r&&(x(!1),G(),y(null),N(!1),S([]),w([]),E(null),P.current=null,R.current=``,z.current=``))}),h.onMessage(`error`,e=>{let n=e;x(!1),G(),N(!1),w([]),E(null),P.current=null,z.current=``,n.code===`SESSION_NOT_FOUND`?($.warn(`Session not found, redirecting to create new session...`),d.error(t(`chat.toasts.sessionNotFoundRedirect`)),window.location.href=`/`):d.error(n.error)}),x(!1),G(),P.current=null,z.current=``,()=>{V.current&&clearTimeout(V.current),W()}},[e,O,k,N,oe,G,W,M,q,r,t]);let Y=(0,_.useCallback)(async(i,a,l,u,f,p,m)=>{if(!e||!i.trim()&&(!a||a.length===0))return;let ee;try{let te=s.getState(),g=te.currentSession,_={model:g?.personaId?`persona:${g.personaId}`:g?.model||``,providerType:g?.providerType,providerId:g?.providerId};if(!o(te.models,_)){d.error(t(`chat.model.selectBeforeSending`));return}N(!0),x(!0),G(),w([]),E(null),R.current=``,z.current=``,V.current&&clearTimeout(V.current),B.current=Date.now();let v=g?.isPrivate===!0,b=g?.messages?.some(e=>e.role===`user`),ne=!v&&!b&&De(g?.title),S=n();D(e,{id:S,role:`user`,content:i.trim(),images:a});let C=n();if(ee=C,P.current=C,z.current=``,y(C),D(e,{role:`assistant`,content:``,id:C}),ne&&le(e,i.trim()),c()){let t=`Demo response for: ${i.trim()}`;I.current=window.setTimeout(()=>{I.current=null,!F.current.has(C)&&(O(e,C,t),r(t),x(!1),G(),y(null),N(!1),P.current=null,R.current=``,z.current=``)},500);return}if(!v){let r=new AbortController,o={sessionId:e,assistantMessageId:C,abort:r};L.current=o;let c=await be(o,await Se({sessionId:e,message:i.trim(),images:a,userMessageId:S,assistantMessageId:C,options:{...g?.settings?.generationOptions??{},...l===void 0?{}:{format:l}},webSearch:u===!0,tools:f===!0,...f===!0&&p?{toolSelection:p}:{},signal:r.signal}));if(c!==`stream`){await J(e,C,{completed:c===`completed`,pending:!1,state:c===`completed`?`succeeded`:`cancelled`}),L.current===o&&(L.current=null);return}for(let r of m??[]){let o=n(),c=new AbortController;ie.current.set(o,c),s.getState().addPendingComparison({sessionId:e,assistantMessageId:o,model:r.model}),(async()=>{try{await Se({sessionId:e,message:i.trim(),images:a,userMessageId:S,assistantMessageId:o,options:{...g?.settings?.generationOptions??{},...l===void 0?{}:{format:l}},webSearch:!1,compare:!0,modelOverride:r,signal:c.signal}),await we({sessionId:e,assistantMessageId:o,signal:c.signal,onEvent:n=>{n.type===`done`?q(e,o):n.type===`error`&&d.error(t(`chat.toasts.comparisonError`,{model:r.model,error:String(n.error??t(`chat.toasts.generationFailed`))}))}})}catch(e){c.signal.aborted||($.error(`Comparison generation failed:`,e),d.error(t(`chat.toasts.comparisonError`,{model:r.model,error:t(`chat.toasts.comparisonFailed`)})))}finally{ie.current.delete(o),s.getState().removePendingComparison(o)}})()}await we({sessionId:e,assistantMessageId:C,signal:r.signal,onEvent:t=>{t.type===`chunk`?h.dispatchMessage(`assistant_chunk`,t):t.type===`done`?h.dispatchMessage(`assistant_complete`,t):typeof t.type==`string`&&(t.type.startsWith(`chat.tool`)||t.type.startsWith(`chat.approval`))?h.dispatchMessage(`tool_event`,t):t.type===`error`&&h.dispatchMessage(`error`,{...t,sessionId:e})}}),L.current?.assistantMessageId===C&&(L.current=null);return}h.isConnected||await h.connect();let T=v?g?.messages?.filter(e=>e.role!==`system`&&e.id!==C).map(e=>({role:e.role,content:e.content,thinking:e.thinking,images:e.images,providerMetadata:e.providerMetadata})):void 0;h.send({type:`chat_stream`,data:{sessionId:e,content:i.trim(),images:a,format:l,options:g?.settings?.generationOptions??{},assistantMessageId:C,isPrivate:v,...u===!0?{webSearch:!0}:{},...v?{model:g?.model,providerType:g?.providerType,providerId:g?.providerId,messageHistory:T}:{}}})}catch(n){let r=ee;if(r&&await ve({sessionId:e,assistantMessageId:r,cancelledMessageIds:F.current,settle:t=>J(e,r,t),onError:e=>$.error(`Failed to resolve cancelled durable chat generation:`,e)})){L.current?.assistantMessageId===r&&(L.current=null);return}if(n instanceof DOMException&&n.name===`AbortError`)return;$.error(`Failed to send message:`,n),x(!1),G(),y(null),N(!1),P.current=null,z.current=``,d.error(t(`chat.toasts.sendFailed`))}},[e,D,O,N,G,le,J,q,r,t]),fe=(0,_.useCallback)(()=>{let n=P.current;if(n){if(f(t(`chat.announce.generationStopped`)),F.current.add(n),I.current!==null)window.clearTimeout(I.current),I.current=null,M(e,n),F.current.delete(n);else if(L.current?.assistantMessageId===n){let t=L.current,r=!t.jobId;_e(t),Q(e,n).then(async i=>{await J(e,n,i,{retainForContinuation:r}),L.current===t&&(L.current=null)}).catch(e=>$.error(`Failed to cancel durable chat generation:`,e)),t.jobId&&Te(t.jobId).catch(e=>$.error(`Failed to cancel durable chat generation:`,e))}else h.send({type:`chat_cancel`,data:{sessionId:e,assistantMessageId:n}})||(M(e,n),F.current.delete(n))}V.current&&=(clearTimeout(V.current),void 0),x(!1),G(),y(null),N(!1),P.current=null,R.current=``,z.current=``},[N,G,M,e,J,t]),pe=(0,_.useCallback)(async()=>{let r=s.getState(),i=r.currentSession;if(!i||!e)return;if(!o(r.models,{model:i.personaId?`persona:${i.personaId}`:i.model,providerType:i.providerType,providerId:i.providerId})){d.error(t(`chat.model.selectBeforeRegenerating`));return}let a=i.messages,c=-1,l=-1;for(let e=a.length-1;e>=0;e--)if(a[e].role===`assistant`){l=e;break}if(l>0){for(let e=l-1;e>=0;e--)if(a[e].role===`user`){c=e;break}}if(c===-1||l===-1){d.error(t(`chat.toasts.noMessageToRegenerate`));return}let u=a[c],f=a[l],p;try{N(!0),x(!0),G(),R.current=``,z.current=``,V.current&&clearTimeout(V.current),B.current=Date.now();let t=n();p=t,P.current=t,z.current=``,y(t),D(e,{role:`assistant`,content:``,id:t,parentId:f.parentId||f.id,branchIndex:f.siblingCount||1,isActive:!0});let r=i.isPrivate===!0;if(!r){let n=new AbortController,r={sessionId:e,assistantMessageId:t,abort:n};L.current=r;let a=await be(r,await Se({sessionId:e,message:u.content,images:u.images,userMessageId:u.id,assistantMessageId:t,options:i.settings?.generationOptions??{},webSearch:!1,regenerate:!0,originalMessageId:f.id,signal:n.signal}));if(a!==`stream`){await J(e,t,{completed:a===`completed`,pending:!1,state:a===`completed`?`succeeded`:`cancelled`}),L.current===r&&(L.current=null);return}await we({sessionId:e,assistantMessageId:t,signal:n.signal,onEvent:t=>{t.type===`chunk`?h.dispatchMessage(`assistant_chunk`,t):t.type===`done`?h.dispatchMessage(`assistant_complete`,t):t.type===`error`&&h.dispatchMessage(`error`,{...t,sessionId:e})}}),L.current?.assistantMessageId===t&&(L.current=null);return}h.isConnected||await h.connect();let o=r?a.filter(e=>e.role!==`system`).map(e=>({role:e.role,content:e.content,thinking:e.thinking,images:e.images,providerMetadata:e.providerMetadata})):void 0;h.send({type:`chat_stream`,data:{sessionId:e,content:u.content,images:u.images,options:i.settings?.generationOptions??{},assistantMessageId:t,regenerate:!0,originalMessageId:f.id,isPrivate:r,...r?{model:i.model,providerType:i.providerType,providerId:i.providerId,messageHistory:o}:{}}})}catch(n){let r=p;if(r&&await ve({sessionId:e,assistantMessageId:r,cancelledMessageIds:F.current,settle:t=>J(e,r,t),onError:e=>$.error(`Failed to resolve cancelled durable chat regeneration:`,e)})){L.current?.assistantMessageId===r&&(L.current=null);return}$.error(`Failed to regenerate message:`,n),r&&M(e,r);try{let t=Oe(e),n=await m.getSession(e);n.success&&n.data&&K(n.data,t)}catch(e){$.error(`Failed to reload session after regenerate:`,e)}x(!1),G(),y(null),N(!1),P.current=null,z.current=``,d.error(t(`chat.toasts.regenerateFailed`))}},[e,N,G,D,M,K,J,t]),me=(0,_.useCallback)(async n=>{let r=s.getState().currentSession;if(!r||!e)return;let i=r.messages.find(e=>e.id===n);if(!i){d.error(t(`chat.toasts.messageNotFound`));return}if(i.isActive!==!1)return;let a=i.parentId||i.id,o=i.branchIndex||0;try{let i=await m.switchMessageBranch(e,n,o);if(i.success&&i.data){let i=r.messages.map(e=>e.id===a||e.parentId===a?{...e,isActive:e.id===n}:e),c={...r,messages:i,updatedAt:Date.now()};s.setState(t=>({sessions:t.sessions.map(t=>t.id===e?c:t),currentSession:c})),d.success(t(`chat.toasts.branchSwitched`,{number:o+1}))}else d.error(i.error||t(`chat.toasts.branchSelectFailed`))}catch(e){$.error(`Failed to select branch:`,e),d.error(t(`chat.toasts.branchSelectFailed`))}},[e,t]),he=(0,_.useCallback)(async(n,r)=>{if(!e||!r.trim())return;let i=s.getState(),a=i.currentSession;if(!a||a.id!==e)return;let o=a.messages.findIndex(e=>e.id===n);if(o===-1||a.messages[o].role!==`user`)return;let c=a.messages[o];try{if(!a.isPrivate){let t=await m.truncateMessagesFrom(e,n);if(!t.success)throw Error(t.error||`Failed to truncate session`)}i.truncateMessagesFrom(e,n),await Y(r,c.images)}catch(e){$.error(`Failed to edit message:`,e),d.error(t(`chat.toasts.editFailed`))}},[e,Y,t]),X=(0,_.useCallback)(async(e,n,r)=>{try{await ee.decideApproval(e,n,r),E(t=>t&&t.approvalId===e?null:t)}catch(e){$.error(`Failed to record the tool decision:`,e),d.error(t(`chat.toasts.toolDecisionFailed`))}},[t]),Z=(0,_.useCallback)(async()=>{if(!e)return;let t=s.getState().currentSession;if(!t||t.id!==e||t.isPrivate||u.getState().isGenerating)return;let n=t.settings?.promptQueue;if(n&&n.length!==0)try{let t=await m.claimQueuedPrompt(e,n[0].id);if(!t.success||!t.data)return;de(e,t.data.queue),await Y(t.data.entry.content)}catch(e){$.error(`Prompt queue drain failed:`,e)}},[e,Y]);return(0,_.useEffect)(()=>{re.current=Z},[Z]),(0,_.useEffect)(()=>{if(!e)return;let t=window.setTimeout(()=>{re.current?.()},400);return()=>window.clearTimeout(t)},[e]),{sendMessage:Y,stopGeneration:fe,cancelComparison:(0,_.useCallback)(async t=>{if(e){ie.current.get(t)?.abort();try{await Q(e,t)}catch(e){$.error(`Failed to cancel the comparison generation:`,e)}finally{s.getState().removePendingComparison(t)}}},[e]),regenerateLastMessage:pe,editAndResendMessage:he,selectBranch:me,isStreaming:b,streamingMessage:l,streamingThinking:te,streamingMessageId:v,toolActivities:ne,activeToolCalls:C,pendingToolApproval:T,decideToolApproval:X}};export{le as a,Y as i,Ae as n,se as o,de as r,De as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t}from"./react-vendor-C1iE8mnY.js";var n=e(t(),1),r=`button, [href], input, select, textarea, [tabindex], [contenteditable="true"]`;function i(e,{onClose:t,enabled:i=!0,initialFocusRef:a}){let[o]=(0,n.useState)(()=>document.activeElement),s=(0,n.useRef)(null),c=(0,n.useRef)(t);(0,n.useEffect)(()=>{c.current=t},[t]),(0,n.useEffect)(()=>{let t=e.current;if(!i||!t)return;let n=document.activeElement,l=t.contains(n)?o:n,u=e=>e.getClientRects().length>0&&getComputedStyle(e).visibility!==`hidden`&&!e.closest(`[inert], [aria-hidden="true"]`),d=()=>{let e=Array.from(t.querySelectorAll(r)).filter(e=>e.tabIndex>=0&&!e.matches(`:disabled`)&&u(e));return e.filter(t=>{if(!(t instanceof HTMLInputElement)||t.type!==`radio`||!t.name)return!0;let n=e.filter(e=>e instanceof HTMLInputElement&&e.type===`radio`&&e.name===t.name&&e.form===t.form);return t===(n.find(e=>e.checked)??n[0])})},f=()=>{let e=Array.from(document.querySelectorAll(`[role="dialog"][aria-modal="true"]`)).filter(u);return e[e.length-1]===t},p=a?.current;if(p&&t.contains(p)&&u(p)&&!p.matches(`:disabled`))s.current=p,p.focus({preventScroll:!0});else if(n instanceof HTMLElement&&t.contains(n))s.current=n;else{let e=s.current;(e&&t.contains(e)&&u(e)&&!e.matches(`:disabled`)?e:d()[0]??t).focus({preventScroll:!0})}let m=e=>{if(!(e.defaultPrevented||!f()||e.isComposing)){if(e.key===`Escape`&&c.current)e.preventDefault(),e.stopPropagation(),c.current();else if(e.key===`Tab`){let n=d(),r=n[0];if(e.preventDefault(),!r)t.focus();else{let t=n.indexOf(document.activeElement);n[e.shiftKey?t<=0?n.length-1:t-1:(t+1)%n.length]?.focus()}}}},h=e=>{if(e.defaultPrevented||e.button!==0||!f())return;let t=e.target instanceof Element?e.target.closest(`button`):null;t&&d().includes(t)&&(e.preventDefault(),t.focus({preventScroll:!0}))};return document.addEventListener(`keydown`,m),document.addEventListener(`mousedown`,h),()=>{document.removeEventListener(`keydown`,m),document.removeEventListener(`mousedown`,h),l instanceof HTMLElement&&l.isConnected&&l.focus({preventScroll:!0})}},[e,i,o,a])}export{i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,r as n,t as r}from"./react-vendor-C1iE8mnY.js";import{t as i}from"./useQuery-2_pQiHbl.js";import{d as a}from"./router-vendor-qltZAWoz.js";import{t as o}from"./utils-BvvV-Cka.js";import{t as s}from"./useTranslation-D9EScZXH.js";import{h as c,s as l,t as u}from"./chatStore-hzQyRM9H.js";import{t as d}from"./logger-rEW7uQ8m.js";import{$n as f,$t as p,An as m,Dn as h,G as g,Jt as _,Lt as v,M as ee,Mn as te,Or as y,Q as b,S as x,Zn as S,Zt as ne,c as C,dr as w,n as T,sr as E,t as D,tr as O,tt as re,zn as ie}from"./ui-vendor-BTcw5yZ6.js";import{t as ae}from"./Button-DwZ26Lqc.js";import"./ui-D4Ytvr6d.js";import{S as oe,g as se,t as k,y as A}from"./api-D6IF0v9_.js";import{t as ce}from"./authStore-DdIb6km_.js";import{i as j,n as M,r as N,t as P}from"./thinking-DwlkTfPX.js";var F=e(t(),1),le=n(),ue=` · `,de=`strands:plugin:`,fe=new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`});function pe(e){return e.agentId||e.name.split(`:`)[0]||e.name}function me(e){return/embed/i.test(e.name)?!0:[e.details?.family,...e.details?.families??[]].filter(e=>!!e).some(e=>/bert$/i.test(e))}function I(e){return!!(e.isAgent&&e.agentId&&e.name===e.agentId)}function L(e,t){let n=e.find(I);if(n?.agentName)return n.agentName;for(let t of e){let e=t.agentName??``,n=e.indexOf(ue);if(n>0)return e.slice(0,n)}return t}function he(e,t){let n=e.agentName||e.name;if(I(e))return{title:n,isDefault:!0};let r=`${t}${ue}`,i=n.startsWith(r)?n.slice(r.length):n,a;if(e.name.startsWith(de)){let e=/^(.*\S)\s+\(([^()]+)\)$/.exec(i);e&&(i=e[1],a=e[2])}return{title:i,...a?{provider:a}:{},isDefault:!1}}function ge(e,t){return[...e].sort((e,n)=>{let r=I(e);return r===I(n)?fe.compare(t(e),t(n)):r?-1:1})}function _e(e,t){let n=[],r=[],i=[],a=[],o=new Map,s=new Map;for(let t of e)if(t.isLegacySelection)n.push(t);else if(t.isUnavailable)r.push(t);else if(t.isPersona)i.push(t);else if(t.isAgent){let e=pe(t);s.set(e,[...s.get(e)??[],t])}else if(t.isPlugin){let e=t.pluginId||t.pluginName||``;o.set(e,[...o.get(e)??[],t])}else c(t)&&!me(t)&&a.push(t);let l=[{key:`legacy`,kind:`legacy`,label:t.legacy,models:n},{key:`unavailable`,kind:`unavailable`,label:t.unavailable,models:r},{key:`personas`,kind:`personas`,label:t.personas,models:i},{key:`ollama`,kind:`ollama`,label:t.ollama,models:a}];for(let[e,n]of o)l.push({key:`plugin:${e}`,kind:`plugin`,label:n[0]?.pluginName||e||t.plugins,models:ge(n,e=>e.name)});for(let[e,n]of s){let r=L(n,e||t.agents);l.push({key:`agent:${e}`,kind:`agent`,label:r,models:ge(n,e=>he(e,r).title)})}return l.filter(e=>e.models.length>0)}function R(e){return e.toLowerCase().replace(/[\s\-_./:·()[\],]+/g,` `).trim()}function ve(e,t,n,r=``){let i=R(n).split(` `).filter(Boolean);if(i.length===0)return!0;let a=R([e.name,r,e.personaName,e.pluginName,e.agentName,t.label].filter(Boolean).join(` `)),o=a.replace(/ /g,``);return i.every(e=>a.includes(e)||o.includes(e))}function ye(e){let t=-1;for(let n of e.matchAll(/(?<![\d.])(\d{1,2})(?:[.-](\d{1,2}))?(?!\d|\.\d|b\b)/gi)){let e=Number(n[1])*100+Number(n[2]??0);e>t&&(t=e)}return t}function be(e,t,n={}){if(e.length<=8)return{visible:e,hidden:0};let r;if(n.newestFirst){let t=e.filter(I),n=e.filter(e=>!I(e)).map((e,t)=>({model:e,index:t,rank:ye(e.name)})).sort((e,t)=>t.rank-e.rank||e.index-t.index).map(e=>e.model);r=[...t,...n].slice(0,5)}else r=e.slice(0,5);if(!r.some(t)){let n=e.find(t);n&&(r[r.length-1]=n)}let i=new Set(r),a=e.filter(e=>i.has(e));return{visible:a,hidden:e.length-a.length}}var xe={ai:`AI`,api:`API`,awq:`AWQ`,bf16:`BF16`,chatgpt:`ChatGPT`,deepseek:`DeepSeek`,fp16:`FP16`,fp8:`FP8`,glm:`GLM`,gpt:`GPT`,gptq:`GPTQ`,hd:`HD`,lfm:`LFM`,llm:`LLM`,minimax:`MiniMax`,mlx:`MLX`,ml:`ML`,moe:`MoE`,openai:`OpenAI`,oss:`OSS`,qwq:`QwQ`,tts:`TTS`,vl:`VL`,xl:`XL`},Se={"meta-llama":`Meta`,"x-ai":`xAI`,"z-ai":`Z.ai`,amazon:`Amazon`,anthropic:`Anthropic`,cohere:`Cohere`,deepseek:`DeepSeek`,google:`Google`,liquid:`Liquid AI`,meta:`Meta`,microsoft:`Microsoft`,minimax:`MiniMax`,mistralai:`Mistral`,moonshotai:`Moonshot AI`,nvidia:`NVIDIA`,openai:`OpenAI`,perplexity:`Perplexity`,qwen:`Qwen`},z=/^(?:hf\.co|huggingface\.co)\//i,B=new Set([`gguf`]);function V(e){let t=e.toLowerCase();return xe[t]?xe[t]:e!==t||/^o\d/.test(e)?e:/^\d+(?:\.\d+)?[bkmt]$/.test(e)||/^[a-z]\d+(?:\.\d+)?[a-z]?$/.test(e)?e.toUpperCase():/^\d/.test(e)?e:e.charAt(0).toUpperCase()+e.slice(1)}function H(e){let t=e.split(/[-_\s]+/).filter(Boolean),n=t.length>1?t.filter(e=>!B.has(e.toLowerCase())):t,r=[];for(let e of n){let t=r[r.length-1];t&&/^\d{1,2}$/.test(e)&&/^\d{1,2}$/.test(t)&&r.length>1&&!/^\d/.test(r[r.length-2])?r[r.length-1]=`${t}.${e}`:r.push(V(e))}return r.join(` `)||e}function Ce(e){let t=e.toLowerCase();return Se[t]?Se[t]:e===t?H(e):e}function we(e,t={}){let n=e.trim(),r=n.startsWith(`~`),i=(r?n.slice(1):n).replace(z,``).split(`/`).filter(Boolean);if(!(t.prettify??i.length>1)||i.length===0)return{name:n};let a=i[i.length-1],o,s=a.lastIndexOf(`:`);s>0&&(o=a.slice(s+1)||void 0,a=a.slice(0,s)),r&&/[-_]latest$/i.test(a)&&(a=a.replace(/[-_]latest$/i,``),o??=`latest`),o===`latest`&&!r&&(o=void 0);let c=i.length>1?Ce(i[i.length-2]):void 0;return{name:H(a),...c?{vendor:c}:{},...o?{tag:o}:{}}}function Te(e){if(!Number.isFinite(e)||e<=0)return``;if(e>=1e6){let t=e%1048576==0?e/1048576:e/1e6;return`${Number(t.toFixed(1))}M`}if(e>=1e3){let t=e%1024==0?e/1024:e/1e3;return`${Math.round(t)}K`}return String(e)}function Ee(e){if(!Number.isFinite(e)||e<=0)return``;let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=e,r=0;for(;n>=1e3&&r<t.length-1;)n/=1e3,r+=1;return`${n>=10||r===0?Math.round(n):n.toFixed(1)} ${t[r]}`}var U=r(),De=[`bg-amber-500/15 text-amber-700 dark:text-amber-300`,`bg-emerald-500/15 text-emerald-700 dark:text-emerald-300`,`bg-sky-500/15 text-sky-700 dark:text-sky-300`,`bg-violet-500/15 text-violet-700 dark:text-violet-300`,`bg-rose-500/15 text-rose-700 dark:text-rose-300`,`bg-indigo-500/15 text-indigo-700 dark:text-indigo-300`,`bg-teal-500/15 text-teal-700 dark:text-teal-300`,`bg-orange-500/15 text-orange-700 dark:text-orange-300`];function Oe(e){let t=0;for(let n of e.toLowerCase())t=t*31+n.charCodeAt(0)>>>0;return De[t%De.length]}function ke({seed:e,size:t=`sm`,className:n}){let r=(/[\p{L}\p{N}]/u.exec(e)?.[0]??`?`).toUpperCase();return(0,U.jsx)(`span`,{"aria-hidden":`true`,className:o(`inline-flex shrink-0 select-none items-center justify-center font-semibold leading-none`,t===`md`?`h-6 w-6 rounded-md text-[11px]`:`h-4 w-4 rounded-sm text-[9px]`,Oe(e),n),children:r})}function W(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toString()}function Ae({hfTask:e,hfSort:t,canInstallModels:n,loadingHf:r,hfModels:i,expandedHfModel:a,hfGgufFiles:c,loadingGguf:l,pullingModel:u,pullProgress:d,setHfTask:p,setHfSort:g,onToggleHfModel:_,onPullHfGguf:ee,onCancelPull:te,onRefreshHfModels:y}){let{t:x}=s();return(0,U.jsxs)(`div`,{className:`flex-1 flex flex-col overflow-hidden`,children:[(0,U.jsx)(`div`,{className:`px-3 py-2 border-b border-gray-200 dark:border-dark-300 shrink-0 space-y-2`,children:(0,U.jsxs)(`div`,{className:`flex gap-2`,children:[(0,U.jsxs)(`select`,{value:e,onChange:e=>p(e.target.value),onMouseDown:e=>e.stopPropagation(),className:`flex-1 px-2 py-1.5 rounded-lg border text-xs bg-gray-50 dark:bg-dark-50 border-gray-200 dark:border-dark-300 text-gray-900 dark:text-gray-100`,children:[(0,U.jsx)(`option`,{value:`text-generation`,children:x(`modelManager.huggingface.taskTextGeneration`)}),(0,U.jsx)(`option`,{value:`text-to-speech`,children:x(`modelManager.huggingface.taskTextToSpeech`)}),(0,U.jsx)(`option`,{value:`text-to-image`,children:x(`modelManager.huggingface.taskTextToImage`)}),(0,U.jsx)(`option`,{value:`automatic-speech-recognition`,children:x(`modelManager.huggingface.taskSpeechRecognition`)})]}),(0,U.jsxs)(`select`,{value:t,onChange:e=>g(e.target.value),onMouseDown:e=>e.stopPropagation(),className:`px-2 py-1.5 rounded-lg border text-xs bg-gray-50 dark:bg-dark-50 border-gray-200 dark:border-dark-300 text-gray-900 dark:text-gray-100`,children:[(0,U.jsx)(`option`,{value:`downloads`,children:x(`modelManager.huggingface.sortDownloads`)}),(0,U.jsx)(`option`,{value:`likes`,children:x(`modelManager.huggingface.sortLikes`)}),(0,U.jsx)(`option`,{value:`lastModified`,children:x(`modelManager.huggingface.sortRecent`)})]})]})}),(0,U.jsxs)(`div`,{className:`scroll-region min-h-0 flex-1 scrollbar-thin`,children:[!n&&(0,U.jsx)(`div`,{className:`mx-3 mb-1 mt-3 rounded-lg border border-amber-200 bg-amber-500/10 px-3 py-2 text-xs text-ink dark:border-amber-800 dark:bg-amber-900/20`,children:x(`modelSelector.pullRestricted`)}),r?(0,U.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,U.jsx)(v,{className:`h-6 w-6 animate-spin text-gray-400`})}):i.length===0?(0,U.jsxs)(`div`,{className:`px-4 py-8 text-center text-gray-500 dark:text-gray-400`,children:[(0,U.jsx)(D,{className:`h-8 w-8 mx-auto mb-2 text-gray-300 dark:text-gray-600`}),(0,U.jsx)(`p`,{className:`text-sm`,children:x(`modelManager.huggingface.noModelsFound`)})]}):(0,U.jsx)(`div`,{className:`divide-y divide-gray-100 dark:divide-dark-200`,children:i.map(e=>{let t=a===e.id,r=c[e.id]||[],i=l===e.id;return(0,U.jsxs)(`div`,{className:`bg-white dark:bg-dark-100`,children:[(0,U.jsx)(`div`,{className:`px-3 py-3 cursor-pointer hover:bg-gray-50 dark:hover:bg-dark-200`,onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),_(e.id)},children:(0,U.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,U.jsx)(`div`,{className:`shrink-0 rounded-lg bg-yellow-500/20 p-2 dark:bg-yellow-900/30`,children:(0,U.jsx)(D,{className:`h-4 w-4 text-yellow-600 dark:text-yellow-400`})}),(0,U.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`h4`,{dir:`ltr`,className:`text-sm font-medium text-gray-900 dark:text-gray-100 truncate`,children:e.id}),e.gated&&(0,U.jsx)(`span`,{className:`rounded-sm bg-yellow-500/20 px-1.5 py-0.5 text-xs text-ink dark:bg-yellow-900/30`,children:`Gated`})]}),(0,U.jsxs)(`p`,{className:`text-xs text-gray-500 dark:text-gray-400 mt-0.5`,children:[`by `,e.author]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-3 mt-1.5 text-xs text-gray-400 dark:text-gray-500`,children:[(0,U.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(m,{className:`h-3 w-3`}),W(e.downloads)]}),(0,U.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(ne,{className:`h-3 w-3`}),W(e.likes)]}),e.pipeline_tag&&(0,U.jsx)(`span`,{className:`px-1.5 py-0.5 rounded-sm bg-gray-100 dark:bg-dark-200`,children:e.pipeline_tag})]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,U.jsx)(`a`,{href:`https://huggingface.co/${e.id}`,target:`_blank`,rel:`noopener noreferrer`,onMouseDown:e=>e.stopPropagation(),className:`p-1.5 rounded-lg hover:bg-gray-100 dark:hover:bg-dark-200`,children:(0,U.jsx)(h,{className:`h-4 w-4 text-gray-400`})}),(0,U.jsx)(f,{className:o(`h-4 w-4 text-gray-400 transition-transform`,t&&`rotate-180`)})]})]})}),t&&(0,U.jsx)(`div`,{className:`px-3 pb-3 pt-1 border-t border-gray-100 dark:border-dark-200 bg-gray-50 dark:bg-dark-200`,children:i?(0,U.jsxs)(`div`,{className:`flex items-center justify-center py-4`,children:[(0,U.jsx)(v,{className:`h-4 w-4 animate-spin text-gray-400`}),(0,U.jsx)(`span`,{className:`ml-2 text-xs text-gray-500`,children:x(`modelManager.huggingface.checkingGguf`)})]}):r.length===0?(0,U.jsx)(`div`,{className:`py-4 text-center text-xs text-gray-500 dark:text-gray-400`,children:x(`modelManager.huggingface.noGgufAvailable`)}):(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsx)(`div`,{className:`text-xs font-medium text-gray-600 dark:text-gray-300 mb-2`,children:x(`modelManager.huggingface.ggufFilesCount`,{count:r.length})}),r.map(e=>{let t=u===e.ollamaCommand;return(0,U.jsxs)(`div`,{className:`flex items-center gap-2 p-2 rounded-lg bg-white dark:bg-dark-100 border border-gray-200 dark:border-dark-300`,children:[(0,U.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,U.jsx)(`div`,{className:`text-xs font-medium text-gray-800 dark:text-gray-200 truncate`,children:e.filename}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mt-0.5 text-xs text-gray-500 dark:text-gray-400`,children:[(0,U.jsx)(`span`,{children:e.sizeFormatted}),e.quantization&&(0,U.jsx)(`span`,{className:`px-1.5 py-0.5 rounded-sm bg-purple-100 dark:bg-purple-900/30 text-purple-700 dark:text-purple-400`,children:e.quantization})]})]}),t?(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`div`,{className:`text-xs text-gray-500 w-12 text-right`,children:d?.percent===void 0?`...`:`${d.percent}%`}),(0,U.jsx)(`button`,{onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),te()},className:`p-1.5 rounded-lg text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20`,children:(0,U.jsx)(T,{className:`h-4 w-4`})})]}):n?(0,U.jsxs)(`button`,{onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),ee(e.ollamaCommand,e.filename)},disabled:!!u,className:o(`px-3 py-1.5 rounded-lg text-xs font-medium`,`bg-primary-100 dark:bg-primary-900/30`,`text-primary-700 dark:text-primary-400`,`hover:bg-primary-200 dark:hover:bg-primary-900/50`,`disabled:opacity-50 disabled:cursor-not-allowed`),children:[(0,U.jsx)(m,{className:`h-3 w-3 inline mr-1`}),x(`models.pull`)]}):(0,U.jsx)(`span`,{className:`rounded-sm bg-amber-500/20 px-2 py-1 text-[11px] font-medium text-ink dark:bg-amber-900/30`,children:x(`modelSelector.adminOnlyPull`)})]},e.filename)}),u?.startsWith(`hf.co/`)&&u.includes(e.id)&&d?.percent!==void 0&&(0,U.jsx)(`div`,{className:`w-full bg-gray-200 dark:bg-dark-300 rounded-full h-1.5 overflow-hidden mt-2`,children:(0,U.jsx)(`div`,{className:`h-1.5 rounded-full bg-primary-500 transition-all duration-300`,style:{width:`${d.percent}%`}})})]})})]},e.id)})})]}),(0,U.jsxs)(`div`,{className:`px-3 py-2 border-t border-gray-200 dark:border-dark-300 flex items-center justify-between shrink-0`,children:[(0,U.jsxs)(`a`,{href:`https://huggingface.co/models`,target:`_blank`,rel:`noopener noreferrer`,onMouseDown:e=>e.stopPropagation(),className:`text-xs text-primary-600 dark:text-primary-400 hover:underline flex items-center gap-1`,children:[(0,U.jsx)(h,{className:`h-3 w-3`}),x(`modelManager.huggingface.browseAllLink`)]}),(0,U.jsx)(`button`,{onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),y()},className:`p-1.5 rounded-lg hover:bg-gray-100 dark:hover:bg-dark-200`,children:(0,U.jsx)(b,{className:o(`h-3.5 w-3.5 text-gray-400`,r&&`animate-spin`)})})]})]})}var je=`[data-testid="model-selector-option"], [data-testid="model-selector-show-all"]`;function Me(e,t){if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;let n=Array.from(e.currentTarget.querySelectorAll(je)),r=n.indexOf(document.activeElement);if(r===-1)return;e.preventDefault();let i=r+(e.key===`ArrowDown`?1:-1);i<0?t():n[Math.min(i,n.length-1)]?.focus()}function Ne({groups:e,selectedModel:t,showImageGen:n,getModelValue:r,getModelIcon:i,getModelLabel:a,getModelTag:c,getModelSubLabel:l,onModelSelect:u,onShowAll:d,onOpenGallery:f,onExitTop:p}){let{t:m}=s();return(0,U.jsxs)(`div`,{className:`scroll-region min-h-0 flex-1 scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-dark-400`,onKeyDown:e=>Me(e,p),children:[e.length>0?e.map(e=>(0,U.jsxs)(`div`,{"data-testid":`model-selector-group`,children:[e.showHeader&&(0,U.jsxs)(`div`,{className:`sticky top-0 z-1 flex items-center gap-2 border-b border-gray-200 bg-gray-100 px-3 py-2 text-xs font-semibold text-gray-500 dark:border-dark-400 dark:bg-dark-300 dark:text-gray-400`,children:[e.icon,(0,U.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label}),(0,U.jsx)(`span`,{className:`font-normal tabular-nums text-gray-400 dark:text-dark-500`,children:e.total})]}),e.models.map(n=>{let s=r(n),d=l(n,e),f=c(n,e);return(0,U.jsx)(`button`,{type:`button`,"data-testid":`model-selector-option`,"data-model-value":s,"aria-pressed":t===s,title:n.isPersona?void 0:n.name,onClick:()=>u(s),className:o(`block w-full cursor-pointer border-b border-gray-100 px-3 py-2 text-start last:border-b-0 dark:border-dark-200`,`hover:bg-gray-50 dark:hover:bg-dark-200`,`bg-white dark:bg-dark-100 transition-colors`,`focus-visible:relative focus-visible:z-10 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary-500/50`,t===s&&`bg-primary-50 dark:bg-primary-900/30`),children:(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[i(n),(0,U.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,U.jsx)(`span`,{dir:n.isPersona?`auto`:`ltr`,className:`min-w-0 truncate text-sm font-medium text-gray-900 dark:text-gray-100`,children:a(n,e)}),f&&(0,U.jsx)(`span`,{dir:`ltr`,className:`shrink-0 rounded-sm border border-black/8 px-1 py-px font-mono text-[10px] leading-4 text-gray-500 dark:border-white/10 dark:text-dark-600`,children:f})]}),d&&(0,U.jsx)(`div`,{dir:`auto`,className:`text-xs text-gray-500 dark:text-gray-400 truncate`,children:d})]}),t===s&&(0,U.jsx)(O,{className:`h-4 w-4 text-primary-600 dark:text-primary-400 shrink-0`})]})},s)}),e.hidden>0&&(0,U.jsxs)(`button`,{type:`button`,"data-testid":`model-selector-show-all`,onClick:()=>d(e.key),className:o(`flex w-full items-center justify-between gap-2 border-b border-gray-100 bg-white px-3 py-2 text-start text-xs font-medium text-primary-600 dark:border-dark-200 dark:bg-dark-100 dark:text-primary-400`,`hover:bg-gray-50 dark:hover:bg-dark-200`,`focus-visible:relative focus-visible:z-10 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary-500/50`),children:[(0,U.jsx)(`span`,{className:`truncate`,children:m(`modelSelector.showAll`,{total:e.total})}),(0,U.jsx)(S,{className:`h-3.5 w-3.5 shrink-0 rtl:rotate-180`})]})]},e.key)):(0,U.jsxs)(`div`,{className:`px-4 py-8 text-center text-gray-500 dark:text-gray-400`,children:[(0,U.jsx)(te,{className:`h-8 w-8 mx-auto mb-2 text-gray-300 dark:text-gray-600`}),(0,U.jsx)(`p`,{className:`text-sm`,children:m(`models.noModelsFound`)})]}),n&&(0,U.jsxs)(`div`,{className:`border-t border-gray-200 dark:border-dark-300`,children:[(0,U.jsx)(`div`,{className:`px-3 py-2 text-xs font-semibold text-gray-500 dark:text-gray-400 bg-gray-100 dark:bg-dark-300`,children:(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(re,{className:`h-4 w-4 text-blue-600 dark:text-blue-400`}),m(`modelSelector.actions`)]})}),(0,U.jsx)(`div`,{onMouseDown:e=>{e.preventDefault(),f()},className:`px-3 py-3 cursor-pointer hover:bg-blue-50 dark:hover:bg-blue-900/20 bg-white dark:bg-dark-100`,children:(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(_,{className:`h-4 w-4 text-blue-600 dark:text-blue-400`}),(0,U.jsxs)(`div`,{className:`flex-1`,children:[(0,U.jsx)(`div`,{className:`text-sm font-medium text-gray-900 dark:text-gray-100`,children:m(`gallery.generate`)}),(0,U.jsx)(`div`,{className:`text-xs text-gray-500 dark:text-gray-400`,children:m(`gallery.generateDescription`)})]})]})})]})]})}function Pe({sources:e,active:t,onChange:n}){let{t:r}=s(),i=(0,F.useRef)([]),a=e.reduce((e,t)=>e+t.count,0),c=[{key:`all`,label:r(`common.all`),count:a},...e],l=(e,t)=>{let r=getComputedStyle(e.currentTarget).direction===`rtl`,a=r?`ArrowLeft`:`ArrowRight`,o=r?`ArrowRight`:`ArrowLeft`,s=null;e.key===a?s=(t+1)%c.length:e.key===o?s=(t-1+c.length)%c.length:e.key===`Home`?s=0:e.key===`End`&&(s=c.length-1),s!==null&&(e.preventDefault(),n(c[s].key),i.current[s]?.focus())};return(0,U.jsx)(`div`,{role:`radiogroup`,"aria-label":r(`modelSelector.sources`),"data-testid":`model-selector-sources`,className:`flex gap-1.5 overflow-x-auto px-4 pb-3 sm:px-5 scrollbar-none [&::-webkit-scrollbar]:hidden`,children:c.map((e,r)=>{let a=e.key===t;return(0,U.jsxs)(`button`,{ref:e=>{i.current[r]=e},type:`button`,role:`radio`,"aria-checked":a,tabIndex:a?0:-1,"data-source-key":e.key,onClick:()=>n(e.key),onKeyDown:e=>l(e,r),className:o(`flex shrink-0 items-center gap-1.5 rounded-full border px-3 py-1 text-xs font-medium transition-colors`,`focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-500/50`,a?`border-transparent bg-gray-900 text-white dark:bg-dark-900 dark:text-dark-25`:`border-black/8 text-gray-600 hover:bg-gray-100 dark:border-white/9 dark:text-dark-600 dark:hover:bg-dark-200`,e.count===0&&!a&&`opacity-50`),children:[(0,U.jsx)(`span`,{className:`whitespace-nowrap`,children:e.label}),(0,U.jsx)(`span`,{className:o(`tabular-nums`,a?`text-white/70 dark:text-dark-25/70`:`text-gray-400 dark:text-dark-500`),children:e.count})]},e.key)})})}function Fe({libraryCategories:e,libraryCategory:t,canInstallModels:n,loadingLibrary:r,filteredLibraryModels:i,pullingModel:a,pullProgress:c,setLibraryCategory:l,isModelInstalled:u,onModelSelect:d,onPullModel:f,onCancelPull:p,onRefreshLibrary:g}){let{t:_}=s();return(0,U.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:[(0,U.jsx)(`div`,{className:`px-3 py-2 border-b border-gray-200 dark:border-dark-300 shrink-0`,children:(0,U.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.map(e=>(0,U.jsx)(`button`,{onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),l(e)},className:o(`px-2.5 py-1 rounded-full text-xs font-medium transition-colors`,t===e?`bg-primary-100 dark:bg-primary-900/30 text-primary-700 dark:text-primary-400`:`bg-gray-100 dark:bg-dark-200 text-gray-600 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-dark-300`),children:e.charAt(0).toUpperCase()+e.slice(1)},e))})}),(0,U.jsxs)(`div`,{className:`scroll-region min-h-0 flex-1 scrollbar-thin`,children:[!n&&(0,U.jsx)(`div`,{className:`mx-3 mb-1 mt-3 rounded-lg border border-amber-200 bg-amber-500/10 px-3 py-2 text-xs text-ink dark:border-amber-800 dark:bg-amber-900/20`,children:_(`modelSelector.pullRestricted`)}),r?(0,U.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,U.jsx)(v,{className:`h-6 w-6 animate-spin text-gray-400`})}):i.length===0?(0,U.jsxs)(`div`,{className:`px-4 py-8 text-center text-gray-500 dark:text-gray-400`,children:[(0,U.jsx)(ie,{className:`h-8 w-8 mx-auto mb-2 text-gray-300 dark:text-gray-600`}),(0,U.jsx)(`p`,{className:`text-sm`,children:_(`models.noModelsFound`)})]}):(0,U.jsx)(`div`,{className:`divide-y divide-gray-100 dark:divide-dark-200`,children:i.map(e=>{let t=u(e.name),r=a===e.name;return(0,U.jsxs)(`div`,{className:o(`px-3 py-3 bg-white dark:bg-dark-100`,t&&`bg-green-50/50 dark:bg-green-900/10`),children:[(0,U.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,U.jsx)(`div`,{className:`p-2 rounded-lg bg-blue-100 dark:bg-blue-900/30 shrink-0`,children:(0,U.jsx)(ie,{className:`h-4 w-4 text-blue-600 dark:text-blue-400`})}),(0,U.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`h4`,{dir:`ltr`,className:`text-sm font-medium text-gray-900 dark:text-gray-100 truncate`,children:e.name}),t&&(0,U.jsx)(`span`,{className:`px-1.5 py-0.5 rounded-sm text-xs bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400`,children:_(`modelSelector.installed`)}),(e.category===`cloud`||e.tags?.includes(`cloud`))&&(0,U.jsxs)(`span`,{className:`px-1.5 py-0.5 rounded-sm text-xs bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-400 flex items-center gap-1`,children:[(0,U.jsx)(ie,{className:`h-3 w-3`}),`Cloud`]})]}),(0,U.jsx)(`p`,{className:`text-xs text-gray-500 dark:text-gray-400 line-clamp-1 mt-0.5`,children:e.description}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mt-1.5`,children:[e.sizes.slice(0,3).map(e=>(0,U.jsx)(`span`,{className:`px-1.5 py-0.5 rounded-sm text-xs bg-gray-100 dark:bg-dark-200 text-gray-600 dark:text-gray-400`,children:e},e)),e.pulls&&(0,U.jsxs)(`span`,{className:`text-xs text-gray-400 dark:text-gray-500 flex items-center gap-1`,children:[(0,U.jsx)(m,{className:`h-3 w-3`}),e.pulls]})]})]}),(0,U.jsx)(`div`,{className:`shrink-0`,children:r?(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`div`,{className:`text-xs text-gray-500 w-12 text-right`,children:c?.percent===void 0?`...`:`${c.percent}%`}),(0,U.jsx)(`button`,{onClick:p,className:`p-1.5 rounded-lg text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20`,children:(0,U.jsx)(T,{className:`h-4 w-4`})})]}):t?(0,U.jsx)(`button`,{onClick:()=>d(e.name),className:`px-3 py-1.5 rounded-lg text-xs font-medium bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400 hover:bg-green-200 dark:hover:bg-green-900/50`,children:_(`modelSelector.use`)}):n?(0,U.jsxs)(`button`,{onClick:()=>f(e.name),className:`px-3 py-1.5 rounded-lg text-xs font-medium bg-primary-100 dark:bg-primary-900/30 text-primary-700 dark:text-primary-400 hover:bg-primary-200 dark:hover:bg-primary-900/50`,children:[(0,U.jsx)(m,{className:`h-3 w-3 inline mr-1`}),_(`modelSelector.pull`)]}):(0,U.jsx)(`span`,{className:`rounded-sm bg-amber-500/20 px-2 py-1 text-[11px] font-medium text-ink dark:bg-amber-900/30`,children:_(`modelSelector.adminOnlyPull`)})})]}),r&&c?.percent!==void 0&&(0,U.jsx)(`div`,{className:`mt-2 w-full bg-gray-200 dark:bg-dark-300 rounded-full h-1.5 overflow-hidden`,children:(0,U.jsx)(`div`,{className:`h-1.5 rounded-full bg-primary-500 transition-all duration-300`,style:{width:`${c.percent}%`}})})]},e.name)})})]}),(0,U.jsxs)(`div`,{className:`px-3 py-2 border-t border-gray-200 dark:border-dark-300 flex items-center justify-between shrink-0`,children:[(0,U.jsxs)(`a`,{href:`https://ollama.com/library`,target:`_blank`,rel:`noopener noreferrer`,onMouseDown:e=>e.stopPropagation(),className:`text-xs text-primary-600 dark:text-primary-400 hover:underline flex items-center gap-1`,children:[(0,U.jsx)(h,{className:`h-3 w-3`}),_(`modelManager.huggingface.browseAllLink`)]}),(0,U.jsx)(`button`,{onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),g()},className:`p-1.5 rounded-lg hover:bg-gray-100 dark:hover:bg-dark-200`,children:(0,U.jsx)(b,{className:o(`h-3.5 w-3.5 text-gray-400`,r&&`animate-spin`)})})]})]})}var Ie=d(`components:model-selector`),Le=({models:e,selectedModel:t,onModelChange:n,currentPersona:r,className:d,disabled:m=!1,compact:h=!1,showImageGen:_=!1,onModelsRefresh:v,getModelValue:te,getModelId:b,getModelLabel:S,getModelTitle:ne,triggerRef:O,triggerTestId:re,selectTestId:ae,ariaLabel:k})=>{let{t:j}=s(),[M,N]=(0,F.useState)(!1),[P,ue]=(0,F.useState)(``),[de,fe]=(0,F.useState)(`installed`),[pe,me]=(0,F.useState)(`all`),I=(0,F.useRef)(null),L=(0,F.useRef)(null),ge=(0,F.useRef)(null),R=(0,F.useRef)(null),ye=a(),{user:xe,systemInfo:Se}=ce(),z=xe?.role===`admin`||Se?.requiresAuth===!1,B=Se?.ollamaEnabled!==!1,V=B?de:`installed`,[H,Ce]=(0,F.useState)(`all`),[De,Oe]=(0,F.useState)(``),[W,je]=(0,F.useState)(`text-generation`),[Me,Le]=(0,F.useState)(`downloads`),[Re,ze]=(0,F.useState)(``),[G,Be]=(0,F.useState)(null),[Ve,He]=(0,F.useState)({}),[Ue,We]=(0,F.useState)(null),[K,q]=(0,F.useState)(null),[Ge,J]=(0,F.useState)(null),[Ke,Y]=(0,F.useState)(null),qe=[`all`,`general`,`coding`,`reasoning`,`vision`,`embedding`,`cloud`],Je=(0,F.useMemo)(()=>_e(e,{legacy:j(`modelSelector.providerNotRecorded`,`Provider not recorded`),unavailable:j(`modelSelector.unavailableSelections`,`Unavailable selections`),personas:j(`modelSelector.personas`),ollama:`Ollama`,plugins:j(`modelSelector.pluginModels`),agents:j(`modelSelector.agentModels`,`Agents`)}),[e,j]),Ye=e=>{let t=`h-4 w-4 shrink-0 text-gray-500 dark:text-dark-600`;switch(e.kind){case`legacy`:return(0,U.jsx)(E,{className:t});case`unavailable`:return(0,U.jsx)(T,{className:t});case`personas`:return(0,U.jsx)(C,{className:t});case`agent`:return(0,U.jsx)(x,{className:t});default:return(0,U.jsx)(ke,{seed:e.label})}},X=e=>te?.(e)??e.name,Xe=e=>we(b?.(e)??e.name,e.isPlugin?{prettify:!0}:{}),Ze=e=>{let t=Xe(e);return t.tag?`${t.name} ${t.tag}`:t.name},Qe=u(e=>e.modelMetadata),$e=u(e=>e.personas),Z=e.find(e=>X(e)===t),et=e=>{if(!e.name.startsWith(`persona:`))return;let t=e.name.slice(8),n=t;try{n=decodeURIComponent(t)}catch{}let r=$e[t]??$e[n];if(r?.name)return r.name;if(e.personaName&&e.personaName!==t)return e.personaName},tt=e=>{if(!e.name.startsWith(`persona:`))return;let t=e.name.slice(8),n=t;try{n=decodeURIComponent(t)}catch{}return $e[t]??$e[n]};(0,F.useImperativeHandle)(O,()=>ge.current);let Q=(0,F.useCallback)((e=!0)=>{N(!1),ue(``),e&&window.requestAnimationFrame(()=>ge.current?.focus())},[]),{data:nt=[],isLoading:rt,refetch:it}=i({queryKey:[`ollama-library-selector`,De,H===`cloud`?`cloud`:`all`],queryFn:async()=>{let e=await A.getLibraryModels({search:De||void 0,sort:`popular`,category:H===`cloud`?`cloud`:void 0});return e.success&&e.data?e.data:[]},enabled:M&&V===`ollama`}),{data:at=[],isLoading:ot,refetch:st}=i({queryKey:[`hf-models-selector`,W,Re,Me],queryFn:async()=>{let e=await oe.getModels({task:W,search:Re||void 0,sort:Me,limit:30});return e.success&&e.data?e.data:[]},enabled:M&&V===`huggingface`}),ct=nt.filter(e=>{let t=!P||e.name.toLowerCase().includes(P.toLowerCase())||e.description.toLowerCase().includes(P.toLowerCase()),n=H===`all`||e.category===H;return t&&n}),lt=(0,F.useCallback)(async e=>{let[t,n]=e.split(`/`);if(t&&n){We(e);try{let r=await oe.getGgufFiles(t,n);r.success&&r.data&&He(t=>({...t,[e]:r.data}))}catch(e){Ie.error(`Failed to load GGUF files:`,e)}finally{We(null)}}},[]),ut=(0,F.useCallback)(e=>{G===e?Be(null):(Be(e),Ve[e]||lt(e))},[G,Ve,lt]),dt=(0,F.useCallback)((e,t)=>{if(!z)y.error(j(`modelSelector.pullRestricted`));else if(!K){q(e),J({status:`starting`});try{let n=A.pullModelStream(e,e=>{J(e)},()=>{J(null),q(null),Y(null),y.success(j(`modelDownload.success`,{name:t})),v?.()},e=>{J(null),q(null),Y(null),y.error(j(`modelDownload.failed`,{error:e}))});Y(()=>n)}catch{J(null),q(null),y.error(j(`modelDownload.startFailed`))}}},[z,v,K,j]);(0,F.useEffect)(()=>{let e=setTimeout(()=>{V===`huggingface`?ze(P):V===`ollama`&&Oe(P)},300);return()=>clearTimeout(e)},[P,V]),(0,F.useEffect)(()=>{if(!M)return;let e=e=>{if(e.key===`Escape`)e.preventDefault(),Q();else if(e.key===`Tab`&&L.current){let t=Array.from(L.current.querySelectorAll(`button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])`)).filter(e=>e.offsetParent!==null),n=t[0],r=t[t.length-1];if(!n||!r)return;e.shiftKey&&document.activeElement===n?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus())}};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[Q,M]),(0,F.useEffect)(()=>{M&&R.current&&R.current.focus()},[M]);let ft=async t=>{let r=e.find(e=>X(e)===t)??e.find(e=>!e.isPlugin&&!e.isPersona&&e.name===t),i=r?X(r):t,a=r?.name??t;if(Q(),!B)n({target:{value:i}});else{try{let e=await A.listRunningModels();if(e.success&&e.data){let t=e.data;t.length>0&&(r?.isPlugin!==!0&&t.some(e=>e.name===a||a.startsWith(`persona:`))||await A.unloadAllModels())}}catch(e){Ie.warn(`Failed to unload models before switch:`,e)}n({target:{value:i}})}},pt=async e=>{if(!z)y.error(j(`modelSelector.pullRestricted`));else if(!K){q(e),J({status:`starting`});try{let t=A.pullModelStream(e,e=>{J(e)},()=>{J(null),q(null),Y(null),y.success(j(`modelDownload.success`,{name:e})),v?.()},e=>{J(null),q(null),Y(null),y.error(j(`modelDownload.failed`,{error:e}))});Y(()=>t)}catch{J(null),q(null),y.error(j(`modelDownload.startFailed`))}}},mt=()=>{Ke&&(Ke(),Y(null),q(null),J(null),y.success(j(`modelDownload.cancelled`)))},ht=t=>e.some(e=>c(e)&&(e.name===t||e.name.startsWith(t+`:`))),gt=(e,t=`sm`)=>{let n=t===`md`?`h-6 w-6 rounded-md`:`h-4 w-4 rounded-sm`,r=Qe[l(e)]?.avatar;if(r&&!e.isPersona)return(0,U.jsx)(`img`,{src:r,alt:``,className:o(n,`shrink-0 rounded-full object-cover`)});if(e.isPersona||e.isLegacySelection){let t=tt(e);if(t)return(0,U.jsx)(`img`,{src:se(t,64),alt:``,className:o(n,`shrink-0 object-cover`)})}if(e.isLegacySelection||e.isPersona||e.isAgent){let r=e.isLegacySelection?E:e.isPersona?C:x,i=(0,U.jsx)(r,{className:`h-4 w-4 shrink-0 text-gray-500 dark:text-dark-600`});return t===`md`?(0,U.jsx)(`span`,{className:o(n,`flex shrink-0 items-center justify-center bg-gray-100 dark:bg-dark-200`),children:i}):i}let i=Xe(e),a=e.isPlugin?i.vendor||e.pluginName||e.pluginId||i.name:i.vendor||i.name;return(0,U.jsx)(ke,{seed:a,size:t})},$=e=>{let t=Qe[l(e)]?.label;if(t&&!e.isPersona)return t;if(S)return S(e);if(e.isLegacySelection)return`${et(e)??e.name} (${j(`modelSelector.legacyProvider`,`provider not recorded`)})`;if(e.isPersona)return et(e)||e.personaName||e.name;if(e.isAgent)return e.isUnavailable?`${e.agentName||e.name} (${j(`modelSelector.unavailable`,`unavailable`)})`:e.agentName||e.name;let n=Ze(e);return e.isUnavailable?`${n} (${j(`modelSelector.unavailable`,`unavailable`)})`:n},_t=e=>e.isLegacySelection?e.isUnavailable?j(`modelSelector.providerUnavailable`,`provider unavailable`):j(`modelSelector.reselectProvider`,`reselect a provider to pin this model`):e.isPersona?j(`modelSelector.via`,{provider:e.model}):e.isAgent&&e.isUnavailable?e.unavailableReason??j(`modelSelector.unavailable`,`unavailable`):e.isPlugin?e.isUnavailable?`${j(`modelSelector.via`,{provider:e.pluginName||e.pluginId})} · ${j(`modelSelector.providerUnavailable`,`provider unavailable`)}`:j(`modelSelector.via`,{provider:e.pluginName}):e.isUnavailable?j(`modelSelector.providerUnavailable`,`provider unavailable`):null,vt=e=>e.kind===`plugin`||e.kind===`ollama`,yt=e=>{let t=Xe(e);if(e.isPlugin||t.vendor||t.tag)return t;let n=t.name.lastIndexOf(`:`);if(n<=0)return t;let r=t.name.slice(n+1);return{name:t.name.slice(0,n),...r&&r!==`latest`?{tag:r}:{}}},bt=e=>!!Qe[l(e)]?.label,xt=(e,t)=>S||bt(e)?$(e):vt(t)?yt(e).name:t.kind===`agent`?he(e,t.label).title:$(e),St=(e,t)=>!vt(t)||S||bt(e)?null:yt(e).tag??null,Ct=(e,t)=>{if(t.kind===`agent`){let n=he(e,t.label);return n.isDefault?j(`modelSelector.defaultModel`):n.provider?j(`modelSelector.via`,{provider:n.provider}):null}if(!vt(t))return _t(e);let n=yt(e),r=e.details??{},i=/(^|[-:])cloud$/i.test(e.name),a=[n.vendor,e.isPlugin?void 0:r.parameter_size,e.isPlugin||r.quantization_level===n.tag?void 0:r.quantization_level,e.contextLength?j(`modelSelector.contextSize`,{size:Te(e.contextLength),defaultValue:`{{size}} context`}):void 0,e.isPlugin||i?void 0:Ee(e.size)].filter(e=>!!e);return a.length>0?a.join(` · `):null},wt=e=>X(e)===t,Tt=Je.map(e=>({source:e,matches:e.models.filter(t=>ve(t,e,P,$(t)))})),Et=Je.length>1,Dt=Et&&Je.some(e=>e.key===pe)?pe:`all`,Ot=Dt===`all`,kt=Tt.filter(({source:e})=>Ot||e.key===Dt).map(({source:e,matches:t})=>{let n=Ot&&Et?be(t,wt,{newestFirst:e.kind===`plugin`||e.kind===`agent`}):{visible:t,hidden:0};return{key:e.key,kind:e.kind,label:e.label,icon:Ye(e),models:n.visible,total:t.length,hidden:n.hidden,showHeader:Ot}}).filter(e=>e.models.length>0),At=Tt.map(({source:e,matches:t})=>({key:e.key,label:e.label,count:t.length}));return(0,U.jsxs)(`div`,{className:o(`relative min-w-0`,d),ref:I,children:[(0,U.jsxs)(`button`,{ref:ge,"data-testid":re,type:`button`,onClick:()=>!m&&N(!M),disabled:m,"aria-haspopup":`dialog`,"aria-expanded":M,"aria-label":k&&Z?`${k}: ${$(Z)}`:k,className:o(h?`flex h-9 w-full min-w-0 items-center justify-between gap-2 px-2.5 text-start`:`w-full flex items-center justify-between gap-2 px-3 py-2.5 text-start`,`rounded-xl border border-line bg-surface-subtle text-sm text-ink hover:bg-hover-solid`,`transition-colors duration-150 focus:outline-hidden focus:ring-2 focus:ring-primary-500/30 focus:border-primary-500`,m?`opacity-50 cursor-not-allowed`:`cursor-pointer`),title:h?Z?ne?.(Z)??$(Z):j(`modelSelector.selectModel`):void 0,children:[(()=>{if(!Z)return h?(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,U.jsx)(w,{className:`h-4 w-4 shrink-0`}),(0,U.jsx)(`span`,{className:`truncate text-xs font-medium text-ink-subtle`,children:j(`modelSelector.selectModel`)})]}):j(`modelSelector.selectModel`);if(h){let e=$(Z);return(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`shrink-0`,children:gt(Z)}),(0,U.jsx)(`span`,{dir:Z.isPersona?`auto`:`ltr`,className:`truncate text-xs font-medium text-ink`,children:e})]})}let e=$(Z),t=_t(Z);return(0,U.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[gt(Z),(0,U.jsxs)(`div`,{className:`flex flex-col min-w-0`,children:[(0,U.jsx)(`span`,{dir:Z.isPersona?`auto`:`ltr`,className:`text-sm font-medium truncate`,children:e}),t&&(0,U.jsx)(`span`,{dir:`auto`,className:`text-xs text-gray-500 dark:text-gray-400 truncate`,children:t})]}),Z.isPersona&&r&&(0,U.jsxs)(`div`,{className:`flex items-center gap-1 ms-auto`,children:[(0,U.jsx)(E,{className:`h-3 w-3 text-gray-500 dark:text-dark-600`}),r.embedding_model&&(0,U.jsx)(ee,{className:`h-3 w-3 text-gray-400 dark:text-dark-500`})]})]})})(),(0,U.jsx)(f,{className:o(h?`h-3 w-3`:`h-4 w-4`,`shrink-0 text-ink-subtle transition-transform duration-150 motion-reduce:transition-none`,M&&`rotate-180`)})]}),M&&(0,le.createPortal)((0,U.jsxs)(`div`,{className:`fixed inset-0 z-999999 flex items-center justify-center p-3 sm:p-6`,children:[(0,U.jsx)(`div`,{className:`absolute inset-0 bg-gray-950/55 backdrop-blur-md`,onClick:()=>Q()}),(0,U.jsxs)(`div`,{ref:L,role:`dialog`,"aria-modal":`true`,"aria-label":j(`modelSelector.selectModel`),className:o(`relative flex w-full max-w-xl flex-col overflow-hidden bg-white/98 dark:bg-dark-25/98`,`h-[min(620px,88vh)] rounded-3xl border border-black/8 dark:border-white/9`,`shadow-[0_30px_100px_rgba(0,0,0,0.28)] backdrop-blur-xl animate-scale-in`),onClick:e=>e.stopPropagation(),children:[(0,U.jsxs)(`div`,{className:`shrink-0`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between px-4 pb-2 pt-4 sm:px-5 sm:pt-5`,children:[(0,U.jsx)(`h2`,{className:`text-lg font-medium tracking-tight text-gray-950 dark:text-dark-950 rtl:tracking-normal`,children:j(`modelSelector.selectModel`)}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>Q(),className:`flex h-9 w-9 items-center justify-center rounded-full text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-950 dark:text-dark-500 dark:hover:bg-dark-200 dark:hover:text-dark-950`,title:j(`common.close`),"aria-label":j(`common.close`),children:(0,U.jsx)(T,{className:`h-4 w-4`})})]}),(0,U.jsx)(`div`,{className:`px-4 pb-3 sm:px-5`,children:(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsx)(g,{className:`absolute inset-s-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400`}),(0,U.jsx)(`input`,{ref:R,type:`text`,placeholder:j(V===`installed`?B?`modelSelector.searchInstalled`:`modelSelector.searchModels`:V===`ollama`?`modelSelector.searchOllama`:`modelSelector.searchHuggingFace`),value:P,onChange:e=>ue(e.target.value),onKeyDown:e=>{if(V!==`installed`)return;let t=L.current?.querySelector(`[data-testid="model-selector-option"]`);e.key===`ArrowDown`&&t?(e.preventDefault(),t.focus()):e.key===`Enter`&&P.trim()&&t&&(e.preventDefault(),t.click())},className:o(`w-full rounded-xl border border-black/[0.07] bg-gray-100/70 py-2.5 ps-10 pe-4 text-sm dark:border-white/[0.07] dark:bg-dark-200/70`,`focus:outline-hidden focus:border-primary-500 focus:ring-2 focus:ring-primary-500/30`,`text-gray-900 dark:text-dark-900 placeholder:text-gray-400 dark:placeholder:text-dark-500`)})]})}),B&&(0,U.jsxs)(`div`,{className:`mx-4 mb-3 flex rounded-xl bg-gray-100/70 p-1 dark:bg-dark-200/70 sm:mx-5`,children:[(0,U.jsxs)(`button`,{onClick:()=>{fe(`installed`)},className:o(`flex-1 rounded-lg px-2 py-2 text-xs font-medium transition-colors sm:px-4`,V===`installed`?`bg-white text-gray-950 shadow-xs dark:bg-dark-300 dark:text-dark-950`:`text-gray-500 hover:text-gray-800 dark:text-dark-500 dark:hover:text-dark-800`),"aria-pressed":V===`installed`,children:[(0,U.jsx)(p,{className:`h-4 w-4 inline me-1.5`}),j(`modelSelector.installed`)]}),(0,U.jsxs)(`button`,{onClick:()=>{fe(`ollama`)},className:o(`flex-1 rounded-lg px-2 py-2 text-xs font-medium transition-colors sm:px-4`,V===`ollama`?`bg-white text-gray-950 shadow-xs dark:bg-dark-300 dark:text-dark-950`:`text-gray-500 hover:text-gray-800 dark:text-dark-500 dark:hover:text-dark-800`),"aria-pressed":V===`ollama`,children:[(0,U.jsx)(ie,{className:`h-4 w-4 inline me-1.5`}),`Ollama`]}),(0,U.jsxs)(`button`,{onClick:()=>{fe(`huggingface`)},className:o(`flex-1 rounded-lg px-2 py-2 text-xs font-medium transition-colors sm:px-4`,V===`huggingface`?`bg-white text-gray-950 shadow-xs dark:bg-dark-300 dark:text-dark-950`:`text-gray-500 hover:text-gray-800 dark:text-dark-500 dark:hover:text-dark-800`),"aria-pressed":V===`huggingface`,children:[(0,U.jsx)(D,{className:`h-4 w-4 inline me-1.5`}),`HuggingFace`]})]}),V===`installed`&&Et&&(0,U.jsx)(Pe,{sources:At,active:Dt,onChange:me})]}),V===`installed`&&(0,U.jsx)(Ne,{groups:kt,selectedModel:t,showImageGen:_&&Ot,getModelValue:X,getModelIcon:e=>gt(e,`md`),getModelLabel:xt,getModelTag:St,getModelSubLabel:Ct,onExitTop:()=>R.current?.focus(),onModelSelect:ft,onShowAll:e=>{me(e),R.current?.focus()},onOpenGallery:()=>{Q(!1),ye(`/gallery`)}},Dt),V===`ollama`&&(0,U.jsx)(Fe,{libraryCategories:qe,libraryCategory:H,canInstallModels:z,loadingLibrary:rt,filteredLibraryModels:ct,pullingModel:K,pullProgress:Ge,setLibraryCategory:Ce,isModelInstalled:ht,onModelSelect:ft,onPullModel:pt,onCancelPull:mt,onRefreshLibrary:()=>{it()}}),V===`huggingface`&&(0,U.jsx)(Ae,{hfTask:W,hfSort:Me,canInstallModels:z,loadingHf:ot,hfModels:at,expandedHfModel:G,hfGgufFiles:Ve,loadingGguf:Ue,pullingModel:K,pullProgress:Ge,setHfTask:je,setHfSort:Le,onToggleHfModel:ut,onPullHfGguf:dt,onCancelPull:mt,onRefreshHfModels:()=>{st()}})]})]}),document.body),(0,U.jsx)(`select`,{"data-testid":ae,"aria-label":k,"aria-hidden":`true`,dir:`ltr`,value:t,onChange:n,className:`hidden`,tabIndex:-1,children:e.map(e=>(0,U.jsx)(`option`,{value:X(e),children:$(e)},`${e.isLegacySelection?`legacy`:e.isPersona?`persona`:e.isPlugin?`plugin`:`ollama`}:${e.pluginId||``}:${X(e)}`))})]})},Re=({value:e,inheritedValue:t,onChange:n})=>{let{t:r}=s(),[i,a]=(0,F.useState)(!1),c=(0,F.useRef)(null),l=e??t,u=M(l),d=N(l),f=N(e),p=t==null?void 0:N(t),m=(0,F.useRef)(null),h=u?r(`chat.input.thinkingOn`,{level:r(`settings.generation.thinkingLevels.${d}`)}):r(`chat.input.thinkingOff`),g=()=>c.current?.querySelector(`button`)?.focus();return(0,F.useEffect)(()=>{if(!i)return;let e=m.current?.querySelectorAll(`[role="menuitemradio"]`);(Array.from(e??[]).find(e=>e.getAttribute(`aria-checked`)===`true`)??e?.[0])?.focus()},[i]),(0,F.useEffect)(()=>{if(!i)return;let e=e=>{c.current?.contains(e.target)||a(!1)},t=e=>{e.key===`Escape`&&(a(!1),g())};return window.addEventListener(`mousedown`,e),window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`mousedown`,e),window.removeEventListener(`keydown`,t)}},[i]),(0,U.jsxs)(`div`,{ref:c,className:`relative shrink-0`,children:[(0,U.jsxs)(ae,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>a(e=>!e),className:o(`h-9 rounded-full p-0 flex items-center justify-center gap-1 touch-manipulation transition-colors duration-150`,u?`w-auto px-2.5`:`w-9`,`text-ink-muted hover:bg-interactive-hover hover:text-ink`,u&&`bg-primary-50 text-primary-600 dark:bg-primary-900/25 dark:text-primary-400`),title:h,"aria-label":h,"aria-haspopup":`menu`,"aria-expanded":i,"aria-pressed":u,children:[(0,U.jsx)(E,{className:`h-4 w-4`}),u&&(0,U.jsx)(`span`,{className:`text-[11px] font-medium`,children:r(`settings.generation.thinkingLevels.${d}`)})]}),i&&(0,U.jsxs)(`div`,{ref:m,role:`menu`,"aria-label":r(`chat.controls.thinking`),onKeyDown:e=>{if(![`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(e.key))return;let t=Array.from(e.currentTarget.querySelectorAll(`[role="menuitemradio"]`));if(t.length===0)return;e.preventDefault();let n=t.indexOf(document.activeElement);t[e.key===`Home`?0:e.key===`End`?t.length-1:e.key===`ArrowDown`?(n+1)%t.length:(n-1+t.length)%t.length].focus()},className:`absolute bottom-full inset-e-0 z-30 mb-2 w-48 rounded-2xl border border-black/8 bg-surface/95 p-1.5 shadow-[0_16px_48px_rgba(15,23,42,0.16)] backdrop-blur-xl animate-scale-in dark:border-white/9 dark:bg-dark-100/95`,children:[(0,U.jsx)(`p`,{className:`mb-1 px-2 pt-1 text-[11px] font-medium text-ink-muted`,children:r(`chat.controls.thinking`)}),P.map(e=>{let t=e===f;return(0,U.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":t,tabIndex:-1,onClick:()=>{n(j(e)),a(!1),g()},className:o(`flex w-full items-center justify-between gap-2 rounded-xl px-2.5 py-2 text-start text-[13px] text-gray-700 hover:bg-gray-100 dark:text-dark-800 dark:hover:bg-dark-200`,t&&`text-primary-600 dark:text-primary-400`),children:[(0,U.jsx)(`span`,{className:`truncate`,children:e==="default"&&p!==void 0?r(`settings.generation.thinkingLevels.defaultWith`,{level:r(`settings.generation.thinkingLevels.${p}`)}):r(`settings.generation.thinkingLevels.${e}`)}),t&&(0,U.jsx)(O,{className:`h-3.5 w-3.5 shrink-0`})]},e)})]})]})},ze=d(`hooks:dictation`),G=()=>{if(typeof window>`u`)return;let e=window;return e.SpeechRecognition||e.webkitSpeechRecognition},Be=[{mimeType:`audio/webm;codecs=opus`,format:`webm`}],Ve=300,He=.25,Ue=e=>`${encodeURIComponent(e.plugin)}:${encodeURIComponent(e.model)}`;function We(e){if(typeof MediaRecorder>`u`)return;let t=new Set((e.config?.formats||[]).map(e=>e.toLowerCase()));return Be.find(e=>(t.size===0||t.has(e.format))&&(typeof MediaRecorder.isTypeSupported!=`function`||MediaRecorder.isTypeSupported(e.mimeType)))?.mimeType}function K({onStart:e,onText:t,ownerKey:n}){let{t:r,i18n:i}=s(),[a,o]=(0,F.useState)(`idle`),[c,l]=(0,F.useState)([]),u=(0,F.useRef)(null),d=(0,F.useRef)(null),f=(0,F.useRef)(null),p=(0,F.useRef)(null),m=(0,F.useRef)(null),h=(0,F.useRef)(0),g=(0,F.useRef)(`idle`),_=(0,F.useRef)(void 0),v=(0,F.useRef)(e),ee=(0,F.useRef)(t);(0,F.useEffect)(()=>{v.current=e,ee.current=t},[e,t]),(0,F.useEffect)(()=>{let e=!1;return k.getModels().then(t=>{!e&&t.success&&t.data&&l(t.data)}).catch(()=>{e||l([])}),()=>{e=!0}},[]);let te=(0,F.useMemo)(()=>typeof window<`u`&&window.isSecureContext&&typeof navigator<`u`&&!!navigator.mediaDevices&&!!G(),[]),b=typeof window<`u`&&window.isSecureContext&&typeof navigator<`u`&&!!navigator.mediaDevices?.getUserMedia,x=(0,F.useMemo)(()=>[...te?[{key:`browser`,kind:`browser`}]:[],...b?c.filter(e=>!!We(e)).map(e=>({key:Ue(e),kind:`provider`,model:e})):[]],[te,b,c]),[S,ne]=(0,F.useState)(``),C=(0,F.useMemo)(()=>x.find(e=>e.key===S)??x[0],[S,x]),w=C?.kind===`provider`?C.model:void 0,T=x.length>0,E=(0,F.useCallback)(()=>{m.current!==null&&(window.clearTimeout(m.current),m.current=null)},[]),D=(0,F.useCallback)(e=>{g.current=e,o(e)},[]),O=(0,F.useCallback)(()=>{h.current+=1,E(),u.current?.stop(),u.current=null,p.current?.abort(),p.current=null;let e=d.current;d.current=null,e&&(e.ondataavailable=null,e.onerror=null,e.onstop=null,e.state===`recording`&&e.stop()),f.current?.getTracks().forEach(e=>e.stop()),f.current=null,D(`idle`)},[E,D]);return(0,F.useEffect)(()=>(_.current=n,O),[O,n]),{supported:T,phase:a,toggle:(0,F.useCallback)(async()=>{let e=g.current;if(e===`starting`||e===`transcribing`){O();return}if(e===`recording`){d.current?.state===`recording`?(D(`transcribing`),d.current.stop()):O();return}if(w){let e=h.current+1;h.current=e;let t=_.current;v.current(),D(`starting`);try{let n=await navigator.mediaDevices.getUserMedia({audio:!0});if(h.current!==e||_.current!==t){n.getTracks().forEach(e=>e.stop());return}f.current=n;let a=We(w),o=a?new MediaRecorder(n,{mimeType:a}):new MediaRecorder(n),s=[];o.ondataavailable=e=>{e.data.size>0&&s.push(e.data)},o.onerror=()=>{n.getTracks().forEach(e=>e.stop()),E(),h.current===e&&(d.current=null,f.current=null,D(`idle`),y.error(r(`voiceMode.transcriptionFailed`)))},o.onstop=()=>{if(n.getTracks().forEach(e=>e.stop()),E(),h.current!==e||_.current!==t)return;if(d.current=null,f.current=null,s.length===0){D(`idle`);return}let a=new Blob(s,{type:o.mimeType||s[0].type||`audio/webm`}),c=new AbortController;p.current=c,D(`transcribing`),k.transcribe(a,w,{language:i.language,signal:c.signal,fallbackMessage:r(`voiceMode.transcriptionFailed`)}).then(n=>{h.current!==e||_.current!==t||c.signal.aborted||ee.current(n.text.trim())}).catch(e=>{c.signal.aborted||(ze.error(`Provider transcription failed:`,e),y.error(e instanceof Error?e.message:r(`voiceMode.transcriptionFailed`)))}).finally(()=>{p.current===c&&h.current===e&&(p.current=null,D(`idle`))})},d.current=o,o.start(250);let c=w.config?.max_duration_seconds,l=typeof c==`number`&&c>0?Math.min(c,Ve):Ve;m.current=window.setTimeout(()=>{h.current===e&&o.state===`recording`&&o.stop()},Math.max(.1,l-He)*1e3),D(`recording`);return}catch(t){if(h.current!==e)return;ze.error(`Failed to start provider dictation:`,t),E(),f.current?.getTracks().forEach(e=>e.stop()),f.current=null,d.current=null,D(`idle`),y.error(r(`voiceMode.transcriptionFailed`));return}}let t=G();if(!t)return;let n=h.current+1;h.current=n;let a=_.current,o=new t;o.lang=i.language,o.continuous=!0,o.interimResults=!0,v.current(),o.onresult=e=>{if(h.current!==n||_.current!==a||u.current!==o)return;let t=``;for(let n=0;n<e.results.length;n++)t+=e.results[n][0]?.transcript??``;ee.current(t.trim())},o.onend=()=>{h.current===n&&(u.current=null,D(`idle`))},o.onerror=()=>{h.current===n&&(u.current=null,D(`idle`))},u.current=o,D(`recording`);try{o.start()}catch(e){ze.error(`Failed to start dictation:`,e),u.current=null,D(`idle`)}},[O,E,i.language,w,D,r]),cancel:O,sources:x,activeSourceKey:C?.key??``,setSourceKey:ne,providerModel:w}}export{Re as n,Le as r,K as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-vendor-C1iE8mnY.js";var r=e(t(),1),i=n(),a=r.createContext(void 0),o=e=>{let t=r.useContext(a);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},s=({client:e,children:t})=>(r.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,i.jsx)(a.Provider,{value:e,children:t})),c={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},l=new class{#e=c;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function u(e){setTimeout(e,0)}var d=typeof window>`u`||`Deno`in globalThis;function f(){}function p(e,t){return typeof e==`function`?e(t):e}function m(e){return typeof e==`number`&&e>=0&&e!==1/0}function h(e,t){return Math.max(e+(t||0)-Date.now(),0)}function g(e,t){return typeof e==`function`?e(t):e}function _(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==y(o,t.options))return!1}else if(!x(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function v(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(b(t.options.mutationKey)!==b(a))return!1}else if(!x(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function y(e,t){return(t?.queryKeyHashFn||b)(e)}function b(e){return JSON.stringify(e,(e,t)=>T(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function x(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!x(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!x(e[r],t[r]))return!1;return!0}return!1}var ee=Object.prototype.hasOwnProperty;function S(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=w(e)&&w(t);if(!r&&!(T(e)&&T(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ee.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=S(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function C(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function w(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function T(e){if(!E(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!E(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function E(e){return Object.prototype.toString.call(e)===`[object Object]`}function te(e){return new Promise(t=>{l.setTimeout(t,e)})}function D(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:S(e,t)}function ne(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function re(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var O=Symbol();function k(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===O?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function A(e,t){return typeof e==`function`?e(...t):!!e}function ie(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0})),i)}),e}var ae=()=>d,j=()=>ae(),M=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},N=new class extends M{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},oe=u;function se(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=oe,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var P=se(),F=new class extends M{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function ce(e){return Math.min(1e3*2**e,3e4)}function I(e){return(e??`online`)!==`online`||F.isOnline()}var L=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function R(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(f);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new L(t);g(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},p=()=>N.isFocused()&&(e.networkMode===`always`||F.isOnline())&&e.canRun(),m=()=>I(e.networkMode)&&e.canRun(),h=e=>{c()||(r?.(),i=`resolved`,a(e))},g=e=>{c()||(r?.(),i=`rejected`,o(e))},_=t=>new Promise(n=>{r=e=>{(c()||t())&&n(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),v=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(h).catch(r=>{if(c())return;let i=e.retry??(j()?0:3),a=e.retryDelay??ce,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?g(r):(n++,e.onFail?.(n,r),te(o).then(()=>p()?void 0:_(p)).then(()=>{t?g(r):v()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:m,start:()=>(m()?v():_(m).then(v),s)}}var z=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),m(this.gcTime)&&(this.#e=l.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(j()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(l.clearTimeout(this.#e),this.#e=void 0)}};function le(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{ie(e,()=>t.signal,()=>n=!0)},u=k(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?re:ne;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?V:B,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]===void 0?r.initialPageParam:o[0]:B(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function B(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function V(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function ue(e,t){return t?B(e,t)!=null:!1}function H(e,t){return!t||!e.getPreviousPageParam?!1:V(e,t)!=null}var de=class extends z{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=G(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=G(this.options);e.data!==void 0&&(this.setState(W(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=D(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(f).catch(f):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>g(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===O||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>g(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!h(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=k(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?le(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=R({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof L&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof L){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...U(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...W(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),P.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function U(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:I(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function W(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function G(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var K=class extends M{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),q(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return J(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return J(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof g(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!C(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Y(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||g(this.options.enabled,this.#t)!==g(t.enabled,this.#t)||g(this.options.staleTime,this.#t)!==g(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||g(this.options.enabled,this.#t)!==g(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return C(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch(t).then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(f)),t}#h(e){return!j()&&g(this.options.enabled,this.#t)!==!1&&m(e)}#g(){this.#b();let e=g(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=h(this.#r.dataUpdatedAt,e)+1;this.#u=l.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return g(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=l.setInterval(()=>{(this.options.refetchIntervalInBackground||N.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(l.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(l.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&q(e,t),o=i&&Y(e,n,t,r);(a||o)&&(l={...l,...U(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=D(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=D(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let _=l.fetchStatus===`fetching`,v=m===`pending`,y=m===`error`,b=v&&_,x=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:v,isSuccess:m===`success`,isError:y,isInitialLoading:b,isLoading:b,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:_,isRefetching:_&&!v,isLoadingError:y&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:y&&x,isStale:X(e,t),refetch:this.refetch,isEnabled:g(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),C(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();P.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function fe(e,t){return g(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||g(t.retryOnMount,e)!==!1)}function q(e,t){return fe(e,t)||e.state.data!==void 0&&J(e,t,t.refetchOnMount)}function J(e,t,n){if(g(t.enabled,e)!==!1&&g(t.staleTime,e)!==`static`){let r=g(n,e);return r===`always`||r!==!1&&X(e,t)}return!1}function Y(e,t,n,r){return(e!==t||g(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&X(e,n)}function X(e,t){return g(t.enabled,e)!==!1&&e.isStaleByTime(g(t.staleTime,e))}var Z=r.createContext(!1),pe=()=>r.useContext(Z);Z.Provider;function me(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var he=r.createContext(me()),ge=()=>r.useContext(he),_e=(e,t,n)=>{let r=n?.state.status===`error`&&typeof e.throwOnError==`function`?A(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Q=e=>{r.useEffect(()=>{e.clearReset()},[e])},ve=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||A(n,[e.error,r])),ye=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},be=(e,t)=>e?.suspense&&t.isPending,xe=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function $(e,t,n){let i=pe(),a=ge(),s=o(n),c=s.defaultQueryOptions(e),l=s.getQueryCache().get(c.queryHash),u=e.subscribed!==!1;c._optimisticResults=i?`isRestoring`:u?`optimistic`:void 0,ye(c),_e(c,a,l),Q(a);let[d]=r.useState(()=>new t(s,c)),p=d.getOptimisticResult(c),m=!i&&u;if(r.useSyncExternalStore(r.useCallback(e=>{let t=m?d.subscribe(P.batchCalls(e)):f;return d.updateResult(),t},[d,m]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),r.useEffect(()=>{d.setOptions(c)},[c,d]),be(c,p))throw xe(c,d,a);if(ve({result:p,errorResetBoundary:a,throwOnError:c.throwOnError,query:l,suspense:c.suspense}))throw p.error;return c.notifyOnChangeProps?p:d.trackResult(p)}function Se(e,t){return $(e,K,t)}export{o as C,s as S,_,ue as a,g as b,R as c,N as d,M as f,v as g,y as h,de as i,F as l,b as m,$ as n,H as o,p,K as r,z as s,Se as t,P as u,f as v,O as x,x as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,t}from"./rolldown-runtime-
|
|
1
|
+
import{r as e,t}from"./rolldown-runtime-XKyaHtl9.js";import{i as n}from"./react-vendor-C1iE8mnY.js";import{f as r,h as i,u as a}from"./utils-BvvV-Cka.js";var o=e(n()),s=(e,t,n,r)=>{let i=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,`warn`,`react-i18next::`,!0);m(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},c={},l=(e,t,n,r)=>{m(n)&&c[n]||(m(n)&&(c[n]=new Date),s(e,t,n,r))},u=(e,t)=>()=>{if(e.isInitialized)t();else{let n=()=>{setTimeout(()=>{e.off(`initialized`,n)},0),t()};e.on(`initialized`,n)}},d=(e,t,n)=>{e.loadNamespaces(t,u(e,n))},f=(e,t,n,r)=>{if(m(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return d(e,n,r);n.forEach(t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)}),e.loadLanguages(t,u(e,r))},p=(e,t,n={})=>!t.languages||!t.languages.length?(l(t,`NO_LANGUAGES`,`i18n.languages were undefined or empty`,{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(t,r)=>{if(n.bindI18n&&n.bindI18n.indexOf(`languageChanging`)>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}),m=e=>typeof e==`string`,h=e=>typeof e==`object`&&!!e,g=(0,o.createContext)(),_=class{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}},v=t((e=>{var t=n();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),y=t(((e,t)=>{t.exports=v()}))(),b={t:(e,t)=>{if(m(t))return t;if(h(t)&&m(t.defaultValue))return t.defaultValue;if(typeof e==`function`)return``;if(Array.isArray(e)){let t=e[e.length-1];return typeof t==`function`?``:t}return e},ready:!1},x=()=>()=>{},S=(e,t={})=>{let{i18n:n}=t,{i18n:s,defaultNS:c}=(0,o.useContext)(g)||{},u=n||s||a();u&&!u.reportNamespaces&&(u.reportNamespaces=new _),u||l(u,`NO_I18NEXT_INSTANCE`,`useTranslation: You will need to pass in an i18next instance by using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.`);let h=(0,o.useMemo)(()=>({...r(),...u?.options?.react,...t}),[u,t]),{useSuspense:v,keyPrefix:S,bindI18n:C,bindI18nStore:w}=h,T=e||c||u?.options?.defaultNS,E=m(T)?[T]:T||[`translation`],D=(0,o.useMemo)(()=>E,E);u?.reportNamespaces?.addUsedNamespaces?.(D);let O=(0,o.useRef)(0),k=(0,o.useCallback)(e=>{if(!u)return x;let t=()=>{O.current+=1,e()};return C&&u.on(C,t),w&&u.store.on(w,t),()=>{C&&C.split(` `).forEach(e=>u.off(e,t)),w&&w.split(` `).forEach(e=>u.store.off(e,t))}},[u,C,w]),A=(0,o.useRef)(),j=(0,o.useCallback)(()=>{if(!u)return b;let e=!!(u.isInitialized||u.initializedStoreOnce)&&D.every(e=>p(e,u,h)),n=t.lng||u.language,r=O.current,a=typeof S==`function`?i(S,{...u.options,ns:D}):S,o=A.current;if(o&&o.i18n===u&&o.ready===e&&o.lng===n&&o.namespaces===D&&o.keyPrefix===a&&o.revision===r)return o;let s={t:u.getFixedT(n,h.nsMode===`fallback`?D:D[0],S,{scopeNs:D}),i18n:u,ready:e,lng:n,namespaces:D,keyPrefix:a,revision:r};return A.current=s,s},[u,D,S,h,t.lng]),[M,N]=(0,o.useState)(0),{t:P,ready:F}=(0,y.useSyncExternalStore)(k,j,j),I;u&&v&&!F&&(I=new Promise(e=>{let n=()=>e();t.lng?f(u,t.lng,D,n):d(u,D,n)}),{t:P,ready:F}=j()),(0,o.useEffect)(()=>{if(u&&!F&&!v){let e=()=>N(e=>e+1);t.lng?f(u,t.lng,D,e):d(u,D,e)}},[u,t.lng,D,F,v,M]);let L=u||{},R=(0,o.useRef)(null),z=(0,o.useRef)(),B=e=>`${e.language}|${e.resolvedLanguage}|${e.languages?.join(`,`)}`,V=e=>{let t=Object.getOwnPropertyDescriptors(e);t.__original&&delete t.__original;let n=Object.create(Object.getPrototypeOf(e),t);if(!Object.prototype.hasOwnProperty.call(n,`__original`))try{Object.defineProperty(n,"__original",{value:e,writable:!1,enumerable:!1,configurable:!1})}catch{}return n},H=(0,o.useMemo)(()=>{let e=L,t=e&&B(e),n=e;e&&(R.current&&R.current.__original===e&&z.current===t?n=R.current:(n=V(e),R.current=n,z.current=t));let r=!F&&!v?(...e)=>(l(u,`USE_T_BEFORE_READY`,`useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t.`),P(...e)):P,i=[r,n,F];return i.t=r,i.i18n=n,i.ready=F,i},[P,L,F,L.resolvedLanguage,L.language,L.languages]);if(u&&v&&!F){let e=!1;try{e=!1}catch{}throw e&&l(u,`SUSPENDED_WHILE_LOADING`,`useTranslation: suspended while translations are loading (useSuspense is true by default). Add a <Suspense> boundary above this component, or set react.useSuspense: false in the i18next init options. https://react.i18next.com/latest/usetranslation-hook`),I}return H};export{S as t};
|