decocms 4.518.1 → 4.518.3
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/{ActiveShapeUtils-Bis8M8cE.js → ActiveShapeUtils-Docp8wLu.js} +1 -1
- package/dist/client/assets/{AlertCircle-CF7oV00-.js → AlertCircle-DbgHFTtO.js} +1 -1
- package/dist/client/assets/{AreaChart-rRgwbDdY.js → AreaChart-CcL-fFKM.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BYRX2oWU.js → ArrowLeft-B24gv2xe.js} +1 -1
- package/dist/client/assets/{ArrowUp-C-Wi5Wp-.js → ArrowUp-CgN1Qhsf.js} +1 -1
- package/dist/client/assets/{BarChart-B-Yzzi8V.js → BarChart-CCFGMu0H.js} +1 -1
- package/dist/client/assets/{Building02-BTo5ALb8.js → Building02-DBmpU4M6.js} +1 -1
- package/dist/client/assets/{CartesianChart-D4q-R38l.js → CartesianChart-DHq2iPiU.js} +1 -1
- package/dist/client/assets/{CategoricalChart-DTvqZVLo.js → CategoricalChart-Do09x_e5.js} +1 -1
- package/dist/client/assets/{CheckCircle-B7DLXg5D.js → CheckCircle-Cqp__I1R.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-ByVW2vd8.js → ChevronSelectorVertical-Bg2KdIAv.js} +1 -1
- package/dist/client/assets/{ChevronUp-i4o2LTaN.js → ChevronUp-BJfOFayd.js} +1 -1
- package/dist/client/assets/{Copy01-Ck9G4OUr.js → Copy01-C8oI3ru2.js} +1 -1
- package/dist/client/assets/{CreditCard01-DBL8NXSk.js → CreditCard01-DBg0t5KK.js} +1 -1
- package/dist/client/assets/{DotsVertical-DGS_x5nz.js → DotsVertical-MgtYn_XR.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-ClwVJba6.js → ErrorBarContext-Bjgx2BpF.js} +1 -1
- package/dist/client/assets/{Globe04-lKXBAfc3.js → Globe04-8XNa-DGn.js} +1 -1
- package/dist/client/assets/{Image01-Cwrowq3c.js → Image01-BYSI_JTy.js} +1 -1
- package/dist/client/assets/{Key01-CEbPGYnm.js → Key01-CVBy3Esl.js} +1 -1
- package/dist/client/assets/{Link01-DXqb71Uu.js → Link01-1YHKCfLl.js} +1 -1
- package/dist/client/assets/{LinkBroken01-DhWTb9MO.js → LinkBroken01-D8vKURBw.js} +1 -1
- package/dist/client/assets/{Minus-C9yYSfDR.js → Minus-D7Nn8Jj1.js} +1 -1
- package/dist/client/assets/{Monitor01-BL3DAm_1.js → Monitor01-th-leB7u.js} +1 -1
- package/dist/client/assets/{Play-CZ7QKkqf.js → Play-B3knqxcb.js} +1 -1
- package/dist/client/assets/{Plus-BRxUqR_F.js → Plus-Bf8vM3Sx.js} +1 -1
- package/dist/client/assets/{ReferenceLine-D1hjyX4I.js → ReferenceLine-DevuDJh8.js} +1 -1
- package/dist/client/assets/{SearchMd-DiO3q0AT.js → SearchMd-C1vd4NNy.js} +1 -1
- package/dist/client/assets/{Sector-XuiRQ9ct.js → Sector-CjducGVR.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-B4aQ0-ny.js → ShoppingBag01-Bkku1Te9.js} +1 -1
- package/dist/client/assets/{Sun-DqiY7Z2B.js → Sun-C_rfv84K.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BbdJtypW.js → SwitchHorizontal01-DsxrRdFb.js} +1 -1
- package/dist/client/assets/{Tool01-C0vFHYhV.js → Tool01-XzMXqYKz.js} +1 -1
- package/dist/client/assets/{Trash01-bhcUMroB.js → Trash01-C68DqBe-.js} +1 -1
- package/dist/client/assets/{Upload01-BwEuXdMa.js → Upload01-D4h8lLWj.js} +1 -1
- package/dist/client/assets/{User01-DSs11bSF.js → User01-BKJMa06q.js} +1 -1
- package/dist/client/assets/{UserSquare-DXYtKMfd.js → UserSquare-ezkB_C7H.js} +1 -1
- package/dist/client/assets/{Users01-CTqd0ZAH.js → Users01-sQ3Jopve.js} +1 -1
- package/dist/client/assets/{XClose-CxYwKo3k.js → XClose-5-Y_ZVDY.js} +1 -1
- package/dist/client/assets/{ZoomOut-D-Ww048N.js → ZoomOut-CTwXyALk.js} +1 -1
- package/dist/client/assets/{access-gate-Bq22oyfg.js → access-gate-BAeTdIKF.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-CQYwaYCv.js → add-connection-dialog-CzGzxkZf.js} +1 -1
- package/dist/client/assets/agent-analytics-CyvLQ78l.js +1 -0
- package/dist/client/assets/agent-app-CNlTu6Xl.js +1 -0
- package/dist/client/assets/{agent-assets-4YMODB__.js → agent-assets-CDrWVXsZ.js} +1 -1
- package/dist/client/assets/{agent-automation-CmK6_mc6.js → agent-automation-CANuyesn.js} +3 -3
- package/dist/client/assets/agent-automations-FCLkmptj.js +1 -0
- package/dist/client/assets/agent-calendar-ChKa8nwx.js +1 -0
- package/dist/client/assets/{agent-connect-sources-Bxy4Jo7k.js → agent-connect-sources-DPRFzy_W.js} +1 -1
- package/dist/client/assets/agent-deck-DgzTTX-H.js +1 -0
- package/dist/client/assets/{agent-e2e-BdqM7Rx1.js → agent-e2e-CGsydJDk.js} +1 -1
- package/dist/client/assets/agent-experiments-g1fOqVOr.js +1 -0
- package/dist/client/assets/agent-file-DZxHfHqj.js +1 -0
- package/dist/client/assets/{agent-hosting-yUCKeG5I.js → agent-hosting-DLdgWaMb.js} +1 -1
- package/dist/client/assets/{agent-icon-CCDPFoN-.js → agent-icon-Bl0Q4nDQ.js} +1 -1
- package/dist/client/assets/agent-library-T0msL9vO.js +1 -0
- package/dist/client/assets/agent-library-file-Dc6tLUFf.js +1 -0
- package/dist/client/assets/agent-monitor-64lw2Ndx.js +1 -0
- package/dist/client/assets/{agent-overview-D27q04-k.js → agent-overview-DmbW8VOm.js} +1 -1
- package/dist/client/assets/{agent-releases-DhOHbzAx.js → agent-releases-DJsbXDlS.js} +1 -1
- package/dist/client/assets/agent-settings-BEGX73lw.js +1 -0
- package/dist/client/assets/{agent-site-editor-CoubOLH6.js → agent-site-editor-Dn7we51s.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-MGF1GSqb.js +2 -0
- package/dist/client/assets/agent-site-editor-content-KSRD36m4.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-jNYBd5Qs.js +1 -0
- package/dist/client/assets/agent-view-Cmt42rZM.js +1 -0
- package/dist/client/assets/{agent-view-guard-BIS7z4mW.js → agent-view-guard-B0aDsWRb.js} +1 -1
- package/dist/client/assets/{agents-list-CpVGk57l.js → agents-list-lOOhfuKV.js} +1 -1
- package/dist/client/assets/{ai-providers-C8dIcjWL.js → ai-providers-Bm7atoS5.js} +1 -1
- package/dist/client/assets/{alert-dialog-BcRtAren.js → alert-dialog-SFY1grIM.js} +2 -2
- package/dist/client/assets/alert-fsJICKf8.js +1 -0
- package/dist/client/assets/{analytics-sections-CTEkK2Tf.js → analytics-sections-KGMek742.js} +1 -1
- package/dist/client/assets/{analytics-tab-DPVT4KOA.js → analytics-tab-DrPnNwhC.js} +2 -2
- package/dist/client/assets/{api-keys-DYTxKYWP.js → api-keys-DGMEM3Pu.js} +1 -1
- package/dist/client/assets/api-keys-DxiLI10z.js +1 -0
- package/dist/client/assets/{app-editor-C1ZA1u8T.js → app-editor-6m_ygtwU.js} +1 -1
- package/dist/client/assets/{asset-utils-DIN0M3zp.js → asset-utils-DJKQ3jqO.js} +1 -1
- package/dist/client/assets/{auth-catchall-vhsgYqnn.js → auth-catchall-BDasxET4.js} +1 -1
- package/dist/client/assets/{auth-entry-C6zNerIy.js → auth-entry-CIp781XC.js} +1 -1
- package/dist/client/assets/{auth-vu0NBiVX.js → auth-k-50r1Jm.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DKwsje6s.js → auth-split-layout-DKyMuscv.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-Dj1wDkpb.js → authenticate-and-persist-oauth-Citp3_ku.js} +1 -1
- package/dist/client/assets/{automation-list-row-DucKF7kG.js → automation-list-row-DCYvqhb1.js} +1 -1
- package/dist/client/assets/{automation-runs-Ui7o3JfN.js → automation-runs-Bv01EPr_.js} +1 -1
- package/dist/client/assets/{automations-CmK0evd4.js → automations-CMa4N4ws.js} +1 -1
- package/dist/client/assets/{autosend-ClHP6mj3.js → autosend-BUGExBM4.js} +1 -1
- package/dist/client/assets/{avatar-BfW8_V1B.js → avatar-DZp2nksb.js} +1 -1
- package/dist/client/assets/badge-B8Ivcb6S.js +1 -0
- package/dist/client/assets/{block-document-l9rZniOP.js → block-document-t9Z4rWQI.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-DIzgwExA.js → blocks-preview-workspace-context-guMABPcp.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-D014yZyw.js → blocks-tab-states-Ch0bvZWI.js} +1 -1
- package/dist/client/assets/{blog-schema-p025Q_3k.js → blog-schema-DGhK3ld9.js} +1 -1
- package/dist/client/assets/{buckets-C4799eWK.js → buckets-PCZkbjVY.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-C9nuC795.js → build-improve-prompt-doc-Ba28GGJ7.js} +1 -1
- package/dist/client/assets/{calendar-C7UsyFmW.js → calendar-BDnGPQeR.js} +1 -1
- package/dist/client/assets/{campaigns-view-Cz4ACJMm.js → campaigns-view-BzxbPG_g.js} +1 -1
- package/dist/client/assets/{capability-load-error-rgxsCr8U.js → capability-load-error-h9GaAVI2.js} +1 -1
- package/dist/client/assets/{category-editor-CldKargp.js → category-editor-BCaNtr8G.js} +1 -1
- package/dist/client/assets/cdn-tab-BxlHc73J.js +1 -0
- package/dist/client/assets/{chart-7lusH4mk.js → chart-CF2951Pl.js} +1 -1
- package/dist/client/assets/{chat-context-DaG-xhpe.js → chat-context-C_P788VD.js} +6 -6
- package/dist/client/assets/{chat-draft-B4qXFQ20.js → chat-draft-Cd62GOk3.js} +1 -1
- package/dist/client/assets/{checkbox-k3S7hbYo.js → checkbox-D_LpTCuo.js} +1 -1
- package/dist/client/assets/{choose-editor-DhoxAjmj.js → choose-editor-CB85FQ98.js} +1 -1
- package/dist/client/assets/{cli-auth-success-9cwHK6DP.js → cli-auth-success-6cvMKGqI.js} +1 -1
- package/dist/client/assets/{client-icons-XJM50Gvn.js → client-icons-CwlNIvVS.js} +1 -1
- package/dist/client/assets/cms-settings-editor-CoBhi6-0.js +1 -0
- package/dist/client/assets/{collapsible-CCUbGddy.js → collapsible-BHKr0Yuy.js} +1 -1
- package/dist/client/assets/{collection-detail-BQphYH0i.js → collection-detail--pNpxuBG.js} +1 -1
- package/dist/client/assets/{collection-display-button-DtypHbWr.js → collection-display-button-CmGqnHZR.js} +1 -1
- package/dist/client/assets/{collection-search-DFZiZHgj.js → collection-search-BfeTverb.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-D5vvhE9_.js → collection-table-wrapper-DbYcMpOp.js} +1 -1
- package/dist/client/assets/{collection-tabs-5oBppmJp.js → collection-tabs-BCwnkCTo.js} +1 -1
- package/dist/client/assets/{column-rules-DikbPDpl.js → column-rules-cuIMwEgL.js} +1 -1
- package/dist/client/assets/{combobox--wUI1bJn.js → combobox-Br3ekqoF.js} +1 -1
- package/dist/client/assets/{command-A6J0_nSj.js → command-9a3EU_B7.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-DHW4_WEu.js → companion-mcps-section-Bict1-Py.js} +1 -1
- package/dist/client/assets/{config-0cyLL49J.js → config-HnMhGwJ8.js} +1 -1
- package/dist/client/assets/{connect-Bi8fTNRc.js → connect-CPP1LzMI.js} +1 -1
- package/dist/client/assets/{connect-layout-BXupI1uo.js → connect-layout-CoCuwn0R.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-DUESoily.js → connect-source-dialog-tW0_dVgF.js} +1 -1
- package/dist/client/assets/{connection-DP0Tkqpu.js → connection-DA0DdtmE.js} +1 -1
- package/dist/client/assets/{connection-card-SGeLl-3V.js → connection-card-D6khbIvi.js} +1 -1
- package/dist/client/assets/{connection-detail-8iT2pzkA.js → connection-detail-3DINZ9Ps.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-5dAreg1i.js → connection-form-helpers-CD1Glq-b.js} +1 -1
- package/dist/client/assets/{connections-Ba0FzDee.js → connections-5zgE9hOg.js} +1 -1
- package/dist/client/assets/{content-tab-Co7UZ0ue.js → content-tab-DsX079ZZ.js} +3 -3
- package/dist/client/assets/{context-DSH71GyO.js → context-D_yEBKdV.js} +1 -1
- package/dist/client/assets/{context-menu-m7JMy9Ts.js → context-menu-CQmIAsNX.js} +1 -1
- package/dist/client/assets/{context-shell-CHo3-a1U.js → context-shell-Cm9pkJeZ.js} +3 -3
- package/dist/client/assets/{core.esm-BT3eS5hh.js → core.esm-KXf7B9P5.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-t8CuAC-D.js → create-organization-dialog-CU3HQ3J9.js} +1 -1
- package/dist/client/assets/{daily-pulse-EoXIBNAG.js → daily-pulse-BTMsF03t.js} +1 -1
- package/dist/client/assets/{discover-r5fXEWQj.js → discover-CF8v9Owa.js} +1 -1
- package/dist/client/assets/{domain-settings-Zd079_oe.js → domain-settings-BE6GV0Yp.js} +1 -1
- package/dist/client/assets/{drawer-BfInv3z-.js → drawer-BTNZfEU6.js} +1 -1
- package/dist/client/assets/{editor-classes-5vsxGGPA.js → editor-classes-DQrtem9w.js} +1 -1
- package/dist/client/assets/{editor-CpWj2GSL.js → editor-swke_0an.js} +1 -1
- package/dist/client/assets/{empty-state-C97rGNTx.js → empty-state-CkRk6emt.js} +1 -1
- package/dist/client/assets/{empty-state-BThdzdI0.js → empty-state-DjnYxJoJ.js} +1 -1
- package/dist/client/assets/experiments-tab-6fYgjeCj.js +1 -0
- package/dist/client/assets/experiments-tab-choice-DLYJ3Xgw.js +1 -0
- package/dist/client/assets/{extract-connection-data-BJcueAXf.js → extract-connection-data-BcSeYo2b.js} +1 -1
- package/dist/client/assets/{feature-gate-DOUh8nVg.js → feature-gate-DnDfxxPc.js} +1 -1
- package/dist/client/assets/{feature-paywall-skggPdmN.js → feature-paywall-DbYyln6a.js} +1 -1
- package/dist/client/assets/{file-explorer-BB5wuYW2.js → file-explorer-CmXZRbDC.js} +1 -1
- package/dist/client/assets/{file-preview-DYLPzEi6.js → file-preview-CB-QuWoi.js} +1 -1
- package/dist/client/assets/{file-share-button-B1svbxuR.js → file-share-button-5DKLtCO8.js} +2 -2
- package/dist/client/assets/{file-type-icon-Dh-YpP4t.js → file-type-icon-BlPndn8R.js} +1 -1
- package/dist/client/assets/{folder-icon-CPXfYDTX.js → folder-icon-50i43Zdi.js} +2 -2
- package/dist/client/assets/{form-Diz2j79C.js → form-CWlPjOiE.js} +1 -1
- package/dist/client/assets/{general-5pQPx87d.js → general-DiUoRhmp.js} +1 -1
- package/dist/client/assets/{home-Dnlsm-wz.js → home-DgNlH8AE.js} +1 -1
- package/dist/client/assets/{icon-button-DuuXKRCk.js → icon-button-BjI92SlL.js} +1 -1
- package/dist/client/assets/{index-u06bTyUt.js → index-AzZxgAUy.js} +1 -1
- package/dist/client/assets/{index-Bpjyo8cb.js → index-BT89s1_n.js} +1 -1
- package/dist/client/assets/{index-fElQwNzQ.js → index-BiGgRVLA.js} +1 -1
- package/dist/client/assets/{index-CjCEGRSu.js → index-BzTLQsHh.js} +1 -1
- package/dist/client/assets/{index-DY9jv8u5.js → index-CImJlq71.js} +38 -38
- package/dist/client/assets/{index-D2_QRuAQ.js → index-ChO_KP9v.js} +1 -1
- package/dist/client/assets/{index-CtJ5bSic.js → index-D5TlKaB4.js} +1 -1
- package/dist/client/assets/index-D8VCkLtE.js +1 -0
- package/dist/client/assets/{index-DPyR1fyZ.js → index-DQ2PXCBR.js} +1 -1
- package/dist/client/assets/{index-Bw7ZdG0V.js → index-DYNe4TdA.js} +1 -1
- package/dist/client/assets/{index-5O453B2L.js → index-DfzKVEQZ.js} +1 -1
- package/dist/client/assets/index-MPdUOMBb.css +1 -0
- package/dist/client/assets/{index-CH_rHFJ7.js → index-UjSXE0Iy.js} +1 -1
- package/dist/client/assets/{index-vOiCoekF.js → index-YTcaUBCs.js} +1 -1
- package/dist/client/assets/{index-BvwkkTca.js → index-YVO_Peic.js} +1 -1
- package/dist/client/assets/{index-hWaEVFzi.js → index-YbD_X2Sg.js} +1 -1
- package/dist/client/assets/{index-redirect-BF2Ze6CX.js → index-redirect-DDzvngbU.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-Glyohd4p.js → infiniteQueryObserver-BPnYbZuQ.js} +1 -1
- package/dist/client/assets/{infra-billing-Bd2bFoZ5.js → infra-billing-BqdikAj2.js} +1 -1
- package/dist/client/assets/{input-F0XP3M77.js → input-BHFkZ3T9.js} +3 -3
- package/dist/client/assets/{input-Ca18CK1P.js → input-Cs9OOIz-.js} +1 -1
- package/dist/client/assets/{integration-icon-BZ0SYBCb.js → integration-icon-B9snkXuC.js} +1 -1
- package/dist/client/assets/{jira-icon-66RPgyoE.js → jira-icon-DIYO8jdA.js} +1 -1
- package/dist/client/assets/{label-CUbZuKc3.js → label-CfvfFl3x.js} +1 -1
- package/dist/client/assets/{layout-Cedqx0JP.js → layout-BRYkue1F.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-D41zNkt6.js → legacy-agents-deep-Sb6HNynM.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-B7bd3WDG.js → legacy-main-redirect-DxGhnvQi.js} +1 -1
- package/dist/client/assets/library-BWuIS4mc.js +1 -0
- package/dist/client/assets/{login-BEUSAD5h.js → login-BoKhcWPb.js} +1 -1
- package/dist/client/assets/{markdown-CQTrkEJG.js → markdown-BDnIqP7U.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-CfeFa2D0.js → mcp-app-renderer-vmvnP_G4.js} +1 -1
- package/dist/client/assets/{mcp-oauth-dZFQnVjg.js → mcp-oauth-Bf1ymd_L.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DqI-dLnK.js → mcp-oauth-De4zWGdY.js} +1 -1
- package/dist/client/assets/{members-D8letp2p.js → members-C_49FqGn.js} +1 -1
- package/dist/client/assets/{memory-C9mu7Zkb.js → memory-DB-8JkBQ.js} +1 -1
- package/dist/client/assets/{mini-report-page-JqpGP2GL.js → mini-report-page-UFZ1_IfA.js} +1 -1
- package/dist/client/assets/{mock-board-BGHy2qG4.js → mock-board-uI6Kjr1q.js} +3 -3
- package/dist/client/assets/{monaco-editor-nJc5wgpu.js → monaco-editor-FMQP-sIq.js} +2 -2
- package/dist/client/assets/monitoring-D8MQ-E4C.js +1 -0
- package/dist/client/assets/{monitoring-stats-row-BAFX8tUf.js → monitoring-stats-row-BGPZUteu.js} +1 -1
- package/dist/client/assets/{multi-select-DpaHzZAz.js → multi-select-CjpZ72b0.js} +1 -1
- package/dist/client/assets/{mustache-CewpKCP1.js → mustache-wrPcgRSJ.js} +1 -1
- package/dist/client/assets/{named-rule-uses-939Puzgt.js → named-rule-uses-DUhhItNP.js} +1 -1
- package/dist/client/assets/{named-rule-view-CML2JnRp.js → named-rule-view-DuazhL5D.js} +1 -1
- package/dist/client/assets/{new-project-dialog-BDUYA1Q9.js → new-project-dialog-CEUx8Wuz.js} +1 -1
- package/dist/client/assets/{oauth-callback-ClogQ-NW.js → oauth-callback-VCDp4Mdt.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-aAWOChDT.js → oauth-callback-ai-provider-DA8fj9mx.js} +1 -1
- package/dist/client/assets/{onboarding-DkM2lBLt.js → onboarding-CNAboKGM.js} +1 -1
- package/dist/client/assets/{openai-conversation-CnNyoZHy.js → openai-conversation-DzWEkMFW.js} +2 -2
- package/dist/client/assets/{optimistic-project-sidebar-views-Dd9HCPLE.js → optimistic-project-sidebar-views-DtUy3pl1.js} +1 -1
- package/dist/client/assets/{order-monitor-day-D7yGjq7b.js → order-monitor-day-AyxJmcAH.js} +1 -1
- package/dist/client/assets/{organization-choice-CVq2K-mi.js → organization-choice-BQVJgGgg.js} +1 -1
- package/dist/client/assets/{orgs-riRdPSVS.js → orgs-D0MWQorV.js} +1 -1
- package/dist/client/assets/{page-seo-form-DHiOVvvv.js → page-seo-form-Dbm_mNqs.js} +1 -1
- package/dist/client/assets/{pair-BiwOJOFx.js → pair-CNR7-_qK.js} +8 -8
- package/dist/client/assets/{parse-sections-Ce8e3CyM.js → parse-sections-BYTdQHxf.js} +1 -1
- package/dist/client/assets/{plan-Cpl6bs6l.js → plan-CEyzI8hm.js} +1 -1
- package/dist/client/assets/{plan-ladder-DJwAssQD.js → plan-ladder-Chib98li.js} +1 -1
- package/dist/client/assets/{popover-B1ABR0kS.js → popover-BqGcOxqn.js} +1 -1
- package/dist/client/assets/{post-calendar-CtSEncUE.js → post-calendar-2c7rIKCZ.js} +1 -1
- package/dist/client/assets/{post-editor-Cxxxfb0r.js → post-editor-CRPwAV6k.js} +2 -2
- package/dist/client/assets/{preview-content-ULOD_UZt.js → preview-content-C3GD-BQD.js} +1 -1
- package/dist/client/assets/{preview-dialog-CZYisvNu.js → preview-dialog-vLTpbCc0.js} +1 -1
- package/dist/client/assets/{preview-panel-ItJi6Jc0.js → preview-panel-C6xrnpJj.js} +1 -1
- package/dist/client/assets/{preview-tab-B6Q-8P-_.js → preview-tab-CBRKeC1b.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-BHrHoQQK.js → product-picker-dialog-DHVGLlrb.js} +1 -1
- package/dist/client/assets/{profile-B6Cd5Dxw.js → profile-C5h78yhG.js} +1 -1
- package/dist/client/assets/project-app-view-C3iPvweM.js +1 -0
- package/dist/client/assets/{project-apps-Dler5z99.js → project-apps-D7YctFcN.js} +1 -1
- package/dist/client/assets/{project-feed-BwWFdPBj.js → project-feed-CpfPTWDh.js} +1 -1
- package/dist/client/assets/{project-icon-BtGD--7Z.js → project-icon-B-MVviOF.js} +1 -1
- package/dist/client/assets/project-reports-qKDYuHCF.js +1 -0
- package/dist/client/assets/project-tasks-C08bqxWt.js +1 -0
- package/dist/client/assets/{projects-BbyUgZdk.js → projects-DrGNXye1.js} +1 -1
- package/dist/client/assets/{projects-empty-state-cl5VGT1T.js → projects-empty-state-B6Ieq7wG.js} +1 -1
- package/dist/client/assets/{prompts-C7IgVGhQ.js → prompts-DszjlGng.js} +1 -1
- package/dist/client/assets/record-editor-zoDoy66N.js +1 -0
- package/dist/client/assets/{redirect-editor-DGmg8IhI.js → redirect-editor-D4gU7n0c.js} +1 -1
- package/dist/client/assets/{releases-api-CS8wgmr5.js → releases-api-CK0jSLYO.js} +1 -1
- package/dist/client/assets/reports-CalnjK7E.js +1 -0
- package/dist/client/assets/{reports-J6WeamZr.js → reports-CjnzDShS.js} +1 -1
- package/dist/client/assets/{reports-onboarding-BskSIDus.js → reports-onboarding-C81Upwj7.js} +1 -1
- package/dist/client/assets/{reports-tab-a3KJftGt.js → reports-tab-DJdkQM-o.js} +2 -2
- package/dist/client/assets/repositories-C7NPKiSj.js +1 -0
- package/dist/client/assets/{repositories-BZocQhoR.js → repositories-IyZ5mwlx.js} +1 -1
- package/dist/client/assets/{repository-binding-DEE5HjOP.js → repository-binding-wXpkgUS5.js} +1 -1
- package/dist/client/assets/{repository-import-picker-WAot3Ghn.js → repository-import-picker-DWw4DnKc.js} +1 -1
- package/dist/client/assets/{repository-picker-DKd6y_Vd.js → repository-picker-fHOvHVjl.js} +1 -1
- package/dist/client/assets/{require-capability-BdR5kRbu.js → require-capability-B4IJOpH-.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CXS5DXAp.js → required-auth-layout-p9wTtbkA.js} +1 -1
- package/dist/client/assets/{reset-password-Br9V0wHS.js → reset-password-CpXnMk-E.js} +1 -1
- package/dist/client/assets/{resizable-CkWJ6g0G.js → resizable-CykEr2xO.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-BXRYZg2i.js → resolve-tab-icon-dNyXGxcc.js} +1 -1
- package/dist/client/assets/{review-settings-CfpCP4zo.js → review-settings-D36VxF8a.js} +1 -1
- package/dist/client/assets/{roles-D-ySNiDm.js → roles-DPB4O14g.js} +1 -1
- package/dist/client/assets/{route-Bor9ph6H.js → route-CH9GHNDj.js} +1 -1
- package/dist/client/assets/route-DsIfFih1.js +1 -0
- package/dist/client/assets/route-rXh3k9jX.js +1 -0
- package/dist/client/assets/{runnable-block-editor-D1duQp0J.js → runnable-block-editor-CvNZGRDu.js} +6 -6
- package/dist/client/assets/{sandbox-lifecycle-context-DJrMSxNE.js → sandbox-lifecycle-context-CsnW_1kh.js} +1 -1
- package/dist/client/assets/{schema-BXxpoJF8.js → schema-BXcU44Bp.js} +1 -1
- package/dist/client/assets/{schema-BiVd-UM7.js → schema-BjLtWzT5.js} +1 -1
- package/dist/client/assets/{scroll-area-DdvxCYsk.js → scroll-area-BZP0xkZ2.js} +1 -1
- package/dist/client/assets/{search-input-UGzUEySU.js → search-input-CLbrLBK4.js} +1 -1
- package/dist/client/assets/{search-toggle-09QkRcdu.js → search-toggle-Bz--u_u6.js} +1 -1
- package/dist/client/assets/{secret-ciphertext-D7Z8GkTt.js → secret-ciphertext-DZQPZkTr.js} +1 -1
- package/dist/client/assets/{secret-picker-jW2RoOXq.js → secret-picker-r4BGxMfM.js} +1 -1
- package/dist/client/assets/{secrets--oDOIL-g.js → secrets-CzuDVgfq.js} +1 -1
- package/dist/client/assets/{sections-Cktygxsr.js → sections-DE80daGy.js} +1 -1
- package/dist/client/assets/{sections-editor-Ykrd9ksj.js → sections-editor-C5rNMLKQ.js} +1 -1
- package/dist/client/assets/{select-C48ly-p-.js → select-CO-KeEXe.js} +1 -1
- package/dist/client/assets/{select-model-qC-ddNWu.js → select-model-B9aWAF7v.js} +1 -1
- package/dist/client/assets/{seo-editor-vkCR941s.js → seo-editor-C5HGby9p.js} +1 -1
- package/dist/client/assets/{separator-CfwhkXab.js → separator-Dr93-tcp.js} +1 -1
- package/dist/client/assets/settings-tab-OQ9gNE2t.js +1 -0
- package/dist/client/assets/{sheet-C78dW_OW.js → sheet-DYqe447t.js} +1 -1
- package/dist/client/assets/shell-layout-Bmd6dXD4.js +1 -0
- package/dist/client/assets/{site-draft-actions-DyZ1f4ik.js → site-draft-actions-CNazOyJI.js} +1 -1
- package/dist/client/assets/site-draft-view-CaiajxbQ.js +2 -0
- package/dist/client/assets/site-editor-BC9YFkDH.js +1 -0
- package/dist/client/assets/{site-editor-toast-C_UZBEd9.js → site-editor-toast-Ckx512no.js} +1 -1
- package/dist/client/assets/{skills-CHltBKqG.js → skills-Dq2dQBym.js} +1 -1
- package/dist/client/assets/{slider-DueO9EFe.js → slider-Dm9m4Zom.js} +1 -1
- package/dist/client/assets/{sortable.esm-D411R8sQ.js → sortable.esm-PpUBUYvN.js} +1 -1
- package/dist/client/assets/{sso-C7rH2Jsc.js → sso-et00F2-M.js} +1 -1
- package/dist/client/assets/{suggestion-_sJX1Xs_.js → suggestion-CaGvyBH6.js} +1 -1
- package/dist/client/assets/{switch-Wb17Bg4i.js → switch-DGiOaGRn.js} +1 -1
- package/dist/client/assets/{symbol-CN-EQDYU.js → symbol-ZVON6uKU.js} +1 -1
- package/dist/client/assets/{synced-repos-BRIUeky9.js → synced-repos-CKQ3x7oT.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-BeHT1AU_.js → tab-icon-glyph-DLj4dmeB.js} +1 -1
- package/dist/client/assets/{table-ChqbkXkJ.js → table-DcqK9CO1.js} +1 -1
- package/dist/client/assets/{tabs-D-bShRzz.js → tabs-CU2NQvm6.js} +1 -1
- package/dist/client/assets/{task-assignee-avatar-Db7T5j33.js → task-assignee-avatar-Cs9bBLeR.js} +1 -1
- package/dist/client/assets/{task-board-NNGstnYy.js → task-board-CRvOV9zQ.js} +1 -1
- package/dist/client/assets/{task-route-BYz8Txhc.js → task-route-BPQ9h0t-.js} +1 -1
- package/dist/client/assets/{task-status-BtnjgBne.js → task-status-k_KZvqi3.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-BiCEJijC.js → taskboard-analytics-DXKp_Xl8.js} +1 -1
- package/dist/client/assets/{tasks-DscpmhWw.js → tasks-CJWFfvRo.js} +1 -1
- package/dist/client/assets/tasks-DfOAe8MK.js +1 -0
- package/dist/client/assets/{textarea-DXNX9E30.js → textarea-Bp989dUN.js} +1 -1
- package/dist/client/assets/{thread-analytics-BxM1u9ID.js → thread-analytics-CMG9NspT.js} +1 -1
- package/dist/client/assets/{thread-intent-BYXYhdV9.js → thread-intent-DXY7orZh.js} +1 -1
- package/dist/client/assets/{thread-route--lOZYDN5.js → thread-route-B1rrIJuw.js} +1 -1
- package/dist/client/assets/{thread-route-EPwO0Tp5.js → thread-route-ChN9O-1A.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-Doh4mgo7.js → thread-sheet-body-D-x-TABK.js} +1 -1
- package/dist/client/assets/{time-range-picker-bYUcsgps.js → time-range-picker-B10kjTj_.js} +1 -1
- package/dist/client/assets/{toggle-group-C__89QW8.js → toggle-group-K25Bl_Tm.js} +1 -1
- package/dist/client/assets/{tool-namespace-CjWGrg1d.js → tool-namespace-ln4cIuCt.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-Bn0QMDhj.js → toolbar-icon-button-NAoOtagz.js} +1 -1
- package/dist/client/assets/{tooltip-CjIqGzku.js → tooltip-BB8x2ajM.js} +1 -1
- package/dist/client/assets/{tooltipContext-BlJpYj2n.js → tooltipContext-DG-hvJrr.js} +1 -1
- package/dist/client/assets/{track-DiwbUXrF.js → track-DwVNsvWy.js} +1 -1
- package/dist/client/assets/{types-2FdJQAcI.js → types-D4eFbg3n.js} +2 -2
- package/dist/client/assets/{url-slug-SgUmhnUm.js → url-slug-Ck137SN4.js} +1 -1
- package/dist/client/assets/{usage-stats-mjbSmunu.js → usage-stats-DpZZQ75-.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Ui8zDguo.js → use-ai-providers-Cng_Zcqq.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-DqZvErCE.js → use-apply-named-rule-5US13ud-.js} +1 -1
- package/dist/client/assets/{use-automations-C1_nM6XA.js → use-automations-BV-J2Ily.js} +1 -1
- package/dist/client/assets/{use-autosave-DUE5eTHe.js → use-autosave-By6DVzfK.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-Civkwlwx.js → use-chat-layout-state-CNkklJiF.js} +1 -1
- package/dist/client/assets/{use-clock-tick-BglfF91b.js → use-clock-tick-D95T8222.js} +1 -1
- package/dist/client/assets/{use-connect-companion-DXE20Cit.js → use-connect-companion-BRWaN5AJ.js} +1 -1
- package/dist/client/assets/{use-connection-DjG9Ar0-.js → use-connection-CAJy9ePc.js} +1 -1
- package/dist/client/assets/{use-content-sync-UBduiNPN.js → use-content-sync-3FE60C_P.js} +1 -1
- package/dist/client/assets/{use-copy-D-ZUZJVe.js → use-copy-CvMH5zdo.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-zb51VTao.js → use-create-virtual-mcp-DTJ0zfpe.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-DDB69sAw.js → use-date-fns-locale-D3Iz1MzV.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-sMVb1_hn.js → use-debounced-autosave-CGLCHS8I.js} +1 -1
- package/dist/client/assets/{use-debounced-value-0e-te_rl.js → use-debounced-value-DvzjOUVw.js} +1 -1
- package/dist/client/assets/{use-deco-credits-zw0Jw-tt.js → use-deco-credits-D1dKlqXc.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BQLXDAAl.js → use-decopilot-events-DvJkZDam.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CcIoRjhU.js → use-delete-connection-D1ttYwJz.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-s7tGTRS4.js → use-deployment-admin-BpF0owio.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-B9Iu3h_6.js → use-fast-preview-draft-url-C_TDHMYN.js} +1 -1
- package/dist/client/assets/{use-file-configs-CDeU2xvZ.js → use-file-configs-Bf0fhL21.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-CFSuERBJ.js → use-inbox-feed-DFw-YlJH.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BopUCEp4.js → use-infinite-scroll-CwPqy0HC.js} +1 -1
- package/dist/client/assets/{use-join-requests-D2jJesnC.js → use-join-requests-Z3CFtAeL.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs--2YvNIZr.js → use-main-panel-tabs-Cp-duvYv.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-DEXNa6Oz.js → use-mcp-auth-status-Db86wDh0.js} +1 -1
- package/dist/client/assets/{use-mcp-client-owuI-9F9.js → use-mcp-client-BT3MLYTJ.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-8FxF45h0.js → use-mcp-prompts-DvHpjECx.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-qNpUlzik.js → use-mcp-tools-DY3R7rf0.js} +1 -1
- package/dist/client/assets/{use-members-VmpszULL.js → use-members-DrsTuCTp.js} +1 -1
- package/dist/client/assets/{use-mobile-CqyBz8Dx.js → use-mobile-Nz4my9ZZ.js} +1 -1
- package/dist/client/assets/{use-move-blocks-Cnva5RwQ.js → use-move-blocks-Ck3YCWT9.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DdSspEm5.js → use-navigate-to-agent-DqXhqPI9.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-CO2ZloNb.js → use-open-billing-url-BPZ_x4uz.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BQ7kloKy.js → use-org-auth-client-BVmUiQl1.js} +1 -1
- package/dist/client/assets/{use-org-fs-CvYQh_B2.js → use-org-fs-qBxAqXun.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-BtFmt_qd.js → use-org-repo-syncs-C4sXoqIp.js} +1 -1
- package/dist/client/assets/{use-org-sso-B9p-4KH7.js → use-org-sso-B4zmaZVL.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Cu4J92yA.js → use-organization-roles-CfuwXcGJ.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BcSo4teS.js → use-organization-settings-DKJZVR_x.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-Co0XZmSD.js → use-panel-navigate-D57HPY2x.js} +1 -1
- package/dist/client/assets/use-project-native-view-presence-C3HlYZwC.js +1 -0
- package/dist/client/assets/{use-project-scope-BL3NRFI4.js → use-project-scope-CnnlA-du.js} +1 -1
- package/dist/client/assets/{use-recent-apps-RjVee3Pq.js → use-recent-apps-CeorMBvV.js} +1 -1
- package/dist/client/assets/{use-releases-vjl0fUb-.js → use-releases-fI9YxkQH.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-B0L8y4wc.js → use-reports-diagnostic-J_fRdq7J.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-Bjcn7PU6.js → use-sandbox-events-CioMqxnO.js} +1 -1
- package/dist/client/assets/{use-secrets-D9Bq6nE_.js → use-secrets-OlxyEwyb.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-Vjigvtig.js → use-section-preview-base-C3ZuHMr0.js} +1 -1
- package/dist/client/assets/{use-session-runtime-C-ErRuug.js → use-session-runtime-DfVwDDov.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-oSws9nsi.js → use-sidebar-collapsed-D3qR_zRH.js} +1 -1
- package/dist/client/assets/{use-tags-pfCDbF9Z.js → use-tags-CxN5zuRZ.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-CopE-4zr.js → use-task-board-analytics-C-0VTjUE.js} +1 -1
- package/dist/client/assets/{use-task-board-events-C280-Zim.js → use-task-board-events-BH7aE_i8.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-x7ZAMu8t.js → use-task-board-item-prs-BLDfRR9k.js} +1 -1
- package/dist/client/assets/{use-task-metadata-CDV-25sQ.js → use-task-metadata-xGzNCL2M.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-RcDxA37Q.js → use-thread-analytics-DJdxAjR-.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-orGxjs9L.js → use-thread-outputs-D8VLF1dw.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BwyrFPWF.js +1 -0
- package/dist/client/assets/{useQueries-M-H4-oNf.js → useQueries-1QlJ0aQr.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DJXxpWPx.js +1 -0
- package/dist/client/assets/{users-Yugcw0oy.js → users-C4R4jnJb.js} +1 -1
- package/dist/client/assets/{utils-Cwt2fdOd.js → utils-Dc05pOUY.js} +1 -1
- package/dist/client/assets/{variant-calendar-r5D0JiAM.js → variant-calendar-B48hMXng.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-Dcw_0UNB.js → variant-matcher-override-f1vt09fC.js} +1 -1
- package/dist/client/assets/{virtual-mcp-D9lu2UG3.js → virtual-mcp-CP4uoCBU.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-BEBGvoea.js → watch-sse-pool-HKRMih-U.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-analytics-B-zaohtV.js +0 -1
- package/dist/client/assets/agent-app-BbV2xIu_.js +0 -1
- package/dist/client/assets/agent-automations-BCX_o1aB.js +0 -1
- package/dist/client/assets/agent-calendar-Ddf3r2JM.js +0 -1
- package/dist/client/assets/agent-deck-UP8oQtvT.js +0 -1
- package/dist/client/assets/agent-experiments-CrVBOIKR.js +0 -1
- package/dist/client/assets/agent-file-Cb4leotK.js +0 -1
- package/dist/client/assets/agent-library-DMqKWgMi.js +0 -1
- package/dist/client/assets/agent-library-file-DOe-l166.js +0 -1
- package/dist/client/assets/agent-monitor-DpSfxETg.js +0 -1
- package/dist/client/assets/agent-settings-D_kjSJft.js +0 -1
- package/dist/client/assets/agent-site-editor-code-CdfJCg4-.js +0 -2
- package/dist/client/assets/agent-site-editor-content-C-o-blM5.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-D1F79zUW.js +0 -1
- package/dist/client/assets/agent-view-PuW3-X6q.js +0 -1
- package/dist/client/assets/alert-CmByshZi.js +0 -1
- package/dist/client/assets/api-keys-CNy2dZat.js +0 -1
- package/dist/client/assets/badge-CqxA0I5-.js +0 -1
- package/dist/client/assets/cms-settings-editor-VytgeION.js +0 -1
- package/dist/client/assets/experiments-tab-BQyQ_6Nt.js +0 -1
- package/dist/client/assets/experiments-tab-choice-CJxPrnzq.js +0 -1
- package/dist/client/assets/index-BMri_gPt.js +0 -1
- package/dist/client/assets/index-DjdMnw7p.css +0 -1
- package/dist/client/assets/library-D71H_oBI.js +0 -1
- package/dist/client/assets/monitor-v8-CHgzPfyd.js +0 -1
- package/dist/client/assets/monitoring-BtZh6NEX.js +0 -1
- package/dist/client/assets/project-app-view-B1-HxYgX.js +0 -1
- package/dist/client/assets/project-reports-DigBj5UN.js +0 -1
- package/dist/client/assets/project-tasks-ckZ9YIhp.js +0 -1
- package/dist/client/assets/record-editor-DulCdbwX.js +0 -1
- package/dist/client/assets/reports-ChrL-50F.js +0 -1
- package/dist/client/assets/repositories-BS-pBlSH.js +0 -1
- package/dist/client/assets/route-DIJ9is23.js +0 -1
- package/dist/client/assets/route-DTfdE-p1.js +0 -1
- package/dist/client/assets/settings-tab-BR68FSDQ.js +0 -1
- package/dist/client/assets/shell-layout-7jtYUd9L.js +0 -1
- package/dist/client/assets/site-draft-view-BRWWuiN5.js +0 -2
- package/dist/client/assets/site-editor-JG7QILYD.js +0 -1
- package/dist/client/assets/tasks-CtzEjcDR.js +0 -1
- package/dist/client/assets/use-project-native-view-presence-BRsKjCEJ.js +0 -1
- package/dist/client/assets/useInfiniteQuery-C3FB4QSd.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-zAujesU3.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,l as d,j as f,ek as m}from"./index-
|
|
1
|
+
import{c as p,l as d,j as f,ek as m}from"./index-CImJlq71.js";function x(l){const t=p.c(12);let o,a,r,i;t[0]!==l?({className:o,orientation:r,decorative:i,...a}=l,t[0]=l,t[1]=o,t[2]=a,t[3]=r,t[4]=i):(o=t[1],a=t[2],r=t[3],i=t[4]);const s=r===void 0?"horizontal":r,c=i===void 0?!0:i;let e;t[5]!==o?(e=d("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",o),t[5]=o,t[6]=e):e=t[6];let n;return t[7]!==c||t[8]!==s||t[9]!==a||t[10]!==e?(n=f.jsx(m,{"data-slot":"separator-root",decorative:c,orientation:s,className:e,...a}),t[7]=c,t[8]=s,t[9]=a,t[10]=e,t[11]=n):n=t[11],n}export{x as S};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e,j as o}from"./index-CImJlq71.js";import{V as a}from"./index-ChO_KP9v.js";function p(s){const t=e.c(2),{virtualMcpId:r}=s;let i;return t[0]!==r?(i=o.jsx(a,{virtualMcpId:r}),t[0]=r,t[1]=i):i=t[1],i}export{p as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,l as f,j as i,dw as S,dk as $,
|
|
1
|
+
import{c as n,l as f,j as i,dw as S,dk as $,aK as w,dx as C,dl as z,dy as k,aW as R,dm as B}from"./index-CImJlq71.js";function P(o){const e=n.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx($,{"data-slot":"sheet",...t}),e[2]=t,e[3]=s):s=e[3],s}function D(o){const e=n.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(z,{"data-slot":"sheet-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function E(o){const e=n.c(8);let t,s;e[0]!==o?({className:t,...s}=o,e[0]=o,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=f("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=i.jsx(B,{"data-slot":"sheet-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function T(o){const e=n.c(22);let t,s,a,l,p,m;e[0]!==o?({className:s,children:t,side:l,size:p,hideCloseButton:m,...a}=o,e[0]=o,e[1]=t,e[2]=s,e[3]=a,e[4]=l,e[5]=p,e[6]=m):(t=e[1],s=e[2],a=e[3],l=e[4],p=e[5],m=e[6]);const d=l===void 0?"right":l,v=p===void 0?"sm":p,x=m===void 0?!1:m;let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(E,{}),e[7]=u):u=e[7];const g=d==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l",b=d==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r",j=(d==="left"||d==="right")&&(v==="lg"?"w-full sm:max-w-xl":"sm:max-w-sm"),N=d==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",y=d==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t";let r;e[8]!==s||e[9]!==g||e[10]!==b||e[11]!==j||e[12]!==N||e[13]!==y?(r=f("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-200 data-[state=open]:duration-200",g,b,j,N,y,s),e[8]=s,e[9]=g,e[10]=b,e[11]=j,e[12]=N,e[13]=y,e[14]=r):r=e[14];let c;e[15]!==x?(c=!x&&i.jsxs(k,{className:"data-[state=open]:bg-secondary absolute top-4 right-4 opacity-70 transition-opacity hover:opacity-100 focus-ring disabled:pointer-events-none rounded-lg",children:[i.jsx(R,{className:"size-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]}),e[15]=x,e[16]=c):c=e[16];let h;return e[17]!==t||e[18]!==a||e[19]!==r||e[20]!==c?(h=i.jsxs(D,{children:[u,i.jsxs(w,{"data-slot":"sheet-content",className:r,...a,children:[t,c]})]}),e[17]=t,e[18]=a,e[19]=r,e[20]=c,e[21]=h):h=e[21],h}function _(o){const e=n.c(8);let t,s;e[0]!==o?({className:t,...s}=o,e[0]=o,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=f("flex flex-col gap-1.5 p-4",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=i.jsx("div",{"data-slot":"sheet-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function F(o){const e=n.c(8);let t,s;e[0]!==o?({className:t,...s}=o,e[0]=o,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=f("mt-auto flex flex-col gap-2 p-4",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=i.jsx("div",{"data-slot":"sheet-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function H(o){const e=n.c(8);let t,s;e[0]!==o?({className:t,...s}=o,e[0]=o,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=f("text-foreground font-semibold",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=i.jsx(S,{"data-slot":"sheet-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function K(o){const e=n.c(8);let t,s;e[0]!==o?({className:t,...s}=o,e[0]=o,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=f("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=i.jsx(C,{"data-slot":"sheet-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}export{H as S,T as a,P as b,_ as c,K as d,F as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as R,b as J,e as st,j as n,B as M,t as Ue,bY as le,ad as Tt,a as Je,G as Vt,R as Nt,K as We,bZ as Wt,b_ as Yt,aw as Ve,l as ft,aZ as Qt,x as ht,r as X,ab as Xt,ac as ne,s as _t,v as Pt,q as At,D as Et,d as Ct,a2 as ut,J as Ot,m as qe,y as lt,aM as It,b$ as Zt,aS as en,aX as gt,F as tn,c0 as nn,aN as sn,w as on,c1 as an,c2 as rn,c3 as ln,c4 as cn,c5 as dn,a3 as un,u as mn,a4 as fn,c6 as hn,c7 as gn,k as $t,c8 as pt,c9 as pn,O as yn,_ as bn}from"./index-CImJlq71.js";import{A as it}from"./avatar-DZp2nksb.js";import{t as Lt}from"./Building02-DBmpU4M6.js";import{i as xn,s as te}from"./UserSquare-ezkB_C7H.js";import{aA as Sn,W as wn,I as rt,aa as vn,K as jn,aB as kn,n as yt,g as Tn,p as Nn,k as _n,aC as Pn,l as An}from"./agent-icon-Bl0Q4nDQ.js";import{s as En}from"./XClose-5-Y_ZVDY.js";import{a as Cn,u as On}from"./use-project-scope-CnnlA-du.js";import{u as Dt,a as In}from"./use-panel-navigate-D57HPY2x.js";import{i as ie}from"./CheckCircle-Cqp__I1R.js";import{i as bt}from"./Monitor01-th-leB7u.js";import{i as Ke}from"./ZoomOut-CTwXyALk.js";import{u as $n}from"./use-clock-tick-D95T8222.js";import{s as xt}from"./Plus-Bf8vM3Sx.js";import{a as Ln}from"./Tool01-XzMXqYKz.js";import{b as se,a as Be,f as Dn,e as Rn,c as Mn,C as Fn}from"./command-9a3EU_B7.js";import{I as zn}from"./integration-icon-B9snkXuC.js";import{P as Kn}from"./project-icon-B-MVviOF.js";import{a as qn,m as Bn}from"./use-mcp-client-BT3MLYTJ.js";import{u as Hn,a as Un,n as Gn}from"./new-project-dialog-CEUx8Wuz.js";import{S as Jn,u as Vn}from"./thread-intent-DXY7orZh.js";import{R as Wn}from"./required-auth-layout-p9wTtbkA.js";import{A as Yn}from"./autosend-BUGExBM4.js";import{u as Qn,a as Xn,b as Zn,c as es}from"./thread-route-B1rrIJuw.js";import{u as ts}from"./use-org-sso-B4zmaZVL.js";function ns(t){const e=R.c(49),{orgName:o,orgSlug:r,orgLogo:s,domain:a}=t,i=J();let c;e[0]!==r||e[1]!==i?(c=async()=>{const P=await fetch("/api/auth/custom/domain-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:r})}),E=await P.json();if(!P.ok||!E.success)throw new Error(E.error??i("common.autoDomainJoinScreen.joinError"));return E},e[0]=r,e[1]=i,e[2]=c):c=e[2];let m;e[3]!==r?(m=P=>{window.location.href=`/${P.slug??r}`},e[3]=r,e[4]=m):m=e[4];let h;e[5]!==i?(h=P=>{Ue.error(P instanceof Error?P.message:i("common.autoDomainJoinScreen.joinError"))},e[5]=i,e[6]=h):h=e[6];let w;e[7]!==c||e[8]!==m||e[9]!==h?(w={mutationFn:c,onSuccess:m,onError:h},e[7]=c,e[8]=m,e[9]=h,e[10]=w):w=e[10];const u=st(w),p=ss;let l;e[11]!==s||e[12]!==o?(l=s?n.jsx(it,{url:s,fallback:o,shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(Lt,{className:"h-6 w-6 text-primary"})}),e[11]=s,e[12]=o,e[13]=l):l=e[13];let g;e[14]!==o||e[15]!==i?(g=i("common.autoDomainJoinScreen.joinPrompt",{orgName:o}),e[14]=o,e[15]=i,e[16]=g):g=e[16];let f;e[17]!==g?(f=n.jsx("h3",{className:"text-lg font-medium",children:g}),e[17]=g,e[18]=f):f=e[18];let d;e[19]!==a||e[20]!==i?(d=i("common.autoDomainJoinScreen.joinDescription",{domain:a}),e[19]=a,e[20]=i,e[21]=d):d=e[21];let S;e[22]!==d?(S=n.jsx("p",{className:"text-sm text-muted-foreground",children:d}),e[22]=d,e[23]=S):S=e[23];let y;e[24]!==f||e[25]!==S?(y=n.jsxs("div",{className:"space-y-2",children:[f,S]}),e[24]=f,e[25]=S,e[26]=y):y=e[26];let x;e[27]!==u?(x=()=>u.mutate(),e[27]=u,e[28]=x):x=e[28];let v;e[29]!==u.isPending||e[30]!==o||e[31]!==i?(v=u.isPending?i("common.autoDomainJoinScreen.joining"):i("common.autoDomainJoinScreen.enterOrg",{orgName:o}),e[29]=u.isPending,e[30]=o,e[31]=i,e[32]=v):v=e[32];let b;e[33]!==u.isPending||e[34]!==x||e[35]!==v?(b=n.jsx(M,{onClick:x,disabled:u.isPending,children:v}),e[33]=u.isPending,e[34]=x,e[35]=v,e[36]=b):b=e[36];const T=u.isPending;let j;e[37]!==i?(j=i("common.goHome"),e[37]=i,e[38]=j):j=e[38];let k;e[39]!==u.isPending||e[40]!==j?(k=n.jsx(M,{variant:"ghost",onClick:p,disabled:T,children:j}),e[39]=u.isPending,e[40]=j,e[41]=k):k=e[41];let _;e[42]!==b||e[43]!==k?(_=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[b,k]}),e[42]=b,e[43]=k,e[44]=_):_=e[44];let N;return e[45]!==y||e[46]!==_||e[47]!==l?(N=n.jsxs(le,{children:[l,y,_]}),e[45]=y,e[46]=_,e[47]=l,e[48]=N):N=e[48],N}function ss(){window.location.href="/"}function St(t){const e=R.c(25),{orgSlug:o,orgName:r,reason:s}=t,a=J(),i=os,c=s==="not-found",m=c?xn:Tt;let h;e[0]!==c||e[1]!==a?(h=a(c?"common.noAccessScreen.organizationNotFound":"common.noAccessScreen.noAccess"),e[0]=c,e[1]=a,e[2]=h):h=e[2];const w=h;let u;e[3]!==c||e[4]!==r||e[5]!==o||e[6]!==a?(u=c?n.jsxs(n.Fragment,{children:[a("common.noAccessScreen.couldNotFind")," ",n.jsx("strong",{children:o}),"."]}):n.jsxs(n.Fragment,{children:[a("common.noAccessScreen.noAccessTo")," ",n.jsx("strong",{children:r??o}),".",n.jsx("br",{}),a("common.noAccessScreen.askAdminToInvite")]}),e[3]=c,e[4]=r,e[5]=o,e[6]=a,e[7]=u):u=e[7];const p=u;let l;e[8]!==m?(l=n.jsx("div",{className:"bg-muted p-3 rounded-full",children:n.jsx(m,{className:"h-6 w-6 text-muted-foreground"})}),e[8]=m,e[9]=l):l=e[9];let g;e[10]!==w?(g=n.jsx("h3",{className:"text-lg font-medium",children:w}),e[10]=w,e[11]=g):g=e[11];let f;e[12]!==p?(f=n.jsx("p",{className:"text-sm text-muted-foreground",children:p}),e[12]=p,e[13]=f):f=e[13];let d;e[14]!==g||e[15]!==f?(d=n.jsxs("div",{className:"space-y-2",children:[g,f]}),e[14]=g,e[15]=f,e[16]=d):d=e[16];let S;e[17]!==a?(S=a("common.goHome"),e[17]=a,e[18]=S):S=e[18];let y;e[19]!==S?(y=n.jsx(M,{onClick:i,children:S}),e[19]=S,e[20]=y):y=e[20];let x;return e[21]!==l||e[22]!==d||e[23]!==y?(x=n.jsxs(le,{children:[l,d,y]}),e[21]=l,e[22]=d,e[23]=y,e[24]=x):x=e[24],x}function os(){window.location.href="/"}function is(t){const e=R.c(59),{invitationId:o,orgName:r,orgSlug:s,orgLogo:a}=t,i=J();let c;e[0]!==o?(c=async()=>{const A=await Je.organization.acceptInvitation({invitationId:o});if(A.error)throw new Error(A.error.message);return A.data},e[0]=o,e[1]=c):c=e[1];let m;e[2]!==s?(m=()=>{Vt(),window.location.href=`/${s}`},e[2]=s,e[3]=m):m=e[3];let h;e[4]!==i?(h=A=>{Ue.error(A instanceof Error?A.message:i("common.pendingInviteScreen.failedToAccept"))},e[4]=i,e[5]=h):h=e[5];let w;e[6]!==c||e[7]!==m||e[8]!==h?(w={mutationFn:c,onSuccess:m,onError:h},e[6]=c,e[7]=m,e[8]=h,e[9]=w):w=e[9];const u=st(w);let p;e[10]!==o?(p=async()=>{const A=await Je.organization.rejectInvitation({invitationId:o});if(A.error)throw new Error(A.error.message);return A.data},e[10]=o,e[11]=p):p=e[11];let l,g;e[12]!==i?(l=()=>{Ue.success(i("common.pendingInviteScreen.invitationDeclined")),window.location.href="/"},g=A=>{Ue.error(A instanceof Error?A.message:i("common.pendingInviteScreen.failedToDecline"))},e[12]=i,e[13]=l,e[14]=g):(l=e[13],g=e[14]);let f;e[15]!==p||e[16]!==l||e[17]!==g?(f={mutationFn:p,onSuccess:l,onError:g},e[15]=p,e[16]=l,e[17]=g,e[18]=f):f=e[18];const d=st(f),S=u.isPending||d.isPending;let y;e[19]!==a||e[20]!==r?(y=a?n.jsx(it,{url:a,fallback:r,shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(Sn,{className:"h-6 w-6 text-primary"})}),e[19]=a,e[20]=r,e[21]=y):y=e[21];let x;e[22]!==r||e[23]!==i?(x=i("common.pendingInviteScreen.invitedTo",{orgName:r}),e[22]=r,e[23]=i,e[24]=x):x=e[24];let v;e[25]!==x?(v=n.jsx("h3",{className:"text-lg font-medium",children:x}),e[25]=x,e[26]=v):v=e[26];let b;e[27]!==i?(b=i("common.pendingInviteScreen.acceptDescription"),e[27]=i,e[28]=b):b=e[28];let T;e[29]!==b?(T=n.jsx("p",{className:"text-sm text-muted-foreground",children:b}),e[29]=b,e[30]=T):T=e[30];let j;e[31]!==v||e[32]!==T?(j=n.jsxs("div",{className:"space-y-2",children:[v,T]}),e[31]=v,e[32]=T,e[33]=j):j=e[33];let k;e[34]!==u?(k=()=>u.mutate(),e[34]=u,e[35]=k):k=e[35];let _;e[36]!==u.isPending||e[37]!==i?(_=u.isPending?i("common.pendingInviteScreen.acceptingButton"):i("common.pendingInviteScreen.acceptButton"),e[36]=u.isPending,e[37]=i,e[38]=_):_=e[38];let N;e[39]!==S||e[40]!==k||e[41]!==_?(N=n.jsx(M,{onClick:k,disabled:S,children:_}),e[39]=S,e[40]=k,e[41]=_,e[42]=N):N=e[42];let P;e[43]!==d?(P=()=>d.mutate(),e[43]=d,e[44]=P):P=e[44];let E;e[45]!==d.isPending||e[46]!==i?(E=d.isPending?i("common.pendingInviteScreen.decliningButton"):i("common.pendingInviteScreen.declineButton"),e[45]=d.isPending,e[46]=i,e[47]=E):E=e[47];let I;e[48]!==S||e[49]!==P||e[50]!==E?(I=n.jsx(M,{variant:"ghost",onClick:P,disabled:S,children:E}),e[48]=S,e[49]=P,e[50]=E,e[51]=I):I=e[51];let O;e[52]!==N||e[53]!==I?(O=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[N,I]}),e[52]=N,e[53]=I,e[54]=O):O=e[54];let D;return e[55]!==j||e[56]!==O||e[57]!==y?(D=n.jsxs(le,{children:[y,j,O]}),e[55]=j,e[56]=O,e[57]=y,e[58]=D):D=e[58],D}function as(t){const e=R.c(23),{orgName:o,orgLogo:r}=t,s=J();let a;e[0]!==r||e[1]!==o?(a=r?n.jsx(it,{url:r,fallback:o,shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full","aria-hidden":"true",children:n.jsx(wn,{className:"h-6 w-6 text-primary"})}),e[0]=r,e[1]=o,e[2]=a):a=e[2];let i;e[3]!==s?(i=s("common.requestPendingScreen.title"),e[3]=s,e[4]=i):i=e[4];let c;e[5]!==i?(c=n.jsx("h3",{className:"text-lg font-medium",children:i}),e[5]=i,e[6]=c):c=e[6];let m;e[7]!==o||e[8]!==s?(m=s("common.requestPendingScreen.description",{orgName:o}),e[7]=o,e[8]=s,e[9]=m):m=e[9];let h;e[10]!==m?(h=n.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[10]=m,e[11]=h):h=e[11];let w;e[12]!==c||e[13]!==h?(w=n.jsxs("div",{className:"space-y-2",children:[c,h]}),e[12]=c,e[13]=h,e[14]=w):w=e[14];let u;e[15]!==s?(u=s("common.goHome"),e[15]=s,e[16]=u):u=e[16];let p;e[17]!==u?(p=n.jsx(M,{variant:"ghost",onClick:rs,children:u}),e[17]=u,e[18]=p):p=e[18];let l;return e[19]!==a||e[20]!==w||e[21]!==p?(l=n.jsxs(le,{children:[a,w,p]}),e[19]=a,e[20]=w,e[21]=p,e[22]=l):l=e[22],l}function rs(){window.location.href="/"}function ls(t){const e=R.c(45),{orgName:o,orgSlug:r,orgLogo:s,domain:a}=t,i=J();let c;e[0]!==r?(c=async()=>{const N=await fetch("/api/auth/custom/domain-request-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:r})}),P=await N.json();if(!N.ok||!P.success)throw new Error(P.error??"Failed to request access");return P},e[0]=r,e[1]=c):c=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=ds,e[2]=m):m=e[2];let h;e[3]!==i?(h=N=>{Ue.error(N instanceof Error?N.message:i("common.requestToJoinScreen.failedToRequest"))},e[3]=i,e[4]=h):h=e[4];let w;e[5]!==c||e[6]!==h?(w={mutationFn:c,onSuccess:m,onError:h},e[5]=c,e[6]=h,e[7]=w):w=e[7];const u=st(w);let p;e[8]!==s||e[9]!==o?(p=s?n.jsx(it,{url:s,fallback:o,shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(Lt,{className:"h-6 w-6 text-primary"})}),e[8]=s,e[9]=o,e[10]=p):p=e[10];let l;e[11]!==o||e[12]!==i?(l=i("common.requestToJoinScreen.title",{orgName:o}),e[11]=o,e[12]=i,e[13]=l):l=e[13];let g;e[14]!==l?(g=n.jsx("h3",{className:"text-lg font-medium",children:l}),e[14]=l,e[15]=g):g=e[15];let f;e[16]!==a||e[17]!==i?(f=i("common.requestToJoinScreen.description",{domain:a}),e[16]=a,e[17]=i,e[18]=f):f=e[18];let d;e[19]!==f?(d=n.jsx("p",{className:"text-sm text-muted-foreground",children:f}),e[19]=f,e[20]=d):d=e[20];let S;e[21]!==g||e[22]!==d?(S=n.jsxs("div",{className:"space-y-2",children:[g,d]}),e[21]=g,e[22]=d,e[23]=S):S=e[23];let y;e[24]!==u?(y=()=>u.mutate(),e[24]=u,e[25]=y):y=e[25];let x;e[26]!==u.isPending||e[27]!==i?(x=u.isPending?i("common.requestToJoinScreen.requesting"):i("common.requestToJoinScreen.requestButton"),e[26]=u.isPending,e[27]=i,e[28]=x):x=e[28];let v;e[29]!==u.isPending||e[30]!==y||e[31]!==x?(v=n.jsx(M,{onClick:y,disabled:u.isPending,children:x}),e[29]=u.isPending,e[30]=y,e[31]=x,e[32]=v):v=e[32];const b=u.isPending;let T;e[33]!==i?(T=i("common.goHome"),e[33]=i,e[34]=T):T=e[34];let j;e[35]!==u.isPending||e[36]!==T?(j=n.jsx(M,{variant:"ghost",onClick:cs,disabled:b,children:T}),e[35]=u.isPending,e[36]=T,e[37]=j):j=e[37];let k;e[38]!==v||e[39]!==j?(k=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[v,j]}),e[38]=v,e[39]=j,e[40]=k):k=e[40];let _;return e[41]!==S||e[42]!==k||e[43]!==p?(_=n.jsxs(le,{children:[p,S,k]}),e[41]=S,e[42]=k,e[43]=p,e[44]=_):_=e[44],_}function cs(){window.location.href="/"}function ds(t){if(t.alreadyMember&&t.slug){window.location.href=`/${t.slug}`;return}window.location.reload()}function us(t){const e=R.c(7);let o;e[0]!==t?(o=We.orgAccessStatus(t),e[0]=t,e[1]=o):o=e[1];let r;e[2]!==t?(r=async()=>{const a=await fetch(`/api/auth/custom/org-access-status/${encodeURIComponent(t)}`,{credentials:"include"});if(!a.ok)throw new Error(`org-access-status failed (${a.status})`);return await a.json()},e[2]=t,e[3]=r):r=e[3];let s;return e[4]!==o||e[5]!==r?(s={queryKey:o,queryFn:r,refetchOnWindowFocus:!1},e[4]=o,e[5]=r,e[6]=s):s=e[6],Nt(s)}function ms({orgSlug:t}){const{data:e}=us(t);if(e.status!=="member"){Wt()?.org===t&&Yt();const o=localStorage.getItem(Ve.lastOrgSlug())===t;if(o&&localStorage.removeItem(Ve.lastOrgSlug()),o&&(e.status==="not-found"||e.status==="no-access"))return window.location.href="/",null}return e.status==="not-found"?n.jsx(St,{orgSlug:t,reason:"not-found"}):e.status==="pending-invite"?n.jsx(is,{invitationId:e.invitation.id,orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo}):e.status==="auto-domain-join"?n.jsx(ns,{orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo,domain:e.organization.domain??""}):e.status==="can-request"?n.jsx(ls,{orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo,domain:e.organization.domain??""}):e.status==="request-pending"?n.jsx(as,{orgName:e.organization.name,orgLogo:e.organization.logo}):e.status==="member"?(window.location.reload(),null):n.jsx(St,{orgSlug:t,orgName:e.organization.name,reason:"no-access"})}function Rt(t){const e=R.c(42),{ariaLabel:o,dismissLabel:r,eyebrow:s,title:a,description:i,icon:c,children:m,footerLeading:h,actions:w,onDismiss:u,tone:p}=t,l=p===void 0?"neutral":p,g=h||w;let f;e[0]!==l?(f=l==="system"&&n.jsx("div",{className:"h-0.5 bg-special"}),e[0]=l,e[1]=f):f=e[1];let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(En,{size:14}),e[2]=d):d=e[2];let S;e[3]!==r||e[4]!==u?(S=n.jsx(M,{size:"icon-sm",variant:"ghost","aria-label":r,className:"absolute right-2 top-2 z-10 text-muted-foreground",onClick:u,children:d}),e[3]=r,e[4]=u,e[5]=S):S=e[5];const y=c&&"flex items-start gap-3",x=m&&"pb-3";let v;e[6]!==y||e[7]!==x?(v=ft("p-4 pr-11",y,x),e[6]=y,e[7]=x,e[8]=v):v=e[8];let b;e[9]!==c?(b=c&&n.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-special/10 text-special",children:c}),e[9]=c,e[10]=b):b=e[10];let T;e[11]!==s?(T=s&&n.jsx("p",{className:"text-xs text-muted-foreground",children:s}),e[11]=s,e[12]=T):T=e[12];let j;e[13]!==a?(j=n.jsx("h3",{className:"text-base font-semibold text-foreground",children:a}),e[13]=a,e[14]=j):j=e[14];let k;e[15]!==i?(k=i&&n.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:i}),e[15]=i,e[16]=k):k=e[16];let _;e[17]!==j||e[18]!==k||e[19]!==T?(_=n.jsxs("div",{children:[T,j,k]}),e[17]=j,e[18]=k,e[19]=T,e[20]=_):_=e[20];let N;e[21]!==m?(N=m&&n.jsx("div",{className:"mt-3",children:m}),e[21]=m,e[22]=N):N=e[22];let P;e[23]!==_||e[24]!==N?(P=n.jsxs("div",{className:"min-w-0 flex-1",children:[_,N]}),e[23]=_,e[24]=N,e[25]=P):P=e[25];let E;e[26]!==P||e[27]!==v||e[28]!==b?(E=n.jsxs("div",{className:v,children:[b,P]}),e[26]=P,e[27]=v,e[28]=b,e[29]=E):E=e[29];let I;e[30]!==w||e[31]!==h||e[32]!==g||e[33]!==l?(I=g&&n.jsxs("div",{className:ft("flex items-center justify-between gap-3 px-4 py-2.5",l==="system"?"border-t border-border bg-muted/50":"pt-0"),children:[n.jsx("div",{className:"min-w-0 text-xs text-muted-foreground",children:h}),n.jsx("div",{className:"flex shrink-0 items-center gap-2",children:w})]}),e[30]=w,e[31]=h,e[32]=g,e[33]=l,e[34]=I):I=e[34];let O;return e[35]!==o||e[36]!==E||e[37]!==I||e[38]!==f||e[39]!==S||e[40]!==l?(O=n.jsxs("div",{role:"dialog","aria-label":o,"data-slot":"announcement-card","data-tone":l,className:"relative w-full overflow-hidden rounded-lg bg-popover shadow-soft animate-in fade-in slide-in-from-bottom-2 duration-300",children:[f,S,E,I]}),e[35]=o,e[36]=E,e[37]=I,e[38]=f,e[39]=S,e[40]=l,e[41]=O):O=e[41],O}const fs={switcher:"tour-layout-switcher",nav:"tour-layout-nav",tasks:"tour-layout-tasks",projects:"tour-layout-projects",account:"tour-layout-account",recentActivity:"tour-layout-recent-activity",siteEditor:"tour-layout-site-editor",surfaceTabs:"tour-layout-surface-tabs",branchPicker:"tour-layout-branch-picker",automations:"tour-layout-automations",settings:"tour-layout-settings"};function Mt(t){return`[data-tour="${fs[t]}"]`}const hs=[{scope:"shell",anchor:"switcher",titleKey:"layoutTour.switcher.title",descKey:"layoutTour.switcher.description",side:"right"},{scope:"shell",anchor:"nav",titleKey:"layoutTour.nav.title",descKey:"layoutTour.nav.description",side:"right"},{scope:"shell",anchor:"tasks",titleKey:"layoutTour.tasks.title",descKey:"layoutTour.tasks.description",side:"right"},{scope:"project",anchor:"siteEditor",titleKey:"layoutTour.siteEditor.title",descKey:"layoutTour.siteEditor.description",side:"right"},{scope:"project",anchor:"automations",titleKey:"layoutTour.automations.title",descKey:"layoutTour.automations.description",side:"right"},{scope:"shell",anchor:"settings",titleKey:"layoutTour.settings.title",descKey:"layoutTour.settings.description",side:"right"},{scope:"shell",anchor:"projects",titleKey:"layoutTour.projects.title",descKey:"layoutTour.projects.description",side:"right"},{scope:"shell",anchor:"account",titleKey:"layoutTour.account.title",descKey:"layoutTour.account.description",side:"right"},{scope:"siteEditor",anchor:"surfaceTabs",titleKey:"layoutTour.surfaceTabs.title",descKey:"layoutTour.surfaceTabs.description",side:"bottom"},{scope:"siteEditor",anchor:"branchPicker",titleKey:"layoutTour.branchPicker.title",descKey:"layoutTour.branchPicker.description",side:"bottom"},{scope:"orgHome",anchor:"recentActivity",titleKey:"layoutTour.recentActivity.title",descKey:"layoutTour.recentActivity.description",side:"top"}];function gs(t){return hs.filter(e=>e.scope==="shell"||e.scope==="orgHome"&&t.onOrgHome||e.scope==="project"&&t.inProject||e.scope==="siteEditor"&&t.onSiteEditor)}function ps(t,e){return gs(e).map(o=>({element:Mt(o.anchor),popover:{title:t(o.titleKey),description:t(o.descKey),side:o.side,align:"center"}}))}const ys=Mt("switcher"),bs=30;function Ft(t){const e=document.querySelector(t);return e instanceof HTMLElement&&e.offsetParent!==null}function xs(t,e){return ps(t,e).filter(o=>typeof o.element=="string"&&Ft(o.element))}function Ss(t,e){return{showProgress:!0,progressText:t("layoutTour.progress"),nextBtnText:t("layoutTour.next"),prevBtnText:t("layoutTour.prev"),doneBtnText:t("layoutTour.done"),showButtons:["next","previous"],smoothScroll:!0,allowClose:!0,disableActiveInteraction:!0,stagePadding:6,stageRadius:8,waitForElement:0,skipMissingElement:!0,popoverClass:"layout-tour-popover",onPopoverRender:(o,{driver:r})=>{if(o.footerButtons.querySelector(".layout-tour-skip"))return;const s=document.createElement("button");s.type="button",s.className="driver-popover-footer-btn layout-tour-skip",s.textContent=t("layoutTour.skip"),s.addEventListener("click",()=>r.destroy()),o.footerButtons.insertBefore(s,o.footerButtons.firstChild)},onDestroyed:()=>{He=!1},steps:e}}let He=!1;async function ws(){return(await Qt(()=>import("./driver.js-Dj4CfABu.js"),[])).driver}function vs(t,e){if(He)return;He=!0;let o=0;const r=()=>{if(!Ft(ys)&&o++<bs){requestAnimationFrame(r);return}const s=xs(t,e);if(s.length===0){He=!1;return}ws().then(a=>{a(Ss(t,s)).drive()}).catch(()=>{He=!1})};r()}function js(t){return t!=="off"}function ti(t){if(!t.hasSource)return[];const e=["site-editor"];return js(t.cmsMode)&&e.push("content"),t.runtime==="sandbox"&&e.push("code"),e}function zt(t){return t==="site-editor"||t==="content"||t==="code"||t.startsWith("code:")}function ni(t){return t.reportsOnly&&!t.onReportAgent&&zt(t.tabId)}const Kt=[{id:"new-layout",date:"2026-09-22",eyebrow:"Now Available",title:"New Layout",bullets:[{icon:bt,title:"Unified page headers",body:"Every page now has a clear header with navigation breadcrumbs and actions, making it easy to orient yourself and move around."},{icon:rt,title:"Consistent navigation and controls",body:"Settings and project pages use a predictable sidebar instead of scattered tabs. Buttons, inputs and toolbars share one shape and one height, and the layout adapts to smaller screens."},{icon:vn,title:"Site editor redesigned",body:"Try the redesigned blocks editor from Profile & Preferences. Blocks share consistent actions, variants appear beside their block in the header, and section selection is searchable."}],cta:{label:"Take a tour",action:"start-tour"}},{id:"unified-workspace-layout",date:"2026-09-01",eyebrow:"Now Available",title:"A new way around Studio",bullets:[{icon:ht,title:"Unified org switcher",body:"Organizations and agents now share one control at the top of the sidebar. Search it to jump straight to any agent, including ones in your other organizations."},{icon:te,title:"Your org at a glance",body:"The organization home now opens on the agents your team built and the tasks they are running — no empty board to fill in first."},{icon:bt,title:"Simplified CMS",body:"The CMS opens over the page you are previewing rather than somewhere else, so changing a section never costs you your place."}],cta:{label:"Take the tour",action:"start-tour"}},{id:"codex-gpt-5-6-defaults",date:"2026-07-13",eyebrow:"Now Available",title:"Codex defaults move to GPT-5.6",bullets:[{icon:te,title:"Sol leads Thinking",body:"Codex Thinking now defaults to `gpt-5.6-sol` for deeper coding and reasoning work."},{icon:ie,title:"Terra balances Smart",body:"The Smart tier now uses `gpt-5.6-terra`, replacing GPT-5.4 as the default balanced Codex model."},{icon:Ke,title:"Luna speeds up Fast",body:"The Fast tier and lightweight Codex title generation now use `gpt-5.6-luna`. Existing threads that reference older GPT-5.4 or GPT-5.5 model IDs remain supported."}]},{id:"claude-sonnet-5",date:"2026-06-30",eyebrow:"Now Available",title:"Claude Sonnet 5 powers the Smart tier",bullets:[{icon:te,title:"More agentic coding",body:"Sonnet 5 is Anthropic's strongest Sonnet model yet, with improved reasoning, tool use, coding, and knowledge work compared with Sonnet 4.6."},{icon:ie,title:"Available in Claude Code",body:"The Claude Code harness now pins the Smart tier to the new `claude-sonnet-5` model id so new sessions use Sonnet 5 by default."},{icon:Ke,title:"Nothing to change",body:"Existing Smart-tier chats and agents pick up Sonnet 5 automatically. Thinking remains on Opus 4.8 1M."}],learnMoreHref:"https://www.anthropic.com/news/claude-sonnet-5"},{id:"fable-5-suspension",date:"2026-06-13",eyebrow:"Important Update",title:"Fable 5 & Mythos 5 suspended — Opus 4.8 takes over",bullets:[{icon:ie,title:"US government directive",body:"Anthropic received an export control directive requiring the suspension of Fable 5 and Mythos 5 access for all users, citing national security concerns. Anthropic is complying while it works to resolve the matter."},{icon:te,title:"Opus 4.8 steps in as the Thinking tier",body:"The Thinking tier now runs on Claude Opus 4.8, which remains fully operational. Performance on most tasks is comparable, and Anthropic reports more than 95% of sessions were unaffected by the Fable 5 classifiers anyway."},{icon:Ke,title:"Nothing to change",body:"The switch is automatic — any chat or agent already using the Thinking tier is now served by Opus 4.8. Anthropic will share further details within 24 hours."}],learnMoreHref:"https://www.anthropic.com/news/fable-mythos-access"},{id:"claude-fable-5",date:"2026-06-09",eyebrow:"Now Available",title:"Claude Fable 5 leads the Thinking tier",bullets:[{icon:te,title:"State-of-the-art reasoning",body:"Fable 5 takes the Thinking tier, posting top scores across software engineering, knowledge work, and vision — and outperforming Opus 4.8 on nearly every benchmark Anthropic tested."},{icon:ie,title:"Safety without the slowdown",body:"New classifiers route the small slice of high-risk requests (cybersecurity, bio/chem) back to Opus 4.8. Anthropic reports more than 95% of sessions never trigger a fallback."},{icon:Ke,title:"Nothing to change",body:"Chats and agents pick up Fable 5 automatically wherever the Thinking tier is selected. Opus 4.8 stays available as the safety fallback."}],learnMoreHref:"https://www.anthropic.com/news/claude-fable-5-mythos-5"},{id:"claude-opus-4-8",date:"2026-05-28",eyebrow:"Now Available",title:"Claude Opus 4.8 is the new default",bullets:[{icon:te,title:"Smarter thinking, same price",body:"Opus 4.8 now leads the Thinking and Smarter tiers, outperforming Opus 4.7 on coding, reasoning, and agent tasks at the same cost."},{icon:ie,title:"More honest answers",body:"It's about 4× less likely to let a code flaw slip through unflagged, and surfaces uncertainty instead of making unsupported claims."},{icon:Ke,title:"Nothing to change",body:"Chats and agents pick up Opus 4.8 automatically wherever the Thinking or Smarter tier is selected."}],learnMoreHref:"https://www.anthropic.com/news/claude-opus-4-8"},{id:"enhanced-sidebar",date:"2026-05-28",eyebrow:"Now Available",title:"Enhanced sidebar",bullets:[{icon:te,title:"A clearer view of what's running",body:"See every task in your organization at a glance, with each agent and status group laid out so you can spot active work without hunting for it."},{icon:rt,title:"Browse one group at a time",body:"Expand the groups you care about and pull in more results on demand — no more endless scrolling to find an older conversation."},{icon:ie,title:"Polished and steadier",body:"Several sidebar bugs are fixed, including empty agent groups showing the right action and status filters returning the right tasks."}]},{id:"smarter-task-delegation",date:"2026-05-27",eyebrow:"Now Available",title:"Smarter task delegation",bullets:[{icon:ht,title:"Real results from delegated agents",body:"When one agent hands work to another, you'll see the full report inline — no more empty replies hiding the work that was done."},{icon:Ke,title:"Same powers, top to bottom",body:"Delegated agents now work with the same tools, context, and memory as the agent that called them, so complex multi-agent investigations finish on the first try."},{icon:ie,title:"Clearer progress signals",body:"When a delegated task hits its limit or runs into a problem, you get a plain-language message instead of a silent stall."}]},{id:"sidebar-task-groups",date:"2026-05-27",eyebrow:"Now Available",title:"Redesigned sidebar",bullets:[{icon:te,title:"Group by agent or status",body:"Switch the task list between grouping by agent or by status — pick whichever matches how you're working right now."},{icon:rt,title:"Sharper filters",body:"Narrow the list to your tasks, manual chats, or automations from a compact filter row above the groups."}]},{id:"release-channel",date:"2026-05-26",eyebrow:"Now Available",title:"Release announcements",bullets:[{icon:te,title:"Heads-up when features ship",body:"New releases surface in a corner card the first time you see them, then stick around in your inbox."},{icon:jn,title:"Unified inbox",body:"Org invitations and product updates now share one chronological feed in the sidebar."}]}],ot="studio.release-feed.v1",ct=new Set;let ae="",re={},dt=!1;function ks(){if(dt)return ae||"{}";try{return localStorage.getItem(ot)??"{}"}catch{return ae||"{}"}}function qt(t){try{const e=JSON.parse(t);return e&&typeof e=="object"?e:{}}catch{return{}}}function wt(){const t=ks();return t!==ae&&(ae=t,re=qt(t)),re}function Ts(t){ct.add(t);const e=o=>{if(!(o.key!==ot&&o.key!==null)){try{const r=localStorage.getItem(ot)??"{}",a={...qt(r),...re};re=a,ae=JSON.stringify(a)}catch{}t()}};return window.addEventListener("storage",e),()=>{ct.delete(t),window.removeEventListener("storage",e)}}function Ns(t){re=t,ae=JSON.stringify(t);try{localStorage.setItem(ot,ae),dt=!1}catch{dt=!0}ct.forEach(e=>e())}function _s(){const t=R.c(7),e=X.useSyncExternalStore(Ts,wt,wt);let o;t[0]!==e?(o=m=>!!e[m],t[0]=e,t[1]=o):o=t[1];const r=o,s=Ps;let a;t[2]!==e?(a=Kt.reduce((m,h)=>e[h.id]?m:m+1,0),t[2]=e,t[3]=a):a=t[3];const i=a;let c;return t[4]!==r||t[5]!==i?(c={isSeen:r,markSeen:s,unseenCount:i},t[4]=r,t[5]=i,t[6]=c):c=t[6],c}function Ps(t){re[t]||Ns({...re,[t]:{seenAt:new Date().toISOString()}})}const As=720*60*60*1e3,Es=10080*60*1e3;function Cs(t){const[e,o,r]=t.split("-").map(Number);return!e||!o||!r?new Date(t).getTime():new Date(e,o-1,r).getTime()}function Os(t){const e=Kt[0];if(!e)return null;const o=Cs(e.date),r=t-o;return r<0||r>As?null:e}function Is(t){if(t instanceof Date)return t.getTime();if(typeof t=="string"||typeof t=="number"){const e=new Date(t).getTime();return Number.isFinite(e)?e:null}return null}function $s(t,e){const o=Is(t);return o===null?!1:e-o>=Es}function Ls(){const t=R.c(46),e=J(),o=Cn(),r=Xt(),s=Dt(),a=!!o,i=r===ne.home&&!o;let c;t[0]!==s||t[1]!==a?(c=a&&!!s&&zt(s),t[0]=s,t[1]=a,t[2]=c):c=t[2];const m=c,{data:h}=Je.useSession(),{isSeen:w,markSeen:u}=_s(),p=$n(6e4);let l,g,f;if(t[3]!==w||t[4]!==p||t[5]!==h?.user?.createdAt){f=Symbol.for("react.early_return_sentinel");e:{if(l=Os(p),!l){f=null;break e}if(!$s(h?.user?.createdAt,p)){f=null;break e}g=w(l.id)}t[3]=w,t[4]=p,t[5]=h?.user?.createdAt,t[6]=l,t[7]=g,t[8]=f}else l=t[6],g=t[7],f=t[8];if(f!==Symbol.for("react.early_return_sentinel"))return f;if(g)return null;let d;t[9]!==l.id||t[10]!==a||t[11]!==u||t[12]!==i||t[13]!==m||t[14]!==e?(d=()=>{u(l.id),vs(e,{onOrgHome:i,inProject:a,onSiteEditor:m})},t[9]=l.id,t[10]=a,t[11]=u,t[12]=i,t[13]=m,t[14]=e,t[15]=d):d=t[15];const S=d;let y;t[16]!==e?(y=e("announcements.release.ariaLabel"),t[16]=e,t[17]=y):y=t[17];let x;t[18]!==e?(x=e("announcements.release.dismiss"),t[18]=e,t[19]=x):x=t[19];const v=l.eyebrow,b=l.title;let T;t[20]!==l.id||t[21]!==u?(T=()=>u(l.id),t[20]=l.id,t[21]=u,t[22]=T):T=t[22];let j;t[23]!==l.id||t[24]!==l.learnMoreHref||t[25]!==u||t[26]!==e?(j=l.learnMoreHref?n.jsx("a",{href:l.learnMoreHref,target:"_blank",rel:"noreferrer",onClick:()=>u(l.id),className:"underline-offset-2 hover:text-foreground hover:underline",children:e("announcements.release.learnMore")}):null,t[23]=l.id,t[24]=l.learnMoreHref,t[25]=u,t[26]=e,t[27]=j):j=t[27];let k;t[28]!==l.cta||t[29]!==l.id||t[30]!==u||t[31]!==S?(k=l.cta?"href"in l.cta?n.jsx(M,{asChild:!0,size:"sm",onClick:()=>u(l.id),children:n.jsx("a",{href:l.cta.href,children:l.cta.label})}):n.jsx(M,{size:"sm",onClick:S,children:l.cta.label}):null,t[28]=l.cta,t[29]=l.id,t[30]=u,t[31]=S,t[32]=k):k=t[32];let _;t[33]!==l.bullets?(_=l.bullets.map(Ds),t[33]=l.bullets,t[34]=_):_=t[34];let N;t[35]!==_?(N=n.jsx("ul",{className:"flex flex-col gap-3",children:_}),t[35]=_,t[36]=N):N=t[36];let P;return t[37]!==l.eyebrow||t[38]!==l.title||t[39]!==k||t[40]!==N||t[41]!==y||t[42]!==x||t[43]!==T||t[44]!==j?(P=n.jsx(Rt,{ariaLabel:y,dismissLabel:x,eyebrow:v,title:b,onDismiss:T,footerLeading:j,actions:k,children:N}),t[37]=l.eyebrow,t[38]=l.title,t[39]=k,t[40]=N,t[41]=y,t[42]=x,t[43]=T,t[44]=j,t[45]=P):P=t[45],P}function Ds(t,e){return n.jsxs("li",{className:"flex items-start gap-3",children:[n.jsx(t.icon,{size:20,className:"mt-0.5 shrink-0 text-muted-foreground"}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("p",{className:"text-sm font-medium text-foreground",children:t.title}),n.jsx("p",{className:"text-xs text-muted-foreground",children:t.body})]})]},e)}const Bt=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform),oe=Bt?"⌘":"Ctrl",G={commandPalette:{keys:[oe,"K"],description:"Command palette"},keyboardShortcuts:{keys:["?"],description:"Keyboard shortcuts"},back:{keys:[oe,"["],description:"Back to previous"},focusChatInput:{keys:[oe,"L"],description:"Focus chat input"},saveAndFormat:{keys:[oe,"S"],description:"Save & format"},sendMessage:{keys:["Enter"],description:"Send message"},newLine:{keys:["Shift","Enter"],description:"New line"},selectOption:{keys:["1-9"],description:"Select option"},applyFilter:{keys:[oe,"Enter"],description:"Apply filter"},togglePlanMode:{keys:[oe,"Shift","L"],description:"Toggle plan mode"},newTask:{keys:["Shift",oe,"S"],description:"New task"},toggleDaemon:{keys:[oe,"D"],description:"Toggle daemon logs"}},Rs=[{label:"General",shortcuts:[G.commandPalette,G.keyboardShortcuts,G.back,G.newTask,G.toggleDaemon]},{label:"Editor",shortcuts:[G.saveAndFormat]},{label:"Chat",shortcuts:[G.focusChatInput,G.togglePlanMode,G.sendMessage,G.newLine]},{label:"Questions",shortcuts:[G.selectOption]},{label:"Monitoring",shortcuts:[G.applyFilter]}];function vt(t){return Bt?t.metaKey:t.ctrlKey}function Ms(t){if(!(t instanceof HTMLElement))return!1;if(t.isContentEditable)return!0;const e=t.tagName;return e==="INPUT"||e==="TEXTAREA"||e==="SELECT"}function Fs(t){const e=R.c(11),{open:o,onOpenChange:r}=t,s=J();let a;e[0]!==s?(a=s("common.keyboardShortcutsDialog.title"),e[0]=s,e[1]=a):a=e[1];let i;e[2]!==a?(i=n.jsx(_t,{children:n.jsx(Pt,{children:a})}),e[2]=a,e[3]=i):i=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("div",{className:"flex flex-col gap-4",children:Rs.map(zs)}),e[4]=c):c=e[4];let m;e[5]!==i?(m=n.jsxs(At,{className:"sm:max-w-md",children:[i,c]}),e[5]=i,e[6]=m):m=e[6];let h;return e[7]!==r||e[8]!==o||e[9]!==m?(h=n.jsx(Et,{open:o,onOpenChange:r,children:m}),e[7]=r,e[8]=o,e[9]=m,e[10]=h):h=e[10],h}function zs(t){return n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:t.label}),n.jsx("div",{className:"flex flex-col gap-1.5",children:t.shortcuts.map(Ks)})]},t.label)}function Ks(t){return n.jsxs("div",{className:"flex items-center justify-between py-1",children:[n.jsx("span",{className:"text-sm",children:t.description}),n.jsx("div",{className:"flex items-center gap-1",children:t.keys.map(qs)})]},t.description)}function qs(t){return n.jsx("kbd",{className:"inline-flex items-center justify-center min-w-6 h-6 px-1.5 rounded-sm border border-border bg-muted text-muted-foreground text-xs font-mono",children:t},t)}const jt=8;function Bs(t){const{org:e}=ut(),o=qn({connectionId:Ot,orgId:e.id,orgSlug:e.slug}),{data:r}=qe({queryKey:We.globalSearch(e.id,t,jt),enabled:!!o&&t.trim().length>=2,staleTime:15e3,retry:!1,queryFn:async()=>{if(!o)return[];try{return(await o.callTool({name:"GLOBAL_SEARCH",arguments:{query:t,limit:jt}})).structuredContent?.items??[]}catch{return[]}}});return r??[]}function Hs(t){const e=R.c(195),{open:o,onOpenChange:r}=t,s=J(),a=Ct(),{org:i}=ut(),{projects:c,hasProjects:m}=On(),[h,w]=X.useState(""),u=X.useDeferredValue(h),p=Bs(u);let l;e[0]!==r?(l=()=>{r(!1),w("")},e[0]=r,e[1]=l):l=e[1];const g=l;let f;e[2]!==g?(f=(K,q)=>{lt("command_palette_used",{kind:q}),K(),g()},e[2]=g,e[3]=f):f=e[3];const d=f;let S;e[4]!==a||e[5]!==i.id||e[6]!==i.slug?(S=K=>{if(K.type==="connection"){if(!K.slug){a({to:"/$org/settings/connections",params:{org:i.slug},search:{tab:"all"}});return}a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:K.slug}});return}if(K.type==="task"){a({to:ne.tasks,params:{org:i.slug,taskKey:K.key??void 0}});return}const q=It(i.id).id;Zt(a,en({org:i.slug,agentId:K.virtual_mcp_id??q,superAgentId:q}),{search:()=>({thread:K.id}),replace:!1})},e[4]=a,e[5]=i.id,e[6]=i.slug,e[7]=S):S=e[7];const y=S;let x;e[8]!==h?(x=[h],e[8]=h,e[9]=x):x=e[9];const v=x;let b,T,j,k,_,N,P,E,I,O,D,A,F;if(e[10]!==g||e[11]!==d||e[12]!==m||e[13]!==p||e[14]!==a||e[15]!==r||e[16]!==o||e[17]!==y||e[18]!==i.slug||e[19]!==c||e[20]!==v||e[21]!==s||e[22]!==h){const K=p.filter(Gs),q=p.filter(Us);let V;e[36]!==i.slug?(V={org:i.slug},e[36]=i.slug,e[37]=V):V=e[37];const $=V;let W;e[38]!==s?(W=s("sidebar.navDestinations.home"),e[38]=s,e[39]=W):W=e[39];let Y;e[40]===Symbol.for("react.memo_cache_sentinel")?(Y=n.jsx(Tn,{"aria-hidden":"true"}),e[40]=Y):Y=e[40];let H;e[41]!==$||e[42]!==W?(H={key:"home",label:W,icon:Y,to:ne.home,params:$},e[41]=$,e[42]=W,e[43]=H):H=e[43];let U;e[44]!==s?(U=s("sidebar.navDestinations.reports"),e[44]=s,e[45]=U):U=e[45];let ee;e[46]===Symbol.for("react.memo_cache_sentinel")?(ee=n.jsx(Nn,{"aria-hidden":"true"}),e[46]=ee):ee=e[46];let Q;e[47]!==$||e[48]!==U?(Q={key:"reports",label:U,icon:ee,to:ne.reports,params:$},e[47]=$,e[48]=U,e[49]=Q):Q=e[49];let L;e[50]!==s?(L=s("sidebar.navDestinations.tasks"),e[50]=s,e[51]=L):L=e[51];let B;e[52]===Symbol.for("react.memo_cache_sentinel")?(B=n.jsx(yt,{"aria-hidden":"true"}),e[52]=B):B=e[52];let ce;e[53]!==i.slug?(ce={org:i.slug,taskKey:void 0},e[53]=i.slug,e[54]=ce):ce=e[54];let de;e[55]!==L||e[56]!==ce?(de={key:"tasks",label:L,icon:B,to:ne.tasks,params:ce},e[55]=L,e[56]=ce,e[57]=de):de=e[57];let ue;e[58]!==s?(ue=s("sidebar.navDestinations.library"),e[58]=s,e[59]=ue):ue=e[59];let Ye;e[60]===Symbol.for("react.memo_cache_sentinel")?(Ye=n.jsx(_n,{"aria-hidden":"true"}),e[60]=Ye):Ye=e[60];let me;e[61]!==$||e[62]!==ue?(me={key:"library",label:ue,icon:Ye,to:ne.library,params:$},e[61]=$,e[62]=ue,e[63]=me):me=e[63];let fe;e[64]!==s?(fe=s("sidebar.navDestinations.discover"),e[64]=s,e[65]=fe):fe=e[65];let Qe;e[66]===Symbol.for("react.memo_cache_sentinel")?(Qe=n.jsx(Pn,{"aria-hidden":"true"}),e[66]=Qe):Qe=e[66];let he;e[67]!==$||e[68]!==fe?(he={key:"discover",label:fe,icon:Qe,to:ne.discover,params:$},e[67]=$,e[68]=fe,e[69]=he):he=e[69];let Xe;e[70]!==H||e[71]!==Q||e[72]!==de||e[73]!==me||e[74]!==he?(Xe=[H,Q,de,me,he],e[70]=H,e[71]=Q,e[72]=de,e[73]=me,e[74]=he,e[75]=Xe):Xe=e[75];const at=Xe;T=Dn,k=o,e[76]!==g||e[77]!==r?(_=C=>C?r(!0):g(),e[76]=g,e[77]=r,e[78]=_):_=e[78],e[79]!==s?(N=s("commandPalette.title"),e[79]=s,e[80]=N):N=e[80],e[81]!==s?(P=s("commandPalette.description"),e[81]=s,e[82]=P):P=e[82];let ge;e[83]!==s?(ge=s("commandPalette.placeholder"),e[83]=s,e[84]=ge):ge=e[84];let pe;e[85]!==s?(pe=s("commandPalette.placeholder"),e[85]=s,e[86]=pe):pe=e[86],e[87]!==ge||e[88]!==pe||e[89]!==h?(E=n.jsx(Rn,{placeholder:ge,"aria-label":pe,value:h,onValueChange:w}),e[87]=ge,e[88]=pe,e[89]=h,e[90]=E):E=e[90],b=Mn;let ye;e[91]!==s?(ye=s("commandPalette.empty"),e[91]=s,e[92]=ye):ye=e[92],e[93]!==ye?(I=n.jsx(Fn,{children:ye}),e[93]=ye,e[94]=I):I=e[94];let be;e[95]!==s?(be=s("commandPalette.goTo"),e[95]=s,e[96]=be):be=e[96];let xe;e[97]!==at||e[98]!==d||e[99]!==a?(xe=at.map(C=>n.jsxs(se,{onSelect:()=>d(()=>a({to:C.to,params:C.params}),"destination"),children:[C.icon,n.jsx("span",{children:C.label})]},C.key)),e[97]=at,e[98]=d,e[99]=a,e[100]=xe):xe=e[100],e[101]!==be||e[102]!==xe?(O=n.jsx(Be,{heading:be,children:xe}),e[101]=be,e[102]=xe,e[103]=O):O=e[103],e[104]!==d||e[105]!==m||e[106]!==a||e[107]!==i.slug||e[108]!==c||e[109]!==s?(D=m&&n.jsx(Be,{heading:s("commandPalette.projects"),children:c.map(C=>n.jsxs(se,{value:`project ${C.title}`,onSelect:()=>d(()=>a({to:ne.projects,params:{org:i.slug,agentId:C.id}}),"project"),children:[n.jsx(Kn,{icon:C.icon,name:C.title,"aria-hidden":"true"}),n.jsx("span",{children:C.title})]},C.id))}),e[104]=d,e[105]=m,e[106]=a,e[107]=i.slug,e[108]=c,e[109]=s,e[110]=D):D=e[110];let Se;e[111]!==s?(Se=s("commandPalette.actions"),e[111]=s,e[112]=Se):Se=e[112];let we;e[113]!==s?(we=s("commandPalette.newProject"),e[113]=s,e[114]=we):we=e[114];let ve;e[115]!==d||e[116]!==a||e[117]!==$?(ve=()=>d(()=>a({to:ne.home,params:$}),"new_project"),e[115]=d,e[116]=a,e[117]=$,e[118]=ve):ve=e[118];let Ze;e[119]===Symbol.for("react.memo_cache_sentinel")?(Ze=n.jsx(xt,{"aria-hidden":"true"}),e[119]=Ze):Ze=e[119];let je;e[120]!==s?(je=s("commandPalette.newProject"),e[120]=s,e[121]=je):je=e[121];let ke;e[122]!==je?(ke=n.jsx("span",{children:je}),e[122]=je,e[123]=ke):ke=e[123];let Te;e[124]!==we||e[125]!==ve||e[126]!==ke?(Te=n.jsxs(se,{value:we,onSelect:ve,children:[Ze,ke]}),e[124]=we,e[125]=ve,e[126]=ke,e[127]=Te):Te=e[127];let Ne;e[128]!==s?(Ne=s("commandPalette.inviteTeammate"),e[128]=s,e[129]=Ne):Ne=e[129];let _e;e[130]!==d||e[131]!==a||e[132]!==$?(_e=()=>d(()=>a({to:"/$org/settings/members",params:$}),"invite"),e[130]=d,e[131]=a,e[132]=$,e[133]=_e):_e=e[133];let et;e[134]===Symbol.for("react.memo_cache_sentinel")?(et=n.jsx(An,{"aria-hidden":"true"}),e[134]=et):et=e[134];let Pe;e[135]!==s?(Pe=s("commandPalette.inviteTeammate"),e[135]=s,e[136]=Pe):Pe=e[136];let Ae;e[137]!==Pe?(Ae=n.jsx("span",{children:Pe}),e[137]=Pe,e[138]=Ae):Ae=e[138];let Ee;e[139]!==Ne||e[140]!==_e||e[141]!==Ae?(Ee=n.jsxs(se,{value:Ne,onSelect:_e,children:[et,Ae]}),e[139]=Ne,e[140]=_e,e[141]=Ae,e[142]=Ee):Ee=e[142];let Ce;e[143]!==s?(Ce=s("commandPalette.addConnection"),e[143]=s,e[144]=Ce):Ce=e[144];let Oe;e[145]!==d||e[146]!==a||e[147]!==$?(Oe=()=>d(()=>a({to:"/$org/settings/connections",params:$,search:{tab:"all"}}),"add_connection"),e[145]=d,e[146]=a,e[147]=$,e[148]=Oe):Oe=e[148];let tt;e[149]===Symbol.for("react.memo_cache_sentinel")?(tt=n.jsx(xt,{"aria-hidden":"true"}),e[149]=tt):tt=e[149];let Ie;e[150]!==s?(Ie=s("commandPalette.addConnection"),e[150]=s,e[151]=Ie):Ie=e[151];let $e;e[152]!==Ie?($e=n.jsx("span",{children:Ie}),e[152]=Ie,e[153]=$e):$e=e[153];let Le;e[154]!==Ce||e[155]!==Oe||e[156]!==$e?(Le=n.jsxs(se,{value:Ce,onSelect:Oe,children:[tt,$e]}),e[154]=Ce,e[155]=Oe,e[156]=$e,e[157]=Le):Le=e[157];let De;e[158]!==s?(De=s("commandPalette.settings"),e[158]=s,e[159]=De):De=e[159];let Re;e[160]!==d||e[161]!==a||e[162]!==$?(Re=()=>d(()=>a({to:"/$org/settings/general",params:$}),"settings"),e[160]=d,e[161]=a,e[162]=$,e[163]=Re):Re=e[163];let nt;e[164]===Symbol.for("react.memo_cache_sentinel")?(nt=n.jsx(Ln,{"aria-hidden":"true"}),e[164]=nt):nt=e[164];let Me;e[165]!==s?(Me=s("commandPalette.settings"),e[165]=s,e[166]=Me):Me=e[166];let Fe;e[167]!==Me?(Fe=n.jsx("span",{children:Me}),e[167]=Me,e[168]=Fe):Fe=e[168];let ze;e[169]!==De||e[170]!==Re||e[171]!==Fe?(ze=n.jsxs(se,{value:De,onSelect:Re,children:[nt,Fe]}),e[169]=De,e[170]=Re,e[171]=Fe,e[172]=ze):ze=e[172],e[173]!==Se||e[174]!==Te||e[175]!==Ee||e[176]!==Le||e[177]!==ze?(A=n.jsxs(Be,{heading:Se,children:[Te,Ee,Le,ze]}),e[173]=Se,e[174]=Te,e[175]=Ee,e[176]=Le,e[177]=ze,e[178]=A):A=e[178],F=K.length>0&&n.jsx(Be,{heading:s("commandPalette.connections"),children:K.map(C=>n.jsxs(se,{value:`${C.title} ${C.id}`,keywords:v,onSelect:()=>d(()=>y(C),"connection"),children:[n.jsx(zn,{icon:C.icon,name:C.title,size:"2xs","aria-hidden":"true"}),n.jsx("span",{className:"truncate",children:C.title})]},`connection:${C.id}`))}),j=q.length>0&&n.jsx(Be,{heading:s("commandPalette.results"),children:q.map(C=>n.jsxs(se,{value:`${C.title} ${C.id}`,keywords:v,onSelect:()=>d(()=>y(C),C.type),children:[C.type==="thread"?n.jsx(kn,{"aria-hidden":"true"}):n.jsx(yt,{"aria-hidden":"true"}),n.jsx("span",{className:"truncate",children:C.title}),C.type==="task"&&C.key&&n.jsx("span",{className:"ml-auto shrink-0 font-mono text-xs text-muted-foreground",children:C.key})]},`${C.type}:${C.id}`))}),e[10]=g,e[11]=d,e[12]=m,e[13]=p,e[14]=a,e[15]=r,e[16]=o,e[17]=y,e[18]=i.slug,e[19]=c,e[20]=v,e[21]=s,e[22]=h,e[23]=b,e[24]=T,e[25]=j,e[26]=k,e[27]=_,e[28]=N,e[29]=P,e[30]=E,e[31]=I,e[32]=O,e[33]=D,e[34]=A,e[35]=F}else b=e[23],T=e[24],j=e[25],k=e[26],_=e[27],N=e[28],P=e[29],E=e[30],I=e[31],O=e[32],D=e[33],A=e[34],F=e[35];let z;e[179]!==b||e[180]!==j||e[181]!==I||e[182]!==O||e[183]!==D||e[184]!==A||e[185]!==F?(z=n.jsxs(b,{children:[I,O,D,A,F,j]}),e[179]=b,e[180]=j,e[181]=I,e[182]=O,e[183]=D,e[184]=A,e[185]=F,e[186]=z):z=e[186];let Z;return e[187]!==T||e[188]!==k||e[189]!==_||e[190]!==N||e[191]!==P||e[192]!==E||e[193]!==z?(Z=n.jsxs(T,{open:k,onOpenChange:_,title:N,description:P,children:[E,z]}),e[187]=T,e[188]=k,e[189]=_,e[190]=N,e[191]=P,e[192]=E,e[193]=z,e[194]=Z):Z=e[194],Z}function Us(t){return t.type!=="connection"}function Gs(t){return t.type==="connection"}const Ge=new Jn(!1);function Js(){Ge.set(!0)}function Vs(){Ge.set(!1)}function Ws(){const t=R.c(2),e=X.useSyncExternalStore(Ge.subscribe,Ge.get);let o;return t[0]!==e?(o=[e,Ge.set],t[0]=e,t[1]=o):o=t[1],o}const Ys=300*1e3,Qs=2;function Xs(t,e,o){return!e||e===o?{version:null,count:0}:t.version===e?{version:e,count:t.count+1}:{version:e,count:1}}function Zs(t,e){return t.count>=Qs&&t.version!==null&&t.version!==e}function eo(){const t=R.c(31),e=J();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={queryKey:We.appVersionCheck(),queryFn:no,refetchInterval:Ys,refetchIntervalInBackground:!0,staleTime:0},t[0]=o):o=t[0];const{data:r,dataUpdatedAt:s}=qe(o),[a,i]=X.useState(0);let c;t[1]===Symbol.for("react.memo_cache_sentinel")?(c={version:null,count:0},t[1]=c):c=t[1];const[m,h]=X.useState(c);s!==a&&(i(s),h(k=>Xs(k,r,"4.518.3")));const[w,u]=X.useState(null);if(!Zs(m,w))return null;let p;t[2]!==e?(p=e("announcements.version.ariaLabel"),t[2]=e,t[3]=p):p=t[3];let l;t[4]!==e?(l=e("announcements.version.dismiss"),t[4]=e,t[5]=l):l=t[5];let g;t[6]!==e?(g=e("announcements.version.eyebrow"),t[6]=e,t[7]=g):g=t[7];let f;t[8]!==e?(f=e("announcements.version.title"),t[8]=e,t[9]=f):f=t[9];let d;t[10]!==e?(d=e("announcements.version.description"),t[10]=e,t[11]=d):d=t[11];let S;t[12]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(gt,{size:16}),t[12]=S):S=t[12];let y;t[13]!==m.version?(y=()=>u(m.version),t[13]=m.version,t[14]=y):y=t[14];let x;t[15]!==e?(x=e("announcements.version.currentSession",{version:"4.518.3"}),t[15]=e,t[16]=x):x=t[16];let v;t[17]!==e?(v=e("announcements.version.refresh"),t[17]=e,t[18]=v):v=t[18];let b;t[19]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(gt,{size:14}),t[19]=b):b=t[19];let T;t[20]!==v?(T=n.jsxs(M,{size:"sm",onClick:to,children:[v,b]}),t[20]=v,t[21]=T):T=t[21];let j;return t[22]!==T||t[23]!==p||t[24]!==l||t[25]!==g||t[26]!==f||t[27]!==d||t[28]!==y||t[29]!==x?(j=n.jsx(Rt,{ariaLabel:p,dismissLabel:l,eyebrow:g,title:f,description:d,icon:S,tone:"system",onDismiss:y,footerLeading:x,actions:T}),t[22]=T,t[23]=p,t[24]=l,t[25]=g,t[26]=f,t[27]=d,t[28]=y,t[29]=x,t[30]=j):j=t[30],j}function to(){return window.location.reload()}async function no(){const t=await fetch("/api/config",{cache:"no-store"}),{config:e}=await t.json();return e.version}function so(t){return{has(){try{return localStorage.getItem(t)==="1"}catch{return!1}},mark(){try{localStorage.setItem(t,"1")}catch{}}}}const oo=Date.parse("2026-07-21T00:00:00Z"),kt=t=>so(Ve.ptBrAnnouncementSeen(t));function io(){const t=R.c(35),e=J(),[o,r]=tn(),{data:s,isPending:a}=Je.useSession(),i=s?.user,c=i?.id,m=i?.createdAt,h=m!=null&&new Date(m).getTime()<oo,w=nn()==="pt-BR",u=!a&&!!c&&h&&w&&o.language==="en"&&!kt(c).has(),[p,l]=X.useState(!1),[g,f]=X.useState(!1);!p&&!a&&(l(!0),u&&c&&(kt(c).mark(),r(ro),f(!0),lt("pt_br_auto_switch_shown")));let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=Z=>{lt("pt_br_auto_switch_closed",{action:Z}),f(!1)},t[0]=d):d=t[0];const S=d;let y;t[1]!==r?(y=()=>{r(ao),S("switch-back")},t[1]=r,t[2]=y):y=t[2];const x=y;let v;t[3]===Symbol.for("react.memo_cache_sentinel")?(v=Z=>!Z&&S("dismiss"),t[3]=v):v=t[3];let b;t[4]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx("div",{className:"text-4xl","aria-hidden":"true",children:"🇧🇷"}),t[4]=b):b=t[4];let T;t[5]!==e?(T=e("announcements.ptBr.title"),t[5]=e,t[6]=T):T=t[6];let j;t[7]!==T?(j=n.jsx(Pt,{children:T}),t[7]=T,t[8]=j):j=t[8];let k;t[9]!==e?(k=e("announcements.ptBr.description"),t[9]=e,t[10]=k):k=t[10];let _;t[11]!==k?(_=n.jsx(sn,{children:k}),t[11]=k,t[12]=_):_=t[12];let N;t[13]!==j||t[14]!==_?(N=n.jsxs(_t,{children:[j,_]}),t[13]=j,t[14]=_,t[15]=N):N=t[15];let P;t[16]!==e?(P=e("announcements.ptBr.switchBack"),t[16]=e,t[17]=P):P=t[17];let E;t[18]!==x||t[19]!==P?(E=n.jsx(M,{variant:"outline",onClick:x,children:P}),t[18]=x,t[19]=P,t[20]=E):E=t[20];let I;t[21]===Symbol.for("react.memo_cache_sentinel")?(I=()=>S("ok"),t[21]=I):I=t[21];let O;t[22]!==e?(O=e("announcements.ptBr.ok"),t[22]=e,t[23]=O):O=t[23];let D;t[24]!==O?(D=n.jsx(M,{onClick:I,children:O}),t[24]=O,t[25]=D):D=t[25];let A;t[26]!==E||t[27]!==D?(A=n.jsxs(on,{children:[E,D]}),t[26]=E,t[27]=D,t[28]=A):A=t[28];let F;t[29]!==A||t[30]!==N?(F=n.jsxs(At,{className:"sm:max-w-md",children:[b,N,A]}),t[29]=A,t[30]=N,t[31]=F):F=t[31];let z;return t[32]!==g||t[33]!==F?(z=n.jsx(Et,{open:g,onOpenChange:v,children:F}),t[32]=g,t[33]=F,t[34]=z):z=t[34],z}function ao(t){return{...t,language:"en"}}function ro(t){return{...t,language:"pt-BR"}}function lo(t){const e=an(t);return typeof e=="string"?e:void 0}function co(){return lo("experiment-pipeline-check"),null}function uo(t){const e=R.c(1),{activeOrg:o}=t;if(!o)return null;rn(o.id,{name:o.name??void 0,slug:o.slug??void 0}),ln();let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(co,{}),e[0]=r):r=e[0],r}function mo(t){const{prev:e,virtualMcpId:o,decopilotId:r,savedLayout:s,opts:a,autosendValue:i}=t,c={mainpanel:void 0};o?c.virtualmcpid=o:e.virtualmcpid&&(c.virtualmcpid=e.virtualmcpid);const m=typeof e.virtualmcpid=="string"?e.virtualmcpid:r,w=(o??m)!==m;let u,p;return a?.panel?p=a.panel:a?.newThread&&!w&&cn(e.tabId)?(p=e.tabId,c.mainpanel=e.mainpanel,u=e.sidepanel):s?(p=s.tab,s.sidepanel!==void 0&&(u=s.sidepanel),s.mainpanel!==void 0&&(c.mainpanel=s.mainpanel)):!w&&e.tabId&&!dn(e.tabId)&&(p=e.tabId),u!==void 0&&(c.sidepanel=u),a?.autosend&&(c.autosend=i),{tabId:p,search:c}}const Ht="studio:thread-layout:v4",fo=50;function Ut(t){const e={};return t===null||typeof t!="object"||(typeof t.tab=="string"&&(e.tab=t.tab),typeof t.mainpanel=="boolean"&&(e.mainpanel=t.mainpanel),typeof t.sidepanel=="boolean"&&(e.sidepanel=t.sidepanel)),e}function ho(t,e,o,r=fo){const s=t.filter(([a])=>a!==e);for(s.push([e,Ut(o)]);s.length>r;)s.shift();return s}function mt(){try{const t=sessionStorage.getItem(Ht);if(!t)return[];const e=JSON.parse(t);return Array.isArray(e)?e.filter(o=>Array.isArray(o)&&o.length===2&&typeof o[0]=="string"):[]}catch{return[]}}function Gt(t){try{sessionStorage.setItem(Ht,JSON.stringify(t))}catch{}}function go(t,e){t&&Gt(ho(mt(),t,e))}function po(t){if(!t)return null;const e=mt().find(([o])=>o===t);return e?Ut(e[1]):null}function si(t){if(!t)return;const e=mt(),o=e.filter(([r])=>r!==t);o.length!==e.length&&Gt(o)}function Jt(t){return{queryKey:We.homeNextActions(t),queryFn:async()=>{const e=await fetch(`/api/${t}/home-next-actions`,{cache:"no-store"});if(!e.ok)throw new Error("Failed to load home next actions");return await e.json()},staleTime:0,refetchOnWindowFocus:"always"}}function oi(t){const e=R.c(10);let o;e[0]!==t?(o=Jt(t),e[0]=t,e[1]=o):o=e[1];const r=qe(o);let s;e[2]!==r.data?.prompts?(s=r.data?.prompts??[],e[2]=r.data?.prompts,e[3]=s):s=e[3];let a;e[4]!==r.data?.tiles?(a=r.data?.tiles??[],e[4]=r.data?.tiles,e[5]=a):a=e[5];let i;return e[6]!==r.isLoading||e[7]!==s||e[8]!==a?(i={isLoading:r.isLoading,prompts:s,tiles:a},e[6]=r.isLoading,e[7]=s,e[8]=a,e[9]=i):i=e[9],i}function yo(t){const e=R.c(31),{orgSlug:o,orgName:r,domain:s}=t,a=J();let i;e[0]!==o?(i=()=>{window.location.href=`/api/${encodeURIComponent(o)}/sso/authorize`},e[0]=o,e[1]=i):i=e[1];const c=i,m=bo;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx("div",{className:"bg-primary/10 p-3 rounded-full","aria-hidden":"true",children:n.jsx(Tt,{className:"h-6 w-6 text-primary"})}),e[2]=h):h=e[2];let w;e[3]!==a?(w=a("common.ssoRequiredScreen.title"),e[3]=a,e[4]=w):w=e[4];let u;e[5]!==w?(u=n.jsx("h3",{className:"text-lg font-medium",children:w}),e[5]=w,e[6]=u):u=e[6];let p;e[7]!==s||e[8]!==r||e[9]!==a?(p=r?n.jsxs(n.Fragment,{children:[n.jsx("strong",{children:r})," ",a("common.ssoRequiredScreen.requiresSsoAuth"),s?` ${a("common.ssoRequiredScreen.via",{domain:s})}`:"","."]}):a("common.ssoRequiredScreen.orgRequiresSsoAuth"),e[7]=s,e[8]=r,e[9]=a,e[10]=p):p=e[10];let l;e[11]!==p?(l=n.jsx("p",{className:"text-sm text-muted-foreground",children:p}),e[11]=p,e[12]=l):l=e[12];let g;e[13]!==u||e[14]!==l?(g=n.jsxs("div",{className:"space-y-2",children:[u,l]}),e[13]=u,e[14]=l,e[15]=g):g=e[15];let f;e[16]!==a?(f=a("common.ssoRequiredScreen.signInWithSso"),e[16]=a,e[17]=f):f=e[17];let d;e[18]!==c||e[19]!==f?(d=n.jsx(M,{onClick:c,children:f}),e[18]=c,e[19]=f,e[20]=d):d=e[20];let S;e[21]!==a?(S=a("common.goBack"),e[21]=a,e[22]=S):S=e[22];let y;e[23]!==S?(y=n.jsx(M,{variant:"ghost",onClick:m,children:S}),e[23]=S,e[24]=y):y=e[24];let x;e[25]!==y||e[26]!==d?(x=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[d,y]}),e[25]=y,e[26]=d,e[27]=x):x=e[27];let v;return e[28]!==x||e[29]!==g?(v=n.jsxs(le,{children:[h,g,x]}),e[28]=x,e[29]=g,e[30]=v):v=e[30],v}function bo(){window.location.href="/"}function xo(t){const e=R.c(27),{notice:o,orgSlug:r}=t,s=J();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:n.jsx(un,{className:"h-6 w-6 text-destructive"})}),e[0]=a):a=e[0];let i;e[1]!==o.title?(i=n.jsx("h3",{className:"text-lg font-medium",children:o.title}),e[1]=o.title,e[2]=i):i=e[2];let c;e[3]!==o.message?(c=n.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-line",children:o.message}),e[3]=o.message,e[4]=c):c=e[4];let m;e[5]!==i||e[6]!==c?(m=n.jsxs("div",{className:"space-y-2",children:[i,c]}),e[5]=i,e[6]=c,e[7]=m):m=e[7];let h;e[8]!==o.ctaLabel||e[9]!==o.ctaUrl?(h=o.ctaUrl&&o.ctaLabel?n.jsx(M,{asChild:!0,children:n.jsx("a",{href:o.ctaUrl,target:"_blank",rel:"noreferrer noopener",children:o.ctaLabel})}):null,e[8]=o.ctaLabel,e[9]=o.ctaUrl,e[10]=h):h=e[10];const w=`/${encodeURIComponent(r)}/settings/infra-billing`;let u;e[11]!==s?(u=s("common.blockedOrgScreen.goToBilling"),e[11]=s,e[12]=u):u=e[12];let p;e[13]!==w||e[14]!==u?(p=n.jsx(M,{variant:"outline",asChild:!0,children:n.jsx("a",{href:w,children:u})}),e[13]=w,e[14]=u,e[15]=p):p=e[15];let l;e[16]!==s?(l=s("common.blockedOrgScreen.switchOrg"),e[16]=s,e[17]=l):l=e[17];let g;e[18]!==l?(g=n.jsx(M,{variant:"ghost",asChild:!0,children:n.jsx("a",{href:"/",children:l})}),e[18]=l,e[19]=g):g=e[19];let f;e[20]!==g||e[21]!==h||e[22]!==p?(f=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[h,p,g]}),e[20]=g,e[21]=h,e[22]=p,e[23]=f):f=e[23];let d;return e[24]!==f||e[25]!==m?(d=n.jsxs(le,{children:[a,m,f]}),e[24]=f,e[25]=m,e[26]=d):d=e[26],d}function So(t){const e=R.c(8);let o;e[0]!==t?(o=We.orgNotice(t??""),e[0]=t,e[1]=o):o=e[1];let r;e[2]!==t?(r=async()=>{const i=await fetch(`/api/${t}/notice`,{credentials:"include"});return i.ok?(await i.json()).notice??null:null},e[2]=t,e[3]=r):r=e[3];const s=!!t;let a;return e[4]!==o||e[5]!==r||e[6]!==s?(a={queryKey:o,queryFn:r,enabled:s,staleTime:6e4},e[4]=o,e[5]=r,e[6]=s,e[7]=a):a=e[7],qe(a)}const wo="/settings/infra-billing";function vo(t){return(t.endsWith("/")?t.slice(0,-1):t).endsWith(wo)}function jo(t){const e=R.c(7),{org:o,children:r}=t;let s;e[0]!==o.id||e[1]!==o.name?(s={id:o.id,organizationId:o.id,slug:"_org",name:o.name,ui:null},e[0]=o.id,e[1]=o.name,e[2]=s):s=e[2];const a=s;let i;return e[3]!==r||e[4]!==o||e[5]!==a?(i=n.jsx(bn,{org:o,project:a,children:r}),e[3]=r,e[4]=o,e[5]=a,e[6]=i):i=e[6],i}function ko(){const t=Ct(),e=Vn(),{org:o}=ut(),r=mn({strict:!1}),s=Dt(),{openPanel:a,closePanel:i}=In(),c=Qn(),m=Xn(),h=Zn(),w=es(),u=(f,d=!0)=>t({to:".",search:f,replace:d}),p=()=>u(f=>({...f,sidepanel:!0})),l=(f,d,S)=>{const y=!!m&&m===f;m&&!y&&go(m,{tab:s,mainpanel:r.mainpanel,sidepanel:r.sidepanel});const x=y?null:po(f),v=It(o.id).id,b=mo({prev:{virtualmcpid:c,tabId:s,mainpanel:r.mainpanel,sidepanel:r.sidepanel},virtualMcpId:d,decopilotId:v,savedLayout:x,opts:S,autosendValue:Yn});return w(f,()=>b.search,{virtualMcpId:d,view:{tabId:b.tabId}})};return{openSidePanel:p,setTaskId:l,createNewTask:async(f,d,S)=>{const y=crypto.randomUUID(),x=f??h;try{await e?.create({id:y,virtual_mcp_id:x,...d?{branch:d}:{}})}catch{}l(y,x,{...S,newThread:!0})},openTab:a,closeTab:i}}const To=new Set(["/$org/","/$org/home"]);function No(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e={select:_o},t[0]=e):e=t[0],$t(e)}function _o(t){const e=t.matches.at(-1)?.fullPath;return e!==void 0&&To.has(e)}function Po(){const t=R.c(53);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org",shouldThrow:!1},t[0]=e):e=t[0];const r=fn(e)?.params.org,[s,a]=X.useState(!1),[i,c]=Ws(),[m,h]=Hn(),w=hn(),u=No(),p=r??"";let l;t[1]!==p?(l=Jt(p),t[1]=p,t[2]=l):l=t[2];const g=!!r&&u;let f;t[3]!==l||t[4]!==g?(f={...l,enabled:g},t[3]=l,t[4]=g,t[5]=f):f=t[5],qe(f);const{data:d}=Je.useSession(),S=d?.user?.id;let y,x;t[6]!==w?(y=()=>{const L=B=>{if(vt(B)&&B.code==="KeyK"){B.preventDefault(),Js();return}if(B.key==="?"&&!Ms(B.target)){B.preventDefault(),a(!0);return}vt(B)&&B.code==="BracketLeft"&&w.history.canGoBack()&&(B.preventDefault(),w.history.back())};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},x=[w],t[6]=w,t[7]=y,t[8]=x):(y=t[7],x=t[8]),X.useEffect(y,x);let v;t[9]!==r||t[10]!==S?(v=gn(r,S),t[9]=r,t[10]=S,t[11]=v):v=t[11];const{data:b}=Nt(v),T=b?.id,j=b?.slug,{data:k}=ts(T,j),_=!!k?.ssoRequired&&!k.authenticated,{data:N}=So(j);let P;t[12]===Symbol.for("react.memo_cache_sentinel")?(P={select:Ao},t[12]=P):P=t[12];const E=$t(P),I=N?.severity==="block"&&!vo(E),O=T??"",D=j??"";let A;t[13]!==D||t[14]!==O?(A=Bn({connectionId:Ot,orgId:O,orgSlug:D}),t[13]=D,t[14]=O,t[15]=A):A=t[15];const F=!!T&&!!j;let z;if(t[16]!==A||t[17]!==F?(z={...A,enabled:F},t[16]=A,t[17]=F,t[18]=z):z=t[18],qe(z),(!b||pt(b)||_||I)&&Vs(),!b){let L;return t[19]!==r?(L=n.jsx(ms,{orgSlug:r}),t[19]=r,t[20]=L):L=t[20],L}if(pt(b)){localStorage.getItem(Ve.lastOrgSlug())===r&&localStorage.removeItem(Ve.lastOrgSlug());let L;return t[21]!==b.name?(L=n.jsx(pn,{orgName:b.name}),t[21]=b.name,t[22]=L):L=t[22],L}if(I&&N){let L;return t[23]!==b.slug||t[24]!==N?(L=n.jsx(xo,{notice:N,orgSlug:b.slug}),t[23]=b.slug,t[24]=N,t[25]=L):L=t[25],L}if(_){let L;return t[26]!==b.id||t[27]!==b.name||t[28]!==b.slug||t[29]!==k.domain?(L=n.jsx(yo,{orgId:b.id,orgSlug:b.slug,orgName:b.name,domain:k.domain}),t[26]=b.id,t[27]=b.name,t[28]=b.slug,t[29]=k.domain,t[30]=L):L=t[30],L}const K=b.logo??null;let q;t[31]!==b||t[32]!==K?(q={...b,logo:K},t[31]=b,t[32]=K,t[33]=q):q=t[33];let V;t[34]!==b?(V=n.jsx(uo,{activeOrg:b}),t[34]=b,t[35]=V):V=t[35];let $;t[36]===Symbol.for("react.memo_cache_sentinel")?($=n.jsx(yn,{}),t[36]=$):$=t[36];let W;t[37]===Symbol.for("react.memo_cache_sentinel")?(W=n.jsxs("div",{className:"fixed bottom-6 right-6 z-50 flex w-[min(360px,calc(100vw-3rem))] flex-col gap-3",children:[n.jsx(Ls,{}),n.jsx(eo,{})]}),t[37]=W):W=t[37];let Y;t[38]!==i||t[39]!==c?(Y=i&&n.jsx(Hs,{open:i,onOpenChange:c}),t[38]=i,t[39]=c,t[40]=Y):Y=t[40];let H;t[41]!==m||t[42]!==h?(H=m&&n.jsx(Un,{open:!0,onOpenChange:h,source:Gn()}),t[41]=m,t[42]=h,t[43]=H):H=t[43];let U;t[44]!==s?(U=n.jsx(Fs,{open:s,onOpenChange:a}),t[44]=s,t[45]=U):U=t[45];let ee;t[46]===Symbol.for("react.memo_cache_sentinel")?(ee=n.jsx(io,{}),t[46]=ee):ee=t[46];let Q;return t[47]!==q||t[48]!==V||t[49]!==Y||t[50]!==H||t[51]!==U?(Q=n.jsxs(jo,{org:q,children:[V,$,W,Y,H,U,ee]}),t[47]=q,t[48]=V,t[49]=Y,t[50]=H,t[51]=U,t[52]=Q):Q=t[52],Q}function Ao(t){return t.location.pathname}function Eo(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Wn,{children:n.jsx(Po,{})}),t[0]=e):e=t[0],e}const ii=Object.freeze(Object.defineProperty({__proto__:null,default:Eo,usePanelActions:ko},Symbol.toStringTag,{value:"Module"}));export{G as K,fs as L,ko as a,vt as b,js as c,oi as d,Ms as e,si as f,ii as g,zt as i,Js as o,ti as r,ni as s,So as u};
|
package/dist/client/assets/{site-draft-actions-DyZ1f4ik.js → site-draft-actions-CNazOyJI.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as M,b as xe,r as q,j as r,B as ye,l as W,K as Et,ap as Js,av as da,az as Or,U as zt,t as Oe,T as ws,V as js,X as Ps,a as Ss,a2 as ks,
|
|
1
|
+
import{c as M,b as xe,r as q,j as r,B as ye,l as W,K as Et,ap as Js,av as da,az as Or,U as zt,t as Oe,T as ws,V as js,X as Ps,a as Ss,a2 as ks,bt as Ur,h as qt,aq as zr,I as qr,a5 as Hr,o as Ns,R as ua,m as Bt,dX as Xs,F as ha,D as fa,v as ma,q as pa,Q as ba,H as ga,b0 as xa,a3 as va,aX as Ys,e as Mn,y as Kr,J as Vr}from"./index-CImJlq71.js";import{S as Gr}from"./separator-Dr93-tcp.js";import{f as Qr,u as Wt,r as ya,l as wa,c as ja,b as Wr}from"./chat-context-C_P788VD.js";import{u as Gt,a0 as Jr,c as Pa,b as Sa,a1 as Zs,a2 as ps,a3 as Fn,a4 as Xr,a5 as Yr,H as $s,a6 as Zr,a7 as $n,a8 as el,a9 as tl,aa as sl,ab as nl,ac as al,ad as rl,ae as ll,D as en,B as ka,af as il,ag as Na,z as ol,w as Ca}from"./site-editor-toast-Ckx512no.js";import{L as cl,a as dl}from"./shell-layout-Bmd6dXD4.js";import{I as Aa}from"./toolbar-icon-button-NAoOtagz.js";import{P as ul,a as hl,b as fl}from"./popover-BqGcOxqn.js";import{c as jt,T as Pt,a as St,b as Cs}from"./tooltip-BB8x2ajM.js";import{A as tn,a as sn,b as nn,c as an,g as rn,d as ln,e as on,f as cn}from"./alert-dialog-SFY1grIM.js";import{d as ml,e as pl,c as bl,C as En,a as _n,b as Ln}from"./command-9a3EU_B7.js";import{T as Ft,a as Ra,c as Ta}from"./tabs-CU2NQvm6.js";import{t as Ia}from"./ChevronUp-BJfOFayd.js";import{aH as As,H as gl,a as Ba,aI as xl,b as Da,aJ as Ma,O as vl}from"./agent-icon-Bl0Q4nDQ.js";import{i as Fa}from"./DotsVertical-MgtYn_XR.js";import{b as $a}from"./Tool01-XzMXqYKz.js";import{s as Ea}from"./Plus-Bf8vM3Sx.js";import{s as Rs}from"./Trash01-C68DqBe-.js";import{u as dn,r as Es,a as On,n as _s,g as un,b as hn}from"./use-releases-fI9YxkQH.js";import{u as yl}from"./use-members-DrsTuCTp.js";import{n as wl,d as jl,l as Un,j as Pl}from"./thread-intent-DXY7orZh.js";import{h as _a,r as La,g as Sl,f as nt,a as fn,j as Oa}from"./repository-binding-wXpkgUS5.js";import{u as kl}from"./use-debounced-value-DvzjOUVw.js";import{u as Nl}from"./use-clock-tick-D95T8222.js";import{u as Cl}from"./useInfiniteQuery-BwyrFPWF.js";import{e as Al,c as Rl,p as Tl,g as Ua,h as za,i as qa}from"./use-navigate-to-agent-DqXhqPI9.js";import{R as zn}from"./virtual-mcp-CP4uoCBU.js";import{u as Ha,c as Il,e as Bl}from"./experiments-tab-choice-DLYJ3Xgw.js";import{G as Ka}from"./repository-picker-fHOvHVjl.js";import{u as mn}from"./use-session-runtime-DfVwDDov.js";import{u as Dl,c as Ml,d as Fl,e as $l}from"./use-fast-preview-draft-url-C_TDHMYN.js";import{aG as Ot,aH as Va,A as bs,t as pn,aI as Ga,aJ as bn,$ as El,b as _l,aK as Qa,ar as Ll,aL as Ol,o as Ul,z as It,f as gn,aM as zl}from"./parse-sections-BYTdQHxf.js";import"./index-YTcaUBCs.js";import{T as ql}from"./textarea-Bp989dUN.js";import{i as xn}from"./CheckCircle-Cqp__I1R.js";import{s as gs}from"./Image01-BYSI_JTy.js";import{b as Hl}from"./format-time-Cq80KKvY.js";import{a as Kl,g as Vl}from"./UserSquare-ezkB_C7H.js";import{n as Gl,b as Ql,m as Wl}from"./named-rule-uses-DUhhItNP.js";import{S as Jl,e as Xl,a as Yl,R as Wa}from"./secret-ciphertext-DZQPZkTr.js";import{f as vn,b as Ja,r as Ts,p as Zl,c as Xa,i as yn,d as ei,e as Ya,m as ti,h as si,g as Za,j as ni,n as ai,k as ri,l as li,o as ii,q as wn,t as oi,u as er,s as tr,v as Ls}from"./sandbox-git-api-CH_-QFpD.js";import{b as ci,g as di}from"./utils-Dc05pOUY.js";import{i as ui}from"./Monitor01-th-leB7u.js";import{w as jn,g as hi,D as fi}from"./section-preview-url-7zfngvgW.js";import{w as Pn}from"./device-hint-SeLRi17j.js";import{w as qn}from"./editor-swke_0an.js";import{u as sr}from"./use-content-sync-3FE60C_P.js";import{p as mi,H as pi,h as bi,k as gi,n as xi,r as vi,a as yi,u as wi}from"./releases-api-CK0jSLYO.js";import{s as nr}from"./save-changes-debug-nBi-n9eV.js";import{u as ji}from"./use-mcp-client-BT3MLYTJ.js";import{u as Pi}from"./use-sandbox-events-CioMqxnO.js";import{b as Si,a as ki}from"./sandbox-lifecycle-context-CsnW_1kh.js";import{b as Ni}from"./thread-route-B1rrIJuw.js";const Hn=/[\r\n<>]/,Ci=/^[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+$/;function Is(t){const e=t?.userName?.trim();if(!e||Hn.test(e))return null;const s=t?.userEmail?.trim();return!s||Hn.test(s)?{userName:e}:Ci.test(s)?{userName:e,userEmail:s}:{userName:e}}function Ai(t){return t.split(`
|
|
2
2
|
`).filter(e=>!/^Co-authored-by:\s/i.test(e)).join(`
|
|
3
3
|
`).trimEnd()}function Ri(t){const e=t.userName.trim(),s=t.userEmail?.trim();return s?`Co-authored-by: ${e} <${s}>`:`Co-authored-by: ${e}`}function ar(t,e){const s=Is(e);if(!s)return t;const a=Ai(t),n=Ri(s);if(a.includes(n))return a;const o=a.trimEnd();return o.length>0?`${o}
|
|
4
4
|
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/agent-site-editor-Dn7we51s.js","assets/index-CImJlq71.js","assets/index-MPdUOMBb.css","assets/chat-context-C_P788VD.js","assets/use-panel-navigate-D57HPY2x.js","assets/thread-route-B1rrIJuw.js","assets/use-project-scope-CnnlA-du.js","assets/repository-binding-wXpkgUS5.js","assets/use-mcp-client-BT3MLYTJ.js","assets/auth-k-50r1Jm.js","assets/autosend-BUGExBM4.js","assets/thread-intent-DXY7orZh.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-HKRMih-U.js","assets/task-board-CRvOV9zQ.js","assets/schema-BXcU44Bp.js","assets/slugify-CEUa2lfQ.js","assets/use-decopilot-events-DvJkZDam.js","assets/use-ai-providers-Cng_Zcqq.js","assets/location-V0VwTJTt.js","assets/use-organization-settings-DKJZVR_x.js","assets/site-draft-actions-CNazOyJI.js","assets/separator-Dr93-tcp.js","assets/site-editor-toast-Ckx512no.js","assets/use-session-runtime-DfVwDDov.js","assets/experiments-tab-choice-DLYJ3Xgw.js","assets/sandbox-url-D3mC8qhT.js","assets/utils-Dc05pOUY.js","assets/ZoomOut-CTwXyALk.js","assets/Image01-BYSI_JTy.js","assets/use-sandbox-events-CioMqxnO.js","assets/sandbox-git-api-CH_-QFpD.js","assets/shell-layout-Bmd6dXD4.js","assets/avatar-DZp2nksb.js","assets/User01-BKJMa06q.js","assets/Building02-DBmpU4M6.js","assets/UserSquare-ezkB_C7H.js","assets/agent-icon-Bl0Q4nDQ.js","assets/AlertCircle-DbgHFTtO.js","assets/Tool01-XzMXqYKz.js","assets/ArrowUp-CgN1Qhsf.js","assets/ArrowLeft-B24gv2xe.js","assets/LinkBroken01-D8vKURBw.js","assets/ShoppingBag01-Bkku1Te9.js","assets/CheckCircle-Cqp__I1R.js","assets/ChevronUp-BJfOFayd.js","assets/ChevronSelectorVertical-Bg2KdIAv.js","assets/Copy01-C8oI3ru2.js","assets/CreditCard01-DBg0t5KK.js","assets/DotsVertical-MgtYn_XR.js","assets/Globe04-8XNa-DGn.js","assets/SwitchHorizontal01-DsxrRdFb.js","assets/Key01-CVBy3Esl.js","assets/Link01-1YHKCfLl.js","assets/Minus-D7Nn8Jj1.js","assets/Monitor01-th-leB7u.js","assets/Sun-C_rfv84K.js","assets/Play-B3knqxcb.js","assets/Plus-Bf8vM3Sx.js","assets/SearchMd-C1vd4NNy.js","assets/Trash01-C68DqBe-.js","assets/Upload01-D4h8lLWj.js","assets/Users01-sQ3Jopve.js","assets/XClose-5-Y_ZVDY.js","assets/use-clock-tick-D95T8222.js","assets/command-9a3EU_B7.js","assets/index-UjSXE0Iy.js","assets/integration-icon-B9snkXuC.js","assets/project-icon-B-MVviOF.js","assets/new-project-dialog-CEUx8Wuz.js","assets/label-CfvfFl3x.js","assets/repository-import-picker-DWw4DnKc.js","assets/use-navigate-to-agent-DqXhqPI9.js","assets/repository-picker-fHOvHVjl.js","assets/tooltip-BB8x2ajM.js","assets/index-DQ2PXCBR.js","assets/useInfiniteQuery-BwyrFPWF.js","assets/infiniteQueryObserver-BPnYbZuQ.js","assets/collection-search-BfeTverb.js","assets/use-debounced-value-DvzjOUVw.js","assets/required-auth-layout-p9wTtbkA.js","assets/use-org-sso-B4zmaZVL.js","assets/shell-layout-CE2Eihra.css","assets/toolbar-icon-button-NAoOtagz.js","assets/popover-BqGcOxqn.js","assets/alert-dialog-SFY1grIM.js","assets/tabs-CU2NQvm6.js","assets/active-indicator-CCMhAsc_.js","assets/use-releases-fI9YxkQH.js","assets/serial-task-queue-CGOeQgpr.js","assets/use-members-DrsTuCTp.js","assets/use-org-auth-client-BVmUiQl1.js","assets/virtual-mcp-CP4uoCBU.js","assets/url-slug-Ck137SN4.js","assets/use-fast-preview-draft-url-C_TDHMYN.js","assets/section-preview-url-7zfngvgW.js","assets/preview-link-C762yHOt.js","assets/variant-draft-pointer-BeAKcq_c.js","assets/parse-sections-BYTdQHxf.js","assets/index-YTcaUBCs.js","assets/tool-namespace-ln4cIuCt.js","assets/drawer-BTNZfEU6.js","assets/use-mobile-Nz4my9ZZ.js","assets/use-mcp-prompts-DvHpjECx.js","assets/usage-stats-DpZZQ75-.js","assets/form-CWlPjOiE.js","assets/utils-CVEq3hMx.js","assets/markdown-BDnIqP7U.js","assets/use-copy-CvMH5zdo.js","assets/format-time-Cq80KKvY.js","assets/differenceInSeconds-C3x8sHUj.js","assets/input-BHFkZ3T9.js","assets/icon-button-BjI92SlL.js","assets/file-type-icon-BlPndn8R.js","assets/chat-draft-Cd62GOk3.js","assets/select-CO-KeEXe.js","assets/index-BdQq_4o_.js","assets/use-deco-credits-D1dKlqXc.js","assets/toggle-group-K25Bl_Tm.js","assets/use-open-billing-url-BPZ_x4uz.js","assets/index-BT89s1_n.js","assets/checkbox-D_LpTCuo.js","assets/ai-providers-logos-DD3qZ33J.js","assets/input-Cs9OOIz-.js","assets/suggestion-CaGvyBH6.js","assets/use-org-fs-qBxAqXun.js","assets/question-004-sINsf4GQ.js","assets/feature-paywall-DbYyln6a.js","assets/plan-ladder-Chib98li.js","assets/add-connection-dialog-CzGzxkZf.js","assets/extract-connection-data-BcSeYo2b.js","assets/metadata-D72DunRR.js","assets/connection-DA0DdtmE.js","assets/connection-card-D6khbIvi.js","assets/connection-slug-CITJ0kGN.js","assets/textarea-Bp989dUN.js","assets/use-connection-CAJy9ePc.js","assets/schema-BjLtWzT5.js","assets/connection-form-helpers-CD1Glq-b.js","assets/authenticate-and-persist-oauth-Citp3_ku.js","assets/mcp-oauth-Bf1ymd_L.js","assets/mcp-oauth-De4zWGdY.js","assets/collection-tabs-BCwnkCTo.js","assets/badge-B8Ivcb6S.js","assets/use-infinite-scroll-CwPqy0HC.js","assets/useSuspenseInfiniteQuery-DJXxpWPx.js","assets/use-task-board-events-BH7aE_i8.js","assets/use-chat-layout-state-CNkklJiF.js","assets/input-Bwd_JSM8.css","assets/pair-CNR7-_qK.js","assets/collapsible-BHKr0Yuy.js","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-vmvnP_G4.js","assets/types-D4eFbg3n.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/sheet-DYqe447t.js","assets/use-thread-outputs-D8VLF1dw.js","assets/named-rule-uses-DUhhItNP.js","assets/secret-ciphertext-DZQPZkTr.js","assets/alert-fsJICKf8.js","assets/device-hint-SeLRi17j.js","assets/editor-swke_0an.js","assets/use-content-sync-3FE60C_P.js","assets/releases-api-CK0jSLYO.js","assets/save-changes-debug-nBi-n9eV.js","assets/sandbox-lifecycle-context-CsnW_1kh.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/index-DYNe4TdA.js","assets/use-sidebar-collapsed-D3qR_zRH.js","assets/resizable-CykEr2xO.js","assets/agent-site-editor-DDGTF8rc.css","assets/agent-site-editor-content-KSRD36m4.js","assets/agent-view-guard-B0aDsWRb.js","assets/use-main-panel-tabs-Cp-duvYv.js","assets/use-mcp-tools-DY3R7rf0.js","assets/resolve-tab-icon-dNyXGxcc.js","assets/use-task-metadata-xGzNCL2M.js","assets/preview-source-BsRLGWUP.js","assets/use-project-native-view-presence-C3HlYZwC.js","assets/match-site-slug-config-D3fUJ6vX.js","assets/use-file-configs-Bf0fhL21.js","assets/site-slug-DebpOoQq.js","assets/feature-gate-DnDfxxPc.js","assets/content-tab-DsX079ZZ.js","assets/blocks-tab-states-Ch0bvZWI.js","assets/slider-Dm9m4Zom.js","assets/index-YbD_X2Sg.js","assets/tooltipContext-DG-hvJrr.js","assets/CategoricalChart-Do09x_e5.js","assets/index-BzTLQsHh.js","assets/ActiveShapeUtils-Docp8wLu.js","assets/Sector-CjducGVR.js","assets/symbol-ZVON6uKU.js","assets/empty-state-CkRk6emt.js","assets/runnable-block-editor-CvNZGRDu.js","assets/switch-DGiOaGRn.js","assets/scroll-area-BZP0xkZ2.js","assets/monaco-editor-FMQP-sIq.js","assets/calendar-BDnGPQeR.js","assets/editor-classes-DQrtem9w.js","assets/core.esm-KXf7B9P5.js","assets/sortable.esm-PpUBUYvN.js","assets/combobox-Br3ekqoF.js","assets/search-input-CLbrLBK4.js","assets/asset-utils-DJKQ3jqO.js","assets/mustache-wrPcgRSJ.js","assets/date-utils-CrvIKg-s.js","assets/use-move-blocks-Ck3YCWT9.js","assets/empty-state-DjnYxJoJ.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{k as O,l as N,m as V}from"./named-rule-view-DuazhL5D.js";import{h as H}from"./named-rule-uses-DUhhItNP.js";import{aN as A,a_ as L}from"./parse-sections-BYTdQHxf.js";import{aZ as y,c as R,b as T,a2 as U,j as c,n as _}from"./index-CImJlq71.js";import{E as B}from"./empty-state-DjnYxJoJ.js";import{u as K}from"./chat-context-C_P788VD.js";import{u as M,l as $}from"./site-editor-toast-Ckx512no.js";import{i as q,u as Q,S as G}from"./blocks-tab-states-Ch0bvZWI.js";import{a as Z}from"./use-panel-navigate-D57HPY2x.js";const P={running:0,everyone:1,off:2};function ae(s,e){const i=A(s,"experiments");if(i.kind==="conflict")return[];const o=e?.published??null;return Object.entries(i.values).map(([n,l],a)=>{const m=O(o,"experiments",n,l),x=m==="changed"?N(o,"experiments",n):void 0;return{order:a,row:{name:n,share:l,status:L(l),uses:e?H(e,"experiments",n):0,entryState:m,...x!==void 0?{publishedShare:x}:{}}}}).sort((n,l)=>P[n.row.status]-P[l.row.status]||n.order-l.order).map(n=>n.row)}function ce(s,e){return V(s,e?.published??null,"experiments")}function de(s){const e={contentPageVariant:s.focus?.pageVariant,contentSection:s.focus?.section,contentVariant:s.focus?.variant};return s.blockKind==="page"?{contentPageId:s.blockKey,contentCollection:void 0,contentItem:void 0,...e}:{contentPageId:void 0,contentCollection:"sections",contentItem:s.blockKey,...e}}let F=null;function z(){return F??=Promise.all([y(()=>import("./agent-site-editor-Dn7we51s.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171])),y(()=>import("./agent-site-editor-content-KSRD36m4.js"),__vite__mapDeps([172,1,2,173,174,148,5,4,6,7,8,9,11,12,13,14,15,16,17,38,39,40,41,42,43,44,29,36,45,46,47,37,48,49,50,30,51,52,53,54,55,56,57,58,59,60,61,62,35,63,64,137,175,154,107,26,100,3,10,18,19,20,21,101,75,76,102,79,103,104,105,106,71,108,109,110,111,112,113,114,33,34,65,66,67,68,69,70,72,73,74,77,78,80,81,82,83,115,25,116,117,87,88,118,119,120,121,122,123,85,124,125,126,127,91,92,128,129,130,131,132,133,94,134,135,136,138,139,140,141,142,143,144,145,146,147,149,150,151,152,153,155,156,157,31,27,176,177,178,179,180,181,182,93,183,184,185,186,187,188,189,190,191,192,193,99,24,28,32,194,195,167,159,160,196,197,198,162,199,200,201,202,203,86,204,205,206,163,166,207,208,209]))]).catch(s=>{throw F=null,s}),F}function J(s){return e=>{if(!e)return;const i=()=>{s().catch(()=>{})};if(typeof requestIdleCallback=="function"){const t=requestIdleCallback(i,{timeout:2e3});return()=>cancelIdleCallback(t)}const o=setTimeout(i,200);return()=>clearTimeout(o)}}const W=J(z);function I(s){const e=R.c(7),{icon:i,title:o,description:t,action:n}=s;let l;e[0]!==n?(l=n?{children:n.label,onClick:n.onClick}:void 0,e[0]=n,e[1]=l):l=e[1];let a;return e[2]!==t||e[3]!==i||e[4]!==l||e[5]!==o?(a=c.jsx(_,{children:c.jsx(_.Content,{children:c.jsx(_.Container,{children:c.jsx(B,{icon:i,title:o,description:t,buttonProps:l})})})}),e[2]=t,e[3]=i,e[4]=l,e[5]=o,e[6]=a):a=e[6],a}function ue(s){const e=R.c(28),{virtualMcpId:i,icon:o,copy:t,skeleton:n,children:l}=s,a=T(),{org:m}=U(),x=K(),p=x?.currentBranch??null,g=M(i,p),{openPanel:k}=Z();if(!p){const r=t.noDraftTitle,v=t.noDraftDesc;let d;e[0]!==a?(d=a("sectionsEditor.namedRules.openEditor"),e[0]=a,e[1]=d):d=e[1];let u;e[2]!==k?(u=()=>k("content"),e[2]=k,e[3]=u):u=e[3];let f;e[4]!==d||e[5]!==u?(f={label:d,onClick:u},e[4]=d,e[5]=u,e[6]=f):f=e[6];let b;return e[7]!==t.noDraftDesc||e[8]!==t.noDraftTitle||e[9]!==o||e[10]!==f?(b=c.jsx(I,{icon:o,title:r,description:v,action:f}),e[7]=t.noDraftDesc,e[8]=t.noDraftTitle,e[9]=o,e[10]=f,e[11]=b):b=e[11],b}if(q(g)){let r;return e[12]===Symbol.for("react.memo_cache_sentinel")?(r=c.jsx(G,{}),e[12]=r):r=e[12],r}if(g.kind==="pending"){let r;return e[13]!==n?(r=c.jsx(c.Fragment,{children:n}),e[13]=n,e[14]=r):r=e[14],r}if(g.kind!=="protocol"){let r;return e[15]!==t.loadFailed||e[16]!==t.loadFailedHint||e[17]!==o?(r=c.jsx(I,{icon:o,title:t.loadFailed,description:t.loadFailedHint}),e[15]=t.loadFailed,e[16]=t.loadFailedHint,e[17]=o,e[18]=r):r=e[18],r}const S=x?.taskId??null;let h;return e[19]!==p||e[20]!==l||e[21]!==t||e[22]!==o||e[23]!==m.slug||e[24]!==n||e[25]!==S||e[26]!==i?(h=c.jsx(X,{orgSlug:m.slug,virtualMcpId:i,branch:p,threadId:S,icon:o,copy:t,skeleton:n,children:l},p),e[19]=p,e[20]=l,e[21]=t,e[22]=o,e[23]=m.slug,e[24]=n,e[25]=S,e[26]=i,e[27]=h):h=e[27],h}function X(s){const e=R.c(30),{orgSlug:i,virtualMcpId:o,branch:t,threadId:n,icon:l,copy:a,skeleton:m,children:x}=s,p=T();let g;e[0]!==t||e[1]!==i||e[2]!==n||e[3]!==o?(g={orgSlug:i,virtualMcpId:o,branch:t,threadId:n,previewUrl:null},e[0]=t,e[1]=i,e[2]=n,e[3]=o,e[4]=g):g=e[4];const k=g,S=$(k),h=Q(k),r=S.data,v=h.data;if(!r||!v){if(S.isError||h.isError){const b=a.loadFailed,w=a.loadFailedHint;let E;e[5]!==p?(E=p("sectionsEditor.namedRules.tryAgain"),e[5]=p,e[6]=E):E=e[6];let C;e[7]!==S||e[8]!==h?(C=()=>{S.refetch(),h.refetch()},e[7]=S,e[8]=h,e[9]=C):C=e[9];let D;e[10]!==E||e[11]!==C?(D={label:E,onClick:C},e[10]=E,e[11]=C,e[12]=D):D=e[12];let j;return e[13]!==a.loadFailed||e[14]!==a.loadFailedHint||e[15]!==l||e[16]!==D?(j=c.jsx(I,{icon:l,title:b,description:w,action:D}),e[13]=a.loadFailed,e[14]=a.loadFailedHint,e[15]=l,e[16]=D,e[17]=j):j=e[17],j}let f;return e[18]!==m?(f=c.jsx(c.Fragment,{children:m}),e[18]=m,e[19]=f):f=e[19],f}let d;e[20]!==t||e[21]!==x||e[22]!==r||e[23]!==v||e[24]!==i||e[25]!==n||e[26]!==o?(d=x({orgSlug:i,virtualMcpId:o,branch:t,threadId:n,decofile:r,meta:v}),e[20]=t,e[21]=x,e[22]=r,e[23]=v,e[24]=i,e[25]=n,e[26]=o,e[27]=d):d=e[27];let u;return e[28]!==d?(u=c.jsx("div",{className:"contents",ref:W,children:d}),e[28]=d,e[29]=u):u=e[29],u}export{ue as S,I as a,de as c,ae as e,ce as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as u,r as g,j as n,F,Z as G,_ as H,a as E,k as P,b as O,n as y,L as M}from"./index-CImJlq71.js";import{C as V}from"./chat-context-C_P788VD.js";import{C as x}from"./index-DYNe4TdA.js";import{L}from"./index-D8VCkLtE.js";import{B as K}from"./blocks-preview-workspace-context-guMABPcp.js";import{e as T,p as W,s as J,a as U,r as z,T as $,u as R,b as Z}from"./site-editor-toast-Ckx512no.js";import{u as q,L as B,P as Q,S as X}from"./preview-tab-CBRKeC1b.js";import{C as Y}from"./content-tab-DsX079ZZ.js";import{T as tt}from"./tab-icon-glyph-DLj4dmeB.js";import{r as ot}from"./resolve-tab-icon-dNyXGxcc.js";import et from"./agent-site-editor-Dn7we51s.js";import"./use-panel-navigate-D57HPY2x.js";import"./thread-route-B1rrIJuw.js";import"./use-project-scope-CnnlA-du.js";import"./repository-binding-wXpkgUS5.js";import"./use-mcp-client-BT3MLYTJ.js";import"./auth-k-50r1Jm.js";import"./autosend-BUGExBM4.js";import"./thread-intent-DXY7orZh.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-HKRMih-U.js";import"./task-board-CRvOV9zQ.js";import"./schema-BXcU44Bp.js";import"./slugify-CEUa2lfQ.js";import"./use-decopilot-events-DvJkZDam.js";import"./use-ai-providers-Cng_Zcqq.js";import"./location-V0VwTJTt.js";import"./use-organization-settings-DKJZVR_x.js";import"./use-mobile-Nz4my9ZZ.js";import"./use-sidebar-collapsed-D3qR_zRH.js";import"./use-chat-layout-state-CNkklJiF.js";import"./agent-icon-Bl0Q4nDQ.js";import"./AlertCircle-DbgHFTtO.js";import"./Tool01-XzMXqYKz.js";import"./ArrowUp-CgN1Qhsf.js";import"./ArrowLeft-B24gv2xe.js";import"./LinkBroken01-D8vKURBw.js";import"./ShoppingBag01-Bkku1Te9.js";import"./ZoomOut-CTwXyALk.js";import"./Building02-DBmpU4M6.js";import"./CheckCircle-Cqp__I1R.js";import"./ChevronUp-BJfOFayd.js";import"./ChevronSelectorVertical-Bg2KdIAv.js";import"./UserSquare-ezkB_C7H.js";import"./Copy01-C8oI3ru2.js";import"./CreditCard01-DBg0t5KK.js";import"./DotsVertical-MgtYn_XR.js";import"./Image01-BYSI_JTy.js";import"./Globe04-8XNa-DGn.js";import"./SwitchHorizontal01-DsxrRdFb.js";import"./Key01-CVBy3Esl.js";import"./Link01-1YHKCfLl.js";import"./Minus-D7Nn8Jj1.js";import"./Monitor01-th-leB7u.js";import"./Sun-C_rfv84K.js";import"./Play-B3knqxcb.js";import"./Plus-Bf8vM3Sx.js";import"./SearchMd-C1vd4NNy.js";import"./Trash01-C68DqBe-.js";import"./Upload01-D4h8lLWj.js";import"./User01-BKJMa06q.js";import"./Users01-sQ3Jopve.js";import"./XClose-5-Y_ZVDY.js";import"./tooltip-BB8x2ajM.js";import"./index-DQ2PXCBR.js";import"./toolbar-icon-button-NAoOtagz.js";import"./shell-layout-Bmd6dXD4.js";import"./avatar-DZp2nksb.js";import"./use-clock-tick-D95T8222.js";import"./command-9a3EU_B7.js";import"./index-UjSXE0Iy.js";import"./integration-icon-B9snkXuC.js";import"./project-icon-B-MVviOF.js";import"./new-project-dialog-CEUx8Wuz.js";import"./label-CfvfFl3x.js";import"./repository-import-picker-DWw4DnKc.js";import"./use-navigate-to-agent-DqXhqPI9.js";import"./repository-picker-fHOvHVjl.js";import"./useInfiniteQuery-BwyrFPWF.js";import"./infiniteQueryObserver-BPnYbZuQ.js";import"./collection-search-BfeTverb.js";import"./use-debounced-value-DvzjOUVw.js";import"./required-auth-layout-p9wTtbkA.js";import"./use-org-sso-B4zmaZVL.js";import"./sheet-DYqe447t.js";import"./resizable-CykEr2xO.js";import"./core.esm-KXf7B9P5.js";import"./sortable.esm-PpUBUYvN.js";import"./context-menu-CQmIAsNX.js";import"./create-organization-dialog-CU3HQ3J9.js";import"./alert-dialog-SFY1grIM.js";import"./form-CWlPjOiE.js";import"./project-apps-D7YctFcN.js";import"./use-recent-apps-CeorMBvV.js";import"./use-session-runtime-DfVwDDov.js";import"./experiments-tab-choice-DLYJ3Xgw.js";import"./sandbox-url-D3mC8qhT.js";import"./utils-Dc05pOUY.js";import"./use-sandbox-events-CioMqxnO.js";import"./sandbox-git-api-CH_-QFpD.js";import"./runnable-block-editor-CvNZGRDu.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-CNR7-_qK.js";import"./format-time-Cq80KKvY.js";import"./differenceInSeconds-C3x8sHUj.js";import"./collapsible-BHKr0Yuy.js";import"./use-copy-CvMH5zdo.js";import"./usage-stats-DpZZQ75-.js";import"./tool-namespace-ln4cIuCt.js";import"./utils-CVEq3hMx.js";import"./markdown-BDnIqP7U.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-vmvnP_G4.js";import"./types-D4eFbg3n.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./use-connection-CAJy9ePc.js";import"./use-mcp-prompts-DvHpjECx.js";import"./use-thread-outputs-D8VLF1dw.js";import"./file-type-icon-BlPndn8R.js";import"./secret-ciphertext-DZQPZkTr.js";import"./alert-fsJICKf8.js";import"./parse-sections-BYTdQHxf.js";import"./switch-DGiOaGRn.js";import"./textarea-Bp989dUN.js";import"./popover-BqGcOxqn.js";import"./blocks-tab-states-Ch0bvZWI.js";import"./slider-Dm9m4Zom.js";import"./index-YbD_X2Sg.js";import"./index-BdQq_4o_.js";import"./tooltipContext-DG-hvJrr.js";import"./CategoricalChart-Do09x_e5.js";import"./index-BzTLQsHh.js";import"./ActiveShapeUtils-Docp8wLu.js";import"./Sector-CjducGVR.js";import"./symbol-ZVON6uKU.js";import"./empty-state-CkRk6emt.js";import"./scroll-area-BZP0xkZ2.js";import"./monaco-editor-FMQP-sIq.js";import"./editor-swke_0an.js";import"./calendar-BDnGPQeR.js";import"./select-CO-KeEXe.js";import"./editor-classes-DQrtem9w.js";import"./toggle-group-K25Bl_Tm.js";import"./active-indicator-CCMhAsc_.js";import"./combobox-Br3ekqoF.js";import"./search-input-CLbrLBK4.js";import"./tabs-CU2NQvm6.js";import"./use-file-configs-Bf0fhL21.js";import"./asset-utils-DJKQ3jqO.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./sandbox-lifecycle-context-CsnW_1kh.js";import"./variant-matcher-override-f1vt09fC.js";import"./variant-draft-pointer-BeAKcq_c.js";import"./section-preview-url-7zfngvgW.js";import"./use-fast-preview-draft-url-C_TDHMYN.js";import"./preview-link-C762yHOt.js";import"./useQueries-1QlJ0aQr.js";import"./device-hint-SeLRi17j.js";import"./virtual-mcp-CP4uoCBU.js";import"./url-slug-Ck137SN4.js";import"./preview-source-BsRLGWUP.js";import"./use-task-metadata-xGzNCL2M.js";import"./mustache-wrPcgRSJ.js";import"./use-content-sync-3FE60C_P.js";import"./checkbox-D_LpTCuo.js";import"./date-utils-CrvIKg-s.js";import"./use-move-blocks-Ck3YCWT9.js";import"./badge-B8Ivcb6S.js";import"./empty-state-DjnYxJoJ.js";import"./site-draft-actions-CNazOyJI.js";import"./separator-Dr93-tcp.js";import"./use-releases-fI9YxkQH.js";import"./serial-task-queue-CGOeQgpr.js";import"./use-members-DrsTuCTp.js";import"./use-org-auth-client-BVmUiQl1.js";import"./index-YTcaUBCs.js";import"./drawer-BTNZfEU6.js";import"./input-BHFkZ3T9.js";import"./icon-button-BjI92SlL.js";import"./chat-draft-Cd62GOk3.js";import"./use-deco-credits-D1dKlqXc.js";import"./use-open-billing-url-BPZ_x4uz.js";import"./index-BT89s1_n.js";import"./ai-providers-logos-DD3qZ33J.js";import"./input-Cs9OOIz-.js";import"./suggestion-CaGvyBH6.js";import"./use-org-fs-qBxAqXun.js";import"./question-004-sINsf4GQ.js";import"./feature-paywall-DbYyln6a.js";import"./plan-ladder-Chib98li.js";import"./add-connection-dialog-CzGzxkZf.js";import"./extract-connection-data-BcSeYo2b.js";import"./metadata-D72DunRR.js";import"./connection-DA0DdtmE.js";import"./connection-card-D6khbIvi.js";import"./connection-slug-CITJ0kGN.js";import"./schema-BjLtWzT5.js";import"./connection-form-helpers-CD1Glq-b.js";import"./authenticate-and-persist-oauth-Citp3_ku.js";import"./mcp-oauth-Bf1ymd_L.js";import"./mcp-oauth-De4zWGdY.js";import"./collection-tabs-BCwnkCTo.js";import"./use-infinite-scroll-CwPqy0HC.js";import"./useSuspenseInfiniteQuery-DJXxpWPx.js";import"./use-task-board-events-BH7aE_i8.js";import"./named-rule-uses-DUhhItNP.js";import"./releases-api-CK0jSLYO.js";import"./save-changes-debug-nBi-n9eV.js";function I(o){return o.kind==="unavailable"&&o.source==="local"&&(o.problem?.reason??"not-answering")==="not-answering"}const it=o=>o;function rt(o){const t=u.c(10),{candidates:e,invalidLink:c,shell:m,editor:i}=o,r=c===void 0?!1:c,s=m===void 0?it:m,[p,l]=g.useState(null);if(p){let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>l(null),t[0]=f):f=t[0];let h;return t[1]!==p||t[2]!==i?(h=i(p,f),t[1]=p,t[2]=i,t[3]=h):h=t[3],h}let a;t[4]!==e||t[5]!==r?(a=n.jsx(nt,{candidates:e,invalidLink:r,onConnect:l}),t[4]=e,t[5]=r,t[6]=a):a=t[6];let d;return t[7]!==s||t[8]!==a?(d=s(a),t[7]=s,t[8]=a,t[9]=d):d=t[9],d}function nt(o){const t=u.c(17),{candidates:e,invalidLink:c,onConnect:m}=o,i=c===void 0?!1:c,[r]=F(),{language:s}=r;let p;t[0]!==m?(p=D=>m({endpoint:D}),t[0]=m,t[1]=p):p=t[1];let l;t[2]!==e||t[3]!==p?(l={candidates:e,onFound:p},t[2]=e,t[3]=p,t[4]=l):l=t[4];const a=q(l),{state:d,access:f,needsGesture:h}=a;let k;t[5]!==e||t[6]!==s?(k=new Intl.ListFormat(s,{style:"long",type:"conjunction"}).format(e.map(T)),t[5]=e,t[6]=s,t[7]=k):k=t[7];const C=k;let j;t[8]!==f||t[9]!==a.start||t[10]!==h||t[11]!==d?(j=f==="denied"?{kind:"denied"}:h?{kind:"needs-gesture",onStart:a.start}:d.problem?{kind:"problem",problem:d.problem,host:T(d.problem.endpoint)}:{kind:"looking",paused:d.status==="paused"},t[8]=f,t[9]=a.start,t[10]=h,t[11]=d,t[12]=j):j=t[12];const _=j;let S;return t[13]!==C||t[14]!==i||t[15]!==_?(S=n.jsx(B,{wait:_,hosts:C,invalidLink:i}),t[13]=C,t[14]=i,t[15]=_,t[16]=S):S=t[16],S}const v="deco-serve",w="working-tree",st={id:"",slug:"",name:"",logo:null},mt={id:v,slug:v},pt={virtualMcpId:v,taskId:null,openTask:()=>{},createTask:()=>"",createTaskWithMessage:()=>{},activeTask:null,isThreadLocked:!1,lockedHarness:null,lockedBranch:null,currentBranch:w,setCurrentTaskBranch:()=>{}};function at(){const o=window.location.hash,t=new URLSearchParams(o.replace(/^#/,"")).has("endpoint"),e=t?W(o):null;return t&&window.history.replaceState(null,"",window.location.pathname+window.location.search),e&&J(e),{candidates:U(e,z()),invalidLink:t&&!e}}const ct=[{id:"site-editor",to:"/site-editor",label:"preview"},{id:"content",to:"/site-editor/content",label:"content"}];function lt(){const o=u.c(6),t=O();let e;o[0]===Symbol.for("react.memo_cache_sentinel")?(e={select:dt},o[0]=e):e=o[0];const c=P(e);let m;o[1]!==t||o[2]!==c?(m=ct.map(r=>n.jsx(y.Tab,{asChild:!0,active:c==="content"==(r.id==="content"),children:n.jsxs(M,{to:r.to,activeOptions:{exact:!0},children:[n.jsx("span",{"aria-hidden":"true",className:"flex size-4 shrink-0 items-center justify-center",children:n.jsx(tt,{icon:ot({tabId:r.id,kind:"system",connections:[]})})}),t(`common.mainPanelTabs.${r.label}`)]})},r.id)),o[1]=t,o[2]=c,o[3]=m):m=o[3];let i;return o[4]!==m?(i=n.jsx(y.Tabs,{children:m}),o[4]=m,o[5]=i):i=o[5],i}function dt(o){return o.matches.at(-1)?.staticData.siteEditorView}function N(o){const t=u.c(14),{children:e}=o,c=O(),{connection:m}=Z(v),i=R(v,w);let r,s;if(t[0]!==i||t[1]!==e||t[2]!==m||t[3]!==c){s=Symbol.for("react.early_return_sentinel");t:{if(r=m?T(m.endpoint):"",i.kind==="protocol"){s=e;break t}if(i.kind!=="unavailable"||I(i)){s=n.jsx(X,{headingLevel:2,waiting:!0,title:c("decoServe.connect.reaching",{host:r})});break t}}t[0]=i,t[1]=e,t[2]=m,t[3]=c,t[4]=r,t[5]=s}else r=t[4],s=t[5];if(s!==Symbol.for("react.early_return_sentinel"))return s;let p;t[6]!==i.problem?(p=i.problem??{reason:"not-answering"},t[6]=i.problem,t[7]=p):p=t[7];let l;t[8]!==r||t[9]!==p?(l={kind:"problem",problem:p,host:r},t[8]=r,t[9]=p,t[10]=l):l=t[10];let a;return t[11]!==r||t[12]!==l?(a=n.jsx(B,{wait:l,hosts:r}),t[11]=r,t[12]=l,t[13]=a):a=t[13],a}function ut(o){const t=u.c(6),{onLost:e}=o,c=R(v,w);let m;t[0]!==c?(m=I(c),t[0]=c,t[1]=m):m=t[1];const i=m;let r,s;return t[2]!==i||t[3]!==e?(r=()=>{i&&e()},s=[i,e],t[2]=i,t[3]=e,t[4]=r,t[5]=s):(r=t[4],s=t[5]),g.useEffect(r,s),null}const A={threadOpen:!1,contentOpen:!0,threadVisibilityExplicit:!1,toggleThread:()=>{},toggleContent:()=>{}};function ft(){const o=u.c(11),{data:t}=E.useSession();let e;o[0]===Symbol.for("react.memo_cache_sentinel")?(e={select:ht},o[0]=e):e=o[0];const c=P(e),m=!!t?.user;let i;o[1]!==m?(i={rail:m},o[1]=m,o[2]=i):i=o[2];const r=c??"preview";let s,p,l;o[3]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(lt,{}),p=n.jsx(x.Thread,{children:null}),l=n.jsx(et,{}),o[3]=s,o[4]=p,o[5]=l):(s=o[3],p=o[4],l=o[5]);let a;o[6]!==r?(a=n.jsx(L.Content,{children:n.jsxs(x,{...A,threadless:!0,contentKey:r,contentNavigation:s,children:[p,l]})}),o[6]=r,o[7]=a):a=o[7];let d;return o[8]!==i||o[9]!==a?(d=n.jsx(L,{outsideOrg:i,children:a}),o[8]=i,o[9]=a,o[10]=d):d=o[10],d}function ht(o){return o.matches.at(-1)?.staticData.siteEditorView}function vt(o){const t=u.c(8),{children:e}=o,{data:c}=E.useSession(),m=!!c?.user;let i;t[0]!==m?(i={rail:m},t[0]=m,t[1]=i):i=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(x.Thread,{children:null}),t[2]=r):r=t[2];let s;t[3]!==e?(s=n.jsx(L.Content,{children:n.jsxs(x,{...A,threadless:!0,contentKey:"guide",children:[r,n.jsx(x.Content,{children:e})]})}),t[3]=e,t[4]=s):s=t[4];let p;return t[5]!==i||t[6]!==s?(p=n.jsx(L,{outsideOrg:i,children:s}),t[5]=i,t[6]=s,t[7]=p):p=t[7],p}const b=()=>{},xt={connection:null,set:b,clear:b};function fr(){const o=u.c(3),[t]=g.useState(at);let e;return o[0]!==t.candidates||o[1]!==t.invalidLink?(e=n.jsx(G,{value:!0,children:n.jsx(H,{org:st,project:mt,children:n.jsx(rt,{candidates:t.candidates,invalidLink:t.invalidLink,shell:jt,editor:kt})})}),o[0]=t.candidates,o[1]=t.invalidLink,o[2]=e):e=o[2],e}function kt(o,t){return n.jsxs($.Provider,{value:{connection:o,set:b,clear:b},children:[n.jsx(ut,{onLost:t}),n.jsx(V,{value:pt,children:n.jsx(K,{children:n.jsx(ft,{})})})]})}function jt(o){return n.jsx($.Provider,{value:xt,children:n.jsx(vt,{children:o})})}function hr(){const o=u.c(1);let t;return o[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(N,{children:n.jsx(Q,{virtualMcpId:v})}),o[0]=t):t=o[0],t}function vr(){const o=u.c(1);let t;return o[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(N,{children:n.jsx(Y,{virtualMcpId:v})}),o[0]=t):t=o[0],t}export{vr as SiteEditorContent,hr as SiteEditorPreview,fr as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as P,o as q,m as F,K as v,dX as Ye,aF as Nt,aG as Dt,r as U,a as Rt,aw as ce,a2 as xt,au as Pt,dG as At,t as X,j as V}from"./index-DY9jv8u5.js";import{u as We}from"./use-session-runtime-C-ErRuug.js";import{M as $t,j as Lt,i as le,s as xe}from"./thread-intent-BYXYhdV9.js";import{u as we,b as Ft}from"./experiments-tab-choice-CJxPrnzq.js";import{b as ne}from"./sandbox-url-D3mC8qhT.js";import{s as Ut}from"./utils-Cwt2fdOd.js";import{a as Mt}from"./repository-binding-DEE5HjOP.js";import{u as jt}from"./chat-context-DaG-xhpe.js";import{i as Bt,u as Qt}from"./use-sandbox-events-Bjcn7PU6.js";import{a as Vt}from"./sandbox-git-api-CH_-QFpD.js";import{e as Ht}from"./backoff-CrEUbyZT.js";const w={MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603,NotFound:-32001,Conflict:-32002,InvalidBlock:-32003,ReadOnly:-32005,Unsupported:-32006,LimitExceeded:-32007,Unavailable:-32008,Unauthorized:-32010};class T extends Error{code;data;constructor(t,n,o){super(n),this.name="ContentProtocolError",this.code=t,this.data=o}toJSON(){return this.data===void 0?{code:this.code,message:this.message}:{code:this.code,message:this.message,data:this.data}}static from(t){return new T(t.code,t.message,t.data)}}const K="deco-content",ue={major:1},ze=1;async function Gt(e){let t=new Uint8Array(await e.arrayBuffer());if(t[0]===31&&t[1]===139){const n=new Blob([t]).stream().pipeThrough(new DecompressionStream("gzip"));t=new Uint8Array(await new Response(n).arrayBuffer())}return JSON.parse(new TextDecoder().decode(t))}const de={major:ue.major,minor:ze},Xe=`the endpoint speaks an older ${K} than this client needs (${de.major}.${de.minor} or newer): update @decocms/blocks in the site (8.2.0 or newer) and start deco serve again`;function W(e,t,n){const o={reason:t,required:{...de}};if(n){o.actual={protocol:n.protocol,major:n.version?.major,minor:n.version?.minor};const r=n.server;typeof r?.name=="string"&&typeof r.version=="string"&&(o.server={name:r.name,version:r.version})}return new T(w.Unsupported,e,o)}function Ze(e){const t=e??{},{protocol:n,version:o}=t;if(n!==K)throw W(`the endpoint speaks ${JSON.stringify(n)}, not ${K}`,"protocol",t);if(o?.major!==ue.major)throw W(`the endpoint speaks ${K} ${String(o?.major)}.x; this client speaks ${ue.major}.x`,"major",t);if(typeof o.minor!="number"||o.minor<ze)throw W(Xe,"outdated",t);return e}function Pe(e,t){return t.code===w.MethodNotFound&&e.startsWith("changes.")?W(Xe,"outdated"):T.from(t)}function ye(e){const t=e.fetch??(s=>fetch(s));let n=1;async function o(s){const i={"content-type":"application/json",accept:"application/json",...e.headers},a=await t(new Request(e.endpoint,{method:"POST",headers:i,body:JSON.stringify(s)}));let c;try{c=await Gt(a)}catch{throw new T(w.Unavailable,`the endpoint answered HTTP ${a.status} without a JSON-RPC body`)}if(!a.ok||!Array.isArray(c)&&c?.id===null){const l=c?.error;throw l?T.from(l):new T(w.Unavailable,`the endpoint answered HTTP ${a.status}`)}return c}const r=async(s,i)=>{const a=n++,c=await o({jsonrpc:"2.0",id:a,method:s,params:i??{}});if(c.error)throw Pe(s,c.error);return c.result};return{call:r,describe:async()=>Ze(await r("describe")),schemaGet:s=>r("schema.get",s),blocksList:s=>r("blocks.list",s),blocksApply:s=>r("blocks.apply",s),changesList:s=>r("changes.list",s),changesGet:s=>r("changes.get",s),changesDiscard:s=>r("changes.discard",s),async batch(s){const i=s.map(()=>n++),a=await o(s.map((l,d)=>({jsonrpc:"2.0",id:i[d],method:l.method,params:l.params??{}}))),c=new Map(a.map(l=>[l.id,l]));return i.map((l,d)=>{const u=c.get(l);return u?u.error?{ok:!1,error:Pe(s[d].method,u.error)}:{ok:!0,result:u.result}:{ok:!1,error:new T(w.InternalError,"no response for this call")}})}}}const fe=".json";[...Array.from({length:9},(e,t)=>`COM${t+1}`),...Array.from({length:9},(e,t)=>`LPT${t+1}`)];new TextEncoder;function Kt(e){return`${encodeURIComponent(e)}${fe}`}function et(e){return e.endsWith(fe)?e.slice(0,-fe.length):e}function Co(e){const t=et(e);try{return decodeURIComponent(t)}catch{return t}}function qt(e){let t=et(e),n=0;for(;t.includes("%");){let o;try{o=decodeURIComponent(t)}catch{break}if(o===t)break;t=o,n++}return{name:t,passes:n}}function Io(e){return qt(Kt(e)).name}const Ae=20,$e=5,Le=500;function Se(e){return e instanceof T?e.code===w.MethodNotFound?!0:e.code===w.Unsupported&&e.data?.reason==="outdated":!1}function he(e,t){return t.notModified?e?{...e,base:t.base}:null:{revision:t.revision,base:t.base,changes:t.changes}}async function Jt(e,t,n){const o=v.contentChanges(n),r=e.getQueryData(o),s=await t.changesList(r?{ifNoneMatch:r.revision}:{}),i=he(r,s);if(i)return i;const a=await t.changesList({});return he(void 0,a)}async function Yt(e,t){const n=[];for(let s=0;s<t.length;s+=Ae)n.push(t.slice(s,s+Ae));const o=Object.create(null),r=[];for(let s=0;s<n.length;s+=$e){const i=await e.batch(n.slice(s,s+$e).map(a=>({method:"changes.get",params:{names:a}})));for(const a of i){if(!a.ok)throw a.error;const c=a.result;Object.assign(o,c.entries),r.push(...c.diagnostics)}}return{entries:o,diagnostics:r}}async function Oo(e,t){let n={revision:"",versions:{}};for(let o=0;o<t.length;o+=Le){const r=t.slice(o,o+Le),s=await e.changesDiscard({names:r.map(i=>i.name),ifMatch:Object.fromEntries(r.map(i=>[i.name,i.version]))});n={revision:s.revision,versions:{...n.versions,...s.versions}}}return n}function To(e){return e instanceof T&&e.code===w.Conflict}function tt(e){return e?.kind==="protocol"?e:null}function _o(e,t,n){const o=P.c(14);let r;o[0]!==n?(r={},o[0]=n,o[1]=r):r=o[1];const s=r,i=q();let a;o[2]!==e?(a=tt(e),o[2]=e,o[3]=a):a=o[3];const c=a,l=!!c&&!!t&&s.enabled!==!1;let d;o[4]!==t?(d=v.contentChanges(t??""),o[4]=t,o[5]=d):d=o[5];let u;o[6]!==t||o[7]!==l||o[8]!==c||o[9]!==i?(u=l?()=>Jt(i,c.client,t):Ye,o[6]=t,o[7]=l,o[8]=c,o[9]=i,o[10]=u):u=o[10];let f;return o[11]!==d||o[12]!==u?(f={queryKey:d,queryFn:u,staleTime:0},o[11]=d,o[12]=u,o[13]=f):f=o[13],F(f)}function No(e,t,n){const o=P.c(14);let r;o[0]!==e?(r=tt(e),o[0]=e,o[1]=r):r=o[1];const s=r;let i;o[2]!==n?(i=n?Object.keys(n.changes):[],o[2]=n,o[3]=i):i=o[3];const a=i,c=!!s&&!!t&&!!n&&a.length>0;let l;o[4]!==t||o[5]!==n?.revision?(l=v.contentChangeSides(t??"",n?.revision??""),o[4]=t,o[5]=n?.revision,o[6]=l):l=o[6];let d;o[7]!==c||o[8]!==a||o[9]!==s?(d=c?()=>Yt(s.client,a):Ye,o[7]=c,o[8]=a,o[9]=s,o[10]=d):d=o[10];let u;return o[11]!==l||o[12]!==d?(u={queryKey:l,queryFn:d,staleTime:Number.POSITIVE_INFINITY},o[11]=l,o[12]=d,o[13]=u):u=o[13],F(u)}function nt(e){try{const t=new URL(e);if(t.protocol!=="http:"&&t.protocol!=="https:")return!1;const n=t.hostname.toLowerCase();return n==="127.0.0.1"||n==="[::1]"||n==="localhost"}catch{return!1}}function Z(e){try{const t=new URL(e);return(t.hostname==="127.0.0.1"||t.hostname==="[::1]")&&(t.hostname="localhost"),t.href}catch{return e}}const ot=Nt({endpoint:Dt().max(2048).refine(e=>nt(e)&&new URL(e).pathname==="/rpc").transform(Z)});function Do(e){const t=new URLSearchParams(e.replace(/^#/,"")),n=ot.safeParse({endpoint:t.get("endpoint")??""});return n.success?n.data:null}function rt(e){const t=ot.safeParse(e);return t.success?t.data:null}const st="studio:deco-serve-last";function Ro(e){try{localStorage.setItem(st,JSON.stringify(e))}catch{}}function xo(){try{const e=localStorage.getItem(st);return e?rt(JSON.parse(e)):null}catch{return null}}function Po(e){try{return new URL(Z(e)).host}catch{return e}}function Wt(e,t=1e4){return Math.min(1e3*2**Math.max(0,e-1),t)}const zt="http://localhost:4545/rpc",Ao="npx @decocms/blocks serve",$o="npx @decocms/blocks schema";class Ee extends Error{constructor(t="the endpoint isn't deco serve"){super(t),this.name="NotDecoServeError"}}function Xt(e){if(e instanceof Ee)return{reason:"not-deco-serve"};if(!(e instanceof T))return{reason:"not-answering"};switch(e.code){case w.Unauthorized:case w.MethodNotFound:return{reason:"outdated"};case w.Unsupported:return Se(e)?{reason:"outdated"}:{reason:"version-mismatch"};case w.Unavailable:return/^the endpoint answered HTTP/.test(e.message)?{reason:"not-deco-serve"}:{reason:"error",detail:e.message};default:return{reason:"error",detail:e.message}}}function Lo(e,t){if(e)return[Z(e.endpoint)];const n=[t?.endpoint,zt].filter(o=>!!o).map(Z);return[...new Set(n)]}const it=U.createContext(null);function Zt(e){const t=P.c(27),n=U.useContext(it),o=we(n?null:e),{data:r}=Rt.useSession(),s=r?.user?.id??"",i=!!e&&!!s;let a;t[0]!==i||t[1]!==s||t[2]!==e?(a=i?ce.decoServeConnection(s,e):null,t[0]=i,t[1]=s,t[2]=e,t[3]=a):a=t[3];const[c,l]=Ue(a);let d;t[4]!==i||t[5]!==s||t[6]!==e?(d=i?ce.decoServeEndpoint(s,e):null,t[4]=i,t[5]=s,t[6]=e,t[7]=d):d=t[7];const[u,f]=Ue(d);if(n)return n;let g;t[8]!==c||t[9]!==i?(g=i?rt(c):null,t[8]=c,t[9]=i,t[10]=g):g=t[10];const m=g,k=!!m;let C;t[11]!==o||t[12]!==k?(C=en(o,k),t[11]=o,t[12]=k,t[13]=C):C=t[13];const{applies:R,undecided:_}=C,N=R?m:null,I=i&&o==="v8"&&typeof u=="string"?u:null;let O;t[14]!==f||t[15]!==l||t[16]!==i?(O=S=>{i&&(l(S),f(S.endpoint))},t[14]=f,t[15]=l,t[16]=i,t[17]=O):O=t[17];let p;t[18]!==l||t[19]!==i?(p=()=>{i&&l(null)},t[18]=l,t[19]=i,t[20]=p):p=t[20];let y;return t[21]!==N||t[22]!==I||t[23]!==O||t[24]!==p||t[25]!==_?(y={connection:N,undecided:_,lastEndpoint:I,set:O,clear:p},t[21]=N,t[22]=I,t[23]=O,t[24]=p,t[25]=_,t[26]=y):y=t[26],y}function en(e,t){return t?e==="loading"?{applies:!1,undecided:!0}:{applies:e==="v8"||e==="error",undecided:!1}:{applies:!1,undecided:!1}}function Fe(e){try{const t=localStorage.getItem(e);return t===null?null:JSON.parse(t)}catch{return null}}function Ue(e){const t=P.c(17),n=q(),o=e??"";let r;t[0]!==o?(r=["localStorage",o],t[0]=o,t[1]=r):r=t[1];const s=r;let i,a;t[2]!==e?(i=()=>e?Fe(e):null,a=()=>e?Fe(e):null,t[2]=e,t[3]=i,t[4]=a):(i=t[3],a=t[4]);const c=!!e;let l;t[5]!==s||t[6]!==i||t[7]!==a||t[8]!==c?(l={queryKey:s,queryFn:i,initialData:a,enabled:c,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[5]=s,t[6]=i,t[7]=a,t[8]=c,t[9]=l):l=t[9];const{data:d}=F(l);let u;t[10]!==e||t[11]!==n||t[12]!==s?(u=k=>{if(e){try{k===null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(k))}catch{}n.setQueryData(s,k)}},t[10]=e,t[11]=n,t[12]=s,t[13]=u):u=t[13];const f=u,g=e?d??null:null;let m;return t[14]!==f||t[15]!==g?(m=[g,f],t[14]=f,t[15]=g,t[16]=m):m=t[16],m}function Fo(e){return e.kind==="protocol"||e.kind==="unavailable"}function Uo(e){const t=e.hasOrg?e.orgFlag:!1,{backend:n}=e;return n==="protocol"||n==="unavailable"?!0:n==="pending"?t===!0?!0:void 0:t}function Mo(e,t,n){return t!=="github"||n!=="v8"?!1:e.kind==="pending"?!0:e.kind==="unavailable"&&e.siteNotOwned?!1:(e.kind==="protocol"||e.kind==="unavailable")&&e.source==="github"}function jo(e){if(e.kind!=="protocol"||e.source!=="local")return null;const t=e.describe.preview?.url;return t&&nt(t)?t:null}function Bo(e,t){return e.kind!=="protocol"||e.source!=="local"||!e.describe.assets||!t?null:new URL(t.endpoint).origin}function at(e){return e.hasServeConnection?"local":e.runtime==="sandbox"?"sandbox":"github"}function tn(e){if(!e.hasProject)return"legacy";const t=at(e);if(t==="local")return"protocol-local";if(e.serveConnectionUndecided)return"pending";if(t==="sandbox"){const o=e.sandboxSite;return o==="v8"?"protocol-sandbox":o==="v7"?"legacy":o==="error"?e.markedV8?"retrying-sandbox":"legacy":"pending"}if(e.mainSchema==="loading")return"pending";if(e.mainSchema==="error")return"retrying-github";if(e.mainSchema==="v7")return"legacy";const n=e.githubSite;return n==="v8"?"protocol-github":n==="not-owned"?"site-not-owned-github":n==="error"?"unavailable-github":n==="v7"?"legacy":"pending"}function nn(e){return{github:e.mode==="github"&&e.mainSchema==="v8",sandbox:e.mode==="sandbox"&&e.workingTreeReady}}function Me(e){return e.isError||e.errorUpdateCount>0}function on(e,t,n){if(!t||n.size===0)return e;const o={...e};for(const r of n)Object.hasOwn(t,r)?o[r]=t[r]:delete o[r];return o}function rn(e){if(!e||typeof e!="object")return[];const t=e,n=[];return typeof t.blockKey=="string"&&n.push(t.blockKey),t.writes&&typeof t.writes=="object"&&n.push(...Object.keys(t.writes)),Array.isArray(t.deletes)&&n.push(...t.deletes.filter(o=>typeof o=="string")),n}function oe(e){return{[$t]:e}}class ke extends Error{status=409;constructor(){super("main's schema changed")}}async function Ce(e){return e.status!==409?!1:(await e.clone().json().catch(()=>null))?.code===Lt}function Ie(e,t,n){e.resetQueries({predicate:o=>{const r=o.queryKey;return r[1]!==t||r[2]!==n?!1:r[0]===v.mainSchemaV8(t,n)[0]||r[0]===v.contentBackend()[0]&&r[4]==="github"}})}function ct(e,t,n){return e.getQueryData(v.mainSchemaV8(t,n))}const lt="__noSchema";function sn(){return{manifest:{blocks:{}},schema:{definitions:{},root:{}},[lt]:!0}}function Qo(e){return!!e&&e[lt]===!0}function ut(e){if(!e.ok)return e.error.code===w.NotFound;const t=e.result;return t.notModified===!1&&t.schema===null}function an(e,t){return(typeof t.name=="string"?t.name.trim():"")||e}const cn=(e,t)=>e.label.localeCompare(t.label)||e.key.localeCompare(t.key);function Vo(e){const t=new Map;for(const[n,o]of Object.entries(e)){const r=o&&typeof o=="object"&&!Array.isArray(o)?o:{},s=typeof r.__resolveType=="string"?r.__resolveType:null,i=t.get(s)??[];i.push({key:n,label:an(n,r)}),t.set(s,i)}return[...t.entries()].map(([n,o])=>({resolveType:n,blocks:o.sort(cn)})).sort((n,o)=>n.resolveType===null?1:o.resolveType===null?-1:je(n.resolveType).localeCompare(je(o.resolveType))||n.resolveType.localeCompare(o.resolveType))}function je(e){return(e.split("/").filter(Boolean).at(-1)??e).replace(/\.(tsx?|jsx?)$/,"")||e}function Be(e,t,n){if(t.length===0)return n;const[o,...r]=t;if(Array.isArray(e)&&typeof o=="number"){const s=e.slice();return s[o]=Be(e[o],r,n),s}if(e&&typeof e=="object"&&typeof o=="string"){const s=e,i={};for(const a of Object.keys(s))i[a]=a===o?Be(s[a],r,n):s[a];return i}return e}function Ho(e){if(e.trim()==="")return null;const t=Number(e);return Number.isFinite(t)?t:null}class Qe extends Error{}class Ve extends Error{}const dt="site-not-owned";async function ln(e){return e.status!==409?!1:(await e.clone().json().catch(()=>null))?.code==="site_not_owned"}async function un(e,t=r=>fetch(r),n,o){const r=ye({endpoint:e,fetch:async s=>{const i=new Request(s);for(const[c,l]of Object.entries(oe("v8")))i.headers.set(c,l);const a=await t(i);if(await ln(a))throw new Ve;if(await Ce(a))throw n?.(),new ke;return a}});try{const s=await Te(r,le(o)?{schema:o}:void 0);return s.v8Schema?s:null}catch(s){if(s instanceof Ve)return dt;throw s}}const Oe=5e3;function dn(e){return new URL(`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}/rpc`,window.location.origin).href}function fn(e){return new URL(ne(e,"rpc"),window.location.origin).href}async function Te(e,t){const[n,o]=await e.batch(t?[{method:"describe"}]:[{method:"describe"},{method:"schema.get"}]);if(!n?.ok)throw n?.error??new Error("no describe");if(n.result?.protocol!==K)throw new Ee;const s=Ze(n.result);if(t)return{client:e,describe:s,hasSchema:t.schema!=null,v8Schema:le(t.schema)};if(!o)throw new Error("no schema.get");if(ut(o))return{client:e,describe:s,hasSchema:!1,v8Schema:!1};if(o.ok){const i=o.result;return{client:e,describe:s,hasSchema:!0,v8Schema:le(i?.schema)}}throw o.error}async function hn(e,t=n=>fetch(n)){const n=ye({endpoint:e,fetch:async o=>{const r=await t(o);if(r.status===404)throw new Qe;return r}});try{const o=await Te(n);return o.v8Schema?o:null}catch(o){if(o instanceof Qe)return null;throw o}}function ft(e,t){const n=P.c(53),{org:o}=xt(),{connection:r,undecided:s}=Zt(e),{runtime:i}=We(e),a=U.useContext(it),c=we(a?null:e),l=Ft(e),d=at({hasServeConnection:!!r,runtime:i}),u=jt()?.taskId??null,f=Bt(Qt().lifecycle.phase),g=q(),m=nn({mode:d,mainSchema:c,workingTreeReady:f}),k=m.github&&!!o.slug&&!!e&&!!t;let C;n[0]!==t||n[1]!==o.slug||n[2]!==g||n[3]!==e?(C=()=>un(dn({orgSlug:o.slug,virtualMcpId:e,branch:t}),void 0,()=>Ie(g,o.slug,e),ct(g,o.slug,e)?.schema),n[0]=t,n[1]=o.slug,n[2]=g,n[3]=e,n[4]=C):C=n[4];const R=F({queryKey:v.contentBackend(o.slug,e??"",t??"","github"),queryFn:C,enabled:k,staleTime:Number.POSITIVE_INFINITY,...He}),_=m.sandbox&&!!o.slug&&!!e&&!!t;let N;n[5]!==t||n[6]!==o.slug||n[7]!==u||n[8]!==e?(N=async()=>hn(fn({orgSlug:o.slug,virtualMcpId:e,branch:t,threadId:u})),n[5]=t,n[6]=o.slug,n[7]=u,n[8]=e,n[9]=N):N=n[9];const I=F({queryKey:v.contentBackend(o.slug,e??"",t??"","sandbox",u??""),queryFn:N,enabled:_,staleTime:Number.POSITIVE_INFINITY,...He}),O=!!r;let p;n[10]!==r?.endpoint||n[11]!==o.slug||n[12]!==e?(p=v.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[10]=r?.endpoint,n[11]=o.slug,n[12]=e,n[13]=p):p=n[13];let y;n[14]!==r?(y=()=>Te(ye({endpoint:r.endpoint})),n[14]=r,n[15]=y):y=n[15];let S;n[16]!==O||n[17]!==p||n[18]!==y?(S={queryKey:p,queryFn:y,enabled:O,staleTime:Number.POSITIVE_INFINITY,retry:vn,retryDelay:mn,refetchInterval:gn},n[16]=O,n[17]=p,n[18]=y,n[19]=S):S=n[19];const b=F(S);let A;n[20]!==r?.endpoint||n[21]!==o.slug||n[22]!==e?(A=v.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[20]=r?.endpoint,n[21]=o.slug,n[22]=e,n[23]=A):A=n[23];const $=A;let E;n[24]!==r?.endpoint||n[25]!==o.slug||n[26]!==e?(E=v.contentBackend(o.slug,e??"","local-describe",r?.endpoint??""),n[24]=r?.endpoint,n[25]=o.slug,n[26]=e,n[27]=E):E=n[27];let D;n[28]!==b.data||n[29]!==$||n[30]!==g?(D=async()=>{try{return await b.data.client.describe()}catch(h){const G=h;throw g.invalidateQueries({queryKey:$,exact:!0},{cancelRefetch:!1}),G}},n[28]=b.data,n[29]=$,n[30]=g,n[31]=D):D=n[31];const x=!!b.data&&!a;let M;n[32]!==E||n[33]!==D||n[34]!==x?(M={queryKey:E,queryFn:D,enabled:x,refetchInterval:Oe,retry:!1},n[32]=E,n[33]=D,n[34]=x,n[35]=M):M=n[35];const Q=F(M).data??b.data?.describe,L=tn({hasProject:!!e,hasServeConnection:!!r,serveConnectionUndecided:s,runtime:i,mainSchema:c,githubSite:R.data===dt?"not-owned":R.data?"v8":R.data===null?"v7":Me(R)?"error":"loading",sandboxSite:bn({data:I.data,isError:Me(I),workingTreeReady:f}),markedV8:l});if(L==="pending"){let h;return n[36]===Symbol.for("react.memo_cache_sentinel")?(h={kind:"pending"},n[36]=h):h=n[36],h}if(L==="retrying-github"){let h;return n[37]===Symbol.for("react.memo_cache_sentinel")?(h={kind:"pending",retrying:"github"},n[37]=h):h=n[37],h}if(L==="retrying-sandbox"){let h;return n[38]===Symbol.for("react.memo_cache_sentinel")?(h={kind:"pending",retrying:"sandbox"},n[38]=h):h=n[38],h}if(L==="legacy"){let h;return n[39]===Symbol.for("react.memo_cache_sentinel")?(h={kind:"legacy"},n[39]=h):h=n[39],h}if(L==="protocol-github"){const h=R.data;let G;return n[40]!==h?(G=ge("github",h,""),n[40]=h,n[41]=G):G=n[41],G}if(L==="site-not-owned-github"){let h;return n[42]===Symbol.for("react.memo_cache_sentinel")?(h={kind:"unavailable",source:"github",siteNotOwned:!0},n[42]=h):h=n[42],h}if(L==="protocol-sandbox"){let h;return n[43]!==I.data?(h=ge("sandbox",I.data,":sandbox"),n[43]=I.data,n[44]=h):h=n[44],h}if(L==="unavailable-github"){let h;return n[45]===Symbol.for("react.memo_cache_sentinel")?(h={kind:"unavailable",source:"github"},n[45]=h):h=n[45],h}const ie=b.error??b.failureReason,ae=r?.endpoint??"";let Y;return n[46]!==Q||n[47]!==b.data||n[48]!==b.failureCount||n[49]!==b.isError||n[50]!==ie||n[51]!==ae?(Y=wn({probed:b.data,isError:b.isError,failureCount:b.failureCount,failure:ie,describe:Q,endpoint:ae}),n[46]=Q,n[47]=b.data,n[48]=b.failureCount,n[49]=b.isError,n[50]=ie,n[51]=ae,n[52]=Y):Y=n[52],Y}function gn(e){return e.state.status==="error"||e.state.data?.v8Schema===!1?Oe:!1}function mn(e){return Wt(e+1)}function vn(e,t){return!(t instanceof T)&&!(t instanceof Ee)}function bn(e){return e.data!==void 0?e.data?"v8":"v7":e.workingTreeReady?e.isError?"error":"loading":"unavailable"}const pn=3;function wn(e){if(e.probed?.hasSchema&&!e.probed.v8Schema)return{kind:"unavailable",source:"local",problem:{reason:"not-v8"}};const t=e.probed?ge("local",{...e.probed,describe:e.describe??e.probed.describe},`:serve:${e.endpoint}`):null;return e.isError||e.failureCount>0?t?.kind==="protocol"&&!e.isError&&e.failureCount<pn?t:{kind:"unavailable",source:"local",problem:Xt(e.failure)}:t??{kind:"pending"}}const He={retry:2,refetchInterval:e=>e.state.status==="error"?Oe:!1};function ge(e,t,n){return{kind:"protocol",source:e,client:t.client,describe:t.describe,cacheKeySuffix:n,hasSchema:t.hasSchema}}function ht(e){const t=P.c(13);let n;t[0]!==e?(n=ce.localPreviewUrl(e??""),t[0]=e,t[1]=n):n=t[1];const o=n,[r,s]=Pt(o,null),i=we(e);let a;if(t[2]!==i||t[3]!==r||t[4]!==e){const f=e?xe(r):null;a=yn({saved:f,main:i}),t[2]=i,t[3]=r,t[4]=e,t[5]=a}else a=t[5];const c=a;let l,d;t[6]!==s?(l=f=>s(xe(f)),d=()=>s(null),t[6]=s,t[7]=l,t[8]=d):(l=t[7],d=t[8]);let u;return t[9]!==c||t[10]!==l||t[11]!==d?(u={...c,setUrl:l,clear:d},t[9]=c,t[10]=l,t[11]=d,t[12]=u):u=t[12],u}function yn(e){return e.saved?e.main==="v7"?{url:e.saved,undecided:!1}:e.main==="v8"?{url:null,undecided:!1}:{url:null,undecided:!0}:{url:null,undecided:!1}}function Sn(e,t){const n=(e??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${t}`:t}function Ge(e){let t;try{t=JSON.parse(e)}catch{return null}return typeof t!="object"||t===null||Array.isArray(t)?null:t}class _e extends Error{constructor(t,n,o=[]){super(n),this.blocks=t,this.fields=o,this.name="BlockConflictError"}blocks;fields}function Ne(e){return`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`}function re(e,t,n){return["decofile-write",e,t,n]}function En(e,t,n){return{id:re(e,t,n).join(":")}}function De(e){return`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`}async function kn(e,t){const n=await e.json().catch(()=>({}));throw new Error(n.error??`${t} failed (${e.status})`)}function Cn(e,t,n){e.setQueryData(v.decofileDraft(Ne(t)),n)}function In(e,t){return e.getQueryData(v.decofileDraft(Ne(t)))??null}async function On(e,t){const n=await fetch(De(e),{cache:"no-store",headers:{...oe("v7"),"if-none-match":`"${t}"`}}).catch(()=>null);return n?.status===200||n?.status===409}function Go(e){const t=P.c(4);let n;t[0]!==e?(n=v.decofileDraft(e?Ne(e):""),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:Tn,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=F(o);return r??null}async function Tn(){throw new Error("decofileDraft is populated by reads/writes, not fetched")}async function _n(e,t){const n=await fetch(De(t),{cache:"no-store",headers:oe("v7")});if(await Ce(n))throw Ie(e,t.orgSlug,t.virtualMcpId),new ke;if(!n.ok){const r=new Error(`Failed to fetch decofile: ${n.status}`);throw r.status=n.status,r}const o=await n.json();return o.token&&Cn(e,t,{version:o.version,token:o.token,apiHost:o.apiHost??window.location.host}),o.decofile}async function Ko(e,t){const n=await fetch(De(e),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(n.status===409){const r=await n.json().catch(()=>({}));throw r.code==="block-conflict"?new _e(r.blocks??[],r.error??"Block changed"):new Error(r.error??`Save failed (${n.status})`)}if(!n.ok)return kn(n,"Save");const o=await n.json();return{...o,apiHost:o.apiHost??window.location.host}}const gt=3e3,Nn=15e3,Dn=2*6e4,mt={now:()=>Date.now(),setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),hidden:()=>typeof document<"u"&&document.visibilityState==="hidden"};function Rn(e){return e<Dn?gt:Nn}function xn(e,t=mt){const n=t.now();let o=!1,r=!1,s=null;const i=()=>{o||(s=t.setTimeout(a,Rn(t.now()-n)))},a=()=>{if(s=null,o)return;const{read:c,skip:l}=e();if(r||t.hidden()||l?.()){i();return}r=!0;let d;try{d=c()}catch{d=void 0}Promise.resolve(d).catch(()=>{}).finally(()=>{r=!1}),i()};return i(),()=>{o=!0,s!==null&&t.clearTimeout(s)}}const Ke=()=>0;function Pn(e,t,n=mt){const o=U.useRef(t);o.current=t;const[r]=U.useState(()=>({polling:()=>xn(()=>o.current,n),idle:()=>()=>{}}));U.useSyncExternalStore(e?r.polling:r.idle,Ke,Ke)}function vt(e,t){return ne(e,t)}function An(e,t){return ne(e,"preview-fetch",{path:t})}function qo(e){return vt(e,"preview-invoke")}function Jo(e){return vt(e,"catalog-invoke")}function bt(e){try{const{hostname:t}=new URL(e);return t==="localhost"||t.endsWith(".localhost")||t==="127.0.0.1"||t==="::1"}catch{return!1}}function $n(){if(typeof document>"u")return null;const e=Array.from(document.querySelectorAll("iframe"));for(const t of e){const n=t.getAttribute("src");if(n&&bt(n))return n}return null}function Ln(e,t){const n=e.previewUrl??e.getFallbackPreviewUrl?.()??$n();return n&&bt(n)?new URL(t,n).toString():An(e,t)}function Fn(e){return Ln(e,"/.decofile")}function Un(e){return e===400?"absent":e===404?"unavailable":e>=200&&e<300?"ok":"error"}function qe(e){return e.liveOk||e.committedAbsent?404:e.liveStatus??502}async function Mn(e,t){const n=ne(e,"read"),o=await fetch(n,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:t,full:!0})}),r=Un(o.status);if(r==="absent")return{kind:"absent"};if(r==="unavailable")return{kind:"unavailable"};if(r==="error"){const i=new Error(`Failed to read ${t}: ${o.status}`);throw i.status=o.status,i}const s=await o.json();return typeof s.content!="string"?{kind:"unavailable"}:{kind:"data",data:Ut(s.content)}}async function jn(e,t){const n=await Mn(e,t);if(n.kind!=="data")return n;try{return{kind:"data",data:JSON.parse(n.data)}}catch{return{kind:"unavailable"}}}async function Yo(e){const t=`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}/meta`,n=await fetch(t,{cache:"no-store"});if(n.status===404)return{kind:"absent"};if(!n.ok){const o=new Error(`Failed to read committed meta: ${n.status}`);throw o.status=n.status,o}try{return{kind:"data",data:await n.json()}}catch{return{kind:"unavailable"}}}function Bn(e){return Mt(e)?.metadata?.runtime?.path??null}class pt extends Error{constructor(t){super(t instanceof Error?t.message:String(t),{cause:t}),this.name="ServeLostError"}}function Wo(e){return e instanceof T&&e.code===w.Conflict}function wt(e){const t=e.data?.violations;return!Array.isArray(t)||t.length===0?e.message:t.slice(0,3).map(n=>n.message).join("; ")}function Qn(e,t,n){if(t instanceof _e)return t.message;if(n==="local")return Hn(e,t);if(t instanceof T)switch(t.code){case w.Conflict:return e("siteEditor.save.conflict");case w.ReadOnly:return e("siteEditor.save.readOnly");case w.InvalidBlock:case w.InvalidParams:return e("siteEditor.save.invalid");case w.LimitExceeded:return e("siteEditor.save.tooLarge")}return e("siteEditor.save.failed")}function Vn(e,t){if(t==="local"||e instanceof _e)return null;if(e instanceof T){const n=e.code===w.InvalidBlock||e.code===w.InvalidParams?wt(e):e.message;return n?`${e.code}: ${n}`:null}return e.message||null}function Hn(e,t){if(t instanceof pt)return e("decoServe.save.serverGone");if(t instanceof T)switch(t.code){case w.Conflict:return e("decoServe.save.conflict");case w.ReadOnly:return e("decoServe.save.readOnly");case w.InvalidBlock:case w.InvalidParams:return e("decoServe.save.invalid",{detail:wt(t)});case w.LimitExceeded:return e("decoServe.save.tooLarge")}return e("sectionsEditor.sectionsEditor.saveFailed",{error:t.message})}function Gn(e,t,n){return e===null?0:Math.max(0,n-Math.max(0,t-e))}function Kn(e,t){const[n,o]=U.useState(e),r=U.useRef(null);return e&&!n&&o(!0),U.useEffect(()=>{if(e){r.current??=Date.now();return}if(!n)return;const s=()=>{r.current=null,o(!1)},i=Gn(r.current,Date.now(),t);if(i===0){s();return}const a=setTimeout(s,i);return()=>clearTimeout(a)},[e,n,t]),n}const yt={phase:"idle",inFlight:0,reload:{seq:0,navigates:!1},epoch:0},qn=15e3,ee=new Map;function H(e,t){return`${e}/${t}`}function j(e){let t=ee.get(e);return t||(t={state:yt,listeners:new Set,previews:0,timer:null,discardListeners:new Set},ee.set(e,t)),t}function B(e,t){const n=j(e);n.state={...n.state,...t};for(const o of n.listeners)o()}function se(e){e.timer&&clearTimeout(e.timer),e.timer=null}function Re(e){return ee.get(e)?.state??yt}function Jn(e,t){const n=j(e);return n.listeners.add(t),()=>{n.listeners.delete(t)}}function zo(e){const t=j(e);return t.previews++,()=>{t.previews--,t.previews===0&&t.state.phase==="reloading"&&(se(t),B(e,{phase:"idle"}))}}function Xo(e){const t=ee.get(e);!t||t.state.phase!=="reloading"||(se(t),B(e,{phase:"idle"}))}function St(e){const t=j(e);se(t),B(e,{phase:"saving",inFlight:t.state.inFlight+1})}function me(e,t){const n=j(e),o=Math.max(0,n.state.inFlight-1);if(o>0){B(e,{inFlight:o});return}if(!t.ok||n.previews===0){B(e,{phase:"idle",inFlight:o});return}Et(e,t.navigates,o)}function Et(e,t,n=0){const o=j(e);se(o),o.timer=setTimeout(()=>{o.timer=null,o.state.phase==="reloading"&&B(e,{phase:"idle"})},qn),B(e,{phase:"reloading",inFlight:n,reload:{seq:o.state.reload.seq+1,navigates:t}})}function Yn(e){return e?.kind==="protocol"&&e.source==="github"}async function ve(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s,backend:i,cacheKey:a}=e,c=t.kind==="publish"||t.kind==="reapply"?n.invalidateQueries({queryKey:v.hostedReleases(o,r)}):null;if(i?.kind!=="protocol")return await c,{navigates:!1};const l=s?v.protocolDraftRead(o,r,s):null,d=l?JSON.stringify(n.getQueryData(l)??null):null,u=c?[c]:[];if(a&&t.reread&&u.push(n.invalidateQueries({queryKey:v.decofile(a)})),a&&u.push(n.invalidateQueries({queryKey:v.contentChanges(a)})),s&&i.source==="sandbox"&&u.push(n.invalidateQueries({queryKey:Vt(o,r,s)})),Yn(i)&&l&&u.push(n.invalidateQueries({queryKey:l})),await Promise.all(u),t.kind!=="edit"){const m=H(o,r);B(m,{epoch:Re(m).epoch+1})}const f=l?JSON.stringify(n.getQueryData(l)??null):null,g=d!==f;return g&&await new Promise(m=>At.schedule(m)),{navigates:g}}async function Wn(e,t){return St(H(e.orgSlug,e.virtualMcpId)),kt(e,t)}async function kt(e,t){const n=H(e.orgSlug,e.virtualMcpId);let o;try{o=await t.write()}catch(s){throw me(n,{ok:!1,navigates:!1}),t.refreshOnError&&ve(e,{kind:t.kind,reread:!0}).catch(()=>{}),s}let r=!1;try{({navigates:r}=await ve(e,t))}catch{}finally{me(n,{ok:!0,navigates:r})}return o}function Zo(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s}=e,i=H(o,r),a=new Set(t.blockKeys);for(const d of[...j(i).discardListeners])d(a);St(i);let c=!1;const l=()=>(c=!0,kt(e,{kind:"discard",reread:!0,write:t.write}));return s?n.getMutationCache().build(n,{mutationKey:re(o,r,s),scope:En(o,r,s),mutationFn:l}).execute(void 0).catch(d=>{throw c||me(i,{ok:!1,navigates:!1}),d}):l()}function er(e,t,n){const o=P.c(8);let r;o[0]!==e||o[1]!==t?(r=H(e,t),o[0]=e,o[1]=t,o[2]=r):r=o[2];const s=r;let i;o[3]!==n||o[4]!==s?(i=()=>{const c=j(s).discardListeners;return c.add(n),()=>{c.delete(n)}},o[3]=n,o[4]=s,o[5]=i):i=o[5];let a;o[6]!==s?(a=[s],o[6]=s,o[7]=a):a=o[7],U.useEffect(i,a)}function zn(e){const t=H(e.orgSlug,e.virtualMcpId);Re(t).inFlight>0||ve(e,{kind:"external"}).then(({navigates:n})=>{const o=j(t);o.previews>0&&o.state.inFlight===0&&Et(t,n)}).catch(()=>{})}function Xn(e,t){const n=P.c(7);let o;n[0]!==e||n[1]!==t?(o=H(e,t),n[0]=e,n[1]=t,n[2]=o):o=n[2];const r=o;let s;n[3]!==r?(s=l=>Jn(r,l),n[3]=r,n[4]=s):s=n[4];const i=s;let a;n[5]!==r?(a=()=>Re(r),n[5]=r,n[6]=a):a=n[6];const c=a;return U.useSyncExternalStore(i,c,c)}const Zn=500;function tr(e,t){const{phase:n}=Xn(e,t);return Kn(n!=="idle",Zn)}function eo(e){const t=new Error(`${e} unavailable (content server unreachable)`);return t.status=502,t}function to(e,t){return v.liveMeta(e.orgSlug,e.virtualMcpId,e.branch,`protocol${t.cacheKeySuffix}`,"")}function nr(e,t,n){const o=e.getQueryData(v.contentVersions(t));if(!o)return;if(Object.hasOwn(o,n))return o[n];const r=e.getQueryData(v.decofile(t));return r&&Object.hasOwn(r,n)?void 0:null}function Ct(e,t,n){e.setQueryData(v.contentVersions(t),o=>{const r={...o};for(const[s,i]of Object.entries(n))i===null?delete r[s]:r[s]=i;return r})}function no(e,t){const n=e.getMutationCache().findAll({mutationKey:re(t.orgSlug,t.virtualMcpId,t.branch),status:"pending"});return new Set(n.flatMap(o=>rn(o.state.variables)))}function be(e,t){e.resetQueries({queryKey:v.contentBackend(t.orgSlug,t.virtualMcpId,"local")})}async function te(e,t,n,o){try{return await o()}catch(r){const s=!(r instanceof T);throw t.source==="local"&&s?(be(e,n),new pt(r)):(t.source==="local"&&Se(r)&&be(e,n),r)}}const z=new Map;function It(e,t,n,o){const r=z.get(o);if(r)return r;const s=Ot(e,t,n,o,!0);return z.set(o,s),s.finally(()=>z.delete(o))}async function or(e,t,n,o){const r=z.get(o);return r&&await r.catch(()=>{}),It(e,t,n,o)}async function Ot(e,t,n,o,r){const s=v.decofile(o),i=to(n,t),a=v.contentRevision(o),c=e.getQueryData(s),l=e.getQueryData(i),d=e.getQueryData(a)??void 0,u=t.source==="github"&&!l?ct(e,n.orgSlug,n.virtualMcpId):void 0,f=u?.isV8&&u.schema&&u.version?u:void 0,g=l??f?.schema,m=f?{...d,schemaVersion:f.version}:d,k=r&&c?m?.revision:void 0,C=r&&g?m?.schemaVersion:void 0,R=v.contentChanges(o),_=e.getQueryData(R),[N,I,O]=await te(e,t,n,()=>t.client.batch([{method:"blocks.list",params:k?{ifNoneMatch:k}:{}},{method:"schema.get",params:C?{ifNoneMatch:C}:{}},{method:"changes.list",params:_?{ifNoneMatch:_.revision}:{}}]));if(O?.ok){const x=he(_,O.result);x&&e.setQueryData(R,x)}else O&&t.source==="local"&&Se(O.error)&&be(e,n);if(!N?.ok)throw N?.error??new Error("no blocks.list");if(!I)throw new Error("no schema.get");const p=N.result,y=ut(I),S=I.ok&&!y?I.result:null;if(p.notModified&&!c||S?.notModified&&!g)return Ot(e,t,n,o,!1);const b=p.notModified?new Set:no(e,n),A=p.notModified?c:on(p.blocks,c,b),$=y?sn():S?S.notModified?g:S.schema:I.error,E=e.getQueryData(a)?.revision,D=E!==void 0&&E!==m?.revision;if(e.setQueryData(a,{revision:D?E:p.notModified?m?.revision:p.revision,schemaVersion:S?S.notModified?m?.schemaVersion:S.version??void 0:void 0}),e.setQueryData(s,A),!p.notModified){const x=v.contentVersions(o),M=e.getQueryData(x),J={...p.versions};for(const Q of b){const L=M?.[Q];L!==void 0?J[Q]=L:delete J[Q]}e.setQueryData(x,J)}return $ instanceof T||e.setQueryData(i,$),!D&&!p.notModified&&c&&m?.revision&&p.revision!==m.revision&&zn({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o}),{blocks:A,meta:$}}async function rr(e,t,n,o,r,s){return Wn({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o},{kind:"edit",write:async()=>{const i=await te(e,t,n,()=>t.client.blocksApply({set:r.set,delete:r.delete,...s?{ifMatch:s}:{}}));e.setQueryData(v.contentRevision(o),c=>({...c,revision:i.revision}));const a=i.versions??{};return Ct(e,o,a),{revision:i.revision,versions:a}}})}async function sr(e,t,n,o,r){await e.invalidateQueries({queryKey:v.decofile(o)});let s;try{const a=(await te(e,t,n,()=>t.client.changesGet({names:[r]}))).entries[r];if(a&&a.after===null&&a.version!==null)return;s={value:a?.after??null,version:a?.version??null}}catch{const i=await te(e,t,n,()=>t.client.blocksList({}));if(i.notModified)return;s={value:i.blocks[r]??null,version:i.versions[r]??null}}e.setQueryData(v.decofile(o),i=>{const a={...i};return s.value===null?delete a[r]:a[r]=s.value,a}),Ct(e,o,{[r]:s.version})}function oo(e){const t=P.c(15),n=q();let o;t[0]!==e?.branch||t[1]!==e?.orgSlug||t[2]!==e?.virtualMcpId?(o=v.protocolDraftRead(e?.orgSlug??"",e?.virtualMcpId??"",e?.branch??""),t[0]=e?.branch,t[1]=e?.orgSlug,t[2]=e?.virtualMcpId,t[3]=o):o=t[3];let r;t[4]!==e||t[5]!==n?(r=async()=>{const g=await fetch(`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`,{cache:"no-store",headers:oe("v8")});if(await Ce(g))throw Ie(n,e.orgSlug,e.virtualMcpId),new ke;if(!g.ok)throw new Error(`draft pointer read failed: ${g.status}`);return await g.json()},t[4]=e,t[5]=n,t[6]=r):r=t[6];const s=!!e;let i;t[7]!==o||t[8]!==r||t[9]!==s?(i={queryKey:o,queryFn:r,enabled:s,staleTime:Number.POSITIVE_INFINITY},t[7]=o,t[8]=r,t[9]=s,t[10]=i):i=t[10];const{data:a,isPending:c,isError:l}=F(i),d=!!e&&c&&!l;if(!e||!a?.draft||!a.version){let g;return t[11]!==d?(g={pointer:null,pending:d},t[11]=d,t[12]=g):g=t[12],g}const u=`${a.draft}@${a.version}`;let f;return t[13]!==u?(f={pointer:u,pending:!1},t[13]=u,t[14]=f):f=t[14],f}function ir(e){return oo(e).pointer}function ar(e){const t=P.c(4);let n;t[0]!==e?(n=v.contentRevision(e),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:ro,staleTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=F(o);return r?.revision}async function ro(){throw new Error("content revisions are set by reads and writes")}function Je(e){const t=`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`;return e.protocolSuffix?`${t}${e.protocolSuffix}`:e.localPreviewUrl?`${t}:local:${e.localPreviewUrl}`:t}function so(e,t){const n=P.c(6),{url:o}=ht(e?.virtualMcpId),r=ft(e?.virtualMcpId,e?.branch);if(!e)return"";let s;return n[0]!==r.cacheKeySuffix||n[1]!==r.kind||n[2]!==o||n[3]!==t?.tunnel||n[4]!==e?(s=r.kind==="protocol"?Je({...e,protocolSuffix:r.cacheKeySuffix}):Je({...e,localPreviewUrl:t?.tunnel===!1?null:o}),n[0]=r.cacheKeySuffix,n[1]=r.kind,n[2]=o,n[3]=t?.tunnel,n[4]=e,n[5]=s):s=n[5],s}function cr(e,t){const n=P.c(39),{url:o,undecided:r}=ht(e?.virtualMcpId),s=!!o,i=ft(e?.virtualMcpId,e?.branch),a=i.kind==="protocol"?i:null,c=so(e),l=t?.fetchEnabled??!0,d=Bn(e?.virtualMcpId),u=We(e?.virtualMcpId).runtime==="cms",f=q();let g;n[0]!==c?(g=v.decofile(c),n[0]=c,n[1]=g):g=n[1];const m=g;let k;n[2]!==e||n[3]!==f||n[4]!==m?(k=()=>{if(!e||f.isMutating({mutationKey:re(e.orgSlug,e.virtualMcpId,e.branch)})>0)return!0;const b=f.getQueryState(m);return b?.fetchStatus==="fetching"||Date.now()-(b?.dataUpdatedAt??0)<gt/2},n[2]=e,n[3]=f,n[4]=m,n[5]=k):k=n[5];let C;n[6]!==u||n[7]!==s||n[8]!==e||n[9]!==a||n[10]!==f||n[11]!==m?(C=async()=>{if(e){if(!a&&u&&!s){const b=In(f,e)?.version;if(b&&!await On(e,b))return}await f.refetchQueries({queryKey:m,exact:!0},{cancelRefetch:!1})}},n[6]=u,n[7]=s,n[8]=e,n[9]=a,n[10]=f,n[11]=m,n[12]=C):C=n[12];let R;n[13]!==k||n[14]!==C?(R={skip:k,read:C},n[13]=k,n[14]=C,n[15]=R):R=n[15],Pn(!!t?.pollWhile&&!!e,R);let _;n[16]!==i.kind||n[17]!==u||n[18]!==l||n[19]!==c||n[20]!==s||n[21]!==o||n[22]!==d||n[23]!==e||n[24]!==a||n[25]!==f?(_=async()=>{if(a)return(await It(f,a,e,c)).blocks;if(i.kind==="unavailable")throw eo("decofile");if(s){const E=await fetch(new URL("/.decofile",o).toString(),{cache:"no-store"}).catch(co),D=E?.ok?Ge(await E.text()):null;if(D)return D;const x=new Error("decofile unavailable (local tunnel unreachable)");throw x.status=502,x}if(u)return _n(f,e);const b=()=>jn(e,Sn(d,".deco/blocks.gen.json"));if(l){const E=await fetch(Fn(e),{cache:"no-store"}).catch(ao);if(E?.ok){const M=Ge(await E.text());if(M)return M}const D=await b();if(D.kind==="data")return D.data;const x=new Error(`Failed to fetch decofile: ${E?.status??"network error"}`);throw x.status=qe({liveOk:!!E?.ok,liveStatus:E?.status,committedAbsent:D.kind==="absent"}),x}const A=await b();if(A.kind==="data")return A.data;const $=new Error("decofile unavailable (preview down, no committed snapshot)");throw $.status=qe({liveOk:!1,committedAbsent:A.kind==="absent"}),$},n[16]=i.kind,n[17]=u,n[18]=l,n[19]=c,n[20]=s,n[21]=o,n[22]=d,n[23]=e,n[24]=a,n[25]=f,n[26]=_):_=n[26];const N=!!e&&i.kind!=="pending"&&!r,I=a?0:3e4,O=a?.describe.pollIntervalMs,p=a?"always":void 0;let y;n[27]!==u||n[28]!==s||n[29]!==a?(y=(b,A)=>{if(a||u||s)return b<3;const $=A.status;return $!==502&&$!==404&&b<2},n[27]=u,n[28]=s,n[29]=a,n[30]=y):y=n[30];let S;return n[31]!==m||n[32]!==_||n[33]!==N||n[34]!==I||n[35]!==O||n[36]!==p||n[37]!==y?(S={queryKey:m,queryFn:_,enabled:N,staleTime:I,refetchInterval:O,refetchIntervalInBackground:!1,refetchOnWindowFocus:p,retry:y,retryDelay:io},n[31]=m,n[32]=_,n[33]=N,n[34]=I,n[35]=O,n[36]=p,n[37]=y,n[38]=S):S=n[38],F(S)}function io(e){return Ht(5e3,1e3,e,2,0)}function ao(){return null}function co(){return null}const lo="site-editor-save",uo={id:lo,description:void 0,action:void 0,cancel:void 0},lr="site-editor-undo",pe="site-editor-publish";function fo(e){const t=P.c(7),{label:n,detail:o}=e;let r;t[0]!==n?(r=V.jsx("summary",{className:"cursor-pointer select-none text-muted-foreground",children:n}),t[0]=n,t[1]=r):r=t[1];let s;t[2]!==o?(s=V.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words font-mono text-muted-foreground",children:o}),t[2]=o,t[3]=s):s=t[3];let i;return t[4]!==r||t[5]!==s?(i=V.jsxs("details",{className:"mt-1 text-xs",children:[r,s]}),t[4]=r,t[5]=s,t[6]=i):i=t[6],i}function Tt(e,t){return t?V.jsx(fo,{label:e("siteEditor.details"),detail:t}):void 0}function ur(e,t,n){X.error(Qn(e,t,n),{...uo,description:Tt(e,Vn(t,n))})}const _t={action:void 0,duration:void 0};function dr(e,t){X.success(t?e("siteEditor.publish.publishedOn",{host:t}):e("siteEditor.publish.published"),{..._t,id:pe,description:void 0})}function fr(e,{headline:t,body:n,detail:o,retry:r,pending:s,tone:i="error"}){const a=Tt(e,o??null);X[i](t,{id:pe,description:n&&a?V.jsxs(V.Fragment,{children:[V.jsx("p",{children:n}),a]}):n??a,action:r?{label:e("siteEditor.tryAgain"),onClick:c=>{c.preventDefault(),X.loading(s??e("thread.publishPopover.publishing"),{..._t,id:pe,description:void 0}),r()}}:void 0,duration:r?Number.POSITIVE_INFINITY:void 0})}function hr(e){return e instanceof Error?e.message||null:e==null?null:String(e)}export{Bo as $,zo as A,Xn as B,Xo as C,so as D,ar as E,En as F,re as G,Wn as H,Mn as I,kn as J,_e as K,Wo as L,rr as M,sr as N,ur as O,Cn as P,Ko as Q,er as R,Ao as S,it as T,Uo as U,Vo as V,je as W,Be as X,Ho as Y,$o as Z,Ln as _,Lo as a,zt as a0,Tt as a1,hr as a2,Io as a3,Co as a4,Kt as a5,Ie as a6,dr as a7,Zo as a8,Oo as a9,To as aa,Se as ab,No as ac,to as ad,Jt as ae,fo as af,_o as ag,It as ah,eo as ai,Yo as aj,jn as ak,Go as al,ir as am,oe as an,fr as ao,pe as ap,_t as aq,lr as ar,uo as as,or as at,nr as au,Jo as av,Zt as b,ht as c,Wt as d,Po as e,Xt as f,Te as g,ye as h,nt as i,qo as j,An as k,cr as l,Fo as m,Qo as n,Bn as o,Do as p,Sn as q,xo as r,Ro as s,at as t,ft as u,jo as v,tr as w,Mo as x,oo as y,H as z};
|
|
1
|
+
import{c as P,o as q,m as U,K as v,dX as Ye,aG as Nt,aH as Dt,r as F,a as Rt,aw as ce,a2 as xt,au as Pt,dG as At,t as X,j as V}from"./index-CImJlq71.js";import{u as We}from"./use-session-runtime-DfVwDDov.js";import{M as $t,j as Lt,i as le,s as xe}from"./thread-intent-DXY7orZh.js";import{u as we,b as Ut}from"./experiments-tab-choice-DLYJ3Xgw.js";import{b as ne}from"./sandbox-url-D3mC8qhT.js";import{s as Ft}from"./utils-Dc05pOUY.js";import{a as Mt}from"./repository-binding-wXpkgUS5.js";import{u as jt}from"./chat-context-C_P788VD.js";import{i as Bt,u as Qt}from"./use-sandbox-events-CioMqxnO.js";import{a as Vt}from"./sandbox-git-api-CH_-QFpD.js";import{e as Ht}from"./backoff-CrEUbyZT.js";const w={MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603,NotFound:-32001,Conflict:-32002,InvalidBlock:-32003,ReadOnly:-32005,Unsupported:-32006,LimitExceeded:-32007,Unavailable:-32008,Unauthorized:-32010};class T extends Error{code;data;constructor(t,n,o){super(n),this.name="ContentProtocolError",this.code=t,this.data=o}toJSON(){return this.data===void 0?{code:this.code,message:this.message}:{code:this.code,message:this.message,data:this.data}}static from(t){return new T(t.code,t.message,t.data)}}const K="deco-content",ue={major:1},ze=1;async function Gt(e){let t=new Uint8Array(await e.arrayBuffer());if(t[0]===31&&t[1]===139){const n=new Blob([t]).stream().pipeThrough(new DecompressionStream("gzip"));t=new Uint8Array(await new Response(n).arrayBuffer())}return JSON.parse(new TextDecoder().decode(t))}const de={major:ue.major,minor:ze},Xe=`the endpoint speaks an older ${K} than this client needs (${de.major}.${de.minor} or newer): update @decocms/blocks in the site (8.2.0 or newer) and start deco serve again`;function W(e,t,n){const o={reason:t,required:{...de}};if(n){o.actual={protocol:n.protocol,major:n.version?.major,minor:n.version?.minor};const r=n.server;typeof r?.name=="string"&&typeof r.version=="string"&&(o.server={name:r.name,version:r.version})}return new T(w.Unsupported,e,o)}function Ze(e){const t=e??{},{protocol:n,version:o}=t;if(n!==K)throw W(`the endpoint speaks ${JSON.stringify(n)}, not ${K}`,"protocol",t);if(o?.major!==ue.major)throw W(`the endpoint speaks ${K} ${String(o?.major)}.x; this client speaks ${ue.major}.x`,"major",t);if(typeof o.minor!="number"||o.minor<ze)throw W(Xe,"outdated",t);return e}function Pe(e,t){return t.code===w.MethodNotFound&&e.startsWith("changes.")?W(Xe,"outdated"):T.from(t)}function ye(e){const t=e.fetch??(s=>fetch(s));let n=1;async function o(s){const i={"content-type":"application/json",accept:"application/json",...e.headers},a=await t(new Request(e.endpoint,{method:"POST",headers:i,body:JSON.stringify(s)}));let c;try{c=await Gt(a)}catch{throw new T(w.Unavailable,`the endpoint answered HTTP ${a.status} without a JSON-RPC body`)}if(!a.ok||!Array.isArray(c)&&c?.id===null){const l=c?.error;throw l?T.from(l):new T(w.Unavailable,`the endpoint answered HTTP ${a.status}`)}return c}const r=async(s,i)=>{const a=n++,c=await o({jsonrpc:"2.0",id:a,method:s,params:i??{}});if(c.error)throw Pe(s,c.error);return c.result};return{call:r,describe:async()=>Ze(await r("describe")),schemaGet:s=>r("schema.get",s),blocksList:s=>r("blocks.list",s),blocksApply:s=>r("blocks.apply",s),changesList:s=>r("changes.list",s),changesGet:s=>r("changes.get",s),changesDiscard:s=>r("changes.discard",s),async batch(s){const i=s.map(()=>n++),a=await o(s.map((l,d)=>({jsonrpc:"2.0",id:i[d],method:l.method,params:l.params??{}}))),c=new Map(a.map(l=>[l.id,l]));return i.map((l,d)=>{const u=c.get(l);return u?u.error?{ok:!1,error:Pe(s[d].method,u.error)}:{ok:!0,result:u.result}:{ok:!1,error:new T(w.InternalError,"no response for this call")}})}}}const fe=".json";[...Array.from({length:9},(e,t)=>`COM${t+1}`),...Array.from({length:9},(e,t)=>`LPT${t+1}`)];new TextEncoder;function Kt(e){return`${encodeURIComponent(e)}${fe}`}function et(e){return e.endsWith(fe)?e.slice(0,-fe.length):e}function Co(e){const t=et(e);try{return decodeURIComponent(t)}catch{return t}}function qt(e){let t=et(e),n=0;for(;t.includes("%");){let o;try{o=decodeURIComponent(t)}catch{break}if(o===t)break;t=o,n++}return{name:t,passes:n}}function Io(e){return qt(Kt(e)).name}const Ae=20,$e=5,Le=500;function Se(e){return e instanceof T?e.code===w.MethodNotFound?!0:e.code===w.Unsupported&&e.data?.reason==="outdated":!1}function he(e,t){return t.notModified?e?{...e,base:t.base}:null:{revision:t.revision,base:t.base,changes:t.changes}}async function Jt(e,t,n){const o=v.contentChanges(n),r=e.getQueryData(o),s=await t.changesList(r?{ifNoneMatch:r.revision}:{}),i=he(r,s);if(i)return i;const a=await t.changesList({});return he(void 0,a)}async function Yt(e,t){const n=[];for(let s=0;s<t.length;s+=Ae)n.push(t.slice(s,s+Ae));const o=Object.create(null),r=[];for(let s=0;s<n.length;s+=$e){const i=await e.batch(n.slice(s,s+$e).map(a=>({method:"changes.get",params:{names:a}})));for(const a of i){if(!a.ok)throw a.error;const c=a.result;Object.assign(o,c.entries),r.push(...c.diagnostics)}}return{entries:o,diagnostics:r}}async function Oo(e,t){let n={revision:"",versions:{}};for(let o=0;o<t.length;o+=Le){const r=t.slice(o,o+Le),s=await e.changesDiscard({names:r.map(i=>i.name),ifMatch:Object.fromEntries(r.map(i=>[i.name,i.version]))});n={revision:s.revision,versions:{...n.versions,...s.versions}}}return n}function To(e){return e instanceof T&&e.code===w.Conflict}function tt(e){return e?.kind==="protocol"?e:null}function _o(e,t,n){const o=P.c(14);let r;o[0]!==n?(r={},o[0]=n,o[1]=r):r=o[1];const s=r,i=q();let a;o[2]!==e?(a=tt(e),o[2]=e,o[3]=a):a=o[3];const c=a,l=!!c&&!!t&&s.enabled!==!1;let d;o[4]!==t?(d=v.contentChanges(t??""),o[4]=t,o[5]=d):d=o[5];let u;o[6]!==t||o[7]!==l||o[8]!==c||o[9]!==i?(u=l?()=>Jt(i,c.client,t):Ye,o[6]=t,o[7]=l,o[8]=c,o[9]=i,o[10]=u):u=o[10];let f;return o[11]!==d||o[12]!==u?(f={queryKey:d,queryFn:u,staleTime:0},o[11]=d,o[12]=u,o[13]=f):f=o[13],U(f)}function No(e,t,n){const o=P.c(14);let r;o[0]!==e?(r=tt(e),o[0]=e,o[1]=r):r=o[1];const s=r;let i;o[2]!==n?(i=n?Object.keys(n.changes):[],o[2]=n,o[3]=i):i=o[3];const a=i,c=!!s&&!!t&&!!n&&a.length>0;let l;o[4]!==t||o[5]!==n?.revision?(l=v.contentChangeSides(t??"",n?.revision??""),o[4]=t,o[5]=n?.revision,o[6]=l):l=o[6];let d;o[7]!==c||o[8]!==a||o[9]!==s?(d=c?()=>Yt(s.client,a):Ye,o[7]=c,o[8]=a,o[9]=s,o[10]=d):d=o[10];let u;return o[11]!==l||o[12]!==d?(u={queryKey:l,queryFn:d,staleTime:Number.POSITIVE_INFINITY},o[11]=l,o[12]=d,o[13]=u):u=o[13],U(u)}function nt(e){try{const t=new URL(e);if(t.protocol!=="http:"&&t.protocol!=="https:")return!1;const n=t.hostname.toLowerCase();return n==="127.0.0.1"||n==="[::1]"||n==="localhost"}catch{return!1}}function Z(e){try{const t=new URL(e);return(t.hostname==="127.0.0.1"||t.hostname==="[::1]")&&(t.hostname="localhost"),t.href}catch{return e}}const ot=Nt({endpoint:Dt().max(2048).refine(e=>nt(e)&&new URL(e).pathname==="/rpc").transform(Z)});function Do(e){const t=new URLSearchParams(e.replace(/^#/,"")),n=ot.safeParse({endpoint:t.get("endpoint")??""});return n.success?n.data:null}function rt(e){const t=ot.safeParse(e);return t.success?t.data:null}const st="studio:deco-serve-last";function Ro(e){try{localStorage.setItem(st,JSON.stringify(e))}catch{}}function xo(){try{const e=localStorage.getItem(st);return e?rt(JSON.parse(e)):null}catch{return null}}function Po(e){try{return new URL(Z(e)).host}catch{return e}}function Wt(e,t=1e4){return Math.min(1e3*2**Math.max(0,e-1),t)}const zt="http://localhost:4545/rpc",Ao="npx @decocms/blocks serve",$o="npx @decocms/blocks schema";class Ee extends Error{constructor(t="the endpoint isn't deco serve"){super(t),this.name="NotDecoServeError"}}function Xt(e){if(e instanceof Ee)return{reason:"not-deco-serve"};if(!(e instanceof T))return{reason:"not-answering"};switch(e.code){case w.Unauthorized:case w.MethodNotFound:return{reason:"outdated"};case w.Unsupported:return Se(e)?{reason:"outdated"}:{reason:"version-mismatch"};case w.Unavailable:return/^the endpoint answered HTTP/.test(e.message)?{reason:"not-deco-serve"}:{reason:"error",detail:e.message};default:return{reason:"error",detail:e.message}}}function Lo(e,t){if(e)return[Z(e.endpoint)];const n=[t?.endpoint,zt].filter(o=>!!o).map(Z);return[...new Set(n)]}const it=F.createContext(null);function Zt(e){const t=P.c(27),n=F.useContext(it),o=we(n?null:e),{data:r}=Rt.useSession(),s=r?.user?.id??"",i=!!e&&!!s;let a;t[0]!==i||t[1]!==s||t[2]!==e?(a=i?ce.decoServeConnection(s,e):null,t[0]=i,t[1]=s,t[2]=e,t[3]=a):a=t[3];const[c,l]=Fe(a);let d;t[4]!==i||t[5]!==s||t[6]!==e?(d=i?ce.decoServeEndpoint(s,e):null,t[4]=i,t[5]=s,t[6]=e,t[7]=d):d=t[7];const[u,f]=Fe(d);if(n)return n;let g;t[8]!==c||t[9]!==i?(g=i?rt(c):null,t[8]=c,t[9]=i,t[10]=g):g=t[10];const m=g,k=!!m;let C;t[11]!==o||t[12]!==k?(C=en(o,k),t[11]=o,t[12]=k,t[13]=C):C=t[13];const{applies:R,undecided:_}=C,N=R?m:null,I=i&&o==="v8"&&typeof u=="string"?u:null;let O;t[14]!==f||t[15]!==l||t[16]!==i?(O=S=>{i&&(l(S),f(S.endpoint))},t[14]=f,t[15]=l,t[16]=i,t[17]=O):O=t[17];let p;t[18]!==l||t[19]!==i?(p=()=>{i&&l(null)},t[18]=l,t[19]=i,t[20]=p):p=t[20];let y;return t[21]!==N||t[22]!==I||t[23]!==O||t[24]!==p||t[25]!==_?(y={connection:N,undecided:_,lastEndpoint:I,set:O,clear:p},t[21]=N,t[22]=I,t[23]=O,t[24]=p,t[25]=_,t[26]=y):y=t[26],y}function en(e,t){return t?e==="loading"?{applies:!1,undecided:!0}:{applies:e==="v8"||e==="error",undecided:!1}:{applies:!1,undecided:!1}}function Ue(e){try{const t=localStorage.getItem(e);return t===null?null:JSON.parse(t)}catch{return null}}function Fe(e){const t=P.c(17),n=q(),o=e??"";let r;t[0]!==o?(r=["localStorage",o],t[0]=o,t[1]=r):r=t[1];const s=r;let i,a;t[2]!==e?(i=()=>e?Ue(e):null,a=()=>e?Ue(e):null,t[2]=e,t[3]=i,t[4]=a):(i=t[3],a=t[4]);const c=!!e;let l;t[5]!==s||t[6]!==i||t[7]!==a||t[8]!==c?(l={queryKey:s,queryFn:i,initialData:a,enabled:c,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[5]=s,t[6]=i,t[7]=a,t[8]=c,t[9]=l):l=t[9];const{data:d}=U(l);let u;t[10]!==e||t[11]!==n||t[12]!==s?(u=k=>{if(e){try{k===null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(k))}catch{}n.setQueryData(s,k)}},t[10]=e,t[11]=n,t[12]=s,t[13]=u):u=t[13];const f=u,g=e?d??null:null;let m;return t[14]!==f||t[15]!==g?(m=[g,f],t[14]=f,t[15]=g,t[16]=m):m=t[16],m}function Uo(e){return e.kind==="protocol"||e.kind==="unavailable"}function Fo(e){const t=e.hasOrg?e.orgFlag:!1,{backend:n}=e;return n==="protocol"||n==="unavailable"?!0:n==="pending"?t===!0?!0:void 0:t}function Mo(e,t,n){return t!=="github"||n!=="v8"?!1:e.kind==="pending"?!0:e.kind==="unavailable"&&e.siteNotOwned?!1:(e.kind==="protocol"||e.kind==="unavailable")&&e.source==="github"}function jo(e){if(e.kind!=="protocol"||e.source!=="local")return null;const t=e.describe.preview?.url;return t&&nt(t)?t:null}function Bo(e,t){return e.kind!=="protocol"||e.source!=="local"||!e.describe.assets||!t?null:new URL(t.endpoint).origin}function at(e){return e.hasServeConnection?"local":e.runtime==="sandbox"?"sandbox":"github"}function tn(e){if(!e.hasProject)return"legacy";const t=at(e);if(t==="local")return"protocol-local";if(e.serveConnectionUndecided)return"pending";if(t==="sandbox"){const o=e.sandboxSite;return o==="v8"?"protocol-sandbox":o==="v7"?"legacy":o==="error"?e.markedV8?"retrying-sandbox":"legacy":"pending"}if(e.mainSchema==="loading")return"pending";if(e.mainSchema==="error")return"retrying-github";if(e.mainSchema==="v7")return"legacy";const n=e.githubSite;return n==="v8"?"protocol-github":n==="not-owned"?"site-not-owned-github":n==="error"?"unavailable-github":n==="v7"?"legacy":"pending"}function nn(e){return{github:e.mode==="github"&&e.mainSchema==="v8",sandbox:e.mode==="sandbox"&&e.workingTreeReady}}function Me(e){return e.isError||e.errorUpdateCount>0}function on(e,t,n){if(!t||n.size===0)return e;const o={...e};for(const r of n)Object.hasOwn(t,r)?o[r]=t[r]:delete o[r];return o}function rn(e){if(!e||typeof e!="object")return[];const t=e,n=[];return typeof t.blockKey=="string"&&n.push(t.blockKey),t.writes&&typeof t.writes=="object"&&n.push(...Object.keys(t.writes)),Array.isArray(t.deletes)&&n.push(...t.deletes.filter(o=>typeof o=="string")),n}function oe(e){return{[$t]:e}}class ke extends Error{status=409;constructor(){super("main's schema changed")}}async function Ce(e){return e.status!==409?!1:(await e.clone().json().catch(()=>null))?.code===Lt}function Ie(e,t,n){e.resetQueries({predicate:o=>{const r=o.queryKey;return r[1]!==t||r[2]!==n?!1:r[0]===v.mainSchemaV8(t,n)[0]||r[0]===v.contentBackend()[0]&&r[4]==="github"}})}function ct(e,t,n){return e.getQueryData(v.mainSchemaV8(t,n))}const lt="__noSchema";function sn(){return{manifest:{blocks:{}},schema:{definitions:{},root:{}},[lt]:!0}}function Qo(e){return!!e&&e[lt]===!0}function ut(e){if(!e.ok)return e.error.code===w.NotFound;const t=e.result;return t.notModified===!1&&t.schema===null}function an(e,t){return(typeof t.name=="string"?t.name.trim():"")||e}const cn=(e,t)=>e.label.localeCompare(t.label)||e.key.localeCompare(t.key);function Vo(e){const t=new Map;for(const[n,o]of Object.entries(e)){const r=o&&typeof o=="object"&&!Array.isArray(o)?o:{},s=typeof r.__resolveType=="string"?r.__resolveType:null,i=t.get(s)??[];i.push({key:n,label:an(n,r)}),t.set(s,i)}return[...t.entries()].map(([n,o])=>({resolveType:n,blocks:o.sort(cn)})).sort((n,o)=>n.resolveType===null?1:o.resolveType===null?-1:je(n.resolveType).localeCompare(je(o.resolveType))||n.resolveType.localeCompare(o.resolveType))}function je(e){return(e.split("/").filter(Boolean).at(-1)??e).replace(/\.(tsx?|jsx?)$/,"")||e}function Be(e,t,n){if(t.length===0)return n;const[o,...r]=t;if(Array.isArray(e)&&typeof o=="number"){const s=e.slice();return s[o]=Be(e[o],r,n),s}if(e&&typeof e=="object"&&typeof o=="string"){const s=e,i={};for(const a of Object.keys(s))i[a]=a===o?Be(s[a],r,n):s[a];return i}return e}function Ho(e){if(e.trim()==="")return null;const t=Number(e);return Number.isFinite(t)?t:null}class Qe extends Error{}class Ve extends Error{}const dt="site-not-owned";async function ln(e){return e.status!==409?!1:(await e.clone().json().catch(()=>null))?.code==="site_not_owned"}async function un(e,t=r=>fetch(r),n,o){const r=ye({endpoint:e,fetch:async s=>{const i=new Request(s);for(const[c,l]of Object.entries(oe("v8")))i.headers.set(c,l);const a=await t(i);if(await ln(a))throw new Ve;if(await Ce(a))throw n?.(),new ke;return a}});try{const s=await Te(r,le(o)?{schema:o}:void 0);return s.v8Schema?s:null}catch(s){if(s instanceof Ve)return dt;throw s}}const Oe=5e3;function dn(e){return new URL(`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}/rpc`,window.location.origin).href}function fn(e){return new URL(ne(e,"rpc"),window.location.origin).href}async function Te(e,t){const[n,o]=await e.batch(t?[{method:"describe"}]:[{method:"describe"},{method:"schema.get"}]);if(!n?.ok)throw n?.error??new Error("no describe");if(n.result?.protocol!==K)throw new Ee;const s=Ze(n.result);if(t)return{client:e,describe:s,hasSchema:t.schema!=null,v8Schema:le(t.schema)};if(!o)throw new Error("no schema.get");if(ut(o))return{client:e,describe:s,hasSchema:!1,v8Schema:!1};if(o.ok){const i=o.result;return{client:e,describe:s,hasSchema:!0,v8Schema:le(i?.schema)}}throw o.error}async function hn(e,t=n=>fetch(n)){const n=ye({endpoint:e,fetch:async o=>{const r=await t(o);if(r.status===404)throw new Qe;return r}});try{const o=await Te(n);return o.v8Schema?o:null}catch(o){if(o instanceof Qe)return null;throw o}}function ft(e,t){const n=P.c(53),{org:o}=xt(),{connection:r,undecided:s}=Zt(e),{runtime:i}=We(e),a=F.useContext(it),c=we(a?null:e),l=Ut(e),d=at({hasServeConnection:!!r,runtime:i}),u=jt()?.taskId??null,f=Bt(Qt().lifecycle.phase),g=q(),m=nn({mode:d,mainSchema:c,workingTreeReady:f}),k=m.github&&!!o.slug&&!!e&&!!t;let C;n[0]!==t||n[1]!==o.slug||n[2]!==g||n[3]!==e?(C=()=>un(dn({orgSlug:o.slug,virtualMcpId:e,branch:t}),void 0,()=>Ie(g,o.slug,e),ct(g,o.slug,e)?.schema),n[0]=t,n[1]=o.slug,n[2]=g,n[3]=e,n[4]=C):C=n[4];const R=U({queryKey:v.contentBackend(o.slug,e??"",t??"","github"),queryFn:C,enabled:k,staleTime:Number.POSITIVE_INFINITY,...He}),_=m.sandbox&&!!o.slug&&!!e&&!!t;let N;n[5]!==t||n[6]!==o.slug||n[7]!==u||n[8]!==e?(N=async()=>hn(fn({orgSlug:o.slug,virtualMcpId:e,branch:t,threadId:u})),n[5]=t,n[6]=o.slug,n[7]=u,n[8]=e,n[9]=N):N=n[9];const I=U({queryKey:v.contentBackend(o.slug,e??"",t??"","sandbox",u??""),queryFn:N,enabled:_,staleTime:Number.POSITIVE_INFINITY,...He}),O=!!r;let p;n[10]!==r?.endpoint||n[11]!==o.slug||n[12]!==e?(p=v.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[10]=r?.endpoint,n[11]=o.slug,n[12]=e,n[13]=p):p=n[13];let y;n[14]!==r?(y=()=>Te(ye({endpoint:r.endpoint})),n[14]=r,n[15]=y):y=n[15];let S;n[16]!==O||n[17]!==p||n[18]!==y?(S={queryKey:p,queryFn:y,enabled:O,staleTime:Number.POSITIVE_INFINITY,retry:vn,retryDelay:mn,refetchInterval:gn},n[16]=O,n[17]=p,n[18]=y,n[19]=S):S=n[19];const b=U(S);let A;n[20]!==r?.endpoint||n[21]!==o.slug||n[22]!==e?(A=v.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[20]=r?.endpoint,n[21]=o.slug,n[22]=e,n[23]=A):A=n[23];const $=A;let E;n[24]!==r?.endpoint||n[25]!==o.slug||n[26]!==e?(E=v.contentBackend(o.slug,e??"","local-describe",r?.endpoint??""),n[24]=r?.endpoint,n[25]=o.slug,n[26]=e,n[27]=E):E=n[27];let D;n[28]!==b.data||n[29]!==$||n[30]!==g?(D=async()=>{try{return await b.data.client.describe()}catch(h){const G=h;throw g.invalidateQueries({queryKey:$,exact:!0},{cancelRefetch:!1}),G}},n[28]=b.data,n[29]=$,n[30]=g,n[31]=D):D=n[31];const x=!!b.data&&!a;let M;n[32]!==E||n[33]!==D||n[34]!==x?(M={queryKey:E,queryFn:D,enabled:x,refetchInterval:Oe,retry:!1},n[32]=E,n[33]=D,n[34]=x,n[35]=M):M=n[35];const Q=U(M).data??b.data?.describe,L=tn({hasProject:!!e,hasServeConnection:!!r,serveConnectionUndecided:s,runtime:i,mainSchema:c,githubSite:R.data===dt?"not-owned":R.data?"v8":R.data===null?"v7":Me(R)?"error":"loading",sandboxSite:bn({data:I.data,isError:Me(I),workingTreeReady:f}),markedV8:l});if(L==="pending"){let h;return n[36]===Symbol.for("react.memo_cache_sentinel")?(h={kind:"pending"},n[36]=h):h=n[36],h}if(L==="retrying-github"){let h;return n[37]===Symbol.for("react.memo_cache_sentinel")?(h={kind:"pending",retrying:"github"},n[37]=h):h=n[37],h}if(L==="retrying-sandbox"){let h;return n[38]===Symbol.for("react.memo_cache_sentinel")?(h={kind:"pending",retrying:"sandbox"},n[38]=h):h=n[38],h}if(L==="legacy"){let h;return n[39]===Symbol.for("react.memo_cache_sentinel")?(h={kind:"legacy"},n[39]=h):h=n[39],h}if(L==="protocol-github"){const h=R.data;let G;return n[40]!==h?(G=ge("github",h,""),n[40]=h,n[41]=G):G=n[41],G}if(L==="site-not-owned-github"){let h;return n[42]===Symbol.for("react.memo_cache_sentinel")?(h={kind:"unavailable",source:"github",siteNotOwned:!0},n[42]=h):h=n[42],h}if(L==="protocol-sandbox"){let h;return n[43]!==I.data?(h=ge("sandbox",I.data,":sandbox"),n[43]=I.data,n[44]=h):h=n[44],h}if(L==="unavailable-github"){let h;return n[45]===Symbol.for("react.memo_cache_sentinel")?(h={kind:"unavailable",source:"github"},n[45]=h):h=n[45],h}const ie=b.error??b.failureReason,ae=r?.endpoint??"";let Y;return n[46]!==Q||n[47]!==b.data||n[48]!==b.failureCount||n[49]!==b.isError||n[50]!==ie||n[51]!==ae?(Y=wn({probed:b.data,isError:b.isError,failureCount:b.failureCount,failure:ie,describe:Q,endpoint:ae}),n[46]=Q,n[47]=b.data,n[48]=b.failureCount,n[49]=b.isError,n[50]=ie,n[51]=ae,n[52]=Y):Y=n[52],Y}function gn(e){return e.state.status==="error"||e.state.data?.v8Schema===!1?Oe:!1}function mn(e){return Wt(e+1)}function vn(e,t){return!(t instanceof T)&&!(t instanceof Ee)}function bn(e){return e.data!==void 0?e.data?"v8":"v7":e.workingTreeReady?e.isError?"error":"loading":"unavailable"}const pn=3;function wn(e){if(e.probed?.hasSchema&&!e.probed.v8Schema)return{kind:"unavailable",source:"local",problem:{reason:"not-v8"}};const t=e.probed?ge("local",{...e.probed,describe:e.describe??e.probed.describe},`:serve:${e.endpoint}`):null;return e.isError||e.failureCount>0?t?.kind==="protocol"&&!e.isError&&e.failureCount<pn?t:{kind:"unavailable",source:"local",problem:Xt(e.failure)}:t??{kind:"pending"}}const He={retry:2,refetchInterval:e=>e.state.status==="error"?Oe:!1};function ge(e,t,n){return{kind:"protocol",source:e,client:t.client,describe:t.describe,cacheKeySuffix:n,hasSchema:t.hasSchema}}function ht(e){const t=P.c(13);let n;t[0]!==e?(n=ce.localPreviewUrl(e??""),t[0]=e,t[1]=n):n=t[1];const o=n,[r,s]=Pt(o,null),i=we(e);let a;if(t[2]!==i||t[3]!==r||t[4]!==e){const f=e?xe(r):null;a=yn({saved:f,main:i}),t[2]=i,t[3]=r,t[4]=e,t[5]=a}else a=t[5];const c=a;let l,d;t[6]!==s?(l=f=>s(xe(f)),d=()=>s(null),t[6]=s,t[7]=l,t[8]=d):(l=t[7],d=t[8]);let u;return t[9]!==c||t[10]!==l||t[11]!==d?(u={...c,setUrl:l,clear:d},t[9]=c,t[10]=l,t[11]=d,t[12]=u):u=t[12],u}function yn(e){return e.saved?e.main==="v7"?{url:e.saved,undecided:!1}:e.main==="v8"?{url:null,undecided:!1}:{url:null,undecided:!0}:{url:null,undecided:!1}}function Sn(e,t){const n=(e??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${t}`:t}function Ge(e){let t;try{t=JSON.parse(e)}catch{return null}return typeof t!="object"||t===null||Array.isArray(t)?null:t}class _e extends Error{constructor(t,n,o=[]){super(n),this.blocks=t,this.fields=o,this.name="BlockConflictError"}blocks;fields}function Ne(e){return`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`}function re(e,t,n){return["decofile-write",e,t,n]}function En(e,t,n){return{id:re(e,t,n).join(":")}}function De(e){return`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`}async function kn(e,t){const n=await e.json().catch(()=>({}));throw new Error(n.error??`${t} failed (${e.status})`)}function Cn(e,t,n){e.setQueryData(v.decofileDraft(Ne(t)),n)}function In(e,t){return e.getQueryData(v.decofileDraft(Ne(t)))??null}async function On(e,t){const n=await fetch(De(e),{cache:"no-store",headers:{...oe("v7"),"if-none-match":`"${t}"`}}).catch(()=>null);return n?.status===200||n?.status===409}function Go(e){const t=P.c(4);let n;t[0]!==e?(n=v.decofileDraft(e?Ne(e):""),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:Tn,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=U(o);return r??null}async function Tn(){throw new Error("decofileDraft is populated by reads/writes, not fetched")}async function _n(e,t){const n=await fetch(De(t),{cache:"no-store",headers:oe("v7")});if(await Ce(n))throw Ie(e,t.orgSlug,t.virtualMcpId),new ke;if(!n.ok){const r=new Error(`Failed to fetch decofile: ${n.status}`);throw r.status=n.status,r}const o=await n.json();return o.token&&Cn(e,t,{version:o.version,token:o.token,apiHost:o.apiHost??window.location.host}),o.decofile}async function Ko(e,t){const n=await fetch(De(e),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(n.status===409){const r=await n.json().catch(()=>({}));throw r.code==="block-conflict"?new _e(r.blocks??[],r.error??"Block changed"):new Error(r.error??`Save failed (${n.status})`)}if(!n.ok)return kn(n,"Save");const o=await n.json();return{...o,apiHost:o.apiHost??window.location.host}}const gt=3e3,Nn=15e3,Dn=2*6e4,mt={now:()=>Date.now(),setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),hidden:()=>typeof document<"u"&&document.visibilityState==="hidden"};function Rn(e){return e<Dn?gt:Nn}function xn(e,t=mt){const n=t.now();let o=!1,r=!1,s=null;const i=()=>{o||(s=t.setTimeout(a,Rn(t.now()-n)))},a=()=>{if(s=null,o)return;const{read:c,skip:l}=e();if(r||t.hidden()||l?.()){i();return}r=!0;let d;try{d=c()}catch{d=void 0}Promise.resolve(d).catch(()=>{}).finally(()=>{r=!1}),i()};return i(),()=>{o=!0,s!==null&&t.clearTimeout(s)}}const Ke=()=>0;function Pn(e,t,n=mt){const o=F.useRef(t);o.current=t;const[r]=F.useState(()=>({polling:()=>xn(()=>o.current,n),idle:()=>()=>{}}));F.useSyncExternalStore(e?r.polling:r.idle,Ke,Ke)}function vt(e,t){return ne(e,t)}function An(e,t){return ne(e,"preview-fetch",{path:t})}function qo(e){return vt(e,"preview-invoke")}function Jo(e){return vt(e,"catalog-invoke")}function bt(e){try{const{hostname:t}=new URL(e);return t==="localhost"||t.endsWith(".localhost")||t==="127.0.0.1"||t==="::1"}catch{return!1}}function $n(){if(typeof document>"u")return null;const e=Array.from(document.querySelectorAll("iframe"));for(const t of e){const n=t.getAttribute("src");if(n&&bt(n))return n}return null}function Ln(e,t){const n=e.previewUrl??e.getFallbackPreviewUrl?.()??$n();return n&&bt(n)?new URL(t,n).toString():An(e,t)}function Un(e){return Ln(e,"/.decofile")}function Fn(e){return e===400?"absent":e===404?"unavailable":e>=200&&e<300?"ok":"error"}function qe(e){return e.liveOk||e.committedAbsent?404:e.liveStatus??502}async function Mn(e,t){const n=ne(e,"read"),o=await fetch(n,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:t,full:!0})}),r=Fn(o.status);if(r==="absent")return{kind:"absent"};if(r==="unavailable")return{kind:"unavailable"};if(r==="error"){const i=new Error(`Failed to read ${t}: ${o.status}`);throw i.status=o.status,i}const s=await o.json();return typeof s.content!="string"?{kind:"unavailable"}:{kind:"data",data:Ft(s.content)}}async function jn(e,t){const n=await Mn(e,t);if(n.kind!=="data")return n;try{return{kind:"data",data:JSON.parse(n.data)}}catch{return{kind:"unavailable"}}}async function Yo(e){const t=`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}/meta`,n=await fetch(t,{cache:"no-store"});if(n.status===404)return{kind:"absent"};if(!n.ok){const o=new Error(`Failed to read committed meta: ${n.status}`);throw o.status=n.status,o}try{return{kind:"data",data:await n.json()}}catch{return{kind:"unavailable"}}}function Bn(e){return Mt(e)?.metadata?.runtime?.path??null}class pt extends Error{constructor(t){super(t instanceof Error?t.message:String(t),{cause:t}),this.name="ServeLostError"}}function Wo(e){return e instanceof T&&e.code===w.Conflict}function wt(e){const t=e.data?.violations;return!Array.isArray(t)||t.length===0?e.message:t.slice(0,3).map(n=>n.message).join("; ")}function Qn(e,t,n){if(t instanceof _e)return t.message;if(n==="local")return Hn(e,t);if(t instanceof T)switch(t.code){case w.Conflict:return e("siteEditor.save.conflict");case w.ReadOnly:return e("siteEditor.save.readOnly");case w.InvalidBlock:case w.InvalidParams:return e("siteEditor.save.invalid");case w.LimitExceeded:return e("siteEditor.save.tooLarge")}return e("siteEditor.save.failed")}function Vn(e,t){if(t==="local"||e instanceof _e)return null;if(e instanceof T){const n=e.code===w.InvalidBlock||e.code===w.InvalidParams?wt(e):e.message;return n?`${e.code}: ${n}`:null}return e.message||null}function Hn(e,t){if(t instanceof pt)return e("decoServe.save.serverGone");if(t instanceof T)switch(t.code){case w.Conflict:return e("decoServe.save.conflict");case w.ReadOnly:return e("decoServe.save.readOnly");case w.InvalidBlock:case w.InvalidParams:return e("decoServe.save.invalid",{detail:wt(t)});case w.LimitExceeded:return e("decoServe.save.tooLarge")}return e("sectionsEditor.sectionsEditor.saveFailed",{error:t.message})}function Gn(e,t,n){return e===null?0:Math.max(0,n-Math.max(0,t-e))}function Kn(e,t){const[n,o]=F.useState(e),r=F.useRef(null);return e&&!n&&o(!0),F.useEffect(()=>{if(e){r.current??=Date.now();return}if(!n)return;const s=()=>{r.current=null,o(!1)},i=Gn(r.current,Date.now(),t);if(i===0){s();return}const a=setTimeout(s,i);return()=>clearTimeout(a)},[e,n,t]),n}const yt={phase:"idle",inFlight:0,reload:{seq:0,navigates:!1},epoch:0},qn=15e3,ee=new Map;function H(e,t){return`${e}/${t}`}function j(e){let t=ee.get(e);return t||(t={state:yt,listeners:new Set,previews:0,timer:null,discardListeners:new Set},ee.set(e,t)),t}function B(e,t){const n=j(e);n.state={...n.state,...t};for(const o of n.listeners)o()}function se(e){e.timer&&clearTimeout(e.timer),e.timer=null}function Re(e){return ee.get(e)?.state??yt}function Jn(e,t){const n=j(e);return n.listeners.add(t),()=>{n.listeners.delete(t)}}function zo(e){const t=j(e);return t.previews++,()=>{t.previews--,t.previews===0&&t.state.phase==="reloading"&&(se(t),B(e,{phase:"idle"}))}}function Xo(e){const t=ee.get(e);!t||t.state.phase!=="reloading"||(se(t),B(e,{phase:"idle"}))}function St(e){const t=j(e);se(t),B(e,{phase:"saving",inFlight:t.state.inFlight+1})}function me(e,t){const n=j(e),o=Math.max(0,n.state.inFlight-1);if(o>0){B(e,{inFlight:o});return}if(!t.ok||n.previews===0){B(e,{phase:"idle",inFlight:o});return}Et(e,t.navigates,o)}function Et(e,t,n=0){const o=j(e);se(o),o.timer=setTimeout(()=>{o.timer=null,o.state.phase==="reloading"&&B(e,{phase:"idle"})},qn),B(e,{phase:"reloading",inFlight:n,reload:{seq:o.state.reload.seq+1,navigates:t}})}function Yn(e){return e?.kind==="protocol"&&e.source==="github"}async function ve(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s,backend:i,cacheKey:a}=e,c=t.kind==="publish"||t.kind==="reapply"?n.invalidateQueries({queryKey:v.hostedReleases(o,r)}):null;if(i?.kind!=="protocol")return await c,{navigates:!1};const l=s?v.protocolDraftRead(o,r,s):null,d=l?JSON.stringify(n.getQueryData(l)??null):null,u=c?[c]:[];if(a&&t.reread&&u.push(n.invalidateQueries({queryKey:v.decofile(a)})),a&&u.push(n.invalidateQueries({queryKey:v.contentChanges(a)})),s&&i.source==="sandbox"&&u.push(n.invalidateQueries({queryKey:Vt(o,r,s)})),Yn(i)&&l&&u.push(n.invalidateQueries({queryKey:l})),await Promise.all(u),t.kind!=="edit"){const m=H(o,r);B(m,{epoch:Re(m).epoch+1})}const f=l?JSON.stringify(n.getQueryData(l)??null):null,g=d!==f;return g&&await new Promise(m=>At.schedule(m)),{navigates:g}}async function Wn(e,t){return St(H(e.orgSlug,e.virtualMcpId)),kt(e,t)}async function kt(e,t){const n=H(e.orgSlug,e.virtualMcpId);let o;try{o=await t.write()}catch(s){throw me(n,{ok:!1,navigates:!1}),t.refreshOnError&&ve(e,{kind:t.kind,reread:!0}).catch(()=>{}),s}let r=!1;try{({navigates:r}=await ve(e,t))}catch{}finally{me(n,{ok:!0,navigates:r})}return o}function Zo(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s}=e,i=H(o,r),a=new Set(t.blockKeys);for(const d of[...j(i).discardListeners])d(a);St(i);let c=!1;const l=()=>(c=!0,kt(e,{kind:"discard",reread:!0,write:t.write}));return s?n.getMutationCache().build(n,{mutationKey:re(o,r,s),scope:En(o,r,s),mutationFn:l}).execute(void 0).catch(d=>{throw c||me(i,{ok:!1,navigates:!1}),d}):l()}function er(e,t,n){const o=P.c(8);let r;o[0]!==e||o[1]!==t?(r=H(e,t),o[0]=e,o[1]=t,o[2]=r):r=o[2];const s=r;let i;o[3]!==n||o[4]!==s?(i=()=>{const c=j(s).discardListeners;return c.add(n),()=>{c.delete(n)}},o[3]=n,o[4]=s,o[5]=i):i=o[5];let a;o[6]!==s?(a=[s],o[6]=s,o[7]=a):a=o[7],F.useEffect(i,a)}function zn(e){const t=H(e.orgSlug,e.virtualMcpId);Re(t).inFlight>0||ve(e,{kind:"external"}).then(({navigates:n})=>{const o=j(t);o.previews>0&&o.state.inFlight===0&&Et(t,n)}).catch(()=>{})}function Xn(e,t){const n=P.c(7);let o;n[0]!==e||n[1]!==t?(o=H(e,t),n[0]=e,n[1]=t,n[2]=o):o=n[2];const r=o;let s;n[3]!==r?(s=l=>Jn(r,l),n[3]=r,n[4]=s):s=n[4];const i=s;let a;n[5]!==r?(a=()=>Re(r),n[5]=r,n[6]=a):a=n[6];const c=a;return F.useSyncExternalStore(i,c,c)}const Zn=500;function tr(e,t){const{phase:n}=Xn(e,t);return Kn(n!=="idle",Zn)}function eo(e){const t=new Error(`${e} unavailable (content server unreachable)`);return t.status=502,t}function to(e,t){return v.liveMeta(e.orgSlug,e.virtualMcpId,e.branch,`protocol${t.cacheKeySuffix}`,"")}function nr(e,t,n){const o=e.getQueryData(v.contentVersions(t));if(!o)return;if(Object.hasOwn(o,n))return o[n];const r=e.getQueryData(v.decofile(t));return r&&Object.hasOwn(r,n)?void 0:null}function Ct(e,t,n){e.setQueryData(v.contentVersions(t),o=>{const r={...o};for(const[s,i]of Object.entries(n))i===null?delete r[s]:r[s]=i;return r})}function no(e,t){const n=e.getMutationCache().findAll({mutationKey:re(t.orgSlug,t.virtualMcpId,t.branch),status:"pending"});return new Set(n.flatMap(o=>rn(o.state.variables)))}function be(e,t){e.resetQueries({queryKey:v.contentBackend(t.orgSlug,t.virtualMcpId,"local")})}async function te(e,t,n,o){try{return await o()}catch(r){const s=!(r instanceof T);throw t.source==="local"&&s?(be(e,n),new pt(r)):(t.source==="local"&&Se(r)&&be(e,n),r)}}const z=new Map;function It(e,t,n,o){const r=z.get(o);if(r)return r;const s=Ot(e,t,n,o,!0);return z.set(o,s),s.finally(()=>z.delete(o))}async function or(e,t,n,o){const r=z.get(o);return r&&await r.catch(()=>{}),It(e,t,n,o)}async function Ot(e,t,n,o,r){const s=v.decofile(o),i=to(n,t),a=v.contentRevision(o),c=e.getQueryData(s),l=e.getQueryData(i),d=e.getQueryData(a)??void 0,u=t.source==="github"&&!l?ct(e,n.orgSlug,n.virtualMcpId):void 0,f=u?.isV8&&u.schema&&u.version?u:void 0,g=l??f?.schema,m=f?{...d,schemaVersion:f.version}:d,k=r&&c?m?.revision:void 0,C=r&&g?m?.schemaVersion:void 0,R=v.contentChanges(o),_=e.getQueryData(R),[N,I,O]=await te(e,t,n,()=>t.client.batch([{method:"blocks.list",params:k?{ifNoneMatch:k}:{}},{method:"schema.get",params:C?{ifNoneMatch:C}:{}},{method:"changes.list",params:_?{ifNoneMatch:_.revision}:{}}]));if(O?.ok){const x=he(_,O.result);x&&e.setQueryData(R,x)}else O&&t.source==="local"&&Se(O.error)&&be(e,n);if(!N?.ok)throw N?.error??new Error("no blocks.list");if(!I)throw new Error("no schema.get");const p=N.result,y=ut(I),S=I.ok&&!y?I.result:null;if(p.notModified&&!c||S?.notModified&&!g)return Ot(e,t,n,o,!1);const b=p.notModified?new Set:no(e,n),A=p.notModified?c:on(p.blocks,c,b),$=y?sn():S?S.notModified?g:S.schema:I.error,E=e.getQueryData(a)?.revision,D=E!==void 0&&E!==m?.revision;if(e.setQueryData(a,{revision:D?E:p.notModified?m?.revision:p.revision,schemaVersion:S?S.notModified?m?.schemaVersion:S.version??void 0:void 0}),e.setQueryData(s,A),!p.notModified){const x=v.contentVersions(o),M=e.getQueryData(x),J={...p.versions};for(const Q of b){const L=M?.[Q];L!==void 0?J[Q]=L:delete J[Q]}e.setQueryData(x,J)}return $ instanceof T||e.setQueryData(i,$),!D&&!p.notModified&&c&&m?.revision&&p.revision!==m.revision&&zn({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o}),{blocks:A,meta:$}}async function rr(e,t,n,o,r,s){return Wn({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o},{kind:"edit",write:async()=>{const i=await te(e,t,n,()=>t.client.blocksApply({set:r.set,delete:r.delete,...s?{ifMatch:s}:{}}));e.setQueryData(v.contentRevision(o),c=>({...c,revision:i.revision}));const a=i.versions??{};return Ct(e,o,a),{revision:i.revision,versions:a}}})}async function sr(e,t,n,o,r){await e.invalidateQueries({queryKey:v.decofile(o)});let s;try{const a=(await te(e,t,n,()=>t.client.changesGet({names:[r]}))).entries[r];if(a&&a.after===null&&a.version!==null)return;s={value:a?.after??null,version:a?.version??null}}catch{const i=await te(e,t,n,()=>t.client.blocksList({}));if(i.notModified)return;s={value:i.blocks[r]??null,version:i.versions[r]??null}}e.setQueryData(v.decofile(o),i=>{const a={...i};return s.value===null?delete a[r]:a[r]=s.value,a}),Ct(e,o,{[r]:s.version})}function oo(e){const t=P.c(15),n=q();let o;t[0]!==e?.branch||t[1]!==e?.orgSlug||t[2]!==e?.virtualMcpId?(o=v.protocolDraftRead(e?.orgSlug??"",e?.virtualMcpId??"",e?.branch??""),t[0]=e?.branch,t[1]=e?.orgSlug,t[2]=e?.virtualMcpId,t[3]=o):o=t[3];let r;t[4]!==e||t[5]!==n?(r=async()=>{const g=await fetch(`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`,{cache:"no-store",headers:oe("v8")});if(await Ce(g))throw Ie(n,e.orgSlug,e.virtualMcpId),new ke;if(!g.ok)throw new Error(`draft pointer read failed: ${g.status}`);return await g.json()},t[4]=e,t[5]=n,t[6]=r):r=t[6];const s=!!e;let i;t[7]!==o||t[8]!==r||t[9]!==s?(i={queryKey:o,queryFn:r,enabled:s,staleTime:Number.POSITIVE_INFINITY},t[7]=o,t[8]=r,t[9]=s,t[10]=i):i=t[10];const{data:a,isPending:c,isError:l}=U(i),d=!!e&&c&&!l;if(!e||!a?.draft||!a.version){let g;return t[11]!==d?(g={pointer:null,pending:d},t[11]=d,t[12]=g):g=t[12],g}const u=`${a.draft}@${a.version}`;let f;return t[13]!==u?(f={pointer:u,pending:!1},t[13]=u,t[14]=f):f=t[14],f}function ir(e){return oo(e).pointer}function ar(e){const t=P.c(4);let n;t[0]!==e?(n=v.contentRevision(e),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:ro,staleTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=U(o);return r?.revision}async function ro(){throw new Error("content revisions are set by reads and writes")}function Je(e){const t=`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`;return e.protocolSuffix?`${t}${e.protocolSuffix}`:e.localPreviewUrl?`${t}:local:${e.localPreviewUrl}`:t}function so(e,t){const n=P.c(6),{url:o}=ht(e?.virtualMcpId),r=ft(e?.virtualMcpId,e?.branch);if(!e)return"";let s;return n[0]!==r.cacheKeySuffix||n[1]!==r.kind||n[2]!==o||n[3]!==t?.tunnel||n[4]!==e?(s=r.kind==="protocol"?Je({...e,protocolSuffix:r.cacheKeySuffix}):Je({...e,localPreviewUrl:t?.tunnel===!1?null:o}),n[0]=r.cacheKeySuffix,n[1]=r.kind,n[2]=o,n[3]=t?.tunnel,n[4]=e,n[5]=s):s=n[5],s}function cr(e,t){const n=P.c(39),{url:o,undecided:r}=ht(e?.virtualMcpId),s=!!o,i=ft(e?.virtualMcpId,e?.branch),a=i.kind==="protocol"?i:null,c=so(e),l=t?.fetchEnabled??!0,d=Bn(e?.virtualMcpId),u=We(e?.virtualMcpId).runtime==="cms",f=q();let g;n[0]!==c?(g=v.decofile(c),n[0]=c,n[1]=g):g=n[1];const m=g;let k;n[2]!==e||n[3]!==f||n[4]!==m?(k=()=>{if(!e||f.isMutating({mutationKey:re(e.orgSlug,e.virtualMcpId,e.branch)})>0)return!0;const b=f.getQueryState(m);return b?.fetchStatus==="fetching"||Date.now()-(b?.dataUpdatedAt??0)<gt/2},n[2]=e,n[3]=f,n[4]=m,n[5]=k):k=n[5];let C;n[6]!==u||n[7]!==s||n[8]!==e||n[9]!==a||n[10]!==f||n[11]!==m?(C=async()=>{if(e){if(!a&&u&&!s){const b=In(f,e)?.version;if(b&&!await On(e,b))return}await f.refetchQueries({queryKey:m,exact:!0},{cancelRefetch:!1})}},n[6]=u,n[7]=s,n[8]=e,n[9]=a,n[10]=f,n[11]=m,n[12]=C):C=n[12];let R;n[13]!==k||n[14]!==C?(R={skip:k,read:C},n[13]=k,n[14]=C,n[15]=R):R=n[15],Pn(!!t?.pollWhile&&!!e,R);let _;n[16]!==i.kind||n[17]!==u||n[18]!==l||n[19]!==c||n[20]!==s||n[21]!==o||n[22]!==d||n[23]!==e||n[24]!==a||n[25]!==f?(_=async()=>{if(a)return(await It(f,a,e,c)).blocks;if(i.kind==="unavailable")throw eo("decofile");if(s){const E=await fetch(new URL("/.decofile",o).toString(),{cache:"no-store"}).catch(co),D=E?.ok?Ge(await E.text()):null;if(D)return D;const x=new Error("decofile unavailable (local tunnel unreachable)");throw x.status=502,x}if(u)return _n(f,e);const b=()=>jn(e,Sn(d,".deco/blocks.gen.json"));if(l){const E=await fetch(Un(e),{cache:"no-store"}).catch(ao);if(E?.ok){const M=Ge(await E.text());if(M)return M}const D=await b();if(D.kind==="data")return D.data;const x=new Error(`Failed to fetch decofile: ${E?.status??"network error"}`);throw x.status=qe({liveOk:!!E?.ok,liveStatus:E?.status,committedAbsent:D.kind==="absent"}),x}const A=await b();if(A.kind==="data")return A.data;const $=new Error("decofile unavailable (preview down, no committed snapshot)");throw $.status=qe({liveOk:!1,committedAbsent:A.kind==="absent"}),$},n[16]=i.kind,n[17]=u,n[18]=l,n[19]=c,n[20]=s,n[21]=o,n[22]=d,n[23]=e,n[24]=a,n[25]=f,n[26]=_):_=n[26];const N=!!e&&i.kind!=="pending"&&!r,I=a?0:3e4,O=a?.describe.pollIntervalMs,p=a?"always":void 0;let y;n[27]!==u||n[28]!==s||n[29]!==a?(y=(b,A)=>{if(a||u||s)return b<3;const $=A.status;return $!==502&&$!==404&&b<2},n[27]=u,n[28]=s,n[29]=a,n[30]=y):y=n[30];let S;return n[31]!==m||n[32]!==_||n[33]!==N||n[34]!==I||n[35]!==O||n[36]!==p||n[37]!==y?(S={queryKey:m,queryFn:_,enabled:N,staleTime:I,refetchInterval:O,refetchIntervalInBackground:!1,refetchOnWindowFocus:p,retry:y,retryDelay:io},n[31]=m,n[32]=_,n[33]=N,n[34]=I,n[35]=O,n[36]=p,n[37]=y,n[38]=S):S=n[38],U(S)}function io(e){return Ht(5e3,1e3,e,2,0)}function ao(){return null}function co(){return null}const lo="site-editor-save",uo={id:lo,description:void 0,action:void 0,cancel:void 0},lr="site-editor-undo",pe="site-editor-publish";function fo(e){const t=P.c(7),{label:n,detail:o}=e;let r;t[0]!==n?(r=V.jsx("summary",{className:"cursor-pointer select-none text-muted-foreground",children:n}),t[0]=n,t[1]=r):r=t[1];let s;t[2]!==o?(s=V.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words font-mono text-muted-foreground",children:o}),t[2]=o,t[3]=s):s=t[3];let i;return t[4]!==r||t[5]!==s?(i=V.jsxs("details",{className:"mt-1 text-xs",children:[r,s]}),t[4]=r,t[5]=s,t[6]=i):i=t[6],i}function Tt(e,t){return t?V.jsx(fo,{label:e("siteEditor.details"),detail:t}):void 0}function ur(e,t,n){X.error(Qn(e,t,n),{...uo,description:Tt(e,Vn(t,n))})}const _t={action:void 0,duration:void 0};function dr(e,t){X.success(t?e("siteEditor.publish.publishedOn",{host:t}):e("siteEditor.publish.published"),{..._t,id:pe,description:void 0})}function fr(e,{headline:t,body:n,detail:o,retry:r,pending:s,tone:i="error"}){const a=Tt(e,o??null);X[i](t,{id:pe,description:n&&a?V.jsxs(V.Fragment,{children:[V.jsx("p",{children:n}),a]}):n??a,action:r?{label:e("siteEditor.tryAgain"),onClick:c=>{c.preventDefault(),X.loading(s??e("thread.publishPopover.publishing"),{..._t,id:pe,description:void 0}),r()}}:void 0,duration:r?Number.POSITIVE_INFINITY:void 0})}function hr(e){return e instanceof Error?e.message||null:e==null?null:String(e)}export{Bo as $,zo as A,Xn as B,Xo as C,so as D,ar as E,En as F,re as G,Wn as H,Mn as I,kn as J,_e as K,Wo as L,rr as M,sr as N,ur as O,Cn as P,Ko as Q,er as R,Ao as S,it as T,Fo as U,Vo as V,je as W,Be as X,Ho as Y,$o as Z,Ln as _,Lo as a,zt as a0,Tt as a1,hr as a2,Io as a3,Co as a4,Kt as a5,Ie as a6,dr as a7,Zo as a8,Oo as a9,To as aa,Se as ab,No as ac,to as ad,Jt as ae,fo as af,_o as ag,It as ah,eo as ai,Yo as aj,jn as ak,Go as al,ir as am,oe as an,fr as ao,pe as ap,_t as aq,lr as ar,uo as as,or as at,nr as au,Jo as av,Zt as b,ht as c,Wt as d,Po as e,Xt as f,Te as g,ye as h,nt as i,qo as j,An as k,cr as l,Uo as m,Qo as n,Bn as o,Do as p,Sn as q,xo as r,Ro as s,at as t,ft as u,jo as v,tr as w,Mo as x,oo as y,H as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as te,a2 as se,o as ae,r as T,aa as ce,j as t,B as U,n as $,b1 as de,a3 as me,t as D,az as ue,c as ie,l as pe,X as ge,T as fe,V as he,U as xe,K as Q,f0 as je}from"./index-DY9jv8u5.js";import{i as ke}from"./DotsVertical-DGS_x5nz.js";import{i as le,a as ve}from"./ZoomOut-D-Ww048N.js";import{s as ye}from"./Trash01-bhcUMroB.js";import{i as Se}from"./Upload01-BwEuXdMa.js";import{S as be}from"./search-input-UGzUEySU.js";import{S as we}from"./search-toggle-09QkRcdu.js";import{f as Ce,e as De,b as Ne,A as Pe,a as Ae,d as Ee,c as Te,g as Me}from"./alert-dialog-BcRtAren.js";import{E as Y}from"./empty-state-C97rGNTx.js";import{C as Oe}from"./collection-tabs-5oBppmJp.js";import{p as Ie,S as ze,F as Fe}from"./folder-icon-CPXfYDTX.js";import{h as Re,i as $e,r as _e}from"./use-org-fs-CvYQh_B2.js";import{S as Le,H as J,f as Be}from"./location-V0VwTJTt.js";import"./SearchMd-DiO3q0AT.js";import"./icon-button-DuuXKRCk.js";import"./tooltip-CjIqGzku.js";import"./index-DPyR1fyZ.js";import"./badge-CqxA0I5-.js";import"./markdown-CQTrkEJG.js";import"./use-copy-D-ZUZJVe.js";import"./Copy01-Ck9G4OUr.js";import"./use-mobile-CqyBz8Dx.js";import"./use-panel-navigate-Co0XZmSD.js";import"./thread-route--lOZYDN5.js";import"./use-project-scope-BL3NRFI4.js";import"./repository-binding-DEE5HjOP.js";import"./use-mcp-client-owuI-9F9.js";import"./auth-vu0NBiVX.js";import"./file-preview-DYLPzEi6.js";import"./utils-Cwt2fdOd.js";import"./Image01-Cwrowq3c.js";import"./editor-CpWj2GSL.js";import"./file-type-icon-Dh-YpP4t.js";import"./useInfiniteQuery-C3FB4QSd.js";import"./infiniteQueryObserver-Glyohd4p.js";const Z=200,Ke=new Set(["node_modules","__pycache__"]);function q(s){const[,...e]=s.webkitRelativePath.split("/");return e.length>0?e.join("/"):s.name}function He(s){return q(s).split("/").every(e=>!e.startsWith(".")&&!Ke.has(e))}function Qe(s){return s.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"skill"}function Ue(s,e){const l=new Map;for(const r of s){const c=q(r).split("/");c.pop();const a=["skills",e,...c].join("/");l.set(a,[...l.get(a)??[],r])}return l}async function qe(s,e){const r=(await Promise.allSettled([...s].map(([c,a])=>e({dir:c,files:a})))).find(c=>c.status==="rejected");if(r)throw r.reason}function Ge(s,e){const l=Ie(e),r=`skills/${s}`;return{id:`home/${r}`,name:l.name??s,description:l.description,disableModelInvocation:l.disableModelInvocation,source:"home",volume:J,path:r,sandboxPath:`${Le}/${J}/${r}`}}const L="*";function B(s){return s.volume==="home"}function re(s,e){const l=s.indexOf(":");return l===-1?{label:e,glyph:le}:{label:s.slice(l+1),glyph:s.startsWith("repo:")?ue:ve}}function Xe(s){const e=ie.c(48),{entry:l,pending:r,onOpen:c,onDelete:a}=s,o=te(),{org:m}=se();let S;e[0]!==l.source||e[1]!==m.name?(S=re(l.source,m.name),e[0]=l.source,e[1]=m.name,e[2]=S):S=e[2];const{label:M,glyph:O}=S;let I;e[3]!==l?(I=B(l),e[3]=l,e[4]=I):I=e[4];const F=I,z=r?"opacity-60":"hover:bg-accent";let u;e[5]!==z?(u=pe("relative transition-colors group overflow-hidden flex flex-col h-full",z),e[5]=z,e[6]=u):u=e[6];let f;e[7]!==l.name||e[8]!==c||e[9]!==r?(f=!r&&t.jsx("button",{type:"button",onClick:c,className:"absolute inset-0 z-0","aria-label":l.name}),e[7]=l.name,e[8]=c,e[9]=r,e[10]=f):f=e[10];const b=F?"default":"system",N=!F;let w;e[11]!==O||e[12]!==b||e[13]!==N?(w=t.jsx(Fe,{glyph:O,tone:b,readOnly:N,className:"size-8 shrink-0"}),e[11]=O,e[12]=b,e[13]=N,e[14]=w):w=e[14];let h;e[15]!==a||e[16]!==o?(h=a&&t.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:t.jsxs(ge,{children:[t.jsx(fe,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"icon",children:t.jsx(ke,{size:16})})}),t.jsx(he,{align:"end",children:t.jsxs(xe,{variant:"destructive",onClick:K=>{K.stopPropagation(),a()},children:[t.jsx(ye,{size:16}),o("settings.skills.deleteButton")]})})]})}),e[15]=a,e[16]=o,e[17]=h):h=e[17];let x;e[18]!==w||e[19]!==h?(x=t.jsxs("div",{className:"flex items-start justify-between",children:[w,h]}),e[18]=w,e[19]=h,e[20]=x):x=e[20];let j;e[21]!==l.name?(j=t.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:l.name}),e[21]=l.name,e[22]=j):j=e[22];let C;e[23]!==l.description||e[24]!==o?(C=l.description||o("settings.skills.noDescription"),e[23]=l.description,e[24]=o,e[25]=C):C=e[25];let k;e[26]!==C?(k=t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:C}),e[26]=C,e[27]=k):k=e[27];let d;e[28]!==j||e[29]!==k?(d=t.jsxs("div",{className:"flex flex-col gap-1",children:[j,k]}),e[28]=j,e[29]=k,e[30]=d):d=e[30];let v;e[31]!==x||e[32]!==d?(v=t.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[x,d]}),e[31]=x,e[32]=d,e[33]=v):v=e[33];let p;e[34]!==M||e[35]!==r||e[36]!==o?(p=r?o("settings.skills.importing"):M,e[34]=M,e[35]=r,e[36]=o,e[37]=p):p=e[37];let y;e[38]!==p?(y=t.jsx("div",{className:"border-t border-border mt-auto",children:t.jsx("div",{className:"h-10 flex items-center px-4.5",children:t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:p})})}),e[38]=p,e[39]=y):y=e[39];let g;e[40]!==v||e[41]!==y?(g=t.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[v,y]}),e[40]=v,e[41]=y,e[42]=g):g=e[42];let P;return e[43]!==r||e[44]!==g||e[45]!==u||e[46]!==f?(P=t.jsxs(je,{size:"flush","aria-busy":r,className:u,children:[f,g]}),e[43]=r,e[44]=g,e[45]=u,e[46]=f,e[47]=P):P=e[47],P}function ee(s){const e=ie.c(2),{children:l}=s;let r;return e[0]!==l?(r=t.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:l}),e[0]=l,e[1]=r):r=e[1],r}function Et(){const s=te(),{org:e}=se(),l=Re(),{remove:r,upload:c}=$e("home"),a=ae(),o=T.useRef(null),[m,S]=T.useState(""),M=ce(),[O,I]=T.useState(L),[F,z]=T.useState(!1),[u,f]=T.useState(null),[b,N]=T.useState(null),[w,h]=T.useState(null),x=()=>{a.invalidateQueries({queryKey:Q.slashSkills(e.id)}),a.invalidateQueries({queryKey:Q.orgFsSkills(e.id)})},j=i=>a.setQueryData(Q.slashSkills(e.id),n=>i(n??[]));async function C(i){const n=[...i??[]];if(o.current&&(o.current.value=""),n.length===0)return;const A=n[0]?.webkitRelativePath??"";if(!A){D.error(s("settings.skills.importNeedsFolder"));return}const H=A.split("/")[0]??"",_=n.filter(He),X=_.find(E=>q(E)==="SKILL.md");if(!X){D.error(s("settings.skills.importMissingSkillMd"));return}if(_.length>Z){D.error(s("settings.skills.importTooManyFiles",{count:String(_.length),max:String(Z)}));return}const R=Qe(H),W=`skills/${R}`;let V=!1;z(!0);try{if(await _e(e.slug,"home",W)){D.error(s("settings.skills.importSlugTaken",{slug:R}));return}V=!0;const E=Ge(R,await X.text());j(oe=>[E,...oe]),h(E.id),await qe(Ue(_,R),c.mutateAsync),D.success(s("settings.skills.importSuccess",{name:R}))}catch(E){V&&await r.mutateAsync(W).catch(()=>{}),D.error(E instanceof Error?E.message:s("settings.skills.importError"))}finally{h(null),x(),z(!1)}}const k=m.toLowerCase(),d=(l.data??[]).filter(i=>i.name.toLowerCase().includes(k)||(i.description??"").toLowerCase().includes(k)).sort((i,n)=>Number(B(n))-Number(B(i))||i.name.localeCompare(n.name)),v=new Set((l.data??[]).map(i=>i.source)),p=new Map;for(const i of d)p.set(i.source,(p.get(i.source)??0)+1);const y=[{id:L,label:s("settings.skills.filterAll"),count:d.length},...[...v].map(i=>({id:i,label:re(i,e.name).label,count:p.get(i)??0}))],g=v.has(O)?O:L,P=g===L?d:d.filter(i=>i.source===g),K=i=>f(Be(i.volume,i.path)),ne=async()=>{if(!b)return;const{id:i,path:n}=b;N(null),j(A=>A.filter(H=>H.id!==i));try{await r.mutateAsync(n),D.success(s("settings.skills.deleteSuccess"))}catch(A){D.error(A instanceof Error?A.message:s("settings.skills.deleteError"))}finally{x()}},G=t.jsxs(U,{size:"sm",disabled:F,onClick:()=>o.current?.click(),children:[t.jsx(Se,{size:14}),s(F?"settings.skills.importing":"settings.skills.importButton")]});return t.jsxs($,{children:[t.jsx($.Content,{children:t.jsx($.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[M?t.jsx($.Actions,{secondary:t.jsx(we,{value:m,onChange:S,label:s("library.context.search"),placeholder:s("settings.skills.searchPlaceholder"),clearLabel:s("library.library.clearSearch")}),children:G}):t.jsx($.Title,{actions:G,children:s("settings.skills.pageTitle")}),t.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3 empty:hidden",children:!M&&t.jsx(be,{value:m,onChange:S,placeholder:s("settings.skills.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:i=>{i.key==="Escape"&&(S(""),i.target.blur())}})}),t.jsx("input",{ref:o,type:"file",multiple:!0,webkitdirectory:"",className:"hidden",onChange:i=>{C(i.target.files)}}),y.length>2&&t.jsx(Oe,{placement:"page",tabs:y,activeTab:g,onTabChange:I}),l.isPending?t.jsx("div",{className:"@container",children:t.jsx(ee,{children:Array.from({length:8},(i,n)=>t.jsx(de,{className:"h-[168px] rounded-xl"},n))})}):l.isError?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(Y,{image:t.jsx(me,{size:48,className:"text-muted-foreground"}),title:s("settings.skills.errorTitle"),description:l.error instanceof Error?l.error.message:s("settings.skills.errorDescription"),actions:t.jsx(U,{size:"sm",variant:"outline",onClick:()=>{l.refetch()},children:s("settings.skills.retry")})})}):P.length===0?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(Y,{image:t.jsx(le,{size:48,className:"text-muted-foreground"}),title:s(m?"settings.skills.noResultsTitle":"settings.skills.emptyTitle"),description:m?s("settings.skills.noResultsDescription",{search:m}):s("settings.skills.emptyDescription"),actions:!1})}):t.jsx("div",{className:"@container",children:t.jsx(ee,{children:P.map(i=>{const n=i.id===w;return t.jsx(Xe,{entry:i,pending:n,onOpen:()=>K(i),onDelete:B(i)&&!n?()=>N(i):void 0},i.id)})})})]})})}),u&&t.jsx(ze,{skillPath:u,onClose:()=>f(null)},u),t.jsx(Ce,{open:b!==null,onOpenChange:i=>!i&&N(null),children:t.jsxs(De,{children:[t.jsxs(Ne,{children:[t.jsx(Pe,{children:s("settings.skills.deleteDialogTitle")}),t.jsx(Ae,{children:s("settings.skills.deleteDialogDescription",{name:b?.name??""})})]}),t.jsxs(Ee,{children:[t.jsx(Te,{children:s("settings.skills.cancel")}),t.jsx(Me,{onClick:ne,variant:"destructive",children:s("settings.skills.deleteButton")})]})]})})]})}export{Et as default};
|
|
1
|
+
import{b as te,a2 as se,o as ae,r as T,aa as ce,j as t,B as U,n as $,b2 as de,a3 as me,t as D,az as ue,c as ie,l as pe,X as ge,T as fe,V as he,U as xe,K as Q,f0 as je}from"./index-CImJlq71.js";import{i as ke}from"./DotsVertical-MgtYn_XR.js";import{i as le,a as ve}from"./ZoomOut-CTwXyALk.js";import{s as ye}from"./Trash01-C68DqBe-.js";import{i as Se}from"./Upload01-D4h8lLWj.js";import{S as be}from"./search-input-CLbrLBK4.js";import{S as we}from"./search-toggle-Bz--u_u6.js";import{f as Ce,e as De,b as Ne,A as Pe,a as Ae,d as Ee,c as Te,g as Me}from"./alert-dialog-SFY1grIM.js";import{E as Y}from"./empty-state-CkRk6emt.js";import{C as Oe}from"./collection-tabs-BCwnkCTo.js";import{p as Ie,S as ze,F as Fe}from"./folder-icon-50i43Zdi.js";import{h as Re,i as $e,r as _e}from"./use-org-fs-qBxAqXun.js";import{S as Le,H as J,f as Be}from"./location-V0VwTJTt.js";import"./SearchMd-C1vd4NNy.js";import"./icon-button-BjI92SlL.js";import"./tooltip-BB8x2ajM.js";import"./index-DQ2PXCBR.js";import"./badge-B8Ivcb6S.js";import"./markdown-BDnIqP7U.js";import"./use-copy-CvMH5zdo.js";import"./Copy01-C8oI3ru2.js";import"./use-mobile-Nz4my9ZZ.js";import"./use-panel-navigate-D57HPY2x.js";import"./thread-route-B1rrIJuw.js";import"./use-project-scope-CnnlA-du.js";import"./repository-binding-wXpkgUS5.js";import"./use-mcp-client-BT3MLYTJ.js";import"./auth-k-50r1Jm.js";import"./file-preview-CB-QuWoi.js";import"./utils-Dc05pOUY.js";import"./Image01-BYSI_JTy.js";import"./editor-swke_0an.js";import"./file-type-icon-BlPndn8R.js";import"./useInfiniteQuery-BwyrFPWF.js";import"./infiniteQueryObserver-BPnYbZuQ.js";const Z=200,Ke=new Set(["node_modules","__pycache__"]);function q(s){const[,...e]=s.webkitRelativePath.split("/");return e.length>0?e.join("/"):s.name}function He(s){return q(s).split("/").every(e=>!e.startsWith(".")&&!Ke.has(e))}function Qe(s){return s.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"skill"}function Ue(s,e){const l=new Map;for(const r of s){const c=q(r).split("/");c.pop();const a=["skills",e,...c].join("/");l.set(a,[...l.get(a)??[],r])}return l}async function qe(s,e){const r=(await Promise.allSettled([...s].map(([c,a])=>e({dir:c,files:a})))).find(c=>c.status==="rejected");if(r)throw r.reason}function Ge(s,e){const l=Ie(e),r=`skills/${s}`;return{id:`home/${r}`,name:l.name??s,description:l.description,disableModelInvocation:l.disableModelInvocation,source:"home",volume:J,path:r,sandboxPath:`${Le}/${J}/${r}`}}const L="*";function B(s){return s.volume==="home"}function re(s,e){const l=s.indexOf(":");return l===-1?{label:e,glyph:le}:{label:s.slice(l+1),glyph:s.startsWith("repo:")?ue:ve}}function Xe(s){const e=ie.c(48),{entry:l,pending:r,onOpen:c,onDelete:a}=s,o=te(),{org:m}=se();let S;e[0]!==l.source||e[1]!==m.name?(S=re(l.source,m.name),e[0]=l.source,e[1]=m.name,e[2]=S):S=e[2];const{label:M,glyph:O}=S;let I;e[3]!==l?(I=B(l),e[3]=l,e[4]=I):I=e[4];const F=I,z=r?"opacity-60":"hover:bg-accent";let u;e[5]!==z?(u=pe("relative transition-colors group overflow-hidden flex flex-col h-full",z),e[5]=z,e[6]=u):u=e[6];let f;e[7]!==l.name||e[8]!==c||e[9]!==r?(f=!r&&t.jsx("button",{type:"button",onClick:c,className:"absolute inset-0 z-0","aria-label":l.name}),e[7]=l.name,e[8]=c,e[9]=r,e[10]=f):f=e[10];const b=F?"default":"system",N=!F;let w;e[11]!==O||e[12]!==b||e[13]!==N?(w=t.jsx(Fe,{glyph:O,tone:b,readOnly:N,className:"size-8 shrink-0"}),e[11]=O,e[12]=b,e[13]=N,e[14]=w):w=e[14];let h;e[15]!==a||e[16]!==o?(h=a&&t.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:t.jsxs(ge,{children:[t.jsx(fe,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"icon",children:t.jsx(ke,{size:16})})}),t.jsx(he,{align:"end",children:t.jsxs(xe,{variant:"destructive",onClick:K=>{K.stopPropagation(),a()},children:[t.jsx(ye,{size:16}),o("settings.skills.deleteButton")]})})]})}),e[15]=a,e[16]=o,e[17]=h):h=e[17];let x;e[18]!==w||e[19]!==h?(x=t.jsxs("div",{className:"flex items-start justify-between",children:[w,h]}),e[18]=w,e[19]=h,e[20]=x):x=e[20];let j;e[21]!==l.name?(j=t.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:l.name}),e[21]=l.name,e[22]=j):j=e[22];let C;e[23]!==l.description||e[24]!==o?(C=l.description||o("settings.skills.noDescription"),e[23]=l.description,e[24]=o,e[25]=C):C=e[25];let k;e[26]!==C?(k=t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:C}),e[26]=C,e[27]=k):k=e[27];let d;e[28]!==j||e[29]!==k?(d=t.jsxs("div",{className:"flex flex-col gap-1",children:[j,k]}),e[28]=j,e[29]=k,e[30]=d):d=e[30];let v;e[31]!==x||e[32]!==d?(v=t.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[x,d]}),e[31]=x,e[32]=d,e[33]=v):v=e[33];let p;e[34]!==M||e[35]!==r||e[36]!==o?(p=r?o("settings.skills.importing"):M,e[34]=M,e[35]=r,e[36]=o,e[37]=p):p=e[37];let y;e[38]!==p?(y=t.jsx("div",{className:"border-t border-border mt-auto",children:t.jsx("div",{className:"h-10 flex items-center px-4.5",children:t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:p})})}),e[38]=p,e[39]=y):y=e[39];let g;e[40]!==v||e[41]!==y?(g=t.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[v,y]}),e[40]=v,e[41]=y,e[42]=g):g=e[42];let P;return e[43]!==r||e[44]!==g||e[45]!==u||e[46]!==f?(P=t.jsxs(je,{size:"flush","aria-busy":r,className:u,children:[f,g]}),e[43]=r,e[44]=g,e[45]=u,e[46]=f,e[47]=P):P=e[47],P}function ee(s){const e=ie.c(2),{children:l}=s;let r;return e[0]!==l?(r=t.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:l}),e[0]=l,e[1]=r):r=e[1],r}function Et(){const s=te(),{org:e}=se(),l=Re(),{remove:r,upload:c}=$e("home"),a=ae(),o=T.useRef(null),[m,S]=T.useState(""),M=ce(),[O,I]=T.useState(L),[F,z]=T.useState(!1),[u,f]=T.useState(null),[b,N]=T.useState(null),[w,h]=T.useState(null),x=()=>{a.invalidateQueries({queryKey:Q.slashSkills(e.id)}),a.invalidateQueries({queryKey:Q.orgFsSkills(e.id)})},j=i=>a.setQueryData(Q.slashSkills(e.id),n=>i(n??[]));async function C(i){const n=[...i??[]];if(o.current&&(o.current.value=""),n.length===0)return;const A=n[0]?.webkitRelativePath??"";if(!A){D.error(s("settings.skills.importNeedsFolder"));return}const H=A.split("/")[0]??"",_=n.filter(He),X=_.find(E=>q(E)==="SKILL.md");if(!X){D.error(s("settings.skills.importMissingSkillMd"));return}if(_.length>Z){D.error(s("settings.skills.importTooManyFiles",{count:String(_.length),max:String(Z)}));return}const R=Qe(H),W=`skills/${R}`;let V=!1;z(!0);try{if(await _e(e.slug,"home",W)){D.error(s("settings.skills.importSlugTaken",{slug:R}));return}V=!0;const E=Ge(R,await X.text());j(oe=>[E,...oe]),h(E.id),await qe(Ue(_,R),c.mutateAsync),D.success(s("settings.skills.importSuccess",{name:R}))}catch(E){V&&await r.mutateAsync(W).catch(()=>{}),D.error(E instanceof Error?E.message:s("settings.skills.importError"))}finally{h(null),x(),z(!1)}}const k=m.toLowerCase(),d=(l.data??[]).filter(i=>i.name.toLowerCase().includes(k)||(i.description??"").toLowerCase().includes(k)).sort((i,n)=>Number(B(n))-Number(B(i))||i.name.localeCompare(n.name)),v=new Set((l.data??[]).map(i=>i.source)),p=new Map;for(const i of d)p.set(i.source,(p.get(i.source)??0)+1);const y=[{id:L,label:s("settings.skills.filterAll"),count:d.length},...[...v].map(i=>({id:i,label:re(i,e.name).label,count:p.get(i)??0}))],g=v.has(O)?O:L,P=g===L?d:d.filter(i=>i.source===g),K=i=>f(Be(i.volume,i.path)),ne=async()=>{if(!b)return;const{id:i,path:n}=b;N(null),j(A=>A.filter(H=>H.id!==i));try{await r.mutateAsync(n),D.success(s("settings.skills.deleteSuccess"))}catch(A){D.error(A instanceof Error?A.message:s("settings.skills.deleteError"))}finally{x()}},G=t.jsxs(U,{size:"sm",disabled:F,onClick:()=>o.current?.click(),children:[t.jsx(Se,{size:14}),s(F?"settings.skills.importing":"settings.skills.importButton")]});return t.jsxs($,{children:[t.jsx($.Content,{children:t.jsx($.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[M?t.jsx($.Actions,{secondary:t.jsx(we,{value:m,onChange:S,label:s("library.context.search"),placeholder:s("settings.skills.searchPlaceholder"),clearLabel:s("library.library.clearSearch")}),children:G}):t.jsx($.Title,{actions:G,children:s("settings.skills.pageTitle")}),t.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3 empty:hidden",children:!M&&t.jsx(be,{value:m,onChange:S,placeholder:s("settings.skills.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:i=>{i.key==="Escape"&&(S(""),i.target.blur())}})}),t.jsx("input",{ref:o,type:"file",multiple:!0,webkitdirectory:"",className:"hidden",onChange:i=>{C(i.target.files)}}),y.length>2&&t.jsx(Oe,{placement:"page",tabs:y,activeTab:g,onTabChange:I}),l.isPending?t.jsx("div",{className:"@container",children:t.jsx(ee,{children:Array.from({length:8},(i,n)=>t.jsx(de,{className:"h-[168px] rounded-xl"},n))})}):l.isError?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(Y,{image:t.jsx(me,{size:48,className:"text-muted-foreground"}),title:s("settings.skills.errorTitle"),description:l.error instanceof Error?l.error.message:s("settings.skills.errorDescription"),actions:t.jsx(U,{size:"sm",variant:"outline",onClick:()=>{l.refetch()},children:s("settings.skills.retry")})})}):P.length===0?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(Y,{image:t.jsx(le,{size:48,className:"text-muted-foreground"}),title:s(m?"settings.skills.noResultsTitle":"settings.skills.emptyTitle"),description:m?s("settings.skills.noResultsDescription",{search:m}):s("settings.skills.emptyDescription"),actions:!1})}):t.jsx("div",{className:"@container",children:t.jsx(ee,{children:P.map(i=>{const n=i.id===w;return t.jsx(Xe,{entry:i,pending:n,onOpen:()=>K(i),onDelete:B(i)&&!n?()=>N(i):void 0},i.id)})})})]})})}),u&&t.jsx(ze,{skillPath:u,onClose:()=>f(null)},u),t.jsx(Ce,{open:b!==null,onOpenChange:i=>!i&&N(null),children:t.jsxs(De,{children:[t.jsxs(Ne,{children:[t.jsx(Pe,{children:s("settings.skills.deleteDialogTitle")}),t.jsx(Ae,{children:s("settings.skills.deleteDialogDescription",{name:b?.name??""})})]}),t.jsxs(Ee,{children:[t.jsx(Te,{children:s("settings.skills.cancel")}),t.jsx(Me,{onClick:ne,variant:"destructive",children:s("settings.skills.deleteButton")})]})]})})]})}export{Et as default};
|