@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
package/package.json
CHANGED
package/release.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"desktopVersion": "2.
|
|
3
|
-
"desktopTag": "v2.
|
|
4
|
-
"desktopCommit": "
|
|
2
|
+
"desktopVersion": "2.13.1",
|
|
3
|
+
"desktopTag": "v2.13.1",
|
|
4
|
+
"desktopCommit": "d34f6593e95c10bcd97928e7518daba544eabefd",
|
|
5
5
|
"unitRevision": 0,
|
|
6
6
|
"prerelease": false,
|
|
7
|
-
"sourceCommit": "
|
|
7
|
+
"sourceCommit": "d34f6593e95c10bcd97928e7518daba544eabefd",
|
|
8
8
|
"sourceDirty": false,
|
|
9
|
-
"builtAt": "2026-10-
|
|
9
|
+
"builtAt": "2026-10-06T16:44:52.470Z",
|
|
10
10
|
"commercialServerIncluded": false
|
|
11
11
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as P,d,j as t}from"./index-BM2o7PeV.js";import{F as D,a5 as T,aB as M,mo as R,eR as V,hj as W,bs as q,aa as y,mp as N,b0 as B,a4 as U,bJ as $,d$ as H,ar as _,mq as J,fL as K,p as O,u as X}from"./appStore-DWP8UET9.js";import"./client-0MPbodA6.js";import{u as G}from"./codeStudioStore-BBU62GTy.js";import{C as Q}from"./CapabilityMenu-SwVlZ06x.js";import{c as Y}from"./nativeDownload-BYT082bY.js";/* empty css */import{C as Z}from"./code-xml-Cuna8Kh4.js";import{P as aa}from"./pencil-cqvCkekG.js";import{A as ta}from"./arrow-up-right-DrCXuWS7.js";import"./ipc-CxAyeo8q.js";const ia=[["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"m15 10-3 3-3-3",key:"lzhmyn"}],["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}]],ea=D("monitor-down",ia);let v=0;const f=Y((i,l)=>({items:[],status:"loading",async load(){const m=window.tangu?.productsList;if(!m){i({status:"error"});return}const r=++v;l().status!=="ready"&&i({status:"loading"});try{const n=await m();r===v&&i({items:n,status:"ready"})}catch{r===v&&l().status!=="ready"&&i({status:"error"})}}})),b=i=>i instanceof Error?i.message:String(i);function wa(){const{t:i,locale:l}=P(),m=f(a=>a.items),r=f(a=>a.status),n=f(a=>a.load),[k]=d.useState(()=>f.getState().status!=="ready"),[S,o]=d.useState(null),w=T(a=>a.spaces.some(e=>e.id==="coding"))&&!!M("code-studio"),[z,g]=d.useState(()=>Date.now());d.useEffect(()=>{n();const a=()=>{g(Date.now()),n()};return window.addEventListener("focus",a),()=>{window.removeEventListener("focus",a)}},[n]),d.useEffect(()=>{const a=setInterval(()=>{document.hidden||g(Date.now())},6e4);return()=>clearInterval(a)},[]);const u=(a,e,s=!1)=>X.getState().toast(i(a,e),s),L=a=>{O.getState().openView("product",{id:a.id},"main",{newTab:!0})},C=a=>{window.tangu?.openDetached?.([{type:"product",params:{id:a.id}}])},p=a=>{y("coding"),requestAnimationFrame(()=>{G.getState().openProject(a.root,a.name)})},E=async a=>{const e=window.tangu?.productsShortcut;if(e){o(a.id);try{const{key:s,error:c,vars:h}=J(await e(a.id,i("artificial.shortcut.fallbackName")));u(s,h,c)}catch(s){u("artificial.toast.shortcutFailed",{detail:b(s)},!0)}finally{o(null)}}},A=async a=>{const e=window.tangu?.productsUpdate;if(!e)return;const s=(await K(i("artificial.rename.title"),a.name,{label:i("artificial.rename.label")}))?.trim();if(!(!s||s===a.name)){o(a.id);try{await e(a.id,{name:s}),await n()}catch(c){u("artificial.toast.renameFailed",{detail:b(c)},!0)}finally{o(null)}}},F=async a=>{const e=window.tangu?.productsTrash;if(!(!e||!window.confirm(i(a.external?"artificial.remove.confirm":"artificial.trash.confirm",{name:a.name})))){o(a.id);try{await e(a.id,{action:a.external?"unregister":"trash",dirId:a.dirId}),await n()}catch(s){u("artificial.toast.trashFailed",{detail:b(s)},!0)}finally{o(null)}}},I=a=>{const e=N(a.kind),s=e.icon,c=S===a.id,h=[...e.canLaunch&&window.tangu?.openDetached?[{id:"open-window",label:i("artificial.action.openWindow"),icon:t.jsx(B,{size:14}),onSelect:()=>C(a)}]:[],...w?[{id:"edit",label:i("artificial.action.edit"),icon:t.jsx(Z,{size:14}),onSelect:()=>p(a)}]:[],...e.canShortcut&&window.tangu?.productsShortcut?[{id:"shortcut",label:i("artificial.action.shortcut"),icon:t.jsx(ea,{size:14}),onSelect:()=>{E(a)}}]:[],...window.tangu?.revealHostPath?[{id:"reveal",label:i("artificial.action.reveal"),icon:t.jsx(U,{size:14}),onSelect:()=>{window.tangu?.revealHostPath?.(a.root)}}]:[],...window.tangu?.productsUpdate?[{id:"rename",label:i("artificial.action.rename"),icon:t.jsx(aa,{size:14}),onSelect:()=>{A(a)}}]:[],...window.tangu?.productsTrash?[{id:"trash",label:i(a.external?"artificial.action.remove":"artificial.action.trash"),icon:t.jsx($,{size:14}),danger:!0,onSelect:()=>{F(a)}}]:[]],j=c||!e.canLaunch&&!w;return t.jsxs("div",{className:"newtab-card art-card","data-artificial-card":!0,"data-product-id":a.id,"data-kind":a.kind,children:[t.jsxs("button",{className:"art-card-main","data-action":"open",disabled:j,"aria-label":e.canLaunch?i("artificial.action.open",{name:a.name}):`${i("artificial.action.edit")} · ${a.name}`,onClick:()=>e.canLaunch?L(a):p(a),children:[t.jsx("span",{className:"newtab-card-ic",children:t.jsx(s,{size:18})}),t.jsx("span",{className:"art-card-name",title:a.name,children:a.name}),!j&&t.jsx(ta,{size:14,className:"art-card-go","aria-hidden":!0})]}),t.jsxs("div",{className:"art-card-foot",children:[t.jsxs("div",{className:"art-card-meta",children:[t.jsx("span",{children:H(a.updatedAt,{now:z,locale:l})}),a.published&&t.jsx("span",{className:"art-badge","data-badge":"published",children:i("artificial.badge.published")}),a.kind==="plugin"&&a.devLoad&&t.jsx("span",{className:"art-badge","data-badge":"devload",children:i("artificial.badge.devLoad")})]}),h.length>0&&t.jsx(Q,{label:i("artificial.action.more",{name:a.name}),className:"icon-btn art-card-more",disabled:c,items:h,children:t.jsx(_,{size:14})})]})]},a.id)},x=R(m);return t.jsx("div",{className:"art-root","data-artificial-root":!0,children:t.jsxs("div",{className:"art-inner",children:[t.jsxs("div",{className:"art-head",children:[t.jsx(V,{size:18}),t.jsxs("div",{className:"art-titles",children:[t.jsx("div",{className:"art-title",children:i("view.artificial")}),t.jsx("div",{className:"art-sub",children:i("artificial.subtitle")})]}),t.jsx("button",{className:"icon-btn","data-action":"refresh",title:i("artificial.refresh"),"aria-label":i("artificial.refresh"),onClick:()=>{n()},children:t.jsx(W,{size:14})})]}),r==="loading"&&t.jsxs("div",{className:"art-loading","data-state":"loading",children:[t.jsx(q,{variant:"list"}),t.jsx("span",{className:"art-sr-only",role:"status",children:i("artificial.loading")})]}),r==="error"&&t.jsxs("div",{className:"art-state",role:"alert","data-state":"error",children:[t.jsx("div",{className:"art-state-title",children:i("artificial.loadFailed")}),t.jsx("button",{className:"btn sm","data-action":"retry",onClick:()=>{n()},children:i("common.retry")})]}),r==="ready"&&!x.length&&t.jsxs("div",{className:"art-state","data-state":"empty",children:[t.jsx("div",{className:"art-state-title",children:i("artificial.empty.title")}),t.jsx("p",{children:i("artificial.empty.body")}),w&&t.jsx("button",{className:"btn primary sm","data-action":"go-coding",onClick:()=>y("coding"),children:i("artificial.empty.cta")})]}),r==="ready"&&x.length>0&&t.jsx("div",{className:k?"sk-fade-in":void 0,children:x.map(a=>t.jsxs("div",{className:"newtab-sec","data-kind-group":a.kind,children:[t.jsx("div",{className:"newtab-sec-title",children:i(N(a.kind).labelKey)}),t.jsx("div",{className:"newtab-grid art-grid",children:a.items.map(I)})]},a.kind))})]})})}export{wa as ArtificialView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as o,j as e,u as pe}from"./index-CF4RV4mh.js";import{z as Ge,bp as Qe,pT as le,e$ as Je,jy as et,aI as tt,aH as at,fc as nt,f8 as it,gX as lt,gS as st,g7 as ot,g_ as rt,pU as dt,g as ut,da as ct,eO as ie,b8 as mt,pV as ht,pW as Pe,pX as Ie,pY as Fe,Z as Re,S as De,gU as be,af as bt,aD as xt,pZ as pt,aQ as xe,p_ as vt,p$ as gt,bQ as jt,bR as ft,B as yt,D as Nt,W as _t,g1 as Ct,q0 as kt,q1 as wt,k as St,q2 as Et,q3 as $t,u as Pt}from"./appStore-Dg9WALEA.js";import{C as Ft}from"./CapabilityMenu-BQBsM638.js";import{u as Rt}from"./gestures-CkW1Kfs9.js";import{a as Dt,C as zt}from"./Chrome-CwFiDmre.js";import{d as Tt,e as At,f as It,g as Mt}from"./canvasPrefs-BeG4oEgP.js";import{R as qt}from"./rotate-ccw-CUlnplr0.js";import"./messages-BH5MfQdZ.js";import{W as ze}from"./workflow-DuoVRSSX.js";import{C as Ht}from"./circle-question-mark-WL3vbp-Z.js";const Wt=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Vt=Ge("bell",Wt);function Lt({controller:i,open:c,title:b,onClose:C,children:h}){const[g]=o.useState(()=>document.createElement("div"));g.className="auto-extension";const a=o.useRef(null),k=o.useRef(C);k.current=C;const v=o.useRef(b);return v.current=b,o.useEffect(()=>{if(!(!i||!c)){try{a.current=i.open({id:"automation-context",title:()=>v.current,mount:f=>(f.appendChild(g),()=>g.remove()),onClose:()=>k.current()})}catch{k.current()}return()=>{a.current?.close(),a.current=null}}},[i,c,g]),c?i?Qe.createPortal(h,g):e.jsx("div",{className:"auto-extension auto-extension-inline",children:h}):null}const sa=["reminder","briefing","table","button"];function Ot(i,c){return i?i==="briefing"||i==="button"?[{...le("agent_run"),prompt:c(`automation.ux.${i}.prompt`)}]:[{...le("notify"),title:c(`automation.ux.${i}.name`),body:c(`automation.ux.${i}.body`)}]:[le("notify")]}function Te(i,c,b){if(i.type==="notify")return i.title.trim()?null:"notify";if(i.type==="agent_run")return i.agentSlug?i.prompt.trim()?null:"prompt":"agent";if(i.type==="db_row_add"||i.type==="db_row_edit"){if(!/\.db$/i.test(i.dbPath.trim()))return"table";if(!i.cells.some(h=>h.k.trim()))return"cells";if(i.type==="db_row_edit"){if(c!=="db_changed"&&(!i.rowId.trim()&&!i.matchColumn.trim()||i.rowFrom.trim()))return"row";if(i.matchColumn.trim()&&!i.matchValue.trim())return"match"}return null}const C=b.find(h=>h.name===i.tool);if(!C)return"tool";if((C.parameters.required||[]).some(h=>!(i.argValues[h]||"").trim()))return"args";for(const[h,g]of Object.entries(i.argValues)){if(!g.trim())continue;const a=C.parameters.properties?.[h];if(a?.type==="number"&&!Number.isFinite(Number(g)))return"args";if(a?.type==="object"||a?.type==="array")try{const k=JSON.parse(g);if(a.type==="array"?!Array.isArray(k):!k||typeof k!="object"||Array.isArray(k))return"json"}catch{return"json"}}return null}function Bt(i){return(i||[]).map(c=>({value:`{{row.${c.id}}}`,label:c.name}))}const Ut=i=>({x:0,y:i*132,w:244,h:84}),Kt=({nodes:i,selected:c,onSelect:b,children:C})=>{const{t:h}=pe(),g=o.useId().replace(/:/g,""),a=o.useRef(null),[k,v]=o.useState({}),[f,P]=o.useState(Tt),[I,F]=o.useState(At),x=Je(a),m=new Map(i.map((n,s)=>[n.id,k[n.id]||Ut(s)])),$=i.map(n=>n.id).join(","),p=Rt(a,x,{boxes:()=>m,identity:()=>$,commit:n=>v(s=>({...s,...Object.fromEntries(n)})),hitKey:n=>n.closest("[data-flow-node]")?.dataset.flowNode||null,onEnterEdit:b,onDoubleClick:n=>{n&&b(n)},minW:244,minH:84,repel:!0},f);o.useEffect(()=>p.bind(a.current),[p.bind]),o.useEffect(()=>x.bindWheel(a.current),[x.bindWheel]);const D=o.useRef(()=>x.fitTo([...m.values()],64));D.current=()=>x.fitTo([...m.values()],64),o.useEffect(()=>{v({});const n=requestAnimationFrame(()=>D.current());return()=>cancelAnimationFrame(n)},[$]),o.useEffect(()=>{const n=new ResizeObserver(()=>D.current());return a.current&&n.observe(a.current),()=>n.disconnect()},[]);const M=n=>p.live?.get(n)||m.get(n);return e.jsx("div",{className:"auto-canvas-shell am-app",children:e.jsxs("div",{className:"auto-canvas amx-stage",ref:a,tabIndex:0,"aria-label":h("automation.ux.flow"),onPointerUpCapture:n=>{if(p.busy)return;const s=document.elementFromPoint(n.clientX,n.clientY)?.closest("[data-flow-node]");s&&a.current?.contains(s)&&b(s.dataset.flowNode)},children:[e.jsx("div",{className:"amx-stage-grid",style:et(x.vp)}),e.jsxs("div",{className:"auto-canvas-world",style:{transform:`translate(${x.vp.x}px, ${x.vp.y}px) scale(${x.vp.z})`},children:[e.jsxs("svg",{className:"auto-canvas-edges","aria-hidden":"true",children:[e.jsx("defs",{children:e.jsx("marker",{id:g,markerWidth:"8",markerHeight:"8",refX:"6",refY:"3",orient:"auto",children:e.jsx("path",{d:"M0,0 L6,3 L0,6",fill:"none",stroke:"currentColor"})})}),i.slice(1).map((n,s)=>{const y=M(i[s].id),w=M(n.id),q=y.x+y.w/2,H=y.y+y.h,Z=w.x+w.w/2,V=w.y;return e.jsx("path",{d:`M${q},${H} C${q},${H+28} ${Z},${V-28} ${Z},${V}`,markerEnd:`url(#${g})`},n.id)})]}),i.map(n=>{const s=M(n.id);return e.jsxs("div",{"data-flow-node":n.id,role:"button",tabIndex:0,"aria-pressed":c===n.id,className:`auto-flow-node ${c===n.id?"selected":""}`,style:{left:s.x,top:s.y,width:s.w,height:s.h},onClick:()=>b(n.id),onKeyDown:y=>{y.key==="Enter"&&(y.preventDefault(),b(n.id))},children:[e.jsx("span",{className:"auto-flow-icon",children:n.icon}),e.jsx("strong",{children:n.title}),e.jsx("span",{className:"auto-flow-status",title:h(n.ready?"automation.ux.ready":"automation.ux.incomplete"),children:n.ready?e.jsx(tt,{size:13}):e.jsx(at,{size:13})}),e.jsx("span",{className:"auto-flow-subtitle",children:n.subtitle})]},n.id)}),p.marquee&&e.jsx("div",{className:"amx-stage-marquee",style:{left:p.marquee.x,top:p.marquee.y,width:p.marquee.w,height:p.marquee.h}})]}),C&&e.jsx("div",{className:"amx-stage-tools auto-canvas-tools",children:C}),e.jsx(Dt,{zoom:x.vp.z,onZoomBy:n=>{const{w:s,h:y}=nt(a.current);x.setVp(it(x.vp,x.vp.z*n,s/2,y/2))},onFit:()=>D.current(),snap:f,onSnap:n=>{P(n),Mt(n)},mini:I,onMini:n=>{F(n),It(n)},extra:e.jsx("button",{type:"button",title:h("automation.ux.arrange"),onClick:()=>{v({}),requestAnimationFrame(()=>D.current())},children:e.jsx(qt,{size:12})})}),I&&e.jsx(zt,{hostRef:a,vp:x.vp,items:i.map(n=>({key:n.id,kind:"card",box:M(n.id)})),onCenter:x.centerOn})]})})},Ae=({label:i,value:c,onChange:b,multiline:C,maxLength:h=4e3,placeholder:g,columns:a,hasRow:k})=>{const{t:v}=pe(),f=o.useId(),P=o.useRef(null),I=o.useRef({start:c.length,end:c.length}),F=m=>{if(!m)return;const{start:$,end:p}=I.current;c.length-(p-$)+m.length>h||(b(c.slice(0,$)+m+c.slice(p)),requestAnimationFrame(()=>{P.current?.focus(),P.current?.setSelectionRange($+m.length,$+m.length)}))},x={id:f,ref:P,value:c,maxLength:h,placeholder:g,onChange:m=>b(m.target.value),onSelect:m=>{I.current={start:m.currentTarget.selectionStart??c.length,end:m.currentTarget.selectionEnd??c.length}}};return e.jsxs("div",{className:"field auto-template-field",children:[e.jsxs("div",{className:"auto-field-heading",children:[e.jsx("label",{htmlFor:f,children:i}),e.jsxs("select",{"aria-label":v("automation.ux.insertVariable",{field:i}),value:"",onChange:m=>F(m.target.value),children:[e.jsx("option",{value:"",children:v("automation.ux.variables")}),e.jsx("option",{value:"{{today}}",children:v("automation.ux.today")}),e.jsx("option",{value:"{{now}}",children:v("automation.ux.now")}),k&&e.jsxs("optgroup",{label:v("automation.ux.triggerRow"),children:[e.jsx("option",{value:"{{row.id}}",children:v("automation.ux.rowId")}),Bt(a).map(m=>e.jsx("option",{value:m.value,children:m.label},m.value))]})]})]}),C?e.jsx("textarea",{...x}):e.jsx("input",{type:"text",...x})]})};function Xt(){const i=new Date(Date.now()+36e5);i.setMinutes(0,0,0);const c=b=>String(b).padStart(2,"0");return`${i.getFullYear()}-${c(i.getMonth()+1)}-${c(i.getDate())}T${c(i.getHours())}:00`}const Yt=({editing:i,starter:c,fixedManual:b,onSaved:C,onCancel:h,extendView:g})=>{const{t:a}=pe(),k=lt(),v=st(),f=v.actionsCatalog,[P,I]=o.useState(i?.desc||(c?a(`automation.ux.${c}.name`):"")),[F,x]=o.useState("trigger"),[m,$]=o.useState(!1),p=t=>{x(t),$(!0)},[D,M]=o.useState(i?.enabled??!!b),n=i?.cond,[s,y]=o.useState(n?n.type==="event_seen"?"event_seen":n.type==="file_chars_gte"?"file_chars_gte":n.type==="manual"?"manual":n.type==="db_changed"?"db_changed":"timer":b||c==="button"?"manual":c==="table"?"db_changed":"timer"),[w,q]=o.useState(n?.type==="at"?"at":n?.type==="every"?"every":"daily_at"),[H,Z]=o.useState(n?.type==="daily_at"?n.time:"09:00"),V=!!i&&ot(i),[G,Me]=o.useState(n?.type==="at"&&!V?n.datetime.replace(" ","T"):Xt()),Q=n?.type==="every"?/^(\d+)([mhd])$/.exec(n.interval):null,[J,qe]=o.useState(Q?Q[1]:"1"),[ve,He]=o.useState(Q?Q[2]:"h"),[se,We]=o.useState(n?.type==="event_seen"?n.match:""),[oe,Ve]=o.useState(n?.type==="file_chars_gte"?n.path:""),[re,Le]=o.useState(n?.type==="file_chars_gte"?String(n.n):"100"),[R,Oe]=o.useState(n?.type==="db_changed"?n.path:""),[T,ge]=o.useState(n?.type==="db_changed"?n.event:"row_added"),[W,je]=o.useState(()=>rt(n)),fe=(t,u)=>je(r=>u?r.includes(t)?r:[...r,t]:r.filter(l=>l!==t)),[de,Be]=o.useState(n?.type==="db_changed"&&n.equals||""),[L,ue]=o.useState(()=>dt(n)),ce=(t,u)=>ue(r=>r.map((l,d)=>d===t?{...l,...u}:l));o.useEffect(()=>{ut()},[]);const ye=ct(t=>t.files),O=o.useMemo(()=>ye.filter(t=>/\.db$/i.test(t)),[ye]);o.useEffect(()=>{for(const t of O)ie.getState().load(t,t)},[O]);const Ne=ie(mt(t=>O.filter(u=>t.entries[u]?.data?.source!==void 0))),ee=o.useMemo(()=>O.filter(t=>!Ne.includes(t)),[O,Ne]),B=ie(t=>s==="db_changed"&&R?t.entries[R]?.data?.columns:void 0),U=o.useMemo(()=>B?.filter(t=>t.type!=="formula"&&t.type!=="lookup"),[B]),[S,te]=o.useState(()=>i?ht(i):Ot(c,a)),[me,Ue]=o.useState(i&&!i.actions?.length&&!i.agentSlug&&i.prompt||""),[K,_e]=o.useState(()=>Pe(i,s)),Ce=o.useRef(!1);o.useEffect(()=>{!i&&!Ce.current&&_e(Pe(null,s))},[s,i]);const[X,ke]=o.useState(!1),[we,ae]=o.useState(""),Ke=t=>{if(S.length>=24)return;const u=le(t);te(r=>[...r,u]),p(String(u.key))},Se=S.some(t=>t.type==="agent_run"),j=(t,u)=>te(r=>r.map(l=>l.key===t?{...l,...u}:l)),Ee=(t,u)=>te(r=>{const l=t+u;if(l<0||l>=r.length)return r;const d=[...r];return[d[t],d[l]]=[d[l],d[t]],d});if(Ie(i))return e.jsxs("div",{className:"auto-builder",children:[e.jsxs("div",{className:"auto-builder-title",children:[e.jsx(ze,{size:17})," ",a("automation.builder.editTitle")]}),e.jsx("div",{className:"auto-node",children:e.jsx("div",{className:"auto-hint",children:a("automation.builder.unsupported")})}),e.jsx("div",{className:"auto-builder-actions",children:e.jsx("button",{className:"btn ghost",onClick:()=>h?h():v.closeBuilder(),children:a("common.cancel")})})]});const $e=!(s==="timer"&&(w==="daily_at"&&!/^\d{1,2}:\d{2}$/.test(H)||w==="at"&&!G||w==="every"&&(!Number.isInteger(Number(J))||Number(J)<1))||s==="event_seen"&&!se.trim()||s==="file_chars_gte"&&(!oe.trim()||!(Number(re)>0))||s==="db_changed"&&(!/\.db$/i.test(R.trim())||T==="cell_changed"&&!W.length||L.length>Fe||L.some(t=>t.column.trim()&&(t.op==="eq"||t.op==="ne")&&!t.value.trim()))),E=[];P.trim()||E.push({node:"trigger",text:a("automation.ux.issue.name")}),$e||E.push({node:"trigger",text:a("automation.ux.issue.trigger")}),!S.length&&(!i||s==="manual")&&E.push({node:"review",text:a("automation.ux.issue.steps")}),S.forEach((t,u)=>{const r=Te(t,s,f);r&&E.push({node:String(t.key),text:`${u+1}. ${a(`automation.ux.issue.${r}`)}`})}),s!=="timer"&&s!=="manual"&&(!K.trim()||!Number.isFinite(Number(K))||Number(K)<0)&&E.push({node:"review",text:a("automation.ux.issue.cooldown")});const ne=E.length===0,Xe=async()=>{if(!ne||X)return;const t=s==="timer"?w:s;if(t==="at"&&(Ct(G)?.getTime()??0)<Date.now()-5*6e4){ae(a("automation.builder.atPast"));return}const u=d=>ie.getState().entries[d]?.data?.source!==void 0;if([...t==="db_changed"?[R.trim()]:[],...S.filter(d=>d.type==="db_row_add"||d.type==="db_row_edit").map(d=>d.dbPath.trim())].filter(Boolean).some(u)){ae(a("automation.builder.dbNoteView"));return}ke(!0),ae("");const l=kt(S,f);try{const d=await wt(St(),{id:i?.id,actor:"user",desc:P.trim(),cond_type:t,time:t==="daily_at"?H:void 0,datetime:t==="at"?G:void 0,interval:t==="every"?`${Math.floor(Number(J))}${ve}`:void 0,match:t==="event_seen"?se.trim():void 0,path:t==="file_chars_gte"?oe.trim():t==="db_changed"?R.trim():void 0,n:t==="file_chars_gte"?Number(re):void 0,event:t==="db_changed"?T:void 0,column_id:t==="db_changed"&&T==="cell_changed"?W[0]:void 0,column_ids:t==="db_changed"&&T==="cell_changed"&&W.length>1?W:void 0,equals:t==="db_changed"&&T==="cell_changed"&&de.trim()?de.trim():void 0,where:t==="db_changed"?$t(L):void 0,vault:t==="db_changed"&&i?.cond.type==="db_changed"?i.cond.vault:void 0,prompt:S.length?void 0:me.trim()||void 0,cooldown_hours:Et(s,K),actions:S.length?l:null,enabled:D});if(C){v.bump(),C(d);return}v.acceptSaved(d),Pt.getState().toast(a("automation.ux.saved"))}catch(d){ae(String(d?.message||d))}finally{ke(!1)}},he=t=>t==="notify"?e.jsx(Vt,{size:14}):t==="agent_run"?e.jsx(yt,{size:14}):t==="db_row_add"||t==="db_row_edit"?e.jsx(Nt,{size:14}):e.jsx(_t,{size:14}),Ye=[{id:"trigger",title:a("automation.builder.trigger"),subtitle:a(`automation.builder.${s==="timer"?"condTimer":s==="manual"?"condManual":s==="db_changed"?"condDb":s==="event_seen"?"condEvent":"condFile"}`),icon:e.jsx(Re,{size:17}),ready:$e&&!!P.trim()},...S.map((t,u)=>({id:String(t.key),title:`${u+1}. ${a(`automation.step.${t.type}`)}`,subtitle:t.title||t.prompt||t.dbPath||t.tool||a("automation.ux.setupHint"),icon:he(t.type),ready:!Te(t,s,f)})),...!S.length&&i&&s!=="manual"?[{id:"muse",title:a("automation.builder.museFallback"),subtitle:me||a("automation.builder.museFallbackHint"),icon:e.jsx(De,{size:17}),ready:!0}]:[],{id:"review",title:a("automation.ux.finish"),subtitle:a(ne?"automation.ux.allReady":"automation.ux.finishHint"),icon:e.jsx(be,{size:17}),ready:ne}],Ze=e.jsxs(e.Fragment,{children:[e.jsxs(Ft,{label:a("automation.ux.addStep"),className:"btn ghost sm",disabled:X||S.length>=24,items:["notify","agent_run","db_row_add","db_row_edit","tool_call"].map(t=>({id:t,label:a(`automation.step.${t}`),icon:he(t),disabled:t==="tool_call"&&!f.length,onSelect:()=>Ke(t)})),children:[e.jsx(bt,{size:14}),a("automation.ux.addStep")]}),e.jsx("button",{className:"icon-btn",title:a("automation.ux.help"),onClick:()=>p("help"),children:e.jsx(Ht,{size:15})})]});return e.jsxs("div",{className:`auto-builder auto-workflow-builder ${b?"auto-builder-embedded":""}`,children:[e.jsxs("div",{className:"auto-builder-title",children:[e.jsx(ze,{size:17}),e.jsx("span",{children:a(i?"automation.builder.editTitle":"automation.builder.title")}),e.jsx("button",{className:"btn ghost sm",disabled:X,onClick:()=>h?h():v.closeBuilder(),children:a("common.cancel")})]}),e.jsx("div",{className:"auto-builder-workspace",hidden:!g&&m,children:e.jsx(Kt,{nodes:Ye,selected:m?F:"",onSelect:p,children:Ze})}),e.jsxs(Lt,{controller:g,open:m,title:a("automation.ux.setup"),onClose:()=>$(!1),children:[!g&&e.jsxs("button",{className:"btn ghost sm auto-inline-back",onClick:()=>$(!1),children:[e.jsx(xt,{size:14}),a("automation.ux.flow")]}),e.jsxs("div",{className:"auto-inspector","aria-label":a("automation.ux.setup"),children:[e.jsxs("div",{className:"auto-node",hidden:F!=="trigger",children:[e.jsxs("div",{className:"auto-node-head",children:[e.jsx("span",{className:"auto-ic",children:e.jsx(Re,{size:14})}),a("automation.builder.trigger")]}),e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.desc")}),e.jsx("input",{"aria-label":a("automation.builder.desc"),type:"text",value:P,maxLength:200,placeholder:a("automation.builder.descPh"),onChange:t=>I(t.target.value)})]}),!b&&e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.condType")}),e.jsxs("div",{className:"auto-seg",children:[e.jsx("button",{className:s==="timer"?"active":"",onClick:()=>y("timer"),children:a("automation.builder.condTimer")}),e.jsx("button",{className:s==="event_seen"?"active":"",onClick:()=>y("event_seen"),children:a("automation.builder.condEvent")}),e.jsx("button",{className:s==="file_chars_gte"?"active":"",onClick:()=>y("file_chars_gte"),children:a("automation.builder.condFile")}),e.jsx("button",{className:s==="db_changed"?"active":"",onClick:()=>y("db_changed"),children:a("automation.builder.condDb")}),e.jsx("button",{className:s==="manual"?"active":"",onClick:()=>y("manual"),children:a("automation.builder.condManual")})]})]}),s==="db_changed"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.dbPath")}),e.jsxs("select",{value:R,onChange:t=>{Oe(t.target.value),je([])},children:[e.jsx("option",{value:"",children:a("automation.builder.dbPickDb")}),ee.map(t=>e.jsx("option",{value:t,children:t},t)),R&&!ee.includes(R)&&e.jsx("option",{value:R,children:R})]})]}),e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.dbEvent")}),e.jsxs("div",{className:"auto-seg",children:[e.jsx("button",{className:T==="row_added"?"active":"",onClick:()=>ge("row_added"),children:a("automation.builder.dbEventRow")}),e.jsx("button",{className:T==="cell_changed"?"active":"",onClick:()=>ge("cell_changed"),children:a("automation.builder.dbEventCell")})]})]}),T==="cell_changed"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.dbColumn")}),e.jsxs("div",{className:"auto-checks",children:[(U??[]).map(t=>e.jsxs("label",{className:"auto-check",children:[e.jsx("input",{type:"checkbox",checked:W.includes(t.id),onChange:u=>fe(t.id,u.target.checked)}),t.name]},t.id)),W.filter(t=>!(U??[]).some(u=>u.id===t)).map(t=>e.jsxs("label",{className:"auto-check",children:[e.jsx("input",{type:"checkbox",checked:!0,onChange:()=>fe(t,!1)}),"(",t,")"]},t)),!U&&e.jsx("span",{className:"auto-hint",children:a("automation.builder.dbColsLoading")})]}),e.jsx("div",{className:"auto-hint",children:a("automation.builder.dbColumnsHint")})]}),e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.dbEquals")}),e.jsx("input",{type:"text",value:de,maxLength:200,placeholder:a("automation.builder.dbEqualsPh"),onChange:t=>Be(t.target.value)})]})]}),e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.dbWhere")}),L.map((t,u)=>e.jsxs("div",{className:"auto-inline",children:[e.jsxs("select",{value:t.column,onChange:r=>ce(u,{column:r.target.value}),children:[e.jsx("option",{value:"",children:a(B?"automation.builder.dbPickCol":"automation.builder.dbColsLoading")}),(B??[]).map(r=>e.jsx("option",{value:r.id,children:r.name},r.id)),t.column&&!(B??[]).some(r=>r.id===t.column)&&e.jsxs("option",{value:t.column,children:["(",t.column,")"]})]}),e.jsx("select",{value:t.op,onChange:r=>ce(u,{op:r.target.value}),children:pt.map(r=>e.jsx("option",{value:r,children:a(r==="eq"?"automation.builder.dbWhereOpEq":r==="ne"?"automation.builder.dbWhereOpNe":r==="empty"?"automation.builder.dbWhereOpEmpty":"automation.builder.dbWhereOpNotEmpty")},r))}),e.jsx("input",{type:"text",value:t.value,maxLength:200,disabled:t.op==="empty"||t.op==="notempty",placeholder:a("automation.builder.dbWhereValPh"),onChange:r=>ce(u,{value:r.target.value})}),e.jsx("button",{className:"icon-btn",title:a("common.delete"),onClick:()=>ue(r=>r.filter((l,d)=>d!==u)),children:e.jsx(xe,{size:12})})]},u)),e.jsx("button",{className:"icon-btn",title:a("automation.builder.dbWhereAdd"),disabled:L.length>=Fe,onClick:()=>ue(t=>[...t,{column:"",op:"eq",value:""}]),children:"+"}),e.jsx("div",{className:"auto-hint",children:a("automation.builder.dbWhereHint")})]}),e.jsx("div",{className:"auto-hint",children:a("automation.builder.dbHint")})]}),s==="manual"&&e.jsx("div",{className:"auto-hint",children:a("automation.builder.manualHint")}),s==="timer"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.timerMode")}),e.jsxs("div",{className:"auto-seg",children:[e.jsx("button",{className:w==="daily_at"?"active":"",onClick:()=>q("daily_at"),children:a("automation.builder.timerDaily")}),e.jsx("button",{className:w==="at"?"active":"",onClick:()=>q("at"),children:a("automation.builder.timerOnce")}),e.jsx("button",{className:w==="every"?"active":"",onClick:()=>q("every"),children:a("automation.builder.timerEvery")})]})]}),w==="daily_at"&&e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.time")}),e.jsx("input",{type:"time",value:H,onChange:t=>Z(t.target.value)})]}),w==="at"&&e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.datetime")}),e.jsx("input",{type:"datetime-local",value:G,onChange:t=>Me(t.target.value)}),e.jsx("div",{className:"auto-hint",children:a(V?"automation.builder.expiredReset":"automation.builder.onceHint")})]}),w==="every"&&e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.interval")}),e.jsxs("div",{className:"auto-inline",children:[e.jsx("input",{type:"number",value:J,min:1,style:{width:90},onChange:t=>qe(t.target.value)}),e.jsxs("select",{value:ve,onChange:t=>He(t.target.value),children:[e.jsx("option",{value:"m",children:a("automation.builder.unitM")}),e.jsx("option",{value:"h",children:a("automation.builder.unitH")}),e.jsx("option",{value:"d",children:a("automation.builder.unitD")})]})]}),e.jsx("div",{className:"auto-hint",children:a("automation.builder.everyHint")})]})]}),s==="event_seen"&&e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.match")}),e.jsx("input",{type:"text",list:"auto-event-catalog",value:se,maxLength:120,placeholder:a("automation.builder.matchPh"),onChange:t=>We(t.target.value)}),e.jsxs("datalist",{id:"auto-event-catalog",children:[vt.map(t=>e.jsx("option",{value:t},t)),gt().map(t=>e.jsx("option",{value:t.name,label:t.label},t.name))]}),e.jsx("div",{className:"auto-hint",children:a("automation.builder.matchHint")})]}),s==="file_chars_gte"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.path")}),e.jsx("input",{type:"text",value:oe,placeholder:"~/Forsion/Notes/xxx.md",onChange:t=>Ve(t.target.value)})]}),e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.chars")}),e.jsx("input",{type:"number",value:re,min:1,onChange:t=>Le(t.target.value)})]})]})]}),S.map((t,u)=>{const r=t.type==="tool_call"?f.find(l=>l.name===t.tool):void 0;return e.jsxs("div",{className:"auto-node",hidden:F!==String(t.key),children:[e.jsxs("div",{className:"auto-node-head",children:[e.jsx("span",{className:"auto-ic",children:he(t.type)}),a("automation.builder.stepN",{n:String(u+1)})," · ",a(`automation.step.${t.type}`),e.jsxs("span",{className:"auto-step-tools",children:[e.jsx("button",{className:"icon-btn",disabled:u===0,title:a("automation.builder.moveUp"),onClick:()=>Ee(u,-1),children:e.jsx(jt,{size:12})}),e.jsx("button",{className:"icon-btn",disabled:u===S.length-1,title:a("automation.builder.moveDown"),onClick:()=>Ee(u,1),children:e.jsx(ft,{size:12})}),e.jsx("button",{className:"icon-btn",title:a("common.delete"),onClick:()=>{te(l=>l.filter(d=>d.key!==t.key)),p("trigger")},children:e.jsx(xe,{size:12})})]})]}),t.type==="notify"&&e.jsxs(e.Fragment,{children:[e.jsx(Ae,{label:a("automation.builder.notifyTitle"),value:t.title,maxLength:200,placeholder:a("automation.builder.notifyTitlePh"),onChange:l=>j(t.key,{title:l}),columns:U,hasRow:s==="db_changed"}),e.jsx(Ae,{label:a("automation.builder.notifyBody"),value:t.body,multiline:!0,onChange:l=>j(t.key,{body:l}),columns:U,hasRow:s==="db_changed"}),e.jsx("div",{className:"auto-hint",children:a("automation.builder.notifyHint")})]}),t.type==="agent_run"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.runner")}),e.jsxs("select",{value:t.agentSlug,onChange:l=>j(t.key,{agentSlug:l.target.value}),children:[e.jsx("option",{value:"",children:a("automation.builder.runnerPick")}),k.filter(l=>l.slug!=="muse").map(l=>e.jsx("option",{value:l.slug,children:l.name},l.slug))]})]}),e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.prompt")}),e.jsx("textarea",{value:t.prompt,maxLength:500,placeholder:a("automation.builder.promptPh"),onChange:l=>j(t.key,{prompt:l.target.value})})]})]}),(t.type==="db_row_add"||t.type==="db_row_edit")&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.dbPath")}),e.jsxs("select",{value:t.dbPath,onChange:l=>j(t.key,{dbPath:l.target.value}),children:[e.jsx("option",{value:"",children:a("automation.builder.dbPickDb")}),ee.map(l=>e.jsx("option",{value:l,children:l},l)),t.dbPath&&!ee.includes(t.dbPath)&&e.jsx("option",{value:t.dbPath,children:t.dbPath})]})]}),t.type==="db_row_edit"&&e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.dbRowId")}),e.jsx("input",{type:"text",value:t.rowId,placeholder:a(s==="db_changed"?"automation.builder.dbRowIdPh":"automation.builder.dbRowIdRequired"),onChange:l=>j(t.key,{rowId:l.target.value})})]}),t.type==="db_row_edit"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.dbRowFrom")}),e.jsx("input",{type:"text",value:t.rowFrom,maxLength:200,placeholder:a("automation.builder.dbRowFromPh"),onChange:l=>j(t.key,{rowFrom:l.target.value})})]}),e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.dbMatch")}),e.jsxs("div",{className:"auto-inline",children:[e.jsx("input",{type:"text",value:t.matchColumn,maxLength:200,placeholder:a("automation.builder.dbCellKey"),style:{width:120},onChange:l=>j(t.key,{matchColumn:l.target.value})}),e.jsx("input",{type:"text",value:t.matchValue,maxLength:2e3,placeholder:a("automation.builder.dbMatchValPh"),onChange:l=>j(t.key,{matchValue:l.target.value})})]}),e.jsx("div",{className:"auto-hint",children:a("automation.builder.dbTargetHint")})]})]}),e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.dbCells")}),t.cells.map((l,d)=>e.jsxs("div",{className:"auto-inline",children:[e.jsx("input",{type:"text",value:l.k,placeholder:a("automation.builder.dbCellKey"),style:{width:120},onChange:A=>j(t.key,{cells:t.cells.map((N,z)=>z===d?{...N,k:A.target.value}:N)})}),e.jsx("input",{type:"text",value:l.v,placeholder:a(d===0?"automation.builder.dbCellValPh":"automation.builder.dbCellVal"),onChange:A=>j(t.key,{cells:t.cells.map((N,z)=>z===d?{...N,v:A.target.value}:N)})}),e.jsx("button",{className:"icon-btn",title:a("common.delete"),disabled:t.cells.length<=1,onClick:()=>j(t.key,{cells:t.cells.filter((A,N)=>N!==d)}),children:e.jsx(xe,{size:12})})]},d)),e.jsx("button",{className:"icon-btn",title:a("automation.builder.dbCellAdd"),onClick:()=>j(t.key,{cells:[...t.cells,{k:"",v:""}]}),children:"+"}),e.jsx("div",{className:"auto-hint",children:a("automation.builder.dbCellsHint")})]}),t.type==="db_row_add"&&e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.dbSkipIfEmpty")}),e.jsx("input",{type:"text",value:t.skipIfEmpty,maxLength:200,placeholder:a("automation.builder.dbSkipIfEmptyPh"),onChange:l=>j(t.key,{skipIfEmpty:l.target.value})})]})]}),t.type==="tool_call"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.tool")}),e.jsxs("select",{value:t.tool,onChange:l=>{const d=f.find(N=>N.name===l.target.value),A=Object.fromEntries((d?.parameters.required||[]).filter(N=>d?.parameters.properties?.[N]?.type==="boolean").map(N=>[N,"false"]));j(t.key,{tool:l.target.value,argValues:A})},children:[e.jsx("option",{value:"",children:a("automation.builder.toolPick")}),f.map(l=>e.jsxs("option",{value:l.name,children:[l.name,l.dangerous?" ⚠":""]},l.name))]}),r&&e.jsxs("div",{className:"auto-hint",children:[r.description,r.dangerous?` · ${a("automation.builder.dangerous")}`:""]})]}),r&&Object.entries(r.parameters.properties||{}).map(([l,d])=>{const A=(r.parameters.required||[]).includes(l),N=`${l}${A?" *":""}`,z=t.argValues[l]||"",Y=_=>j(t.key,{argValues:{...t.argValues,[l]:_}});return e.jsxs("div",{className:"field",children:[e.jsx("label",{title:d.description||"",children:N}),d.enum?.length?e.jsxs("select",{value:z,onChange:_=>Y(_.target.value),children:[e.jsx("option",{value:""}),d.enum.map(_=>e.jsx("option",{value:_,children:_},_))]}):d.type==="boolean"?e.jsxs("label",{className:"auto-check",children:[e.jsx("input",{type:"checkbox",checked:z==="true",onChange:_=>Y(_.target.checked?"true":"false")})," ",d.description||""]}):d.type==="number"?e.jsx("input",{type:"number",value:z,onChange:_=>Y(_.target.value)}):d.type==="string"?e.jsx("textarea",{rows:2,value:z,placeholder:d.description||"",onChange:_=>Y(_.target.value)}):e.jsx("textarea",{rows:2,value:z,placeholder:`JSON — ${d.description||""}`,onChange:_=>Y(_.target.value)})]},l)})]})]},t.key)}),S.length===0&&i&&s!=="manual"&&e.jsxs("div",{className:"auto-node auto-node-muse",hidden:F!=="muse",children:[e.jsxs("div",{className:"auto-node-head",children:[e.jsx("span",{className:"auto-ic",children:e.jsx(De,{size:14})}),a("automation.builder.museFallback")]}),e.jsx("div",{className:"auto-hint",children:a("automation.builder.museFallbackHint")}),e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.prompt")}),e.jsx("textarea",{value:me,maxLength:500,placeholder:a("automation.builder.promptPh"),onChange:t=>Ue(t.target.value)})]})]}),e.jsxs("div",{className:"auto-node auto-review",hidden:F!=="review",children:[e.jsxs("div",{className:"auto-node-head",children:[e.jsx(be,{size:16}),a("automation.ux.review")]}),e.jsx("p",{className:"auto-hint",children:a("automation.ux.enableHint")}),e.jsxs("label",{className:"auto-check",children:[e.jsx("input",{type:"checkbox",checked:D,onChange:t=>M(t.target.checked)}),a("automation.ux.enabledLabel")]}),E.length?e.jsxs("div",{className:"auto-validation",role:"status",children:[e.jsx("strong",{children:a("automation.ux.checklist")}),E.map((t,u)=>e.jsx("button",{onClick:()=>p(t.node),children:t.text},u))]}):e.jsxs("p",{className:"auto-ready",children:[e.jsx(be,{size:14}),a("automation.ux.allReady")]}),s!=="timer"&&s!=="manual"&&e.jsxs("div",{className:"auto-guard",children:[e.jsx("label",{children:a("automation.builder.cooldown")}),e.jsx("input",{type:"number",value:K,min:Se?1:s==="db_changed"?0:.25,step:"1",onChange:t=>{Ce.current=!0,_e(t.target.value)}}),e.jsx("span",{className:"auto-hint",children:a(Se?"automation.builder.cooldownAgentHint":s==="db_changed"?"automation.builder.cooldownDbHint":"automation.builder.cooldownHint")})]})]}),e.jsxs("div",{className:"auto-node",hidden:F!=="help",children:[e.jsx("h3",{children:a("automation.ux.flow")}),e.jsx("p",{className:"auto-hint",children:a("automation.ux.canvasOrder")}),e.jsx("p",{className:"auto-hint",children:a("automation.ux.nativeHint")})]})]})]}),e.jsxs("div",{className:"auto-builder-actions auto-builder-footer",children:[e.jsx("div",{className:"auto-save-status","aria-live":"polite",children:we?e.jsx("span",{role:"alert",children:we}):E.length?e.jsxs("button",{onClick:()=>p(E[0].node),children:[E[0].text,E.length>1?` (+${E.length-1})`:""]}):e.jsx("span",{children:a("automation.ux.allReady")})}),e.jsx("button",{className:"btn ghost sm",onClick:()=>p("review"),children:a("automation.ux.review")}),e.jsx("button",{className:"btn sm",disabled:!ne||X,onClick:()=>{Xe()},children:X?"…":a(D?"automation.ux.saveEnabled":"automation.ux.savePaused")})]})]})},oa=Object.freeze(Object.defineProperty({__proto__:null,AutomationBuilder:Yt,hasUnsupportedParts:Ie},Symbol.toStringTag,{value:"Module"}));export{Lt as A,Vt as B,sa as S,Yt as a,oa as b};
|
|
1
|
+
import{d as o,j as e,u as pe}from"./index-BM2o7PeV.js";import{F as Ye,bp as Qe,qK as le,fA as Ze,kp as et,aJ as tt,dD as at,fN as nt,fJ as it,hD as lt,hy as st,gM as ot,hG as rt,qL as dt,h as ut,b as ct,fn as ie,aS as mt,qM as ht,qN as $e,qO as Te,qP as Fe,a2 as qe,K as Re,hA as be,aq as bt,aK as xt,qQ as pt,bJ as xe,qR as vt,qS as gt,bH as jt,bI as ft,G as yt,J as Nt,_ as _t,gG as Ct,qT as kt,qU as wt,s as St,qV as Et,qW as Pt,u as $t}from"./appStore-DWP8UET9.js";import{C as Ft}from"./CapabilityMenu-SwVlZ06x.js";import{u as qt}from"./gestures-DQBCcK4y.js";import{a as Rt,C as Dt}from"./Chrome-HdfyYV3i.js";import{d as At,e as Mt,f as Tt,g as zt}from"./canvasPrefs-8taQ42Cz.js";import{R as It}from"./rotate-ccw-BvipPIjC.js";import"./messages-_jta1lSI.js";import{W as De}from"./workflow-DPoG4QE2.js";import{C as Ht}from"./circle-question-mark-XbAFplz1.js";const Vt=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Wt=Ye("bell",Vt);function Lt({controller:i,open:c,title:b,onClose:C,children:h}){const[g]=o.useState(()=>document.createElement("div"));g.className="auto-extension";const a=o.useRef(null),k=o.useRef(C);k.current=C;const v=o.useRef(b);return v.current=b,o.useEffect(()=>{if(!(!i||!c)){try{a.current=i.open({id:"automation-context",title:()=>v.current,mount:f=>(f.appendChild(g),()=>g.remove()),onClose:()=>k.current()})}catch{k.current()}return()=>{a.current?.close(),a.current=null}}},[i,c,g]),c?i?Qe.createPortal(h,g):e.jsx("div",{className:"auto-extension auto-extension-inline",children:h}):null}const sa=["reminder","briefing","table","button"];function Ot(i,c){return i?i==="briefing"||i==="button"?[{...le("agent_run"),prompt:c(`automation.ux.${i}.prompt`)}]:[{...le("notify"),title:c(`automation.ux.${i}.name`),body:c(`automation.ux.${i}.body`)}]:[le("notify")]}function Ae(i,c,b){if(i.type==="notify")return i.title.trim()?null:"notify";if(i.type==="agent_run")return i.agentSlug?i.prompt.trim()?null:"prompt":"agent";if(i.type==="db_row_add"||i.type==="db_row_edit"){if(!/\.db$/i.test(i.dbPath.trim()))return"table";if(!i.cells.some(h=>h.k.trim()))return"cells";if(i.type==="db_row_edit"){if(c!=="db_changed"&&(!i.rowId.trim()&&!i.matchColumn.trim()||i.rowFrom.trim()))return"row";if(i.matchColumn.trim()&&!i.matchValue.trim())return"match"}return null}const C=b.find(h=>h.name===i.tool);if(!C)return"tool";if((C.parameters.required||[]).some(h=>!(i.argValues[h]||"").trim()))return"args";for(const[h,g]of Object.entries(i.argValues)){if(!g.trim())continue;const a=C.parameters.properties?.[h];if(a?.type==="number"&&!Number.isFinite(Number(g)))return"args";if(a?.type==="object"||a?.type==="array")try{const k=JSON.parse(g);if(a.type==="array"?!Array.isArray(k):!k||typeof k!="object"||Array.isArray(k))return"json"}catch{return"json"}}return null}function Bt(i){return(i||[]).map(c=>({value:`{{row.${c.id}}}`,label:c.name}))}const Ut=i=>({x:0,y:i*132,w:244,h:84}),Kt=({nodes:i,selected:c,onSelect:b,children:C})=>{const{t:h}=pe(),g=o.useId().replace(/:/g,""),a=o.useRef(null),[k,v]=o.useState({}),[f,$]=o.useState(At),[T,F]=o.useState(Mt),x=Ze(a),m=new Map(i.map((n,s)=>[n.id,k[n.id]||Ut(s)])),P=i.map(n=>n.id).join(","),p=qt(a,x,{boxes:()=>m,identity:()=>P,commit:n=>v(s=>({...s,...Object.fromEntries(n)})),hitKey:n=>n.closest("[data-flow-node]")?.dataset.flowNode||null,onEnterEdit:b,onDoubleClick:n=>{n&&b(n)},minW:244,minH:84,repel:!0},f);o.useEffect(()=>p.bind(a.current),[p.bind]),o.useEffect(()=>x.bindWheel(a.current),[x.bindWheel]);const R=o.useRef(()=>x.fitTo([...m.values()],64));R.current=()=>x.fitTo([...m.values()],64),o.useEffect(()=>{v({});const n=requestAnimationFrame(()=>R.current());return()=>cancelAnimationFrame(n)},[P]),o.useEffect(()=>{const n=new ResizeObserver(()=>R.current());return a.current&&n.observe(a.current),()=>n.disconnect()},[]);const z=n=>p.live?.get(n)||m.get(n);return e.jsx("div",{className:"auto-canvas-shell am-app",children:e.jsxs("div",{className:"auto-canvas amx-stage",ref:a,tabIndex:0,"aria-label":h("automation.ux.flow"),onPointerUpCapture:n=>{if(p.busy)return;const s=document.elementFromPoint(n.clientX,n.clientY)?.closest("[data-flow-node]");s&&a.current?.contains(s)&&b(s.dataset.flowNode)},children:[e.jsx("div",{className:"amx-stage-grid",style:et(x.vp)}),e.jsxs("div",{className:"auto-canvas-world",style:{transform:`translate(${x.vp.x}px, ${x.vp.y}px) scale(${x.vp.z})`},children:[e.jsxs("svg",{className:"auto-canvas-edges","aria-hidden":"true",children:[e.jsx("defs",{children:e.jsx("marker",{id:g,markerWidth:"8",markerHeight:"8",refX:"6",refY:"3",orient:"auto",children:e.jsx("path",{d:"M0,0 L6,3 L0,6",fill:"none",stroke:"currentColor"})})}),i.slice(1).map((n,s)=>{const y=z(i[s].id),w=z(n.id),I=y.x+y.w/2,H=y.y+y.h,X=w.x+w.w/2,W=w.y;return e.jsx("path",{d:`M${I},${H} C${I},${H+28} ${X},${W-28} ${X},${W}`,markerEnd:`url(#${g})`},n.id)})]}),i.map(n=>{const s=z(n.id);return e.jsxs("div",{"data-flow-node":n.id,role:"button",tabIndex:0,"aria-pressed":c===n.id,className:`auto-flow-node ${c===n.id?"selected":""}`,style:{left:s.x,top:s.y,width:s.w,height:s.h},onClick:()=>b(n.id),onKeyDown:y=>{y.key==="Enter"&&(y.preventDefault(),b(n.id))},children:[e.jsx("span",{className:"auto-flow-icon",children:n.icon}),e.jsx("strong",{children:n.title}),e.jsx("span",{className:"auto-flow-status",title:h(n.ready?"automation.ux.ready":"automation.ux.incomplete"),children:n.ready?e.jsx(tt,{size:13}):e.jsx(at,{size:13})}),e.jsx("span",{className:"auto-flow-subtitle",children:n.subtitle})]},n.id)}),p.marquee&&e.jsx("div",{className:"amx-stage-marquee",style:{left:p.marquee.x,top:p.marquee.y,width:p.marquee.w,height:p.marquee.h}})]}),C&&e.jsx("div",{className:"amx-stage-tools auto-canvas-tools",children:C}),e.jsx(Rt,{zoom:x.vp.z,onZoomBy:n=>{const{w:s,h:y}=nt(a.current);x.setVp(it(x.vp,x.vp.z*n,s/2,y/2))},onFit:()=>R.current(),snap:f,onSnap:n=>{$(n),zt(n)},mini:T,onMini:n=>{F(n),Tt(n)},extra:e.jsx("button",{type:"button",title:h("automation.ux.arrange"),onClick:()=>{v({}),requestAnimationFrame(()=>R.current())},children:e.jsx(It,{size:12})})}),T&&e.jsx(Dt,{hostRef:a,vp:x.vp,items:i.map(n=>({key:n.id,kind:"card",box:z(n.id)})),onCenter:x.centerOn})]})})},Me=({label:i,value:c,onChange:b,multiline:C,maxLength:h=4e3,placeholder:g,columns:a,hasRow:k})=>{const{t:v}=pe(),f=o.useId(),$=o.useRef(null),T=o.useRef({start:c.length,end:c.length}),F=m=>{if(!m)return;const{start:P,end:p}=T.current;c.length-(p-P)+m.length>h||(b(c.slice(0,P)+m+c.slice(p)),requestAnimationFrame(()=>{$.current?.focus(),$.current?.setSelectionRange(P+m.length,P+m.length)}))},x={id:f,ref:$,value:c,maxLength:h,placeholder:g,onChange:m=>b(m.target.value),onSelect:m=>{T.current={start:m.currentTarget.selectionStart??c.length,end:m.currentTarget.selectionEnd??c.length}}};return e.jsxs("div",{className:"field auto-template-field",children:[e.jsxs("div",{className:"auto-field-heading",children:[e.jsx("label",{htmlFor:f,children:i}),e.jsxs("select",{"aria-label":v("automation.ux.insertVariable",{field:i}),value:"",onChange:m=>F(m.target.value),children:[e.jsx("option",{value:"",children:v("automation.ux.variables")}),e.jsx("option",{value:"{{today}}",children:v("automation.ux.today")}),e.jsx("option",{value:"{{now}}",children:v("automation.ux.now")}),k&&e.jsxs("optgroup",{label:v("automation.ux.triggerRow"),children:[e.jsx("option",{value:"{{row.id}}",children:v("automation.ux.rowId")}),Bt(a).map(m=>e.jsx("option",{value:m.value,children:m.label},m.value))]})]})]}),C?e.jsx("textarea",{...x}):e.jsx("input",{type:"text",...x})]})};function Gt(){const i=new Date(Date.now()+36e5);i.setMinutes(0,0,0);const c=b=>String(b).padStart(2,"0");return`${i.getFullYear()}-${c(i.getMonth()+1)}-${c(i.getDate())}T${c(i.getHours())}:00`}const Jt=({editing:i,starter:c,fixedManual:b,onSaved:C,onCancel:h,extendView:g})=>{const{t:a}=pe(),k=lt(),v=st(),f=v.actionsCatalog,[$,T]=o.useState(i?.desc||(c?a(`automation.ux.${c}.name`):"")),[F,x]=o.useState("trigger"),[m,P]=o.useState(!1),p=t=>{x(t),P(!0)},[R,z]=o.useState(i?.enabled??!!b),n=i?.cond,[s,y]=o.useState(n?n.type==="event_seen"?"event_seen":n.type==="file_chars_gte"?"file_chars_gte":n.type==="manual"?"manual":n.type==="db_changed"?"db_changed":"timer":b||c==="button"?"manual":c==="table"?"db_changed":"timer"),[w,I]=o.useState(n?.type==="at"?"at":n?.type==="every"?"every":"daily_at"),[H,X]=o.useState(n?.type==="daily_at"?n.time:"09:00"),W=!!i&&ot(i),[Y,ze]=o.useState(n?.type==="at"&&!W?n.datetime.replace(" ","T"):Gt()),Q=n?.type==="every"?/^(\d+)([mhd])$/.exec(n.interval):null,[Z,Ie]=o.useState(Q?Q[1]:"1"),[ve,He]=o.useState(Q?Q[2]:"h"),[se,Ve]=o.useState(n?.type==="event_seen"?n.match:""),[oe,We]=o.useState(n?.type==="file_chars_gte"?n.path:""),[re,Le]=o.useState(n?.type==="file_chars_gte"?String(n.n):"100"),[q,Oe]=o.useState(n?.type==="db_changed"?n.path:""),[A,ge]=o.useState(n?.type==="db_changed"?n.event:"row_added"),[V,je]=o.useState(()=>rt(n)),fe=(t,u)=>je(r=>u?r.includes(t)?r:[...r,t]:r.filter(l=>l!==t)),[de,Be]=o.useState(n?.type==="db_changed"&&n.equals||""),[L,ue]=o.useState(()=>dt(n)),ce=(t,u)=>ue(r=>r.map((l,d)=>d===t?{...l,...u}:l));o.useEffect(()=>{ut()},[]);const ye=ct(t=>t.files),O=o.useMemo(()=>ye.filter(t=>/\.db$/i.test(t)),[ye]);o.useEffect(()=>{for(const t of O)ie.getState().load(t,t)},[O]);const Ne=ie(mt(t=>O.filter(u=>t.entries[u]?.data?.source!==void 0))),ee=o.useMemo(()=>O.filter(t=>!Ne.includes(t)),[O,Ne]),B=ie(t=>s==="db_changed"&&q?t.entries[q]?.data?.columns:void 0),U=o.useMemo(()=>B?.filter(t=>t.type!=="formula"&&t.type!=="lookup"),[B]),[S,te]=o.useState(()=>i?ht(i):Ot(c,a)),[me,Ue]=o.useState(i&&!i.actions?.length&&!i.agentSlug&&i.prompt||""),[K,_e]=o.useState(()=>$e(i,s)),Ce=o.useRef(!1);o.useEffect(()=>{!i&&!Ce.current&&_e($e(null,s))},[s,i]);const[G,ke]=o.useState(!1),[we,ae]=o.useState(""),Ke=t=>{if(S.length>=24)return;const u=le(t);te(r=>[...r,u]),p(String(u.key))},Se=S.some(t=>t.type==="agent_run"),j=(t,u)=>te(r=>r.map(l=>l.key===t?{...l,...u}:l)),Ee=(t,u)=>te(r=>{const l=t+u;if(l<0||l>=r.length)return r;const d=[...r];return[d[t],d[l]]=[d[l],d[t]],d});if(Te(i))return e.jsxs("div",{className:"auto-builder",children:[e.jsxs("div",{className:"auto-builder-title",children:[e.jsx(De,{size:17})," ",a("automation.builder.editTitle")]}),e.jsx("div",{className:"auto-node",children:e.jsx("div",{className:"auto-hint",children:a("automation.builder.unsupported")})}),e.jsx("div",{className:"auto-builder-actions",children:e.jsx("button",{className:"btn ghost",onClick:()=>h?h():v.closeBuilder(),children:a("common.cancel")})})]});const Pe=!(s==="timer"&&(w==="daily_at"&&!/^\d{1,2}:\d{2}$/.test(H)||w==="at"&&!Y||w==="every"&&(!Number.isInteger(Number(Z))||Number(Z)<1))||s==="event_seen"&&!se.trim()||s==="file_chars_gte"&&(!oe.trim()||!(Number(re)>0))||s==="db_changed"&&(!/\.db$/i.test(q.trim())||A==="cell_changed"&&!V.length||L.length>Fe||L.some(t=>t.column.trim()&&(t.op==="eq"||t.op==="ne")&&!t.value.trim()))),E=[];$.trim()||E.push({node:"trigger",text:a("automation.ux.issue.name")}),Pe||E.push({node:"trigger",text:a("automation.ux.issue.trigger")}),!S.length&&(!i||s==="manual")&&E.push({node:"review",text:a("automation.ux.issue.steps")}),S.forEach((t,u)=>{const r=Ae(t,s,f);r&&E.push({node:String(t.key),text:`${u+1}. ${a(`automation.ux.issue.${r}`)}`})}),s!=="timer"&&s!=="manual"&&(!K.trim()||!Number.isFinite(Number(K))||Number(K)<0)&&E.push({node:"review",text:a("automation.ux.issue.cooldown")});const ne=E.length===0,Ge=async()=>{if(!ne||G)return;const t=s==="timer"?w:s;if(t==="at"&&(Ct(Y)?.getTime()??0)<Date.now()-5*6e4){ae(a("automation.builder.atPast"));return}const u=d=>ie.getState().entries[d]?.data?.source!==void 0;if([...t==="db_changed"?[q.trim()]:[],...S.filter(d=>d.type==="db_row_add"||d.type==="db_row_edit").map(d=>d.dbPath.trim())].filter(Boolean).some(u)){ae(a("automation.builder.dbNoteView"));return}ke(!0),ae("");const l=kt(S,f);try{const d=await wt(St(),{id:i?.id,actor:"user",desc:$.trim(),cond_type:t,time:t==="daily_at"?H:void 0,datetime:t==="at"?Y:void 0,interval:t==="every"?`${Math.floor(Number(Z))}${ve}`:void 0,match:t==="event_seen"?se.trim():void 0,path:t==="file_chars_gte"?oe.trim():t==="db_changed"?q.trim():void 0,n:t==="file_chars_gte"?Number(re):void 0,event:t==="db_changed"?A:void 0,column_id:t==="db_changed"&&A==="cell_changed"?V[0]:void 0,column_ids:t==="db_changed"&&A==="cell_changed"&&V.length>1?V:void 0,equals:t==="db_changed"&&A==="cell_changed"&&de.trim()?de.trim():void 0,where:t==="db_changed"?Pt(L):void 0,vault:t==="db_changed"&&i?.cond.type==="db_changed"?i.cond.vault:void 0,prompt:S.length?void 0:me.trim()||void 0,cooldown_hours:Et(s,K),actions:S.length?l:null,enabled:R});if(C){v.bump(),C(d);return}v.acceptSaved(d),$t.getState().toast(a("automation.ux.saved"))}catch(d){ae(String(d?.message||d))}finally{ke(!1)}},he=t=>t==="notify"?e.jsx(Wt,{size:14}):t==="agent_run"?e.jsx(yt,{size:14}):t==="db_row_add"||t==="db_row_edit"?e.jsx(Nt,{size:14}):e.jsx(_t,{size:14}),Je=[{id:"trigger",title:a("automation.builder.trigger"),subtitle:a(`automation.builder.${s==="timer"?"condTimer":s==="manual"?"condManual":s==="db_changed"?"condDb":s==="event_seen"?"condEvent":"condFile"}`),icon:e.jsx(qe,{size:17}),ready:Pe&&!!$.trim()},...S.map((t,u)=>({id:String(t.key),title:`${u+1}. ${a(`automation.step.${t.type}`)}`,subtitle:t.title||t.prompt||t.dbPath||t.tool||a("automation.ux.setupHint"),icon:he(t.type),ready:!Ae(t,s,f)})),...!S.length&&i&&s!=="manual"?[{id:"muse",title:a("automation.builder.museFallback"),subtitle:me||a("automation.builder.museFallbackHint"),icon:e.jsx(Re,{size:17}),ready:!0}]:[],{id:"review",title:a("automation.ux.finish"),subtitle:a(ne?"automation.ux.allReady":"automation.ux.finishHint"),icon:e.jsx(be,{size:17}),ready:ne}],Xe=e.jsxs(e.Fragment,{children:[e.jsxs(Ft,{label:a("automation.ux.addStep"),className:"btn ghost sm",disabled:G||S.length>=24,items:["notify","agent_run","db_row_add","db_row_edit","tool_call"].map(t=>({id:t,label:a(`automation.step.${t}`),icon:he(t),disabled:t==="tool_call"&&!f.length,onSelect:()=>Ke(t)})),children:[e.jsx(bt,{size:14}),a("automation.ux.addStep")]}),e.jsx("button",{className:"icon-btn",title:a("automation.ux.help"),onClick:()=>p("help"),children:e.jsx(Ht,{size:15})})]});return e.jsxs("div",{className:`auto-builder auto-workflow-builder ${b?"auto-builder-embedded":""}`,children:[e.jsxs("div",{className:"auto-builder-title",children:[e.jsx(De,{size:17}),e.jsx("span",{children:a(i?"automation.builder.editTitle":"automation.builder.title")}),e.jsx("button",{className:"btn ghost sm",disabled:G,onClick:()=>h?h():v.closeBuilder(),children:a("common.cancel")})]}),e.jsx("div",{className:"auto-builder-workspace",hidden:!g&&m,children:e.jsx(Kt,{nodes:Je,selected:m?F:"",onSelect:p,children:Xe})}),e.jsxs(Lt,{controller:g,open:m,title:a("automation.ux.setup"),onClose:()=>P(!1),children:[!g&&e.jsxs("button",{className:"btn ghost sm auto-inline-back",onClick:()=>P(!1),children:[e.jsx(xt,{size:14}),a("automation.ux.flow")]}),e.jsxs("div",{className:"auto-inspector","aria-label":a("automation.ux.setup"),children:[e.jsxs("div",{className:"auto-node",hidden:F!=="trigger",children:[e.jsxs("div",{className:"auto-node-head",children:[e.jsx("span",{className:"auto-ic",children:e.jsx(qe,{size:14})}),a("automation.builder.trigger")]}),e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.desc")}),e.jsx("input",{"aria-label":a("automation.builder.desc"),type:"text",value:$,maxLength:200,placeholder:a("automation.builder.descPh"),onChange:t=>T(t.target.value)})]}),!b&&e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.condType")}),e.jsxs("div",{className:"auto-seg",children:[e.jsx("button",{className:s==="timer"?"active":"",onClick:()=>y("timer"),children:a("automation.builder.condTimer")}),e.jsx("button",{className:s==="event_seen"?"active":"",onClick:()=>y("event_seen"),children:a("automation.builder.condEvent")}),e.jsx("button",{className:s==="file_chars_gte"?"active":"",onClick:()=>y("file_chars_gte"),children:a("automation.builder.condFile")}),e.jsx("button",{className:s==="db_changed"?"active":"",onClick:()=>y("db_changed"),children:a("automation.builder.condDb")}),e.jsx("button",{className:s==="manual"?"active":"",onClick:()=>y("manual"),children:a("automation.builder.condManual")})]})]}),s==="db_changed"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.dbPath")}),e.jsxs("select",{value:q,onChange:t=>{Oe(t.target.value),je([])},children:[e.jsx("option",{value:"",children:a("automation.builder.dbPickDb")}),ee.map(t=>e.jsx("option",{value:t,children:t},t)),q&&!ee.includes(q)&&e.jsx("option",{value:q,children:q})]})]}),e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.dbEvent")}),e.jsxs("div",{className:"auto-seg",children:[e.jsx("button",{className:A==="row_added"?"active":"",onClick:()=>ge("row_added"),children:a("automation.builder.dbEventRow")}),e.jsx("button",{className:A==="cell_changed"?"active":"",onClick:()=>ge("cell_changed"),children:a("automation.builder.dbEventCell")})]})]}),A==="cell_changed"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.dbColumn")}),e.jsxs("div",{className:"auto-checks",children:[(U??[]).map(t=>e.jsxs("label",{className:"auto-check",children:[e.jsx("input",{type:"checkbox",checked:V.includes(t.id),onChange:u=>fe(t.id,u.target.checked)}),t.name]},t.id)),V.filter(t=>!(U??[]).some(u=>u.id===t)).map(t=>e.jsxs("label",{className:"auto-check",children:[e.jsx("input",{type:"checkbox",checked:!0,onChange:()=>fe(t,!1)}),"(",t,")"]},t)),!U&&e.jsx("span",{className:"auto-hint",children:a("automation.builder.dbColsLoading")})]}),e.jsx("div",{className:"auto-hint",children:a("automation.builder.dbColumnsHint")})]}),e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.dbEquals")}),e.jsx("input",{type:"text",value:de,maxLength:200,placeholder:a("automation.builder.dbEqualsPh"),onChange:t=>Be(t.target.value)})]})]}),e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.dbWhere")}),L.map((t,u)=>e.jsxs("div",{className:"auto-inline",children:[e.jsxs("select",{value:t.column,onChange:r=>ce(u,{column:r.target.value}),children:[e.jsx("option",{value:"",children:a(B?"automation.builder.dbPickCol":"automation.builder.dbColsLoading")}),(B??[]).map(r=>e.jsx("option",{value:r.id,children:r.name},r.id)),t.column&&!(B??[]).some(r=>r.id===t.column)&&e.jsxs("option",{value:t.column,children:["(",t.column,")"]})]}),e.jsx("select",{value:t.op,onChange:r=>ce(u,{op:r.target.value}),children:pt.map(r=>e.jsx("option",{value:r,children:a(r==="eq"?"automation.builder.dbWhereOpEq":r==="ne"?"automation.builder.dbWhereOpNe":r==="empty"?"automation.builder.dbWhereOpEmpty":"automation.builder.dbWhereOpNotEmpty")},r))}),e.jsx("input",{type:"text",value:t.value,maxLength:200,disabled:t.op==="empty"||t.op==="notempty",placeholder:a("automation.builder.dbWhereValPh"),onChange:r=>ce(u,{value:r.target.value})}),e.jsx("button",{className:"icon-btn",title:a("common.delete"),onClick:()=>ue(r=>r.filter((l,d)=>d!==u)),children:e.jsx(xe,{size:12})})]},u)),e.jsx("button",{className:"icon-btn",title:a("automation.builder.dbWhereAdd"),disabled:L.length>=Fe,onClick:()=>ue(t=>[...t,{column:"",op:"eq",value:""}]),children:"+"}),e.jsx("div",{className:"auto-hint",children:a("automation.builder.dbWhereHint")})]}),e.jsx("div",{className:"auto-hint",children:a("automation.builder.dbHint")})]}),s==="manual"&&e.jsx("div",{className:"auto-hint",children:a("automation.builder.manualHint")}),s==="timer"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.timerMode")}),e.jsxs("div",{className:"auto-seg",children:[e.jsx("button",{className:w==="daily_at"?"active":"",onClick:()=>I("daily_at"),children:a("automation.builder.timerDaily")}),e.jsx("button",{className:w==="at"?"active":"",onClick:()=>I("at"),children:a("automation.builder.timerOnce")}),e.jsx("button",{className:w==="every"?"active":"",onClick:()=>I("every"),children:a("automation.builder.timerEvery")})]})]}),w==="daily_at"&&e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.time")}),e.jsx("input",{type:"time",value:H,onChange:t=>X(t.target.value)})]}),w==="at"&&e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.datetime")}),e.jsx("input",{type:"datetime-local",value:Y,onChange:t=>ze(t.target.value)}),e.jsx("div",{className:"auto-hint",children:a(W?"automation.builder.expiredReset":"automation.builder.onceHint")})]}),w==="every"&&e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.interval")}),e.jsxs("div",{className:"auto-inline",children:[e.jsx("input",{type:"number",value:Z,min:1,style:{width:90},onChange:t=>Ie(t.target.value)}),e.jsxs("select",{value:ve,onChange:t=>He(t.target.value),children:[e.jsx("option",{value:"m",children:a("automation.builder.unitM")}),e.jsx("option",{value:"h",children:a("automation.builder.unitH")}),e.jsx("option",{value:"d",children:a("automation.builder.unitD")})]})]}),e.jsx("div",{className:"auto-hint",children:a("automation.builder.everyHint")})]})]}),s==="event_seen"&&e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.match")}),e.jsx("input",{type:"text",list:"auto-event-catalog",value:se,maxLength:120,placeholder:a("automation.builder.matchPh"),onChange:t=>Ve(t.target.value)}),e.jsxs("datalist",{id:"auto-event-catalog",children:[vt.map(t=>e.jsx("option",{value:t},t)),gt().map(t=>e.jsx("option",{value:t.name,label:t.label},t.name))]}),e.jsx("div",{className:"auto-hint",children:a("automation.builder.matchHint")})]}),s==="file_chars_gte"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.path")}),e.jsx("input",{type:"text",value:oe,placeholder:"~/Forsion/Notes/xxx.md",onChange:t=>We(t.target.value)})]}),e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.chars")}),e.jsx("input",{type:"number",value:re,min:1,onChange:t=>Le(t.target.value)})]})]})]}),S.map((t,u)=>{const r=t.type==="tool_call"?f.find(l=>l.name===t.tool):void 0;return e.jsxs("div",{className:"auto-node",hidden:F!==String(t.key),children:[e.jsxs("div",{className:"auto-node-head",children:[e.jsx("span",{className:"auto-ic",children:he(t.type)}),a("automation.builder.stepN",{n:String(u+1)})," · ",a(`automation.step.${t.type}`),e.jsxs("span",{className:"auto-step-tools",children:[e.jsx("button",{className:"icon-btn",disabled:u===0,title:a("automation.builder.moveUp"),onClick:()=>Ee(u,-1),children:e.jsx(jt,{size:12})}),e.jsx("button",{className:"icon-btn",disabled:u===S.length-1,title:a("automation.builder.moveDown"),onClick:()=>Ee(u,1),children:e.jsx(ft,{size:12})}),e.jsx("button",{className:"icon-btn",title:a("common.delete"),onClick:()=>{te(l=>l.filter(d=>d.key!==t.key)),p("trigger")},children:e.jsx(xe,{size:12})})]})]}),t.type==="notify"&&e.jsxs(e.Fragment,{children:[e.jsx(Me,{label:a("automation.builder.notifyTitle"),value:t.title,maxLength:200,placeholder:a("automation.builder.notifyTitlePh"),onChange:l=>j(t.key,{title:l}),columns:U,hasRow:s==="db_changed"}),e.jsx(Me,{label:a("automation.builder.notifyBody"),value:t.body,multiline:!0,onChange:l=>j(t.key,{body:l}),columns:U,hasRow:s==="db_changed"}),e.jsx("div",{className:"auto-hint",children:a("automation.builder.notifyHint")})]}),t.type==="agent_run"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.runner")}),e.jsxs("select",{value:t.agentSlug,onChange:l=>j(t.key,{agentSlug:l.target.value}),children:[e.jsx("option",{value:"",children:a("automation.builder.runnerPick")}),k.filter(l=>l.slug!=="muse").map(l=>e.jsx("option",{value:l.slug,children:l.name},l.slug))]})]}),e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.prompt")}),e.jsx("textarea",{value:t.prompt,maxLength:500,placeholder:a("automation.builder.promptPh"),onChange:l=>j(t.key,{prompt:l.target.value})})]})]}),(t.type==="db_row_add"||t.type==="db_row_edit")&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.dbPath")}),e.jsxs("select",{value:t.dbPath,onChange:l=>j(t.key,{dbPath:l.target.value}),children:[e.jsx("option",{value:"",children:a("automation.builder.dbPickDb")}),ee.map(l=>e.jsx("option",{value:l,children:l},l)),t.dbPath&&!ee.includes(t.dbPath)&&e.jsx("option",{value:t.dbPath,children:t.dbPath})]})]}),t.type==="db_row_edit"&&e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.dbRowId")}),e.jsx("input",{type:"text",value:t.rowId,placeholder:a(s==="db_changed"?"automation.builder.dbRowIdPh":"automation.builder.dbRowIdRequired"),onChange:l=>j(t.key,{rowId:l.target.value})})]}),t.type==="db_row_edit"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.dbRowFrom")}),e.jsx("input",{type:"text",value:t.rowFrom,maxLength:200,placeholder:a("automation.builder.dbRowFromPh"),onChange:l=>j(t.key,{rowFrom:l.target.value})})]}),e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.dbMatch")}),e.jsxs("div",{className:"auto-inline",children:[e.jsx("input",{type:"text",value:t.matchColumn,maxLength:200,placeholder:a("automation.builder.dbCellKey"),style:{width:120},onChange:l=>j(t.key,{matchColumn:l.target.value})}),e.jsx("input",{type:"text",value:t.matchValue,maxLength:2e3,placeholder:a("automation.builder.dbMatchValPh"),onChange:l=>j(t.key,{matchValue:l.target.value})})]}),e.jsx("div",{className:"auto-hint",children:a("automation.builder.dbTargetHint")})]})]}),e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.dbCells")}),t.cells.map((l,d)=>e.jsxs("div",{className:"auto-inline",children:[e.jsx("input",{type:"text",value:l.k,placeholder:a("automation.builder.dbCellKey"),style:{width:120},onChange:M=>j(t.key,{cells:t.cells.map((N,D)=>D===d?{...N,k:M.target.value}:N)})}),e.jsx("input",{type:"text",value:l.v,placeholder:a(d===0?"automation.builder.dbCellValPh":"automation.builder.dbCellVal"),onChange:M=>j(t.key,{cells:t.cells.map((N,D)=>D===d?{...N,v:M.target.value}:N)})}),e.jsx("button",{className:"icon-btn",title:a("common.delete"),disabled:t.cells.length<=1,onClick:()=>j(t.key,{cells:t.cells.filter((M,N)=>N!==d)}),children:e.jsx(xe,{size:12})})]},d)),e.jsx("button",{className:"icon-btn",title:a("automation.builder.dbCellAdd"),onClick:()=>j(t.key,{cells:[...t.cells,{k:"",v:""}]}),children:"+"}),e.jsx("div",{className:"auto-hint",children:a("automation.builder.dbCellsHint")})]}),t.type==="db_row_add"&&e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.dbSkipIfEmpty")}),e.jsx("input",{type:"text",value:t.skipIfEmpty,maxLength:200,placeholder:a("automation.builder.dbSkipIfEmptyPh"),onChange:l=>j(t.key,{skipIfEmpty:l.target.value})})]})]}),t.type==="tool_call"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.tool")}),e.jsxs("select",{value:t.tool,onChange:l=>{const d=f.find(N=>N.name===l.target.value),M=Object.fromEntries((d?.parameters.required||[]).filter(N=>d?.parameters.properties?.[N]?.type==="boolean").map(N=>[N,"false"]));j(t.key,{tool:l.target.value,argValues:M})},children:[e.jsx("option",{value:"",children:a("automation.builder.toolPick")}),f.map(l=>e.jsxs("option",{value:l.name,children:[l.name,l.dangerous?" ⚠":""]},l.name))]}),r&&e.jsxs("div",{className:"auto-hint",children:[r.description,r.dangerous?` · ${a("automation.builder.dangerous")}`:""]})]}),r&&Object.entries(r.parameters.properties||{}).map(([l,d])=>{const M=(r.parameters.required||[]).includes(l),N=`${l}${M?" *":""}`,D=t.argValues[l]||"",J=_=>j(t.key,{argValues:{...t.argValues,[l]:_}});return e.jsxs("div",{className:"field",children:[e.jsx("label",{title:d.description||"",children:N}),d.enum?.length?e.jsxs("select",{value:D,onChange:_=>J(_.target.value),children:[e.jsx("option",{value:""}),d.enum.map(_=>e.jsx("option",{value:_,children:_},_))]}):d.type==="boolean"?e.jsxs("label",{className:"auto-check",children:[e.jsx("input",{type:"checkbox",checked:D==="true",onChange:_=>J(_.target.checked?"true":"false")})," ",d.description||""]}):d.type==="number"?e.jsx("input",{type:"number",value:D,onChange:_=>J(_.target.value)}):d.type==="string"?e.jsx("textarea",{rows:2,value:D,placeholder:d.description||"",onChange:_=>J(_.target.value)}):e.jsx("textarea",{rows:2,value:D,placeholder:`JSON — ${d.description||""}`,onChange:_=>J(_.target.value)})]},l)})]})]},t.key)}),S.length===0&&i&&s!=="manual"&&e.jsxs("div",{className:"auto-node auto-node-muse",hidden:F!=="muse",children:[e.jsxs("div",{className:"auto-node-head",children:[e.jsx("span",{className:"auto-ic",children:e.jsx(Re,{size:14})}),a("automation.builder.museFallback")]}),e.jsx("div",{className:"auto-hint",children:a("automation.builder.museFallbackHint")}),e.jsxs("div",{className:"field",children:[e.jsx("label",{children:a("automation.builder.prompt")}),e.jsx("textarea",{value:me,maxLength:500,placeholder:a("automation.builder.promptPh"),onChange:t=>Ue(t.target.value)})]})]}),e.jsxs("div",{className:"auto-node auto-review",hidden:F!=="review",children:[e.jsxs("div",{className:"auto-node-head",children:[e.jsx(be,{size:16}),a("automation.ux.review")]}),e.jsx("p",{className:"auto-hint",children:a("automation.ux.enableHint")}),e.jsxs("label",{className:"auto-check",children:[e.jsx("input",{type:"checkbox",checked:R,onChange:t=>z(t.target.checked)}),a("automation.ux.enabledLabel")]}),E.length?e.jsxs("div",{className:"auto-validation",role:"status",children:[e.jsx("strong",{children:a("automation.ux.checklist")}),E.map((t,u)=>e.jsx("button",{onClick:()=>p(t.node),children:t.text},u))]}):e.jsxs("p",{className:"auto-ready",children:[e.jsx(be,{size:14}),a("automation.ux.allReady")]}),s!=="timer"&&s!=="manual"&&e.jsxs("div",{className:"auto-guard",children:[e.jsx("label",{children:a("automation.builder.cooldown")}),e.jsx("input",{type:"number",value:K,min:Se?1:s==="db_changed"?0:.25,step:"1",onChange:t=>{Ce.current=!0,_e(t.target.value)}}),e.jsx("span",{className:"auto-hint",children:a(Se?"automation.builder.cooldownAgentHint":s==="db_changed"?"automation.builder.cooldownDbHint":"automation.builder.cooldownHint")})]})]}),e.jsxs("div",{className:"auto-node",hidden:F!=="help",children:[e.jsx("h3",{children:a("automation.ux.flow")}),e.jsx("p",{className:"auto-hint",children:a("automation.ux.canvasOrder")}),e.jsx("p",{className:"auto-hint",children:a("automation.ux.nativeHint")})]})]})]}),e.jsxs("div",{className:"auto-builder-actions auto-builder-footer",children:[e.jsx("div",{className:"auto-save-status","aria-live":"polite",children:we?e.jsx("span",{role:"alert",children:we}):E.length?e.jsxs("button",{onClick:()=>p(E[0].node),children:[E[0].text,E.length>1?` (+${E.length-1})`:""]}):e.jsx("span",{children:a("automation.ux.allReady")})}),e.jsx("button",{className:"btn ghost sm",onClick:()=>p("review"),children:a("automation.ux.review")}),e.jsx("button",{className:"btn sm",disabled:!ne||G,onClick:()=>{Ge()},children:G?"…":a(R?"automation.ux.saveEnabled":"automation.ux.savePaused")})]})]})},oa=Object.freeze(Object.defineProperty({__proto__:null,AutomationBuilder:Jt,hasUnsupportedParts:Te},Symbol.toStringTag,{value:"Module"}));export{Lt as A,Wt as B,sa as S,Jt as a,oa as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as a,u as F,d,r as la}from"./index-BM2o7PeV.js";import{p as oa,bn as ra,j4 as ia,j0 as V,j6 as ma,j8 as da,iW as ua,jR as fa,jd as q,jo as ha,j9 as pa,b as J,iX as ga,iY as xa,iZ as ba,i_ as ja,jS as j,i$ as D,ji as va,jg as Ca,jf as Na,G as wa,W as X,J as $,aq as Da,as as aa,ah as Z,fL as H,f7 as Sa,jT as ea,jU as za,jV as Q,jW as K,jX as Ma,fn as ka,jY as ya,jZ as Aa,R as Pa,j_ as qa}from"./appStore-DWP8UET9.js";import"./client-0MPbodA6.js";import{A as Fa}from"./astryxBridge-D-m4_kYt.js";import{u as O}from"./calendarNavStore-Cylfvv3s.js";import{C as Ea}from"./CapabilityMenu-SwVlZ06x.js";import{H as Ia}from"./hard-drive-BpuI5ebj.js";import{S as Ta}from"./star-BQWMXnn7.js";import{C as La}from"./CheckboxInput-BC-5a_C9.js";import{U as Ra}from"./upload-ZrOj6tXA.js";import"./nativeDownload-BYT082bY.js";import"./ipc-CxAyeo8q.js";import"./Tooltip-ZxrDqN4p.js";la({"calcfg.prevMonth":{zh:"上个月",en:"Previous month"},"calcfg.nextMonth":{zh:"下个月",en:"Next month"},"calcfg.jumpToDay":{zh:"跳转到这一天",en:"Jump to this day"},"calcfg.cloud":{zh:"云端",en:"Cloud"},"calcfg.title":{zh:"日历",en:"Calendars"},"calcfg.empty":{zh:"还没有加入日历的多维表。",en:"No databases added to the calendar yet."},"calcfg.eventColor":{zh:"事件颜色",en:"Event color"},"calcfg.fetchFailed":{zh:"拉取失败",en:"Fetch failed"},"calcfg.isDefaultAria":{zh:"{name} 是新建默认日历",en:"{name} is the default calendar for new events"},"calcfg.setDefaultAria":{zh:"将 {name} 设为新建默认日历",en:"Make {name} the default calendar for new events"},"calcfg.defaultCalendar":{zh:"新建默认日历",en:"Default calendar for new events"},"calcfg.setAsDefault":{zh:"设为新建默认日历",en:"Set as default for new events"},"calcfg.showInCalendar":{zh:"在日历中显示",en:"Show in calendar"},"calcfg.more":{zh:"更多",en:"More"},"calcfg.addCalendar":{zh:"添加日历",en:"Add calendar"},"calcfg.addDatabase":{zh:"添加多维表",en:"Add database"},"calcfg.subscribeExternal":{zh:"订阅外部日历",en:"Subscribe to external calendar"},"calcfg.subscribeHint":{zh:"粘贴 .ics 订阅地址(Google / Outlook / Apple 日历「密钥地址」都行)",en:"Paste an .ics subscription URL (Google, Outlook, or Apple Calendar's private address all work)"},"calcfg.importIcs":{zh:"导入 .ics 文件",en:"Import .ics file"},"calcfg.fileTooLarge":{zh:"文件过大(> {mb}MB)",en:"File too large (over {mb} MB)"},"calcfg.notIcs":{zh:"这不是一个 .ics 日历文件",en:"That isn't an .ics calendar file"},"calcfg.readFailed":{zh:"读取失败:{msg}",en:"Failed to read: {msg}"},"calcfg.renameCalendar":{zh:"重命名日历",en:"Rename calendar"},"calcfg.renameSub":{zh:"重命名订阅",en:"Rename subscription"},"calcfg.rename":{zh:"重命名",en:"Rename"},"calcfg.refreshNow":{zh:"立即刷新",en:"Refresh now"},"calcfg.unsubscribe":{zh:"取消订阅",en:"Unsubscribe"},"calcfg.setDefaultDb":{zh:"设为默认库",en:"Set as default"},"calcfg.openInNewTab":{zh:"在新标签打开",en:"Open in new tab"},"calcfg.columnMapping":{zh:"日历设置(列映射)",en:"Calendar settings (column mapping)"},"calcfg.removeFromCalendar":{zh:"从日历移除",en:"Remove from calendar"},"calcfg.searchDbPlaceholder":{zh:"搜索要加入日历的多维表…",en:"Search databases to add to the calendar…"},"calcfg.noCandidates":{zh:"没有含日期属性的可添加多维表",en:"No databases with a date property available to add"},"calcfg.footHint":{zh:"只有含「日期」属性的多维表会出现在这里",en:"Only databases with a Date property appear here"},"calcfg.weekStart":{zh:"一周开始于",en:"Week starts on"},"calcfg.weekStart.auto":{zh:"跟随语言({day})",en:"Default ({day})"},"calcfg.weekStart.sun":{zh:"周日",en:"Sunday"},"calcfg.weekStart.mon":{zh:"周一",en:"Monday"}});function Ha(){const{t:s}=F(),n=Q(c=>c.pref),p=Q(c=>c.setPref),i=c=>s(c===1?"calcfg.weekStart.mon":"calcfg.weekStart.sun"),u=[{value:"auto",label:s("calcfg.weekStart.auto",{day:i(qa())})},{value:0,label:i(0)},{value:1,label:i(1)}],f=u.find(c=>c.value===n)??u[0];return a.jsxs("div",{className:"amx-calcfg-weekstart","data-week-start":n,children:[a.jsx("span",{className:"amx-calcfg-weekstart-label",children:s("calcfg.weekStart")}),a.jsxs(Ea,{label:`${s("calcfg.weekStart")} · ${f.label}`,className:"capability-menu-trigger amx-calcfg-weekstart-btn",selection:!0,items:u.map(c=>({id:`week-start:${c.value}`,label:c.label,selected:c.value===n,onSelect:()=>p(c.value)})),children:[a.jsx("span",{children:f.label}),a.jsx(aa,{size:13})]})]})}function se(){return a.jsx(Fa,{children:a.jsxs("div",{className:"amx-calside",children:[a.jsx(Oa,{}),a.jsx(Wa,{})]})})}const W=s=>new Date(s.getFullYear(),s.getMonth(),1);function Oa(){const{t:s}=F(),n=oa(t=>(t.mainTabs,((t.api?ra(t.api):null)?.params??{}).__type==="calendar")),p=O(t=>t.visibleStart),i=O(t=>t.visibleEnd),u=O(t=>t.requestJump),f=d.useMemo(()=>ia(new Date),[]),[c,h]=d.useState(()=>W(f));d.useEffect(()=>{if(n&&p&&i){const t=V(p),b=ma(t,Math.floor(da(V(i),t)/2));h(W(b))}},[n,p,i]);const v=ua(),x=d.useMemo(()=>fa(c),[c,v]),C=q(f,!0),o=t=>{if(!n||!p||!i)return!1;const b=q(t,!0);return b>=p&&b<=i},N=t=>{h(W(t)),n&&u(q(t,!0))};return a.jsxs("div",{className:"amx-mini",children:[a.jsxs("div",{className:"amx-mini-head",children:[a.jsx("button",{className:"amx-mini-nav",onClick:()=>h(new Date(c.getFullYear(),c.getMonth()-1,1)),"aria-label":s("calcfg.prevMonth"),children:"‹"}),a.jsx("span",{className:"amx-mini-title",children:ha(c)}),a.jsx("button",{className:"amx-mini-nav",onClick:()=>h(new Date(c.getFullYear(),c.getMonth()+1,1)),"aria-label":s("calcfg.nextMonth"),children:"›"})]}),a.jsx("div",{className:"amx-mini-dow",children:pa().map(t=>a.jsx("span",{children:t},t))}),a.jsx("div",{className:"amx-mini-grid",children:x.map(t=>{const b=t.getMonth()!==c.getMonth(),E=q(t,!0)===C;return a.jsx("button",{className:`amx-mini-day${b?" out":""}${E?" today":""}${o(t)?" band":""}`,onClick:()=>N(t),title:n?s("calcfg.jumpToDay"):void 0,children:t.getDate()},+t)})})]})}function Wa(){const{t:s}=F(),n=J(e=>e.vaultRoot)??"",i=J(e=>e.vaultSide)==="cloud"?s("calcfg.cloud"):n.split(/[\\/]/).pop()||n,u=ga(),f=xa(),c=ba(),h=ja(),v=j(e=>e.errors),x=D(e=>e.byVault),C=D(e=>e.setColor),o=D(e=>e.toggleHidden),N=D(e=>e.setDefault),t=D(e=>e.addMember),b=D(e=>e.removeMember),[E,I]=d.useState(!1),[T,S]=d.useState(null),[B,k]=d.useState(null),[m,g]=d.useState(null),[z,y]=d.useState(null),sa=d.useMemo(()=>new Set(u.map(e=>e.db.path)),[u]),Y=[...u.map(e=>({db:e.db})),...f.map(e=>({db:e,readonly:!0,kind:"agent"})),...c.map(e=>({db:e,readonly:!0,kind:"other"})),...h.map(e=>({db:e,readonly:!0,kind:"ics"}))],_=va(n,x),ta=e=>{g(null),H(s("calcfg.renameCalendar"),e.name).then(r=>{const l=r?.trim();l&&l!==e.name&&ka.getState().mutate(e.path,A=>({...A,name:l}))})},M=e=>e.slice(6),G=e=>v[M(e)],na=()=>{H(s("calcfg.subscribeExternal"),"",{label:s("calcfg.subscribeHint")}).then(e=>{const r=e?.trim();r&&j.getState().add(r)})},ca=()=>{const e=document.createElement("input");e.type="file",e.accept=".ics,text/calendar",e.onchange=()=>{const r=e.files?.[0];if(r){if(r.size>K){k(s("calcfg.fileTooLarge",{mb:K/1024/1024}));return}k(null),r.text().then(l=>{j.getState().importText(Ma(l)||r.name.replace(/\.ics$/i,""),l)||k(s("calcfg.notIcs"))}).catch(l=>k(s("calcfg.readFailed",{msg:l?.message||String(l)})))}},e.click()};return a.jsxs("div",{className:"amx-calcfg",children:[a.jsx("div",{className:"amx-calcfg-head",children:s("calcfg.title")}),Y.length===0&&a.jsx("div",{className:"amx-calcfg-empty",children:s("calcfg.empty")}),a.jsx("div",{className:"amx-calcfg-list",children:Y.map(({db:e,readonly:r,kind:l},A)=>{const L=Ca(n,x,e.path,A),R=!Na(n,x,e.path),P=_?_===e.path:A===0;return a.jsxs("div",{className:"amx-calcfg-row",children:[a.jsx("span",{className:"amx-calcfg-type","aria-hidden":"true",children:l==="agent"?a.jsx(wa,{size:14}):l==="ics"?a.jsx(X,{size:14}):l==="other"?a.jsx(Ia,{size:14}):a.jsx($,{size:14})}),a.jsx("span",{className:"amx-calcfg-swatch",style:{background:R?L:"transparent",borderColor:L},children:a.jsx("input",{type:"color",value:L,onChange:w=>C(n,e.path,w.target.value),title:s("calcfg.eventColor")})}),a.jsxs("span",{className:`amx-calcfg-name${R?"":" off"}`,title:G(e.path)||e.name,children:[e.name,l==="ics"&&G(e.path)&&a.jsxs("span",{className:"amx-cal-vault",children:[" · ",s("calcfg.fetchFailed")]}),(()=>{const w=l==="agent"?"":l==="other"?e.vaultLabel||"":i;return w?a.jsxs("span",{className:"amx-cal-vault",children:[" · ",w]}):null})()]}),!r&&a.jsx("button",{className:`amx-calcfg-def${P?" on":""}`,"aria-label":P?s("calcfg.isDefaultAria",{name:e.name}):s("calcfg.setDefaultAria",{name:e.name}),title:s(P?"calcfg.defaultCalendar":"calcfg.setAsDefault"),onClick:()=>N(n,e.path),children:a.jsx(Ta,{size:13,fill:P?"currentColor":"none"})}),a.jsx(La,{label:s("calcfg.showInCalendar"),isLabelHidden:!0,size:"sm",value:R,onChange:()=>o(n,e.path)}),(!r||l==="ics")&&a.jsx("button",{className:"amx-calcfg-more",title:s("calcfg.more"),onClick:w=>{const U=w.currentTarget.getBoundingClientRect();g({db:e,ics:l==="ics",x:Math.min(U.left,window.innerWidth-180),y:U.bottom+4})},children:"⋯"})]},e.path)})}),a.jsxs("button",{className:"amx-calcfg-add amx-calcfg-add-main",onClick:e=>{const r=e.currentTarget.getBoundingClientRect();S({x:Math.max(12,r.left),y:r.bottom+4})},children:[a.jsx(Da,{size:14})," ",s("calcfg.addCalendar")," ",a.jsx(aa,{size:13})]}),B&&a.jsx("div",{className:"amx-calcfg-hint",style:{color:"var(--danger)"},children:B}),a.jsx(Ha,{}),T&&a.jsx("div",{className:"amx-db-popwrap",onMouseDown:()=>S(null),children:a.jsxs(Z,{className:"amx-db-pop amx-calcfg-addmenu",x:T.x,y:T.y,onMouseDown:e=>e.stopPropagation(),children:[a.jsxs("button",{className:"amx-db-opt",onClick:()=>{S(null),I(!0)},children:[a.jsx($,{size:14})," ",s("calcfg.addDatabase")]}),a.jsxs("button",{className:"amx-db-opt",onClick:()=>{S(null),na()},children:[a.jsx(X,{size:14})," ",s("calcfg.subscribeExternal")]}),a.jsxs("button",{className:"amx-db-opt",onClick:()=>{S(null),ca()},children:[a.jsx(Ra,{size:14})," ",s("calcfg.importIcs")]})]})}),m&&a.jsx("div",{className:"amx-db-popwrap",onMouseDown:()=>g(null),children:a.jsx(Z,{className:"amx-db-pop amx-calcfg-menu",x:m.x,y:m.y,onMouseDown:e=>e.stopPropagation(),children:m.ics?a.jsxs(a.Fragment,{children:[!!j.getState().subs.find(e=>e.id===M(m.db.path))?.url&&a.jsx("button",{className:"amx-db-opt",onClick:()=>{j.getState().refresh(M(m.db.path)),g(null)},children:s("calcfg.refreshNow")}),a.jsx("button",{className:"amx-db-opt",onClick:()=>{const e=M(m.db.path),r=m.db.name;g(null),H(s("calcfg.renameSub"),r).then(l=>{l?.trim()&&j.getState().rename(e,l.trim())})},children:s("calcfg.rename")}),a.jsx("button",{className:"amx-db-opt amx-db-opt-danger",onClick:()=>{j.getState().remove(M(m.db.path)),g(null)},children:s("calcfg.unsubscribe")})]}):a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"amx-db-opt",onClick:()=>ta(m.db),children:s("calcfg.rename")}),a.jsx("button",{className:"amx-db-opt",onClick:()=>{N(n,m.db.path),g(null)},children:s("calcfg.setDefaultDb")}),a.jsx("button",{className:"amx-db-opt",onClick:()=>{Sa(m.db.path),g(null)},children:s("calcfg.openInNewTab")}),a.jsx("button",{className:"amx-db-opt",onClick:()=>{y(m.db),g(null)},children:s("calcfg.columnMapping")}),a.jsx("button",{className:"amx-db-opt amx-db-opt-danger",onClick:()=>{b(n,m.db.path),g(null)},children:s("calcfg.removeFromCalendar")})]})})}),E&&a.jsx($a,{memberPaths:sa,onClose:()=>I(!1),onAdd:(e,r,l)=>{t(n,e.path,r,l),I(!1)}}),z&&a.jsx("div",{className:"amx-db-popwrap",onMouseDown:()=>y(null),children:a.jsx("div",{className:"amx-db-pop amx-calpick-pop",onMouseDown:e=>e.stopPropagation(),children:a.jsx(ea,{dbName:z.name,columns:z.columns,initial:za(n,x,z.path),onCancel:()=>y(null),onConfirm:(e,r)=>{t(n,z.path,e,r),y(null)}})})})]})}function $a({memberPaths:s,onClose:n,onAdd:p}){const{t:i}=F(),u=ya(),[f,c]=d.useState(""),[h,v]=d.useState(null),x=d.useMemo(()=>u.filter(o=>!s.has(o.path)&&o.columns.some(Aa)),[u,s]),C=f?x.filter(o=>o.name.toLowerCase().includes(f.toLowerCase())):x;return a.jsx("div",{className:"amx-qf-scrim",onMouseDown:n,children:h?a.jsx("div",{className:"amx-qf-card",onMouseDown:o=>o.stopPropagation(),children:a.jsx(ea,{dbName:h.name,columns:h.columns,onCancel:()=>v(null),onConfirm:(o,N)=>p(h,o,N)})}):a.jsxs("div",{className:"amx-qf",onMouseDown:o=>o.stopPropagation(),children:[a.jsxs("div",{className:"amx-qf-head",children:[a.jsx(Pa,{size:16,className:"amx-qf-searchicon"}),a.jsx("input",{autoFocus:!0,className:"amx-qf-input",placeholder:i("calcfg.searchDbPlaceholder"),value:f,onChange:o=>c(o.target.value)})]}),a.jsxs("div",{className:"amx-qf-list",children:[C.map(o=>a.jsxs("button",{className:"amx-qf-row",onClick:()=>v(o),children:[a.jsx("span",{className:"amx-qf-icon",children:a.jsx($,{size:15})}),a.jsx("span",{className:"amx-qf-title",children:o.name||o.path}),a.jsx("span",{className:"amx-qf-sub",children:o.path.replace(/\\/g,"/").split("/").slice(0,-1).join("/")||"/"})]},o.path)),C.length===0&&a.jsx("div",{className:"amx-qf-empty",children:i("calcfg.noCandidates")})]}),a.jsx("div",{className:"amx-qf-foot",children:i("calcfg.footHint")})]})})}export{se as CalendarConfigView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as n,j as s,t as we,r as Je,u as ze}from"./index-BM2o7PeV.js";import{F as xt,iW as ft,iX as mt,iY as ht,iZ as pt,i_ as yt,u as gt,b as kt,i$ as bt,j0 as me,j1 as vt,j2 as G,j3 as be,j4 as Q,j5 as wt,c5 as jt,aJ as $t,j6 as ae,j7 as Te,j8 as $e,j9 as Mt,ja as Qe,jb as et,jc as fe,ag as xe,jd as J,je as Ct,jf as zt,jg as Et,jh as Dt,ji as Tt,jj as St,jk as Nt,jl as qe,jm as Rt,jn as We,jo as At,jp as He,jq as It,jr as tt}from"./appStore-DWP8UET9.js";import"./client-0MPbodA6.js";import{u as Lt,p as ee,m as he,t as pe,S as Pt,a as qt,b as Wt,r as Ht,c as Kt,I as Ft,l as Ot,A as Vt}from"./astryxBridge-D-m4_kYt.js";import{u as te,H as Bt}from"./calendarNavStore-Cylfvv3s.js";import{u as Gt}from"./mdMarkStore-DQHDjG7s.js";import{E as Yt,d as Xt}from"./EventCard-B_ndpqH_.js";import{Z as Ut,a as _t}from"./zoom-in-lbTgzdQP.js";import{R as Zt}from"./rotate-ccw-BvipPIjC.js";import"./nativeDownload-BYT082bY.js";import"./ipc-CxAyeo8q.js";import"./mdMarks-DbIcRa0O.js";const Jt=[["path",{d:"M16 19h6",key:"xwg31i"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M19 16v6",key:"tddt3s"}],["path",{d:"M21 12.598V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8.5",key:"1glfrc"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}]],Qt=xt("calendar-plus",Jt);function nt({children:e,as:t="span",ref:a,...u}){return n.createElement(t,{ref:a,...u,className:"x10l6tqk x1i1rx1s xjm9jq1 xkdpibf x1717udv xb3r6kr xzpqnlu xuxw1ft xng3xce x13vifvy x1o0tod x47corl x87ps6o"},e)}nt.displayName="VisuallyHidden";const en="data-astryx-edge-comp",Re=n.createContext(null);Re.displayName="SizeContext";function tn(e,t="md"){const a=n.use(Re);return e??a??t}Re.Provider;const st=n.createContext(null);st.displayName="ButtonGroupContext";function nn(){return n.use(st)}const rt=n.createContext(null);rt.displayName="LinkContext";function sn(e){function t({href:a,ref:u,...x}){return n.createElement(e,{ref:u,href:a,to:a,...x})}return t.displayName=`LinkWithTo(${typeof e=="string"?e:e.displayName||e.name||"Component"})`,t}function at(e){const t=n.use(rt),a=e??t?.component??"a";return n.useMemo(()=>a==="a"?"a":sn(a),[a])}const re={base:{kVAEAm:"x1n2onr6",k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kOIVth:"x1txdalj",k8WAf4:"xce4md1",kg3NbH:"xrrkdod",kMzoRj:"xc342km",ksu8eU:"xng3xce",kaIpWk:"x1jxw6zd",kMv6JI:"xjb2p0i",kGuDYH:"xcr08ib",kLWn49:"x1kq96og",k63SB2:"x1e4wzip",khDVqt:"xuxw1ft",kkrTdU:"x1ypdohk",k1ekBW:"xrafxwg",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",$$css:!0},pressable:{k3aq6I:"x3oybdh xk4oym4",$$css:!0},disabled:{kkrTdU:"x1h6gzvc",kSiTet:"xbyyjgo",kKwaWg:"x18o3ruo",k3aq6I:"x1c071of x1pdlv7q",$$css:!0},ariaDisabled:{kKwaWg:"x18o3ruo x8o3jvd xuqm82a",$$css:!0},iconOnly:{"--button-icon-only-aspect":"x1v15ycx",kOBAk4:"xioom0i",kg3NbH:"xnjsko4",k8WAf4:"xt970qd",$$css:!0},iconWrapper:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kmuXW:"x2lah0s",$$css:!0},contentWrapper:{k1xSpc:"xjp7ctv",$$css:!0},link:{kybGjl:"x1hl2dhg",$$css:!0}},rn={sm:{kZKoxP:"x6k0iem",$$css:!0},md:{kZKoxP:"x1ueg155",$$css:!0},lg:{kZKoxP:"xssyfek",$$css:!0}},an={sm:{kzqmXN:"x1kky2od",kZKoxP:"xlup9mm",kGuDYH:"x1j61zf2",$$css:!0},md:{kzqmXN:"x1kky2od",kZKoxP:"xlup9mm",kGuDYH:"x1j61zf2",$$css:!0},lg:{kzqmXN:"xw4jnvo",kZKoxP:"x1qx5ct2",kGuDYH:"xwsyq91",$$css:!0}},on={primary:{kWkggS:"x1ewilqj",kMwMTN:"x17wrial",kKwaWg:"x1ilzqfv xq8i9tn",kI3sdo:"x17nn4n9","--button-focus-offset":"xkzo27j",kInvED:"x1wfwxd8 x13aywxo",$$css:!0},secondary:{kWkggS:"x17x4s8c",kMwMTN:"x1tgivj0",kKwaWg:"x1ilzqfv xq8i9tn",kI3sdo:"x17nn4n9","--button-focus-offset":"xkzo27j",kInvED:"x1wfwxd8 x13aywxo",$$css:!0},ghost:{kWkggS:"xjbqb8w",kMwMTN:"x1tgivj0",kKwaWg:"x1ilzqfv xq8i9tn",kI3sdo:"x17nn4n9","--button-focus-offset":"xkzo27j",kInvED:"x1wfwxd8 x13aywxo",$$css:!0},destructive:{kWkggS:"x1pjz0fi",kMwMTN:"x1m024r3",kKwaWg:"x1ilzqfv xq8i9tn",kI3sdo:"x1p73he7","--button-focus-offset":"xkzo27j",kInvED:"x1wfwxd8 x13aywxo",$$css:!0}},Ke={hiddenContent:{kMwMTN:"x19co3pv",$$css:!0},hiddenContentDelayed:{kKVMdj:"x1ffowhz",k44tkh:"xjlvqhv",kWV6AL:"x10e4vud",kKxzle:"x17yabm6 x14q22ui",$$css:!0}},je={horizontal:{krdFHd:"x15mokao x8eehn2",kVL7Gh:"xbiv7yw x1xrp5p4",kfmiAY:"x1ga7v0g x11xp8u1",kT0f0o:"x16uus16 x747jw7",k2ei4v:"xgbv0en x1pjv70x",kVhnKS:"x1t7ytsu xyf0ibl",kGJrpR:"x1j92z86",$$css:!0},vertical:{krdFHd:"x15mokao x8eehn2",kfmiAY:"x1ga7v0g x2qxyot",kVL7Gh:"xbiv7yw x1yp72r9",kT0f0o:"x16uus16 x747jw7",kEafiO:"x11xkdxz x1g31smg",kPef9Z:"x13fuv20 x1d9v4yf",kLZC3w:"x1pc3f07",$$css:!0},onSolidHorizontal:{kGJrpR:"xrvmtm5",$$css:!0},onSolidVertical:{kLZC3w:"x11npmm7",$$css:!0}};function ce({label:e,variant:t="secondary",size:a,type:u="button",isDisabled:x=!1,isLoading:z=!1,isInterruptible:$=!1,clickAction:y,icon:M,isIconOnly:l=!1,children:c,endContent:g,tooltip:v,href:T,as:D,target:C,rel:p,xstyle:K,className:I,style:A,ref:S,...P}){const h=tn(a,"md"),E=nn(),[N,i]=n.useTransition(),f=n.useRef(!1),k=z||N,w=N||$,q=E?.isDisabled??!1,W=x||q||k&&!$,X=at(D),F=T!=null&&!W,V=v!=null&&W,d=Lt({placement:"above",isEnabled:v!=null}),R=U=>{if(W||f.current&&!$){U.preventDefault();return}P.onClick?.(U),y&&!U.defaultPrevented&&(f.current=!0,i(async()=>{try{await y(U)}finally{f.current=!1}}))},H=V?U=>{U.key==="Enter"||U.key===" "?U.preventDefault():P.onKeyDown?.(U)}:void 0,O=t==="ghost"?{[en]:""}:null,o=ee(re.base,rn[h],on[t],l&&re.iconOnly,W&&re.disabled,V&&re.ariaDisabled,F&&re.link,!E&&re.pressable,E&&(E.orientation==="horizontal"?je.horizontal:je.vertical),E&&(t==="primary"||t==="destructive")&&(E.orientation==="horizontal"?je.onSolidHorizontal:je.onSolidVertical),K),r=he(pe("button",{variant:t,size:h}),o,I,A),m=s.jsxs(s.Fragment,{children:[k&&s.jsx("span",{...{0:{className:"x10l6tqk x13vifvy xu96u03 x3m8u43 x1ey2m1c xrvj5dj x1ku5rj1"},1:{className:"x10l6tqk x13vifvy xu96u03 x3m8u43 x1ey2m1c xrvj5dj x1ku5rj1 xqcmdr3 xb2rp9n xskzprw x17yabm6 x14q22ui"}}[!!w<<0],"aria-hidden":"true",children:s.jsx(Pt,{size:"sm",shade:"inherit"})}),s.jsxs("span",{...ee(re.contentWrapper,k&&(w?Ke.hiddenContentDelayed:Ke.hiddenContent)),"aria-hidden":k||void 0,children:[M&&s.jsx("span",{...ee(re.iconWrapper,an[h]),children:M}),l?null:s.jsx("span",{className:"xb3r6kr xlyipyv xeuugli",children:c??e}),!l&&g&&s.jsx("span",{className:"x3nfvp2 x6s0dn4 x1heor9g",children:g})]}),s.jsx(nt,{role:"status","aria-live":"polite",children:k?"Loading":""})]}),b=l&&e!==""||k&&!l||c!=null&&c!==e?{"aria-label":e}:null,L=v!=null?{"aria-describedby":[P["aria-describedby"],d.describedBy].filter(Boolean).join(" ")||void 0}:null,B=qt(S,v!=null?d.ref:void 0);let ne;return F?ne=s.jsx(X,{ref:B,href:T,target:C,rel:p,...r,...P,...b,...L,...O,onClick:R,children:m}):ne=s.jsx("button",{ref:B,type:u,disabled:V?void 0:W,...r,...P,...b,...L,...O,"aria-busy":k||void 0,"aria-disabled":V||void 0,onClick:R,...H?{onKeyDown:H}:null,children:m}),v?s.jsxs(s.Fragment,{children:[ne,d.renderTooltip(v)]}):ne}ce.displayName="Button";const ln='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), [contenteditable]:not([contenteditable="false"]), audio[controls], video[controls], iframe, details > summary:first-child',ve=[];function cn(e){ve.push(e)}function un(e){const t=ve.lastIndexOf(e);t!==-1&&ve.splice(t,1)}function dn(e){return ve[ve.length-1]===e}function xn(e){return e.isComposing===!0||e.keyCode===229}function fn(e){if(e.hasAttribute("inert")||e.closest("[inert]")||e.hidden||e.closest("[hidden]"))return!1;if(typeof window<"u"&&window.getComputedStyle){const t=window.getComputedStyle(e);if(t.visibility==="hidden"||t.display==="none")return!1}return!0}function Ae(e){return Array.from(e.querySelectorAll(ln)).filter(fn)}function ot(e){try{e.focus()}catch{}return document.activeElement===e}function Fe(e){const t=Ae(e);for(const a of t)if(ot(a))return!0;return!1}function mn(e){const t=Ae(e);for(let a=t.length-1;a>=0;a--)if(ot(t[a]))return!0;return!1}function hn(e){const{isActive:t,onEscape:a}=e,u=n.useRef(null),x=n.useRef(null),z=n.useRef(!1),$=n.useCallback(()=>{u.current&&Fe(u.current)},[]);return n.useEffect(()=>{if(!t)return;const y=M=>{const l=u.current;if(!l)return;const c=M.target;l.contains(c)?x.current=c:z.current&&(Fe(l),x.current===document.activeElement&&mn(l),x.current=document.activeElement),z.current=!1};return document.addEventListener("focus",y,!0),()=>{document.removeEventListener("focus",y,!0)}},[t]),n.useEffect(()=>{if(!t)return;const y=()=>{a?.()};a&&cn(y);const M=l=>{const c=u.current;if(c){if(l.key==="Escape"&&a){if(l.defaultPrevented||xn(l)||!dn(y))return;l.preventDefault(),l.stopPropagation(),a();return}if(l.key==="Tab"){z.current=!0;const g=Ae(c);if(g.length===0)return;const v=g[0],T=g[g.length-1];l.shiftKey?document.activeElement===v&&(l.preventDefault(),T.focus()):document.activeElement===T&&(l.preventDefault(),v.focus())}}};return document.addEventListener("keydown",M),()=>{document.removeEventListener("keydown",M),a&&un(y)}},[t,a]),{containerRef:u,focusFirst:$}}const Oe={surface:{kWkggS:"x1prclbq",kaIpWk:"x1hviunn",kGVxlE:"x1i5ehqx",$$css:!0},contentWrapper:{kVAEAm:"x1n2onr6",$$css:!0}};function pn(e={}){const{onShow:t,onHide:a,xstyle:u,hasLightDismiss:x=!0,hasEscapeDismiss:z=!0,hasAutoFocus:$=!0,hasSurface:y=!0,hasCloseButton:M=!0,closeButtonLabel:l="Close popover",dialogLabel:c,role:g="dialog",isModal:v=!0}=e,T=n.useRef(null),D=n.useRef(!1),C=Wt({mode:"context",lightDismiss:x,onShow:t,onHide:a}),{containerRef:p,focusFirst:K}=hn({isActive:C.isOpen,onEscape:z||x?C.hide:void 0});n.useEffect(()=>{C.isOpen&&$&&!D.current&&requestAnimationFrame(()=>{K()}),C.isOpen||(D.current=!1)},[C.isOpen,$,K]);const I=n.useCallback(N=>{T.current=N,C.ref(N)},[C]),A=n.useCallback(N=>{D.current=N?.skipAutoFocus??!1,C.show()},[C]),S=n.useCallback(()=>{C.isOpen?C.hide():A()},[C,A]),P={"aria-haspopup":g==="dialog"?"dialog":"true","aria-expanded":C.isOpen,"aria-controls":C.id},h=n.useRef(!1);n.useEffect(()=>{g==="dialog"&&!c&&!h.current&&(h.current=!0,console.warn('usePopover: role="dialog" without a `dialogLabel` renders an unnamed dialog. Pass `dialogLabel`, or use `role: "none"` for listbox/menu popups whose content already carries its own role.'))},[g,c]);const E=n.useCallback((N,i)=>C.render(s.jsxs("div",{ref:p,role:g==="dialog"?"dialog":void 0,"aria-modal":g==="dialog"&&v?!0:void 0,"aria-label":g==="dialog"?c:void 0,...ee(Oe.contentWrapper,y&&Oe.surface,u),children:[N,M&&s.jsx("div",{className:"x10l6tqk x1ey2m1c x1nrll8i x31h1t8 x1vjfegm x1i1rx1s x10okhzq xjm9jq1 x132qfvm xb3r6kr x1dordxg x1hyvwdk x10wafsz x47corl xbt4iw xexx8yu x1kw28su",children:s.jsx(ce,{variant:"secondary",label:l,onClick:C.hide})})]}),{...i,xstyle:i?.xstyle}),[C,M,y,l,p,c,g,v,u]);return{triggerRef:I,contentRef:p,anchorId:C.anchorId,show:A,hide:C.hide,toggle:S,isOpen:C.isOpen,id:C.id,render:E,triggerProps:P}}const Ve={horizontal:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kzqmXN:"xh8yej3",$$css:!0},vertical:{k1xSpc:"x3nfvp2",kXwgrk:"xdt5ytf",kGNEyG:"x6s0dn4",kZKoxP:"x5yr21d",$$css:!0}},de={horizontalLine:{kZKoxP:"xsyqizj",kzQI83:"x1iyjqo2",kmuXW:"xs83m0k",$$css:!0},verticalLine:{kzqmXN:"xjk4fl7",kzQI83:"x1iyjqo2",kmuXW:"xs83m0k",$$css:!0},subtle:{kWkggS:"x1m4xfpy",$$css:!0},strong:{kWkggS:"x7njt3n",$$css:!0}},Be={horizontal:{keTefX:"xojxgvx",k71WvV:"x1fcf3bl",kzqmXN:"xx6qvi6",$$css:!0},vertical:{keoZOQ:"x1sa9bsh",k1K539:"x6h7pi7",kZKoxP:"x12qplqi",$$css:!0}};function lt({orientation:e="horizontal",label:t,variant:a="subtle",isFullBleed:u=!1,xstyle:x,className:z,style:$,ref:y,...M}){const l=e==="horizontal";return s.jsxs("div",{ref:y,role:"separator","aria-orientation":e,...he(pe("divider",{variant:a,orientation:e}),ee(l?Ve.horizontal:Ve.vertical,u&&(l?Be.horizontal:Be.vertical),x),z,$),...M,children:[s.jsx("div",{...ee(l?de.horizontalLine:de.verticalLine,de[a])}),t&&s.jsx("div",{...{0:{className:"x2lah0s xrrkdod x141an7d x1ltkj2j xv1l7n4"},1:{className:"x2lah0s x141an7d x1ltkj2j xv1l7n4 xnjsko4 x8o8v82"}}[!l<<0],children:t}),t&&s.jsx("div",{...ee(l?de.horizontalLine:de.verticalLine,de[a])})]})}lt.displayName="Divider";const yn=["noopener","noreferrer"];function gn(e,t){if(e!=="_blank")return{target:e,rel:t};const a=t?.split(/\s+/).filter(Boolean)??[];for(const u of yn)a.includes(u)||a.push(u);return{target:e,rel:a.join(" ")}}const _={root:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x1txdalj",kg3NbH:"xf314gf",kVAEAm:"x1n2onr6",kB7OPa:"x9f619",k9WMMc:"x1yc453h",kaIpWk:"xh6dtrn",$$css:!0},alignStart:{kGNEyG:"x1cy8zhl",$$css:!0},interactive:{kkrTdU:"x1ypdohk",k1ekBW:"x15406qy",kIyJzY:"xkvfbh3",kAMwcw:"xlr8y92",kWkggS:"xjbqb8w xe9uy6x xyxi2l3",$$css:!0},focusVisibleOutline:{kI3sdo:"x1a2a7pz x1irc7jg",kInvED:"x1wfwxd8 xdjuwb3",$$css:!0},highlighted:{kWkggS:"x1lmrjuc",$$css:!0},selected:{kWkggS:"xgcxg3y",$$css:!0},disabled:{kkrTdU:"x1h6gzvc",kfzvcC:"x47corl",$$css:!0},label:{kMwMTN:"x1tgivj0",kGuDYH:"xjm74w1",kLWn49:"xw6l6zx",$$css:!0},labelSingleTruncate:{kVQacm:"xb3r6kr",kg5iWk:"xlyipyv",khDVqt:"xuxw1ft",$$css:!0},labelMultiTruncate:{kVQacm:"xb3r6kr",k1xSpc:"x104kibb",kgKLqz:"x1ua5tub",$$css:!0},description:{kMwMTN:"xv1l7n4",kGuDYH:"x141an7d",kLWn49:"x1ltkj2j",$$css:!0},descriptionSingleTruncate:{kVQacm:"xb3r6kr",kg5iWk:"xlyipyv",khDVqt:"xuxw1ft",$$css:!0},descriptionMultiTruncate:{kVQacm:"xb3r6kr",k1xSpc:"x104kibb",kgKLqz:"x1ua5tub",$$css:!0}},Ge={lineClamp:e=>[{kJFfOR:e!=null?"x1yhjpo9":e,$$css:!0},{"--x-WebkitLineClamp":e??void 0}]},kn={compact:{k8WAf4:"xu0wf1k",$$css:!0},balanced:{k8WAf4:"xce4md1",$$css:!0},spacious:{k8WAf4:"x8o8v82",kg3NbH:"xrrkdod",$$css:!0}};function ct({as:e="div",marker:t,startContent:a,label:u,description:x,endContent:z,align:$="center",density:y="balanced",labelLines:M,descriptionLines:l,onClick:c,href:g,target:v,rel:T,isHighlighted:D=!1,isSelected:C=!1,isDisabled:p=!1,xstyle:K,className:I,style:A,ref:S,role:P,...h}){const E=at(),N=c!=null||g!=null,{target:i,rel:f}=gn(v,T),k=P!=null,w=typeof u=="string",q=typeof x=="string",W=M!=null?M===1?_.labelSingleTruncate:_.labelMultiTruncate:w?_.labelSingleTruncate:null,X=l!=null?l===1?_.descriptionSingleTruncate:_.descriptionMultiTruncate:q?_.descriptionSingleTruncate:null,F=s.jsxs(s.Fragment,{children:[s.jsx("span",{...ee(_.label,W,M!=null&&M>1&&Ge.lineClamp(M)),children:u}),x!=null&&s.jsx("span",{...ee(_.description,X,l!=null&&l>1&&Ge.lineClamp(l)),children:x})]}),V=R=>{p||R.target.closest("button, a, input, select, textarea")||c?.(R)},d=s.jsxs(s.Fragment,{children:[t,a!=null&&s.jsx("span",{className:"x3psx0u x78zum5",children:a}),k?s.jsx("span",{...{0:{className:"x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h"},1:{className:"x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h xbyyjgo"}}[!!p<<0],children:F}):g!=null?s.jsx(E,{href:g,target:i,rel:f,"aria-disabled":p||void 0,tabIndex:p?-1:void 0,...{0:{className:"xmper1u xln7xf2 x1heor9g x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h x1hl2dhg x1a2a7pz"},1:{className:"xmper1u xln7xf2 x1heor9g x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h x1hl2dhg x1a2a7pz xbyyjgo"}}[!!p<<0],children:F}):c!=null?s.jsx("button",{type:"button",onClick:c,disabled:p,...{0:{className:"xmper1u xln7xf2 x1heor9g x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h x1a2a7pz"},1:{className:"xmper1u xln7xf2 x1heor9g x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h x1a2a7pz xbyyjgo"}}[!!p<<0],children:F}):s.jsx("span",{...{0:{className:"x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h"},1:{className:"x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h xbyyjgo"}}[!!p<<0],children:F}),z!=null&&s.jsx("span",{...{0:{className:"x3psx0u x78zum5 xvc5jky"},1:{className:"x3psx0u x78zum5 xvc5jky xbyyjgo"}}[!!p<<0],children:z})]});return s.jsx(e,{ref:S,"aria-selected":C||void 0,"aria-disabled":p||void 0,...h,...he(pe("item",{density:y,align:$}),ee(_.root,kn[y],$==="start"&&_.alignStart,N&&_.interactive,N&&_.focusVisibleOutline,D&&_.highlighted,C&&_.selected,p&&!k&&_.disabled,K),I,A),role:P,onClick:k?c:N?V:void 0,children:d})}ct.displayName="Item";const Ie=n.createContext(null);Ie.displayName="DropdownMenuContext";function bn(){return n.use(Ie)}const Ye={root:{kB7OPa:"x9f619",kzqmXN:"xh8yej3",k8WAf4:"xce4md1",kg3NbH:"xf314gf",kaIpWk:"x1ws5lxm",kMv6JI:"x9ynric",kGuDYH:"xcr08ib",kMwMTN:"x1tgivj0",kWkggS:"xjbqb8w x1c52tdz x1uwx2nv",kkrTdU:"x1ypdohk",k9WMMc:"xdpxx8g",kI3sdo:"x1a2a7pz",$$css:!0},disabled:{kSiTet:"xbyyjgo",kkrTdU:"x1h6gzvc",$$css:!0}},vn={sm:{k8WAf4:"xu0wf1k",kg3NbH:"xf314gf",$$css:!0},md:{k8WAf4:"x1vofgu7",$$css:!0},lg:{$$css:!0}};function ie({icon:e,label:t,description:a,onClick:u,isDisabled:x=!1,endContent:z,xstyle:$,className:y,style:M}){const l=bn(),c=l?.menuSize??"md",g=n.useCallback(()=>{x||!u||(u(),l?.closeMenu())},[x,u,l]);return s.jsx(ct,{role:"menuitem",tabIndex:x?void 0:-1,startContent:e?Ht(e,{size:"sm",color:"secondary"}):void 0,label:t,description:a,endContent:z,onClick:g,isDisabled:x,xstyle:[Ye.root,vn[c],x&&Ye.disabled,$],...he(pe("dropdown-menu-item",{size:c}),{className:y,style:M})})}ie.displayName="DropdownMenuItem";const wn={divider:{kqGvvJ:"xsq74q5",$$css:!0}};function Xe(e){return`item-${e.label}`}function jn(e,t){return`section-${e.title??t}`}function $n(e){const t=[];for(let a=0;a<e.length;a++){const u=e[a];"type"in u&&u.type==="divider"?t.push(s.jsx(lt,{xstyle:wn.divider},`divider-${a}`)):"type"in u&&u.type==="section"?t.push(s.jsxs("div",{role:"group","aria-label":u.title,children:[u.title&&s.jsx("div",{className:"xu0wf1k xf314gf x9ynric x141an7d x1ltkj2j xv1l7n4 x87ps6o","aria-hidden":"true",children:u.title}),u.items.map(x=>s.jsx(ie,{icon:x.icon,label:x.label,onClick:x.onClick,isDisabled:x.isDisabled},Xe(x)))]},jn(u,a))):"type"in u||t.push(s.jsx(ie,{icon:u.icon,label:u.label,onClick:u.onClick,isDisabled:u.isDisabled},Xe(u)))}return t}const Mn=new Set(["text","search","url","tel","email","password","number"]);function Cn(e){if(e.isContentEditable)return e;const t=e.closest("[contenteditable]");return t&&t.getAttribute("contenteditable")!=="false"?t:null}function Ue(e,t){if(!(e instanceof HTMLElement))return!1;const a=Cn(e);if(a){const l=typeof window<"u"?window.getSelection():null;return l&&l.rangeCount>0&&!l.isCollapsed?!0:(a.textContent??"").length>0}const u=e.tagName==="TEXTAREA",x=e.tagName==="INPUT"&&Mn.has(e.type);if(!u&&!x)return!1;const z=e,{selectionStart:$,selectionEnd:y,value:M}=z;return $!==y||$==null?!0:t==="ArrowLeft"||t==="ArrowUp"||t==="Home"?$>0:t==="ArrowRight"||t==="ArrowDown"||t==="End"?$<M.length:!1}function zn(e={}){const{itemSelector:t='[role="menuitem"]',wrap:a=!0,onEscape:u,orientation:x="vertical",hasHomeEnd:z=!0,isRtl:$=!1,hasRovingTabIndex:y=!1,hasCaretGuard:M=!1}=e,l=n.useRef(null),c=n.useCallback(h=>h.getAttribute("aria-disabled")==="true"||h.disabled===!0||h.hasAttribute("disabled"),[]),g=n.useCallback(()=>l.current?Array.from(l.current.querySelectorAll(t)):[],[t]),v=n.useCallback((h,E,N,i)=>{const f=h.length;if(f===0)return-1;let k=E;for(let w=0;w<f;w++){if(k<0||k>=f){if(!i)return-1;k=(k+f)%f}const q=h[k];if(q&&!c(q))return k;k+=N}return-1},[c]),T=n.useCallback(()=>{const h=g(),E=document.activeElement;return h.findIndex(N=>N===E||N.contains(E))},[g]),D=n.useCallback((h,E)=>{h.getAttribute("tabindex")!==String(E)&&h.setAttribute("tabindex",String(E))},[]),C=n.useCallback(()=>{const h=g(),E=h.filter(f=>!c(f));if(E.length===0)return;const i=E.find(f=>f.getAttribute("tabindex")==="0")??E[0];for(const f of h)D(f,f===i?0:-1)},[g,c,D]);Kt(()=>{y&&C()});const p=n.useCallback((h,E)=>{const N=h[E];if(N){if(y)for(const i of h)D(i,i===N?0:-1);N.focus()}},[y,D]),K=n.useCallback(h=>{const E=g();if(E.length===0)return;const N=Math.max(0,Math.min(h,E.length-1));p(E,N)},[g,p]),I=n.useCallback(()=>{const h=g(),E=v(h,0,1,!1);return E!==-1?(p(h,E),!0):!1},[g,v,p]),A=n.useCallback(()=>{const h=g(),E=v(h,h.length-1,-1,!1);return E!==-1?(p(h,E),!0):!1},[g,v,p]),S=n.useCallback(()=>{y&&C()},[y,C]),P=n.useCallback(h=>{if(h.ctrlKey||h.metaKey||h.altKey)return;if(h.key==="Escape"){h.preventDefault(),u?.();return}const E=x==="horizontal"||x==="both",N=x==="vertical"||x==="both",i=[],f=[];E&&(i.push($?"ArrowLeft":"ArrowRight"),f.push($?"ArrowRight":"ArrowLeft")),N&&(i.push("ArrowDown"),f.push("ArrowUp"));const k=i.includes(h.key),w=f.includes(h.key),q=z&&h.key==="Home",W=z&&h.key==="End";if(!k&&!w&&!q&&!W||M&&(Ue(h.target,h.key)||Ue(document.activeElement,h.key)))return;const X=T(),F=g();if(k){const V=X===-1?0:X+1,d=v(F,V,1,a);d!==-1&&p(F,d)}else if(w){const V=X===-1?F.length-1:X-1,d=v(F,V,-1,a);d!==-1&&p(F,d)}else q?I():W&&A();h.preventDefault()},[T,g,a,x,$,z,M,v,p,I,A,u]);return{listRef:l,handleKeyDown:P,handleFocus:S,focusItem:K,focusFirst:I,focusLast:A}}function En(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&e.key!==" "}function Dn(e){const{getItemLabels:t,onMatch:a,getCurrentIndex:u,resetMs:x=750,isDisabled:z}=e,$=n.useRef(""),y=n.useRef(void 0),M=n.useCallback(()=>{$.current="",y.current&&(clearTimeout(y.current),y.current=void 0)},[]),l=n.useCallback(()=>{y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{$.current="",y.current=void 0},x)},[x]);return{onKeyDown:n.useCallback(g=>{const v=g.key===" "&&$.current.length>0;if(!En(g)&&!v)return!1;const T=t();if(T.length===0)return!1;const D=g.key.toLowerCase(),C=$.current.length>0&&$.current.split("").every(S=>S===D),p=C?D:$.current+D;$.current=p,l();const K=u?.()??-1,I=T.length,A=C?1:0;for(let S=0;S<I;S++){const P=(K+A+S+I)%I;if(z?.(P))continue;const h=T[P];if(h!=null&&h.trim().toLowerCase().startsWith(p))return a(P),!0}return!0},[t,a,u,l,z]),reset:M}}const ye={dropdown:{kB7OPa:"x9f619",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kOIVth:"x1lsbc85",kskxy:"xuyqlj2",kORKVm:"x1odjw0f","--_dropdown-menu-radius":"x1fcsqxe","--_dropdown-menu-padding":"xgory14",kmVPX3:"x9epnlk",kaIpWk:"x1n97fys",kSiTet:"x1hc1fzr",k1ekBW:"x19991ni",kIyJzY:"xuedmi6",kAMwcw:"xlr8y92",$$css:!0},popover:{k7Eaqz:"xrzjruh",$$css:!0},popoverBlockGap:{keoZOQ:"xcsaf9d",k1K539:"x14cgwvg",$$css:!0},popoverInlineGap:{keTefX:"x11g1kdw",k71WvV:"xnur1sd",$$css:!0},popoverCustomWidth:e=>[{k7Eaqz:(typeof e=="number"?`${e}px`:e)!=null?"xkj4a21":typeof e=="number"?`${e}px`:e,$$css:!0},{"--x-minWidth":(t=>typeof t=="number"?t+"px":t??void 0)(typeof e=="number"?`${e}px`:e)}]},Tn={label:"Menu"};function Se({button:e=Tn,isMenuOpen:t,onOpenChange:a,menuWidth:u,onClick:x,hasChevron:z=!0,placement:$="below",className:y,style:M,xstyle:l,"data-testid":c,...g}){const v=("items"in g?g.items:void 0)??[],T=g.children,D=n.useId(),C=e?.size??"md",p=n.useRef(null),[K,I]=n.useState(!1),A=t!==void 0,S=A?t:K,P=n.useRef(0),h=n.useCallback(()=>{P.current=Date.now(),A?a?.(!1):I(!1),p.current?.focus()},[A,a]),E=n.useRef(!1),N=n.useCallback(()=>{A?a?.(!0):I(!0),E.current&&(E.current=!1)},[A,a]),i=pn({onHide:h,onShow:N,hasLightDismiss:!0,hasCloseButton:!1,hasAutoFocus:!1,role:"none"}),f=n.useCallback(()=>{i.hide()},[i]),{listRef:k,handleKeyDown:w,focusFirst:q,focusItem:W}=zn({itemSelector:'[role="menuitem"]:not([aria-disabled="true"])',wrap:!1,onEscape:f}),X=n.useCallback(()=>k.current?Array.from(k.current.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')):[],[k]),F=Dn({getItemLabels:()=>X().map(b=>b.textContent),onMatch:W,getCurrentIndex:()=>X().findIndex(b=>b===document.activeElement||b.contains(document.activeElement))});n.useEffect(()=>{A&&(t&&!i.isOpen?(i.show(),requestAnimationFrame(()=>q())):!t&&i.isOpen&&i.hide())},[t,A,i,q]);const V=n.useCallback(b=>{if(b.key==="Enter"||b.key===" "){b.preventDefault();const L=document.activeElement;L?.getAttribute("role")==="menuitem"&&L.click();return}if(b.key==="Tab"){f();return}if(F.onKeyDown(b)){b.preventDefault();return}w(b)},[w,f,F]),d=n.useCallback(()=>{i.show(),requestAnimationFrame(()=>q())},[i,q]),R=n.useCallback(()=>{Date.now()-P.current<50||(x?.(),A?a?.(!t):i.isOpen?i.hide():d())},[x,A,a,t,i,d]),H=n.useCallback(b=>{i.isOpen||(b.key==="ArrowDown"||b.key==="Enter"||b.key===" ")&&(b.preventDefault(),d())},[i.isOpen,d]),Y=e.isIconOnly===!0,O=e.endContent??(z&&!Y?s.jsx(Ft,{icon:"chevronDown",size:"sm",color:"inherit"}):void 0),o=u?ye.popoverCustomWidth(u):ye.popover,r=$==="above"||$==="below"?ye.popoverBlockGap:ye.popoverInlineGap,m=n.useMemo(()=>({closeMenu:f,menuSize:C}),[f,C]),j=g.items!==void 0?$n(v):T;return s.jsxs(s.Fragment,{children:[s.jsx(ce,{...e,ref:b=>{p.current=b,i.triggerRef(b);const L=e.ref;typeof L=="function"?L(b):L&&(L.current=b)},tooltip:S?void 0:e.tooltip,endContent:O,onClick:R,onKeyDown:H,"aria-haspopup":"menu","aria-expanded":S,"aria-controls":D,"data-testid":c}),i.render(s.jsx("div",{ref:k,id:D,role:"menu","aria-label":e.label,onKeyDown:V,...he(pe("dropdown-menu"),ee(ye.dropdown,l),y,M),children:s.jsx(Ie,{value:m,children:j})}),{placement:$,alignment:"start",xstyle:[o,r,Ot[$]]})]})}Se.displayName="DropdownMenu";const Sn={wrapper:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kOIVth:"xzye2dw",kmuXW:"x2lah0s",$$css:!0}},Nn={ctrl:"⌃",alt:"⌥",shift:"⇧",enter:"↵",backspace:"⌫",escape:"Esc",tab:"⇥",up:"↑",down:"↓",left:"←",right:"→",plus:"+"};function Rn(e,t){return e==="mod"?t?"⌘":"Ctrl":Nn[e]??e.toUpperCase()}const An={ctrl:"Control",alt:"Alt",shift:"Shift",enter:"Enter",backspace:"Backspace",escape:"Escape",tab:"Tab",up:"Up arrow",down:"Down arrow",left:"Left arrow",right:"Right arrow",plus:"Plus"};function In(e,t){return e==="mod"?t?"Command":"Control":An[e]??e.toUpperCase()}function Ln(){return()=>{}}function Pn(){return!1}function qn(){if(typeof navigator>"u")return!1;const e="userAgentData"in navigator?navigator.userAgentData:null;return e&&typeof e=="object"&&"platform"in e?/mac/i.test(e.platform??""):/Mac|iPhone|iPad|iPod/.test(navigator.platform??"")}function it({keys:e,ref:t,xstyle:a,className:u,style:x,...z}){const $=n.useSyncExternalStore(Ln,qn,Pn),y=e.split("+").map(l=>l.trim().toLowerCase()),M=y.map(l=>In(l,$)).join(" + ");return s.jsx("span",{ref:t,role:"img","aria-label":M,...z,...he(pe("kbd"),ee(Sn.wrapper,a),u,x),children:y.map(l=>s.jsx("kbd",{"aria-hidden":"true",className:"x3nfvp2 x6s0dn4 xl56j7k x16asifk x1grt7ep x7a5moj xx3sua9 x17x4s8c xlxy82 x1q0q8m5 xib2hle xv1l7n4 x9ynric x141an7d x1e4wzip x1ltkj2j x87ps6o",children:Rn(l,$)},l))})}it.displayName="Kbd";Je({"calkeys.modeDay":{zh:"日",en:"Day"},"calkeys.modeWeek":{zh:"周",en:"Week"},"calkeys.mode3day":{zh:"3 日",en:"3 days"},"calkeys.modeMonth":{zh:"月",en:"Month"}});const Ne=[{id:"day",get label(){return we("calkeys.modeDay")},key:"d"},{id:"week",get label(){return we("calkeys.modeWeek")},key:"w"},{id:"3day",get label(){return we("calkeys.mode3day")},key:"3"},{id:"month",get label(){return we("calkeys.modeMonth")},key:"m"}];function Wn(e){const t=(e.metaKey||e.ctrlKey)&&!e.altKey;if(t&&(e.key==="c"||e.key==="C"))return{kind:"copy"};if(t&&(e.key==="v"||e.key==="V"))return{kind:"paste"};if(e.metaKey||e.ctrlKey||e.altKey)return null;if(e.key==="Delete"||e.key==="Backspace")return{kind:"delete"};if(e.key==="ArrowLeft")return{kind:"prev"};if(e.key==="ArrowRight")return{kind:"next"};const a=Ne.find(u=>u.key===e.key.toLowerCase());return a?{kind:"mode",mode:a.id}:null}const ge=e=>e.end?.getTime()??e.start.getTime()+3600*1e3;function Hn(e){const t=[...e].sort((u,x)=>u.start.getTime()-x.start.getTime()||ge(u)-ge(x)),a=new Map;for(let u=0;u<t.length;){let x=u+1,z=ge(t[u]);for(;x<t.length&&t[x].start.getTime()<z;)z=Math.max(z,ge(t[x])),x+=1;const $=t.slice(u,x),y=[],M=$.map(c=>{let g=y.findIndex(v=>v<=c.start.getTime());return g<0&&(g=y.length),y[g]=ge(c),{ev:c,lane:g}}),l=Math.max(1,y.length);for(const{ev:c,lane:g}of M)a.set(c.key,{lane:g,laneCount:l,leftPct:g/l*100,widthPct:100/l});u=x}return a}Je({"calview.untitled":{zh:"未命名",en:"Untitled"},"calview.newEventTitle":{zh:"新事件",en:"New event"},"calview.new":{zh:"新建",en:"New"},"calview.newInto":{zh:"新建到「{name}」",en:'New event in "{name}"'},"calview.noDbHint":{zh:"请先在右栏添加一个含日期属性的多维表",en:"Add a calendar database in the right panel first"},"calview.today":{zh:"今天",en:"Today"},"calview.prevPage":{zh:"上一页",en:"Previous"},"calview.nextPage":{zh:"下一页",en:"Next"},"calview.density":{zh:"密度",en:"Density"},"calview.zoomOut":{zh:"缩小时间轴",en:"Zoom out timeline"},"calview.zoomIn":{zh:"放大时间轴",en:"Zoom in timeline"},"calview.densityReset":{zh:"恢复默认密度",en:"Reset to default density"},"calview.empty":{zh:"还没有日历事件。点「新建」,或在右栏添加一个含日期属性的多维表。",en:'No calendar events yet. Click "New", or add a database with a date property in the right panel.'},"calview.emptyNoDb":{zh:"还没有日历。在右栏点「添加日历」,选一个含日期属性的多维表。",en:'No calendars yet. Use "Add calendar" in the right panel to pick a database with a date property.'},"calview.allDay":{zh:"全天",en:"All-day"},"calview.a11yAllDayEvent":{zh:"{title},全天事件",en:"{title}, all-day event"},"calview.allDayDragHint":{zh:"{title}(可拖入时间格设为定时)",en:"{title} (drag into a time slot to schedule it)"},"calview.a11yEvent":{zh:"{title},{time}",en:"{title}, {time}"},"calview.a11yEventRange":{zh:"{title},{start} 至 {end}",en:"{title}, {start} to {end}"},"calview.monthFirst":{zh:"{m}月1",en:"{m}/1"},"calview.moreItems":{zh:"还有 {n} 项",en:"{n} more"},"calview.a11yMoreEvents":{zh:"查看 {m} 月 {d} 日全部 {n} 个事件",en:"View all {n} events on {m}/{d}"},"calview.a11yDayEvents":{zh:"{m} 月 {d} 日事件",en:"Events on {m}/{d}"},"calview.dayHeading":{zh:"{m} 月 {d} 日",en:"{m}/{d}"},"calview.closeAgenda":{zh:"关闭日程列表",en:"Close agenda list"}});const le=26,_e=8.4,ke=150,Ze=40;function Kn(e,t,a){const u=[];return e.forEach(({db:x,dateCol:z},$)=>{if(zt(t,a,x.path))return;const y=Et(t,a,x.path,$);for(const M of x.rows){const l=typeof M.cells[z]=="string"?M.cells[z]:"",c=Dt(l);c&&u.push({key:`${x.path}::${M.rowId}`,color:y,db:x,row:M,colId:z,title:M.name,raw:l,start:me(c.start),end:c.end?me(c.end):null,allDay:c.allDay,readonly:x.readonly&&!x.writeCell})}}),u}const Z=e=>`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`,oe=e=>{const t=e.currentTarget,a=t.getBoundingClientRect();return{left:a.left,top:a.top,right:a.right,bottom:a.bottom,zoom:xe(t)||1}},Fn=(e,t,a)=>t?`${J(e,a)}/${J(t,a)}`:J(e,a),Me=(e,t,a)=>tt(e.db,e.row.rowId,e.colId,Fn(t,a,e.allDay)),Ce=e=>({"--amx-event-color":e}),ut=(e,t)=>{const a=Q(t).getTime(),u=Q(e.start).getTime()<a,x=Q(e.end??e.start).getTime()>a;return`${u?" continues-left":""}${x?" continues-right":""}`};function rs(){const{t:e}=ze(),t=ft(),a=mt(),u=ht(),x=pt(),z=yt(),$=Gt(),y=gt(d=>d.cfg),M=kt(d=>d.vaultRoot)??"",l=bt(d=>d.byVault),c=te(d=>d.mode),g=te(d=>d.setMode),v=te(d=>d.hourPx),T=te(d=>d.setHourPx),D=te(d=>d.jumpNonce),[C,p]=n.useState(null),K=n.useRef(null),I=n.useRef(null),A=n.useRef(null);n.useEffect(()=>{c!=="month"&&(A.current=null)},[c]);const S=n.useRef(null),P=n.useRef(null);n.useEffect(()=>{if(!D)return;const d=te.getState().jumpDate;d&&I.current?.goto(me(d))},[D]),n.useEffect(()=>{const d=()=>{Ct.getState().refresh(y)};d();const R=window.setInterval(d,6e4);return()=>window.clearInterval(R)},[y]);const h=n.useMemo(()=>[...a.map(d=>({db:d.db,dateCol:d.dateCol})),...[...u,...x,...z,...$].map(d=>({db:d,dateCol:vt(d)?.id})).filter(d=>!!d.dateCol)],[a,u,x,z,$]),E=n.useMemo(()=>Kn(h,M,l),[h,M,l]),N=n.useMemo(()=>E.map(d=>d.title?d:{...d,title:e("calview.untitled")}),[E,e]),i=C?E.find(d=>d.key===C.key)??null:null;S.current=i;const f=(d,R)=>p({key:d,at:R}),k=()=>{const d=Tt(M,l),R=a.find(H=>H.db.path===d)??a.find(H=>!H.db.isNoteView)??a[0]??null;return R?{db:R.db,dateCol:R.dateCol}:null},w=k(),q=async(d,R,H)=>{const Y=k();if(!Y)return;const{db:O,dateCol:o}=Y;let r;if(R===null)r=J(d,!0);else{const j=G(Q(d),R);r=`${J(j,!1)}/${J(G(j,30),!1)}`}const m=await Nt(O,o,r,e("calview.newEventTitle"));f(`${O.path}::${m}`,H)};n.useEffect(()=>{const d=R=>{const H=R.target;if(H&&H.closest("input, textarea, select, [contenteditable]"))return;const Y=Wn(R);if(!Y)return;const O=S.current;switch(Y.kind){case"copy":O&&!O.readonly&&(P.current={db:O.db,rowId:O.row.rowId});break;case"paste":P.current&&St(P.current.db,P.current.rowId);break;case"delete":O&&!O.readonly&&(Xt(O.db,O.row,O.title),p(null));break;case"prev":I.current?.prev();break;case"next":I.current?.next();break;case"mode":te.getState().setMode(Y.mode);break}R.preventDefault()};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[]);const W=n.useRef(null),[X,F]=n.useState(7);n.useLayoutEffect(()=>{const d=W.current;if(!d)return;const R=()=>{const Y=d.clientWidth-52;F(Y>=784?7:Y>=396?3:1)};R();const H=new ResizeObserver(R);return H.observe(d),()=>H.disconnect()},[]);const V=Math.min(c==="week"?7:c==="3day"?3:1,X);return s.jsxs("div",{className:"amx-cal",ref:W,children:[s.jsx(Vt,{children:s.jsxs("header",{className:"amx-cal-bar",children:[s.jsx("div",{className:"amx-cal-nav",children:s.jsx("span",{className:"amx-cal-title",ref:K})}),s.jsxs("div",{className:"amx-cal-modes",children:[s.jsx(ce,{size:"sm",variant:"primary",icon:s.jsx(Qt,{size:14}),label:e("calview.new"),isDisabled:!w,tooltip:w?e("calview.newInto",{name:w.db.name}):e("calview.noDbHint"),onClick:d=>{const R=new Date,H=G(Q(R),be(R.getHours()*60+R.getMinutes()+15)),Y=oe(d);q(Q(H),H.getHours()*60+H.getMinutes(),Y)}}),s.jsx(ce,{size:"sm",variant:"secondary",label:e("calview.today"),onClick:()=>I.current?.today()}),s.jsx(ce,{size:"sm",variant:"ghost",isIconOnly:!0,icon:s.jsx(wt,{size:14}),label:e("calview.prevPage"),onClick:()=>I.current?.prev()}),s.jsx(ce,{size:"sm",variant:"ghost",isIconOnly:!0,icon:s.jsx(jt,{size:14}),label:e("calview.nextPage"),onClick:()=>I.current?.next()}),s.jsx(Se,{button:{label:Ne.find(d=>d.id===c)?.label??"周",variant:"secondary",size:"sm"},menuWidth:168,children:Ne.map(d=>s.jsx(ie,{icon:c===d.id?s.jsx($t,{size:14}):s.jsx("span",{style:{display:"inline-block",width:14}}),label:d.label,endContent:s.jsx(it,{keys:d.key}),onClick:()=>g(d.id)},d.id))}),c!=="month"&&s.jsx("span",{className:"amx-cal-density",children:s.jsxs(Se,{button:{label:e("calview.density"),variant:"ghost",size:"sm"},menuWidth:176,children:[s.jsx(ie,{icon:s.jsx(Ut,{size:14}),label:e("calview.zoomOut"),onClick:()=>T(v-8)}),s.jsx(ie,{icon:s.jsx(_t,{size:14}),label:e("calview.zoomIn"),onClick:()=>T(v+8)}),s.jsx(ie,{icon:s.jsx(Zt,{size:14}),label:e("calview.densityReset"),endContent:`${v}px`,onClick:()=>T(Bt)})]})})]})]})}),N.length===0&&s.jsx("div",{className:"amx-cal-empty",children:e(w?"calview.empty":"calview.emptyNoDb")}),c==="month"?s.jsx(Vn,{ref:I,anchorRef:A,events:N,selectedKey:C?.key??null,onPick:f,onCreate:(d,R)=>{q(d,null,R)},titleRef:K},`dow${t}`):s.jsx(On,{ref:I,n:V,weekStartDow:c==="week"&&V===7?t:null,events:N,selectedKey:C?.key??null,onPick:f,onCreate:(d,R,H)=>{q(d,R,H)},titleRef:K}),i&&C&&s.jsx(Yt,{ev:i,at:C.at,onClose:()=>p(null)})]})}const On=n.forwardRef(function({n:t,weekStartDow:a,events:u,selectedKey:x,onPick:z,onCreate:$,titleRef:y},M){const{t:l}=ze(),c=n.useRef(null),g=n.useRef(null),[v,T]=n.useState(0),[D,C]=n.useState(0),p=te(o=>o.hourPx),K=te(o=>o.setVisibleRange),I=()=>{g.current&&c.current&&(g.current.style.transform=`translateY(${-c.current.scrollTop}px)`)},A=n.useMemo(()=>Q(new Date),[]),S=n.useMemo(()=>{const o=ae(A,-ke);return Array.from({length:ke*2+1},(r,m)=>ae(o,m))},[A]),P=o=>a==null?o:Math.max(0,o-(S[o].getDay()-a+7)%7),h=n.useRef(ke),E=n.useRef(void 0),N=n.useRef(!1),i=n.useRef(""),f=n.useRef(-1),k=n.useRef(null),w=()=>{k.current&&(k.current.style.display="none")},q=n.useRef(null),[W,X]=n.useState(()=>{const o=new Date;return o.getHours()*60+o.getMinutes()});n.useEffect(()=>{const o=setInterval(()=>{const r=new Date;X(r.getHours()*60+r.getMinutes())},3e4);return()=>clearInterval(o)},[]),n.useEffect(()=>()=>K(null,null),[K]);const F=()=>{const o=c.current;if(!o||!v)return;const r=Math.max(0,Math.min(S.length-t,Math.round(o.scrollLeft/v)));h.current=r;const m=It(Qe(S[r],t));m!==i.current&&(i.current=m,y.current&&(y.current.textContent=m)),r*8+t!==f.current&&(f.current=r*8+t,K(J(S[r],!0),J(S[Math.min(S.length-1,r+t-1)],!0)))};n.useLayoutEffect(()=>{const o=c.current;if(!o)return;const r=t===7?112:t===3?132:180,m=()=>T(Math.max(r,o.clientWidth/t));m();const j=new ResizeObserver(m);return j.observe(o),()=>j.disconnect()},[t]),n.useLayoutEffect(()=>{const o=c.current;if(!o)return;const r=o.querySelector(".amx-cal-daycol2");r&&C(Math.max(0,r.offsetTop-(le+14)))},[u,v,t]),n.useLayoutEffect(()=>{const o=c.current;if(!(!o||!v)){if(!N.current){h.current=ke,N.current=!0;const r=o.querySelector(".amx-cal-daycol2"),m=r?r.offsetTop:le+14;o.scrollTop=Math.max(0,m+W/60*p-o.clientHeight/2)}E.current!==a&&(E.current=a,h.current=P(h.current)),o.scrollLeft=h.current*v,F(),I()}},[v,a]);const V=n.useRef(p);n.useLayoutEffect(()=>{const o=c.current,r=V.current;if(V.current=p,!o||r===p)return;const m=o.querySelector(".amx-cal-daycol2"),j=m?m.offsetTop:le+14,b=o.clientHeight/2,L=(o.scrollTop+b-j)/r;o.scrollTop=Math.max(0,j+L*p-b),I()},[p]),n.useEffect(()=>{const o=c.current;if(!o)return;const r=m=>{if(!m.ctrlKey&&!m.metaKey)return;m.preventDefault();const j=te.getState();j.setHourPx(j.hourPx*(m.deltaY<0?1.12:1/1.12))};return o.addEventListener("wheel",r,{passive:!1}),()=>o.removeEventListener("wheel",r)},[]),n.useImperativeHandle(M,()=>({prev:()=>c.current?.scrollBy({left:-t*v,behavior:"smooth"}),next:()=>c.current?.scrollBy({left:t*v,behavior:"smooth"}),today:()=>c.current?.scrollTo({left:P(ke)*v,behavior:"smooth"}),goto:o=>{if(!v)return;const r=Math.min(S.length-t,P(Math.max(0,Math.min(S.length-1,$e(Q(o),S[0])))));c.current?.scrollTo({left:r*v,behavior:"smooth"})}}),[t,v,S,a]);const d=(o,r)=>{if(r.stopPropagation(),o.readonly)return;const m=r.currentTarget,j=m.getBoundingClientRect(),b=xe(m)||1,L=(r.clientY-j.top)/b,B=L<_e?"start":j.height/b-L<_e?"end":"move",ne=We(o.start,o.end,p),U=Math.max(14,ne.height),ue=m.querySelector(".amx-cal-event-t");m.setPointerCapture(r.pointerId),m.classList.add("dragging"),q.current={mode:B,ev:o,el:m,tEl:ue,t0:ue?.textContent??"",x0:r.clientX,y0:r.clientY,zoom:b,top0:ne.top,h0:U,grabOffY:L,durMin:Math.round(U/p*60),msDur:o.end?o.end.getTime()-o.start.getTime():0,dyMin:0,moved:!1,target:null}},R=o=>{const r=q.current;if(!r)return;if(r.mode==="move"){const b=(o.clientX-r.x0)/r.zoom,L=(o.clientY-r.y0)/r.zoom;(Math.abs(b)>3||Math.abs(L)>3)&&(r.moved=!0),r.el.style.transform=`translate(${b}px, ${L}px)`;const B=c.current;if(!B||!v)return;const ne=B.getBoundingClientRect(),U=xe(B)||1,ue=Math.max(0,Math.min(S.length-1,Math.floor(((o.clientX-ne.left)/U+B.scrollLeft)/v))),Le=le+14+D,dt=(o.clientY-ne.top)/U-r.grabOffY+B.scrollTop-Le,Ee=Math.max(0,Math.min(1440-r.durMin,be(dt/p*60)));r.target={iso:J(S[ue],!0),topMin:Ee};const se=k.current;if(se&&(se.style.display="block",se.style.left=`${ue*v}px`,se.style.width=`${v}px`,se.style.top=`${Le+Ee/60*p}px`,se.style.height=`${r.h0}px`),r.moved){const De=G(Q(S[ue]),Ee),Pe=r.msDur?`${Z(De)}–${Z(new Date(De.getTime()+r.msDur))}`:Z(De);r.tEl&&(r.tEl.textContent=Pe),se&&(se.textContent=Pe)}return}const m=be((o.clientY-r.y0)/r.zoom/p*60);r.dyMin=m;const j=m/60*p;if(r.mode==="end"?r.el.style.height=`${Math.max(14,r.h0+j)}px`:(r.el.style.top=`${r.top0+j}px`,r.el.style.height=`${Math.max(14,r.h0-j)}px`),m!==0&&r.tEl){const b=r.ev.end??G(r.ev.start,60);if(r.mode==="end"){let L=G(b,m);L.getTime()<=r.ev.start.getTime()&&(L=G(r.ev.start,15)),r.tEl.textContent=`${Z(r.ev.start)}–${Z(L)}`}else{let L=G(r.ev.start,m);L.getTime()>=b.getTime()&&(L=G(b,-15)),r.tEl.textContent=`${Z(L)}–${Z(b)}`}}},H=(o,r)=>{const m=q.current;if(q.current=null,!m){o.readonly&&z(o.key,oe(r));return}if(m.el.classList.remove("dragging"),m.mode==="move"){if(m.el.style.transform="",w(),!m.moved||!m.target){m.tEl&&(m.tEl.textContent=m.t0),m.moved||z(o.key,oe(r));return}const b=G(Q(me(m.target.iso)),m.target.topMin);Me(o,b,o.end?new Date(b.getTime()+m.msDur):null);return}if(m.dyMin===0){m.tEl&&(m.tEl.textContent=m.t0);return}const j=o.end??G(o.start,60);if(m.mode==="end"){let b=G(j,m.dyMin);b.getTime()<=o.start.getTime()&&(b=G(o.start,15)),Me(o,o.start,b)}else{let b=G(o.start,m.dyMin);b.getTime()>=j.getTime()&&(b=G(j,-15)),Me(o,b,j)}},Y=o=>{o.stopPropagation(),o.currentTarget.setPointerCapture(o.pointerId)},O=(o,r)=>{if(o.readonly){z(o.key,oe(r));return}const m=document.elementFromPoint(r.clientX,r.clientY)?.closest(".amx-cal-daycol2"),j=m?.getAttribute("data-date");if(m&&j){const b=m.getBoundingClientRect(),L=Math.max(0,Math.min(1410,be((r.clientY-b.top)/(xe(m)||1)/p*60))),B=G(Q(me(j)),L);tt(o.db,o.row.rowId,o.colId,`${J(B,!1)}/${J(G(B,30),!1)}`);return}z(o.key,oe(r))};return s.jsxs("div",{className:"amx-cal-timerow",style:{"--amx-hour-px":`${p}px`},children:[s.jsx("div",{className:"amx-cal-gutterfixed",children:s.jsxs("div",{className:"amx-cal-gutterinner",children:[s.jsx("div",{className:"amx-cal-gcorner",style:{height:le+14}}),s.jsx("div",{className:"amx-cal-gallday",style:{height:D},children:l("calview.allDay")}),s.jsxs("div",{className:"amx-cal-ghours",ref:g,children:[qe.map(o=>s.jsx("div",{className:"amx-cal-hour",style:{height:p},children:o===0?"":`${o}:00`},o)),s.jsxs("span",{className:"amx-cal-nowlabel",style:{top:W/60*p},children:[String(Math.floor(W/60)).padStart(2,"0"),":",String(W%60).padStart(2,"0")]})]})]})}),s.jsx("div",{className:"amx-cal-tscroll",ref:c,onScroll:()=>{F(),I()},children:s.jsxs("div",{className:"amx-cal-tgrid2",style:{gridTemplateColumns:`repeat(${S.length}, ${v}px)`,gridTemplateRows:`${le+14}px auto ${qe.length*p}px`},children:[S.map(o=>s.jsxs("div",{className:`amx-cal-thead2${fe(o,A)?" today":""}`,children:[s.jsx("span",{className:"amx-cal-tdow",children:Rt(o.getDay())}),s.jsxs("span",{className:"amx-cal-tdate",children:[o.getMonth()+1,"/",o.getDate()]})]},+o)),S.map(o=>s.jsx("div",{className:"amx-cal-allday2",children:u.filter(r=>r.allDay&&et(r.start,r.end,o)).map(r=>s.jsx("button",{className:`amx-cal-chip-ev amx-cal-alldrag${r.readonly?" readonly":""}${x===r.key?" selected":""}${ut(r,o)}`,style:Ce(r.color),"aria-label":l("calview.a11yAllDayEvent",{title:r.title}),title:r.readonly?r.title:l("calview.allDayDragHint",{title:r.title}),onPointerDown:Y,onPointerUp:m=>O(r,m),children:r.title},r.key))},+o)),S.map(o=>s.jsxs("div",{className:"amx-cal-daycol2","data-date":J(o,!0),onDoubleClick:r=>{if(r.target.closest(".amx-cal-event"))return;const m=r.currentTarget.getBoundingClientRect(),j=xe(r.currentTarget)||1,b=Math.max(0,Math.min(1410,be((r.clientY-m.top)/j/p*60)));$(o,b,{left:r.clientX,top:r.clientY,right:r.clientX,bottom:r.clientY,zoom:j})},children:[(()=>{const r=u.filter(j=>!j.allDay&&fe(j.start,o)),m=Hn(r);return r.map(j=>{const b=We(j.start,j.end,p),L=m.get(j.key)??{leftPct:0,widthPct:100};return s.jsxs("button",{className:`amx-cal-event${j.readonly?" readonly":""}${x===j.key?" selected":""}`,style:{...Ce(j.color),top:b.top,height:Math.max(14,b.height),left:`calc(${L.leftPct}% + 2px)`,width:`calc(${L.widthPct}% - 4px)`},"aria-label":j.end?l("calview.a11yEventRange",{title:j.title,start:Z(j.start),end:Z(j.end)}):l("calview.a11yEvent",{title:j.title,time:Z(j.start)}),title:j.title,onPointerDown:B=>d(j,B),onPointerMove:R,onPointerUp:B=>H(j,B),children:[s.jsxs("span",{className:"amx-cal-event-t",children:[Z(j.start),j.end?`–${Z(j.end)}`:""]}),s.jsx("span",{className:"amx-cal-event-title",children:j.title})]},j.key)})})(),s.jsx("div",{className:`amx-cal-nowline${fe(o,A)?" today":""}`,style:{top:W/60*p}})]},+o)),s.jsx("div",{className:"amx-cal-dropghost",ref:k})]})})]})}),Vn=n.forwardRef(function({anchorRef:t,events:a,selectedKey:u,onPick:x,onCreate:z,titleRef:$},y){const{t:M}=ze(),l=n.useRef(null),[c,g]=n.useState(0),v=te(i=>i.setVisibleRange),T=n.useMemo(()=>Q(new Date),[]),D=n.useMemo(()=>{const i=ae(Te(T),-Ze*7);return Array.from({length:Ze*2+1},(f,k)=>ae(i,k*7))},[T]),C=n.useRef(!1),[p,K]=n.useState(null),I=n.useRef(""),A=n.useRef(-1);n.useEffect(()=>()=>v(null,null),[v]);const S=(i,f)=>Math.round($e(Te(new Date(i,f,1)),D[0])/7),P=()=>{const i=l.current;if(!i||!c)return;const f=Math.max(0,Math.min(D.length-1,Math.round(i.scrollTop/c))),k=ae(D[f],3),w=At(k);if(t&&(t.current={y:k.getFullYear(),m:k.getMonth()}),w!==I.current&&(I.current=w,$.current&&($.current.textContent=w)),f!==A.current){A.current=f;const q=Math.max(1,Math.round(i.clientHeight/c)),W=D[Math.min(D.length-1,f+q-1)];v(J(D[f],!0),J(ae(W,6),!0))}};n.useLayoutEffect(()=>{const i=l.current;if(!i)return;const f=()=>g(Math.max(64,(i.clientHeight-le)/6));f();const k=new ResizeObserver(f);return k.observe(i),()=>k.disconnect()},[]),n.useLayoutEffect(()=>{const i=l.current;if(!i||!c||C.current)return;C.current=!0;const f=t?.current;if(f){let k=Math.max(0,Math.min(D.length-1,S(f.y,f.m)));ae(D[k],3).getMonth()!==f.m&&k+1<D.length&&(k+=1),i.scrollTop=k*c}else i.scrollTop=S(T.getFullYear(),T.getMonth())*c;P()},[c]),n.useImperativeHandle(y,()=>({prev:()=>h(-1),next:()=>h(1),today:()=>l.current?.scrollTo({top:S(T.getFullYear(),T.getMonth())*c,behavior:"smooth"}),goto:i=>{if(!c)return;const f=Math.max(0,Math.min(D.length-1,Math.round($e(Te(i),D[0])/7)));l.current?.scrollTo({top:f*c,behavior:"smooth"})}}),[c]);const h=i=>{const f=l.current;if(!f||!c)return;const k=Math.max(0,Math.min(D.length-1,Math.round(f.scrollTop/c))),w=ae(D[k],3);f.scrollTo({top:Math.max(0,S(w.getFullYear(),w.getMonth()+i))*c,behavior:"smooth"})},E=i=>{i.stopPropagation(),i.currentTarget.setPointerCapture(i.pointerId)},N=(i,f)=>{const k=oe(f);if(i.readonly){x(i.key,k);return}const q=document.elementFromPoint(f.clientX,f.clientY)?.closest(".amx-cal-mcell")?.getAttribute("data-date");if(q){const W=$e(me(q),i.start);if(W!==0){Me(i,He(i.start,W),i.end?He(i.end,W):null);return}}x(i.key,k)};return s.jsxs("div",{className:"amx-cal-mscroll",ref:l,onScroll:P,children:[s.jsx("div",{className:"amx-cal-weekhead2",children:Mt().map(i=>s.jsx("div",{children:i},i))}),s.jsx("div",{className:"amx-cal-mweeks",children:D.map(i=>s.jsx("div",{className:"amx-cal-mweek",style:{height:c},children:Qe(i,7).map(f=>{const k=a.filter(w=>et(w.start,w.end,f));return s.jsxs("div",{className:`amx-cal-mcell${fe(f,T)?" today":""}`,"data-date":J(f,!0),onDoubleClick:w=>{w.target.closest(".amx-cal-chip-ev")||z(f,{left:w.clientX,top:w.clientY,right:w.clientX,bottom:w.clientY,zoom:xe(w.currentTarget)||1})},children:[s.jsx("div",{className:"amx-cal-mnum",children:f.getDate()===1?M("calview.monthFirst",{m:f.getMonth()+1}):f.getDate()}),k.slice(0,3).map(w=>s.jsxs("button",{className:`amx-cal-chip-ev${w.readonly?" readonly":""}${u===w.key?" selected":""}${ut(w,f)}`,style:Ce(w.color),title:w.title,"aria-label":!w.allDay&&fe(w.start,f)?M("calview.a11yEvent",{title:w.title,time:Z(w.start)}):w.title,onPointerDown:E,onPointerUp:q=>N(w,q),children:[!w.allDay&&fe(w.start,f)&&s.jsx("span",{className:"amx-cal-chip-t",children:Z(w.start)})," ",w.title]},w.key)),k.length>3&&s.jsx("button",{className:"amx-cal-more","aria-label":M("calview.a11yMoreEvents",{m:f.getMonth()+1,d:f.getDate(),n:k.length}),onClick:w=>K({day:f,events:k,at:oe(w)}),children:M("calview.moreItems",{n:k.length-3})})]},+f)})},+i))}),p&&s.jsx(Bn,{day:p.day,events:p.events,at:p.at,onPick:(i,f)=>{K(null),x(i,f)},onClose:()=>K(null)})]})});function Bn({day:e,events:t,at:a,onPick:u,onClose:x}){const{t:z}=ze(),$=292,y=a.zoom||1,M=12*y,l=Math.max(M,Math.min(a.left,window.innerWidth-$*y-M))/y,c=Math.max(M,Math.min(a.bottom+6*y,window.innerHeight-356*y-M))/y,g=n.useRef(null),v=n.useRef(x);return v.current=x,n.useEffect(()=>{const T=document.activeElement instanceof HTMLElement?document.activeElement:null;g.current?.querySelector(".amx-cal-agenda-list > button")?.focus();const D=C=>{C.key==="Escape"&&(C.preventDefault(),v.current())};return window.addEventListener("keydown",D),()=>{window.removeEventListener("keydown",D),T?.focus()}},[]),s.jsx("div",{className:"amx-cal-agenda-overlay",onMouseDown:x,children:s.jsxs("section",{className:"amx-cal-agenda",ref:g,role:"dialog","aria-modal":"true","aria-label":z("calview.a11yDayEvents",{m:e.getMonth()+1,d:e.getDate()}),style:{left:l,top:c,width:$},onMouseDown:T=>T.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:z("calview.dayHeading",{m:e.getMonth()+1,d:e.getDate()})}),s.jsx("button",{onClick:x,"aria-label":z("calview.closeAgenda"),children:"×"})]}),s.jsx("div",{className:"amx-cal-agenda-list",children:t.map(T=>s.jsxs("button",{style:Ce(T.color),onClick:D=>u(T.key,oe(D)),children:[s.jsx("span",{className:"amx-cal-agenda-time",children:T.allDay?z("calview.allDay"):Z(T.start)}),s.jsx("span",{children:T.title})]},T.key))})]})})}export{rs as CalendarView,Vn as MonthScroll};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as s,j as n}from"./index-BM2o7PeV.js";import{cq as j,as as k,bp as C,ah as A,R as L,aJ as S}from"./appStore-DWP8UET9.js";import"./client-0MPbodA6.js";function z({label:u,children:g,items:w,className:E="capability-menu-trigger",searchLabel:d,selection:p=!1,disabled:v=!1,acceptsDrag:y}){const b=s.useId(),a=s.useRef(null),l=s.useRef(null),[r,f]=s.useState(null),[h,x]=s.useState(""),i=(e=!0)=>{f(null),x(""),e&&a.current?.isConnected&&a.current.focus()},m=()=>{const e=a.current?.getBoundingClientRect();e&&f({x:e.left,y:e.bottom+4,top:e.top})};s.useEffect(()=>{if(!r)return;const e=c=>{!l.current?.contains(c.target)&&!a.current?.contains(c.target)&&i(!1)},t=c=>{if(l.current?.contains(c.target))return;const o=a.current?.getBoundingClientRect();if(!o||!a.current?.isConnected){i(!1);return}(Math.abs(o.left-r.x)>1||Math.abs(o.bottom+4-r.y)>1)&&f({x:o.left,y:o.bottom+4,top:o.top})};return document.addEventListener("pointerdown",e),window.addEventListener("resize",t),document.addEventListener("scroll",t,!0),()=>{document.removeEventListener("pointerdown",e),window.removeEventListener("resize",t),document.removeEventListener("scroll",t,!0)}},[r]),s.useEffect(()=>{if(!r||j())return;const e=l.current;(e?.querySelector("input")||e?.querySelector('[aria-checked="true"]:not(:disabled), button:not(:disabled)'))?.focus({preventScroll:!0})},[!!r]);const D=w.filter(e=>e.label.toLowerCase().includes(h.trim().toLowerCase()));return n.jsxs(n.Fragment,{children:[n.jsx("button",{ref:a,type:"button",className:E,"aria-label":u,title:u,"aria-haspopup":"menu","aria-expanded":!!r,"aria-controls":r?b:void 0,disabled:v,onDragEnter:e=>{y?.(e.dataTransfer)&&(e.preventDefault(),r||m())},onDragOver:e=>{y?.(e.dataTransfer)&&e.preventDefault()},onClick:()=>r?i():m(),onKeyDown:e=>{(e.key==="ArrowDown"||e.key==="ArrowUp")&&(e.preventDefault(),m())},children:g||n.jsxs(n.Fragment,{children:[n.jsx("span",{children:u}),n.jsx(k,{size:13})]})}),r&&C.createPortal(n.jsx("div",{className:"ui-popover-backdrop",style:{pointerEvents:"none"},children:n.jsxs(A,{style:{pointerEvents:"auto"},x:r.x,y:r.y,anchorTop:r.top,innerRef:e=>{l.current=e},id:b,className:`ui-popover capability-menu${p?" capability-menu-selection":""}`,role:"menu","aria-label":u,onKeyDown:e=>{if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),i();return}if(e.key==="Tab"){i();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(e.key)||e.target instanceof HTMLInputElement&&["Home","End"].includes(e.key))return;e.preventDefault(),e.stopPropagation();const t=Array.from(l.current?.querySelectorAll("button:not(:disabled)")||[]),c=t.indexOf(document.activeElement),o=e.key==="Home"?0:e.key==="End"?t.length-1:(c+(e.key==="ArrowDown"?1:-1)+t.length)%t.length;t[o]?.focus()},children:[d&&n.jsxs("label",{className:"capability-menu-search",children:[n.jsx(L,{size:14}),n.jsx("input",{"aria-label":d,placeholder:d,value:h,onChange:e=>x(e.target.value)})]}),n.jsx("div",{className:"capability-menu-items",children:D.map(e=>n.jsxs("button",{type:"button",role:p?"menuitemradio":"menuitem","aria-label":e.label,"aria-checked":p?!!e.selected:void 0,disabled:e.disabled,className:`${e.danger?"danger":""}${e.dropActive?" capability-menu-drop":""}`,onDragOver:e.onDragOver,onDragLeave:e.onDragLeave,onDrop:e.onDrop,onClick:()=>{i(),e.onSelect()},children:[n.jsx("span",{className:"capability-menu-icon",children:e.icon}),n.jsx("span",{children:e.label}),e.hint&&n.jsx("small",{className:"capability-menu-hint",children:e.hint}),e.selected&&n.jsx(S,{size:14})]},e.id))})]})}),document.body)]})}export{z as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,d as i}from"./index-
|
|
1
|
+
import{j as e,d as i}from"./index-BM2o7PeV.js";import{r as ee,I as se,m as w,t as q,p as k,u as xe,a as te,S as ce}from"./astryxBridge-D-m4_kYt.js";import{Tooltip as ne}from"./Tooltip-ZxrDqN4p.js";function K({label:c,inputID:s,labelID:o,isGroupLabel:l=!1,isLabelHidden:a=!1,isDisabled:p=!1,isOptional:u=!1,isRequired:x=!1,labelIcon:m,labelTooltip:d,description:h,descriptionID:v,ref:$}){const n=u?"Optional":x?"Required":null,S=l?"span":"label",N=e.jsxs(e.Fragment,{children:[m&&ee(m,{size:"sm",color:"inherit"}),c,n&&e.jsxs("span",{className:"x1sodnla x141an7d x1ltkj2j xv1l7n4",children:[e.jsx("span",{"aria-hidden":"true",children:" ∙ "}),n]}),d&&e.jsx(ne,{content:d,placement:"above",children:e.jsx(se,{icon:"info",size:"sm",color:"inherit"})})]});return e.jsxs(e.Fragment,{children:[e.jsx(S,{ref:$,id:o,htmlFor:l?void 0:s,...w(q("field-label"),{0:{className:"x78zum5 x6s0dn4 xzye2dw x9ynric xcr08ib x1kq96og x1e4wzip xv1l7n4 x1ypdohk"},2:{className:"x78zum5 x6s0dn4 xzye2dw x9ynric xcr08ib x1kq96og x1e4wzip xnbbluu x1h6gzvc"},1:{className:"x78zum5 x6s0dn4 xzye2dw x9ynric xcr08ib x1kq96og x1e4wzip xv1l7n4 x1ypdohk xng3xce xzpqnlu xjm9jq1 xu96u03 xkdpibf xb3r6kr x1717udv x47corl x10l6tqk x13vifvy x87ps6o xuxw1ft x1i1rx1s"},3:{className:"x78zum5 x6s0dn4 xzye2dw x9ynric xcr08ib x1kq96og x1e4wzip xnbbluu x1h6gzvc xng3xce xzpqnlu xjm9jq1 xu96u03 xkdpibf xb3r6kr x1717udv x47corl x10l6tqk x13vifvy x87ps6o xuxw1ft x1i1rx1s"}}[!!p<<1|!!a<<0]),children:N}),h&&e.jsx("span",{id:v,...{0:{className:"x9ynric x141an7d x1ltkj2j x1sodnla xv1l7n4"},1:{className:"x9ynric x141an7d x1ltkj2j x1sodnla xv1l7n4 xng3xce xzpqnlu xjm9jq1 xu96u03 xkdpibf xb3r6kr x1717udv x47corl x10l6tqk x13vifvy x87ps6o xuxw1ft x1i1rx1s"}}[!!a<<0],children:h})]})}K.displayName="FieldLabel";let E=!1;typeof window<"u"&&requestAnimationFrame(()=>{E=!0});const re={slideDown:{kKVMdj:"x1srr2gu x1aquc0h",k44tkh:"x9uej1z",kyAemX:"x128ha8g",kWV6AL:"xskzprw",$$css:!0},slideUp:{kKVMdj:"x1dvww92 x1aquc0h",k44tkh:"x9uej1z",kyAemX:"x128ha8g",kWV6AL:"xskzprw",$$css:!0},fadeIn:{kKVMdj:"xqcmdr3 x1aquc0h",k44tkh:"x9uej1z",kyAemX:"x128ha8g",kWV6AL:"xskzprw",$$css:!0},scaleIn:{kKVMdj:"x97zbip x1aquc0h",k44tkh:"x9uej1z",kyAemX:"x128ha8g",kWV6AL:"xskzprw",$$css:!0}};function ie(c="slideDown"){const[s]=i.useState(()=>E);return s?re[c]:null}const W={base:{kMv6JI:"x9ynric",kGuDYH:"x141an7d",kLWn49:"x1ltkj2j",$$css:!0},attached:{keoZOQ:"x1c40v9y",kLKAdn:"x1ak3mig",kGO01o:"x1wesfrj",kg3NbH:"xf314gf",kqGeR4:"x14lggfu",kYm2EN:"xtufxuj",$$css:!0},detached:{keoZOQ:"xcsaf9d",k8WAf4:"xce4md1",kg3NbH:"xf314gf",kaIpWk:"xh6dtrn",$$css:!0}},ae={warning:{kWkggS:"x24i8r5",kMwMTN:"xdhq94a",$$css:!0},error:{kWkggS:"x1pritpl",kMwMTN:"x1joocv1",$$css:!0},success:{kWkggS:"xu13z74",kMwMTN:"xltfdvo",$$css:!0}};function Z({ref:c,type:s,message:o,id:l,variant:a="attached",xstyle:p,className:u,style:x,...m}){const d=ie("slideDown");return e.jsx("div",{ref:c,id:l,role:s==="error"?"alert":"status","aria-live":s==="error"?"assertive":"polite",...m,...w(q("field-status",{type:s,variant:a}),k(W.base,d,a==="attached"?W.attached:W.detached,ae[s],p),u,x),children:o})}Z.displayName="FieldStatus";const ke={x1tspnpo:"x1tspnpo",$$css:!0},D=i.createContext(null);D.displayName="CheckboxListContext";const t={container:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x1txdalj",$$css:!0},containerLabelHidden:{kOIVth:"xxhr3t",$$css:!0},checkboxWrapper:{kVAEAm:"x1n2onr6",k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kmuXW:"x2lah0s",kHBbk8:"xc8icb0",$$css:!0},input:{kVAEAm:"x10l6tqk",kogj98:"x1ghz6dp",kmVPX3:"x1717udv",kSiTet:"xg01cxk",kkrTdU:"x1ypdohk",kY2c9j:"x1vjfegm",$$css:!0},inputDisabled:{kkrTdU:"x1h6gzvc",$$css:!0},checkbox:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kMzoRj:"x1litavf",ksu8eU:"x1y0btm7",kaIpWk:"xx3sua9",k1ekBW:"xts7igz",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",$$css:!0},checkboxFocus:{kI3sdo:"x1a2a7pz xkri23q",kInvED:"x81n7kt",$$css:!0},checkboxUnchecked:{kMwMTN:"xqwr325",kVAM5u:"xvy26l8 x1jtjlen",kWkggS:"x10xzikg xrsv7h",$$css:!0},checkboxChecked:{kMwMTN:"x17wrial",kVAM5u:"xad5do x1od6ugu",kWkggS:"x1ewilqj x6aeo4j",$$css:!0},checkboxDisabled:{kSiTet:"xbyyjgo",kVAM5u:"x14i3s5s xmt8yqp",$$css:!0},checkboxDisabledUnchecked:{kWkggS:"xwmxj5m x1cjfj8k",$$css:!0},checkmark:{k1xSpc:"x1s85apg",kMwMTN:"x17wrial",$$css:!0},checkmarkVisible:{k1xSpc:"x1lliihq",$$css:!0},indeterminateMark:{k1xSpc:"x1s85apg",kWkggS:"x1azo05",kaIpWk:"x1nj7uno",$$css:!0},indeterminateMarkVisible:{k1xSpc:"x1lliihq",$$css:!0}},F={sm:{kzqmXN:"xw4jnvo",kZKoxP:"x1qx5ct2",$$css:!0},md:{kzqmXN:"xvy4d1p",kZKoxP:"xxk0z11",$$css:!0}},de={sm:{kzqmXN:"x1xp8n7a",kZKoxP:"xmix8c7",$$css:!0},md:{kzqmXN:"x17z2i9w",kZKoxP:"x17rw0jw",$$css:!0}},oe={sm:{kzqmXN:"xsmyaan",kZKoxP:"x1kpxq89",$$css:!0},md:{kzqmXN:"x6jxa94",kZKoxP:"x1v9usgg",$$css:!0}},le={sm:{kzqmXN:"x1fsd2vl",kZKoxP:"x36qwtl",$$css:!0},md:{kzqmXN:"xsmyaan",kZKoxP:"x36qwtl",$$css:!0}},ue={width:c=>[{kzqmXN:c!=null?"x5lhr3w":c,$$css:!0},{"--x-width":(s=>typeof s=="number"?s+"px":s??void 0)(c)}]};function me({label:c,isLabelHidden:s=!1,description:o,onChange:l,changeAction:a,isLoading:p=!1,value:u,isDisabled:x=!1,htmlName:m,disabledMessage:d,isReadOnly:h=!1,isOptional:v=!1,isRequired:$=!1,size:n="md",onFocus:S,onBlur:N,labelIcon:O,status:f,width:A,xstyle:B,className:G,style:U,ref:R}){const C=i.useId(),T=i.useId(),L=i.useId(),[,H]=i.useTransition(),[M,Y]=i.useOptimistic(u),I=p||M!==u,g=x&&!!d,J=i.use(D),X=x&&(g||(J?.hasDisabledMessage??!1)),y=xe({placement:"above",focusTrigger:"always",isEnabled:g}),j=M==="indeterminate",z=M===!0,P=z||j,Q=i.useCallback(r=>{r&&(r.indeterminate=j)},[j]),b=[];o&&!s&&b.push(T),f?.message&&b.push(L),g&&b.push(y.describedBy);const _=b.length>0?b.join(" "):void 0;return e.jsxs("div",{...w(q("checkbox-input",{size:n}),k(A!=null&&ue.width(A),B),G,U),children:[e.jsxs("div",{ref:r=>{y.interactionRef(r)},...k(t.container,s&&t.containerLabelHidden,!x&&ke),children:[e.jsxs("div",{...k(t.checkboxWrapper,F[n]),children:[e.jsx("input",{ref:te(R,Q,y.positionRef),id:C,type:"checkbox",name:x?void 0:m,checked:z,disabled:x&&!X,"aria-disabled":X?"true":void 0,readOnly:h,required:$,onChange:r=>{if(x||I||h)return;const V=r.target.checked;l?.(V,r),a&&!r.defaultPrevented&&H(async()=>{Y(V),await a(V,r)})},onFocus:S,onBlur:N,"aria-readonly":h||void 0,"aria-describedby":_,"aria-invalid":f?.type==="error"?!0:void 0,"aria-busy":I||void 0,...k(t.input,F[n],x&&t.inputDisabled)}),e.jsx("div",{"aria-hidden":"true",...w(q("checkbox",{size:n,checked:z?"checked":j?"indeterminate":null,disabled:x?"disabled":null}),k(t.checkbox,de[n],!x&&t.checkboxFocus,P?t.checkboxChecked:t.checkboxUnchecked,x&&t.checkboxDisabled,x&&!P&&t.checkboxDisabledUnchecked)),children:I?e.jsx(ce,{size:"sm",shade:"inherit"}):e.jsxs(e.Fragment,{children:[e.jsx("svg",{viewBox:"0 0 10 10",...k(t.checkmark,oe[n],z&&t.checkmarkVisible),children:e.jsx("path",{d:"M8.5 2.5L4 7.5L1.5 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})}),e.jsx("div",{...k(t.indeterminateMark,le[n],j&&t.indeterminateMarkVisible)})]})})]}),e.jsx("div",{className:"x78zum5 xdt5ytf x1lsbc85",children:e.jsx(K,{label:c,inputID:C,isLabelHidden:s,isDisabled:x,isOptional:v,isRequired:$,labelIcon:O,description:o,descriptionID:T})})]}),f?.message&&e.jsx(Z,{type:f.type,message:f.message,id:L,variant:"detached"}),g&&y.renderTooltip(d)]})}me.displayName="CheckboxInput";export{me as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as D,u as R,j as c,r as _}from"./index-BM2o7PeV.js";import{F as A,ag as H,aq as T,fF as $}from"./appStore-DWP8UET9.js";import"./client-0MPbodA6.js";import{M as E}from"./minus-C9ndHJ9O.js";const b=[["path",{d:"m12 15 4 4",key:"lnac28"}],["path",{d:"M2.352 10.648a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l6.029-6.029a1 1 0 1 1 3 3l-6.029 6.029a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l6.365-6.367A1 1 0 0 0 8.716 4.282z",key:"nlhkjb"}],["path",{d:"m5 8 4 4",key:"j6kj7e"}]],F=A("magnet",b);const X=[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]],Y=A("map",X),B=18,L=(e,n)=>e.x<n.x+n.w&&e.x+e.w>n.x&&e.y<n.y+n.h&&e.y+e.h>n.y,W=(e,n)=>({x:e.x-n,y:e.y-n,w:e.w+n*2,h:e.h+n*2});function J(e,n,m={x:0,y:0},d=B,i){if(!e.length||!n.length)return{x:0,y:0};const x=n.map(o=>W(o,Math.max(0,d))),u=(o,a)=>e.every(f=>{const h={...f,x:f.x+o,y:f.y+a};return i&&(h.x<i.x||h.y<i.y||h.x+h.w>i.x+i.w||h.y+h.h>i.y+i.h)?!1:x.every(k=>!L(h,k))});if(u(0,0))return{x:0,y:0};const y=new Set([0]),r=new Set([0]);for(const o of e)for(const a of x)y.add(Math.floor(a.x-(o.x+o.w))),y.add(Math.ceil(a.x+a.w-o.x)),r.add(Math.floor(a.y-(o.y+o.h))),r.add(Math.ceil(a.y+a.h-o.y));const M=Math.hypot(m.x,m.y);let s=null;for(const o of y)for(const a of r){if(!u(o,a))continue;const f=M?(o*m.x+a*m.y)/M:0,h=o!==0&&a!==0?.1:0,k=o*o+a*a+h-f*.001;(!s||k<s.score)&&(s={x:o,y:a,score:k})}return s?{x:s.x,y:s.y}:{x:0,y:0}}_({"cvminimap.aria":{zh:"画布缩略图",en:"Canvas minimap"},"cvminimap.hint":{zh:"画布缩略图:点击或拖动以导航",en:"Canvas minimap: click or drag to navigate"}});const w=184,z=112,P=7;function K({hostRef:e,vp:n,items:m,onCenter:d}){const i=D.useRef(!1),{t:x}=R(),u=e.current;if(!u||!m.length)return null;const y=H(u)||1,r=u.getBoundingClientRect(),M={x:-n.x/n.z,y:-n.y/n.z,w:Math.max(1,r.width/y/n.z),h:Math.max(1,r.height/y/n.z)},s=[...m.map(t=>t.box),M],o=Math.min(...s.map(t=>t.x)),a=Math.min(...s.map(t=>t.y)),f=Math.max(...s.map(t=>t.x+t.w)),h=Math.max(...s.map(t=>t.y+t.h)),k=Math.max(1,f-o),j=Math.max(1,h-a),l=Math.min((w-P*2)/k,(z-P*2)/j),v=(w-k*l)/2-o*l,C=(z-j*l)/2-a*l,N=t=>({x:v+t.x*l,y:C+t.y*l,w:Math.max(1.5,t.w*l),h:Math.max(1.5,t.h*l)}),I=t=>{const p=t.currentTarget.getBoundingClientRect(),O=(t.clientX-p.left)/Math.max(1,p.width)*w,S=(t.clientY-p.top)/Math.max(1,p.height)*z;d((O-v)/l,(S-C)/l)},g=N(M);return c.jsx("div",{className:"amx-stage-minimap",role:"navigation","aria-label":x("cvminimap.aria"),title:x("cvminimap.hint"),onPointerDown:t=>{t.preventDefault(),t.stopPropagation(),i.current=!0;try{t.currentTarget.setPointerCapture(t.pointerId)}catch{}I(t)},onPointerMove:t=>{i.current&&(t.preventDefault(),t.stopPropagation(),I(t))},onPointerUp:t=>{i.current=!1;try{t.currentTarget.releasePointerCapture(t.pointerId)}catch{}},onPointerCancel:()=>{i.current=!1},children:c.jsxs("svg",{viewBox:`0 0 ${w} ${z}`,"aria-hidden":"true",children:[m.map(t=>{const p=N(t.box);return c.jsx("rect",{className:`amx-mini-item is-${t.kind}`,"data-mini-key":t.key,x:p.x,y:p.y,width:p.w,height:p.h,rx:t.kind==="frame"?2:1.5},t.key)}),c.jsx("rect",{className:"amx-mini-viewport",x:g.x,y:g.y,width:g.w,height:g.h,rx:"2"})]})})}_({"ckchrome.zoomOut":{zh:"缩小",en:"Zoom out"},"ckchrome.zoomIn":{zh:"放大",en:"Zoom in"},"ckchrome.zoomReset":{zh:"重置为 100%",en:"Reset to 100%"},"ckchrome.fit":{zh:"适应内容",en:"Fit to content"},"ckchrome.snap":{zh:"点阵吸附",en:"Snap to grid"},"ckchrome.snapOff":{zh:"关闭点阵吸附",en:"Turn off snap to grid"},"ckchrome.snapOn":{zh:"开启点阵吸附",en:"Turn on snap to grid"},"ckchrome.miniHide":{zh:"隐藏缩略图",en:"Hide minimap"},"ckchrome.miniShow":{zh:"显示缩略图",en:"Show minimap"}});function Q({zoom:e,onZoomBy:n,onFit:m,snap:d,onSnap:i,mini:x,onMini:u,extra:y}){const{t:r}=R();return c.jsxs("div",{className:"amx-stage-hud",children:[c.jsx("button",{type:"button",onClick:()=>n(1/1.2),title:r("ckchrome.zoomOut"),children:c.jsx(E,{size:12})}),c.jsx("button",{type:"button",className:"amx-hud-zoom",onClick:()=>n(1/e),title:r("ckchrome.zoomReset"),children:c.jsxs("span",{children:[Math.round(e*100),"%"]})}),c.jsx("button",{type:"button",onClick:()=>n(1.2),title:r("ckchrome.zoomIn"),children:c.jsx(T,{size:12})}),c.jsx("button",{type:"button",onClick:m,title:r("ckchrome.fit"),children:c.jsx($,{size:12})}),y,c.jsx("button",{type:"button",className:`amx-snap-toggle${d?" is-on":""}`,"aria-pressed":d,"aria-label":r("ckchrome.snap"),title:r(d?"ckchrome.snapOff":"ckchrome.snapOn"),onClick:()=>i(!d),children:c.jsx(F,{size:12})}),c.jsx("button",{type:"button",className:x?"is-on":"","aria-pressed":x,title:r(x?"ckchrome.miniHide":"ckchrome.miniShow"),onClick:()=>u(!x),children:c.jsx(Y,{size:12})})]})}export{K as C,Y as M,Q as a,J as r};
|