pisper 0.5.26-linux-x64.0 → 0.5.26
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 +54 -0
- package/README.md +47 -47
- 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 +2254 -0
- package/web/assets/AnimatedContent-BiVNqD3m.js +1 -0
- package/web/assets/AnimatedList-CJTx-B8I.js +1 -0
- package/web/assets/AppOverlays-DIFAJSqX.js +1 -0
- package/web/assets/AppSelect-C8CfPey8.js +1 -0
- package/web/assets/AssetsPage-mvzTPNos.js +1 -0
- package/web/assets/ChannelsPage-LtS2l9DS.js +1 -0
- package/web/assets/ChatHistoryPage-DBQagD2A.js +1 -0
- package/web/assets/ChatPage-NyxefP54.js +9 -0
- package/web/assets/ClickSpark-BhxL8WOQ.js +1 -0
- package/web/assets/ConfigPage-D-uiE8GM.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-CM_Xt2jB.js +1 -0
- package/web/assets/MemoryPage-BF5AlBar.js +1 -0
- package/web/assets/PageHeader-Bkjl7ruE.js +1 -0
- package/web/assets/PluginsPage-eM3XurKa.js +1 -0
- package/web/assets/PreviewPages-QjOXYaDL.js +1 -0
- package/web/assets/SchedulesPage-DSq5o5Tw.js +1 -0
- package/web/assets/ShinyText-fuaKxKqJ.js +1 -0
- package/web/assets/SkillsPage-Bg7RtcrP.js +1 -0
- package/web/assets/StarOrbit-BlI6MhVr.js +1 -0
- package/web/assets/TerminalPanel-BrP-ENHg.css +1 -0
- package/web/assets/TerminalPanel-C0xiIAOO.js +18 -0
- package/web/assets/Threads-DskDSsK6.js +1 -0
- package/web/assets/WelcomeEffects-BFECNEBW.js +1 -0
- package/web/assets/WorkflowsPage-CXOGNFan.js +1 -0
- package/web/assets/WorkspacePicker-BBqYj7id.js +1 -0
- package/web/assets/alert-B7D8joCd.js +1 -0
- package/web/assets/alert-dialog-B5TaETaJ.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/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-CFOXmGdd.js +1 -0
- package/web/assets/button-DzlQCSNK.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/chevron-down-DXmj1gMQ.js +1 -0
- package/web/assets/circle-dot-CbGG7s_7.js +1 -0
- package/web/assets/coffee-ouOQ86EC.js +1 -0
- package/web/assets/copy-DO0sQBgx.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-CuwNeZEs.js +1 -0
- package/web/assets/dist-QkD6B9bR.js +1 -0
- package/web/assets/dracula-BHWKrbxM.js +1 -0
- package/web/assets/dracula-soft-5eyTD99u.js +1 -0
- package/web/assets/earth-D-KiHvdO.js +1 -0
- package/web/assets/es2015-D5Xsi_dj.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-BLyfP8St.js +1 -0
- package/web/assets/file-B6GksU4A.js +1 -0
- package/web/assets/file-code-corner-3gopYCm4.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-Bu_a9jz0.js +1 -0
- package/web/assets/imba-DsUTQ-LC.js +1 -0
- package/web/assets/index-ByiRyOgQ.css +2 -0
- package/web/assets/index-Dy6ce2fa.js +41 -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-SOWAopyR.js +1 -0
- package/web/assets/loader-circle-i0WYlBWu.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-C3tSGsW0.js +1 -0
- package/web/assets/min-dark-BSWPekZh.js +1 -0
- package/web/assets/min-light-DDpmG2fV.js +1 -0
- package/web/assets/monokai-B_bV9PQ9.js +1 -0
- package/web/assets/network-zt1ahOiz.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-top-DYcS-wiY.js +1 -0
- package/web/assets/paperclip-t0nP1kBQ.js +1 -0
- package/web/assets/pencil-BOb7CieI.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-V5zloi0R.js +1 -0
- package/web/assets/poimandres-DRFjx7u4.js +1 -0
- package/web/assets/postcss-BXeXVLqQ.js +1 -0
- package/web/assets/progress-qLVGg5Oj.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-CTsP04bb.js +1 -0
- package/web/assets/scss-Davl4E3T.js +1 -0
- package/web/assets/search-Chj7BjSz.js +1 -0
- package/web/assets/shellscript-CLZ0U2zV.js +1 -0
- package/web/assets/shield-check-By9gGYwr.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/sql-b92rrcVl.js +1 -0
- package/web/assets/square-DQQwOv3-.js +1 -0
- package/web/assets/square-terminal-ByK0g_OZ.js +1 -0
- package/web/assets/stylus-B6D30XZt.js +1 -0
- package/web/assets/sun-CiCuEpCg.js +1 -0
- package/web/assets/svelte-BfstjgUc.js +1 -0
- package/web/assets/synthwave-84-nFMaYfgc.js +1 -0
- package/web/assets/tag-B0fT5ThM.js +1 -0
- package/web/assets/tokyo-night-oM2G3aXe.js +1 -0
- package/web/assets/trash-2-2GzVxk5J.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-i18n-CYAA2G_0.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-CWK5AVhB.js +130 -0
- package/web/assets/vendor-markdown-plugins-DCl4I7Pz.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/wgsl-BsKzXJz4.js +1 -0
- package/web/assets/wit-DdvCle-K.js +1 -0
- package/web/assets/wrench-DkHcVlxK.js +1 -0
- package/web/assets/xml-CNfvW5JP.js +1 -0
- package/web/assets/yaml-rwi0_p6S.js +1 -0
- package/web/assets/zap-CRNpJWAy.js +1 -0
- package/web/favicon.svg +25 -0
- package/web/icons.svg +24 -0
- package/web/index.html +72 -0
- package/web/memory-galaxy-background.webp +0 -0
- package/web/mobile-startup.html +316 -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.24_linux_x86_64.tar.gz +0 -0
- package/components/runtime/Pisper_Runtime_Node_0.5.24_linux_x86_64.tar.gz.sig +0 -1
- package/components/tui/Pisper_TUI_Component_0.5.15_linux_x86_64.tar.gz +0 -0
- package/components/tui/Pisper_TUI_Component_0.5.15_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"./utils-C8uzG5AZ.js";/* empty css */var i=e(t(),1),a=n();function o({className:e,onPointerDownCapture:t,children:n,...o}){let[s,c]=(0,i.useState)(null),l=(0,i.useCallback)(e=>{let n=e.currentTarget.getBoundingClientRect();c({id:Date.now(),x:e.clientX-n.left,y:e.clientY-n.top}),t?.(e)},[t]);return(0,a.jsxs)(`span`,{className:r(`rb-click-spark`,e),onPointerDownCapture:l,...o,children:[n,s&&(0,a.jsx)(`span`,{"aria-hidden":`true`,className:`rb-click-spark-burst`,style:{left:s.x,top:s.y},children:Array.from({length:8},(e,t)=>(0,a.jsx)(`i`,{style:{"--rb-spark-angle":`${t*45}deg`}},t))},s.id)]})}export{o as ClickSpark};
|
|
@@ -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{s as r}from"./vendor-router-Bw2aAdMs.js";import{n as i,r as a,s as o,t as s}from"./button-DzlQCSNK.js";import{d as c,h as l,m as u,p as d,r as f,s as p,t as m,u as h}from"./use-i18n-CYAA2G_0.js";import{a as g,c as _,i as v,n as y,o as b,r as x,s as S,t as C}from"./MarkdownMessage-CM_Xt2jB.js";import{i as w,n as T,r as E,t as D}from"./AppSelect-C8CfPey8.js";import{t as O}from"./utils-C8uzG5AZ.js";import{t as k}from"./chevron-down-DXmj1gMQ.js";import{n as A}from"./copy-DO0sQBgx.js";import{t as j}from"./earth-D-KiHvdO.js";import{t as M}from"./image-Bu_a9jz0.js";import{t as N}from"./loader-circle-i0WYlBWu.js";import{n as P,r as F,t as I}from"./sun-CiCuEpCg.js";import{t as L}from"./network-zt1ahOiz.js";import{t as ee}from"./play-V5zloi0R.js";import{t as R}from"./save-CTsP04bb.js";import{t as te}from"./search-Chj7BjSz.js";import{t as ne}from"./shield-check-By9gGYwr.js";import{t as re}from"./square-terminal-ByK0g_OZ.js";import{t as ie}from"./trash-2-2GzVxk5J.js";import{t as ae}from"./wrench-DkHcVlxK.js";import{t as oe}from"./zap-CRNpJWAy.js";import{A as se,B as ce,Bt as le,C as z,Ct as B,D as ue,Dt as de,E as fe,Et as pe,F as me,Ft as he,G as V,Ht as ge,It as _e,Lt as ve,M as ye,Mt as be,N as xe,Ot as H,P as Se,S as Ce,T as we,U as Te,Vt as Ee,_t as De,a as Oe,at as ke,b as Ae,i as U,j as je,k as Me,kt as Ne,l as Pe,n as Fe,nn as Ie,o as Le,r as Re,rn as ze,s as Be,t as Ve,v as He,vt as Ue,w as We,wt as Ge,x as Ke,xt as qe,y as Je,z as Ye,zt as Xe}from"./index-Dy6ce2fa.js";import{t as W}from"./field-BLyfP8St.js";import{t as Ze}from"./usePagePrimaryAction-Bw0OFTDZ.js";import{n as Qe}from"./brand-CFOXmGdd.js";var G=e(t(),1),K=n(),$e=Object.defineProperty,q=(e,t)=>$e(e,`name`,{value:t,configurable:!0}),et=[`PageUp`,`PageDown`],tt=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],nt={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},rt=`Slider`,[it,at,ot]=ze(rt),[st,ct]=u(rt,[ot]),[lt,ut]=st(rt),dt=G.forwardRef(q(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:f=[r],value:p,onValueChange:m=q(()=>{},`onValueChange`),onValueCommit:h=q(()=>{},`onValueCommit`),inverted:g=!1,form:_,...v}=e,y=G.useRef(new Set),b=G.useRef(0),x=G.useRef(!1),S=s===`horizontal`?mt:ht,[C,w]=G.useState(null),T=o(t,w),[D=[],O]=c({prop:p,defaultProp:f,onChange:q(e=>{[...y.current][b.current]?.focus({preventScroll:!0,focusVisible:x.current}),x.current=!1,m(e)},`onChange`)}),k=G.useRef(D),A=G.useRef(D);G.useEffect(()=>{let e=_?C?.ownerDocument.getElementById(_):C?.closest(`form`);if(e instanceof HTMLFormElement){let t=q(()=>O(A.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[C,_,O]);function j(e){P(e,Nt(D,e))}q(j,`handleSlideStart`);function M(e){P(e,b.current)}q(M,`handleSlideMove`);function N(){String(D)!==String(k.current)&&h(D)}q(N,`handleSlideEnd`);function P(e,t,{commit:n}={commit:!1}){let o=Rt(a),s=zt(Math.round((e-r)/a)*a+r,o),c=E(s,[r,i]);O((e=[])=>{let r=At(e,c,t);if(It(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 q(P,`updateValues`),(0,K.jsx)(lt,{scope:e.__scopeSlider,name:n,disabled:l,min:r,max:i,valueIndexToChangeRef:b,thumbs:y.current,values:D,orientation:s,form:_,children:(0,K.jsx)(it.Provider,{scope:e.__scopeSlider,children:(0,K.jsx)(it.Slot,{scope:e.__scopeSlider,children:(0,K.jsx)(S,{"aria-disabled":l,"data-disabled":l?``:void 0,...v,ref:T,onPointerDown:d(v.onPointerDown,()=>{l||(k.current=D,x.current=!1)}),min:r,max:i,inverted:g,onSlideStart:l?void 0:j,onSlideMove:l?void 0:M,onSlideEnd:l?void 0:N,onHomeKeyDown:()=>{l||(x.current=!0,P(r,0,{commit:!0}))},onEndKeyDown:()=>{l||(x.current=!0,P(i,D.length-1,{commit:!0}))},onStepKeyDown:({event:e,direction:t})=>{if(!l){x.current=!0;let n=et.includes(e.key)||e.shiftKey&&tt.includes(e.key)?10:1,i=b.current,o=D[i];P(Bt(o,{min:r,step:a,direction:t,multiplier:n}),i,{commit:!0})}}})})})})},`Slider`)),[ft,pt]=st(rt,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),mt=G.forwardRef(q(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=Ie(i),_=g===`ltr`,v=_&&!a||!_&&a;function y(e){let t=h.current||f.getBoundingClientRect(),i=Lt([0,t.width],v?[n,r]:[r,n]);return h.current=t,i(e-t.left)}return q(y,`getValueFromPointer`),(0,K.jsx)(ft,{scope:e.__scopeSlider,startEdge:v?`left`:`right`,endEdge:v?`right`:`left`,direction:v?1:-1,size:`width`,children:(0,K.jsx)(gt,{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=nt[v?`from-left`:`from-right`].includes(e.key);u?.({event:e,direction:t?-1:1})}})})},`SliderHorizontal`)),ht=G.forwardRef(q(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=Lt([0,t.height],m?[r,n]:[n,r]);return p.current=t,i(e-t.top)}return q(h,`getValueFromPointer`),(0,K.jsx)(ft,{scope:e.__scopeSlider,startEdge:m?`bottom`:`top`,endEdge:m?`top`:`bottom`,size:`height`,direction:m?1:-1,children:(0,K.jsx)(gt,{"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=nt[m?`from-bottom`:`from-top`].includes(e.key);l?.({event:e,direction:t?-1:1})}})})},`SliderVertical`)),gt=G.forwardRef(q(function(e,t){let{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:o,onEndKeyDown:s,onStepKeyDown:c,...u}=e,f=ut(rt,n);return(0,K.jsx)(l.span,{...u,ref:t,onKeyDown:d(e.onKeyDown,e=>{e.key===`Home`?(o(e),e.preventDefault()):e.key===`End`?(s(e),e.preventDefault()):et.concat(tt).includes(e.key)&&(c(e),e.preventDefault())}),onPointerDown:d(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),f.thumbs.has(t)?t.focus({preventScroll:!0,focusVisible:!1}):r(e)}),onPointerMove:d(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)}),onPointerUp:d(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),a(e))})})},`SliderImpl`)),_t=`SliderTrack`,vt=G.forwardRef(q(function(e,t){let{__scopeSlider:n,...r}=e,i=ut(_t,n);return(0,K.jsx)(l.span,{"data-disabled":i.disabled?``:void 0,"data-orientation":i.orientation,...r,ref:t})},`SliderTrack`)),yt=`SliderRange`,bt=G.forwardRef(q(function(e,t){let{__scopeSlider:n,...r}=e,i=ut(yt,n),a=pt(yt,n),s=G.useRef(null),c=o(t,s),u=i.values.length,d=i.values.map(e=>jt(e,i.min,i.max)),f=u>1?Math.min(...d):0,p=100-Math.max(...d);return(0,K.jsx)(l.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?``:void 0,...r,ref:c,style:{...e.style,[a.startEdge]:f+`%`,[a.endEdge]:p+`%`}})},`SliderRange`)),[xt,St]=st(`SliderThumb`),Ct=`SliderThumbProvider`;function wt(e){let{__scopeSlider:t,name:n,children:r,internal_do_not_use_render:i}=e,a=ut(Ct,t),o=at(t),[s,c]=G.useState(null),l=G.useMemo(()=>s?o().findIndex(e=>e.ref.current===s):-1,[o,s]),u=h(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:jt(f,a.min,a.max);G.useEffect(()=>{if(s)return a.thumbs.add(s),()=>{a.thumbs.delete(s)}},[s,a.thumbs]);let g={value:f,name:p,form:a.form,isFormControl:d,index:l,thumb:s,onThumbChange:c,percent:m,size:u};return(0,K.jsx)(xt,{scope:t,...g,children:Vt(i)?i(g):r})}q(wt,`SliderThumbProvider`);var Tt=`SliderThumbTrigger`,Et=G.forwardRef(q(function(e,t){let{__scopeSlider:n,...r}=e,i=ut(Tt,n),a=pt(Tt,n),{index:s,value:c,percent:u,size:f,onThumbChange:p}=St(Tt,n),m=o(t,p),h=Mt(s,i.values.length),g=f?.[a.size],_=g?Pt(g,u,a.direction):0;return(0,K.jsx)(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[a.startEdge]:`calc(${u}% + ${_}px)`},children:(0,K.jsx)(it.ItemSlot,{scope:n,children:(0,K.jsx)(l.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:d(e.onFocus,()=>{i.valueIndexToChangeRef.current=s})})})})},`SliderThumbTrigger`)),Dt=G.forwardRef(q(function(e,t){let{__scopeSlider:n,name:r,...i}=e;return(0,K.jsx)(wt,{__scopeSlider:n,name:r,internal_do_not_use_render:({index:e,isFormControl:r})=>(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Et,{...i,ref:t,__scopeSlider:n}),r?(0,K.jsx)(kt,{__scopeSlider:n},e):null]})})},`SliderThumb`)),Ot=`SliderBubbleInput`,kt=G.forwardRef(q(function({__scopeSlider:e,...t},n){let{value:r,name:i,form:a}=St(Ot,e),s=G.useRef(null),c=o(s,n),u=w(r);return G.useEffect(()=>{let e=s.current;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(u!==r&&n){let t=new Event(`input`,{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}},[u,r]),(0,K.jsx)(l.input,{style:{display:`none`},name:i,form:a,...t,ref:c,defaultValue:r})},`SliderBubbleInput`));function At(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}q(At,`getNextSortedValues`);function jt(e,t,n){let r=100/(n-t)*(e-t);return E(r,[0,100])}q(jt,`convertValueToPercentage`);function Mt(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}q(Mt,`getLabel`);function Nt(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)}q(Nt,`getClosestValueIndex`);function Pt(e,t,n){let r=e/2;return(r-Lt([0,50],[0,r])(t)*n)*n}q(Pt,`getThumbInBoundsOffset`);function Ft(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}q(Ft,`getStepsBetweenValues`);function It(e,t){if(t>0){let n=Ft(e);return Math.min(...n)>=t}return!0}q(It,`hasMinStepsBetweenValues`);function Lt(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])}}q(Lt,`linearScale`);function Rt(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}q(Rt,`getDecimalCount`);function zt(e,t){let n=10**t;return Math.round(e*n)/n}q(zt,`roundValue`);function Bt(e,{min:t,step:n,direction:r,multiplier:i}){let a=Rt(n),o=(e-t)/n,s=Math.round(o),c=zt(s*n+t,a)===zt(e,a),l;return l=c?s+i*r:r>0?Math.ceil(o):Math.floor(o),zt(l*n+t,a)}q(Bt,`getNextStepValue`);function Vt(e){return typeof e==`function`}q(Vt,`isFunction`);var Ht=i(`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`}]]),Ut=i(`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`}]]),Wt=i(`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`}]]),Gt=i(`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`}]]),Kt=i(`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`}]]),qt=i(`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`}]]),Jt=i(`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`}]]),Yt=i(`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`}]]),Xt=i(`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`}]]),Zt=i(`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`}]]),Qt=i(`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`}]]),$t=i(`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`}]]),en=i(`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`}]]),tn=i(`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`}]]),nn=i(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),rn=i(`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`}]]),an=i(`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`}]]),on=i(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),sn=i(`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`}]]),cn=i(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),ln=i(`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`}]]),un=i(`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`}]]),dn=i(`video`,[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]),J=Ve,Y=Le,X=Pe;function fn(e){return(0,K.jsx)(Be,{density:`compact`,...e})}var pn=`0.5.24`,mn=`https://ling-kong-ran.github.io/pisper/`,hn=`https://github.com/ling-kong-ran/pisper`,gn=`${hn}/blob/release/LICENSE`;function _n({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)(he,{className:`text-[var(--text-muted)] transition-colors group-hover:text-[var(--star-strong)]`,size:14})]})}function vn({update:e}){let{t}=m(),n=e.info?.version||pn;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)(X,{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)(J,{className:`p-5`,children:[(0,K.jsx)(Y,{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)(_n,{href:mn,icon:j,label:t(`config:aboutSettings.website`),value:`ling-kong-ran.github.io/pisper`}),(0,K.jsx)(_n,{href:hn,icon:A,label:t(`config:aboutSettings.sourceCode`),value:`github.com/ling-kong-ran/pisper`}),(0,K.jsx)(_n,{href:gn,icon:rn,label:t(`config:aboutSettings.license`),value:`MIT License`})]})]}),(0,K.jsx)(J,{className:`p-5`,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)(Y,{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:hn,target:`_blank`,rel:`noopener noreferrer`,children:[(0,K.jsx)(sn,{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 yn({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)(dt,{"data-slot":`slider`,defaultValue:t,value:n,min:r,max:i,className:O(`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)(vt,{"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)(bt,{"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)(Dt,{"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 bn(e){window.dispatchEvent(new CustomEvent(`pisper:desktop-pet-changed`,{detail:e}))}function xn({notify:e,requestConfirm:t}){let{t:n}=m(),r=window.pisperDesktop,i=(0,G.useMemo)(()=>r?.getPetStatus?{getStatus:()=>r.getPetStatus(),setEnabled:e=>r.setPetEnabled(e),setOpacity:e=>r.setPetOpacity(e),search:e=>r.searchPets(e),install:e=>r.installPet(e),select:e=>r.selectPet(e),remove:e=>r.removePet(e),openCatalog:()=>void r.openPetdex?.()}:{getStatus:()=>V(`/api/desktop-pet`),setEnabled:e=>V(`/api/desktop-pet/enabled`,{method:`POST`,body:{enabled:e}}),setOpacity:e=>V(`/api/desktop-pet/opacity`,{method:`POST`,body:{opacity:e}}),search:e=>V(`/api/desktop-pet/catalog?query=${encodeURIComponent(e)}`),install:e=>V(`/api/desktop-pet/install`,{method:`POST`,body:{slug:e}}),select:e=>V(`/api/desktop-pet/select`,{method:`POST`,body:{slug:e}}),remove:e=>V(`/api/desktop-pet/${encodeURIComponent(e)}`,{method:`DELETE`}),openCatalog:()=>window.open(`https://petdex.dev`,`_blank`,`noopener,noreferrer`)},[r]),[a,o]=(0,G.useState)(null),[c,l]=(0,G.useState)(``),[u,d]=(0,G.useState)([]),[f,p]=(0,G.useState)(100),[h,g]=(0,G.useState)(``),[_,v]=(0,G.useState)(``),y=(0,G.useCallback)(e=>{o(e),p(Math.round((e.opacity??1)*100))},[]),b=(0,G.useCallback)(async()=>{try{v(``),y(await i.getStatus())}catch(e){v(e instanceof Error?e.message:String(e))}},[y,i]),x=(0,G.useCallback)(async()=>{g(`search`);try{v(``),d(await i.search(c))}catch(e){v(e instanceof Error?e.message:String(e))}finally{g(``)}},[i,c]);(0,G.useEffect)(()=>{b(),i.search(``).then(d).catch(()=>{})},[i,b]);let S=async t=>{let r=a;o(e=>e&&{...e,enabled:t,running:!!(t&&e.installed.length)}),g(`toggle`);try{v(``);let r=await i.setEnabled(t);y(r),bn(r),e(n(t?`config:desktopPetSettings.petEnabled`:`config:desktopPetSettings.petDisabled`))}catch(e){o(r),v(e instanceof Error?e.message:String(e))}finally{g(``)}},C=async e=>{g(`opacity`);try{v(``);let t=await i.setOpacity(e);y(t),bn(t)}catch(e){p(Math.round((a?.opacity??1)*100)),v(e instanceof Error?e.message:String(e))}finally{g(``)}},w=async(t=c)=>{if(t.trim()){g(`install`);try{v(``);let r=await i.install(t);y(r),bn(r),e(n(`config:desktopPetSettings.petInstalled`,{name:r.selectedName||t}))}catch(e){v(e instanceof Error?e.message:String(e))}finally{g(``)}}},T=async t=>{if(t!==a?.selectedSlug){g(`select:${t}`);try{v(``);let r=await i.select(t);y(r),bn(r),e(n(`config:desktopPetSettings.petSelected`,{name:r.selectedName||t}))}catch(e){v(e instanceof Error?e.message:String(e))}finally{g(``)}}},E=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`})){g(`remove:${r.slug}`);try{v(``);let t=await i.remove(r.slug);y(t),bn(t),e(n(`config:desktopPetSettings.petRemoved`,{name:r.name}))}catch(e){v(e instanceof Error?e.message:String(e))}finally{g(``)}}};return(0,K.jsxs)(`div`,{className:`flex w-[min(100%,_760px)] flex-col gap-[12px] desktop-pet-settings`,children:[(0,K.jsxs)(J,{className:`[padding:18px]`,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)(Wt,{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`)})]})]}),a?(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)(Wt,{size:18}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`strong`,{children:n(`config:desktopPetSettings.showOnDesktop`)}),(0,K.jsx)(`small`,{children:a.selectedName?n(`config:desktopPetSettings.currentPet`,{name:a.selectedName}):n(`config:desktopPetSettings.installBeforeEnabling`)})]}),(0,K.jsx)(X,{tone:a.running?`green`:`gray`,children:a.running?n(`config:desktopPetSettings.running`):n(`config:desktopPetSettings.stopped`)}),(0,K.jsx)(fn,{value:a.enabled,disabled:!!h||!a.installed.length,onChange:S,ariaLabel:n(`config:desktopPetSettings.showOnDesktop`)})]}):(0,K.jsxs)(Oe,{className:`[margin-top:15px]`,children:[(0,K.jsx)(H,{className:`animate-spin`,size:16}),(0,K.jsx)(`span`,{children:n(`config:desktopPetSettings.loading`)})]}),a&&(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:[f,`%`]})]}),(0,K.jsx)(yn,{value:[f],min:20,max:100,step:5,disabled:h===`opacity`,onValueChange:([e])=>p(e),onValueCommit:([e])=>void C(e/100),"aria-label":n(`config:desktopPetSettings.opacity`)})]}),_&&(0,K.jsx)(`div`,{className:`text-[var(--danger)] text-[13px] mt-3`,children:_})]}),(0,K.jsxs)(J,{className:`[padding:18px]`,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)(_e,{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:c,onChange:e=>l(e.target.value),onKeyDown:e=>{e.key===`Enter`&&x()},placeholder:n(`config:desktopPetSettings.searchPlaceholder`),"aria-label":n(`config:desktopPetSettings.petSlug`)}),(0,K.jsxs)(s,{size:`lg`,className:`min-w-[104px]`,disabled:h===`search`,onClick:x,children:[h===`search`?(0,K.jsx)(H,{className:`animate-spin`,size:14}):(0,K.jsx)(te,{size:14}),n(`config:desktopPetSettings.search`)]})]}),u.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:u.map(e=>{let t=a?.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:!!h,onClick:()=>t?T(e.slug):w(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)(Wt,{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)(X,{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:i.openCatalog,children:[(0,K.jsx)(he,{size:14}),n(`config:desktopPetSettings.browsePetdex`)]})})]}),a&&a.installed.length>0&&(0,K.jsxs)(J,{className:`[padding:18px]`,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)(Wt,{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:a.installed.map(e=>{let t=e.slug===a.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:!!h,onClick:()=>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)(Wt,{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)(X,{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:!!h,onClick:()=>void E(e),"aria-label":n(`config:desktopPetSettings.delete`),title:n(`config:desktopPetSettings.delete`),children:h===`remove:${e.slug}`?(0,K.jsx)(H,{className:`animate-spin`,size:14}):(0,K.jsx)(ie,{size:14})})]},`${e.source}:${e.slug}`)})})]})]})}function Sn(e,t){return t(e===`en-US`?`config:languageSettings.english`:`config:languageSettings.simplifiedChinese`)}function Cn({notify:e}){let{language:t,setLanguage:n,t:r}=m(),i=r=>{r!==t&&(n(r),e(p(r===`en-US`?`config:languageSettings.displayLanguageChangedToEnglish`:`config:languageSettings.displayLanguageChangedToSimplifiedChinese`,r)))};return(0,K.jsxs)(J,{className:`p-[18px]`,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)(Yt,{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:f.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:Sn(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)(T,{size:15})})]},e.value)})}),(0,K.jsxs)(Oe,{className:`mt-[15px]`,children:[(0,K.jsx)(Yt,{size:16}),(0,K.jsxs)(`span`,{children:[(0,K.jsxs)(`strong`,{children:[r(`config:languageSettings.currentLanguage`),` · `,Sn(t,r)]}),(0,K.jsx)(`small`,{children:r(`config:languageSettings.thisSettingChangesInterfaceTextOnlyItDoesNotControlTheLanguageOfAgentResponses`)})]})]})]})}function wn({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 Tn({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)(T,{size:13})})]},e.value)})})}function En({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 Dn={neutral:`#18181b`,blue:`#1677e8`,teal:`#0f766e`,violet:`#7557c8`,coral:`#c94f5d`,custom:`#1677e8`};function On({notify:e}){let{t}=m(),n=z(e=>e.theme),r=z(e=>e.density),i=z(e=>e.accent),a=z(e=>e.customAccent),o=z(e=>e.fontScale),c=z(e=>e.radius),l=z(e=>e.motion),u=z(e=>e.setTheme),d=z(e=>e.setDensity),f=z(e=>e.setAccent),p=z(e=>e.setCustomAccent),h=z(e=>e.setFontScale),g=z(e=>e.setRadius),_=z(e=>e.setMotion),v=z(e=>e.resetAppearance),y=n!==Ce.theme||r!==Ce.density||i!==Ce.accent||a!==Ce.customAccent||o!==Ce.fontScale||c!==Ce.radius||l!==Ce.motion,[b,x]=(0,G.useState)(a);(0,G.useEffect)(()=>x(a),[a]);let C=De(b),w=!!b.trim()&&!C,E=e=>{x(e);let t=De(e);t&&O(p)(t)},D=()=>e(t(`config:interfaceSettings.preferencesUpdated`)),O=e=>t=>{e(t),D()},k=[{value:`system`,label:t(`config:interfaceSettings.followSystem`),description:t(`config:interfaceSettings.followSystemDescription`),icon:F},{value:`scheduled`,label:t(`config:interfaceSettings.automaticByTime`),description:t(`config:interfaceSettings.automaticByTimeDescription`),icon:S},{value:`light`,label:t(`config:interfaceSettings.light`),description:t(`config:interfaceSettings.lightDescription`),icon:I},{value:`dark`,label:t(`config:interfaceSettings.dark`),description:t(`config:interfaceSettings.darkDescription`),icon:P}],A=[{value:`comfortable`,label:t(`config:interfaceSettings.comfortable`),description:t(`config:interfaceSettings.comfortableDescription`),icon:un},{value:`compact`,label:t(`config:interfaceSettings.compact`),description:t(`config:interfaceSettings.compactDescription`),icon:qt}],j=[{value:`system`,label:t(`config:interfaceSettings.motionSystem`),description:t(`config:interfaceSettings.motionSystemDescription`),icon:F},{value:`full`,label:t(`config:interfaceSettings.motionFull`),description:t(`config:interfaceSettings.motionFullDescription`),icon:Ge},{value:`reduced`,label:t(`config:interfaceSettings.motionReduced`),description:t(`config:interfaceSettings.motionReducedDescription`),icon:Ht}],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`)}],L=[{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)(J,{className:`p-[18px]`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4 max-[650px]:flex-col`,children:[(0,K.jsx)(wn,{icon:Qt,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)(nn,{size:14}),t(`config:interfaceSettings.restoreDefaults`)]})]}),(0,K.jsx)(Tn,{label:t(`config:interfaceSettings.colorMode`),options:k,value:n,onChange:O(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)(Qt,{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:()=>O(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:Dn[e.value]}}),e.label,i===e.value&&(0,K.jsx)(T,{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:De(a)||`#1677e8`,onChange:e=>O(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=>E(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)] ${w?`border-[var(--danger)]`:`border-[var(--stroke)]`}`}),(0,K.jsx)(`span`,{className:`text-[12px] ${w?`text-[var(--danger)]`:`text-[var(--text-muted)]`}`,children:t(w?`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)(ln,{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)(En,{label:t(`config:interfaceSettings.fontSize`),options:N,value:o,onChange:O(h)})]}),(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)(En,{label:t(`config:interfaceSettings.cornerStyle`),options:L,value:c,onChange:O(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)(J,{className:`p-[18px]`,children:[(0,K.jsx)(wn,{icon:Ht,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)(Tn,{label:t(`config:interfaceSettings.interfaceDensity`),options:A,value:r,onChange:O(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)(Tn,{label:t(`config:interfaceSettings.motion`),options:j,value:l,onChange:O(_)})]})]})]}),(0,K.jsx)(Cn,{notify:e})]})}var kn=[[`openai-responses`,`OpenAI Responses`],[`openai-completions`,`OpenAI Chat Completions`],[`anthropic-messages`,`Anthropic Messages`],[`google-generative-ai`,`Google Generative AI`]],An={openai:le,"openai-codex":le,anthropic:Xe,google:Ge,deepseek:A,xai:oe,openrouter:L,"kimi-coding":Ge,"zai-coding-cn":Xe};function jn({providers:e,defaultProviderId:t,toggling:n,onConfigure:r,onToggle:i,onDelete:a,onAddCustom:o}){let{t:c}=m();return(0,K.jsxs)(J,{children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-[8px] [margin-bottom:8px]`,children:[(0,K.jsx)(Y,{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)(Ne,{size:13}),c(`config:configPage.addCustomConnection`)]})]}),(0,K.jsx)(`div`,{className:`grid [grid-template-columns:repeat(auto-fill,minmax(230px,1fr))] gap-[8px]`,children:e.map(e=>{let o=An[e.id]||pe,l=e.type===`visual`,u=e.id===t,d=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:l?void 0:`button`,tabIndex:l?void 0:0,title:l?void 0:c(`config:configPage.configure`),className:O(`flex flex-col gap-[8px] [border:1px_solid_var(--stroke-soft)] rounded-[var(--r-sm)] bg-[var(--surface-subtle)] p-[10px_11px]`,!l&&`cursor-pointer hover:border-[var(--accent-border)] hover:bg-[var(--accent-soft)] focus-visible:outline-2 focus-visible:outline-[var(--focus)]`),onClick:()=>{l||r(e)},onKeyDown:t=>{!l&&(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}),u&&(0,K.jsx)(X,{tone:`green`,children:c(`config:configPage.defaultBadge`)}),l&&(0,K.jsx)(X,{tone:`gray`,children:c(`config:configPage.visualProvider`)})]}),(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:d}),(0,K.jsxs)(`div`,{className:`flex flex-none items-center gap-[6px]`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:[(0,K.jsx)(fn,{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)(ie,{size:13})})]})]})]},e.id)})})]})}function Mn({config:e,onQuickSetup:t,onChangeModel:n}){let{t:r}=m(),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)(J,{className:`[margin-bottom:12px]`,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-[12px]`,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)(le,{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)(X,{tone:`green`,children:[(0,K.jsx)(ve,{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)(Gt,{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 flex-none items-center gap-[7px]`,children:[l&&o&&(0,K.jsxs)(s,{variant:`outline`,className:`bg-surface-subtle`,onClick:n,children:[(0,K.jsx)($t,{size:13}),r(`config:configPage.changeModel`)]}),(0,K.jsxs)(s,{onClick:t,children:[(0,K.jsx)(g,{size:13}),r(`config:configPage.quickSetup`)]})]})]})})}function Nn({onClose:e,onCreated:t,initialProviderType:n=`chat`}){let{t:r}=m(),[i,a]=(0,G.useState)({name:``,id:``,providerType:n,api:`openai-responses`,baseUrl:``,apiKey:``,model:``,modelName:``,modelKind:n===`visual`?`image`:`chat`,reasoning:!0,enabled:!0}),[o,c]=(0,G.useState)(!1),[l,u]=(0,G.useState)(``),d=e=>a(t=>({...t,name:e,id:t.id||e.toLowerCase().replace(/[^a-z0-9._-]+/g,`-`).replace(/^-+|-+$/g,``)})),f=e=>a(t=>({...t,providerType:e,modelKind:e===`visual`?t.modelKind===`image`||t.modelKind===`video`?t.modelKind:`image`:t.modelKind===`chat`?t.modelKind:`chat`}));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:t=>t.target===t.currentTarget&&e(),children:(0,K.jsxs)(`form`,{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(),c(!0),u(``);try{t(await V(`/api/providers`,{method:`POST`,body:JSON.stringify(i)}))}catch(e){u(e instanceof Error?e.message:String(e))}finally{c(!1)}},children:[(0,K.jsxs)(Fe,{children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h2`,{children:r(`config:configPage.addProviderConnection`)}),(0,K.jsx)(`p`,{children:r(`config:configPage.youCanCreateMultipleConnectionsUsingTheSameProtocolEachWithItsOwnKeyAndBaseURL`)})]}),(0,K.jsx)(s,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":r(`config:configPage.closeDialog`),onClick:e,children:(0,K.jsx)(qe,{size:17})})]}),(0,K.jsxs)(`div`,{className:`form-grid grid gap-[9px]`,children:[(0,K.jsxs)(W,{variant:`control`,children:[r(`config:configPage.displayName`),(0,K.jsx)(`input`,{value:i.name,onChange:e=>d(e.target.value),placeholder:r(`config:configPage.forExampleOpenAIOfficial`)})]}),(0,K.jsxs)(W,{variant:`control`,children:[`Provider ID`,(0,K.jsx)(`input`,{value:i.id,onChange:e=>a({...i,id:e.target.value}),placeholder:`openai-official`})]})]}),(0,K.jsxs)(W,{variant:`control`,children:[r(`config:configPage.providerPurpose`),(0,K.jsxs)(D,{value:i.providerType,onChange:e=>f(e.target.value),children:[(0,K.jsx)(`option`,{value:`chat`,children:r(`config:configPage.chatProvider`)}),(0,K.jsx)(`option`,{value:`visual`,children:r(`config:configPage.visualProvider`)})]}),(0,K.jsx)(`small`,{children:i.providerType===`visual`?r(`config:configPage.usedOnlyForImageGenerationVideoGenerationAndImageEditingChatModelsAreIgnored`):r(`config:configPage.usedForAgentChatAndMayAlsoIncludeVisualModels`)})]}),(0,K.jsxs)(W,{variant:`control`,children:[r(`config:configPage.apiProtocol`),(0,K.jsx)(D,{value:i.api,onChange:e=>a({...i,api:e.target.value}),children:kn.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:i.baseUrl,onChange:e=>a({...i,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:i.apiKey,onChange:e=>a({...i,apiKey:e.target.value}),placeholder:r(`config:configPage.enterTheAPIKeyForThisConnection`)})]}),(0,K.jsxs)(`div`,{className:`form-grid grid gap-[9px]`,children:[(0,K.jsxs)(W,{variant:`control`,children:[r(`config:configPage.initialModelID`),(0,K.jsx)(`input`,{value:i.model,onChange:e=>a({...i,model:e.target.value}),placeholder:i.providerType===`visual`?`gpt-image-2 or grok-imagine-video`:`gpt-5.4 or gpt-image-1`})]}),(0,K.jsxs)(W,{variant:`control`,children:[r(`config:configPage.modelName`),(0,K.jsx)(`input`,{value:i.modelName,onChange:e=>a({...i,modelName:e.target.value}),placeholder:r(`config:configPage.leaveBlankToUseTheModelID`)})]})]}),(0,K.jsxs)(W,{variant:`control`,children:[r(`config:configPage.modelType`),(0,K.jsxs)(D,{value:i.modelKind,onChange:e=>a({...i,modelKind:e.target.value}),children:[i.providerType!==`visual`&&(0,K.jsx)(`option`,{value:`chat`,children:r(`config:configPage.chat`)}),(0,K.jsx)(`option`,{value:`image`,children:r(`config:configPage.imageGenerationAndEditing`)}),(0,K.jsx)(`option`,{value:`video`,children:r(`config:configPage.videoGeneration`)})]})]}),(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:r(`config:configPage.enableAfterCreation`)}),(0,K.jsx)(`small`,{children:r(`config:configPage.visualModelsAreSelectedByTheVisualGenerationToolAndDoNotAppearInTheChatModelList`)})]}),(0,K.jsx)(fn,{value:i.enabled,onChange:e=>a({...i,enabled:e})})]}),l&&(0,K.jsxs)(U,{children:[(0,K.jsx)(B,{size:13}),l]}),(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:r(`config:configPage.cancel`)}),(0,K.jsxs)(s,{size:`lg`,disabled:o,children:[o?(0,K.jsx)(H,{className:`animate-spin`,size:14}):(0,K.jsx)(Ne,{size:14}),r(o?`config:configPage.creating`:`config:configPage.createConnection`)]})]})]})})}function Pn(e){return(e.providers||[]).some(e=>e.importable&&!e.imported&&!e.conflict)}function Fn(e,t){return!t&&!Pn(e)}function In(e,t,n){let r=e.providers||[],i=e.errors||[],a=Pn(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 Ln(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 Rn(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 zn(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 Bn({discovery:e,discovering:t,error:n,importing:r,onRefresh:i,onImport:a}){let{t:o}=m(),[c,l]=(0,G.useState)(null),u=e.providers||[],d=e.errors||[];if(!In(e,t,n))return null;let f=c??Fn(e,t),p=()=>(l(null),i()),h=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)(J,{className:`[margin-bottom:12px] [padding:12px_14px]`,children:[(0,K.jsxs)(`div`,{className:`provider-discovery-head [&_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:`provider-discovery-toggle [&_>_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)(pe,{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)(k,{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)(H,{className:`animate-spin`,size:13}):(0,K.jsx)(H,{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)(H,{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=Ln(e),n=r===e.id,i=e.source.startsWith(`claude-`)?Xe:le,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] 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`),` `,`· `,Rn(e,o),` · `,e.location]})]}),(0,K.jsx)(`span`,{className:`flex flex-none items-center`,children:e.imported?(0,K.jsx)(X,{tone:`green`,children:o(`config:configPage.loaded`)}):e.conflict?(0,K.jsx)(X,{tone:`amber`,children:o(`config:configPage.conflictDetected`)}):e.importable?(0,K.jsxs)(s,{type:`button`,disabled:n||!!r,onClick:()=>h(e),children:[n?(0,K.jsx)(H,{className:`animate-spin`,size:12}):(0,K.jsx)(_e,{size:12}),n?o(`config:configPage.loading`):e.kind===`authentication`?o(`config:configPage.loadLoginState`):o(`config:configPage.loadConfiguration`)]}):(0,K.jsx)(X,{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)(pe,{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)(B,{size:13}),n]}),d.map((e,t)=>(0,K.jsxs)(`span`,{children:[(0,K.jsx)(B,{size:13}),Ln(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)(B,{size:13}),Ln(e),` · `,zn(t.code,o)]},`${e.id}-${t.code}-${n}`)))]})]})]})}function Vn(e){let t=e?.models.filter(e=>e.kind===`chat`)||[];return t.find(t=>t.id===e?.defaultModel)||t[0]||null}function Hn({config:e,initialProviderId:t,startAtModels:n,onClose:r,onCompleted:i,onCustomProvider:a}){let{t:o}=m(),c=e.providers.filter(e=>e.type!==`visual`&&e.id!==`openai-codex`),l=t&&c.find(e=>e.id===t)||null,u=!!(l&&n&&l.configured&&l.models.some(e=>e.kind===`chat`)),[d,f]=(0,G.useState)(l?u?3:2:1),[p,h]=(0,G.useState)(l),[g,b]=(0,G.useState)(``),[S,C]=(0,G.useState)(l?.api||`openai-responses`),[w,E]=(0,G.useState)(l?.baseUrl||``),[A,j]=(0,G.useState)(l?.organization||``),[M,N]=(0,G.useState)(u?l:null),[P,F]=(0,G.useState)(()=>u&&Vn(l)?.id||``),[I,L]=(0,G.useState)(!1),[ee,R]=(0,G.useState)(``),[te,ne]=(0,G.useState)(``),[re,ie]=(0,G.useState)(!!l?.custom),ae=(0,G.useRef)(null),oe=()=>ae.current?.value??g,se=e=>{h(e),C(e.api||`openai-responses`),E(e.baseUrl||``),j(e.organization||``),ie(!!e.custom),R(``),f(2)},ce=async()=>{if(!p)return;let e=oe().trim();if(e!==g&&b(e),!e&&!p.configured){R(o(`config:configPage.enterTheAPIKeyForThisConnection`));return}if(p.custom&&!w.trim()){R(o(`config:configPage.enterProviderBaseURLBeforeSaving`));return}L(!0),R(``);try{let t=await V(`/api/providers/${encodeURIComponent(p.id)}/models/discover`,{method:`POST`,body:JSON.stringify({apiKey:e,api:S,baseUrl:w,organization:A,providerType:`chat`})}),n=t.config?.providers.find(e=>e.id===p.id),r=n||(t.models?.length?{...p,models:t.models}:null),i=r?.models.filter(e=>e.kind===`chat`)||[];if(!r||!i.length){R(o(`config:configPage.fetchOrAddAChatModel`));return}N(r);let a=n?Vn(n):i[0];F(a?.id||``),f(3)}catch(e){let t=e instanceof Error?e.message:String(e),n=/\(401\)|\(403\)|鉴权|认证|密钥|API Key/i.test(t),r=p.models.filter(e=>e.kind===`chat`);if(!n&&r.length){N(p),F(Vn(p)?.id||``),ne(t),f(3);return}R(t)}finally{L(!1)}},le=async()=>{let t=P.trim();if(!(!p||!t)){L(!0),R(``);try{i(await V(`/api/config`,{method:`PUT`,body:JSON.stringify({provider:p.id,providerType:`chat`,api:S,baseUrl:w,organization:A,model:t,apiKey:oe(),thinkingLevel:e.thinkingLevel,toolMode:e.toolMode,setAsDefault:!0,enabled:!0})}))}catch(e){R(e instanceof Error?e.message:String(e))}finally{L(!1)}}},z=M?.models.filter(e=>e.kind===`chat`)||[],ue=M?Vn(M)?.id:``,de=p&&An[p.id]||pe;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&&r(),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)(Fe,{children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h2`,{children:o(`config:configPage.quickSetupTitle`)}),(0,K.jsxs)(`p`,{children:[o(`config:configPage.stepIndicator`,{current:d,total:3}),` ·`,` `,o(d===1?`config:configPage.quickSetupStepProvider`:d===2?`config:configPage.quickSetupStepKey`:`config:configPage.quickSetupStepModel`)]})]}),(0,K.jsx)(s,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":o(`config:configPage.closeDialog`),onClick:r,children:(0,K.jsx)(qe,{size:17})})]}),d===1&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`grid grid-cols-2 gap-[8px] max-[520px]:grid-cols-1 [margin-top:12px]`,children:c.map(e=>{let t=An[e.id]||pe;return(0,K.jsxs)(`button`,{type:`button`,className:`flex min-w-0 cursor-pointer items-center gap-[9px] [border:1px_solid_var(--stroke-soft)] rounded-[var(--r-sm)] bg-[var(--surface-subtle)] p-[10px_11px] text-left hover:border-[var(--accent-border)] hover:bg-[var(--accent-soft)]`,onClick:()=>se(e),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.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:e.name}),(0,K.jsx)(`small`,{className:`text-[11px] text-[var(--text-muted)]`,children:e.configured?o(`config:configPage.configured`):o(`config:configPage.apiKeyRequired`)})]}),e.configured&&(0,K.jsx)(ve,{size:14,className:`flex-none text-[var(--success)]`})]},e.id)})}),(0,K.jsx)(`div`,{className:`flex justify-center [margin-top:14px]`,children:(0,K.jsxs)(s,{variant:`ghost`,className:`text-[var(--text-muted)]`,onClick:a,children:[(0,K.jsx)(Ne,{size:14}),o(`config:configPage.addCustomConnection`)]})})]}),d===2&&p&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-[9px] [margin-top:12px] [border:1px_solid_var(--stroke-soft)] rounded-[var(--r-sm)] bg-[var(--surface-subtle)] p-[10px_11px]`,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)(de,{size:16})}),(0,K.jsx)(`strong`,{className:`text-[13px]`,children:p.name}),p.configured&&(0,K.jsx)(X,{tone:`green`,children:o(`config:configPage.configured`)})]}),(0,K.jsx)(`div`,{className:`[margin-top:12px]`,children:(0,K.jsxs)(W,{variant:`control`,children:[`API Key`,(0,K.jsx)(`input`,{ref:ae,type:`password`,autoComplete:`new-password`,autoFocus:!0,value:g,onChange:e=>b(e.target.value),onInput:e=>{let t=e.currentTarget.value;g!==t&&b(t)},placeholder:p.configured?o(`config:configPage.keepExistingKeyBlank`):o(`config:configPage.enterTheAPIKeyForThisConnection`)})]})}),(0,K.jsxs)(y,{open:re,onOpenChange:ie,className:`[margin-top:10px]`,children:[(0,K.jsx)(v,{asChild:!0,children:(0,K.jsxs)(`button`,{type:`button`,className:`group flex w-full cursor-pointer items-center gap-[6px] border-0 bg-transparent p-0 text-left text-[12px] font-[600] text-[var(--text-muted)] hover:text-[var(--text)]`,children:[(0,K.jsx)(k,{size:14,className:`transition-transform group-data-[state=open]:rotate-180`}),(0,K.jsx)(`span`,{children:o(`config:configPage.advancedSettings`)}),(0,K.jsx)(`span`,{className:`font-[400] text-[var(--text-tertiary)]`,children:o(`config:configPage.advancedSettingsHint`)})]})}),(0,K.jsxs)(x,{children:[(0,K.jsxs)(W,{variant:`control`,children:[`Base URL`,(0,K.jsx)(`input`,{value:w,onChange:e=>E(e.target.value),placeholder:o(`config:configPage.defaultEndpointForModelsInThisConnection`)})]}),(0,K.jsxs)(W,{variant:`control`,children:[o(`config:configPage.apiProtocol`),(0,K.jsx)(D,{value:S,onChange:e=>C(e.target.value),children:kn.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:A,onChange:e=>j(e.target.value),placeholder:o(`config:configPage.optionalUsedOnlyForOpenAIOrganization`)})]})]})]})]}),d===3&&M&&(0,K.jsxs)(K.Fragment,{children:[te&&(0,K.jsxs)(Oe,{className:`[margin-top:12px]`,children:[(0,K.jsx)(B,{size:15}),(0,K.jsx)(`span`,{children:(0,K.jsx)(`small`,{children:o(`config:configPage.discoverFailedUsingExisting`,{message:te})})})]}),(0,K.jsx)(`p`,{className:`[margin:12px_0_8px] text-[12px] leading-[1.5] text-[var(--text-muted)]`,children:o(`config:configPage.selectModelToFinish`)}),(0,K.jsx)(`div`,{className:`flex max-h-[260px] flex-col gap-[6px] overflow-y-auto`,children:z.map(e=>(0,K.jsxs)(`button`,{type:`button`,className:O(`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)]`,P===e.id&&`[border-color:var(--accent-border)] bg-[var(--accent-soft)]`),onClick:()=>F(e.id),children:[(0,K.jsx)(`span`,{className:O(`grid w-[16px] h-[16px] flex-none place-items-center rounded-full [border:1px_solid_var(--stroke)] text-transparent`,P===e.id&&`[border-color:var(--brand-blue)] bg-[var(--brand-blue)] text-white`),children:(0,K.jsx)(T,{size:11})}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-[13px]`,children:e.name}),e.id===ue&&(0,K.jsx)(X,{tone:`blue`,children:o(`config:configPage.recommended`)})]},e.id))}),(0,K.jsxs)(W,{variant:`control`,children:[o(`config:configPage.manualModelId`),(0,K.jsx)(`input`,{value:P,onChange:e=>F(e.target.value),placeholder:o(`config:configPage.manualModelIdHint`)})]})]}),ee&&(0,K.jsxs)(U,{children:[(0,K.jsx)(B,{size:13}),ee]}),d>1&&(0,K.jsxs)(`div`,{className:`flex justify-between gap-[8px] [margin-top:18px]`,children:[(0,K.jsxs)(s,{variant:`outline`,size:`lg`,className:`bg-surface-subtle`,disabled:I,onClick:()=>{R(``),f(d-1)},children:[(0,K.jsx)(ge,{size:14}),o(`config:configPage.previousStep`)]}),d===2?(0,K.jsxs)(s,{size:`lg`,disabled:I,onClick:()=>void ce(),children:[I?(0,K.jsx)(H,{className:`animate-spin`,size:14}):(0,K.jsx)(_,{size:14}),o(I?`config:configPage.fetchingModels`:`config:configPage.nextStep`)]}):(0,K.jsxs)(s,{size:`lg`,disabled:I||!P.trim(),onClick:()=>void le(),children:[I?(0,K.jsx)(H,{className:`animate-spin`,size:14}):(0,K.jsx)(T,{size:14}),o(I?`config:configPage.saving`:`config:configPage.saveAndSetDefault`)]})]})]})})}function Un({config:e,notify:t,onConfigChanged:n}){let{t:r}=m(),[i,a]=(0,G.useState)(e.thinkingLevel),[o,c]=(0,G.useState)(e.toolMode),[l,u]=(0,G.useState)(!1),[d,f]=(0,G.useState)(``);(0,G.useEffect)(()=>{a(e.thinkingLevel),c(e.toolMode)},[e.thinkingLevel,e.toolMode]);let p=e.defaultProvider||e.provider,h=e.defaultModel||e.model,g=e.providers.find(e=>e.id===p),_=!!(g?.configured&&h),v=i!==e.thinkingLevel||o!==e.toolMode,y=async()=>{if(!(!g||!h)){u(!0),f(``);try{n(await V(`/api/config`,{method:`PUT`,body:JSON.stringify({provider:g.id,providerType:g.type,api:g.api,baseUrl:g.baseUrl||``,organization:g.organization||``,model:h,thinkingLevel:i,toolMode:o,setAsDefault:!1})})),t(r(`config:configPage.runtimePolicySaved`))}catch(e){f(e instanceof Error?e.message:String(e))}finally{u(!1)}}};return(0,K.jsxs)(J,{children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-[8px]`,children:[(0,K.jsx)(Y,{title:r(`config:configPage.agentRuntimePolicy`)}),(0,K.jsxs)(s,{size:`sm`,className:`h-[27px] px-[10px] text-[12px]`,disabled:l||!v||!_,onClick:()=>void y(),children:[l?(0,K.jsx)(H,{className:`animate-spin`,size:13}):(0,K.jsx)(R,{size:13}),r(l?`config:configPage.saving`:`config:configPage.saveSettings`)]})]}),(0,K.jsxs)(W,{variant:`control`,children:[r(`config:configPage.thinkingLevel`),(0,K.jsx)(D,{value:i,onChange:e=>a(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:[r(`config:configPage.availableTools`),(0,K.jsxs)(D,{value:o,onChange:e=>c(e.target.value),children:[(0,K.jsx)(`option`,{value:`workspace`,children:r(`config:configPage.fileEditingTools`)}),(0,K.jsx)(`option`,{value:`full`,children:r(`config:configPage.fullToolAccess`)}),(0,K.jsx)(`option`,{value:`custom`,children:r(`config:configPage.customManageEachToolOnThePluginsPage`)})]})]}),(0,K.jsxs)(Oe,{children:[(0,K.jsx)(ne,{size:16}),(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`strong`,{children:r(`config:configPage.permissionsAreEnforcedByTheRuntime`)}),(0,K.jsx)(`small`,{children:r(`config:configPage.afterSavingExistingRuntimesAreReleasedAndNewChatsUseTheLatestPolicy`)})]})]}),d&&(0,K.jsxs)(U,{children:[(0,K.jsx)(B,{size:13}),d]})]})}function Wn(e){return e instanceof Error?e.message:String(e)}function Gn({notify:e,requestConfirm:t,t:n}){let[r,i]=(0,G.useState)(null),[a,o]=(0,G.useState)(!0),[s,c]=(0,G.useState)(``),[l,u]=(0,G.useState)(``);return(0,G.useEffect)(()=>{let e=!0;return V(`/api/config`).then(t=>{if(e)return i(t),o(!1),V(`/api/providers/models/refresh`,{method:`POST`,body:`{}`})}).then(t=>{!e||!t?.config||i(t.config)}).catch(t=>{e&&(c(Wn(t)),o(!1))}),()=>{e=!1}},[]),{config:r,loading:a,error:s,toggling:l,applyConfig:(0,G.useCallback)(e=>{i(e),c(``)},[]),toggleProvider:(0,G.useCallback)(async(t,r)=>{u(t.id),c(``);try{let a=await V(`/api/providers/${encodeURIComponent(t.id)}/enabled`,{method:`PUT`,body:JSON.stringify({enabled:r})});i(a),e(n(`config:configPage.nameState`,{name:t.name,state:n(r?`config:configPage.enabled`:`config:configPage.disabled`)}))}catch(e){c(Wn(e))}finally{u(``)}},[e,n]),deleteProvider:(0,G.useCallback)(async r=>{if(await t({title:n(`config:configPage.deleteProviderConnection`),message:n(`config:configPage.deleteNameItsModelSettingsAndAuthenticationDetailsWillAlsoBeRemoved`,{name:r.name}),confirmLabel:n(`config:configPage.delete`)})){c(``);try{let t=await V(`/api/providers/${encodeURIComponent(r.id)}`,{method:`DELETE`});i(t),e(n(`config:configPage.providerConnectionDeleted`))}catch(e){c(Wn(e))}}},[e,t,n])}}function Kn({requestConfirm:e,onImported:t,t:n}){let[r,i]=(0,G.useState)({providers:[],errors:[]}),[a,o]=(0,G.useState)(!0),[s,c]=(0,G.useState)(``),[l,u]=(0,G.useState)(``),[d,f]=(0,G.useState)(``),p=(0,G.useCallback)(async()=>{o(!0),c(``);try{i(await V(`/api/providers/discovery`))}catch(e){c(Wn(e))}finally{o(!1)}},[]);return(0,G.useEffect)(()=>{p()},[p]),{discovery:r,discovering:a,error:s,operationError:l,importing:d,refresh:p,importProvider:(0,G.useCallback)(async r=>{let a=r.source===`codex-config`?`Codex config.toml`:r.source===`claude-config`?`Claude settings.json`:r.source===`codex-auth`?`Codex login`:`Claude login`,o=r.kind===`authentication`;if(await e({title:n(o?`config:configPage.loadLoginState`:`config:configPage.loadProviderConfiguration`),message:n(o?`config:configPage.loadOfficialProviderLoginStateFromSource`:`config:configPage.loadThisProviderConfigurationFromSource`,{source:a}),confirmLabel:n(o?`config:configPage.loadLoginState`:`config:configPage.loadConfiguration`)})){f(r.id),u(``);try{let e=await V(`/api/providers/${encodeURIComponent(r.id)}/import`,{method:`POST`,body:`{}`});i(e.discovery),t(e)}catch(e){u(Wn(e))}finally{f(``)}}},[t,e,n])}}var qn={openai:[{id:`gpt-image-2`,name:`GPT Image 2`,kind:`image`},{id:`sora-2`,name:`Sora 2`,kind:`video`}],google:[{id:`gemini-3-pro-image`,name:`Gemini 3 Pro Image`,kind:`image`},{id:`veo-3.1`,name:`Veo 3.1`,kind:`video`}],xai:[{id:`grok-imagine-image`,name:`Grok Imagine`,kind:`image`}]};function Jn({icon:e,label:t,model:n}){let{t:r}=m();return(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-[9px] [border:1px_solid_var(--stroke-soft)] rounded-[var(--r-sm)] bg-[var(--surface-subtle)] p-[9px_11px]`,children:[(0,K.jsx)(`span`,{className:`grid w-[30px] h-[30px] flex-none place-items-center rounded-[var(--r-xs)] bg-[var(--accent-soft)] text-[var(--star-strong)]`,children:(0,K.jsx)(e,{size:15})}),(0,K.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-[1px]`,children:[(0,K.jsx)(`small`,{className:`text-[11px] text-[var(--text-muted)]`,children:t}),n?(0,K.jsxs)(`strong`,{className:`overflow-hidden text-ellipsis whitespace-nowrap text-[13px]`,children:[n.name,` · `,n.providerName]}):(0,K.jsx)(`span`,{className:`text-[12px] text-[var(--text-tertiary)]`,children:r(`config:configPage.visualNotConfigured`)})]})]})}function Yn({config:e,notify:t,onConfigChanged:n,onAddVisualProvider:i}){let{t:a}=m(),[o,c]=(0,G.useState)(null),[l,u]=(0,G.useState)(!0),[d,f]=(0,G.useState)(``),[p,h]=(0,G.useState)(!1),[_,v]=(0,G.useState)(!1),[y,b]=(0,G.useState)(null),[x,S]=(0,G.useState)(``),C=r(),w=(0,G.useCallback)(async()=>{try{c(await V(`/api/visual/models`)),S(``)}catch(e){S(e instanceof Error?e.message:String(e))}finally{u(!1)}},[]);(0,G.useEffect)(()=>{w()},[w,e]);let E=async(e,r)=>{let i=`${e.id}/${r.id}`;f(i),S(``);try{n(await V(`/api/providers/${encodeURIComponent(e.id)}/models`,{method:`POST`,body:JSON.stringify({id:r.id,name:r.name,kind:r.kind})})),t(a(`config:configPage.visualModelAdded`)),await w()}catch(e){S(e instanceof Error?e.message:String(e))}finally{f(``)}},D=async()=>{h(!0),S(``),b(null);try{b(await V(`/api/visual/test`,{method:`POST`,body:`{}`})),t(a(`config:configPage.testSucceeded`))}catch(e){S(e instanceof Error?e.message:String(e))}finally{h(!1)}},O=async()=>{v(!0),S(``);try{let e=await V(`/api/visual/models`);if(c(e),!e.image){t(a(`config:configPage.visualUnavailableNotify`),`error`);return}ke(``,A)&&C(Ue.chat)}catch(e){S(e instanceof Error?e.message:String(e))}finally{v(!1)}},k=!!(o?.image||o?.video),A=a(`config:configPage.visualExamplePrompt`),j=e.providers.filter(e=>e.configured&&qn[e.id]).flatMap(e=>(qn[e.id]||[]).filter(e=>e.kind===`image`?!o?.image:!o?.video).map(t=>({provider:e,model:t}))),N=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-[7px] [margin-top:10px] text-[12px] text-[var(--text-muted)]`,children:[(0,K.jsx)(`span`,{children:a(`config:configPage.tryExample`)}),(0,K.jsxs)(`button`,{type:`button`,className:`inline-flex max-w-full cursor-pointer items-center gap-[5px] [border:1px_solid_var(--stroke-soft)] rounded-[var(--r-pill)] bg-[var(--surface-subtle)] px-[9px] py-[3px] text-[12px] text-[var(--text)] hover:border-[var(--accent-border)] hover:bg-[var(--accent-soft)]`,title:a(`config:configPage.tryExampleTooltip`),disabled:_,onClick:()=>void O(),children:[(0,K.jsx)(`span`,{className:`overflow-hidden text-ellipsis whitespace-nowrap`,children:A}),_?(0,K.jsx)(H,{size:12,className:`flex-none animate-spin text-[var(--text-muted)]`}):(0,K.jsx)(ee,{size:12,className:`flex-none text-[var(--star-strong)]`})]}),k&&(0,K.jsx)(`span`,{className:`text-[11px] text-[var(--text-tertiary)]`,children:a(`config:configPage.visualOutputHint`)})]});return(0,K.jsxs)(J,{className:`[margin-top:12px]`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-[10px]`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-[10px]`,children:[(0,K.jsx)(`span`,{className:`grid w-[34px] h-[34px] flex-none place-items-center rounded-[var(--r-sm)] bg-[var(--star-soft)] text-[var(--star-strong)]`,children:(0,K.jsx)(Ge,{size:17})}),(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-[1px]`,children:[(0,K.jsx)(Y,{title:a(`config:configPage.visualGeneration`)}),(0,K.jsx)(`span`,{className:`text-[12px] text-[var(--text-muted)]`,children:a(`config:configPage.visualGenerationSubtitle`)})]})]}),o?.image&&(0,K.jsxs)(s,{variant:`outline`,size:`sm`,className:`flex-none bg-surface-subtle`,disabled:p,onClick:()=>void D(),children:[p?(0,K.jsx)(H,{className:`animate-spin`,size:13}):(0,K.jsx)(g,{size:13}),a(p?`config:configPage.testingGeneration`:`config:configPage.testGeneration`)]})]}),l?(0,K.jsxs)(`div`,{className:`flex items-center gap-[8px] [margin-top:12px] text-[12px] text-[var(--text-muted)]`,children:[(0,K.jsx)(H,{className:`animate-spin`,size:13}),a(`config:configPage.loadingVisualStatus`)]}):k?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`grid grid-cols-2 gap-[8px] [margin-top:12px] max-[520px]:grid-cols-1`,children:[(0,K.jsx)(Jn,{icon:M,label:a(`config:configPage.visualImageModel`),model:o?.image}),(0,K.jsx)(Jn,{icon:dn,label:a(`config:configPage.visualVideoModel`),model:o?.video})]}),N,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)(T,{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:a(`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)(K.Fragment,{children:[(0,K.jsx)(`p`,{className:`[margin:10px_0_0] text-[12px] leading-[1.6] text-[var(--text-muted)]`,children:a(`config:configPage.visualEmptyHint`)}),N]}),!l&&(!k||j.length>0)&&(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-[7px] [margin-top:10px]`,children:[!k&&j.length>0&&(0,K.jsx)(`span`,{className:`text-[12px] font-[600] text-[var(--text-muted)]`,children:a(`config:configPage.quickAddVisualModel`)}),j.map(({provider:e,model:t})=>{let n=`${e.id}/${t.id}`;return(0,K.jsxs)(s,{variant:`outline`,size:`sm`,className:`h-[27px] bg-surface-subtle px-[9px] text-[12px]`,disabled:!!d,onClick:()=>void E(e,t),children:[d===n?(0,K.jsx)(H,{className:`animate-spin`,size:12}):(0,K.jsx)(Ne,{size:12}),e.name,` · `,t.name]},n)}),!k&&(0,K.jsxs)(s,{variant:`ghost`,size:`sm`,className:`text-[var(--text-muted)]`,onClick:i,children:[(0,K.jsx)(Ne,{size:13}),a(`config:configPage.newVisualConnection`)]})]}),x&&(0,K.jsxs)(U,{children:[(0,K.jsx)(B,{size:13}),x]})]})}var Xn=`pisper.config.manageConnectionsOpen`;function Zn(){let e=window.localStorage.getItem(Xn);return e===`1`||e!==`0`&&null}function Qn({notify:e,registerPrimaryAction:t,requestConfirm:n}){let{t:r}=m(),[i,a]=(0,G.useState)(null),[o,s]=(0,G.useState)(``),[c,l]=(0,G.useState)(Zn),u=Gn({notify:e,requestConfirm:n,t:r}),{config:d}=u,f=Kn({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(Ze(t,()=>a({})),!d)return(0,K.jsxs)(Re,{children:[(0,K.jsx)(H,{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,h=d.providers.find(e=>e.id===p),g=c??!1,_=e=>{l(e),window.localStorage.setItem(Xn,e?`1`:`0`)},b=e=>a({providerId:e.id,startAtModels:e.configured&&e.models.some(e=>e.kind===`chat`)});return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Mn,{config:d,onQuickSetup:()=>a({}),onChangeModel:()=>h?b(h):a({})}),(0,K.jsxs)(y,{open:g,onOpenChange:_,children:[(0,K.jsx)(v,{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)(k,{size:15,className:`text-[var(--text-muted)] transition-transform group-data-[state=closed]:-rotate-90`}),(0,K.jsx)(`span`,{className:`text-[13px] font-[700] text-[var(--text-secondary)]`,children:r(`config:configPage.manageConnections`)}),(0,K.jsx)(`span`,{className:`text-[12px] text-[var(--text-tertiary)]`,children:r(`config:configPage.manageConnectionsHint`)})]})}),(0,K.jsxs)(x,{children:[(0,K.jsx)(Bn,{discovery:f.discovery,discovering:f.discovering,error:f.error||f.operationError,importing:f.importing,onRefresh:f.refresh,onImport:f.importProvider}),(0,K.jsx)(jn,{providers:d.providers,defaultProviderId:p,toggling:u.toggling,onConfigure:b,onToggle:u.toggleProvider,onDelete:u.deleteProvider,onAddCustom:()=>s(`chat`)}),u.error&&(0,K.jsx)(U,{children:u.error}),(0,K.jsx)(`div`,{className:`[margin-top:12px]`,children:(0,K.jsx)(Un,{config:d,notify:e,onConfigChanged:u.applyConfig})})]})]}),(0,K.jsx)(Yn,{config:d,notify:e,onConfigChanged:u.applyConfig,onAddVisualProvider:()=>s(`visual`)}),i&&(0,K.jsx)(Hn,{config:d,initialProviderId:i.providerId,startAtModels:i.startAtModels,onClose:()=>a(null),onCompleted:t=>{u.applyConfig(t),e(r(`config:configPage.setupComplete`)),a(null)},onCustomProvider:()=>{a(null),s(`chat`)}}),o&&(0,K.jsx)(Nn,{initialProviderType:o,onClose:()=>s(``),onCreated:t=>{u.applyConfig(t),e(r(`config:configPage.providerConnectionCreated`)),s(``),t.createdProviderId&&a({providerId:t.createdProviderId,startAtModels:!1})}})]})}function Z(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 $n(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 er,Q,tr,nr,rr=`__TAURI_TO_IPC_KEY__`;function ir(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}var ar=class{constructor(e){er.set(this,void 0),Q.set(this,0),tr.set(this,[]),nr.set(this,void 0),$n(this,er,e||(()=>{}),`f`),this.id=ir(e=>{let t=e.index;if(`end`in e){t==Z(this,Q,`f`)?this.cleanupCallback():$n(this,nr,t,`f`);return}let n=e.message;if(t==Z(this,Q,`f`)){for(Z(this,er,`f`).call(this,n),$n(this,Q,Z(this,Q,`f`)+1,`f`);Z(this,Q,`f`)in Z(this,tr,`f`);){let e=Z(this,tr,`f`)[Z(this,Q,`f`)];Z(this,er,`f`).call(this,e),delete Z(this,tr,`f`)[Z(this,Q,`f`)],$n(this,Q,Z(this,Q,`f`)+1,`f`)}Z(this,Q,`f`)===Z(this,nr,`f`)&&this.cleanupCallback()}else Z(this,tr,`f`)[t]=n})}cleanupCallback(){window.__TAURI_INTERNALS__.unregisterCallback(this.id)}set onmessage(e){$n(this,er,e,`f`)}get onmessage(){return Z(this,er,`f`)}[(er=new WeakMap,Q=new WeakMap,tr=new WeakMap,nr=new WeakMap,rr)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[rr]()}};function $(e,t){let n=window.__TAURI__?.core?.invoke??window.__TAURI_INTERNALS__?.invoke;return n?n(e,t):Promise.reject(Error(`native bridge unavailable`))}function or(e,t){return $(`plugin:barcode-scanner|${e}`,t)}function sr(e){return e instanceof Error?e.message:String(e)}function cr(e){return/cancel(?:led|ed)/i.test(sr(e))}function lr(){return new Promise(e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))})}function ur(e){return Array.isArray(e)?new TextDecoder().decode(Uint8Array.from(e)):``}function dr(e){if(!e.isActive||!e.port)return null;let t=ur(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=ur(e.txt.name)||e.name||`Pisper Desktop`,a=`https://${r}:${e.port}`;return{id:`${e.fullName}:${a}`,name:i,url:a,fingerprint:t}}function fr(e){return new Promise(t=>window.setTimeout(t,e))}function pr({open:e,onOpenChange:t}){let{t:n}=m(),[r,i]=(0,G.useState)(``),[a,o]=(0,G.useState)(``),[c,l]=(0,G.useState)(``),[u,d]=(0,G.useState)(null),[f,p]=(0,G.useState)(!1),[h,g]=(0,G.useState)([]),[_,v]=(0,G.useState)(!1),[y,b]=(0,G.useState)(``),[x,S]=(0,G.useState)(``),[C,w]=(0,G.useState)(``),T=(0,G.useRef)(!1),E=(0,G.useRef)(!1),D=(0,G.useRef)(!1),O=(0,G.useRef)(0),k=(0,G.useRef)(``),A=(0,G.useCallback)(e=>{T.current=e,p(e)},[]),j=(0,G.useCallback)(async()=>{E.current=!0,T.current&&await or(`cancel`).catch(()=>void 0),A(!1),d(null)},[A]);(0,G.useEffect)(()=>{if(!f)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)}},[f]),(0,G.useEffect)(()=>{if(!f)return;let e=`pisper-scanner-${Date.now()}`;window.history.pushState({...window.history.state,pisperScanner:e},``);let t=()=>void j();return window.addEventListener(`popstate`,t),()=>{window.removeEventListener(`popstate`,t),!D.current&&window.history.state?.pisperScanner===e&&window.history.back()}},[j,f]);let M=e=>{if(!e.proxyUrl)throw Error(n(`config:mobileServer.pairFailed`));window.location.replace(e.proxyUrl)},P=(0,G.useCallback)(async()=>{let e=++O.current;v(!0),b(``),g([]);let t=new ar;t.onmessage=t=>{if(O.current!==e)return;if(t.reason===`permission-denied`){b(n(`config:mobileServer.localNetworkDenied`));return}if(t.reason?.startsWith(`error:`)){b(n(`config:mobileServer.discoveryFailed`));return}if(!t.service)return;if(!t.service.isActive){g(e=>e.filter(e=>!e.id.startsWith(`${t.service?.fullName}:`)));return}let r=dr(t.service);r&&g(e=>[...e.filter(e=>e.fingerprint!==r.fingerprint),r])};let r=null;try{await $(`mobile_ensure_local_network_permission`),r=(await $(`plugin:dns-sd|browse_start`,{options:{service:{type:`pisper`,protocol:`tcp`,domain:`local`},timeoutMs:4e3},channel:t})).browseId,await fr(4300)}catch(t){O.current===e&&b(sr(t).includes(`local_network_permission_denied`)?n(`config:mobileServer.localNetworkDenied`):n(`config:mobileServer.discoveryFailed`))}finally{r!==null&&await $(`plugin:dns-sd|browse_stop`,{browseId:r}).catch(()=>void 0),O.current===e&&v(!1)}},[n]);(0,G.useEffect)(()=>{if(!(!e||f))return P(),()=>{O.current+=1}},[P,e,f]);let F=(0,G.useCallback)(async()=>{let e=k.current;k.current=``,e&&await $(`mobile_cancel_lan_pairing`,{operationId:e}).catch(()=>void 0),d(null),S(``)},[]),I=async e=>{let t=globalThis.crypto?.randomUUID?.()||`lan-${Date.now()}-${Math.random().toString(16).slice(2)}`;k.current=t,d(`lan:${e.id}`),w(``),S(n(`config:mobileServer.awaitingApproval`,{name:e.name}));try{let n=await $(`mobile_pair_lan`,{operationId:t,name:e.name,url:e.url,fingerprint:e.fingerprint,deviceName:null});if(k.current!==t)return;M(n)}catch(e){k.current===t&&w(sr(e))}finally{k.current===t&&(k.current=``,d(null),S(``))}},L=async()=>{E.current=!1,D.current=!1,d(`scan`),w(``);try{let e=await or(`check_permissions`);if(e.camera!==`granted`&&(e=await or(`request_permissions`)),e.camera!==`granted`)throw Error(n(`config:mobileServer.cameraDenied`));if(E.current||(A(!0),await lr(),E.current))return;let t=await or(`scan`,{windowed:!0,formats:[]});if(!t.content)throw Error(n(`config:mobileServer.scanFailed`));D.current=!0,M(await $(`mobile_pair`,{payloadJson:t.content,deviceName:null}))}catch(e){!E.current&&!cr(e)&&w(sr(e))}finally{A(!1),d(null),E.current=!1}},ee=async()=>{d(`manual`),w(``);try{M(await $(`mobile_pair_manual`,{url:r,code:a,fingerprint:c,deviceName:null}))}catch(e){w(sr(e))}finally{d(null)}};return(0,K.jsx)(se,{open:e,onOpenChange:e=>{if(!e&&f){j();return}if(!e&&u?.startsWith(`lan:`)){F(),t(!1);return}u||(e||w(``),t(e))},children:(0,K.jsx)(je,{showCloseButton:!f,overlayClassName:f?`bg-transparent supports-backdrop-filter:backdrop-blur-none`:void 0,className:f?`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:f?e=>e.preventDefault():void 0,children:f?(0,K.jsxs)(`div`,{className:`flex h-dvh w-screen flex-col overflow-hidden`,children:[(0,K.jsxs)(Se,{className:`sr-only`,children:[(0,K.jsx)(me,{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 j(),children:[(0,K.jsx)(ge,{}),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)(an,{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 j(),children:n(`config:mobileServer.cancelScan`)})]})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(Se,{children:[(0,K.jsx)(me,{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)(tn,{className:`size-4`}),n(`config:mobileServer.nearby`)]}),(0,K.jsx)(s,{size:`icon-sm`,variant:`ghost`,disabled:_||u!==null,"aria-label":n(`config:mobileServer.rediscover`),onClick:()=>void P(),children:(0,K.jsx)(H,{className:_?`animate-spin`:void 0})})]}),h.length?(0,K.jsx)(`ul`,{className:`grid max-h-44 gap-1.5 overflow-y-auto`,children:h.map(e=>{let t=u===`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)(pe,{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:u!==null,onClick:()=>void I(e),children:[t?(0,K.jsx)(N,{className:`animate-spin`}):null,n(`config:mobileServer.requestConnect`)]})]},e.id)})}):(0,K.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:n(_?`config:mobileServer.discovering`:`config:mobileServer.noNearby`)}),y?(0,K.jsx)(`p`,{className:`text-xs leading-relaxed text-destructive`,children:y}):null,x?(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:x}),(0,K.jsx)(s,{size:`sm`,variant:`outline`,onClick:()=>void F(),children:n(`config:mobileServer.cancelRequest`)})]}):null]}),(0,K.jsxs)(`div`,{className:`relative py-1`,children:[(0,K.jsx)(Ye,{}),(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:u!==null,onClick:()=>void L(),children:[u===`scan`?(0,K.jsx)(N,{className:`animate-spin`}):(0,K.jsx)(en,{}),n(`config:mobileServer.scan`)]}),(0,K.jsxs)(`div`,{className:`relative py-1`,children:[(0,K.jsx)(Ye,{}),(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.manual`)})]}),(0,K.jsxs)(`form`,{className:`grid gap-3`,onSubmit:e=>{e.preventDefault(),ee()},children:[(0,K.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,K.jsx)(Me,{htmlFor:`mobile-pair-url`,children:n(`config:mobileServer.url`)}),(0,K.jsx)(ce,{id:`mobile-pair-url`,inputMode:`url`,autoCapitalize:`off`,autoCorrect:`off`,placeholder:`https://192.168.1.5:5174`,value:r,onChange:e=>i(e.target.value)})]}),(0,K.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,K.jsx)(Me,{htmlFor:`mobile-pair-code`,children:n(`config:mobileServer.code`)}),(0,K.jsx)(ce,{id:`mobile-pair-code`,autoCapitalize:`characters`,autoCorrect:`off`,placeholder:`ABCD-EFGH`,value:a,onChange:e=>o(e.target.value)})]}),(0,K.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,K.jsx)(Me,{htmlFor:`mobile-pair-fingerprint`,children:n(`config:remoteAccess.fingerprint`)}),(0,K.jsx)(ce,{id:`mobile-pair-fingerprint`,autoCapitalize:`characters`,autoCorrect:`off`,placeholder:`SHA256:1BA3FEB1`,value:c,onChange:e=>l(e.target.value)})]}),C?(0,K.jsx)(`p`,{className:`text-xs leading-relaxed text-destructive`,children:C}):null,(0,K.jsx)(xe,{className:`mt-1`,children:(0,K.jsxs)(s,{type:`submit`,disabled:u!==null||!r||!a||!c,children:[u===`manual`?(0,K.jsx)(N,{className:`animate-spin`}):null,n(`config:mobileServer.pair`)]})})]})]})})})}function mr(e,t){let n=window.__TAURI__?.core?.invoke??window.__TAURI_INTERNALS__?.invoke;return n?n(e,t):Promise.reject(Error(`native bridge unavailable`))}function hr(){let{t:e}=m(),[t,n]=(0,G.useState)(null),[r,i]=(0,G.useState)(``),[a,o]=(0,G.useState)(``),[c,l]=(0,G.useState)(!1),u=(0,G.useCallback)(async()=>{try{n(await mr(`mobile_state`)),i(``)}catch{i(e(`config:mobileServer.loadFailed`))}},[e]);(0,G.useEffect)(()=>{u()},[u]);let d=async(e,t,r=``)=>{o(r||e);try{n(await mr(e,t)),i(``)}catch(e){i(String(e))}finally{o(``)}},f=async e=>{o(e);try{let t=await mr(`mobile_select_server`,{id:e});n(t),i(``),t.proxyUrl&&window.location.replace(t.proxyUrl)}catch(e){i(String(e))}finally{o(``)}},p=t?.mode===`local`;return(0,K.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,K.jsx)(pr,{open:c,onOpenChange:l}),(0,K.jsxs)(J,{className:`flex flex-col gap-3 p-4`,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)(be,{size:19})}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h2`,{className:`text-[16px]`,children:e(`config:mobileServer.title`)}),(0,K.jsx)(`p`,{className:`mt-1 text-[13px] leading-[1.55] text-[var(--text-muted)]`,children:e(`config:mobileServer.description`)})]})]}),(0,K.jsxs)(s,{size:`sm`,onClick:()=>l(!0),children:[(0,K.jsx)(Ne,{size:14}),e(`config:mobileServer.addServer`)]})]}),r?(0,K.jsx)(`p`,{className:`text-[12px] text-[var(--danger)]`,children:r}):null]}),(0,K.jsx)(J,{className:`flex flex-col gap-3 p-4`,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)(on,{size:19})}),(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`h2`,{className:`flex items-center gap-2 text-[16px]`,children:[e(`config:mobileServer.localTitle`),p?(0,K.jsx)(`span`,{className:`text-[11px] text-[var(--star-strong)]`,children:e(`config:mobileServer.currentLocal`)}):null]}),(0,K.jsx)(`p`,{className:`mt-1 text-[13px] leading-[1.55] text-[var(--text-muted)]`,children:e(`config:mobileServer.localDescription`)})]})]}),(0,K.jsx)(s,{size:`sm`,variant:`outline`,disabled:p||a===`mobile_enter_local`,onClick:()=>void(async()=>{o(`mobile_enter_local`);try{let e=await mr(`mobile_enter_local`);e.onDevice.url&&window.location.replace(e.onDevice.url)}catch(e){i(String(e))}finally{o(``)}})(),children:e(p?`config:mobileServer.currentLocal`:`config:mobileServer.enterLocal`)})]})}),(0,K.jsx)(J,{className:`flex flex-col gap-3 p-4`,children:t?.servers?.length?(0,K.jsx)(`ul`,{className:`flex flex-col gap-2`,children:t.servers.map(n=>{let r=t.mode===`remote`&&n.id===t.activeId,i=n.endpoints.find(e=>e.url),o=n.endpoints.find(e=>e.t===`iroh`),c=i?.url||(o?.nodeId?`Iroh ${o.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`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,K.jsx)(pe,{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:[n.name,r?(0,K.jsx)(`span`,{className:`ml-2 text-[11px] text-[var(--star-strong)]`,children:e(`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:e(i&&o?`config:mobileServer.transportLanP2p`:o?`config:mobileServer.transportP2p`:`config:mobileServer.transportLan`)})]}),r&&t.activeTransport?(0,K.jsx)(`div`,{className:`text-[11px] text-[var(--star-strong)]`,children:e(`config:mobileServer.activeTransport`,{transport:t.activeTransport===`iroh`?e(`config:mobileServer.transportP2p`):e(`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`,disabled:a===n.id,onClick:()=>void f(n.id),children:e(`config:mobileServer.connect`)}),(0,K.jsx)(s,{size:`sm`,variant:`ghost`,"aria-label":e(`config:mobileServer.forget`),onClick:()=>{window.confirm(e(`config:mobileServer.forgetConfirm`))&&d(`mobile_forget_server`,{id:n.id},n.id)},children:(0,K.jsx)(ie,{size:14})})]})]},n.id)})}):(0,K.jsx)(`p`,{className:`text-[12px] text-[var(--text-muted)]`,children:e(`config:mobileServer.empty`)})})]})}var gr={feishu:{tone:`blue`},weixin:{tone:`green`},browser:{tone:`blue`}};function _r(e,t){return t(e===`feishu`?`config:notificationSettings.feishu`:e===`weixin`?`config:notificationSettings.weChat`:`config:notificationSettings.browserNotification`)}function vr(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 yr(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 br(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 xr(){return typeof window<`u`&&window.pisperDesktop?.showNotification?window.pisperDesktop.getNotificationStatus?`checking`:`granted`:typeof window<`u`&&He()?`checking`:We()}function Sr(e,t){return t(e===`system-disabled`||e===`app-disabled`?`config:notificationSettings.systemNotificationsAreOffAllowPisperToSendNotificationsInYourOperatingSystemSettings`:e===`unsupported`?`config:notificationSettings.systemNotificationsAreNotSupportedInThisEnvironment`:`config:notificationSettings.theOperatingSystemDidNotAcceptTheNotificationCheckYourSystemNotificationSettings`)}function Cr(e){return e instanceof Error?e.message:String(e)}function wr({notify:e,onBrowserNotificationChange:t}){let{t:n}=m(),[r,i]=(0,G.useState)({browser:{enabled:!1},connections:{},scopes:[],templates:[]}),[a,o]=(0,G.useState)(!0),[c,l]=(0,G.useState)(``),u=!!window.pisperDesktop?.showNotification,d=He(),[f,p]=(0,G.useState)(xr),[h,g]=(0,G.useState)(!1),_=(0,G.useCallback)(async()=>{if(!u)return;let e=window.pisperDesktop?.getNotificationStatus;if(!e){p(`granted`);return}try{let t=await e(),n=t?.permission;p(n==="default"||n===`denied`||n===`granted`||n===`checking`||n===`unsupported`?n:t?.supported===!1?`unsupported`:`granted`)}catch{p(`unsupported`)}},[u]),v=(0,G.useCallback)(async()=>{try{l(``);let e=await V(`/api/settings/notifications`);i(e),t?.(e)}catch(e){l(Cr(e))}finally{o(!1)}},[t]);(0,G.useEffect)(()=>{v()},[v]),(0,G.useEffect)(()=>{if(!u)return;_();let e=()=>{_()};return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},[u,_]);let y=(0,G.useCallback)(async()=>{if(!(u||!d))try{let e=await Je();p(e===!0?`granted`:e===!1?`denied`:`default`)}catch{p(`unsupported`)}},[u,d]);(0,G.useEffect)(()=>{if(u||!d)return;y();let e=()=>void y();return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},[u,d,y]);let b=async r=>{let a=``;if(r){if(u&&f!==`granted`)a=Sr(`system-disabled`,n);else if(!u&&d){let e=`denied`;try{let t=await Je()===!0?`granted`:await Ke();e=t===`granted`?`granted`:t===`denied`?`denied`:`default`}catch{e=`unsupported`}p(e),e!==`granted`&&(a=n(`config:notificationSettings.systemNotificationsAreOffAllowPisperToSendNotificationsInYourOperatingSystemSettings`))}else if(!u){let e=await fe();if(p(e),e!==`granted`)a=n(e===`unsupported`?`config:notificationSettings.systemNotificationsAreNotSupportedInThisEnvironment`:`config:notificationSettings.notificationPermissionWasNotGrantedAllowNotificationsInTheBrowserSiteSettings`);else try{await we()}catch{a=n(`config:notificationSettings.theBrowserBackgroundNotificationServiceCouldNotBeRegistered`)}}}g(!0);try{let o=await V(`/api/settings/notifications/browser`,{method:`PATCH`,body:JSON.stringify({enabled:r})});i(o),t?.(o),a?e(n(`config:notificationSettings.savedButLocalDeliveryUnavailable`,{reason:a}),`info`):e(n(r?`config:notificationSettings.notificationsEnabled`:`config:notificationSettings.notificationsDisabled`))}catch(t){e(Cr(t),`error`)}finally{g(!1)}},x=(0,G.useCallback)(async(e,t,r=`pisper-browser-test`)=>{if(u){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 p(i.permission??`denied`),Error(Sr(i.reason,n));return i}return d?(await Ae(e,t),{shown:!0,transport:`tauri`}):ue({title:e,body:t,tag:r,url:window.location.href})},[u,d,n]),S=async()=>{if(f!==`granted`){e(f===`unsupported`?Sr(`unsupported`,n):u?Sr(`system-disabled`,n):n(`config:notificationSettings.notificationPermissionWasNotGrantedAllowNotificationsInTheBrowserSiteSettings`),`error`);return}try{await x(n(`config:notificationSettings.appNotificationTest`,{app:Qe}),n(`config:notificationSettings.notificationsAreWorking`)),e(n(`config:notificationSettings.theTestNotificationWasSentCheckYourSystemNotificationCenter`),`info`)}catch(t){e(Cr(t)||n(`config:notificationSettings.theOperatingSystemDidNotAcceptTheNotificationCheckYourSystemNotificationSettings`),`error`)}},C=async()=>{try{await window.pisperDesktop?.openNotificationSettings?.()||e(n(`config:notificationSettings.openNotificationPermissionsInYourOperatingSystemSettings`),`info`)}catch{e(n(`config:notificationSettings.openNotificationPermissionsInYourOperatingSystemSettings`),`info`)}};if(a)return(0,K.jsxs)(Re,{children:[(0,K.jsx)(H,{className:`animate-spin`,size:23}),(0,K.jsx)(`h2`,{children:n(`config:notificationSettings.loadingNotificationSettings`)})]});let w=n(f===`granted`?`config:notificationSettings.permissionGranted`:f===`denied`?u?`config:notificationSettings.systemNotificationsAreOff`:`config:notificationSettings.browserNotificationsAreBlocked`:f===`unsupported`?`config:notificationSettings.notSupported`:f===`checking`?`config:notificationSettings.checking`:`config:notificationSettings.waitingForPermission`),T=f===`granted`?`green`:f==="default"||f===`checking`?`amber`:`red`;return(0,K.jsxs)(`div`,{className:`flex flex-col gap-[12px]`,children:[c&&(0,K.jsxs)(U,{children:[(0,K.jsx)(B,{size:13}),c]}),(0,K.jsxs)(J,{className:`browser-notification-card`,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)] ${r.browser.enabled?`blue`:``}`,children:r.browser.enabled?(0,K.jsx)(Ee,{size:18}):(0,K.jsx)(Ut,{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)(X,{tone:T,children:w}),(0,K.jsx)(fn,{value:r.browser.enabled,disabled:h||f===`checking`,onChange:b})]}),(0,K.jsxs)(Oe,{children:[(0,K.jsx)(ne,{size:15}),(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`strong`,{children:n(u?`config:notificationSettings.controlledByOperatingSystemNotificationSettings`:`config:notificationSettings.controlledByBrowserSitePermissions`)}),(0,K.jsx)(`small`,{children:n(u?`config:notificationSettings.theDesktopAppUsesOperatingSystemNotificationsTurningThisOffDoesNotChangeTheOperatingSystemPermis`:`config:notificationSettings.theWebAppUsesBrowserSiteNotificationsTurningThisOffDoesNotChangeTheBrowserPermissionItself`)})]})]}),(0,K.jsxs)(`div`,{className:`mt-[15px] flex gap-2 max-[650px]:flex-wrap`,children:[u&&f===`denied`&&(0,K.jsxs)(s,{variant:`outline`,size:`lg`,className:`bg-surface-subtle`,onClick:C,children:[(0,K.jsx)(ne,{size:14}),n(`config:notificationSettings.openSystemNotificationSettings`)]}),(0,K.jsxs)(s,{variant:`outline`,size:`lg`,className:`bg-surface-subtle`,disabled:!r.browser.enabled||f!==`granted`,onClick:S,children:[(0,K.jsx)(Ee,{size:14}),n(`config:notificationSettings.sendTestNotification`)]})]})]}),(0,K.jsx)(Tr,{data:r,setData:i,notify:e,permission:f,onBrowserTest:x,onSettingsChange:t})]})}function Tr({data:e,setData:t,notify:n,permission:r,onBrowserTest:i,onSettingsChange:a}){let{t:o}=m(),[c,l]=(0,G.useState)(e.templates[0]?.id||``),[u,d]=(0,G.useState)(`feishu`),f=e.templates.find(e=>e.id===c)||e.templates[0],p=f?.channels?.[u],[h,g]=(0,G.useState)(p?.content||``),[_,v]=(0,G.useState)(!1),y=e.scopes.find(e=>e.platform===u),x=u===`browser`?e.browser.enabled&&r===`granted`:!!y,S=gr;return(0,G.useEffect)(()=>{g(p?.content||``)},[c,u,p?.content]),f?(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)(J,{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)(Y,{title:o(`config:notificationSettings.notificationTemplates`)}),(0,K.jsx)(`span`,{children:o(`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===f.id?`selected`:``}`,onClick:()=>l(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)(b,{size:14})}),(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`strong`,{children:vr(e.id,e.name,o)}),(0,K.jsx)(`small`,{children:yr(e.id,e.description,o)})]}),(0,K.jsx)(X,{tone:e.enabled?`green`:`gray`,children:e.enabled?o(`config:notificationSettings.enabled`):o(`config:notificationSettings.disabled`)})]},e.id))]}),(0,K.jsxs)(J,{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)(Fe,{children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h2`,{children:vr(f.id,f.name,o)}),(0,K.jsx)(`p`,{children:yr(f.id,f.description,o)})]}),(0,K.jsx)(fn,{value:f.enabled,onChange:e=>t(t=>({...t,templates:t.templates.map(t=>t.id===f.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(3,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:u===t?`active`:``,onClick:()=>d(t),children:[_r(t,o),(0,K.jsx)(X,{tone:r?n.tone:`gray`,children:o(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:[o(`config:notificationSettings.messageContent`),(0,K.jsx)(`textarea`,{value:h,onChange:e=>g(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:o(`config:notificationSettings.availableVariables`)}),f.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:o(`config:notificationSettings.preview`)}),(0,K.jsx)(`pre`,{children:br(h,o)})]}),(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:_||!x,onClick:async()=>{v(!0);try{let e=await V(`/api/settings/notifications/templates/${encodeURIComponent(f.id)}/${u}/test`,{method:`POST`,body:`{}`});u===`browser`&&await i?.(e.title||vr(f.id,f.name,o),e.body||e.preview||``,`pisper-template-${f.id}`),n(o(u===`browser`?`config:notificationSettings.theTestNotificationWasSentCheckYourSystemNotificationCenter`:`config:notificationSettings.testNotificationSentToCountChats`,{count:e.sent}))}catch(e){n(Cr(e),`error`)}finally{v(!1)}},children:[(0,K.jsx)(b,{size:14}),o(`config:notificationSettings.sendTest`)]}),(0,K.jsxs)(s,{size:`lg`,disabled:_||!h.trim(),onClick:async()=>{v(!0);try{let e=await V(`/api/settings/notifications/templates/${encodeURIComponent(f.id)}/${u}`,{method:`PUT`,body:JSON.stringify({enabled:f.enabled,content:h})});t(e),a?.(e),n(o(`config:notificationSettings.notificationTemplateSaved`))}catch(e){n(Cr(e),`error`)}finally{v(!1)}},children:[_?(0,K.jsx)(H,{className:`animate-spin`,size:14}):(0,K.jsx)(R,{size:14}),o(`config:notificationSettings.saveTemplate`)]})]})]})]}):null}function Er({notify:e}){let{t,language:n}=m(),[r,i]=(0,G.useState)(null),[a,o]=(0,G.useState)([]),[c,l]=(0,G.useState)([]),[u,d]=(0,G.useState)(null),[f,p]=(0,G.useState)(!1),[h,g]=(0,G.useState)(``),[_,v]=(0,G.useState)(``),[y,b]=(0,G.useState)(!1),[x,S]=(0,G.useState)(``),C=(0,G.useCallback)(async()=>{try{let[e,t,n]=await Promise.all([V(`/api/remote/status`),V(`/api/remote/devices`),V(`/api/remote/pairing-requests`).catch(()=>({requests:[]}))]);i(e),o(t.devices.filter(e=>!e.revokedAt)),l(n.requests),S(``)}catch{S(t(`config:remoteAccess.loadFailed`))}},[t]);(0,G.useEffect)(()=>{C()},[C]),(0,G.useEffect)(()=>{if(!r?.listening)return;let e=window.setInterval(()=>void C(),2e3);return()=>window.clearInterval(e)},[C,r?.listening]);let w=async n=>{b(!0);try{await V(`/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||(d(null),p(!1),g(``)),await C()}catch(n){e(t(`config:remoteAccess.toggleFailed`,{message:String(n)}),`error`)}finally{b(!1)}},E=async()=>{b(!0),g(``);try{let e=await V(`/api/remote/pairing-code`,{method:`POST`});if(!e?.code||!e?.expiresAt)throw Error(t(`config:remoteAccess.qrUnavailable`));d(e),p(!0),e.qrDataUrl||g(t(`config:remoteAccess.qrUnavailable`))}catch(n){let r=t(`config:remoteAccess.pairingFailed`,{message:String(n)});g(r),e(r,`error`)}finally{b(!1)}},D=async(n,r)=>{v(n.id);try{await V(`/api/remote/pairing-requests/${encodeURIComponent(n.id)}/decision`,{method:`POST`,body:{approved:r}}),await C()}catch(n){e(t(`config:remoteAccess.approvalFailed`,{message:String(n)}),`error`)}finally{v(``)}},O=async n=>{if(window.confirm(t(`config:remoteAccess.revokeConfirm`,{name:n.name})))try{await V(`/api/remote/devices/${encodeURIComponent(n.id)}/revoke`,{method:`POST`}),await C()}catch(n){e(t(`config:remoteAccess.revokeFailed`,{message:String(n)}),`error`)}};return x?(0,K.jsx)(J,{className:`p-4 text-[13px] text-[var(--text-muted)]`,children:x}):r?(0,K.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,K.jsx)(se,{open:f&&u!==null,onOpenChange:p,children:(0,K.jsxs)(je,{className:`sm:max-w-md`,children:[(0,K.jsxs)(Se,{children:[(0,K.jsx)(me,{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:[u?.qrDataUrl?(0,K.jsx)(`img`,{src:u.qrDataUrl,alt:t(`config:remoteAccess.qrAlt`),className:`size-64 max-w-full rounded-[var(--r-sm)] bg-white p-2`}):null,h?(0,K.jsx)(`p`,{className:`text-center text-[12px] leading-relaxed text-[var(--danger)]`,children:h}):null,u?(0,K.jsxs)(`div`,{className:`text-center`,children:[(0,K.jsx)(`div`,{className:`font-mono text-[20px] tracking-[0.2em]`,children:u.code}),(0,K.jsx)(`div`,{className:`mt-1 text-[11px] text-[var(--text-muted)]`,children:t(`config:remoteAccess.codeExpiresAt`,{time:Te(u.expiresAt,n)})})]}):null]}),(0,K.jsx)(xe,{children:(0,K.jsxs)(s,{disabled:y,onClick:()=>void E(),children:[y?(0,K.jsx)(N,{className:`animate-spin`}):(0,K.jsx)(H,{}),t(y?`config:remoteAccess.generatingQr`:`config:remoteAccess.regenerate`)]})})]})}),(0,K.jsxs)(J,{className:`flex flex-col gap-3 p-4`,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)(be,{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)(fn,{value:r.enabled&&r.listening,disabled:y,onChange:e=>void w(e),ariaLabel:t(`config:remoteAccess.title`)})]}),r.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:r.error})}):null]}),r.listening&&c.length?(0,K.jsxs)(J,{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)(on,{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:c.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:_===e.id,onClick:()=>void D(e,!1),children:[(0,K.jsx)(qe,{}),t(`config:remoteAccess.reject`)]}),(0,K.jsxs)(s,{size:`sm`,disabled:_===e.id,onClick:()=>void D(e,!0),children:[_===e.id?(0,K.jsx)(N,{className:`animate-spin`}):(0,K.jsx)(T,{}),t(`config:remoteAccess.approve`)]})]})]},e.id))})]}):null,r.listening?(0,K.jsxs)(J,{className:`flex flex-col gap-3 p-4`,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)(en,{size:16}),t(`config:remoteAccess.pairing`)]}),(0,K.jsxs)(s,{size:`sm`,disabled:y,onClick:()=>void E(),children:[y?(0,K.jsx)(N,{className:`animate-spin`}):(0,K.jsx)(en,{}),t(y?`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`)}),h&&!f?(0,K.jsx)(`p`,{className:`text-[12px] leading-relaxed text-[var(--danger)]`,"aria-live":`polite`,children:h}):null]}):null,(0,K.jsxs)(J,{className:`flex flex-col gap-3 p-4`,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)(on,{size:16}),t(`config:remoteAccess.devices`)]}),(0,K.jsx)(s,{size:`sm`,variant:`ghost`,onClick:()=>void C(),"aria-label":t(`config:remoteAccess.refresh`),children:(0,K.jsx)(H,{size:14})})]}),a.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:a.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 Dr({notify:e}){let{t}=m(),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,h=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)(J,{className:`[padding:18px] cli-settings-card`,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)(cn,{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)(X,{tone:r?.installed&&!r.needsRepair?`green`:r?.needsRepair?`blue`:`gray`,children:h})]}),r&&(0,K.jsxs)(Oe,{className:`[margin-top:15px] cli-settings-status [&_small]:[overflow-wrap:anywhere]`,children:[r.installed&&!r.needsRepair?(0,K.jsx)(ve,{size:16}):(0,K.jsx)(cn,{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)(H,{className:`animate-spin`,size:14}):(0,K.jsx)(ie,{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)(H,{className:`animate-spin`,size:14}):r?.needsRepair?(0,K.jsx)(ae,{size:14}):(0,K.jsx)(_e,{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 Or=`0.5.24`,kr=9e5,Ar=2592e6;function jr(){try{let e=JSON.parse(localStorage.getItem(a.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 Mr(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 Nr(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 Pr({notify:e,update:t}){let{t:n,language:r}=m(),i=t?.info||{desktop:!1,packaged:!1,version:Or,platform:`browser`,arch:``},o=t?.status||{state:`idle`},c=!!i.desktop,l=!!i.mobile,u=c||l,[d,f]=(0,G.useState)({version:Or,date:``,notes:``}),[p,h]=(0,G.useState)([]),[g,v]=(0,G.useState)(``),[y,b]=(0,G.useState)(jr);(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)=>V(`/api/sponsors/settings-updates?locale=${encodeURIComponent(r)}${t?`&refresh=1`:``}`).then(t=>{e&&h(Array.isArray(t.campaigns)?t.campaigns:[])}).catch(()=>{e&&!t&&h([])});t();let n=window.setInterval(()=>void t(!0),kr);return()=>{e=!1,window.clearInterval(n)}},[r]);let x=e=>{let t={...y,[e]:Date.now()+Ar};b(t);try{localStorage.setItem(a.sponsorDismissals,JSON.stringify(t))}catch{}},S=async()=>{if(t){v(`check`);try{await t.check()}finally{v(``)}}},w=()=>t?.openReleases(),T=()=>t?.openUpdateLog?.(),E=async()=>{v(c?`install`:``);try{c?await t?.installComponents():await t?.download()}catch(t){e(t instanceof Error?t.message:String(t),`error`)}finally{v(``)}},D=()=>t?.install(),O=d.version===i.version?d:null,k=o.notes||(u?O?.notes||n(`config:updateSettings.noReleaseNotesAreAvailableForThisVersion`):o.state===`current`?n(`config:updateSettings.theCurrentWebSourceIsSyncedWithBranch`,{branch:o.branch||`main`}):n(`config:updateSettings.commitsThatHaveNotBeenSyncedWillAppearHereAfterTheCheck`)),A=o.state===`available`,j=o.state===`error`&&o.canResume&&o.canDownload,M=o.state===`downloaded`,N=o.state===`checking`||g===`check`,P=o.state===`downloading`||g===`install`,F=N?`checking`:P?`downloading`:o.state,I=u?`v${i.version}`:`v${i.version}${o.currentCommit?` · ${o.currentCommit.slice(0,7)}`:``}`,L=u?`v${o.availableVersion||O?.version||i.version}`:o.availableCommit?.slice(0,7)||o.currentCommit?.slice(0,7)||d.version||i.version,ee=p.filter(e=>(y[e.id]||0)<=Date.now()),R=(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`?i.version:`--`,availableVersion:``,message:``,releaseUrl:``,notes:``,size:0,transferred:0,canInstall:!1,restartRequired:!1})},[i.version,t.components]),te=(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(j?`config:updateSettings.downloadPaused`:`config:updateSettings.checkFailed`),`red`]})[F]||[n(`config:updateSettings.notChecked`),`gray`],[u,F,j,n]);return(0,K.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[880px] flex-col gap-3`,children:[(0,K.jsxs)(J,{className:`p-5`,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)(Zt,{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)(X,{tone:te[1],children:te[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:I})]}),(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:Mr(i,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)(B,{className:`mt-0.5 shrink-0`,size:15}):(0,K.jsx)(Xt,{className:`mt-0.5 shrink-0`,size:15}),(0,K.jsx)(`span`,{children:o.message})]}),j&&(0,K.jsx)(`small`,{className:`mt-2 block text-[12px] text-[var(--text-muted)]`,children:n(`config:updateSettings.downloadedDataWasPreservedAndCanResumeFromTheInterruptionPoint`)}),P&&(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),`% · `,Nr(o.transferred,r),` /`,` `,Nr(o.total,r)]})]}),(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:N||P||!!g,onClick:M?D:A||j?E:S,children:[N||P?(0,K.jsx)(H,{className:`animate-spin`,size:14}):M?(0,K.jsx)(de,{size:14}):A||j?o.canDownload?(0,K.jsx)(_e,{size:14}):(0,K.jsx)(he,{size:14}):(0,K.jsx)(H,{size:14}),N||P?n(P&&c?`config:updateSettings.installingUpdates`:`config:updateSettings.checking2`):M?n(`config:updateSettings.restartAndInstall`):j?n(`config:updateSettings.resumeDownload`):A?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:w,children:[(0,K.jsx)(he,{size:14}),u?`GitHub Releases`:`GitHub Compare`]}),c&&(0,K.jsxs)(s,{variant:`outline`,size:`lg`,className:`bg-surface-subtle`,onClick:T,children:[(0,K.jsx)(he,{size:14}),n(`config:updateSettings.viewUpdateDiagnosticLog`)]})]}),!l&&(0,K.jsxs)(`div`,{className:`mt-6 border-t border-[var(--border)] pt-5`,children:[(0,K.jsx)(Y,{title:n(`config:updateSettings.appComponents`)}),(0,K.jsx)(`div`,{className:`mt-3 divide-y divide-[var(--border)]`,children:R.map(e=>{let t=e.component===`desktop`?Xt:e.component===`tui`?re:Kt,i=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:i}),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)(_,{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:Nr(e.size,r)})]}),(0,K.jsx)(X,{tone:a,children:o})]},e.component)})})]})]}),!l&&(0,K.jsx)(Dr,{notify:e}),(0,K.jsxs)(J,{className:`p-5`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsx)(Y,{title:n(u?A||j||M||P?`config:updateSettings.newVersionReleaseNotes`:`config:updateSettings.currentReleaseNotes`:A?`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)(ve,{size:13}),A||j||M||P?L:u?`v${O?.version||i.version}`:o.currentCommit?.slice(0,7)||n(`config:updateSettings.notChecked`)]})]}),(o.releaseDate||u&&O?.date)&&(0,K.jsx)(`small`,{className:`mt-2 block text-[12px] text-[var(--text-muted)]`,children:new Intl.DateTimeFormat(r,{dateStyle:`long`}).format(new Date(o.releaseDate||O?.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)(C,{children:k})})]}),ee.length>0&&(0,K.jsxs)(J,{className:`p-5`,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)(Jt,{size:19})}),(0,K.jsxs)(`span`,{className:`min-w-0`,children:[(0,K.jsx)(Y,{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:ee.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)(X,{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)(he,{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:()=>x(e.id),children:(0,K.jsx)(qe,{size:15})})]},e.id))})]})]})}function Fr({notify:e,registerPrimaryAction:t,section:n,onBrowserNotificationChange:r,requestConfirm:i,update:a}){let o;return o=n===`notifications`?(0,K.jsx)(wr,{notify:e,onBrowserNotificationChange:r}):n===`interface`?(0,K.jsx)(On,{notify:e}):n===`desktop-pet`?(0,K.jsx)(xn,{notify:e,requestConfirm:i}):n===`mobile-server`?(0,K.jsx)(hr,{}):n===`remote-access`?(0,K.jsx)(Er,{notify:e}):n===`updates`?(0,K.jsx)(Pr,{notify:e,update:a}):n===`about`?(0,K.jsx)(vn,{update:a}):(0,K.jsx)(Qn,{notify:e,registerPrimaryAction:t,requestConfirm:i}),o}export{Fr 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 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,t as n}from"./vendor-react-CHuvPdJE.js";import{n as r,s as i,t as a}from"./button-DzlQCSNK.js";import{d as o,f as s,h as c,m as l,p as u,t as d}from"./use-i18n-CYAA2G_0.js";import{u as f}from"./es2015-D5Xsi_dj.js";import{n as p}from"./dist-QkD6B9bR.js";import{n as m}from"./AppSelect-C8CfPey8.js";import{t as h}from"./utils-C8uzG5AZ.js";import{t as g}from"./copy-DO0sQBgx.js";import{n as _,t as v}from"./vendor-markdown-plugins-DCl4I7Pz.js";import{i as y,n as b,r as ee,t as te}from"./vendor-markdown-CWK5AVhB.js";import{n as x,r as S,t as C}from"./vendor-shiki-runtime-CxE5QolQ.js";var w=e(t(),1),T=n(),E=Object.defineProperty,D=(e,t)=>E(e,`name`,{value:t,configurable:!0}),O=`Collapsible`,[k,ne]=l(O),[re,A]=k(O),ie=w.forwardRef(D(function(e,t){let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:s,...l}=e,[u,d]=o({prop:r,defaultProp:i??!1,onChange:s,caller:O});return(0,T.jsx)(re,{scope:n,disabled:a,contentId:p(),open:u,onOpenToggle:w.useCallback(()=>d(e=>!e),[d]),children:(0,T.jsx)(c.div,{"data-state":M(u),"data-disabled":a?``:void 0,...l,ref:t})})},`Collapsible`)),ae=`CollapsibleTrigger`,oe=w.forwardRef(D(function(e,t){let{__scopeCollapsible:n,...r}=e,i=A(ae,n);return(0,T.jsx)(c.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":M(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:u(e.onClick,i.onOpenToggle)})},`CollapsibleTrigger`)),j=`CollapsibleContent`,se=w.forwardRef(D(function(e,t){let{forceMount:n,...r}=e,i=A(j,e.__scopeCollapsible);return(0,T.jsx)(f,{present:n||i.open,children:({present:e})=>(0,T.jsx)(ce,{...r,ref:t,present:e})})},`CollapsibleContent`)),ce=w.forwardRef(D(function(e,t){let{__scopeCollapsible:n,present:r,children:a,...o}=e,l=A(j,n),[u,d]=w.useState(r),f=w.useRef(null),p=i(t,f),m=w.useRef(0),h=m.current,g=w.useRef(0),_=g.current,v=l.open||u,y=w.useRef(v),b=w.useRef(void 0);return w.useEffect(()=>{let e=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(e)},[]),s(()=>{let e=f.current;if(e){b.current=b.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();m.current=t.height,g.current=t.width,y.current||(e.style.transitionDuration=b.current.transitionDuration,e.style.animationName=b.current.animationName),d(r)}},[l.open,r]),(0,T.jsx)(c.div,{"data-state":M(l.open),"data-disabled":l.disabled?``:void 0,id:l.contentId,hidden:!v,...o,ref:p,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":_?`${_}px`:void 0,...e.style},children:v&&a})},`CollapsibleContentImpl`));function M(e){return e?`open`:`closed`}D(M,`getState`);var N=ie,P=r(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),F=r(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),I=r(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),L=r(`wand-sparkles`,[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]]);function R({...e}){return(0,T.jsx)(N,{"data-slot":`collapsible`,...e})}function z({...e}){return(0,T.jsx)(oe,{"data-slot":`collapsible-trigger`,...e})}function B({...e}){return(0,T.jsx)(se,{"data-slot":`collapsible-content`,...e})}var V=[`github-dark`,`github-dark`],H=150,U=new Set([`text`,`txt`,`plain`,`plaintext`]),W=new Map;for(let e of x){W.set(e.id,e.id);for(let t of e.aliases??[])W.set(t,e.id)}function G(e){return typeof e==`string`?e:e.name??`custom`}function le(e){let t=String(e||``).trim().toLowerCase();return W.get(t)??`text`}function ue(e,t,n){return`${t}:${G(n[0])}:${G(n[1])}:${e.length}:${e.slice(0,64)}:${e.slice(-64)}`}var K=new Map;function de(e){let t=K.get(e);return t&&(K.delete(e),K.set(e,t)),t}function fe(e,t){for(K.delete(e),K.set(e,t);K.size>H;){let e=K.keys().next().value;if(e===void 0)break;K.delete(e)}}var q=null,J=new Map;function pe(){return q??=S({themes:[...V],langs:[],engine:C({forgiving:!0})}),q}function me(e,t){if(U.has(t)||e.getLoadedLanguages().includes(t))return Promise.resolve();let n=x.find(e=>e.id===t);if(!n)return Promise.resolve();let r=J.get(t);return r||(r=e.loadLanguage(()=>n.import().then(e=>e.default)).catch(e=>{throw J.delete(t),e}),J.set(t,r)),r}var Y=new Map;function he(){return{name:`shiki`,type:`code-highlighter`,supportsLanguage(e){return W.has(String(e||``).trim().toLowerCase())},getSupportedLanguages(){return x.map(e=>e.id)},getThemes(){return V},highlight({code:e,language:t,themes:n},r){let i=le(t),a=ue(e,i,n),o=de(a);if(o)return o;let s=Y.get(a),c=!!s;return s||(s=new Set,Y.set(a,s)),r&&s.add(r),c||(async()=>{try{let t=await pe();await me(t,i);let r=t.getLoadedLanguages().includes(i)?i:`text`,o=t.codeToTokens(e,{lang:r,themes:{light:n[0],dark:n[1]}});fe(a,o);let s=Y.get(a);if(Y.delete(a),s)for(let e of s)e(o)}catch(e){Y.delete(a),console.error(`[streamdown] Failed to highlight code:`,e)}})(),null}}}var ge=he(),_e={cjk:_,code:ge,math:v};function ve(){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=b(n.slice(i)),o=[...t.slice(0,-1),...a];return e=n,t=o,o}return e=n,t=b(n),t}}var ye={a:Ce,code:Oe,img:we,strong:Te,table:Ee},be=!1,xe={linkMode:`text-only`};function X(e){return typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map(X).join(``):(0,w.isValidElement)(e)?X(e.props.children):``}function Se(e){return String(e||``).match(/language-([\w-]+)/)?.[1]||`text`}function Z(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 Ce({children:e,node:t,className:n,href:r,...i}){let a=X(e).trim()?e:r;return r?(0,T.jsx)(`a`,{...i,className:h(`markdown-link`,n),href:r,target:`_blank`,rel:`noopener noreferrer`,children:a}):(0,T.jsx)(`span`,{className:h(`markdown-link`,n),children:a})}function we({node:e,...t}){return(0,T.jsx)(`img`,{loading:`lazy`,...t})}function Te({node:e,...t}){return(0,T.jsx)(`strong`,{...t})}function Ee({node:e,...t}){return(0,T.jsx)(`table`,{...t})}function Q({source:e}){let{t}=d(),[n,r]=(0,w.useState)(!1);return(0,T.jsxs)(a,{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 Z(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,T.jsx)(m,{size:13}):(0,T.jsx)(g,{size:13}),t(n?`common:markdownMessage.copied`:`common:markdownMessage.copy`)]})}function De({language:e,source:t}){return(0,T.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,T.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,T.jsx)(`span`,{className:`ml-1 font-mono lowercase`,children:e}),(0,T.jsx)(Q,{source:t})]}),(0,T.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,T.jsx)(`pre`,{className:`bg-transparent`,children:(0,T.jsx)(`code`,{children:t})})})]})}function Oe({children:e,className:t,node:n,...r}){let i=y();if(!Object.hasOwn(r,`data-block`))return(0,T.jsx)(`code`,{className:t||``,...r,children:e});let a=X(e).replace(/\n$/,``),o=Se(t);return i?(0,T.jsx)(De,{language:o,source:a}):(0,T.jsx)(ee,{code:a,isIncomplete:i,language:o,lineNumbers:!1,children:(0,T.jsx)(Q,{source:a})})}function ke({children:e,className:t,streaming:n=!1}){let r=String(e??``),[i]=(0,w.useState)(()=>ve());return(0,T.jsx)(`div`,{className:h(`markdown-body`,n&&`markdown-streaming`,t),"aria-busy":n||void 0,children:(0,T.jsx)(te,{className:`markdown-content space-y-0`,components:ye,controls:be,isAnimating:n,lineNumbers:!1,mode:`streaming`,parseMarkdownIntoBlocksFn:i,plugins:_e,remend:xe,children:r})})}var $=(0,w.memo)(ke);$.displayName=`MarkdownMessage`;export{L as a,P as c,z as i,R as n,I as o,B as r,F as s,$ as t};
|