@forsion/unit 2.12.2 → 2.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -0
- package/backendWorker.mjs +6 -2
- package/main.mjs +991 -497
- package/package.json +1 -1
- package/release.json +5 -5
- package/web/assets/ArtificialView-XwHMLUFb.js +1 -0
- package/web/assets/{AutomationBuilder-sxWdUa0L.js → AutomationBuilder-hqs0QhMt.js} +1 -1
- package/web/assets/CalendarConfigView-DKib8Oed.js +1 -0
- package/web/assets/CalendarView-DJ5iOzvu.js +1 -0
- package/web/assets/CapabilityMenu-SwVlZ06x.js +1 -0
- package/web/assets/{CheckboxInput-BsaoUHZ0.js → CheckboxInput-BC-5a_C9.js} +1 -1
- package/web/assets/Chrome-HdfyYV3i.js +1 -0
- package/web/assets/{CodeView-j065KtVh.js → CodeView-CFL6yQ-6.js} +3 -3
- package/web/assets/DashboardGridView-B9DCWYVb.js +17 -0
- package/web/assets/{EventCard-BmDQkEj9.js → EventCard-B_ndpqH_.js} +1 -1
- package/web/assets/ExcalidrawCanvas-BQ4KKLJP.js +1 -0
- package/web/assets/{FloatingToc-CENybkAA.js → FloatingToc-Ce9GamvH.js} +1 -1
- package/web/assets/HomepageView-RCOfcVbE.js +1 -0
- package/web/assets/ImageStudioPanels-lkS_y2uM.js +3 -0
- package/web/assets/ImageStudioView-UPv52acl.js +1 -0
- package/web/assets/InlineFiles-CQbQumkf.js +1 -0
- package/web/assets/MarkdownBlock--__nPQGh.css +1 -0
- package/web/assets/MarkdownBlock-CkqiwPXa.js +58 -0
- package/web/assets/ModelPill-CY-rU1RU.js +2 -0
- package/web/assets/MuseLibraryView-CtTHlVnT.js +2 -0
- package/web/assets/{MuseView-d-iBk3sc.js → MuseView-CC2A7MBs.js} +2 -2
- package/web/assets/{PageHistoryPanel-CR-k1AM7.js → PageHistoryPanel-KhKT1DLy.js} +2 -2
- package/web/assets/PdfAnnotator-C_kglLCA.css +1 -0
- package/web/assets/PdfAnnotator-DUyrgY-t.js +505 -0
- package/web/assets/{ProductView-u2aezVsl.js → ProductView-CgsIYZqD.js} +1 -1
- package/web/assets/RightPanel-BHDgqTFs.js +4 -0
- package/web/assets/RunLocationPicker-BE5mxnab.css +1 -0
- package/web/assets/RunLocationPicker-DBnXYV5B.js +38 -0
- package/web/assets/{SidebarRow-BuSkKH5q.js → SidebarRow-BAJxbMcx.js} +1 -1
- package/web/assets/{SketchCard-D87GADyG.js → SketchCard-BGYz-bXP.js} +5 -5
- package/web/assets/{StudioGuestSurface-BijU_EEb.js → StudioGuestSurface-lt6znmkl.js} +1 -1
- package/web/assets/{TodoListView-DPPVpPUn.js → TodoListView-DPKhee6i.js} +1 -1
- package/web/assets/{Tooltip-DY4ISA-e.js → Tooltip-ZxrDqN4p.js} +1 -1
- package/web/assets/UnifiedPage-BX6ZQL0h.js +68 -0
- package/web/assets/UnifiedPage-CWXc_mo1.css +1 -0
- package/web/assets/{amadeus-manual.en-DWaN2fPs.js → amadeus-manual.en-DzRWr4BL.js} +18 -18
- package/web/assets/{amadeus-manual.zh--7D5TS8X.js → amadeus-manual.zh-DW32DkL7.js} +18 -18
- package/web/assets/{appStore-Dg9WALEA.js → appStore-DWP8UET9.js} +208 -122
- package/web/assets/appStore-wtOILggO.css +1 -0
- package/web/assets/{arrow-up-right-CpQs92mu.js → arrow-up-right-DrCXuWS7.js} +1 -1
- package/web/assets/{astryxBridge-BZhaZPs4.js → astryxBridge-D-m4_kYt.js} +3 -3
- package/web/assets/automationListSource-C8BNy6RY.js +1 -0
- package/web/assets/book-open-OLNm7OaB.js +1 -0
- package/web/assets/{calendarNavStore-C7fGRpoH.js → calendarNavStore-Cylfvv3s.js} +1 -1
- package/web/assets/{canvasPrefs-BeG4oEgP.js → canvasPrefs-8taQ42Cz.js} +1 -1
- package/web/assets/chatBoxSurface-CIlzs45H.js +1 -0
- package/web/assets/{circle-question-mark-WL3vbp-Z.js → circle-question-mark-XbAFplz1.js} +1 -1
- package/web/assets/{circle-x-D7s-M5sB.js → circle-x-fcReAZaE.js} +1 -1
- package/web/assets/{client-BSKpsyAw.js → client-0MPbodA6.js} +1 -1
- package/web/assets/{code-xml-BALV9u_c.js → code-xml-Cuna8Kh4.js} +1 -1
- package/web/assets/{codeStudioStore-C2mWfm32.js → codeStudioStore-BBU62GTy.js} +1 -1
- package/web/assets/codingNavigation-CZB4v1ZW.css +1 -0
- package/web/assets/codingNavigation-DDlPpPk5.js +47 -0
- package/web/assets/{create-4xUyKtAF.js → create-BGtEfCcg.js} +4 -4
- package/web/assets/dashboardSurface-BYM3C7WG.js +1 -0
- package/web/assets/{deskCapture-Df701U8L.js → deskCapture-BiUCmqfc.js} +1 -1
- package/web/assets/{diff2html-BV-zCH4d.js → diff2html-BNp2FTbk.js} +1 -1
- package/web/assets/{docx-preview-DW4IyU_Q.js → docx-preview-CFznGVOU.js} +1 -1
- package/web/assets/{emoji-DGaxpCIu.js → emoji-6zl4yfOS.js} +1 -1
- package/web/assets/floatingTocSurface-DreXPCa6.js +1 -0
- package/web/assets/{foldActions-B7KByFdN.js → foldActions-05QcQziQ.js} +1 -1
- package/web/assets/folder-BpsfOHD4.js +1 -0
- package/web/assets/{folder-plus-D1TDb7k9.js → folder-plus-BeQHr4AZ.js} +1 -1
- package/web/assets/gestures-DQBCcK4y.js +1 -0
- package/web/assets/{hand-Crrw-nSn.js → hand-Bko7ms15.js} +1 -1
- package/web/assets/{hard-drive-BbyVSbfP.js → hard-drive-BpuI5ebj.js} +1 -1
- package/web/assets/i18n-ecQQxiMQ.css +1 -0
- package/web/assets/i18n.generated-BuLjnmY8.js +15 -0
- package/web/assets/imageStudio--KF9gwHA.css +1 -0
- package/web/assets/imageStudio-BLVNKmEG.js +2 -0
- package/web/assets/{index-DKhyDkGB.js → index-BF10xp_K.js} +1 -1
- package/web/assets/{index-C7U6T-k8.js → index-BHm6K743.js} +1 -1
- package/web/assets/{index-CF4RV4mh.js → index-BM2o7PeV.js} +90 -90
- package/web/assets/{index-Brik2pf9.js → index-BgnNNv3e.js} +1 -1
- package/web/assets/{index--drOLtq7.js → index-C0Gy2NQ6.js} +1 -1
- package/web/assets/{index-CflzrdSt.js → index-C1doZp5H.js} +1 -1
- package/web/assets/{index-SZ5waGAq.js → index-C4L6vjd_.js} +1 -1
- package/web/assets/{index-Cmr7gVZQ.js → index-CD3yIkOA.js} +1 -1
- package/web/assets/{index-BYsdKR_1.js → index-CJeUgjPU.js} +1 -1
- package/web/assets/{index-CzM-C2Sd.js → index-CLHoq1w-.js} +1 -1
- package/web/assets/{index-tAXBa_fN.js → index-CUZI62qU.js} +1 -1
- package/web/assets/{index-C6GJulug.js → index-Cff42k7q.js} +1 -1
- package/web/assets/index-Ck_O3Jdd.js +1 -0
- package/web/assets/index-CuiYK18N.js +1 -0
- package/web/assets/{index-BRW82CsP.js → index-CwcOeZdT.js} +1 -1
- package/web/assets/{index-DUWR2nZi.js → index-D6AycQIz.js} +1 -1
- package/web/assets/{index-BCZZVJ_w.js → index-D7gVhvNY.js} +1 -1
- package/web/assets/{index-DjzSBM0U.js → index-D9UZQy42.js} +1 -1
- package/web/assets/{index-KL5Rj9kP.js → index-DuBQ0j2g.js} +1 -1
- package/web/assets/{index-Dg9oixs4.js → index-OD1gSX3h.js} +1 -1
- package/web/assets/{index-gPSbFSUn.js → index-Uo5tswys.js} +1 -1
- package/web/assets/{index-D1f_JwPH.js → index-o8cj0pRH.js} +1 -1
- package/web/assets/{index-OHi69jDq.js → index-rHjhbwvm.js} +1 -1
- package/web/assets/{index-CqyM6tQ0.js → index-rggq2czF.js} +1 -1
- package/web/assets/{index-Czu_bbDM.js → index-sCXThwqZ.js} +1 -1
- package/web/assets/{invitePage-lLQ-e0pj.js → invitePage-b0HGvMj6.js} +1 -1
- package/web/assets/{ipc-DQOD2UKk.js → ipc-CxAyeo8q.js} +1 -1
- package/web/assets/{jszip.min-DZxV9uZ_.js → jszip.min-B94KpE21.js} +1 -1
- package/web/assets/launchpad-C2c1MSVX.css +1 -0
- package/web/assets/{layout-grid-B_pjJwz4.js → layout-grid-BBVuEdWG.js} +1 -1
- package/web/assets/{linkFollow-C0_3k_PC.js → linkFollow-B7ivDZMM.js} +4 -4
- package/web/assets/{list-tree-DkAJYEXd.js → list-tree-4-0QDbLu.js} +1 -1
- package/web/assets/{listFold-BsOVn9UZ.js → listFold-DLuxXiIj.js} +1 -1
- package/web/assets/{lock-BnGHxjeE.js → lock-CnbZm4vo.js} +1 -1
- package/web/assets/{log-out-DBuMeqik.js → log-out-BEynWaHa.js} +1 -1
- package/web/assets/{main-NgUPPqDn.css → main-BiS_5wrB.css} +1 -1
- package/web/assets/main-sIq2N9Z5.js +20 -0
- package/web/assets/markdownEditorSurface-ZSJ3RHAv.js +3 -0
- package/web/assets/mdMarkStore-DQHDjG7s.js +2 -0
- package/web/assets/{mdMarks-Bq7Hl-4C.js → mdMarks-DbIcRa0O.js} +1 -1
- package/web/assets/{message-square-plus-BiAZAvcw.js → message-square-plus-CpiKDvle.js} +1 -1
- package/web/assets/{messages-BH5MfQdZ.js → messages-_jta1lSI.js} +1 -1
- package/web/assets/minus-C9ndHJ9O.js +1 -0
- package/web/assets/mobileEntry-CPmU_c4m.js +13 -0
- package/web/assets/nativeDownload-BYT082bY.js +1 -0
- package/web/assets/{pageChrome-xLNdFaSg.css → pageChrome-CovzZPdb.css} +1 -1
- package/web/assets/pageChrome-D3Niv1JM.js +1 -0
- package/web/assets/{pageTree-CZH2J6cc.js → pageTree-CgfvpzIj.js} +2 -2
- package/web/assets/{pen-tool-lkmBqliH.js → pen-tool-BXEFnU2i.js} +1 -1
- package/web/assets/{pencil-Cvk91P_Z.js → pencil-cqvCkekG.js} +1 -1
- package/web/assets/pluginChat-BbBukMuN.js +2 -0
- package/web/assets/{redo-2-DSi54z4e.js → redo-2-BO7wCDwy.js} +1 -1
- package/web/assets/{rotate-ccw-CUlnplr0.js → rotate-ccw-BvipPIjC.js} +1 -1
- package/web/assets/{sharePage-MM6UpPJ9.js → sharePage-XbN50US7.js} +2 -2
- package/web/assets/{shareViewer-CDZ8lTdy.js → shareViewer-BaYogetW.js} +1 -1
- package/web/assets/{star-CwDiGyUW.js → star-BQWMXnn7.js} +1 -1
- package/web/assets/tableSurface-BXqqidd1.js +1 -0
- package/web/assets/{terminal-DIXogYJY.js → terminal-l9k6RDrH.js} +1 -1
- package/web/assets/{terminalView-B3aZSsrQ.js → terminalView-Cpnt5_0P.js} +1 -1
- package/web/assets/theme-C6D3tMGV.css +1 -0
- package/web/assets/type-CFoaj2eD.js +1 -0
- package/web/assets/{undo-2-tUKCv5Gs.js → undo-2-DusxpdLa.js} +1 -1
- package/web/assets/{unitAccount-D8lVwaaT.js → unitAccount-DwutFPPw.js} +1 -1
- package/web/assets/{unitBridge-D547ublk.js → unitBridge-CcgQpkqV.js} +1 -1
- package/web/assets/{unitCloudTransport-BVF6lVp4.js → unitCloudTransport-vA7cLDts.js} +1 -1
- package/web/assets/{unitOwnerAccess-BfnEjsZb.js → unitOwnerAccess-LBlJ1YfA.js} +1 -1
- package/web/assets/{unitShim-DxetRgmP.js → unitShim-B_M9IrbC.js} +3 -3
- package/web/assets/{upload-BbeAsMuD.js → upload-ZrOj6tXA.js} +1 -1
- package/web/assets/userSpaces-uJOnsedR.js +1 -0
- package/web/assets/viewportLock-D3SNkwS2.js +631 -0
- package/web/assets/viewportLock-IP1zaVkz.css +1 -0
- package/web/assets/{workflow-DuoVRSSX.js → workflow-DPoG4QE2.js} +1 -1
- package/web/assets/{zoom-in-hr5bRpDL.js → zoom-in-lbTgzdQP.js} +1 -1
- package/web/index.html +232 -13
- package/web/assets/ArtificialView-B4ESD4iK.js +0 -1
- package/web/assets/CalendarConfigView-cCfo_EvZ.js +0 -1
- package/web/assets/CalendarView-wgLapctk.js +0 -1
- package/web/assets/CapabilityMenu-BQBsM638.js +0 -1
- package/web/assets/ChatView-BIUk0OJd.css +0 -1
- package/web/assets/ChatView-C-jCJnyS.js +0 -47
- package/web/assets/Chrome-CwFiDmre.js +0 -1
- package/web/assets/DashboardGridView-DXqe0vPd.js +0 -17
- package/web/assets/ExcalidrawCanvas-C3egkikA.js +0 -1
- package/web/assets/HomepageView-CRdhjLXu.js +0 -1
- package/web/assets/ImageStudioPanels-Dke7xf8E.js +0 -3
- package/web/assets/ImageStudioView-g38V8gaj.js +0 -1
- package/web/assets/InlineFiles-C_hjvn3u.js +0 -1
- package/web/assets/MarkdownBlock-DIjYEhTK.js +0 -56
- package/web/assets/ModelPill-BPlgovPo.js +0 -1
- package/web/assets/MuseLibraryView-CenyTTim.js +0 -2
- package/web/assets/PdfAnnotator-CGzC_o1Q.css +0 -1
- package/web/assets/PdfAnnotator-D79ip27w.js +0 -560
- package/web/assets/RightPanel-C3OJTIqT.js +0 -4
- package/web/assets/RunLocationPicker-BNcZ7KKF.css +0 -1
- package/web/assets/RunLocationPicker-CTYXUH2z.js +0 -34
- package/web/assets/UnifiedPage-CKNtVD_n.js +0 -57
- package/web/assets/UnifiedPage-DX_sTpyZ.css +0 -1
- package/web/assets/appStore-Di8LXuJ9.css +0 -1
- package/web/assets/automationListSource-DP5xZBxo.js +0 -1
- package/web/assets/chatBoxSurface-zvcyfrxE.js +0 -1
- package/web/assets/dashboardSurface-CFTH5z4c.js +0 -1
- package/web/assets/ellipsis-r1EcXsFq.js +0 -1
- package/web/assets/floatingTocSurface-C6RJ6i41.js +0 -1
- package/web/assets/folder-DlxnPmWY.js +0 -1
- package/web/assets/frame-_xBVYe3P.js +0 -1
- package/web/assets/gestures-CkW1Kfs9.js +0 -1
- package/web/assets/i18n-D-eU58uw.css +0 -1
- package/web/assets/i18n.generated-Bbsz16cl.js +0 -15
- package/web/assets/imageStudio-BqbNOvpu.css +0 -1
- package/web/assets/imageStudio-C_Rs630L.js +0 -2
- package/web/assets/index-BCubCwdT.js +0 -1
- package/web/assets/index-DZfZTksa.js +0 -1
- package/web/assets/main-Dki8NlsT.js +0 -21
- package/web/assets/markdownEditorSurface-B4PeUzed.js +0 -3
- package/web/assets/mdMarkStore-CsKl7C8O.js +0 -2
- package/web/assets/minus-Cyv1YzOU.js +0 -1
- package/web/assets/mobileEntry-Bd_nKr0D.js +0 -13
- package/web/assets/nativeDownload-D-f1_L2S.js +0 -1
- package/web/assets/pageChrome-C9_azUYW.js +0 -1
- package/web/assets/panel-left-rOc8As0s.js +0 -1
- package/web/assets/pen-line-m6_HvWZ9.js +0 -1
- package/web/assets/sticky-note-BIuPUSOU.js +0 -1
- package/web/assets/tableSurface-Y_JBQsuz.js +0 -1
- package/web/assets/theme-DfEi_DND.css +0 -1
- package/web/assets/type-Cqoabh7H.js +0 -1
- package/web/assets/userSpaces-DyyAn7vj.js +0 -1
- package/web/assets/viewportLock-C4SX-9PO.js +0 -103
- package/web/assets/viewportLock-DYSe7Jsn.css +0 -1
- package/web/assets/waves-horizontal-B8ZpHQ5H.js +0 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./appStore-DWP8UET9.js","./index-BM2o7PeV.js","./nativeDownload-BYT082bY.js","./ipc-CxAyeo8q.js","./client-0MPbodA6.js","./appStore-wtOILggO.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{d as c,j as t,r as Qe,u as ge,t as En,_ as Le,f as fs,L as hs}from"./index-BM2o7PeV.js";import{c as gs}from"./client-0MPbodA6.js";import{f as bs,g as ws,L as Cn,T as vs,C as an,W as ks,h as xs,u as ys,j as Ss,s as js,k as Es,a as Cs,b as Nn,D as Ns,A as In,F as Te,S as Ln,M as Tn,c as Mn,B as Is,P as Dn,d as Ls,N as Ts,l as Ms,m as Ds,i as Rs,e as As}from"./viewportLock-D3SNkwS2.js";import{F as ie,M as Ps,G as Os,I as zs,J as Fs,L as _s,P as $s,K as Bs,N as Ws,R as Vs,U as qs,T as Hs,V as Ys,W as Us,X as Ks,Y as Xs,Z as wt,_ as Gs,$ as Zs,a0 as Js,a1 as Qs,a2 as Rn,a3 as ea,a4 as ta,m as te,a5 as oe,a6 as na,a7 as sa,a8 as An,a9 as aa,aa as et,ab as on,ac as oa,ad as ia,ae as fe,af as ft,ag as vt,ah as rn,ai as ra,aj as cn,ak as ca,al as Ue,am as ln,an as la,ao as je,ap as da,aq as ua,ar as ma,as as Pn,at as pa,au as fa,av as ha,aw as ga,ax as On,S as ba,ay as Pe,az as tt,aA as Me,aB as Ae,aC as wa,aD as va,aE as xt,aF as zn,aG as Ze,aH as yt,u as E,aI as dn,aJ as ka,aK as xa,aL as ya,aM as un,aN as Sa,aO as Fn,aP as ja,p as $,aQ as Ea,aR as St,s as jt,i as nt,j as Ca,aS as _n,aT as Na,aU as mn,aV as $n,g as Ia,aW as La,Q as Ta,aX as Bn,O as Ma,aY as pn,aZ as Da,a_ as fn,a$ as Ra,h as Et,b0 as Aa,b1 as Je,b2 as Pa,b3 as Oa,b4 as za,b5 as Fa,b6 as _a,b7 as $a,b8 as Ba,b9 as Wa,w as Va,x as qa,y as Ha,z as Ya,ba as Ua,B as Ka,C as Xa,D as Ga,E as Za}from"./appStore-DWP8UET9.js";import{P as Ja}from"./pen-tool-BXEFnU2i.js";import{T as Qa,R as eo,M as to,V as no,a as so,C as ao,H as oo,f as io}from"./userSpaces-uJOnsedR.js";import{C as ro,P as co,H as lo,A as Se,m as uo}from"./SidebarRow-BAJxbMcx.js";import{M as mo}from"./Chrome-HdfyYV3i.js";import{T as po}from"./terminal-l9k6RDrH.js";import{B as fo}from"./AutomationBuilder-hqs0QhMt.js";import{S as ho}from"./star-BQWMXnn7.js";import{F as Wn}from"./folder-BpsfOHD4.js";import{F as Vn}from"./UnifiedPage-BX6ZQL0h.js";import{i as go,q as bo,o as hn,a as wo,c as vo,A as ko,p as xo,d as yo,E as So}from"./codingNavigation-DDlPpPk5.js";import"./i18n.generated-BuLjnmY8.js";import{S as jo,C as Eo}from"./RunLocationPicker-DBnXYV5B.js";import{R as Co}from"./RightPanel-BHDgqTFs.js";import{n as No}from"./codeStudioStore-BBU62GTy.js";import"./ModelPill-CY-rU1RU.js";import"./rotate-ccw-BvipPIjC.js";import"./upload-ZrOj6tXA.js";import"./hard-drive-BpuI5ebj.js";import"./CapabilityMenu-SwVlZ06x.js";import"./book-open-OLNm7OaB.js";import"./folder-plus-BeQHr4AZ.js";import"./circle-x-fcReAZaE.js";import"./layout-grid-BBVuEdWG.js";import"./nativeDownload-BYT082bY.js";import"./DashboardGridView-B9DCWYVb.js";import"./FloatingToc-Ce9GamvH.js";import"./MarkdownBlock-CkqiwPXa.js";import"./index-CuiYK18N.js";import"./linkFollow-B7ivDZMM.js";import"./mdMarks-DbIcRa0O.js";import"./emoji-6zl4yfOS.js";import"./listFold-DLuxXiIj.js";import"./pageChrome-D3Niv1JM.js";import"./pageTree-CgfvpzIj.js";import"./pluginExt-Byb64tQO.js";import"./list-tree-4-0QDbLu.js";import"./pencil-cqvCkekG.js";import"./type-CFoaj2eD.js";import"./undo-2-DusxpdLa.js";import"./redo-2-BO7wCDwy.js";import"./code-xml-Cuna8Kh4.js";import"./lock-CnbZm4vo.js";import"./ipc-CxAyeo8q.js";import"./InlineFiles-CQbQumkf.js";import"./workflow-DPoG4QE2.js";import"./canvasPrefs-8taQ42Cz.js";import"./circle-question-mark-XbAFplz1.js";import"./gestures-DQBCcK4y.js";import"./MuseView-CC2A7MBs.js";import"./automationListSource-C8BNy6RY.js";import"./messages-_jta1lSI.js";import"./approvalText-Cy2UAUAQ.js";import"./message-square-plus-CpiKDvle.js";import"./log-out-BEynWaHa.js";import"./index-Ck_O3Jdd.js";/* empty css */import"./StudioGuestSurface-lt6znmkl.js";import"./minus-C9ndHJ9O.js";import"./SketchCard-BGYz-bXP.js";import"./arrow-up-right-DrCXuWS7.js";import"./hand-Bko7ms15.js";import"./foldActions-05QcQziQ.js";import"./create-BGtEfCcg.js";import"./pdf.worker.min-CGb3BKV9.js";import"./zoom-in-lbTgzdQP.js";import"./mdMarkStore-DQHDjG7s.js";const Io=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],Lo=ie("box",Io);const To=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],Mo=ie("calendar",To);const Do=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Ro=ie("chevron-up",Do);const Ao=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],Po=ie("chevrons-left",Ao);const Oo=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],zo=ie("chevrons-right",Oo);const Fo=[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]],_o=ie("flag",Fo);const $o=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Bo=ie("tag",$o);const Wo=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Vo=ie("user",Wo),qn={folder:Wn,"folder-open":ta,star:ho,heart:oo,home:ea,zap:Rn,bookmark:Qs,bell:fo,tag:Bo,flag:_o,pin:co,box:Lo,package:Js,settings:Zs,wrench:Gs,terminal:po,code:ao,"file-text":wt,image:Xs,music:so,video:no,camera:Ks,globe:Us,compass:Ys,map:mo,calendar:Mo,clock:ro,mail:to,"message-circle":Hs,users:qs,user:Vo,search:Vs,filter:Ws,sparkles:Bs,rocket:eo,target:Qa,trophy:vs,lightbulb:Cn,coffee:ws,palette:$s,layers:_s,database:Fs,"pen-tool":Ja,inbox:zs,bot:Os,command:bs,moon:Ps},qo=Object.keys(qn),ht=n=>n?qn[n]:void 0;function Ho(n,a,o){const u=n.target.closest("button")??a;let r=!1,w=!1,p,b;const h=parseFloat(getComputedStyle(document.body).zoom)||1,m=n.clientX,g=n.clientY;u.setPointerCapture(n.pointerId);const v=(S=!1)=>{if(w=!0,window.removeEventListener("pointermove",I,!0),window.removeEventListener("pointerup",C,!0),window.removeEventListener("pointercancel",f,!0),window.removeEventListener("keydown",y,!0),window.removeEventListener("blur",f),u.removeEventListener("lostpointercapture",f),u.hasPointerCapture(n.pointerId)&&u.releasePointerCapture(n.pointerId),document.documentElement.classList.remove("rb-pointer-dragging"),p?.remove(),b?.remove(),r){const M=L=>{L.preventDefault(),L.stopImmediatePropagation(),D()},j=()=>{clearTimeout(R),R=window.setTimeout(D,0)},D=()=>{window.removeEventListener("click",M,!0),window.removeEventListener("pointerup",j,!0),clearTimeout(R)};window.addEventListener("click",M,!0),S||window.addEventListener("pointerup",j,{capture:!0,once:!0});let R=window.setTimeout(D,S?0:1e4)}},f=()=>{w||(v(),r&&o.cancel())},y=S=>{S.key==="Escape"&&(S.preventDefault(),S.stopImmediatePropagation(),f())},I=S=>{if(!(S.pointerId!==n.pointerId||w)){if(!(S.buttons&1)){f();return}if(!(!r&&Math.hypot(S.clientX-m,S.clientY-g)<6)){r||(r=!0,document.documentElement.classList.add("rb-pointer-dragging"),b=document.createElement("div"),b.className="rb-pointer-shield",b.style.width=`${window.innerWidth/h}px`,b.style.height=`${window.innerHeight/h}px`,b.setAttribute("aria-hidden","true"),document.body.appendChild(b),p=a.cloneNode(!0),p.removeAttribute("data-id"),p.querySelectorAll("[id]").forEach(M=>M.removeAttribute("id")),p.className="rb-pointer-ghost",p.setAttribute("aria-hidden","true"),p.style.width=`${a.getBoundingClientRect().width/h}px`,document.body.appendChild(p),o.start()),S.preventDefault(),p.style.left=`${(S.clientX+12)/h}px`,p.style.top=`${(S.clientY+12)/h}px`,b.style.pointerEvents="none";try{o.move(S)}finally{b.style.pointerEvents=""}}}},C=S=>{S.pointerId!==n.pointerId||S.button!==0||w||(v(!0),r&&(S.preventDefault(),o.drop(S)))};return window.addEventListener("pointermove",I,!0),window.addEventListener("pointerup",C,!0),window.addEventListener("pointercancel",f,!0),window.addEventListener("keydown",y,!0),window.addEventListener("blur",f),u.addEventListener("lostpointercapture",f),f}const gt=4,gn=5,bn=5,Yo=1e3,Uo=100;function wn(n){if(n>=9)return"";const a=pa({id:`space-slot-${n+1}`,hotkey:`mod+${n+1}`});return a?fa(a,ha()):""}function De({item:n,expanded:a}){if(n.component){const r=n.component;return t.jsx(r,{expanded:a})}const o=n.icon,u=n.tooltip?je(n.tooltip):"";return t.jsxs("button",{className:"rb-btn","aria-label":u||void 0,"data-rb-tip":a?void 0:u||void 0,onClick:n.onClick,children:[o&&t.jsx(o,{size:18}),a&&t.jsx("span",{className:"rb-label",children:u})]})}function Ko({cmd:n,expanded:a,overrideIcon:o}){const[,u]=c.useReducer(b=>b+1,0),r=o??n.icon??Rn,w=je(n.title);let p;if(n.checked)try{p=!!n.checked()}catch{p=void 0}return t.jsxs("button",{className:`rb-btn${p?" is-on":""}`,"aria-pressed":p,"aria-label":w,"data-rb-tip":a?void 0:w,onMouseEnter:n.checked?u:void 0,onMouseLeave:n.checked?u:void 0,onClick:()=>{const b=n.run();n.checked&&(u(),b&&typeof b.then=="function"&&b.then(u,u))},children:[t.jsx(r,{size:18}),a&&t.jsx("span",{className:"rb-label",children:w})]})}const Ke=24,Re=n=>n.startsWith("space:")?n.slice(6):null,Xo=600;function Go(){const n=te(e=>e.items),a=te(e=>e.expanded),o=te(e=>e.order),u=te(e=>e.bottomOrder),r=te(e=>e.folders),w=te(e=>e.commandItems),p=te(e=>e.commandIcons),b=te(e=>e.recentCount),h=oe(e=>e.recent),m=na(e=>e.commands);sa(e=>e.overrides);const{t:g}=An(),v=()=>te.getState(),[f,y]=c.useState(null),I=c.useRef(void 0);c.useEffect(()=>()=>I.current?.(),[]);const[C,S]=c.useState(null),[M,j]=c.useState(null),[D,R]=c.useState(null),[L,G]=c.useState(null),[Y,B]=c.useState(null),[W,V]=c.useState(null),[_,re]=c.useState(99),z=c.useRef(null),U=c.useRef(null),ce=c.useRef(null),le=c.useRef(null),K=c.useRef(null),T=c.useRef(null),de=c.useRef(void 0),ne=c.useRef(null),[se,ue]=c.useState({top:0,bottom:0}),[P,st]=c.useState(null),[be,we]=c.useState({}),k=c.useRef({}),O=c.useRef({});c.useEffect(()=>()=>{for(const e of Object.values(k.current))window.clearTimeout(e?.timer)},[]);const[ze,q]=c.useState(!1),me=c.useRef(void 0);c.useEffect(()=>()=>window.clearTimeout(me.current),[]);const ve=e=>{for(const i of["top","bottom"]){const d=k.current[i];if(!d)continue;window.clearTimeout(d.timer);const l=O.current[i];l&&(l.style.transform=d.from?`translateY(${-d.from*A}px)`:""),delete k.current[i]}we({}),window.clearTimeout(me.current);const s=!window.matchMedia("(prefers-reduced-motion: reduce)").matches;q(s),s&&(me.current=window.setTimeout(()=>q(!1),240)),st(e)},[ke,Fe]=c.useState(null),Ee=c.useRef(null),at=c.useRef(void 0),_e=c.useRef(!1),Ct=c.useRef(0),Ce=()=>{window.clearTimeout(at.current),Ee.current=null,_e.current&&(_e.current=!1,Ct.current=Date.now()),Fe(null)},ot=!!f||!!Y||!!W||!!L;c.useEffect(()=>{(ot||a)&&Ce()},[ot,a]),c.useEffect(()=>()=>window.clearTimeout(at.current),[]);const es=e=>{const s=e.target.closest("[data-rb-tip]");if(s===Ee.current)return;const i=_e.current||Date.now()-Ct.current<=Uo;if(Ce(),!s||ot||a)return;Ee.current=s;const d=()=>{if(Ee.current!==s||!s.isConnected||!s.dataset.rbTip)return;const l=s.getBoundingClientRect();_e.current=!0,Fe({text:s.dataset.rbTip,mid:l.top+l.height/2})};i?d():at.current=window.setTimeout(d,Yo)},ts=new Set(r.flatMap(e=>e.items)),$e=new Map,Nt=e=>{const s=[];for(const d of n)(d.side??"top")===e&&!d.pinned&&s.push({kind:"item",id:d.id,item:d});if(e==="bottom")for(const d of w){const l=m.find(x=>x.id===d);l&&s.push({kind:"cmd",id:`cmd:${d}`,cmd:l})}for(const d of r)d.zone===e&&s.push({kind:"folder",id:d.id,folder:d});for(const d of s)$e.set(d.id,d);return ra(s.map(d=>d.id),e==="top"?o:u).map(d=>$e.get(d)).filter(d=>!ts.has(d.id))},Z=Nt("top"),J=Nt("bottom"),It=e=>e.items.reduce((s,i)=>s+($e.has(i)?1:0),0),ns=n.filter(e=>e.side==="bottom"&&e.pinned),ss=n.filter(e=>e.side==="head"),as=n.filter(e=>e.side==="home"),A=(a?34:32)+gt;c.useLayoutEffect(()=>{const e=z.current;if(!e)return;const s=()=>{const d=getComputedStyle(e),l=(U.current?.offsetHeight??0)+(le.current?.offsetHeight??0),x=e.clientHeight-parseFloat(d.paddingTop)-parseFloat(d.paddingBottom)-l-(ce.current?.offsetHeight??0)-2*A-48;re(Math.max(2,Math.floor(x/A)))};s();const i=new ResizeObserver(s);return i.observe(e),le.current&&i.observe(le.current),()=>i.disconnect()},[a,A,n.length,r.length,w.length,P]);const Lt=(e,s)=>e<=s?e:s+1,Tt=Lt(Z.length,gn),it=Lt(J.length,bn);let ae=Tt,pe=it;if(P)P==="top"?ae=_:pe=_;else if(ae+pe>_)if(Z.length===0)ae=0,pe=_;else if(J.length===0)ae=_,pe=0;else{const e=Math.floor(_/2);ae=Math.max(1,Math.min(Tt,Math.max(e,_-it))),pe=Math.max(1,Math.min(it,_-ae))}const Mt=(e,s,i,d,l)=>{if(e.length<=s&&e.length<=l)return{shown:e,tail:[],start:0,max:0};const x=Math.max(0,s-1),N=e.length-x,F=Math.min(Math.max(0,d),N),ee=i?e.length-x-F:F;return{shown:e.slice(ee,ee+x),tail:[...e.slice(0,ee),...e.slice(ee+x)],start:ee,max:N}},Be=Mt(Z,ae,!1,se.top,P==="top"?1/0:gn),We=Mt(J,pe,!0,se.bottom,P==="bottom"?1/0:bn),Dt=h.map(e=>n.find(s=>s.id===`space:${e}`)).filter(e=>!!e).slice(0,aa(b,_,ae,pe,!!P)),os=(e,s)=>i=>{const d=O.current[e];if(!s.max||f||!i.deltaY||!d)return;window.clearTimeout(de.current);let l=k.current[e];l||(l=k.current[e]={px:s.start*A,from:s.start,timer:0},we(N=>({...N,[e]:!0}))),window.clearTimeout(l.timer);const x=i.deltaMode?Math.sign(i.deltaY)*A:Math.max(-A,Math.min(A,i.deltaY));l.px=Math.max(0,Math.min(s.max*A,l.px+x)),d.style.transform=`translateY(${-l.px}px)`,l.timer=window.setTimeout(()=>is(e,s),120)},is=(e,s)=>{const i=k.current[e],d=O.current[e];if(!i||!d)return;const l=i.at??i.from,x=i.px-l*A;let N=Math.round(i.px/A);N===l&&x&&(N+=Math.sign(x)),Rt(e,s,Math.max(0,Math.min(s.max,N)))},Rt=(e,s,i)=>{const d=O.current[e];if(!d)return;let l=k.current[e];l||(l=k.current[e]={px:s.start*A,from:s.start,timer:0},we(x=>({...x,[e]:!0}))),window.clearTimeout(l.timer),l.px=i*A,l.at=i,d.style.transform=i?`translateY(${-i*A}px)`:"",l.timer=window.setTimeout(()=>{delete k.current[e],we(x=>({...x,[e]:!1})),ue(x=>({...x,[e]:e==="top"?i:s.max-i}))},240)};c.useEffect(()=>()=>window.clearTimeout(de.current),[]);const At=c.useRef(()=>{});At.current=()=>{if(!f)for(const[e,s]of[["top",Be],["bottom",We]])se[e]&&(s.max&&O.current[e]?Rt(e,s,e==="top"?0:s.max):ue(i=>({...i,[e]:0})))};const Pt=!!(se.top||se.bottom||be.top||be.bottom);c.useEffect(()=>{if(!Pt)return;const e=()=>{cn()&&(window.clearTimeout(de.current),de.current=window.setTimeout(()=>{cn()&&At.current()},Xo))},s=i=>{const d=i.target;i.button!==0||d?.closest?.(".rb-menu, .rb-iconpick, [data-rb-overlay]")||d&&(z.current?.contains(d)||d.closest(".rb-fly"))&&!d.closest(".rb-btn:not(.rb-more, .rb-plus, .rb-toggle, .rb-folder)")||e()};return window.addEventListener("click",s,!0),window.addEventListener("blur",e),()=>{window.removeEventListener("click",s,!0),window.removeEventListener("blur",e)}},[Pt]);const Q=L?.folderId?r.find(e=>e.id===L.folderId):void 0,Ve=()=>{T.current&&(window.clearTimeout(T.current),T.current=null)},Ot=()=>{Ve(),T.current=window.setTimeout(()=>{f||G(null)},150)},rt=(e,s,i,d)=>{Ve(),G({key:e,zone:s,folderId:d,top:i.getBoundingClientRect().top})};c.useLayoutEffect(()=>{const e=K.current;if(!e||!L)return;const s=e.getBoundingClientRect().bottom-(window.innerHeight-8);s>0&&G({...L,top:Math.max(8,L.top-s)})},[L?.key,Q?.items.length]);const zt=!!L;c.useEffect(()=>{if(!zt)return;const e=i=>{i.key==="Escape"&&G(null)},s=i=>{const d=i.target;!K.current?.contains(d)&&!z.current?.contains(d)&&G(null)};return window.addEventListener("keydown",e),window.addEventListener("mousedown",s),()=>{window.removeEventListener("keydown",e),window.removeEventListener("mousedown",s)}},[zt]),c.useEffect(()=>{if(!P)return;const e=()=>ve(null),s=d=>{if(d.button!==0)return;const l=d.target;l?.closest?.(".rb-menu, .rb-iconpick, .rb-fly, [data-rb-overlay]")||l&&z.current?.contains(l)&&l.closest("button")||e()},i=d=>{d.key==="Escape"&&e()};return window.addEventListener("pointerdown",s,!0),window.addEventListener("keydown",i),window.addEventListener("blur",e),()=>{window.removeEventListener("pointerdown",s,!0),window.removeEventListener("keydown",i),window.removeEventListener("blur",e)}},[P,A]);const ct=c.useRef(new Map),Ft=c.useRef(()=>{});c.useEffect(()=>{Ft.current=e=>{const s=Z[e];if(s){if(s.kind==="folder"){const i=ct.current.get(s.id)??z.current;i&&rt(s.id,"top",i,s.id);return}G(null),s.kind==="cmd"?s.cmd.run():s.id.startsWith("space:")?et(s.id.slice(6)):s.item.onClick?.()}}});const _t=Math.min(9,Z.length);c.useEffect(()=>{for(let e=1;e<=9;e++){if(e>_t){on(`space-slot-${e}`);continue}oa({id:`space-slot-${e}`,title:()=>ia("lcl.ribbon.switchSpace",{n:e}),keywords:`space switch ${e} 切换 空间`,hotkey:`mod+${e}`,run:()=>Ft.current(e-1)})}return()=>{for(let e=1;e<=9;e++)on(`space-slot-${e}`)}},[_t]);const $t=(e,s,i,d)=>{e.dataTransfer.effectAllowed="move";const l=e.currentTarget.getBoundingClientRect();e.dataTransfer.setDragImage(e.currentTarget,e.clientX-l.left,e.clientY-l.top),y({id:s,zone:i,from:d})},xe=()=>{ne.current=null,y(null),S(null),j(null),R(null)},Ne=f&&fe()?.openSpace?Re(f.id):null,Bt=c.useRef({dropped:!1,gone:!1}),lt=(e,s)=>{const i=z.current?.getBoundingClientRect();if(!i)return!0;const d=x=>e>=x.left-Ke&&e<=x.right+Ke&&s>=x.top-Ke&&s<=x.bottom+Ke,l=K.current?.getBoundingClientRect();return d(i)||!!l&&d(l)},Wt=e=>{const s=e.target;return!!s&&(!!z.current?.contains(s)||!!K.current?.contains(s))};c.useLayoutEffect(()=>{if(!Ne)return;const e={dropped:!1,gone:!1};Bt.current=e;const s=l=>{e.gone=!1,!Wt(l)&&(l.preventDefault(),l.stopPropagation(),l.dataTransfer&&(l.dataTransfer.dropEffect="move"),j(x=>x&&null),R(x=>x&&null))},i=l=>{e.dropped=!0,!Wt(l)&&(l.preventDefault(),l.stopPropagation(),lt(l.clientX,l.clientY)||fe()?.openSpace?.(Ne,{screenX:l.screenX,screenY:l.screenY}))},d=l=>{(l.clientX<=0||l.clientY<=0||l.clientX>=window.innerWidth||l.clientY>=window.innerHeight)&&(e.gone=!0)};return window.addEventListener("dragover",s,!0),window.addEventListener("drop",i,!0),window.addEventListener("dragleave",d,!0),()=>{window.removeEventListener("dragover",s,!0),window.removeEventListener("drop",i,!0),window.removeEventListener("dragleave",d,!0)}},[Ne]);const Vt=e=>{const s=Bt.current;if(Ne&&!s.dropped){const{clientX:i,clientY:d}=e,l=i<0||d<0||i>window.innerWidth||d>window.innerHeight,x=!l&&/^(IFRAME|WEBVIEW)$/.test(document.elementFromPoint(i,d)?.tagName??"");(l||!lt(i,d)&&(s.gone||x))&&fe()?.openSpace?.(Ne,e.screenX||e.screenY?{screenX:e.screenX,screenY:e.screenY}:void 0)}xe()},ye=(e,s,i)=>{s&&(e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="move",i?.())},qt=(e,s)=>{const i=e.querySelectorAll(".rb-slot"),d=i[0]?.getBoundingClientRect().top??0,l=i.length>1?i[1].getBoundingClientRect().top-d:0;return{top:d,pitch:l,grabDy:s??l/2}},Ht=(e,s,i)=>la(s,i,ne.current??qt(e)),Yt=(e,s)=>{const i=e.parentElement;i&&(ne.current=qt(i,s-e.getBoundingClientRect().top))},qe=(e,s,i=f)=>{const d=i;if(xe(),!d||d.zone!==e||d.id===s)return;d.from&&v().moveOutOfFolder(d.id);const l=e==="top"?v().order:v().bottomOrder,x=ca(l,(e==="top"?Z:J).map(F=>F.id)),N=s?x.indexOf(s):-1;v().setZoneOrder(e,Ue(x,d.id,N>=0?N:x.length))},He=(e,s,i=f)=>{const d=i;if(xe(),!(!d||d.zone!==e.zone||d.id.startsWith("folder:"))){if(d.from===e.id)v().setFolderItems(e.id,Ue(e.items,d.id,s??e.items.length));else if(v().moveIntoFolder(e.id,d.id),d.from||v().setZoneOrder(e.zone,ln(e.zone==="top"?v().order:v().bottomOrder,(e.zone==="top"?Z:J).map(l=>l.id),d.id)),s!==void 0){const l=v().folders.find(x=>x.id===e.id);l&&v().setFolderItems(e.id,Ue(l.items,d.id,s))}}},dt=c.useRef(null);dt.current={target:(e,s)=>{const i=document.elementFromPoint(e.clientX,e.clientY),d=!!i&&(!!z.current?.contains(i)||!!K.current?.contains(i));if(d){const x=i.closest("[data-rb-folder]")?.dataset.rbFolder,N=r.find(H=>H.id===x);if(N&&N.zone===s.zone){const H=i.closest("[data-rb-folder-index]");return j(null),R(N.id),S(H?.dataset.id??null),H||rt(N.id,N.zone,i.closest("[data-rb-folder]"),N.id),{kind:"folder",folder:N,at:H?Number(H.dataset.rbFolderIndex):void 0}}const F=i.closest("[data-rb-more]")?.dataset.rbMore;if(F===s.zone)return j(null),R(`more:${F}`),{kind:"bar",zone:s.zone,id:s.zone==="bottom"?J[0]?.id??null:null};const ee=i.closest(".rb-top, .rb-bottom");if(ee){const H=ee.classList.contains("rb-top")?"top":"bottom";if(H!==s.zone)return{kind:"cancel"};const sn=(H==="top"?Be:We).shown.map(Ie=>Ie.id),pt=Ht(ee,e.clientY,sn.length);return R(null),S(null),j(Ie=>Ie?.zone===H&&Ie.index===pt?Ie:{zone:H,index:pt}),{kind:"bar",zone:H,id:sn[pt]??null}}}return j(null),R(null),S(null),{kind:e.clientX<0||e.clientY<0||e.clientX>=window.innerWidth||e.clientY>=window.innerHeight||!d&&!lt(e.clientX,e.clientY)?"tear":"cancel"}},drop:(e,s,i)=>{if(i.kind==="bar")qe(i.zone,i.id,s);else if(i.kind==="folder")He(i.folder,i.at,s);else if(xe(),i.kind==="tear"){const d=fe(),l=Re(s.id);l&&d?.openSpace?.(l,d.cursorScreenPoint?.()??{screenX:e.screenX,screenY:e.screenY})}}};const Ut=(e,s,i,d)=>{if(!fe()?.ribbonPointerDrag||!Re(s)||e.button!==0||!e.isPrimary)return;e.stopPropagation(),I.current?.();const l=e.currentTarget,x={id:s,zone:i,from:d};d||Yt(l,e.clientY);let N={kind:"cancel"};I.current=Ho(e.nativeEvent,l,{start:()=>{Ce(),Ve(),y(x)},move:F=>{N=dt.current.target(F,x)},drop:F=>{dt.current.drop(F,x,N)},cancel:xe})},Kt=e=>!(fe()?.ribbonPointerDrag&&Re(e)),Xt=ft.prompt??((e,s)=>Promise.resolve(window.prompt(e,s))),rs=e=>{Xt(g("lcl.ribbon.newFolder"),g("lcl.ribbon.folderDefaultName")).then(s=>{const i=s?.trim();i&&v().addFolder(e,i)})},Ye=e=>[...e==="top"&&ft.newSpace?[{label:g("lcl.ribbon.newSpace"),onClick:ft.newSpace}]:[],...e==="bottom"?[{label:g("lcl.ribbon.addCommand"),onClick:()=>da(s=>v().addCommandItem(s))}]:[],{label:g(e==="top"?"lcl.ribbon.newFolderSpaces":"lcl.ribbon.newFolderCommands"),onClick:()=>rs(e)}],cs=e=>s=>{s.defaultPrevented||(s.preventDefault(),B({x:s.clientX,y:s.clientY,entries:Ye(e)}))},ls=e=>{e.defaultPrevented||(e.preventDefault(),B({x:e.clientX,y:e.clientY,entries:[...Ye("top"),...Ye("bottom")]}))},Gt=(e,s,i,d)=>{B(null),V({x:e,y:s,current:i,apply:d})},ds=e=>s=>{s.preventDefault(),s.stopPropagation();const i=s.clientX,d=s.clientY;B({x:i,y:d,entries:[{label:g("lcl.ribbon.changeIcon"),onClick:()=>Gt(i,d,e.icon,l=>v().setFolderIcon(e.id,l))},{label:g("lcl.ribbon.rename"),onClick:()=>{Xt(g("lcl.ribbon.renameFolder"),e.name).then(l=>{const x=l?.trim();x&&v().renameFolder(e.id,x)})}},{label:g("lcl.ribbon.dissolveFolder"),onClick:()=>v().removeFolder(e.id)}]})},Zt=e=>{const s=Re(e.id),i=fe()?.openSpace;return[...s&&i?[{label:g("lcl.ribbon.openInNewWindow"),onClick:()=>i(s)}]:[],...e.menu?.()??[]]},Jt=e=>s=>{if(s.defaultPrevented)return;const i=Zt(e);i.length&&(s.preventDefault(),s.stopPropagation(),B({x:s.clientX,y:s.clientY,entries:i}))},Qt=e=>s=>{s.preventDefault(),s.stopPropagation();const i=s.clientX,d=s.clientY;B({x:i,y:d,entries:[{label:g("lcl.ribbon.setIcon"),onClick:()=>Gt(i,d,v().commandIcons[e],l=>v().setCommandIcon(e,l))},{label:g("lcl.ribbon.removeCommand"),onClick:()=>v().removeCommandItem(e)}]})},us=e=>{const s=ht(e.icon)??Wn;return t.jsxs("button",{ref:i=>{i?ct.current.set(e.id,i):ct.current.delete(e.id)},className:`rb-btn rb-folder${D===e.id?" drag-into":""}`,"data-rb-folder":e.id,"aria-label":`${e.name} (${It(e)})`,onMouseEnter:i=>rt(e.id,e.zone,i.currentTarget,e.id),onMouseLeave:Ot,onContextMenu:ds(e),onDragOver:i=>ye(i,!!f&&f.zone===e.zone&&!f.id.startsWith("folder:"),()=>{j(null),R(e.id)}),onDragLeave:()=>{D===e.id&&R(null)},onDrop:i=>{!f||f.id.startsWith("folder:")||(i.preventDefault(),i.stopPropagation(),He(e))},children:[t.jsx(s,{size:18}),a&&t.jsx("span",{className:"rb-label",children:e.name})]})},en=e=>{const s=P===e,i=g(s?"lcl.ribbon.less":"lcl.ribbon.more"),d=s?e==="top"?Ro:Pn:ma;return t.jsxs("button",{className:`rb-btn rb-more${s?" is-open":""}${D===`more:${e}`?" drag-into":""}`,"data-rb-more":e,"aria-label":i,"aria-expanded":s,"data-rb-tip":a?void 0:i,onClick:()=>ve(s?null:e),onDragOver:l=>ye(l,!!f&&f.zone===e,()=>{j(null),R(`more:${e}`)}),onDragLeave:()=>{D===`more:${e}`&&R(null)},onDrop:l=>{l.preventDefault(),l.stopPropagation(),qe(e,e==="bottom"?J[0]?.id??null:null)},children:[t.jsx(d,{size:18}),a&&t.jsx("span",{className:"rb-label",children:i})]})},ut=(e,s)=>{const i=s??a;return e.kind==="item"?t.jsx(De,{item:e.item,expanded:i}):e.kind==="cmd"?t.jsx(Ko,{cmd:e.cmd,expanded:i,overrideIcon:ht(p[e.cmd.id])}):us(e.folder)},ms=(e,s,i,d,l,x)=>{const N=d?d.indexOf(e.id):i;return t.jsxs("div",{"data-id":e.id,className:`rb-slot${f?.id===e.id?" dragging":""}${l?" drag-over":""}`,style:N!==i?{transform:`translateY(${(N-i)*A}px)`}:void 0,draggable:Kt(e.id),onPointerDown:F=>Ut(F,e.id,s,null),onDragStart:F=>{Yt(F.currentTarget,F.clientY),$t(F,e.id,s,null)},onDragEnd:Vt,onContextMenu:e.kind==="cmd"?Qt(e.cmd.id):e.kind==="item"?Jt(e.item):void 0,children:[ut(e),s==="top"&&a&&wn(x)&&t.jsx("span",{className:"rb-key",children:wn(x)})]},e.id)},mt=e=>g(e==="top"?"lcl.ribbon.addSpaceOrFolder":"lcl.ribbon.addCommand"),tn=e=>t.jsxs("button",{className:"rb-btn rb-plus","aria-label":mt(e),"data-rb-tip":a?void 0:mt(e),onClick:s=>{const i=s.currentTarget.getBoundingClientRect();B({x:i.right+6,y:i.top,entries:Ye(e)})},children:[t.jsx(ua,{size:16}),a&&t.jsx("span",{className:"rb-label",children:mt(e)})]}),nn=(e,s)=>{const i=s.shown.map(l=>l.id),d=f&&M?.zone===e&&i.includes(f.id)?Ue(i,f.id,M.index):null;return t.jsxs("div",{className:`rb-group rb-${e}`,onContextMenu:cs(e),onWheel:os(e,s),onDragOver:l=>{const x=Ht(l.currentTarget,l.clientY,i.length);ye(l,!!f&&f.zone===e,()=>{R(null),j(N=>N?.zone===e&&N.index===x?N:{zone:e,index:x})})},onDrop:l=>{l.preventDefault(),l.stopPropagation(),qe(e,(M?.zone===e?i[M.index]:null)??null)},children:[e==="bottom"&&t.jsxs(t.Fragment,{children:[tn(e),(s.tail.length>0||P===e)&&en(e)]}),t.jsx("div",{className:"rb-strip",style:{height:Math.max(0,s.shown.length*A-gt)},children:t.jsx("div",{ref:l=>{O.current[e]=l},className:"rb-strip-in",style:s.start?{transform:`translateY(${-s.start*A}px)`}:void 0,children:(e==="top"?Z:J).map((l,x)=>{const N=x-s.start;return N>=0&&N<s.shown.length?ms(l,e,N,d,!d&&M?.zone===e&&M.index===N,x):t.jsx("div",{className:"rb-cell","aria-hidden":!0,inert:!0,style:{height:A-gt},children:(be[e]||ze)&&ut(l)},l.id)})})}),e==="top"&&t.jsxs(t.Fragment,{children:[(s.tail.length>0||P===e)&&en(e),tn(e)]})]})},ps=(e,s,i,d)=>t.jsx("div",{"data-id":e.id,className:`rb-fly-row${f?.id===e.id?" dragging":""}${C===e.id&&f?.id!==e.id?` drag-over${f&&d.indexOf(f.id)>=0&&d.indexOf(f.id)<i?" below":""}`:""}`,"data-rb-folder":s.id,"data-rb-folder-index":i,draggable:Kt(e.id),onPointerDown:l=>Ut(l,e.id,s.zone,s.id),onDragStart:l=>{l.stopPropagation(),$t(l,e.id,s.zone,s.id)},onDragOver:l=>ye(l,!!f&&f.zone===s.zone&&f.id!==e.id&&!f.id.startsWith("folder:"),()=>S(e.id)),onDragLeave:()=>{C===e.id&&S(null)},onDrop:l=>{l.preventDefault(),l.stopPropagation(),He(s,i)},onDragEnd:Vt,onContextMenu:e.kind==="cmd"?Qt(e.cmd.id):l=>{l.preventDefault(),l.stopPropagation(),B({x:l.clientX,y:l.clientY,entries:[...e.kind==="item"?Zt(e.item):[],{label:g("lcl.ribbon.moveOut"),onClick:()=>{v().moveOutOfFolder(e.id);const x=s.zone==="top"?v().order:v().bottomOrder;v().setZoneOrder(s.zone,[...ln(x,(s.zone==="top"?Z:J).map(N=>N.id),e.id),e.id])}}]})},children:ut(e,!0)},e.id);return t.jsxs("div",{ref:z,className:`rb${a?" rb-expanded":""}${f?" rb-dragging":""}${P?` rb-open-${P}`:""}`,onContextMenu:ls,onMouseOver:es,onMouseLeave:Ce,onMouseDownCapture:e=>{Ce(),Ee.current=e.target.closest("[data-rb-tip]")},onDragOver:e=>ye(e,!!f),onDrop:e=>{if(!f)return;e.preventDefault();const s=f.zone,i=M?.zone===s?(s==="top"?Be:We).shown[M.index]?.id:void 0;if(i===void 0){xe();return}qe(s,i)},children:[t.jsxs("div",{ref:U,className:"rb-head",children:[t.jsxs("button",{className:"rb-btn rb-toggle","aria-label":g(a?"lcl.ribbon.iconsOnly":"lcl.ribbon.showLabels"),"aria-expanded":a,"data-rb-tip":a?void 0:g("lcl.ribbon.showLabels"),onClick:()=>v().toggleExpanded(),children:[a?t.jsx(Po,{size:18}):t.jsx(zo,{size:18}),a&&t.jsx("span",{className:"rb-label",children:g("lcl.ribbon.iconsOnly")})]}),ss.map(e=>t.jsx(De,{item:e,expanded:a},e.id))]}),t.jsx("div",{ref:ce,className:"rb-group rb-home",children:as.map(e=>t.jsx(De,{item:e,expanded:a},e.id))}),P!=="bottom"&&nn("top",Be),Dt.length>0&&t.jsx("div",{className:"rb-group rb-recent",role:"group","aria-label":g("lcl.ribbon.recentSpaces"),children:Dt.map(e=>t.jsx("div",{className:"rb-recent-slot","data-recent-id":e.id,onContextMenu:Jt(e),children:t.jsx(De,{item:e,expanded:a})},e.id))}),P!=="top"&&nn("bottom",We),t.jsx("div",{ref:le,className:"rb-group rb-pinned",children:ns.map(e=>t.jsx(De,{item:e,expanded:a},e.id))}),L&&Q&&t.jsxs("div",{ref:K,className:"rb-fly","data-rb-folder":Q.id,style:(()=>{const e=vt(z.current);return{left:((z.current?.getBoundingClientRect().right??44)+4)/e,top:L.top/e}})(),onMouseEnter:Ve,onMouseLeave:Ot,onDragOver:e=>ye(e,!!f&&f.zone===L.zone&&!f.id.startsWith("folder:")&&e.target===e.currentTarget),onDrop:e=>{e.target===e.currentTarget&&(e.preventDefault(),He(Q))},children:[t.jsx("div",{className:"rb-fly-head",children:Q.name}),It(Q)===0&&t.jsx("div",{className:"rb-fly-empty",children:g("lcl.ribbon.folderEmpty")}),Q.items.map((e,s)=>{const i=$e.get(e);return i?ps(i,Q,s,Q.items):null})]}),ke&&!a&&t.jsx("div",{className:"rb-tip",role:"tooltip",style:(()=>{const e=vt(z.current);return{left:((z.current?.getBoundingClientRect().right??44)+6)/e,top:ke.mid/e}})(),children:ke.text}),Y&&t.jsx("div",{className:"rb-menu-backdrop",onMouseDown:()=>B(null),onContextMenu:e=>{e.preventDefault(),B(null)},children:t.jsx(rn,{className:"rb-menu",x:Y.x,y:Y.y,onMouseDown:e=>e.stopPropagation(),children:Y.entries.map((e,s)=>t.jsx("button",{onClick:()=>{B(null),e.onClick()},children:e.label},s))})}),W&&t.jsx("div",{className:"rb-menu-backdrop",onMouseDown:()=>V(null),onContextMenu:e=>{e.preventDefault(),V(null)},children:t.jsxs(rn,{className:"rb-iconpick",x:W.x,y:W.y,onMouseDown:e=>e.stopPropagation(),children:[t.jsx("button",{className:"rb-iconpick-reset",onClick:()=>{const e=W.apply;V(null),e("")},children:g("lcl.ribbon.defaultIcon")}),t.jsx("div",{className:"rb-iconpick-grid",children:qo.map(e=>{const s=ht(e);return t.jsx("button",{className:`rb-iconpick-btn${W.current===e?" on":""}`,title:e,onClick:()=>{const i=W.apply;V(null),i(e)},children:t.jsx(s,{size:17})},e)})})]})})]})}const vn=8,Zo=n=>n.dataset.lclShift==="end"?vn:n.dataset.lclShift==="start"?-vn:0;function Jo(){const n=Array.from(document.querySelectorAll(".dv-groupview")).map(o=>({r:o.getBoundingClientRect(),papery:!o.querySelector(".wb-tab--icon")})).filter(o=>o.r.width>0&&o.r.height>0),a=3;for(const o of document.querySelectorAll(".dv-sash")){const u=!!o.closest(".dv-split-view-container.dv-horizontal"),r=o.getBoundingClientRect();if(!r.width&&!r.height)continue;const w=u?r.left+r.width/2:r.top+r.height/2,[p,b]=u?[r.top,r.bottom]:[r.left,r.right];let h=null,m=null;for(const v of n){const[f,y,I,C]=u?[v.r.left,v.r.right,v.r.top,v.r.bottom]:[v.r.top,v.r.bottom,v.r.left,v.r.right];C<=p||I>=b||(h===null&&Math.abs(y-w)<=a&&(h=v.papery),m===null&&Math.abs(f-w)<=a&&(m=v.papery))}const g=h===!1&&m===!0?"end":h===!0&&m===!1?"start":"";g?o.dataset.lclShift=g:delete o.dataset.lclShift}}function Qo(){const n=document.createElement("div");n.className="lcl-sash-tick",document.body.appendChild(n);let a=null,o=0;const u=(f,y)=>{const I=!!f.closest(".dv-split-view-container.dv-horizontal"),C=f.getBoundingClientRect(),S=Zo(f);cancelAnimationFrame(o),o=requestAnimationFrame(()=>{n.classList.add("show"),n.classList.toggle("h",!I);const M=vt(n);I?(n.style.left=`${(C.left+C.width/2+S)/M}px`,n.style.top=`${Math.min(Math.max(y.clientY,C.top),C.bottom)/M}px`):(n.style.left=`${Math.min(Math.max(y.clientX,C.left),C.right)/M}px`,n.style.top=`${(C.top+C.height/2+S)/M}px`)})},r=f=>f instanceof Element?f.closest(".dv-sash"):null,w=f=>{const y=a instanceof HTMLElement?a:r(f.target);y?u(y,f):n.classList.contains("show")&&(cancelAnimationFrame(o),n.classList.remove("show"))},p=f=>{a=r(f.target)},b=f=>{a&&(a=null,r(f.target)||(cancelAnimationFrame(o),n.classList.remove("show")))};let h=0;const m=()=>{window.clearTimeout(h),h=window.setTimeout(Jo,120)},g=f=>f instanceof Element&&(f.matches(".dv-sash, .dv-view, .dv-groupview")||!!f.querySelector(".dv-sash, .dv-groupview")),v=new MutationObserver(f=>{for(const y of f)for(const I of[...y.addedNodes,...y.removedNodes])if(g(I)){m();return}});return v.observe(document.body,{childList:!0,subtree:!0}),m(),document.addEventListener("pointermove",w,{passive:!0}),document.addEventListener("pointerdown",p,{passive:!0}),document.addEventListener("pointerup",b,{passive:!0}),()=>{v.disconnect(),window.clearTimeout(h),cancelAnimationFrame(o),document.removeEventListener("pointermove",w),document.removeEventListener("pointerdown",p),document.removeEventListener("pointerup",b),n.remove()}}const Hn=({dark:n,soft:a,buildDefault:o,header:u,noRibbon:r,footer:w})=>(c.useEffect(()=>ga(),[]),c.useEffect(()=>Qo(),[]),On==="mobile"?t.jsxs(t.Fragment,{children:[t.jsx(ba,{dark:n,soft:a,buildDefault:o}),t.jsx(an,{})]}):t.jsxs("div",{className:"shell",children:[u,t.jsxs("div",{className:"shell-top",children:[!r&&t.jsx(Go,{}),t.jsxs("div",{className:"shell-work",children:[t.jsx(ks,{dark:n,soft:a,buildDefault:o}),w]})]}),t.jsx(an,{})]})),Yn=({buildDefault:n,direct:a})=>{const o=oe(j=>j.spaces),u=oe(j=>j.activeSpaceId),[,r]=c.useReducer(j=>j+1,0);c.useEffect(()=>Pe(r),[]);const w=o.filter(tt),p=w.find(j=>j.id===u),b=Me(j=>j.mainLeaves.find(D=>D.id===j.activeMainId)),[h,m]=c.useState(!1),{t:g}=An(),v=p?.icon,f=a?Ae(a.view.type):void 0,y=c.useRef(!1);f&&(y.current=!0),c.useEffect(()=>{a&&y.current&&!f&&window.tangu?.closeSelf?.()},[a,f]);const I=a?.title||(f?je(f.displayName):p?je(p.mini?.name??p.name):"Mini Panel");c.useEffect(()=>{const j=Me.getState();if(j.setDefaultBuilder(n),!a)if(p)j.getActiveLeaf()?.type!==p.mini.view.type&&j.resetLayout();else{const D=w.find(R=>R.id==="tangu")??w[0];D&&wa(D.id),j.resetLayout()}},[o,u,p,n,a]),c.useEffect(()=>{const j=D=>{D.key==="Escape"&&m(!1)};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[]);const C=b&&(a?b.type===a.view.type:p&&b.type===p.mini.view.type)?Me.getState().getActiveLeaf():null,S=C?Ae(C.type):null,M=()=>{if(a){Ze({type:a.mainView.type,params:{...a.mainView.params,...Me.getState().getActiveLeaf()?.params}});return}const j=yt();j?.mini&&Ze({spaceId:j.id,type:j.mini.mainView.type,params:{...j.mini.mainView.params,...Me.getState().getActiveLeaf()?.params}})};return t.jsxs("div",{className:"mini-card-shell","data-space":a?"direct":p?.id,children:[t.jsxs("header",{className:"mini-card-chrome",children:[t.jsxs("button",{className:"mini-card-space","aria-label":g("lcl.mini.switchSpace"),"aria-expanded":h,disabled:!!a||w.length<2,onClick:()=>m(!h),children:[!a&&v&&t.jsx(v,{size:15}),t.jsx("span",{children:I}),!a&&w.length>1&&t.jsx(Pn,{size:12})]}),t.jsx("div",{className:"mini-card-drag-title"}),t.jsx("button",{className:"mini-card-action","aria-label":g("lcl.mini.showMain"),title:g("lcl.mini.showMain"),disabled:!a&&!p,onClick:M,children:t.jsx(va,{size:15})}),t.jsx("button",{className:"mini-card-action mini-card-close","aria-label":g("lcl.mini.close"),onClick:()=>window.tangu?.closeSelf?.(),children:t.jsx(xt,{size:15})})]}),t.jsx("main",{className:"mini-card-main",children:C&&S?t.jsx("div",{className:"mini-panel-view","data-view":C.type,children:t.jsx(zn,{children:t.jsx(c.Suspense,{fallback:null,children:S.factory({leaf:C,params:C.params})})})},`${C.id}:${C.type}`):t.jsx("div",{className:"mini-panel-empty",children:g("lcl.mini.empty")})}),h&&t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"mini-card-dismiss","aria-label":g("lcl.mini.closeMenu"),onClick:()=>m(!1)}),t.jsx("section",{className:"mini-card-popover","aria-label":g("lcl.mini.switchSpace"),children:t.jsx("div",{className:"mini-card-popover-list",children:w.map(j=>{const D=j.icon;return t.jsxs("button",{className:`mini-card-row${j.id===u?" active":""}`,onClick:()=>{et(j.id),m(!1)},children:[D&&t.jsx(D,{size:15}),t.jsx("span",{className:"mini-card-row-label",children:je(j.mini.name??j.name)})]},j.id)})})})]})]})};function ei(){return t.jsx("div",{className:"mac-titlebar"})}const bt=9e3,ti=5*1024*1024;function kt(n){return typeof n=="string"?n.replace(/\bBearer\s+[A-Za-z0-9._~+\/-]+=*/gi,"Bearer [redacted]").replace(/\b(sk-[a-zA-Z0-9_-]{12,})\b/g,"[redacted]").replace(/((?:["']?)(?:api[_-]?key|access[_-]?token|refresh[_-]?token|token|password|secret|authorization|cookie)(?:["']?)\s*[:=]\s*["']?)([^\s,"';&}]+)/gi,"$1[redacted]"):Array.isArray(n)?n.map(kt):n&&typeof n=="object"?Object.fromEntries(Object.entries(n).map(([a,o])=>[a,/^(?:token|.*api[_-]?key|access[_-]?token|refresh[_-]?token|password|secret|authorization|cookie|set-cookie)$/i.test(a)?"[redacted]":kt(o)])):n}async function ni(n,a,o){const u=await xs(n,a,o),r=JSON.stringify(kt({...u,feedbackSelection:o}),null,2);return{json:r,filename:`tangu-feedback-${a?.id.slice(0,8)||"app"}-${new Date().toISOString().slice(0,10)}.json`,bytes:new TextEncoder().encode(r).byteLength,missing:Object.entries(u.sources).filter(([,w])=>w!=="included").map(([w])=>w),truncated:!!u.messagesTruncated||!!u.activityLogTruncated}}Qe({"feedback.subtitle":{zh:"告诉我们哪里可以做得更好。",en:"Tell us what could work better."},"feedback.kind":{zh:"反馈类型",en:"Feedback type"},"feedback.bug":{zh:"遇到问题",en:"Report a problem"},"feedback.idea":{zh:"功能建议",en:"Suggest a feature"},"feedback.other":{zh:"其他反馈",en:"Something else"},"feedback.description":{zh:"具体发生了什么?",en:"What happened?"},"feedback.bugPlaceholder":{zh:`你当时在做什么?预期的结果是什么,实际又发生了什么?
|
|
3
|
+
如果可以,请写下重现步骤。`,en:`What were you doing? What did you expect, and what happened instead?
|
|
4
|
+
Include steps to reproduce it if you can.`},"feedback.ideaPlaceholder":{zh:"你想完成什么?哪项改进会对你有帮助?",en:"What are you trying to do? What change would help?"},"feedback.otherPlaceholder":{zh:"分享你的使用体验或想法……",en:"Share your experience or thoughts…"},"feedback.context":{zh:"附带诊断信息",en:"Include diagnostic information"},"feedback.diagnostics":{zh:"应用与运行日志",en:"App and runtime logs"},"feedback.diagnosticsHint":{zh:"版本、界面状态、错误、运行时间线与用量;进程日志可能涉及其他会话。",en:"Version, interface state, errors, run timeline and usage. Process logs may include other sessions."},"feedback.conversation":{zh:"当前会话内容",en:"Current conversation"},"feedback.conversationHint":{zh:"最多 500 条消息,包含工具输入与输出。",en:"Up to 500 messages, including tool inputs and outputs."},"feedback.activity":{zh:"近期活动记录",en:"Recent activity"},"feedback.activityHint":{zh:"近 2 天内最新 500 行,可能包含文件名与操作路径。",en:"The latest 500 lines from the last 2 days; may contain file names and paths."},"feedback.sessionContext":{zh:"关联会话:{name}",en:"Linked conversation: {name}"},"feedback.withoutSession":{zh:"未关联会话,仍可提交应用问题。",en:"No linked conversation. You can still report an app issue."},"feedback.privacy":{zh:"已过滤常见凭据字段。日志仍可能包含路径或内容片段,请按需选择并预览。",en:"Common credential fields are filtered. Logs may still contain paths or content excerpts; choose what to include and review the preview."},"feedback.preview":{zh:"预览附件",en:"Preview attachment"},"feedback.export":{zh:"导出日志文件",en:"Export log file"},"feedback.backToForm":{zh:"返回反馈",en:"Back to feedback"},"feedback.preparing":{zh:"正在准备诊断信息…",en:"Preparing diagnostics…"},"feedback.sending":{zh:"正在提交…",en:"Sending…"},"feedback.ready":{zh:"诊断附件已就绪 · {size}",en:"Diagnostics ready · {size}"},"feedback.textOnly":{zh:"仅提交反馈文字",en:"Only your feedback text will be sent"},"feedback.partial":{zh:"部分诊断来源不可用:{sources}。将提交已获取的内容。",en:"Some diagnostic sources are unavailable: {sources}. Available information will be sent."},"feedback.source.appVersion":{zh:"应用版本",en:"app version"},"feedback.source.messages":{zh:"会话内容",en:"conversation"},"feedback.source.agentConfig":{zh:"会话设置",en:"session settings"},"feedback.source.backendLogs":{zh:"运行输出",en:"runtime output"},"feedback.source.connection":{zh:"连接信息",en:"connection details"},"feedback.source.backendStatus":{zh:"引擎状态",en:"engine status"},"feedback.source.usage":{zh:"用量",en:"usage"},"feedback.source.timeline":{zh:"运行时间线",en:"run timeline"},"feedback.source.activityLog":{zh:"活动记录",en:"activity"},"feedback.truncated":{zh:"部分记录已达到数量上限,附件内已标记。",en:"Some records reached the collection limit; this is marked in the attachment."},"feedback.tooLarge":{zh:"附件超过 5 MB,请减少勾选的内容后再提交。",en:"The attachment exceeds 5 MB. Deselect some information before sending."},"feedback.prepareFailed":{zh:"诊断信息准备失败。请重试,或取消勾选后仅提交文字。",en:"Could not prepare diagnostics. Retry, or deselect the options to send text only."},"feedback.refresh":{zh:"重新收集",en:"Collect again"},"feedback.successTitle":{zh:"反馈已收到",en:"Feedback received"},"feedback.successHint":{zh:"感谢你帮助我们改进 Tangu。你可以在账户中心查看回复。",en:"Thanks for helping improve Tangu. You can view replies in your account center."},"feedback.ticket":{zh:"反馈编号:{id}",en:"Reference: {id}"},"feedback.viewFeedback":{zh:"查看我的反馈",en:"View my feedback"},"feedback.done":{zh:"完成",en:"Done"},"feedback.limit":{zh:"反馈内容不能超过 {max} 字。",en:"Feedback cannot exceed {max} characters."},"feedback.retry":{zh:"重试提交",en:"Try again"},"feedback.diagnosePrompt":{zh:`我在使用 Tangu 时遇到一个问题,想请你帮我诊断:
|
|
5
|
+
|
|
6
|
+
{description}
|
|
7
|
+
|
|
8
|
+
请结合当前会话的上下文分析可能的原因,并给出排查步骤。`,en:`I ran into a problem while using Tangu and would like your help diagnosing it:
|
|
9
|
+
|
|
10
|
+
{description}
|
|
11
|
+
|
|
12
|
+
Using the context of this session, analyze the likely causes and suggest troubleshooting steps.`}});function Un(n){E.getState().setPendingDraft(n),$.getState().openView("chat",{followActive:!0,reuseKey:"primary"},"main")}const Kn=({cfg:n,activeSession:a,onClose:o,surface:u="modal"})=>{const{t:r}=ge(),[w]=c.useState(()=>({cfg:n,session:a})),p=E(k=>k.feedbackDraft),[b,h]=c.useState("bug"),[m,g]=c.useState(!0),[v,f]=c.useState(!1),[y,I]=c.useState(!1),[C,S]=c.useState(0),[M,j]=c.useState(null),[D,R]=c.useState(!1),[L,G]=c.useState(!1),[Y,B]=c.useState(null),[W,V]=c.useState(""),_=c.useRef(null),re=c.useRef(!1),z=c.useRef(o);z.current=o;const U=m||v||y,ce=`${m}:${v}:${y}:${C}`,le=M?.key===ce?M:null,K=U&&!le,T=U?le?.report:void 0,de=!!T&&T.bytes>ti,ne=p.trim().length>bt,se=!!p.trim()&&!ne&&!L&&!Y&&!K&&!de&&(!U||!!T),ue=()=>{re.current||z.current()};c.useEffect(()=>{if(!U)return;let k=!0;return ni(w.cfg,w.session,{diagnostics:m,conversation:v,activity:y}).then(O=>{k&&j({key:ce,report:O})}).catch(()=>{k&&j({key:ce,failed:!0})}),()=>{k=!1}},[w,m,v,y,C,ce,U]),c.useEffect(()=>{const k=document.activeElement,O=requestAnimationFrame(()=>_.current?.querySelector("textarea")?.focus()),ze=q=>{if(q.key==="Escape"&&(q.preventDefault(),q.stopImmediatePropagation(),re.current||z.current()),q.key==="Tab"){const me=Array.from(_.current?.querySelectorAll('button:not(:disabled), textarea:not(:disabled), input:not(:disabled), [tabindex="0"]')||[]).filter(Fe=>Fe.getClientRects().length>0),ve=me[0],ke=me[me.length-1];if(!ve){q.preventDefault(),_.current?.focus();return}q.shiftKey&&(document.activeElement===ve||!_.current?.contains(document.activeElement))?(q.preventDefault(),ke.focus()):!q.shiftKey&&(document.activeElement===ke||!_.current?.contains(document.activeElement))&&(q.preventDefault(),ve.focus())}};return document.addEventListener("keydown",ze,!0),()=>{cancelAnimationFrame(O),document.removeEventListener("keydown",ze,!0),k?.focus()}},[]);const P=async()=>{if(!(!se||re.current)){if(!window.tangu?.submitFeedback){V(r("feedback.errUnavailable"));return}re.current=!0,G(!0),V("");try{const k=await window.tangu.submitFeedback({description:`[Tangu · ${r(`feedback.${b}`)}]
|
|
13
|
+
|
|
14
|
+
${p.trim()}`,...T?{sessionLogJson:T.json,sessionLogName:T.filename}:{}});k.ok?(B(k),E.setState({feedbackDraft:""})):V(k.error==="attachment-too-large"?r("feedback.tooLarge"):r("feedback.errFail",{err:k.error==="not-logged-in"?r("feedback.errNotLoggedIn"):k.error||"Unknown error"}))}catch(k){V(r("feedback.errFail",{err:String(k?.message||k)}))}finally{re.current=!1,G(!1)}}},st=()=>{if(!p.trim()||L)return;const k=r("feedback.diagnosePrompt",{description:p.trim()});window.tangu?.requestMainAction?window.tangu.requestMainAction("chat-draft",k):Un(k),ue()},be=T?`${(T.bytes/1024).toFixed(1)} KB`:"",we=()=>{if(!T)return;const k=URL.createObjectURL(new Blob([T.json],{type:"application/json;charset=utf-8"})),O=document.createElement("a");O.href=k,O.download=T.filename,O.click(),setTimeout(()=>URL.revokeObjectURL(k),1e4)};return t.jsx("div",{className:u==="panel"?"feedback-panel-surface":"memv-modal feedback-overlay",onClick:k=>{u==="modal"&&k.target===k.currentTarget&&ue()},children:t.jsxs("div",{ref:_,className:"modal feedback-modal",role:"dialog","aria-modal":"true","aria-labelledby":"feedback-title",tabIndex:-1,onKeyDown:k=>{(k.metaKey||k.ctrlKey)&&k.key==="Enter"&&!k.nativeEvent.isComposing&&(k.preventDefault(),P())},children:[t.jsxs("div",{className:"modal-head feedback-head",children:[t.jsxs("div",{className:"feedback-heading",children:[t.jsx(dn,{size:19}),t.jsxs("div",{children:[t.jsx("h2",{id:"feedback-title",children:r("feedback.title")}),t.jsx("p",{children:r("feedback.subtitle")})]})]}),t.jsx("button",{className:"icon-btn",onClick:ue,disabled:L,"aria-label":r("settings.btn.cancel"),children:t.jsx(xt,{size:18})})]}),Y?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"modal-body feedback-success",role:"status",children:[t.jsx("span",{className:"feedback-success-icon",children:t.jsx(ka,{size:28})}),t.jsx("h3",{children:r("feedback.successTitle")}),t.jsx("p",{children:r("feedback.successHint")}),Y.id&&t.jsx("code",{children:r("feedback.ticket",{id:Y.id})}),Y.attachmentSkipped&&t.jsx("p",{className:"feedback-warning",children:r("feedback.okNoLog")}),W&&t.jsx("p",{className:"feedback-warning",role:"alert",children:W})]}),t.jsxs("div",{className:"feedback-footer",children:[window.tangu?.openAccountCenter&&t.jsx("button",{className:"btn ghost",onClick:()=>{V(""),window.tangu.openAccountCenter("feedback").catch(()=>V(r("feedback.errUnavailable")))},children:r("feedback.viewFeedback")}),t.jsx("span",{className:"grow"}),t.jsx("button",{autoFocus:!0,className:"btn primary",onClick:ue,children:r("feedback.done")})]})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"modal-body feedback-body",children:[D?t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn ghost sm feedback-back",onClick:()=>R(!1),children:[t.jsx(xa,{size:14}),r("feedback.backToForm")]}),t.jsxs("div",{className:"feedback-file",children:[t.jsx(wt,{size:15}),t.jsx("span",{children:T?.filename}),t.jsx("span",{children:be})]}),t.jsx("pre",{className:"feedback-preview",tabIndex:0,children:T?.json})]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"feedback-kinds",role:"group","aria-label":r("feedback.kind"),children:[{id:"bug",Icon:ya},{id:"idea",Icon:Cn},{id:"other",Icon:dn}].map(({id:k,Icon:O})=>t.jsxs("button",{className:"btn ghost","aria-pressed":b===k,disabled:L,onClick:()=>h(k),children:[t.jsx(O,{size:15}),r(`feedback.${k}`)]},k))}),t.jsxs("div",{className:"feedback-description",children:[t.jsx("label",{htmlFor:"feedback-description",children:r(b==="bug"?"feedback.description":"feedback.label")}),t.jsx("textarea",{id:"feedback-description",value:p,onChange:k=>{E.setState({feedbackDraft:k.target.value}),V("")},placeholder:r(`feedback.${b}Placeholder`),disabled:L,"aria-invalid":ne,"aria-describedby":"feedback-count"}),t.jsxs("span",{id:"feedback-count",className:ne?"feedback-warning":"feedback-count",children:[p.trim().length.toLocaleString()," / ",bt.toLocaleString()]})]}),t.jsxs("section",{className:"feedback-context","aria-labelledby":"feedback-context-title",children:[t.jsxs("div",{className:"feedback-section-heading",children:[t.jsx("h3",{id:"feedback-context-title",children:r("feedback.context")}),t.jsx("code",{children:"/feedback"})]}),t.jsx("p",{className:"feedback-session",children:w.session?r("feedback.sessionContext",{name:w.session.title||w.session.id.slice(0,8)}):r("feedback.withoutSession")}),[{id:"diagnostics",checked:m,change:g,unavailable:!1},{id:"conversation",checked:v,change:f,unavailable:!w.session},{id:"activity",checked:y,change:I,unavailable:!window.tangu?.exportActivity}].map(k=>t.jsxs("label",{className:"feedback-option","data-disabled":k.unavailable||void 0,children:[t.jsx("input",{type:"checkbox",checked:k.checked,onChange:O=>k.change(O.target.checked),disabled:L||k.unavailable}),t.jsxs("span",{children:[t.jsx("strong",{children:r(`feedback.${k.id}`)}),t.jsx("small",{children:r(`feedback.${k.id}Hint`)})]})]},k.id))]}),t.jsxs("div",{className:"feedback-report-status",role:"status",children:[t.jsx("span",{children:K?t.jsxs(t.Fragment,{children:[t.jsx(un,{size:13,className:"spin"}),r("feedback.preparing")]}):T?t.jsxs(t.Fragment,{children:[t.jsx(wt,{size:13}),r("feedback.ready",{size:be})]}):r(U?"feedback.prepareFailed":"feedback.textOnly")}),t.jsxs("div",{children:[T&&t.jsx("button",{className:"btn ghost sm",onClick:()=>R(!0),disabled:L,children:r("feedback.preview")}),T&&t.jsxs("button",{className:"btn ghost sm",onClick:we,disabled:L,children:[t.jsx(Sa,{size:13}),r("feedback.export")]}),U&&t.jsx("button",{className:"icon-btn",onClick:()=>S(k=>k+1),disabled:L||K,"aria-label":r("feedback.refresh"),title:r("feedback.refresh"),children:t.jsx(Fn,{size:13})})]})]}),!!T?.missing.length&&t.jsx("p",{className:"feedback-warning",children:r("feedback.partial",{sources:T.missing.map(k=>r(`feedback.source.${k}`)).join(", ")})}),T?.truncated&&t.jsx("p",{className:"feedback-note",children:r("feedback.truncated")}),U&&t.jsx("p",{className:"feedback-note",children:r("feedback.privacy")})]}),de&&t.jsx("p",{className:"feedback-warning",role:"alert",children:r("feedback.tooLarge")}),ne&&t.jsx("p",{className:"feedback-warning",role:"alert",children:r("feedback.limit",{max:bt})}),W&&t.jsx("p",{className:"feedback-warning",role:"alert",children:W})]}),t.jsxs("div",{className:"feedback-footer",children:[t.jsxs("button",{className:"btn ghost feedback-diagnose",onClick:st,disabled:L||!p.trim(),title:r("feedback.diagnoseViaChatHint"),children:[t.jsx(ja,{size:15}),r("feedback.diagnoseViaChat")]}),t.jsx("span",{className:"grow"}),t.jsxs("button",{className:"btn primary",onClick:()=>{P()},disabled:!se,children:[L&&t.jsx(un,{size:14,className:"spin"}),r(L?"feedback.sending":W?"feedback.retry":"feedback.submit")]})]})]})]})})};function Xe(n){return Array.from(n.dataTransfer?.types??[]).includes("Files")}function Oe(){let n=0;const a=h=>{if(h){document.body.setAttribute("data-file-drag","1");return}n=0,document.body.removeAttribute("data-file-drag")},o=h=>{!Xe(h)||h.defaultPrevented||(h.preventDefault(),h.dataTransfer&&(h.dataTransfer.dropEffect="none"))},u=h=>{Xe(h)&&!h.defaultPrevented&&h.preventDefault()},r=()=>a(!1),w=h=>{Xe(h)&&(n++,a(!0))},p=h=>{Xe(h)&&(n=Math.max(0,n-1),n||a(!1))},b=()=>a(!1);return document.addEventListener("dragover",o),document.addEventListener("drop",u),document.addEventListener("drop",r,!0),document.addEventListener("dragenter",w),document.addEventListener("dragleave",p),window.addEventListener("dragend",b),window.addEventListener("blur",b),()=>{document.removeEventListener("dragover",o),document.removeEventListener("drop",u),document.removeEventListener("drop",r,!0),document.removeEventListener("dragenter",w),document.removeEventListener("dragleave",p),window.removeEventListener("dragend",b),window.removeEventListener("blur",b),document.body.removeAttribute("data-file-drag")}}function Xn({target:n,onUnavailable:a}){const[,o]=c.useReducer(m=>m+1,0),[u,r]=c.useState(()=>({...n.params??{}})),w=c.useRef(u);w.current=u;const p=c.useRef(!1);c.useEffect(()=>Pe(o),[]),c.useEffect(()=>r({...n.params??{}}),[n]);const b=Ae(n.type);b&&(p.current=!0),c.useEffect(()=>{p.current&&!b&&a?.()},[b,a]);const h=c.useMemo(()=>({id:`floating:${n.type}`,type:n.type,loc:"main",get params(){return w.current},setTitle:m=>{document.title=m},setParams:m=>r({...m}),close:()=>a?.()}),[n.type,a]);return b?t.jsx("div",{className:"floating-plugin-view","data-view":n.type,children:t.jsx(zn,{children:t.jsx(c.Suspense,{fallback:null,children:b.factory({leaf:h,params:u})})})}):t.jsx("div",{className:"floating-panel-empty",children:"Loading panel…"})}const si=[[390,"iPhone"],[414,"Max"],[768,"iPad"]];function ai({children:n}){const[a,o]=c.useState(390);return On!=="mobile"?t.jsx(t.Fragment,{children:n}):window.innerWidth<=820?t.jsx(t.Fragment,{children:n}):t.jsxs("div",{className:"sc-frame",children:[t.jsx("div",{className:"sc-bar",children:si.map(([u,r])=>t.jsxs("button",{className:`sc-size${a===u?" on":""}`,onClick:()=>o(u),children:[r," · ",u]},u))}),t.jsx("div",{className:"sc-device",style:{width:a},children:n})]})}function oi(){ys(),c.useEffect(()=>Oe(),[]),c.useEffect(()=>{Ss(),go()},[]),c.useEffect(()=>window.tangu?.onMainAction?.((m,g)=>{m==="onboarding"&&E.getState().setOnboarding(!0),m==="dev-commands"&&js(),m==="test-notification"&&Es(),m==="reset-layout"&&$.getState().resetLayout({undoable:!0}),m==="achievement-toast"&&Ea(),m==="space-removed"&&g&&io(g),m==="chat-draft"&&g&&Un(g),m==="chat-quote"&&g&&bo(g),m==="agents-changed"&&(E.getState().refreshAgents(),window.dispatchEvent(new Event("forsion:agents-changed"))),m==="skills-changed"&&(St(jt()).then(v=>E.setState({skillsList:v})).catch(()=>{}),window.dispatchEvent(new Event("forsion:skills-changed"))),m==="open-agents"&&hn(E.getState().defaultAgentSlug||""),m==="open-agent"&&g&&/^[a-z0-9][a-z0-9-]{0,63}$/.test(g)&&hn(g)}),[]);const n=nt(),a=Ca();Cs();const o=E(_n(m=>({sessions:m.sessions,archivedSessions:m.archivedSessions,activeId:m.activeId,settingsOpen:m.settingsOpen,settingsTab:m.settingsTab,settingsSkillKey:m.settingsSkillKey,onboarding:m.onboarding,feedbackOpen:m.feedbackOpen,marketOpen:m.marketOpen,closeMarket:m.closeMarket,achievementsOpen:m.achievementsOpen,cfg:m.cfg,tr:m.tr,openSettings:m.openSettings,closeSettings:m.closeSettings,patchConfig:m.patchConfig,connect:m.connect,setOnboarding:m.setOnboarding,closeFeedback:m.closeFeedback}))),u=o.sessions.find(m=>m.id===o.activeId)||o.archivedSessions.find(m=>m.id===o.activeId)||null,r=c.useSyncExternalStore(Na,mn,mn),[w,p]=c.useState(!1),b=c.useRef(o.onboarding);c.useEffect(()=>{const m=b.current;if(b.current=o.onboarding,m&&!o.onboarding){p(!0);const g=setTimeout(()=>p(!1),650);return()=>clearTimeout(g)}},[o.onboarding]);const h=o.settingsOpen||o.marketOpen||o.achievementsOpen||o.feedbackOpen||!!r||o.onboarding;return t.jsxs(ai,{children:[t.jsx("div",{className:`shell-host${w?" main-enter":""}`,style:o.onboarding?{visibility:"hidden"}:void 0,children:t.jsx(Hn,{dark:a.mode==="dark",soft:!!$n(a.lang)?.manifest.panelGap,buildDefault:Nn,header:t.jsx(ei,{}),footer:t.jsx(Ns,{})})}),Ia()&&t.jsx(In,{}),t.jsx(La,{}),t.jsx(Ta,{}),t.jsx(Vn,{}),t.jsx(lo,{}),t.jsx(Se,{children:o.settingsOpen&&t.jsx(Te,{title:o.tr("settings.title"),onClose:()=>o.closeSettings(),children:t.jsx(Ln,{open:!0,initialTab:o.settingsTab??void 0,initialSkillKey:o.settingsSkillKey??void 0,cfg:o.cfg,activeSession:u,themeLang:n.lang,themeSkin:n.skin,themeMode:n.mode,themeModePref:n.modePref,flatOn:n.flat,glassOn:n.glass,themeSeed:n.seed,onClose:()=>o.closeSettings(),onConfigChange:o.patchConfig,onThemeChange:(m,g,v)=>n.setTheme(m,g,n.bg,v),onFlatChange:n.setFlat,onGlassChange:m=>n.setGlass(m),onSeedChange:m=>n.setSeedValue(m),onReloadThemes:()=>n.reloadThemes(),onReconnect:m=>{o.connect({...o.cfg,...m||{}})},onRelaunchOnboarding:()=>{o.closeSettings();try{localStorage.removeItem(Bn)}catch{}o.setOnboarding(!0)}})},"settings")}),t.jsx(Se,{children:o.onboarding&&t.jsx(uo.div,{style:{position:"fixed",inset:0,zIndex:60,background:"var(--bg)"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,scale:1.06},transition:{duration:.45,ease:[.2,.8,.2,1]},children:t.jsx(Ma,{themeLang:n.lang,themeSkin:n.skin,themeMode:n.mode,themeModePref:n.modePref,themeSeed:n.seed,onThemeChange:(m,g,v)=>n.setTheme(m,g,n.bg,v),onSeedChange:m=>n.setSeedValue(m),onReconnect:()=>{window.tangu?.getConfig().then(m=>{const g={backendUrl:m.backendUrl,token:m.token,modelId:m.modelId};E.setState({cfg:g,desktopMode:"managed"}),E.getState().connect(g)})},onFinish:()=>{o.setOnboarding(!1),window.tangu?.getConfig().then(m=>{const g={backendUrl:m.backendUrl,token:m.token,modelId:m.modelId};E.setState({cfg:g,homeDir:m.homeDir,defaultWsDir:m.defaultWorkspaceDir||""}),E.getState().connect(g)})}})},"onboarding")}),t.jsx(Se,{children:o.marketOpen&&t.jsx(Te,{title:o.tr("market.title"),onClose:()=>o.closeMarket(),children:t.jsx(Tn,{onClose:()=>o.closeMarket()})},"market")}),t.jsx(Se,{children:o.achievementsOpen&&t.jsx(Te,{title:o.tr("achievements.title"),onClose:()=>E.getState().closeAchievements(),children:t.jsx(Mn,{onClose:()=>E.getState().closeAchievements()})},"achievements")}),t.jsx(Se,{children:o.feedbackOpen&&t.jsx(Te,{compact:!0,title:o.tr("feedback.title"),onClose:()=>o.closeFeedback(),children:t.jsx(Kn,{surface:"panel",cfg:o.cfg,activeSession:u,onClose:()=>o.closeFeedback()})},"feedback")}),t.jsx(Is,{}),t.jsx(Se,{children:r?.view&&t.jsx(Te,{title:r.title,onClose:pn,children:t.jsx(Xn,{target:r.view,onUnavailable:pn})},r.id)}),!h&&t.jsx(Dn,{}),!h&&t.jsx(Ls,{onOpen:()=>E.getState().openAchievements()}),!o.onboarding&&t.jsx(Ts,{})]})}Qe({"chatpreview.msg.ask":{zh:"帮我把 LCL 的 hash 路由分支理一下,再决定要不要抽成表。",en:"Walk me through the hash route branches in LCL, then decide whether to pull them into a table."},"chatpreview.msg.reasoning":{zh:"先看 main.tsx 的 hash 分支顺序,确认 #/aion 与 #/tangu 不会被前面的 frame 分支吞掉,再决定是否抽一个 routes 表。整体规模还小,优先可读性。",en:"Start with the order of the hash branches in main.tsx, confirm that #/aion and #/tangu are not swallowed by the earlier frame branch, then decide whether to extract a routes table. The whole thing is still small, so readability wins."},"chatpreview.todo.read":{zh:"读 main.tsx 路由分支",en:"Read the route branches in main.tsx"},"chatpreview.todo.addRoute":{zh:"加 #/tangu 分支",en:"Add the #/tangu branch"},"chatpreview.todo.navLink":{zh:"补 Navigator 链接",en:"Add the Navigator link"},"chatpreview.todo.build":{zh:"跑 tsc / build",en:"Run tsc / build"},"chatpreview.plan":{zh:`1. 检查 hash 分支顺序
|
|
15
|
+
2. 补路由与导航
|
|
16
|
+
3. 运行 typecheck / build`,en:`1. Check the order of the hash branches
|
|
17
|
+
2. Add the route and the navigation link
|
|
18
|
+
3. Run typecheck / build`},"chatpreview.msg.answer":{zh:"看完了。当前是 5 条 `if (route.view === …)` 顺序分支,`frame` 在前、`aion/tangu` 在后,互不吞。\n\n```ts\nif (route.view === 'frame') return <Frame/>\nif (route.view === 'tangu') return <Tangu/>\n```\n\n规模还小,**暂不必抽表**——超过 ~8 条再说。",en:"Had a look. Right now there are 5 sequential `if (route.view === …)` branches — `frame` first, then `aion/tangu` — and none of them swallows another.\n\n```ts\nif (route.view === 'frame') return <Frame/>\nif (route.view === 'tangu') return <Tangu/>\n```\n\nAt this size a table is **not worth extracting yet** — revisit past ~8 branches."},"chatpreview.msg.buildFirst":{zh:"我先跑一遍构建确认。",en:"Let me run a build first to confirm."},"chatpreview.plan.question":{zh:"计划已就绪。是否批准?",en:"The plan is ready. Approve it?"},"chatpreview.inquiry.question":{zh:"路由是抽成表驱动,还是保持 if 分支?",en:"Should routing become table-driven, or stay as if branches?"},"chatpreview.inquiry.optTable":{zh:"抽成 routes 表",en:"Extract a routes table"},"chatpreview.inquiry.optIf":{zh:"保持 if 分支",en:"Keep the if branches"},"chatpreview.session.routing":{zh:"重构 LCL 路由层",en:"Refactor the LCL routing layer"},"chatpreview.session.weekly":{zh:"周报整理",en:"Compile the weekly report"},"chatpreview.session.scraper":{zh:"爬虫脚本调试",en:"Debug the scraper script"},"chatpreview.session.design":{zh:"设计系统对照",en:"Design system comparison"}});function ii(n){const a=Date.now()-6e4;return[{id:"u1",role:"user",content:n("chatpreview.msg.ask"),attachments:[{name:"routes.md",mimeType:"text/markdown",data:"",size:128}],status:"done",timestamp:a+1},{id:"a1",role:"assistant",agentName:"Tangu",status:"done",timestamp:a+2,systemPrompt:"You are Tangu, a coding agent. Keep changes scoped and verify them.",reasoning:n("chatpreview.msg.reasoning"),toolEvents:[{id:"t1",name:"read_file",arguments:"src/main.tsx",done:!0,elapsedMs:400},{id:"t2",name:"run_shell",arguments:"npx tsc --noEmit",done:!0,isError:!0,elapsedMs:1200}],todos:[{status:"completed",content:n("chatpreview.todo.read")},{status:"in_progress",content:n("chatpreview.todo.addRoute")},{status:"pending",content:n("chatpreview.todo.navLink")},{status:"pending",content:n("chatpreview.todo.build")}],planProposal:n("chatpreview.plan"),inquiries:[{inquiryId:"iqp",runId:"r1",question:n("chatpreview.plan.question"),options:[],status:"pending",kind:"plan"}],content:n("chatpreview.msg.answer")},{id:"a2",role:"assistant",agentName:"Tangu",status:"done",timestamp:a+3,content:n("chatpreview.msg.buildFirst"),approvals:[{approvalId:"ap1",runId:"r1",name:"run_bash",arguments:JSON.stringify({command:"npm run build && npx tsc --noEmit"}),preview:"$ npm run build && npx tsc --noEmit",status:"pending",reason:{kind:"mode",mode:"auto-edit"}},{approvalId:"ap2",runId:"r1",name:"write_file",arguments:JSON.stringify({path:"/etc/hosts",content:`127.0.0.1 tangu.local
|
|
19
|
+
`}),preview:"⚠ Write outside the workspace · write /etc/hosts (22 chars)",status:"pending",reason:{kind:"escalate",mode:"auto-edit"}}]},{id:"a3",role:"assistant",agentName:"Tangu",status:"done",timestamp:a+4,content:"",inquiries:[{inquiryId:"iq1",runId:"r1",question:n("chatpreview.inquiry.question"),options:[n("chatpreview.inquiry.optTable"),n("chatpreview.inquiry.optIf")],status:"pending"}]}]}const kn=new Date().toISOString(),ri=["chatpreview.session.routing","chatpreview.session.weekly","chatpreview.session.scraper","chatpreview.session.design"];function ci(n){return ri.map((a,o)=>({id:`s${o+1}`,title:n(a),model_id:null,archived:!1,emoji:null,agent_config:null,project_path:"/tangu",project_name:n("app.defaultWorkspace"),created_at:kn,updated_at:kn}))}function li(n){return[{key:"__cloud__",name:n("app.cloudWorkspace"),kind:"cloud",path:null,system:!0},{key:"/tangu",name:n("app.defaultWorkspace"),kind:"local",path:"/tangu",system:!0}]}const xn={backendUrl:"http://localhost:8787",token:"",modelId:""};function di(){const{t:n}=ge(),[a,o]=c.useState(!1),[u,r]=c.useState(""),w=c.useRef(null),p=c.useMemo(()=>ii(n),[n]),b=c.useMemo(()=>ci(n),[n]),h=c.useMemo(()=>li(n),[n]);return t.jsxs("div",{className:"t2-preview-shell",children:[t.jsx("div",{className:"t2-preview-side",children:t.jsx(jo,{collapsed:!1,sessions:b,archivedSessions:[],activeId:"s1",runningIds:new Set(["s2"]),unreadIds:new Set(["s3"]),cfg:xn,modelId:"",activeSession:b[0],workspaces:h,onSelect:()=>{},onNewInWorkspace:()=>{},onAddWorkspace:()=>{},onRenameWorkspace:()=>{},onRemoveWorkspace:()=>{},onRename:()=>{},onArchive:()=>{},onDelete:()=>{},onOpenSettings:()=>{},showSpecial:!0,onNewChat:()=>o(!0),onOpenWorkspace:()=>{}})}),t.jsxs("div",{className:"t2-preview-main t2-chat-view",children:[t.jsxs("div",{className:"t2-toolbar",children:[t.jsx("div",{className:"t2-toolbar-title",children:b[0].title}),t.jsx("span",{className:"t2-toolbar-grow"}),t.jsx("button",{className:"t2-pill",onClick:()=>o(!1),style:{fontWeight:a?400:600},children:n("workbench.chat")}),t.jsx("button",{className:"t2-pill",onClick:()=>o(!0),style:{fontWeight:a?600:400},children:n("chat.emptyHint")}),u&&t.jsx("span",{className:"t2-toolbar-pill","data-preview-action":!0,children:u})]}),a?t.jsx(wo,{}):t.jsx("div",{className:"t2-stream",ref:w,children:t.jsx("div",{className:"t2-stream-inner",children:p.map(m=>t.jsx(vo,{msg:m},m.id))})}),t.jsx(Eo,{approvalTray:a?void 0:t.jsx(ko,{items:xo(p),onDecide:(m,g,v,f)=>(r(`approval:${v}:${String(f?.command||"")}`),!1),onAnswer:(m,g,v)=>(r(`inquiry:${v}`),!1)}),disabled:!1,running:!1,execConfig:{execMode:"host",approvalMode:"auto-edit"},models:null,modelId:"",onModelChange:()=>{},planMode:!1,onPlanModeChange:()=>{},onExecConfigChange:()=>{},onSend:async()=>!0,onStop:()=>{},contextWindow:2e5,ctxTokens:84e3,sessionTokens:12e3,onCompact:()=>{}})]}),t.jsxs("div",{className:"t2-preview-right",children:[t.jsx("div",{className:"t2-preview-right-title",children:n("panel.tab.toc")}),t.jsx(Co,{view:"toc",cfg:xn,sessionId:"s1",sessionConfig:{},running:!1,messages:a?[]:p,chatScrollRef:w,onToast:()=>{},onOpenPreview:()=>{},subChats:[]})]})]})}function ui(){$.getState().openView("home",{},"main")}Qe({"spaceWindow.stuck":{zh:"这个 Space 还没准备好。它所属的插件可能还在加载,或已被停用、卸载。准备好后这里会自动打开,也可以直接关掉这扇窗。",en:"This Space is not ready yet. Its plugin may still be loading, or may have been disabled or removed. It will open here once it is ready, or you can close this window."}});const yn=6e3;function mi(){const[n,a]=c.useState(fn?"wait":"plain");return c.useEffect(()=>{const o=fn;if(!o)return;const u=Date.now();let r=null,w=!1;const p=()=>{const g=oe.getState().spaces.find(f=>f.id===o);if(r){g!==r&&!w&&(w=!0,location.reload());return}if(!g||!Ra()&&Date.now()-u<yn)return;r=g;const v=$.getState();v.setSidebarDefaults(g.sidebarDefaults),v.setSideProfile(g.id,g.resizableSides??{},g.sideDefaultScale,g.bottomSpan),v.setPinned(g.pinned),document.title=je(g.name),a("ready")};p();const b=oe.subscribe(p),h=Pe(p),m=window.setTimeout(()=>{p(),r||a("stuck")},yn+50);return()=>{b(),h(),window.clearTimeout(m)}},[]),n}function pi(){const{t:n}=ge(),a=nt(),o=mi();c.useEffect(()=>{E.getState().setTr((r,w)=>n(r,w))},[n]),c.useEffect(()=>{E.getState().boot()},[]),c.useEffect(()=>Oe(),[]),c.useEffect(()=>window.tangu?.onMainAction?.(r=>{r==="agents-changed"&&(E.getState().refreshAgents(),window.dispatchEvent(new Event("forsion:agents-changed"))),r==="skills-changed"&&(St(jt()).then(w=>E.setState({skillsList:w})).catch(()=>{}),window.dispatchEvent(new Event("forsion:skills-changed")))}),[]),c.useEffect(()=>{window.tangu?.detachedReady?.(Da()).then(r=>{if(!r?.length)return;const w=$.getState();for(const p of r)w.openView(p.type,p.params??{},"main")})},[]);const u=(()=>{try{return window.tangu?.platform==="darwin"}catch{return!1}})();return o==="wait"||o==="stuck"?t.jsxs("div",{className:"shell-host",style:{display:"flex",flexDirection:"column"},children:[u&&t.jsx("div",{style:{height:38,flex:"0 0 auto",WebkitAppRegion:"drag"}}),o==="stuck"&&t.jsx("div",{className:"space-window-wait",role:"status",style:{flex:1,display:"grid",placeItems:"center",padding:32,textAlign:"center",color:"var(--text-muted)",fontSize:"var(--ui-font-body, 13px)",lineHeight:1.6},children:t.jsx("span",{style:{maxWidth:420},children:n("spaceWindow.stuck")})})]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"shell-host",children:t.jsx(Hn,{noRibbon:!0,dark:a.mode==="dark",soft:!!$n(a.lang)?.manifest.panelGap,buildDefault:o==="ready"?Nn:ui,header:u?t.jsx("div",{style:{height:38,flex:"0 0 auto",WebkitAppRegion:"drag"}}):void 0})}),window.amadeus&&t.jsx(In,{}),t.jsx(Vn,{})]})}Qe({"dock.pickTitle":{zh:"贴到哪个窗口旁边",en:"Dock beside a window"},"dock.pickHint":{zh:"选一个窗口,对话面板会贴在它旁边,一起移动和缩放。",en:"Pick a window. The chat panel docks beside it and moves and resizes with it."},"dock.loading":{zh:"正在查找窗口…",en:"Looking for windows…"},"dock.empty":{zh:"屏幕上没有可以贴靠的窗口。",en:"No windows on screen to dock beside."},"dock.refresh":{zh:"刷新",en:"Refresh"},"dock.close":{zh:"关闭",en:"Close"},"dock.selectedIn":{zh:"在 {app} 里选中的:",en:"Selected in {app}:"},"dock.err.helper_not_installed":{zh:"还没装好「电脑操作」的本机 helper。让 Agent 用一次电脑操作,它会自动装好。",en:"The Computer Use helper is not installed yet. Ask the agent to use Computer Use once and it installs itself."},"dock.err.helper_not_running":{zh:"「电脑操作」的本机 helper 没有启动。",en:"The Computer Use helper is not running."},"dock.err.unsupported_helper":{zh:"本机的「电脑操作」helper 是旧版,不支持侧边拼接。让 Agent 用一次电脑操作,它会自动更新。",en:"The Computer Use helper is out of date and cannot dock. Ask the agent to use Computer Use once and it updates itself."},"dock.err.window_gone":{zh:"这个窗口已经关了。",en:"That window has been closed."},"dock.err.generic":{zh:"没能贴过去({code})。",en:"Could not dock ({code})."}});const fi=new Set(["helper_not_installed","helper_not_running","unsupported_helper","window_gone"]);function hi(n,a,o){return n?.text?n.text:n?.items?.length?[o("dock.selectedIn",{app:a}),...n.items.map(u=>`- ${u}`)].join(`
|
|
20
|
+
`):""}function gi(){const{t:n}=ge(),[a,o]=c.useState(!1),[u,r]=c.useState(null);c.useEffect(()=>{E.getState().setTr((p,b)=>n(p,b))},[n]),c.useEffect(()=>{E.getState().boot().finally(()=>{E.setState({sessionMode:"work"}),o(!0)});const p=window.tangu?.onAppDockState?.(b=>r(b.target));return window.tangu?.appDockReady?.().then(b=>r(b.target)),()=>p?.()},[]),c.useEffect(()=>{window.amadeus&&Et()},[]),c.useEffect(()=>Oe(),[]),c.useEffect(()=>{if(!a||!u)return;const p={type:"chat",params:{miniSurface:!0,appRef:u}};wi({view:p,mainView:{type:"chat"}}),E.getState().setActiveId(null),$.getState().openView("chat",p.params,"main")},[a,u?.pid,u?.windowId]);const w=c.useRef(n);return w.current=n,c.useEffect(()=>{if(!u)return;let p="";const b=async()=>{const h=hi(await window.tangu?.appDockSelection?.(),u.app,w.current);!h||h===p||(p=h,E.getState().setPendingChatQuote("chat",h))};return window.addEventListener("focus",b),()=>window.removeEventListener("focus",b)},[u?.pid,u?.windowId]),u?t.jsx(Yn,{buildDefault:()=>{},direct:{title:u.app,view:{type:"chat",params:{miniSurface:!0,appRef:u}},mainView:{type:"chat"}}}):t.jsx(bi,{})}function bi(){const{t:n}=ge(),[a,o]=c.useState(null),[u,r]=c.useState(""),w=async()=>{o(null),r("");const h=await window.tangu?.appDockCandidates?.();o(h?.windows??[]),h?.error&&r(h.error)};c.useEffect(()=>{w()},[]);const p=async h=>{r("");const m=await window.tangu?.appDockAttach?.({pid:h.pid,windowId:h.windowId,app:h.app,bundleId:h.bundleId,title:h.title});m&&!m.ok&&m.error!=="superseded"&&r(m.error||"unavailable")},b=u?fi.has(u)?n(`dock.err.${u}`):n("dock.err.generic",{code:u}):"";return t.jsxs("div",{className:"mini-card-shell","data-space":"dock",children:[t.jsxs("header",{className:"mini-card-chrome",children:[t.jsx("div",{className:"mini-card-drag-title dock-picker-title",children:n("dock.pickTitle")}),t.jsx("button",{className:"mini-card-action","aria-label":n("dock.refresh"),title:n("dock.refresh"),onClick:()=>{w()},children:t.jsx(Fn,{size:15})}),t.jsx("button",{className:"mini-card-action mini-card-close","aria-label":n("dock.close"),onClick:()=>window.tangu?.closeSelf?.(),children:t.jsx(xt,{size:15})})]}),t.jsxs("main",{className:"mini-card-main dock-picker",children:[t.jsx("p",{className:"dock-picker-hint",children:n("dock.pickHint")}),b&&t.jsx("p",{className:"dock-picker-error",role:"alert",children:b}),a===null?t.jsx("div",{className:"mini-panel-empty",children:n("dock.loading")}):a.length===0?!b&&t.jsx("div",{className:"mini-panel-empty",children:n("dock.empty")}):t.jsx("div",{className:"dock-picker-list",children:a.map(h=>t.jsxs("button",{className:"mini-card-row dock-picker-row","data-window-id":h.windowId,onClick:()=>{p(h)},children:[t.jsx(Aa,{size:15}),t.jsxs("span",{className:"mini-card-row-label",children:[t.jsx("span",{className:"dock-picker-app",children:h.app}),h.title&&t.jsx("span",{className:"dock-picker-window",children:h.title})]})]},`${h.pid}:${h.windowId}`))})]})]})}let X=null;function wi(n){X=n}Je()==="mini"&&(Oa(async n=>{n.type==="amadeus-editor"&&await Fa();const a={...n.params};delete a.miniSurface,n.type==="chat"&&(a.sessionId||=E.getState().activeId||void 0,a.followActive=!a.sessionId),window.tangu?.showMainPanel?.({...n,params:a})}),za(n=>{if(X?.view)return n.type===X.view.type?n:n.type===(X.mainView?.type||X.view.type)?{type:X.view.type,params:{...X.view.params,...n.params}}:(Ze({...n}),null);const a=yt();if(!a||!tt(a))return null;const o=a.mini;return n.type===o.view.type?n:n.type===o.mainView.type?{type:o.view.type,params:{...o.view.params,...n.params}}:(Ze({...n}),null)}));function vi(){const n=yt();n&&tt(n)&&$.getState().openView(n.mini.view.type,n.mini.view.params??{},"main")}function ki(){return Pa()?t.jsx(gi,{}):t.jsx(xi,{})}function xi(){const{t:n}=ge(),[a,o]=c.useState(null);return c.useEffect(()=>{E.getState().setTr((u,r)=>n(u,r))},[n]),c.useEffect(()=>{let u=!1,r=!1;const w=new URLSearchParams(location.search);let p=w.get("sessionId")?{sessionId:w.get("sessionId")}:null;const b=()=>{if(!u||!p)return;if(p.view){const C=p.view;if(!Ae(C.type)){r&&window.tangu?.closeSelf?.();return}r=!0;const S=p;p=null,X=S,o(S),$.getState().openView(C.type,{...C.params,...S.params},"main");return}const v=p.spaceId||(p.sessionId?"tangu":void 0),f=oe.getState().spaces.find(C=>C.id===v);if(!f||!tt(f))return;const y=p;p=null,X=null,o(null),et(f.id);const I={...f.mini.view.params,...y.params,...y.sessionId?{sessionId:y.sessionId,followActive:!1}:{}};$.getState().openView(f.mini.view.type,I,"main"),y.sessionId&&E.getState().setActiveId(y.sessionId)},h=window.tangu?.onMiniTarget?.(v=>{p=v,b()});window.tangu?.miniReady?.();const m=oe.subscribe(b),g=Pe(b);return E.getState().boot().finally(()=>{u=!0,b()}),()=>{h?.(),m(),g(),u=!1,X=null}},[]),c.useEffect(()=>{window.amadeus&&Et()},[]),c.useEffect(()=>Oe(),[]),t.jsx(Yn,{buildDefault:vi,direct:a?.view?{title:a.title,view:a.view,mainView:a.mainView??a.view}:null})}const yi={settings:"settings.title",market:"market.title",achievements:"achievements.title",feedback:"feedback.title",btw:"btw.title"};function Si(n,a){return n.builtin?a(yi[n.builtin]):n.title}function ji(){const{t:n}=ge(),a=nt(),[o,u]=c.useState(null),r=E(_n(y=>({cfg:y.cfg,cfgLoaded:y.cfgLoaded,closeSettings:y.closeSettings,closeMarket:y.closeMarket,closeAchievements:y.closeAchievements,closeFeedback:y.closeFeedback,patchConfig:y.patchConfig,connect:y.connect}))),w=o?.params?.session?.id?o.params.session:null,p=()=>window.tangu?.closeSelf?.(),b=o?.builtin==="btw"?yo(o.params):null,h=o?Si(o,n):"";if(c.useEffect(()=>{o?.builtin&&h&&(document.title=h)},[o?.builtin,h]),c.useEffect(()=>{E.getState().setTr((y,I)=>n(y,I))},[n]),c.useEffect(()=>{E.getState().boot()},[]),c.useEffect(()=>{window.amadeus&&Et()},[]),c.useEffect(()=>Oe(),[]),c.useEffect(()=>window.tangu?.onMainAction?.(y=>{y==="agents-changed"&&(E.getState().refreshAgents(),window.dispatchEvent(new Event("forsion:agents-changed"))),y==="skills-changed"&&(St(jt()).then(I=>E.setState({skillsList:I})).catch(()=>{}),window.dispatchEvent(new Event("forsion:skills-changed")))}),[]),c.useEffect(()=>{const y=_a(),I=window.tangu?.onFloatingTarget?.(u);return window.tangu?.floatingReady?.(y).then(C=>{C&&u(C)}),()=>I?.()},[]),c.useEffect(()=>{o?.builtin==="feedback"&&typeof o.params?.description=="string"&&E.setState({feedbackDraft:o.params.description})},[o]),!o)return t.jsx("div",{className:"floating-native-root"});const m=()=>{r.closeSettings(),p()},g=()=>{r.closeMarket(),p()},v=()=>{r.closeAchievements(),p()},f=()=>{r.closeFeedback(),p()};return t.jsxs("div",{className:"floating-native-root",children:[window.tangu?.platform==="darwin"&&t.jsx("header",{className:"floating-native-chrome",children:t.jsx("span",{title:h,children:h})}),t.jsxs("main",{className:"floating-native-content",children:[o.builtin==="settings"&&t.jsx(Ln,{open:!0,initialTab:typeof o.params?.tab=="string"?o.params.tab:void 0,initialSkillKey:typeof o.params?.skillKey=="string"?o.params.skillKey:void 0,cfg:r.cfg,activeSession:w,themeLang:a.lang,themeSkin:a.skin,themeMode:a.mode,themeModePref:a.modePref,flatOn:a.flat,glassOn:a.glass,themeSeed:a.seed,onClose:m,onConfigChange:r.patchConfig,onThemeChange:(y,I,C)=>a.setTheme(y,I,a.bg,C),onFlatChange:a.setFlat,onGlassChange:a.setGlass,onSeedChange:a.setSeedValue,onReloadThemes:a.reloadThemes,onReconnect:y=>{r.connect({...r.cfg,...y||{}})},onRelaunchOnboarding:()=>{try{localStorage.removeItem(Bn)}catch{}window.tangu?.requestMainAction?.("onboarding"),p()}},JSON.stringify(o.params??{})),o.builtin==="market"&&t.jsx(Tn,{initialQuery:typeof o.params?.q=="string"?o.params.q:void 0,onClose:g},String(o.params?.q??"")),o.builtin==="achievements"&&t.jsx(Mn,{onClose:v}),o.builtin==="feedback"&&r.cfgLoaded&&t.jsx(Kn,{surface:"panel",cfg:r.cfg,activeSession:w,onClose:f},w?.id||""),o.builtin==="btw"&&r.cfgLoaded&&b&&t.jsx(Ms,{seed:b,onClose:p}),o.view&&t.jsx(Xn,{target:o.view,onUnavailable:p})]}),(o.builtin==="settings"||o.builtin==="market")&&t.jsx(Dn,{})]})}let he=null;function Sn(n){if(!n){he&&(he.style.display="none");return}he||(he=document.createElement("div"),Object.assign(he.style,{position:"fixed",inset:"0",pointerEvents:"none",zIndex:"99998",boxSizing:"border-box",border:"3px solid var(--accent, #4d8794)",background:"color-mix(in srgb, var(--accent, #4d8794) 8%, transparent)"}),document.body.appendChild(he)),he.style.display="block"}function Ei(){const n=window.tangu;if(n?.openDetached){if(Je()==="main"){let a="";const o=()=>{const p=E.getState(),b=p.activeId,h={sessionId:b,runId:b?p.runningBySession[b]??null:null},m=JSON.stringify(h);m!==a&&(a=m,n.reportMiniSession?.(h))};E.subscribe(o),o();let u=null;const r=()=>{if(!$.getState().api||!u||!Ae(u.type))return;const b=u;u=null,b.spaceId&&et(b.spaceId);const h=$.getState().openView(b.type,b.params??{},"main");h&&b.params&&h.setParams({...h.params,...b.params})};n.onMainPanelTarget?.(p=>{u=p,r()}),Pe(r);let w=!1;$.subscribe(p=>{p.api&&(w||(w=!0,n.mainPanelReady?.()),r())})}$a({ribbonPointerDrag:n.platform==="win32",cursorScreenPoint:n.cursorScreenPoint,detach:(a,o)=>{n.openDetached?.(a,o)},openSpace:(a,o)=>{Je()==="main"&&Ba()===a&&oe.getState().activeSpaceId===a&&$.getState().saveNamed(Wa(a)),n.openDetached?.([],o,{space:a})},dragUpdate:(a,o,u)=>n.dragUpdate?.(a,o,u),drop:async(a,o,u)=>(await n.dropView?.(a,o,u))?.routed??!1}),n.onAcceptView?.(a=>{Sn(null),$.getState().openView(a.type,a.params??{},"main")}),n.onDragPreview?.(a=>Sn(a))}}function Ci(){const n=window.tangu;if(!n?.reportRunningSessions)return;const a=o=>n.reportRunningSessions(Object.keys(o).length);a(E.getState().runningBySession),E.subscribe((o,u)=>{o.runningBySession!==u.runningBySession&&a(o.runningBySession)})}const jn=n=>No(n).toLowerCase(),Gn=(n,a)=>n.configBySession[a]?.cwd||n.sessions.find(o=>o.id===a)?.project_path||"",Zn=(n,a)=>Object.keys(n.runningBySession).some(o=>jn(Gn(n,o))===jn(a));function Ni(){const n=window.tangu;if(!(!n?.codeStudioGitCommit||!n.codeStudioGitStatus||!n.productsIsCreation))return E.subscribe((a,o)=>{if(a.runningBySession!==o.runningBySession)for(const u of Object.keys(o.runningBySession)){if(a.runningBySession[u])continue;const r=Gn(a,u);!r||Zn(a,r)||Ii(r,u)}})}async function Ii(n,a){try{if(!await window.tangu.productsIsCreation(n))return;const o=await window.tangu.codeStudioGitStatus(n);if(!(o?.auto??o?.writable)||Zn(E.getState(),n))return;const u=Ds(E.getState().messagesBySession[a]||[]);await window.tangu.codeStudioGitCommit(n,{name:u,auto:!0,untitled:En("studio.history.untitled")})}catch(o){console.warn("[creations] 自动存版本失败",o)}}function Li(){if(!window.tangu?.onAuthWillChange)return()=>{};let n=!1,a=null,o=!1,u=0,r=Promise.resolve(),w=!1;const p=()=>{a&&(a.inert=o),a=null},b=window.tangu.onAuthWillChange(async()=>{const m=++u;a||(a=document.body,o=a?.inert??!1,a&&(a.inert=!0));try{if(await r,m!==u||w||!window.amadeus)return;const[{flushAllScopes:g,resetAllScopeDocs:v,usePageStore:f},{useDbStore:y},{useDrawStore:I},C]=await Promise.all([Le(()=>import("./appStore-DWP8UET9.js").then(S=>S.rF),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),Le(()=>import("./appStore-DWP8UET9.js").then(S=>S.rG),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),Le(()=>import("./appStore-DWP8UET9.js").then(S=>S.rI),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),Le(()=>import("./index-BM2o7PeV.js").then(S=>S.cx),[],import.meta.url)]);if(await Promise.all([g(!0),y.getState().flushAll(!0),I.getState().flushAll(!0)]),m!==u)return;n=f.getState().vaultSide==="cloud",n&&(C.retireAllUnifiedScopes(),v(),f.setState({vaultRoot:null,pages:[],folders:[],files:[],icons:{}}))}catch(g){throw m===u&&p(),g}}),h=window.tangu.onAuthChanged?.(()=>{const m=++u;if(!n){r.finally(()=>{m===u&&p()});return}n=!1,r=r.then(async()=>{const{usePageStore:g}=await Le(async()=>{const{usePageStore:v}=await import("./appStore-DWP8UET9.js").then(f=>f.rF);return{usePageStore:v}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url);w||(await g.getState().restoreVault(),await g.getState().initVaultSide())}).catch(g=>console.error("[auth] Cannot restore vault after account change:",g)).finally(()=>{m===u&&p()})});return()=>{w=!0,++u,b(),h?.(),p()}}Li();window.addEventListener("error",n=>{console.error("[tangu] window error:",n.error||n.message)});window.addEventListener("unhandledrejection",n=>{console.error("[tangu] unhandledrejection:",n.reason)});const Ti=(()=>{try{return location.hash==="#preview"}catch{return!1}})(),Ge=Je();try{document.documentElement.dataset.window=Ge}catch{}try{document.documentElement.lang=fs()==="zh"?"zh-CN":"en"}catch{}try{window.tangu?.platform==="darwin"&&(document.documentElement.dataset.platform="mac")}catch{}let Jn,Qn=null;try{Jn=localStorage.getItem("forsion_theme_seed")||void 0}catch{}try{Qn=localStorage.getItem("forsion_theme_lang")}catch{}try{Va(qa(),Ha(),Ya(),Ua(),{customColor:Jn}),Ka(),document.documentElement.style.removeProperty("background"),nt.getState().initThemes(Qn),E.getState().setTr(En),Rs(),Ei(),Ci(),Ni(),Xa(),As(),Ga()}catch(n){console.error("[tangu] init failed, continue to mount:",n),Za("init",n)}gs.createRoot(document.getElementById("root")).render(t.jsx(hs,{children:t.jsx(So,{children:Ti?t.jsx(di,{}):Ge==="mini"?t.jsx(ki,{}):Ge==="floating"?t.jsx(ji,{}):Ge==="detached"?t.jsx(pi,{}):t.jsx(oi,{})})}));
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{Q as z,U as A,W as O,X as H,j as y,K as W,u as V,d as w,r as F}from"./index-BM2o7PeV.js";import{mt as B,mu as I,mv as _,g4 as T}from"./appStore-DWP8UET9.js";import{P as N}from"./MarkdownBlock-CkqiwPXa.js";import"./nativeDownload-BYT082bY.js";import"./ipc-CxAyeo8q.js";import"./client-0MPbodA6.js";import"./index-CuiYK18N.js";import"./linkFollow-B7ivDZMM.js";import"./mdMarks-DbIcRa0O.js";import"./emoji-6zl4yfOS.js";import"./listFold-DLuxXiIj.js";import"./book-open-OLNm7OaB.js";const G=z().use(A).use(O,{singleTilde:!1}).use(H,["yaml"]).use(B).use(I,{singleTilde:!1}),c=t=>String(t??"").replace(/[&<>"']/g,m=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[m]);function P(t,m=!1){if(!t||/[\u0000-\u0020\u007f\\]/.test(t)||t.startsWith("//"))return null;if(t.startsWith("/")||t.startsWith("#"))return t;try{const o=new URL(t);if(o.protocol==="https:"||o.protocol==="http:"||!m&&o.protocol==="mailto:")return o.href}catch{}return!t.includes(":")&&!t.startsWith(".")?t:null}function j(t){return t.value??(t.children??[]).map(j).join("")}function M(t){return t.type!=="paragraph"?null:/^!\[\[([^\]\n]+)\]\]$/.exec(j(t).trim())?.[1]?.replace(/\|\d+$/,"")??null}function K(t){return t.type==="paragraph"&&t.children?.length===1&&t.children[0].type==="image"?t.children[0]:null}function Q(t,m={}){const o=G.parse(t),d=m.locale==="zh",u=(e,l=!1)=>{const r=P(e,l);if(!r||!m.baseUrl||r.startsWith("#"))return r;try{return P(new URL(r,m.baseUrl).href,l)}catch{return r}};let g=!0;const v=()=>{const e=!!m.priorityFirstImage&&g;return g=!1,e?'loading="eager" fetchpriority="high"':'loading="lazy"'},i=new Map((o.children??[]).filter(e=>e.type==="definition").map(e=>[e.identifier,e]));let f=0;const p=e=>(e.children??[]).map(s).join(""),$=(e,l)=>{const r=_(e),a=u(r?.provider==="Bilibili"&&/^BV[\w]{10}$/i.test(e.trim())?"https://www.bilibili.com/video/"+e.trim():e,!0);if(!a)return null;let h=a;try{h=new URL(a,"https://forsion.example").pathname}catch{}const b=/\.(mp4|webm|mov|m4v|ogv)$/i.test(h),C=/\.(mp3|m4a|ogg|wav|flac)$/i.test(h);if(!r&&!b&&!C)return null;const S=l?.alt||r?.provider||(d?C?"音频":"视频演示":C?"Audio":"Video demo"),q=l?.url?u(l.url,!0):null,x=/^(\d{1,4})[:/](\d{1,4})$/.exec(l?.title||""),R=x&&+x[1]>0&&+x[2]>0?` style="aspect-ratio:${+x[1]}/${+x[2]}"`:"",U=q?`<img src="${c(q)}" alt="${c(S)}" ${v()} decoding="async">`:`<div class="md-media-placeholder"><span>${c(S)}</span></div>`;return`<figure class="md-media" data-amadeus-media="${r?"platform":C?"audio":"video"}" data-src="${c(r?.src||a)}"><div class="md-media-stage${q?" has-poster":""}"${R}>${U}</div><figcaption><span>${c(S)}</span><button type="button" class="play-button">${d?"播放":"Play"}${r?` · ${r.provider}`:""}</button><a href="${c(a)}" target="_blank" rel="noopener noreferrer">${d?"打开原视频":"Open original"} ↗</a></figcaption><p class="md-media-error" role="status" hidden>${d?"暂时无法播放,请打开原视频。":"Playback is unavailable. Open the original video."}</p></figure>`};function s(e){const l=()=>p(e);switch(e.type){case"text":return c(e.value);case"strong":return`<strong>${l()}</strong>`;case"emphasis":return`<em>${l()}</em>`;case"delete":return`<del>${l()}</del>`;case"inlineCode":return`<code>${c(e.value)}</code>`;case"break":return"<br>";case"heading":{const r=Math.min(6,(e.depth??2)+(m.headingOffset??0));return`<h${r} id="${c(m.idPrefix||"md")}-${++f}">${l()}</h${r}>`}case"paragraph":{const r=M(e);if(r){const a=u(r,!0);if(a&&/\.(?:png|jpe?g|gif|webp|avif|svg)(?:[?#]|$)/i.test(a))return`<figure class="md-image"><img src="${c(a)}" alt="${c(r)}" ${v()} decoding="async"></figure>`;const h=$(r);if(h)return h;const b=u(r);return b?`<p class="md-bookmark"><a href="${c(b)}" target="_blank" rel="noopener noreferrer">${c(r)} ↗</a></p>`:`<p>${c(j(e))}</p>`}return`<p>${l()}</p>`}case"link":case"linkReference":{const r=e.url??i.get(e.identifier)?.url??"",a=u(r);return a?`<a href="${c(a)}"${/^https?:/.test(a)?' target="_blank" rel="noopener noreferrer"':""}>${l()}</a>`:l()}case"image":case"imageReference":{const r=i.get(e.identifier),a=u(e.url??r?.url??"",!0);return a?`<img src="${c(a)}" alt="${c(e.alt||"")}" ${v()} decoding="async">`:c(e.alt||"")}case"list":return`<${e.ordered?"ol":"ul"}${e.ordered&&e.start?` start="${e.start}"`:""}>${l()}</${e.ordered?"ol":"ul"}>`;case"listItem":return`<li>${e.checked!=null?`<input type="checkbox" disabled aria-label="${d?"清单项":"Checklist item"}"${e.checked?" checked":""}>`:""}${l()}</li>`;case"blockquote":{const r=e.children?.[0],a=r?.type==="paragraph"?/^\[!([\w-]+)\]([+-])?\s*(.*)/.exec(j(r)):null;if(!a)return`<blockquote>${l()}</blockquote>`;const h=(e.children??[]).slice(1).map(s).join(""),b=c(a[3]||a[1]);return a[2]?`<details class="md-callout md-fold"${a[2]==="+"?" open":""}><summary>${b}</summary><div>${h}</div></details>`:`<aside class="md-callout"><p class="md-callout-title">${b}</p>${h}</aside>`}case"table":return`<div class="md-table-wrap"><table>${(e.children??[]).map((r,a)=>`<${a?"tbody":"thead"}><tr>${(r.children??[]).map(h=>`<${a?"td":"th"}>${p(h)}</${a?"td":"th"}>`).join("")}</tr></${a?"tbody":"thead"}>`).join("")}</table></div>`;case"code":return`<pre><code${e.lang?` class="language-${c(e.lang.replace(/[^\w-]/g,""))}"`:""}>${c(e.value)}</code></pre>`;case"thematicBreak":return"<hr>";case"html":case"yaml":case"definition":return"";default:return e.children?l():c(e.value)}}const n=(o.children??[]).filter(e=>!["yaml","html","definition"].includes(e.type));let L="";n[0]?.type==="heading"&&n[0].depth===1&&(L=j(n.shift()));let k="",E=!1;for(let e=0;e<n.length;e++){const l=n[e];l.type==="heading"&&l.depth===2&&(E&&(k+="</section>"),k+='<section class="md-feature">',E=!0);const r=K(l),a=n[e+1]&&M(n[e+1]),h=r&&a?$(a,r):null;if(h){k+=h,e++;continue}k+=s(l)}return E&&(k+="</section>"),{title:L,html:k}}function X(t,m="en"){const o=m==="zh",d=Array.from(t.querySelectorAll("[data-amadeus-media]")),u=new AbortController,g=i=>{d.forEach(f=>{f!==i&&f.querySelector("video,audio")?.pause()})};for(const i of d){const f=i.querySelector("button"),p=i.querySelector(".md-media-stage");f.addEventListener("click",()=>{const $=i.querySelector(".md-media-error");if($.hidden=!0,i.dataset.amadeusMedia==="platform"){if(p.querySelector("iframe")){p.querySelector("iframe").remove(),p.classList.remove("playing"),f.textContent=o?"播放":"Play";return}g(i);const n=document.createElement("iframe");n.src=i.dataset.src,n.title=i.querySelector("figcaption span")?.textContent||"Video",n.allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen",n.allowFullscreen=!0,n.referrerPolicy="strict-origin-when-cross-origin",p.appendChild(n),p.classList.add("playing"),f.textContent=o?"关闭播放器":"Close player";return}let s=p.querySelector("video,audio");if(s||(s=document.createElement(i.dataset.amadeusMedia==="audio"?"audio":"video"),s.setAttribute("controls",""),s.setAttribute("playsinline",""),s.preload="none",s.src=i.dataset.src,p.appendChild(s),s.addEventListener("playing",()=>{p.classList.add("playing"),f.textContent=o?"暂停":"Pause"},{signal:u.signal}),s.addEventListener("pause",()=>{f.textContent=s.ended?o?"重播":"Replay":o?"继续播放":"Resume"},{signal:u.signal}),s.addEventListener("loadedmetadata",()=>{s instanceof HTMLVideoElement&&s.videoHeight&&(p.style.aspectRatio=`${s.videoWidth}/${s.videoHeight}`)},{signal:u.signal})),!s.paused){s.pause();return}g(i),s.play().catch(()=>{$.hidden=!1,p.classList.remove("playing")})},{signal:u.signal})}const v=()=>{d.forEach(i=>i.querySelector("video,audio")?.pause())};return document.addEventListener("visibilitychange",()=>{document.hidden&&v()},{signal:u.signal}),()=>{u.abort(),v(),d.forEach(i=>i.querySelector("iframe")?.remove())}}F({"publishing.visual":{zh:"Amadeus 编辑",en:"Amadeus editor"},"publishing.source":{zh:"Markdown 源码",en:"Markdown source"},"publishing.preview":{zh:"预览",en:"Preview"}});function D({options:t,revision:m,alive:o}){const{t:d,locale:u}=V(),[g,v]=w.useState(t.value),[i,f]=w.useState("visual"),p=w.useRef(null);w.useEffect(()=>{v(t.value)},[t.value,m]);const $=n=>{o()&&(t.value=n,v(n),t.onChange?.(n))};w.useEffect(()=>p.current?X(p.current,u):void 0,[i,g,u,t.previewBaseUrl]);const s=i==="preview"?Q(g,{locale:u,baseUrl:t.previewBaseUrl}):null;return y.jsxs("div",{className:"am-app amx-publishing-editor","aria-label":t.label,children:[y.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,padding:"8px 0"},children:["visual","source","preview"].map(n=>y.jsx("button",{className:"btn",type:"button","aria-pressed":i===n,onClick:()=>f(n),children:d(`publishing.${n}`)},n))}),i==="visual"&&y.jsx(N,{initial:g,onChange:$,readOnly:t.readOnly,immediate:!0}),i==="source"&&y.jsx("textarea",{"aria-label":t.label||d("publishing.source"),value:g,readOnly:t.readOnly,onChange:n=>$(n.target.value),style:{width:"100%",minHeight:420,resize:"vertical",padding:12,font:"inherit",fontFamily:"var(--font-mono)",color:"var(--text)",background:"var(--bg)",border:"1px solid var(--border)",borderRadius:"var(--radius-sm)"}}),s&&y.jsx("div",{ref:p,className:"amadeus-published",dangerouslySetInnerHTML:{__html:(s.title?`<h1>${s.title.replace(/[&<>"']/g,n=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[n])}</h1>`:"")+s.html}})]})}function ce(t,m){const o={...m};let d=!0,u=0;const g=()=>y.jsx(W,{children:y.jsx(D,{options:o,revision:u++,alive:()=>d})}),v=T(t,g(),()=>{d=!1}),i=()=>v.render(g());return{getValue(){return o.value},update(f){d&&(Object.assign(o,f),i())},insertMarkdown(f){d&&!o.readOnly&&(o.value+=`
|
|
2
|
+
|
|
3
|
+
`+f,o.onChange?.(o.value),i())},focus(){d&&t.querySelector('[contenteditable="true"],textarea')?.focus()},dispose:v.dispose}}export{ce as mountPluginMarkdownEditor};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./appStore-DWP8UET9.js","./index-BM2o7PeV.js","./nativeDownload-BYT082bY.js","./ipc-CxAyeo8q.js","./client-0MPbodA6.js","./appStore-wtOILggO.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{u as y,d as f,_ as g,t as l,r as w}from"./index-BM2o7PeV.js";import{w as M,a as S}from"./mdMarks-DbIcRa0O.js";import{dl as d,b as m}from"./appStore-DWP8UET9.js";import{c as _,n as N}from"./nativeDownload-BYT082bY.js";w({"mdmark.patchFailed":{zh:"改不动「{name}」—— 笔记里那一行已经变了",en:"Can’t update “{name}” — that line in the note has changed"},"mdmark.openNote":{zh:"打开笔记",en:"Open note"},"mdmark.colName":{zh:"事项",en:"Item"},"mdmark.colDate":{zh:"时间",en:"Time"},"mdmark.colNote":{zh:"来源笔记",en:"Source note"},"mdmark.calName":{zh:"笔记",en:"Notes"}});const u=a=>`${a.path}:${a.line}`,h=new Map;let p=0,k=0;const i=_((a,c)=>({marks:[],ready:!1,overlay:{},async load(){if(!d?.listMarks){a({marks:[],ready:!0});return}const r=++k,n=m.getState().vaultRoot;try{await m.getState().flushSave().catch(()=>{});const t=await d.listMarks();r===k&&m.getState().vaultRoot===n&&a({marks:t,ready:!0})}catch{r===k&&a({marks:[],ready:!0})}},patch(r,n){const t=u(r);a(o=>({overlay:{...o.overlay,[t]:{...o.overlay[t],...n}}}));const e=h.get(t);e&&clearTimeout(e),h.set(t,window.setTimeout(()=>{h.delete(t),x(t,r)},400))}}));async function x(a,c){const r=i.getState(),n=r.overlay[a];if(!n||!d?.patchMark)return;const t=r.marks.find(o=>u(o)===a)??c;let e=t.raw;if(n.checked!==void 0&&(e=M(e,n.checked)??e),n.due!==void 0&&(e=S(e,n.due)??e),e!==t.raw){p++;try{await m.getState().flushSave().catch(()=>{}),await d.patchMark(t.path,t.raw,t.occ,e).catch(()=>!1)||N({event:"system.generic",level:"warning",text:l("mdmark.patchFailed",{name:t.text}),action:{label:l("mdmark.openNote"),run:()=>{g(()=>import("./appStore-DWP8UET9.js").then(s=>s.rH),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url).then(s=>s.openNoteAtHeading(t.path,t.heading))}}})}finally{p--}}await i.getState().load(),!h.has(a)&&p===0&&i.setState(o=>{const s={...o.overlay};return delete s[a],{overlay:s}})}function T(){const a=i(t=>t.marks),c=i(t=>t.overlay),r=m(t=>t.vaultRoot),n=m(t=>t.activePage);return f.useEffect(()=>{const t=setTimeout(()=>{i.getState().load()},250);return()=>clearTimeout(t)},[r,n]),f.useMemo(()=>Object.keys(c).length?a.map(e=>{const o=c[u(e)];return o?{...e,due:o.due??e.due,checked:o.checked??e.checked}:e}):a,[a,c])}function z(a,c){return d?.patchMark?(i.getState().patch(a,c),!0):!1}d?.onStructureChange?.(()=>{i.getState().load()});const C="mdnote://vault-notes",D=()=>[{id:"name",name:l("mdmark.colName"),type:"text"},{id:"date",name:l("mdmark.colDate"),type:"calendarDate"},{id:"note",name:l("mdmark.colNote"),type:"text"}];function E(){const a=T(),{locale:c}=y();return f.useMemo(()=>{const r=a.filter(e=>!e.isTask);if(!r.length)return[];const n=new Map(r.map(e=>[u(e),e])),t=r.map(e=>({rowId:u(e),name:e.text,cells:{name:e.text,date:e.due,note:e.title}}));return[{path:C,name:l("mdmark.calName"),isNoteView:!1,readonly:!0,columns:D(),rows:t,writeCell:d?.patchMark?(e,o,s)=>{const v=n.get(e);!v||o!=="date"||typeof s!="string"||!s||i.getState().patch(v,{due:s})}:void 0,openRow:e=>{const o=n.get(e);o&&g(()=>import("./appStore-DWP8UET9.js").then(s=>s.rH),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url).then(s=>s.openNoteAtHeading(o.path,o.heading))}}]},[a,c])}export{T as a,i as b,z as p,E as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{oY as c}from"./appStore-DWP8UET9.js";const s=String.raw`\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2})?`,d=/[A-Za-z0-9._%+-]/,l=new RegExp(String.raw`(?<!${d.source})@(remind:)?(${s}(?:/${s})?)(?=$|[\s,;.。,、;))\]】!?!?])`,"g");function*h(n){l.lastIndex=0;let e;for(;e=l.exec(n);)e[2].split("/").every(c)&&(yield{index:e.index,whole:e[0],remind:!!e[1],val:e[2]})}function a(n,e){const i=[...h(n)],t=i.find(r=>!r.remind)??i[0];if(!t)return null;const o=`${t.whole.startsWith("@")?"":t.whole[0]}@${t.remind?"remind:":""}${e}`;return n.slice(0,t.index)+o+n.slice(t.index+t.whole.length)}function x(n,e){const i=/^(\s*[-*+]\s+\[)[ xX](\]\s)/.exec(n);return i?n.slice(0,i[1].length)+(e?"x":" ")+n.slice(i[1].length+1):null}export{d as A,a,x as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{F as a}from"./appStore-DWP8UET9.js";const e=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M12 8v6",key:"1ib9pf"}],["path",{d:"M9 11h6",key:"1fldmi"}]],o=a("message-square-plus",e);export{o as M};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t}from"./index-
|
|
1
|
+
import{r as t}from"./index-BM2o7PeV.js";t({"automation.deleted":{zh:"已删除「{name}」",en:"Deleted “{name}”"},"automation.deleteConfirm":{zh:"删除「{name}」?此操作无法撤销。",en:"Delete “{name}”? This can’t be undone."},"automation.undo":{zh:"撤销",en:"Undo"},"automation.ux.actions":{zh:"更多操作",en:"More actions"},"automation.ux.help":{zh:"使用说明",en:"Workflow help"},"automation.ux.properties":{zh:"规则配置",en:"Rule configuration"},"automation.ux.myWorkflows":{zh:"我的自动化",en:"My workflows"},"automation.ux.noRules":{zh:"从入门模板创建第一条自动化。",en:"Create your first workflow from a starter template."},"automation.ux.workspace":{zh:"自动化工作台",en:"Automation studio"},"automation.ux.welcome":{zh:"把重复的事,交给流程",en:"Turn repeat work into a workflow"},"automation.ux.intro":{zh:"从一个触发条件开始,连接 Agent、笔记和多维表,随时查看每一步的结果。",en:"Start with a trigger, connect your agents, notes and databases, and see what each step did."},"automation.ux.guide.trigger":{zh:"选择触发方式",en:"Choose a trigger"},"automation.ux.guide.triggerHint":{zh:"定时、事件、表格变化,或手动点击。",en:"A schedule, an event, a database change, or a click."},"automation.ux.guide.actions":{zh:"连接要做的事",en:"Connect your actions"},"automation.ux.guide.actionsHint":{zh:"在画布添加步骤,选中节点完成配置。",en:"Add steps on the canvas, then select a node to configure it."},"automation.ux.guide.test":{zh:"试运行,再启用",en:"Test, then enable"},"automation.ux.guide.testHint":{zh:"先保存为暂停状态,检查结果后开启。",en:"Save paused, review a test run, then enable it."},"automation.ux.startWith":{zh:"从场景开始",en:"Start with a use case"},"automation.ux.blank":{zh:"自定义流程",en:"Custom workflow"},"automation.ux.draftHint":{zh:"模板只填入草稿。保存前,你可以修改所有配置。",en:"Templates only fill a draft. Review and change anything before saving."},"automation.ux.native":{zh:"和 Forsion 一起工作",en:"Works with Forsion"},"automation.ux.nativeHint":{zh:"笔记按钮负责手动启动,多维表提供触发数据,Agent 处理任务,通知送达收件箱。Muse 和 Historian 的系统自动化也可在左侧单独管理。",en:"Note buttons start manual workflows, databases supply trigger data, agents handle tasks, and notifications arrive in your inbox. Manage Muse and Historian separately in the sidebar."},"automation.ux.reminder.name":{zh:"每日提醒",en:"Daily reminder"},"automation.ux.reminder.hint":{zh:"每天固定时间,把提醒送进收件箱。",en:"Send a reminder to your inbox at a set time each day."},"automation.ux.reminder.flow":{zh:"每天 09:00 → 发通知",en:"Daily at 09:00 → Notify"},"automation.ux.reminder.body":{zh:"今天有哪些值得优先处理的事?",en:"What deserves your attention today?"},"automation.ux.briefing.name":{zh:"Agent 每日简报",en:"Daily agent briefing"},"automation.ux.briefing.hint":{zh:"选一个 Agent,定时整理你关心的信息。",en:"Choose an agent to prepare a scheduled briefing."},"automation.ux.briefing.flow":{zh:"定时 → 跑 Agent",en:"Schedule → Run agent"},"automation.ux.briefing.prompt":{zh:"整理一份今日工作简报,总结当前待办和需要关注的事项。",en:"Prepare a daily briefing of current tasks and items that need attention."},"automation.ux.table.name":{zh:"新增记录提醒",en:"New record notification"},"automation.ux.table.hint":{zh:"多维表新增一行时,通知你及时跟进。",en:"Get notified when a new row is added to a database."},"automation.ux.table.flow":{zh:"新增记录 → 发通知",en:"Row added → Notify"},"automation.ux.table.body":{zh:"多维表新增了记录:{{row.id}}",en:"A new database row was added: {{row.id}}"},"automation.ux.button.name":{zh:"一键交给 Agent",en:"One click to an agent"},"automation.ux.button.hint":{zh:"手动执行常用任务,也能绑定到笔记按钮。",en:"Run a repeat task manually or attach it to a note button."},"automation.ux.button.flow":{zh:"手动点击 → 跑 Agent",en:"Manual click → Run agent"},"automation.ux.button.prompt":{zh:"检查我的待办,整理接下来最值得推进的三件事。",en:"Review my tasks and identify the three most useful next actions."},"automation.ux.overview":{zh:"入门与模板",en:"Guide and templates"},"automation.ux.search":{zh:"搜索自动化",en:"Search automations"},"automation.ux.noMatches":{zh:"没有匹配的自动化",en:"No matching automations"},"automation.ux.enable":{zh:"启用",en:"Enable"},"automation.ux.pause":{zh:"暂停",en:"Pause"},"automation.ux.on":{zh:"已启用",en:"Enabled"},"automation.ux.off":{zh:"已暂停",en:"Paused"},"automation.ux.flow":{zh:"工作流画布",en:"Workflow canvas"},"automation.ux.canvasHint":{zh:"拖动排列 · 点击配置",en:"Drag to arrange · Click to configure"},"automation.ux.canvasOrder":{zh:"按连线顺序执行。拖动只调整布局,步骤顺序在配置中调整。",en:"Steps run in connected order. Dragging changes the layout; use the step controls to reorder execution."},"automation.ux.zoomIn":{zh:"放大画布",en:"Zoom in"},"automation.ux.zoomOut":{zh:"缩小画布",en:"Zoom out"},"automation.ux.fit":{zh:"适应视图",en:"Fit to view"},"automation.ux.arrange":{zh:"自动排列",en:"Auto arrange"},"automation.ux.ready":{zh:"已配置",en:"Configured"},"automation.ux.incomplete":{zh:"待配置",en:"Needs setup"},"automation.ux.finish":{zh:"保存与启用",en:"Save and enable"},"automation.ux.finishHint":{zh:"检查配置与启动方式",en:"Review setup and activation"},"automation.ux.addStep":{zh:"添加步骤",en:"Add a step"},"automation.ux.maxSteps":{zh:"最多添加 24 个步骤",en:"Up to 24 steps"},"automation.ux.setup":{zh:"节点配置",en:"Node configuration"},"automation.ux.setupHint":{zh:"选中画布节点,配置触发条件或动作。",en:"Select a canvas node to configure its trigger or action."},"automation.ux.savePaused":{zh:"保存为暂停",en:"Save paused"},"automation.ux.saveEnabled":{zh:"保存并启用",en:"Save and enable"},"automation.ux.enabledLabel":{zh:"保存后启用",en:"Enable after saving"},"automation.ux.enableHint":{zh:"暂停状态仍可试运行;启用后才响应触发条件。",en:"Paused workflows can still be tested. Enable them to respond to triggers."},"automation.ux.saved":{zh:"自动化已保存",en:"Automation saved"},"automation.ux.checklist":{zh:"还需完成",en:"Complete the setup"},"automation.ux.allReady":{zh:"配置已完成,可以保存",en:"Ready to save"},"automation.ux.review":{zh:"检查并保存",en:"Review and save"},"automation.ux.issue.name":{zh:"填写自动化名称",en:"Enter a workflow name"},"automation.ux.issue.trigger":{zh:"补全触发条件",en:"Complete the trigger settings"},"automation.ux.issue.steps":{zh:"至少添加一个动作",en:"Add at least one action"},"automation.ux.issue.notify":{zh:"填写通知标题",en:"Enter a notification title"},"automation.ux.issue.agent":{zh:"选择执行任务的 Agent",en:"Choose an agent"},"automation.ux.issue.prompt":{zh:"说明 Agent 需要完成的任务",en:"Describe the task for the agent"},"automation.ux.issue.table":{zh:"选择目标多维表",en:"Choose a database"},"automation.ux.issue.cells":{zh:"至少指定一个要写入的字段",en:"Add at least one field to write"},"automation.ux.issue.row":{zh:"指定记录 ID 或按列值匹配目标记录",en:"Set a row ID or match target rows by a column value"},"automation.ux.issue.match":{zh:"填写记录匹配值",en:"Enter a row matching value"},"automation.ux.issue.tool":{zh:"选择一个可用工具",en:"Choose an available tool"},"automation.ux.issue.args":{zh:"补全工具的必填参数",en:"Complete the required tool arguments"},"automation.ux.issue.json":{zh:"填写有效的 JSON 参数",en:"Enter valid JSON arguments"},"automation.ux.issue.cooldown":{zh:"填写有效的冷却时长",en:"Enter a valid cooldown duration"},"automation.ux.variables":{zh:"插入变量",en:"Insert variable"},"automation.ux.insertVariable":{zh:"为「{field}」插入变量",en:"Insert a variable into {field}"},"automation.ux.today":{zh:"今天的日期",en:"Today"},"automation.ux.now":{zh:"当前时间",en:"Current time"},"automation.ux.triggerRow":{zh:"触发记录",en:"Trigger row"},"automation.ux.rowId":{zh:"记录 ID",en:"Row ID"},"automation.ux.runHint":{zh:"试运行会真实执行已保存的动作。",en:"Testing executes the saved actions."},"automation.ux.dbRunHint":{zh:"表格规则试运行不携带触发行数据;行变量与默认触发行目标需要真实表格事件。",en:"Database tests have no triggering row. Row variables and default row targets require a real database event."},"automation.ux.runResults":{zh:"运行结果",en:"Run results"},"automation.ux.runEmpty":{zh:"还没有运行记录。可以先试运行一次,或等待触发条件满足。",en:"No runs yet. Test the workflow or wait for its trigger."},"automation.ux.runLoading":{zh:"正在读取运行记录…",en:"Loading runs…"},"automation.ux.runError":{zh:"无法读取运行记录,请重试。",en:"Could not load runs. Please retry."},"automation.ux.retry":{zh:"重试",en:"Retry"},"automation.ux.done":{zh:"已完成",en:"Completed"},"automation.ux.failed":{zh:"失败",en:"Failed"},"automation.ux.running":{zh:"运行中",en:"Running"},"automation.ux.queued":{zh:"排队中",en:"Queued"},"automation.ux.autoOrigin":{zh:"自动触发",en:"Automatic"},"automation.ux.manualOrigin":{zh:"手动执行",en:"Manual"},"automation.ux.stepResult":{zh:"步骤 {n} · {type}",en:"Step {n} · {type}"},"automation.ux.latestResults":{zh:"每步执行结果",en:"Step results"},"automation.ux.noSteps":{zh:"这次执行没有步骤结果。",en:"No step results were recorded for this run."},"automation.ux.systemHint":{zh:"系统助理",en:"System assistants"},"automation.ux.loadError":{zh:"自动化加载失败,请重试。",en:"Could not load automations. Please retry."}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as o}from"./appStore-DWP8UET9.js";const s=[["path",{d:"M5 12h14",key:"1ays0h"}]],e=o("minus",s);export{e as M};
|