decocms 4.166.2 → 4.167.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-DH3qtgBe.js → AlertCircle-Cd8M35Wb.js} +1 -1
- package/dist/client/assets/{AreaChart-CUxSq8CM.js → AreaChart-C78nqQQF.js} +1 -1
- package/dist/client/assets/{ArrowUp-Bw-aOPaU.js → ArrowUp-4BHUZHFD.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-Cc2KMNxL.js → ArrowUpRight-CCEVlmCI.js} +1 -1
- package/dist/client/assets/{Check-lBHxT1HX.js → Check-CK_e8wdj.js} +1 -1
- package/dist/client/assets/{CheckCircle-Cva3EkPV.js → CheckCircle-D31c9Zko.js} +1 -1
- package/dist/client/assets/{ChevronDown-QYK7Lenl.js → ChevronDown-DSAcD82u.js} +1 -1
- package/dist/client/assets/{ChevronRight-CWURfvDb.js → ChevronRight-D02mIW0w.js} +1 -1
- package/dist/client/assets/{ChevronUp-BMvYccDe.js → ChevronUp-BqqaHKfG.js} +1 -1
- package/dist/client/assets/{Copy01-CAqSjpf_.js → Copy01-CbmbpqVa.js} +1 -1
- package/dist/client/assets/{CpuChip01-lsdcDtEC.js → CpuChip01-DHX1tpE2.js} +1 -1
- package/dist/client/assets/{DotsVertical-C58fabD-.js → DotsVertical-DD9vI7XN.js} +1 -1
- package/dist/client/assets/{Eye-Dw90cLwR.js → Eye-CgfUY2cN.js} +1 -1
- package/dist/client/assets/{FilterLines-BafoDeSJ.js → FilterLines-BVMJKn0q.js} +1 -1
- package/dist/client/assets/{HardDrive-BuNe2d8F.js → HardDrive-2n4L-vNW.js} +1 -1
- package/dist/client/assets/{Key01-DSruLSCx.js → Key01-T5YNQBm2.js} +1 -1
- package/dist/client/assets/{LayoutLeft-BV4kR0Cl.js → LayoutLeft-CaOxvIEl.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DltqAIeP.js → LinkExternal01-CXa8wVjc.js} +1 -1
- package/dist/client/assets/{LogOut01-B1kROqne.js → LogOut01-CM9eugyU.js} +1 -1
- package/dist/client/assets/{Monitor01-Ba7OYhMO.js → Monitor01-8S0W2w5U.js} +1 -1
- package/dist/client/assets/{Palette-CwJTW0Hm.js → Palette-BQLbJJdf.js} +1 -1
- package/dist/client/assets/{Play-B47Q6pNp.js → Play-CuYQk1-M.js} +1 -1
- package/dist/client/assets/{Plus-Bi2kvuIY.js → Plus-BApQaxo5.js} +1 -1
- package/dist/client/assets/{SearchLg-UBODIUpH.js → SearchLg-BSb_OzKH.js} +1 -1
- package/dist/client/assets/{SearchMd-Swr0KhLg.js → SearchMd-bzt4kP0K.js} +1 -1
- package/dist/client/assets/{Settings02-Crp31NAs.js → Settings02-Cslfpi0u.js} +1 -1
- package/dist/client/assets/{Shield01-D6aMdI8b.js → Shield01-vx0tzuE8.js} +1 -1
- package/dist/client/assets/{Star01-WZXTBc9P.js → Star01-DGK3WnVL.js} +1 -1
- package/dist/client/assets/{Stars01-CbClslIT.js → Stars01-BkoB-Q1B.js} +1 -1
- package/dist/client/assets/{Stars02-D3Ts30Xu.js → Stars02-Cx4R-W4T.js} +1 -1
- package/dist/client/assets/{Sun-DOEVL1Eu.js → Sun-Cno0ZL2K.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-5PmCZ0_U.js → SwitchHorizontal01-B1yag0Lu.js} +1 -1
- package/dist/client/assets/{Tool01-BgrN_XhB.js → Tool01-BPkNcjLe.js} +1 -1
- package/dist/client/assets/{Tool02-C8_nzaSV.js → Tool02-8rf_PPrb.js} +1 -1
- package/dist/client/assets/{Trash01-BB8WWZkr.js → Trash01-CjLF47KG.js} +1 -1
- package/dist/client/assets/{TrendUp01-cPdEBjok.js → TrendUp01-B3nbKtR5.js} +1 -1
- package/dist/client/assets/{Upload01-HoFghnaA.js → Upload01-C74iA_2l.js} +1 -1
- package/dist/client/assets/{User01-CU43n4aC.js → User01-gol1gjVG.js} +1 -1
- package/dist/client/assets/{Users01-BfmGwOWr.js → Users01-ConkK5Hy.js} +1 -1
- package/dist/client/assets/{Users03-BrSAA7CP.js → Users03-C0TiA5ig.js} +1 -1
- package/dist/client/assets/{X-BW2EYO4B.js → X-D-SXXNOh.js} +1 -1
- package/dist/client/assets/{XCircle-Mv4us9Z1.js → XCircle-Bdipnf78.js} +1 -1
- package/dist/client/assets/{XClose-DCuiifka.js → XClose-BXyOmw6P.js} +1 -1
- package/dist/client/assets/{Zap-fP1c7xXe.js → Zap-DJXvF0rz.js} +1 -1
- package/dist/client/assets/{ZapSquare-DYA2y0UF.js → ZapSquare-DRAXQQVP.js} +1 -1
- package/dist/client/assets/{access-gate-BOsNScRg.js → access-gate-BKMOmBMY.js} +1 -1
- package/dist/client/assets/{add-section-modal-_WTg53uR.js → add-section-modal-B75sXBI5.js} +1 -1
- package/dist/client/assets/{agent-icon-Dx4NCRpv.js → agent-icon-bqP8cd4A.js} +1 -1
- package/dist/client/assets/{agents-list-B6Umsglt.js → agents-list-JTNfRO7b.js} +1 -1
- package/dist/client/assets/ai-providers-DB4edqOH.js +1 -0
- package/dist/client/assets/{alert-dialog-C9XbRCXw.js → alert-dialog-fWZE2eoL.js} +3 -3
- package/dist/client/assets/{alert-NAuelKid.js → alert-kXNc1jQs.js} +1 -1
- package/dist/client/assets/{app-editor-9ydsOs0i.js → app-editor-BJoZeDYw.js} +1 -1
- package/dist/client/assets/{auth-B6HaqNKN.js → auth-B6-JmtGV.js} +1 -1
- package/dist/client/assets/{auth-catchall-CgRGtxCe.js → auth-catchall-cHl02pOC.js} +1 -1
- package/dist/client/assets/{auth-entry-iN06W9mE.js → auth-entry-BkcVdNXd.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CbLuIloM.js → auth-split-layout-ozU7OFFM.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-B4pAf04F.js → authenticate-and-persist-oauth-BBAoTw-S.js} +1 -1
- package/dist/client/assets/{automation-list-row-BRUbqICU.js → automation-list-row-BkrA0C81.js} +1 -1
- package/dist/client/assets/{automation-runs-BJxujaRz.js → automation-runs-1f49gKdv.js} +1 -1
- package/dist/client/assets/{automations-DM2CfSl8.js → automations-CuujfvxS.js} +1 -1
- package/dist/client/assets/{avatar-D9ru8t7J.js → avatar-CG1sYMC3.js} +1 -1
- package/dist/client/assets/{badge-DuDSo4B5.js → badge-DTv3ytkG.js} +1 -1
- package/dist/client/assets/{block-document-Bj42QOMt.js → block-document-pKW_gNRc.js} +1 -1
- package/dist/client/assets/{brand-context-BUhPcaYQ.js → brand-context-CSdoqkrl.js} +1 -1
- package/dist/client/assets/{buckets-bVh7oMEv.js → buckets-9vcDP1Xx.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-88hyriYd.js → bulk-category-panel-Z8lz1ptZ.js} +1 -1
- package/dist/client/assets/{calendar-CyEY0jbs.js → calendar-CSYSRHan.js} +1 -1
- package/dist/client/assets/{capability-load-error-D5Gggd0Y.js → capability-load-error-CI7JffNO.js} +1 -1
- package/dist/client/assets/{card-F2SMEUTI.js → card-Djqe431m.js} +1 -1
- package/dist/client/assets/{category-editor-DW9xGXQm.js → category-editor-BOkZGzvy.js} +1 -1
- package/dist/client/assets/{chat-context-BPHBf2SD.js → chat-context-B9IMqX9H.js} +4 -4
- package/dist/client/assets/{checkbox-ttemAxHh.js → checkbox-g1Xe-Fh0.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CqGPeKLM.js → cli-auth-success-71pX1cOc.js} +1 -1
- package/dist/client/assets/{collection-detail-Dfuq9bfs.js → collection-detail-DSTfsDtj.js} +1 -1
- package/dist/client/assets/{collection-display-button-BRJWc_xO.js → collection-display-button-DqckpPka.js} +1 -1
- package/dist/client/assets/{collection-search-C_lEkJSM.js → collection-search-D8p930-2.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CzY9tIKJ.js → collection-table-wrapper-C4pkDKfG.js} +1 -1
- package/dist/client/assets/{collection-tabs-DKMXuAh7.js → collection-tabs-Btbvy5wZ.js} +1 -1
- package/dist/client/assets/{command-BaN3HpzD.js → command-D8VZgYcp.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-Cbx7Kx6o.js → commerce-onboarding-B_-r2hWt.js} +1 -1
- package/dist/client/assets/{companions-core-DBvnypYt.js → companions-core-C6pGrBaV.js} +1 -1
- package/dist/client/assets/{connect-CsGthfpX.js → connect-Dggz_rgK.js} +1 -1
- package/dist/client/assets/{connection-D4s1OcN3.js → connection-Bm6D5T7s.js} +1 -1
- package/dist/client/assets/{connection-card-ClxMiq53.js → connection-card-DaylHwd8.js} +1 -1
- package/dist/client/assets/{connection-detail-CD343aW8.js → connection-detail-pp291ZsI.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BL_ujE81.js → connection-form-helpers-abaaeWRW.js} +1 -1
- package/dist/client/assets/{connections-CUCSFMwK.js → connections-C-3JQ-RT.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DvMExQy8.js → decopilot-sse-pool-DJTs5v3B.js} +1 -1
- package/dist/client/assets/{dialog-1l6V_AO-.js → dialog-BNEf4h73.js} +1 -1
- package/dist/client/assets/{domain-settings-DNGGLfRt.js → domain-settings-BQw1ZHpG.js} +1 -1
- package/dist/client/assets/{drawer-D_dlIrgq.js → drawer-BOicXoW4.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BSq_T2rN.js → dropdown-menu-B0OSBqF5.js} +1 -1
- package/dist/client/assets/{empty-state-DbpV7XVc.js → empty-state-Jijm8Zjj.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DsmAsG2q.js → extract-connection-data-ByQ1VQpk.js} +1 -1
- package/dist/client/assets/{file-explorer-qDmxYOXW.js → file-explorer-CheIIdH4.js} +2 -2
- package/dist/client/assets/{form-BBhau0Q4.js → form-BoZJqj_8.js} +1 -1
- package/dist/client/assets/{general-DEP7lOkZ.js → general-CtysXkWo.js} +1 -1
- package/dist/client/assets/github-repo-picker-CCSv048C.js +1 -0
- package/dist/client/assets/{hooks-D1TjgNd-.js → hooks-Bl53PFCW.js} +5 -5
- package/dist/client/assets/{index-CiqXq-Gv.js → index-7i5MzulY.js} +1 -1
- package/dist/client/assets/index-BAn2tA3m.js +1 -0
- package/dist/client/assets/{index-C_7kU-Qk.js → index-BB4oQ8m2.js} +1 -1
- package/dist/client/assets/{index-B1Tuj6zE.js → index-BdV3mKMQ.js} +1 -1
- package/dist/client/assets/{index-D8Oyc-Sj.js → index-CzdD7w68.js} +1 -1
- package/dist/client/assets/{index-LnErdRrl.js → index-D7iPCSni.js} +13 -13
- package/dist/client/assets/{index-B1INhWoo.js → index-DBW7-LLJ.js} +6 -6
- package/dist/client/assets/{index-Bg79Fd9u.js → index-DFVpce2g.js} +5 -5
- package/dist/client/assets/{index-CtHwx2FP.js → index-DS1dPTBr.js} +1 -1
- package/dist/client/assets/{index-B09P05BF.js → index-DW8FWTYY.js} +1 -1
- package/dist/client/assets/index-EC0JTBd4.js +1 -0
- package/dist/client/assets/{index-redirect-CSLJ76k2.js → index-redirect-idcaLUlq.js} +1 -1
- package/dist/client/assets/{input-DkjdpI9N.js → input-DM14QBHx.js} +1 -1
- package/dist/client/assets/{integration-icon-eRBxSPRX.js → integration-icon-BjR4OGAx.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-DW8BgMeK.js → invite-member-dialog-D9LT_tFK.js} +1 -1
- package/dist/client/assets/{label-BxyuqrG3.js → label-BEcprhix.js} +1 -1
- package/dist/client/assets/{layout-Cu8cokWN.js → layout-DluG1Vni.js} +1 -1
- package/dist/client/assets/{login-cHpOzdtv.js → login-BUNmGthz.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BWVH0_CJ.js → mcp-oauth-ws9m29vQ.js} +1 -1
- package/dist/client/assets/{members-CywL8X1G.js → members-B2rGjbVl.js} +1 -1
- package/dist/client/assets/{monaco-editor-Mtdo8aZY.js → monaco-editor-DJSyif3I.js} +4 -4
- package/dist/client/assets/{monitoring-stats-row-je0A9zFO.js → monitoring-stats-row-B5xpjD5z.js} +3 -3
- package/dist/client/assets/{multi-select-Cna0azbN.js → multi-select-DX4wKmiL.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-Bz_8J_A5.js → oauth-callback-ai-provider-DYANs1ON.js} +1 -1
- package/dist/client/assets/{oauth-callback-DTQkysno.js → oauth-callback-qhM58XQs.js} +1 -1
- package/dist/client/assets/{onboarding-CjSfkbXS.js → onboarding-WshxsJzF.js} +1 -1
- package/dist/client/assets/{org-layout-BjpSi748.js → org-layout-CvfJlqf0.js} +1 -1
- package/dist/client/assets/{organization-choice-NAhiEtg0.js → organization-choice-CsgXcMIz.js} +1 -1
- package/dist/client/assets/{orgs-CrVyQZvg.js → orgs-CGCwj0aX.js} +1 -1
- package/dist/client/assets/{page-seo-form-vyR-JMew.js → page-seo-form-BUmIrCHq.js} +1 -1
- package/dist/client/assets/{popover-PONP-IrS.js → popover-13d1_Ydy.js} +1 -1
- package/dist/client/assets/{post-editor-DAuwYe2r.js → post-editor-CW3QV3HH.js} +1 -1
- package/dist/client/assets/{primitives-D8K2Kshy.js → primitives-CWnjtxmC.js} +1 -1
- package/dist/client/assets/{profile-YApiO9LU.js → profile-D-gvwVRu.js} +1 -1
- package/dist/client/assets/project-app-view-CWjCgPJM.js +1 -0
- package/dist/client/assets/record-editor-Bhe663KT.js +1 -0
- package/dist/client/assets/{redirect-editor-BTed9W7Z.js → redirect-editor-BQgkHo14.js} +1 -1
- package/dist/client/assets/registry-Dp0LTgEx.js +2 -0
- package/dist/client/assets/{registry-layout-xuewIiFA.js → registry-layout-10se5s7s.js} +1 -1
- package/dist/client/assets/{reports-CNXGX--9.js → reports-B0dg8-1T.js} +1 -1
- package/dist/client/assets/{require-capability-RQbEgO2R.js → require-capability-94N1MpBW.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Cp2xOp41.js → required-auth-layout-DTRJEXT6.js} +1 -1
- package/dist/client/assets/{reset-password-DTmQ8ZLF.js → reset-password-DTqfLCFl.js} +1 -1
- package/dist/client/assets/{roles-DteJLIyV.js → roles-DMaB4I0B.js} +1 -1
- package/dist/client/assets/{search-input-l0QwIQw1.js → search-input-Cav-R6u1.js} +1 -1
- package/dist/client/assets/{secrets-4vWsgQBd.js → secrets-CmQA_lCO.js} +1 -1
- package/dist/client/assets/{sections-editor-C_KhTOCu.js → sections-editor-B1CYJQwI.js} +1 -1
- package/dist/client/assets/{select-model-CUI7TW7J.js → select-model-z0c2dMz_.js} +2 -2
- package/dist/client/assets/{select-CzAV5CH5.js → select-p5o_Bt0F.js} +1 -1
- package/dist/client/assets/self-tool-result-Cgb76l_D.js +1 -0
- package/dist/client/assets/{seo-editor-Dd2fVK23.js → seo-editor-DTdLrmHB.js} +1 -1
- package/dist/client/assets/{settings-layout-DQBiJK3p.js → settings-layout-BnrJScNO.js} +1 -1
- package/dist/client/assets/{settings-section-CoPqg6gm.js → settings-section-CZTjnxlV.js} +1 -1
- package/dist/client/assets/{shell-controls-DZPzbjgh.js → shell-controls-XiJZc3ao.js} +1 -1
- package/dist/client/assets/{shell-layout-BWjH-Sfe.js → shell-layout-CvSnv4Ng.js} +1 -1
- package/dist/client/assets/{sidebar-DD3SRmGs.js → sidebar-BBmlF4Le.js} +1 -1
- package/dist/client/assets/{skeleton-ZVeLusnT.js → skeleton-D5maqyjg.js} +1 -1
- package/dist/client/assets/{spinner-CeQixqey.js → spinner-D09NsuWH.js} +1 -1
- package/dist/client/assets/{sso-ioZ6VXWU.js → sso-DqK4eFK8.js} +1 -1
- package/dist/client/assets/{store-DsMfvWEf.js → store-DRo6GtOx.js} +1 -1
- package/dist/client/assets/store-registry-BfDOrY5J.js +2 -0
- package/dist/client/assets/{studio-tools-QMuOj6-u.js → studio-tools-eC6fCmF6.js} +1 -1
- package/dist/client/assets/{switch-DvFygQiJ.js → switch-DJGvmJgh.js} +1 -1
- package/dist/client/assets/{tab-id-8wArXECU.js → tab-id-ts2R-IK7.js} +1 -1
- package/dist/client/assets/{table-TbcMVTO8.js → table-CUPzY57H.js} +1 -1
- package/dist/client/assets/{tabs-CFfkTu0X.js → tabs-BezZc3NY.js} +1 -1
- package/dist/client/assets/{textarea-DkC87OzG.js → textarea-DHTTJLnr.js} +1 -1
- package/dist/client/assets/{toggle-group-CTKp_-5Y.js → toggle-group-CqJpxcmh.js} +1 -1
- package/dist/client/assets/{toolbar-xTOW3jV5.js → toolbar-8XCdJRqW.js} +1 -1
- package/dist/client/assets/{tooltip-DvQ0XsJD.js → tooltip-fkTa7gIG.js} +1 -1
- package/dist/client/assets/{use-ai-providers-CXx6vxgf.js → use-ai-providers-wy-pIlnl.js} +1 -1
- package/dist/client/assets/{use-automations-CIRY26Sm.js → use-automations-BebUXKcQ.js} +1 -1
- package/dist/client/assets/{use-autosave-BFchLnE-.js → use-autosave-CUZ4cIic.js} +1 -1
- package/dist/client/assets/{use-capability-CbsdK6kc.js → use-capability-D9H3t7HP.js} +1 -1
- package/dist/client/assets/{use-clock-tick-yxMgruH1.js → use-clock-tick-Cso4aNFM.js} +1 -1
- package/dist/client/assets/{use-connection-Crt7Wnf6.js → use-connection-DJ0b1gTC.js} +1 -1
- package/dist/client/assets/{use-copy-D8LT9wzj.js → use-copy-BNgRyC_N.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CYPHz2tM.js → use-create-virtual-mcp-pKJoeitk.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-Bk4kxnd7.js → use-debounced-autosave-B-9KRifB.js} +1 -1
- package/dist/client/assets/{use-debounced-value-C7ql9pQ9.js → use-debounced-value-DrbFDRJg.js} +1 -1
- package/dist/client/assets/{use-deco-credits-D09kZAP8.js → use-deco-credits-DmpIUFXQ.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-C_3NeXEi.js → use-decopilot-events-CPtuygfk.js} +1 -1
- package/dist/client/assets/{use-delete-connection-C37Wf7oV.js → use-delete-connection-Ca978irp.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-s6rTcF1z.js → use-deployment-admin-DG7sPT_s.js} +1 -1
- package/dist/client/assets/{use-file-configs-d0gxFXga.js → use-file-configs-BSbmDdF6.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-GIf_V4mg.js → use-infinite-scroll-BLH47khU.js} +1 -1
- package/dist/client/assets/{use-join-requests-CTSz7464.js → use-join-requests-BFZJlmrE.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-BXPNVCkT.js → use-mcp-auth-status-DtWK2vVN.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Cpe5VVFd.js → use-mcp-client-YC9HMu6y.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-vrGNFP62.js → use-mcp-tools-81zsgjbk.js} +1 -1
- package/dist/client/assets/{use-members-Di-wqSFo.js → use-members-BOo6SBZf.js} +1 -1
- package/dist/client/assets/{use-mobile-BDpXfOGb.js → use-mobile-DaXh9iB4.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-xBQA-nI3.js → use-navigate-to-agent-CwseQD-z.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-xlorPrK7.js → use-org-auth-client-B_HThHi-.js} +1 -1
- package/dist/client/assets/{use-org-sso-BP9JFiDp.js → use-org-sso-vq0R-8A9.js} +1 -1
- package/dist/client/assets/{use-organization-roles-LBstF68U.js → use-organization-roles-C1XBXdGf.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BxnffxCo.js → use-organization-settings-Bi013MJn.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CMbVPAo5.js → use-registry-connections-DHHAMc5J.js} +1 -1
- package/dist/client/assets/{use-secrets-BvEnn7fN.js → use-secrets-BCwf7s42.js} +1 -1
- package/dist/client/assets/{use-status-sounds-Cuh2VhxF.js → use-status-sounds-B4bZcx6E.js} +1 -1
- package/dist/client/assets/{use-tags-Ro4HIuso.js → use-tags-CxtVjJTC.js} +1 -1
- package/dist/client/assets/{use-view-mode-BPzd0kmg.js → use-view-mode-2rHbtOa0.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-CRbRiAY-.js → use-virtual-mcp-Czn5fHtD.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-yZBiNKu9.js +1 -0
- package/dist/client/assets/{useQueries-D1qVck3-.js → useQueries-BIMkg7rJ.js} +1 -1
- package/dist/client/assets/{useRouterState-BK4V-Kyf.js → useRouterState-CQeHJLAo.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CdZRM8uM.js +1 -0
- package/dist/client/assets/{users-DG9dviv7.js → users-CbQWIH4c.js} +1 -1
- package/dist/client/assets/{variant-calendar-B31vNriY.js → variant-calendar-CVBnB48e.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-Ckvgwera.js → view-mode-toggle-CZXwONMQ.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +158 -158
- package/dist/server/server.js +123 -123
- package/package.json +1 -1
- package/dist/client/assets/ai-providers-B61Bdd0p.js +0 -1
- package/dist/client/assets/github-repo-picker-DZFkRYw0.js +0 -1
- package/dist/client/assets/index-D0yzSc_G.js +0 -1
- package/dist/client/assets/index-SpY-wt3w.js +0 -1
- package/dist/client/assets/project-app-view-ZWIwvBP5.js +0 -1
- package/dist/client/assets/record-editor-CzQMCL3u.js +0 -1
- package/dist/client/assets/registry-PrAxBk77.js +0 -2
- package/dist/client/assets/self-tool-result-CFJjEh0u.js +0 -1
- package/dist/client/assets/store-registry-eAQ_7jJi.js +0 -2
- package/dist/client/assets/useInfiniteQuery-C-RqwYQP.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-QRgmbC8e.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as W,b as te,r as Xe,j as n,B as He,a6 as ke,m as Le,aH as Ye,F as Ge,o as We,K as qe,n as Je,e as Ee,p as se,t as G,_ as Ze}from"./index-B1INhWoo.js";import{t as et}from"./ChevronDown-QYK7Lenl.js";import{i as tt}from"./ChevronRight-CWURfvDb.js";import{s as Me}from"./Plus-Bi2kvuIY.js";import{s as st,t as nt}from"./Star01-WZXTBc9P.js";import{s as lt}from"./Trash01-BB8WWZkr.js";import{c as ot,d as rt,b as it,f as at,g as ct,e as dt,a as ft,A as mt}from"./alert-dialog-C9XbRCXw.js";import{P as Ke}from"./index-D8Oyc-Sj.js";import{u as Ve}from"./studio-tools-QMuOj6-u.js";import{u as ut}from"./use-debounced-autosave-Bk4kxnd7.js";import{n as xt}from"./LinkExternal01-DltqAIeP.js";import{i as gt}from"./Zap-fP1c7xXe.js";import{I as we}from"./input-DkjdpI9N.js";import{T as bt}from"./textarea-DkC87OzG.js";import{R as ht}from"./require-capability-RQbEgO2R.js";import"./sidebar-DD3SRmGs.js";import"./LayoutLeft-BV4kR0Cl.js";import"./use-mobile-BDpXfOGb.js";import"./X-BW2EYO4B.js";import"./tooltip-DvQ0XsJD.js";import"./use-capability-CbsdK6kc.js";import"./access-gate-BOsNScRg.js";import"./capability-load-error-D5Gggd0Y.js";function Ie(t){const e=W.c(8),{title:s,children:r,className:l}=t;let o;e[0]!==l?(o=Le("rounded-2xl border border-border/60 bg-background p-5",l),e[0]=l,e[1]=o):o=e[1];let i;e[2]!==s?(i=n.jsx("div",{className:"mb-4",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s})}),e[2]=s,e[3]=i):i=e[3];let a;return e[4]!==r||e[5]!==o||e[6]!==i?(a=n.jsxs("div",{className:o,children:[i,r]}),e[4]=r,e[5]=o,e[6]=i,e[7]=a):a=e[7],a}function pt(t){const e=W.c(41),{onExtract:s,isExtracting:r}=t,l=te(),[o,i]=Xe.useState("");let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-primary/10",children:n.jsx(gt,{size:18,className:"text-primary"})}),e[0]=a):a=e[0];let c;e[1]!==l?(c=l("settings.brandFormSections.autoExtractTitle"),e[1]=l,e[2]=c):c=e[2];let d;e[3]!==c?(d=n.jsx("p",{className:"text-sm font-medium text-foreground",children:c}),e[3]=c,e[4]=d):d=e[4];let j;e[5]!==l?(j=l("settings.brandFormSections.autoExtractDescription"),e[5]=l,e[6]=j):j=e[6];let b;e[7]!==j?(b=n.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:j}),e[7]=j,e[8]=b):b=e[8];let x;e[9]!==l?(x=l("settings.brandFormSections.domainPlaceholder"),e[9]=l,e[10]=x):x=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=_=>i(_.target.value),e[11]=f):f=e[11];let u;e[12]!==o||e[13]!==r||e[14]!==s?(u=_=>{_.key==="Enter"&&o.trim()&&!r&&s(o.trim())},e[12]=o,e[13]=r,e[14]=s,e[15]=u):u=e[15];let h;e[16]!==o||e[17]!==x||e[18]!==u?(h=n.jsx(we,{placeholder:x,value:o,onChange:f,className:"max-w-xs",onKeyDown:u}),e[16]=o,e[17]=x,e[18]=u,e[19]=h):h=e[19];let m;e[20]!==o||e[21]!==r?(m=!o.trim()||r,e[20]=o,e[21]=r,e[22]=m):m=e[22];let g;e[23]!==o||e[24]!==s?(g=()=>s(o.trim()),e[23]=o,e[24]=s,e[25]=g):g=e[25];let N;e[26]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(st,{size:14}),e[26]=N):N=e[26];let p;e[27]!==r||e[28]!==l?(p=l(r?"settings.brandFormSections.extracting":"settings.brandFormSections.extract"),e[27]=r,e[28]=l,e[29]=p):p=e[29];let C;e[30]!==m||e[31]!==g||e[32]!==p?(C=n.jsxs(He,{variant:"outline",disabled:m,onClick:g,children:[N,p]}),e[30]=m,e[31]=g,e[32]=p,e[33]=C):C=e[33];let y;e[34]!==C||e[35]!==h?(y=n.jsxs("div",{className:"mt-3 flex gap-2",children:[h,C]}),e[34]=C,e[35]=h,e[36]=y):y=e[36];let B;return e[37]!==y||e[38]!==d||e[39]!==b?(B=n.jsx("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-5",children:n.jsxs("div",{className:"flex items-start gap-4",children:[a,n.jsxs("div",{className:"flex-1",children:[d,b,y]})]})}),e[37]=y,e[38]=d,e[39]=b,e[40]=B):B=e[40],B}function jt(t){const e=W.c(61),{form:s,onFieldChange:r,onFieldCommit:l}=t,o=te();let i;e[0]!==s?(i=s.watch("domain"),e[0]=s,e[1]=i):i=e[1];const a=i;let c;e[2]!==o?(c=o("settings.brandFormSections.companyOverviewTitle"),e[2]=o,e[3]=c):c=e[3];let d;e[4]!==o?(d=o("settings.brandFormSections.companyNameLabel"),e[4]=o,e[5]=d):d=e[5];let j;e[6]!==d?(j=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:d}),e[6]=d,e[7]=j):j=e[7];let b;e[8]!==r||e[9]!==l||e[10]!==o?(b=O=>{const{field:F}=O;return n.jsx(we,{...F,onChange:A=>{F.onChange(A),r()},onBlur:()=>{F.onBlur(),l()},placeholder:o("settings.brandFormSections.companyNamePlaceholder")})},e[8]=r,e[9]=l,e[10]=o,e[11]=b):b=e[11];let x;e[12]!==s.control||e[13]!==b?(x=n.jsx(ke,{control:s.control,name:"name",render:b}),e[12]=s.control,e[13]=b,e[14]=x):x=e[14];let f;e[15]!==j||e[16]!==x?(f=n.jsxs("div",{children:[j,x]}),e[15]=j,e[16]=x,e[17]=f):f=e[17];let u;e[18]!==o?(u=o("settings.brandFormSections.domainLabel"),e[18]=o,e[19]=u):u=e[19];let h;e[20]!==u?(h=n.jsx("span",{children:u}),e[20]=u,e[21]=h):h=e[21];let m;e[22]!==a||e[23]!==o?(m=a&&n.jsxs("a",{href:`https://${a}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 transition-colors hover:text-foreground",children:[n.jsx(xt,{size:10}),o("settings.brandFormSections.openLink")]}),e[22]=a,e[23]=o,e[24]=m):m=e[24];let g;e[25]!==m||e[26]!==h?(g=n.jsxs("label",{className:"mb-1 flex items-center justify-between text-xs text-muted-foreground",children:[h,m]}),e[25]=m,e[26]=h,e[27]=g):g=e[27];let N;e[28]!==r||e[29]!==l||e[30]!==o?(N=O=>{const{field:F}=O;return n.jsx(we,{...F,onChange:A=>{F.onChange(A),r()},onBlur:()=>{F.onBlur(),l()},placeholder:o("settings.brandFormSections.domainInputPlaceholder")})},e[28]=r,e[29]=l,e[30]=o,e[31]=N):N=e[31];let p;e[32]!==s.control||e[33]!==N?(p=n.jsx(ke,{control:s.control,name:"domain",render:N}),e[32]=s.control,e[33]=N,e[34]=p):p=e[34];let C;e[35]!==g||e[36]!==p?(C=n.jsxs("div",{children:[g,p]}),e[35]=g,e[36]=p,e[37]=C):C=e[37];let y;e[38]!==C||e[39]!==f?(y=n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[f,C]}),e[38]=C,e[39]=f,e[40]=y):y=e[40];let B;e[41]!==o?(B=o("settings.brandFormSections.overviewLabel"),e[41]=o,e[42]=B):B=e[42];let _;e[43]!==B?(_=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:B}),e[43]=B,e[44]=_):_=e[44];let T;e[45]!==r||e[46]!==l||e[47]!==o?(T=O=>{const{field:F}=O;return n.jsx(bt,{...F,onChange:A=>{F.onChange(A),r()},onBlur:()=>{F.onBlur(),l()},placeholder:o("settings.brandFormSections.overviewPlaceholder"),rows:3})},e[45]=r,e[46]=l,e[47]=o,e[48]=T):T=e[48];let k;e[49]!==s.control||e[50]!==T?(k=n.jsx(ke,{control:s.control,name:"overview",render:T}),e[49]=s.control,e[50]=T,e[51]=k):k=e[51];let w;e[52]!==_||e[53]!==k?(w=n.jsxs("div",{children:[_,k]}),e[52]=_,e[53]=k,e[54]=w):w=e[54];let E;e[55]!==y||e[56]!==w?(E=n.jsxs("div",{className:"space-y-3",children:[y,w]}),e[55]=y,e[56]=w,e[57]=E):E=e[57];let R;return e[58]!==c||e[59]!==E?(R=n.jsx(Ie,{title:c,children:E}),e[58]=c,e[59]=E,e[60]=R):R=e[60],R}const Ct={backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"8px 8px",backgroundPosition:"0 0, 4px 4px",backgroundColor:"#fff"};function Ue(t){const e=W.c(24),{form:s,name:r,label:l,imgClassName:o,onFieldChange:i,onFieldCommit:a}=t,c=o===void 0?"h-full w-full object-contain p-3":o,d=te();let j;e[0]!==s||e[1]!==r?(j=s.watch(r),e[0]=s,e[1]=r,e[2]=j):j=e[2];const b=j;let x;e[3]!==c||e[4]!==l||e[5]!==d||e[6]!==b?(x=n.jsx("div",{className:"flex aspect-video w-28 shrink-0 items-center justify-center overflow-hidden rounded-xl",style:Ct,children:b?n.jsx("img",{src:b,alt:l,className:c,loading:"lazy"}):n.jsx("span",{className:"text-[10px] text-muted-foreground/70",children:d("settings.brandFormSections.noImageLabel",{label:l.toLowerCase()})})}),e[3]=c,e[4]=l,e[5]=d,e[6]=b,e[7]=x):x=e[7];let f;e[8]!==l?(f=n.jsxs("label",{className:"mb-1 block text-xs text-muted-foreground",children:[l," URL"]}),e[8]=l,e[9]=f):f=e[9];let u;e[10]!==i||e[11]!==a||e[12]!==d?(u=N=>{const{field:p}=N;return n.jsx(we,{...p,onChange:C=>{p.onChange(C),i()},onBlur:()=>{p.onBlur(),a()},placeholder:d("settings.brandFormSections.urlPlaceholder")})},e[10]=i,e[11]=a,e[12]=d,e[13]=u):u=e[13];let h;e[14]!==s.control||e[15]!==r||e[16]!==u?(h=n.jsx(ke,{control:s.control,name:r,render:u}),e[14]=s.control,e[15]=r,e[16]=u,e[17]=h):h=e[17];let m;e[18]!==f||e[19]!==h?(m=n.jsxs("div",{className:"flex-1",children:[f,h]}),e[18]=f,e[19]=h,e[20]=m):m=e[20];let g;return e[21]!==x||e[22]!==m?(g=n.jsxs("div",{className:"flex items-start gap-3",children:[x,m]}),e[21]=x,e[22]=m,e[23]=g):g=e[23],g}function yt(t){const e=W.c(30),{form:s,onFieldChange:r,onFieldCommit:l}=t,o=te();let i;e[0]!==o?(i=o("settings.brandFormSections.logosImagesTitle"),e[0]=o,e[1]=i):i=e[1];let a;e[2]!==o?(a=o("settings.brandFormSections.logoLabel"),e[2]=o,e[3]=a):a=e[3];let c;e[4]!==s||e[5]!==r||e[6]!==l||e[7]!==a?(c=n.jsx(Ue,{form:s,name:"logo",label:a,onFieldChange:r,onFieldCommit:l}),e[4]=s,e[5]=r,e[6]=l,e[7]=a,e[8]=c):c=e[8];let d;e[9]!==o?(d=o("settings.brandFormSections.faviconLabel"),e[9]=o,e[10]=d):d=e[10];let j;e[11]!==s||e[12]!==r||e[13]!==l||e[14]!==d?(j=n.jsx(Ue,{form:s,name:"favicon",label:d,imgClassName:"h-12 w-12 object-contain",onFieldChange:r,onFieldCommit:l}),e[11]=s,e[12]=r,e[13]=l,e[14]=d,e[15]=j):j=e[15];let b;e[16]!==o?(b=o("settings.brandFormSections.ogImageLabel"),e[16]=o,e[17]=b):b=e[17];let x;e[18]!==s||e[19]!==r||e[20]!==l||e[21]!==b?(x=n.jsx(Ue,{form:s,name:"ogImage",label:b,imgClassName:"h-full w-full object-contain",onFieldChange:r,onFieldCommit:l}),e[18]=s,e[19]=r,e[20]=l,e[21]=b,e[22]=x):x=e[22];let f;e[23]!==c||e[24]!==j||e[25]!==x?(f=n.jsxs("div",{className:"space-y-3",children:[c,j,x]}),e[23]=c,e[24]=j,e[25]=x,e[26]=f):f=e[26];let u;return e[27]!==i||e[28]!==f?(u=n.jsx(Ie,{title:i,children:f}),e[27]=i,e[28]=f,e[29]=u):u=e[29],u}const vt=[{key:"heading",labelKey:"settings.brandFormSections.fontRoleHeading"},{key:"body",labelKey:"settings.brandFormSections.fontRoleBody"},{key:"code",labelKey:"settings.brandFormSections.fontRoleCode"}];function Nt(t){const e=W.c(12),{form:s,onFieldChange:r,onFieldCommit:l}=t,o=te();let i;e[0]!==o?(i=o("settings.brandFormSections.fontsTitle"),e[0]=o,e[1]=i):i=e[1];let a;e[2]!==s||e[3]!==r||e[4]!==l||e[5]!==o?(a=vt.map(j=>{const{key:b,labelKey:x}=j,f=`fonts.${b}`,u=s.watch(f),h=o(x);return n.jsxs("div",{children:[n.jsxs("label",{className:"mb-1 flex items-center gap-3 text-xs text-muted-foreground",children:[n.jsx("span",{className:"w-7 text-base font-medium leading-none text-foreground",children:"Aa"}),n.jsx("span",{children:h}),u&&n.jsx("span",{className:"ml-auto truncate text-foreground",style:{fontFamily:u},children:u})]}),n.jsx(ke,{control:s.control,name:f,render:m=>{const{field:g}=m;return n.jsx(we,{...g,value:g.value??"",onChange:N=>{g.onChange(N),r()},onBlur:()=>{g.onBlur(),l()},placeholder:o("settings.brandFormSections.fontFamilyPlaceholder",{role:h.toLowerCase()})})}})]},b)}),e[2]=s,e[3]=r,e[4]=l,e[5]=o,e[6]=a):a=e[6];let c;e[7]!==a?(c=n.jsx("div",{className:"space-y-2",children:a}),e[7]=a,e[8]=c):c=e[8];let d;return e[9]!==i||e[10]!==c?(d=n.jsx(Ie,{title:i,children:c}),e[9]=i,e[10]=c,e[11]=d):d=e[11],d}const Bt=[{key:"primary",labelKey:"settings.brandFormSections.colorRolePrimary"},{key:"secondary",labelKey:"settings.brandFormSections.colorRoleSecondary"},{key:"accent",labelKey:"settings.brandFormSections.colorRoleAccent"},{key:"background",labelKey:"settings.brandFormSections.colorRoleBackground"},{key:"foreground",labelKey:"settings.brandFormSections.colorRoleForeground"}];function Ft(t){const e=W.c(12),{form:s,onFieldChange:r,onFieldCommit:l}=t,o=te();let i;e[0]!==o?(i=o("settings.brandFormSections.colorsTitle"),e[0]=o,e[1]=i):i=e[1];let a;e[2]!==s||e[3]!==r||e[4]!==l||e[5]!==o?(a=Bt.map(j=>{const{key:b,labelKey:x}=j,f=`colors.${b}`,u=o(x);return n.jsx(ke,{control:s.control,name:f,render:h=>{const{field:m}=h;return n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"color",value:m.value??"#000000",onChange:g=>{m.onChange(g.target.value),r()},onBlur:()=>{m.onBlur(),l()},className:"h-9 w-9 shrink-0 cursor-pointer rounded-lg border border-border bg-transparent p-0.5"}),n.jsx(we,{value:m.value??"",onChange:g=>{m.onChange(g.target.value),r()},onBlur:()=>{m.onBlur(),l()},placeholder:o("settings.brandFormSections.colorPlaceholder"),className:"w-28"}),n.jsx("span",{className:"flex-1 text-xs text-muted-foreground",children:u})]})}},b)}),e[2]=s,e[3]=r,e[4]=l,e[5]=o,e[6]=a):a=e[6];let c;e[7]!==a?(c=n.jsx("div",{className:"space-y-2",children:a}),e[7]=a,e[8]=c):c=e[8];let d;return e[9]!==i||e[10]!==c?(d=n.jsx(Ie,{title:i,children:c}),e[9]=i,e[10]=c,e[11]=d):d=e[11],d}function St(t){const e=W.c(168),{brand:s,onChanged:r}=t,l=te(),o=Ve(),[i,a]=Xe.useState(s.isDefault??!1),[c,d]=Xe.useState(!1),j=s.name??"",b=s.domain??"",x=s.overview??"",f=s.logo??"",u=s.favicon??"",h=s.ogImage??"";let m;e[0]!==s.fonts?(m=s.fonts??{},e[0]=s.fonts,e[1]=m):m=e[1];let g;e[2]!==s.colors?(g=s.colors??{},e[2]=s.colors,e[3]=g):g=e[3];let N;e[4]!==j||e[5]!==b||e[6]!==x||e[7]!==f||e[8]!==u||e[9]!==h||e[10]!==m||e[11]!==g?(N={values:{name:j,domain:b,overview:x,logo:f,favicon:u,ogImage:h,fonts:m,colors:g}},e[4]=j,e[5]=b,e[6]=x,e[7]=f,e[8]=u,e[9]=h,e[10]=m,e[11]=g,e[12]=N):N=e[12];const p=Ze(N);let C;e[13]!==s.id||e[14]!==o?(C=async v=>{const Pe=Object.values(v.fonts).some(Tt),$e=Object.values(v.colors).some(At);await o.call("BRAND_CONTEXT_UPDATE",{id:s.id,name:v.name,domain:v.domain,overview:v.overview,logo:v.logo||null,favicon:v.favicon||null,ogImage:v.ogImage||null,fonts:Pe?v.fonts:null,colors:$e?v.colors:null})},e[13]=s.id,e[14]=o,e[15]=C):C=e[15];let y;e[16]!==l?(y=()=>G.error(l("settings.orgBrandContext.failedSaveBrandContext")),e[16]=l,e[17]=y):y=e[17];let B;e[18]!==C||e[19]!==y?(B={mutationFn:C,onError:y},e[18]=C,e[19]=y,e[20]=B):B=e[20];const _=Ee(B);let T;e[21]!==s.id||e[22]!==p||e[23]!==r||e[24]!==l||e[25]!==_?(T={delayMs:500,save:async()=>{const v=p.control._formState.dirtyFields,Pe=Object.keys(v);if(Pe.length===0)return;const $e=p.getValues(),Qe=p.control._defaultValues;p.reset($e,{keepValues:!0});try{await _.mutateAsync($e),se("brand_updated",{brand_id:s.id,fields:Pe}),G.success(l("settings.orgBrandContext.brandContextUpdated")),r()}catch{p.reset(Qe,{keepValues:!0})}}},e[21]=s.id,e[22]=p,e[23]=r,e[24]=l,e[25]=_,e[26]=T):T=e[26];const{schedule:k,flush:w}=ut(T);let E;e[27]!==s.id||e[28]!==o?(E=async()=>{await o.call("BRAND_CONTEXT_DELETE",{id:s.id})},e[27]=s.id,e[28]=o,e[29]=E):E=e[29];let R;e[30]!==s.id||e[31]!==r||e[32]!==l?(R=()=>{se("brand_deleted",{brand_id:s.id}),d(!1),r(),G.success(l("settings.orgBrandContext.brandDeleted"))},e[30]=s.id,e[31]=r,e[32]=l,e[33]=R):R=e[33];let O;e[34]!==l?(O=()=>G.error(l("settings.orgBrandContext.failedDeleteBrand")),e[34]=l,e[35]=O):O=e[35];let F;e[36]!==E||e[37]!==R||e[38]!==O?(F={mutationFn:E,onSuccess:R,onError:O},e[36]=E,e[37]=R,e[38]=O,e[39]=F):F=e[39];const{mutate:A,isPending:D}=Ee(F);let P;e[40]!==s.id||e[41]!==s.isDefault||e[42]!==o?(P=async()=>{await o.call("BRAND_CONTEXT_UPDATE",{id:s.id,isDefault:!s.isDefault})},e[40]=s.id,e[41]=s.isDefault,e[42]=o,e[43]=P):P=e[43];let $;e[44]!==s.id||e[45]!==s.isDefault||e[46]!==r||e[47]!==l?($=()=>{se(s.isDefault?"brand_unset_as_default":"brand_set_as_default",{brand_id:s.id}),r(),G.success(s.isDefault?l("settings.orgBrandContext.removedAsDefaultBrand"):l("settings.orgBrandContext.setAsDefaultBrand"))},e[44]=s.id,e[45]=s.isDefault,e[46]=r,e[47]=l,e[48]=$):$=e[48];let K;e[49]!==l?(K=()=>G.error(l("settings.orgBrandContext.failedUpdateDefaultBrand")),e[49]=l,e[50]=K):K=e[50];let J;e[51]!==P||e[52]!==$||e[53]!==K?(J={mutationFn:P,onSuccess:$,onError:K},e[51]=P,e[52]=$,e[53]=K,e[54]=J):J=e[54];const{mutate:q}=Ee(J),V=s.isDefault?"border-primary/30":"border-border/60";let L;e[55]!==V?(L=Le("rounded-2xl border bg-background",V),e[55]=V,e[56]=L):L=e[56];let I;e[57]!==i?(I=()=>a(!i),e[57]=i,e[58]=I):I=e[58];let Q;e[59]!==i?(Q=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:i?n.jsx(et,{size:14}):n.jsx(tt,{size:14})}),e[59]=i,e[60]=Q):Q=e[60];let Z;e[61]!==s.logo||e[62]!==s.name?(Z=s.logo?n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg",style:{backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"6px 6px",backgroundPosition:"0 0, 3px 3px",backgroundColor:"#fff"},children:n.jsx("img",{src:s.logo,alt:"",className:"h-full w-full object-contain p-1",onError:Et})}):n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s.name?.charAt(0)?.toUpperCase()||"?"})}),e[61]=s.logo,e[62]=s.name,e[63]=Z):Z=e[63];let M;e[64]!==s.name||e[65]!==l?(M=s.name||l("settings.orgBrandContext.untitledBrand"),e[64]=s.name,e[65]=l,e[66]=M):M=e[66];let Y;e[67]!==M?(Y=n.jsx("span",{className:"text-sm font-medium text-foreground",children:M}),e[67]=M,e[68]=Y):Y=e[68];let z;e[69]!==s.domain?(z=s.domain&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:s.domain}),e[69]=s.domain,e[70]=z):z=e[70];let U;e[71]!==Y||e[72]!==z?(U=n.jsxs("div",{className:"flex flex-1 flex-col items-start gap-0.5 overflow-hidden text-left",children:[Y,z]}),e[71]=Y,e[72]=z,e[73]=U):U=e[73];let X;e[74]!==s.colors||e[75]!==i?(X=!i&&s.colors&&Object.values(s.colors).some(wt)&&n.jsx("div",{className:"flex shrink-0 gap-1",children:Object.entries(s.colors).filter(kt).map(Dt)}),e[74]=s.colors,e[75]=i,e[76]=X):X=e[76];let H;e[77]!==s.fonts||e[78]!==i?(H=!i&&s.fonts&&Object.values(s.fonts).some(_t)&&n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Object.values(s.fonts).filter(Boolean).join(", ")}),e[77]=s.fonts,e[78]=i,e[79]=H):H=e[79];const ee=s.isDefault?"opacity-100":"opacity-0 hover:bg-muted group-hover:opacity-100";let S;e[80]!==ee?(S=Le("flex h-7 w-7 shrink-0 items-center justify-center rounded-lg transition-opacity",ee),e[80]=ee,e[81]=S):S=e[81];let ne,le;e[82]!==q?(ne=v=>{v.stopPropagation(),q()},le=v=>{v.key==="Enter"&&(v.stopPropagation(),q())},e[82]=q,e[83]=ne,e[84]=le):(ne=e[83],le=e[84]);let oe;e[85]!==s.isDefault||e[86]!==l?(oe=s.isDefault?l("settings.orgBrandContext.unsetAsDefault"):l("settings.orgBrandContext.setAsDefault"),e[85]=s.isDefault,e[86]=l,e[87]=oe):oe=e[87];const ze=s.isDefault?"text-primary fill-primary":"text-muted-foreground";let re;e[88]!==ze?(re=Le(ze),e[88]=ze,e[89]=re):re=e[89];let ie;e[90]!==re?(ie=n.jsx(nt,{size:13,className:re}),e[90]=re,e[91]=ie):ie=e[91];let ae;e[92]!==S||e[93]!==ne||e[94]!==le||e[95]!==oe||e[96]!==ie?(ae=n.jsx("span",{role:"button",tabIndex:0,className:S,onClick:ne,onKeyDown:le,title:oe,children:ie}),e[92]=S,e[93]=ne,e[94]=le,e[95]=oe,e[96]=ie,e[97]=ae):ae=e[97];let Ae,Te;e[98]===Symbol.for("react.memo_cache_sentinel")?(Ae=v=>{v.stopPropagation(),d(!0)},Te=v=>{v.key==="Enter"&&(v.stopPropagation(),d(!0))},e[98]=Ae,e[99]=Te):(Ae=e[98],Te=e[99]);let ce;e[100]!==l?(ce=l("settings.orgBrandContext.deleteBrand"),e[100]=l,e[101]=ce):ce=e[101];let Re;e[102]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(lt,{size:13,className:"text-muted-foreground"}),e[102]=Re):Re=e[102];let de;e[103]!==ce?(de=n.jsx("span",{role:"button",tabIndex:0,className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg opacity-0 transition-opacity hover:bg-destructive/10 group-hover:opacity-100",onClick:Ae,onKeyDown:Te,title:ce,children:Re}),e[103]=ce,e[104]=de):de=e[104];let fe;e[105]!==I||e[106]!==Q||e[107]!==Z||e[108]!==U||e[109]!==X||e[110]!==H||e[111]!==ae||e[112]!==de?(fe=n.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 p-5",onClick:I,children:[Q,Z,U,X,H,ae,de]}),e[105]=I,e[106]=Q,e[107]=Z,e[108]=U,e[109]=X,e[110]=H,e[111]=ae,e[112]=de,e[113]=fe):fe=e[113];let me;e[114]!==i||e[115]!==w||e[116]!==p||e[117]!==k?(me=i&&n.jsxs("div",{className:"space-y-3 px-5 pb-5",children:[n.jsx(jt,{form:p,onFieldChange:k,onFieldCommit:w}),n.jsx(yt,{form:p,onFieldChange:k,onFieldCommit:w}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(Ft,{form:p,onFieldChange:k,onFieldCommit:w}),n.jsx(Nt,{form:p,onFieldChange:k,onFieldCommit:w})]})]}),e[114]=i,e[115]=w,e[116]=p,e[117]=k,e[118]=me):me=e[118];let ue;e[119]!==D?(ue=v=>{!v&&!D&&d(!1)},e[119]=D,e[120]=ue):ue=e[120];let xe;e[121]!==l?(xe=l("settings.orgBrandContext.deleteBrandTitle"),e[121]=l,e[122]=xe):xe=e[122];let ge;e[123]!==xe?(ge=n.jsx(ot,{children:xe}),e[123]=xe,e[124]=ge):ge=e[124];let be;e[125]!==s.name||e[126]!==l?(be=l("settings.orgBrandContext.deleteConfirmMessage",{name:s.name||l("settings.orgBrandContext.thisBrand")}),e[125]=s.name,e[126]=l,e[127]=be):be=e[127];let he;e[128]!==be?(he=n.jsx("p",{children:be}),e[128]=be,e[129]=he):he=e[129];let pe;e[130]!==s.isDefault||e[131]!==l?(pe=s.isDefault&&n.jsxs("p",{className:"mt-2 rounded-lg border border-destructive/30 bg-destructive/5 p-2 text-destructive",children:[n.jsxs("span",{className:"font-medium",children:[l("settings.orgBrandContext.headsUp"),":"]})," ",l("settings.orgBrandContext.deleteDefaultBrandWarning")]}),e[130]=s.isDefault,e[131]=l,e[132]=pe):pe=e[132];let je;e[133]!==he||e[134]!==pe?(je=n.jsx(rt,{asChild:!0,children:n.jsxs("div",{children:[he,pe]})}),e[133]=he,e[134]=pe,e[135]=je):je=e[135];let Ce;e[136]!==ge||e[137]!==je?(Ce=n.jsxs(it,{children:[ge,je]}),e[136]=ge,e[137]=je,e[138]=Ce):Ce=e[138];let ye;e[139]!==l?(ye=l("settings.orgBrandContext.cancel"),e[139]=l,e[140]=ye):ye=e[140];let ve;e[141]!==D||e[142]!==ye?(ve=n.jsx(at,{disabled:D,children:ye}),e[141]=D,e[142]=ye,e[143]=ve):ve=e[143];let Ne;e[144]!==A?(Ne=v=>{v.preventDefault(),A()},e[144]=A,e[145]=Ne):Ne=e[145];let Be;e[146]!==D||e[147]!==l?(Be=l(D?"settings.orgBrandContext.deleting":"settings.orgBrandContext.delete"),e[146]=D,e[147]=l,e[148]=Be):Be=e[148];let Fe;e[149]!==D||e[150]!==Ne||e[151]!==Be?(Fe=n.jsx(ct,{onClick:Ne,disabled:D,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Be}),e[149]=D,e[150]=Ne,e[151]=Be,e[152]=Fe):Fe=e[152];let Se;e[153]!==ve||e[154]!==Fe?(Se=n.jsxs(dt,{children:[ve,Fe]}),e[153]=ve,e[154]=Fe,e[155]=Se):Se=e[155];let _e;e[156]!==Ce||e[157]!==Se?(_e=n.jsxs(ft,{children:[Ce,Se]}),e[156]=Ce,e[157]=Se,e[158]=_e):_e=e[158];let De;e[159]!==c||e[160]!==ue||e[161]!==_e?(De=n.jsx(mt,{open:c,onOpenChange:ue,children:_e}),e[159]=c,e[160]=ue,e[161]=_e,e[162]=De):De=e[162];let Oe;return e[163]!==L||e[164]!==fe||e[165]!==me||e[166]!==De?(Oe=n.jsxs("div",{className:L,children:[fe,me,De]}),e[163]=L,e[164]=fe,e[165]=me,e[166]=De,e[167]=Oe):Oe=e[167],Oe}function _t(t){return t}function Dt(t){const[e,s]=t;return n.jsx("div",{className:"h-5 w-5 rounded-full border border-border/40",style:{backgroundColor:s},title:`${e}: ${s}`},e)}function kt(t){const[,e]=t;return e}function wt(t){return t}function Et(t){t.target.style.display="none"}function At(t){return t?.trim()}function Tt(t){return t?.trim()}function Rt(){const t=W.c(77),e=te(),{brandExtractEnabled:s}=Ye(),{org:r}=Ge(),l=Ve(),o=We();let i;t[0]!==r.id?(i=qe.brandContext(r.id),t[0]=r.id,t[1]=i):i=t[1];let a;t[2]!==l?(a=async()=>{const{items:S}=await l.call("BRAND_CONTEXT_LIST",{includeArchived:!1});return S},t[2]=l,t[3]=a):a=t[3];let c;t[4]!==i||t[5]!==a?(c={queryKey:i,queryFn:a},t[4]=i,t[5]=a,t[6]=c):c=t[6];const{data:d}=Je(c),b=(d===void 0?[]:d).filter(Ot);let x;t[7]!==r.id||t[8]!==o?(x=()=>o.invalidateQueries({queryKey:qe.brandContext(r.id),refetchType:"all"}),t[7]=r.id,t[8]=o,t[9]=x):x=t[9];const f=x;let u;t[10]!==l?(u=async()=>{await l.call("BRAND_CONTEXT_CREATE",{name:"New Brand",domain:"example.com",overview:""})},t[10]=l,t[11]=u):u=t[11];let h;t[12]!==f||t[13]!==e?(h=()=>{se("brand_created"),f(),G.success(e("settings.orgBrandContext.brandCreated"))},t[12]=f,t[13]=e,t[14]=h):h=t[14];let m;t[15]!==e?(m=()=>G.error(e("settings.orgBrandContext.failedCreateBrand")),t[15]=e,t[16]=m):m=t[16];let g;t[17]!==u||t[18]!==h||t[19]!==m?(g={mutationFn:u,onSuccess:h,onError:m},t[17]=u,t[18]=h,t[19]=m,t[20]=g):g=t[20];const{mutate:N,isPending:p}=Ee(g);let C;t[21]!==l?(C=async S=>{se("brand_extract_started",{domain:S}),await l.call("BRAND_CONTEXT_EXTRACT",{domain:S})},t[21]=l,t[22]=C):C=t[22];let y;t[23]!==f||t[24]!==e?(y=()=>{se("brand_extract_succeeded"),f(),G.success(e("settings.orgBrandContext.brandExtractedSuccessfully"))},t[23]=f,t[24]=e,t[25]=y):y=t[25];let B;t[26]!==e?(B=S=>{se("brand_extract_failed",{error:S instanceof Error?S.message:"unknown"}),G.error(S instanceof Error?S.message:e("settings.orgBrandContext.failedExtractBrand"))},t[26]=e,t[27]=B):B=t[27];let _;t[28]!==y||t[29]!==B||t[30]!==C?(_={mutationFn:C,onSuccess:y,onError:B},t[28]=y,t[29]=B,t[30]=C,t[31]=_):_=t[31];const{mutate:T,isPending:k}=Ee(_),w=Ke,E=Ke,R=Ke,O="flex flex-col gap-6";let F;t[32]!==e?(F=e("settings.orgBrandContext.brandContext"),t[32]=e,t[33]=F):F=t[33];let A;t[34]!==F?(A=n.jsx(Ke.Title,{children:F}),t[34]=F,t[35]=A):A=t[35];let D;t[36]!==e?(D=e("settings.orgBrandContext.brandContextDescription"),t[36]=e,t[37]=D):D=t[37];let P;t[38]!==D?(P=n.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:D}),t[38]=D,t[39]=P):P=t[39];let $;t[40]!==A||t[41]!==P?($=n.jsxs("div",{children:[A,P]}),t[40]=A,t[41]=P,t[42]=$):$=t[42];let K;t[43]!==N?(K=()=>N(),t[43]=N,t[44]=K):K=t[44];let J;t[45]===Symbol.for("react.memo_cache_sentinel")?(J=n.jsx(Me,{size:14}),t[45]=J):J=t[45];let q;t[46]!==e?(q=e("settings.orgBrandContext.addBrand"),t[46]=e,t[47]=q):q=t[47];let V;t[48]!==p||t[49]!==K||t[50]!==q?(V=n.jsxs(He,{variant:"outline",onClick:K,disabled:p,children:[J,q]}),t[48]=p,t[49]=K,t[50]=q,t[51]=V):V=t[51];let L;t[52]!==$||t[53]!==V?(L=n.jsxs("div",{className:"flex items-center justify-between",children:[$,V]}),t[52]=$,t[53]=V,t[54]=L):L=t[54];let I;t[55]!==s||t[56]!==T||t[57]!==k?(I=s&&n.jsx(pt,{onExtract:S=>T(S),isExtracting:k}),t[55]=s,t[56]=T,t[57]=k,t[58]=I):I=t[58];const Q=b.length===0&&n.jsxs("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-8 text-center",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:e("settings.orgBrandContext.noBrandsConfigured")}),n.jsxs(He,{variant:"outline",size:"sm",className:"mt-3",onClick:()=>N(),disabled:p,children:[n.jsx(Me,{size:14}),e("settings.orgBrandContext.addYourFirstBrand")]})]}),Z="group space-y-3";let M;t[59]!==f?(M=S=>n.jsx(St,{brand:S,onChanged:f},S.id),t[59]=f,t[60]=M):M=t[60];const Y=b.map(M);let z;t[61]!==Y?(z=n.jsx("div",{className:Z,children:Y}),t[61]=Y,t[62]=z):z=t[62];let U;t[63]!==L||t[64]!==I||t[65]!==Q||t[66]!==z?(U=n.jsxs("div",{className:O,children:[L,I,Q,z]}),t[63]=L,t[64]=I,t[65]=Q,t[66]=z,t[67]=U):U=t[67];let X;t[68]!==R.Body||t[69]!==U?(X=n.jsx(R.Body,{children:U}),t[68]=R.Body,t[69]=U,t[70]=X):X=t[70];let H;t[71]!==E.Content||t[72]!==X?(H=n.jsx(E.Content,{children:X}),t[71]=E.Content,t[72]=X,t[73]=H):H=t[73];let ee;return t[74]!==w||t[75]!==H?(ee=n.jsx(w,{children:H}),t[74]=w,t[75]=H,t[76]=ee):ee=t[76],ee}function Ot(t){return!t.archivedAt}function os(){const t=W.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(ht,{capability:"org:manage",area:"brand context",children:n.jsx(Rt,{})}),t[0]=e):e=t[0],e}export{os as default};
|
|
1
|
+
import{c as W,b as te,r as Xe,j as n,B as qe,a7 as ke,m as Le,aI as Ye,F as Ge,o as We,K as He,n as Je,e as Ee,p as se,t as G,$ as Ze}from"./index-DBW7-LLJ.js";import{t as et}from"./ChevronDown-DSAcD82u.js";import{i as tt}from"./ChevronRight-D02mIW0w.js";import{s as Me}from"./Plus-BApQaxo5.js";import{s as st,t as nt}from"./Star01-DGK3WnVL.js";import{s as lt}from"./Trash01-CjLF47KG.js";import{A as ot,a as rt,b as it,c as at,d as ct,e as dt,f as ft,g as mt}from"./alert-dialog-fWZE2eoL.js";import{P as Ke}from"./index-CzdD7w68.js";import{u as Ve}from"./studio-tools-eC6fCmF6.js";import{u as ut}from"./use-debounced-autosave-B-9KRifB.js";import{n as xt}from"./LinkExternal01-CXa8wVjc.js";import{i as gt}from"./Zap-DJXvF0rz.js";import{I as we}from"./input-DM14QBHx.js";import{T as bt}from"./textarea-DHTTJLnr.js";import{R as ht}from"./require-capability-94N1MpBW.js";import"./sidebar-BBmlF4Le.js";import"./LayoutLeft-CaOxvIEl.js";import"./use-mobile-DaXh9iB4.js";import"./X-D-SXXNOh.js";import"./tooltip-fkTa7gIG.js";import"./use-capability-D9H3t7HP.js";import"./access-gate-BKMOmBMY.js";import"./capability-load-error-CI7JffNO.js";function Ie(t){const e=W.c(8),{title:s,children:r,className:l}=t;let o;e[0]!==l?(o=Le("rounded-2xl border border-border/60 bg-background p-5",l),e[0]=l,e[1]=o):o=e[1];let i;e[2]!==s?(i=n.jsx("div",{className:"mb-4",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s})}),e[2]=s,e[3]=i):i=e[3];let a;return e[4]!==r||e[5]!==o||e[6]!==i?(a=n.jsxs("div",{className:o,children:[i,r]}),e[4]=r,e[5]=o,e[6]=i,e[7]=a):a=e[7],a}function pt(t){const e=W.c(41),{onExtract:s,isExtracting:r}=t,l=te(),[o,i]=Xe.useState("");let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-primary/10",children:n.jsx(gt,{size:18,className:"text-primary"})}),e[0]=a):a=e[0];let c;e[1]!==l?(c=l("settings.brandFormSections.autoExtractTitle"),e[1]=l,e[2]=c):c=e[2];let d;e[3]!==c?(d=n.jsx("p",{className:"text-sm font-medium text-foreground",children:c}),e[3]=c,e[4]=d):d=e[4];let j;e[5]!==l?(j=l("settings.brandFormSections.autoExtractDescription"),e[5]=l,e[6]=j):j=e[6];let b;e[7]!==j?(b=n.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:j}),e[7]=j,e[8]=b):b=e[8];let x;e[9]!==l?(x=l("settings.brandFormSections.domainPlaceholder"),e[9]=l,e[10]=x):x=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=_=>i(_.target.value),e[11]=f):f=e[11];let u;e[12]!==o||e[13]!==r||e[14]!==s?(u=_=>{_.key==="Enter"&&o.trim()&&!r&&s(o.trim())},e[12]=o,e[13]=r,e[14]=s,e[15]=u):u=e[15];let h;e[16]!==o||e[17]!==x||e[18]!==u?(h=n.jsx(we,{placeholder:x,value:o,onChange:f,className:"max-w-xs",onKeyDown:u}),e[16]=o,e[17]=x,e[18]=u,e[19]=h):h=e[19];let m;e[20]!==o||e[21]!==r?(m=!o.trim()||r,e[20]=o,e[21]=r,e[22]=m):m=e[22];let g;e[23]!==o||e[24]!==s?(g=()=>s(o.trim()),e[23]=o,e[24]=s,e[25]=g):g=e[25];let N;e[26]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(st,{size:14}),e[26]=N):N=e[26];let p;e[27]!==r||e[28]!==l?(p=l(r?"settings.brandFormSections.extracting":"settings.brandFormSections.extract"),e[27]=r,e[28]=l,e[29]=p):p=e[29];let C;e[30]!==m||e[31]!==g||e[32]!==p?(C=n.jsxs(qe,{variant:"outline",disabled:m,onClick:g,children:[N,p]}),e[30]=m,e[31]=g,e[32]=p,e[33]=C):C=e[33];let y;e[34]!==C||e[35]!==h?(y=n.jsxs("div",{className:"mt-3 flex gap-2",children:[h,C]}),e[34]=C,e[35]=h,e[36]=y):y=e[36];let B;return e[37]!==y||e[38]!==d||e[39]!==b?(B=n.jsx("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-5",children:n.jsxs("div",{className:"flex items-start gap-4",children:[a,n.jsxs("div",{className:"flex-1",children:[d,b,y]})]})}),e[37]=y,e[38]=d,e[39]=b,e[40]=B):B=e[40],B}function jt(t){const e=W.c(61),{form:s,onFieldChange:r,onFieldCommit:l}=t,o=te();let i;e[0]!==s?(i=s.watch("domain"),e[0]=s,e[1]=i):i=e[1];const a=i;let c;e[2]!==o?(c=o("settings.brandFormSections.companyOverviewTitle"),e[2]=o,e[3]=c):c=e[3];let d;e[4]!==o?(d=o("settings.brandFormSections.companyNameLabel"),e[4]=o,e[5]=d):d=e[5];let j;e[6]!==d?(j=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:d}),e[6]=d,e[7]=j):j=e[7];let b;e[8]!==r||e[9]!==l||e[10]!==o?(b=O=>{const{field:F}=O;return n.jsx(we,{...F,onChange:A=>{F.onChange(A),r()},onBlur:()=>{F.onBlur(),l()},placeholder:o("settings.brandFormSections.companyNamePlaceholder")})},e[8]=r,e[9]=l,e[10]=o,e[11]=b):b=e[11];let x;e[12]!==s.control||e[13]!==b?(x=n.jsx(ke,{control:s.control,name:"name",render:b}),e[12]=s.control,e[13]=b,e[14]=x):x=e[14];let f;e[15]!==j||e[16]!==x?(f=n.jsxs("div",{children:[j,x]}),e[15]=j,e[16]=x,e[17]=f):f=e[17];let u;e[18]!==o?(u=o("settings.brandFormSections.domainLabel"),e[18]=o,e[19]=u):u=e[19];let h;e[20]!==u?(h=n.jsx("span",{children:u}),e[20]=u,e[21]=h):h=e[21];let m;e[22]!==a||e[23]!==o?(m=a&&n.jsxs("a",{href:`https://${a}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 transition-colors hover:text-foreground",children:[n.jsx(xt,{size:10}),o("settings.brandFormSections.openLink")]}),e[22]=a,e[23]=o,e[24]=m):m=e[24];let g;e[25]!==m||e[26]!==h?(g=n.jsxs("label",{className:"mb-1 flex items-center justify-between text-xs text-muted-foreground",children:[h,m]}),e[25]=m,e[26]=h,e[27]=g):g=e[27];let N;e[28]!==r||e[29]!==l||e[30]!==o?(N=O=>{const{field:F}=O;return n.jsx(we,{...F,onChange:A=>{F.onChange(A),r()},onBlur:()=>{F.onBlur(),l()},placeholder:o("settings.brandFormSections.domainInputPlaceholder")})},e[28]=r,e[29]=l,e[30]=o,e[31]=N):N=e[31];let p;e[32]!==s.control||e[33]!==N?(p=n.jsx(ke,{control:s.control,name:"domain",render:N}),e[32]=s.control,e[33]=N,e[34]=p):p=e[34];let C;e[35]!==g||e[36]!==p?(C=n.jsxs("div",{children:[g,p]}),e[35]=g,e[36]=p,e[37]=C):C=e[37];let y;e[38]!==C||e[39]!==f?(y=n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[f,C]}),e[38]=C,e[39]=f,e[40]=y):y=e[40];let B;e[41]!==o?(B=o("settings.brandFormSections.overviewLabel"),e[41]=o,e[42]=B):B=e[42];let _;e[43]!==B?(_=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:B}),e[43]=B,e[44]=_):_=e[44];let T;e[45]!==r||e[46]!==l||e[47]!==o?(T=O=>{const{field:F}=O;return n.jsx(bt,{...F,onChange:A=>{F.onChange(A),r()},onBlur:()=>{F.onBlur(),l()},placeholder:o("settings.brandFormSections.overviewPlaceholder"),rows:3})},e[45]=r,e[46]=l,e[47]=o,e[48]=T):T=e[48];let k;e[49]!==s.control||e[50]!==T?(k=n.jsx(ke,{control:s.control,name:"overview",render:T}),e[49]=s.control,e[50]=T,e[51]=k):k=e[51];let w;e[52]!==_||e[53]!==k?(w=n.jsxs("div",{children:[_,k]}),e[52]=_,e[53]=k,e[54]=w):w=e[54];let E;e[55]!==y||e[56]!==w?(E=n.jsxs("div",{className:"space-y-3",children:[y,w]}),e[55]=y,e[56]=w,e[57]=E):E=e[57];let R;return e[58]!==c||e[59]!==E?(R=n.jsx(Ie,{title:c,children:E}),e[58]=c,e[59]=E,e[60]=R):R=e[60],R}const Ct={backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"8px 8px",backgroundPosition:"0 0, 4px 4px",backgroundColor:"#fff"};function Ue(t){const e=W.c(24),{form:s,name:r,label:l,imgClassName:o,onFieldChange:i,onFieldCommit:a}=t,c=o===void 0?"h-full w-full object-contain p-3":o,d=te();let j;e[0]!==s||e[1]!==r?(j=s.watch(r),e[0]=s,e[1]=r,e[2]=j):j=e[2];const b=j;let x;e[3]!==c||e[4]!==l||e[5]!==d||e[6]!==b?(x=n.jsx("div",{className:"flex aspect-video w-28 shrink-0 items-center justify-center overflow-hidden rounded-xl",style:Ct,children:b?n.jsx("img",{src:b,alt:l,className:c,loading:"lazy"}):n.jsx("span",{className:"text-[10px] text-muted-foreground/70",children:d("settings.brandFormSections.noImageLabel",{label:l.toLowerCase()})})}),e[3]=c,e[4]=l,e[5]=d,e[6]=b,e[7]=x):x=e[7];let f;e[8]!==l?(f=n.jsxs("label",{className:"mb-1 block text-xs text-muted-foreground",children:[l," URL"]}),e[8]=l,e[9]=f):f=e[9];let u;e[10]!==i||e[11]!==a||e[12]!==d?(u=N=>{const{field:p}=N;return n.jsx(we,{...p,onChange:C=>{p.onChange(C),i()},onBlur:()=>{p.onBlur(),a()},placeholder:d("settings.brandFormSections.urlPlaceholder")})},e[10]=i,e[11]=a,e[12]=d,e[13]=u):u=e[13];let h;e[14]!==s.control||e[15]!==r||e[16]!==u?(h=n.jsx(ke,{control:s.control,name:r,render:u}),e[14]=s.control,e[15]=r,e[16]=u,e[17]=h):h=e[17];let m;e[18]!==f||e[19]!==h?(m=n.jsxs("div",{className:"flex-1",children:[f,h]}),e[18]=f,e[19]=h,e[20]=m):m=e[20];let g;return e[21]!==x||e[22]!==m?(g=n.jsxs("div",{className:"flex items-start gap-3",children:[x,m]}),e[21]=x,e[22]=m,e[23]=g):g=e[23],g}function yt(t){const e=W.c(30),{form:s,onFieldChange:r,onFieldCommit:l}=t,o=te();let i;e[0]!==o?(i=o("settings.brandFormSections.logosImagesTitle"),e[0]=o,e[1]=i):i=e[1];let a;e[2]!==o?(a=o("settings.brandFormSections.logoLabel"),e[2]=o,e[3]=a):a=e[3];let c;e[4]!==s||e[5]!==r||e[6]!==l||e[7]!==a?(c=n.jsx(Ue,{form:s,name:"logo",label:a,onFieldChange:r,onFieldCommit:l}),e[4]=s,e[5]=r,e[6]=l,e[7]=a,e[8]=c):c=e[8];let d;e[9]!==o?(d=o("settings.brandFormSections.faviconLabel"),e[9]=o,e[10]=d):d=e[10];let j;e[11]!==s||e[12]!==r||e[13]!==l||e[14]!==d?(j=n.jsx(Ue,{form:s,name:"favicon",label:d,imgClassName:"h-12 w-12 object-contain",onFieldChange:r,onFieldCommit:l}),e[11]=s,e[12]=r,e[13]=l,e[14]=d,e[15]=j):j=e[15];let b;e[16]!==o?(b=o("settings.brandFormSections.ogImageLabel"),e[16]=o,e[17]=b):b=e[17];let x;e[18]!==s||e[19]!==r||e[20]!==l||e[21]!==b?(x=n.jsx(Ue,{form:s,name:"ogImage",label:b,imgClassName:"h-full w-full object-contain",onFieldChange:r,onFieldCommit:l}),e[18]=s,e[19]=r,e[20]=l,e[21]=b,e[22]=x):x=e[22];let f;e[23]!==c||e[24]!==j||e[25]!==x?(f=n.jsxs("div",{className:"space-y-3",children:[c,j,x]}),e[23]=c,e[24]=j,e[25]=x,e[26]=f):f=e[26];let u;return e[27]!==i||e[28]!==f?(u=n.jsx(Ie,{title:i,children:f}),e[27]=i,e[28]=f,e[29]=u):u=e[29],u}const vt=[{key:"heading",labelKey:"settings.brandFormSections.fontRoleHeading"},{key:"body",labelKey:"settings.brandFormSections.fontRoleBody"},{key:"code",labelKey:"settings.brandFormSections.fontRoleCode"}];function Nt(t){const e=W.c(12),{form:s,onFieldChange:r,onFieldCommit:l}=t,o=te();let i;e[0]!==o?(i=o("settings.brandFormSections.fontsTitle"),e[0]=o,e[1]=i):i=e[1];let a;e[2]!==s||e[3]!==r||e[4]!==l||e[5]!==o?(a=vt.map(j=>{const{key:b,labelKey:x}=j,f=`fonts.${b}`,u=s.watch(f),h=o(x);return n.jsxs("div",{children:[n.jsxs("label",{className:"mb-1 flex items-center gap-3 text-xs text-muted-foreground",children:[n.jsx("span",{className:"w-7 text-base font-medium leading-none text-foreground",children:"Aa"}),n.jsx("span",{children:h}),u&&n.jsx("span",{className:"ml-auto truncate text-foreground",style:{fontFamily:u},children:u})]}),n.jsx(ke,{control:s.control,name:f,render:m=>{const{field:g}=m;return n.jsx(we,{...g,value:g.value??"",onChange:N=>{g.onChange(N),r()},onBlur:()=>{g.onBlur(),l()},placeholder:o("settings.brandFormSections.fontFamilyPlaceholder",{role:h.toLowerCase()})})}})]},b)}),e[2]=s,e[3]=r,e[4]=l,e[5]=o,e[6]=a):a=e[6];let c;e[7]!==a?(c=n.jsx("div",{className:"space-y-2",children:a}),e[7]=a,e[8]=c):c=e[8];let d;return e[9]!==i||e[10]!==c?(d=n.jsx(Ie,{title:i,children:c}),e[9]=i,e[10]=c,e[11]=d):d=e[11],d}const Bt=[{key:"primary",labelKey:"settings.brandFormSections.colorRolePrimary"},{key:"secondary",labelKey:"settings.brandFormSections.colorRoleSecondary"},{key:"accent",labelKey:"settings.brandFormSections.colorRoleAccent"},{key:"background",labelKey:"settings.brandFormSections.colorRoleBackground"},{key:"foreground",labelKey:"settings.brandFormSections.colorRoleForeground"}];function Ft(t){const e=W.c(12),{form:s,onFieldChange:r,onFieldCommit:l}=t,o=te();let i;e[0]!==o?(i=o("settings.brandFormSections.colorsTitle"),e[0]=o,e[1]=i):i=e[1];let a;e[2]!==s||e[3]!==r||e[4]!==l||e[5]!==o?(a=Bt.map(j=>{const{key:b,labelKey:x}=j,f=`colors.${b}`,u=o(x);return n.jsx(ke,{control:s.control,name:f,render:h=>{const{field:m}=h;return n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"color",value:m.value??"#000000",onChange:g=>{m.onChange(g.target.value),r()},onBlur:()=>{m.onBlur(),l()},className:"h-9 w-9 shrink-0 cursor-pointer rounded-lg border border-border bg-transparent p-0.5"}),n.jsx(we,{value:m.value??"",onChange:g=>{m.onChange(g.target.value),r()},onBlur:()=>{m.onBlur(),l()},placeholder:o("settings.brandFormSections.colorPlaceholder"),className:"w-28"}),n.jsx("span",{className:"flex-1 text-xs text-muted-foreground",children:u})]})}},b)}),e[2]=s,e[3]=r,e[4]=l,e[5]=o,e[6]=a):a=e[6];let c;e[7]!==a?(c=n.jsx("div",{className:"space-y-2",children:a}),e[7]=a,e[8]=c):c=e[8];let d;return e[9]!==i||e[10]!==c?(d=n.jsx(Ie,{title:i,children:c}),e[9]=i,e[10]=c,e[11]=d):d=e[11],d}function St(t){const e=W.c(168),{brand:s,onChanged:r}=t,l=te(),o=Ve(),[i,a]=Xe.useState(s.isDefault??!1),[c,d]=Xe.useState(!1),j=s.name??"",b=s.domain??"",x=s.overview??"",f=s.logo??"",u=s.favicon??"",h=s.ogImage??"";let m;e[0]!==s.fonts?(m=s.fonts??{},e[0]=s.fonts,e[1]=m):m=e[1];let g;e[2]!==s.colors?(g=s.colors??{},e[2]=s.colors,e[3]=g):g=e[3];let N;e[4]!==j||e[5]!==b||e[6]!==x||e[7]!==f||e[8]!==u||e[9]!==h||e[10]!==m||e[11]!==g?(N={values:{name:j,domain:b,overview:x,logo:f,favicon:u,ogImage:h,fonts:m,colors:g}},e[4]=j,e[5]=b,e[6]=x,e[7]=f,e[8]=u,e[9]=h,e[10]=m,e[11]=g,e[12]=N):N=e[12];const p=Ze(N);let C;e[13]!==s.id||e[14]!==o?(C=async v=>{const Pe=Object.values(v.fonts).some(Tt),$e=Object.values(v.colors).some(At);await o.call("BRAND_CONTEXT_UPDATE",{id:s.id,name:v.name,domain:v.domain,overview:v.overview,logo:v.logo||null,favicon:v.favicon||null,ogImage:v.ogImage||null,fonts:Pe?v.fonts:null,colors:$e?v.colors:null})},e[13]=s.id,e[14]=o,e[15]=C):C=e[15];let y;e[16]!==l?(y=()=>G.error(l("settings.orgBrandContext.failedSaveBrandContext")),e[16]=l,e[17]=y):y=e[17];let B;e[18]!==C||e[19]!==y?(B={mutationFn:C,onError:y},e[18]=C,e[19]=y,e[20]=B):B=e[20];const _=Ee(B);let T;e[21]!==s.id||e[22]!==p||e[23]!==r||e[24]!==l||e[25]!==_?(T={delayMs:500,save:async()=>{const v=p.control._formState.dirtyFields,Pe=Object.keys(v);if(Pe.length===0)return;const $e=p.getValues(),Qe=p.control._defaultValues;p.reset($e,{keepValues:!0});try{await _.mutateAsync($e),se("brand_updated",{brand_id:s.id,fields:Pe}),G.success(l("settings.orgBrandContext.brandContextUpdated")),r()}catch{p.reset(Qe,{keepValues:!0})}}},e[21]=s.id,e[22]=p,e[23]=r,e[24]=l,e[25]=_,e[26]=T):T=e[26];const{schedule:k,flush:w}=ut(T);let E;e[27]!==s.id||e[28]!==o?(E=async()=>{await o.call("BRAND_CONTEXT_DELETE",{id:s.id})},e[27]=s.id,e[28]=o,e[29]=E):E=e[29];let R;e[30]!==s.id||e[31]!==r||e[32]!==l?(R=()=>{se("brand_deleted",{brand_id:s.id}),d(!1),r(),G.success(l("settings.orgBrandContext.brandDeleted"))},e[30]=s.id,e[31]=r,e[32]=l,e[33]=R):R=e[33];let O;e[34]!==l?(O=()=>G.error(l("settings.orgBrandContext.failedDeleteBrand")),e[34]=l,e[35]=O):O=e[35];let F;e[36]!==E||e[37]!==R||e[38]!==O?(F={mutationFn:E,onSuccess:R,onError:O},e[36]=E,e[37]=R,e[38]=O,e[39]=F):F=e[39];const{mutate:A,isPending:D}=Ee(F);let P;e[40]!==s.id||e[41]!==s.isDefault||e[42]!==o?(P=async()=>{await o.call("BRAND_CONTEXT_UPDATE",{id:s.id,isDefault:!s.isDefault})},e[40]=s.id,e[41]=s.isDefault,e[42]=o,e[43]=P):P=e[43];let $;e[44]!==s.id||e[45]!==s.isDefault||e[46]!==r||e[47]!==l?($=()=>{se(s.isDefault?"brand_unset_as_default":"brand_set_as_default",{brand_id:s.id}),r(),G.success(s.isDefault?l("settings.orgBrandContext.removedAsDefaultBrand"):l("settings.orgBrandContext.setAsDefaultBrand"))},e[44]=s.id,e[45]=s.isDefault,e[46]=r,e[47]=l,e[48]=$):$=e[48];let K;e[49]!==l?(K=()=>G.error(l("settings.orgBrandContext.failedUpdateDefaultBrand")),e[49]=l,e[50]=K):K=e[50];let J;e[51]!==P||e[52]!==$||e[53]!==K?(J={mutationFn:P,onSuccess:$,onError:K},e[51]=P,e[52]=$,e[53]=K,e[54]=J):J=e[54];const{mutate:H}=Ee(J),V=s.isDefault?"border-primary/30":"border-border/60";let L;e[55]!==V?(L=Le("rounded-2xl border bg-background",V),e[55]=V,e[56]=L):L=e[56];let I;e[57]!==i?(I=()=>a(!i),e[57]=i,e[58]=I):I=e[58];let Q;e[59]!==i?(Q=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:i?n.jsx(et,{size:14}):n.jsx(tt,{size:14})}),e[59]=i,e[60]=Q):Q=e[60];let Z;e[61]!==s.logo||e[62]!==s.name?(Z=s.logo?n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg",style:{backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"6px 6px",backgroundPosition:"0 0, 3px 3px",backgroundColor:"#fff"},children:n.jsx("img",{src:s.logo,alt:"",className:"h-full w-full object-contain p-1",onError:Et})}):n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s.name?.charAt(0)?.toUpperCase()||"?"})}),e[61]=s.logo,e[62]=s.name,e[63]=Z):Z=e[63];let M;e[64]!==s.name||e[65]!==l?(M=s.name||l("settings.orgBrandContext.untitledBrand"),e[64]=s.name,e[65]=l,e[66]=M):M=e[66];let Y;e[67]!==M?(Y=n.jsx("span",{className:"text-sm font-medium text-foreground",children:M}),e[67]=M,e[68]=Y):Y=e[68];let z;e[69]!==s.domain?(z=s.domain&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:s.domain}),e[69]=s.domain,e[70]=z):z=e[70];let U;e[71]!==Y||e[72]!==z?(U=n.jsxs("div",{className:"flex flex-1 flex-col items-start gap-0.5 overflow-hidden text-left",children:[Y,z]}),e[71]=Y,e[72]=z,e[73]=U):U=e[73];let X;e[74]!==s.colors||e[75]!==i?(X=!i&&s.colors&&Object.values(s.colors).some(wt)&&n.jsx("div",{className:"flex shrink-0 gap-1",children:Object.entries(s.colors).filter(kt).map(Dt)}),e[74]=s.colors,e[75]=i,e[76]=X):X=e[76];let q;e[77]!==s.fonts||e[78]!==i?(q=!i&&s.fonts&&Object.values(s.fonts).some(_t)&&n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Object.values(s.fonts).filter(Boolean).join(", ")}),e[77]=s.fonts,e[78]=i,e[79]=q):q=e[79];const ee=s.isDefault?"opacity-100":"opacity-0 hover:bg-muted group-hover:opacity-100";let S;e[80]!==ee?(S=Le("flex h-7 w-7 shrink-0 items-center justify-center rounded-lg transition-opacity",ee),e[80]=ee,e[81]=S):S=e[81];let ne,le;e[82]!==H?(ne=v=>{v.stopPropagation(),H()},le=v=>{v.key==="Enter"&&(v.stopPropagation(),H())},e[82]=H,e[83]=ne,e[84]=le):(ne=e[83],le=e[84]);let oe;e[85]!==s.isDefault||e[86]!==l?(oe=s.isDefault?l("settings.orgBrandContext.unsetAsDefault"):l("settings.orgBrandContext.setAsDefault"),e[85]=s.isDefault,e[86]=l,e[87]=oe):oe=e[87];const ze=s.isDefault?"text-primary fill-primary":"text-muted-foreground";let re;e[88]!==ze?(re=Le(ze),e[88]=ze,e[89]=re):re=e[89];let ie;e[90]!==re?(ie=n.jsx(nt,{size:13,className:re}),e[90]=re,e[91]=ie):ie=e[91];let ae;e[92]!==S||e[93]!==ne||e[94]!==le||e[95]!==oe||e[96]!==ie?(ae=n.jsx("span",{role:"button",tabIndex:0,className:S,onClick:ne,onKeyDown:le,title:oe,children:ie}),e[92]=S,e[93]=ne,e[94]=le,e[95]=oe,e[96]=ie,e[97]=ae):ae=e[97];let Ae,Te;e[98]===Symbol.for("react.memo_cache_sentinel")?(Ae=v=>{v.stopPropagation(),d(!0)},Te=v=>{v.key==="Enter"&&(v.stopPropagation(),d(!0))},e[98]=Ae,e[99]=Te):(Ae=e[98],Te=e[99]);let ce;e[100]!==l?(ce=l("settings.orgBrandContext.deleteBrand"),e[100]=l,e[101]=ce):ce=e[101];let Re;e[102]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(lt,{size:13,className:"text-muted-foreground"}),e[102]=Re):Re=e[102];let de;e[103]!==ce?(de=n.jsx("span",{role:"button",tabIndex:0,className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg opacity-0 transition-opacity hover:bg-destructive/10 group-hover:opacity-100",onClick:Ae,onKeyDown:Te,title:ce,children:Re}),e[103]=ce,e[104]=de):de=e[104];let fe;e[105]!==I||e[106]!==Q||e[107]!==Z||e[108]!==U||e[109]!==X||e[110]!==q||e[111]!==ae||e[112]!==de?(fe=n.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 p-5",onClick:I,children:[Q,Z,U,X,q,ae,de]}),e[105]=I,e[106]=Q,e[107]=Z,e[108]=U,e[109]=X,e[110]=q,e[111]=ae,e[112]=de,e[113]=fe):fe=e[113];let me;e[114]!==i||e[115]!==w||e[116]!==p||e[117]!==k?(me=i&&n.jsxs("div",{className:"space-y-3 px-5 pb-5",children:[n.jsx(jt,{form:p,onFieldChange:k,onFieldCommit:w}),n.jsx(yt,{form:p,onFieldChange:k,onFieldCommit:w}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(Ft,{form:p,onFieldChange:k,onFieldCommit:w}),n.jsx(Nt,{form:p,onFieldChange:k,onFieldCommit:w})]})]}),e[114]=i,e[115]=w,e[116]=p,e[117]=k,e[118]=me):me=e[118];let ue;e[119]!==D?(ue=v=>{!v&&!D&&d(!1)},e[119]=D,e[120]=ue):ue=e[120];let xe;e[121]!==l?(xe=l("settings.orgBrandContext.deleteBrandTitle"),e[121]=l,e[122]=xe):xe=e[122];let ge;e[123]!==xe?(ge=n.jsx(ot,{children:xe}),e[123]=xe,e[124]=ge):ge=e[124];let be;e[125]!==s.name||e[126]!==l?(be=l("settings.orgBrandContext.deleteConfirmMessage",{name:s.name||l("settings.orgBrandContext.thisBrand")}),e[125]=s.name,e[126]=l,e[127]=be):be=e[127];let he;e[128]!==be?(he=n.jsx("p",{children:be}),e[128]=be,e[129]=he):he=e[129];let pe;e[130]!==s.isDefault||e[131]!==l?(pe=s.isDefault&&n.jsxs("p",{className:"mt-2 rounded-lg border border-destructive/30 bg-destructive/5 p-2 text-destructive",children:[n.jsxs("span",{className:"font-medium",children:[l("settings.orgBrandContext.headsUp"),":"]})," ",l("settings.orgBrandContext.deleteDefaultBrandWarning")]}),e[130]=s.isDefault,e[131]=l,e[132]=pe):pe=e[132];let je;e[133]!==he||e[134]!==pe?(je=n.jsx(rt,{asChild:!0,children:n.jsxs("div",{children:[he,pe]})}),e[133]=he,e[134]=pe,e[135]=je):je=e[135];let Ce;e[136]!==ge||e[137]!==je?(Ce=n.jsxs(it,{children:[ge,je]}),e[136]=ge,e[137]=je,e[138]=Ce):Ce=e[138];let ye;e[139]!==l?(ye=l("settings.orgBrandContext.cancel"),e[139]=l,e[140]=ye):ye=e[140];let ve;e[141]!==D||e[142]!==ye?(ve=n.jsx(at,{disabled:D,children:ye}),e[141]=D,e[142]=ye,e[143]=ve):ve=e[143];let Ne;e[144]!==A?(Ne=v=>{v.preventDefault(),A()},e[144]=A,e[145]=Ne):Ne=e[145];let Be;e[146]!==D||e[147]!==l?(Be=l(D?"settings.orgBrandContext.deleting":"settings.orgBrandContext.delete"),e[146]=D,e[147]=l,e[148]=Be):Be=e[148];let Fe;e[149]!==D||e[150]!==Ne||e[151]!==Be?(Fe=n.jsx(ct,{onClick:Ne,disabled:D,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Be}),e[149]=D,e[150]=Ne,e[151]=Be,e[152]=Fe):Fe=e[152];let Se;e[153]!==ve||e[154]!==Fe?(Se=n.jsxs(dt,{children:[ve,Fe]}),e[153]=ve,e[154]=Fe,e[155]=Se):Se=e[155];let _e;e[156]!==Ce||e[157]!==Se?(_e=n.jsxs(ft,{children:[Ce,Se]}),e[156]=Ce,e[157]=Se,e[158]=_e):_e=e[158];let De;e[159]!==c||e[160]!==ue||e[161]!==_e?(De=n.jsx(mt,{open:c,onOpenChange:ue,children:_e}),e[159]=c,e[160]=ue,e[161]=_e,e[162]=De):De=e[162];let Oe;return e[163]!==L||e[164]!==fe||e[165]!==me||e[166]!==De?(Oe=n.jsxs("div",{className:L,children:[fe,me,De]}),e[163]=L,e[164]=fe,e[165]=me,e[166]=De,e[167]=Oe):Oe=e[167],Oe}function _t(t){return t}function Dt(t){const[e,s]=t;return n.jsx("div",{className:"h-5 w-5 rounded-full border border-border/40",style:{backgroundColor:s},title:`${e}: ${s}`},e)}function kt(t){const[,e]=t;return e}function wt(t){return t}function Et(t){t.target.style.display="none"}function At(t){return t?.trim()}function Tt(t){return t?.trim()}function Rt(){const t=W.c(77),e=te(),{brandExtractEnabled:s}=Ye(),{org:r}=Ge(),l=Ve(),o=We();let i;t[0]!==r.id?(i=He.brandContext(r.id),t[0]=r.id,t[1]=i):i=t[1];let a;t[2]!==l?(a=async()=>{const{items:S}=await l.call("BRAND_CONTEXT_LIST",{includeArchived:!1});return S},t[2]=l,t[3]=a):a=t[3];let c;t[4]!==i||t[5]!==a?(c={queryKey:i,queryFn:a},t[4]=i,t[5]=a,t[6]=c):c=t[6];const{data:d}=Je(c),b=(d===void 0?[]:d).filter(Ot);let x;t[7]!==r.id||t[8]!==o?(x=()=>o.invalidateQueries({queryKey:He.brandContext(r.id),refetchType:"all"}),t[7]=r.id,t[8]=o,t[9]=x):x=t[9];const f=x;let u;t[10]!==l?(u=async()=>{await l.call("BRAND_CONTEXT_CREATE",{name:"New Brand",domain:"example.com",overview:""})},t[10]=l,t[11]=u):u=t[11];let h;t[12]!==f||t[13]!==e?(h=()=>{se("brand_created"),f(),G.success(e("settings.orgBrandContext.brandCreated"))},t[12]=f,t[13]=e,t[14]=h):h=t[14];let m;t[15]!==e?(m=()=>G.error(e("settings.orgBrandContext.failedCreateBrand")),t[15]=e,t[16]=m):m=t[16];let g;t[17]!==u||t[18]!==h||t[19]!==m?(g={mutationFn:u,onSuccess:h,onError:m},t[17]=u,t[18]=h,t[19]=m,t[20]=g):g=t[20];const{mutate:N,isPending:p}=Ee(g);let C;t[21]!==l?(C=async S=>{se("brand_extract_started",{domain:S}),await l.call("BRAND_CONTEXT_EXTRACT",{domain:S})},t[21]=l,t[22]=C):C=t[22];let y;t[23]!==f||t[24]!==e?(y=()=>{se("brand_extract_succeeded"),f(),G.success(e("settings.orgBrandContext.brandExtractedSuccessfully"))},t[23]=f,t[24]=e,t[25]=y):y=t[25];let B;t[26]!==e?(B=S=>{se("brand_extract_failed",{error:S instanceof Error?S.message:"unknown"}),G.error(S instanceof Error?S.message:e("settings.orgBrandContext.failedExtractBrand"))},t[26]=e,t[27]=B):B=t[27];let _;t[28]!==y||t[29]!==B||t[30]!==C?(_={mutationFn:C,onSuccess:y,onError:B},t[28]=y,t[29]=B,t[30]=C,t[31]=_):_=t[31];const{mutate:T,isPending:k}=Ee(_),w=Ke,E=Ke,R=Ke,O="flex flex-col gap-6";let F;t[32]!==e?(F=e("settings.orgBrandContext.brandContext"),t[32]=e,t[33]=F):F=t[33];let A;t[34]!==F?(A=n.jsx(Ke.Title,{children:F}),t[34]=F,t[35]=A):A=t[35];let D;t[36]!==e?(D=e("settings.orgBrandContext.brandContextDescription"),t[36]=e,t[37]=D):D=t[37];let P;t[38]!==D?(P=n.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:D}),t[38]=D,t[39]=P):P=t[39];let $;t[40]!==A||t[41]!==P?($=n.jsxs("div",{children:[A,P]}),t[40]=A,t[41]=P,t[42]=$):$=t[42];let K;t[43]!==N?(K=()=>N(),t[43]=N,t[44]=K):K=t[44];let J;t[45]===Symbol.for("react.memo_cache_sentinel")?(J=n.jsx(Me,{size:14}),t[45]=J):J=t[45];let H;t[46]!==e?(H=e("settings.orgBrandContext.addBrand"),t[46]=e,t[47]=H):H=t[47];let V;t[48]!==p||t[49]!==K||t[50]!==H?(V=n.jsxs(qe,{variant:"outline",onClick:K,disabled:p,children:[J,H]}),t[48]=p,t[49]=K,t[50]=H,t[51]=V):V=t[51];let L;t[52]!==$||t[53]!==V?(L=n.jsxs("div",{className:"flex items-center justify-between",children:[$,V]}),t[52]=$,t[53]=V,t[54]=L):L=t[54];let I;t[55]!==s||t[56]!==T||t[57]!==k?(I=s&&n.jsx(pt,{onExtract:S=>T(S),isExtracting:k}),t[55]=s,t[56]=T,t[57]=k,t[58]=I):I=t[58];const Q=b.length===0&&n.jsxs("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-8 text-center",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:e("settings.orgBrandContext.noBrandsConfigured")}),n.jsxs(qe,{variant:"outline",size:"sm",className:"mt-3",onClick:()=>N(),disabled:p,children:[n.jsx(Me,{size:14}),e("settings.orgBrandContext.addYourFirstBrand")]})]}),Z="group space-y-3";let M;t[59]!==f?(M=S=>n.jsx(St,{brand:S,onChanged:f},S.id),t[59]=f,t[60]=M):M=t[60];const Y=b.map(M);let z;t[61]!==Y?(z=n.jsx("div",{className:Z,children:Y}),t[61]=Y,t[62]=z):z=t[62];let U;t[63]!==L||t[64]!==I||t[65]!==Q||t[66]!==z?(U=n.jsxs("div",{className:O,children:[L,I,Q,z]}),t[63]=L,t[64]=I,t[65]=Q,t[66]=z,t[67]=U):U=t[67];let X;t[68]!==R.Body||t[69]!==U?(X=n.jsx(R.Body,{children:U}),t[68]=R.Body,t[69]=U,t[70]=X):X=t[70];let q;t[71]!==E.Content||t[72]!==X?(q=n.jsx(E.Content,{children:X}),t[71]=E.Content,t[72]=X,t[73]=q):q=t[73];let ee;return t[74]!==w||t[75]!==q?(ee=n.jsx(w,{children:q}),t[74]=w,t[75]=q,t[76]=ee):ee=t[76],ee}function Ot(t){return!t.archivedAt}function os(){const t=W.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(ht,{capability:"org:manage",area:"brand context",children:n.jsx(Rt,{})}),t[0]=e):e=t[0],e}export{os as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as T,b as F,j as t,r as C,E as W,B as L,t as K}from"./index-B1INhWoo.js";import{i as X}from"./AlertCircle-DH3qtgBe.js";import{i as I}from"./HardDrive-BuNe2d8F.js";import{s as V}from"./Plus-Bi2kvuIY.js";import{s as Y}from"./Trash01-BB8WWZkr.js";import{g as Z,c as ee,d as te,b as se,f as ie,e as le,a as ne,A as re}from"./alert-dialog-C9XbRCXw.js";import{e as ce,d as ae,a as oe,b as de,h as ue,c as me}from"./dialog-1l6V_AO-.js";import{I as P}from"./input-DkjdpI9N.js";import{L as B}from"./label-BxyuqrG3.js";import{S as fe,a as ge,b as xe,c as pe,d as q}from"./select-CzAV5CH5.js";import{S as he}from"./switch-DvFygQiJ.js";import{S as be}from"./skeleton-ZVeLusnT.js";import{T as je}from"./textarea-DkC87OzG.js";import{P as E}from"./index-D8Oyc-Sj.js";import{c as ke}from"./settings-section-CoPqg6gm.js";import{u as ye,b as ve,c as Se}from"./use-file-configs-d0gxFXga.js";import{R as Ce}from"./require-capability-RQbEgO2R.js";import"./X-BW2EYO4B.js";import"./tooltip-DvQ0XsJD.js";import"./Check-lBHxT1HX.js";import"./ChevronDown-QYK7Lenl.js";import"./ChevronUp-BMvYccDe.js";import"./sidebar-DD3SRmGs.js";import"./LayoutLeft-BV4kR0Cl.js";import"./use-mobile-BDpXfOGb.js";import"./card-F2SMEUTI.js";import"./ArrowUpRight-Cc2KMNxL.js";import"./studio-tools-QMuOj6-u.js";import"./use-capability-CbsdK6kc.js";import"./access-gate-BOsNScRg.js";import"./capability-load-error-D5Gggd0Y.js";function Ne(i,e){if(!(i instanceof Error))return e;const s=i.message.match(/\[\s*\{[\s\S]*\}\s*\]/);if(s)try{const l=JSON.parse(s[0])[0];if(l?.message){const n=l.path?.join(".");return n?`${n}: ${l.message}`:l.message}}catch{}return i.message||e}function Be(i){const e=T.c(6),{error:s}=i,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(X,{size:16}),e[0]=l):l=e[0];let n;e[1]!==s.message||e[2]!==r?(n=r("settings.buckets.failedToLoadConfigs",{error:s.message}),e[1]=s.message,e[2]=r,e[3]=n):n=e[3];let c;return e[4]!==n?(c=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,t.jsx("span",{className:"text-sm font-medium",children:n})]}),e[4]=n,e[5]=c):c=e[5],c}function Pe(i){const e=T.c(51),{config:s,onDelete:r}=i,l=F();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(I,{size:16,className:"text-muted-foreground"})}),e[0]=n):n=e[0];let c;e[1]!==s.name?(c=t.jsx("span",{className:"font-medium text-sm truncate",children:s.name}),e[1]=s.name,e[2]=c):c=e[2];let a;e[3]!==s.credentialType||e[4]!==l?(a=s.credentialType==="sts-session"?t.jsx("span",{className:"text-[10px] uppercase tracking-wide font-medium px-1.5 py-0.5 rounded bg-muted text-muted-foreground shrink-0",children:"STS"}):s.credentialType==="managed"?t.jsx("span",{className:"text-[10px] uppercase tracking-wide font-medium px-1.5 py-0.5 rounded bg-muted text-muted-foreground shrink-0",children:l("settings.buckets.managed")}):null,e[3]=s.credentialType,e[4]=l,e[5]=a):a=e[5];let u;e[6]!==s.bucket||e[7]!==s.region?(u=t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:[s.bucket," · ",s.region]}),e[6]=s.bucket,e[7]=s.region,e[8]=u):u=e[8];let o;e[9]!==c||e[10]!==a||e[11]!==u?(o=t.jsxs("div",{className:"flex items-center gap-2",children:[c,a,u]}),e[9]=c,e[10]=a,e[11]=u,e[12]=o):o=e[12];let g;e[13]!==s.description?(g=s.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:s.description}):null,e[13]=s.description,e[14]=g):g=e[14];let d;e[15]!==s.endpoint||e[16]!==s.forcePathStyle||e[17]!==l?(d=s.endpoint?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:[s.endpoint,s.forcePathStyle?` (${l("settings.buckets.pathStyle")})`:""]}):null,e[15]=s.endpoint,e[16]=s.forcePathStyle,e[17]=l,e[18]=d):d=e[18];let f;e[19]!==s.prefix||e[20]!==l?(f=s.prefix?t.jsx("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:l("settings.buckets.prefix",{prefix:s.prefix})}):null,e[19]=s.prefix,e[20]=l,e[21]=f):f=e[21];let m;e[22]!==s.publicUrlBase||e[23]!==l?(m=s.publicUrlBase?t.jsx("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:l("settings.buckets.public",{url:s.publicUrlBase})}):null,e[22]=s.publicUrlBase,e[23]=l,e[24]=m):m=e[24];let b;e[25]!==o||e[26]!==g||e[27]!==d||e[28]!==f||e[29]!==m?(b=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[n,t.jsxs("div",{className:"min-w-0",children:[o,g,d,f,m]})]}),e[25]=o,e[26]=g,e[27]=d,e[28]=f,e[29]=m,e[30]=b):b=e[30];let j;e[31]!==s.createdAt?(j=new Date(s.createdAt).toLocaleDateString(),e[31]=s.createdAt,e[32]=j):j=e[32];let S;e[33]!==j?(S=t.jsx("span",{className:"text-xs text-muted-foreground",children:j}),e[33]=j,e[34]=S):S=e[34];let v;e[35]!==s||e[36]!==r?(v=()=>r(s),e[35]=s,e[36]=r,e[37]=v):v=e[37];let k;e[38]!==s.name||e[39]!==l?(k=l("settings.buckets.deleteButton",{name:s.name}),e[38]=s.name,e[39]=l,e[40]=k):k=e[40];let y;e[41]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Y,{size:14}),e[41]=y):y=e[41];let x;e[42]!==v||e[43]!==k?(x=t.jsx(L,{variant:"ghost",size:"sm",onClick:v,"aria-label":k,children:y}),e[42]=v,e[43]=k,e[44]=x):x=e[44];let p;e[45]!==S||e[46]!==x?(p=t.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[S,x]}),e[45]=S,e[46]=x,e[47]=p):p=e[47];let N;return e[48]!==b||e[49]!==p?(N=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[b,p]}),e[48]=b,e[49]=p,e[50]=N):N=e[50],N}function De(i){const e=T.c(21),{onCreate:s}=i,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(I,{size:20,className:"text-muted-foreground"})}),e[0]=l):l=e[0];let n;e[1]!==r?(n=r("settings.buckets.noBucketsConfigured"),e[1]=r,e[2]=n):n=e[2];let c;e[3]!==n?(c=t.jsx("p",{className:"font-medium text-sm",children:n}),e[3]=n,e[4]=c):c=e[4];let a;e[5]!==r?(a=r("settings.buckets.emptyStateDescription"),e[5]=r,e[6]=a):a=e[6];let u;e[7]!==a?(u=t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:a}),e[7]=a,e[8]=u):u=e[8];let o;e[9]!==c||e[10]!==u?(o=t.jsxs("div",{children:[c,u]}),e[9]=c,e[10]=u,e[11]=o):o=e[11];let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(V,{size:14}),e[12]=g):g=e[12];let d;e[13]!==r?(d=r("settings.buckets.addBucket"),e[13]=r,e[14]=d):d=e[14];let f;e[15]!==s||e[16]!==d?(f=t.jsxs(L,{onClick:s,size:"sm",className:"mt-2",children:[g,d]}),e[15]=s,e[16]=d,e[17]=f):f=e[17];let m;return e[18]!==o||e[19]!==f?(m=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[l,o,f]}),e[18]=o,e[19]=f,e[20]=m):m=e[20],m}function O({open:i,onOpenChange:e}){const s=F(),[r,l]=C.useState(""),[n,c]=C.useState(""),[a,u]=C.useState(""),[o,g]=C.useState(""),[d,f]=C.useState(""),[m,b]=C.useState(!1),[j,S]=C.useState(""),[v,k]=C.useState(""),[y,x]=C.useState("static"),[p,N]=C.useState(""),[D,w]=C.useState(""),[_,A]=C.useState(""),[$,z]=C.useState(""),U=ve();function H(){l(""),c(""),u(""),g(""),f(""),b(!1),S(""),k(""),x("static"),N(""),w(""),A(""),z("")}const R=y==="sts-session"?!!(_.trim()&&$.trim()):!!(p&&D);async function J(h){if(h.preventDefault(),!r.trim()||!a.trim()||!o.trim()||!R)return;const M=y==="sts-session"?{credentialType:"sts-session",refreshUrl:_.trim(),apiKey:$.trim()}:{credentialType:"static",accessKeyId:p,secretAccessKey:D};try{await U.mutateAsync({name:r.trim(),description:n.trim()||void 0,bucket:a.trim(),region:o.trim(),endpoint:d.trim()||void 0,forcePathStyle:m,prefix:j.trim()||void 0,publicUrlBase:v.trim()||void 0,...M}),K.success(s("settings.buckets.bucketAdded",{name:r.trim()})),H(),e(!1)}catch(Q){K.error(Ne(Q,s("settings.buckets.failedToAddBucket")))}}const G=U.isPending||!r.trim()||!a.trim()||!o.trim()||!R;return t.jsx(ce,{open:i,onOpenChange:e,children:t.jsxs(ae,{className:"sm:max-w-lg max-h-[90vh] overflow-y-auto",children:[t.jsxs(oe,{children:[t.jsx(de,{children:s("settings.buckets.addS3Bucket")}),t.jsx(ue,{children:s("settings.buckets.credentialsEncryptedDescription")})]}),t.jsxs("form",{onSubmit:J,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-name",children:s("settings.buckets.nameLabel")}),t.jsx(P,{id:"file-config-name",value:r,onChange:h=>l(h.target.value),placeholder:s("settings.buckets.namePlaceholder"),autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("settings.buckets.nameHelperText")})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-bucket",children:s("settings.buckets.bucketLabel")}),t.jsx(P,{id:"file-config-bucket",value:a,onChange:h=>u(h.target.value),placeholder:s("settings.buckets.bucketPlaceholder"),autoComplete:"off",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-region",children:s("settings.buckets.regionLabel")}),t.jsx(P,{id:"file-config-region",value:o,onChange:h=>g(h.target.value),placeholder:s("settings.buckets.regionPlaceholder"),autoComplete:"off",required:!0})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-endpoint",children:s("settings.buckets.endpointLabel")}),t.jsx(P,{id:"file-config-endpoint",type:"url",value:d,onChange:h=>f(h.target.value),placeholder:s("settings.buckets.endpointPlaceholder"),autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("settings.buckets.endpointHelperText")})]}),t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-border/60 p-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx(B,{htmlFor:"file-config-path-style",className:"text-sm",children:s("settings.buckets.forcePathStyleLabel")}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:s("settings.buckets.forcePathStyleHelperText")})]}),t.jsx(he,{id:"file-config-path-style",checked:m,onCheckedChange:b})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-prefix",children:s("settings.buckets.prefixLabel")}),t.jsx(P,{id:"file-config-prefix",value:j,onChange:h=>S(h.target.value),placeholder:s("settings.buckets.prefixPlaceholder"),autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("settings.buckets.prefixHelperText")})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-public-url-base",children:s("settings.buckets.publicUrlBaseLabel")}),t.jsx(P,{id:"file-config-public-url-base",type:"url",value:v,onChange:h=>k(h.target.value),placeholder:s("settings.buckets.publicUrlBasePlaceholder"),autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("settings.buckets.publicUrlBaseHelperText")})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-credential-type",children:s("settings.buckets.credentialsLabel")}),t.jsxs(fe,{value:y,onValueChange:h=>x(h),children:[t.jsx(ge,{id:"file-config-credential-type",className:"w-full",children:t.jsx(xe,{})}),t.jsxs(pe,{children:[t.jsx(q,{value:"static",children:s("settings.buckets.staticKeyOption")}),t.jsx(q,{value:"sts-session",children:s("settings.buckets.temporarySessionOption")})]})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s(y==="sts-session"?"settings.buckets.stsSessionHelperText":"settings.buckets.staticKeyHelperText")})]}),y==="static"?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-access-key",children:s("settings.buckets.accessKeyIdLabel")}),t.jsx(P,{id:"file-config-access-key",value:p,onChange:h=>N(h.target.value),autoComplete:"off",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-secret-key",children:s("settings.buckets.secretAccessKeyLabel")}),t.jsx(P,{id:"file-config-secret-key",type:"password",value:D,onChange:h=>w(h.target.value),autoComplete:"new-password",required:!0})]})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-refresh-url",children:s("settings.buckets.refreshUrlLabel")}),t.jsx(P,{id:"file-config-refresh-url",type:"url",value:_,onChange:h=>A(h.target.value),placeholder:s("settings.buckets.refreshUrlPlaceholder"),autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("settings.buckets.refreshUrlHelperText")})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-api-key",children:s("settings.buckets.apiKeyLabel")}),t.jsx(P,{id:"file-config-api-key",type:"password",value:$,onChange:h=>z(h.target.value),autoComplete:"new-password",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("settings.buckets.apiKeyHelperText")})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-description",children:s("settings.buckets.descriptionLabel")}),t.jsx(je,{id:"file-config-description",value:n,onChange:h=>c(h.target.value),rows:2,placeholder:s("settings.buckets.descriptionPlaceholder")})]}),t.jsxs(me,{children:[t.jsx(L,{type:"button",variant:"outline",onClick:()=>{H(),e(!1)},disabled:U.isPending,children:s("settings.buckets.cancelButton")}),t.jsx(L,{type:"submit",disabled:G,children:U.isPending?s("settings.buckets.addingButton"):s("settings.buckets.addBucketButton")})]})]})]})})}function Te(i){const e=T.c(41),{config:s,onClose:r}=i,l=F(),n=Se();let c;e[0]!==s||e[1]!==n||e[2]!==r||e[3]!==l?(c=async function(){if(s)try{await n.mutateAsync(s.id),K.success(l("settings.buckets.bucketRemoved",{name:s.name})),r()}catch(_){const A=_;K.error(A instanceof Error?A.message:l("settings.buckets.failedToRemoveBucket"))}},e[0]=s,e[1]=n,e[2]=r,e[3]=l,e[4]=c):c=e[4];const a=c,u=s!==null;let o;e[5]!==r?(o=w=>!w&&r(),e[5]=r,e[6]=o):o=e[6];let g;e[7]!==l?(g=l("settings.buckets.removeBucketTitle"),e[7]=l,e[8]=g):g=e[8];let d;e[9]!==g?(d=t.jsx(ee,{children:g}),e[9]=g,e[10]=d):d=e[10];const f=s?.name??"";let m;e[11]!==l||e[12]!==f?(m=l("settings.buckets.removeBucketDescription",{name:f}),e[11]=l,e[12]=f,e[13]=m):m=e[13];let b;e[14]!==m?(b=t.jsx(te,{children:m}),e[14]=m,e[15]=b):b=e[15];let j;e[16]!==d||e[17]!==b?(j=t.jsxs(se,{children:[d,b]}),e[16]=d,e[17]=b,e[18]=j):j=e[18];const S=n.isPending;let v;e[19]!==l?(v=l("settings.buckets.cancelButton"),e[19]=l,e[20]=v):v=e[20];let k;e[21]!==n.isPending||e[22]!==v?(k=t.jsx(ie,{disabled:S,children:v}),e[21]=n.isPending,e[22]=v,e[23]=k):k=e[23];let y;e[24]!==n.isPending||e[25]!==l?(y=n.isPending?l("settings.buckets.removingButton"):l("settings.buckets.removeButton"),e[24]=n.isPending,e[25]=l,e[26]=y):y=e[26];let x;e[27]!==n.isPending||e[28]!==a||e[29]!==y?(x=t.jsx(Z,{onClick:a,disabled:n.isPending,children:y}),e[27]=n.isPending,e[28]=a,e[29]=y,e[30]=x):x=e[30];let p;e[31]!==k||e[32]!==x?(p=t.jsxs(le,{children:[k,x]}),e[31]=k,e[32]=x,e[33]=p):p=e[33];let N;e[34]!==p||e[35]!==j?(N=t.jsxs(ne,{children:[j,p]}),e[34]=p,e[35]=j,e[36]=N):N=e[36];let D;return e[37]!==N||e[38]!==u||e[39]!==o?(D=t.jsx(re,{open:u,onOpenChange:o,children:N}),e[37]=N,e[38]=u,e[39]=o,e[40]=D):D=e[40],D}function Fe(){const i=T.c(32),e=F(),s=ye(),[r,l]=C.useState(!1),[n,c]=C.useState(null);if(s.length===0){let x;i[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(De,{onCreate:()=>l(!0)}),i[0]=x):x=i[0];let p;return i[1]!==r?(p=t.jsxs(t.Fragment,{children:[x,t.jsx(O,{open:r,onOpenChange:l})]}),i[1]=r,i[2]=p):p=i[2],p}let a;i[3]!==s.length||i[4]!==e?(a=e("settings.buckets.bucketsConfigured",{count:s.length}),i[3]=s.length,i[4]=e,i[5]=a):a=i[5];let u;i[6]!==a?(u=t.jsx("p",{className:"text-sm text-muted-foreground",children:a}),i[6]=a,i[7]=u):u=i[7];let o;i[8]===Symbol.for("react.memo_cache_sentinel")?(o=()=>l(!0),i[8]=o):o=i[8];let g;i[9]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(V,{size:14}),i[9]=g):g=i[9];let d;i[10]!==e?(d=e("settings.buckets.addBucket"),i[10]=e,i[11]=d):d=i[11];let f;i[12]!==d?(f=t.jsxs(L,{onClick:o,size:"sm",children:[g,d]}),i[12]=d,i[13]=f):f=i[13];let m;i[14]!==u||i[15]!==f?(m=t.jsxs("div",{className:"flex items-center justify-between",children:[u,f]}),i[14]=u,i[15]=f,i[16]=m):m=i[16];let b;if(i[17]!==s){let x;i[19]===Symbol.for("react.memo_cache_sentinel")?(x=p=>t.jsx(Pe,{config:p,onDelete:c},p.id),i[19]=x):x=i[19],b=s.map(x),i[17]=s,i[18]=b}else b=i[18];let j;i[20]!==b?(j=t.jsx("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:t.jsx("div",{children:b})}),i[20]=b,i[21]=j):j=i[21];let S;i[22]!==r?(S=t.jsx(O,{open:r,onOpenChange:l}),i[22]=r,i[23]=S):S=i[23];let v;i[24]===Symbol.for("react.memo_cache_sentinel")?(v=()=>c(null),i[24]=v):v=i[24];let k;i[25]!==n?(k=t.jsx(Te,{config:n,onClose:v}),i[25]=n,i[26]=k):k=i[26];let y;return i[27]!==k||i[28]!==m||i[29]!==j||i[30]!==S?(y=t.jsxs(t.Fragment,{children:[m,j,S,k]}),i[27]=k,i[28]=m,i[29]=j,i[30]=S,i[31]=y):y=i[31],y}function we(){const i=T.c(12),e=F();let s;i[0]!==e?(s=e("settings.buckets.pageTitle"),i[0]=e,i[1]=s):s=i[1];let r;i[2]!==s?(r=t.jsx(E.Title,{children:s}),i[2]=s,i[3]=r):r=i[3];let l;i[4]!==e?(l=u=>{const{error:o}=u;return t.jsx(Be,{error:o??new Error(e("settings.buckets.failedToLoadConfigsFallback"))})},i[4]=e,i[5]=l):l=i[5];let n;i[6]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(C.Suspense,{fallback:t.jsx(be,{className:"h-32 w-full"}),children:t.jsx(Fe,{})}),i[6]=n):n=i[6];let c;i[7]!==l?(c=t.jsx(W,{fallback:l,children:n}),i[7]=l,i[8]=c):c=i[8];let a;return i[9]!==r||i[10]!==c?(a=t.jsx(E,{children:t.jsx(E.Content,{children:t.jsx(E.Body,{children:t.jsxs(ke,{children:[r,c]})})})}),i[9]=r,i[10]=c,i[11]=a):a=i[11],a}function ot(){const i=T.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ce,{capability:"file-configs:manage",area:"files",children:t.jsx(we,{})}),i[0]=e):e=i[0],e}export{ot as default};
|
|
1
|
+
import{c as T,b as F,j as t,r as C,E as W,B as L,t as K}from"./index-DBW7-LLJ.js";import{i as X}from"./AlertCircle-Cd8M35Wb.js";import{i as I}from"./HardDrive-2n4L-vNW.js";import{s as V}from"./Plus-BApQaxo5.js";import{s as Y}from"./Trash01-CjLF47KG.js";import{d as Z,A as ee,a as te,b as se,c as ie,e as le,f as ne,g as re}from"./alert-dialog-fWZE2eoL.js";import{e as ce,d as ae,a as oe,b as de,h as ue,c as me}from"./dialog-BNEf4h73.js";import{I as P}from"./input-DM14QBHx.js";import{L as B}from"./label-BEcprhix.js";import{S as fe,a as ge,b as xe,c as pe,d as q}from"./select-p5o_Bt0F.js";import{S as he}from"./switch-DJGvmJgh.js";import{S as be}from"./skeleton-D5maqyjg.js";import{T as je}from"./textarea-DHTTJLnr.js";import{P as E}from"./index-CzdD7w68.js";import{c as ke}from"./settings-section-CZTjnxlV.js";import{u as ye,b as ve,c as Se}from"./use-file-configs-BSbmDdF6.js";import{R as Ce}from"./require-capability-94N1MpBW.js";import"./X-D-SXXNOh.js";import"./tooltip-fkTa7gIG.js";import"./Check-CK_e8wdj.js";import"./ChevronDown-DSAcD82u.js";import"./ChevronUp-BqqaHKfG.js";import"./sidebar-BBmlF4Le.js";import"./LayoutLeft-CaOxvIEl.js";import"./use-mobile-DaXh9iB4.js";import"./card-Djqe431m.js";import"./ArrowUpRight-CCEVlmCI.js";import"./studio-tools-eC6fCmF6.js";import"./use-capability-D9H3t7HP.js";import"./access-gate-BKMOmBMY.js";import"./capability-load-error-CI7JffNO.js";function Ne(i,e){if(!(i instanceof Error))return e;const s=i.message.match(/\[\s*\{[\s\S]*\}\s*\]/);if(s)try{const l=JSON.parse(s[0])[0];if(l?.message){const n=l.path?.join(".");return n?`${n}: ${l.message}`:l.message}}catch{}return i.message||e}function Be(i){const e=T.c(6),{error:s}=i,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(X,{size:16}),e[0]=l):l=e[0];let n;e[1]!==s.message||e[2]!==r?(n=r("settings.buckets.failedToLoadConfigs",{error:s.message}),e[1]=s.message,e[2]=r,e[3]=n):n=e[3];let c;return e[4]!==n?(c=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,t.jsx("span",{className:"text-sm font-medium",children:n})]}),e[4]=n,e[5]=c):c=e[5],c}function Pe(i){const e=T.c(51),{config:s,onDelete:r}=i,l=F();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(I,{size:16,className:"text-muted-foreground"})}),e[0]=n):n=e[0];let c;e[1]!==s.name?(c=t.jsx("span",{className:"font-medium text-sm truncate",children:s.name}),e[1]=s.name,e[2]=c):c=e[2];let a;e[3]!==s.credentialType||e[4]!==l?(a=s.credentialType==="sts-session"?t.jsx("span",{className:"text-[10px] uppercase tracking-wide font-medium px-1.5 py-0.5 rounded bg-muted text-muted-foreground shrink-0",children:"STS"}):s.credentialType==="managed"?t.jsx("span",{className:"text-[10px] uppercase tracking-wide font-medium px-1.5 py-0.5 rounded bg-muted text-muted-foreground shrink-0",children:l("settings.buckets.managed")}):null,e[3]=s.credentialType,e[4]=l,e[5]=a):a=e[5];let u;e[6]!==s.bucket||e[7]!==s.region?(u=t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:[s.bucket," · ",s.region]}),e[6]=s.bucket,e[7]=s.region,e[8]=u):u=e[8];let o;e[9]!==c||e[10]!==a||e[11]!==u?(o=t.jsxs("div",{className:"flex items-center gap-2",children:[c,a,u]}),e[9]=c,e[10]=a,e[11]=u,e[12]=o):o=e[12];let g;e[13]!==s.description?(g=s.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:s.description}):null,e[13]=s.description,e[14]=g):g=e[14];let d;e[15]!==s.endpoint||e[16]!==s.forcePathStyle||e[17]!==l?(d=s.endpoint?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:[s.endpoint,s.forcePathStyle?` (${l("settings.buckets.pathStyle")})`:""]}):null,e[15]=s.endpoint,e[16]=s.forcePathStyle,e[17]=l,e[18]=d):d=e[18];let f;e[19]!==s.prefix||e[20]!==l?(f=s.prefix?t.jsx("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:l("settings.buckets.prefix",{prefix:s.prefix})}):null,e[19]=s.prefix,e[20]=l,e[21]=f):f=e[21];let m;e[22]!==s.publicUrlBase||e[23]!==l?(m=s.publicUrlBase?t.jsx("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:l("settings.buckets.public",{url:s.publicUrlBase})}):null,e[22]=s.publicUrlBase,e[23]=l,e[24]=m):m=e[24];let b;e[25]!==o||e[26]!==g||e[27]!==d||e[28]!==f||e[29]!==m?(b=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[n,t.jsxs("div",{className:"min-w-0",children:[o,g,d,f,m]})]}),e[25]=o,e[26]=g,e[27]=d,e[28]=f,e[29]=m,e[30]=b):b=e[30];let j;e[31]!==s.createdAt?(j=new Date(s.createdAt).toLocaleDateString(),e[31]=s.createdAt,e[32]=j):j=e[32];let S;e[33]!==j?(S=t.jsx("span",{className:"text-xs text-muted-foreground",children:j}),e[33]=j,e[34]=S):S=e[34];let v;e[35]!==s||e[36]!==r?(v=()=>r(s),e[35]=s,e[36]=r,e[37]=v):v=e[37];let k;e[38]!==s.name||e[39]!==l?(k=l("settings.buckets.deleteButton",{name:s.name}),e[38]=s.name,e[39]=l,e[40]=k):k=e[40];let y;e[41]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Y,{size:14}),e[41]=y):y=e[41];let x;e[42]!==v||e[43]!==k?(x=t.jsx(L,{variant:"ghost",size:"sm",onClick:v,"aria-label":k,children:y}),e[42]=v,e[43]=k,e[44]=x):x=e[44];let p;e[45]!==S||e[46]!==x?(p=t.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[S,x]}),e[45]=S,e[46]=x,e[47]=p):p=e[47];let N;return e[48]!==b||e[49]!==p?(N=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[b,p]}),e[48]=b,e[49]=p,e[50]=N):N=e[50],N}function De(i){const e=T.c(21),{onCreate:s}=i,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(I,{size:20,className:"text-muted-foreground"})}),e[0]=l):l=e[0];let n;e[1]!==r?(n=r("settings.buckets.noBucketsConfigured"),e[1]=r,e[2]=n):n=e[2];let c;e[3]!==n?(c=t.jsx("p",{className:"font-medium text-sm",children:n}),e[3]=n,e[4]=c):c=e[4];let a;e[5]!==r?(a=r("settings.buckets.emptyStateDescription"),e[5]=r,e[6]=a):a=e[6];let u;e[7]!==a?(u=t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:a}),e[7]=a,e[8]=u):u=e[8];let o;e[9]!==c||e[10]!==u?(o=t.jsxs("div",{children:[c,u]}),e[9]=c,e[10]=u,e[11]=o):o=e[11];let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(V,{size:14}),e[12]=g):g=e[12];let d;e[13]!==r?(d=r("settings.buckets.addBucket"),e[13]=r,e[14]=d):d=e[14];let f;e[15]!==s||e[16]!==d?(f=t.jsxs(L,{onClick:s,size:"sm",className:"mt-2",children:[g,d]}),e[15]=s,e[16]=d,e[17]=f):f=e[17];let m;return e[18]!==o||e[19]!==f?(m=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[l,o,f]}),e[18]=o,e[19]=f,e[20]=m):m=e[20],m}function O({open:i,onOpenChange:e}){const s=F(),[r,l]=C.useState(""),[n,c]=C.useState(""),[a,u]=C.useState(""),[o,g]=C.useState(""),[d,f]=C.useState(""),[m,b]=C.useState(!1),[j,S]=C.useState(""),[v,k]=C.useState(""),[y,x]=C.useState("static"),[p,N]=C.useState(""),[D,w]=C.useState(""),[_,A]=C.useState(""),[$,z]=C.useState(""),U=ve();function H(){l(""),c(""),u(""),g(""),f(""),b(!1),S(""),k(""),x("static"),N(""),w(""),A(""),z("")}const R=y==="sts-session"?!!(_.trim()&&$.trim()):!!(p&&D);async function J(h){if(h.preventDefault(),!r.trim()||!a.trim()||!o.trim()||!R)return;const M=y==="sts-session"?{credentialType:"sts-session",refreshUrl:_.trim(),apiKey:$.trim()}:{credentialType:"static",accessKeyId:p,secretAccessKey:D};try{await U.mutateAsync({name:r.trim(),description:n.trim()||void 0,bucket:a.trim(),region:o.trim(),endpoint:d.trim()||void 0,forcePathStyle:m,prefix:j.trim()||void 0,publicUrlBase:v.trim()||void 0,...M}),K.success(s("settings.buckets.bucketAdded",{name:r.trim()})),H(),e(!1)}catch(Q){K.error(Ne(Q,s("settings.buckets.failedToAddBucket")))}}const G=U.isPending||!r.trim()||!a.trim()||!o.trim()||!R;return t.jsx(ce,{open:i,onOpenChange:e,children:t.jsxs(ae,{className:"sm:max-w-lg max-h-[90vh] overflow-y-auto",children:[t.jsxs(oe,{children:[t.jsx(de,{children:s("settings.buckets.addS3Bucket")}),t.jsx(ue,{children:s("settings.buckets.credentialsEncryptedDescription")})]}),t.jsxs("form",{onSubmit:J,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-name",children:s("settings.buckets.nameLabel")}),t.jsx(P,{id:"file-config-name",value:r,onChange:h=>l(h.target.value),placeholder:s("settings.buckets.namePlaceholder"),autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("settings.buckets.nameHelperText")})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-bucket",children:s("settings.buckets.bucketLabel")}),t.jsx(P,{id:"file-config-bucket",value:a,onChange:h=>u(h.target.value),placeholder:s("settings.buckets.bucketPlaceholder"),autoComplete:"off",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-region",children:s("settings.buckets.regionLabel")}),t.jsx(P,{id:"file-config-region",value:o,onChange:h=>g(h.target.value),placeholder:s("settings.buckets.regionPlaceholder"),autoComplete:"off",required:!0})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-endpoint",children:s("settings.buckets.endpointLabel")}),t.jsx(P,{id:"file-config-endpoint",type:"url",value:d,onChange:h=>f(h.target.value),placeholder:s("settings.buckets.endpointPlaceholder"),autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("settings.buckets.endpointHelperText")})]}),t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-border/60 p-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx(B,{htmlFor:"file-config-path-style",className:"text-sm",children:s("settings.buckets.forcePathStyleLabel")}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:s("settings.buckets.forcePathStyleHelperText")})]}),t.jsx(he,{id:"file-config-path-style",checked:m,onCheckedChange:b})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-prefix",children:s("settings.buckets.prefixLabel")}),t.jsx(P,{id:"file-config-prefix",value:j,onChange:h=>S(h.target.value),placeholder:s("settings.buckets.prefixPlaceholder"),autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("settings.buckets.prefixHelperText")})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-public-url-base",children:s("settings.buckets.publicUrlBaseLabel")}),t.jsx(P,{id:"file-config-public-url-base",type:"url",value:v,onChange:h=>k(h.target.value),placeholder:s("settings.buckets.publicUrlBasePlaceholder"),autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("settings.buckets.publicUrlBaseHelperText")})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-credential-type",children:s("settings.buckets.credentialsLabel")}),t.jsxs(fe,{value:y,onValueChange:h=>x(h),children:[t.jsx(ge,{id:"file-config-credential-type",className:"w-full",children:t.jsx(xe,{})}),t.jsxs(pe,{children:[t.jsx(q,{value:"static",children:s("settings.buckets.staticKeyOption")}),t.jsx(q,{value:"sts-session",children:s("settings.buckets.temporarySessionOption")})]})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s(y==="sts-session"?"settings.buckets.stsSessionHelperText":"settings.buckets.staticKeyHelperText")})]}),y==="static"?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-access-key",children:s("settings.buckets.accessKeyIdLabel")}),t.jsx(P,{id:"file-config-access-key",value:p,onChange:h=>N(h.target.value),autoComplete:"off",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-secret-key",children:s("settings.buckets.secretAccessKeyLabel")}),t.jsx(P,{id:"file-config-secret-key",type:"password",value:D,onChange:h=>w(h.target.value),autoComplete:"new-password",required:!0})]})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-refresh-url",children:s("settings.buckets.refreshUrlLabel")}),t.jsx(P,{id:"file-config-refresh-url",type:"url",value:_,onChange:h=>A(h.target.value),placeholder:s("settings.buckets.refreshUrlPlaceholder"),autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("settings.buckets.refreshUrlHelperText")})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-api-key",children:s("settings.buckets.apiKeyLabel")}),t.jsx(P,{id:"file-config-api-key",type:"password",value:$,onChange:h=>z(h.target.value),autoComplete:"new-password",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("settings.buckets.apiKeyHelperText")})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-description",children:s("settings.buckets.descriptionLabel")}),t.jsx(je,{id:"file-config-description",value:n,onChange:h=>c(h.target.value),rows:2,placeholder:s("settings.buckets.descriptionPlaceholder")})]}),t.jsxs(me,{children:[t.jsx(L,{type:"button",variant:"outline",onClick:()=>{H(),e(!1)},disabled:U.isPending,children:s("settings.buckets.cancelButton")}),t.jsx(L,{type:"submit",disabled:G,children:U.isPending?s("settings.buckets.addingButton"):s("settings.buckets.addBucketButton")})]})]})]})})}function Te(i){const e=T.c(41),{config:s,onClose:r}=i,l=F(),n=Se();let c;e[0]!==s||e[1]!==n||e[2]!==r||e[3]!==l?(c=async function(){if(s)try{await n.mutateAsync(s.id),K.success(l("settings.buckets.bucketRemoved",{name:s.name})),r()}catch(_){const A=_;K.error(A instanceof Error?A.message:l("settings.buckets.failedToRemoveBucket"))}},e[0]=s,e[1]=n,e[2]=r,e[3]=l,e[4]=c):c=e[4];const a=c,u=s!==null;let o;e[5]!==r?(o=w=>!w&&r(),e[5]=r,e[6]=o):o=e[6];let g;e[7]!==l?(g=l("settings.buckets.removeBucketTitle"),e[7]=l,e[8]=g):g=e[8];let d;e[9]!==g?(d=t.jsx(ee,{children:g}),e[9]=g,e[10]=d):d=e[10];const f=s?.name??"";let m;e[11]!==l||e[12]!==f?(m=l("settings.buckets.removeBucketDescription",{name:f}),e[11]=l,e[12]=f,e[13]=m):m=e[13];let b;e[14]!==m?(b=t.jsx(te,{children:m}),e[14]=m,e[15]=b):b=e[15];let j;e[16]!==d||e[17]!==b?(j=t.jsxs(se,{children:[d,b]}),e[16]=d,e[17]=b,e[18]=j):j=e[18];const S=n.isPending;let v;e[19]!==l?(v=l("settings.buckets.cancelButton"),e[19]=l,e[20]=v):v=e[20];let k;e[21]!==n.isPending||e[22]!==v?(k=t.jsx(ie,{disabled:S,children:v}),e[21]=n.isPending,e[22]=v,e[23]=k):k=e[23];let y;e[24]!==n.isPending||e[25]!==l?(y=n.isPending?l("settings.buckets.removingButton"):l("settings.buckets.removeButton"),e[24]=n.isPending,e[25]=l,e[26]=y):y=e[26];let x;e[27]!==n.isPending||e[28]!==a||e[29]!==y?(x=t.jsx(Z,{onClick:a,disabled:n.isPending,children:y}),e[27]=n.isPending,e[28]=a,e[29]=y,e[30]=x):x=e[30];let p;e[31]!==k||e[32]!==x?(p=t.jsxs(le,{children:[k,x]}),e[31]=k,e[32]=x,e[33]=p):p=e[33];let N;e[34]!==p||e[35]!==j?(N=t.jsxs(ne,{children:[j,p]}),e[34]=p,e[35]=j,e[36]=N):N=e[36];let D;return e[37]!==N||e[38]!==u||e[39]!==o?(D=t.jsx(re,{open:u,onOpenChange:o,children:N}),e[37]=N,e[38]=u,e[39]=o,e[40]=D):D=e[40],D}function Fe(){const i=T.c(32),e=F(),s=ye(),[r,l]=C.useState(!1),[n,c]=C.useState(null);if(s.length===0){let x;i[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(De,{onCreate:()=>l(!0)}),i[0]=x):x=i[0];let p;return i[1]!==r?(p=t.jsxs(t.Fragment,{children:[x,t.jsx(O,{open:r,onOpenChange:l})]}),i[1]=r,i[2]=p):p=i[2],p}let a;i[3]!==s.length||i[4]!==e?(a=e("settings.buckets.bucketsConfigured",{count:s.length}),i[3]=s.length,i[4]=e,i[5]=a):a=i[5];let u;i[6]!==a?(u=t.jsx("p",{className:"text-sm text-muted-foreground",children:a}),i[6]=a,i[7]=u):u=i[7];let o;i[8]===Symbol.for("react.memo_cache_sentinel")?(o=()=>l(!0),i[8]=o):o=i[8];let g;i[9]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(V,{size:14}),i[9]=g):g=i[9];let d;i[10]!==e?(d=e("settings.buckets.addBucket"),i[10]=e,i[11]=d):d=i[11];let f;i[12]!==d?(f=t.jsxs(L,{onClick:o,size:"sm",children:[g,d]}),i[12]=d,i[13]=f):f=i[13];let m;i[14]!==u||i[15]!==f?(m=t.jsxs("div",{className:"flex items-center justify-between",children:[u,f]}),i[14]=u,i[15]=f,i[16]=m):m=i[16];let b;if(i[17]!==s){let x;i[19]===Symbol.for("react.memo_cache_sentinel")?(x=p=>t.jsx(Pe,{config:p,onDelete:c},p.id),i[19]=x):x=i[19],b=s.map(x),i[17]=s,i[18]=b}else b=i[18];let j;i[20]!==b?(j=t.jsx("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:t.jsx("div",{children:b})}),i[20]=b,i[21]=j):j=i[21];let S;i[22]!==r?(S=t.jsx(O,{open:r,onOpenChange:l}),i[22]=r,i[23]=S):S=i[23];let v;i[24]===Symbol.for("react.memo_cache_sentinel")?(v=()=>c(null),i[24]=v):v=i[24];let k;i[25]!==n?(k=t.jsx(Te,{config:n,onClose:v}),i[25]=n,i[26]=k):k=i[26];let y;return i[27]!==k||i[28]!==m||i[29]!==j||i[30]!==S?(y=t.jsxs(t.Fragment,{children:[m,j,S,k]}),i[27]=k,i[28]=m,i[29]=j,i[30]=S,i[31]=y):y=i[31],y}function we(){const i=T.c(12),e=F();let s;i[0]!==e?(s=e("settings.buckets.pageTitle"),i[0]=e,i[1]=s):s=i[1];let r;i[2]!==s?(r=t.jsx(E.Title,{children:s}),i[2]=s,i[3]=r):r=i[3];let l;i[4]!==e?(l=u=>{const{error:o}=u;return t.jsx(Be,{error:o??new Error(e("settings.buckets.failedToLoadConfigsFallback"))})},i[4]=e,i[5]=l):l=i[5];let n;i[6]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(C.Suspense,{fallback:t.jsx(be,{className:"h-32 w-full"}),children:t.jsx(Fe,{})}),i[6]=n):n=i[6];let c;i[7]!==l?(c=t.jsx(W,{fallback:l,children:n}),i[7]=l,i[8]=c):c=i[8];let a;return i[9]!==r||i[10]!==c?(a=t.jsx(E,{children:t.jsx(E.Content,{children:t.jsx(E.Body,{children:t.jsxs(ke,{children:[r,c]})})})}),i[9]=r,i[10]=c,i[11]=a):a=i[11],a}function ot(){const i=T.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ce,{capability:"file-configs:manage",area:"files",children:t.jsx(we,{})}),i[0]=e):e=i[0],e}export{ot as default};
|
package/dist/client/assets/{bulk-category-panel-88hyriYd.js → bulk-category-panel-Z8lz1ptZ.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as he,b as je,r as de,j as t,k as ye,B as ne}from"./index-B1INhWoo.js";import{B as ue}from"./agent-icon-Dx4NCRpv.js";import{i as Ne}from"./X-BW2EYO4B.js";import{L as ce}from"./label-BxyuqrG3.js";import{a4 as xe,a5 as ke}from"./index-Bg79Fd9u.js";import{S as Ce,a as Pe,b as Se,c as ve,d as _e}from"./select-CzAV5CH5.js";import{T as Te,a as we,c as Be}from"./tooltip-DvQ0XsJD.js";import"./AlertCircle-DH3qtgBe.js";import"./Tool01-BgrN_XhB.js";import"./ArrowUp-Bw-aOPaU.js";import"./Settings02-Crp31NAs.js";import"./Tool02-C8_nzaSV.js";import"./XCircle-Mv4us9Z1.js";import"./ArrowUpRight-Cc2KMNxL.js";import"./TrendUp01-cPdEBjok.js";import"./ZapSquare-DYA2y0UF.js";import"./Users03-BrSAA7CP.js";import"./CheckCircle-Cva3EkPV.js";import"./Check-lBHxT1HX.js";import"./ChevronDown-QYK7Lenl.js";import"./ChevronRight-CWURfvDb.js";import"./ChevronUp-BMvYccDe.js";import"./DotsVertical-C58fabD-.js";import"./Stars02-D3Ts30Xu.js";import"./Copy01-CAqSjpf_.js";import"./CpuChip01-lsdcDtEC.js";import"./Eye-Dw90cLwR.js";import"./FilterLines-BafoDeSJ.js";import"./Star01-WZXTBc9P.js";import"./Palette-CwJTW0Hm.js";import"./SwitchHorizontal01-5PmCZ0_U.js";import"./HardDrive-BuNe2d8F.js";import"./Key01-DSruLSCx.js";import"./LayoutLeft-BV4kR0Cl.js";import"./LinkExternal01-DltqAIeP.js";import"./LogOut01-B1kROqne.js";import"./Monitor01-Ba7OYhMO.js";import"./Sun-DOEVL1Eu.js";import"./Play-B47Q6pNp.js";import"./Plus-Bi2kvuIY.js";import"./SearchLg-UBODIUpH.js";import"./SearchMd-Swr0KhLg.js";import"./Shield01-D6aMdI8b.js";import"./Stars01-CbClslIT.js";import"./Trash01-BB8WWZkr.js";import"./Upload01-HoFghnaA.js";import"./User01-CU43n4aC.js";import"./Users01-BfmGwOWr.js";import"./XClose-DCuiifka.js";import"./Zap-fP1c7xXe.js";import"./chat-context-BPHBf2SD.js";import"./tab-id-8wArXECU.js";import"./dialog-1l6V_AO-.js";import"./hooks-D1TjgNd-.js";import"./use-mcp-client-Cpe5VVFd.js";import"./auth-B6HaqNKN.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-DvMExQy8.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-CRbRiAY-.js";import"./use-ai-providers-CXx6vxgf.js";import"./studio-tools-QMuOj6-u.js";import"./use-decopilot-events-C_3NeXEi.js";import"./use-organization-settings-BxnffxCo.js";import"./automation-runs-BJxujaRz.js";import"./useInfiniteQuery-C-RqwYQP.js";import"./use-infinite-scroll-GIf_V4mg.js";import"./use-connection-Crt7Wnf6.js";import"./card-F2SMEUTI.js";import"./sidebar-DD3SRmGs.js";import"./use-mobile-BDpXfOGb.js";import"./table-TbcMVTO8.js";import"./empty-state-DbpV7XVc.js";import"./use-members-Di-wqSFo.js";import"./use-org-auth-client-xlorPrK7.js";import"./use-clock-tick-yxMgruH1.js";import"./use-automations-CIRY26Sm.js";import"./useSuspenseInfiniteQuery-QRgmbC8e.js";import"./avatar-D9ru8t7J.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-D8LT9wzj.js";import"./calendar-CyEY0jbs.js";import"./monaco-editor-Mtdo8aZY.js";import"./spinner-CeQixqey.js";import"./index-CtHwx2FP.js";import"./shell-layout-BWjH-Sfe.js";import"./required-auth-layout-Cp2xOp41.js";import"./use-org-sso-BP9JFiDp.js";import"./integration-icon-eRBxSPRX.js";import"./use-navigate-to-agent-xBQA-nI3.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-CUxSq8CM.js";import"./form-BBhau0Q4.js";import"./input-DkjdpI9N.js";import"./drawer-D_dlIrgq.js";import"./collection-search-C_lEkJSM.js";import"./index-LnErdRrl.js";import"./get-initials-D-f_fDFw.js";import"./popover-PONP-IrS.js";import"./dropdown-menu-BSq_T2rN.js";import"./github-repo-picker-DZFkRYw0.js";import"./use-debounced-value-C7ql9pQ9.js";import"./authenticate-and-persist-oauth-B4pAf04F.js";import"./mcp-oauth-BWVH0_CJ.js";import"./use-mcp-tools-vrGNFP62.js";import"./extract-connection-data-DsmAsG2q.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CAXumITS.js";import"./use-tags-Ro4HIuso.js";import"./skeleton-ZVeLusnT.js";import"./command-BaN3HpzD.js";import"./index-CiqXq-Gv.js";import"./companions-core-DBvnypYt.js";import"./tabs-CFfkTu0X.js";import"./toggle-group-CTKp_-5Y.js";import"./use-deco-credits-D09kZAP8.js";import"./alert-dialog-C9XbRCXw.js";import"./toolbar-xTOW3jV5.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-ClxMiq53.js";import"./use-registry-connections-CMbVPAo5.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-DkC87OzG.js";import"./connection-form-helpers-BL_ujE81.js";import"./collection-tabs-DKMXuAh7.js";import"./badge-DuDSo4B5.js";import"./select-model-CUI7TW7J.js";import"./checkbox-ttemAxHh.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CoPqg6gm.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-Cuh2VhxF.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-CbsdK6kc.js";import"./pt-BR-CLy76QW2.js";import"./use-mcp-auth-status-BXPNVCkT.js";import"./use-debounced-autosave-Bk4kxnd7.js";import"./index-D8Oyc-Sj.js";import"./search-input-l0QwIQw1.js";import"./switch-DvFygQiJ.js";import"./use-secrets-BvEnn7fN.js";import"./useQueries-D1qVck3-.js";import"./use-file-configs-d0gxFXga.js";import"./automation-list-row-BRUbqICU.js";function ji(i){const e=he.c(121),{posts:X,categories:r,initialSlug:le,isPending:s,onApply:re,onClose:p}=i,o=je(),[m,fe]=de.useState(le&&r.some(a=>a.slug===le)?le:r[0]?.slug??""),[n,ge]=de.useState("add");let Y;if(e[0]!==r||e[1]!==m){let a;e[3]!==m?(a=be=>be.slug===m,e[3]=m,e[4]=a):a=e[4],Y=r.find(a),e[0]=r,e[1]=m,e[2]=Y}else Y=e[2];const c=Y,l=X.length,me=String(l);let d;e[5]!==o||e[6]!==me?(d=o("sandbox.bulkCategoryPanel.selectedCount",{count:me}),e[5]=o,e[6]=me,e[7]=d):d=e[7];let x;e[8]!==d?(x=t.jsx("span",{className:"truncate text-sm font-medium",children:d}),e[8]=d,e[9]=x):x=e[9];let u;e[10]!==o?(u=o("sandbox.bulkCategoryPanel.exitSelection"),e[10]=o,e[11]=u):u=e[11];let Z;e[12]===Symbol.for("react.memo_cache_sentinel")?(Z=t.jsx(Ne,{size:14}),e[12]=Z):Z=e[12];let f;e[13]!==s||e[14]!==p||e[15]!==u?(f=t.jsx(Te,{asChild:!0,children:t.jsx(ne,{type:"button",variant:"ghost",size:"icon",disabled:s,onClick:p,"aria-label":u,children:Z})}),e[13]=s,e[14]=p,e[15]=u,e[16]=f):f=e[16];let g;e[17]!==o?(g=o("sandbox.bulkCategoryPanel.exitSelection"),e[17]=o,e[18]=g):g=e[18];let b;e[19]!==g?(b=t.jsx(we,{side:"bottom",children:g}),e[19]=g,e[20]=b):b=e[20];let h;e[21]!==f||e[22]!==b?(h=t.jsxs(Be,{children:[f,b]}),e[21]=f,e[22]=b,e[23]=h):h=e[23];let j;e[24]!==h||e[25]!==x?(j=t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[x,h]}),e[24]=h,e[25]=x,e[26]=j):j=e[26];let y;e[27]!==o?(y=o("sandbox.bulkCategoryPanel.title"),e[27]=o,e[28]=y):y=e[28];let N;e[29]!==y?(N=t.jsx("h2",{className:"text-2xl font-bold text-foreground",children:y}),e[29]=y,e[30]=N):N=e[30];let k;e[31]!==l||e[32]!==o?(k=l===0?o("sandbox.bulkCategoryPanel.descriptionEmpty"):o("sandbox.bulkCategoryPanel.descriptionWithCount",{count:String(l)}),e[31]=l,e[32]=o,e[33]=k):k=e[33];let C;e[34]!==k?(C=t.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:k}),e[34]=k,e[35]=C):C=e[35];let P;e[36]!==o?(P=o("sandbox.bulkCategoryPanel.categoryLabel"),e[36]=o,e[37]=P):P=e[37];let S;e[38]!==P?(S=t.jsx(ce,{children:P}),e[38]=P,e[39]=S):S=e[39];let v;e[40]!==r||e[41]!==m||e[42]!==o?(v=r.length===0?t.jsx("p",{className:"text-sm text-muted-foreground",children:o("sandbox.bulkCategoryPanel.noCategoriesMessage")}):t.jsxs(Ce,{value:m,onValueChange:fe,children:[t.jsx(Pe,{className:"w-full",children:t.jsx(Se,{placeholder:o("sandbox.bulkCategoryPanel.selectCategoryPlaceholder")})}),t.jsx(ve,{children:r.map(ze)})]}),e[40]=r,e[41]=m,e[42]=o,e[43]=v):v=e[43];let _;e[44]!==S||e[45]!==v?(_=t.jsxs("div",{className:"space-y-2",children:[S,v]}),e[44]=S,e[45]=v,e[46]=_):_=e[46];let ee;e[47]===Symbol.for("react.memo_cache_sentinel")?(ee=a=>ge(a),e[47]=ee):ee=e[47];let te;e[48]===Symbol.for("react.memo_cache_sentinel")?(te=t.jsx(xe,{value:"add",id:"cat-mode-add",className:"mt-0.5"}),e[48]=te):te=e[48];let T;e[49]!==o?(T=o("sandbox.bulkCategoryPanel.modeAddTitle"),e[49]=o,e[50]=T):T=e[50];let w;e[51]!==T?(w=t.jsx("span",{className:"block text-sm font-medium",children:T}),e[51]=T,e[52]=w):w=e[52];let B;e[53]!==o?(B=o("sandbox.bulkCategoryPanel.modeAddDescription"),e[53]=o,e[54]=B):B=e[54];let R;e[55]!==B?(R=t.jsx("span",{className:"block text-xs text-muted-foreground",children:B}),e[55]=B,e[56]=R):R=e[56];let z;e[57]!==w||e[58]!==R?(z=t.jsxs(ce,{htmlFor:"cat-mode-add",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[te,t.jsxs("span",{className:"space-y-0.5",children:[w,R]})]}),e[57]=w,e[58]=R,e[59]=z):z=e[59];let oe;e[60]===Symbol.for("react.memo_cache_sentinel")?(oe=t.jsx(xe,{value:"replace",id:"cat-mode-replace",className:"mt-0.5"}),e[60]=oe):oe=e[60];let E;e[61]!==o?(E=o("sandbox.bulkCategoryPanel.modeReplaceTitle"),e[61]=o,e[62]=E):E=e[62];let L;e[63]!==E?(L=t.jsx("span",{className:"block text-sm font-medium",children:E}),e[63]=E,e[64]=L):L=e[64];let A;e[65]!==o?(A=o("sandbox.bulkCategoryPanel.modeReplaceDescription"),e[65]=o,e[66]=A):A=e[66];let F;e[67]!==A?(F=t.jsx("span",{className:"block text-xs text-muted-foreground",children:A}),e[67]=A,e[68]=F):F=e[68];let M;e[69]!==L||e[70]!==F?(M=t.jsxs(ce,{htmlFor:"cat-mode-replace",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[oe,t.jsxs("span",{className:"space-y-0.5",children:[L,F]})]}),e[69]=L,e[70]=F,e[71]=M):M=e[71];let V;e[72]!==n||e[73]!==z||e[74]!==M?(V=t.jsxs(ke,{value:n,onValueChange:ee,className:"gap-2",children:[z,M]}),e[72]=n,e[73]=z,e[74]=M,e[75]=V):V=e[75];let $;e[76]!==o?($=o("sandbox.bulkCategoryPanel.cancelButton"),e[76]=o,e[77]=$):$=e[77];let D;e[78]!==s||e[79]!==p||e[80]!==$?(D=t.jsx(ne,{type:"button",variant:"outline",onClick:p,disabled:s,children:$}),e[78]=s,e[79]=p,e[80]=$,e[81]=D):D=e[81];const ae=!c||s||l===0;let G;e[82]!==n||e[83]!==re||e[84]!==c?(G=()=>c&&re(n,{name:c.name,slug:c.slug}),e[82]=n,e[83]=re,e[84]=c,e[85]=G):G=e[85];let I;e[86]!==s||e[87]!==o?(I=s?t.jsxs(t.Fragment,{children:[t.jsx(ye,{size:14,className:"animate-spin"}),o("sandbox.bulkCategoryPanel.updatingButton")]}):o("sandbox.bulkCategoryPanel.applyButton"),e[86]=s,e[87]=o,e[88]=I):I=e[88];let W;e[89]!==ae||e[90]!==G||e[91]!==I?(W=t.jsx(ne,{type:"button",disabled:ae,onClick:G,children:I}),e[89]=ae,e[90]=G,e[91]=I,e[92]=W):W=e[92];let q;e[93]!==D||e[94]!==W?(q=t.jsxs("div",{className:"flex justify-end gap-2",children:[D,W]}),e[93]=D,e[94]=W,e[95]=q):q=e[95];let H;e[96]!==_||e[97]!==V||e[98]!==q?(H=t.jsxs("div",{className:"mt-6 space-y-4",children:[_,V,q]}),e[96]=_,e[97]=V,e[98]=q,e[99]=H):H=e[99];let ie;e[100]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx(ue,{size:16,className:"shrink-0 text-muted-foreground"}),e[100]=ie):ie=e[100];const pe=String(l);let J;e[101]!==o||e[102]!==pe?(J=o("sandbox.bulkCategoryPanel.selectedPostsLabel",{count:pe}),e[101]=o,e[102]=pe,e[103]=J):J=e[103];let K;e[104]!==J?(K=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-3",children:[ie,t.jsx("span",{className:"text-sm",children:J})]}),e[104]=J,e[105]=K):K=e[105];let O;e[106]!==l||e[107]!==X||e[108]!==o?(O=l===0?t.jsx("p",{className:"border-t bg-background px-4 py-3 text-sm text-muted-foreground",children:o("sandbox.bulkCategoryPanel.noPostsSelectedMessage")}):t.jsx("ul",{className:"divide-y border-t bg-background",children:X.map(Re)}),e[106]=l,e[107]=X,e[108]=o,e[109]=O):O=e[109];let Q;e[110]!==K||e[111]!==O?(Q=t.jsxs("div",{className:"mt-8 overflow-hidden rounded-lg border bg-muted/30",children:[K,O]}),e[110]=K,e[111]=O,e[112]=Q):Q=e[112];let U;e[113]!==N||e[114]!==C||e[115]!==H||e[116]!==Q?(U=t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-2xl px-8 py-8",children:[N,C,H,Q]})}),e[113]=N,e[114]=C,e[115]=H,e[116]=Q,e[117]=U):U=e[117];let se;return e[118]!==j||e[119]!==U?(se=t.jsxs("div",{className:"flex h-full flex-col",children:[j,U]}),e[118]=j,e[119]=U,e[120]=se):se=e[120],se}function Re(i){return t.jsxs("li",{className:"flex items-center gap-2.5 px-4 py-2.5",children:[t.jsx(ue,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:i.title}),i.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:i.slug})]})]},i.key)}function ze(i){return t.jsx(_e,{value:i.slug,children:t.jsx("span",{className:"truncate",children:i.name})},i.slug)}export{ji as BulkCategoryPanel};
|
|
1
|
+
import{c as he,b as je,r as de,j as t,k as ye,B as ne}from"./index-DBW7-LLJ.js";import{B as ue}from"./agent-icon-bqP8cd4A.js";import{i as Ne}from"./X-D-SXXNOh.js";import{L as ce}from"./label-BEcprhix.js";import{a4 as xe,a5 as ke}from"./index-DFVpce2g.js";import{S as Ce,a as Pe,b as Se,c as ve,d as _e}from"./select-p5o_Bt0F.js";import{T as Te,a as we,c as Be}from"./tooltip-fkTa7gIG.js";import"./AlertCircle-Cd8M35Wb.js";import"./Tool01-BPkNcjLe.js";import"./ArrowUp-4BHUZHFD.js";import"./Settings02-Cslfpi0u.js";import"./Tool02-8rf_PPrb.js";import"./XCircle-Bdipnf78.js";import"./ArrowUpRight-CCEVlmCI.js";import"./TrendUp01-B3nbKtR5.js";import"./ZapSquare-DRAXQQVP.js";import"./Users03-C0TiA5ig.js";import"./CheckCircle-D31c9Zko.js";import"./Check-CK_e8wdj.js";import"./ChevronDown-DSAcD82u.js";import"./ChevronRight-D02mIW0w.js";import"./ChevronUp-BqqaHKfG.js";import"./DotsVertical-DD9vI7XN.js";import"./Stars02-Cx4R-W4T.js";import"./Copy01-CbmbpqVa.js";import"./CpuChip01-DHX1tpE2.js";import"./Eye-CgfUY2cN.js";import"./FilterLines-BVMJKn0q.js";import"./Star01-DGK3WnVL.js";import"./Palette-BQLbJJdf.js";import"./SwitchHorizontal01-B1yag0Lu.js";import"./HardDrive-2n4L-vNW.js";import"./Key01-T5YNQBm2.js";import"./LayoutLeft-CaOxvIEl.js";import"./LinkExternal01-CXa8wVjc.js";import"./LogOut01-CM9eugyU.js";import"./Monitor01-8S0W2w5U.js";import"./Sun-Cno0ZL2K.js";import"./Play-CuYQk1-M.js";import"./Plus-BApQaxo5.js";import"./SearchLg-BSb_OzKH.js";import"./SearchMd-bzt4kP0K.js";import"./Shield01-vx0tzuE8.js";import"./Stars01-BkoB-Q1B.js";import"./Trash01-CjLF47KG.js";import"./Upload01-C74iA_2l.js";import"./User01-gol1gjVG.js";import"./Users01-ConkK5Hy.js";import"./XClose-BXyOmw6P.js";import"./Zap-DJXvF0rz.js";import"./chat-context-B9IMqX9H.js";import"./tab-id-ts2R-IK7.js";import"./dialog-BNEf4h73.js";import"./hooks-Bl53PFCW.js";import"./use-mcp-client-YC9HMu6y.js";import"./auth-B6-JmtGV.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-DJTs5v3B.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-Czn5fHtD.js";import"./use-ai-providers-wy-pIlnl.js";import"./studio-tools-eC6fCmF6.js";import"./use-decopilot-events-CPtuygfk.js";import"./use-organization-settings-Bi013MJn.js";import"./automation-runs-1f49gKdv.js";import"./useInfiniteQuery-yZBiNKu9.js";import"./use-infinite-scroll-BLH47khU.js";import"./use-connection-DJ0b1gTC.js";import"./card-Djqe431m.js";import"./sidebar-BBmlF4Le.js";import"./use-mobile-DaXh9iB4.js";import"./table-CUPzY57H.js";import"./empty-state-Jijm8Zjj.js";import"./use-members-BOo6SBZf.js";import"./use-org-auth-client-B_HThHi-.js";import"./use-clock-tick-Cso4aNFM.js";import"./use-automations-BebUXKcQ.js";import"./useSuspenseInfiniteQuery-CdZRM8uM.js";import"./avatar-CG1sYMC3.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BNgRyC_N.js";import"./calendar-CSYSRHan.js";import"./monaco-editor-DJSyif3I.js";import"./spinner-D09NsuWH.js";import"./index-DS1dPTBr.js";import"./shell-layout-CvSnv4Ng.js";import"./required-auth-layout-DTRJEXT6.js";import"./use-org-sso-vq0R-8A9.js";import"./integration-icon-BjR4OGAx.js";import"./use-navigate-to-agent-CwseQD-z.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-C78nqQQF.js";import"./form-BoZJqj_8.js";import"./input-DM14QBHx.js";import"./drawer-BOicXoW4.js";import"./collection-search-D8p930-2.js";import"./index-D7iPCSni.js";import"./get-initials-D-f_fDFw.js";import"./popover-13d1_Ydy.js";import"./dropdown-menu-B0OSBqF5.js";import"./github-repo-picker-CCSv048C.js";import"./use-debounced-value-DrbFDRJg.js";import"./authenticate-and-persist-oauth-BBAoTw-S.js";import"./mcp-oauth-ws9m29vQ.js";import"./use-mcp-tools-81zsgjbk.js";import"./extract-connection-data-ByQ1VQpk.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CAXumITS.js";import"./use-tags-CxtVjJTC.js";import"./skeleton-D5maqyjg.js";import"./command-D8VZgYcp.js";import"./index-7i5MzulY.js";import"./companions-core-C6pGrBaV.js";import"./tabs-BezZc3NY.js";import"./toggle-group-CqJpxcmh.js";import"./use-deco-credits-DmpIUFXQ.js";import"./alert-dialog-fWZE2eoL.js";import"./toolbar-8XCdJRqW.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-DaylHwd8.js";import"./use-registry-connections-DHHAMc5J.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-DHTTJLnr.js";import"./connection-form-helpers-abaaeWRW.js";import"./collection-tabs-Btbvy5wZ.js";import"./badge-DTv3ytkG.js";import"./select-model-z0c2dMz_.js";import"./checkbox-g1Xe-Fh0.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CZTjnxlV.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-B4bZcx6E.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-D9H3t7HP.js";import"./pt-BR-CLy76QW2.js";import"./use-mcp-auth-status-DtWK2vVN.js";import"./use-debounced-autosave-B-9KRifB.js";import"./index-CzdD7w68.js";import"./search-input-Cav-R6u1.js";import"./switch-DJGvmJgh.js";import"./use-secrets-BCwf7s42.js";import"./useQueries-BIMkg7rJ.js";import"./use-file-configs-BSbmDdF6.js";import"./automation-list-row-BkrA0C81.js";function ji(i){const e=he.c(121),{posts:X,categories:r,initialSlug:le,isPending:s,onApply:re,onClose:p}=i,o=je(),[m,fe]=de.useState(le&&r.some(a=>a.slug===le)?le:r[0]?.slug??""),[n,ge]=de.useState("add");let Y;if(e[0]!==r||e[1]!==m){let a;e[3]!==m?(a=be=>be.slug===m,e[3]=m,e[4]=a):a=e[4],Y=r.find(a),e[0]=r,e[1]=m,e[2]=Y}else Y=e[2];const c=Y,l=X.length,me=String(l);let d;e[5]!==o||e[6]!==me?(d=o("sandbox.bulkCategoryPanel.selectedCount",{count:me}),e[5]=o,e[6]=me,e[7]=d):d=e[7];let x;e[8]!==d?(x=t.jsx("span",{className:"truncate text-sm font-medium",children:d}),e[8]=d,e[9]=x):x=e[9];let u;e[10]!==o?(u=o("sandbox.bulkCategoryPanel.exitSelection"),e[10]=o,e[11]=u):u=e[11];let Z;e[12]===Symbol.for("react.memo_cache_sentinel")?(Z=t.jsx(Ne,{size:14}),e[12]=Z):Z=e[12];let f;e[13]!==s||e[14]!==p||e[15]!==u?(f=t.jsx(Te,{asChild:!0,children:t.jsx(ne,{type:"button",variant:"ghost",size:"icon",disabled:s,onClick:p,"aria-label":u,children:Z})}),e[13]=s,e[14]=p,e[15]=u,e[16]=f):f=e[16];let g;e[17]!==o?(g=o("sandbox.bulkCategoryPanel.exitSelection"),e[17]=o,e[18]=g):g=e[18];let b;e[19]!==g?(b=t.jsx(we,{side:"bottom",children:g}),e[19]=g,e[20]=b):b=e[20];let h;e[21]!==f||e[22]!==b?(h=t.jsxs(Be,{children:[f,b]}),e[21]=f,e[22]=b,e[23]=h):h=e[23];let j;e[24]!==h||e[25]!==x?(j=t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[x,h]}),e[24]=h,e[25]=x,e[26]=j):j=e[26];let y;e[27]!==o?(y=o("sandbox.bulkCategoryPanel.title"),e[27]=o,e[28]=y):y=e[28];let N;e[29]!==y?(N=t.jsx("h2",{className:"text-2xl font-bold text-foreground",children:y}),e[29]=y,e[30]=N):N=e[30];let k;e[31]!==l||e[32]!==o?(k=l===0?o("sandbox.bulkCategoryPanel.descriptionEmpty"):o("sandbox.bulkCategoryPanel.descriptionWithCount",{count:String(l)}),e[31]=l,e[32]=o,e[33]=k):k=e[33];let C;e[34]!==k?(C=t.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:k}),e[34]=k,e[35]=C):C=e[35];let P;e[36]!==o?(P=o("sandbox.bulkCategoryPanel.categoryLabel"),e[36]=o,e[37]=P):P=e[37];let S;e[38]!==P?(S=t.jsx(ce,{children:P}),e[38]=P,e[39]=S):S=e[39];let v;e[40]!==r||e[41]!==m||e[42]!==o?(v=r.length===0?t.jsx("p",{className:"text-sm text-muted-foreground",children:o("sandbox.bulkCategoryPanel.noCategoriesMessage")}):t.jsxs(Ce,{value:m,onValueChange:fe,children:[t.jsx(Pe,{className:"w-full",children:t.jsx(Se,{placeholder:o("sandbox.bulkCategoryPanel.selectCategoryPlaceholder")})}),t.jsx(ve,{children:r.map(ze)})]}),e[40]=r,e[41]=m,e[42]=o,e[43]=v):v=e[43];let _;e[44]!==S||e[45]!==v?(_=t.jsxs("div",{className:"space-y-2",children:[S,v]}),e[44]=S,e[45]=v,e[46]=_):_=e[46];let ee;e[47]===Symbol.for("react.memo_cache_sentinel")?(ee=a=>ge(a),e[47]=ee):ee=e[47];let te;e[48]===Symbol.for("react.memo_cache_sentinel")?(te=t.jsx(xe,{value:"add",id:"cat-mode-add",className:"mt-0.5"}),e[48]=te):te=e[48];let T;e[49]!==o?(T=o("sandbox.bulkCategoryPanel.modeAddTitle"),e[49]=o,e[50]=T):T=e[50];let w;e[51]!==T?(w=t.jsx("span",{className:"block text-sm font-medium",children:T}),e[51]=T,e[52]=w):w=e[52];let B;e[53]!==o?(B=o("sandbox.bulkCategoryPanel.modeAddDescription"),e[53]=o,e[54]=B):B=e[54];let R;e[55]!==B?(R=t.jsx("span",{className:"block text-xs text-muted-foreground",children:B}),e[55]=B,e[56]=R):R=e[56];let z;e[57]!==w||e[58]!==R?(z=t.jsxs(ce,{htmlFor:"cat-mode-add",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[te,t.jsxs("span",{className:"space-y-0.5",children:[w,R]})]}),e[57]=w,e[58]=R,e[59]=z):z=e[59];let oe;e[60]===Symbol.for("react.memo_cache_sentinel")?(oe=t.jsx(xe,{value:"replace",id:"cat-mode-replace",className:"mt-0.5"}),e[60]=oe):oe=e[60];let E;e[61]!==o?(E=o("sandbox.bulkCategoryPanel.modeReplaceTitle"),e[61]=o,e[62]=E):E=e[62];let L;e[63]!==E?(L=t.jsx("span",{className:"block text-sm font-medium",children:E}),e[63]=E,e[64]=L):L=e[64];let A;e[65]!==o?(A=o("sandbox.bulkCategoryPanel.modeReplaceDescription"),e[65]=o,e[66]=A):A=e[66];let F;e[67]!==A?(F=t.jsx("span",{className:"block text-xs text-muted-foreground",children:A}),e[67]=A,e[68]=F):F=e[68];let M;e[69]!==L||e[70]!==F?(M=t.jsxs(ce,{htmlFor:"cat-mode-replace",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[oe,t.jsxs("span",{className:"space-y-0.5",children:[L,F]})]}),e[69]=L,e[70]=F,e[71]=M):M=e[71];let V;e[72]!==n||e[73]!==z||e[74]!==M?(V=t.jsxs(ke,{value:n,onValueChange:ee,className:"gap-2",children:[z,M]}),e[72]=n,e[73]=z,e[74]=M,e[75]=V):V=e[75];let $;e[76]!==o?($=o("sandbox.bulkCategoryPanel.cancelButton"),e[76]=o,e[77]=$):$=e[77];let D;e[78]!==s||e[79]!==p||e[80]!==$?(D=t.jsx(ne,{type:"button",variant:"outline",onClick:p,disabled:s,children:$}),e[78]=s,e[79]=p,e[80]=$,e[81]=D):D=e[81];const ae=!c||s||l===0;let G;e[82]!==n||e[83]!==re||e[84]!==c?(G=()=>c&&re(n,{name:c.name,slug:c.slug}),e[82]=n,e[83]=re,e[84]=c,e[85]=G):G=e[85];let I;e[86]!==s||e[87]!==o?(I=s?t.jsxs(t.Fragment,{children:[t.jsx(ye,{size:14,className:"animate-spin"}),o("sandbox.bulkCategoryPanel.updatingButton")]}):o("sandbox.bulkCategoryPanel.applyButton"),e[86]=s,e[87]=o,e[88]=I):I=e[88];let W;e[89]!==ae||e[90]!==G||e[91]!==I?(W=t.jsx(ne,{type:"button",disabled:ae,onClick:G,children:I}),e[89]=ae,e[90]=G,e[91]=I,e[92]=W):W=e[92];let q;e[93]!==D||e[94]!==W?(q=t.jsxs("div",{className:"flex justify-end gap-2",children:[D,W]}),e[93]=D,e[94]=W,e[95]=q):q=e[95];let H;e[96]!==_||e[97]!==V||e[98]!==q?(H=t.jsxs("div",{className:"mt-6 space-y-4",children:[_,V,q]}),e[96]=_,e[97]=V,e[98]=q,e[99]=H):H=e[99];let ie;e[100]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx(ue,{size:16,className:"shrink-0 text-muted-foreground"}),e[100]=ie):ie=e[100];const pe=String(l);let J;e[101]!==o||e[102]!==pe?(J=o("sandbox.bulkCategoryPanel.selectedPostsLabel",{count:pe}),e[101]=o,e[102]=pe,e[103]=J):J=e[103];let K;e[104]!==J?(K=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-3",children:[ie,t.jsx("span",{className:"text-sm",children:J})]}),e[104]=J,e[105]=K):K=e[105];let O;e[106]!==l||e[107]!==X||e[108]!==o?(O=l===0?t.jsx("p",{className:"border-t bg-background px-4 py-3 text-sm text-muted-foreground",children:o("sandbox.bulkCategoryPanel.noPostsSelectedMessage")}):t.jsx("ul",{className:"divide-y border-t bg-background",children:X.map(Re)}),e[106]=l,e[107]=X,e[108]=o,e[109]=O):O=e[109];let Q;e[110]!==K||e[111]!==O?(Q=t.jsxs("div",{className:"mt-8 overflow-hidden rounded-lg border bg-muted/30",children:[K,O]}),e[110]=K,e[111]=O,e[112]=Q):Q=e[112];let U;e[113]!==N||e[114]!==C||e[115]!==H||e[116]!==Q?(U=t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-2xl px-8 py-8",children:[N,C,H,Q]})}),e[113]=N,e[114]=C,e[115]=H,e[116]=Q,e[117]=U):U=e[117];let se;return e[118]!==j||e[119]!==U?(se=t.jsxs("div",{className:"flex h-full flex-col",children:[j,U]}),e[118]=j,e[119]=U,e[120]=se):se=e[120],se}function Re(i){return t.jsxs("li",{className:"flex items-center gap-2.5 px-4 py-2.5",children:[t.jsx(ue,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:i.title}),i.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:i.slug})]})]},i.key)}function ze(i){return t.jsx(_e,{value:i.slug,children:t.jsx("span",{className:"truncate",children:i.name})},i.slug)}export{ji as BulkCategoryPanel};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as J,bP as Dv,bQ as pR,j as R,af as fR,aw as tt,bR as hR,c as Nt,b as gi,m as wn,bw as Wm,bS as Cs,H as mR,d as gR,f as bR,B as Mv,bT as Bb}from"./index-B1INhWoo.js";import{i as Pv}from"./Check-lBHxT1HX.js";import{a as Fv}from"./Copy01-CAqSjpf_.js";import{e as ER,g as yR,f as TR,b as SR}from"./dialog-1l6V_AO-.js";import{n as kR}from"./Tool02-C8_nzaSV.js";import{aV as AR,aW as vR,w as _R}from"./agent-icon-Dx4NCRpv.js";import{u as CR}from"./use-mobile-BDpXfOGb.js";import{h as NR}from"./tab-id-8wArXECU.js";import{i as wR}from"./ChevronRight-CWURfvDb.js";function Ub(e){return e?e.replace(/[_-]/g," ").toLowerCase().split(" ").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" "):""}function UZ(e,t){return e==="output-error"||e==="output-denied"?"error":e==="approval-requested"?"approval":e==="input-streaming"||e==="input-available"||e==="output-available"&&t===!0?"loading":"idle"}function HZ(e){if(e==null||typeof e!="object")return;const t=e;if(t.structuredContent&&typeof t.structuredContent=="object")return t.structuredContent;if(Array.isArray(t.content)){const n=t.content[0];if(n?.type==="text"&&typeof n.text=="string")try{return JSON.parse(n.text)}catch{return}return}return e}function Ke(e){this.content=e}Ke.prototype={constructor:Ke,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new Ke(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new Ke(n)},addToStart:function(e,t){return new Ke([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Ke(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new Ke(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=Ke.from(e),e.size?new Ke(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=Ke.from(e),e.size?new Ke(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Ke.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}};Ke.from=function(e){if(e instanceof Ke)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Ke(t)};function Bv(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let s=0;i.text[s]==a.text[s];s++)n++;return n}if(i.content.size||a.content.size){let s=Bv(i.content,a.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function Uv(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let s=e.child(--i),o=t.child(--a),l=s.nodeSize;if(s==o){n-=l,r-=l;continue}if(!s.sameMarkup(o))return{a:n,b:r};if(s.isText&&s.text!=o.text){let u=0,c=Math.min(s.text.length,o.text.length);for(;u<c&&s.text[s.text.length-u-1]==o.text[o.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(s.content.size||o.content.size){let u=Uv(s.content,o.content,n-1,r-1);if(u)return u}n-=l,r-=l}}class ${constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,i=0,a){for(let s=0,o=0;o<n;s++){let l=this.content[s],u=o+l.nodeSize;if(u>t&&r(l,i+o,a||null,s)!==!1&&l.content.size){let c=o+1;l.nodesBetween(Math.max(0,t-c),Math.min(l.content.size,n-c),r,i+c)}o=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let a="",s=!0;return this.nodesBetween(t,n,(o,l)=>{let u=o.isText?o.text.slice(Math.max(t,l)-l,n-l):o.isLeaf?i?typeof i=="function"?i(o):i:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&u||o.isTextblock)&&r&&(s?s=!1:a+=r),a+=u},0),a}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new $(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let a=0,s=0;s<n;a++){let o=this.content[a],l=s+o.nodeSize;l>t&&((s<t||l>n)&&(o.isText?o=o.cut(Math.max(0,t-s),Math.min(o.text.length,n-s)):o=o.cut(Math.max(0,t-s-1),Math.min(o.content.size,n-s-1))),r.push(o),i+=o.nodeSize),s=l}return new $(r,i)}cutByIndex(t,n){return t==n?$.empty:t==0&&n==this.content.length?this:new $(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new $(i,a)}addToStart(t){return new $([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new $(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];t(i,r,n),r+=i.nodeSize}}findDiffStart(t,n=0){return Bv(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return Uv(this,t,n,r)}findIndex(t){if(t==0)return Ka(0,t);if(t==this.size)return Ka(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),a=r+i.nodeSize;if(a>=t)return a==t?Ka(n+1,a):Ka(n,r);r=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return $.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new $(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return $.empty;let n,r=0;for(let i=0;i<t.length;i++){let a=t[i];r+=a.nodeSize,i&&a.isText&&t[i-1].sameMarkup(a)?(n||(n=t.slice(0,i)),n[n.length-1]=a.withText(n[n.length-1].text+a.text)):n&&n.push(a)}return new $(n||t,r)}static from(t){if(!t)return $.empty;if(t instanceof $)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new $([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}$.empty=new $([],0);const ul={index:0,offset:0};function Ka(e,t){return ul.index=e,ul.offset=t,ul}function Ns(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!Ns(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!Ns(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let ve=class Vh{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,r=!1;for(let i=0;i<t.length;i++){let a=t[i];if(this.eq(a))return t;if(this.type.excludes(a.type))n||(n=t.slice(0,i));else{if(a.type.excludes(this.type))return t;!r&&a.type.rank>this.type.rank&&(n||(n=t.slice(0,i)),n.push(this),r=!0),n&&n.push(a)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&Ns(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return Vh.none;if(t instanceof Vh)return[t];let n=t.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};ve.none=[];class ws extends Error{}class K{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=zv(this.content,t+this.openStart,n);return r&&new K(r,this.openStart,this.openEnd)}removeBetween(t,n){return new K(Hv(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return K.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new K($.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let a=t.firstChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.firstChild)r++;for(let a=t.lastChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.lastChild)i++;return new K(t,r,i)}}K.empty=new K($.empty,0,0);function Hv(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:s,offset:o}=e.findIndex(n);if(i==t||a.isText){if(o!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,a.copy(Hv(a.content,t-i-1,n-i-1)))}function zv(e,t,n,r){let{index:i,offset:a}=e.findIndex(t),s=e.maybeChild(i);if(a==t||s.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let o=zv(s.content,t-a-1,n,s);return o&&e.replaceChild(i,s.copy(o))}function IR(e,t,n){if(n.openStart>e.depth)throw new ws("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new ws("Inconsistent open depths");return $v(e,t,n,0)}function $v(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let s=$v(e,t,n,r+1);return a.copy(a.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let s=e.parent,o=s.content;return Tr(s,o.cut(0,e.parentOffset).append(n.content).append(o.cut(t.parentOffset)))}else{let{start:s,end:o}=RR(n,e);return Tr(a,Gv(e,s,o,t,r))}else return Tr(a,Is(e,t,r))}function qv(e,t){if(!t.type.compatibleContent(e.type))throw new ws("Cannot join "+t.type.name+" onto "+e.type.name)}function Wh(e,t,n){let r=e.node(n);return qv(r,t.node(n)),r}function yr(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Xi(e,t,n,r){let i=(t||e).node(n),a=0,s=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(yr(e.nodeAfter,r),a++));for(let o=a;o<s;o++)yr(i.child(o),r);t&&t.depth==n&&t.textOffset&&yr(t.nodeBefore,r)}function Tr(e,t){return e.type.checkContent(t),e.copy(t)}function Gv(e,t,n,r,i){let a=e.depth>i&&Wh(e,t,i+1),s=r.depth>i&&Wh(n,r,i+1),o=[];return Xi(null,e,i,o),a&&s&&t.index(i)==n.index(i)?(qv(a,s),yr(Tr(a,Gv(e,t,n,r,i+1)),o)):(a&&yr(Tr(a,Is(e,t,i+1)),o),Xi(t,n,i,o),s&&yr(Tr(s,Is(n,r,i+1)),o)),Xi(r,null,i,o),new $(o)}function Is(e,t,n){let r=[];if(Xi(null,e,n,r),e.depth>n){let i=Wh(e,t,n+1);yr(Tr(i,Is(e,t,n+1)),r)}return Xi(t,null,n,r),new $(r)}function RR(e,t){let n=t.depth-e.openStart,i=t.node(n).copy(e.content);for(let a=n-1;a>=0;a--)i=t.node(a).copy($.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}class ga{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=t.child(n);return r?t.child(n).cut(r):i}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let a=0;a<t;a++)i+=r.child(a).nodeSize;return i}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return ve.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),i=t.maybeChild(n);if(!r){let o=r;r=i,i=o}let a=r.marks;for(var s=0;s<a.length;s++)a[s].type.spec.inclusive===!1&&(!i||!a[s].isInSet(i.marks))&&(a=a[s--].removeFromSet(a));return a}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=t.parent.maybeChild(t.index());for(var a=0;a<r.length;a++)r[a].type.spec.inclusive===!1&&(!i||!r[a].isInSet(i.marks))&&(r=r[a--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new Rs(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,a=n;for(let s=t;;){let{index:o,offset:l}=s.content.findIndex(a),u=a-l;if(r.push(s,o,i+l),!u||(s=s.child(o),s.isText))break;a=u-1,i+=l+1}return new ga(n,r,a)}static resolveCached(t,n){let r=Hb.get(t);if(r)for(let a=0;a<r.elts.length;a++){let s=r.elts[a];if(s.pos==n)return s}else Hb.set(t,r=new xR);let i=r.elts[r.i]=ga.resolve(t,n);return r.i=(r.i+1)%OR,i}}class xR{constructor(){this.elts=[],this.i=0}}const OR=12,Hb=new WeakMap;class Rs{constructor(t,n,r){this.$from=t,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const LR=Object.create(null);class Xt{constructor(t,n,r,i=ve.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||$.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,r,i=0){this.content.nodesBetween(t,n,r,i,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,r,i){return this.content.textBetween(t,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,r){return this.type==t&&Ns(this.attrs,n||t.defaultAttrs||LR)&&ve.sameSet(this.marks,r||ve.none)}copy(t=null){return t==this.content?this:new Xt(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new Xt(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return K.empty;let i=this.resolve(t),a=this.resolve(n),s=r?0:i.sharedDepth(n),o=i.start(s),u=i.node(s).content.cut(i.pos-o,a.pos-o);return new K(u,i.depth-s,a.depth-s)}replace(t,n,r){return IR(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(t);if(n=n.maybeChild(r),!n)return null;if(i==t||n.isText)return n;t-=i+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(t){return ga.resolveCached(this,t)}resolveNoCache(t){return ga.resolve(this,t)}rangeHasMark(t,n,r){let i=!1;return n>t&&this.nodesBetween(t,n,a=>(r.isInSet(a.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),jv(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=$.empty,i=0,a=r.childCount){let s=this.contentMatchAt(t).matchFragment(r,i,a),o=s&&s.matchFragment(this.content,n);if(!o||!o.validEnd)return!1;for(let l=i;l<a;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(t,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let a=this.contentMatchAt(t).matchType(r),s=a&&a.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=ve.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),t=r.addToSet(t)}if(!ve.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let i=$.fromJSON(t,n.content),a=t.nodeType(n.type).create(n.attrs,i,r);return a.type.checkAttrs(a.attrs),a}}Xt.prototype.text=void 0;class xs extends Xt{constructor(t,n,r,i){if(super(t,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):jv(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new xs(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new xs(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function jv(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class _r{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new DR(t,n);if(r.next==null)return _r.empty;let i=Vv(r);r.next&&r.err("Unexpected trailing text");let a=zR(HR(i));return $R(a,r),a}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let i=this;for(let a=n;i&&a<r;a++)i=i.matchType(t.child(a).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let i=[this];function a(s,o){let l=s.matchFragment(t,r);if(l&&(!n||l.validEnd))return $.from(o.map(u=>u.createAndFill()));for(let u=0;u<s.next.length;u++){let{type:c,next:d}=s.next[u];if(!(c.isText||c.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let p=a(d,o.concat(c));if(p)return p}}return null}return a(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),a=i.match;if(a.matchType(t)){let s=[];for(let o=i;o.type;o=o.via)s.push(o.type);return s.reverse()}for(let s=0;s<a.next.length;s++){let{type:o,next:l}=a.next[s];!o.isLeaf&&!o.hasRequiredAttrs()&&!(o.name in n)&&(!i.type||l.validEnd)&&(r.push({match:o.contentMatch,type:o,via:i}),n[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let i=0;i<r.next.length;i++)t.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),t.map((r,i)=>{let a=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)a+=(s?", ":"")+r.next[s].type.name+"->"+t.indexOf(r.next[s].next);return a}).join(`
|
|
1
|
+
import{r as J,bQ as Dv,bR as pR,j as R,ag as fR,ax as tt,bS as hR,c as Nt,b as gi,m as wn,bx as Wm,bT as Cs,H as mR,d as gR,f as bR,B as Mv,U as Bb}from"./index-DBW7-LLJ.js";import{i as Pv}from"./Check-CK_e8wdj.js";import{a as Fv}from"./Copy01-CbmbpqVa.js";import{e as ER,g as yR,f as TR,b as SR}from"./dialog-BNEf4h73.js";import{n as kR}from"./Tool02-8rf_PPrb.js";import{aV as AR,aW as vR,w as _R}from"./agent-icon-bqP8cd4A.js";import{u as CR}from"./use-mobile-DaXh9iB4.js";import{h as NR}from"./tab-id-ts2R-IK7.js";import{i as wR}from"./ChevronRight-D02mIW0w.js";function Ub(e){return e?e.replace(/[_-]/g," ").toLowerCase().split(" ").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" "):""}function UZ(e,t){return e==="output-error"||e==="output-denied"?"error":e==="approval-requested"?"approval":e==="input-streaming"||e==="input-available"||e==="output-available"&&t===!0?"loading":"idle"}function HZ(e){if(e==null||typeof e!="object")return;const t=e;if(t.structuredContent&&typeof t.structuredContent=="object")return t.structuredContent;if(Array.isArray(t.content)){const n=t.content[0];if(n?.type==="text"&&typeof n.text=="string")try{return JSON.parse(n.text)}catch{return}return}return e}function Ke(e){this.content=e}Ke.prototype={constructor:Ke,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new Ke(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new Ke(n)},addToStart:function(e,t){return new Ke([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Ke(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new Ke(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=Ke.from(e),e.size?new Ke(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=Ke.from(e),e.size?new Ke(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Ke.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}};Ke.from=function(e){if(e instanceof Ke)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Ke(t)};function Bv(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let s=0;i.text[s]==a.text[s];s++)n++;return n}if(i.content.size||a.content.size){let s=Bv(i.content,a.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function Uv(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let s=e.child(--i),o=t.child(--a),l=s.nodeSize;if(s==o){n-=l,r-=l;continue}if(!s.sameMarkup(o))return{a:n,b:r};if(s.isText&&s.text!=o.text){let u=0,c=Math.min(s.text.length,o.text.length);for(;u<c&&s.text[s.text.length-u-1]==o.text[o.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(s.content.size||o.content.size){let u=Uv(s.content,o.content,n-1,r-1);if(u)return u}n-=l,r-=l}}class ${constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,i=0,a){for(let s=0,o=0;o<n;s++){let l=this.content[s],u=o+l.nodeSize;if(u>t&&r(l,i+o,a||null,s)!==!1&&l.content.size){let c=o+1;l.nodesBetween(Math.max(0,t-c),Math.min(l.content.size,n-c),r,i+c)}o=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let a="",s=!0;return this.nodesBetween(t,n,(o,l)=>{let u=o.isText?o.text.slice(Math.max(t,l)-l,n-l):o.isLeaf?i?typeof i=="function"?i(o):i:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&u||o.isTextblock)&&r&&(s?s=!1:a+=r),a+=u},0),a}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new $(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let a=0,s=0;s<n;a++){let o=this.content[a],l=s+o.nodeSize;l>t&&((s<t||l>n)&&(o.isText?o=o.cut(Math.max(0,t-s),Math.min(o.text.length,n-s)):o=o.cut(Math.max(0,t-s-1),Math.min(o.content.size,n-s-1))),r.push(o),i+=o.nodeSize),s=l}return new $(r,i)}cutByIndex(t,n){return t==n?$.empty:t==0&&n==this.content.length?this:new $(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new $(i,a)}addToStart(t){return new $([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new $(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];t(i,r,n),r+=i.nodeSize}}findDiffStart(t,n=0){return Bv(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return Uv(this,t,n,r)}findIndex(t){if(t==0)return Ka(0,t);if(t==this.size)return Ka(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),a=r+i.nodeSize;if(a>=t)return a==t?Ka(n+1,a):Ka(n,r);r=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return $.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new $(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return $.empty;let n,r=0;for(let i=0;i<t.length;i++){let a=t[i];r+=a.nodeSize,i&&a.isText&&t[i-1].sameMarkup(a)?(n||(n=t.slice(0,i)),n[n.length-1]=a.withText(n[n.length-1].text+a.text)):n&&n.push(a)}return new $(n||t,r)}static from(t){if(!t)return $.empty;if(t instanceof $)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new $([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}$.empty=new $([],0);const ul={index:0,offset:0};function Ka(e,t){return ul.index=e,ul.offset=t,ul}function Ns(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!Ns(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!Ns(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let ve=class Vh{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,r=!1;for(let i=0;i<t.length;i++){let a=t[i];if(this.eq(a))return t;if(this.type.excludes(a.type))n||(n=t.slice(0,i));else{if(a.type.excludes(this.type))return t;!r&&a.type.rank>this.type.rank&&(n||(n=t.slice(0,i)),n.push(this),r=!0),n&&n.push(a)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&Ns(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return Vh.none;if(t instanceof Vh)return[t];let n=t.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};ve.none=[];class ws extends Error{}class K{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=zv(this.content,t+this.openStart,n);return r&&new K(r,this.openStart,this.openEnd)}removeBetween(t,n){return new K(Hv(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return K.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new K($.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let a=t.firstChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.firstChild)r++;for(let a=t.lastChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.lastChild)i++;return new K(t,r,i)}}K.empty=new K($.empty,0,0);function Hv(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:s,offset:o}=e.findIndex(n);if(i==t||a.isText){if(o!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,a.copy(Hv(a.content,t-i-1,n-i-1)))}function zv(e,t,n,r){let{index:i,offset:a}=e.findIndex(t),s=e.maybeChild(i);if(a==t||s.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let o=zv(s.content,t-a-1,n,s);return o&&e.replaceChild(i,s.copy(o))}function IR(e,t,n){if(n.openStart>e.depth)throw new ws("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new ws("Inconsistent open depths");return $v(e,t,n,0)}function $v(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let s=$v(e,t,n,r+1);return a.copy(a.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let s=e.parent,o=s.content;return Tr(s,o.cut(0,e.parentOffset).append(n.content).append(o.cut(t.parentOffset)))}else{let{start:s,end:o}=RR(n,e);return Tr(a,Gv(e,s,o,t,r))}else return Tr(a,Is(e,t,r))}function qv(e,t){if(!t.type.compatibleContent(e.type))throw new ws("Cannot join "+t.type.name+" onto "+e.type.name)}function Wh(e,t,n){let r=e.node(n);return qv(r,t.node(n)),r}function yr(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Xi(e,t,n,r){let i=(t||e).node(n),a=0,s=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(yr(e.nodeAfter,r),a++));for(let o=a;o<s;o++)yr(i.child(o),r);t&&t.depth==n&&t.textOffset&&yr(t.nodeBefore,r)}function Tr(e,t){return e.type.checkContent(t),e.copy(t)}function Gv(e,t,n,r,i){let a=e.depth>i&&Wh(e,t,i+1),s=r.depth>i&&Wh(n,r,i+1),o=[];return Xi(null,e,i,o),a&&s&&t.index(i)==n.index(i)?(qv(a,s),yr(Tr(a,Gv(e,t,n,r,i+1)),o)):(a&&yr(Tr(a,Is(e,t,i+1)),o),Xi(t,n,i,o),s&&yr(Tr(s,Is(n,r,i+1)),o)),Xi(r,null,i,o),new $(o)}function Is(e,t,n){let r=[];if(Xi(null,e,n,r),e.depth>n){let i=Wh(e,t,n+1);yr(Tr(i,Is(e,t,n+1)),r)}return Xi(t,null,n,r),new $(r)}function RR(e,t){let n=t.depth-e.openStart,i=t.node(n).copy(e.content);for(let a=n-1;a>=0;a--)i=t.node(a).copy($.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}class ga{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=t.child(n);return r?t.child(n).cut(r):i}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let a=0;a<t;a++)i+=r.child(a).nodeSize;return i}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return ve.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),i=t.maybeChild(n);if(!r){let o=r;r=i,i=o}let a=r.marks;for(var s=0;s<a.length;s++)a[s].type.spec.inclusive===!1&&(!i||!a[s].isInSet(i.marks))&&(a=a[s--].removeFromSet(a));return a}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=t.parent.maybeChild(t.index());for(var a=0;a<r.length;a++)r[a].type.spec.inclusive===!1&&(!i||!r[a].isInSet(i.marks))&&(r=r[a--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new Rs(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,a=n;for(let s=t;;){let{index:o,offset:l}=s.content.findIndex(a),u=a-l;if(r.push(s,o,i+l),!u||(s=s.child(o),s.isText))break;a=u-1,i+=l+1}return new ga(n,r,a)}static resolveCached(t,n){let r=Hb.get(t);if(r)for(let a=0;a<r.elts.length;a++){let s=r.elts[a];if(s.pos==n)return s}else Hb.set(t,r=new xR);let i=r.elts[r.i]=ga.resolve(t,n);return r.i=(r.i+1)%OR,i}}class xR{constructor(){this.elts=[],this.i=0}}const OR=12,Hb=new WeakMap;class Rs{constructor(t,n,r){this.$from=t,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const LR=Object.create(null);class Xt{constructor(t,n,r,i=ve.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||$.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,r,i=0){this.content.nodesBetween(t,n,r,i,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,r,i){return this.content.textBetween(t,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,r){return this.type==t&&Ns(this.attrs,n||t.defaultAttrs||LR)&&ve.sameSet(this.marks,r||ve.none)}copy(t=null){return t==this.content?this:new Xt(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new Xt(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return K.empty;let i=this.resolve(t),a=this.resolve(n),s=r?0:i.sharedDepth(n),o=i.start(s),u=i.node(s).content.cut(i.pos-o,a.pos-o);return new K(u,i.depth-s,a.depth-s)}replace(t,n,r){return IR(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(t);if(n=n.maybeChild(r),!n)return null;if(i==t||n.isText)return n;t-=i+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(t){return ga.resolveCached(this,t)}resolveNoCache(t){return ga.resolve(this,t)}rangeHasMark(t,n,r){let i=!1;return n>t&&this.nodesBetween(t,n,a=>(r.isInSet(a.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),jv(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=$.empty,i=0,a=r.childCount){let s=this.contentMatchAt(t).matchFragment(r,i,a),o=s&&s.matchFragment(this.content,n);if(!o||!o.validEnd)return!1;for(let l=i;l<a;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(t,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let a=this.contentMatchAt(t).matchType(r),s=a&&a.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=ve.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),t=r.addToSet(t)}if(!ve.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let i=$.fromJSON(t,n.content),a=t.nodeType(n.type).create(n.attrs,i,r);return a.type.checkAttrs(a.attrs),a}}Xt.prototype.text=void 0;class xs extends Xt{constructor(t,n,r,i){if(super(t,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):jv(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new xs(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new xs(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function jv(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class _r{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new DR(t,n);if(r.next==null)return _r.empty;let i=Vv(r);r.next&&r.err("Unexpected trailing text");let a=zR(HR(i));return $R(a,r),a}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let i=this;for(let a=n;i&&a<r;a++)i=i.matchType(t.child(a).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let i=[this];function a(s,o){let l=s.matchFragment(t,r);if(l&&(!n||l.validEnd))return $.from(o.map(u=>u.createAndFill()));for(let u=0;u<s.next.length;u++){let{type:c,next:d}=s.next[u];if(!(c.isText||c.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let p=a(d,o.concat(c));if(p)return p}}return null}return a(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),a=i.match;if(a.matchType(t)){let s=[];for(let o=i;o.type;o=o.via)s.push(o.type);return s.reverse()}for(let s=0;s<a.next.length;s++){let{type:o,next:l}=a.next[s];!o.isLeaf&&!o.hasRequiredAttrs()&&!(o.name in n)&&(!i.type||l.validEnd)&&(r.push({match:o.contentMatch,type:o,via:i}),n[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let i=0;i<r.next.length;i++)t.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),t.map((r,i)=>{let a=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)a+=(s?", ":"")+r.next[s].type.name+"->"+t.indexOf(r.next[s].next);return a}).join(`
|
|
2
2
|
`)}}_r.empty=new _r(!0);class DR{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function Vv(e){let t=[];do t.push(MR(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function MR(e){let t=[];do t.push(PR(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function PR(e){let t=UR(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=FR(e,t);else break;return t}function zb(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function FR(e,t){let n=zb(e),r=n;return e.eat(",")&&(e.next!="}"?r=zb(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function BR(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let a in n){let s=n[a];s.isInGroup(t)&&i.push(s)}return i.length==0&&e.err("No node type or group '"+t+"' found"),i}function UR(e){if(e.eat("(")){let t=Vv(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=BR(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function HR(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(s,o,l){let u={term:l,to:o};return t[s].push(u),u}function i(s,o){s.forEach(l=>l.to=o)}function a(s,o){if(s.type=="choice")return s.exprs.reduce((l,u)=>l.concat(a(u,o)),[]);if(s.type=="seq")for(let l=0;;l++){let u=a(s.exprs[l],o);if(l==s.exprs.length-1)return u;i(u,o=n())}else if(s.type=="star"){let l=n();return r(o,l),i(a(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return i(a(s.expr,o),l),i(a(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(o)].concat(a(s.expr,o));if(s.type=="range"){let l=o;for(let u=0;u<s.min;u++){let c=n();i(a(s.expr,l),c),l=c}if(s.max==-1)i(a(s.expr,l),l);else for(let u=s.min;u<s.max;u++){let c=n();r(l,c),i(a(s.expr,l),c),l=c}return[r(l)]}else{if(s.type=="name")return[r(o,void 0,s.value)];throw new Error("Unknown expr type")}}}}function Wv(e,t){return t-e}function $b(e,t){let n=[];return r(t),n.sort(Wv);function r(i){let a=e[i];if(a.length==1&&!a[0].term)return r(a[0].to);n.push(i);for(let s=0;s<a.length;s++){let{term:o,to:l}=a[s];!o&&n.indexOf(l)==-1&&r(l)}}}function zR(e){let t=Object.create(null);return n($b(e,0));function n(r){let i=[];r.forEach(s=>{e[s].forEach(({term:o,to:l})=>{if(!o)return;let u;for(let c=0;c<i.length;c++)i[c][0]==o&&(u=i[c][1]);$b(e,l).forEach(c=>{u||i.push([o,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let a=t[r.join(",")]=new _r(r.indexOf(e.length-1)>-1);for(let s=0;s<i.length;s++){let o=i[s][1].sort(Wv);a.next.push({type:i[s][0],next:t[o.join(",")]||n(o)})}return a}}function $R(e,t){for(let n=0,r=[e];n<r.length;n++){let i=r[n],a=!i.validEnd,s=[];for(let o=0;o<i.next.length;o++){let{type:l,next:u}=i.next[o];s.push(l.name),a&&!(l.isText||l.hasRequiredAttrs())&&(a=!1),r.indexOf(u)==-1&&r.push(u)}a&&t.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Yv(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function Kv(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let a=e[r];if(a.hasDefault)i=a.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function Xv(e,t,n,r){for(let i in t)if(!(i in e))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in e){let a=e[i];a.validate&&a.validate(t[i])}}function Zv(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new GR(e,r,t[r]);return n}let qb=class Qv{constructor(t,n,r){this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Zv(t,r.attrs),this.defaultAttrs=Yv(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==_r.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:Kv(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Xt(this,this.computeAttrs(t),$.from(n),ve.setFrom(r))}createChecked(t=null,n,r){return n=$.from(n),this.checkContent(n),new Xt(this,this.computeAttrs(t),n,ve.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=$.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let i=this.contentMatch.matchFragment(n),a=i&&i.fillBefore($.empty,!0);return a?new Xt(this,t,n.append(a),ve.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r<t.childCount;r++)if(!this.allowsMarks(t.child(r).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){Xv(this.attrs,t,"node",this.name)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:ve.none:t}static compile(t,n){let r=Object.create(null);t.forEach((a,s)=>r[a]=new Qv(a,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let a in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function qR(e,t,n){let r=n.split("|");return i=>{let a=i===null?"null":typeof i;if(r.indexOf(a)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${a}`)}}class GR{constructor(t,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?qR(t,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class No{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=Zv(t,i.attrs),this.excluded=null;let a=Yv(this.attrs);this.instance=a?new ve(this,a):null}create(t=null){return!t&&this.instance?this.instance:new ve(this,Kv(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((a,s)=>r[a]=new No(a,i++,n,s)),r}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}checkAttrs(t){Xv(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}let Jv=class{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in t)n[i]=t[i];n.nodes=Ke.from(t.nodes),n.marks=Ke.from(t.marks||{}),this.nodes=qb.compile(this.spec.nodes,this),this.marks=No.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let a=this.nodes[i],s=a.spec.content||"",o=a.spec.marks;if(a.contentMatch=r[s]||(r[s]=_r.parse(s,this.nodes)),a.inlineContent=a.contentMatch.inlineContent,a.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!a.isInline||!a.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=a}a.markSet=o=="_"?null:o?Gb(this,o.split(" ")):o==""||!a.inlineContent?[]:null}for(let i in this.marks){let a=this.marks[i],s=a.spec.excludes;a.excluded=s==null?[a]:s==""?[]:Gb(this,s.split(" "))}this.nodeFromJSON=i=>Xt.fromJSON(this,i),this.markFromJSON=i=>ve.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,i){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof qb){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,i)}text(t,n){let r=this.nodes.text;return new xs(r,r.defaultAttrs,t,ve.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}};function Gb(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],s=a;if(a)n.push(a);else for(let o in e.marks){let l=e.marks[o];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}function jR(e){return e.tag!=null}function VR(e){return e.style!=null}class Ln{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(jR(i))this.tags.push(i);else if(VR(i)){let a=/[^=]*/.exec(i.style)[0];r.indexOf(a)<0&&r.push(a),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let a=t.nodes[i.node];return a.contentMatch.matchType(a)})}parse(t,n={}){let r=new Vb(this,n,!1);return r.addAll(t,ve.none,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new Vb(this,n,!0);return r.addAll(t,ve.none,n.from,n.to),K.maxOpen(r.finish())}matchTag(t,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let a=this.tags[i];if(KR(t,a.tag)&&(a.namespace===void 0||t.namespaceURI==a.namespace)&&(!a.context||n.matchesContext(a.context))){if(a.getAttrs){let s=a.getAttrs(t);if(s===!1)continue;a.attrs=s||void 0}return a}}}matchStyle(t,n,r,i){for(let a=i?this.styles.indexOf(i)+1:0;a<this.styles.length;a++){let s=this.styles[a],o=s.style;if(!(o.indexOf(t)!=0||s.context&&!r.matchesContext(s.context)||o.length>t.length&&(o.charCodeAt(t.length)!=61||o.slice(t.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(t){let n=[];function r(i){let a=i.priority==null?50:i.priority,s=0;for(;s<n.length;s++){let o=n[s];if((o.priority==null?50:o.priority)<a)break}n.splice(s,0,i)}for(let i in t.marks){let a=t.marks[i].spec.parseDOM;a&&a.forEach(s=>{r(s=Wb(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in t.nodes){let a=t.nodes[i].spec.parseDOM;a&&a.forEach(s=>{r(s=Wb(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new Ln(t,Ln.schemaRules(t)))}}const e_={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},WR={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},t_={ol:!0,ul:!0},ba=1,Yh=2,Zi=4;function jb(e,t,n){return t!=null?(t?ba:0)|(t==="full"?Yh:0):e&&e.whitespace=="pre"?ba|Yh:n&~Zi}class Xa{constructor(t,n,r,i,a,s){this.type=t,this.attrs=n,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=ve.none,this.match=a||(s&Zi?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore($.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(t.type))?(this.match=r,i):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&ba)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let a=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=a.withText(a.text.slice(0,a.text.length-i[0].length))}}let n=$.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore($.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!e_.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class Vb{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,a,s=jb(null,n.preserveWhitespace,0)|(r?Zi:0);i?a=new Xa(i.type,i.attrs,ve.none,!0,n.topMatch||i.type.contentMatch,s):r?a=new Xa(null,null,ve.none,!0,null,s):a=new Xa(t.schema.topNodeType,null,ve.none,!0,null,s),this.nodes=[a],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let r=t.nodeValue,i=this.top,a=i.options&Yh?"full":this.localPreserveWS||(i.options&ba)>0,{schema:s}=this.parser;if(a==="full"||i.inlineContext(t)||/[^ \t\r\n\u000c]/.test(r)){if(a)if(a==="full")r=r.replace(/\r\n?/g,`
|
|
3
3
|
`);else if(s.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(s.linebreakReplacement.create())){let o=r.split(/\r?\n|\r/);for(let l=0;l<o.length;l++)l&&this.insertNode(s.linebreakReplacement.create(),n,!0),o[l]&&this.insertNode(s.text(o[l]),n,!/\S/.test(o[l]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let o=i.content[i.content.length-1],l=t.previousSibling;(!o||l&&l.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(r=r.slice(1))}r&&this.insertNode(s.text(r),n,!/\S/.test(r)),this.findInText(t)}else this.findInside(t)}addElement(t,n,r){let i=this.localPreserveWS,a=this.top;(t.tagName=="PRE"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let s=t.nodeName.toLowerCase(),o;t_.hasOwnProperty(s)&&this.parser.normalizeLists&&YR(t);let l=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(o=this.parser.matchTag(t,this,r));e:if(l?l.ignore:WR.hasOwnProperty(s))this.findInside(t),this.ignoreFallback(t,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(t=l.skip);let u,c=this.needsBlock;if(e_.hasOwnProperty(s))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),u=!0,a.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,n);break e}let d=l&&l.skip?n:this.readStyles(t,n);d&&this.addAll(t,d),u&&this.sync(a),this.needsBlock=c}else{let u=this.readStyles(t,n);u&&this.addElementByRule(t,l,u,l.consuming===!1?o:void 0)}this.localPreserveWS=i}leafFallback(t,n){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
|
|
4
4
|
`),n)}ignoreFallback(t,n){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(t,n){let r=t.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let a=this.parser.matchedStyles[i],s=r.getPropertyValue(a);if(s)for(let o=void 0;;){let l=this.parser.matchStyle(a,s,this,o);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(u=>!l.clearMark(u)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)o=l;else break}}return n}addElementByRule(t,n,r,i){let a,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r,t.nodeName=="BR")||this.leafFallback(t,r);else{let l=this.enter(s,n.attrs||null,r,n.preserveWhitespace);l&&(a=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let o=this.top;if(s&&s.isLeaf)this.findInside(t);else if(i)this.addElement(t,r,i);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=t;typeof n.contentElement=="string"?l=t.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(t):n.contentElement&&(l=n.contentElement),this.findAround(t,l,!0),this.addAll(l,r),this.findAround(t,l,!1)}a&&this.sync(o)&&this.open--}addAll(t,n,r,i){let a=r||0;for(let s=r?t.childNodes[r]:t.firstChild,o=i==null?null:t.childNodes[i];s!=o;s=s.nextSibling,++a)this.findAtPoint(t,a),this.addDOM(s,n);this.findAtPoint(t,a)}findPlace(t,n,r){let i,a;for(let s=this.open,o=0;s>=0;s--){let l=this.nodes[s],u=l.findWrapping(t);if(u&&(!i||i.length>u.length+o)&&(i=u,a=l,!u.length))break;if(l.solid){if(r)break;o+=2}}if(!i)return null;this.sync(a);for(let s=0;s<i.length;s++)n=this.enterInner(i[s],null,n,!1);return n}insertNode(t,n,r){if(t.isInline&&this.needsBlock&&!this.top.type){let a=this.textblockFromContext();a&&(n=this.enterInner(a,null,n))}let i=this.findPlace(t,n,r);if(i){this.closeExtra();let a=this.top;a.match&&(a.match=a.match.matchType(t.type));let s=ve.none;for(let o of i.concat(t.marks))(a.type?a.type.allowsMarkType(o.type):Yb(o.type,t.type))&&(s=o.addToSet(s));return a.content.push(t.mark(s)),!0}return!1}enter(t,n,r,i){let a=this.findPlace(t.create(n),r,!1);return a&&(a=this.enterInner(t,n,r,!0,i)),a}enterInner(t,n,r,i=!1,a){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(t);let o=jb(t,a,s.options);s.options&Zi&&s.content.length==0&&(o|=Zi);let l=ve.none;return r=r.filter(u=>(s.type?s.type.allowsMarkType(u.type):Yb(u.type,t))?(l=u.addToSet(l),!1):!0),this.nodes.push(new Xa(t,n,l,i,null,o)),this.open++,r}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=ba)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)t+=r[i].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&t.nodeType==1&&t.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),a=-(r?r.depth+1:0)+(i?0:1),s=(o,l)=>{for(;o>=0;o--){let u=n[o];if(u==""){if(o==n.length-1||o==0)continue;for(;l>=a;l--)if(s(o-1,l))return!0;return!1}else{let c=l>0||l==0&&i?this.nodes[l].type:r&&l>=a?r.node(l-a).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function YR(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&t_.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function KR(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Wb(e){let t={};for(let n in e)t[n]=e[n];return t}function Yb(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],s=o=>{a.push(o);for(let l=0;l<o.edgeCount;l++){let{type:u,next:c}=o.edge(l);if(u==t||a.indexOf(c)<0&&s(c))return!0}};if(s(i.contentMatch))return!0}}class Lr{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=cl(n).createDocumentFragment());let i=r,a=[];return t.forEach(s=>{if(a.length||s.marks.length){let o=0,l=0;for(;o<a.length&&l<s.marks.length;){let u=s.marks[l];if(!this.marks[u.type.name]){l++;continue}if(!u.eq(a[o][0])||u.type.spec.spanning===!1)break;o++,l++}for(;o<a.length;)i=a.pop()[1];for(;l<s.marks.length;){let u=s.marks[l++],c=this.serializeMark(u,s.isInline,n);c&&(a.push([u,i]),i.appendChild(c.dom),i=c.contentDOM||c.dom)}}i.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(t,n){let{dom:r,contentDOM:i}=ms(cl(n),this.nodes[t.type.name](t),null,t.attrs);if(i){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,i)}return r}serializeNode(t,n={}){let r=this.serializeNodeInner(t,n);for(let i=t.marks.length-1;i>=0;i--){let a=this.serializeMark(t.marks[i],t.isInline,n);a&&((a.contentDOM||a.dom).appendChild(r),r=a.dom)}return r}serializeMark(t,n,r={}){let i=this.marks[t.type.name];return i&&ms(cl(r),i(t,n),null,t.attrs)}static renderSpec(t,n,r=null,i){return ms(t,n,r,i)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Lr(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=Kb(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return Kb(t.marks)}}function Kb(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function cl(e){return e.document||window.document}const Xb=new WeakMap;function XR(e){let t=Xb.get(e);return t===void 0&&Xb.set(e,t=ZR(e)),t}function ZR(e){let t=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")t||(t=[]),t.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(e),t}function ms(e,t,n,r){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],a;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(a=XR(r))&&a.indexOf(t)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let o,l=n?e.createElementNS(n,i):e.createElement(i),u=t[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let d in u)if(u[d]!=null){let p=d.indexOf(" ");p>0?l.setAttributeNS(d.slice(0,p),d.slice(p+1),u[d]):d=="style"&&l.style?l.style.cssText=u[d]:l.setAttribute(d,u[d])}}for(let d=c;d<t.length;d++){let p=t[d];if(p===0){if(d<t.length-1||d>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:f,contentDOM:m}=ms(e,p,n,r);if(l.appendChild(f),m){if(o)throw new RangeError("Multiple content holes");o=m}}}return{dom:l,contentDOM:o}}const n_=65535,r_=Math.pow(2,16);function QR(e,t){return e+t*r_}function Zb(e){return e&n_}function JR(e){return(e-(e&n_))/r_}const i_=1,a_=2,gs=4,s_=8;class Kh{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&s_)>0}get deletedBefore(){return(this.delInfo&(i_|gs))>0}get deletedAfter(){return(this.delInfo&(a_|gs))>0}get deletedAcross(){return(this.delInfo&gs)>0}}class Dt{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Dt.empty)return Dt.empty}recover(t){let n=0,r=Zb(t);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+JR(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,a=this.inverted?2:1,s=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let l=this.ranges[o]-(this.inverted?i:0);if(l>t)break;let u=this.ranges[o+a],c=this.ranges[o+s],d=l+u;if(t<=d){let p=u?t==l?-1:t==d?1:n:n,f=l+i+(p<0?0:c);if(r)return f;let m=t==(n<0?l:d)?null:QR(o/3,t-l),g=t==l?a_:t==d?i_:gs;return(n<0?t!=l:t!=d)&&(g|=s_),new Kh(f,g,m)}i+=c-u}return r?t+i:new Kh(t+i,0,null)}touches(t,n){let r=0,i=Zb(n),a=this.inverted?2:1,s=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let l=this.ranges[o]-(this.inverted?r:0);if(l>t)break;let u=this.ranges[o+a],c=l+u;if(t<=c&&o==i*3)return!0;r+=this.ranges[o+s]-u}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,a=0;i<this.ranges.length;i+=3){let s=this.ranges[i],o=s-(this.inverted?a:0),l=s+(this.inverted?0:a),u=this.ranges[i+n],c=this.ranges[i+r];t(o,o+u,l,l+c),a+=c-u}}invert(){return new Dt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Dt.empty:new Dt(t<0?[0,-t,0]:[0,0,t])}}Dt.empty=new Dt([]);class Ea{constructor(t,n,r=0,i=t?t.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=t||[],this.ownData=!(t||n)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new Ea(this._maps,this.mirror,t,n)}appendMap(t,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(t),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(t){for(let n=0,r=this._maps.length;n<t._maps.length;n++){let i=t.getMirror(n);this.appendMap(t._maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,r=this._maps.length+t._maps.length;n>=0;n--){let i=t.getMirror(n);this.appendMap(t._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let t=new Ea;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;r<this.to;r++)t=this._maps[r].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,r){let i=0;for(let a=this.from;a<this.to;a++){let s=this._maps[a],o=s.mapResult(t,n);if(o.recover!=null){let l=this.getMirror(a);if(l!=null&&l>a&&l<this.to){a=l,t=this._maps[l].recover(o.recover);continue}}i|=o.delInfo,t=o.pos}return r?t:new Kh(t,i,null)}}const dl=Object.create(null);class it{getMap(){return Dt.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=dl[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in dl)throw new RangeError("Duplicate use of step JSON ID "+t);return dl[t]=n,n.prototype.jsonID=t,n}}class He{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new He(t,null)}static fail(t){return new He(null,t)}static fromReplace(t,n,r,i){try{return He.ok(t.replace(n,r,i))}catch(a){if(a instanceof ws)return He.fail(a.message);throw a}}}function Ym(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(Ym(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return $.fromArray(r)}class Xn extends it{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),a=new K(Ym(n.content,(s,o)=>!s.isAtom||!o.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return He.fromReplace(t,this.from,this.to,a)}invert(){return new Kt(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Xn(n.pos,r.pos,this.mark)}merge(t){return t instanceof Xn&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Xn(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Xn(n.from,n.to,t.markFromJSON(n.mark))}}it.jsonID("addMark",Xn);class Kt extends it{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new K(Ym(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return He.fromReplace(t,this.from,this.to,r)}invert(){return new Xn(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Kt(n.pos,r.pos,this.mark)}merge(t){return t instanceof Kt&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Kt(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Kt(n.from,n.to,t.markFromJSON(n.mark))}}it.jsonID("removeMark",Kt);class Zn extends it{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return He.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return He.fromReplace(t,this.pos,this.pos+1,new K($.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Zn(this.pos,n.marks[i]);return new Zn(this.pos,this.mark)}}return new Cr(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Zn(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Zn(n.pos,t.markFromJSON(n.mark))}}it.jsonID("addNodeMark",Zn);class Cr extends it{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return He.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return He.fromReplace(t,this.pos,this.pos+1,new K($.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Zn(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Cr(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Cr(n.pos,t.markFromJSON(n.mark))}}it.jsonID("removeNodeMark",Cr);class Ue extends it{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&Xh(t,this.from,this.to)?He.fail("Structure replace would overwrite content"):He.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Dt([this.from,this.to-this.from,this.slice.size])}invert(t){return new Ue(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&Ue.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new Ue(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof Ue)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?K.empty:new K(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Ue(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?K.empty:new K(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Ue(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Ue(n.from,n.to,K.fromJSON(t,n.slice),!!n.structure)}}Ue.MAP_BIAS=1;it.jsonID("replace",Ue);class We extends it{constructor(t,n,r,i,a,s,o=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=a,this.insert=s,this.structure=o}apply(t){if(this.structure&&(Xh(t,this.from,this.gapFrom)||Xh(t,this.gapTo,this.to)))return He.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return He.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?He.fromReplace(t,this.from,this.to,r):He.fail("Content does not fit in gap")}getMap(){return new Dt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new We(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new We(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new We(n.from,n.to,n.gapFrom,n.gapTo,K.fromJSON(t,n.slice),n.insert,!!n.structure)}}it.jsonID("replaceAround",We);function Xh(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let s=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function ex(e,t,n,r){let i=[],a=[],s,o;e.doc.nodesBetween(t,n,(l,u,c)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&c.type.allowsMarkType(r.type)){let p=Math.max(u,t),f=Math.min(u+l.nodeSize,n),m=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(m)||(s&&s.to==p&&s.mark.eq(d[g])?s.to=f:i.push(s=new Kt(p,f,d[g])));o&&o.to==p?o.to=f:a.push(o=new Xn(p,f,r))}}),i.forEach(l=>e.step(l)),a.forEach(l=>e.step(l))}function tx(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(s,o)=>{if(!s.isInline)return;a++;let l=null;if(r instanceof No){let u=s.marks,c;for(;c=r.isInSet(u);)(l||(l=[])).push(c),u=c.removeFromSet(u)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let u=Math.min(o+s.nodeSize,n);for(let c=0;c<l.length;c++){let d=l[c],p;for(let f=0;f<i.length;f++){let m=i[f];m.step==a-1&&d.eq(i[f].style)&&(p=m)}p?(p.to=u,p.step=a):i.push({style:d,from:Math.max(o,t),to:u,step:a})}}}),i.forEach(s=>e.step(new Kt(s.from,s.to,s.style)))}function Km(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),s=[],o=t+1;for(let l=0;l<a.childCount;l++){let u=a.child(l),c=o+u.nodeSize,d=r.matchType(u.type);if(!d)s.push(new Ue(o,c,K.empty));else{r=d;for(let p=0;p<u.marks.length;p++)n.allowsMarkType(u.marks[p].type)||e.step(new Kt(o,c,u.marks[p]));if(i&&u.isText&&n.whitespace!="pre"){let p,f=/\r?\n|\r/g,m;for(;p=f.exec(u.text);)m||(m=new K($.from(n.schema.text(" ",n.allowedMarks(u.marks))),0,0)),s.push(new Ue(o+p.index,o+p.index+p[0].length,m))}}o=c}if(!r.validEnd){let l=r.fillBefore($.empty,!0);e.replace(o,o,new K(l,0,0))}for(let l=s.length-1;l>=0;l--)e.step(s[l])}function nx(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function bi(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth,i=0,a=0;;--r){let s=e.$from.node(r),o=e.$from.index(r)+i,l=e.$to.indexAfter(r)-a;if(r<e.depth&&s.canReplace(o,l,n))return r;if(r==0||s.type.spec.isolating||!nx(s,o,l))break;o&&(i=1),l<s.childCount&&(a=1)}return null}function rx(e,t,n){let{$from:r,$to:i,depth:a}=t,s=r.before(a+1),o=i.after(a+1),l=s,u=o,c=$.empty,d=0;for(let m=a,g=!1;m>n;m--)g||r.index(m)>0?(g=!0,c=$.from(r.node(m).copy(c)),d++):l--;let p=$.empty,f=0;for(let m=a,g=!1;m>n;m--)g||i.after(m+1)<i.end(m)?(g=!0,p=$.from(i.node(m).copy(p)),f++):u++;e.step(new We(l,u,s,o,new K(c.append(p),d,f),c.size-d,!0))}function Xm(e,t,n=null,r=e){let i=ix(e,t),a=i&&ax(r,t);return a?i.map(Qb).concat({type:t,attrs:n}).concat(a.map(Qb)):null}function Qb(e){return{type:e,attrs:null}}function ix(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let s=a.length?a[0]:t;return n.canReplaceWith(r,i,s)?a:null}function ax(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),s=t.contentMatch.findWrapping(a.type);if(!s)return null;let l=(s.length?s[s.length-1]:t).contentMatch;for(let u=r;l&&u<i;u++)l=l.matchType(n.child(u).type);return!l||!l.validEnd?null:s}function sx(e,t,n){let r=$.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let o=n[s].type.contentMatch.matchFragment(r);if(!o||!o.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=$.from(n[s].type.create(n[s].attrs,r))}let i=t.start,a=t.end;e.step(new We(i,a,i,a,new K(r,0,0),n.length,!0))}function ox(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let a=e.steps.length;e.doc.nodesBetween(t,n,(s,o)=>{let l=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,l)&&lx(e.doc,e.mapping.slice(a).map(o),r)){let u=null;if(r.schema.linebreakReplacement){let f=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);f&&!m?u=!1:!f&&m&&(u=!0)}u===!1&&l_(e,s,o,a),Km(e,e.mapping.slice(a).map(o,1),r,void 0,u===null);let c=e.mapping.slice(a),d=c.map(o,1),p=c.map(o+s.nodeSize,1);return e.step(new We(d,p,d+1,p-1,new K($.from(r.create(l,null,s.marks)),0,0),1,!0)),u===!0&&o_(e,s,o,a),!1}})}function o_(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let s,o=/\r?\n|\r/g;for(;s=o.exec(i.text);){let l=e.mapping.slice(r).map(n+1+a+s.index);e.replaceWith(l,l+1,t.type.schema.linebreakReplacement.create())}}})}function l_(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let s=e.mapping.slice(r).map(n+1+a);e.replaceWith(s,s+1,t.type.schema.text(`
|
package/dist/client/assets/{capability-load-error-D5Gggd0Y.js → capability-load-error-CI7JffNO.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,b as y,o as h,F as j,j as s,z as b,K as C,B as E}from"./index-
|
|
1
|
+
import{c as p,b as y,o as h,F as j,j as s,z as b,K as C,B as E}from"./index-DBW7-LLJ.js";function v(){const e=p.c(23),t=y(),d=h(),{locator:x}=j();let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted text-muted-foreground",children:s.jsx(b,{size:28})}),e[0]=u):u=e[0];let i;e[1]!==t?(i=t("common.capabilityLoadError.title"),e[1]=t,e[2]=i):i=e[2];let l;e[3]!==i?(l=s.jsx("h3",{className:"text-lg font-medium",children:i}),e[3]=i,e[4]=l):l=e[4];let r;e[5]!==t?(r=t("common.capabilityLoadError.description"),e[5]=t,e[6]=r):r=e[6];let a;e[7]!==r?(a=s.jsx("p",{className:"mx-auto max-w-sm text-sm text-muted-foreground",children:r}),e[7]=r,e[8]=a):a=e[8];let o;e[9]!==l||e[10]!==a?(o=s.jsxs("div",{className:"space-y-1",children:[l,a]}),e[9]=l,e[10]=a,e[11]=o):o=e[11];let n;e[12]!==x||e[13]!==d?(n=()=>d.invalidateQueries({queryKey:C.myCapabilities(x)}),e[12]=x,e[13]=d,e[14]=n):n=e[14];let c;e[15]!==t?(c=t("common.capabilityLoadError.tryAgain"),e[15]=t,e[16]=c):c=e[16];let m;e[17]!==n||e[18]!==c?(m=s.jsx(E,{variant:"outline",size:"sm",onClick:n,children:c}),e[17]=n,e[18]=c,e[19]=m):m=e[19];let f;return e[20]!==o||e[21]!==m?(f=s.jsxs("div",{className:"flex h-full min-h-[60vh] flex-1 flex-col items-center justify-center gap-4 p-6 text-center",children:[u,o,m]}),e[20]=o,e[21]=m,e[22]=f):f=e[22],f}export{v as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as l,m as n,j as c}from"./index-
|
|
1
|
+
import{c as l,m as n,j as c}from"./index-DBW7-LLJ.js";function i(a){const e=l.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let r;e[3]!==t?(r=n("bg-card text-card-foreground flex flex-col gap-6 rounded-xl card-shadow",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==s||e[6]!==r?(o=c.jsx("div",{"data-slot":"card",className:r,...s}),e[5]=s,e[6]=r,e[7]=o):o=e[7],o}function f(a){const e=l.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=c.jsx("div",{"data-slot":"card-content",...t}),e[2]=t,e[3]=s):s=e[3],s}export{i as C,f as a};
|