pisper 0.5.39-linux-x64.0 → 0.5.39
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.en.md +67 -0
- package/README.md +53 -53
- package/bin/pisper.mjs +48 -0
- package/lib/install.mjs +392 -0
- package/lib/npm-platform.mjs +41 -0
- package/lib/npm-update.mjs +165 -0
- package/lib/platform.mjs +43 -0
- package/lib/postinstall.mjs +3 -0
- package/package.json +36 -14
- package/updater.pubkey +1 -0
- package/web/.vite/manifest.json +2606 -0
- package/web/assets/AnimatedList-_pbK4tS3.js +1 -0
- package/web/assets/AppOverlays-DK_RBSUi.js +1 -0
- package/web/assets/AppSelect-v2NUOzRf.js +1 -0
- package/web/assets/AppShortcuts-D66c2bOM.js +1 -0
- package/web/assets/AssetsPage-DFD-JHLO.js +1 -0
- package/web/assets/ChannelsPage-S1iZpd8M.js +1 -0
- package/web/assets/ChatDockView-wwQKATRH.js +2 -0
- package/web/assets/ChatHistoryPage-BNckgbvE.js +1 -0
- package/web/assets/ChatPage-COE_4ulo.js +4 -0
- package/web/assets/ClickSpark-BhxL8WOQ.js +1 -0
- package/web/assets/ConfigPage-BsLy5y6L.js +1 -0
- package/web/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/web/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/web/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/web/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/web/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/web/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/web/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/web/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/web/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/web/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/web/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/web/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/web/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/web/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/web/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/web/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/web/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/web/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/web/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/web/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/web/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/web/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/web/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/web/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/web/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/web/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/web/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/web/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/web/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/web/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/web/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/web/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/web/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/web/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/web/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/web/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/web/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/web/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/web/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/web/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/web/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/web/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/web/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/web/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/web/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/web/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/web/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/web/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/web/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/web/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/web/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/web/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/web/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/web/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/web/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/web/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/web/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/web/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/web/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/web/assets/MarkdownMessage-ickiT81L.js +2 -0
- package/web/assets/MemoryPage-BryPFpf3.js +1 -0
- package/web/assets/MobileViewportStabilizer-CYh5obIv.js +1 -0
- package/web/assets/PageHeader-D7ZcsXHZ.js +1 -0
- package/web/assets/PluginsPage-By294e2k.js +1 -0
- package/web/assets/PreviewPages-gdxrspfV.js +1 -0
- package/web/assets/SchedulesPage-S6X-heBQ.js +1 -0
- package/web/assets/ShinyText-fuaKxKqJ.js +1 -0
- package/web/assets/SkillsPage-nP6Ilb53.js +1 -0
- package/web/assets/StarOrbit-BlI6MhVr.js +1 -0
- package/web/assets/TerminalPanel-Bb_Kf0kq.js +18 -0
- package/web/assets/TerminalPanel-BrP-ENHg.css +1 -0
- package/web/assets/Threads-DPFx-jxG.js +1 -0
- package/web/assets/WelcomeEffects-C9iQOeK6.js +1 -0
- package/web/assets/WorkflowsPage-DlZwTBcP.js +1 -0
- package/web/assets/WorkspacePicker-D766UTlt.js +1 -0
- package/web/assets/abort-signal-D0GPd1Mw.js +1 -0
- package/web/assets/alert-B7D8joCd.js +1 -0
- package/web/assets/andromeeda-vGVdxbeo.js +1 -0
- package/web/assets/angular-html-17rlCfBS.js +1 -0
- package/web/assets/angular-ts-it3MaXWH.js +1 -0
- package/web/assets/api-CmPTEiOc.js +3 -0
- package/web/assets/arrow-right-KWvgbo3p.js +1 -0
- package/web/assets/astro-BEVDzCov.js +1 -0
- package/web/assets/aurora-x-CDeNXAV0.js +1 -0
- package/web/assets/ayu-dark-DluEY0Gj.js +1 -0
- package/web/assets/ayu-light-C3h-C4tm.js +1 -0
- package/web/assets/ayu-mirage-Bqwy1Gya.js +1 -0
- package/web/assets/blade-B3yUZIOx.js +1 -0
- package/web/assets/brand-DIEc3fK8.js +1 -0
- package/web/assets/button-XhIEgIsg.js +1 -0
- package/web/assets/c-aGSZMVdM.js +1 -0
- package/web/assets/catppuccin-frappe-C9Q5zVZY.js +1 -0
- package/web/assets/catppuccin-latte-CtsyrtPq.js +1 -0
- package/web/assets/catppuccin-macchiato-R8nAf1vR.js +1 -0
- package/web/assets/catppuccin-mocha-DjuaAJKi.js +1 -0
- package/web/assets/chat-api-B4XafR63.js +1 -0
- package/web/assets/check-jIXqkGKr.js +1 -0
- package/web/assets/chevron-down-DT6AXwTP.js +1 -0
- package/web/assets/circle-dot-rl11gaty.js +1 -0
- package/web/assets/client-store-TRnjrXTz.js +1 -0
- package/web/assets/code-xml-Z4K2ea1N.js +1 -0
- package/web/assets/coffee-ouOQ86EC.js +1 -0
- package/web/assets/collapsible-DjbBeRo0.js +1 -0
- package/web/assets/config-search-DdUjL2D7.js +1 -0
- package/web/assets/copy-DS-8Hh_R.js +1 -0
- package/web/assets/cpp-Bm3vm43L.js +1 -0
- package/web/assets/css-CWcS1xXm.js +1 -0
- package/web/assets/csv-Dx-8-gkx.js +1 -0
- package/web/assets/dark-plus-Cs2F2srj.js +1 -0
- package/web/assets/dist-CISIC3_f.js +1 -0
- package/web/assets/dist-DOR8kAEV.js +1 -0
- package/web/assets/dracula-BHWKrbxM.js +1 -0
- package/web/assets/dracula-soft-5eyTD99u.js +1 -0
- package/web/assets/earth-DR_clkZ9.js +1 -0
- package/web/assets/embedded-D2rqyswH.js +269 -0
- package/web/assets/es2015-0VLo_afz.js +41 -0
- package/web/assets/everforest-dark-sB-x3p7T.js +1 -0
- package/web/assets/everforest-light-Df2xbC6M.js +1 -0
- package/web/assets/field-C8yUX8Pf.js +1 -0
- package/web/assets/file-C8GNXmhJ.js +1 -0
- package/web/assets/file-code-corner-BKkXAMHR.js +1 -0
- package/web/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
- package/web/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
- package/web/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
- package/web/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
- package/web/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
- package/web/assets/github-dark-C-LZuMrd.js +1 -0
- package/web/assets/github-dark-default-DXG-b-1a.js +1 -0
- package/web/assets/github-dark-dimmed-Bx1FflLF.js +1 -0
- package/web/assets/github-dark-high-contrast-B_tTalzw.js +1 -0
- package/web/assets/github-light-EUqPIrTm.js +1 -0
- package/web/assets/github-light-default-BXViO-2h.js +1 -0
- package/web/assets/github-light-high-contrast-B68TUdTA.js +1 -0
- package/web/assets/glsl-TOBAB6bO.js +1 -0
- package/web/assets/graphql-BEmIBNve.js +1 -0
- package/web/assets/gruvbox-dark-hard-C820rvS2.js +1 -0
- package/web/assets/gruvbox-dark-medium-BPjhmG05.js +1 -0
- package/web/assets/gruvbox-dark-soft-MrdJrrXF.js +1 -0
- package/web/assets/gruvbox-light-hard-BC_s9l72.js +1 -0
- package/web/assets/gruvbox-light-medium-BAWPOn9u.js +1 -0
- package/web/assets/gruvbox-light-soft-BSMLrYjP.js +1 -0
- package/web/assets/haml-CDWtFtU9.js +1 -0
- package/web/assets/handlebars-BNtjo3pL.js +1 -0
- package/web/assets/horizon-CE9ld1lL.js +1 -0
- package/web/assets/horizon-bright-DSNQnXHK.js +1 -0
- package/web/assets/houston-CsvMBhTu.js +1 -0
- package/web/assets/html-BVyvp26C.js +1 -0
- package/web/assets/html-derivative-BseLpURQ.js +1 -0
- package/web/assets/http-CkCfSMV9.js +1 -0
- package/web/assets/hurl-syYMt6Rn.js +1 -0
- package/web/assets/image-Dh7-wI1d.js +1 -0
- package/web/assets/imba-DsUTQ-LC.js +1 -0
- package/web/assets/index-BvVJkBr0.js +40 -0
- package/web/assets/index-DTit-2OA.css +2 -0
- package/web/assets/input-D1QFzNMx.js +1 -0
- package/web/assets/java-duG_UTKe.js +1 -0
- package/web/assets/javascript-DWVbOe4X.js +1 -0
- package/web/assets/jinja-Boj4niAz.js +1 -0
- package/web/assets/jison-CHwnC1Pv.js +1 -0
- package/web/assets/json-qhed-kSA.js +1 -0
- package/web/assets/json5-BR5RXkoi.js +1 -0
- package/web/assets/jsonc-CYpm1nAK.js +1 -0
- package/web/assets/jsonl-CmCQp5Yx.js +1 -0
- package/web/assets/jsx-fcCEM_-L.js +1 -0
- package/web/assets/julia-VoF7UKfw.js +1 -0
- package/web/assets/kanagawa-dragon-Bozd7klA.js +1 -0
- package/web/assets/kanagawa-lotus-BmuOG9ZW.js +1 -0
- package/web/assets/kanagawa-wave-BML5mF2J.js +1 -0
- package/web/assets/laserwave-C_8bwKvT.js +1 -0
- package/web/assets/less-DVTAwKKz.js +1 -0
- package/web/assets/light-plus-DVQuIRkW.js +1 -0
- package/web/assets/link-2-CaZP6GWi.js +1 -0
- package/web/assets/loader-circle-72TYCcVQ.js +1 -0
- package/web/assets/markdown-BYOwaDjH.js +1 -0
- package/web/assets/marko-Cupn1xhw.js +1 -0
- package/web/assets/material-theme-Bm3Qr25_.js +1 -0
- package/web/assets/material-theme-darker-2IIEA8gg.js +1 -0
- package/web/assets/material-theme-lighter-uhdI0v04.js +1 -0
- package/web/assets/material-theme-ocean-CHQ94UKr.js +1 -0
- package/web/assets/material-theme-palenight-B5W6OYN7.js +1 -0
- package/web/assets/mdc-4FfK5iWR.js +1 -0
- package/web/assets/mdx-DQZ5AkYe.js +1 -0
- package/web/assets/message-circle-Bc_EzZop.js +1 -0
- package/web/assets/min-dark-BSWPekZh.js +1 -0
- package/web/assets/min-light-DDpmG2fV.js +1 -0
- package/web/assets/mobile-remote-fallback-JvG4VcPg.js +1 -0
- package/web/assets/mobile-runtime-recovery-DBq1Dp1R.js +1 -0
- package/web/assets/monokai-B_bV9PQ9.js +1 -0
- package/web/assets/night-owl-DhmEMT88.js +1 -0
- package/web/assets/night-owl-light-eJ-hLW7d.js +1 -0
- package/web/assets/nord-Cb4Vim4T.js +1 -0
- package/web/assets/one-dark-pro-CLwyXe_n.js +1 -0
- package/web/assets/one-light-D7Lr4KcI.js +1 -0
- package/web/assets/panel-left-CVuoi3zo.js +1 -0
- package/web/assets/panel-top-CA2GX1Rj.js +1 -0
- package/web/assets/paperclip-BMRj9kRG.js +1 -0
- package/web/assets/pencil-CxA1IK0x.js +1 -0
- package/web/assets/php-CUREQQ7f.js +1 -0
- package/web/assets/pick-system-directory-BnIFt85A.js +1 -0
- package/web/assets/plastic-DQwYfKfQ.js +1 -0
- package/web/assets/play-N6mg4pFl.js +1 -0
- package/web/assets/poimandres-DRFjx7u4.js +1 -0
- package/web/assets/postcss-BXeXVLqQ.js +1 -0
- package/web/assets/progress-493FBtJ4.js +6 -0
- package/web/assets/pug-CQyGKZpv.js +1 -0
- package/web/assets/python-gzcpVVnB.js +1 -0
- package/web/assets/r-C5FwQflr.js +1 -0
- package/web/assets/react-bits-DQli9s7O.css +1 -0
- package/web/assets/red-DX1BQOs8.js +1 -0
- package/web/assets/regexp--aR2_iz7.js +1 -0
- package/web/assets/rolldown-runtime-B0Z9INg1.js +1 -0
- package/web/assets/rose-pine-aMsaMD1D.js +1 -0
- package/web/assets/rose-pine-dawn-8PwUyIlP.js +1 -0
- package/web/assets/rose-pine-moon-DO-qXg-I.js +1 -0
- package/web/assets/sass-DXrisJhu.js +1 -0
- package/web/assets/save-CVL5N6eP.js +1 -0
- package/web/assets/scroll-area-CrWpxKGa.js +1 -0
- package/web/assets/scss-Davl4E3T.js +1 -0
- package/web/assets/send-DcLH_sg0.js +1 -0
- package/web/assets/separator-COSHUqEJ.js +1 -0
- package/web/assets/shellscript-CLZ0U2zV.js +1 -0
- package/web/assets/shield-check-BQHFfxVy.js +1 -0
- package/web/assets/shortcuts-BIzphxhz.js +1 -0
- package/web/assets/slack-dark-DnToyrRv.js +1 -0
- package/web/assets/slack-ochin-B2OO5cIa.js +1 -0
- package/web/assets/smithy-Dgaz7aur.js +1 -0
- package/web/assets/snazzy-light-4G7pJPwS.js +1 -0
- package/web/assets/solarized-dark-UdsmMDCL.js +1 -0
- package/web/assets/solarized-light-C1IUL_tW.js +1 -0
- package/web/assets/speech-session-UGYrCHlP.js +3 -0
- package/web/assets/speech-stream-text-Cwsgaoku.js +2 -0
- package/web/assets/speech-text-Js_tr4qo.js +1 -0
- package/web/assets/sql-b92rrcVl.js +1 -0
- package/web/assets/square-BZ3Bi3O-.js +1 -0
- package/web/assets/square-terminal-DpCa0gzM.js +1 -0
- package/web/assets/storage-BE5DCCG3.js +1 -0
- package/web/assets/stylus-B6D30XZt.js +1 -0
- package/web/assets/svelte-BfstjgUc.js +1 -0
- package/web/assets/synthwave-84-nFMaYfgc.js +1 -0
- package/web/assets/tag-Csd134FL.js +1 -0
- package/web/assets/tokyo-night-oM2G3aXe.js +1 -0
- package/web/assets/tool-labels-BJhLig5u.js +1 -0
- package/web/assets/tooltip-BIOYQmnq.js +1 -0
- package/web/assets/trash-2-mhzzyC6i.js +1 -0
- package/web/assets/ts-tags-Cckpt1jI.js +1 -0
- package/web/assets/tsx-JMDX3aQ7.js +1 -0
- package/web/assets/typescript-BAz-bF8J.js +1 -0
- package/web/assets/use-animation-visibility-C-GENY2Z.js +1 -0
- package/web/assets/use-i18n-B2uTAjsJ.js +1 -0
- package/web/assets/use-mobile-DikQ1IYz.js +1 -0
- package/web/assets/usePagePrimaryAction-Bw0OFTDZ.js +1 -0
- package/web/assets/utils-C8uzG5AZ.js +1 -0
- package/web/assets/vendor-dockview-D5adAaCg.css +1 -0
- package/web/assets/vendor-dockview-yY5mBM3U.js +1 -0
- package/web/assets/vendor-markdown-K9KdiImV.js +130 -0
- package/web/assets/vendor-markdown-plugins-DEcVZfaU.css +1 -0
- package/web/assets/vendor-markdown-plugins-Wv1dLaAO.js +263 -0
- package/web/assets/vendor-motion-XxgxfZSY.js +9 -0
- package/web/assets/vendor-react-CHuvPdJE.js +9 -0
- package/web/assets/vendor-router-Bw2aAdMs.js +4 -0
- package/web/assets/vendor-shiki-runtime-CxE5QolQ.js +153 -0
- package/web/assets/vendor-state-DE1O_s6m.js +1 -0
- package/web/assets/vendor-ui-DvrYggeS.js +1 -0
- package/web/assets/vendor-xyflow-CnjXtcyK.js +7 -0
- package/web/assets/vendor-xyflow-DLioOiRN.css +1 -0
- package/web/assets/vesper-DdrHHSXu.js +1 -0
- package/web/assets/vitesse-black-fwtXNY1n.js +1 -0
- package/web/assets/vitesse-dark-BZCL-v6S.js +1 -0
- package/web/assets/vitesse-light-VbXTXTou.js +1 -0
- package/web/assets/vue-3H7P6ncC.js +1 -0
- package/web/assets/vue-html-DZGW9MGR.js +1 -0
- package/web/assets/vue-vine-BECt67gq.js +1 -0
- package/web/assets/wasm-BnjxR4X6.js +1 -0
- package/web/assets/wasm-ByWQv1Qj.js +1 -0
- package/web/assets/web-preview-panel-Dp5aIwsV.js +556 -0
- package/web/assets/welcome-brand-W7Ox3fri.js +1 -0
- package/web/assets/wgsl-BsKzXJz4.js +1 -0
- package/web/assets/wit-DdvCle-K.js +1 -0
- package/web/assets/wrench-BqeVhocX.js +1 -0
- package/web/assets/x-bw26XDZM.js +1 -0
- package/web/assets/xml-CNfvW5JP.js +1 -0
- package/web/assets/yaml-rwi0_p6S.js +1 -0
- package/web/assets/zap-CFsp4Y1u.js +1 -0
- package/web/favicon.svg +25 -0
- package/web/icons.svg +24 -0
- package/web/index.html +82 -0
- package/web/memory-galaxy-background.webp +0 -0
- package/web/mobile-startup.html +322 -0
- package/web/notification-sw.js +13 -0
- package/web/tauri-pet.css +117 -0
- package/web/tauri-pet.html +16 -0
- package/web/tauri-pet.js +149 -0
- package/components/runtime/Pisper_Runtime_Node_0.5.37_linux_x86_64.tar.gz +0 -0
- package/components/runtime/Pisper_Runtime_Node_0.5.37_linux_x86_64.tar.gz.sig +0 -1
- package/components/tui/Pisper_TUI_Component_0.5.23_linux_x86_64.tar.gz +0 -0
- package/components/tui/Pisper_TUI_Component_0.5.23_linux_x86_64.tar.gz.sig +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,t as n}from"./vendor-react-CHuvPdJE.js";import{t as r}from"./api-CmPTEiOc.js";import{i,n as a,o,t as s}from"./button-XhIEgIsg.js";import{d as c,g as l,h as u,m as d,p as f,r as p,s as m,t as h,u as g}from"./use-i18n-B2uTAjsJ.js";import{c as _,i as v,o as y,s as b}from"./use-mobile-DikQ1IYz.js";import{a as x,i as S,n as C,r as w,s as T,t as E,u as D}from"./es2015-0VLo_afz.js";import{n as O,t as k}from"./dist-CISIC3_f.js";import{a as A,c as j,i as M,n as N,o as ee,r as P,s as te,t as F}from"./collapsible-DjbBeRo0.js";import{n as I,r as ne,t as L}from"./AppSelect-v2NUOzRf.js";import{t as R}from"./separator-COSHUqEJ.js";import{t as re}from"./utils-C8uzG5AZ.js";import{t as ie}from"./storage-BE5DCCG3.js";import{t as ae}from"./arrow-right-KWvgbo3p.js";import{t as z}from"./check-jIXqkGKr.js";import{t as oe}from"./chevron-down-DT6AXwTP.js";import{t as se}from"./code-xml-Z4K2ea1N.js";import{t as ce}from"./earth-DR_clkZ9.js";import{t as le}from"./loader-circle-72TYCcVQ.js";import{a as ue,i as de,o as fe,s as pe,t as me}from"./config-search-DdUjL2D7.js";import{n as he,t as ge}from"./zap-CFsp4Y1u.js";import{t as _e}from"./save-CVL5N6eP.js";import{t as ve}from"./send-DcLH_sg0.js";import{t as ye}from"./shield-check-BQHFfxVy.js";import{t as be}from"./square-terminal-DpCa0gzM.js";import{t as xe}from"./trash-2-mhzzyC6i.js";import{t as Se}from"./wrench-BqeVhocX.js";import{t as Ce}from"./x-bw26XDZM.js";import{A as we,B as Te,C as B,Ct as Ee,D as De,Dt as Oe,E as ke,Ft as Ae,It as je,Lt as Me,M as Ne,Mt as Pe,N as Fe,Nt as Ie,Ot as Le,P as Re,Pt as ze,Rt as Be,S as Ve,T as He,Tt as Ue,_t as We,a as Ge,b as Ke,bt as V,dt as qe,gt as Je,ht as H,i as U,j as Ye,jt as Xe,k as Ze,kt as Qe,l as $e,n as et,o as tt,r as nt,s as rt,t as it,v as at,vt as ot,w as st,x as ct,xt as lt,y as ut,yt as dt,zt as ft}from"./index-BvVJkBr0.js";import{t as W}from"./field-C8yUX8Pf.js";import{a as pt,c as mt,d as ht,l as gt,s as _t,t as vt,u as yt}from"./shortcuts-BIzphxhz.js";import{t as bt}from"./usePagePrimaryAction-Bw0OFTDZ.js";import{t as xt}from"./MarkdownMessage-ickiT81L.js";import{t as St}from"./brand-DIEc3fK8.js";var G=e(t(),1),K=n(),Ct=Object.defineProperty,q=(e,t)=>Ct(e,`name`,{value:t,configurable:!0}),wt=[`Enter`,` `],Tt=[`ArrowDown`,`PageUp`,`Home`],Et=[`ArrowUp`,`PageDown`,`End`],Dt=[...Tt,...Et];[...wt],[...wt];var Ot=`Menu`,[kt,At,jt]=ft(Ot),[Mt,Nt]=d(Ot,[jt,_,Me]),Pt=_(),Ft=Me(),[It,Lt]=Mt(Ot),[Rt,zt]=Mt(Ot),Bt=q(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=Pt(t),[c,l]=G.useState(null),u=G.useRef(!1),d=k(a),f=Be(i);return G.useEffect(()=>{let e=q(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=q(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),G.useEffect(()=>{if(!n)return;let e=q(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,K.jsx)(b,{...s,children:(0,K.jsx)(It,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,K.jsx)(Rt,{scope:t,onClose:G.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),Vt=G.forwardRef(q(function(e,t){let{__scopeMenu:n,...r}=e,i=Pt(n);return(0,K.jsx)(v,{...i,...r,ref:t})},`MenuAnchor`)),Ht=`MenuPortal`,[Ut,Wt]=Mt(Ht,{forceMount:void 0}),Gt=q(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Lt(Ht,t);return(0,K.jsx)(Ut,{scope:t,forceMount:n,children:(0,K.jsx)(D,{present:n||a.open,children:(0,K.jsx)(S,{asChild:!0,container:i,children:r})})})},`MenuPortal`),J=`MenuContent`,[Kt,qt]=Mt(J),Jt=G.forwardRef(q(function(e,t){let n=Wt(J,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Lt(J,e.__scopeMenu),o=zt(J,e.__scopeMenu);return(0,K.jsx)(kt.Provider,{scope:e.__scopeMenu,children:(0,K.jsx)(D,{present:r||a.open,children:(0,K.jsx)(kt.Slot,{scope:e.__scopeMenu,children:o.modal?(0,K.jsx)(Yt,{...i,ref:t}):(0,K.jsx)(Xt,{...i,ref:t})})})})},`MenuContent`)),Yt=G.forwardRef(q(function(e,t){let n=Lt(J,e.__scopeMenu),r=G.useRef(null),i=o(t,r);return G.useEffect(()=>{let e=r.current;if(e)return E(e)},[]),(0,K.jsx)(Qt,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:f(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),Xt=G.forwardRef(q(function(e,t){let n=Lt(J,e.__scopeMenu);return(0,K.jsx)(Qt,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),Zt=i(`MenuContent.ScrollLock`),Qt=G.forwardRef(q(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:m,onDismiss:h,disableOutsideScroll:g,..._}=e,v=Lt(J,n),b=zt(J,n),S=Pt(n),E=Ft(n),D=At(n),[O,k]=G.useState(null),A=G.useRef(null),j=o(t,A,v.onContentChange),M=G.useRef(0),N=G.useRef(``),ee=G.useRef(0),P=G.useRef(null),te=G.useRef(`right`),F=G.useRef(0),I=g?C:G.Fragment,ne=g?{as:Zt,allowPinchZoom:!0}:void 0,L=q(e=>{let t=N.current+e,n=D().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=hn(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;q((function e(t){N.current=t,window.clearTimeout(M.current),t!==``&&(M.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);G.useEffect(()=>()=>window.clearTimeout(M.current),[]),w();let R=G.useCallback(e=>te.current===P.current?.side&&_n(e,P.current?.area),[]);return(0,K.jsx)(Kt,{scope:n,searchRef:N,onItemEnter:G.useCallback(e=>{R(e)&&e.preventDefault()},[R]),onItemLeave:G.useCallback(e=>{R(e)||(A.current?.focus(),k(null))},[R]),onTriggerLeave:G.useCallback(e=>{R(e)&&e.preventDefault()},[R]),pointerGraceTimerRef:ee,onPointerGraceIntentChange:G.useCallback(e=>{P.current=e},[]),children:(0,K.jsx)(I,{...ne,children:(0,K.jsx)(x,{asChild:!0,trapped:i,onMountAutoFocus:f(a,e=>{e.preventDefault(),A.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:(0,K.jsx)(T,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:m,onDismiss:h,children:(0,K.jsx)(je,{asChild:!0,...E,dir:b.dir,orientation:`vertical`,loop:r,currentTabStopId:O,onCurrentTabStopIdChange:k,onEntryFocus:f(l,e=>{b.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,K.jsx)(y,{role:`menu`,"aria-orientation":`vertical`,"data-state":un(v.open),"data-radix-menu-content":``,dir:b.dir,...S,..._,ref:j,style:{outline:`none`,..._.style},onKeyDown:f(_.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&L(e.key));let i=A.current;if(e.target!==i||!Dt.includes(e.key))return;e.preventDefault();let a=D().filter(e=>!e.disabled).map(e=>e.ref.current);Et.includes(e.key)&&a.reverse(),pn(a)}),onBlur:f(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(M.current),N.current=``)}),onPointerMove:f(e.onPointerMove,vn(e=>{let t=e.target,n=F.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>F.current?`right`:`left`;te.current=t,F.current=e.clientX}}))})})})})})})},`MenuContentImpl`)),$t=`MenuItem`,en=`menu.itemSelect`,tn=G.forwardRef(q(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=G.useRef(null),s=zt($t,e.__scopeMenu),c=qt($t,e.__scopeMenu),u=o(t,a),d=G.useRef(!1),p=q(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(en,{bubbles:!0,cancelable:!0});e.addEventListener(en,e=>r?.(e),{once:!0}),l(e,t),t.defaultPrevented?d.current=!1:s.onClose()}},`handleSelect`);return(0,K.jsx)(nn,{...i,ref:u,disabled:n,onClick:f(e.onClick,p),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:f(e.onPointerUp,e=>{d.current||e.currentTarget?.click()}),onKeyDown:f(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(c.searchRef.current===``||e.key!==` `)&&wt.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),nn=G.forwardRef(q(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,s=qt($t,n),c=Ft(n),l=G.useRef(null),d=o(t,l),[p,m]=G.useState(!1),[h,g]=G.useState(``);return G.useEffect(()=>{let e=l.current;e&&g((e.textContent??``).trim())},[a.children]),(0,K.jsx)(kt.ItemSlot,{scope:n,disabled:r,textValue:i??h,children:(0,K.jsx)(Ae,{asChild:!0,...c,focusable:!r,children:(0,K.jsx)(u.div,{role:`menuitem`,"data-highlighted":p?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:d,onPointerMove:f(e.onPointerMove,vn(e=>{r?s.onItemLeave(e):(s.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:f(e.onPointerLeave,vn(e=>s.onItemLeave(e))),onFocus:f(e.onFocus,()=>m(!0)),onBlur:f(e.onBlur,()=>m(!1))})})})},`MenuItemImpl`)),[rn,an]=Mt(`MenuRadioGroup`,{value:void 0,onValueChange:q(()=>{},`onValueChange`)}),[on,sn]=Mt(`MenuItemIndicator`,{checked:!1}),[cn,ln]=Mt(`MenuSub`);function un(e){return e?`open`:`closed`}q(un,`getOpenState`);function dn(e){return e===`indeterminate`}q(dn,`isIndeterminate`);function fn(e){return dn(e)?`indeterminate`:e?`checked`:`unchecked`}q(fn,`getCheckedState`);function pn(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}q(pn,`focusFirst`);function mn(e,t){return e.map((n,r)=>e[(t+r)%e.length])}q(mn,`wrapArray`);function hn(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=mn(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}q(hn,`getNextMatch`);function gn(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}q(gn,`isPointInPolygon`);function _n(e,t){return t?gn({x:e.clientX,y:e.clientY},t):!1}q(_n,`isPointerInGraceArea`);function vn(e){return t=>t.pointerType===`mouse`?e(t):void 0}q(vn,`whenMouse`);var yn=Bt,bn=Vt,xn=Gt,Sn=Jt,Cn=tn,wn=Object.defineProperty,Tn=(e,t)=>wn(e,`name`,{value:t,configurable:!0}),En=`DropdownMenu`,[Dn,On]=d(En,[Nt]),kn=Nt(),[An,jn]=Dn(En),Mn=Tn(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,l=kn(t),u=G.useRef(null),[d,f]=c({prop:i,defaultProp:a??!1,onChange:o,caller:En});return(0,K.jsx)(An,{scope:t,triggerId:O(),triggerRef:u,contentId:O(),open:d,onOpenChange:f,onOpenToggle:G.useCallback(()=>f(e=>!e),[f]),modal:s,children:(0,K.jsx)(yn,{...l,open:d,onOpenChange:f,dir:r,modal:s,children:n})})},`DropdownMenu`),Nn=`DropdownMenuTrigger`,Pn=G.forwardRef(Tn(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=jn(Nn,n),s=kn(n),c=o(t,a.triggerRef);return(0,K.jsx)(bn,{asChild:!0,...s,children:(0,K.jsx)(u.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:c,onPointerDown:f(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:f(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),Fn=Tn(e=>{let{__scopeDropdownMenu:t,...n}=e,r=kn(t);return(0,K.jsx)(xn,{...r,...n})},`DropdownMenuPortal`),In=`DropdownMenuContent`,Ln=G.forwardRef(Tn(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=jn(In,n),a=kn(n),o=G.useRef(!1);return(0,K.jsx)(Sn,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:f(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:f(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),Rn=G.forwardRef(Tn(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=kn(n);return(0,K.jsx)(Cn,{...i,...r,ref:t})},`DropdownMenuItem`)),zn=Mn,Bn=Pn,Vn=Fn,Hn=Ln,Un=Rn,Wn=Object.defineProperty,Y=(e,t)=>Wn(e,`name`,{value:t,configurable:!0}),Gn=[`PageUp`,`PageDown`],Kn=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],qn={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},Jn=`Slider`,[Yn,Xn,Zn]=ft(Jn),[Qn,$n]=d(Jn,[Zn]),[er,tr]=Qn(Jn),nr=G.forwardRef(Y(function(e,t){let{name:n,min:r=0,max:i=100,step:a=1,orientation:s=`horizontal`,disabled:l=!1,minStepsBetweenThumbs:u=0,defaultValue:d=[r],value:p,onValueChange:m=Y(()=>{},`onValueChange`),onValueCommit:h=Y(()=>{},`onValueCommit`),inverted:g=!1,form:_,...v}=e,y=G.useRef(new Set),b=G.useRef(0),x=G.useRef(!1),S=s===`horizontal`?ar:or,[C,w]=G.useState(null),T=o(t,w),[E=[],D]=c({prop:p,defaultProp:d,onChange:Y(e=>{[...y.current][b.current]?.focus({preventScroll:!0,focusVisible:x.current}),x.current=!1,m(e)},`onChange`)}),O=G.useRef(E),k=G.useRef(E);G.useEffect(()=>{let e=_?C?.ownerDocument.getElementById(_):C?.closest(`form`);if(e instanceof HTMLFormElement){let t=Y(()=>D(k.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[C,_,D]);function A(e){N(e,wr(E,e))}Y(A,`handleSlideStart`);function j(e){N(e,b.current)}Y(j,`handleSlideMove`);function M(){String(E)!==String(O.current)&&h(E)}Y(M,`handleSlideEnd`);function N(e,t,{commit:n}={commit:!1}){let o=kr(a),s=Ar(Math.round((e-r)/a)*a+r,o),c=I(s,[r,i]);D((e=[])=>{let r=xr(e,c,t);if(Dr(r,u*a)){b.current=r.indexOf(c);let t=String(r)!==String(e);return t&&n&&h(r),t?r:e}return e})}return Y(N,`updateValues`),(0,K.jsx)(er,{scope:e.__scopeSlider,name:n,disabled:l,min:r,max:i,valueIndexToChangeRef:b,thumbs:y.current,values:E,orientation:s,form:_,children:(0,K.jsx)(Yn.Provider,{scope:e.__scopeSlider,children:(0,K.jsx)(Yn.Slot,{scope:e.__scopeSlider,children:(0,K.jsx)(S,{"aria-disabled":l,"data-disabled":l?``:void 0,...v,ref:T,onPointerDown:f(v.onPointerDown,()=>{l||(O.current=E,x.current=!1)}),min:r,max:i,inverted:g,onSlideStart:l?void 0:A,onSlideMove:l?void 0:j,onSlideEnd:l?void 0:M,onHomeKeyDown:()=>{l||(x.current=!0,N(r,0,{commit:!0}))},onEndKeyDown:()=>{l||(x.current=!0,N(i,E.length-1,{commit:!0}))},onStepKeyDown:({event:e,direction:t})=>{if(!l){x.current=!0;let n=Gn.includes(e.key)||e.shiftKey&&Kn.includes(e.key)?10:1,i=b.current,o=E[i];N(jr(o,{min:r,step:a,direction:t,multiplier:n}),i,{commit:!0})}}})})})})},`Slider`)),[rr,ir]=Qn(Jn,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),ar=G.forwardRef(Y(function(e,t){let{min:n,max:r,dir:i,inverted:a,onSlideStart:s,onSlideMove:c,onSlideEnd:l,onStepKeyDown:u,...d}=e,[f,p]=G.useState(null),m=o(t,p),h=G.useRef(void 0),g=Be(i),_=g===`ltr`,v=_&&!a||!_&&a;function y(e){let t=h.current||f.getBoundingClientRect(),i=Or([0,t.width],v?[n,r]:[r,n]);return h.current=t,i(e-t.left)}return Y(y,`getValueFromPointer`),(0,K.jsx)(rr,{scope:e.__scopeSlider,startEdge:v?`left`:`right`,endEdge:v?`right`:`left`,direction:v?1:-1,size:`width`,children:(0,K.jsx)(sr,{dir:g,"data-orientation":`horizontal`,...d,ref:m,style:{...d.style,"--radix-slider-thumb-transform":`translateX(-50%)`},onSlideStart:e=>{let t=y(e.clientX);s?.(t)},onSlideMove:e=>{let t=y(e.clientX);c?.(t)},onSlideEnd:()=>{h.current=void 0,l?.()},onStepKeyDown:e=>{let t=qn[v?`from-left`:`from-right`].includes(e.key);u?.({event:e,direction:t?-1:1})}})})},`SliderHorizontal`)),or=G.forwardRef(Y(function(e,t){let{min:n,max:r,inverted:i,onSlideStart:a,onSlideMove:s,onSlideEnd:c,onStepKeyDown:l,...u}=e,d=G.useRef(null),f=o(t,d),p=G.useRef(void 0),m=!i;function h(e){let t=p.current||d.current.getBoundingClientRect(),i=Or([0,t.height],m?[r,n]:[n,r]);return p.current=t,i(e-t.top)}return Y(h,`getValueFromPointer`),(0,K.jsx)(rr,{scope:e.__scopeSlider,startEdge:m?`bottom`:`top`,endEdge:m?`top`:`bottom`,size:`height`,direction:m?1:-1,children:(0,K.jsx)(sr,{"data-orientation":`vertical`,...u,ref:f,style:{...u.style,"--radix-slider-thumb-transform":`translateY(50%)`},onSlideStart:e=>{let t=h(e.clientY);a?.(t)},onSlideMove:e=>{let t=h(e.clientY);s?.(t)},onSlideEnd:()=>{p.current=void 0,c?.()},onStepKeyDown:e=>{let t=qn[m?`from-bottom`:`from-top`].includes(e.key);l?.({event:e,direction:t?-1:1})}})})},`SliderVertical`)),sr=G.forwardRef(Y(function(e,t){let{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:o,onEndKeyDown:s,onStepKeyDown:c,...l}=e,d=tr(Jn,n);return(0,K.jsx)(u.span,{...l,ref:t,onKeyDown:f(e.onKeyDown,e=>{e.key===`Home`?(o(e),e.preventDefault()):e.key===`End`?(s(e),e.preventDefault()):Gn.concat(Kn).includes(e.key)&&(c(e),e.preventDefault())}),onPointerDown:f(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),d.thumbs.has(t)?t.focus({preventScroll:!0,focusVisible:!1}):r(e)}),onPointerMove:f(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)}),onPointerUp:f(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),a(e))})})},`SliderImpl`)),cr=`SliderTrack`,lr=G.forwardRef(Y(function(e,t){let{__scopeSlider:n,...r}=e,i=tr(cr,n);return(0,K.jsx)(u.span,{"data-disabled":i.disabled?``:void 0,"data-orientation":i.orientation,...r,ref:t})},`SliderTrack`)),ur=`SliderRange`,dr=G.forwardRef(Y(function(e,t){let{__scopeSlider:n,...r}=e,i=tr(ur,n),a=ir(ur,n),s=G.useRef(null),c=o(t,s),l=i.values.length,d=i.values.map(e=>Sr(e,i.min,i.max)),f=l>1?Math.min(...d):0,p=100-Math.max(...d);return(0,K.jsx)(u.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?``:void 0,...r,ref:c,style:{...e.style,[a.startEdge]:f+`%`,[a.endEdge]:p+`%`}})},`SliderRange`)),[fr,pr]=Qn(`SliderThumb`),mr=`SliderThumbProvider`;function hr(e){let{__scopeSlider:t,name:n,children:r,internal_do_not_use_render:i}=e,a=tr(mr,t),o=Xn(t),[s,c]=G.useState(null),l=G.useMemo(()=>s?o().findIndex(e=>e.ref.current===s):-1,[o,s]),u=g(s),d=!s||!!a.form||!!s.closest(`form`),f=a.values[l],p=n??(a.name?a.name+(a.values.length>1?`[]`:``):void 0),m=f===void 0?0:Sr(f,a.min,a.max);G.useEffect(()=>{if(s)return a.thumbs.add(s),()=>{a.thumbs.delete(s)}},[s,a.thumbs]);let h={value:f,name:p,form:a.form,isFormControl:d,index:l,thumb:s,onThumbChange:c,percent:m,size:u};return(0,K.jsx)(fr,{scope:t,...h,children:Mr(i)?i(h):r})}Y(hr,`SliderThumbProvider`);var gr=`SliderThumbTrigger`,_r=G.forwardRef(Y(function(e,t){let{__scopeSlider:n,...r}=e,i=tr(gr,n),a=ir(gr,n),{index:s,value:c,percent:l,size:d,onThumbChange:p}=pr(gr,n),m=o(t,p),h=Cr(s,i.values.length),g=d?.[a.size],_=g?Tr(g,l,a.direction):0;return(0,K.jsx)(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[a.startEdge]:`calc(${l}% + ${_}px)`},children:(0,K.jsx)(Yn.ItemSlot,{scope:n,children:(0,K.jsx)(u.span,{role:`slider`,"aria-label":e[`aria-label`]||h,"aria-valuemin":i.min,"aria-valuenow":c,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?``:void 0,tabIndex:i.disabled?void 0:0,...r,ref:m,style:c===void 0?{display:`none`}:e.style,onFocus:f(e.onFocus,()=>{i.valueIndexToChangeRef.current=s})})})})},`SliderThumbTrigger`)),vr=G.forwardRef(Y(function(e,t){let{__scopeSlider:n,name:r,...i}=e;return(0,K.jsx)(hr,{__scopeSlider:n,name:r,internal_do_not_use_render:({index:e,isFormControl:r})=>(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(_r,{...i,ref:t,__scopeSlider:n}),r?(0,K.jsx)(br,{__scopeSlider:n},e):null]})})},`SliderThumb`)),yr=`SliderBubbleInput`,br=G.forwardRef(Y(function({__scopeSlider:e,...t},n){let{value:r,name:i,form:a}=pr(yr,e),s=G.useRef(null),c=o(s,n),l=ne(r);return G.useEffect(()=>{let e=s.current;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(l!==r&&n){let t=new Event(`input`,{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}},[l,r]),(0,K.jsx)(u.input,{style:{display:`none`},name:i,form:a,...t,ref:c,defaultValue:r})},`SliderBubbleInput`));function xr(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}Y(xr,`getNextSortedValues`);function Sr(e,t,n){let r=100/(n-t)*(e-t);return I(r,[0,100])}Y(Sr,`convertValueToPercentage`);function Cr(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}Y(Cr,`getLabel`);function wr(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}Y(wr,`getClosestValueIndex`);function Tr(e,t,n){let r=e/2;return(r-Or([0,50],[0,r])(t)*n)*n}Y(Tr,`getThumbInBoundsOffset`);function Er(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}Y(Er,`getStepsBetweenValues`);function Dr(e,t){if(t>0){let n=Er(e);return Math.min(...n)>=t}return!0}Y(Dr,`hasMinStepsBetweenValues`);function Or(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}Y(Or,`linearScale`);function kr(e){if(!Number.isFinite(e))return 0;let t=e.toString();if(t.includes(`e`)){let[e,n]=t.split(`e`),r=e.split(`.`)[1]||``,i=Number(n);return Math.max(0,r.length-i)}let n=t.split(`.`)[1];return n?n.length:0}Y(kr,`getDecimalCount`);function Ar(e,t){let n=10**t;return Math.round(e*n)/n}Y(Ar,`roundValue`);function jr(e,{min:t,step:n,direction:r,multiplier:i}){let a=kr(n),o=(e-t)/n,s=Math.round(o),c=Ar(s*n+t,a)===Ar(e,a),l;return l=c?s+i*r:r>0?Math.ceil(o):Math.floor(o),Ar(l*n+t,a)}Y(jr,`getNextStepValue`);function Mr(e){return typeof e==`function`}Y(Mr,`isFunction`);var Nr=a(`activity`,[[`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`}]]),Pr=a(`bell-off`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]),Fr=a(`cat`,[[`path`,{d:`M12 5c.67 0 1.35.09 2 .26 1.78-2 5.03-2.84 6.42-2.26 1.4.58-.42 7-.42 7 .57 1.07 1 2.24 1 3.44C21 17.9 16.97 21 12 21s-9-3-9-7.56c0-1.25.5-2.4 1-3.44 0 0-1.89-6.42-.5-7 1.39-.58 4.72.23 6.5 2.23A9.04 9.04 0 0 1 12 5Z`,key:`x6xyqk`}],[`path`,{d:`M8 14v.5`,key:`1nzgdb`}],[`path`,{d:`M16 14v.5`,key:`1lajdz`}],[`path`,{d:`M11.25 16.25h1.5L12 17l-.75-.75Z`,key:`12kq1m`}]]),Ir=a(`circle-alert`,[[`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`}]]),Lr=a(`cpu`,[[`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`}]]),Rr=a(`fold-vertical`,[[`path`,{d:`M12 22v-6`,key:`6o8u61`}],[`path`,{d:`M12 8V2`,key:`1wkif3`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}],[`path`,{d:`m15 19-3-3-3 3`,key:`e37ymu`}],[`path`,{d:`m15 5-3 3-3-3`,key:`19d6lf`}]]),zr=a(`handshake`,[[`path`,{d:`m11 17 2 2a1 1 0 1 0 3-3`,key:`efffak`}],[`path`,{d:`m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4`,key:`9pr0kb`}],[`path`,{d:`m21 3 1 11h-2`,key:`1tisrp`}],[`path`,{d:`M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3`,key:`1uvwmv`}],[`path`,{d:`M3 4h8`,key:`1ep09j`}]]),Br=a(`languages`,[[`path`,{d:`m5 8 6 6`,key:`1wu5hv`}],[`path`,{d:`m4 14 6-6 2-3`,key:`1k1g8d`}],[`path`,{d:`M2 5h12`,key:`or177f`}],[`path`,{d:`M7 2h1`,key:`1t2jsx`}],[`path`,{d:`m22 22-5-10-5 10`,key:`don7ne`}],[`path`,{d:`M14 18h6`,key:`1m8k6r`}]]),Vr=a(`laptop`,[[`path`,{d:`M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z`,key:`1pdavp`}],[`path`,{d:`M20.054 15.987H3.946`,key:`14rxg9`}]]),Hr=a(`package-check`,[[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`path`,{d:`m16 17 2 2 4-4`,key:`uh5qu3`}],[`path`,{d:`M21 11.127V8a2 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.729l7 4a2 2 0 0 0 2 .001l1.32-.753`,key:`kpkbpo`}],[`path`,{d:`M3.29 7 12 12l8.71-5`,key:`19ckod`}],[`path`,{d:`m7.5 4.27 8.997 5.148`,key:`9yrvtv`}]]),Ur=a(`palette`,[[`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`}]]),Wr=a(`pencil-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`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`}]]),Gr=a(`qr-code`,[[`rect`,{width:`5`,height:`5`,x:`3`,y:`3`,rx:`1`,key:`1tu5fj`}],[`rect`,{width:`5`,height:`5`,x:`16`,y:`3`,rx:`1`,key:`1v8r4q`}],[`rect`,{width:`5`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`1x03jg`}],[`path`,{d:`M21 16h-3a2 2 0 0 0-2 2v3`,key:`177gqh`}],[`path`,{d:`M21 21v.01`,key:`ents32`}],[`path`,{d:`M12 7v3a2 2 0 0 1-2 2H7`,key:`8crl2c`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M12 3h.01`,key:`n36tog`}],[`path`,{d:`M12 16v.01`,key:`133mhm`}],[`path`,{d:`M16 12h1`,key:`1slzba`}],[`path`,{d:`M21 12v.01`,key:`1lwtk9`}],[`path`,{d:`M12 21v-1`,key:`1880an`}]]),Kr=a(`radar`,[[`path`,{d:`M19.07 4.93A10 10 0 0 0 6.99 3.34`,key:`z3du51`}],[`path`,{d:`M4 6h.01`,key:`oypzma`}],[`path`,{d:`M2.29 9.62A10 10 0 1 0 21.31 8.35`,key:`qzzz0`}],[`path`,{d:`M16.24 7.76A6 6 0 1 0 8.23 16.67`,key:`1yjesh`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M17.99 11.66A6 6 0 0 1 15.77 16.67`,key:`1u2y91`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`m13.41 10.59 5.66-5.66`,key:`mhq4k0`}]]),qr=a(`scale`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`m19 8 3 8a5 5 0 0 1-6 0zV7`,key:`zcdpyk`}],[`path`,{d:`M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1`,key:`1yorad`}],[`path`,{d:`m5 8 3 8a5 5 0 0 1-6 0zV7`,key:`eua70x`}],[`path`,{d:`M7 21h10`,key:`1b0cd5`}]]),Jr=a(`scan-line`,[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`path`,{d:`M7 12h10`,key:`b7w52i`}]]),Yr=a(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),Xr=a(`star`,[[`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`}]]),Zr=a(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Qr=a(`type`,[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]),$r=a(`unfold-vertical`,[[`path`,{d:`M12 22v-6`,key:`6o8u61`}],[`path`,{d:`M12 8V2`,key:`1wkif3`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}],[`path`,{d:`m15 19-3 3-3-3`,key:`11eu04`}],[`path`,{d:`m15 5-3-3-3 3`,key:`itvq4r`}]]),X=it,ei=tt,Z=$e;function ti(e){return(0,K.jsx)(rt,{density:`compact`,...e})}var ni=`0.5.36`,ri=`https://ling-kong-ran.github.io/pisper/`,ii=`https://github.com/ling-kong-ran/pisper`,ai=`${ii}/blob/release/LICENSE`;function oi({href:e,icon:t,label:n,value:r}){return(0,K.jsxs)(`a`,{className:`group grid min-h-14 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 py-3 text-left no-underline`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:[(0,K.jsx)(`span`,{className:`grid size-8 place-items-center rounded-[var(--r-xs)] bg-[var(--surface-muted)] text-[var(--text-muted)] transition-colors group-hover:text-[var(--star-strong)]`,children:(0,K.jsx)(t,{size:16})}),(0,K.jsxs)(`span`,{className:`min-w-0`,children:[(0,K.jsx)(`strong`,{className:`block text-[13px] text-[var(--text)]`,children:n}),(0,K.jsx)(`small`,{className:`mt-0.5 block truncate text-[12px] text-[var(--text-muted)]`,children:r})]}),(0,K.jsx)(Oe,{className:`text-[var(--text-muted)] transition-colors group-hover:text-[var(--star-strong)]`,size:14})]})}function si({update:e}){let{t}=h(),n=e.info?.version||ni;return(0,K.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[760px] flex-col gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-4 px-1 py-3`,children:[(0,K.jsx)(`img`,{className:`size-16 shrink-0 rounded-[14px] shadow-[0_10px_28px_-14px_var(--shadow)]`,src:`/favicon.svg`,alt:`Pisper`}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`h1`,{className:`text-[22px] font-bold tracking-[0]`,children:`Pisper`}),(0,K.jsxs)(Z,{tone:`gray`,children:[`v`,n]})]}),(0,K.jsx)(`p`,{className:`mt-1 text-[13px] leading-5 text-[var(--text-muted)]`,children:t(`config:aboutSettings.description`)})]})]}),(0,K.jsxs)(X,{className:`p-5`,"data-config-card":`about-project`,children:[(0,K.jsx)(ei,{title:t(`config:aboutSettings.projectInformation`)}),(0,K.jsxs)(`div`,{className:`mt-3 divide-y divide-[var(--stroke-soft)] border-y border-[var(--stroke-soft)]`,children:[(0,K.jsx)(oi,{href:ri,icon:ce,label:t(`config:aboutSettings.website`),value:`ling-kong-ran.github.io/pisper`}),(0,K.jsx)(oi,{href:ii,icon:se,label:t(`config:aboutSettings.sourceCode`),value:`github.com/ling-kong-ran/pisper`}),(0,K.jsx)(oi,{href:ai,icon:qr,label:t(`config:aboutSettings.license`),value:`MIT License`})]})]}),(0,K.jsx)(X,{className:`p-5`,"data-config-card":`about-support`,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-4 max-[540px]:flex-col max-[540px]:items-stretch`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(ei,{title:t(`config:aboutSettings.supportPisper`)}),(0,K.jsx)(`p`,{className:`mt-1 max-w-[520px] text-[13px] leading-5 text-[var(--text-muted)]`,children:t(`config:aboutSettings.supportDescription`)})]}),(0,K.jsx)(s,{asChild:!0,size:`lg`,className:`max-[540px]:w-full`,children:(0,K.jsxs)(`a`,{href:ii,target:`_blank`,rel:`noopener noreferrer`,children:[(0,K.jsx)(Xr,{size:15}),t(`config:aboutSettings.starOnGitHub`)]})})]})}),(0,K.jsx)(`p`,{className:`px-1 py-2 text-center text-[12px] text-[var(--text-muted)]`,children:t(`config:aboutSettings.copyright`)})]})}function ci({className:e,defaultValue:t,value:n,min:r=0,max:i=100,...a}){let o=G.useMemo(()=>Array.isArray(n)?n:Array.isArray(t)?t:[r,i],[n,t,r,i]);return(0,K.jsxs)(nr,{"data-slot":`slider`,defaultValue:t,value:n,min:r,max:i,className:re(`relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col`,e),...a,children:[(0,K.jsx)(lr,{"data-slot":`slider-track`,className:`relative grow overflow-hidden rounded-full bg-muted data-horizontal:h-1 data-horizontal:w-full data-vertical:h-full data-vertical:w-1`,children:(0,K.jsx)(dr,{"data-slot":`slider-range`,className:`absolute bg-primary select-none data-horizontal:h-full data-vertical:w-full`})}),Array.from({length:o.length},(e,t)=>(0,K.jsx)(vr,{"data-slot":`slider-thumb`,className:`relative block size-3 shrink-0 rounded-full border border-ring bg-white ring-ring/50 transition-[color,box-shadow] select-none after:absolute after:-inset-2 hover:ring-3 focus-visible:ring-3 focus-visible:outline-hidden active:ring-3 disabled:pointer-events-none disabled:opacity-50`},t))]})}function li(e){window.dispatchEvent(new CustomEvent(`pisper:desktop-pet-changed`,{detail:e}))}function ui({notify:e,requestConfirm:t}){let{t:n}=h(),i=window.pisperDesktop,a=(0,G.useMemo)(()=>i?.getPetStatus?{getStatus:()=>i.getPetStatus(),setEnabled:e=>i.setPetEnabled(e),setOpacity:e=>i.setPetOpacity(e),search:e=>i.searchPets(e),install:e=>i.installPet(e),select:e=>i.selectPet(e),remove:e=>i.removePet(e),openCatalog:()=>void i.openPetdex?.()}:{getStatus:()=>r(`/api/desktop-pet`),setEnabled:e=>r(`/api/desktop-pet/enabled`,{method:`POST`,body:{enabled:e}}),setOpacity:e=>r(`/api/desktop-pet/opacity`,{method:`POST`,body:{opacity:e}}),search:e=>r(`/api/desktop-pet/catalog?query=${encodeURIComponent(e)}`),install:e=>r(`/api/desktop-pet/install`,{method:`POST`,body:{slug:e}}),select:e=>r(`/api/desktop-pet/select`,{method:`POST`,body:{slug:e}}),remove:e=>r(`/api/desktop-pet/${encodeURIComponent(e)}`,{method:`DELETE`}),openCatalog:()=>window.open(`https://petdex.dev`,`_blank`,`noopener,noreferrer`)},[i]),[o,c]=(0,G.useState)(null),[l,u]=(0,G.useState)(``),[d,f]=(0,G.useState)([]),[p,m]=(0,G.useState)(100),[g,_]=(0,G.useState)(``),[v,y]=(0,G.useState)(``),b=(0,G.useCallback)(e=>{c(e),m(Math.round((e.opacity??1)*100))},[]),x=(0,G.useCallback)(async()=>{try{y(``),b(await a.getStatus())}catch(e){y(e instanceof Error?e.message:String(e))}},[b,a]),S=(0,G.useCallback)(async()=>{_(`search`);try{y(``),f(await a.search(l))}catch(e){y(e instanceof Error?e.message:String(e))}finally{_(``)}},[a,l]);(0,G.useEffect)(()=>{x(),a.search(``).then(f).catch(()=>{})},[a,x]);let C=async t=>{let r=o;c(e=>e&&{...e,enabled:t,running:!!(t&&e.installed.length)}),_(`toggle`);try{y(``);let r=await a.setEnabled(t);b(r),li(r),e(n(t?`config:desktopPetSettings.petEnabled`:`config:desktopPetSettings.petDisabled`))}catch(e){c(r),y(e instanceof Error?e.message:String(e))}finally{_(``)}},w=async e=>{_(`opacity`);try{y(``);let t=await a.setOpacity(e);b(t),li(t)}catch(e){m(Math.round((o?.opacity??1)*100)),y(e instanceof Error?e.message:String(e))}finally{_(``)}},T=async(t=l)=>{if(t.trim()){_(`install`);try{y(``);let r=await a.install(t);b(r),li(r),e(n(`config:desktopPetSettings.petInstalled`,{name:r.selectedName||t}))}catch(e){y(e instanceof Error?e.message:String(e))}finally{_(``)}}},E=async t=>{if(t!==o?.selectedSlug){_(`select:${t}`);try{y(``);let r=await a.select(t);b(r),li(r),e(n(`config:desktopPetSettings.petSelected`,{name:r.selectedName||t}))}catch(e){y(e instanceof Error?e.message:String(e))}finally{_(``)}}},D=async r=>{if(await t({title:n(`config:desktopPetSettings.deleteTitle`),message:n(`config:desktopPetSettings.deleteConfirm`,{name:r.name}),confirmLabel:n(`config:desktopPetSettings.delete`),tone:`danger`})){_(`remove:${r.slug}`);try{y(``);let t=await a.remove(r.slug);b(t),li(t),e(n(`config:desktopPetSettings.petRemoved`,{name:r.name}))}catch(e){y(e instanceof Error?e.message:String(e))}finally{_(``)}}};return(0,K.jsxs)(`div`,{className:`flex w-[min(100%,_760px)] flex-col gap-[12px] desktop-pet-settings`,children:[(0,K.jsxs)(X,{className:`[padding:18px]`,"data-config-card":`desktop-pet-settings`,children:[(0,K.jsxs)(`div`,{className:`language-settings-heading flex items-start gap-[11px] [&_h2]:text-[16px] [&_p]:mt-[4px] [&_p]:text-[var(--text-muted)] [&_p]:text-[13px] [&_p]:leading-[1.55]`,children:[(0,K.jsx)(`span`,{className:`grid w-[38px] h-[38px] [flex:0_0_auto] place-items-center rounded-[11px] bg-[var(--star-soft)] text-[var(--star-strong)]`,children:(0,K.jsx)(Fr,{size:19})}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h2`,{children:n(`config:desktopPetSettings.title`)}),(0,K.jsx)(`p`,{children:n(`config:desktopPetSettings.description`)})]})]}),o?(0,K.jsxs)(`div`,{className:`notification-option [&_>_div]:flex [&_>_div]:min-w-0 [&_>_div]:flex-col [&_>_div]:gap-[4px] [&_strong]:text-[13px] [&_small]:text-[var(--text-muted)] [&_small]:text-[12px] [&_small]:leading-[1.45] grid grid-cols-[auto_minmax(0,1fr)_auto_auto] items-center gap-[11px] mt-4`,children:[(0,K.jsx)(Fr,{size:18}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`strong`,{children:n(`config:desktopPetSettings.showOnDesktop`)}),(0,K.jsx)(`small`,{children:o.selectedName?n(`config:desktopPetSettings.currentPet`,{name:o.selectedName}):n(`config:desktopPetSettings.installBeforeEnabling`)})]}),(0,K.jsx)(Z,{tone:o.running?`green`:`gray`,children:o.running?n(`config:desktopPetSettings.running`):n(`config:desktopPetSettings.stopped`)}),(0,K.jsx)(ti,{value:o.enabled,disabled:!!g||!o.installed.length,onChange:C,ariaLabel:n(`config:desktopPetSettings.showOnDesktop`)})]}):(0,K.jsxs)(Ge,{className:`[margin-top:15px]`,children:[(0,K.jsx)(V,{className:`animate-spin`,size:16}),(0,K.jsx)(`span`,{children:n(`config:desktopPetSettings.loading`)})]}),o&&(0,K.jsxs)(`div`,{className:`desktop-pet-opacity [&_>_div]:flex [&_>_div]:items-center [&_>_div]:justify-between [&_>_div]:gap-[8px] [&_>_div]:text-[12px] [&_>_div_span]:text-[var(--text-muted)] [&_>_div_span]:[font-variant-numeric:tabular-nums] grid grid-cols-[150px_minmax(0,1fr)] items-center gap-[14px] [border-top:1px_solid_var(--stroke-soft)] [padding-top:14px] mt-4`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`strong`,{children:n(`config:desktopPetSettings.opacity`)}),(0,K.jsxs)(`span`,{children:[p,`%`]})]}),(0,K.jsx)(ci,{value:[p],min:20,max:100,step:5,disabled:g===`opacity`,onValueChange:([e])=>m(e),onValueCommit:([e])=>void w(e/100),"aria-label":n(`config:desktopPetSettings.opacity`)})]}),v&&(0,K.jsx)(`div`,{className:`text-[var(--danger)] text-[13px] mt-3`,children:v})]}),(0,K.jsxs)(X,{className:`[padding:18px]`,"data-config-card":`desktop-pet-install`,children:[(0,K.jsxs)(`div`,{className:`language-settings-heading flex items-start gap-[11px] [&_h2]:text-[16px] [&_p]:mt-[4px] [&_p]:text-[var(--text-muted)] [&_p]:text-[13px] [&_p]:leading-[1.55]`,children:[(0,K.jsx)(`span`,{className:`grid w-[38px] h-[38px] [flex:0_0_auto] place-items-center rounded-[11px] bg-[var(--star-soft)] text-[var(--star-strong)]`,children:(0,K.jsx)(Le,{size:19})}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h2`,{children:n(`config:desktopPetSettings.installTitle`)}),(0,K.jsx)(`p`,{children:n(`config:desktopPetSettings.installDescription`)})]})]}),(0,K.jsxs)(`div`,{className:`workspace-path-form grid h-[39px] grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-[8px] mt-[16px] [border:1px_solid_var(--stroke)] rounded-[var(--r-sm)] p-[3px_3px_3px_10px] text-[var(--text-muted)] [&_input]:min-w-0 [&_input]:border-0 [&_input]:[outline:0] [&_input]:font-[ui-monospace,_SFMono-Regular,_Consolas,_'Liberation_Mono',_monospace] [&_input]:text-[12px] dark:[&_input]:bg-[var(--solid)] dark:[&_input]:text-[var(--text)] desktop-pet-search !grid-cols-[minmax(0,1fr)_auto] mt-4`,children:[(0,K.jsx)(`input`,{value:l,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&S()},placeholder:n(`config:desktopPetSettings.searchPlaceholder`),"aria-label":n(`config:desktopPetSettings.petSlug`)}),(0,K.jsxs)(s,{size:`lg`,className:`min-w-[104px]`,disabled:g===`search`,onClick:S,children:[g===`search`?(0,K.jsx)(V,{className:`animate-spin`,size:14}):(0,K.jsx)(ot,{size:14}),n(`config:desktopPetSettings.search`)]})]}),d.length>0&&(0,K.jsx)(`div`,{className:`language-choice-grid max-[650px]:grid-cols-[1fr] grid grid-cols-[repeat(2,_minmax(0,_1fr))] gap-[9px] [margin-top:18px] mt-4`,children:d.map(e=>{let t=o?.installed.some(t=>t.slug===e.slug);return(0,K.jsxs)(`button`,{type:`button`,className:`language-choice hover:border-[var(--star)] hover:bg-[var(--accent-soft)] hover:[transform:translateY(-1px)] [&.selected]:border-[var(--star)] [&.selected]:bg-[var(--star-soft)] [&.selected]:shadow-[0_0_0_3px_var(--accent-ring)] grid min-h-[80px] grid-cols-[auto_minmax(0,_1fr)_auto] items-center gap-[10px] [border:1px_solid_var(--stroke)] rounded-[var(--r-sm)] bg-[var(--surface-subtle)] [padding:11px] text-[var(--text)] text-left [transition:border-color_var(--d1)_var(--ease-out),_background_var(--d1)_var(--ease-out),_box-shadow_var(--d1)_var(--ease-out),_transform_var(--d1)_var(--ease-out)]`,disabled:!!g,onClick:()=>t?E(e.slug):T(e.slug),children:[(0,K.jsx)(`span`,{className:`language-choice-mark grid w-[34px] h-[34px] place-items-center rounded-[9px] bg-[var(--solid)] text-[var(--star-strong)] text-[12px] font-[800] tracking-[.03em]`,children:(0,K.jsx)(Fr,{size:16})}),(0,K.jsxs)(`span`,{className:`language-choice-copy [&_strong]:text-[13px] [&_small]:text-[var(--text-muted)] [&_small]:text-[12px] flex min-w-0 flex-col gap-[3px]`,children:[(0,K.jsx)(`strong`,{children:e.displayName}),(0,K.jsx)(`small`,{children:e.slug})]}),(0,K.jsx)(Z,{tone:t?`green`:`blue`,children:n(t?`config:desktopPetSettings.installed`:`config:desktopPetSettings.install`)})]},e.slug)})}),(0,K.jsx)(`div`,{className:`mt-[15px] flex gap-2 max-[650px]:flex-wrap`,children:(0,K.jsxs)(s,{variant:`outline`,size:`lg`,className:`bg-surface-subtle`,onClick:a.openCatalog,children:[(0,K.jsx)(Oe,{size:14}),n(`config:desktopPetSettings.browsePetdex`)]})})]}),o&&o.installed.length>0&&(0,K.jsxs)(X,{className:`[padding:18px]`,"data-config-card":`desktop-pet-installed`,children:[(0,K.jsxs)(`div`,{className:`language-settings-heading flex items-start gap-[11px] [&_h2]:text-[16px] [&_p]:mt-[4px] [&_p]:text-[var(--text-muted)] [&_p]:text-[13px] [&_p]:leading-[1.55]`,children:[(0,K.jsx)(`span`,{className:`grid w-[38px] h-[38px] [flex:0_0_auto] place-items-center rounded-[11px] bg-[var(--star-soft)] text-[var(--star-strong)]`,children:(0,K.jsx)(Fr,{size:19})}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h2`,{children:n(`config:desktopPetSettings.installedTitle`)}),(0,K.jsx)(`p`,{children:n(`config:desktopPetSettings.installedDescription`)})]})]}),(0,K.jsx)(`div`,{className:`language-choice-grid max-[650px]:grid-cols-[1fr] grid grid-cols-[repeat(2,_minmax(0,_1fr))] gap-[9px] [margin-top:18px] mt-4`,role:`radiogroup`,children:o.installed.map(e=>{let t=e.slug===o.selectedSlug;return(0,K.jsxs)(`div`,{className:`language-choice hover:border-[var(--star)] hover:bg-[var(--accent-soft)] [&.selected]:border-[var(--star)] [&.selected]:bg-[var(--star-soft)] [&.selected]:shadow-[0_0_0_3px_var(--accent-ring)] grid min-h-[80px] grid-cols-[minmax(0,_1fr)_auto] items-center gap-[4px] [border:1px_solid_var(--stroke)] rounded-[var(--r-sm)] bg-[var(--surface-subtle)] [padding:4px] text-[var(--text)] [transition:border-color_var(--d1)_var(--ease-out),_background_var(--d1)_var(--ease-out),_box-shadow_var(--d1)_var(--ease-out)] ${t?`selected`:``}`,children:[(0,K.jsxs)(`button`,{type:`button`,className:`grid min-h-[70px] grid-cols-[auto_minmax(0,_1fr)_auto] items-center gap-[10px] rounded-[calc(var(--r-sm)-2px)] [padding:7px] text-left outline-none focus-visible:ring-2 focus-visible:ring-[var(--star)] disabled:pointer-events-none disabled:opacity-50 ${e.source===`pisper`?``:`col-span-2`}`,role:`radio`,"aria-checked":t,disabled:!!g,onClick:()=>E(e.slug),children:[(0,K.jsx)(`span`,{className:`language-choice-mark grid w-[34px] h-[34px] place-items-center rounded-[9px] bg-[var(--solid)] text-[var(--star-strong)] text-[12px] font-[800] tracking-[.03em]`,children:(0,K.jsx)(Fr,{size:16})}),(0,K.jsxs)(`span`,{className:`language-choice-copy [&_strong]:text-[13px] [&_small]:text-[var(--text-muted)] [&_small]:text-[12px] flex min-w-0 flex-col gap-[3px]`,children:[(0,K.jsx)(`strong`,{children:e.name}),(0,K.jsx)(`small`,{children:e.slug})]}),(0,K.jsx)(Z,{tone:e.source===`pisper`?`blue`:`gray`,children:e.source===`pisper`?`Pisper`:`Petdex`})]}),e.source===`pisper`&&(0,K.jsx)(s,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`text-content-muted hover:text-destructive`,disabled:!!g,onClick:()=>void D(e),"aria-label":n(`config:desktopPetSettings.delete`),title:n(`config:desktopPetSettings.delete`),children:g===`remove:${e.slug}`?(0,K.jsx)(V,{className:`animate-spin`,size:14}):(0,K.jsx)(xe,{size:14})})]},`${e.source}:${e.slug}`)})})]})]})}function di(e,t){return t(e===`en-US`?`config:languageSettings.english`:`config:languageSettings.simplifiedChinese`)}function fi({notify:e}){let{language:t,setLanguage:n,t:r}=h(),i=r=>{r!==t&&(n(r),e(m(r===`en-US`?`config:languageSettings.displayLanguageChangedToEnglish`:`config:languageSettings.displayLanguageChangedToSimplifiedChinese`,r)))};return(0,K.jsxs)(X,{className:`p-[18px]`,"data-config-card":`interface-language`,children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-[11px] [&_h2]:text-[16px] [&_p]:mt-1 [&_p]:text-[13px] [&_p]:leading-[1.55] [&_p]:text-[var(--text-muted)]`,children:[(0,K.jsx)(`span`,{className:`grid size-[38px] flex-none place-items-center rounded-[var(--r-sm)] bg-[var(--star-soft)] text-[var(--star-strong)]`,children:(0,K.jsx)(Br,{size:19})}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h2`,{children:r(`config:languageSettings.displayLanguage`)}),(0,K.jsx)(`p`,{children:r(`config:languageSettings.chooseTheLanguageUsedByPisperChangesApplyImmediatelyAndAreSavedForYourNextVisit`)})]})]}),(0,K.jsx)(`div`,{className:`mt-[18px] grid grid-cols-2 gap-[9px] max-[650px]:grid-cols-1`,role:`radiogroup`,"aria-label":r(`config:languageSettings.displayLanguage`),children:p.map(e=>{let n=e.value===t;return(0,K.jsxs)(`button`,{type:`button`,className:`grid min-h-[80px] grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-2.5 rounded-[var(--r-sm)] border bg-[var(--surface-subtle)] p-[11px] text-left text-[var(--text)] transition hover:-translate-y-px hover:border-[var(--star)] hover:bg-[var(--accent-soft)] ${n?`border-[var(--star)] bg-[var(--star-soft)] shadow-[0_0_0_3px_var(--accent-ring)]`:`border-[var(--stroke)]`}`,role:`radio`,"aria-checked":n,onClick:()=>i(e.value),children:[(0,K.jsx)(`span`,{className:`grid size-[34px] place-items-center rounded-[var(--r-xs)] text-[12px] font-extrabold ${e.value===`en-US`?`bg-[var(--brand-blue-soft)] text-[var(--brand-blue-strong)]`:`bg-[var(--solid)] text-[var(--star-strong)]`}`,children:e.shortName}),(0,K.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-[3px] [&_small]:text-[var(--text-muted)] [&_strong]:text-[13px]`,children:[(0,K.jsx)(`strong`,{children:di(e.value,r)}),(0,K.jsx)(`small`,{children:e.value===`zh-CN`?r(`config:languageSettings.chineseInterface`):r(`config:languageSettings.englishInterface`)})]}),n&&(0,K.jsx)(`span`,{className:`grid size-[21px] place-items-center rounded-full bg-[var(--star)] text-[var(--on-accent)]`,children:(0,K.jsx)(z,{size:15})})]},e.value)})}),(0,K.jsxs)(Ge,{className:`mt-[15px]`,children:[(0,K.jsx)(Br,{size:16}),(0,K.jsxs)(`span`,{children:[(0,K.jsxs)(`strong`,{children:[r(`config:languageSettings.currentLanguage`),` · `,di(t,r)]}),(0,K.jsx)(`small`,{children:r(`config:languageSettings.thisSettingChangesInterfaceTextOnlyItDoesNotControlTheLanguageOfAgentResponses`)})]})]})]})}function pi({icon:e,title:t,description:n}){return(0,K.jsxs)(`div`,{className:`flex items-start gap-[11px] [&_h2]:text-[16px] [&_p]:mt-1 [&_p]:text-[13px] [&_p]:leading-[1.55] [&_p]:text-[var(--text-muted)]`,children:[(0,K.jsx)(`span`,{className:`grid size-[38px] flex-none place-items-center rounded-[var(--r-sm)] bg-[var(--star-soft)] text-[var(--star-strong)]`,children:(0,K.jsx)(e,{size:19})}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h2`,{children:t}),(0,K.jsx)(`p`,{children:n})]})]})}function mi({label:e,options:t,value:n,onChange:r}){return(0,K.jsx)(`div`,{className:`mt-4 grid grid-cols-2 gap-2 max-[650px]:grid-cols-1`,role:`radiogroup`,"aria-label":e,children:t.map(e=>{let t=e.value===n,i=e.icon;return(0,K.jsxs)(`button`,{type:`button`,className:`grid min-h-[72px] grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-2.5 rounded-[var(--r-sm)] border p-2.5 text-left transition hover:-translate-y-px hover:border-[var(--star)] hover:bg-[var(--accent-soft)] ${t?`border-[var(--star)] bg-[var(--star-soft)] shadow-[0_0_0_3px_var(--accent-ring)]`:`border-[var(--stroke)] bg-[var(--surface-subtle)]`}`,role:`radio`,"aria-checked":t,onClick:()=>r(e.value),children:[(0,K.jsx)(`span`,{className:`grid size-8 place-items-center rounded-[var(--r-xs)] bg-[var(--solid)] text-[var(--star-strong)]`,children:(0,K.jsx)(i,{size:16})}),(0,K.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,K.jsx)(`strong`,{className:`text-[13px]`,children:e.label}),(0,K.jsx)(`small`,{className:`text-[var(--text-muted)]`,children:e.description})]}),t&&(0,K.jsx)(`span`,{className:`grid size-5 place-items-center rounded-full bg-[var(--star)] text-[var(--on-accent)]`,children:(0,K.jsx)(z,{size:13})})]},e.value)})})}function hi({label:e,options:t,value:n,onChange:r}){return(0,K.jsx)(`div`,{className:`grid grid-cols-3 gap-1 rounded-[var(--r-sm)] bg-[var(--surface-muted)] p-1`,role:`radiogroup`,"aria-label":e,children:t.map(e=>(0,K.jsx)(`button`,{type:`button`,className:`min-h-8 rounded-[var(--r-xs)] px-2 text-[12px] font-semibold transition ${e.value===n?`bg-[var(--solid)] text-[var(--text)] shadow-sm`:`text-[var(--text-muted)] hover:text-[var(--text)]`}`,role:`radio`,"aria-checked":e.value===n,onClick:()=>r(e.value),children:e.label},e.value))})}var gi={neutral:`#18181b`,blue:`#1677e8`,teal:`#0f766e`,violet:`#7557c8`,coral:`#c94f5d`,custom:`#1677e8`};function _i({notify:e}){let{t}=h(),n=B(e=>e.theme),r=B(e=>e.density),i=B(e=>e.accent),a=B(e=>e.customAccent),o=B(e=>e.fontScale),c=B(e=>e.radius),l=B(e=>e.motion),u=B(e=>e.setTheme),d=B(e=>e.setDensity),f=B(e=>e.setAccent),p=B(e=>e.setCustomAccent),m=B(e=>e.setFontScale),g=B(e=>e.setRadius),_=B(e=>e.setMotion),v=B(e=>e.resetAppearance),y=n!==Ve.theme||r!==Ve.density||i!==Ve.accent||a!==Ve.customAccent||o!==Ve.fontScale||c!==Ve.radius||l!==Ve.motion,[b,x]=(0,G.useState)(a);(0,G.useEffect)(()=>x(a),[a]);let S=qe(b),C=!!b.trim()&&!S,w=e=>{x(e);let t=qe(e);t&&E(p)(t)},T=()=>e(t(`config:interfaceSettings.preferencesUpdated`)),E=e=>t=>{e(t),T()},D=[{value:`system`,label:t(`config:interfaceSettings.followSystem`),description:t(`config:interfaceSettings.followSystemDescription`),icon:pe},{value:`scheduled`,label:t(`config:interfaceSettings.automaticByTime`),description:t(`config:interfaceSettings.automaticByTimeDescription`),icon:j},{value:`light`,label:t(`config:interfaceSettings.light`),description:t(`config:interfaceSettings.lightDescription`),icon:ue},{value:`dark`,label:t(`config:interfaceSettings.dark`),description:t(`config:interfaceSettings.darkDescription`),icon:fe}],O=[{value:`comfortable`,label:t(`config:interfaceSettings.comfortable`),description:t(`config:interfaceSettings.comfortableDescription`),icon:$r},{value:`compact`,label:t(`config:interfaceSettings.compact`),description:t(`config:interfaceSettings.compactDescription`),icon:Rr}],k=[{value:`system`,label:t(`config:interfaceSettings.motionSystem`),description:t(`config:interfaceSettings.motionSystemDescription`),icon:pe},{value:`full`,label:t(`config:interfaceSettings.motionFull`),description:t(`config:interfaceSettings.motionFullDescription`),icon:Je},{value:`reduced`,label:t(`config:interfaceSettings.motionReduced`),description:t(`config:interfaceSettings.motionReducedDescription`),icon:Nr}],M=[{value:`neutral`,label:t(`config:interfaceSettings.accentNeutral`)},{value:`blue`,label:t(`config:interfaceSettings.accentBlue`)},{value:`teal`,label:t(`config:interfaceSettings.accentTeal`)},{value:`violet`,label:t(`config:interfaceSettings.accentViolet`)},{value:`coral`,label:t(`config:interfaceSettings.accentCoral`)},{value:`custom`,label:t(`config:interfaceSettings.accentCustom`)}],N=[{value:`small`,label:t(`config:interfaceSettings.small`)},{value:`default`,label:t(`config:interfaceSettings.standard`)},{value:`large`,label:t(`config:interfaceSettings.large`)}],ee=[{value:`sharp`,label:t(`config:interfaceSettings.sharp`)},{value:`default`,label:t(`config:interfaceSettings.standard`)},{value:`soft`,label:t(`config:interfaceSettings.soft`)}];return(0,K.jsxs)(`div`,{className:`flex w-[min(100%,920px)] flex-col gap-3`,children:[(0,K.jsxs)(X,{className:`p-[18px]`,"data-config-card":`interface-appearance`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4 max-[650px]:flex-col`,children:[(0,K.jsx)(pi,{icon:Ur,title:t(`config:interfaceSettings.appearance`),description:t(`config:interfaceSettings.appearanceDescription`)}),(0,K.jsxs)(s,{type:`button`,variant:`outline`,size:`sm`,disabled:!y,onClick:()=>{v(),e(t(`config:interfaceSettings.defaultsRestored`))},children:[(0,K.jsx)(A,{size:14}),t(`config:interfaceSettings.restoreDefaults`)]})]}),(0,K.jsx)(mi,{label:t(`config:interfaceSettings.colorMode`),options:D,value:n,onChange:E(u)}),(0,K.jsxs)(`div`,{className:`mt-5 border-t border-[var(--stroke-soft)] pt-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-[13px] font-bold text-[var(--text-soft)]`,children:[(0,K.jsx)(Ur,{size:15}),t(`config:interfaceSettings.accentColor`)]}),(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,role:`radiogroup`,"aria-label":t(`config:interfaceSettings.accentColor`),children:M.map(e=>(0,K.jsxs)(`button`,{type:`button`,className:`flex min-h-9 items-center gap-2 rounded-[var(--r-sm)] border px-2.5 text-[12px] font-semibold transition hover:border-[var(--star)] ${i===e.value?`border-[var(--star)] bg-[var(--star-soft)] text-[var(--star-strong)] shadow-[0_0_0_3px_var(--accent-ring)]`:`border-[var(--stroke)] bg-[var(--surface-subtle)] text-[var(--text-soft)]`}`,role:`radio`,"aria-checked":i===e.value,onClick:()=>E(f)(e.value),children:[(0,K.jsx)(`span`,{className:`size-3.5 rounded-full border border-black/10 shadow-sm`,style:{backgroundColor:e.value===`custom`?a:gi[e.value]}}),e.label,i===e.value&&(0,K.jsx)(z,{size:13})]},e.value))}),i===`custom`&&(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-3 rounded-[var(--r-sm)] border border-[var(--stroke)] bg-[var(--surface-subtle)] p-3`,children:[(0,K.jsx)(`input`,{type:`color`,value:qe(a)||`#1677e8`,onChange:e=>E(p)(e.target.value),"aria-label":t(`config:interfaceSettings.customAccentColor`),className:`h-9 w-14 cursor-pointer rounded-[var(--r-xs)] border border-[var(--stroke)] bg-[var(--solid)] p-1`}),(0,K.jsx)(`input`,{type:`text`,value:b,onChange:e=>w(e.target.value),spellCheck:!1,"aria-label":t(`config:interfaceSettings.customAccentHex`),className:`h-9 w-[116px] rounded-[var(--r-xs)] border bg-[var(--solid)] px-2.5 font-mono text-[12.5px] text-[var(--text)] ${C?`border-[var(--danger)]`:`border-[var(--stroke)]`}`}),(0,K.jsx)(`span`,{className:`text-[12px] ${C?`text-[var(--danger)]`:`text-[var(--text-muted)]`}`,children:t(C?`config:interfaceSettings.invalidAccentColor`:`config:interfaceSettings.customAccentHint`)})]})]}),(0,K.jsxs)(`div`,{className:`mt-5 grid grid-cols-[minmax(0,1fr)_minmax(260px,.72fr)] gap-4 border-t border-[var(--stroke-soft)] pt-4 max-[720px]:grid-cols-1`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-[13px] font-bold text-[var(--text-soft)]`,children:[(0,K.jsx)(Qr,{size:15}),t(`config:interfaceSettings.interfaceStyle`)]}),(0,K.jsxs)(`div`,{className:`mt-3 grid grid-cols-2 gap-3 max-[470px]:grid-cols-1`,children:[(0,K.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,K.jsx)(`span`,{className:`text-[12px] text-[var(--text-muted)]`,children:t(`config:interfaceSettings.fontSize`)}),(0,K.jsx)(hi,{label:t(`config:interfaceSettings.fontSize`),options:N,value:o,onChange:E(m)})]}),(0,K.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,K.jsx)(`span`,{className:`text-[12px] text-[var(--text-muted)]`,children:t(`config:interfaceSettings.cornerStyle`)}),(0,K.jsx)(hi,{label:t(`config:interfaceSettings.cornerStyle`),options:ee,value:c,onChange:E(g)})]})]})]}),(0,K.jsxs)(`div`,{className:`overflow-hidden rounded-[var(--r-md)] border border-[var(--stroke)] bg-[var(--main-surface-bg)] shadow-[var(--sh-surface)]`,"aria-label":t(`config:interfaceSettings.livePreview`),children:[(0,K.jsxs)(`div`,{className:`flex h-8 items-center gap-1.5 border-b border-[var(--stroke)] bg-[var(--surface-subtle)] px-3`,children:[(0,K.jsx)(`span`,{className:`size-1.5 rounded-full bg-[var(--brand-blue)]`}),(0,K.jsx)(`span`,{className:`text-[11px] font-bold text-[var(--text-muted)]`,children:t(`config:interfaceSettings.livePreview`)})]}),(0,K.jsxs)(`div`,{className:`grid gap-2.5 p-3`,children:[(0,K.jsx)(`div`,{className:`mr-7 rounded-[var(--r-sm)] bg-[var(--surface-muted)] p-2 text-[var(--app-font-size)] text-[var(--text-soft)]`,children:t(`config:interfaceSettings.previewAgentMessage`)}),(0,K.jsx)(`div`,{className:`ml-7 rounded-[var(--r-sm)] bg-[var(--star)] p-2 text-[var(--app-font-size)] text-[var(--on-accent)]`,children:t(`config:interfaceSettings.previewUserMessage`)}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`h-1.5 flex-1 overflow-hidden rounded-full bg-[var(--surface-muted)]`,children:(0,K.jsx)(`span`,{className:`block h-full w-2/3 rounded-full bg-[var(--brand-blue)]`})}),(0,K.jsx)(`span`,{className:`text-[11px] text-[var(--text-muted)]`,children:`67%`})]})]})]})]})]}),(0,K.jsxs)(X,{className:`p-[18px]`,"data-config-card":`interface-motion`,children:[(0,K.jsx)(pi,{icon:Nr,title:t(`config:interfaceSettings.displayAndMotion`),description:t(`config:interfaceSettings.displayAndMotionDescription`)}),(0,K.jsxs)(`div`,{className:`mt-4 grid grid-cols-2 gap-5 max-[720px]:grid-cols-1`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-[13px] font-bold text-[var(--text-soft)]`,children:t(`config:interfaceSettings.interfaceDensity`)}),(0,K.jsx)(mi,{label:t(`config:interfaceSettings.interfaceDensity`),options:O,value:r,onChange:E(d)})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-[13px] font-bold text-[var(--text-soft)]`,children:t(`config:interfaceSettings.motion`)}),(0,K.jsx)(mi,{label:t(`config:interfaceSettings.motion`),options:k,value:l,onChange:E(_)})]})]})]}),(0,K.jsx)(fi,{notify:e})]})}function vi({...e}){return(0,K.jsx)(zn,{"data-slot":`dropdown-menu`,...e})}function yi({...e}){return(0,K.jsx)(Bn,{"data-slot":`dropdown-menu-trigger`,...e})}function bi({className:e,align:t=`start`,sideOffset:n=4,...r}){return(0,K.jsx)(Vn,{children:(0,K.jsx)(Hn,{"data-slot":`dropdown-menu-content`,sideOffset:n,align:t,className:re(`z-[200] max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:overflow-hidden data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r})})}function xi({className:e,inset:t,variant:n=`default`,...r}){return(0,K.jsx)(Un,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:re(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}var Si=[`voiceInput`,`sendMessage`,`commandPalette`,`primaryAction`],Ci=gt.filter(e=>!Si.includes(e));function wi({requestConfirm:e}){let{t}=h(),n=_t(e=>e.bindings),r=_t(e=>e.setBinding),i=_t(e=>e.resetBindings),[a,o]=(0,G.useState)(null),[c,l]=(0,G.useState)(null),[u,d]=(0,G.useState)(!1),f={commandPalette:t(`config:shortcuts.commandPalette`),primaryAction:t(`config:shortcuts.primaryAction`),focusSearch:t(`config:shortcuts.focusSearch`),toggleSidebar:t(`config:shortcuts.toggleSidebar`),toggleTerminal:t(`config:shortcuts.toggleTerminal`),openSettings:t(`config:shortcuts.openSettings`),focusComposer:t(`config:shortcuts.focusComposer`),sendMessage:t(`config:shortcuts.sendMessage`),voiceInput:t(`config:shortcuts.voiceInput`)},p=(e,i)=>{d(!1);let a=yt(n,e,i);if(a){l({action:e,message:t(`config:shortcuts.conflict`,{action:f[a]})});return}try{ht({...n,[e]:i})}catch{l({action:e,message:t(`config:shortcuts.invalid`)});return}try{r(e,i),o(null),l(null),d(!0)}catch{l({action:e,message:t(`config:shortcuts.saveFailed`)})}},m=(e,n)=>{if(a!==n)return;if(e.key===`Tab`){o(null);return}let r=pt(e.nativeEvent);if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){o(null),l(null);return}r?p(n,r):!e.nativeEvent.isComposing&&e.keyCode!==229&&!e.repeat&&![`Control`,`Meta`,`Alt`,`Shift`,`AltGraph`,`Dead`,`Process`].includes(e.key)&&l({action:n,message:t(`config:shortcuts.invalid`)})},g=async()=>{if(o(null),await e({title:t(`config:shortcuts.resetAll`),message:t(`config:shortcuts.resetConfirm`),confirmLabel:t(`config:shortcuts.resetAll`)}))try{i(),l(null),d(!0)}catch{l({action:null,message:t(`config:shortcuts.saveFailed`)})}},_=gt.some(e=>n[e]!==mt[e]),v=e=>(0,K.jsxs)(`div`,{className:`py-3`,"data-shortcut-action":e,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-between gap-x-5 gap-y-2`,children:[(0,K.jsx)(`label`,{htmlFor:`shortcut-${e}`,className:`min-w-0 text-sm font-medium`,children:f[e]}),(0,K.jsxs)(`div`,{className:`flex min-w-0 max-w-full items-center gap-1`,children:[(0,K.jsx)(s,{id:`shortcut-${e}`,"data-shortcut-recorder":!0,variant:`outline`,className:`h-9 w-44 min-w-0 justify-center gap-2 px-2.5 text-xs max-[400px]:w-40`,"aria-label":t(`config:shortcuts.edit`,{action:f[e]}),"aria-pressed":a===e,"aria-describedby":c?.action===e?`shortcut-error-${e}`:void 0,onClick:()=>{o(e),l(null),d(!1)},onBlur:()=>o(t=>t===e?null:t),onKeyDown:t=>m(t,e),children:(0,K.jsx)(`span`,{className:`min-w-0 whitespace-normal break-words text-left`,children:a===e?t(`config:shortcuts.recording`):vt(n[e])||t(`config:shortcuts.disabled`)})}),(0,K.jsxs)(vi,{children:[(0,K.jsx)(yi,{asChild:!0,children:(0,K.jsx)(s,{variant:`ghost`,size:`icon`,title:t(`config:shortcuts.options`,{action:f[e]}),"aria-label":t(`config:shortcuts.options`,{action:f[e]}),children:(0,K.jsx)(te,{className:`size-4`})})}),(0,K.jsxs)(bi,{align:`end`,className:`w-40`,onCloseAutoFocus:e=>{document.activeElement?.hasAttribute(`data-shortcut-recorder`)&&e.preventDefault()},children:[(0,K.jsxs)(xi,{disabled:n[e]===null,onSelect:()=>p(e,null),children:[(0,K.jsx)(Ce,{className:`size-4`}),t(`config:shortcuts.disableKey`)]}),(0,K.jsxs)(xi,{disabled:n[e]===mt[e],onSelect:()=>p(e,mt[e]),children:[(0,K.jsx)(A,{className:`size-4`}),t(`config:shortcuts.resetAll`)]})]})]})]})]}),c?.action===e&&(0,K.jsx)(`p`,{id:`shortcut-error-${e}`,role:`alert`,className:`mt-2 text-sm text-destructive`,children:c.message})]},e);return(0,K.jsxs)(`section`,{className:`w-full min-w-0`,"data-config-card":`shortcuts-bindings`,children:[(0,K.jsxs)(`div`,{className:`mb-5 flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(Ue,{className:`size-5 text-muted-foreground`,"aria-hidden":`true`}),(0,K.jsx)(`h2`,{className:`text-base font-semibold`,children:t(`config:configPage.shortcuts`)})]}),(0,K.jsx)(s,{variant:`ghost`,size:`icon`,disabled:!_,title:t(`config:shortcuts.resetAll`),"aria-label":t(`config:shortcuts.resetAll`),onClick:()=>void g(),children:(0,K.jsx)(A,{className:`size-4`})})]}),(0,K.jsx)(`div`,{className:`divide-y divide-border border-y border-border`,children:Si.map(v)}),(0,K.jsxs)(`details`,{className:`group mt-3`,onToggle:()=>o(null),children:[(0,K.jsxs)(`summary`,{className:`flex w-fit cursor-pointer list-none items-center gap-1.5 py-2 text-sm text-muted-foreground hover:text-foreground [&::-webkit-details-marker]:hidden`,children:[(0,K.jsx)(oe,{className:`size-4 transition-transform group-open:rotate-180`}),t(`config:shortcuts.more`)]}),(0,K.jsx)(`div`,{className:`divide-y divide-border border-b border-border`,children:Ci.map(v)})]}),(0,K.jsx)(`div`,{className:`mt-3 min-h-5 text-xs text-muted-foreground`,role:`status`,"aria-live":`polite`,children:c?.action===null?(0,K.jsx)(`span`,{className:`text-destructive`,children:c.message}):t(u?`config:shortcuts.saved`:`config:shortcuts.deviceScope`)})]})}var Ti=[[`openai-responses`,`OpenAI Responses`],[`openai-completions`,`OpenAI Chat Completions`],[`anthropic-messages`,`Anthropic Messages`],[`google-generative-ai`,`Google Generative AI`]],Ei={openai:Pe,"openai-codex":Pe,anthropic:Xe,google:Je,deepseek:se,xai:ge,openrouter:he,"kimi-coding":Je,"zai-coding-cn":Xe};function Di({providers:e,defaultProviderId:t,toggling:n,onConfigure:r,onToggle:i,onDelete:a,onAddCustom:o}){let{t:c}=h(),l=e.filter(e=>e.configured||e.custom);return(0,K.jsxs)(X,{children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-[8px] [margin-bottom:8px]`,children:[(0,K.jsx)(ei,{title:c(`config:configPage.connections`)}),(0,K.jsxs)(s,{variant:`ghost`,size:`sm`,className:`h-[26px] px-[8px] text-[12px] text-[var(--text-muted)]`,onClick:o,children:[(0,K.jsx)(lt,{size:13}),c(`config:configPage.addCustomConnection`)]})]}),(0,K.jsx)(`div`,{className:`grid [grid-template-columns:repeat(auto-fill,minmax(min(230px,100%),1fr))] gap-[8px]`,children:l.map(e=>{let o=Ei[e.id]||We,l=e.id===t,u=e.configured?e.enabled?c(`config:configPage.authenticationReady`):c(`config:configPage.disabled2`):e.id===`openai-codex`?c(`config:configPage.codexCLILoginRequired`):c(`config:configPage.apiKeyRequired`);return(0,K.jsxs)(`div`,{role:`button`,tabIndex:0,title:c(`config:configPage.configure`),className:`flex cursor-pointer flex-col gap-[8px] [border:1px_solid_var(--stroke-soft)] rounded-[var(--r-sm)] bg-[var(--surface-subtle)] p-[10px_11px] hover:border-[var(--accent-border)] hover:bg-[var(--accent-soft)] focus-visible:outline-2 focus-visible:outline-[var(--focus)]`,onClick:()=>r(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),r(e))},children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-[8px]`,children:[(0,K.jsx)(`span`,{className:`grid w-[30px] h-[30px] flex-none place-items-center rounded-[var(--r-sm)] bg-[var(--accent-soft)] text-[var(--star-strong)]`,children:(0,K.jsx)(o,{size:16})}),(0,K.jsx)(`strong`,{className:`min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-[13px]`,children:e.name}),l&&(0,K.jsx)(Z,{tone:`green`,children:c(`config:configPage.defaultBadge`)})]}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-[8px]`,children:[(0,K.jsx)(`small`,{className:`text-[12px] text-[var(--text-muted)]`,children:u}),(0,K.jsxs)(`div`,{className:`flex flex-none items-center gap-[6px]`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:[(0,K.jsx)(ti,{value:e.configured&&e.enabled,disabled:!e.configured||n===e.id,onChange:t=>i(e,t)}),e.custom&&(0,K.jsx)(s,{variant:`destructive`,size:`icon`,className:`h-[26px] w-[26px]`,title:c(`config:configPage.deleteProvider`),onClick:()=>a(e),children:(0,K.jsx)(xe,{size:13})})]})]})]},e.id)})})]})}function Oi({config:e,onQuickSetup:t,onChangeModel:n}){let{t:r}=h(),i=e.defaultProvider||e.provider,a=e.defaultModel||e.model,o=e.providers.find(e=>e.id===i),c=o?.models.find(e=>e.id===a),l=!!(o?.configured&&o?.enabled&&a);return(0,K.jsx)(X,{className:`[margin-bottom:12px]`,"data-config-card":`models-current-model`,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-[12px] max-[650px]:grid max-[650px]:grid-cols-[40px_minmax(0,1fr)]`,children:[(0,K.jsx)(`span`,{className:`grid w-[40px] h-[40px] flex-none place-items-center rounded-[11px] bg-[var(--accent-soft)] text-[var(--star-strong)]`,children:(0,K.jsx)(Pe,{size:19})}),(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-[3px]`,children:[(0,K.jsx)(`span`,{className:`text-[12px] font-[600] text-[var(--text-muted)]`,children:r(`config:configPage.currentChatModel`)}),l?(0,K.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-[7px]`,children:[(0,K.jsxs)(`strong`,{className:`overflow-hidden text-ellipsis whitespace-nowrap text-[15px]`,children:[o?.name,` / `,c?.name||a]}),(0,K.jsxs)(Z,{tone:`green`,children:[(0,K.jsx)(Qe,{size:11,className:`mr-[3px] inline`}),r(`config:configPage.authenticationReady`)]})]}):(0,K.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-[2px]`,children:[(0,K.jsxs)(`strong`,{className:`flex items-center gap-[6px] text-[14px] text-[var(--warning-strong)]`,children:[(0,K.jsx)(Ir,{size:15}),r(`config:configPage.noModelConfiguredYet`)]}),(0,K.jsx)(`small`,{className:`text-[12px] text-[var(--text-muted)]`,children:r(`config:configPage.noModelConfiguredHint`)})]})]}),(0,K.jsxs)(`div`,{className:`flex min-w-0 max-w-full flex-none flex-wrap items-center gap-[7px] max-[650px]:col-span-full`,children:[l&&o&&(0,K.jsxs)(s,{variant:`outline`,className:`bg-surface-subtle`,onClick:n,children:[(0,K.jsx)(Wr,{size:13}),r(`config:configPage.changeModel`)]}),(0,K.jsxs)(s,{onClick:t,children:[(0,K.jsx)(M,{size:13}),r(`config:configPage.quickSetup`)]})]})]})})}function ki(e,t){return t===`visual`?e?.models.find(e=>e.kind===`image`||e.kind===`video`):e?.models.find(e=>e.kind===`chat`)||e?.models[0]}function Ai({onClose:e,onCreated:t,initialProviderType:n=`chat`,initialProvider:i}){let{t:a}=h(),o=i?.type||n,c=ki(i,o),l=!!i,[u,d]=(0,G.useState)({name:i?.name||``,id:i?.id||``,providerType:o,api:i?.api||`openai-responses`,baseUrl:i?.baseUrl||``,apiKey:``,model:c?.id||``,modelName:c?.name||``,modelKind:c?.kind===`image`||c?.kind===`video`?c.kind:o===`visual`?`image`:`chat`,reasoning:c?.reasoning!==!1,enabled:i?.enabled??!0}),[f,p]=(0,G.useState)(!1),[m,g]=(0,G.useState)(``),_=e=>d(t=>({...t,name:e,id:t.id||e.toLowerCase().replace(/[^a-z0-9._-]+/g,`-`).replace(/^-+|-+$/g,``)}));return(0,G.useEffect)(()=>{let t=t=>{t.key===`Escape`&&(t.preventDefault(),t.stopPropagation(),e())};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e]),(0,K.jsx)(`div`,{className:`modal-backdrop max-[650px]:p-[8px] fixed z-[70] inset-0 grid place-items-center overflow-y-auto bg-[var(--modal-overlay)] [backdrop-filter:blur(3px)] [padding:20px] [overscroll-behavior:contain] [animation:fade-in_var(--d1)_var(--ease-out)]`,onMouseDown:t=>t.target===t.currentTarget&&e(),children:(0,K.jsxs)(`form`,{role:`dialog`,"aria-modal":`true`,className:`modal !w-[min(430px,100%)] max-h-[calc(100dvh_-_40px)] overflow-y-auto [overscroll-behavior:contain] [border:1px_solid_var(--surface-highlight)] rounded-[var(--r-md)] bg-[var(--solid)] p-[18px] shadow-[0_26px_70px_-25px_var(--shadow-strong)] [animation:modal-in_var(--d2)_var(--ease-out)] max-[650px]:max-h-[calc(100dvh_-_16px)] provider-config-modal !w-[min(620px,100%)]`,onSubmit:async e=>{e.preventDefault(),p(!0),g(``);try{t(l?await r(`/api/config`,{method:`PUT`,body:JSON.stringify({...u,provider:u.id,providerName:u.name,setAsDefault:!1})}):await r(`/api/providers`,{method:`POST`,body:JSON.stringify(u)}))}catch(e){g(e instanceof Error?e.message:String(e))}finally{p(!1)}},children:[(0,K.jsxs)(et,{children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h2`,{children:a(l?`config:configPage.editProviderConnection`:`config:configPage.addProviderConnection`)}),(0,K.jsx)(`p`,{children:a(l?`config:configPage.updateProviderKeyURLAndModelSettings`:`config:configPage.youCanCreateMultipleConnectionsUsingTheSameProtocolEachWithItsOwnKeyAndBaseURL`)})]}),(0,K.jsx)(s,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":a(`config:configPage.closeDialog`),onClick:t=>{t.preventDefault(),t.stopPropagation(),e()},children:(0,K.jsx)(Ce,{size:17})})]}),(0,K.jsxs)(`div`,{className:`form-grid grid gap-[9px]`,children:[(0,K.jsxs)(W,{variant:`control`,children:[a(`config:configPage.displayName`),(0,K.jsx)(`input`,{value:u.name,onChange:e=>_(e.target.value),placeholder:a(`config:configPage.forExampleOpenAIOfficial`)})]}),(0,K.jsxs)(W,{variant:`control`,children:[`Provider ID`,(0,K.jsx)(`input`,{value:u.id,disabled:l,onChange:e=>d({...u,id:e.target.value}),placeholder:`openai-official`})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-[8px] [margin-top:10px] [border:1px_solid_var(--stroke-soft)] rounded-[var(--r-sm)] bg-[var(--surface-subtle)] p-[8px_10px]`,children:[(0,K.jsx)(`span`,{className:`text-[12px] text-[var(--text-muted)]`,children:a(`config:configPage.providerPurpose`)}),(0,K.jsx)(`strong`,{className:`text-[12px]`,children:u.providerType===`visual`?a(`config:configPage.visualProvider`):a(`config:configPage.chatProvider`)})]}),(0,K.jsxs)(W,{variant:`control`,children:[a(`config:configPage.apiProtocol`),(0,K.jsx)(L,{value:u.api,onChange:e=>d({...u,api:e.target.value}),children:Ti.map(([e,t])=>(0,K.jsx)(`option`,{value:e,children:t},e))})]}),(0,K.jsxs)(W,{variant:`control`,children:[`Base URL`,(0,K.jsx)(`input`,{value:u.baseUrl,onChange:e=>d({...u,baseUrl:e.target.value}),placeholder:`https://api.openai.com/v1`})]}),(0,K.jsxs)(W,{variant:`control`,children:[`API Key`,(0,K.jsx)(`input`,{type:`password`,value:u.apiKey,onChange:e=>d({...u,apiKey:e.target.value}),placeholder:a(l?`config:configPage.keepExistingKeyBlank`:`config:configPage.enterTheAPIKeyForThisConnection`)})]}),(0,K.jsxs)(`div`,{className:`form-grid grid gap-[9px]`,children:[(0,K.jsxs)(W,{variant:`control`,children:[a(`config:configPage.initialModelID`),(0,K.jsx)(`input`,{value:u.model,onChange:e=>d({...u,model:e.target.value}),placeholder:u.providerType===`visual`?`gpt-image-2 or grok-imagine-video`:`gpt-5.4 or gpt-image-1`})]}),(0,K.jsxs)(W,{variant:`control`,children:[a(`config:configPage.modelName`),(0,K.jsx)(`input`,{value:u.modelName,onChange:e=>d({...u,modelName:e.target.value}),placeholder:a(`config:configPage.leaveBlankToUseTheModelID`)})]})]}),(0,K.jsxs)(W,{variant:`control`,children:[a(`config:configPage.modelType`),u.providerType===`visual`?(0,K.jsxs)(L,{value:u.modelKind,onChange:e=>d({...u,modelKind:e.target.value}),children:[(0,K.jsx)(`option`,{value:`image`,children:a(`config:configPage.imageGenerationAndEditing`)}),(0,K.jsx)(`option`,{value:`video`,children:a(`config:configPage.videoGeneration`)})]}):(0,K.jsx)(`div`,{className:`rounded-[var(--r-xs)] bg-[var(--surface-subtle)] px-[10px] py-[8px] text-[13px] text-[var(--text-muted)]`,children:a(`config:configPage.chat`)})]}),(0,K.jsxs)(`div`,{className:`modal-toggle-row [&_>_span]:flex [&_>_span]:flex-col [&_>_span]:gap-[3px] [&_strong]:text-[13px] [&_small]:text-[var(--text-muted)] [&_small]:text-[13px] dark:bg-[var(--surface-subtle)] flex min-h-[45px] items-center justify-between gap-[12px] [margin-top:10px] [border:1px_solid_var(--stroke-soft)] rounded-[var(--r-sm)] bg-[var(--surface-subtle)] [padding:8px_10px]`,children:[(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`strong`,{children:a(`config:configPage.enableAfterCreation`)}),(0,K.jsx)(`small`,{children:a(`config:configPage.visualModelsAreSelectedByTheVisualGenerationToolAndDoNotAppearInTheChatModelList`)})]}),(0,K.jsx)(ti,{value:u.enabled,onChange:e=>d({...u,enabled:e})})]}),m&&(0,K.jsxs)(U,{children:[(0,K.jsx)(H,{size:13}),m]}),(0,K.jsxs)(`div`,{className:`flex justify-end gap-[8px] [margin-top:18px]`,children:[(0,K.jsx)(s,{type:`button`,variant:`outline`,size:`lg`,className:`bg-surface-subtle`,onClick:e,children:a(`config:configPage.cancel`)}),(0,K.jsxs)(s,{size:`lg`,disabled:f,children:[f?(0,K.jsx)(V,{className:`animate-spin`,size:14}):l?(0,K.jsx)(z,{size:14}):(0,K.jsx)(lt,{size:14}),a(f?`config:configPage.saving`:l?`config:configPage.saveChanges`:`config:configPage.createConnection`)]})]})]})})}function ji(e){return(e.providers||[]).some(e=>e.importable&&!e.imported&&!e.conflict)}function Mi(e,t){return!t&&!ji(e)}function Ni(e,t,n){let r=e.providers||[],i=e.errors||[],a=ji(e),o=!!(n||i.length||r.some(e=>e.conflict||!e.imported&&!e.importable||e.warnings?.some(e=>e.code!==`login_auth_not_imported`)));return t||a||o}function Pi(e){return e.source===`codex-config`?`Codex config.toml`:e.source===`claude-config`?`Claude settings.json`:e.source===`codex-auth`?`Codex login`:`Claude login`}function Fi(e,t){return e.authType===`environment`?t(`config:configPage.keyVariableName`,{name:e.authVariable}):e.authType===`bearer`||e.authType===`api_key`?t(`config:configPage.authenticationIncludedInConfiguration`):e.authType===`oauth`?t(`config:configPage.loginStateFileDetected`):e.authType===`external-login`?t(`config:configPage.authenticationRequired`):t(`config:configPage.noAuthenticationInConfiguration`)}function Ii(e,t){return t(e===`multiple_auth_values`?`config:configPage.multipleAuthenticationFieldsWereDetectedTheAuthorizationFieldTakesPrecedence`:e===`invalid_url`?`config:configPage.theProviderEndpointIsInvalid`:e===`unsupported_api`?`config:configPage.theAPIProtocolInThisConfigurationIsNotSupportedYet`:e===`invalid_env_name`?`config:configPage.theKeyEnvironmentVariableNameIsInvalid`:`config:configPage.someConfigurationFieldsCannotBeImported`)}function Li({discovery:e,discovering:t,error:n,importing:r,onRefresh:i,onImport:a}){let{t:o}=h(),[c,l]=(0,G.useState)(null),u=e.providers||[],d=e.errors||[];if(!Ni(e,t,n))return null;let f=c??Mi(e,t),p=()=>(l(null),i()),m=e=>(l(null),a(e)),g=e=>[`invalid_json`,`invalid_toml`].includes(e.code)?o(`config:configPage.invalidConfigurationFileFormat`):e.code===`unsupported_config`?o(`config:configPage.noImportableProviderConfigurationWasFound`):e.code===`invalid_login_state`?o(`config:configPage.incompleteLoginState`):e.code===`file_too_large`?o(`config:configPage.configurationFileIsTooLarge`):o(`config:configPage.unableToReadTheConfigurationFile`);return(0,K.jsxs)(X,{className:`[margin-bottom:12px] [padding:12px_14px]`,children:[(0,K.jsxs)(`div`,{className:`[&_strong]:text-[13px] [&_small]:text-[var(--text-muted)] [&_small]:text-[12px] [&_small]:leading-[1.45] max-[650px]:flex-wrap flex items-center gap-[10px]`,children:[(0,K.jsxs)(`button`,{type:`button`,className:`max-[650px]:basis-full [&_>_span:nth-child(2)]:flex [&_>_span:nth-child(2)]:min-w-0 [&_>_span:nth-child(2)]:flex-1 [&_>_span:nth-child(2)]:flex-col [&_>_span:nth-child(2)]:gap-[3px] flex min-w-0 flex-1 items-center gap-[10px] border-0 bg-transparent p-0 text-inherit text-left cursor-pointer`,"aria-expanded":!f,onClick:()=>l(!f),children:[(0,K.jsx)(`span`,{className:`grid w-[38px] h-[38px] [flex:0_0_auto] place-items-center rounded-[11px] bg-[var(--star-soft)] text-[var(--star-strong)]`,children:(0,K.jsx)(We,{size:18})}),(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`strong`,{children:o(`config:configPage.localProviderConfiguration`)}),(0,K.jsx)(`small`,{children:o(`config:configPage.readProviderEndpointModelAndAuthenticationFieldsFromCodexConfigTomlAndClaudeSettingsJson`)})]}),(0,K.jsx)(oe,{size:15,className:`provider-discovery-caret [&.open]:[transform:rotate(180deg)] flex-none text-[var(--text-muted)] [transition:transform_var(--d1)_var(--ease-out)] ${f?``:`open`}`})]}),(0,K.jsxs)(s,{type:`button`,variant:`outline`,className:`bg-surface-subtle`,disabled:t||!!r,onClick:p,children:[t?(0,K.jsx)(V,{className:`animate-spin`,size:13}):(0,K.jsx)(V,{size:13}),o(`config:configPage.rescan`)]})]}),!f&&(0,K.jsxs)(K.Fragment,{children:[t&&!u.length?(0,K.jsxs)(`div`,{className:`flex min-h-[48px] items-center justify-center gap-[7px] [margin-top:9px] rounded-[var(--r-sm)] bg-[var(--surface-subtle)] text-[var(--text-muted)] text-[12px]`,children:[(0,K.jsx)(V,{className:`animate-spin`,size:15}),o(`config:configPage.scanningProviderConfigurationFiles`)]}):u.length?(0,K.jsx)(`div`,{className:`provider-discovery-list max-[650px]:grid-cols-[1fr] grid grid-cols-[repeat(2,minmax(0,1fr))] gap-[8px] [margin-top:11px]`,children:u.map(e=>{let t=Pi(e),n=r===e.id,i=e.source.startsWith(`claude-`)?Xe:Pe,a=e.kind===`authentication`?o(`config:configPage.officialProviderAuthenticationOnly`):e.models?.length?e.models.map(e=>e.id).join(`, `):o(`config:configPage.noModelSpecified`);return(0,K.jsxs)(`div`,{className:`provider-discovery-card grid min-w-0 min-h-[68px] grid-cols-[auto_minmax(0,1fr)_auto] max-[650px]:grid-cols-[auto_minmax(0,1fr)] items-center gap-[9px] [border:1px_solid_var(--stroke)] rounded-[var(--r-sm)] bg-[var(--surface-subtle)] [padding:8px_9px] ${e.imported?`configured [.provider-discovery-card&]:border-[var(--success-border)] [.provider-discovery-card&]:bg-[var(--success-soft)]`:``}`,children:[(0,K.jsx)(`span`,{className:`provider-discovery-icon [&.source-claude-config]:bg-[var(--brand-blue-soft)] [&.source-claude-config]:text-[var(--brand-blue-strong)] grid w-[32px] h-[32px] place-items-center rounded-[var(--r-sm)] bg-[var(--star-soft)] text-[var(--star-strong)] source-${e.source}`,children:(0,K.jsx)(i,{size:17})}),(0,K.jsxs)(`span`,{className:`provider-discovery-copy [&_strong]:overflow-hidden [&_strong]:text-ellipsis [&_strong]:whitespace-nowrap [&_small]:overflow-hidden [&_small]:text-ellipsis [&_small]:whitespace-nowrap [&_strong]:text-[12px] [&_small]:text-[var(--text-muted)] [&_small]:text-[11px] flex min-w-0 flex-col gap-[3px]`,children:[(0,K.jsxs)(`strong`,{children:[t,` · `,e.providerName]}),(0,K.jsxs)(`small`,{children:[e.api,` · `,a]}),(0,K.jsxs)(`small`,{children:[e.kind===`authentication`?o(`config:configPage.officialEndpointOnly`):e.baseUrl||o(`config:configPage.noBaseURLSpecified`),` `,`· `,Fi(e,o),` · `,e.location]})]}),(0,K.jsx)(`span`,{className:`flex min-w-0 flex-none items-center max-[650px]:col-start-2`,children:e.imported?(0,K.jsx)(Z,{tone:`green`,children:o(`config:configPage.loaded`)}):e.conflict?(0,K.jsx)(Z,{tone:`amber`,children:o(`config:configPage.conflictDetected`)}):e.importable?(0,K.jsxs)(s,{type:`button`,disabled:n||!!r,onClick:()=>m(e),children:[n?(0,K.jsx)(V,{className:`animate-spin`,size:12}):(0,K.jsx)(Le,{size:12}),n?o(`config:configPage.loading`):e.kind===`authentication`?o(`config:configPage.loadLoginState`):o(`config:configPage.loadConfiguration`)]}):(0,K.jsx)(Z,{tone:`gray`,children:o(`config:configPage.cannotLoad`)})})]},e.id)})}):(0,K.jsxs)(`div`,{className:`flex min-h-[48px] items-center justify-center gap-[7px] [margin-top:9px] rounded-[var(--r-sm)] bg-[var(--surface-subtle)] text-[var(--text-muted)] text-[12px]`,children:[(0,K.jsx)(We,{size:15}),o(`config:configPage.noImportableCodexOrClaudeProviderConfigurationWasDetected`)]}),(n||d.length>0||u.some(e=>e.warnings?.some(e=>e.code!==`login_auth_not_imported`)))&&(0,K.jsxs)(`div`,{className:`provider-discovery-errors [&_span]:flex [&_span]:items-center [&_span]:gap-[5px] flex flex-col gap-[4px] [margin-top:8px] text-[var(--danger)] text-[11px]`,"aria-live":`polite`,children:[n&&(0,K.jsxs)(`span`,{children:[(0,K.jsx)(H,{size:13}),n]}),d.map((e,t)=>(0,K.jsxs)(`span`,{children:[(0,K.jsx)(H,{size:13}),Pi(e),` · `,g(e)]},`${e.source}-${e.code}-${t}`)),u.flatMap(e=>(e.warnings||[]).filter(e=>e.code!==`login_auth_not_imported`).map((t,n)=>(0,K.jsxs)(`span`,{children:[(0,K.jsx)(H,{size:13}),Pi(e),` · `,Ii(t.code,o)]},`${e.id}-${t.code}-${n}`)))]})]})]})}function Ri(e,t){try{let n=new URL(e).hostname.replace(/^www\./i,``),r=t===`visual`?`visual`:`chat`;return{id:`custom-${n.replace(/[^a-z0-9]+/gi,`-`)}-${r}`.replace(/^-+|-+$/g,``).slice(0,60)||`custom-provider`,name:n||`Custom Provider`}}catch{return{id:`custom-provider`,name:`Custom Provider`}}}function zi(e,t){return String(e||``).replace(/\/+$/,``).toLowerCase()===t.replace(/\/+$/,``).toLowerCase()}function Bi({config:e,providerType:t=`chat`,initialProviderId:n,onClose:i,onCompleted:a}){let{t:o}=h(),c=n&&e.providers.find(e=>e.id===n)||null,[l,u]=(0,G.useState)(1),[d,f]=(0,G.useState)(c),[p,m]=(0,G.useState)(c?.baseUrl||``),[g,_]=(0,G.useState)(c?.api||`openai-responses`),[v,y]=(0,G.useState)(``),[b,x]=(0,G.useState)(c?.organization||``),[S,C]=(0,G.useState)(c?.name||``),[w,T]=(0,G.useState)([]),[E,D]=(0,G.useState)(``),[O,k]=(0,G.useState)(t===`visual`?`image`:`chat`),[A,j]=(0,G.useState)(!1),[M,N]=(0,G.useState)(``),[ee,P]=(0,G.useState)(``),te=(0,G.useRef)(null);(0,G.useEffect)(()=>{let e=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),i())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[i]);let F=()=>te.current?.value??v,I=Ri(p,t),ne=o(t===`visual`?`config:configPage.visualProvider`:`config:configPage.chatProvider`),R=o(l===1?`config:configPage.quickSetupStepBaseUrl`:l===2?`config:configPage.quickSetupStepProtocol`:`config:configPage.quickSetupStepModel`),ie=w.filter(e=>t===`visual`?e.kind===`image`||e.kind===`video`:e.kind===`chat`),oe=()=>{let n=p.trim();try{let e=new URL(n);if(![`http:`,`https:`].includes(e.protocol))throw Error()}catch{N(o(`config:configPage.providerBaseURLMustBeHTTPOrHTTPS`));return}N(``);let r=e.providers.find(e=>e.type===t&&zi(e.baseUrl,n)&&e.api===g);f(r||null),r?(C(r.name),x(r.organization||``)):S.trim()||C(I.name),u(2)},se=()=>{if(!g){N(o(`config:configPage.selectAPIProtocol`));return}N(``),u(3)},ce=async()=>{let n=F().trim();n!==v&&y(n);let i=e.providers.find(e=>e.type===t&&zi(e.baseUrl,p)&&e.api===g);if(f(i||null),!n&&!i?.configured){N(o(`config:configPage.enterTheAPIKeyForThisConnection`));return}j(!0),N(``),P(``);try{let e=((await r(`/api/providers/models/discover-connection`,{method:`POST`,body:JSON.stringify({providerId:i?.id||``,providerType:t,api:g,baseUrl:p,organization:b,apiKey:n})})).models||[]).filter(e=>t===`visual`?e.kind===`image`||e.kind===`video`:e.kind===`chat`);if(!e.length){N(o(t===`visual`?`config:configPage.fetchOrAddAVisualModel`:`config:configPage.fetchOrAddAChatModel`));return}T(e);let a=e.find(e=>e.id===E)||e[0];D(a.id),k(t===`visual`?a.kind:`chat`)}catch(e){let n=e instanceof Error?e.message:String(e),r=i?.models.filter(e=>t===`visual`?e.kind===`image`||e.kind===`video`:e.kind===`chat`)||[];if(!/\(401\)|\(403\)|鉴权|认证|密钥|API Key/i.test(n)&&r.length){T(r);let e=r.find(e=>e.id===E)||r[0];D(e.id),k(t===`visual`?e.kind:`chat`),P(n)}else N(n)}finally{j(!1)}},le=async()=>{let n=E.trim();if(!n){N(o(`config:configPage.selectModelToFinish`));return}j(!0),N(``);try{a(d?await r(`/api/config`,{method:`PUT`,body:JSON.stringify({provider:d.id,providerType:t,api:g,baseUrl:p,organization:b,model:n,modelKind:t===`visual`?O:`chat`,apiKey:F(),thinkingLevel:e.thinkingLevel,toolMode:e.toolMode,setAsDefault:!0,enabled:!0})}):await r(`/api/providers`,{method:`POST`,body:JSON.stringify({id:I.id,name:S.trim()||I.name,providerType:t,api:g,baseUrl:p,organization:b,apiKey:F(),model:n,modelKind:t===`visual`?O:`chat`,enabled:!0})}))}catch(e){N(e instanceof Error?e.message:String(e))}finally{j(!1)}};return(0,K.jsx)(`div`,{className:`modal-backdrop max-[650px]:p-[8px] fixed z-[70] inset-0 grid place-items-center overflow-y-auto bg-[var(--modal-overlay)] [backdrop-filter:blur(3px)] [padding:20px] [overscroll-behavior:contain] [animation:fade-in_var(--d1)_var(--ease-out)]`,onMouseDown:e=>e.target===e.currentTarget&&i(),children:(0,K.jsxs)(`div`,{className:`modal max-h-[calc(100dvh_-_40px)] w-[min(520px,100%)] overflow-y-auto [overscroll-behavior:contain] [border:1px_solid_var(--surface-highlight)] rounded-[var(--r-md)] bg-[var(--solid)] p-[18px] shadow-[0_26px_70px_-25px_var(--shadow-strong)] [animation:modal-in_var(--d2)_var(--ease-out)] max-[650px]:max-h-[calc(100dvh_-_16px)]`,children:[(0,K.jsxs)(et,{children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h2`,{children:o(t===`visual`?`config:configPage.visualQuickSetupTitle`:`config:configPage.quickSetupTitle`)}),(0,K.jsxs)(`p`,{children:[o(`config:configPage.stepIndicator`,{current:l,total:3}),` · `,R]})]}),(0,K.jsx)(s,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":o(`config:configPage.closeDialog`),onClick:i,children:(0,K.jsx)(Ce,{size:17})})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-[8px] [margin-top:12px] [border:1px_solid_var(--stroke-soft)] rounded-[var(--r-sm)] bg-[var(--surface-subtle)] p-[9px_10px]`,children:[(0,K.jsx)(`span`,{className:`grid w-[30px] h-[30px] flex-none place-items-center rounded-[var(--r-sm)] bg-[var(--accent-soft)] text-[var(--star-strong)]`,children:(0,K.jsx)(We,{size:16})}),(0,K.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-[2px]`,children:[(0,K.jsx)(`strong`,{className:`overflow-hidden text-ellipsis whitespace-nowrap text-[13px]`,children:S||I.name}),(0,K.jsx)(`small`,{className:`text-[11px] text-[var(--text-muted)]`,children:ne})]}),(0,K.jsx)(Z,{tone:`gray`,children:ne})]}),l===1&&(0,K.jsxs)(`div`,{className:`[margin-top:14px]`,children:[(0,K.jsxs)(W,{variant:`control`,children:[`Base URL`,(0,K.jsx)(`input`,{autoFocus:!0,value:p,onChange:e=>m(e.target.value),placeholder:`https://api.example.com/v1`,inputMode:`url`})]}),(0,K.jsx)(`p`,{className:`[margin:8px_0_0] text-[12px] leading-[1.5] text-[var(--text-muted)]`,children:o(`config:configPage.quickSetupBaseUrlHint`)})]}),l===2&&(0,K.jsxs)(`div`,{className:`[margin-top:14px]`,children:[(0,K.jsxs)(W,{variant:`control`,children:[o(`config:configPage.apiProtocol`),(0,K.jsx)(L,{value:g,onChange:e=>_(e.target.value),children:Ti.map(([e,t])=>(0,K.jsx)(`option`,{value:e,children:t},e))})]}),(0,K.jsxs)(W,{variant:`control`,children:[`Organization`,(0,K.jsx)(`input`,{value:b,onChange:e=>x(e.target.value),placeholder:o(`config:configPage.optionalUsedOnlyForOpenAIOrganization`)})]})]}),l===3&&(0,K.jsxs)(`div`,{className:`[margin-top:14px]`,children:[!d&&(0,K.jsxs)(W,{variant:`control`,children:[o(`config:configPage.displayName`),(0,K.jsx)(`input`,{value:S,onChange:e=>C(e.target.value),placeholder:I.name})]}),(0,K.jsxs)(W,{variant:`control`,children:[`API Key`,(0,K.jsx)(`input`,{ref:te,type:`password`,autoComplete:`new-password`,autoFocus:!0,value:v,onChange:e=>y(e.target.value),onInput:e=>y(e.currentTarget.value),placeholder:d?.configured?o(`config:configPage.keepExistingKeyBlank`):o(`config:configPage.enterTheAPIKeyForThisConnection`)})]}),(0,K.jsxs)(s,{type:`button`,size:`lg`,className:`[margin-top:10px] w-full`,disabled:A,onClick:()=>void ce(),children:[A?(0,K.jsx)(V,{className:`animate-spin`,size:14}):(0,K.jsx)(V,{size:14}),o(A?`config:configPage.fetchingModels`:`config:configPage.fetchModels`)]}),ee&&(0,K.jsxs)(Ge,{className:`[margin-top:10px]`,children:[(0,K.jsx)(H,{size:15}),(0,K.jsx)(`small`,{children:o(`config:configPage.discoverFailedUsingExisting`,{message:ee})})]}),ie.length>0&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`p`,{className:`[margin:14px_0_8px] text-[12px] leading-[1.5] text-[var(--text-muted)]`,children:o(t===`visual`?`config:configPage.selectVisualModelToFinish`:`config:configPage.selectModelToFinish`)}),(0,K.jsx)(`div`,{className:`flex max-h-[260px] flex-col gap-[6px] overflow-y-auto`,children:ie.map(e=>(0,K.jsxs)(`button`,{type:`button`,className:re(`flex min-w-0 cursor-pointer items-center gap-[8px] [border:1px_solid_var(--stroke-soft)] rounded-[var(--r-sm)] bg-[var(--surface-subtle)] p-[8px_10px] text-left hover:border-[var(--accent-border)]`,E===e.id&&`[border-color:var(--accent-border)] bg-[var(--accent-soft)]`),onClick:()=>{D(e.id),k(t===`visual`?e.kind:`chat`)},children:[(0,K.jsx)(`span`,{className:re(`grid w-[16px] h-[16px] flex-none place-items-center rounded-full [border:1px_solid_var(--stroke)] text-transparent`,E===e.id&&`[border-color:var(--brand-blue)] bg-[var(--brand-blue)] text-white`),children:(0,K.jsx)(z,{size:11})}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-[13px]`,children:e.name}),t===`visual`&&(0,K.jsx)(Z,{tone:`gray`,children:e.kind===`video`?o(`config:configPage.visualVideoModel`):o(`config:configPage.visualImageModel`)})]},`${e.id}-${e.kind}`))})]})]}),M&&(0,K.jsxs)(U,{children:[(0,K.jsx)(H,{size:13}),M]}),(0,K.jsxs)(`div`,{className:`flex justify-between gap-[8px] [margin-top:18px]`,children:[(0,K.jsxs)(s,{type:`button`,variant:`outline`,size:`lg`,className:`bg-surface-subtle`,disabled:A||l===1,onClick:()=>{N(``),u(l-1)},children:[(0,K.jsx)(ze,{size:14}),o(`config:configPage.previousStep`)]}),l===1?(0,K.jsxs)(s,{type:`button`,size:`lg`,disabled:A||!p.trim(),onClick:oe,children:[(0,K.jsx)(ae,{size:14}),o(`config:configPage.nextStep`)]}):l===2?(0,K.jsxs)(s,{type:`button`,size:`lg`,disabled:A,onClick:se,children:[(0,K.jsx)(ae,{size:14}),o(`config:configPage.nextStep`)]}):(0,K.jsxs)(s,{type:`button`,size:`lg`,disabled:A||!E.trim()||ie.length===0,onClick:()=>void le(),children:[A?(0,K.jsx)(V,{className:`animate-spin`,size:14}):(0,K.jsx)(z,{size:14}),o(A?`config:configPage.saving`:`config:configPage.saveAndSetDefault`)]})]})]})})}function Vi({config:e,notify:t,onConfigChanged:n}){let{t:i}=h(),[a,o]=(0,G.useState)(e.thinkingLevel),[c,l]=(0,G.useState)(e.toolMode),[u,d]=(0,G.useState)(!1),[f,p]=(0,G.useState)(``);(0,G.useEffect)(()=>{o(e.thinkingLevel),l(e.toolMode)},[e.thinkingLevel,e.toolMode]);let m=e.defaultProvider||e.provider,g=e.defaultModel||e.model,_=e.providers.find(e=>e.id===m),v=!!(_?.configured&&g),y=a!==e.thinkingLevel||c!==e.toolMode,b=async()=>{if(!(!_||!g)){d(!0),p(``);try{n(await r(`/api/config`,{method:`PUT`,body:JSON.stringify({provider:_.id,providerType:_.type,api:_.api,baseUrl:_.baseUrl||``,organization:_.organization||``,model:g,thinkingLevel:a,toolMode:c,setAsDefault:!1})})),t(i(`config:configPage.runtimePolicySaved`))}catch(e){p(e instanceof Error?e.message:String(e))}finally{d(!1)}}};return(0,K.jsxs)(X,{children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-[8px]`,children:[(0,K.jsx)(ei,{title:i(`config:configPage.agentRuntimePolicy`)}),(0,K.jsxs)(s,{size:`sm`,className:`h-[27px] px-[10px] text-[12px]`,disabled:u||!y||!v,onClick:()=>void b(),children:[u?(0,K.jsx)(V,{className:`animate-spin`,size:13}):(0,K.jsx)(_e,{size:13}),i(u?`config:configPage.saving`:`config:configPage.saveSettings`)]})]}),(0,K.jsxs)(W,{variant:`control`,children:[i(`config:configPage.thinkingLevel`),(0,K.jsx)(L,{value:a,onChange:e=>o(e.target.value),children:[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`].map(e=>(0,K.jsx)(`option`,{children:e},e))})]}),(0,K.jsxs)(W,{variant:`control`,children:[i(`config:configPage.availableTools`),(0,K.jsxs)(L,{value:c,onChange:e=>l(e.target.value),children:[(0,K.jsx)(`option`,{value:`workspace`,children:i(`config:configPage.fileEditingTools`)}),(0,K.jsx)(`option`,{value:`full`,children:i(`config:configPage.fullToolAccess`)}),(0,K.jsx)(`option`,{value:`custom`,children:i(`config:configPage.customManageEachToolOnThePluginsPage`)})]})]}),(0,K.jsxs)(Ge,{children:[(0,K.jsx)(ye,{size:16}),(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`strong`,{children:i(`config:configPage.permissionsAreEnforcedByTheRuntime`)}),(0,K.jsx)(`small`,{children:i(`config:configPage.afterSavingExistingRuntimesAreReleasedAndNewChatsUseTheLatestPolicy`)})]})]}),f&&(0,K.jsxs)(U,{children:[(0,K.jsx)(H,{size:13}),f]})]})}function Hi(e){return e instanceof Error?e.message:String(e)}function Ui({notify:e,requestConfirm:t,t:n}){let[i,a]=(0,G.useState)(null),[o,s]=(0,G.useState)(!0),[c,l]=(0,G.useState)(``),[u,d]=(0,G.useState)(``);return(0,G.useEffect)(()=>{let e=!0;return r(`/api/config`).then(t=>{if(e)return a(t),s(!1),r(`/api/providers/models/refresh`,{method:`POST`,body:`{}`})}).then(t=>{!e||!t?.config||a(t.config)}).catch(t=>{e&&(l(Hi(t)),s(!1))}),()=>{e=!1}},[]),{config:i,loading:o,error:c,toggling:u,applyConfig:(0,G.useCallback)(e=>{a(e),l(``)},[]),toggleProvider:(0,G.useCallback)(async(t,i)=>{d(t.id),l(``);try{let o=await r(`/api/providers/${encodeURIComponent(t.id)}/enabled`,{method:`PUT`,body:JSON.stringify({enabled:i})});a(o),e(n(`config:configPage.nameState`,{name:t.name,state:n(i?`config:configPage.enabled`:`config:configPage.disabled`)}))}catch(e){l(Hi(e))}finally{d(``)}},[e,n]),deleteProvider:(0,G.useCallback)(async i=>{if(await t({title:n(`config:configPage.deleteProviderConnection`),message:n(`config:configPage.deleteNameItsModelSettingsAndAuthenticationDetailsWillAlsoBeRemoved`,{name:i.name}),confirmLabel:n(`config:configPage.delete`)})){l(``);try{let t=await r(`/api/providers/${encodeURIComponent(i.id)}`,{method:`DELETE`});a(t),e(n(`config:configPage.providerConnectionDeleted`))}catch(e){l(Hi(e))}}},[e,t,n])}}function Wi({requestConfirm:e,onImported:t,t:n}){let[i,a]=(0,G.useState)({providers:[],errors:[]}),[o,s]=(0,G.useState)(!0),[c,l]=(0,G.useState)(``),[u,d]=(0,G.useState)(``),[f,p]=(0,G.useState)(``),m=(0,G.useCallback)(async()=>{s(!0),l(``);try{a(await r(`/api/providers/discovery`))}catch(e){l(Hi(e))}finally{s(!1)}},[]);return(0,G.useEffect)(()=>{m()},[m]),{discovery:i,discovering:o,error:c,operationError:u,importing:f,refresh:m,importProvider:(0,G.useCallback)(async i=>{let o=i.source===`codex-config`?`Codex config.toml`:i.source===`claude-config`?`Claude settings.json`:i.source===`codex-auth`?`Codex login`:`Claude login`,s=i.kind===`authentication`;if(await e({title:n(s?`config:configPage.loadLoginState`:`config:configPage.loadProviderConfiguration`),message:n(s?`config:configPage.loadOfficialProviderLoginStateFromSource`:`config:configPage.loadThisProviderConfigurationFromSource`,{source:o}),confirmLabel:n(s?`config:configPage.loadLoginState`:`config:configPage.loadConfiguration`)})){p(i.id),d(``);try{let e=await r(`/api/providers/${encodeURIComponent(i.id)}/import`,{method:`POST`,body:`{}`});a(e.discovery),t(e)}catch(e){d(Hi(e))}finally{p(``)}}},[t,e,n])}}var Gi=`pisper.config.visualConnectionsOpen`;function Ki(){return window.localStorage.getItem(Gi)===`1`}function qi({config:e,notify:t,toggling:n,onToggleProvider:i,onDeleteProvider:a,onQuickSetup:o,onEditVisualProvider:c}){let{t:l}=h(),[u,d]=(0,G.useState)(null),[f,p]=(0,G.useState)(!0),[m,g]=(0,G.useState)(``),[_,v]=(0,G.useState)(!1),[y,b]=(0,G.useState)(null),[x,S]=(0,G.useState)(``),[C,w]=(0,G.useState)(Ki),T=(0,G.useCallback)(async()=>{try{d(await r(`/api/visual/models`)),S(``)}catch(e){S(e instanceof Error?e.message:String(e))}finally{p(!1)}},[]);(0,G.useEffect)(()=>{T()},[T,e]);let E=async(e,n)=>{g(e),S(``);try{d(await r(`/api/visual/models/${e}`,{method:`PUT`,body:JSON.stringify({model:n})})),t(l(`config:configPage.visualModelUpdated`))}catch(e){S(e instanceof Error?e.message:String(e))}finally{g(``)}},D=async()=>{v(!0),S(``),b(null);try{b(await r(`/api/visual/test`,{method:`POST`,body:`{}`})),t(l(`config:configPage.testSucceeded`))}catch(e){S(e instanceof Error?e.message:String(e))}finally{v(!1)}},O=e=>{w(e),window.localStorage.setItem(Gi,e?`1`:`0`)},k=e.providers.filter(e=>e.type===`visual`),A=u?.imageModels||[],j=u?.videoModels||[];return(0,K.jsxs)(`section`,{className:`[margin-top:12px]`,children:[(0,K.jsxs)(X,{className:`[margin-bottom:12px]`,"data-config-card":`models-visual`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-[12px] max-[650px]:grid max-[650px]:grid-cols-[40px_minmax(0,1fr)]`,children:[(0,K.jsx)(`span`,{className:`grid w-[40px] h-[40px] flex-none place-items-center rounded-[11px] bg-[var(--accent-soft)] text-[var(--star-strong)]`,children:(0,K.jsx)(Je,{size:19})}),(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-[3px]`,children:[(0,K.jsx)(`span`,{className:`text-[12px] font-[600] text-[var(--text-muted)]`,children:l(`config:configPage.currentVisualModel`)}),f?(0,K.jsxs)(`span`,{className:`flex items-center gap-[7px] text-[12px] text-[var(--text-muted)]`,children:[(0,K.jsx)(V,{className:`animate-spin`,size:13}),l(`config:configPage.loadingVisualStatus`)]}):u?.image?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-[7px]`,children:[(0,K.jsxs)(`strong`,{className:`overflow-hidden text-ellipsis whitespace-nowrap text-[15px]`,children:[u.image.providerName,` / `,u.image.name]}),(0,K.jsxs)(Z,{tone:`green`,children:[(0,K.jsx)(Qe,{size:11,className:`mr-[3px] inline`}),l(`config:configPage.authenticationReady`)]})]}),u.video&&(0,K.jsxs)(`small`,{className:`text-[12px] text-[var(--text-muted)] [overflow-wrap:anywhere]`,children:[l(`config:configPage.visualVideoModel`),`:`,u.video.providerName,` /`,` `,u.video.name]})]}):(0,K.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-[2px]`,children:[(0,K.jsxs)(`strong`,{className:`flex items-center gap-[6px] text-[14px] text-[var(--warning-strong)]`,children:[(0,K.jsx)(Ir,{size:15}),l(`config:configPage.visualNoneConfigured`)]}),(0,K.jsx)(`small`,{className:`text-[12px] text-[var(--text-muted)]`,children:l(`config:configPage.visualEmptyHint`)})]})]}),(0,K.jsxs)(`div`,{className:`flex min-w-0 max-w-full flex-none flex-wrap items-center gap-[7px] max-[650px]:col-span-full`,children:[u?.image&&(0,K.jsxs)(s,{variant:`outline`,className:`bg-surface-subtle`,disabled:_,onClick:()=>void D(),children:[_?(0,K.jsx)(V,{className:`animate-spin`,size:13}):(0,K.jsx)(ee,{size:13}),l(_?`config:configPage.testingGeneration`:`config:configPage.testGeneration`)]}),(0,K.jsxs)(s,{onClick:o,children:[(0,K.jsx)(M,{size:13}),l(`config:configPage.visualQuickSetup`)]})]})]}),y&&(0,K.jsxs)(`div`,{className:`flex items-center gap-[10px] [margin-top:10px] [border:1px_solid_var(--stroke-soft)] rounded-[var(--r-sm)] bg-[var(--surface-subtle)] p-[8px_10px]`,children:[y.previewDataUrl?(0,K.jsx)(`img`,{src:y.previewDataUrl,alt:y.modelName,className:`h-[44px] w-[44px] flex-none rounded-[var(--r-xs)] object-cover`}):(0,K.jsx)(z,{size:16,className:`flex-none text-[var(--success)]`}),(0,K.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-[1px] text-[12px]`,children:[(0,K.jsx)(`strong`,{className:`text-[var(--success-strong)]`,children:l(`config:configPage.testSucceeded`)}),(0,K.jsxs)(`span`,{className:`overflow-hidden text-ellipsis whitespace-nowrap text-[var(--text-muted)]`,children:[y.providerName,` / `,y.modelName,` · `,y.path]})]})]})]}),(0,K.jsxs)(F,{open:C,onOpenChange:O,children:[(0,K.jsx)(P,{asChild:!0,children:(0,K.jsxs)(`button`,{type:`button`,className:`group flex w-full cursor-pointer items-center gap-[7px] border-0 bg-transparent p-[4px_2px] text-left`,children:[(0,K.jsx)(oe,{size:15,className:`flex-none text-[var(--text-muted)] transition-transform group-data-[state=closed]:-rotate-90`}),(0,K.jsx)(`span`,{className:`shrink-0 text-[13px] font-[700] text-[var(--text-secondary)]`,children:l(`config:configPage.visualConnections`)}),(0,K.jsx)(`span`,{className:`min-w-0 text-[12px] text-[var(--text-tertiary)]`,children:l(`config:configPage.visualConnectionsHint`)})]})}),(0,K.jsx)(N,{children:(0,K.jsxs)(X,{children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-[8px]`,children:[k.map(e=>{let t=Ei[e.id]||We,r=e.configured?e.enabled?l(`config:configPage.authenticationReady`):l(`config:configPage.disabled2`):l(`config:configPage.apiKeyRequired`);return(0,K.jsxs)(`div`,{role:`button`,tabIndex:0,title:l(`config:configPage.configure`),className:`flex min-w-0 cursor-pointer items-center gap-[8px] [border:1px_solid_var(--stroke-soft)] rounded-[var(--r-sm)] bg-[var(--surface-subtle)] p-[9px_11px] hover:border-[var(--accent-border)] hover:bg-[var(--accent-soft)] focus-visible:outline-2 focus-visible:outline-[var(--focus)] max-[650px]:grid max-[650px]:grid-cols-[30px_minmax(0,1fr)_auto]`,onClick:()=>c(e.id),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),c(e.id))},children:[(0,K.jsx)(`span`,{className:`grid w-[30px] h-[30px] flex-none place-items-center rounded-[var(--r-sm)] bg-[var(--accent-soft)] text-[var(--star-strong)]`,children:(0,K.jsx)(t,{size:16})}),(0,K.jsx)(`strong`,{className:`min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-[13px]`,children:e.name}),(0,K.jsx)(`small`,{className:`min-w-0 flex-none text-[12px] text-[var(--text-muted)] max-[650px]:col-start-2 max-[650px]:row-start-2`,children:r}),(0,K.jsxs)(`div`,{className:`flex flex-none items-center gap-[6px] max-[650px]:col-start-3 max-[650px]:row-span-2 max-[650px]:row-start-1`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:[(0,K.jsx)(ti,{value:e.configured&&e.enabled,disabled:!e.configured||n===e.id,onChange:t=>i(e,t)}),e.custom&&(0,K.jsx)(s,{variant:`destructive`,size:`icon`,className:`h-[26px] w-[26px]`,title:l(`config:configPage.deleteProvider`),onClick:()=>a(e),children:(0,K.jsx)(xe,{size:13})})]})]},e.id)}),k.length===0&&(0,K.jsx)(`p`,{className:`[margin:2px_0_0] text-[12px] text-[var(--text-muted)]`,children:l(`config:configPage.visualEmptyHint`)})]}),(A.length>0||j.length>0)&&(0,K.jsxs)(`div`,{className:`flex flex-col gap-[8px] [border-top:1px_solid_var(--stroke-soft)] [margin-top:10px] pt-[10px]`,children:[A.length>0&&(0,K.jsxs)(`div`,{className:`flex items-center gap-[8px]`,children:[(0,K.jsx)(`span`,{className:`w-[64px] flex-none text-[12px] text-[var(--text-muted)]`,children:l(`config:configPage.visualImageModel`)}),(0,K.jsxs)(L,{className:`min-w-0 flex-1`,value:u?.imageSelection||``,disabled:m===`image`,"aria-label":l(`config:configPage.visualImageModel`),onChange:e=>void E(`image`,e.target.value),children:[(0,K.jsx)(`option`,{value:``,children:l(`config:configPage.visualAutoSelected`)}),A.map(e=>(0,K.jsxs)(`option`,{value:`${e.providerId}/${e.id}`,children:[e.providerName,` · `,e.name]},`${e.providerId}/${e.id}`))]})]}),j.length>0&&(0,K.jsxs)(`div`,{className:`flex items-center gap-[8px]`,children:[(0,K.jsx)(`span`,{className:`w-[64px] flex-none text-[12px] text-[var(--text-muted)]`,children:l(`config:configPage.visualVideoModel`)}),(0,K.jsxs)(L,{className:`min-w-0 flex-1`,value:u?.videoSelection||``,disabled:m===`video`,"aria-label":l(`config:configPage.visualVideoModel`),onChange:e=>void E(`video`,e.target.value),children:[(0,K.jsx)(`option`,{value:``,children:l(`config:configPage.visualAutoSelected`)}),j.map(e=>(0,K.jsxs)(`option`,{value:`${e.providerId}/${e.id}`,children:[e.providerName,` · `,e.name]},`${e.providerId}/${e.id}`))]})]}),(0,K.jsx)(`small`,{className:`text-[11px] text-[var(--text-tertiary)]`,children:l(`config:configPage.visualModelsAreSelectedByTheVisualGenerationToolAndDoNotAppearInTheChatModelList`)})]})]})})]}),x&&(0,K.jsx)(`div`,{className:`[margin-top:10px]`,children:(0,K.jsxs)(U,{children:[(0,K.jsx)(H,{size:13}),x]})})]})}var Ji=`pisper.config.manageConnectionsOpen`;function Yi(){let e=window.localStorage.getItem(Ji);return e===`1`||e!==`0`&&null}function Xi({notify:e,registerPrimaryAction:t,requestConfirm:n}){let{t:r}=h(),[i,a]=(0,G.useState)(null),[o,s]=(0,G.useState)(null),[c,l]=(0,G.useState)(Yi),u=Ui({notify:e,requestConfirm:n,t:r}),{config:d}=u,f=Wi({requestConfirm:n,onImported:t=>{u.applyConfig(t.config);let n=t.config.providers.find(e=>e.id===t.providerId);e(t.kind===`authentication`?r(`config:configPage.nameLoginStateHasBeenLoadedIntoPisper`,{name:n?.name||t.providerId}):r(`config:configPage.nameConfigurationHasBeenLoadedIntoPisper`,{name:n?.name||t.providerId}))},t:r});if(bt(t,()=>a({providerType:`chat`})),!d)return(0,K.jsxs)(nt,{children:[(0,K.jsx)(V,{className:`animate-spin`,size:24}),(0,K.jsx)(`h2`,{children:r(`config:configPage.loadingModelCatalog`)}),(0,K.jsx)(`p`,{children:r(`config:configPage.readingProvidersAndAuthenticationStatus`)}),u.error&&(0,K.jsx)(U,{children:u.error})]});let p=d.defaultProvider||d.provider,m=d.providers.find(e=>e.id===p),g=c??!1,_=e=>{l(e),window.localStorage.setItem(Ji,e?`1`:`0`)},v=e=>a({providerId:e.id,providerType:e.type});return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Oi,{config:d,onQuickSetup:()=>a({providerType:`chat`}),onChangeModel:()=>m?v(m):a({providerType:`chat`})}),(0,K.jsxs)(F,{open:g,onOpenChange:_,"data-config-card":`models-connections`,children:[(0,K.jsx)(P,{asChild:!0,children:(0,K.jsxs)(`button`,{type:`button`,className:`group flex w-full cursor-pointer items-center gap-[7px] [margin:2px_0_10px] border-0 bg-transparent p-[4px_2px] text-left`,children:[(0,K.jsx)(oe,{size:15,className:`shrink-0 text-[var(--text-muted)] transition-transform group-data-[state=closed]:-rotate-90`}),(0,K.jsx)(`span`,{className:`shrink-0 text-[13px] font-[700] text-[var(--text-secondary)]`,children:r(`config:configPage.manageConnections`)}),(0,K.jsx)(`span`,{className:`min-w-0 text-[12px] text-[var(--text-tertiary)]`,children:r(`config:configPage.manageConnectionsHint`)})]})}),(0,K.jsxs)(N,{children:[(0,K.jsx)(Li,{discovery:f.discovery,discovering:f.discovering,error:f.error||f.operationError,importing:f.importing,onRefresh:f.refresh,onImport:f.importProvider}),(0,K.jsx)(Di,{providers:d.providers,defaultProviderId:p,toggling:u.toggling,onConfigure:e=>v(e),onToggle:u.toggleProvider,onDelete:u.deleteProvider,onAddCustom:()=>s({providerType:`chat`})}),u.error&&(0,K.jsx)(U,{children:u.error}),(0,K.jsx)(`div`,{className:`[margin-top:12px]`,children:(0,K.jsx)(Vi,{config:d,notify:e,onConfigChanged:u.applyConfig})})]})]}),(0,K.jsx)(qi,{config:d,notify:e,toggling:u.toggling,onToggleProvider:u.toggleProvider,onDeleteProvider:u.deleteProvider,onQuickSetup:()=>a({providerType:`visual`}),onEditVisualProvider:e=>{let t=d.providers.find(t=>t.id===e);t&&s({providerType:`visual`,provider:t})}}),i&&(0,K.jsx)(Bi,{config:d,providerType:i.providerType||`chat`,initialProviderId:i.providerId,onClose:()=>a(null),onCompleted:t=>{u.applyConfig(t),e(r(`config:configPage.setupComplete`)),a(null)}}),o&&(0,K.jsx)(Ai,{initialProviderType:o.providerType,initialProvider:o.provider,onClose:()=>s(null),onCreated:t=>{u.applyConfig(t),o.provider?e(r(`config:configPage.providerConnectionUpdated`)):e(r(`config:configPage.providerConnectionCreated`)),s(null)}})]})}function Q(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)}function Zi(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n}var Qi,$,$i,ea,ta=`__TAURI_TO_IPC_KEY__`;function na(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}var ra=class{constructor(e){Qi.set(this,void 0),$.set(this,0),$i.set(this,[]),ea.set(this,void 0),Zi(this,Qi,e||(()=>{}),`f`),this.id=na(e=>{let t=e.index;if(`end`in e){t==Q(this,$,`f`)?this.cleanupCallback():Zi(this,ea,t,`f`);return}let n=e.message;if(t==Q(this,$,`f`)){for(Q(this,Qi,`f`).call(this,n),Zi(this,$,Q(this,$,`f`)+1,`f`);Q(this,$,`f`)in Q(this,$i,`f`);){let e=Q(this,$i,`f`)[Q(this,$,`f`)];Q(this,Qi,`f`).call(this,e),delete Q(this,$i,`f`)[Q(this,$,`f`)],Zi(this,$,Q(this,$,`f`)+1,`f`)}Q(this,$,`f`)===Q(this,ea,`f`)&&this.cleanupCallback()}else Q(this,$i,`f`)[t]=n})}cleanupCallback(){window.__TAURI_INTERNALS__.unregisterCallback(this.id)}set onmessage(e){Zi(this,Qi,e,`f`)}get onmessage(){return Q(this,Qi,`f`)}[(Qi=new WeakMap,$=new WeakMap,$i=new WeakMap,ea=new WeakMap,ta)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[ta]()}};function ia(e,t){let n=window.__TAURI__?.core?.invoke??window.__TAURI_INTERNALS__?.invoke;return n?n(e,t):Promise.reject(Error(`native bridge unavailable`))}function aa(e,t){return ia(`plugin:barcode-scanner|${e}`,t)}function oa(e){return e instanceof Error?e.message:String(e)}function sa(e){return/cancel(?:led|ed)/i.test(oa(e))}function ca(){return new Promise(e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))})}function la(e){return Array.isArray(e)?new TextDecoder().decode(Uint8Array.from(e)):``}function ua(e){if(!e.isActive||!e.port)return null;let t=la(e.txt.fp);if(!/^SHA256:[0-9A-F]{64}$/i.test(t))return null;let n=e.addresses.find(e=>/^\d{1,3}(?:\.\d{1,3}){3}$/.test(e))||e.addresses.find(e=>e.includes(`:`));if(!n)return null;let r=n.includes(`:`)?`[${n}]`:n,i=la(e.txt.name)||e.name||`Pisper Desktop`,a=`https://${r}:${e.port}`;return{id:`${e.fullName}:${a}`,name:i,url:a,fingerprint:t}}function da(e){return new Promise(t=>window.setTimeout(t,e))}function fa({open:e,onOpenChange:t}){let{t:n}=h(),[r,i]=(0,G.useState)(null),[a,o]=(0,G.useState)(!1),[c,l]=(0,G.useState)([]),[u,d]=(0,G.useState)(!1),[f,p]=(0,G.useState)(``),[m,g]=(0,G.useState)(``),[_,v]=(0,G.useState)(``),y=(0,G.useRef)(!1),b=(0,G.useRef)(!1),x=(0,G.useRef)(!1),S=(0,G.useRef)(0),C=(0,G.useRef)(``),w=(0,G.useCallback)(e=>{y.current=e,o(e)},[]),T=(0,G.useCallback)(async()=>{b.current=!0,y.current&&await aa(`cancel`).catch(()=>void 0),w(!1),i(null)},[w]);(0,G.useEffect)(()=>{if(!a)return;let e=document.getElementById(`root`),t=[],n=(e,n,r)=>{e&&(t.push({element:e,property:n,value:e.style.getPropertyValue(n),priority:e.style.getPropertyPriority(n)}),e.style.setProperty(n,r,`important`))};return n(document.documentElement,`background`,`transparent`),n(document.body,`background`,`transparent`),n(e,`background`,`transparent`),n(e,`visibility`,`hidden`),()=>{for(let{element:e,property:n,value:r,priority:i}of t.reverse())r?e.style.setProperty(n,r,i):e.style.removeProperty(n)}},[a]),(0,G.useEffect)(()=>{if(!a)return;let e=`pisper-scanner-${Date.now()}`;window.history.pushState({...window.history.state,pisperScanner:e},``);let t=()=>void T();return window.addEventListener(`popstate`,t),()=>{window.removeEventListener(`popstate`,t),!x.current&&window.history.state?.pisperScanner===e&&window.history.back()}},[T,a]);let E=e=>{if(!e.proxyUrl)throw Error(n(`config:mobileServer.pairFailed`));window.location.replace(e.proxyUrl)},D=(0,G.useCallback)(async()=>{let e=++S.current;d(!0),p(``),l([]);let t=new ra;t.onmessage=t=>{if(S.current!==e)return;if(t.reason===`permission-denied`){p(n(`config:mobileServer.localNetworkDenied`));return}if(t.reason?.startsWith(`error:`)){p(n(`config:mobileServer.discoveryFailed`));return}if(!t.service)return;if(!t.service.isActive){l(e=>e.filter(e=>!e.id.startsWith(`${t.service?.fullName}:`)));return}let r=ua(t.service);r&&l(e=>[...e.filter(e=>e.fingerprint!==r.fingerprint),r])};let r=null;try{await ia(`mobile_ensure_local_network_permission`),r=(await ia(`plugin:dns-sd|browse_start`,{options:{service:{type:`pisper`,protocol:`tcp`,domain:`local`},timeoutMs:4e3},channel:t})).browseId,await da(4300)}catch(t){S.current===e&&p(oa(t).includes(`local_network_permission_denied`)?n(`config:mobileServer.localNetworkDenied`):n(`config:mobileServer.discoveryFailed`))}finally{r!==null&&await ia(`plugin:dns-sd|browse_stop`,{browseId:r}).catch(()=>void 0),S.current===e&&d(!1)}},[n]);(0,G.useEffect)(()=>{if(!(!e||a))return D(),()=>{S.current+=1}},[D,e,a]);let O=(0,G.useCallback)(async()=>{let e=C.current;C.current=``,e&&await ia(`mobile_cancel_lan_pairing`,{operationId:e}).catch(()=>void 0),i(null),g(``)},[]),k=async e=>{let t=globalThis.crypto?.randomUUID?.()||`lan-${Date.now()}-${Math.random().toString(16).slice(2)}`;C.current=t,i(`lan:${e.id}`),v(``),g(n(`config:mobileServer.awaitingApproval`,{name:e.name}));try{let n=await ia(`mobile_pair_lan`,{operationId:t,name:e.name,url:e.url,fingerprint:e.fingerprint,deviceName:null});if(C.current!==t)return;E(n)}catch(e){C.current===t&&v(oa(e))}finally{C.current===t&&(C.current=``,i(null),g(``))}},A=async()=>{b.current=!1,x.current=!1,i(`scan`),v(``);try{let e=await aa(`check_permissions`);if(e.camera!==`granted`&&(e=await aa(`request_permissions`)),e.camera!==`granted`)throw Error(n(`config:mobileServer.cameraDenied`));if(b.current||(w(!0),await ca(),b.current))return;let t=await aa(`scan`,{windowed:!0,formats:[]});if(!t.content)throw Error(n(`config:mobileServer.scanFailed`));x.current=!0,E(await ia(`mobile_pair`,{payloadJson:t.content,deviceName:null}))}catch(e){!b.current&&!sa(e)&&v(oa(e))}finally{w(!1),i(null),b.current=!1}};return(0,K.jsx)(Ze,{open:e,onOpenChange:e=>{if(!e&&a){T();return}if(!e&&r?.startsWith(`lan:`)){O(),t(!1);return}r||(e||v(``),t(e))},children:(0,K.jsx)(we,{showCloseButton:!a,overlayClassName:a?`bg-transparent supports-backdrop-filter:backdrop-blur-none`:void 0,className:a?`inset-0 top-0 left-0 h-dvh max-h-none w-screen max-w-none translate-x-0 translate-y-0 gap-0 overflow-hidden rounded-none bg-transparent p-0 text-white ring-0 sm:max-w-none`:`sm:max-w-md`,onPointerDownOutside:a?e=>e.preventDefault():void 0,children:a?(0,K.jsxs)(`div`,{className:`flex h-dvh w-screen flex-col overflow-hidden`,children:[(0,K.jsxs)(Fe,{className:`sr-only`,children:[(0,K.jsx)(Re,{children:n(`config:mobileServer.scanTitle`)}),(0,K.jsx)(Ye,{children:n(`config:mobileServer.scanHint`)})]}),(0,K.jsxs)(`header`,{className:`flex min-h-16 items-center justify-between gap-3 bg-black/60 px-4 pb-3`,style:{paddingTop:`max(env(safe-area-inset-top), 0.75rem)`},children:[(0,K.jsxs)(s,{variant:`ghost`,className:`h-10 bg-black/40 px-3 text-white hover:bg-black/70 hover:text-white`,onClick:()=>void T(),children:[(0,K.jsx)(ze,{}),n(`config:mobileServer.cancelScan`)]}),(0,K.jsx)(`div`,{className:`min-w-0 truncate text-sm font-medium`,children:n(`config:mobileServer.scanTitle`)}),(0,K.jsx)(`div`,{className:`w-[88px]`,"aria-hidden":`true`})]}),(0,K.jsx)(`main`,{className:`grid min-h-0 flex-1 place-items-center p-6`,children:(0,K.jsx)(`div`,{className:`relative aspect-square w-[min(72vw,20rem)] rounded-md border-2 border-white/90 shadow-[0_0_0_9999px_rgba(0,0,0,0.18)]`,children:(0,K.jsx)(Jr,{className:`absolute top-1/2 left-1/2 size-10 -translate-x-1/2 -translate-y-1/2 text-white/75`})})}),(0,K.jsxs)(`footer`,{className:`flex flex-col items-center gap-3 bg-black/60 px-5 pt-4 text-center`,style:{paddingBottom:`max(env(safe-area-inset-bottom), 1rem)`},children:[(0,K.jsx)(`p`,{className:`max-w-sm text-sm leading-relaxed text-white/90`,children:n(`config:mobileServer.scanHint`)}),(0,K.jsx)(s,{variant:`outline`,className:`w-full max-w-sm border-white/50 bg-black/30 text-white hover:bg-black/60 hover:text-white`,onClick:()=>void T(),children:n(`config:mobileServer.cancelScan`)})]})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(Fe,{children:[(0,K.jsx)(Re,{children:n(`config:mobileServer.addServer`)}),(0,K.jsx)(Ye,{children:n(`config:mobileServer.discoverDescription`)})]}),(0,K.jsxs)(`section`,{className:`grid gap-2`,"aria-live":`polite`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,K.jsx)(Kr,{className:`size-4`}),n(`config:mobileServer.nearby`)]}),(0,K.jsx)(s,{size:`icon-sm`,variant:`ghost`,disabled:u||r!==null,"aria-label":n(`config:mobileServer.rediscover`),onClick:()=>void D(),children:(0,K.jsx)(V,{className:u?`animate-spin`:void 0})})]}),c.length?(0,K.jsx)(`ul`,{className:`grid max-h-44 gap-1.5 overflow-y-auto`,children:c.map(e=>{let t=r===`lan:${e.id}`;return(0,K.jsxs)(`li`,{className:`flex min-h-12 items-center justify-between gap-3 rounded-md border px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,K.jsx)(We,{className:`size-4 flex-none text-muted-foreground`}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`div`,{className:`truncate text-sm`,children:e.name}),(0,K.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:e.url})]})]}),(0,K.jsxs)(s,{size:`sm`,disabled:r!==null,onClick:()=>void k(e),children:[t?(0,K.jsx)(le,{className:`animate-spin`}):null,n(`config:mobileServer.requestConnect`)]})]},e.id)})}):(0,K.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:n(u?`config:mobileServer.discovering`:`config:mobileServer.noNearby`)}),f?(0,K.jsx)(`p`,{className:`text-xs leading-relaxed text-destructive`,children:f}):null,m?(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md bg-muted px-3 py-2`,children:[(0,K.jsx)(`p`,{className:`text-xs leading-relaxed`,children:m}),(0,K.jsx)(s,{size:`sm`,variant:`outline`,onClick:()=>void O(),children:n(`config:mobileServer.cancelRequest`)})]}):null]}),(0,K.jsxs)(`div`,{className:`relative py-1`,children:[(0,K.jsx)(R,{}),(0,K.jsx)(`span`,{className:`absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-popover px-2 text-xs text-muted-foreground`,children:n(`config:mobileServer.otherMethods`)})]}),(0,K.jsxs)(s,{className:`w-full`,disabled:r!==null,onClick:()=>void A(),children:[r===`scan`?(0,K.jsx)(le,{className:`animate-spin`}):(0,K.jsx)(Gr,{}),n(`config:mobileServer.scan`)]}),_?(0,K.jsx)(`p`,{className:`text-xs leading-relaxed text-destructive`,children:_}):null]})})})}function pa(e,t){let n=window.__TAURI__?.core?.invoke??window.__TAURI_INTERNALS__?.invoke;return n?n(e,t):Promise.reject(Error(`native bridge unavailable`))}function ma({requestConfirm:e}){let{t}=h(),[n,r]=(0,G.useState)(null),[i,a]=(0,G.useState)(``),[o,c]=(0,G.useState)(``),[l,u]=(0,G.useState)(!1),d=(0,G.useCallback)(async()=>{try{r(await pa(`mobile_state`)),a(``)}catch{a(t(`config:mobileServer.loadFailed`))}},[t]);(0,G.useEffect)(()=>{d()},[d]);let f=async(e,t,n=``)=>{c(n||e);try{r(await pa(e,t)),a(``)}catch(e){a(String(e))}finally{c(``)}},p=async n=>{o||await e({title:t(`config:mobileServer.forget`),message:t(`config:mobileServer.forgetConfirm`),confirmLabel:t(`config:mobileServer.forget`),tone:`danger`})&&await f(`mobile_forget_server`,{id:n.id},n.id)},m=async e=>{c(e);try{let t=await pa(`mobile_select_server`,{id:e});r(t),a(``),t.proxyUrl&&window.location.replace(t.proxyUrl)}catch(e){a(String(e))}finally{c(``)}},g=n?.mode===`local`,_=n?.mode===`remote`&&!!n.activeId,v=g||_,y=t(g?`config:mobileServer.currentLocal`:_?`config:mobileServer.current`:`config:mobileServer.empty`);return(0,K.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex min-h-10 items-center gap-2 rounded-[var(--r-sm)] border px-3 py-2 text-[12px] ${v?`border-[var(--success)] bg-[var(--success-soft)] text-[var(--success-strong)]`:`border-[var(--stroke)] bg-[var(--surface-subtle)] text-[var(--text-muted)]`}`,role:`status`,"aria-live":`polite`,children:[(0,K.jsx)(v?Qe:Ir,{size:15,"aria-hidden":`true`}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:y}),n?.activeTransport?(0,K.jsx)(`span`,{className:`flex-none text-[11px] opacity-80`,children:n.activeTransport===`iroh`?t(`config:mobileServer.transportP2p`):t(`config:mobileServer.transportLan`)}):null]}),(0,K.jsx)(fa,{open:l,onOpenChange:u}),(0,K.jsxs)(X,{className:`flex flex-col gap-3 p-4`,"data-config-card":`mobile-server-main`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-[11px]`,children:[(0,K.jsx)(`span`,{className:`grid size-[38px] flex-none place-items-center rounded-[var(--r-sm)] bg-[var(--star-soft)] text-[var(--star-strong)]`,children:(0,K.jsx)(Ee,{size:19})}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h2`,{className:`text-[16px]`,children:t(`config:mobileServer.title`)}),(0,K.jsx)(`p`,{className:`mt-1 text-[13px] leading-[1.55] text-[var(--text-muted)]`,children:t(`config:mobileServer.description`)})]})]}),(0,K.jsxs)(s,{size:`sm`,className:`max-[650px]:h-10 max-[650px]:px-3`,onClick:()=>u(!0),children:[(0,K.jsx)(lt,{size:14}),t(`config:mobileServer.addServer`)]})]}),i?(0,K.jsx)(`p`,{className:`text-[12px] text-[var(--danger)]`,children:i}):null]}),(0,K.jsx)(X,{className:`flex flex-col gap-3 p-4`,"data-config-card":`mobile-server-local`,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 basis-48 items-start gap-[11px]`,children:[(0,K.jsx)(`span`,{className:`grid size-[38px] flex-none place-items-center rounded-[var(--r-sm)] bg-[var(--star-soft)] text-[var(--star-strong)]`,children:(0,K.jsx)(Yr,{size:19})}),(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`h2`,{className:`flex flex-wrap items-center gap-2 text-[16px]`,children:[t(`config:mobileServer.localTitle`),g?(0,K.jsx)(`span`,{className:`text-[11px] text-[var(--star-strong)]`,children:t(`config:mobileServer.currentLocal`)}):null]}),(0,K.jsx)(`p`,{className:`mt-1 text-[13px] leading-[1.55] text-[var(--text-muted)]`,children:t(`config:mobileServer.localDescription`)})]})]}),(0,K.jsx)(s,{size:`sm`,variant:`outline`,className:`flex-none max-[650px]:h-10 max-[650px]:px-3`,disabled:g||!!o,onClick:()=>void(async()=>{c(`mobile_enter_local`);try{let e=await pa(`mobile_enter_local`);e.onDevice.url&&window.location.replace(e.onDevice.url)}catch(e){a(String(e))}finally{c(``)}})(),children:t(g?`config:mobileServer.currentLocal`:`config:mobileServer.enterLocal`)})]})}),(0,K.jsx)(X,{className:`flex flex-col gap-3 p-4`,children:n?.servers?.length?(0,K.jsx)(`ul`,{className:`flex flex-col gap-2`,children:n.servers.map(e=>{let r=n.mode===`remote`&&e.id===n.activeId,i=e.endpoints.find(e=>e.url),a=e.endpoints.find(e=>e.t===`iroh`),c=i?.url||(a?.nodeId?`Iroh ${a.nodeId.slice(0,12)}`:`Iroh`);return(0,K.jsxs)(`li`,{className:`flex items-center justify-between gap-3 rounded-[var(--r-sm)] border border-[var(--border)] px-3 py-2 max-[650px]:items-start max-[650px]:flex-wrap`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,K.jsx)(We,{size:15,className:`flex-none text-[var(--text-muted)]`}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsxs)(`div`,{className:`truncate text-[13px]`,children:[e.name,r?(0,K.jsx)(`span`,{className:`ml-2 text-[11px] text-[var(--star-strong)]`,children:t(`config:mobileServer.current`)}):null]}),(0,K.jsxs)(`div`,{className:`truncate text-[11px] text-[var(--text-muted)]`,children:[c,(0,K.jsx)(`span`,{className:`ml-2`,children:t(i&&a?`config:mobileServer.transportLanP2p`:a?`config:mobileServer.transportP2p`:`config:mobileServer.transportLan`)})]}),r&&n.activeTransport?(0,K.jsx)(`div`,{className:`text-[11px] text-[var(--star-strong)]`,children:t(`config:mobileServer.activeTransport`,{transport:n.activeTransport===`iroh`?t(`config:mobileServer.transportP2p`):t(`config:mobileServer.transportLan`)})}):null]})]}),(0,K.jsxs)(`div`,{className:`flex flex-none items-center gap-1`,children:[r?null:(0,K.jsx)(s,{size:`sm`,variant:`ghost`,className:`max-[650px]:h-10 max-[650px]:px-3`,disabled:o===e.id,onClick:()=>void m(e.id),children:t(`config:mobileServer.connect`)}),(0,K.jsx)(s,{size:`sm`,variant:`ghost`,className:`max-[650px]:size-10`,"aria-label":t(`config:mobileServer.forget`),title:t(`config:mobileServer.forget`),disabled:!!o,onClick:()=>void p(e),children:(0,K.jsx)(xe,{size:14})})]})]},e.id)})}):(0,K.jsx)(`p`,{className:`text-[12px] text-[var(--text-muted)]`,children:t(`config:mobileServer.empty`)})})]})}var ha={feishu:{tone:`blue`},weixin:{tone:`green`},qq:{tone:`blue`},telegram:{tone:`blue`},browser:{tone:`blue`}};function ga(e,t){return t(e===`feishu`?`config:notificationSettings.feishu`:e===`weixin`?`config:notificationSettings.weChat`:e===`qq`?`config:notificationSettings.qq`:e===`telegram`?`config:notificationSettings.telegram`:`config:notificationSettings.browserNotification`)}function _a(e,t,n){return e===`chat.completed`?n(`config:notificationSettings.chatCompleted`):e===`chat.waiting`?n(`config:notificationSettings.chatWaiting`):e===`schedule.completed`?n(`config:notificationSettings.scheduleCompleted`):e===`schedule.failed`?n(`config:notificationSettings.scheduleFailed`):e===`workflow.completed`?n(`config:notificationSettings.workflowCompleted`):e===`workflow.failed`?n(`config:notificationSettings.workflowFailed`):t}function va(e,t,n){return e===`chat.completed`?n(`config:notificationSettings.chatCompletedDescription`):e===`chat.waiting`?n(`config:notificationSettings.chatWaitingDescription`):e===`schedule.completed`?n(`config:notificationSettings.scheduleCompletedDescription`):e===`schedule.failed`?n(`config:notificationSettings.scheduleFailedDescription`):e===`workflow.completed`?n(`config:notificationSettings.workflowCompletedDescription`):e===`workflow.failed`?n(`config:notificationSettings.workflowFailedDescription`):t}function ya(e,t){let n={"chat.title":t(`config:notificationSettings.fixChannelNotification`),"chat.summary":t(`config:notificationSettings.implementationIsCompleteTestsAndBuildHavePassed`),"chat.tool":`bash`,"chat.reason":t(`config:notificationSettings.confirmationIsRequired`),"chat.model":`openai/gpt-5.4`,"task.name":t(`config:notificationSettings.dailyCodeReview`),"task.summary":t(`config:notificationSettings.found2IssuesToAddressTheReportHasBeenArchived`),"task.duration":t(`config:notificationSettings.message2Min18Sec`),"task.nextRun":t(`config:notificationSettings.tomorrow0900`),"task.error":t(`config:notificationSettings.testProcessTimedOut`),"workflow.name":t(`config:notificationSettings.preReleaseChecks`),"workflow.summary":t(`config:notificationSettings.testsBuildAndSecurityChecksHaveAllPassed`),"workflow.duration":t(`config:notificationSettings.message6Min42Sec`),"workflow.runId":`run_20260718_001`,"workflow.node":t(`config:notificationSettings.endToEndTests`),"workflow.error":t(`config:notificationSettings.browserFailedToStart`)};return String(e||``).replace(/\{\{\s*([\w.]+)\s*\}\}/g,(e,t)=>n[t]||`{{${t}}}`)}function ba(){return typeof window<`u`&&window.pisperDesktop?.showNotification?window.pisperDesktop.getNotificationStatus?`checking`:`granted`:typeof window<`u`&&at()?`checking`:st()}function xa(e,t){return t(e===`system-disabled`||e===`app-disabled`?`config:notificationSettings.systemNotificationsAreOffAllowPisperToSendNotificationsInYourOperatingSystemSettings`:e===`unsupported`?`config:notificationSettings.systemNotificationsAreNotSupportedInThisEnvironment`:`config:notificationSettings.theOperatingSystemDidNotAcceptTheNotificationCheckYourSystemNotificationSettings`)}function Sa(e){return e instanceof Error?e.message:String(e)}function Ca({notify:e,onBrowserNotificationChange:t}){let{t:n}=h(),[i,a]=(0,G.useState)({browser:{enabled:!1},connections:{},scopes:[],templates:[]}),[o,c]=(0,G.useState)(!0),[l,u]=(0,G.useState)(``),d=!!window.pisperDesktop?.showNotification,f=at(),[p,m]=(0,G.useState)(ba),[g,_]=(0,G.useState)(!1),v=(0,G.useCallback)(async()=>{if(!d)return;let e=window.pisperDesktop?.getNotificationStatus;if(!e){m(`granted`);return}try{let t=await e(),n=t?.permission;m(n==="default"||n===`denied`||n===`granted`||n===`checking`||n===`unsupported`?n:t?.supported===!1?`unsupported`:`granted`)}catch{m(`unsupported`)}},[d]),y=(0,G.useCallback)(async()=>{try{u(``);let e=await r(`/api/settings/notifications`);a(e),t?.(e)}catch(e){u(Sa(e))}finally{c(!1)}},[t]);(0,G.useEffect)(()=>{y()},[y]),(0,G.useEffect)(()=>{if(!d)return;v();let e=()=>{v()};return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},[d,v]);let b=(0,G.useCallback)(async()=>{if(!(d||!f))try{let e=await ut();m(e===!0?`granted`:e===!1?`denied`:`default`)}catch{m(`unsupported`)}},[d,f]);(0,G.useEffect)(()=>{if(d||!f)return;b();let e=()=>void b();return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},[d,f,b]);let x=async i=>{let o=``;if(i){if(d&&p!==`granted`)o=xa(`system-disabled`,n);else if(!d&&f){let e=`denied`;try{let t=await ut()===!0?`granted`:await ct();e=t===`granted`?`granted`:t===`denied`?`denied`:`default`}catch{e=`unsupported`}m(e),e!==`granted`&&(o=n(`config:notificationSettings.systemNotificationsAreOffAllowPisperToSendNotificationsInYourOperatingSystemSettings`))}else if(!d){let e=await ke();if(m(e),e!==`granted`)o=n(e===`unsupported`?`config:notificationSettings.systemNotificationsAreNotSupportedInThisEnvironment`:`config:notificationSettings.notificationPermissionWasNotGrantedAllowNotificationsInTheBrowserSiteSettings`);else try{await He()}catch{o=n(`config:notificationSettings.theBrowserBackgroundNotificationServiceCouldNotBeRegistered`)}}}_(!0);try{let s=await r(`/api/settings/notifications/browser`,{method:`PATCH`,body:JSON.stringify({enabled:i})});a(s),t?.(s),o?e(n(`config:notificationSettings.savedButLocalDeliveryUnavailable`,{reason:o}),`info`):e(n(i?`config:notificationSettings.notificationsEnabled`:`config:notificationSettings.notificationsDisabled`))}catch(t){e(Sa(t),`error`)}finally{_(!1)}},S=(0,G.useCallback)(async(e,t,r=`pisper-browser-test`)=>{if(d){let r=window.pisperDesktop?.showNotification;if(!r)throw Error(n(`config:notificationSettings.systemNotificationsAreNotSupportedInThisEnvironment`));let i=await r({title:e,body:t});if(i&&typeof i==`object`&&i.shown===!1)throw m(i.permission??`denied`),Error(xa(i.reason,n));return i}return f?(await Ke(e,t),{shown:!0,transport:`tauri`}):De({title:e,body:t,tag:r,url:window.location.href})},[d,f,n]),C=async()=>{if(p!==`granted`){e(p===`unsupported`?xa(`unsupported`,n):d?xa(`system-disabled`,n):n(`config:notificationSettings.notificationPermissionWasNotGrantedAllowNotificationsInTheBrowserSiteSettings`),`error`);return}try{await S(n(`config:notificationSettings.appNotificationTest`,{app:St}),n(`config:notificationSettings.notificationsAreWorking`)),e(n(`config:notificationSettings.theTestNotificationWasSentCheckYourSystemNotificationCenter`),`info`)}catch(t){e(Sa(t)||n(`config:notificationSettings.theOperatingSystemDidNotAcceptTheNotificationCheckYourSystemNotificationSettings`),`error`)}},w=async()=>{try{await window.pisperDesktop?.openNotificationSettings?.()||e(n(`config:notificationSettings.openNotificationPermissionsInYourOperatingSystemSettings`),`info`)}catch{e(n(`config:notificationSettings.openNotificationPermissionsInYourOperatingSystemSettings`),`info`)}};if(o)return(0,K.jsxs)(nt,{children:[(0,K.jsx)(V,{className:`animate-spin`,size:23}),(0,K.jsx)(`h2`,{children:n(`config:notificationSettings.loadingNotificationSettings`)})]});let T=n(p===`granted`?`config:notificationSettings.permissionGranted`:p===`denied`?d?`config:notificationSettings.systemNotificationsAreOff`:`config:notificationSettings.browserNotificationsAreBlocked`:p===`unsupported`?`config:notificationSettings.notSupported`:p===`checking`?`config:notificationSettings.checking`:`config:notificationSettings.waitingForPermission`),E=p===`granted`?`green`:p==="default"||p===`checking`?`amber`:`red`;return(0,K.jsxs)(`div`,{className:`flex flex-col gap-[12px]`,children:[l&&(0,K.jsxs)(U,{children:[(0,K.jsx)(H,{size:13}),l]}),(0,K.jsxs)(X,{className:`browser-notification-card`,"data-config-card":`notifications-browser`,children:[(0,K.jsxs)(`div`,{className:`notification-option [&_>_div]:flex [&_>_div]:min-w-0 [&_>_div]:flex-col [&_>_div]:gap-[4px] [&_strong]:text-[13px] [&_small]:text-[var(--text-muted)] [&_small]:text-[12px] [&_small]:leading-[1.45] grid grid-cols-[auto_minmax(0,1fr)_auto_auto] items-center gap-[11px]`,children:[(0,K.jsx)(`span`,{className:`provider-icon [&_svg]:w-[19px] [&.green]:bg-[var(--success-soft)] [&.green]:text-[var(--success)] [&.blue]:bg-[var(--brand-blue-soft)] [&.blue]:text-[var(--brand-blue-strong)] [.notification-option_&:not(.blue)]:bg-[var(--surface-muted)] [.notification-option_&:not(.blue)]:text-[var(--text-muted)] grid w-[38px] h-[38px] place-items-center rounded-[var(--r-md)] ${i.browser.enabled?`blue`:``}`,children:i.browser.enabled?(0,K.jsx)(Ie,{size:18}):(0,K.jsx)(Pr,{size:18})}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`strong`,{children:n(`config:notificationSettings.notification`)}),(0,K.jsx)(`small`,{children:n(`config:notificationSettings.pisperUsesTheCurrentPlatformNotificationSystemWhenAnAgentCompletesOrFails`)})]}),(0,K.jsx)(Z,{tone:E,children:T}),(0,K.jsx)(ti,{value:i.browser.enabled,disabled:g||p===`checking`,onChange:x})]}),(0,K.jsxs)(Ge,{children:[(0,K.jsx)(ye,{size:15}),(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`strong`,{children:n(d?`config:notificationSettings.controlledByOperatingSystemNotificationSettings`:`config:notificationSettings.controlledByBrowserSitePermissions`)}),(0,K.jsx)(`small`,{children:n(d?`config:notificationSettings.theDesktopAppUsesOperatingSystemNotificationsTurningThisOffDoesNotChangeTheOperatingSystemPermis`:`config:notificationSettings.theWebAppUsesBrowserSiteNotificationsTurningThisOffDoesNotChangeTheBrowserPermissionItself`)})]})]}),(0,K.jsxs)(`div`,{className:`mt-[15px] flex gap-2 max-[650px]:flex-wrap`,children:[d&&p===`denied`&&(0,K.jsxs)(s,{variant:`outline`,size:`lg`,className:`bg-surface-subtle`,onClick:w,children:[(0,K.jsx)(ye,{size:14}),n(`config:notificationSettings.openSystemNotificationSettings`)]}),(0,K.jsxs)(s,{variant:`outline`,size:`lg`,className:`bg-surface-subtle`,disabled:!i.browser.enabled||p!==`granted`,onClick:C,children:[(0,K.jsx)(Ie,{size:14}),n(`config:notificationSettings.sendTestNotification`)]})]})]}),(0,K.jsx)(wa,{data:i,setData:a,notify:e,permission:p,onBrowserTest:S,onSettingsChange:t})]})}function wa({data:e,setData:t,notify:n,permission:i,onBrowserTest:a,onSettingsChange:o}){let{t:c}=h(),[l,u]=(0,G.useState)(e.templates[0]?.id||``),[d,f]=(0,G.useState)(`feishu`),p=e.templates.find(e=>e.id===l)||e.templates[0],m=p?.channels?.[d],[g,_]=(0,G.useState)(m?.content||``),[v,y]=(0,G.useState)(!1),b=e.scopes.find(e=>e.platform===d),x=d===`browser`?e.browser.enabled&&i===`granted`:!!b,S=ha;return(0,G.useEffect)(()=>{_(m?.content||``)},[l,d,m?.content]),p?(0,K.jsxs)(`div`,{className:`two-one-grid max-[900px]:grid-cols-[1fr] grid grid-cols-[minmax(0,2fr)_minmax(260px,1fr)] gap-[12px] [margin-top:0]`,children:[(0,K.jsxs)(X,{"data-config-card":`notifications-templates`,children:[(0,K.jsxs)(`div`,{className:`channel-section-head [&_>_span]:text-[var(--text-muted)] [&_>_span]:text-[13px] flex items-center justify-between gap-[8px] [margin-bottom:8px]`,children:[(0,K.jsx)(ei,{title:c(`config:notificationSettings.notificationTemplates`)}),(0,K.jsx)(`span`,{children:c(`config:notificationSettings.sharedByChatsScheduledTasksAndWorkflows`)})]}),e.templates.map(e=>(0,K.jsxs)(`button`,{className:`channel-template-row hover:rounded-[var(--r-sm)] hover:bg-[var(--accent-soft)] [&.selected]:rounded-[var(--r-sm)] [&.selected]:bg-[var(--accent-soft)] [&_>_span:nth-child(2)]:flex [&_>_span:nth-child(2)]:min-w-0 [&_>_span:nth-child(2)]:flex-col [&_>_span:nth-child(2)]:gap-[4px] [&_strong]:text-[13px] [&_small]:text-[var(--text-muted)] [&_small]:text-[13px] grid w-full min-h-[58px] grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-[9px] border-0 [border-top:1px_solid_var(--stroke-soft)] bg-transparent [padding:8px_6px] text-left ${e.id===p.id?`selected`:``}`,onClick:()=>u(e.id),children:[(0,K.jsx)(`span`,{className:`route-icon grid w-[27px] h-[27px] place-items-center rounded-[var(--r-sm)] bg-[var(--accent-soft)] text-[var(--star-strong)]`,children:(0,K.jsx)(ve,{size:14})}),(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`strong`,{children:_a(e.id,e.name,c)}),(0,K.jsx)(`small`,{children:va(e.id,e.description,c)})]}),(0,K.jsx)(Z,{tone:e.enabled?`green`:`gray`,children:e.enabled?c(`config:notificationSettings.enabled`):c(`config:notificationSettings.disabled`)})]},e.id))]}),(0,K.jsxs)(X,{className:`channel-template-editor [&_textarea]:min-h-[118px] [&_textarea]:font-[ui-monospace,_SFMono-Regular,_Consolas,_'Liberation_Mono',_monospace] [&_textarea]:leading-[1.55]`,children:[(0,K.jsxs)(et,{children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h2`,{children:_a(p.id,p.name,c)}),(0,K.jsx)(`p`,{children:va(p.id,p.description,c)})]}),(0,K.jsx)(ti,{value:p.enabled,onChange:e=>t(t=>({...t,templates:t.templates.map(t=>t.id===p.id?{...t,enabled:e}:t)}))})]}),(0,K.jsx)(`div`,{className:`channel-template-platforms [&_>_button]:flex [&_>_button]:min-h-[36px] [&_>_button]:items-center [&_>_button]:justify-between [&_>_button]:gap-[7px] [&_>_button]:[border:1px_solid_var(--stroke)] [&_>_button]:rounded-[var(--r-sm)] [&_>_button]:bg-[var(--surface-subtle)] [&_>_button]:p-[0_9px] [&_>_button]:text-[12px] [&_>_button]:font-[700] [&_>_button.active]:border-[var(--focus)] [&_>_button.active]:bg-[var(--accent-soft)] [&_>_button.active]:text-[var(--star-strong)] max-[650px]:grid-cols-[1fr] grid grid-cols-[repeat(5,minmax(0,1fr))] gap-[7px] [margin-top:13px]`,children:Object.entries(S).map(([t,n])=>{let r=t===`browser`?e.browser.enabled:e.connections?.[t];return(0,K.jsxs)(`button`,{className:d===t?`active`:``,onClick:()=>f(t),children:[ga(t,c),(0,K.jsx)(Z,{tone:r?n.tone:`gray`,children:c(r?t===`browser`?`config:notificationSettings.enabled2`:`config:notificationSettings.connected`:t===`browser`?`config:notificationSettings.notEnabled`:`config:notificationSettings.notConnected`)})]},t)})}),(0,K.jsxs)(W,{variant:`control`,children:[c(`config:notificationSettings.messageContent`),(0,K.jsx)(`textarea`,{value:g,onChange:e=>_(e.target.value)})]}),(0,K.jsxs)(`div`,{className:`channel-template-vars [&_>_span]:mr-[3px] [&_>_span]:text-[var(--text-muted)] [&_>_span]:text-[13px] [&_code]:rounded-[var(--r-xs)] [&_code]:bg-[var(--template-code-bg)] [&_code]:text-[var(--template-code-text)] [&_code]:p-[3px_5px] [&_code]:font-[ui-monospace,_SFMono-Regular,_Consolas,_'Liberation_Mono',_monospace] [&_code]:text-[13px] flex flex-wrap items-center gap-[5px] [margin-top:10px]`,children:[(0,K.jsx)(`span`,{children:c(`config:notificationSettings.availableVariables`)}),p.variables.map(e=>(0,K.jsx)(`code`,{children:`{{${e}}}`},e))]}),(0,K.jsxs)(`div`,{className:`channel-template-preview [&_>_small]:text-[var(--text-muted)] [&_>_small]:text-[13px] [&_pre]:m-[7px_0_0] [&_pre]:overflow-auto [&_pre]:text-[var(--text-soft)] [&_pre]:font-[inherit] [&_pre]:text-[12px] [&_pre]:leading-[1.55] [&_pre]:whitespace-pre-wrap [margin-top:10px] [border:1px_solid_var(--stroke-soft)] rounded-[var(--r-sm)] bg-[var(--surface-subtle)] [padding:9px]`,children:[(0,K.jsx)(`small`,{children:c(`config:notificationSettings.preview`)}),(0,K.jsx)(`pre`,{children:ya(g,c)})]}),(0,K.jsxs)(`div`,{className:`flex justify-end gap-[8px] [margin-top:18px]`,children:[(0,K.jsxs)(s,{variant:`outline`,size:`lg`,className:`bg-surface-subtle`,disabled:v||!x,onClick:async()=>{y(!0);try{let e=await r(`/api/settings/notifications/templates/${encodeURIComponent(p.id)}/${d}/test`,{method:`POST`,body:`{}`});d===`browser`&&await a?.(e.title||_a(p.id,p.name,c),e.body||e.preview||``,`pisper-template-${p.id}`),n(c(d===`browser`?`config:notificationSettings.theTestNotificationWasSentCheckYourSystemNotificationCenter`:`config:notificationSettings.testNotificationSentToCountChats`,{count:e.sent}))}catch(e){n(Sa(e),`error`)}finally{y(!1)}},children:[(0,K.jsx)(ve,{size:14}),c(`config:notificationSettings.sendTest`)]}),(0,K.jsxs)(s,{size:`lg`,disabled:v||!g.trim(),onClick:async()=>{y(!0);try{let e=await r(`/api/settings/notifications/templates/${encodeURIComponent(p.id)}/${d}`,{method:`PUT`,body:JSON.stringify({enabled:p.enabled,content:g})});t(e),o?.(e),n(c(`config:notificationSettings.notificationTemplateSaved`))}catch(e){n(Sa(e),`error`)}finally{y(!1)}},children:[v?(0,K.jsx)(V,{className:`animate-spin`,size:14}):(0,K.jsx)(_e,{size:14}),c(`config:notificationSettings.saveTemplate`)]})]})]})]}):null}function Ta({notify:e}){let{t,language:n}=h(),[i,a]=(0,G.useState)(null),[o,c]=(0,G.useState)([]),[l,u]=(0,G.useState)([]),[d,f]=(0,G.useState)(null),[p,m]=(0,G.useState)(!1),[g,_]=(0,G.useState)(``),[v,y]=(0,G.useState)(``),[b,x]=(0,G.useState)(!1),[S,C]=(0,G.useState)(``),w=(0,G.useCallback)(async()=>{try{let[e,t,n]=await Promise.all([r(`/api/remote/status`),r(`/api/remote/devices`),r(`/api/remote/pairing-requests`).catch(()=>({requests:[]}))]);a(e),c(t.devices.filter(e=>!e.revokedAt)),u(n.requests),C(``)}catch{C(t(`config:remoteAccess.loadFailed`))}},[t]);(0,G.useEffect)(()=>{w()},[w]),(0,G.useEffect)(()=>{if(!i?.listening)return;let e=window.setInterval(()=>void w(),2e3);return()=>window.clearInterval(e)},[w,i?.listening]);let T=async n=>{x(!0);try{await r(`/api/remote/enabled`,{method:`PUT`,body:{enabled:n}});let e=window.__TAURI__?.core?.invoke??window.__TAURI_INTERNALS__?.invoke;e&&await e(`desktop_iroh_set_enabled`,{enabled:n}).catch(()=>void 0),n||(f(null),m(!1),_(``)),await w()}catch(n){e(t(`config:remoteAccess.toggleFailed`,{message:String(n)}),`error`)}finally{x(!1)}},E=async()=>{x(!0),_(``);try{let e=await r(`/api/remote/pairing-code`,{method:`POST`});if(!e?.code||!e?.expiresAt)throw Error(t(`config:remoteAccess.qrUnavailable`));f(e),m(!0),e.qrDataUrl||_(t(`config:remoteAccess.qrUnavailable`))}catch(n){let r=t(`config:remoteAccess.pairingFailed`,{message:String(n)});_(r),e(r,`error`)}finally{x(!1)}},D=async(n,i)=>{y(n.id);try{await r(`/api/remote/pairing-requests/${encodeURIComponent(n.id)}/decision`,{method:`POST`,body:{approved:i}}),await w()}catch(n){e(t(`config:remoteAccess.approvalFailed`,{message:String(n)}),`error`)}finally{y(``)}},O=async n=>{if(window.confirm(t(`config:remoteAccess.revokeConfirm`,{name:n.name})))try{await r(`/api/remote/devices/${encodeURIComponent(n.id)}/revoke`,{method:`POST`}),await w()}catch(n){e(t(`config:remoteAccess.revokeFailed`,{message:String(n)}),`error`)}};return S?(0,K.jsx)(X,{className:`p-4 text-[13px] text-[var(--text-muted)]`,children:S}):i?(0,K.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,K.jsx)(Ze,{open:p&&d!==null,onOpenChange:m,children:(0,K.jsxs)(we,{className:`sm:max-w-md`,children:[(0,K.jsxs)(Fe,{children:[(0,K.jsx)(Re,{children:t(`config:remoteAccess.pairingQrTitle`)}),(0,K.jsx)(Ye,{children:t(`config:remoteAccess.scanQrDescription`)})]}),(0,K.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-2`,"aria-live":`polite`,children:[d?.qrDataUrl?(0,K.jsx)(`img`,{src:d.qrDataUrl,alt:t(`config:remoteAccess.qrAlt`),className:`size-64 max-w-full rounded-[var(--r-sm)] bg-white p-2`}):null,g?(0,K.jsx)(`p`,{className:`text-center text-[12px] leading-relaxed text-[var(--danger)]`,children:g}):null,d?(0,K.jsxs)(`div`,{className:`text-center`,children:[(0,K.jsx)(`div`,{className:`font-mono text-[20px] tracking-[0.2em]`,children:d.code}),(0,K.jsx)(`div`,{className:`mt-1 text-[11px] text-[var(--text-muted)]`,children:t(`config:remoteAccess.codeExpiresAt`,{time:Te(d.expiresAt,n)})})]}):null]}),(0,K.jsx)(Ne,{children:(0,K.jsxs)(s,{disabled:b,onClick:()=>void E(),children:[b?(0,K.jsx)(le,{className:`animate-spin`}):(0,K.jsx)(V,{}),t(b?`config:remoteAccess.generatingQr`:`config:remoteAccess.regenerate`)]})})]})}),(0,K.jsxs)(X,{className:`flex flex-col gap-3 p-4`,"data-config-card":`remote-access-main`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-[11px]`,children:[(0,K.jsx)(`span`,{className:`grid size-[38px] flex-none place-items-center rounded-[var(--r-sm)] bg-[var(--star-soft)] text-[var(--star-strong)]`,children:(0,K.jsx)(Ee,{size:19})}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h2`,{className:`text-[16px]`,children:t(`config:remoteAccess.title`)}),(0,K.jsx)(`p`,{className:`mt-1 text-[13px] leading-[1.55] text-[var(--text-muted)]`,children:t(`config:remoteAccess.description`)})]})]}),(0,K.jsx)(ti,{value:i.enabled&&i.listening,disabled:b,onChange:e=>void T(e),ariaLabel:t(`config:remoteAccess.title`)})]}),i.error?(0,K.jsx)(`p`,{className:`rounded-[var(--r-sm)] bg-[var(--danger-soft)] px-3 py-2 text-[12px] text-[var(--danger)]`,children:t(`config:remoteAccess.listenFailed`,{message:i.error})}):null]}),i.listening&&l.length?(0,K.jsxs)(X,{className:`flex flex-col gap-3 p-4`,"aria-live":`polite`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-[14px]`,children:[(0,K.jsx)(Yr,{size:16}),t(`config:remoteAccess.pendingApprovals`)]}),(0,K.jsx)(`p`,{className:`text-[12px] leading-relaxed text-[var(--text-muted)]`,children:t(`config:remoteAccess.pendingApprovalsDescription`)}),(0,K.jsx)(`ul`,{className:`flex flex-col gap-2`,children:l.map(e=>(0,K.jsxs)(`li`,{className:`flex items-center justify-between gap-3 rounded-[var(--r-sm)] border border-[var(--border)] px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`div`,{className:`truncate text-[13px]`,children:e.deviceName}),(0,K.jsx)(`div`,{className:`text-[11px] text-[var(--text-muted)]`,children:t(`config:remoteAccess.requestedAt`,{time:Te(e.requestedAt,n)})}),(0,K.jsx)(`code`,{className:`block truncate text-[11px] text-[var(--text-muted)]`,children:t(`config:remoteAccess.requestSource`,{ip:e.ip})})]}),(0,K.jsxs)(`div`,{className:`flex flex-none items-center gap-1`,children:[(0,K.jsxs)(s,{size:`sm`,variant:`ghost`,disabled:v===e.id,onClick:()=>void D(e,!1),children:[(0,K.jsx)(Ce,{}),t(`config:remoteAccess.reject`)]}),(0,K.jsxs)(s,{size:`sm`,disabled:v===e.id,onClick:()=>void D(e,!0),children:[v===e.id?(0,K.jsx)(le,{className:`animate-spin`}):(0,K.jsx)(z,{}),t(`config:remoteAccess.approve`)]})]})]},e.id))})]}):null,i.listening?(0,K.jsxs)(X,{className:`flex flex-col gap-3 p-4`,"data-config-card":`remote-access-pairing`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-[14px]`,children:[(0,K.jsx)(Gr,{size:16}),t(`config:remoteAccess.pairing`)]}),(0,K.jsxs)(s,{size:`sm`,disabled:b,onClick:()=>void E(),children:[b?(0,K.jsx)(le,{className:`animate-spin`}):(0,K.jsx)(Gr,{}),t(b?`config:remoteAccess.generatingQr`:`config:remoteAccess.generateQr`)]})]}),(0,K.jsx)(`p`,{className:`text-[12px] leading-[1.6] text-[var(--text-muted)]`,children:t(`config:remoteAccess.pairingDescription`)}),g&&!p?(0,K.jsx)(`p`,{className:`text-[12px] leading-relaxed text-[var(--danger)]`,"aria-live":`polite`,children:g}):null]}):null,(0,K.jsxs)(X,{className:`flex flex-col gap-3 p-4`,"data-config-card":`remote-access-devices`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-[14px]`,children:[(0,K.jsx)(Yr,{size:16}),t(`config:remoteAccess.devices`)]}),(0,K.jsx)(s,{size:`sm`,variant:`ghost`,onClick:()=>void w(),"aria-label":t(`config:remoteAccess.refresh`),children:(0,K.jsx)(V,{size:14})})]}),o.length===0?(0,K.jsx)(`p`,{className:`text-[12px] text-[var(--text-muted)]`,children:t(`config:remoteAccess.noDevices`)}):(0,K.jsx)(`ul`,{className:`flex flex-col gap-2`,children:o.map(e=>(0,K.jsxs)(`li`,{className:`flex items-center justify-between gap-3 rounded-[var(--r-sm)] border border-[var(--border)] px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsxs)(`div`,{className:`truncate text-[13px]`,children:[e.name,e.current?(0,K.jsx)(`span`,{className:`ml-2 text-[11px] text-[var(--text-muted)]`,children:t(`config:remoteAccess.currentDevice`)}):null]}),(0,K.jsx)(`div`,{className:`text-[11px] text-[var(--text-muted)]`,children:t(`config:remoteAccess.lastSeen`,{time:Te(e.lastSeenAt,n)})})]}),(0,K.jsx)(s,{size:`sm`,variant:`ghost`,onClick:()=>void O(e),children:t(`config:remoteAccess.revoke`)})]},e.id))})]})]}):null}function Ea({notify:e}){let{t}=h(),n=window.pisperDesktop,[r,i]=(0,G.useState)(null),[a,o]=(0,G.useState)(``),[c,l]=(0,G.useState)(``);(0,G.useEffect)(()=>{if(!n?.getCliStatus)return;let e=!0;return n.getCliStatus().then(t=>e&&i(t)).catch(t=>e&&l(t instanceof Error?t.message:String(t))),()=>{e=!1}},[n]);let u=!!(n?.getCliStatus&&n.installCli&&n.uninstallCli),d=async()=>{if(n?.installCli){o(`install`),l(``);try{let r=await n.installCli();i(r),e(t(`config:cliSettings.installedNotification`))}catch(e){l(e instanceof Error?e.message:String(e))}finally{o(``)}}},f=async()=>{if(n?.uninstallCli){o(`uninstall`),l(``);try{let r=await n.uninstallCli();i(r),e(t(`config:cliSettings.uninstalledNotification`))}catch(e){l(e instanceof Error?e.message:String(e))}finally{o(``)}}},p=u&&!r,m=u?p?t(`config:cliSettings.checking`):r?.supported?r.needsRepair?t(`config:cliSettings.needsRepair`):r.installed?t(`config:cliSettings.installed`):t(`config:cliSettings.notInstalled`):t(`config:cliSettings.unavailable`):t(`config:cliSettings.unavailable`);return(0,K.jsxs)(X,{className:`[padding:18px] cli-settings-card`,"data-config-card":`updates-cli`,children:[(0,K.jsxs)(`div`,{className:`language-settings-heading flex items-start gap-[11px] [&_h2]:text-[16px] [&_p]:mt-[4px] [&_p]:text-[var(--text-muted)] [&_p]:text-[13px] [&_p]:leading-[1.55] cli-settings-heading !grid grid-cols-[auto_minmax(0,1fr)_auto]`,children:[(0,K.jsx)(`span`,{className:`grid w-[38px] h-[38px] [flex:0_0_auto] place-items-center rounded-[11px] bg-[var(--star-soft)] text-[var(--star-strong)]`,children:(0,K.jsx)(Zr,{size:19})}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h2`,{children:t(`config:cliSettings.title`)}),(0,K.jsx)(`p`,{children:t(`config:cliSettings.description`)})]}),(0,K.jsx)(Z,{tone:r?.installed&&!r.needsRepair?`green`:r?.needsRepair?`blue`:`gray`,children:m})]}),r&&(0,K.jsxs)(Ge,{className:`[margin-top:15px] cli-settings-status [&_small]:[overflow-wrap:anywhere]`,children:[r.installed&&!r.needsRepair?(0,K.jsx)(Qe,{size:16}):(0,K.jsx)(Zr,{size:16}),(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`strong`,{children:r.installed?t(`config:cliSettings.commandReady`,{command:r.command}):t(`config:cliSettings.commandNotInstalled`,{command:r.command})}),(0,K.jsx)(`small`,{children:r.installPath}),r.installed&&(0,K.jsx)(`small`,{children:r.pathConfigured?t(`config:cliSettings.pathConfigured`):t(`config:cliSettings.pathNeedsRepair`)})]})]}),c&&(0,K.jsx)(U,{children:c}),u&&(0,K.jsxs)(`div`,{className:`mt-3.5 flex justify-end gap-2 max-[650px]:flex-wrap`,children:[r?.installed&&(0,K.jsxs)(s,{type:`button`,variant:`outline`,size:`lg`,className:`bg-surface-subtle`,disabled:!!a,onClick:()=>void f(),children:[a===`uninstall`?(0,K.jsx)(V,{className:`animate-spin`,size:14}):(0,K.jsx)(xe,{size:14}),t(`config:cliSettings.uninstall`)]}),(!r?.installed||r.needsRepair)&&(0,K.jsxs)(s,{type:`button`,size:`lg`,disabled:!!a||p||r?.supported===!1,onClick:()=>void d(),children:[a===`install`?(0,K.jsx)(V,{className:`animate-spin`,size:14}):r?.needsRepair?(0,K.jsx)(Se,{size:14}):(0,K.jsx)(Le,{size:14}),r?.needsRepair?t(`config:cliSettings.repair`):t(`config:cliSettings.install`)]})]}),u&&(0,K.jsx)(`small`,{className:`block [margin:9px_1px_0] text-[var(--text-muted)] text-[12px]`,children:t(`config:cliSettings.restartTerminal`)})]})}var Da=`0.5.36`,Oa=9e5,ka=2592e6;function Aa(){try{let e=JSON.parse(localStorage.getItem(ie.sponsorDismissals)||`{}`);return!e||typeof e!=`object`||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(e=>typeof e[1]==`number`&&e[1]>Date.now()))}catch{return{}}}function ja(e,t){return!e.desktop&&!e.mobile?t(`config:updateSettings.browserMode`):`${{win32:`Windows`,darwin:`macOS`,linux:`Linux`,android:`Android`,ios:`iOS`}[e.platform]||e.platform} · ${e.arch}`}function Ma(e,t){let n=Number(e)||0;if(!n)return`0 B`;let r=[`B`,`KB`,`MB`,`GB`],i=Math.min(r.length-1,Math.floor(Math.log(n)/Math.log(1024)));return`${(n/1024**i).toLocaleString(t,{maximumFractionDigits:1})} ${r[i]}`}function Na({notify:e,update:t}){let{t:n,language:i}=h(),a=t?.info||{desktop:!1,packaged:!1,version:Da,platform:`browser`,arch:``},o=t?.status||{state:`idle`},c=!!a.desktop,l=!!a.mobile,u=c||l,[d,f]=(0,G.useState)({version:Da,date:``,notes:``}),[p,m]=(0,G.useState)([]),[g,_]=(0,G.useState)(``),[v,y]=(0,G.useState)(Aa);(0,G.useEffect)(()=>{let e=!0;return fetch(`/release-notes.json`,{cache:`no-store`}).then(e=>e.ok?e.json():null).then(t=>{e&&t&&f(t)}).catch(()=>{}),()=>{e=!1}},[]),(0,G.useEffect)(()=>{let e=!0,t=(t=!1)=>r(`/api/sponsors/settings-updates?locale=${encodeURIComponent(i)}${t?`&refresh=1`:``}`).then(t=>{e&&m(Array.isArray(t.campaigns)?t.campaigns:[])}).catch(()=>{e&&!t&&m([])});t();let n=window.setInterval(()=>void t(!0),Oa);return()=>{e=!1,window.clearInterval(n)}},[i]);let b=e=>{let t={...v,[e]:Date.now()+ka};y(t);try{localStorage.setItem(ie.sponsorDismissals,JSON.stringify(t))}catch{}},x=async()=>{if(t){_(`check`);try{await t.check()}finally{_(``)}}},S=()=>t?.openReleases(),C=()=>t?.openUpdateLog?.(),w=async()=>{_(c?`install`:``);try{c?await t?.installComponents():await t?.download()}catch(t){e(t instanceof Error?t.message:String(t),`error`)}finally{_(``)}},T=()=>t?.install(),E=d.version===a.version?d:null,D=o.notes||(u?E?.notes||n(`config:updateSettings.noReleaseNotesAreAvailableForThisVersion`):o.state===`current`?n(`config:updateSettings.theCurrentWebSourceIsSyncedWithBranch`,{branch:o.branch||`main`}):n(`config:updateSettings.commitsThatHaveNotBeenSyncedWillAppearHereAfterTheCheck`)),O=o.state===`available`,k=o.state===`error`&&o.canResume&&o.canDownload,A=o.state===`downloaded`,j=o.state===`checking`||g===`check`,M=o.state===`downloading`||g===`install`,N=j?`checking`:M?`downloading`:o.state,ee=u?`v${a.version}`:`v${a.version}${o.currentCommit?` · ${o.currentCommit.slice(0,7)}`:``}`,P=u?`v${o.availableVersion||E?.version||a.version}`:o.availableCommit?.slice(0,7)||o.currentCommit?.slice(0,7)||d.version||a.version,te=p.filter(e=>(v[e.id]||0)<=Date.now()),F=(0,G.useMemo)(()=>{let e=new Map(t.components.map(e=>[e.component,e]));return[`desktop`,`tui`,`runtime`].map(t=>e.get(t)||{component:t,state:`idle`,currentVersion:t===`desktop`?a.version:`--`,availableVersion:``,message:``,releaseUrl:``,notes:``,size:0,transferred:0,canInstall:!1,restartRequired:!1})},[a.version,t.components]),I=(0,G.useMemo)(()=>({idle:[n(`config:updateSettings.notChecked`),`gray`],checking:[n(`config:updateSettings.checking`),`blue`],current:[n(`config:updateSettings.upToDate`),`green`],available:[n(u?`config:updateSettings.updateAvailable`:`config:updateSettings.sourceUpdatesAvailable`),`blue`],downloading:[n(`config:updateSettings.downloading`),`blue`],downloaded:[n(`config:updateSettings.readyToRestart`),`green`],installed:[n(`config:updateSettings.upToDate`),`green`],error:[n(k?`config:updateSettings.downloadPaused`:`config:updateSettings.checkFailed`),`red`]})[N]||[n(`config:updateSettings.notChecked`),`gray`],[u,N,k,n]);return(0,K.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[880px] flex-col gap-3`,children:[(0,K.jsxs)(X,{className:`p-5`,"data-config-card":`updates-main`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,K.jsx)(`span`,{className:`grid w-[38px] h-[38px] [flex:0_0_auto] place-items-center rounded-[11px] bg-[var(--star-soft)] text-[var(--star-strong)]`,children:(0,K.jsx)(Hr,{size:19})}),(0,K.jsx)(`span`,{className:`min-w-0`,children:(0,K.jsx)(`strong`,{className:`block text-[16px]`,children:n(`config:updateSettings.pisperAppUpdates`)})})]}),(0,K.jsx)(Z,{tone:I[1],children:I[0]})]}),(0,K.jsxs)(`div`,{className:`mt-5 grid gap-2 sm:grid-cols-3`,children:[(0,K.jsxs)(`div`,{className:`rounded-[var(--r-sm)] bg-[var(--surface-muted)] p-3`,children:[(0,K.jsx)(`small`,{className:`text-[12px] text-[var(--text-muted)]`,children:n(u?`config:updateSettings.currentVersion`:`config:updateSettings.currentSource`)}),(0,K.jsx)(`strong`,{className:`mt-1 block font-mono text-[14px]`,children:ee})]}),(0,K.jsxs)(`div`,{className:`rounded-[var(--r-sm)] bg-[var(--surface-muted)] p-3`,children:[(0,K.jsx)(`small`,{className:`text-[12px] text-[var(--text-muted)]`,children:n(`config:updateSettings.platform`)}),(0,K.jsx)(`strong`,{className:`mt-1 block text-[14px]`,children:ja(a,n)})]}),(0,K.jsxs)(`div`,{className:`rounded-[var(--r-sm)] bg-[var(--surface-muted)] p-3`,children:[(0,K.jsx)(`small`,{className:`text-[12px] text-[var(--text-muted)]`,children:n(`config:updateSettings.updateChannel`)}),(0,K.jsx)(`strong`,{className:`mt-1 block text-[14px]`,children:u?`Stable`:o.branch||`main`})]})]}),o.message&&(0,K.jsxs)(`div`,{className:`mt-4 flex items-start gap-2 rounded-[var(--r-sm)] p-3 text-[13px] ${o.state===`error`?`bg-[var(--danger-soft)] text-[var(--danger)]`:`bg-[var(--accent-soft)] text-[var(--text)]`}`,children:[o.state===`error`?(0,K.jsx)(H,{className:`mt-0.5 shrink-0`,size:15}):(0,K.jsx)(Vr,{className:`mt-0.5 shrink-0`,size:15}),(0,K.jsx)(`span`,{children:o.message})]}),k&&(0,K.jsx)(`small`,{className:`mt-2 block text-[12px] text-[var(--text-muted)]`,children:n(`config:updateSettings.downloadedDataWasPreservedAndCanResumeFromTheInterruptionPoint`)}),M&&(0,K.jsxs)(`div`,{className:`mt-4`,children:[(0,K.jsxs)(`div`,{className:`flex justify-between text-[12px] text-[var(--text-muted)]`,children:[(0,K.jsx)(`span`,{children:n(`config:updateSettings.downloadProgress`)}),(0,K.jsxs)(`span`,{children:[Math.round(o.percent||0),`% · `,Ma(o.transferred,i),` /`,` `,Ma(o.total,i)]})]}),(0,K.jsx)(`div`,{className:`mt-2 h-1.5 overflow-hidden rounded-full bg-[var(--progress-track)]`,children:(0,K.jsx)(`i`,{className:`block h-full bg-[var(--star)] transition-[width]`,style:{width:`${o.percent||0}%`}})})]}),(0,K.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:[(0,K.jsxs)(s,{size:`lg`,disabled:j||M||!!g,onClick:A?T:O||k?w:x,children:[j||M?(0,K.jsx)(V,{className:`animate-spin`,size:14}):A?(0,K.jsx)(dt,{size:14}):O||k?o.canDownload?(0,K.jsx)(Le,{size:14}):(0,K.jsx)(Oe,{size:14}):(0,K.jsx)(V,{size:14}),j||M?n(M&&c?`config:updateSettings.installingUpdates`:`config:updateSettings.checking2`):A?n(`config:updateSettings.restartAndInstall`):k?n(`config:updateSettings.resumeDownload`):O?o.canDownload?n(c?`config:updateSettings.downloadAndInstallUpdates`:`config:updateSettings.downloadUpdate`):n(u?`config:updateSettings.viewRelease`:`config:updateSettings.viewSourceUpdates`):n(`config:updateSettings.checkForUpdates`)]}),(0,K.jsxs)(s,{variant:`outline`,size:`lg`,className:`bg-surface-subtle`,onClick:S,children:[(0,K.jsx)(Oe,{size:14}),u?`GitHub Releases`:`GitHub Compare`]}),c&&(0,K.jsxs)(s,{variant:`outline`,size:`lg`,className:`bg-surface-subtle`,onClick:C,children:[(0,K.jsx)(Oe,{size:14}),n(`config:updateSettings.viewUpdateDiagnosticLog`)]})]}),!l&&(0,K.jsxs)(`div`,{className:`mt-6 border-t border-[var(--border)] pt-5`,"data-config-card":`updates-components`,children:[(0,K.jsx)(ei,{title:n(`config:updateSettings.appComponents`)}),(0,K.jsx)(`div`,{className:`mt-3 divide-y divide-[var(--border)]`,children:F.map(e=>{let t=e.component===`desktop`?Vr:e.component===`tui`?be:Lr,r=e.component===`desktop`?n(`config:updateSettings.desktopFrontend`):e.component===`tui`?n(`config:updateSettings.tuiClient`):n(`config:updateSettings.runtime`),a=e.state===`error`?`red`:e.state===`available`?`blue`:e.state===`installed`||e.state===`current`?`green`:`gray`,o=e.state===`checking`?n(`config:updateSettings.checking`):e.state===`downloading`?n(`config:updateSettings.downloading`):e.state===`available`?n(`config:updateSettings.updateAvailable`):e.state===`installed`?n(`config:updateSettings.installed`):e.state===`error`?n(`config:updateSettings.checkFailed`):e.state===`current`?n(`config:updateSettings.upToDate`):n(`config:updateSettings.notChecked`);return(0,K.jsxs)(`div`,{className:`grid min-h-[68px] items-center gap-3 py-3 sm:grid-cols-[minmax(0,1fr)_auto_auto]`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,K.jsx)(t,{className:`shrink-0 text-[var(--text-muted)]`,size:17}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`strong`,{className:`block text-[14px]`,children:r}),e.message&&(0,K.jsx)(`small`,{className:`mt-0.5 block text-[12px] text-[var(--text-muted)]`,children:e.message})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2 font-mono text-[12px]`,children:[(0,K.jsxs)(`span`,{children:[`v`,e.currentVersion]}),e.availableVersion&&e.availableVersion!==e.currentVersion&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(ae,{size:12}),(0,K.jsxs)(`span`,{children:[`v`,e.availableVersion]})]}),e.size>0&&e.state===`available`&&(0,K.jsx)(`span`,{className:`font-sans text-[var(--text-muted)]`,children:Ma(e.size,i)})]}),(0,K.jsx)(Z,{tone:a,children:o})]},e.component)})})]})]}),!l&&(0,K.jsx)(Ea,{notify:e}),(0,K.jsxs)(X,{className:`p-5`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsx)(ei,{title:n(u?O||k||A||M?`config:updateSettings.newVersionReleaseNotes`:`config:updateSettings.currentReleaseNotes`:O?`config:updateSettings.commitsToSync`:`config:updateSettings.currentSourceStatus`)}),(0,K.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[12px] text-[var(--text-muted)]`,children:[(0,K.jsx)(Qe,{size:13}),O||k||A||M?P:u?`v${E?.version||a.version}`:o.currentCommit?.slice(0,7)||n(`config:updateSettings.notChecked`)]})]}),(o.releaseDate||u&&E?.date)&&(0,K.jsx)(`small`,{className:`mt-2 block text-[12px] text-[var(--text-muted)]`,children:new Intl.DateTimeFormat(i,{dateStyle:`long`}).format(new Date(o.releaseDate||E?.date||``))}),(0,K.jsx)(`div`,{className:`mt-4 rounded-[var(--r-sm)] border border-[var(--stroke-soft)] bg-[var(--surface-subtle)] p-4`,children:(0,K.jsx)(xt,{children:D})})]}),te.length>0&&(0,K.jsxs)(X,{className:`p-5`,"data-config-card":`updates-sponsors`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,K.jsx)(`span`,{className:`grid w-[38px] h-[38px] [flex:0_0_auto] place-items-center rounded-[11px] bg-[var(--star-soft)] text-[var(--star-strong)]`,children:(0,K.jsx)(zr,{size:19})}),(0,K.jsxs)(`span`,{className:`min-w-0`,children:[(0,K.jsx)(ei,{title:n(`config:updateSettings.sponsors`)}),(0,K.jsx)(`small`,{className:`mt-1 block text-[12px] leading-5 text-[var(--text-muted)]`,children:n(`config:updateSettings.sponsorsDescription`)})]})]}),(0,K.jsx)(`div`,{className:`mt-4 divide-y divide-[var(--stroke-soft)] border-y border-[var(--stroke-soft)]`,children:te.map(e=>(0,K.jsxs)(`div`,{className:`grid min-h-16 grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-3 py-3`,children:[(0,K.jsxs)(`span`,{className:`min-w-0`,children:[(0,K.jsxs)(`span`,{className:`mb-1 flex items-center gap-2`,children:[(0,K.jsx)(`strong`,{className:`truncate text-[14px]`,children:e.name}),(0,K.jsx)(Z,{tone:`gray`,children:n(`config:updateSettings.sponsored`)})]}),(0,K.jsx)(`small`,{className:`block text-[12px] leading-5 text-[var(--text-muted)]`,children:e.description})]}),(0,K.jsx)(s,{asChild:!0,variant:`outline`,className:`bg-surface-subtle`,children:(0,K.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer sponsored`,children:[(0,K.jsx)(Oe,{size:13}),n(`config:updateSettings.visitSponsor`)]})}),(0,K.jsx)(s,{type:`button`,variant:`ghost`,size:`icon`,className:`shrink-0`,"aria-label":n(`config:updateSettings.hideSponsor`),title:n(`config:updateSettings.hideSponsor`),onClick:()=>b(e.id),children:(0,K.jsx)(Ce,{size:15})})]},e.id))})]})]})}function Pa({notify:e,registerPrimaryAction:t,section:n,onBrowserNotificationChange:r,requestConfirm:i,update:a}){de(n);let o;return o=n===`notifications`?(0,K.jsx)(Ca,{notify:e,onBrowserNotificationChange:r}):n===`interface`?(0,K.jsx)(_i,{notify:e}):n===`shortcuts`?(0,K.jsx)(wi,{requestConfirm:i}):n===`desktop-pet`?(0,K.jsx)(ui,{notify:e,requestConfirm:i}):n===`mobile-server`?(0,K.jsx)(ma,{requestConfirm:i}):n===`remote-access`?(0,K.jsx)(Ta,{notify:e}):n===`updates`?(0,K.jsx)(Na,{notify:e,update:a}):n===`about`?(0,K.jsx)(si,{update:a}):(0,K.jsx)(Xi,{notify:e,registerPrimaryAction:t,requestConfirm:i}),(0,K.jsx)(`div`,{"data-config-card":me,children:o})}export{Pa as ConfigPage};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-markdown-plugins-Wv1dLaAO.js","assets/rolldown-runtime-B0Z9INg1.js","assets/vendor-shiki-runtime-CxE5QolQ.js","assets/vendor-router-Bw2aAdMs.js","assets/vendor-react-CHuvPdJE.js","assets/vendor-markdown-plugins-DEcVZfaU.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,t as n}from"./vendor-react-CHuvPdJE.js";import{f as r}from"./vendor-router-Bw2aAdMs.js";import{t as i}from"./button-XhIEgIsg.js";import{t as a}from"./use-i18n-B2uTAjsJ.js";import{t as o}from"./utils-C8uzG5AZ.js";import{t as s}from"./check-jIXqkGKr.js";import{t as c}from"./copy-DS-8Hh_R.js";import{n as l,t as u}from"./vendor-markdown-plugins-Wv1dLaAO.js";import{a as ee,i as d,n as f,r as p,t as m}from"./vendor-markdown-K9KdiImV.js";import{n as h,r as te,t as g}from"./vendor-shiki-runtime-CxE5QolQ.js";var _=e(t(),1),v=[`github-dark`,`github-dark`],y=150,b=new Set([`text`,`txt`,`plain`,`plaintext`]),x=new Map;for(let e of h){x.set(e.id,e.id);for(let t of e.aliases??[])x.set(t,e.id)}function S(e){return typeof e==`string`?e:e.name??`custom`}function C(e){let t=String(e||``).trim().toLowerCase();return x.get(t)??`text`}function w(e,t,n){return`${t}:${S(n[0])}:${S(n[1])}:${e.length}:${e.slice(0,64)}:${e.slice(-64)}`}var T=new Map;function ne(e){let t=T.get(e);return t&&(T.delete(e),T.set(e,t)),t}function re(e,t){for(T.delete(e),T.set(e,t);T.size>y;){let e=T.keys().next().value;if(e===void 0)break;T.delete(e)}}var E=null,D=new Map;function O(){return E??=te({themes:[...v],langs:[],engine:g({forgiving:!0})}),E}function k(e,t){if(b.has(t)||e.getLoadedLanguages().includes(t))return Promise.resolve();let n=h.find(e=>e.id===t);if(!n)return Promise.resolve();let r=D.get(t);return r||(r=e.loadLanguage(()=>n.import().then(e=>e.default)).catch(e=>{throw D.delete(t),e}),D.set(t,r)),r}var A=new Map;function j(){return{name:`shiki`,type:`code-highlighter`,supportsLanguage(e){return x.has(String(e||``).trim().toLowerCase())},getSupportedLanguages(){return h.map(e=>e.id)},getThemes(){return v},highlight({code:e,language:t,themes:n},r){let i=C(t),a=w(e,i,n),o=ne(a);if(o)return o;let s=A.get(a),c=!!s;return s||(s=new Set,A.set(a,s)),r&&s.add(r),c||(async()=>{try{let t=await O();await k(t,i);let r=t.getLoadedLanguages().includes(i)?i:`text`,o=t.codeToTokens(e,{lang:r,themes:{light:n[0],dark:n[1]}});re(a,o);let s=A.get(a);if(A.delete(a),s)for(let e of s)e(o)}catch(e){A.delete(a),console.error(`[streamdown] Failed to highlight code:`,e)}})(),null}}}var M=j(),N={cjk:l,code:M,math:u};function P(){let e=``,t=[];return n=>{if(n===e)return t;if(t.length>0&&n.startsWith(e)){let r=t[t.length-1],i=e.length-r.length,a=p(n.slice(i)),o=[...t.slice(0,-1),...a];return e=n,t=o,o}return e=n,t=p(n),t}}var F=100,I=new Map;function L(e){let t=I.get(e);if(t)return I.delete(e),I.set(e,t),t;let n=p(e);if(I.set(e,n),I.size>F){let e=I.keys().next().value;e!==void 0&&I.delete(e)}return n}var R=null;function z(){return R??=r(()=>import(`./vendor-markdown-plugins-Wv1dLaAO.js`).then(e=>e.O),__vite__mapDeps([0,1,2,3,4,5])),R}function B(e){return/\$\$|\\\(|\\\[|\$[^\n$]+\$|\\begin\{/.test(e)}var V=`https://local-file.pisper.invalid`,H=`/reveal`;function U(e){try{return decodeURIComponent(e)}catch{return e}}function W(e){let t=e.match(/:(\d+)(?::(\d+))?$/);if(!t)return{path:e};let n={path:e.slice(0,-t[0].length),line:Number(t[1])};return t[2]&&(n.column=Number(t[2])),n}function G(e){try{let t=new URL(e);if(t.protocol!==`file:`||t.username||t.password||t.port)return null;let n=U(t.pathname);return t.hostname&&t.hostname!==`localhost`?`//${t.hostname}${n}`:/^\/[A-Za-z]:[\\/]/.test(n)?n.slice(1):n}catch{return null}}function K(e){let t=e.trim();if(!t||[...t].some(e=>{let t=e.codePointAt(0)||0;return t<32||t===127}))return null;let n=/^file:/i.test(t)?G(t):U(t);if(!n)return null;let r=/^\/[A-Za-z]:[\\/]/.test(n)?n.slice(1):n;if(!/^(?:[A-Za-z]:[\\/]|\/|\\\\)/.test(r))return null;let i=W(r);return i.path?i:null}function ie(e){let t=new URL(H,V);return t.searchParams.set(`path`,e.path),e.line!==void 0&&t.searchParams.set(`line`,String(e.line)),e.column!==void 0&&t.searchParams.set(`column`,String(e.column)),t.href}function q(e){try{let t=new URL(e);if(t.origin!==V||t.pathname!==H)return null;let n=K(t.searchParams.get(`path`)||``);if(!n)return null;let r=Number(t.searchParams.get(`line`)),i=Number(t.searchParams.get(`column`)),a={path:n.path};return Number.isSafeInteger(r)&&r>0&&(a.line=r),Number.isSafeInteger(i)&&i>0&&(a.column=i),a}catch{return null}}function J(){return e=>{let t=e=>{if(e.type===`link`&&typeof e.url==`string`){let t=K(e.url);t&&(e.url=ie(t))}for(let n of e.children||[])t(n)};t(e)}}var Y=n(),ae={a:ue,code:he,img:de,strong:fe,table:pe},oe=!1,se={linkMode:`text-only`},ce=[...Object.values(m),J];function X(e){return typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map(X).join(``):(0,_.isValidElement)(e)?X(e.props.children):``}function Z(e){return String(e||``).match(/language-([\w-]+)/)?.[1]||`text`}function le(e){if(navigator.clipboard?.writeText)return navigator.clipboard.writeText(e);let t=document.createElement(`textarea`);return t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.opacity=`0`,document.body.append(t),t.select(),document.execCommand(`copy`),t.remove(),Promise.resolve()}function ue({children:e,node:t,className:n,href:r,...i}){let{t:s}=a(),c=X(e).trim()?e:r;if(!r)return(0,Y.jsx)(`span`,{className:o(`markdown-link`,n),children:c});let l=q(r);if(l){let e=s(`common:markdownMessage.revealLocalPath`,{path:l.path}),t=typeof window>`u`?void 0:window.pisperDesktop?.revealPath;return t?(0,Y.jsx)(`button`,{type:`button`,className:o(`markdown-link inline cursor-pointer border-0 bg-transparent p-0 [font:inherit]`,n),"data-local-path":l.path,title:e,onClick:()=>{t(l.path).catch(e=>{console.error(`[markdown] 无法在文件管理器中显示本地路径。`,e)})},children:c}):(0,Y.jsx)(`span`,{className:o(`markdown-link`,n),"data-local-path":l.path,title:e,children:c})}return(0,Y.jsx)(`a`,{...i,className:o(`markdown-link`,n),href:r,target:`_blank`,rel:`noopener noreferrer`,children:c})}function de({node:e,...t}){return(0,Y.jsx)(`img`,{loading:`lazy`,...t})}function fe({node:e,...t}){return(0,Y.jsx)(`strong`,{...t})}function pe({node:e,...t}){return(0,Y.jsx)(`table`,{...t})}function Q({source:e}){let{t}=a(),[n,r]=(0,_.useState)(!1);return(0,Y.jsxs)(i,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7 gap-1 px-[7px] text-[11px] font-bold text-[var(--code-toolbar-text)] hover:bg-white/10 hover:text-[var(--code-toolbar-text)]`,"data-streamdown":`code-block-copy-button`,onClick:async()=>{try{await le(e),r(!0),window.setTimeout(()=>r(!1),1800)}catch{r(!1)}},"aria-label":t(`common:markdownMessage.copyCode`),title:t(`common:markdownMessage.copyCode`),children:[n?(0,Y.jsx)(s,{size:13}):(0,Y.jsx)(c,{size:13}),t(n?`common:markdownMessage.copied`:`common:markdownMessage.copy`)]})}function me({language:e,source:t}){return(0,Y.jsxs)(`div`,{className:`my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,"data-incomplete":`true`,"data-language":e,"data-streamdown":`code-block`,style:{contentVisibility:`auto`,containIntrinsicSize:`auto 200px`},children:[(0,Y.jsxs)(`div`,{className:`flex h-8 items-center justify-between text-muted-foreground text-xs`,"data-language":e,"data-streamdown":`code-block-header`,children:[(0,Y.jsx)(`span`,{className:`ml-1 font-mono lowercase`,children:e}),(0,Y.jsx)(Q,{source:t})]}),(0,Y.jsx)(`div`,{className:`overflow-x-auto rounded-md border border-border bg-background p-4 text-sm`,"data-language":e,"data-streamdown":`code-block-body`,children:(0,Y.jsx)(`pre`,{className:`bg-transparent`,children:(0,Y.jsx)(`code`,{children:t})})})]})}function he({children:e,className:t,node:n,...r}){let i=ee();if(!Object.hasOwn(r,`data-block`))return(0,Y.jsx)(`code`,{className:t||``,...r,children:e});let a=X(e).replace(/\n$/,``),o=Z(t);return i?(0,Y.jsx)(me,{language:o,source:a}):(0,Y.jsx)(d,{code:a,isIncomplete:i,language:o,lineNumbers:!1,children:(0,Y.jsx)(Q,{source:a})})}function ge({children:e,className:t,streaming:n=!1}){let r=String(e??``),i=(0,_.useMemo)(()=>B(r),[r]);(0,_.useEffect)(()=>{i&&z()},[i]);let[a]=(0,_.useState)(()=>P()),s=n?a:L;return(0,Y.jsx)(`div`,{className:o(`markdown-body`,n&&`markdown-streaming`,t),"aria-busy":n||void 0,children:(0,Y.jsx)(f,{className:`markdown-content space-y-0`,components:ae,controls:oe,isAnimating:n,lineNumbers:!1,mode:`streaming`,parseMarkdownIntoBlocksFn:s,plugins:N,remarkPlugins:ce,remend:se,children:r})})}var $=(0,_.memo)(ge);$.displayName=`MarkdownMessage`;export{$ as t};
|