decocms 4.402.1 → 4.403.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-DcHwjWsq.js → AlertCircle-BxsvjprR.js} +1 -1
- package/dist/client/assets/{AreaChart-BPY6McAI.js → AreaChart-BXuWJn9c.js} +1 -1
- package/dist/client/assets/{ArrowLeft-Bkin1mI_.js → ArrowLeft-C98PG333.js} +1 -1
- package/dist/client/assets/{ArrowRight-5pCNMYve.js → ArrowRight-CK7-YvUr.js} +1 -1
- package/dist/client/assets/{ArrowUp-BBAz-eci.js → ArrowUp-DPWXMpl2.js} +1 -1
- package/dist/client/assets/{CartesianChart-Jh2jk1q9.js → CartesianChart-DD9gGd-G.js} +1 -1
- package/dist/client/assets/{Check-D8Zqb1HC.js → Check-Blxq8j59.js} +1 -1
- package/dist/client/assets/{CheckCircle-CF8WeHYg.js → CheckCircle-DS--6hmh.js} +1 -1
- package/dist/client/assets/{ChevronUp-CGDgj0bm.js → ChevronUp-CRNjHjTK.js} +1 -1
- package/dist/client/assets/{Copy01-C9mP-VM4.js → Copy01-DmLSY0Qf.js} +1 -1
- package/dist/client/assets/{CreditCard01-DQsr79v7.js → CreditCard01-C6GC8NM-.js} +1 -1
- package/dist/client/assets/{DotsVertical-DpAeUNyz.js → DotsVertical-B2eyM1bc.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-CwmIk3tm.js → ErrorBarContext-CYai77oS.js} +1 -1
- package/dist/client/assets/{Eye-DpBHj09D.js → Eye-DDS_VF-Y.js} +1 -1
- package/dist/client/assets/{Globe04-vwBxz8j-.js → Globe04-95dd8QSP.js} +1 -1
- package/dist/client/assets/{Image01-CWl1q5TL.js → Image01-C1vTsGg9.js} +1 -1
- package/dist/client/assets/{Key01-BdZlsNHY.js → Key01-CfEGZMt9.js} +1 -1
- package/dist/client/assets/{LayoutLeft-BCyzo03m.js → LayoutLeft-xPkXxcb6.js} +1 -1
- package/dist/client/assets/{Line-D3dMYTRZ.js → Line-C67AfCyw.js} +1 -1
- package/dist/client/assets/{Link01-DL0Bhiy8.js → Link01-CvcI1eLv.js} +1 -1
- package/dist/client/assets/{LinkExternal01-Bzm59G9x.js → LinkExternal01-DH3oN4WK.js} +1 -1
- package/dist/client/assets/{Monitor01-BWry3mi8.js → Monitor01-B9ABYuV_.js} +1 -1
- package/dist/client/assets/{Palette-QMR4FKys.js → Palette-DJJWQUTk.js} +1 -1
- package/dist/client/assets/{Plus-BUY7Ud4X.js → Plus-GxHWJNZK.js} +1 -1
- package/dist/client/assets/{SearchMd-BZrJSLPd.js → SearchMd-QgF27GDM.js} +1 -1
- package/dist/client/assets/{Sector-DDD99rSB.js → Sector-BNV9jqXa.js} +1 -1
- package/dist/client/assets/{Share07-lQLk_Wuy.js → Share07-DV5DThxW.js} +1 -1
- package/dist/client/assets/{Sun-BVJsSwmV.js → Sun-C3em9BZW.js} +1 -1
- package/dist/client/assets/{Tool01-eWiBwjAj.js → Tool01-BCsmpwCz.js} +1 -1
- package/dist/client/assets/{Trash01-CytDsT4G.js → Trash01-BgJo-uHb.js} +1 -1
- package/dist/client/assets/{Upload01-CDaZdY6S.js → Upload01-BNcthBU9.js} +1 -1
- package/dist/client/assets/{User01-Co__-w2M.js → User01-DvYjRkyx.js} +1 -1
- package/dist/client/assets/{UserSquare-DWwkQbY_.js → UserSquare-DKTJMzlh.js} +1 -1
- package/dist/client/assets/{Users01-DAz3tepP.js → Users01-DqJ21DOW.js} +1 -1
- package/dist/client/assets/{X-DAJc3BKO.js → X-tomqNIg1.js} +1 -1
- package/dist/client/assets/{XClose-BNaGgCB0.js → XClose-DKTON5RG.js} +1 -1
- package/dist/client/assets/{Zap-Cku-mkoY.js → Zap-DMCGUdZC.js} +1 -1
- package/dist/client/assets/{ZoomOut-DdkoWs_x.js → ZoomOut-CvfOKBlv.js} +1 -1
- package/dist/client/assets/{access-gate-BhuVj9y1.js → access-gate-DsBjN_k-.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-Df12oKBz.js → add-connection-dialog-DGaBiFHb.js} +1 -1
- package/dist/client/assets/{agent-analytics-DbTHKQ1k.js → agent-analytics-n1UGPVtK.js} +1 -1
- package/dist/client/assets/agent-app-ucQZeOf-.js +1 -0
- package/dist/client/assets/{agent-assets-CK7eio8D.js → agent-assets-DRURWRvp.js} +1 -1
- package/dist/client/assets/{agent-automation-CuAepk_l.js → agent-automation-DBbEhZPF.js} +1 -1
- package/dist/client/assets/{agent-automations-Bj04SxRa.js → agent-automations-B8ZFE67t.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-BCyCM1tV.js → agent-connect-sources-Dj71XW9T.js} +1 -1
- package/dist/client/assets/agent-deck-96Di6sOJ.js +1 -0
- package/dist/client/assets/{agent-e2e-C-5GcU_j.js → agent-e2e-DfXNlhc3.js} +1 -1
- package/dist/client/assets/{agent-experiments-C8LQkh0S.js → agent-experiments-BJWBqxLp.js} +1 -1
- package/dist/client/assets/{agent-file-iVhCT82h.js → agent-file-BBipxVNI.js} +1 -1
- package/dist/client/assets/{agent-git-3yyAe1K7.js → agent-git-Z2sLlW-j.js} +1 -1
- package/dist/client/assets/{agent-hosting-DDQwutKA.js → agent-hosting-D8WZlGjj.js} +1 -1
- package/dist/client/assets/{agent-icon-BvX9_a8p.js → agent-icon-CP9iXRWW.js} +1 -1
- package/dist/client/assets/agent-library-file-BlvILtIR.js +1 -0
- package/dist/client/assets/{agent-monitor-Cb-4CMIV.js → agent-monitor-CnK_AfrL.js} +1 -1
- package/dist/client/assets/{agent-overview-DGYqyfwa.js → agent-overview-8y0eYIH6.js} +1 -1
- package/dist/client/assets/agent-settings-CeWV6MPi.js +1 -0
- package/dist/client/assets/{agent-site-editor-DZsDoL4C.js → agent-site-editor-CQcbIrSJ.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-orvWD6S7.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-DTjzis44.js → agent-site-editor-content-BlZJF4Kt.js} +3 -3
- package/dist/client/assets/{agent-site-editor-preview-CjO8bl2l.js → agent-site-editor-preview-B2myVBRe.js} +3 -3
- package/dist/client/assets/agent-view-BhpD7HoJ.js +1 -0
- package/dist/client/assets/{agent-view-guard-DKeKGOgB.js → agent-view-guard-CR5g29BH.js} +1 -1
- package/dist/client/assets/{agents-list-VW3RCSuu.js → agents-list-Bn6kIacr.js} +1 -1
- package/dist/client/assets/{ai-providers-DmdvF_P2.js → ai-providers-DIo8QsY4.js} +1 -1
- package/dist/client/assets/{alert-dialog-BUIr72GF.js → alert-dialog-B5hf3Zq6.js} +1 -1
- package/dist/client/assets/{alert-BWOy_aTe.js → alert-xdPy5Dnu.js} +1 -1
- package/dist/client/assets/{analytics-sections-CtJSDTKq.js → analytics-sections-MCA0egKf.js} +1 -1
- package/dist/client/assets/api-keys-BB-GxSyT.js +1 -0
- package/dist/client/assets/{api-keys-BkC5Tf1A.js → api-keys-k6o9_ZVL.js} +1 -1
- package/dist/client/assets/app-editor-BYBxWW6P.js +1 -0
- package/dist/client/assets/{asset-utils-CCxUxZJl.js → asset-utils-DHewT25o.js} +1 -1
- package/dist/client/assets/{auth-catchall-Bc-Nu92V.js → auth-catchall-DrFinUIn.js} +1 -1
- package/dist/client/assets/{auth-entry-BwKPXJEb.js → auth-entry-Ceu5j70S.js} +1 -1
- package/dist/client/assets/{auth-D8auDfWe.js → auth-pb03Kzig.js} +1 -1
- package/dist/client/assets/{auth-split-layout-34Nf6GFY.js → auth-split-layout-Bt9Pa3Bg.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-xX05HUt0.js → authenticate-and-persist-oauth-ByuGS_gG.js} +1 -1
- package/dist/client/assets/{automation-list-row-BjKSRD_8.js → automation-list-row-CH-bg8ai.js} +1 -1
- package/dist/client/assets/{automation-runs-DYTaC7v8.js → automation-runs-C1MhxQwE.js} +1 -1
- package/dist/client/assets/{automations-Dh1bOrz6.js → automations-D4d9Yr8A.js} +1 -1
- package/dist/client/assets/{autosend-CAruNR-r.js → autosend-DxvfLrdl.js} +1 -1
- package/dist/client/assets/{avatar-DpIdIzyq.js → avatar-D9bHXtJ-.js} +1 -1
- package/dist/client/assets/{badge-Cz4FrB04.js → badge-DXHGQv94.js} +1 -1
- package/dist/client/assets/{block-document-DBd3EXVE.js → block-document-Cjfk5S2Y.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-CagHfewh.js → blocks-preview-workspace-context-D339Nq0O.js} +1 -1
- package/dist/client/assets/{buckets-pLKwt15L.js → buckets-8xQyeFnA.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-DktDRS2O.js → build-improve-prompt-doc-D2Ll2Rce.js} +1 -1
- package/dist/client/assets/{calendar-D1XYfb8U.js → calendar-Wk2YDk5Q.js} +1 -1
- package/dist/client/assets/{capability-load-error-C7vdFk9B.js → capability-load-error-QLFmZqWG.js} +1 -1
- package/dist/client/assets/{cards-DwAzndr5.js → cards-c3aviZef.js} +1 -1
- package/dist/client/assets/{category-editor-ogyqgis9.js → category-editor-zXprfyEx.js} +1 -1
- package/dist/client/assets/{chart-PWKZfojU.js → chart-DKqJHT22.js} +1 -1
- package/dist/client/assets/{chat-context-lntumHEL.js → chat-context-zkHg9OWQ.js} +1 -1
- package/dist/client/assets/{chat-draft-vzCx0JHx.js → chat-draft-DSG5ngj7.js} +1 -1
- package/dist/client/assets/{checkbox-CjzMziEV.js → checkbox-K4FR-PUT.js} +1 -1
- package/dist/client/assets/{choose-editor-Dau4YBRD.js → choose-editor-BXV7Je4x.js} +1 -1
- package/dist/client/assets/{claim-phase-copy-CKjixjui.js → claim-phase-copy-pJF6tq00.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DYzdHJrD.js → cli-auth-success-Cl8P0ld7.js} +1 -1
- package/dist/client/assets/{client-icons-DsW6C1D5.js → client-icons-Q4X702lN.js} +1 -1
- package/dist/client/assets/{collapsible-C1N5Vk5A.js → collapsible-C198MfkN.js} +1 -1
- package/dist/client/assets/{collection-detail-CpyWy-pY.js → collection-detail-j8tNEP48.js} +1 -1
- package/dist/client/assets/{collection-display-button-DDhY9dMS.js → collection-display-button-HO4jLV8w.js} +1 -1
- package/dist/client/assets/{collection-search-hFSvTg9q.js → collection-search-DIxBrmSt.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CoSdC7p-.js → collection-table-wrapper-Be87XQmm.js} +1 -1
- package/dist/client/assets/{collection-tabs-CB5jU9UN.js → collection-tabs-BAPv5IF9.js} +1 -1
- package/dist/client/assets/{combobox-D6DckToA.js → combobox-BVFjv7zx.js} +1 -1
- package/dist/client/assets/{command-M2XMNX_S.js → command-CfliK-Cc.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-B9h24TwK.js → companion-mcps-section-BbAoBFxb.js} +1 -1
- package/dist/client/assets/{connect-kPokwQd1.js → connect-BA0xuDG1.js} +1 -1
- package/dist/client/assets/{connect-layout-BLRcrSQ6.js → connect-layout-BdvXARBl.js} +1 -1
- package/dist/client/assets/{connection-card-B_Iux5tH.js → connection-card-DvPe_M7v.js} +1 -1
- package/dist/client/assets/{connection-detail-X7jG3k4W.js → connection-detail-DwqbKjaA.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-Diud5YKf.js → connection-form-helpers-DplEqD9m.js} +1 -1
- package/dist/client/assets/{connection-DNxakCqK.js → connection-vEOaKzQz.js} +1 -1
- package/dist/client/assets/{connections-CdmbRwtQ.js → connections-DP3rfITi.js} +1 -1
- package/dist/client/assets/{context-D_-nNlkt.js → context-BN_AZdQK.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-Dvo8jU8X.js → create-organization-dialog-CIJFPZj1.js} +1 -1
- package/dist/client/assets/{decofile-api-CRY_R36f.js → decofile-api-W5b1cAOf.js} +1 -1
- package/dist/client/assets/{decopilot-B9r80dff.js → decopilot-TYyHvkDT.js} +1 -1
- package/dist/client/assets/{dialog-DZbrQs4a.js → dialog-D_eZEQVv.js} +1 -1
- package/dist/client/assets/{discover-N-k9SPj2.js → discover-B9q6xfGX.js} +1 -1
- package/dist/client/assets/{domain-settings-DaO7iyKF.js → domain-settings-DNUorrft.js} +1 -1
- package/dist/client/assets/{download-app-dialog-Cc26MdhV.js → download-app-dialog-Cg2Fsige.js} +1 -1
- package/dist/client/assets/{drawer-B5y-1Csa.js → drawer-BbjSV6aw.js} +1 -1
- package/dist/client/assets/{editor-BYzs-ptR.js → editor-z3_N_jkd.js} +1 -1
- package/dist/client/assets/{empty-state-sf1-Jq0W.js → empty-state-CDIBHplc.js} +1 -1
- package/dist/client/assets/{empty-state-ypVDBd57.js → empty-state-DdD7u29c.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DjI_aoBC.js → extract-connection-data-IvHnTVAw.js} +1 -1
- package/dist/client/assets/{feature-gate-DcRjQ5be.js → feature-gate-BWDpzS9z.js} +1 -1
- package/dist/client/assets/{feature-paywall-BJyKoG94.js → feature-paywall-BMHKK3Z9.js} +1 -1
- package/dist/client/assets/{file-explorer-4Pc4NHzH.js → file-explorer-D27HdHX3.js} +1 -1
- package/dist/client/assets/{file-preview-BEbWQaxd.js → file-preview-8F3P6Bl5.js} +1 -1
- package/dist/client/assets/{file-share-button-c3pbTUkm.js → file-share-button-DyElnx8z.js} +1 -1
- package/dist/client/assets/{file-type-icon-M-h3H6gl.js → file-type-icon-ClDaqk3f.js} +1 -1
- package/dist/client/assets/{folder-icon-u0aPfhqN.js → folder-icon-D04YRFhU.js} +1 -1
- package/dist/client/assets/{form-BW5sQRmk.js → form-C7tLG-xD.js} +1 -1
- package/dist/client/assets/{gateway-client-Iyhaszzo.js → gateway-client-BS6ihzBm.js} +1 -1
- package/dist/client/assets/{general-BvHqxpPY.js → general-B2rNnykE.js} +1 -1
- package/dist/client/assets/{github-icon-BDxNO7KC.js → github-icon-CfU12Xim.js} +1 -1
- package/dist/client/assets/{home-5wJZqSWV.js → home-i2aU9Ufv.js} +1 -1
- package/dist/client/assets/{hooks-DWWfCdjK.js → hooks-BdWJM6ej.js} +1 -1
- package/dist/client/assets/{icon-button-CtJzFHej.js → icon-button-DAJ4484y.js} +1 -1
- package/dist/client/assets/{index-By68j_mZ.js → index-3i5Lrx2p.js} +1 -1
- package/dist/client/assets/{index-ziWxoYuo.js → index-B_jqJjWZ.js} +39 -39
- package/dist/client/assets/{index-BTBWEo6K.js → index-CFR2L-q4.js} +1 -1
- package/dist/client/assets/{index-CS_gB0YL.js → index-CS_ks7u-.js} +1 -1
- package/dist/client/assets/{index-fHAcll79.js → index-Cc2tAO7N.js} +1 -1
- package/dist/client/assets/{index-BICcivlc.js → index-Chkg10uz.js} +1 -1
- package/dist/client/assets/{index-B_nJnclR.js → index-D6rGE1Dy.js} +1 -1
- package/dist/client/assets/{index-6cM3T3JU.js → index-DBxyNE8f.js} +1 -1
- package/dist/client/assets/{index-sefeb9SI.js → index-DZwO8JK7.js} +1 -1
- package/dist/client/assets/{index-CC84NaKX.js → index-DnYPqGbF.js} +1 -1
- package/dist/client/assets/{index-DMC1gEI3.js → index-DwgW_YLd.js} +1 -1
- package/dist/client/assets/{index-BO05OYcW.js → index-E9kwMDzy.js} +1 -1
- package/dist/client/assets/{index--em0zeg6.js → index-Hk82ozwG.js} +1 -1
- package/dist/client/assets/{index-9mA_jLNn.js → index-_sXoF1Et.js} +1 -1
- package/dist/client/assets/{index-redirect-Bup6rHGm.js → index-redirect-B6SWpWIS.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-C0scbCv9.js → infiniteQueryObserver-DSiFdm1_.js} +1 -1
- package/dist/client/assets/{infra-billing-DZvKZXmT.js → infra-billing-4kvUQS8R.js} +1 -1
- package/dist/client/assets/{input-CXPy1lnR.js → input-CPX_K4na.js} +1 -1
- package/dist/client/assets/{input-CztG7UMa.js → input-CUqzZQqX.js} +1 -1
- package/dist/client/assets/{input-CJpGQ1Th.js → input-D3d-YnPi.js} +1 -1
- package/dist/client/assets/{integration-icon-BzvUNmRE.js → integration-icon-DG8pRbj-.js} +1 -1
- package/dist/client/assets/{label-_3WYFdo5.js → label-B42WVwom.js} +1 -1
- package/dist/client/assets/{last-preview-page-CHWyRhbr.js → last-preview-page-VDeNxgNa.js} +1 -1
- package/dist/client/assets/{layout-DYIHs9kD.js → layout-Cg9QXreU.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-DBTnH6bL.js → legacy-agents-deep-BQwnmlAz.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-BsYq-xiI.js → legacy-main-redirect-DPq1EZZB.js} +1 -1
- package/dist/client/assets/{library-Do40Vk3o.js → library-C5v9Lai5.js} +1 -1
- package/dist/client/assets/{login-Btr57Seb.js → login-CQeYUvND.js} +1 -1
- package/dist/client/assets/{markdown-BA0WefIr.js → markdown-7es2nAha.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-BMekd9hK.js → mcp-app-renderer-DhZPltbk.js} +1 -1
- package/dist/client/assets/{mcp-oauth-9MW-5Yis.js → mcp-oauth-Ckxkgwom.js} +1 -1
- package/dist/client/assets/{members-C1yb5hTi.js → members-BwpS2FJg.js} +1 -1
- package/dist/client/assets/{message-templates-BreVPcoU.js → message-templates-B94eek_d.js} +1 -1
- package/dist/client/assets/{mini-report-page-C4fct7wn.js → mini-report-page-CsRp8RBX.js} +1 -1
- package/dist/client/assets/{mock-board-BtM1Rw_K.js → mock-board-CDJcm5pO.js} +3 -3
- package/dist/client/assets/{monaco-editor-Rppk41ht.js → monaco-editor-CVsFBD0x.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-Cc7ItOSd.js → monitoring-stats-row-ByyxXINL.js} +1 -1
- package/dist/client/assets/{multi-select-3KqHCA4E.js → multi-select-Dz5xTYyG.js} +1 -1
- package/dist/client/assets/{mustache-_Bjx0slz.js → mustache-CP6S3NLE.js} +1 -1
- package/dist/client/assets/{oauth-callback-Bcy-6PY_.js → oauth-callback-Doz3uO24.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-ly_LHSFd.js → oauth-callback-ai-provider-BNo5jLbk.js} +1 -1
- package/dist/client/assets/{onboarding-CbAB8H9h.js → onboarding-CFbudetK.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-BEr3crxf.js → optimistic-project-sidebar-views-BZFYBphr.js} +1 -1
- package/dist/client/assets/{org-file-open-context--mCB_iQy.js → org-file-open-context-BUYeSnyZ.js} +1 -1
- package/dist/client/assets/{organization-choice-BsW0tsr0.js → organization-choice-D785n-oL.js} +1 -1
- package/dist/client/assets/{orgs-DqNq_SYU.js → orgs-BYiTsfBK.js} +1 -1
- package/dist/client/assets/{page-seo-form-DojL7wpr.js → page-seo-form-DLdbZSvc.js} +1 -1
- package/dist/client/assets/{pair-B8zmeOHa.js → pair-Cntzz70t.js} +1 -1
- package/dist/client/assets/{plan-ladder-B4Yh8okh.js → plan-ladder-CgZjoFq0.js} +1 -1
- package/dist/client/assets/{popover-Bk7hW0ey.js → popover-D7TbzVGm.js} +1 -1
- package/dist/client/assets/{post-calendar-BV1eHaK8.js → post-calendar-C1z8ltmP.js} +1 -1
- package/dist/client/assets/{post-editor-BT9uGcZD.js → post-editor-C_EE2ywm.js} +1 -1
- package/dist/client/assets/{preview-content-QoDE1rCY.js → preview-content-BHvFZwTL.js} +1 -1
- package/dist/client/assets/{preview-dialog-C9P8-JXO.js → preview-dialog-LK5goGiO.js} +1 -1
- package/dist/client/assets/{profile-io3wVtBH.js → profile-C8Ekz_R3.js} +1 -1
- package/dist/client/assets/{project-app-view-uS1Oyo_z.js → project-app-view-w895ELfV.js} +1 -1
- package/dist/client/assets/{project-feed-BOlh1fkU.js → project-feed-BIeMuQsl.js} +1 -1
- package/dist/client/assets/{project-icon-Dqsi312T.js → project-icon-KCkwxFCZ.js} +1 -1
- package/dist/client/assets/project-reports-Cl2HONmy.js +1 -0
- package/dist/client/assets/project-tasks-BIMrLh_c.js +1 -0
- package/dist/client/assets/{prompts-BG-MPyn-.js → prompts-ndmFBjqL.js} +1 -1
- package/dist/client/assets/record-editor-DjlSkTMR.js +1 -0
- package/dist/client/assets/{redirect-editor-JipDfipG.js → redirect-editor-CguLDdkl.js} +1 -1
- package/dist/client/assets/reports-D5LirKe3.js +1 -0
- package/dist/client/assets/{reports-DKfv6F8w.js → reports-DlVcHkUD.js} +1 -1
- package/dist/client/assets/{reports-onboarding-Cy3jqQvd.js → reports-onboarding-Ds5SahYM.js} +1 -1
- package/dist/client/assets/{reports-tab-o_wsXSh7.js → reports-tab-DC6c1sVj.js} +2 -2
- package/dist/client/assets/{repositories-CSGkwVyT.js → repositories-CUfjI4El.js} +1 -1
- package/dist/client/assets/{repository-import-picker-CQVzq3BU.js → repository-import-picker-OZgXFfxq.js} +1 -1
- package/dist/client/assets/{repository-picker-BdMF9zgM.js → repository-picker-Cuj06eQZ.js} +1 -1
- package/dist/client/assets/{require-capability-DEtYkpLS.js → require-capability-naAuPznp.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CAKi6iDw.js → required-auth-layout-BuQC1B0R.js} +1 -1
- package/dist/client/assets/{reset-password-CjXeqPrv.js → reset-password-C-TuQEuk.js} +1 -1
- package/dist/client/assets/{resizable-Dwlj_5ft.js → resizable-BSTHeCGD.js} +1 -1
- package/dist/client/assets/{review-settings-BUpwP2dx.js → review-settings-DPAP3K_X.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-DNvgXQgl.js → rich-text-link-control-DSqyN-4h.js} +1 -1
- package/dist/client/assets/{roles-BTKe5RPi.js → roles-p5A3Dtl6.js} +1 -1
- package/dist/client/assets/{route-DAYL9p8i.js → route-CKMOQ40u.js} +1 -1
- package/dist/client/assets/{route-CW79snE6.js → route-CpKC5KjI.js} +1 -1
- package/dist/client/assets/{route-CJkw61Zc.js → route-DBh4p0P2.js} +1 -1
- package/dist/client/assets/{route-page-header-BX_04V6X.js → route-page-header-DqB3P7Mp.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-BqGS6HoQ.js → runnable-block-editor-CgZ8SmOe.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-CMg8X78k.js → sandbox-lifecycle-context-D9wQaDsx.js} +1 -1
- package/dist/client/assets/schema-B6bqanRf.js +1 -0
- package/dist/client/assets/{scroll-area-WP6xUrg2.js → scroll-area-bbynZh9-.js} +1 -1
- package/dist/client/assets/{search-input-CzMI7SbY.js → search-input-Btpivanp.js} +1 -1
- package/dist/client/assets/{search-toggle-_SwtmigM.js → search-toggle-CPZhZrMT.js} +1 -1
- package/dist/client/assets/{secret-picker-B7LbtI2k.js → secret-picker-AWBv6wFY.js} +1 -1
- package/dist/client/assets/{secrets-B5P1IBT4.js → secrets-Dj_h5xgB.js} +1 -1
- package/dist/client/assets/{sections-editor-DIx6r2h9.js → sections-editor-DHlfw38F.js} +1 -1
- package/dist/client/assets/{select-8KXSGRLl.js → select-jSjoqSVI.js} +1 -1
- package/dist/client/assets/{select-model-Bo57k2gC.js → select-model-xbu3VazG.js} +1 -1
- package/dist/client/assets/{seo-editor-BCM5fWif.js → seo-editor-cQIPvPvE.js} +1 -1
- package/dist/client/assets/{separator-BW4l_JXy.js → separator-CzwHfLvM.js} +1 -1
- package/dist/client/assets/{settings-tab-CvDc9lSQ.js → settings-tab-CeOX7aTs.js} +1 -1
- package/dist/client/assets/{sheet-BoIBD2fU.js → sheet-D_ZIeH1i.js} +1 -1
- package/dist/client/assets/{shell-layout-C4Rn0yyM.js → shell-layout-5RFwQBw2.js} +1 -1
- package/dist/client/assets/{skill-preview-CQYYDECQ.js → skill-preview-CNoU4Qye.js} +1 -1
- package/dist/client/assets/{skills-ByEvh5tv.js → skills-BJkniNrS.js} +1 -1
- package/dist/client/assets/{sso-CmLvBErH.js → sso-B9hnmDuf.js} +1 -1
- package/dist/client/assets/{suggestion-tuFcyOKm.js → suggestion-U-2vYvOO.js} +1 -1
- package/dist/client/assets/{switch-DPTro45D.js → switch-CxeV46Qg.js} +1 -1
- package/dist/client/assets/{synced-repos-B4c-CrQ7.js → synced-repos-21EGZfBM.js} +1 -1
- package/dist/client/assets/{table-C7ZZ1Gh3.js → table-C-Py-wTW.js} +1 -1
- package/dist/client/assets/{tabs-CI-qOCoA.js → tabs-C3x66yHR.js} +1 -1
- package/dist/client/assets/{task-board-DPuIO3lj.js → task-board-DfS5a_U6.js} +1 -1
- package/dist/client/assets/{task-route-B502sFo7.js → task-route-D4Lm7oMd.js} +1 -1
- package/dist/client/assets/{task-status-CY7tmQAt.js → task-status-BVsZxsbL.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-wJrWcpXu.js → taskboard-analytics-BPvIiWmk.js} +1 -1
- package/dist/client/assets/tasks-DcFwVI3V.js +1 -0
- package/dist/client/assets/{tasks-DdJpYlFL.js → tasks-DiyaPFMr.js} +1 -1
- package/dist/client/assets/{textarea-BncilA97.js → textarea-BWwZU_t6.js} +1 -1
- package/dist/client/assets/{thread-analytics-ApATKMqj.js → thread-analytics-DUYI7gXn.js} +1 -1
- package/dist/client/assets/{thread-button-DJeTkAyH.js → thread-button-C_OQPTk1.js} +1 -1
- package/dist/client/assets/{thread-intent-BNnANQO5.js → thread-intent-E5sYh_tC.js} +1 -1
- package/dist/client/assets/{thread-route-CBWg87G3.js → thread-route-BDTLcWS1.js} +1 -1
- package/dist/client/assets/{thread-route-M4rTxHUV.js → thread-route-BZ26YLl1.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-CFRV6F8c.js → thread-sheet-body-CsPcwFou.js} +1 -1
- package/dist/client/assets/{toggle-group-DnlZm5ed.js → toggle-group-Br61F69t.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-D8Zp_HQd.js → toolbar-icon-button-DAWIeeny.js} +1 -1
- package/dist/client/assets/{tooltip-OlmP4Xne.js → tooltip-MGIMGAoz.js} +1 -1
- package/dist/client/assets/{track-B0Nkp-gO.js → track-DRMUb5wX.js} +1 -1
- package/dist/client/assets/{types-DXypKwsh.js → types-BobDzo_S.js} +1 -1
- package/dist/client/assets/{usage-stats-CAm8ll0C.js → usage-stats-CtwYJCDG.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Lvr_1665.js → use-ai-providers-D3QOmX-C.js} +1 -1
- package/dist/client/assets/{use-automations-81CjRTlN.js → use-automations-cNW48WkH.js} +1 -1
- package/dist/client/assets/{use-autosave-t6s5wMUE.js → use-autosave-VCuxTv0J.js} +1 -1
- package/dist/client/assets/{use-connect-companion-BxZZw6OD.js → use-connect-companion-BuSwVwXM.js} +1 -1
- package/dist/client/assets/{use-connection-DXReahBl.js → use-connection-BhRHLAsr.js} +1 -1
- package/dist/client/assets/{use-copy-DZfoedG5.js → use-copy-BF-mjGgx.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-D3lKBA1-.js → use-create-virtual-mcp-DwVcqONE.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-B6lsja9n.js → use-date-fns-locale-DCvnbugy.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-D2HFk0bO.js → use-debounced-autosave-jBJVBJsX.js} +1 -1
- package/dist/client/assets/{use-debounced-value-C7-JMyFp.js → use-debounced-value-I_7zwW8J.js} +1 -1
- package/dist/client/assets/{use-deco-credits-hhJiNpZB.js → use-deco-credits-Doeu9LgP.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-zVeGPrg4.js → use-decopilot-events-BnXMCuEf.js} +1 -1
- package/dist/client/assets/{use-delete-connection-B5GiyA_y.js → use-delete-connection-CvMWFyh1.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-Bw0ESsNA.js → use-deployment-admin-BetxU96z.js} +1 -1
- package/dist/client/assets/{use-entitlements-DdLeP5e8.js → use-entitlements-CObs1qD4.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-DmGf6kPM.js → use-fast-preview-draft-url--bVRoyz9.js} +1 -1
- package/dist/client/assets/{use-file-configs-DtnzXs8S.js → use-file-configs-DigsDSAK.js} +1 -1
- package/dist/client/assets/{use-in-settings-Dvk70b-r.js → use-in-settings-kPZjTMQr.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-OBKDpZd2.js → use-infinite-scroll-R-FVBBxh.js} +1 -1
- package/dist/client/assets/{use-join-requests-BR_Ts9mr.js → use-join-requests-BUHZc4Mq.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-D7hvsAEq.js → use-main-panel-tabs-DQnZor4-.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-B6yMK8tP.js → use-mcp-auth-status-ermcBJaV.js} +1 -1
- package/dist/client/assets/{use-mcp-client-D0GxBaDo.js → use-mcp-client-BdNrVAJP.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-CYjViP6k.js → use-mcp-prompts-1Ewo80b8.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-_g4NAjrq.js → use-mcp-tools-Cu0xFgEP.js} +1 -1
- package/dist/client/assets/{use-members-Ct_DkclC.js → use-members-hbcweNuZ.js} +1 -1
- package/dist/client/assets/{use-mobile-DL0BBun-.js → use-mobile-beNLxD1C.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-C0Wb0lHC.js → use-navigate-to-agent-C6DjZGwr.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-5Jl47ZN-.js → use-open-billing-url-y3R__MyB.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BhlcNBON.js → use-org-auth-client-Cn5VVAMk.js} +1 -1
- package/dist/client/assets/{use-org-fs-BZxhCLBv.js → use-org-fs-iJQRZ_Y8.js} +1 -1
- package/dist/client/assets/{use-org-sso-B67vSzPL.js → use-org-sso-DUkP7wB6.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DvWLvtJo.js → use-organization-roles-B_L60GhE.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Cj191Ewd.js → use-organization-settings-DkOGSUvX.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-CxM_dPDF.js → use-panel-navigate-rE0Chr-2.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-Dpkg39tr.js → use-project-native-view-presence-1YdimLRn.js} +1 -1
- package/dist/client/assets/{use-project-scope-CmwWylK9.js → use-project-scope-P0x76zE6.js} +1 -1
- package/dist/client/assets/{use-releases-C64Gw739.js → use-releases-B1QdX0n3.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-BlZh8B-b.js → use-reports-diagnostic-rG5xwYUZ.js} +1 -1
- package/dist/client/assets/{use-route-default-main-4PMl5Y8H.js → use-route-default-main-D9XS7l59.js} +1 -1
- package/dist/client/assets/{use-secrets-DCi_KkhE.js → use-secrets-omlZfkaj.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-0PubG-2k.js → use-section-preview-base-D8Bv__bX.js} +1 -1
- package/dist/client/assets/{use-session-runtime-BQHvzOwo.js → use-session-runtime-DdWkBfbN.js} +1 -1
- package/dist/client/assets/{use-tags-NI2eu5Cz.js → use-tags-CTTUJ_N1.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-Xdiuqy_o.js → use-task-board-analytics-CnU57ib7.js} +1 -1
- package/dist/client/assets/{use-task-metadata-CCc0stnS.js → use-task-metadata-DDYUL_Qx.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-CYxmK_WD.js → use-thread-analytics-Dr_m25eO.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-Bv992dBv.js → use-thread-outputs-DM_M_g6a.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-D6_hi4NV.js → use-virtual-mcp-DfNb-iFO.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-U5kS7Aw3.js +1 -0
- package/dist/client/assets/{useQueries-Dh-P597K.js → useQueries-o0vNhPOA.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BGK64Vi3.js +1 -0
- package/dist/client/assets/{users-D2bWKe0T.js → users-DoJNHPyq.js} +1 -1
- package/dist/client/assets/{utils-Drhm0YFn.js → utils-YiROKHsB.js} +1 -1
- package/dist/client/assets/{variant-calendar-aRH9J9TF.js → variant-calendar-h0YzSol5.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-D83fZJgn.js → variant-matcher-override-Dw_V_0pd.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-CyBHOQ0X.js → view-mode-toggle-BzLcGe3J.js} +1 -1
- package/dist/client/assets/{virtual-mcp-BcxcIP1Z.js → virtual-mcp-VXYym_wm.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +791 -738
- package/dist/server/migrate.js +288 -235
- package/dist/server/server.js +8 -8
- package/package.json +1 -1
- package/dist/client/assets/agent-app-Sr-2nirf.js +0 -1
- package/dist/client/assets/agent-deck-D-UCGYQX.js +0 -1
- package/dist/client/assets/agent-library-file-Cvi8jKHC.js +0 -1
- package/dist/client/assets/agent-settings-CTbjU_Gy.js +0 -1
- package/dist/client/assets/agent-site-editor-code-DR-g4J4J.js +0 -2
- package/dist/client/assets/agent-view-B6BDTAiP.js +0 -1
- package/dist/client/assets/api-keys-CvoR7Xp2.js +0 -1
- package/dist/client/assets/app-editor-BxSmqsZG.js +0 -1
- package/dist/client/assets/project-reports-DDobh4a3.js +0 -1
- package/dist/client/assets/project-tasks-DQbSKuzy.js +0 -1
- package/dist/client/assets/record-editor-BEfIzmJ1.js +0 -1
- package/dist/client/assets/reports-DypWpAd4.js +0 -1
- package/dist/client/assets/schema-DVTBToxW.js +0 -1
- package/dist/client/assets/tasks-BCglhWH3.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BGHP6rbt.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-D4hZ-82Z.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aY as $,aZ as v,a_ as W,a$ as H,b0 as D,b1 as y,b2 as V,b3 as x,b4 as L,b5 as q,b6 as j,b7 as N,b8 as B,b9 as Z,ba as F}from"./index-ziWxoYuo.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function Y(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function K(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Y(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Q(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=B.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=Z[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof $||n instanceof v)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof W)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await b(c,{fetchFn:i}),!o)try{o=await T(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new H(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const S=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(S),d=S}}const O=!e.redirectUrl;if(n!==void 0||O){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const k=await e.tokens();if(k?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:k.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof D)||l instanceof y))throw l}const C=e.state?await e.state():void 0,{authorizationUrl:z,codeVerifier:I}=await ue(c,{metadata:u,clientInformation:d,state:C,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(I),await e.redirectToAuthorization(z),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function T(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return q.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function b(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?V.parse(await o.json()):x.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await T(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await b(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await N(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function P(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=K(r,h);Q(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return F.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=P(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=P(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return j.parse(await s.json())}export{pe as U,b as a,_e as b,Ue as c,T as d,me as e};
|
|
1
|
+
import{aY as $,aZ as v,a_ as W,a$ as H,b0 as D,b1 as y,b2 as V,b3 as x,b4 as L,b5 as q,b6 as j,b7 as N,b8 as B,b9 as Z,ba as F}from"./index-B_jqJjWZ.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function Y(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function K(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Y(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Q(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=B.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=Z[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof $||n instanceof v)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof W)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await b(c,{fetchFn:i}),!o)try{o=await T(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new H(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const S=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(S),d=S}}const O=!e.redirectUrl;if(n!==void 0||O){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const k=await e.tokens();if(k?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:k.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof D)||l instanceof y))throw l}const C=e.state?await e.state():void 0,{authorizationUrl:z,codeVerifier:I}=await ue(c,{metadata:u,clientInformation:d,state:C,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(I),await e.redirectToAuthorization(z),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function T(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return q.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function b(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?V.parse(await o.json()):x.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await T(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await b(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await N(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function P(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=K(r,h);Q(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return F.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=P(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=P(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return j.parse(await s.json())}export{pe as U,b as a,_e as b,Ue as c,T as d,me as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g,l as p,j as f}from"./index-
|
|
1
|
+
import{c as g,l as p,j as f}from"./index-B_jqJjWZ.js";function w(b){const e=g.c(20),{children:m,visual:r,align:j}=b,d=(j===void 0?"center":j)==="fill",x=d?"min-h-[100dvh] md:min-h-screen":"min-h-screen";let l;e[0]!==x?(l=p("flex w-full",x),e[0]=x,e[1]=l):l=e[1];const h=d?"h-[100dvh] justify-start pt-4 pb-8 md:h-auto":"justify-center py-6";let t;e[2]!==h?(t=p("flex flex-1 flex-col items-center bg-sidebar px-6 md:justify-center md:px-10 md:py-10",h),e[2]=h,e[3]=t):t=e[3];const u=d&&"flex min-h-0 flex-1 flex-col md:block md:flex-none";let s;e[4]!==u?(s=p("w-full max-w-[440px]",u),e[4]=u,e[5]=s):s=e[5];let i;e[6]!==m||e[7]!==s?(i=f.jsx("div",{className:s,children:m}),e[6]=m,e[7]=s,e[8]=i):i=e[8];let n;e[9]!==t||e[10]!==i?(n=f.jsx("section",{className:t,children:i}),e[9]=t,e[10]=i,e[11]=n):n=e[11];let c;e[12]!==r?(c=r??f.jsx("img",{src:"/onboarding-placeholder.png",alt:"",className:"absolute inset-0 h-full w-full object-cover"}),e[12]=r,e[13]=c):c=e[13];let a;e[14]!==c?(a=f.jsx("aside",{className:"relative hidden flex-1 overflow-hidden bg-muted md:flex",children:c}),e[14]=c,e[15]=a):a=e[15];let o;return e[16]!==a||e[17]!==l||e[18]!==n?(o=f.jsxs("main",{className:l,children:[n,a]}),e[16]=a,e[17]=l,e[18]=n,e[19]=o):o=e[19],o}export{w as A};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./index-
|
|
1
|
+
import"./index-B_jqJjWZ.js";import{i as u,a as p}from"./mcp-oauth-Ckxkgwom.js";async function k({connectionId:n,orgId:s,orgSlug:o,persistFallback:r}){const c=new URL(`/api/${o}/mcp/${n}`,window.location.origin),i=await u({url:c.href,token:null,orgId:s});if(!i.supportsOAuth||i.isAuthenticated)return{ran:!1,ok:!0,error:null};const{token:t,tokenInfo:e,error:a}=await p({connectionId:n,orgSlug:o,scope:"offline_access"});if(a||!t)return{ran:!0,ok:!1,error:a??"no token received"};if(e)try{(await fetch(`/api/${o}/connections/${n}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:e.accessToken,refreshToken:e.refreshToken,expiresIn:e.expiresIn,scope:e.scope,clientId:e.clientId,clientSecret:e.clientSecret,tokenEndpoint:e.tokenEndpoint})})).ok||await r(t)}catch{await r(t)}else await r(t);return{ran:!0,ok:!0,error:null}}export{k as a};
|
package/dist/client/assets/{automation-list-row-BjKSRD_8.js → automation-list-row-CH-bg8ai.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as q,b as J,r as U,l as W,j as t,F as X,B as Y,I as Z,H as ee,G as te}from"./index-
|
|
1
|
+
import{c as q,b as J,r as U,l as W,j as t,F as X,B as Y,I as Z,H as ee,G as te}from"./index-B_jqJjWZ.js";import{A as se,a as ie,b as ne,c as oe,g as ae,d as re,e as le,f as ce}from"./alert-dialog-B5hf3Zq6.js";import{A as me,O as ue}from"./agent-icon-CP9iXRWW.js";import{i as de}from"./DotsVertical-B2eyM1bc.js";import{s as fe}from"./Trash01-BgJo-uHb.js";import{i as ge}from"./Zap-DMCGUdZC.js";import{a as xe}from"./use-virtual-mcp-DfNb-iFO.js";import{a as pe}from"./use-automations-cNW48WkH.js";function Ce(c){const e=q.c(80),{automation:s,showAgent:a,onClick:n}=c,i=J(),{remove:o}=pe(),[l,I]=U.useState(!1),r=xe(a?s.virtual_mcp_id:void 0);let M;e[0]!==s.id||e[1]!==o?(M=()=>{o.mutate(s.id),I(!1)},e[0]=s.id,e[1]=o,e[2]=M):M=e[2];const K=M;let S;e[3]!==n?(S=m=>{m.target===m.currentTarget&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),n())},e[3]=n,e[4]=S):S=e[4];const H=S,G=s.active&&s.trigger_count>0?"bg-success":"bg-muted-foreground/40";let u;e[5]!==G?(u=W("inline-block size-2 rounded-full shrink-0",G),e[5]=G,e[6]=u):u=e[6];const V=s.active&&s.trigger_count>0?"automations.automationListRow.ariaActive":s.active?"automations.automationListRow.ariaNoTriggers":"automations.automationListRow.ariaPaused";let d;e[7]!==i||e[8]!==V?(d=i(V),e[7]=i,e[8]=V,e[9]=d):d=e[9];let f;e[10]!==u||e[11]!==d?(f=t.jsx("span",{className:u,"aria-label":d}),e[10]=u,e[11]=d,e[12]=f):f=e[12];let g;e[13]!==r?.icon||e[14]!==r?.title||e[15]!==s.name||e[16]!==a?(g=a&&t.jsx(me,{icon:r?.icon??null,name:r?.title??s.name,size:"xs",className:"shrink-0"}),e[13]=r?.icon,e[14]=r?.title,e[15]=s.name,e[16]=a,e[17]=g):g=e[17];let x;e[18]!==s.name?(x=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.name}),e[18]=s.name,e[19]=x):x=e[19];let p;e[20]!==r||e[21]!==a?(p=a&&r&&t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["· ",r.title]}),e[20]=r,e[21]=a,e[22]=p):p=e[22];let h;e[23]!==p||e[24]!==x?(h=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[x,p]}),e[23]=p,e[24]=x,e[25]=h):h=e[25];let j;e[26]!==s.nearest_next_run_at||e[27]!==s.trigger_count?(j=t.jsx(we,{triggerCount:s.trigger_count,nextRunAt:s.nearest_next_run_at}),e[26]=s.nearest_next_run_at,e[27]=s.trigger_count,e[28]=j):j=e[28];let w;e[29]!==h||e[30]!==j?(w=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[h,j]}),e[29]=h,e[30]=j,e[31]=w):w=e[31];let E;e[32]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(X,{asChild:!0,children:t.jsx(Y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100 transition-opacity",children:t.jsx(de,{size:16})})}),e[32]=E):E=e[32];let O,$;e[33]===Symbol.for("react.memo_cache_sentinel")?(O=m=>{m.stopPropagation(),I(!0)},$=t.jsx(fe,{size:16}),e[33]=O,e[34]=$):(O=e[33],$=e[34]);let v;e[35]!==i?(v=i("automations.automationListRow.delete"),e[35]=i,e[36]=v):v=e[36];let _;e[37]!==v?(_=t.jsx("div",{onClick:je,onKeyDown:he,role:"presentation",className:"shrink-0",children:t.jsxs(Z,{children:[E,t.jsx(ee,{align:"end",children:t.jsxs(te,{variant:"destructive",onClick:O,children:[$,v]})})]})}),e[37]=v,e[38]=_):_=e[38];let A;e[39]!==H||e[40]!==n||e[41]!==w||e[42]!==_||e[43]!==f||e[44]!==g?(A=t.jsxs("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:H,className:"group w-full flex items-center gap-3 px-4 py-3 border-b border-border text-left hover:bg-muted/50 transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[f,g,w,_]}),e[39]=H,e[40]=n,e[41]=w,e[42]=_,e[43]=f,e[44]=g,e[45]=A):A=e[45];let b;e[46]!==i?(b=i("automations.automationListRow.deleteTitle"),e[46]=i,e[47]=b):b=e[47];let D;e[48]!==b?(D=t.jsx(se,{children:b}),e[48]=b,e[49]=D):D=e[49];let N;e[50]!==s.name||e[51]!==i?(N=i("automations.automationListRow.deleteDescription",{name:s.name}),e[50]=s.name,e[51]=i,e[52]=N):N=e[52];let R;e[53]!==N?(R=t.jsx(ie,{children:N}),e[53]=N,e[54]=R):R=e[54];let y;e[55]!==D||e[56]!==R?(y=t.jsxs(ne,{children:[D,R]}),e[55]=D,e[56]=R,e[57]=y):y=e[57];let C;e[58]!==i?(C=i("automations.automationListRow.cancel"),e[58]=i,e[59]=C):C=e[59];let L;e[60]!==C?(L=t.jsx(oe,{children:C}),e[60]=C,e[61]=L):L=e[61];const Q=o.isPending;let k;e[62]!==i?(k=i("automations.automationListRow.deleteButton"),e[62]=i,e[63]=k):k=e[63];let P;e[64]!==K||e[65]!==o.isPending||e[66]!==k?(P=t.jsx(ae,{onClick:K,disabled:Q,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:k}),e[64]=K,e[65]=o.isPending,e[66]=k,e[67]=P):P=e[67];let T;e[68]!==L||e[69]!==P?(T=t.jsxs(re,{children:[L,P]}),e[68]=L,e[69]=P,e[70]=T):T=e[70];let z;e[71]!==y||e[72]!==T?(z=t.jsxs(le,{children:[y,T]}),e[71]=y,e[72]=T,e[73]=z):z=e[73];let F;e[74]!==l||e[75]!==z?(F=t.jsx(ce,{open:l,onOpenChange:I,children:z}),e[74]=l,e[75]=z,e[76]=F):F=e[76];let B;return e[77]!==A||e[78]!==F?(B=t.jsxs(t.Fragment,{children:[A,F]}),e[77]=A,e[78]=F,e[79]=B):B=e[79],B}function he(c){return c.stopPropagation()}function je(c){return c.stopPropagation()}function we(c){const e=q.c(8),{triggerCount:s,nextRunAt:a}=c,n=J();if(s===0){let o;e[0]!==n?(o=n("automations.automationListRow.noTriggers"),e[0]=n,e[1]=o):o=e[1];let l;return e[2]!==o?(l=t.jsx("span",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=l):l=e[3],l}let i;return e[4]!==a||e[5]!==n||e[6]!==s?(i=t.jsx("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground min-w-0",children:a?t.jsxs(t.Fragment,{children:[t.jsx(ue,{size:12,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:n("automations.automationListRow.nextRun",{date:new Date(a).toLocaleString()})})]}):t.jsxs(t.Fragment,{children:[t.jsx(ge,{size:12,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:n("automations.automationListRow.triggers",{count:s})})]})}),e[4]=a,e[5]=n,e[6]=s,e[7]=i):i=e[7],i}export{Ce as A};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as z,r as lt,b as W,X as it,z as rt,a3 as ct,K as tt,j as s,l as ut,m as dt,eK as mt}from"./index-ziWxoYuo.js";import{u as ft}from"./useInfiniteQuery-BGHP6rbt.js";import{u as xt}from"./use-connection-DXReahBl.js";import{u as pt}from"./use-mcp-client-D0GxBaDo.js";import{b as gt}from"./use-virtual-mcp-D6_hi4NV.js";import{b as ht,a as Rt}from"./sheet-BoIBD2fU.js";import{e as jt,a as Nt,b as st,T as G,d as bt,c as V}from"./table-C7ZZ1Gh3.js";import{E as et}from"./empty-state-ypVDBd57.js";import{u as Tt}from"./use-infinite-scroll-OBKDpZd2.js";import{a as St}from"./use-members-Ct_DkclC.js";import{g as vt}from"./task-status-CY7tmQAt.js";import{e as wt}from"./use-automations-81CjRTlN.js";import{T as Ct,f as at,a as nt}from"./thread-sheet-body-CFRV6F8c.js";function It(c){const t=z.c(15),[i,r]=lt.useState(null);let e;t[0]!==c||t[1]!==i?(e=i!==null?c.findIndex(u=>u.id===i):-1,t[0]=c,t[1]=i,t[2]=e):e=t[2];const a=e,o=a!==-1?c[a]:null,n=o!==null;let l,w;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=u=>r(u),w=()=>r(null),t[3]=l,t[4]=w):(l=t[3],w=t[4]);let f,x;t[5]!==a||t[6]!==c?(f=()=>{const u=c[a-1];a>0&&u&&r(u.id)},x=()=>{const u=c[a+1];a!==-1&&u&&r(u.id)},t[5]=a,t[6]=c,t[7]=f,t[8]=x):(f=t[7],x=t[8]);let m;return t[9]!==a||t[10]!==o||t[11]!==n||t[12]!==f||t[13]!==x?(m={selected:o,index:a,isOpen:n,select:l,close:w,prev:f,next:x},t[9]=a,t[10]=o,t[11]=n,t[12]=f,t[13]=x,t[14]=m):m=t[14],m}const Z=50;function X(c){const t=z.c(10),{title:i,value:r,subtitle:e}=c;let a;t[0]!==i?(a=s.jsx("span",{className:"text-sm text-foreground/70",children:i}),t[0]=i,t[1]=a):a=t[1];let o;t[2]!==r?(o=s.jsx("span",{className:"text-3xl font-normal tabular-nums",children:r}),t[2]=r,t[3]=o):o=t[3];let n;t[4]!==e?(n=e&&s.jsx("span",{className:"text-xs text-muted-foreground",children:e}),t[4]=e,t[5]=n):n=t[5];let l;return t[6]!==a||t[7]!==o||t[8]!==n?(l=s.jsxs(mt,{className:"pt-4 px-4 pb-5 gap-1",children:[a,o,n]}),t[6]=a,t[7]=o,t[8]=n,t[9]=l):l=t[9],l}function kt(c){const t=z.c(45),{automationId:i,range:r}=c,e=W(),{data:a,isLoading:o}=wt(i,r),n=a?.runs,l=a?.usage;let w;t[0]!==n?(w=n&&n.total>0?`${Math.round(n.completed/n.total*100)}%`:"—",t[0]=n,t[1]=w):w=t[1];const f=w;let x;t[2]!==e||t[3]!==l?(x=l&&l.truncated?e("automations.automationRuns.lastRunsSubtitle",{count:l.sampledRuns}):void 0,t[2]=e,t[3]=l,t[4]=x):x=t[4];const m=x;let u;t[5]!==e?(u=e("automations.automationRuns.runsTitle"),t[5]=e,t[6]=u):u=t[6];let g;t[7]!==o||t[8]!==n?.total?(g=o?"…":n?.total.toLocaleString()??"0",t[7]=o,t[8]=n?.total,t[9]=g):g=t[9];let h;t[10]!==n||t[11]!==e?(h=n?`${n.completed} ${e("automations.automationRuns.ok")} · ${n.failed} ${e("automations.automationRuns.failed")}${n.inProgress>0?` · ${n.inProgress} ${e("automations.automationRuns.running")}`:""}`:void 0,t[10]=n,t[11]=e,t[12]=h):h=t[12];let R;t[13]!==u||t[14]!==g||t[15]!==h?(R=s.jsx(X,{title:u,value:g,subtitle:h}),t[13]=u,t[14]=g,t[15]=h,t[16]=R):R=t[16];let T;t[17]!==e?(T=e("automations.automationRuns.successRateTitle"),t[17]=e,t[18]=T):T=t[18];const k=o?"…":f;let C;t[19]!==T||t[20]!==k?(C=s.jsx(X,{title:T,value:k}),t[19]=T,t[20]=k,t[21]=C):C=t[21];let S;t[22]!==e?(S=e("automations.automationRuns.tokensTitle"),t[22]=e,t[23]=S):S=t[23];let p;t[24]!==o||t[25]!==l?.totalTokens?(p=o?"…":at(l?.totalTokens??0),t[24]=o,t[25]=l?.totalTokens,t[26]=p):p=t[26];let I;t[27]!==S||t[28]!==p||t[29]!==m?(I=s.jsx(X,{title:S,value:p,subtitle:m}),t[27]=S,t[28]=p,t[29]=m,t[30]=I):I=t[30];let d;t[31]!==e?(d=e("automations.automationRuns.costTitle"),t[31]=e,t[32]=d):d=t[32];let j;t[33]!==o||t[34]!==l?(j=o?"…":l&&l.costUsd>0?nt(l.costUsd):"—",t[33]=o,t[34]=l,t[35]=j):j=t[35];let v;t[36]!==d||t[37]!==j||t[38]!==m?(v=s.jsx(X,{title:d,value:j,subtitle:m}),t[36]=d,t[37]=j,t[38]=m,t[39]=v):v=t[39];let N;return t[40]!==I||t[41]!==v||t[42]!==R||t[43]!==C?(N=s.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[R,C,I,v]}),t[40]=I,t[41]=v,t[42]=R,t[43]=C,t[44]=N):N=t[44],N}function yt(c){const t=z.c(57),{run:i,usage:r,onClick:e,lastRowRef:a}=c,o=W();let n,l;if(t[0]!==i.created_at){const P=new Date(i.created_at);n=P.toLocaleDateString("en-US",{month:"short",day:"numeric"}),l=P.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),t[0]=i.created_at,t[1]=n,t[2]=l}else n=t[1],l=t[2];const w=l;let f,x,m,u,g,h,R,T,k,C,S;if(t[3]!==a||t[4]!==e||t[5]!==i.status||t[6]!==i.title||t[7]!==o){const P=vt(i.status),U=P.icon;x=st,k=a,C="h-14 cursor-pointer hover:bg-muted/40 transition-colors border-b-0",S=e,t[19]!==i.title?(m=s.jsx(V,{className:"min-w-0 pr-2 pl-4 md:pr-4",children:s.jsx("div",{className:"font-medium text-foreground truncate",children:i.title})}),t[19]=i.title,t[20]=m):m=t[20],f=V,T="w-28 px-3",h="flex items-center gap-1.5",R=s.jsx(U,{size:14,className:P.iconClassName}),u=ut("text-sm",P.labelColor),g=o(P.labelKey),t[3]=a,t[4]=e,t[5]=i.status,t[6]=i.title,t[7]=o,t[8]=f,t[9]=x,t[10]=m,t[11]=u,t[12]=g,t[13]=h,t[14]=R,t[15]=T,t[16]=k,t[17]=C,t[18]=S}else f=t[8],x=t[9],m=t[10],u=t[11],g=t[12],h=t[13],R=t[14],T=t[15],k=t[16],C=t[17],S=t[18];let p;t[21]!==u||t[22]!==g?(p=s.jsx("span",{className:u,children:g}),t[21]=u,t[22]=g,t[23]=p):p=t[23];let I;t[24]!==p||t[25]!==h||t[26]!==R?(I=s.jsxs("div",{className:h,children:[R,p]}),t[24]=p,t[25]=h,t[26]=R,t[27]=I):I=t[27];let d;t[28]!==f||t[29]!==I||t[30]!==T?(d=s.jsx(f,{className:T,children:I}),t[28]=f,t[29]=I,t[30]=T,t[31]=d):d=t[31];let j;t[32]!==r?(j=r?at(r.totalTokens):"—",t[32]=r,t[33]=j):j=t[33];let v;t[34]!==j?(v=s.jsx(V,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:j}),t[34]=j,t[35]=v):v=t[35];let N;t[36]!==r?(N=r&&r.costUsd>0?nt(r.costUsd):"—",t[36]=r,t[37]=N):N=t[37];let y;t[38]!==N?(y=s.jsx(V,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:N}),t[38]=N,t[39]=y):y=t[39];let D;t[40]!==n?(D=s.jsx("div",{children:n}),t[40]=n,t[41]=D):D=t[41];let _;t[42]!==w?(_=s.jsx("div",{className:"text-xs text-muted-foreground/60",children:w}),t[42]=w,t[43]=_):_=t[43];let E;t[44]!==D||t[45]!==_?(E=s.jsxs(V,{className:"w-32 px-3 pr-5 text-muted-foreground",children:[D,_]}),t[44]=D,t[45]=_,t[46]=E):E=t[46];let $;return t[47]!==x||t[48]!==m||t[49]!==d||t[50]!==v||t[51]!==y||t[52]!==E||t[53]!==k||t[54]!==C||t[55]!==S?($=s.jsxs(x,{ref:k,className:C,onClick:S,children:[m,d,v,y,E]}),t[47]=x,t[48]=m,t[49]=d,t[50]=v,t[51]=y,t[52]=E,t[53]=k,t[54]=C,t[55]=S,t[56]=$):$=t[56],$}function Bt(c){const t=z.c(73),{automationId:i,triggerIds:r,range:e}=c,a=W(),{org:o,locator:n}=it();let l;t[0]!==o.id||t[1]!==o.slug?(l={connectionId:rt,orgId:o.id,orgSlug:o.slug},t[0]=o.id,t[1]=o.slug,t[2]=l):l=t[2];const w=pt(l),f=ct(),x=xt(),m=gt(),{data:u}=St(),g=r.length>0;let h;t[3]!==i||t[4]!==o.id||t[5]!==r?(h=tt.automationRuns(o.id,i,r),t[3]=i,t[4]=o.id,t[5]=r,t[6]=h):h=t[6];let R;t[7]!==f||t[8]!==r?(R=async M=>{const{pageParam:J}=M,ot=J===void 0?0:J;return await f.call("COLLECTION_THREADS_LIST",{limit:Z,offset:ot,where:{trigger_ids:r}})},t[7]=f,t[8]=r,t[9]=R):R=t[9];let T;t[10]!==g||t[11]!==h||t[12]!==R?(T={queryKey:h,queryFn:R,initialPageParam:0,getNextPageParam:Et,enabled:g,staleTime:3e4},t[10]=g,t[11]=h,t[12]=R,t[13]=T):T=t[13];const{data:k,fetchNextPage:C,hasNextPage:S,isFetchingNextPage:p,isLoading:I}=ft(T);let d,j,v,N;t[14]!==k?.pages||t[15]!==n||t[16]!==e?(d=(k?.pages??[]).flatMap(Dt),N=d.map(Pt),v=dt,j=tt.monitoringThreadUsage(n,JSON.stringify({ids:N,...e})),t[14]=k?.pages,t[15]=n,t[16]=e,t[17]=d,t[18]=j,t[19]=v,t[20]=N):(d=t[17],j=t[18],v=t[19],N=t[20]);let y;t[21]!==e||t[22]!==f||t[23]!==N?(y=async()=>await f.call("MONITORING_THREAD_USAGE",{threadIds:N,...e.startDate?{startDate:e.startDate}:{},...e.endDate?{endDate:e.endDate}:{}}),t[21]=e,t[22]=f,t[23]=N,t[24]=y):y=t[24];const D=N.length>0;let _;t[25]!==j||t[26]!==y||t[27]!==D?(_={queryKey:j,queryFn:y,enabled:D,staleTime:3e4},t[25]=j,t[26]=y,t[27]=D,t[28]=_):_=t[28];const{data:E}=v(_);let $;t[29]!==E?.items?($=new Map((E?.items??[]).map(_t)),t[29]=E?.items,t[30]=$):$=t[30];const P=$;let U;t[31]!==C||t[32]!==S||t[33]!==p?(U=()=>{S&&!p&&C()},t[31]=C,t[32]=S,t[33]=p,t[34]=U):U=t[34];const Y=Tt(U,S??!1,p),b=It(d),B=b.selected;let L;t[35]!==i||t[36]!==e?(L=s.jsx(kt,{automationId:i,range:e}),t[35]=i,t[36]=e,t[37]=L):L=t[37];let O;t[38]!==g||t[39]!==I||t[40]!==Y||t[41]!==d||t[42]!==b||t[43]!==a||t[44]!==P?(O=g?I?s.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:a("automations.automationRuns.loadingRuns")}):d.length===0?s.jsx("div",{className:"py-16",children:s.jsx(et,{title:a("automations.automationRuns.noRunsTitle"),description:a("automations.automationRuns.noRunsDescription")})}):s.jsxs(jt,{className:"w-full border-collapse",children:[s.jsx(Nt,{className:"border-b-0",children:s.jsxs(st,{className:"h-9 hover:bg-transparent border-b border-border",children:[s.jsx(G,{className:"pl-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:a("automations.automationRuns.runHeader")}),s.jsx(G,{className:"w-28 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:a("automations.automationRuns.statusHeader")}),s.jsx(G,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:a("automations.automationRuns.tokensHeader")}),s.jsx(G,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:a("automations.automationRuns.costHeader")}),s.jsx(G,{className:"w-32 px-3 pr-5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:a("automations.automationRuns.startedHeader")})]})}),s.jsx(bt,{children:d.map((M,J)=>s.jsx(yt,{run:M,usage:P.get(M.id),onClick:()=>b.select(M.id),lastRowRef:J===d.length-1?Y:void 0},M.id))})]}):s.jsx("div",{className:"py-16",children:s.jsx(et,{title:a("automations.automationRuns.noStartersTitle"),description:a("automations.automationRuns.noStartersDescription")})}),t[38]=g,t[39]=I,t[40]=Y,t[41]=d,t[42]=b,t[43]=a,t[44]=P,t[45]=O):O=t[45];let A;t[46]!==p||t[47]!==a?(A=p&&s.jsx("div",{className:"py-4 text-center text-sm text-muted-foreground",children:a("automations.automationRuns.loadingMore")}),t[46]=p,t[47]=a,t[48]=A):A=t[48];let H;t[49]!==b?(H=M=>{M||b.close()},t[49]=b,t[50]=H):H=t[50];let K;t[51]!==x||t[52]!==m||t[53]!==w||t[54]!==n||t[55]!==u||t[56]!==d||t[57]!==B||t[58]!==b.index||t[59]!==b.next||t[60]!==b.prev?(K=B&&s.jsx(Ct,{thread:B,client:w,locator:n,connections:x,virtualMcps:m,members:u,nav:{index:b.index,total:d.length,onPrev:b.prev,onNext:b.next}}),t[51]=x,t[52]=m,t[53]=w,t[54]=n,t[55]=u,t[56]=d,t[57]=B,t[58]=b.index,t[59]=b.next,t[60]=b.prev,t[61]=K):K=t[61];let q;t[62]!==K?(q=s.jsx(Rt,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:K}),t[62]=K,t[63]=q):q=t[63];let F;t[64]!==b.isOpen||t[65]!==H||t[66]!==q?(F=s.jsx(ht,{open:b.isOpen,onOpenChange:H,children:q}),t[64]=b.isOpen,t[65]=H,t[66]=q,t[67]=F):F=t[67];let Q;return t[68]!==L||t[69]!==O||t[70]!==A||t[71]!==F?(Q=s.jsxs("div",{className:"flex flex-col gap-5",children:[L,O,A,F]}),t[68]=L,t[69]=O,t[70]=A,t[71]=F,t[72]=Q):Q=t[72],Q}function _t(c){return[c.threadId,{calls:c.calls,inputTokens:c.inputTokens,outputTokens:c.outputTokens,totalTokens:c.totalTokens,costUsd:c.costUsd}]}function Pt(c){return c.id}function Dt(c){return c.items??[]}function Et(c,t){const i=c,r=t;if(!((i?.items?.length??0)<Z))return r.length*Z}export{Bt as A,It as u};
|
|
1
|
+
import{c as z,r as lt,b as W,X as it,z as rt,a3 as ct,K as tt,j as s,l as ut,m as dt,eK as mt}from"./index-B_jqJjWZ.js";import{u as ft}from"./useInfiniteQuery-U5kS7Aw3.js";import{u as xt}from"./use-connection-BhRHLAsr.js";import{u as pt}from"./use-mcp-client-BdNrVAJP.js";import{b as gt}from"./use-virtual-mcp-DfNb-iFO.js";import{b as ht,a as Rt}from"./sheet-D_ZIeH1i.js";import{e as jt,a as Nt,b as st,T as G,d as bt,c as V}from"./table-C-Py-wTW.js";import{E as et}from"./empty-state-DdD7u29c.js";import{u as Tt}from"./use-infinite-scroll-R-FVBBxh.js";import{a as St}from"./use-members-hbcweNuZ.js";import{g as vt}from"./task-status-BVsZxsbL.js";import{e as wt}from"./use-automations-cNW48WkH.js";import{T as Ct,f as at,a as nt}from"./thread-sheet-body-CsPcwFou.js";function It(c){const t=z.c(15),[i,r]=lt.useState(null);let e;t[0]!==c||t[1]!==i?(e=i!==null?c.findIndex(u=>u.id===i):-1,t[0]=c,t[1]=i,t[2]=e):e=t[2];const a=e,o=a!==-1?c[a]:null,n=o!==null;let l,w;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=u=>r(u),w=()=>r(null),t[3]=l,t[4]=w):(l=t[3],w=t[4]);let f,x;t[5]!==a||t[6]!==c?(f=()=>{const u=c[a-1];a>0&&u&&r(u.id)},x=()=>{const u=c[a+1];a!==-1&&u&&r(u.id)},t[5]=a,t[6]=c,t[7]=f,t[8]=x):(f=t[7],x=t[8]);let m;return t[9]!==a||t[10]!==o||t[11]!==n||t[12]!==f||t[13]!==x?(m={selected:o,index:a,isOpen:n,select:l,close:w,prev:f,next:x},t[9]=a,t[10]=o,t[11]=n,t[12]=f,t[13]=x,t[14]=m):m=t[14],m}const Z=50;function X(c){const t=z.c(10),{title:i,value:r,subtitle:e}=c;let a;t[0]!==i?(a=s.jsx("span",{className:"text-sm text-foreground/70",children:i}),t[0]=i,t[1]=a):a=t[1];let o;t[2]!==r?(o=s.jsx("span",{className:"text-3xl font-normal tabular-nums",children:r}),t[2]=r,t[3]=o):o=t[3];let n;t[4]!==e?(n=e&&s.jsx("span",{className:"text-xs text-muted-foreground",children:e}),t[4]=e,t[5]=n):n=t[5];let l;return t[6]!==a||t[7]!==o||t[8]!==n?(l=s.jsxs(mt,{className:"pt-4 px-4 pb-5 gap-1",children:[a,o,n]}),t[6]=a,t[7]=o,t[8]=n,t[9]=l):l=t[9],l}function kt(c){const t=z.c(45),{automationId:i,range:r}=c,e=W(),{data:a,isLoading:o}=wt(i,r),n=a?.runs,l=a?.usage;let w;t[0]!==n?(w=n&&n.total>0?`${Math.round(n.completed/n.total*100)}%`:"—",t[0]=n,t[1]=w):w=t[1];const f=w;let x;t[2]!==e||t[3]!==l?(x=l&&l.truncated?e("automations.automationRuns.lastRunsSubtitle",{count:l.sampledRuns}):void 0,t[2]=e,t[3]=l,t[4]=x):x=t[4];const m=x;let u;t[5]!==e?(u=e("automations.automationRuns.runsTitle"),t[5]=e,t[6]=u):u=t[6];let g;t[7]!==o||t[8]!==n?.total?(g=o?"…":n?.total.toLocaleString()??"0",t[7]=o,t[8]=n?.total,t[9]=g):g=t[9];let h;t[10]!==n||t[11]!==e?(h=n?`${n.completed} ${e("automations.automationRuns.ok")} · ${n.failed} ${e("automations.automationRuns.failed")}${n.inProgress>0?` · ${n.inProgress} ${e("automations.automationRuns.running")}`:""}`:void 0,t[10]=n,t[11]=e,t[12]=h):h=t[12];let R;t[13]!==u||t[14]!==g||t[15]!==h?(R=s.jsx(X,{title:u,value:g,subtitle:h}),t[13]=u,t[14]=g,t[15]=h,t[16]=R):R=t[16];let T;t[17]!==e?(T=e("automations.automationRuns.successRateTitle"),t[17]=e,t[18]=T):T=t[18];const k=o?"…":f;let C;t[19]!==T||t[20]!==k?(C=s.jsx(X,{title:T,value:k}),t[19]=T,t[20]=k,t[21]=C):C=t[21];let S;t[22]!==e?(S=e("automations.automationRuns.tokensTitle"),t[22]=e,t[23]=S):S=t[23];let p;t[24]!==o||t[25]!==l?.totalTokens?(p=o?"…":at(l?.totalTokens??0),t[24]=o,t[25]=l?.totalTokens,t[26]=p):p=t[26];let I;t[27]!==S||t[28]!==p||t[29]!==m?(I=s.jsx(X,{title:S,value:p,subtitle:m}),t[27]=S,t[28]=p,t[29]=m,t[30]=I):I=t[30];let d;t[31]!==e?(d=e("automations.automationRuns.costTitle"),t[31]=e,t[32]=d):d=t[32];let j;t[33]!==o||t[34]!==l?(j=o?"…":l&&l.costUsd>0?nt(l.costUsd):"—",t[33]=o,t[34]=l,t[35]=j):j=t[35];let v;t[36]!==d||t[37]!==j||t[38]!==m?(v=s.jsx(X,{title:d,value:j,subtitle:m}),t[36]=d,t[37]=j,t[38]=m,t[39]=v):v=t[39];let N;return t[40]!==I||t[41]!==v||t[42]!==R||t[43]!==C?(N=s.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[R,C,I,v]}),t[40]=I,t[41]=v,t[42]=R,t[43]=C,t[44]=N):N=t[44],N}function yt(c){const t=z.c(57),{run:i,usage:r,onClick:e,lastRowRef:a}=c,o=W();let n,l;if(t[0]!==i.created_at){const P=new Date(i.created_at);n=P.toLocaleDateString("en-US",{month:"short",day:"numeric"}),l=P.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),t[0]=i.created_at,t[1]=n,t[2]=l}else n=t[1],l=t[2];const w=l;let f,x,m,u,g,h,R,T,k,C,S;if(t[3]!==a||t[4]!==e||t[5]!==i.status||t[6]!==i.title||t[7]!==o){const P=vt(i.status),U=P.icon;x=st,k=a,C="h-14 cursor-pointer hover:bg-muted/40 transition-colors border-b-0",S=e,t[19]!==i.title?(m=s.jsx(V,{className:"min-w-0 pr-2 pl-4 md:pr-4",children:s.jsx("div",{className:"font-medium text-foreground truncate",children:i.title})}),t[19]=i.title,t[20]=m):m=t[20],f=V,T="w-28 px-3",h="flex items-center gap-1.5",R=s.jsx(U,{size:14,className:P.iconClassName}),u=ut("text-sm",P.labelColor),g=o(P.labelKey),t[3]=a,t[4]=e,t[5]=i.status,t[6]=i.title,t[7]=o,t[8]=f,t[9]=x,t[10]=m,t[11]=u,t[12]=g,t[13]=h,t[14]=R,t[15]=T,t[16]=k,t[17]=C,t[18]=S}else f=t[8],x=t[9],m=t[10],u=t[11],g=t[12],h=t[13],R=t[14],T=t[15],k=t[16],C=t[17],S=t[18];let p;t[21]!==u||t[22]!==g?(p=s.jsx("span",{className:u,children:g}),t[21]=u,t[22]=g,t[23]=p):p=t[23];let I;t[24]!==p||t[25]!==h||t[26]!==R?(I=s.jsxs("div",{className:h,children:[R,p]}),t[24]=p,t[25]=h,t[26]=R,t[27]=I):I=t[27];let d;t[28]!==f||t[29]!==I||t[30]!==T?(d=s.jsx(f,{className:T,children:I}),t[28]=f,t[29]=I,t[30]=T,t[31]=d):d=t[31];let j;t[32]!==r?(j=r?at(r.totalTokens):"—",t[32]=r,t[33]=j):j=t[33];let v;t[34]!==j?(v=s.jsx(V,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:j}),t[34]=j,t[35]=v):v=t[35];let N;t[36]!==r?(N=r&&r.costUsd>0?nt(r.costUsd):"—",t[36]=r,t[37]=N):N=t[37];let y;t[38]!==N?(y=s.jsx(V,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:N}),t[38]=N,t[39]=y):y=t[39];let D;t[40]!==n?(D=s.jsx("div",{children:n}),t[40]=n,t[41]=D):D=t[41];let _;t[42]!==w?(_=s.jsx("div",{className:"text-xs text-muted-foreground/60",children:w}),t[42]=w,t[43]=_):_=t[43];let E;t[44]!==D||t[45]!==_?(E=s.jsxs(V,{className:"w-32 px-3 pr-5 text-muted-foreground",children:[D,_]}),t[44]=D,t[45]=_,t[46]=E):E=t[46];let $;return t[47]!==x||t[48]!==m||t[49]!==d||t[50]!==v||t[51]!==y||t[52]!==E||t[53]!==k||t[54]!==C||t[55]!==S?($=s.jsxs(x,{ref:k,className:C,onClick:S,children:[m,d,v,y,E]}),t[47]=x,t[48]=m,t[49]=d,t[50]=v,t[51]=y,t[52]=E,t[53]=k,t[54]=C,t[55]=S,t[56]=$):$=t[56],$}function Bt(c){const t=z.c(73),{automationId:i,triggerIds:r,range:e}=c,a=W(),{org:o,locator:n}=it();let l;t[0]!==o.id||t[1]!==o.slug?(l={connectionId:rt,orgId:o.id,orgSlug:o.slug},t[0]=o.id,t[1]=o.slug,t[2]=l):l=t[2];const w=pt(l),f=ct(),x=xt(),m=gt(),{data:u}=St(),g=r.length>0;let h;t[3]!==i||t[4]!==o.id||t[5]!==r?(h=tt.automationRuns(o.id,i,r),t[3]=i,t[4]=o.id,t[5]=r,t[6]=h):h=t[6];let R;t[7]!==f||t[8]!==r?(R=async M=>{const{pageParam:J}=M,ot=J===void 0?0:J;return await f.call("COLLECTION_THREADS_LIST",{limit:Z,offset:ot,where:{trigger_ids:r}})},t[7]=f,t[8]=r,t[9]=R):R=t[9];let T;t[10]!==g||t[11]!==h||t[12]!==R?(T={queryKey:h,queryFn:R,initialPageParam:0,getNextPageParam:Et,enabled:g,staleTime:3e4},t[10]=g,t[11]=h,t[12]=R,t[13]=T):T=t[13];const{data:k,fetchNextPage:C,hasNextPage:S,isFetchingNextPage:p,isLoading:I}=ft(T);let d,j,v,N;t[14]!==k?.pages||t[15]!==n||t[16]!==e?(d=(k?.pages??[]).flatMap(Dt),N=d.map(Pt),v=dt,j=tt.monitoringThreadUsage(n,JSON.stringify({ids:N,...e})),t[14]=k?.pages,t[15]=n,t[16]=e,t[17]=d,t[18]=j,t[19]=v,t[20]=N):(d=t[17],j=t[18],v=t[19],N=t[20]);let y;t[21]!==e||t[22]!==f||t[23]!==N?(y=async()=>await f.call("MONITORING_THREAD_USAGE",{threadIds:N,...e.startDate?{startDate:e.startDate}:{},...e.endDate?{endDate:e.endDate}:{}}),t[21]=e,t[22]=f,t[23]=N,t[24]=y):y=t[24];const D=N.length>0;let _;t[25]!==j||t[26]!==y||t[27]!==D?(_={queryKey:j,queryFn:y,enabled:D,staleTime:3e4},t[25]=j,t[26]=y,t[27]=D,t[28]=_):_=t[28];const{data:E}=v(_);let $;t[29]!==E?.items?($=new Map((E?.items??[]).map(_t)),t[29]=E?.items,t[30]=$):$=t[30];const P=$;let U;t[31]!==C||t[32]!==S||t[33]!==p?(U=()=>{S&&!p&&C()},t[31]=C,t[32]=S,t[33]=p,t[34]=U):U=t[34];const Y=Tt(U,S??!1,p),b=It(d),B=b.selected;let L;t[35]!==i||t[36]!==e?(L=s.jsx(kt,{automationId:i,range:e}),t[35]=i,t[36]=e,t[37]=L):L=t[37];let O;t[38]!==g||t[39]!==I||t[40]!==Y||t[41]!==d||t[42]!==b||t[43]!==a||t[44]!==P?(O=g?I?s.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:a("automations.automationRuns.loadingRuns")}):d.length===0?s.jsx("div",{className:"py-16",children:s.jsx(et,{title:a("automations.automationRuns.noRunsTitle"),description:a("automations.automationRuns.noRunsDescription")})}):s.jsxs(jt,{className:"w-full border-collapse",children:[s.jsx(Nt,{className:"border-b-0",children:s.jsxs(st,{className:"h-9 hover:bg-transparent border-b border-border",children:[s.jsx(G,{className:"pl-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:a("automations.automationRuns.runHeader")}),s.jsx(G,{className:"w-28 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:a("automations.automationRuns.statusHeader")}),s.jsx(G,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:a("automations.automationRuns.tokensHeader")}),s.jsx(G,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:a("automations.automationRuns.costHeader")}),s.jsx(G,{className:"w-32 px-3 pr-5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:a("automations.automationRuns.startedHeader")})]})}),s.jsx(bt,{children:d.map((M,J)=>s.jsx(yt,{run:M,usage:P.get(M.id),onClick:()=>b.select(M.id),lastRowRef:J===d.length-1?Y:void 0},M.id))})]}):s.jsx("div",{className:"py-16",children:s.jsx(et,{title:a("automations.automationRuns.noStartersTitle"),description:a("automations.automationRuns.noStartersDescription")})}),t[38]=g,t[39]=I,t[40]=Y,t[41]=d,t[42]=b,t[43]=a,t[44]=P,t[45]=O):O=t[45];let A;t[46]!==p||t[47]!==a?(A=p&&s.jsx("div",{className:"py-4 text-center text-sm text-muted-foreground",children:a("automations.automationRuns.loadingMore")}),t[46]=p,t[47]=a,t[48]=A):A=t[48];let H;t[49]!==b?(H=M=>{M||b.close()},t[49]=b,t[50]=H):H=t[50];let K;t[51]!==x||t[52]!==m||t[53]!==w||t[54]!==n||t[55]!==u||t[56]!==d||t[57]!==B||t[58]!==b.index||t[59]!==b.next||t[60]!==b.prev?(K=B&&s.jsx(Ct,{thread:B,client:w,locator:n,connections:x,virtualMcps:m,members:u,nav:{index:b.index,total:d.length,onPrev:b.prev,onNext:b.next}}),t[51]=x,t[52]=m,t[53]=w,t[54]=n,t[55]=u,t[56]=d,t[57]=B,t[58]=b.index,t[59]=b.next,t[60]=b.prev,t[61]=K):K=t[61];let q;t[62]!==K?(q=s.jsx(Rt,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:K}),t[62]=K,t[63]=q):q=t[63];let F;t[64]!==b.isOpen||t[65]!==H||t[66]!==q?(F=s.jsx(ht,{open:b.isOpen,onOpenChange:H,children:q}),t[64]=b.isOpen,t[65]=H,t[66]=q,t[67]=F):F=t[67];let Q;return t[68]!==L||t[69]!==O||t[70]!==A||t[71]!==F?(Q=s.jsxs("div",{className:"flex flex-col gap-5",children:[L,O,A,F]}),t[68]=L,t[69]=O,t[70]=A,t[71]=F,t[72]=Q):Q=t[72],Q}function _t(c){return[c.threadId,{calls:c.calls,inputTokens:c.inputTokens,outputTokens:c.outputTokens,totalTokens:c.totalTokens,costUsd:c.costUsd}]}function Pt(c){return c.id}function Dt(c){return c.items??[]}function Et(c,t){const i=c,r=t;if(!((i?.items?.length??0)<Z))return r.length*Z}export{Bt as A,It as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as k,j as e,b as $,X as D,d as M,r as q,n as d,B as V,fx as X,q as R}from"./index-
|
|
1
|
+
import{c as k,j as e,b as $,X as D,d as M,r as q,n as d,B as V,fx as X,q as R}from"./index-B_jqJjWZ.js";import{s as F}from"./Plus-GxHWJNZK.js";import{i as S}from"./Zap-DMCGUdZC.js";import{S as G}from"./search-input-Btpivanp.js";import{E as T}from"./empty-state-DdD7u29c.js";import{u as H}from"./use-automations-cNW48WkH.js";import{u as J}from"./use-navigate-to-agent-C6DjZGwr.js";import{A as K}from"./automation-list-row-CH-bg8ai.js";import{b as O}from"./use-virtual-mcp-DfNb-iFO.js";import{R as Q}from"./require-capability-naAuPznp.js";import"./SearchMd-QgF27GDM.js";import"./use-mcp-client-BdNrVAJP.js";import"./auth-pb03Kzig.js";import"./hooks-BdWJM6ej.js";import"./backoff-8mStPHYB.js";import"./task-board-DfS5a_U6.js";import"./schema-B6bqanRf.js";import"./thread-intent-E5sYh_tC.js";import"./slugify-CEUa2lfQ.js";import"./github-repo-BknN0SVI.js";import"./alert-dialog-B5hf3Zq6.js";import"./agent-icon-CP9iXRWW.js";import"./AlertCircle-BxsvjprR.js";import"./Tool01-BCsmpwCz.js";import"./ArrowUp-DPWXMpl2.js";import"./ArrowLeft-C98PG333.js";import"./ArrowRight-CK7-YvUr.js";import"./ZoomOut-CvfOKBlv.js";import"./Globe04-95dd8QSP.js";import"./CheckCircle-DS--6hmh.js";import"./Check-Blxq8j59.js";import"./ChevronUp-CRNjHjTK.js";import"./UserSquare-DKTJMzlh.js";import"./Copy01-DmLSY0Qf.js";import"./CreditCard01-C6GC8NM-.js";import"./DotsVertical-B2eyM1bc.js";import"./Eye-DDS_VF-Y.js";import"./Share07-DV5DThxW.js";import"./XClose-DKTON5RG.js";import"./Image01-C1vTsGg9.js";import"./Key01-CfEGZMt9.js";import"./LayoutLeft-xPkXxcb6.js";import"./Link01-CvcI1eLv.js";import"./LinkExternal01-DH3oN4WK.js";import"./Monitor01-B9ABYuV_.js";import"./Sun-C3em9BZW.js";import"./Palette-DJJWQUTk.js";import"./Trash01-BgJo-uHb.js";import"./Upload01-BNcthBU9.js";import"./User01-DvYjRkyx.js";import"./Users01-DqJ21DOW.js";import"./X-tomqNIg1.js";import"./access-gate-DsBjN_k-.js";import"./capability-load-error-QLFmZqWG.js";function U(){const t=k.c(20),o=$(),{org:p}=D(),{data:y}=H(void 0),g=y===void 0?[]:y,E=O(),P=J(),f=M(),[x,z]=q.useState(""),h=x.toLowerCase(),b=new Map(E.map(W)),A=g.filter(i=>{if(!h||i.name.toLowerCase().includes(h))return!0;if(i.virtual_mcp_id){const l=b.get(i.virtual_mcp_id);if(l&&l.title.toLowerCase().includes(h))return!0}return!1}),B=(i,l)=>{const N=l&&b.has(l)?l:X(p.id);R("automations_list_row_clicked",{automation_id:i,agent_id:N,source:"settings_automations"}),P(N,{panel:`automation:${i}`})};let c;t[0]!==f||t[1]!==p.slug?(c=()=>{R("automations_empty_state_browse_agents_clicked"),f({to:"/$org/settings/agents",params:{org:p.slug}})},t[0]=f,t[1]=p.slug,t[2]=c):c=t[2];const L=c,j=d,C=d,v=d;let s;t[3]!==o?(s=o("settings.automations.pageTitle"),t[3]=o,t[4]=s):s=t[4];let r;t[5]!==s?(r=e.jsx(d.Title,{children:s}),t[5]=s,t[6]=r):r=t[6];const w=g.length>0&&e.jsx(G,{value:x,onChange:z,placeholder:o("settings.automations.searchPlaceholder"),className:"w-full md:w-[375px]"});let n;t[7]!==r||t[8]!==w?(n=e.jsxs("div",{className:"flex flex-col gap-6",children:[r,w]}),t[7]=r,t[8]=w,t[9]=n):n=t[9];const _=g.length===0?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(T,{image:e.jsx(S,{size:48,className:"text-muted-foreground"}),title:o("settings.automations.emptyTitle"),description:o("settings.automations.emptyDescription"),actions:e.jsxs(V,{size:"sm",onClick:L,children:[e.jsx(F,{size:14}),o("settings.automations.browseAgentsButton")]})})}):A.length===0?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(T,{image:e.jsx(S,{size:48,className:"text-muted-foreground"}),title:o("settings.automations.noResultsTitle"),description:o("settings.automations.noResultsDescription",{search:x})})}):e.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:A.map(i=>e.jsx(K,{automation:i,showAgent:!0,onClick:()=>B(i.id,i.virtual_mcp_id)},i.id))});let a;t[10]!==v.Container||t[11]!==n||t[12]!==_?(a=e.jsxs(v.Container,{children:[n,_]}),t[10]=v.Container,t[11]=n,t[12]=_,t[13]=a):a=t[13];let m;t[14]!==C.Content||t[15]!==a?(m=e.jsx(C.Content,{children:a}),t[14]=C.Content,t[15]=a,t[16]=m):m=t[16];let u;return t[17]!==j||t[18]!==m?(u=e.jsx(j,{children:m}),t[17]=j,t[18]=m,t[19]=u):u=t[19],u}function W(t){return[t.id,t]}function Yt(){const t=k.c(1);let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx(Q,{capability:"automations:manage",area:"automations",children:e.jsx(U,{})}),t[0]=o):o=t[0],o}export{Yt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{V as d}from"./index-
|
|
1
|
+
import{V as d}from"./index-B_jqJjWZ.js";const m=1e4,y="true",i=2;function a(t,n){return d.chatAutosend(t,n)}function l(t){return t==="pending"||t==="sending"}function f(t){if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(!n||typeof n!="object")return null;const e=n;let o=0;e.status==="sending"?o=e.retryAt===void 0?1:i:e.retryAt!==void 0&&(o=1);const r=e.attempt===void 0?o:e.attempt;return typeof e.createdAt!="number"||typeof e.message!="object"||!l(e.status)||e.retryAt!==void 0&&typeof e.retryAt!="number"||typeof r!="number"||!Number.isInteger(r)||r<0||r>i?null:{...n,attempt:r}}function S(t,n,e,o,r=Date.now()){const s={message:o,createdAt:r,status:"pending",attempt:0};return t.setItem(a(n,e),JSON.stringify(s)),s}function p(t,n,e){const o=a(n,e),r=f(t.getItem(o));return r||(t.removeItem(o),null)}function g(t,n,e,o=Date.now()){const r=a(n,e),s=p(t,n,e);if(!s||s.status!=="pending")return null;if(s.attempt>=i)return t.removeItem(r),null;const c=s.retryAt??s.createdAt;if(o-c>=m)return t.removeItem(r),null;const u={...s,status:"sending",attempt:s.attempt+1};return t.setItem(r,JSON.stringify(u)),{message:u.message,createdAt:u.createdAt,attempt:u.attempt}}function T(t,n,e){t.removeItem(a(n,e))}export{y as A,T as a,g as c,S as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as k,j as i,l as f,aB as R,bb as V,bc as I,bd as $}from"./index-
|
|
1
|
+
import{c as k,j as i,l as f,aB as R,bb as V,bc as I,bd as $}from"./index-B_jqJjWZ.js";import{s as O}from"./User01-DvYjRkyx.js";function U(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("relative flex size-8 shrink-0 overflow-hidden rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx($,{"data-slot":"avatar",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function E(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("aspect-square size-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(V,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function M(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("bg-muted flex size-full items-center justify-center rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(I,{"data-slot":"avatar-fallback",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}const C=["drop-shadow-lg bg-gradient-to-br from-red-100 to-red-300 text-red-800 shadow-lg shadow-red-300/40 ring-1 ring-red-300/30","drop-shadow-lg bg-gradient-to-br from-lime-100 to-lime-300 text-lime-800 shadow-lg shadow-lime-300/40 ring-1 ring-lime-300/30","drop-shadow-lg bg-gradient-to-br from-emerald-100 to-emerald-300 text-emerald-800 shadow-lg shadow-emerald-300/40 ring-1 ring-emerald-300/30","drop-shadow-lg bg-gradient-to-br from-orange-100 to-orange-300 text-orange-800 shadow-lg shadow-orange-300/40 ring-1 ring-orange-300/30","drop-shadow-lg bg-gradient-to-br from-amber-100 to-amber-300 text-amber-800 shadow-lg shadow-amber-300/40 ring-1 ring-amber-300/30","drop-shadow-lg bg-gradient-to-br from-yellow-100 to-yellow-300 text-yellow-800 shadow-lg shadow-yellow-300/40 ring-1 ring-yellow-300/30","drop-shadow-lg bg-gradient-to-br from-green-100 to-green-300 text-green-800 shadow-lg shadow-green-300/40 ring-1 ring-green-300/30","drop-shadow-lg bg-gradient-to-br from-teal-100 to-teal-300 text-teal-800 shadow-lg shadow-teal-300/40 ring-1 ring-teal-300/30","drop-shadow-lg bg-gradient-to-br from-cyan-100 to-cyan-300 text-cyan-800 shadow-lg shadow-cyan-300/40 ring-1 ring-cyan-300/30","drop-shadow-lg bg-gradient-to-br from-sky-100 to-sky-300 text-sky-800 shadow-lg shadow-sky-300/40 ring-1 ring-sky-300/30","drop-shadow-lg bg-gradient-to-br from-blue-100 to-blue-300 text-blue-800 shadow-lg shadow-blue-300/40 ring-1 ring-blue-300/30","drop-shadow-lg bg-gradient-to-br from-indigo-100 to-indigo-300 text-indigo-800 shadow-lg shadow-indigo-300/40 ring-1 ring-indigo-300/30","drop-shadow-lg bg-gradient-to-br from-violet-100 to-violet-300 text-violet-800 shadow-lg shadow-violet-300/40 ring-1 ring-violet-300/30","drop-shadow-lg bg-gradient-to-br from-purple-100 to-purple-300 text-purple-800 shadow-lg shadow-purple-300/40 ring-1 ring-purple-300/30","drop-shadow-lg bg-gradient-to-br from-fuchsia-100 to-fuchsia-300 text-fuchsia-800 shadow-lg shadow-fuchsia-300/40 ring-1 ring-fuchsia-300/30","drop-shadow-lg bg-gradient-to-br from-pink-100 to-pink-300 text-pink-800 shadow-lg shadow-pink-300/40 ring-1 ring-pink-300/30","drop-shadow-lg bg-gradient-to-br from-rose-100 to-rose-300 text-rose-800 shadow-lg shadow-rose-300/40 ring-1 ring-rose-300/30"],L="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function T(r){let e=0;for(let t=0;t<r.length;t++)e=r.charCodeAt(t)+((e<<5)-e);const s=Math.abs(e)%C.length;return C[s]}const S=R("border border-border",{variants:{shape:{circle:"rounded-full",square:""},size:{"3xs":"w-3 h-3 text-[7px] font-semibold","2xs":"w-4 h-4 text-[9px] font-semibold",xs:"w-6 h-6 text-sm font-semibold",sm:"w-8 h-8 text-lg font-semibold",base:"w-10 h-10 text-2xl font-semibold",lg:"w-12 h-12 text-3xl font-semibold",xl:"w-16 h-16 text-4xl font-semibold","2xl":"w-20 h-20 text-5xl font-semibold","3xl":"w-32 h-32 text-7xl font-semibold"}},compoundVariants:[{shape:"square",size:"xs",class:"rounded-lg"},{shape:"square",size:"sm",class:"rounded-xl"},{shape:"square",size:"base",class:"rounded-xl"},{shape:"square",size:"lg",class:"rounded-xl"},{shape:"square",size:"xl",class:"rounded-2xl"},{shape:"square",size:"2xl",class:"rounded-3xl"},{shape:"square",size:"3xl",class:"rounded-[40px]"}],defaultVariants:{shape:"square",size:"base"}}),_=R("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),B=r=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[r]||e.base};function D(r){const e=k.c(34);let s,t,o,a,n,d,g,l;e[0]!==r?({url:l,fallback:t,shape:a,size:n,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const m=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g;let x;e:{if(typeof t=="string"){let c;e[9]!==t?(c=t.trim().slice(0,2).toUpperCase(),e[9]=t,e[10]=c):c=e[10],x=c;break e}x=t}const b=x;let y;e:{if(j){y=L;break e}if(typeof t=="string"){let c;e[11]!==t?(c=T(t),e[11]=t,e[12]=c):c=e[12],y=c;break e}y=C[0]}const z=y;let N;e[13]!==l?(N=l?.startsWith("icon://"),e[13]=l,e[14]=N):N=e[14];const p=N;let q;e[15]!==p||e[16]!==l?(q=p?l?.replace("icon://",""):void 0,e[15]=p,e[16]=l,e[17]=q):q=e[17];const F=q;let w;e[18]!==s||e[19]!==m||e[20]!==h?(w=f(S({shape:m,size:h}),s),e[18]=s,e[19]=m,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==z||e[23]!==b||e[24]!==F||e[25]!==p||e[26]!==u||e[27]!==h||e[28]!==l?(v=p&&F?i.jsx("div",{className:f("flex items-center justify-center w-full h-full",z),children:i.jsx(O,{size:B(h)})}):i.jsxs(i.Fragment,{children:[l&&i.jsx(E,{src:l,loading:"lazy",alt:"Avatar",className:f(_({objectFit:u}))}),i.jsx(M,{className:f(z,"rounded-none"),delayMs:l?600:0,children:b})]}),e[22]=z,e[23]=b,e[24]=F,e[25]=p,e[26]=u,e[27]=h,e[28]=l,e[29]=v):v=e[29];let A;return e[30]!==o||e[31]!==v||e[32]!==w?(A=i.jsx(U,{className:w,...o,children:v}),e[30]=o,e[31]=v,e[32]=w,e[33]=A):A=e[33],A}function W(r){const e=k.c(18);let s,t,o,a,n,d,g,l;e[0]!==r?({shape:a,size:n,url:l,fallback:t,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const m=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,x=h??"base";let b;return e[9]!==s||e[10]!==t||e[11]!==j||e[12]!==u||e[13]!==o||e[14]!==m||e[15]!==x||e[16]!==l?(b=i.jsx(D,{shape:m,url:l,fallback:t,size:x,objectFit:u,className:s,muted:j,...o}),e[9]=s,e[10]=t,e[11]=j,e[12]=u,e[13]=o,e[14]=m,e[15]=x,e[16]=l,e[17]=b):b=e[17],b}W.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:f(S({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{W as A};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g,l,j as u,be as v,aB as b}from"./index-
|
|
1
|
+
import{c as g,l,j as u,be as v,aB as b}from"./index-B_jqJjWZ.js";const f=b("inline-flex items-center justify-center rounded-full border text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",warning:"border-transparent bg-warning text-warning-foreground [a&]:hover:bg-warning/90 focus-visible:ring-warning/20 dark:focus-visible:ring-warning/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"},size:{default:"px-2 py-0.5",icon:"size-5",segmented:"h-7 gap-0 rounded-lg border-transparent bg-card p-0 card-shadow"}},defaultVariants:{variant:"default",size:"default"}});function h(d){const e=g.c(14);let r,s,a,n,t;e[0]!==d?({className:r,variant:t,size:a,asChild:n,...s}=d,e[0]=d,e[1]=r,e[2]=s,e[3]=a,e[4]=n,e[5]=t):(r=e[1],s=e[2],a=e[3],n=e[4],t=e[5]);const c=(n===void 0?!1:n)?v:"span";let i;e[6]!==r||e[7]!==a||e[8]!==t?(i=l(f({variant:t,size:a}),r),e[6]=r,e[7]=a,e[8]=t,e[9]=i):i=e[9];let o;return e[10]!==c||e[11]!==s||e[12]!==i?(o=u.jsx(c,{"data-slot":"badge",className:i,...s}),e[10]=c,e[11]=s,e[12]=i,e[13]=o):o=e[13],o}export{h as B};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{c as $,b as D,r as G,j as s,K as xe,m as ge,l as te,h as Fe,B as Bt}from"./index-ziWxoYuo.js";import{T as ve,R as Me,a as qe,b as me,K as Ue,P as He,s as Ge,e as Ve,S as Ke,r as St,D as Ye,c as Je,u as We,C as Qe,v as Pt}from"./rich-text-link-control-DNvgXQgl.js";import{s as Se}from"./Plus-BUY7Ud4X.js";import{l as wt,F as Pe,T as ne,I as se,s as R,i as de,R as ae,A as ce,b as _t,j as Tt,k as ie,o as Lt}from"./agent-site-editor-content-DTjzis44.js";import{I as It,af as $t,Z as At,z as he,S as Et,a7 as Xe,a8 as Ze,a9 as et,aa as Rt,r as Dt,ae as tt}from"./agent-icon-BvX9_a8p.js";import{a as Te,b as Ot,e as zt,C as Ft,c as Mt,d as qt}from"./command-M2XMNX_S.js";import{a as Ut,b as Ht,P as Gt}from"./popover-Bk7hW0ey.js";import{a as Vt}from"./Copy01-C9mP-VM4.js";import{s as Ce}from"./Trash01-CytDsT4G.js";import{b2 as Kt,b1 as Yt,y as Jt}from"./runnable-block-editor-BqGS6HoQ.js";import{Y as Wt,r as Qt}from"./claim-phase-copy-CKjixjui.js";import{i as Xt,a as Zt}from"./ZoomOut-DdkoWs_x.js";import{u as lt,s as st,a as we,b as ot}from"./index-BTBWEo6K.js";import{s as nt}from"./suggestion-tuFcyOKm.js";import{w as rt}from"./section-preview-url-Csj0_ZDg.js";import{B as el}from"./index-fHAcll79.js";import{i as it}from"./Check-D8Zqb1HC.js";import{a as tl}from"./Image01-CWl1q5TL.js";import{s as ll}from"./XClose-BNaGgCB0.js";import{L as fe}from"./label-_3WYFdo5.js";import{c as sl,d as ol,b as nl,D as rl}from"./dialog-DZbrQs4a.js";import{I as Be}from"./input-CztG7UMa.js";const be=u=>typeof u=="string"?u:"",il=/\/blog\.tsx?$/;function at(u,e){for(const[t,r]of Object.entries(u)){if(t.includes("/")||!r||typeof r!="object"||Array.isArray(r))continue;const l=r;if(typeof l.__resolveType!="string"||!il.test(l.__resolveType))continue;const o=be(l[e]);if(o)return o}return null}const al=new Set(["website/pages/Page.tsx","$live/pages/LivePage.tsx"]);function cl(u){if(!u||typeof u!="object"||Array.isArray(u))return null;const e=u;return typeof e.__resolveType!="string"||!al.has(e.__resolveType)?null:typeof e.path=="string"?e.path:null}function dl(u){return Wt(u).filter(e=>e!=="*").length}function ct(u,e){let t=null,r=Number.POSITIVE_INFINITY;for(const l of Object.values(u)){const o=cl(l);if(!o||!e.test(JSON.stringify(l)))continue;const n=dl(o);n<r&&(t=o,r=n)}return t}const ul=/blogpostpage/i,fl=/blogcategorypage/i;function dt(u){return at(u,"pageSlug")??ct(u,ul)}function ml(u){return at(u,"categorySlug")??ct(u,fl)}function pl(u){const e=u.categories;if(!Array.isArray(e)||e.length===0)return"";const t=e[0];return be(t?.slug)}function ut(u,e){let t=u;if(/:category\??/.test(t)){if(!e.category)return null;t=t.replace(/:category\??/g,encodeURIComponent(e.category))}if(/:slug\??/.test(t)){if(!e.slug)return null;t=t.replace(/:slug\??/g,encodeURIComponent(e.slug))}return t}const xl=/:(?:categorySlug|categoria|category|slug)\??/,gl=/:(?:categorySlug|categoria|category|slug)\??/g;function hl(u,e){return xl.test(u)?e?u.replace(gl,encodeURIComponent(e)):null:u}function no({decofile:u,category:e,previewBaseUrl:t,draftPointer:r}){if(!t)return null;const l=ml(u);if(!l)return null;const o=hl(l,be(e.slug));if(!o)return null;try{return rt(new URL(o,t).href,r)}catch{return null}}function ro({decofile:u,post:e,previewBaseUrl:t,draftPointer:r}){if(!t)return null;const l=dt(u);if(!l)return null;const o=ut(l,{category:pl(e),slug:be(e.slug)});if(!o)return null;try{return rt(new URL(o,t).href,r)}catch{return null}}const Le={app:"sandbox.blockPicker.blocksLabel",site:"sandbox.blockPicker.customBlocksLabel"};function bl(u){const e=$.c(6),{iconName:t,iconUrl:r,alt:l}=u;let o;e[0]!==t?(o=$t(t)??It,e[0]=t,e[1]=o):o=e[1];const n=o;let i;return e[2]!==n||e[3]!==l||e[4]!==r?(i=s.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-md border bg-muted",children:r?s.jsx("img",{src:r,alt:l,className:"size-5 object-contain"}):s.jsx(n,{size:16,className:"text-muted-foreground"})}),e[2]=n,e[3]=l,e[4]=r,e[5]=i):i=e[5],i}function Ie(u){const e=$.c(19),{type:t,onInsert:r}=u,l=`${t.title} ${t.resolveType} ${t.description??""}`;let o;e[0]!==r||e[1]!==t.resolveType?(o=()=>r(t.resolveType),e[0]=r,e[1]=t.resolveType,e[2]=o):o=e[2];let n;e[3]!==t.iconName||e[4]!==t.iconUrl||e[5]!==t.title?(n=s.jsx(bl,{iconName:t.iconName,iconUrl:t.iconUrl,alt:t.title}),e[3]=t.iconName,e[4]=t.iconUrl,e[5]=t.title,e[6]=n):n=e[6];let i;e[7]!==t.title?(i=s.jsx("span",{className:"text-sm font-medium",children:t.title}),e[7]=t.title,e[8]=i):i=e[8];let d;e[9]!==t.description?(d=t.description&&s.jsx("span",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[9]=t.description,e[10]=d):d=e[10];let c;e[11]!==i||e[12]!==d?(c=s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[i,d]}),e[11]=i,e[12]=d,e[13]=c):c=e[13];let f;return e[14]!==l||e[15]!==o||e[16]!==n||e[17]!==c?(f=s.jsxs(Ot,{value:l,onSelect:o,className:"flex items-center gap-2.5",children:[n,c]}),e[14]=l,e[15]=o,e[16]=n,e[17]=c,e[18]=f):f=e[18],f}function ft(u){const e=$.c(41),{blockTypes:t,onInsert:r,children:l,align:o}=u,n=o===void 0?"start":o,i=D(),[d,c]=G.useState(!1),[f,b]=G.useState(null);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=_=>{_&&typeof document<"u"&&b(document.querySelector('[data-slot="dialog-content"][data-state="open"]')),c(_)},e[0]=g):g=e[0];const x=g;let y,a;if(e[1]!==t){y=[],a=[];for(const _ of t)(_.source==="site"?a:y).push(_);e[1]=t,e[2]=y,e[3]=a}else y=e[2],a=e[3];let m;e[4]!==r?(m=_=>{r(_),c(!1)},e[4]=r,e[5]=m):m=e[5];const p=m,h=y.length>0&&a.length>0;let v;e[6]!==l?(v=s.jsx(Ut,{asChild:!0,children:l}),e[6]=l,e[7]=v):v=e[7];const N=f??void 0;let k;e[8]!==i?(k=i("sandbox.blockPicker.searchPlaceholder"),e[8]=i,e[9]=k):k=e[9];let j;e[10]!==k?(j=s.jsx(zt,{placeholder:k}),e[10]=k,e[11]=j):j=e[11];let C;e[12]!==i?(C=i("sandbox.blockPicker.noBlocksFound"),e[12]=i,e[13]=C):C=e[13];let S;e[14]!==C?(S=s.jsx(Ft,{children:C}),e[14]=C,e[15]=S):S=e[15];let B;e[16]!==p||e[17]!==h||e[18]!==a||e[19]!==i?(B=a.length>0&&s.jsx(Te,{heading:h?i(Le.site):void 0,children:a.map(_=>s.jsx(Ie,{type:_,onInsert:p},_.resolveType))}),e[16]=p,e[17]=h,e[18]=a,e[19]=i,e[20]=B):B=e[20];let w;e[21]!==y||e[22]!==p||e[23]!==h||e[24]!==i?(w=y.length>0&&s.jsx(Te,{heading:h?i(Le.app):void 0,children:y.map(_=>s.jsx(Ie,{type:_,onInsert:p},_.resolveType))}),e[21]=y,e[22]=p,e[23]=h,e[24]=i,e[25]=w):w=e[25];let T;e[26]!==B||e[27]!==w||e[28]!==S?(T=s.jsxs(Mt,{className:"min-h-0 flex-1",children:[S,B,w]}),e[26]=B,e[27]=w,e[28]=S,e[29]=T):T=e[29];let L;e[30]!==T||e[31]!==j?(L=s.jsxs(qt,{className:"min-h-0 flex-1",children:[j,T]}),e[30]=T,e[31]=j,e[32]=L):L=e[32];let P;e[33]!==n||e[34]!==L||e[35]!==N?(P=s.jsx(Ht,{container:N,className:"flex max-h-(--radix-popover-content-available-height) w-80 flex-col p-0",align:n,children:L}),e[33]=n,e[34]=L,e[35]=N,e[36]=P):P=e[36];let I;return e[37]!==d||e[38]!==P||e[39]!==v?(I=s.jsxs(Gt,{open:d,onOpenChange:x,children:[v,P]}),e[37]=d,e[38]=P,e[39]=v,e[40]=I):I=e[40],I}const mt="vtex/loaders/intelligentSearch/productList.ts",yl="vtex/loaders/categories/tree.ts",vl=24;function ue(u){return u&&typeof u=="object"&&!Array.isArray(u)?u:null}function jl(u){return u.split("/").filter(Boolean).map((t,r)=>`category-${r+1}/${t}`).join("/")}function pt(u,e){const t=e.trim(),r=mt,l=vl;if(u==="cluster")return t?[{resolveType:r,props:{collection:t,count:l}}]:[];if(u==="category"){if(!t)return[];const d=jl(t);return d?[{resolveType:r,props:{facets:d,count:l}}]:[]}if(!t)return[{resolveType:r,props:{count:l}}];const o=[];/^\d+$/.test(t)&&o.push({resolveType:r,props:{ids:[t]}});const i=t.includes("-")&&!/\s/.test(t)?t.replace(/-+/g," "):t;return o.push({resolveType:r,props:{query:i,count:l}}),o}function kl(){return{resolveType:yl,props:{}}}function Nl(u){return{resolveType:mt,props:{ids:u}}}function $e(u){return typeof u=="string"||typeof u=="number"?String(u):""}function _e(u){const e=ue(u),t=Array.isArray(u)?u:Array.isArray(e?.products)?e.products:[],r=[],l=new Set;for(const o of t){const n=ue(o);if(!n)continue;const i=$e(n.productID)||$e(n.sku);if(!i||l.has(i))continue;l.add(i);const d=ue(n.isVariantOf),c=typeof d?.name=="string"&&d.name||typeof n.name=="string"&&n.name||i,f=Array.isArray(n.image)?ue(n.image[0]):null,b=typeof f?.url=="string"?f.url:void 0,g=typeof n.url=="string"&&n.url||typeof d?.url=="string"&&d.url||void 0;r.push({id:i,label:c,image:b,url:g})}return r}function Cl(u){if(typeof u!="string"||!u)return null;let e;try{e=new URL(u,"https://placeholder.invalid").pathname}catch{return null}return e.replace(/^\/+|\/+$/g,"")||null}function Bl(u){const e=[],t=new Set,r=(l,o)=>{const n=ue(l);if(!n)return;const i=typeof n.name=="string"&&n.name?n.name:"",d=i?[...o,i]:o,c=Cl(n.url);if(c&&!t.has(c)&&(t.add(c),e.push({path:c,label:d.join(" › ")||c})),Array.isArray(n.children))for(const f of n.children)r(f,d)};if(Array.isArray(u))for(const l of u)r(l,[]);return e}function Sl(u,e,t=50){const r=e.trim().toLowerCase();return(r?u.filter(o=>o.label.toLowerCase().includes(r)||o.path.toLowerCase().includes(r)):u).slice(0,t)}const Pl=1e4;async function ye(u,{resolveType:e,props:t}){const r=await fetch(Kt(u),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...t}),signal:AbortSignal.timeout(Pl)});if(!r.ok)throw new Error(`Failed to fetch (${r.status})`);return r.json()}function xt(u,e){const t=$.c(20);let r;t[0]!==e?(r=new Set(e.filter(Boolean)),t[0]=e,t[1]=r):r=t[1];let l;t[2]!==r?(l=[...r],t[2]=r,t[3]=l):l=t[3];const o=l;let n;t[4]!==o||t[5]!==u?(n=xe.sandboxInvoke(u?`${u.orgSlug}/${u.virtualMcpId}/${u.branch}`:"none",`blog-products-by-ids:${o.join(",")}`),t[4]=o,t[5]=u,t[6]=n):n=t[6];let i;t[7]!==o||t[8]!==u?(i=()=>ye(u,Nl(o)).then(_e),t[7]=o,t[8]=u,t[9]=i):i=t[9];const d=!!u&&o.length>0;let c;t[10]!==n||t[11]!==i||t[12]!==d?(c={queryKey:n,queryFn:i,enabled:d,staleTime:6e4,retry:1},t[10]=n,t[11]=i,t[12]=d,t[13]=c):c=t[13];const f=ge(c);let b;if(t[14]!==f.data){b=new Map;for(const x of f.data??[])b.set(x.id,x);t[14]=f.data,t[15]=b}else b=t[15];let g;return t[16]!==b||t[17]!==f.isError||t[18]!==f.isLoading?(g={byId:b,isLoading:f.isLoading,isError:f.isError},t[16]=b,t[17]=f.isError,t[18]=f.isLoading,t[19]=g):g=t[19],g}function gt(u){const e=$.c(12),{value:t,onChange:r,placeholder:l,children:o}=u;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(he,{size:13,className:"shrink-0 text-muted-foreground"}),e[0]=n):n=e[0];let i;e[1]!==r?(i=b=>r(b.target.value),e[1]=r,e[2]=i):i=e[2];let d;e[3]!==l||e[4]!==i||e[5]!==t?(d=s.jsxs("div",{className:"flex items-center gap-1.5 rounded border px-2",children:[n,s.jsx("input",{autoFocus:!0,type:"text",value:t,placeholder:l,onChange:i,className:"h-7 flex-1 bg-transparent text-sm text-foreground placeholder:text-muted-foreground focus:outline-none"})]}),e[3]=l,e[4]=i,e[5]=t,e[6]=d):d=e[6];let c;e[7]!==o?(c=s.jsx("div",{className:"max-h-56 overflow-y-auto",children:o}),e[7]=o,e[8]=c):c=e[8];let f;return e[9]!==d||e[10]!==c?(f=s.jsxs("div",{className:"flex flex-col gap-1",children:[d,c]}),e[9]=d,e[10]=c,e[11]=f):f=e[11],f}function ht(u){const e=$.c(13),{label:t,sublabel:r,image:l,onPick:o}=u;let n;e[0]!==l?(n=l!==void 0&&s.jsx("img",{src:l,alt:"",className:"h-7 w-7 shrink-0 rounded object-cover"}),e[0]=l,e[1]=n):n=e[1];let i;e[2]!==t?(i=s.jsx("span",{className:"block truncate text-sm",children:t}),e[2]=t,e[3]=i):i=e[3];let d;e[4]!==r?(d=r&&s.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:r}),e[4]=r,e[5]=d):d=e[5];let c;e[6]!==i||e[7]!==d?(c=s.jsxs("span",{className:"min-w-0 flex-1",children:[i,d]}),e[6]=i,e[7]=d,e[8]=c):c=e[8];let f;return e[9]!==o||e[10]!==n||e[11]!==c?(f=s.jsxs("button",{type:"button",onMouseDown:wl,onClick:o,className:"flex w-full items-center gap-2 rounded px-1.5 py-1.5 text-left transition-colors hover:bg-muted",children:[n,c]}),e[9]=o,e[10]=n,e[11]=c,e[12]=f):f=e[12],f}function wl(u){return u.preventDefault()}function _l(u){const e=$.c(7),{decofile:t,onPick:r}=u,l=D(),[o,n]=G.useState("");let i;if(e[0]!==t||e[1]!==r||e[2]!==l||e[3]!==o){const d=dt(t),c=o.trim().toLowerCase(),f=wt(t).filter(x=>!c||x.title.toLowerCase().includes(c)||x.slug.toLowerCase().includes(c)).slice(0,30),b=x=>d?ut(d,{category:x.categorySlugs[0]??"",slug:x.slug}):null;let g;e[5]!==l?(g=l("sandbox.linkPicker.searchPosts"),e[5]=l,e[6]=g):g=e[6],i=s.jsx(gt,{value:o,onChange:n,placeholder:g,children:f.length===0?s.jsx("p",{className:"px-1.5 py-3 text-center text-xs text-muted-foreground",children:l("sandbox.linkPicker.noPosts")}):f.map(x=>{const y=b(x);return y?s.jsx(ht,{label:x.title||x.slug,sublabel:y,onPick:()=>r(y)},x.key):null})}),e[0]=t,e[1]=r,e[2]=l,e[3]=o,e[4]=i}else i=e[4];return i}function Tl(u){const e=$.c(25),{sandboxRef:t,onPick:r}=u,l=D(),[o,n]=G.useState(""),[i,d]=G.useState(""),c=G.useRef(null);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=k=>{n(k),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>d(k.trim()),300)},e[0]=f):f=e[0];const b=f;let g;e[1]!==i||e[2]!==t.branch||e[3]!==t.orgSlug||e[4]!==t.virtualMcpId?(g=xe.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`product-link:${i}`),e[1]=i,e[2]=t.branch,e[3]=t.orgSlug,e[4]=t.virtualMcpId,e[5]=g):g=e[5];let x;e[6]!==i||e[7]!==t?(x=async()=>{const[k]=pt("search",i);if(!k)return[];const j=await ye(t,k);return _e(j).filter(Ll)},e[6]=i,e[7]=t,e[8]=x):x=e[8];let y;e[9]!==g||e[10]!==x?(y={queryKey:g,queryFn:x},e[9]=g,e[10]=x,e[11]=y):y=e[11];const a=ge(y);let m;e[12]!==a.data?(m=a.data??[],e[12]=a.data,e[13]=m):m=e[13];const p=m;let h;e[14]!==l?(h=l("sandbox.linkPicker.searchProducts"),e[14]=l,e[15]=h):h=e[15];let v;e[16]!==r||e[17]!==p||e[18]!==a.isFetching||e[19]!==l?(v=a.isFetching?s.jsxs("p",{className:"flex items-center justify-center gap-1.5 px-1.5 py-3 text-xs text-muted-foreground",children:[s.jsx(At,{size:12,className:"animate-spin"}),l("sandbox.linkPicker.searching")]}):p.length===0?s.jsx("p",{className:"px-1.5 py-3 text-center text-xs text-muted-foreground",children:l("sandbox.linkPicker.noProducts")}):p.map(k=>s.jsx(ht,{label:k.label,image:k.image??"",onPick:()=>k.url&&r(k.url)},k.id)),e[16]=r,e[17]=p,e[18]=a.isFetching,e[19]=l,e[20]=v):v=e[20];let N;return e[21]!==h||e[22]!==v||e[23]!==o?(N=s.jsx(gt,{value:o,onChange:b,placeholder:h,children:v}),e[21]=h,e[22]=v,e[23]=o,e[24]=N):N=e[24],N}function Ll(u){return u.url}function Il({html:u,placeholder:e,onChange:t,decofile:r,sandboxRef:l}){const o=D(),n=G.useRef(t);n.current=t;const[i,d]=G.useState(!1),c=lt({extensions:[st.configure({link:{HTMLAttributes:{}},heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,bulletList:!1,orderedList:!1,listItem:!1,dropcursor:!1,gapcursor:!1}),nt.configure({placeholder:e??"Write something…"})],content:u||"",editorProps:{attributes:{class:te("prose prose-sm dark:prose-invert max-w-none focus:outline-none","leading-relaxed [&_p]:my-0","[&_a]:cursor-pointer [&_a]:text-primary [&_a]:underline [&_a]:underline-offset-2")}},onUpdate:({editor:g})=>{const x=g.getHTML();n.current(x==="<p></p>"?"":x)}}),f=we({editor:c,selector:({editor:g})=>({isFocused:g?.isFocused??!1,bold:g?.isActive("bold")??!1,italic:g?.isActive("italic")??!1,underline:g?.isActive("underline")??!1,link:g?.isActive("link")??!1})});if(!c)return null;const b=[];return r&&b.push({id:"post",label:o("sandbox.linkPicker.tabPost"),icon:s.jsx(Xt,{size:12}),render:g=>s.jsx(_l,{decofile:r,onPick:g})}),l&&b.push({id:"product",label:o("sandbox.linkPicker.tabProduct"),icon:s.jsx(Et,{size:12}),render:g=>s.jsx(Tl,{sandboxRef:l,onPick:g})}),s.jsxs("div",{className:"relative",children:[(f.isFocused||i)&&s.jsxs("div",{className:"absolute -top-9 left-0 z-10 flex items-center gap-0.5 rounded-md border bg-popover p-0.5 shadow-md",children:[s.jsx(ve,{active:f.bold,label:"Bold",onClick:()=>c.chain().focus().toggleBold().run(),children:s.jsx(Xe,{size:14})}),s.jsx(ve,{active:f.italic,label:"Italic",onClick:()=>c.chain().focus().toggleItalic().run(),children:s.jsx(Ze,{size:14})}),s.jsx(ve,{active:f.underline,label:"Underline",onClick:()=>c.chain().focus().toggleUnderline().run(),children:s.jsx(et,{size:14})}),s.jsx(Me,{editor:c,active:f.link,open:i,onOpenChange:d,sources:b})]}),s.jsx(ot,{editor:c,className:"text-[15px] text-foreground"})]})}function $l(u,e){const t=u.length?u.split(`
|
|
1
|
+
import{c as $,b as D,r as G,j as s,K as xe,m as ge,l as te,h as Fe,B as Bt}from"./index-B_jqJjWZ.js";import{T as ve,R as Me,a as qe,b as me,K as Ue,P as He,s as Ge,e as Ve,S as Ke,r as St,D as Ye,c as Je,u as We,C as Qe,v as Pt}from"./rich-text-link-control-DSqyN-4h.js";import{s as Se}from"./Plus-GxHWJNZK.js";import{l as wt,F as Pe,T as ne,I as se,s as R,i as de,R as ae,A as ce,b as _t,j as Tt,k as ie,o as Lt}from"./agent-site-editor-content-BlZJF4Kt.js";import{I as It,af as $t,Z as At,z as he,S as Et,a7 as Xe,a8 as Ze,a9 as et,aa as Rt,r as Dt,ae as tt}from"./agent-icon-CP9iXRWW.js";import{a as Te,b as Ot,e as zt,C as Ft,c as Mt,d as qt}from"./command-CfliK-Cc.js";import{a as Ut,b as Ht,P as Gt}from"./popover-D7TbzVGm.js";import{a as Vt}from"./Copy01-DmLSY0Qf.js";import{s as Ce}from"./Trash01-BgJo-uHb.js";import{b2 as Kt,b1 as Yt,y as Jt}from"./runnable-block-editor-CgZ8SmOe.js";import{Y as Wt,r as Qt}from"./claim-phase-copy-pJF6tq00.js";import{i as Xt,a as Zt}from"./ZoomOut-CvfOKBlv.js";import{u as lt,s as st,a as we,b as ot}from"./index-CFR2L-q4.js";import{s as nt}from"./suggestion-U-2vYvOO.js";import{w as rt}from"./section-preview-url-Csj0_ZDg.js";import{B as el}from"./index-Cc2tAO7N.js";import{i as it}from"./Check-Blxq8j59.js";import{a as tl}from"./Image01-C1vTsGg9.js";import{s as ll}from"./XClose-DKTON5RG.js";import{L as fe}from"./label-B42WVwom.js";import{c as sl,d as ol,b as nl,D as rl}from"./dialog-D_eZEQVv.js";import{I as Be}from"./input-CUqzZQqX.js";const be=u=>typeof u=="string"?u:"",il=/\/blog\.tsx?$/;function at(u,e){for(const[t,r]of Object.entries(u)){if(t.includes("/")||!r||typeof r!="object"||Array.isArray(r))continue;const l=r;if(typeof l.__resolveType!="string"||!il.test(l.__resolveType))continue;const o=be(l[e]);if(o)return o}return null}const al=new Set(["website/pages/Page.tsx","$live/pages/LivePage.tsx"]);function cl(u){if(!u||typeof u!="object"||Array.isArray(u))return null;const e=u;return typeof e.__resolveType!="string"||!al.has(e.__resolveType)?null:typeof e.path=="string"?e.path:null}function dl(u){return Wt(u).filter(e=>e!=="*").length}function ct(u,e){let t=null,r=Number.POSITIVE_INFINITY;for(const l of Object.values(u)){const o=cl(l);if(!o||!e.test(JSON.stringify(l)))continue;const n=dl(o);n<r&&(t=o,r=n)}return t}const ul=/blogpostpage/i,fl=/blogcategorypage/i;function dt(u){return at(u,"pageSlug")??ct(u,ul)}function ml(u){return at(u,"categorySlug")??ct(u,fl)}function pl(u){const e=u.categories;if(!Array.isArray(e)||e.length===0)return"";const t=e[0];return be(t?.slug)}function ut(u,e){let t=u;if(/:category\??/.test(t)){if(!e.category)return null;t=t.replace(/:category\??/g,encodeURIComponent(e.category))}if(/:slug\??/.test(t)){if(!e.slug)return null;t=t.replace(/:slug\??/g,encodeURIComponent(e.slug))}return t}const xl=/:(?:categorySlug|categoria|category|slug)\??/,gl=/:(?:categorySlug|categoria|category|slug)\??/g;function hl(u,e){return xl.test(u)?e?u.replace(gl,encodeURIComponent(e)):null:u}function no({decofile:u,category:e,previewBaseUrl:t,draftPointer:r}){if(!t)return null;const l=ml(u);if(!l)return null;const o=hl(l,be(e.slug));if(!o)return null;try{return rt(new URL(o,t).href,r)}catch{return null}}function ro({decofile:u,post:e,previewBaseUrl:t,draftPointer:r}){if(!t)return null;const l=dt(u);if(!l)return null;const o=ut(l,{category:pl(e),slug:be(e.slug)});if(!o)return null;try{return rt(new URL(o,t).href,r)}catch{return null}}const Le={app:"sandbox.blockPicker.blocksLabel",site:"sandbox.blockPicker.customBlocksLabel"};function bl(u){const e=$.c(6),{iconName:t,iconUrl:r,alt:l}=u;let o;e[0]!==t?(o=$t(t)??It,e[0]=t,e[1]=o):o=e[1];const n=o;let i;return e[2]!==n||e[3]!==l||e[4]!==r?(i=s.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-md border bg-muted",children:r?s.jsx("img",{src:r,alt:l,className:"size-5 object-contain"}):s.jsx(n,{size:16,className:"text-muted-foreground"})}),e[2]=n,e[3]=l,e[4]=r,e[5]=i):i=e[5],i}function Ie(u){const e=$.c(19),{type:t,onInsert:r}=u,l=`${t.title} ${t.resolveType} ${t.description??""}`;let o;e[0]!==r||e[1]!==t.resolveType?(o=()=>r(t.resolveType),e[0]=r,e[1]=t.resolveType,e[2]=o):o=e[2];let n;e[3]!==t.iconName||e[4]!==t.iconUrl||e[5]!==t.title?(n=s.jsx(bl,{iconName:t.iconName,iconUrl:t.iconUrl,alt:t.title}),e[3]=t.iconName,e[4]=t.iconUrl,e[5]=t.title,e[6]=n):n=e[6];let i;e[7]!==t.title?(i=s.jsx("span",{className:"text-sm font-medium",children:t.title}),e[7]=t.title,e[8]=i):i=e[8];let d;e[9]!==t.description?(d=t.description&&s.jsx("span",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[9]=t.description,e[10]=d):d=e[10];let c;e[11]!==i||e[12]!==d?(c=s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[i,d]}),e[11]=i,e[12]=d,e[13]=c):c=e[13];let f;return e[14]!==l||e[15]!==o||e[16]!==n||e[17]!==c?(f=s.jsxs(Ot,{value:l,onSelect:o,className:"flex items-center gap-2.5",children:[n,c]}),e[14]=l,e[15]=o,e[16]=n,e[17]=c,e[18]=f):f=e[18],f}function ft(u){const e=$.c(41),{blockTypes:t,onInsert:r,children:l,align:o}=u,n=o===void 0?"start":o,i=D(),[d,c]=G.useState(!1),[f,b]=G.useState(null);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=_=>{_&&typeof document<"u"&&b(document.querySelector('[data-slot="dialog-content"][data-state="open"]')),c(_)},e[0]=g):g=e[0];const x=g;let y,a;if(e[1]!==t){y=[],a=[];for(const _ of t)(_.source==="site"?a:y).push(_);e[1]=t,e[2]=y,e[3]=a}else y=e[2],a=e[3];let m;e[4]!==r?(m=_=>{r(_),c(!1)},e[4]=r,e[5]=m):m=e[5];const p=m,h=y.length>0&&a.length>0;let v;e[6]!==l?(v=s.jsx(Ut,{asChild:!0,children:l}),e[6]=l,e[7]=v):v=e[7];const N=f??void 0;let k;e[8]!==i?(k=i("sandbox.blockPicker.searchPlaceholder"),e[8]=i,e[9]=k):k=e[9];let j;e[10]!==k?(j=s.jsx(zt,{placeholder:k}),e[10]=k,e[11]=j):j=e[11];let C;e[12]!==i?(C=i("sandbox.blockPicker.noBlocksFound"),e[12]=i,e[13]=C):C=e[13];let S;e[14]!==C?(S=s.jsx(Ft,{children:C}),e[14]=C,e[15]=S):S=e[15];let B;e[16]!==p||e[17]!==h||e[18]!==a||e[19]!==i?(B=a.length>0&&s.jsx(Te,{heading:h?i(Le.site):void 0,children:a.map(_=>s.jsx(Ie,{type:_,onInsert:p},_.resolveType))}),e[16]=p,e[17]=h,e[18]=a,e[19]=i,e[20]=B):B=e[20];let w;e[21]!==y||e[22]!==p||e[23]!==h||e[24]!==i?(w=y.length>0&&s.jsx(Te,{heading:h?i(Le.app):void 0,children:y.map(_=>s.jsx(Ie,{type:_,onInsert:p},_.resolveType))}),e[21]=y,e[22]=p,e[23]=h,e[24]=i,e[25]=w):w=e[25];let T;e[26]!==B||e[27]!==w||e[28]!==S?(T=s.jsxs(Mt,{className:"min-h-0 flex-1",children:[S,B,w]}),e[26]=B,e[27]=w,e[28]=S,e[29]=T):T=e[29];let L;e[30]!==T||e[31]!==j?(L=s.jsxs(qt,{className:"min-h-0 flex-1",children:[j,T]}),e[30]=T,e[31]=j,e[32]=L):L=e[32];let P;e[33]!==n||e[34]!==L||e[35]!==N?(P=s.jsx(Ht,{container:N,className:"flex max-h-(--radix-popover-content-available-height) w-80 flex-col p-0",align:n,children:L}),e[33]=n,e[34]=L,e[35]=N,e[36]=P):P=e[36];let I;return e[37]!==d||e[38]!==P||e[39]!==v?(I=s.jsxs(Gt,{open:d,onOpenChange:x,children:[v,P]}),e[37]=d,e[38]=P,e[39]=v,e[40]=I):I=e[40],I}const mt="vtex/loaders/intelligentSearch/productList.ts",yl="vtex/loaders/categories/tree.ts",vl=24;function ue(u){return u&&typeof u=="object"&&!Array.isArray(u)?u:null}function jl(u){return u.split("/").filter(Boolean).map((t,r)=>`category-${r+1}/${t}`).join("/")}function pt(u,e){const t=e.trim(),r=mt,l=vl;if(u==="cluster")return t?[{resolveType:r,props:{collection:t,count:l}}]:[];if(u==="category"){if(!t)return[];const d=jl(t);return d?[{resolveType:r,props:{facets:d,count:l}}]:[]}if(!t)return[{resolveType:r,props:{count:l}}];const o=[];/^\d+$/.test(t)&&o.push({resolveType:r,props:{ids:[t]}});const i=t.includes("-")&&!/\s/.test(t)?t.replace(/-+/g," "):t;return o.push({resolveType:r,props:{query:i,count:l}}),o}function kl(){return{resolveType:yl,props:{}}}function Nl(u){return{resolveType:mt,props:{ids:u}}}function $e(u){return typeof u=="string"||typeof u=="number"?String(u):""}function _e(u){const e=ue(u),t=Array.isArray(u)?u:Array.isArray(e?.products)?e.products:[],r=[],l=new Set;for(const o of t){const n=ue(o);if(!n)continue;const i=$e(n.productID)||$e(n.sku);if(!i||l.has(i))continue;l.add(i);const d=ue(n.isVariantOf),c=typeof d?.name=="string"&&d.name||typeof n.name=="string"&&n.name||i,f=Array.isArray(n.image)?ue(n.image[0]):null,b=typeof f?.url=="string"?f.url:void 0,g=typeof n.url=="string"&&n.url||typeof d?.url=="string"&&d.url||void 0;r.push({id:i,label:c,image:b,url:g})}return r}function Cl(u){if(typeof u!="string"||!u)return null;let e;try{e=new URL(u,"https://placeholder.invalid").pathname}catch{return null}return e.replace(/^\/+|\/+$/g,"")||null}function Bl(u){const e=[],t=new Set,r=(l,o)=>{const n=ue(l);if(!n)return;const i=typeof n.name=="string"&&n.name?n.name:"",d=i?[...o,i]:o,c=Cl(n.url);if(c&&!t.has(c)&&(t.add(c),e.push({path:c,label:d.join(" › ")||c})),Array.isArray(n.children))for(const f of n.children)r(f,d)};if(Array.isArray(u))for(const l of u)r(l,[]);return e}function Sl(u,e,t=50){const r=e.trim().toLowerCase();return(r?u.filter(o=>o.label.toLowerCase().includes(r)||o.path.toLowerCase().includes(r)):u).slice(0,t)}const Pl=1e4;async function ye(u,{resolveType:e,props:t}){const r=await fetch(Kt(u),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...t}),signal:AbortSignal.timeout(Pl)});if(!r.ok)throw new Error(`Failed to fetch (${r.status})`);return r.json()}function xt(u,e){const t=$.c(20);let r;t[0]!==e?(r=new Set(e.filter(Boolean)),t[0]=e,t[1]=r):r=t[1];let l;t[2]!==r?(l=[...r],t[2]=r,t[3]=l):l=t[3];const o=l;let n;t[4]!==o||t[5]!==u?(n=xe.sandboxInvoke(u?`${u.orgSlug}/${u.virtualMcpId}/${u.branch}`:"none",`blog-products-by-ids:${o.join(",")}`),t[4]=o,t[5]=u,t[6]=n):n=t[6];let i;t[7]!==o||t[8]!==u?(i=()=>ye(u,Nl(o)).then(_e),t[7]=o,t[8]=u,t[9]=i):i=t[9];const d=!!u&&o.length>0;let c;t[10]!==n||t[11]!==i||t[12]!==d?(c={queryKey:n,queryFn:i,enabled:d,staleTime:6e4,retry:1},t[10]=n,t[11]=i,t[12]=d,t[13]=c):c=t[13];const f=ge(c);let b;if(t[14]!==f.data){b=new Map;for(const x of f.data??[])b.set(x.id,x);t[14]=f.data,t[15]=b}else b=t[15];let g;return t[16]!==b||t[17]!==f.isError||t[18]!==f.isLoading?(g={byId:b,isLoading:f.isLoading,isError:f.isError},t[16]=b,t[17]=f.isError,t[18]=f.isLoading,t[19]=g):g=t[19],g}function gt(u){const e=$.c(12),{value:t,onChange:r,placeholder:l,children:o}=u;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(he,{size:13,className:"shrink-0 text-muted-foreground"}),e[0]=n):n=e[0];let i;e[1]!==r?(i=b=>r(b.target.value),e[1]=r,e[2]=i):i=e[2];let d;e[3]!==l||e[4]!==i||e[5]!==t?(d=s.jsxs("div",{className:"flex items-center gap-1.5 rounded border px-2",children:[n,s.jsx("input",{autoFocus:!0,type:"text",value:t,placeholder:l,onChange:i,className:"h-7 flex-1 bg-transparent text-sm text-foreground placeholder:text-muted-foreground focus:outline-none"})]}),e[3]=l,e[4]=i,e[5]=t,e[6]=d):d=e[6];let c;e[7]!==o?(c=s.jsx("div",{className:"max-h-56 overflow-y-auto",children:o}),e[7]=o,e[8]=c):c=e[8];let f;return e[9]!==d||e[10]!==c?(f=s.jsxs("div",{className:"flex flex-col gap-1",children:[d,c]}),e[9]=d,e[10]=c,e[11]=f):f=e[11],f}function ht(u){const e=$.c(13),{label:t,sublabel:r,image:l,onPick:o}=u;let n;e[0]!==l?(n=l!==void 0&&s.jsx("img",{src:l,alt:"",className:"h-7 w-7 shrink-0 rounded object-cover"}),e[0]=l,e[1]=n):n=e[1];let i;e[2]!==t?(i=s.jsx("span",{className:"block truncate text-sm",children:t}),e[2]=t,e[3]=i):i=e[3];let d;e[4]!==r?(d=r&&s.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:r}),e[4]=r,e[5]=d):d=e[5];let c;e[6]!==i||e[7]!==d?(c=s.jsxs("span",{className:"min-w-0 flex-1",children:[i,d]}),e[6]=i,e[7]=d,e[8]=c):c=e[8];let f;return e[9]!==o||e[10]!==n||e[11]!==c?(f=s.jsxs("button",{type:"button",onMouseDown:wl,onClick:o,className:"flex w-full items-center gap-2 rounded px-1.5 py-1.5 text-left transition-colors hover:bg-muted",children:[n,c]}),e[9]=o,e[10]=n,e[11]=c,e[12]=f):f=e[12],f}function wl(u){return u.preventDefault()}function _l(u){const e=$.c(7),{decofile:t,onPick:r}=u,l=D(),[o,n]=G.useState("");let i;if(e[0]!==t||e[1]!==r||e[2]!==l||e[3]!==o){const d=dt(t),c=o.trim().toLowerCase(),f=wt(t).filter(x=>!c||x.title.toLowerCase().includes(c)||x.slug.toLowerCase().includes(c)).slice(0,30),b=x=>d?ut(d,{category:x.categorySlugs[0]??"",slug:x.slug}):null;let g;e[5]!==l?(g=l("sandbox.linkPicker.searchPosts"),e[5]=l,e[6]=g):g=e[6],i=s.jsx(gt,{value:o,onChange:n,placeholder:g,children:f.length===0?s.jsx("p",{className:"px-1.5 py-3 text-center text-xs text-muted-foreground",children:l("sandbox.linkPicker.noPosts")}):f.map(x=>{const y=b(x);return y?s.jsx(ht,{label:x.title||x.slug,sublabel:y,onPick:()=>r(y)},x.key):null})}),e[0]=t,e[1]=r,e[2]=l,e[3]=o,e[4]=i}else i=e[4];return i}function Tl(u){const e=$.c(25),{sandboxRef:t,onPick:r}=u,l=D(),[o,n]=G.useState(""),[i,d]=G.useState(""),c=G.useRef(null);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=k=>{n(k),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>d(k.trim()),300)},e[0]=f):f=e[0];const b=f;let g;e[1]!==i||e[2]!==t.branch||e[3]!==t.orgSlug||e[4]!==t.virtualMcpId?(g=xe.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`product-link:${i}`),e[1]=i,e[2]=t.branch,e[3]=t.orgSlug,e[4]=t.virtualMcpId,e[5]=g):g=e[5];let x;e[6]!==i||e[7]!==t?(x=async()=>{const[k]=pt("search",i);if(!k)return[];const j=await ye(t,k);return _e(j).filter(Ll)},e[6]=i,e[7]=t,e[8]=x):x=e[8];let y;e[9]!==g||e[10]!==x?(y={queryKey:g,queryFn:x},e[9]=g,e[10]=x,e[11]=y):y=e[11];const a=ge(y);let m;e[12]!==a.data?(m=a.data??[],e[12]=a.data,e[13]=m):m=e[13];const p=m;let h;e[14]!==l?(h=l("sandbox.linkPicker.searchProducts"),e[14]=l,e[15]=h):h=e[15];let v;e[16]!==r||e[17]!==p||e[18]!==a.isFetching||e[19]!==l?(v=a.isFetching?s.jsxs("p",{className:"flex items-center justify-center gap-1.5 px-1.5 py-3 text-xs text-muted-foreground",children:[s.jsx(At,{size:12,className:"animate-spin"}),l("sandbox.linkPicker.searching")]}):p.length===0?s.jsx("p",{className:"px-1.5 py-3 text-center text-xs text-muted-foreground",children:l("sandbox.linkPicker.noProducts")}):p.map(k=>s.jsx(ht,{label:k.label,image:k.image??"",onPick:()=>k.url&&r(k.url)},k.id)),e[16]=r,e[17]=p,e[18]=a.isFetching,e[19]=l,e[20]=v):v=e[20];let N;return e[21]!==h||e[22]!==v||e[23]!==o?(N=s.jsx(gt,{value:o,onChange:b,placeholder:h,children:v}),e[21]=h,e[22]=v,e[23]=o,e[24]=N):N=e[24],N}function Ll(u){return u.url}function Il({html:u,placeholder:e,onChange:t,decofile:r,sandboxRef:l}){const o=D(),n=G.useRef(t);n.current=t;const[i,d]=G.useState(!1),c=lt({extensions:[st.configure({link:{HTMLAttributes:{}},heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,bulletList:!1,orderedList:!1,listItem:!1,dropcursor:!1,gapcursor:!1}),nt.configure({placeholder:e??"Write something…"})],content:u||"",editorProps:{attributes:{class:te("prose prose-sm dark:prose-invert max-w-none focus:outline-none","leading-relaxed [&_p]:my-0","[&_a]:cursor-pointer [&_a]:text-primary [&_a]:underline [&_a]:underline-offset-2")}},onUpdate:({editor:g})=>{const x=g.getHTML();n.current(x==="<p></p>"?"":x)}}),f=we({editor:c,selector:({editor:g})=>({isFocused:g?.isFocused??!1,bold:g?.isActive("bold")??!1,italic:g?.isActive("italic")??!1,underline:g?.isActive("underline")??!1,link:g?.isActive("link")??!1})});if(!c)return null;const b=[];return r&&b.push({id:"post",label:o("sandbox.linkPicker.tabPost"),icon:s.jsx(Xt,{size:12}),render:g=>s.jsx(_l,{decofile:r,onPick:g})}),l&&b.push({id:"product",label:o("sandbox.linkPicker.tabProduct"),icon:s.jsx(Et,{size:12}),render:g=>s.jsx(Tl,{sandboxRef:l,onPick:g})}),s.jsxs("div",{className:"relative",children:[(f.isFocused||i)&&s.jsxs("div",{className:"absolute -top-9 left-0 z-10 flex items-center gap-0.5 rounded-md border bg-popover p-0.5 shadow-md",children:[s.jsx(ve,{active:f.bold,label:"Bold",onClick:()=>c.chain().focus().toggleBold().run(),children:s.jsx(Xe,{size:14})}),s.jsx(ve,{active:f.italic,label:"Italic",onClick:()=>c.chain().focus().toggleItalic().run(),children:s.jsx(Ze,{size:14})}),s.jsx(ve,{active:f.underline,label:"Underline",onClick:()=>c.chain().focus().toggleUnderline().run(),children:s.jsx(et,{size:14})}),s.jsx(Me,{editor:c,active:f.link,open:i,onOpenChange:d,sources:b})]}),s.jsx(ot,{editor:c,className:"text-[15px] text-foreground"})]})}function $l(u,e){const t=u.length?u.split(`
|
|
2
2
|
`):[""],r=e?"ol":"ul",l=t.map(o=>`<li><p>${o}</p></li>`).join("");return`<${r}>${l}</${r}>`}function Al(u){const e=new DOMParser().parseFromString(u,"text/html").body,t=Array.from(e.querySelectorAll(":scope > ul > li, :scope > ol > li")),r=t.length?t:Array.from(e.children);return r.length===0?[""]:r.map(l=>{const o=l.children.length===1?l.children[0]:null;return(o?.tagName==="P"?o.innerHTML:l.innerHTML).trim()})}const El=["1","2","3"],Rl={1:"sandbox.plainBlocks.headingLevel1",2:"sandbox.plainBlocks.headingLevel2",3:"sandbox.plainBlocks.headingLevel3"},Ae={1:"text-3xl font-bold",2:"text-2xl font-bold",3:"text-xl font-semibold",4:"text-lg font-semibold",5:"text-base font-semibold",6:"text-sm font-semibold"};function Dl(u){const e=$.c(23),{text:t,level:r,onChange:l}=u,[o,n]=G.useState(!1),i=D(),d=r||"2";let c;e[0]!==o||e[1]!==d||e[2]!==l||e[3]!==i||e[4]!==t?(c=o&&s.jsx(Pe,{children:El.map(h=>s.jsxs(ne,{active:d===h,label:i(Rl[h]),onClick:()=>l({text:t,level:h}),children:["H",h]},h))}),e[0]=o,e[1]=d,e[2]=l,e[3]=i,e[4]=t,e[5]=c):c=e[5];let f;e[6]!==d||e[7]!==l?(f=h=>l({text:h,level:d}),e[6]=d,e[7]=l,e[8]=f):f=e[8];let b,g;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=()=>n(!0),g=()=>n(!1),e[9]=b,e[10]=g):(b=e[9],g=e[10]);let x;e[11]!==i?(x=i("sandbox.plainBlocks.headingPlaceholder"),e[11]=i,e[12]=x):x=e[12];const y=Ae[d]??Ae[2];let a;e[13]!==y?(a=te("text-foreground",y),e[13]=y,e[14]=a):a=e[14];let m;e[15]!==f||e[16]!==x||e[17]!==a||e[18]!==t?(m=s.jsx(se,{value:t,onChange:f,onFocus:b,onBlur:g,placeholder:x,className:a}),e[15]=f,e[16]=x,e[17]=a,e[18]=t,e[19]=m):m=e[19];let p;return e[20]!==c||e[21]!==m?(p=s.jsxs("div",{className:"relative",children:[c,m]}),e[20]=c,e[21]=m,e[22]=p):p=e[22],p}function Ol(u){const e=$.c(6),{quote:t,onChange:r}=u,l=D();let o;e[0]!==l?(o=l("sandbox.plainBlocks.quotePlaceholder"),e[0]=l,e[1]=o):o=e[1];let n;return e[2]!==r||e[3]!==t||e[4]!==o?(n=s.jsx("div",{className:"border-l-2 border-foreground/30 pl-4",children:s.jsx(se,{value:t,onChange:r,placeholder:o,className:"text-lg italic text-foreground/90"})}),e[2]=r,e[3]=t,e[4]=o,e[5]=n):n=e[5],n}function zl(u){const e=$.c(21),{code:t,language:r,onChange:l}=u,o=D();let n;e[0]!==t||e[1]!==l?(n=x=>l({code:t,language:x.target.value}),e[0]=t,e[1]=l,e[2]=n):n=e[2];let i;e[3]!==o?(i=o("sandbox.plainBlocks.languagePlaceholder"),e[3]=o,e[4]=i):i=e[4];let d;e[5]!==r||e[6]!==n||e[7]!==i?(d=s.jsx("input",{value:r,onChange:n,placeholder:i,className:"w-full border-b bg-transparent px-3 py-1.5 font-mono text-xs text-muted-foreground outline-none placeholder:text-muted-foreground/50"}),e[5]=r,e[6]=n,e[7]=i,e[8]=d):d=e[8];let c;e[9]!==r||e[10]!==l?(c=x=>l({code:x,language:r}),e[9]=r,e[10]=l,e[11]=c):c=e[11];let f;e[12]!==o?(f=o("sandbox.plainBlocks.codePlaceholder"),e[12]=o,e[13]=f):f=e[13];let b;e[14]!==t||e[15]!==c||e[16]!==f?(b=s.jsx(se,{value:t,onChange:c,placeholder:f,spellCheck:!1,className:"px-3 py-2.5 font-mono text-sm text-foreground"}),e[14]=t,e[15]=c,e[16]=f,e[17]=b):b=e[17];let g;return e[18]!==d||e[19]!==b?(g=s.jsxs("div",{className:"overflow-hidden rounded-md border bg-muted/50",children:[d,b]}),e[18]=d,e[19]=b,e[20]=g):g=e[20],g}const Fl=({editor:u,state:e})=>u.isEditable&&(u.isFocused||!e.selection.empty),Ml={placement:"bottom-start",offset:8};function ql(u){const e=$.c(10),{editor:t}=u,r=D(),[l,o]=G.useState(!1),[n,i]=G.useState(null);let d;e[0]!==t?(d={editor:t,selector:Ul},e[0]=t,e[1]=d):d=e[1];const c=we(d);let f;e[2]!==t||e[3]!==n||e[4]!==l||e[5]!==c||e[6]!==r?(f=n&&s.jsxs(el,{editor:t,appendTo:n,shouldShow:Fl,options:Ml,className:"flex items-center gap-0.5 rounded-md border bg-popover p-0.5 shadow-md",children:[s.jsx(ne,{active:c.bold,label:r("sectionsEditor.richTextField.bold"),onClick:()=>t.chain().focus().toggleBold().run(),children:s.jsx(Xe,{size:14})}),s.jsx(ne,{active:c.italic,label:r("sectionsEditor.richTextField.italic"),onClick:()=>t.chain().focus().toggleItalic().run(),children:s.jsx(Ze,{size:14})}),s.jsx(ne,{active:c.underline,label:r("sectionsEditor.richTextField.underline"),onClick:()=>t.chain().focus().toggleUnderline().run(),children:s.jsx(et,{size:14})}),s.jsx(ne,{active:c.strike,label:r("sectionsEditor.richTextField.strikethrough"),onClick:()=>t.chain().focus().toggleStrike().run(),children:s.jsx(Rt,{size:14})}),s.jsx(Me,{editor:t,active:c.link,open:l,onOpenChange:o})]}),e[2]=t,e[3]=n,e[4]=l,e[5]=c,e[6]=r,e[7]=f):f=e[7];let b;return e[8]!==f?(b=s.jsx("div",{ref:i,className:"relative z-20",children:f}),e[8]=f,e[9]=b):b=e[9],b}function Ul(u){const{editor:e}=u;return{bold:e.isActive("bold"),italic:e.isActive("italic"),underline:e.isActive("underline"),strike:e.isActive("strike"),link:e.isActive("link")}}function Hl({items:u,style:e,onChange:t}){const r=D(),l=G.useRef(t);l.current=t;const o=G.useRef(e);o.current=e;const n=lt({extensions:[st.configure({link:{HTMLAttributes:{}},heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,dropcursor:!1,gapcursor:!1}),nt.configure({placeholder:r("sandbox.plainBlocks.listItemPlaceholder")})],content:$l(u,e==="ordered"),editorProps:{attributes:{class:te("focus:outline-none text-[15px] leading-relaxed","[&_ul]:list-disc [&_ol]:list-decimal [&_ul]:pl-7 [&_ol]:pl-7","[&_ul]:my-0 [&_ol]:my-0 [&_li]:pl-1.5 [&_li]:my-1 [&_p]:my-0","marker:text-muted-foreground marker:tabular-nums")},handleKeyDown:(d,c)=>c.key==="Tab"},onUpdate:({editor:d})=>{l.current({items:Al(d.getHTML()).join(`
|
|
3
3
|
`),style:d.isActive("orderedList")?"ordered":d.isActive("bulletList")?"unordered":o.current})}}),i=we({editor:n,selector:({editor:d})=>({isFocused:d?.isFocused??!1,bullet:d?.isActive("bulletList")??!1,ordered:d?.isActive("orderedList")??!1})});return n?s.jsxs("div",{className:"relative",children:[i.isFocused&&s.jsxs(Pe,{children:[s.jsx(ne,{active:i.bullet,label:r("sandbox.plainBlocks.bulletedLabel"),onClick:()=>!i.bullet&&n.chain().focus().toggleBulletList().run(),children:"•"}),s.jsx(ne,{active:i.ordered,label:r("sandbox.plainBlocks.numberedLabel"),onClick:()=>!i.ordered&&n.chain().focus().toggleOrderedList().run(),children:"1."})]}),s.jsx(ql,{editor:n}),s.jsx(ot,{editor:n,className:"text-foreground"})]}):null}function Gl(u){const e=$.c(51),{block:t,onChange:r}=u,l=D();let o;e[0]!==t.size?(o=R(t.size)||"normal",e[0]=t.size,e[1]=o):o=e[1];const n=o;let i;e[2]!==l?(i=l("sandbox.mediaBlocks.image"),e[2]=l,e[3]=i):i=e[3];let d;e[4]!==i?(d={type:"string",format:"image-uri",title:i},e[4]=i,e[5]=d):d=e[5];const c=t.url;let f;e[6]!==t||e[7]!==r?(f=B=>r({...t,url:B}),e[6]=t,e[7]=r,e[8]=f):f=e[8];let b;e[9]!==l?(b=l("sandbox.mediaBlocks.image"),e[9]=l,e[10]=b):b=e[10];let g;e[11]!==t.url||e[12]!==d||e[13]!==f||e[14]!==b?(g=s.jsx(Yt,{schema:d,value:c,onChange:f,path:"block-image-url",label:b}),e[11]=t.url,e[12]=d,e[13]=f,e[14]=b,e[15]=g):g=e[15];let x;e[16]!==t.caption?(x=R(t.caption),e[16]=t.caption,e[17]=x):x=e[17];let y;e[18]!==t||e[19]!==r?(y=B=>r({...t,caption:B}),e[18]=t,e[19]=r,e[20]=y):y=e[20];let a;e[21]!==l?(a=l("sandbox.mediaBlocks.addCaption"),e[21]=l,e[22]=a):a=e[22];let m;e[23]!==a||e[24]!==x||e[25]!==y?(m=s.jsx(se,{value:x,onChange:y,placeholder:a,className:"text-center text-sm italic text-muted-foreground"}),e[23]=a,e[24]=x,e[25]=y,e[26]=m):m=e[26];let p;e[27]===Symbol.for("react.memo_cache_sentinel")?(p=["normal","full"],e[27]=p):p=e[27];let h;e[28]!==t||e[29]!==r||e[30]!==n||e[31]!==l?(h=s.jsx("div",{className:"flex items-center gap-1",children:p.map(B=>s.jsx("button",{type:"button",onClick:()=>r({...t,size:B}),className:te("px-2 py-0.5 transition-colors cursor-pointer rounded-lg",n===B?"bg-accent text-accent-foreground":"hover:bg-muted"),children:l(B==="full"?"sandbox.mediaBlocks.fullWidth":"sandbox.mediaBlocks.normal")},B))}),e[28]=t,e[29]=r,e[30]=n,e[31]=l,e[32]=h):h=e[32];let v;e[33]!==t.alt?(v=R(t.alt),e[33]=t.alt,e[34]=v):v=e[34];let N;e[35]!==t||e[36]!==r?(N=B=>r({...t,alt:B.target.value}),e[35]=t,e[36]=r,e[37]=N):N=e[37];let k;e[38]!==l?(k=l("sandbox.mediaBlocks.altText"),e[38]=l,e[39]=k):k=e[39];let j;e[40]!==v||e[41]!==N||e[42]!==k?(j=s.jsx("input",{value:v,onChange:N,placeholder:k,className:"flex-1 border-0 bg-transparent p-0 text-xs outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[40]=v,e[41]=N,e[42]=k,e[43]=j):j=e[43];let C;e[44]!==h||e[45]!==j?(C=s.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[h,j]}),e[44]=h,e[45]=j,e[46]=C):C=e[46];let S;return e[47]!==m||e[48]!==C||e[49]!==g?(S=s.jsxs("div",{className:"space-y-2",children:[g,m,C]}),e[47]=m,e[48]=C,e[49]=g,e[50]=S):S=e[50],S}function Vl(u){const e=u.match(/(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]{11})/);if(e)return`https://www.youtube.com/embed/${e[1]}`;const t=u.match(/vimeo\.com\/(\d+)/);return t?`https://player.vimeo.com/video/${t[1]}`:null}function Kl(u){const e=$.c(28),{url:t,caption:r,onChange:l}=u,o=D();let n;e[0]!==t?(n=Vl(t),e[0]=t,e[1]=n):n=e[1];const i=n;let d;e[2]!==r||e[3]!==i||e[4]!==o?(d=i?s.jsx("div",{className:"relative aspect-video overflow-hidden rounded-md border bg-muted",children:s.jsx("iframe",{src:i,title:r||o("sandbox.mediaBlocks.video"),sandbox:"allow-scripts allow-same-origin allow-presentation",className:"absolute inset-0 h-full w-full border-0",allowFullScreen:!0})}):s.jsx("div",{className:"flex aspect-video items-center justify-center rounded-md border border-dashed bg-muted/40 text-xs text-muted-foreground",children:o("sandbox.mediaBlocks.pasteVideoUrl")}),e[2]=r,e[3]=i,e[4]=o,e[5]=d):d=e[5];let c;e[6]!==r||e[7]!==l?(c=m=>l({url:m.target.value,caption:r}),e[6]=r,e[7]=l,e[8]=c):c=e[8];let f;e[9]!==o?(f=o("sandbox.mediaBlocks.videoUrlPlaceholder"),e[9]=o,e[10]=f):f=e[10];let b;e[11]!==c||e[12]!==f||e[13]!==t?(b=s.jsx("input",{value:t,onChange:c,placeholder:f,className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[11]=c,e[12]=f,e[13]=t,e[14]=b):b=e[14];let g;e[15]!==l||e[16]!==t?(g=m=>l({url:t,caption:m}),e[15]=l,e[16]=t,e[17]=g):g=e[17];let x;e[18]!==o?(x=o("sandbox.mediaBlocks.addCaption"),e[18]=o,e[19]=x):x=e[19];let y;e[20]!==r||e[21]!==g||e[22]!==x?(y=s.jsx(se,{value:r,onChange:g,placeholder:x,className:"text-center text-sm italic text-muted-foreground"}),e[20]=r,e[21]=g,e[22]=x,e[23]=y):y=e[23];let a;return e[24]!==d||e[25]!==b||e[26]!==y?(a=s.jsxs("div",{className:"space-y-2",children:[d,b,y]}),e[24]=d,e[25]=b,e[26]=y,e[27]=a):a=e[27],a}function Yl(){const u=$.c(5),e=D();let t;u[0]!==e?(t=e("sandbox.mediaBlocks.divider"),u[0]=e,u[1]=t):t=u[1];let r;u[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("span",{className:"h-px flex-1 bg-border"}),u[2]=r):r=u[2];let l;return u[3]!==t?(l=s.jsx("div",{className:"flex items-center py-3","aria-label":t,children:r}),u[3]=t,u[4]=l):l=u[4],l}function Jl(u){const e=$.c(22),{text:t,href:r,onChange:l}=u,o=D();let n;e[0]!==r||e[1]!==l?(n=y=>l({text:y.target.value,href:r}),e[0]=r,e[1]=l,e[2]=n):n=e[2];let i;e[3]!==o?(i=o("sandbox.mediaBlocks.buttonLabel"),e[3]=o,e[4]=i):i=e[4];const d=Math.max(t.length||11,8);let c;e[5]!==n||e[6]!==i||e[7]!==d||e[8]!==t?(c=s.jsx("div",{className:"inline-flex items-center rounded-full bg-primary px-6 py-2 text-sm font-semibold text-primary-foreground",children:s.jsx("input",{value:t,onChange:n,placeholder:i,size:d,className:"border-0 bg-transparent p-0 text-center text-sm font-semibold text-primary-foreground outline-none placeholder:text-primary-foreground/60 focus:ring-0"})}),e[5]=n,e[6]=i,e[7]=d,e[8]=t,e[9]=c):c=e[9];let f;e[10]!==l||e[11]!==t?(f=y=>l({text:t,href:y.target.value}),e[10]=l,e[11]=t,e[12]=f):f=e[12];let b;e[13]!==o?(b=o("sandbox.mediaBlocks.destinationUrlPlaceholder"),e[13]=o,e[14]=b):b=e[14];let g;e[15]!==r||e[16]!==f||e[17]!==b?(g=s.jsx("input",{value:r,onChange:f,placeholder:b,className:"w-full max-w-sm border-0 bg-transparent p-0 text-center text-xs text-muted-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[15]=r,e[16]=f,e[17]=b,e[18]=g):g=e[18];let x;return e[19]!==c||e[20]!==g?(x=s.jsxs("div",{className:"flex flex-col items-center gap-2 py-2",children:[c,g]}),e[19]=c,e[20]=g,e[21]=x):x=e[21],x}const je=[{value:"info",icon:"ℹ",color:"oklch(0.62 0.19 250)"},{value:"tip",icon:"✓",color:"oklch(0.65 0.17 150)"},{value:"warning",icon:"⚠",color:"oklch(0.75 0.15 75)"},{value:"product",icon:"★",color:"oklch(0.62 0.21 300)"}];function Wl(u){const e=$.c(51),{title:t,body:r,variant:l,onChange:o}=u,n=D(),[i,d]=G.useState(!1);let c;e[0]!==l?(c=je.find(P=>P.value===l)??je[0],e[0]=l,e[1]=c):c=e[1];const f=c;let b,g;e[2]===Symbol.for("react.memo_cache_sentinel")?(b=()=>d(!0),g=P=>{P.currentTarget.contains(P.relatedTarget)||d(!1)},e[2]=b,e[3]=g):(b=e[2],g=e[3]);let x;e[4]!==r||e[5]!==i||e[6]!==o||e[7]!==t||e[8]!==f.value?(x=i&&s.jsx(Pe,{children:je.map(P=>s.jsx(ne,{active:f.value===P.value,label:P.value,onClick:()=>o({title:t,body:r,variant:P.value}),children:s.jsx("span",{style:{color:P.color},children:P.icon})},P.value))}),e[4]=r,e[5]=i,e[6]=o,e[7]=t,e[8]=f.value,e[9]=x):x=e[9];const y=`3px solid ${f.color}`,a=`color-mix(in oklch, ${f.color} 8%, transparent)`;let m;e[10]!==y||e[11]!==a?(m={borderLeft:y,backgroundColor:a},e[10]=y,e[11]=a,e[12]=m):m=e[12];let p;e[13]!==f.color?(p={color:f.color},e[13]=f.color,e[14]=p):p=e[14];let h;e[15]!==f.icon?(h=s.jsx("span",{"aria-hidden":!0,className:"text-sm font-bold leading-none",children:f.icon}),e[15]=f.icon,e[16]=h):h=e[16];let v;e[17]!==r||e[18]!==o||e[19]!==l?(v=P=>o({title:P.target.value,body:r,variant:l}),e[17]=r,e[18]=o,e[19]=l,e[20]=v):v=e[20];let N;e[21]!==n?(N=n("sandbox.mediaBlocks.calloutTitle"),e[21]=n,e[22]=N):N=e[22];let k;e[23]!==f.color?(k={color:f.color},e[23]=f.color,e[24]=k):k=e[24];let j;e[25]!==v||e[26]!==N||e[27]!==k||e[28]!==t?(j=s.jsx("input",{value:t,onChange:v,placeholder:N,className:"flex-1 border-0 bg-transparent p-0 text-xs font-semibold uppercase tracking-wide outline-none focus:ring-0",style:k}),e[25]=v,e[26]=N,e[27]=k,e[28]=t,e[29]=j):j=e[29];let C;e[30]!==j||e[31]!==p||e[32]!==h?(C=s.jsxs("div",{className:"mb-1.5 flex items-center gap-2",style:p,children:[h,j]}),e[30]=j,e[31]=p,e[32]=h,e[33]=C):C=e[33];let S;e[34]!==o||e[35]!==t||e[36]!==l?(S=P=>o({title:t,body:P,variant:l}),e[34]=o,e[35]=t,e[36]=l,e[37]=S):S=e[37];let B;e[38]!==n?(B=n("sandbox.mediaBlocks.calloutText"),e[38]=n,e[39]=B):B=e[39];let w;e[40]!==r||e[41]!==S||e[42]!==B?(w=s.jsx(se,{value:r,onChange:S,placeholder:B,className:"text-[15px] leading-relaxed text-foreground"}),e[40]=r,e[41]=S,e[42]=B,e[43]=w):w=e[43];let T;e[44]!==C||e[45]!==w||e[46]!==m?(T=s.jsxs("div",{className:"rounded-md py-4 pl-5 pr-4",style:m,children:[C,w]}),e[44]=C,e[45]=w,e[46]=m,e[47]=T):T=e[47];let L;return e[48]!==T||e[49]!==x?(L=s.jsxs("div",{className:"relative",onFocus:b,onBlur:g,children:[x,T]}),e[48]=T,e[49]=x,e[50]=L):L=e[50],L}function Ql(u){const e=$.c(34),{value:t,label:r,description:l,onChange:o}=u,n=D();let i;e[0]!==l||e[1]!==r||e[2]!==o?(i=p=>o({value:p.target.value,label:r,description:l}),e[0]=l,e[1]=r,e[2]=o,e[3]=i):i=e[3];let d;e[4]!==n?(d=n("sandbox.mediaBlocks.statValuePlaceholder"),e[4]=n,e[5]=d):d=e[5];let c;e[6]!==i||e[7]!==d||e[8]!==t?(c=s.jsx("input",{value:t,onChange:i,placeholder:d,className:"w-full border-0 bg-transparent p-0 text-center text-4xl font-bold tabular-nums text-foreground outline-none placeholder:text-muted-foreground/40 focus:ring-0"}),e[6]=i,e[7]=d,e[8]=t,e[9]=c):c=e[9];let f;e[10]!==l||e[11]!==o||e[12]!==t?(f=p=>o({value:t,label:p.target.value,description:l}),e[10]=l,e[11]=o,e[12]=t,e[13]=f):f=e[13];let b;e[14]!==n?(b=n("sandbox.mediaBlocks.label"),e[14]=n,e[15]=b):b=e[15];let g;e[16]!==r||e[17]!==f||e[18]!==b?(g=s.jsx("input",{value:r,onChange:f,placeholder:b,className:"w-full border-0 bg-transparent p-0 text-center text-xs font-semibold uppercase tracking-wide text-muted-foreground outline-none placeholder:text-muted-foreground/40 focus:ring-0"}),e[16]=r,e[17]=f,e[18]=b,e[19]=g):g=e[19];let x;e[20]!==r||e[21]!==o||e[22]!==t?(x=p=>o({value:t,label:r,description:p}),e[20]=r,e[21]=o,e[22]=t,e[23]=x):x=e[23];let y;e[24]!==n?(y=n("sandbox.mediaBlocks.optionalDescription"),e[24]=n,e[25]=y):y=e[25];let a;e[26]!==l||e[27]!==x||e[28]!==y?(a=s.jsx(se,{value:l,onChange:x,placeholder:y,className:"max-w-md text-center text-sm text-muted-foreground"}),e[26]=l,e[27]=x,e[28]=y,e[29]=a):a=e[29];let m;return e[30]!==c||e[31]!==g||e[32]!==a?(m=s.jsxs("div",{className:"flex flex-col items-center gap-1.5 border-y border-border/60 py-8 text-center",children:[c,g,a]}),e[30]=c,e[31]=g,e[32]=a,e[33]=m):m=e[33],m}function Xl(u){const e=$.c(21),{cards:t,onChange:r}=u,l=D();let o,n,i,d,c;if(e[0]!==t||e[1]!==r||e[2]!==l){n=de(t);let x;e[8]!==r?(x=a=>r(JSON.stringify(a)),e[8]=r,e[9]=x):x=e[9],o=x;const y=(a,m)=>o(n.map((p,h)=>h===a?{...p,...m}:p));c="space-y-2",i="grid grid-cols-1 gap-3 sm:grid-cols-3",d=n.slice(0,3).map((a,m)=>s.jsxs("div",{className:"group/item relative flex flex-col gap-2 rounded-lg border bg-card p-4",children:[s.jsx("div",{className:"absolute right-1 top-1",children:s.jsx(ae,{label:l("sandbox.listBlocks.removeCard"),onClick:()=>o(n.filter((p,h)=>h!==m))})}),s.jsx("input",{value:R(a.icon),onChange:p=>y(m,{icon:p.target.value}),placeholder:"🎴",className:"flex h-9 w-9 items-center justify-center rounded-md border bg-background text-center text-lg outline-none focus:ring-0"}),s.jsx("input",{value:R(a.title),onChange:p=>y(m,{title:p.target.value}),placeholder:l("sandbox.listBlocks.cardTitle"),className:"border-0 bg-transparent p-0 text-[15px] font-semibold outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),s.jsx(se,{value:R(a.body),onChange:p=>y(m,{body:p}),placeholder:l("sandbox.listBlocks.cardBody"),className:"text-sm text-muted-foreground"})]},m)),e[0]=t,e[1]=r,e[2]=l,e[3]=o,e[4]=n,e[5]=i,e[6]=d,e[7]=c}else o=e[3],n=e[4],i=e[5],d=e[6],c=e[7];let f;e[10]!==i||e[11]!==d?(f=s.jsx("div",{className:i,children:d}),e[10]=i,e[11]=d,e[12]=f):f=e[12];let b;e[13]!==o||e[14]!==n||e[15]!==l?(b=n.length<3&&s.jsx(ce,{label:l("sandbox.listBlocks.addCard"),onClick:()=>o([...n,{title:"",body:""}])}),e[13]=o,e[14]=n,e[15]=l,e[16]=b):b=e[16];let g;return e[17]!==c||e[18]!==f||e[19]!==b?(g=s.jsxs("div",{className:c,children:[f,b]}),e[17]=c,e[18]=f,e[19]=b,e[20]=g):g=e[20],g}function Zl(u){const e=$.c(36),{title:t,items:r,onChange:l}=u,o=D();let n,i,d,c,f;if(e[0]!==r||e[1]!==l||e[2]!==o||e[3]!==t){i=de(r);let m;e[9]!==l||e[10]!==t?(m=v=>l({title:t,items:JSON.stringify(v)}),e[9]=l,e[10]=t,e[11]=m):m=e[11],n=m,c="space-y-2";let p;e[12]!==r||e[13]!==l?(p=v=>l({title:v.target.value,items:r}),e[12]=r,e[13]=l,e[14]=p):p=e[14];let h;e[15]!==o?(h=o("sandbox.listBlocks.checklistTitle"),e[15]=o,e[16]=h):h=e[16],e[17]!==p||e[18]!==h||e[19]!==t?(f=s.jsx("input",{value:t,onChange:p,placeholder:h,className:"w-full border-0 bg-transparent p-0 text-lg font-semibold outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[17]=p,e[18]=h,e[19]=t,e[20]=f):f=e[20],d=i.map((v,N)=>s.jsxs("li",{className:"group/item flex items-start gap-3 border-b border-border/50 py-2.5",children:[s.jsx("span",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center text-primary",children:s.jsx(it,{size:15})}),s.jsx(se,{value:v,onChange:k=>n(i.map((j,C)=>C===N?k:j)),placeholder:o("sandbox.listBlocks.checklistItem"),className:"text-[15px] text-foreground"}),s.jsx(ae,{label:o("sandbox.listBlocks.removeItem"),onClick:()=>n(i.filter((k,j)=>j!==N))})]},N)),e[0]=r,e[1]=l,e[2]=o,e[3]=t,e[4]=n,e[5]=i,e[6]=d,e[7]=c,e[8]=f}else n=e[4],i=e[5],d=e[6],c=e[7],f=e[8];let b;e[21]!==d?(b=s.jsx("ul",{children:d}),e[21]=d,e[22]=b):b=e[22];let g;e[23]!==o?(g=o("sandbox.listBlocks.addItem"),e[23]=o,e[24]=g):g=e[24];let x;e[25]!==n||e[26]!==i?(x=()=>n([...i,""]),e[25]=n,e[26]=i,e[27]=x):x=e[27];let y;e[28]!==g||e[29]!==x?(y=s.jsx(ce,{label:g,onClick:x}),e[28]=g,e[29]=x,e[30]=y):y=e[30];let a;return e[31]!==c||e[32]!==f||e[33]!==b||e[34]!==y?(a=s.jsxs("div",{className:c,children:[f,b,y]}),e[31]=c,e[32]=f,e[33]=b,e[34]=y,e[35]=a):a=e[35],a}function es(u){const e=$.c(21),{stats:t,onChange:r}=u,l=D();let o,n,i,d,c;if(e[0]!==r||e[1]!==t||e[2]!==l){n=de(t);let x;e[8]!==r?(x=a=>r(JSON.stringify(a)),e[8]=r,e[9]=x):x=e[9],o=x;const y=(a,m)=>o(n.map((p,h)=>h===a?{...p,...m}:p));c="space-y-2",i="grid grid-cols-1 gap-3 sm:grid-cols-3",d=n.slice(0,3).map((a,m)=>s.jsxs("div",{className:"group/item relative rounded-lg border p-5 text-center",children:[s.jsx("div",{className:"absolute right-1 top-1",children:s.jsx(ae,{label:l("sandbox.listBlocks.removeStat"),onClick:()=>o(n.filter((p,h)=>h!==m))})}),s.jsx("input",{value:R(a.value),onChange:p=>y(m,{value:p.target.value}),placeholder:l("sandbox.listBlocks.statValuePlaceholder"),className:"w-full border-0 bg-transparent p-0 text-center text-3xl font-bold tabular-nums text-foreground outline-none placeholder:text-muted-foreground/40 focus:ring-0"}),s.jsx("input",{value:R(a.label),onChange:p=>y(m,{label:p.target.value}),placeholder:l("sandbox.listBlocks.label"),className:"mt-1 w-full border-0 bg-transparent p-0 text-center text-sm text-muted-foreground outline-none placeholder:text-muted-foreground/40 focus:ring-0"})]},m)),e[0]=r,e[1]=t,e[2]=l,e[3]=o,e[4]=n,e[5]=i,e[6]=d,e[7]=c}else o=e[3],n=e[4],i=e[5],d=e[6],c=e[7];let f;e[10]!==i||e[11]!==d?(f=s.jsx("div",{className:i,children:d}),e[10]=i,e[11]=d,e[12]=f):f=e[12];let b;e[13]!==o||e[14]!==n||e[15]!==l?(b=n.length<3&&s.jsx(ce,{label:l("sandbox.listBlocks.addStat"),onClick:()=>o([...n,{value:"",label:""}])}),e[13]=o,e[14]=n,e[15]=l,e[16]=b):b=e[16];let g;return e[17]!==c||e[18]!==f||e[19]!==b?(g=s.jsxs("div",{className:c,children:[f,b]}),e[17]=c,e[18]=f,e[19]=b,e[20]=g):g=e[20],g}function ts(u){const e=$.c(38),{title:t,steps:r,onChange:l}=u,o=D();let n,i,d,c,f,b;if(e[0]!==l||e[1]!==r||e[2]!==o||e[3]!==t){i=de(r);let p;e[10]!==l||e[11]!==t?(p=k=>l({title:t,steps:JSON.stringify(k)}),e[10]=l,e[11]=t,e[12]=p):p=e[12],n=p;const h=(k,j)=>n(i.map((C,S)=>S===k?{...C,...j}:C));f="space-y-2";let v;e[13]!==l||e[14]!==r?(v=k=>l({title:k.target.value,steps:r}),e[13]=l,e[14]=r,e[15]=v):v=e[15];let N;e[16]!==o?(N=o("sandbox.listBlocks.stepsTitle"),e[16]=o,e[17]=N):N=e[17],e[18]!==v||e[19]!==N||e[20]!==t?(b=s.jsx("input",{value:t,onChange:v,placeholder:N,className:"w-full border-0 bg-transparent p-0 text-lg font-semibold uppercase tracking-wide outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[18]=v,e[19]=N,e[20]=t,e[21]=b):b=e[21],d="space-y-3",c=i.map((k,j)=>s.jsxs("li",{className:"group/item flex gap-4",children:[s.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full border text-sm font-semibold text-muted-foreground",children:j+1}),s.jsxs("div",{className:"min-w-0 flex-1 space-y-1 pt-0.5",children:[s.jsx("input",{value:R(k.title),onChange:C=>h(j,{title:C.target.value}),placeholder:o("sandbox.listBlocks.stepTitle"),className:"w-full border-0 bg-transparent p-0 text-[15px] font-semibold outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),s.jsx(se,{value:R(k.description),onChange:C=>h(j,{description:C}),placeholder:o("sandbox.listBlocks.stepDescription"),className:"text-sm text-muted-foreground"})]}),s.jsx(ae,{label:o("sandbox.listBlocks.removeStep"),onClick:()=>n(i.filter((C,S)=>S!==j))})]},j)),e[0]=l,e[1]=r,e[2]=o,e[3]=t,e[4]=n,e[5]=i,e[6]=d,e[7]=c,e[8]=f,e[9]=b}else n=e[4],i=e[5],d=e[6],c=e[7],f=e[8],b=e[9];let g;e[22]!==d||e[23]!==c?(g=s.jsx("ol",{className:d,children:c}),e[22]=d,e[23]=c,e[24]=g):g=e[24];let x;e[25]!==o?(x=o("sandbox.listBlocks.addStep"),e[25]=o,e[26]=x):x=e[26];let y;e[27]!==n||e[28]!==i?(y=()=>n([...i,{title:"",description:""}]),e[27]=n,e[28]=i,e[29]=y):y=e[29];let a;e[30]!==x||e[31]!==y?(a=s.jsx(ce,{label:x,onClick:y}),e[30]=x,e[31]=y,e[32]=a):a=e[32];let m;return e[33]!==f||e[34]!==b||e[35]!==g||e[36]!==a?(m=s.jsxs("div",{className:f,children:[b,g,a]}),e[33]=f,e[34]=b,e[35]=g,e[36]=a,e[37]=m):m=e[37],m}function Ee(u,e){try{const t=JSON.parse(u||"{}");return{title:typeof t?.title=="string"?t.title:e,items:Array.isArray(t?.items)?t.items:[]}}catch{return{title:e,items:[]}}}function ls(u){const e=$.c(13),{left:t,right:r,onChange:l}=u,o=D();let n;if(e[0]!==t||e[1]!==l||e[2]!==r||e[3]!==o){const i={left:Ee(t,o("sandbox.listBlocks.optionA")),right:Ee(r,o("sandbox.listBlocks.optionB"))};let d;e[5]!==t||e[6]!==l||e[7]!==r?(d=(x,y)=>l({left:x==="left"?JSON.stringify(y):t,right:x==="right"?JSON.stringify(y):r}),e[5]=t,e[6]=l,e[7]=r,e[8]=d):d=e[8];const c=d;let f;e[9]!==c||e[10]!==o?(f=(x,y,a)=>{const m=y.items??[];return s.jsxs("div",{className:"space-y-2 rounded-lg border p-4",children:[s.jsx("input",{value:R(y.title),onChange:p=>c(x,{...y,title:p.target.value}),placeholder:o("sandbox.listBlocks.columnTitle"),className:"w-full border-0 bg-transparent p-0 text-xs font-semibold uppercase tracking-wide outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),s.jsx("ul",{className:"space-y-1.5",children:m.map((p,h)=>s.jsxs("li",{className:"group/item flex items-start gap-2",children:[s.jsx("span",{"aria-hidden":!0,className:"mt-0.5 shrink-0 text-sm font-bold",style:{color:a},children:"✓"}),s.jsx(se,{value:p,onChange:v=>c(x,{...y,items:m.map((N,k)=>k===h?v:N)}),placeholder:o("sandbox.listBlocks.item"),className:"text-sm text-foreground"}),s.jsx(ae,{label:o("sandbox.listBlocks.removeItem"),onClick:()=>c(x,{...y,items:m.filter((v,N)=>N!==h)})})]},h))}),s.jsx(ce,{label:o("sandbox.listBlocks.addItem"),onClick:()=>c(x,{...y,items:[...m,""]})})]})},e[9]=c,e[10]=o,e[11]=f):f=e[11];const b=f;let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=te("grid grid-cols-1 gap-3 sm:grid-cols-2"),e[12]=g):g=e[12],n=s.jsxs("div",{className:g,children:[b("left",i.left,"oklch(0.65 0.17 150)"),b("right",i.right,"oklch(0.75 0.15 75)")]}),e[0]=t,e[1]=l,e[2]=r,e[3]=o,e[4]=n}else n=e[4];return n}const ss="vtex/loaders/intelligentSearch/productList.ts";function re(u){return u&&typeof u=="object"&&!Array.isArray(u)?u:null}function ke(u){return typeof u=="string"||typeof u=="number"?String(u):""}function Ne(u){const e=re(u);return!!e&&typeof e.__resolveType=="string"&&"productId"in e}function bt(u){if(Array.isArray(u))return u.map(r=>ke(re(r)?.productId));const e=re(u),t=re(e?.props);return t&&Array.isArray(t.ids)?t.ids.map(ke):e&&"productId"in e?[ke(e.productId)]:[]}function os(u){const e=re(u)??{};return typeof e.__resolveType=="string"?e.__resolveType:ss}function yt(u,e){if(Array.isArray(u)){const o=u.find(Ne);if(o)return e.map((n,i)=>{const d=re(u[i]);return{...Ne(d)?d:{__resolveType:o.__resolveType},productId:n}})}const t=re(u);if(Ne(t)&&!re(t.props)?.ids)return{...t,productId:e[0]??""};const r=re(t?.props)??{},l=os(u);return{...t??{},__resolveType:l,props:{...r,ids:e,simulationBehavior:r.simulationBehavior??"default"}}}const ns=[{id:"search",labelKey:"sandbox.productPickerDialog.modeSearch"},{id:"category",labelKey:"sandbox.productPickerDialog.modeCategory"},{id:"cluster",labelKey:"sandbox.productPickerDialog.modeClusterId"}];async function rs(u,e){if(e.length===0)return[];const t=await Promise.allSettled(e.map(n=>ye(u,n))),r=t.filter(n=>n.status==="fulfilled").map(n=>n.value);if(r.length===0){const n=t.find(i=>i.status==="rejected");throw n?n.reason:new Error("Failed to fetch products")}const l=[],o=new Set;for(const n of r)for(const i of _e(n))o.has(i.id)||(o.add(i.id),l.push(i));return l}function Re(u){const e=$.c(6),[t,r]=G.useState(""),[l,o]=G.useState(""),n=G.useRef(null);let i;e[0]!==u?(i=f=>{r(f),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>o(f),u)},e[0]=u,e[1]=i):i=e[1];const d=i;let c;return e[2]!==l||e[3]!==d||e[4]!==t?(c={value:t,debounced:l,onChange:d},e[2]=l,e[3]=d,e[4]=t,e[5]=c):c=e[5],c}function is(u){const e=$.c(23),{option:t,selected:r,onToggle:l}=u,o=r?"border-primary/40 bg-primary/5":"border-transparent hover:bg-muted/60";let n;e[0]!==o?(n=te("flex w-full items-center gap-3 rounded-lg border px-2 py-2 text-left transition-colors",o),e[0]=o,e[1]=n):n=e[1];let i;e[2]!==t.image?(i=s.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:t.image?s.jsx("img",{src:t.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):s.jsx(he,{size:14,className:"text-muted-foreground"})}),e[2]=t.image,e[3]=i):i=e[3];let d;e[4]!==t.label?(d=s.jsx("span",{className:"line-clamp-2 text-sm",children:t.label}),e[4]=t.label,e[5]=d):d=e[5];let c;e[6]!==t.id?(c=s.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:["ID ",t.id]}),e[6]=t.id,e[7]=c):c=e[7];let f;e[8]!==d||e[9]!==c?(f=s.jsxs("span",{className:"min-w-0 flex-1",children:[d,c]}),e[8]=d,e[9]=c,e[10]=f):f=e[10];const b=r?"border-primary bg-primary text-primary-foreground":"border-border text-transparent";let g;e[11]!==b?(g=te("flex h-5 w-5 shrink-0 items-center justify-center rounded-full border",b),e[11]=b,e[12]=g):g=e[12];let x;e[13]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(it,{size:12}),e[13]=x):x=e[13];let y;e[14]!==g?(y=s.jsx("span",{className:g,children:x}),e[14]=g,e[15]=y):y=e[15];let a;return e[16]!==l||e[17]!==r||e[18]!==y||e[19]!==n||e[20]!==i||e[21]!==f?(a=s.jsxs("button",{type:"button",onClick:l,"aria-pressed":r,className:n,children:[i,f,y]}),e[16]=l,e[17]=r,e[18]=y,e[19]=n,e[20]=i,e[21]=f,e[22]=a):a=e[22],a}function vt(u){const e=$.c(9),{query:t,emptyLabel:r,loadingLabel:l}=u,o=D();if(t.isLoading){let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Fe,{size:"xs"}),e[0]=i):i=e[0];let d;return e[1]!==l?(d=s.jsxs("div",{className:"flex items-center gap-2 px-2 py-6 text-sm text-muted-foreground",children:[i,l]}),e[1]=l,e[2]=d):d=e[2],d}if(t.isError){let i;e[3]!==o?(i=o("sandbox.productPickerDialog.couldNotLoad"),e[3]=o,e[4]=i):i=e[4];let d;return e[5]!==i?(d=s.jsx("p",{className:"px-2 py-6 text-sm text-muted-foreground",children:i}),e[5]=i,e[6]=d):d=e[6],d}let n;return e[7]!==r?(n=s.jsx("p",{className:"px-2 py-6 text-center text-sm text-muted-foreground",children:r}),e[7]=r,e[8]=n):n=e[8],n}function jt(u){return`${u.orgSlug}/${u.virtualMcpId}/${u.branch}`}function as(u){const e=$.c(45),{sandboxRef:t,open:r,selected:l,onSelect:o}=u,n=D(),[i,d]=G.useState("");let c;e[0]!==t?(c=xe.sandboxInvoke(jt(t),"blog-category-tree"),e[0]=t,e[1]=c):c=e[1];let f;e[2]!==t?(f=()=>ye(t,kl()).then(Bl),e[2]=t,e[3]=f):f=e[3];const b=r&&!l;let g;e[4]!==c||e[5]!==f||e[6]!==b?(g={queryKey:c,queryFn:f,enabled:b,staleTime:6e4,retry:1},e[4]=c,e[5]=f,e[6]=b,e[7]=g):g=e[7];const x=ge(g);if(l){let N;e[8]!==o?(N=()=>o(null),e[8]=o,e[9]=N):N=e[9];let k;e[10]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Dt,{size:14}),e[10]=k):k=e[10];let j;e[11]!==n?(j=n("sandbox.productPickerDialog.categoryLabel"),e[11]=n,e[12]=j):j=e[12];let C;e[13]!==l.label?(C=s.jsx("span",{className:"text-foreground",children:l.label}),e[13]=l.label,e[14]=C):C=e[14];let S;e[15]!==n?(S=n("sandbox.productPickerDialog.change"),e[15]=n,e[16]=S):S=e[16];let B;e[17]!==j||e[18]!==C||e[19]!==S?(B=s.jsxs("span",{className:"truncate",children:[j,C," —",S]}),e[17]=j,e[18]=C,e[19]=S,e[20]=B):B=e[20];let w;return e[21]!==B||e[22]!==N?(w=s.jsxs("button",{type:"button",onClick:N,className:"flex items-center gap-1.5 rounded-lg px-2 py-1.5 text-sm text-muted-foreground hover:bg-muted/60 hover:text-foreground",children:[k,B]}),e[21]=B,e[22]=N,e[23]=w):w=e[23],w}let y,a,m,p;if(e[24]!==i||e[25]!==o||e[26]!==x||e[27]!==n){const N=Sl(x.data??[],i);m="space-y-2";let k;e[32]===Symbol.for("react.memo_cache_sentinel")?(k=C=>d(C.target.value),e[32]=k):k=e[32];let j;e[33]!==n?(j=n("sandbox.productPickerDialog.filterCategoriesPlaceholder"),e[33]=n,e[34]=j):j=e[34],e[35]!==i||e[36]!==j?(p=s.jsx(Be,{value:i,onChange:k,placeholder:j,className:"h-9"}),e[35]=i,e[36]=j,e[37]=p):p=e[37],y="h-48 overflow-y-auto rounded-md border",a=N.length===0?s.jsx(vt,{query:x,loadingLabel:n("sandbox.productPickerDialog.loadingCategories"),emptyLabel:n("sandbox.productPickerDialog.noCategories")}):s.jsx("div",{className:"p-1",children:N.map(C=>s.jsx("button",{type:"button",onClick:()=>o(C),className:"block w-full truncate px-2 py-1.5 text-left text-sm hover:bg-muted/60 rounded-lg",children:C.label},C.path))}),e[24]=i,e[25]=o,e[26]=x,e[27]=n,e[28]=y,e[29]=a,e[30]=m,e[31]=p}else y=e[28],a=e[29],m=e[30],p=e[31];let h;e[38]!==y||e[39]!==a?(h=s.jsx("div",{className:y,children:a}),e[38]=y,e[39]=a,e[40]=h):h=e[40];let v;return e[41]!==m||e[42]!==p||e[43]!==h?(v=s.jsxs("div",{className:m,children:[p,h]}),e[41]=m,e[42]=p,e[43]=h,e[44]=v):v=e[44],v}function kt(u){const e=$.c(89),{open:t,onOpenChange:r,sandboxRef:l,selectedIds:o,onChange:n,multiple:i}=u,d=i===void 0?!0:i,c=D(),[f,b]=G.useState("search"),g=Re(300),x=Re(300),[y,a]=G.useState(null),m=f==="search"?g.debounced:f==="cluster"?x.debounced:y?.path??"";let p;e[0]!==f||e[1]!==m?(p=pt(f,m),e[0]=f,e[1]=m,e[2]=p):p=e[2];const h=p;let v;e[3]!==f||e[4]!==l||e[5]!==m?(v=xe.sandboxInvoke(jt(l),`blog-product:${f}:${m}`),e[3]=f,e[4]=l,e[5]=m,e[6]=v):v=e[6];let N;e[7]!==h||e[8]!==l?(N=()=>rs(l,h),e[7]=h,e[8]=l,e[9]=N):N=e[9];const k=t&&h.length>0;let j;e[10]!==v||e[11]!==N||e[12]!==k?(j={queryKey:v,queryFn:N,enabled:k,staleTime:6e4,retry:1},e[10]=v,e[11]=N,e[12]=k,e[13]=j):j=e[13];const C=ge(j);let S;e[14]!==o?(S=new Set(o.filter(Boolean)),e[14]=o,e[15]=S):S=e[15];const B=S;let w;e[16]!==d||e[17]!==n||e[18]!==B||e[19]!==o?(w=H=>{if(!d){n(B.has(H)?[]:[H]);return}B.has(H)?n(o.filter(oe=>oe!==H)):n([...o.filter(Boolean),H])},e[16]=d,e[17]=n,e[18]=B,e[19]=o,e[20]=w):w=e[20];const T=w;let L;e[21]!==C.data?(L=C.data??[],e[21]=C.data,e[22]=L):L=e[22];const P=L,I=h.length===0;let _;e[23]!==d||e[24]!==c?(_=c(d?"sandbox.productPickerDialog.addProducts":"sandbox.productPickerDialog.chooseProduct"),e[23]=d,e[24]=c,e[25]=_):_=e[25];let z;e[26]!==_?(z=s.jsx(sl,{className:"border-b border-border px-4 py-3",children:s.jsx(ol,{className:"text-sm font-medium",children:_})}),e[26]=_,e[27]=z):z=e[27];let U;e[28]!==f||e[29]!==c?(U=ns.map(H=>s.jsx("button",{type:"button",onClick:()=>b(H.id),className:te("rounded-lg px-2.5 py-1 text-sm transition-colors",f===H.id?"bg-muted font-medium text-foreground":"text-muted-foreground hover:text-foreground"),children:c(H.labelKey)},H.id)),e[28]=f,e[29]=c,e[30]=U):U=e[30];let J;e[31]!==U?(J=s.jsx("div",{className:"flex shrink-0 items-center gap-1 border-b border-border px-4 py-2",children:U}),e[31]=U,e[32]=J):J=e[32];let W;e[33]!==f||e[34]!==g||e[35]!==c?(W=f==="search"&&s.jsx(Be,{autoFocus:!0,value:g.value,onChange:H=>g.onChange(H.target.value),placeholder:c("sandbox.productPickerDialog.searchProductsPlaceholder"),className:"h-9"}),e[33]=f,e[34]=g,e[35]=c,e[36]=W):W=e[36];let q;e[37]!==x||e[38]!==f||e[39]!==c?(q=f==="cluster"&&s.jsx(Be,{autoFocus:!0,value:x.value,onChange:H=>x.onChange(H.target.value),placeholder:c("sandbox.productPickerDialog.clusterIdPlaceholder"),className:"h-9"}),e[37]=x,e[38]=f,e[39]=c,e[40]=q):q=e[40];let V;e[41]!==y||e[42]!==f||e[43]!==t||e[44]!==l?(V=f==="category"&&s.jsx(as,{sandboxRef:l,open:t,selected:y,onSelect:a}),e[41]=y,e[42]=f,e[43]=t,e[44]=l,e[45]=V):V=e[45];let A;e[46]!==W||e[47]!==q||e[48]!==V?(A=s.jsxs("div",{className:"shrink-0 space-y-2 px-4 py-3",children:[W,q,V]}),e[46]=W,e[47]=q,e[48]=V,e[49]=A):A=e[49];let E;e[50]!==P||e[51]!==C||e[52]!==B||e[53]!==I||e[54]!==c||e[55]!==T?(E=P.length>0?P.map(H=>s.jsx(is,{option:H,selected:B.has(H.id),onToggle:()=>T(H.id)},H.id)):!I&&s.jsx(vt,{query:C,loadingLabel:c("sandbox.productPickerDialog.loadingProducts"),emptyLabel:c("sandbox.productPickerDialog.noProductsFound")}),e[50]=P,e[51]=C,e[52]=B,e[53]=I,e[54]=c,e[55]=T,e[56]=E):E=e[56];let O;e[57]!==f||e[58]!==I||e[59]!==c?(O=I&&s.jsx("p",{className:"px-2 py-6 text-center text-sm text-muted-foreground",children:c(f==="category"?"sandbox.productPickerDialog.pickCategoryPrompt":"sandbox.productPickerDialog.enterClusterPrompt")}),e[57]=f,e[58]=I,e[59]=c,e[60]=O):O=e[60];let Y;e[61]!==E||e[62]!==O?(Y=s.jsxs("div",{className:"min-h-0 flex-1 space-y-1 overflow-y-auto border-t border-border px-3 py-2",children:[E,O]}),e[61]=E,e[62]=O,e[63]=Y):Y=e[63];let Q;e[64]!==B.size||e[65]!==c?(Q=B.size===0?c("sandbox.productPickerDialog.noneSelected"):c("sandbox.productPickerDialog.selectedCount",{count:String(B.size)}),e[64]=B.size,e[65]=c,e[66]=Q):Q=e[66];let X;e[67]!==Q?(X=s.jsx("span",{className:"text-xs text-muted-foreground",children:Q}),e[67]=Q,e[68]=X):X=e[68];let Z;e[69]!==r?(Z=()=>r(!1),e[69]=r,e[70]=Z):Z=e[70];let le;e[71]!==c?(le=c("sandbox.productPickerDialog.done"),e[71]=c,e[72]=le):le=e[72];let F;e[73]!==Z||e[74]!==le?(F=s.jsx(Bt,{size:"sm",onClick:Z,children:le}),e[73]=Z,e[74]=le,e[75]=F):F=e[75];let K;e[76]!==X||e[77]!==F?(K=s.jsxs("div",{className:"flex shrink-0 items-center justify-between border-t border-border px-4 py-3",children:[X,F]}),e[76]=X,e[77]=F,e[78]=K):K=e[78];let M;e[79]!==z||e[80]!==J||e[81]!==A||e[82]!==Y||e[83]!==K?(M=s.jsxs(nl,{className:"flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[560px] sm:max-w-[560px]",children:[z,J,A,Y,K]}),e[79]=z,e[80]=J,e[81]=A,e[82]=Y,e[83]=K,e[84]=M):M=e[84];let ee;return e[85]!==r||e[86]!==t||e[87]!==M?(ee=s.jsx(rl,{open:t,onOpenChange:r,children:M}),e[85]=r,e[86]=t,e[87]=M,e[88]=ee):ee=e[88],ee}const cs=["normal","h1","h2","h3"],ds=/^<(h[1-3])>([\s\S]*)<\/\1>$/i;function us(u){const e=u.match(ds);return e?{level:e[1].toLowerCase(),text:e[2]}:{level:"normal",text:u}}function De(u,e){return e?u==="normal"?e:`<${u}>${e}</${u}>`:""}const Oe={normal:"sandbox.productBlocks.headingNormal",h1:"sandbox.productBlocks.headingH1",h2:"sandbox.productBlocks.headingH2",h3:"sandbox.productBlocks.headingH3"},fs={normal:"text-lg font-semibold",h1:"text-3xl font-bold",h2:"text-2xl font-bold",h3:"text-xl font-semibold"};function ms(u){const e=$.c(27),{value:t,onChange:r}=u,l=D();let o,n,i,d,c;e[0]!==r||e[1]!==l||e[2]!==t?({level:o,text:c}=us(t),d="space-y-1.5",n="flex items-center gap-0.5",i=cs.map(p=>s.jsx(ne,{active:o===p,label:l(Oe[p]),onClick:()=>r(De(p,c)),children:l(Oe[p])},p)),e[0]=r,e[1]=l,e[2]=t,e[3]=o,e[4]=n,e[5]=i,e[6]=d,e[7]=c):(o=e[3],n=e[4],i=e[5],d=e[6],c=e[7]);let f;e[8]!==n||e[9]!==i?(f=s.jsx("div",{className:n,children:i}),e[8]=n,e[9]=i,e[10]=f):f=e[10];let b;e[11]!==o||e[12]!==r?(b=p=>r(De(o,p.target.value)),e[11]=o,e[12]=r,e[13]=b):b=e[13];let g;e[14]!==l?(g=l("sandbox.productBlocks.shelfTitlePlaceholder"),e[14]=l,e[15]=g):g=e[15];const x=fs[o];let y;e[16]!==x?(y=te("w-full border-0 bg-transparent p-0 outline-none placeholder:text-muted-foreground/50 focus:ring-0",x),e[16]=x,e[17]=y):y=e[17];let a;e[18]!==b||e[19]!==g||e[20]!==y||e[21]!==c?(a=s.jsx("input",{value:c,onChange:b,placeholder:g,className:y}),e[18]=b,e[19]=g,e[20]=y,e[21]=c,e[22]=a):a=e[22];let m;return e[23]!==d||e[24]!==f||e[25]!==a?(m=s.jsxs("div",{className:d,children:[f,a]}),e[23]=d,e[24]=f,e[25]=a,e[26]=m):m=e[26],m}function Nt(u){const e=$.c(4),{label:t,onClick:r}=u;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(he,{size:13}),e[0]=l):l=e[0];let o;return e[1]!==t||e[2]!==r?(o=s.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground cursor-pointer",children:[l,t]}),e[1]=t,e[2]=r,e[3]=o):o=e[3],o}function Ct(u){const e=$.c(9),{option:t,loading:r,className:l,iconSize:o}=u,n=o===void 0?18:o;let i;e[0]!==l?(i=te("flex items-center justify-center overflow-hidden bg-muted text-muted-foreground",l),e[0]=l,e[1]=i):i=e[1];let d;e[2]!==n||e[3]!==r||e[4]!==t?(d=t?.image?s.jsx("img",{src:t.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-contain p-1.5"}):r?s.jsx(Fe,{size:"xs"}):s.jsx(tl,{size:n}),e[2]=n,e[3]=r,e[4]=t,e[5]=d):d=e[5];let c;return e[6]!==i||e[7]!==d?(c=s.jsx("span",{className:i,children:d}),e[6]=i,e[7]=d,e[8]=c):c=e[8],c}function ps(u){const e=$.c(50),{id:t,option:r,loading:l,onRemove:o}=u,n=D();let i;e[0]!==t?(i={id:t},e[0]=t,e[1]=i):i=e[1];const{attributes:d,listeners:c,setNodeRef:f,transform:b,transition:g,isDragging:x}=We(i);let y;e[2]!==b?(y=Qe.Transform.toString(b),e[2]=b,e[3]=y):y=e[3];let a;e[4]!==y||e[5]!==g?(a={transform:y,transition:g},e[4]=y,e[5]=g,e[6]=a):a=e[6];const m=x&&"z-10 opacity-60";let p;e[7]!==m?(p=te("group/card relative flex flex-col overflow-hidden rounded-md border bg-background",m),e[7]=m,e[8]=p):p=e[8];let h;e[9]!==l||e[10]!==r?(h=s.jsx(Ct,{option:r,loading:l,className:"h-full w-full"}),e[9]=l,e[10]=r,e[11]=h):h=e[11];let v;e[12]!==n?(v=n("sandbox.productBlocks.dragToReorderLabel"),e[12]=n,e[13]=v):v=e[13];let N;e[14]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(tt,{size:13}),e[14]=N):N=e[14];let k;e[15]!==d||e[16]!==c||e[17]!==v?(k=s.jsx("button",{type:"button","aria-label":v,...d,...c,className:"absolute left-1 top-1 flex h-6 w-6 cursor-grab items-center justify-center bg-background/80 text-muted-foreground opacity-0 backdrop-blur-sm transition-opacity hover:text-foreground active:cursor-grabbing group-hover/card:opacity-100 rounded-lg",children:N}),e[15]=d,e[16]=c,e[17]=v,e[18]=k):k=e[18];let j;e[19]!==n?(j=n("sandbox.productBlocks.removeProductLabel"),e[19]=n,e[20]=j):j=e[20];let C;e[21]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(ll,{size:13}),e[21]=C):C=e[21];let S;e[22]!==o||e[23]!==j?(S=s.jsx("button",{type:"button","aria-label":j,onClick:o,className:"absolute right-1 top-1 flex h-6 w-6 items-center justify-center bg-background/80 text-muted-foreground opacity-0 backdrop-blur-sm transition-opacity hover:text-destructive group-hover/card:opacity-100 cursor-pointer rounded-lg",children:C}),e[22]=o,e[23]=j,e[24]=S):S=e[24];let B;e[25]!==S||e[26]!==h||e[27]!==k?(B=s.jsxs("div",{className:"relative aspect-square",children:[h,k,S]}),e[25]=S,e[26]=h,e[27]=k,e[28]=B):B=e[28];let w;e[29]!==t||e[30]!==l||e[31]!==r?.label||e[32]!==n?(w=r?.label??(l?n("sandbox.productBlocks.loadingEllipsis"):n("sandbox.productBlocks.productWithId",{id:t})),e[29]=t,e[30]=l,e[31]=r?.label,e[32]=n,e[33]=w):w=e[33];let T;e[34]!==w?(T=s.jsx("p",{className:"line-clamp-2 text-xs leading-tight text-foreground",children:w}),e[34]=w,e[35]=T):T=e[35];let L;e[36]!==t||e[37]!==n?(L=n("sandbox.productBlocks.idLabel",{id:t}),e[36]=t,e[37]=n,e[38]=L):L=e[38];let P;e[39]!==L?(P=s.jsx("p",{className:"text-[11px] text-muted-foreground",children:L}),e[39]=L,e[40]=P):P=e[40];let I;e[41]!==T||e[42]!==P?(I=s.jsxs("div",{className:"flex flex-col gap-0.5 p-2",children:[T,P]}),e[41]=T,e[42]=P,e[43]=I):I=e[43];let _;return e[44]!==f||e[45]!==B||e[46]!==I||e[47]!==a||e[48]!==p?(_=s.jsxs("div",{ref:f,style:a,className:p,children:[B,I]}),e[44]=f,e[45]=B,e[46]=I,e[47]=a,e[48]=p,e[49]=_):_=e[49],_}function xs(u){const e=$.c(21),{ids:t,lookup:r,onReorder:l,onRemove:o}=u;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={activationConstraint:{distance:6}},e[0]=n):n=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={coordinateGetter:Ge},e[1]=i):i=e[1];const d=qe(me(He,n),me(Ue,i));let c;e[2]!==t||e[3]!==l?(c=a=>{const{active:m,over:p}=a;if(!p||m.id===p.id)return;const h=t.indexOf(String(m.id)),v=t.indexOf(String(p.id));h===-1||v===-1||l(Ve(t,h,v))},e[2]=t,e[3]=l,e[4]=c):c=e[4];const f=c;let b;if(e[5]!==t||e[6]!==r||e[7]!==o){let a;e[9]!==r||e[10]!==o?(a=m=>s.jsx(ps,{id:m,option:r.byId.get(m),loading:r.isLoading&&!r.byId.get(m),onRemove:()=>o(m)},m),e[9]=r,e[10]=o,e[11]=a):a=e[11],b=t.map(a),e[5]=t,e[6]=r,e[7]=o,e[8]=b}else b=e[8];let g;e[12]!==b?(g=s.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:b}),e[12]=b,e[13]=g):g=e[13];let x;e[14]!==t||e[15]!==g?(x=s.jsx(Ke,{items:t,strategy:St,children:g}),e[14]=t,e[15]=g,e[16]=x):x=e[16];let y;return e[17]!==f||e[18]!==d||e[19]!==x?(y=s.jsx(Ye,{sensors:d,collisionDetection:Je,onDragEnd:f,children:x}),e[17]=f,e[18]=d,e[19]=x,e[20]=y):y=e[20],y}function gs(u){const e=$.c(13),{onBrowse:t}=u,r=D();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("span",{className:"flex h-9 w-9 items-center justify-center rounded-full bg-muted text-muted-foreground",children:s.jsx(Zt,{size:16})}),e[0]=l):l=e[0];let o;e[1]!==r?(o=r("sandbox.productBlocks.addProductsButton"),e[1]=r,e[2]=o):o=e[2];let n;e[3]!==o?(n=s.jsx("span",{className:"text-sm font-medium text-foreground",children:o}),e[3]=o,e[4]=n):n=e[4];let i;e[5]!==r?(i=r("sandbox.productBlocks.addProductsDescription"),e[5]=r,e[6]=i):i=e[6];let d;e[7]!==i?(d=s.jsx("span",{className:"text-xs text-muted-foreground",children:i}),e[7]=i,e[8]=d):d=e[8];let c;return e[9]!==t||e[10]!==n||e[11]!==d?(c=s.jsxs("button",{type:"button",onClick:t,className:"flex w-full flex-col items-center justify-center gap-1.5 rounded-lg border border-dashed py-8 text-center transition-colors hover:border-foreground/30 hover:bg-muted/40 cursor-pointer",children:[l,n,d]}),e[9]=t,e[10]=n,e[11]=d,e[12]=c):c=e[12],c}function hs(u){const e=$.c(30),{ids:t,onChange:r}=u,l=D();let o;e[0]!==t||e[1]!==r?(o=(m,p)=>r(t.map((h,v)=>v===m?p:h)),e[0]=t,e[1]=r,e[2]=o):o=e[2];const n=o;let i;e[3]!==l?(i=l("sandbox.productBlocks.vtexProductIds"),e[3]=l,e[4]=i):i=e[4];let d;e[5]!==i?(d=s.jsx(fe,{className:"text-xs text-muted-foreground",children:i}),e[5]=i,e[6]=d):d=e[6];let c;e[7]!==t.length||e[8]!==l?(c=t.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:l("sandbox.productBlocks.startDevServerDescription")}),e[7]=t.length,e[8]=l,e[9]=c):c=e[9];let f;e[10]!==t||e[11]!==r||e[12]!==n||e[13]!==l?(f=t.map((m,p)=>s.jsxs("li",{className:"group/item flex items-center gap-3",children:[s.jsx("input",{value:m,onChange:h=>n(p,h.target.value),placeholder:l("sandbox.productBlocks.skuIdPlaceholder"),className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),s.jsx(ae,{label:l("sandbox.productBlocks.removeProductIdButton"),onClick:()=>r(t.filter((h,v)=>v!==p))})]},p)),e[10]=t,e[11]=r,e[12]=n,e[13]=l,e[14]=f):f=e[14];let b;e[15]!==f?(b=s.jsx("ul",{className:"space-y-2",children:f}),e[15]=f,e[16]=b):b=e[16];let g;e[17]!==l?(g=l("sandbox.productBlocks.addProductIdButton"),e[17]=l,e[18]=g):g=e[18];let x;e[19]!==t||e[20]!==r?(x=()=>r([...t,""]),e[19]=t,e[20]=r,e[21]=x):x=e[21];let y;e[22]!==g||e[23]!==x?(y=s.jsx(ce,{label:g,onClick:x}),e[22]=g,e[23]=x,e[24]=y):y=e[24];let a;return e[25]!==d||e[26]!==c||e[27]!==b||e[28]!==y?(a=s.jsxs("div",{className:"space-y-2",children:[d,c,b,y]}),e[25]=d,e[26]=c,e[27]=b,e[28]=y,e[29]=a):a=e[29],a}function bs(u){const e=$.c(32),{block:t,onChange:r,sandboxRef:l}=u,o=D();let n,i;e[0]!==t.products?(n=bt(t.products),i=new Set(n.filter(Boolean)),e[0]=t.products,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let d;e[3]!==i?(d=[...i],e[3]=i,e[4]=d):d=e[4];const c=d,[f,b]=G.useState(!1),g=xt(l,c);let x;e[5]!==t||e[6]!==r?(x=k=>r({...t,products:yt(t.products,k)}),e[5]=t,e[6]=r,e[7]=x):x=e[7];const y=x;let a;e[8]!==t.title?(a=R(t.title),e[8]=t.title,e[9]=a):a=e[9];let m;e[10]!==t||e[11]!==r?(m=k=>r({...t,title:k}),e[10]=t,e[11]=r,e[12]=m):m=e[12];let p;e[13]!==a||e[14]!==m?(p=s.jsx(ms,{value:a,onChange:m}),e[13]=a,e[14]=m,e[15]=p):p=e[15];let h;e[16]!==c||e[17]!==g||e[18]!==n||e[19]!==l||e[20]!==y||e[21]!==o?(h=l?s.jsxs("div",{className:"space-y-3",children:[c.length>0&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("span",{className:"text-xs font-medium text-muted-foreground",children:[c.length," ",o(c.length===1?"sandbox.productBlocks.productSingular":"sandbox.productBlocks.productPlural")]}),s.jsx(Nt,{label:o("sandbox.productBlocks.browseProductsButton"),onClick:()=>b(!0)})]}),c.length===0?s.jsx(gs,{onBrowse:()=>b(!0)}):s.jsx(xs,{ids:c,lookup:g,onReorder:y,onRemove:k=>y(c.filter(j=>j!==k))})]}):s.jsx(hs,{ids:n,onChange:y}),e[16]=c,e[17]=g,e[18]=n,e[19]=l,e[20]=y,e[21]=o,e[22]=h):h=e[22];let v;e[23]!==c||e[24]!==f||e[25]!==l||e[26]!==y?(v=l&&s.jsx(kt,{open:f,onOpenChange:b,sandboxRef:l,selectedIds:c,onChange:y}),e[23]=c,e[24]=f,e[25]=l,e[26]=y,e[27]=v):v=e[27];let N;return e[28]!==p||e[29]!==h||e[30]!==v?(N=s.jsxs("div",{className:"space-y-4 rounded-lg border bg-card p-4",children:[p,h,v]}),e[28]=p,e[29]=h,e[30]=v,e[31]=N):N=e[31],N}function ys(u){const e=$.c(27),{id:t,option:r,loading:l,onRemove:o}=u,n=D();let i;e[0]!==l||e[1]!==r?(i=s.jsx(Ct,{option:r,loading:l,className:"h-11 w-11 shrink-0 rounded",iconSize:16}),e[0]=l,e[1]=r,e[2]=i):i=e[2];let d;e[3]!==t||e[4]!==l||e[5]!==r?.label||e[6]!==n?(d=r?.label??(l?n("sandbox.productBlocks.loadingEllipsis"):n("sandbox.productBlocks.productWithId",{id:t})),e[3]=t,e[4]=l,e[5]=r?.label,e[6]=n,e[7]=d):d=e[7];let c;e[8]!==d?(c=s.jsx("p",{className:"truncate text-sm text-foreground",children:d}),e[8]=d,e[9]=c):c=e[9];let f;e[10]!==t||e[11]!==n?(f=n("sandbox.productBlocks.idLabel",{id:t}),e[10]=t,e[11]=n,e[12]=f):f=e[12];let b;e[13]!==f?(b=s.jsx("p",{className:"text-xs text-muted-foreground",children:f}),e[13]=f,e[14]=b):b=e[14];let g;e[15]!==c||e[16]!==b?(g=s.jsxs("div",{className:"min-w-0 flex-1",children:[c,b]}),e[15]=c,e[16]=b,e[17]=g):g=e[17];let x;e[18]!==n?(x=n("sandbox.productBlocks.removeProductButton"),e[18]=n,e[19]=x):x=e[19];let y;e[20]!==o||e[21]!==x?(y=s.jsx(ae,{label:x,onClick:o}),e[20]=o,e[21]=x,e[22]=y):y=e[22];let a;return e[23]!==i||e[24]!==g||e[25]!==y?(a=s.jsxs("div",{className:"group/item flex items-center gap-3 rounded-md border bg-background p-2",children:[i,g,y]}),e[23]=i,e[24]=g,e[25]=y,e[26]=a):a=e[26],a}function vs(u){const e=$.c(78),{block:t,onChange:r,sandboxRef:l}=u,o=D();let n;e[0]!==t.product?(n=bt(t.product).filter(Boolean)[0]??"",e[0]=t.product,e[1]=n):n=e[1];const i=n,[d,c]=G.useState(!1);let f;e[2]!==i?(f=i?[i]:[],e[2]=i,e[3]=f):f=e[3];const b=xt(l,f);let g;e[4]!==t||e[5]!==r?(g=A=>r({...t,product:yt(t.product,A)}),e[4]=t,e[5]=r,e[6]=g):g=e[6];const x=g;let y;e[7]!==o?(y=o("sandbox.productBlocks.productCardLabel"),e[7]=o,e[8]=y):y=e[8];let a;e[9]!==y?(a=s.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:y}),e[9]=y,e[10]=a):a=e[10];let m;e[11]!==o?(m=o("sandbox.productBlocks.ctaLabelField"),e[11]=o,e[12]=m):m=e[12];let p;e[13]!==m?(p=s.jsx(fe,{htmlFor:"product-card-cta",className:"text-xs text-muted-foreground",children:m}),e[13]=m,e[14]=p):p=e[14];let h;e[15]!==t.textCta?(h=R(t.textCta),e[15]=t.textCta,e[16]=h):h=e[16];let v;e[17]!==t||e[18]!==r?(v=A=>r({...t,textCta:A.target.value}),e[17]=t,e[18]=r,e[19]=v):v=e[19];let N;e[20]!==o?(N=o("sandbox.productBlocks.ctaLabelPlaceholder"),e[20]=o,e[21]=N):N=e[21];let k;e[22]!==N||e[23]!==h||e[24]!==v?(k=s.jsx("input",{id:"product-card-cta",value:h,onChange:v,placeholder:N,className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[22]=N,e[23]=h,e[24]=v,e[25]=k):k=e[25];let j;e[26]!==k||e[27]!==p?(j=s.jsxs("div",{className:"space-y-2",children:[p,k]}),e[26]=k,e[27]=p,e[28]=j):j=e[28];let C;e[29]!==o?(C=o("sandbox.productBlocks.productSlugField"),e[29]=o,e[30]=C):C=e[30];let S;e[31]!==C?(S=s.jsx(fe,{htmlFor:"product-card-slug",className:"text-xs text-muted-foreground",children:C}),e[31]=C,e[32]=S):S=e[32];let B;e[33]!==t.productSlug?(B=R(t.productSlug),e[33]=t.productSlug,e[34]=B):B=e[34];let w;e[35]!==t||e[36]!==r?(w=A=>r({...t,productSlug:A.target.value}),e[35]=t,e[36]=r,e[37]=w):w=e[37];let T;e[38]!==o?(T=o("sandbox.productBlocks.productSlugPlaceholder"),e[38]=o,e[39]=T):T=e[39];let L;e[40]!==B||e[41]!==w||e[42]!==T?(L=s.jsx("input",{id:"product-card-slug",value:B,onChange:w,placeholder:T,className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[40]=B,e[41]=w,e[42]=T,e[43]=L):L=e[43];let P;e[44]!==S||e[45]!==L?(P=s.jsxs("div",{className:"space-y-2",children:[S,L]}),e[44]=S,e[45]=L,e[46]=P):P=e[46];let I;e[47]!==o?(I=o("sandbox.productBlocks.productField"),e[47]=o,e[48]=I):I=e[48];let _;e[49]!==I?(_=s.jsx(fe,{className:"text-xs text-muted-foreground",children:I}),e[49]=I,e[50]=_):_=e[50];let z;e[51]!==i||e[52]!==l||e[53]!==o?(z=l&&i&&s.jsx(Nt,{label:o("sandbox.productBlocks.changeButton"),onClick:()=>c(!0)}),e[51]=i,e[52]=l,e[53]=o,e[54]=z):z=e[54];let U;e[55]!==_||e[56]!==z?(U=s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[_,z]}),e[55]=_,e[56]=z,e[57]=U):U=e[57];let J;e[58]!==b||e[59]!==i||e[60]!==l||e[61]!==x||e[62]!==o?(J=l?i?s.jsx(ys,{id:i,option:b.byId.get(i),loading:b.isLoading,onRemove:()=>x([])}):s.jsxs("button",{type:"button",onClick:()=>c(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed py-3 text-sm text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground cursor-pointer",children:[s.jsx(he,{size:14}),o("sandbox.productBlocks.chooseProductButton")]}):s.jsx("input",{value:i,onChange:A=>x(A.target.value?[A.target.value]:[]),placeholder:o("sandbox.productBlocks.vtexProductIdPlaceholder"),className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[58]=b,e[59]=i,e[60]=l,e[61]=x,e[62]=o,e[63]=J):J=e[63];let W;e[64]!==U||e[65]!==J?(W=s.jsxs("div",{className:"space-y-2",children:[U,J]}),e[64]=U,e[65]=J,e[66]=W):W=e[66];let q;e[67]!==d||e[68]!==i||e[69]!==l||e[70]!==x?(q=l&&s.jsx(kt,{open:d,onOpenChange:c,sandboxRef:l,selectedIds:i?[i]:[],onChange:x,multiple:!1}),e[67]=d,e[68]=i,e[69]=l,e[70]=x,e[71]=q):q=e[71];let V;return e[72]!==j||e[73]!==P||e[74]!==W||e[75]!==q||e[76]!==a?(V=s.jsxs("div",{className:"space-y-4 rounded-lg border bg-card p-4",children:[a,j,P,W,q]}),e[72]=j,e[73]=P,e[74]=W,e[75]=q,e[76]=a,e[77]=V):V=e[77],V}const js=2,ks=2;function Ns(u){return de(u).map(R)}function Cs(u){return de(u).map(e=>Array.isArray(e)?e.map(R):[])}function ze(u){return Array.from({length:u},()=>"")}function Bs(u){const e=$.c(50),{headers:t,rows:r,onChange:l}=u,o=D();let n,i,d,c,f,b,g,x,y;if(e[0]!==t||e[1]!==l||e[2]!==r||e[3]!==o){const w=Ns(t),T=Cs(r),L=w.length===0&&T.length===0;d=L?js:Math.max(w.length,...T.map(ws),1);const P=Array.from({length:d},(A,E)=>w[E]??"");c=L?Array.from({length:ks},()=>ze(d)):T.map(A=>Array.from({length:d},(E,O)=>A[O]??""));let I;e[13]!==l?(I=(A,E)=>l({headers:JSON.stringify(A.some(Ps)?A:[]),rows:JSON.stringify(E)}),e[13]=l,e[14]=I):I=e[14];const _=I,z=(A,E)=>_(P.map((O,Y)=>Y===A?E:O),c),U=(A,E,O)=>_(P,c.map((Y,Q)=>Q===A?Y.map((X,Z)=>Z===E?O:X):Y));i=()=>_(P,[...c,ze(d)]);const J=A=>_(P,c.filter((E,O)=>O!==A));n=()=>_([...P,""],c.map(Ss));const W=A=>_(P.filter((E,O)=>O!==A),c.map(E=>E.filter((O,Y)=>Y!==A)));y="space-y-2",x="overflow-x-auto rounded-lg border",b="w-full border-collapse";let q;e[15]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx("th",{className:"w-8 border-b"}),e[15]=q):q=e[15];const V=s.jsxs("tr",{className:"bg-muted/40",children:[P.map((A,E)=>s.jsxs("th",{className:"group/col relative border-b border-r p-0 last:border-r-0",children:[s.jsx("input",{value:A,onChange:O=>z(E,O.target.value),placeholder:o("sandbox.tableBlock.headerPlaceholder",{n:E+1}),className:"w-full border-0 bg-transparent py-2 pl-7 pr-3 text-xs font-semibold uppercase tracking-wide outline-none placeholder:text-muted-foreground/40 focus:bg-background focus:ring-0"}),d>1&&s.jsx("button",{type:"button","aria-label":o("sandbox.tableBlock.removeColumn",{n:E+1}),onClick:()=>W(E),className:"absolute left-0.5 top-1/2 flex h-5 w-5 -translate-y-1/2 items-center justify-center text-muted-foreground/50 opacity-0 transition-opacity hover:text-destructive group-hover/col:opacity-100 cursor-pointer rounded-lg",children:s.jsx(Ce,{size:12})})]},E)),q]});e[16]!==V?(g=s.jsx("thead",{children:V}),e[16]=V,e[17]=g):g=e[17],f=c.map((A,E)=>s.jsxs("tr",{className:"group/item border-b last:border-b-0",children:[A.map((O,Y)=>s.jsx("td",{className:"border-r p-0 last:border-r-0",children:s.jsx("input",{value:O,onChange:Q=>U(E,Y,Q.target.value),placeholder:"—",className:"w-full border-0 bg-transparent px-3 py-2 text-sm outline-none placeholder:text-muted-foreground/30 focus:bg-muted/30 focus:ring-0"})},Y)),s.jsx("td",{className:"w-8 text-center align-middle",children:c.length>1&&s.jsx("button",{type:"button","aria-label":o("sandbox.tableBlock.removeRow",{n:E+1}),onClick:()=>J(E),className:"flex h-6 w-6 items-center justify-center text-muted-foreground/60 opacity-0 transition-opacity hover:text-destructive group-hover/item:opacity-100 cursor-pointer rounded-lg",children:s.jsx(Ce,{size:13})})})]},E)),e[0]=t,e[1]=l,e[2]=r,e[3]=o,e[4]=n,e[5]=i,e[6]=d,e[7]=c,e[8]=f,e[9]=b,e[10]=g,e[11]=x,e[12]=y}else n=e[4],i=e[5],d=e[6],c=e[7],f=e[8],b=e[9],g=e[10],x=e[11],y=e[12];let a;e[18]!==d||e[19]!==c.length||e[20]!==o?(a=c.length===0&&s.jsx("tr",{children:s.jsx("td",{colSpan:d+1,className:"px-3 py-4 text-center text-xs text-muted-foreground",children:o("sandbox.tableBlock.noRowsYet")})}),e[18]=d,e[19]=c.length,e[20]=o,e[21]=a):a=e[21];let m;e[22]!==f||e[23]!==a?(m=s.jsxs("tbody",{children:[f,a]}),e[22]=f,e[23]=a,e[24]=m):m=e[24];let p;e[25]!==b||e[26]!==g||e[27]!==m?(p=s.jsxs("table",{className:b,children:[g,m]}),e[25]=b,e[26]=g,e[27]=m,e[28]=p):p=e[28];let h;e[29]!==x||e[30]!==p?(h=s.jsx("div",{className:x,children:p}),e[29]=x,e[30]=p,e[31]=h):h=e[31];let v;e[32]!==o?(v=o("sandbox.tableBlock.addRow"),e[32]=o,e[33]=v):v=e[33];let N;e[34]!==i||e[35]!==v?(N=s.jsx(ce,{label:v,onClick:i}),e[34]=i,e[35]=v,e[36]=N):N=e[36];let k;e[37]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Se,{size:13}),e[37]=k):k=e[37];let j;e[38]!==o?(j=o("sandbox.tableBlock.addColumn"),e[38]=o,e[39]=j):j=e[39];let C;e[40]!==n||e[41]!==j?(C=s.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-1.5 rounded-lg border border-dashed px-2.5 py-1.5 text-xs text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground cursor-pointer",children:[k,j]}),e[40]=n,e[41]=j,e[42]=C):C=e[42];let S;e[43]!==N||e[44]!==C?(S=s.jsxs("div",{className:"flex gap-2",children:[N,C]}),e[43]=N,e[44]=C,e[45]=S):S=e[45];let B;return e[46]!==S||e[47]!==y||e[48]!==h?(B=s.jsxs("div",{className:y,children:[h,S]}),e[46]=S,e[47]=y,e[48]=h,e[49]=B):B=e[49],B}function Ss(u){return[...u,""]}function Ps(u){return u.trim()!==""}function ws(u){return u.length}function _s(u){const e=$.c(190),{block:t,meta:r,onChange:l,decofile:o,sandboxRef:n}=u,i=D(),d=t.__resolveType??"",c=_t(d);if(Tt(d))switch(c){case"Paragraph":{let a;e[0]!==t.html?(a=R(t.html),e[0]=t.html,e[1]=a):a=e[1];let m;e[2]!==i?(m=i("sandbox.blockRegistry.writeSomethingPlaceholder"),e[2]=i,e[3]=m):m=e[3];let p;e[4]!==t||e[5]!==l?(p=v=>l({...t,html:v}),e[4]=t,e[5]=l,e[6]=p):p=e[6];let h;return e[7]!==o||e[8]!==n||e[9]!==a||e[10]!==m||e[11]!==p?(h=s.jsx(Il,{html:a,placeholder:m,onChange:p,decofile:o,sandboxRef:n}),e[7]=o,e[8]=n,e[9]=a,e[10]=m,e[11]=p,e[12]=h):h=e[12],h}case"Heading":{let a;e[13]!==t.text?(a=R(t.text),e[13]=t.text,e[14]=a):a=e[14];let m;e[15]!==t.level?(m=R(t.level),e[15]=t.level,e[16]=m):m=e[16];let p;e[17]!==t||e[18]!==l?(p=v=>l({...t,...v}),e[17]=t,e[18]=l,e[19]=p):p=e[19];let h;return e[20]!==a||e[21]!==m||e[22]!==p?(h=s.jsx(Dl,{text:a,level:m,onChange:p}),e[20]=a,e[21]=m,e[22]=p,e[23]=h):h=e[23],h}case"Quote":{let a;e[24]!==t.quote?(a=R(t.quote),e[24]=t.quote,e[25]=a):a=e[25];let m;e[26]!==t||e[27]!==l?(m=h=>l({...t,quote:h}),e[26]=t,e[27]=l,e[28]=m):m=e[28];let p;return e[29]!==a||e[30]!==m?(p=s.jsx(Ol,{quote:a,onChange:m}),e[29]=a,e[30]=m,e[31]=p):p=e[31],p}case"Code":{let a;e[32]!==t.code?(a=R(t.code),e[32]=t.code,e[33]=a):a=e[33];let m;e[34]!==t.language?(m=R(t.language),e[34]=t.language,e[35]=m):m=e[35];let p;e[36]!==t||e[37]!==l?(p=v=>l({...t,...v}),e[36]=t,e[37]=l,e[38]=p):p=e[38];let h;return e[39]!==a||e[40]!==m||e[41]!==p?(h=s.jsx(zl,{code:a,language:m,onChange:p}),e[39]=a,e[40]=m,e[41]=p,e[42]=h):h=e[42],h}case"List":{let a;e[43]!==t.items?(a=R(t.items),e[43]=t.items,e[44]=a):a=e[44];let m;e[45]!==t.style?(m=R(t.style),e[45]=t.style,e[46]=m):m=e[46];let p;e[47]!==t||e[48]!==l?(p=v=>l({...t,...v}),e[47]=t,e[48]=l,e[49]=p):p=e[49];let h;return e[50]!==a||e[51]!==m||e[52]!==p?(h=s.jsx(Hl,{items:a,style:m,onChange:p}),e[50]=a,e[51]=m,e[52]=p,e[53]=h):h=e[53],h}case"BlockImage":{let a;return e[54]!==t||e[55]!==l?(a=s.jsx(Gl,{block:t,onChange:l}),e[54]=t,e[55]=l,e[56]=a):a=e[56],a}case"Video":{let a;e[57]!==t.url?(a=R(t.url),e[57]=t.url,e[58]=a):a=e[58];let m;e[59]!==t.caption?(m=R(t.caption),e[59]=t.caption,e[60]=m):m=e[60];let p;e[61]!==t||e[62]!==l?(p=v=>l({...t,...v}),e[61]=t,e[62]=l,e[63]=p):p=e[63];let h;return e[64]!==a||e[65]!==m||e[66]!==p?(h=s.jsx(Kl,{url:a,caption:m,onChange:p}),e[64]=a,e[65]=m,e[66]=p,e[67]=h):h=e[67],h}case"Divider":{let a;return e[68]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Yl,{}),e[68]=a):a=e[68],a}case"Cta":{let a;e[69]!==t.text?(a=R(t.text),e[69]=t.text,e[70]=a):a=e[70];let m;e[71]!==t.href?(m=R(t.href),e[71]=t.href,e[72]=m):m=e[72];let p;e[73]!==t||e[74]!==l?(p=v=>l({...t,...v}),e[73]=t,e[74]=l,e[75]=p):p=e[75];let h;return e[76]!==a||e[77]!==m||e[78]!==p?(h=s.jsx(Jl,{text:a,href:m,onChange:p}),e[76]=a,e[77]=m,e[78]=p,e[79]=h):h=e[79],h}case"Callout":{let a;e[80]!==t.title?(a=R(t.title),e[80]=t.title,e[81]=a):a=e[81];let m;e[82]!==t.body?(m=R(t.body),e[82]=t.body,e[83]=m):m=e[83];let p;e[84]!==t.variant?(p=R(t.variant),e[84]=t.variant,e[85]=p):p=e[85];let h;e[86]!==t||e[87]!==l?(h=N=>l({...t,...N}),e[86]=t,e[87]=l,e[88]=h):h=e[88];let v;return e[89]!==a||e[90]!==m||e[91]!==p||e[92]!==h?(v=s.jsx(Wl,{title:a,body:m,variant:p,onChange:h}),e[89]=a,e[90]=m,e[91]=p,e[92]=h,e[93]=v):v=e[93],v}case"Stat":{let a;e[94]!==t.value?(a=R(t.value),e[94]=t.value,e[95]=a):a=e[95];let m;e[96]!==t.label?(m=R(t.label),e[96]=t.label,e[97]=m):m=e[97];let p;e[98]!==t.description?(p=R(t.description),e[98]=t.description,e[99]=p):p=e[99];let h;e[100]!==t||e[101]!==l?(h=N=>l({...t,...N}),e[100]=t,e[101]=l,e[102]=h):h=e[102];let v;return e[103]!==a||e[104]!==m||e[105]!==p||e[106]!==h?(v=s.jsx(Ql,{value:a,label:m,description:p,onChange:h}),e[103]=a,e[104]=m,e[105]=p,e[106]=h,e[107]=v):v=e[107],v}case"StatGroup":{let a;e[108]!==t.stats?(a=ie(t.stats),e[108]=t.stats,e[109]=a):a=e[109];let m;e[110]!==t||e[111]!==l?(m=h=>l({...t,stats:h}),e[110]=t,e[111]=l,e[112]=m):m=e[112];let p;return e[113]!==a||e[114]!==m?(p=s.jsx(es,{stats:a,onChange:m}),e[113]=a,e[114]=m,e[115]=p):p=e[115],p}case"CardGroup":{let a;e[116]!==t.cards?(a=ie(t.cards),e[116]=t.cards,e[117]=a):a=e[117];let m;e[118]!==t||e[119]!==l?(m=h=>l({...t,cards:h}),e[118]=t,e[119]=l,e[120]=m):m=e[120];let p;return e[121]!==a||e[122]!==m?(p=s.jsx(Xl,{cards:a,onChange:m}),e[121]=a,e[122]=m,e[123]=p):p=e[123],p}case"Checklist":{let a;e[124]!==t.title?(a=R(t.title),e[124]=t.title,e[125]=a):a=e[125];let m;e[126]!==t.items?(m=ie(t.items),e[126]=t.items,e[127]=m):m=e[127];let p;e[128]!==t||e[129]!==l?(p=v=>l({...t,...v}),e[128]=t,e[129]=l,e[130]=p):p=e[130];let h;return e[131]!==a||e[132]!==m||e[133]!==p?(h=s.jsx(Zl,{title:a,items:m,onChange:p}),e[131]=a,e[132]=m,e[133]=p,e[134]=h):h=e[134],h}case"Steps":{let a;e[135]!==t.title?(a=R(t.title),e[135]=t.title,e[136]=a):a=e[136];let m;e[137]!==t.steps?(m=ie(t.steps),e[137]=t.steps,e[138]=m):m=e[138];let p;e[139]!==t||e[140]!==l?(p=v=>l({...t,...v}),e[139]=t,e[140]=l,e[141]=p):p=e[141];let h;return e[142]!==a||e[143]!==m||e[144]!==p?(h=s.jsx(ts,{title:a,steps:m,onChange:p}),e[142]=a,e[143]=m,e[144]=p,e[145]=h):h=e[145],h}case"Comparison":{let a;e[146]!==t.left?(a=ie(t.left,{}),e[146]=t.left,e[147]=a):a=e[147];let m;e[148]!==t.right?(m=ie(t.right,{}),e[148]=t.right,e[149]=m):m=e[149];let p;e[150]!==t||e[151]!==l?(p=v=>l({...t,...v}),e[150]=t,e[151]=l,e[152]=p):p=e[152];let h;return e[153]!==a||e[154]!==m||e[155]!==p?(h=s.jsx(ls,{left:a,right:m,onChange:p}),e[153]=a,e[154]=m,e[155]=p,e[156]=h):h=e[156],h}case"Table":{let a;e[157]!==t.headers?(a=ie(t.headers),e[157]=t.headers,e[158]=a):a=e[158];let m;e[159]!==t.rows?(m=ie(t.rows),e[159]=t.rows,e[160]=m):m=e[160];let p;e[161]!==t||e[162]!==l?(p=v=>l({...t,...v}),e[161]=t,e[162]=l,e[163]=p):p=e[163];let h;return e[164]!==a||e[165]!==m||e[166]!==p?(h=s.jsx(Bs,{headers:a,rows:m,onChange:p}),e[164]=a,e[165]=m,e[166]=p,e[167]=h):h=e[167],h}case"ProductCard":{let a;return e[168]!==t||e[169]!==l||e[170]!==n?(a=s.jsx(vs,{block:t,onChange:l,sandboxRef:n}),e[168]=t,e[169]=l,e[170]=n,e[171]=a):a=e[171],a}case"ProductShelf":{let a;return e[172]!==t||e[173]!==l||e[174]!==n?(a=s.jsx(bs,{block:t,onChange:l,sandboxRef:n}),e[172]=t,e[173]=l,e[174]=n,e[175]=a):a=e[175],a}}let b;e[176]!==r||e[177]!==d?(b=d?Qt(d,r):null,e[176]=r,e[177]=d,e[178]=b):b=e[178];const g=b;if(!g){const a=d??"";let m;e[179]!==i||e[180]!==a?(m=i("sandbox.blockRegistry.unknownBlockType",{type:a}),e[179]=i,e[180]=a,e[181]=m):m=e[181];let p;return e[182]!==m?(p=s.jsx("p",{className:"text-xs text-muted-foreground",children:m}),e[182]=m,e[183]=p):p=e[183],p}let x;e[184]!==l?(x=a=>l(a),e[184]=l,e[185]=x):x=e[185];let y;return e[186]!==t||e[187]!==g||e[188]!==x?(y=s.jsx(Jt,{schema:g,value:t,onChange:x,basePath:""}),e[186]=t,e[187]=g,e[188]=x,e[189]=y):y=e[189],y}function Ts(u){const e=$.c(44),{id:t,block:r,meta:l,onChange:o,onDelete:n,onDuplicate:i,decofile:d,sandboxRef:c}=u,f=D();let b;e[0]!==t?(b={id:t},e[0]=t,e[1]=b):b=e[1];const{attributes:g,listeners:x,setNodeRef:y,transform:a,transition:m,isDragging:p}=We(b);let h;e[2]!==a?(h=Qe.Transform.toString(a),e[2]=a,e[3]=h):h=e[3];let v;e[4]!==h||e[5]!==m?(v={transform:h,transition:m},e[4]=h,e[5]=m,e[6]=v):v=e[6];const N=p&&"opacity-50";let k;e[7]!==N?(k=te("group/row relative rounded-md py-1.5 pl-12 pr-2 transition-colors hover:bg-muted/40",N),e[7]=N,e[8]=k):k=e[8];let j;e[9]!==f?(j=f("sandbox.blockRow.dragToReorder"),e[9]=f,e[10]=j):j=e[10];let C;e[11]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(tt,{size:14}),e[11]=C):C=e[11];let S;e[12]!==g||e[13]!==x||e[14]!==j?(S=s.jsx("button",{type:"button","aria-label":j,className:"absolute left-1 top-1.5 flex h-6 w-6 cursor-grab items-center justify-center text-muted-foreground opacity-0 transition-opacity hover:bg-muted hover:text-foreground active:cursor-grabbing group-hover/row:opacity-100 rounded-lg",...g,...x,children:C}),e[12]=g,e[13]=x,e[14]=j,e[15]=S):S=e[15];let B;e[16]!==f?(B=f("sandbox.blockRow.duplicateBlock"),e[16]=f,e[17]=B):B=e[17];let w;e[18]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(Vt,{size:14}),e[18]=w):w=e[18];let T;e[19]!==i||e[20]!==B?(T=s.jsx("button",{type:"button","aria-label":B,onClick:i,className:"flex h-6 w-6 items-center justify-center text-muted-foreground hover:bg-muted hover:text-foreground cursor-pointer rounded-lg",children:w}),e[19]=i,e[20]=B,e[21]=T):T=e[21];let L;e[22]!==f?(L=f("sandbox.blockRow.deleteBlock"),e[22]=f,e[23]=L):L=e[23];let P;e[24]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(Ce,{size:14}),e[24]=P):P=e[24];let I;e[25]!==n||e[26]!==L?(I=s.jsx("button",{type:"button","aria-label":L,onClick:n,className:"flex h-6 w-6 items-center justify-center text-muted-foreground hover:bg-muted hover:text-destructive cursor-pointer rounded-lg",children:P}),e[25]=n,e[26]=L,e[27]=I):I=e[27];let _;e[28]!==T||e[29]!==I?(_=s.jsxs("div",{className:"absolute right-1 top-1 z-10 flex flex-row gap-0.5 rounded-md bg-background/80 opacity-0 backdrop-blur-sm transition-opacity group-hover/row:opacity-100",children:[T,I]}),e[28]=T,e[29]=I,e[30]=_):_=e[30];let z;e[31]!==r||e[32]!==d||e[33]!==l||e[34]!==o||e[35]!==c?(z=s.jsx(_s,{block:r,meta:l,onChange:o,decofile:d,sandboxRef:c}),e[31]=r,e[32]=d,e[33]=l,e[34]=o,e[35]=c,e[36]=z):z=e[36];let U;return e[37]!==y||e[38]!==_||e[39]!==z||e[40]!==v||e[41]!==k||e[42]!==S?(U=s.jsxs("div",{ref:y,style:v,className:k,children:[S,_,z]}),e[37]=y,e[38]=_,e[39]=z,e[40]=v,e[41]=k,e[42]=S,e[43]=U):U=e[43],U}function pe(){return crypto.randomUUID()}function Ls(u){return u.map(e=>({id:pe(),block:e}))}function Is(u,e){return e.map((t,r)=>{const l=u[r];return{id:l?l.id:pe(),block:t}})}function io(u){return Array.isArray(u)?u:[]}function $s(u){const e=$.c(10),{blockTypes:t,onInsert:r}=u,l=D();let o;e[0]!==l?(o=l("sandbox.blockPicker.insertBlockButton"),e[0]=l,e[1]=o):o=e[1];let n;e[2]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("span",{className:"absolute inset-x-10 top-1/2 h-px -translate-y-1/2 bg-primary/30"}),e[2]=n):n=e[2];let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("span",{className:"relative z-10 flex h-5 w-5 items-center justify-center rounded-lg border bg-background text-muted-foreground",children:s.jsx(Se,{size:12})}),e[3]=i):i=e[3];let d;e[4]!==o?(d=s.jsxs("button",{type:"button","aria-label":o,className:"group/ins relative flex h-2.5 w-full items-center justify-center opacity-0 transition-opacity hover:opacity-100 cursor-pointer",children:[n,i]}),e[4]=o,e[5]=d):d=e[5];let c;return e[6]!==t||e[7]!==r||e[8]!==d?(c=s.jsx(ft,{blockTypes:t,onInsert:r,align:"center",children:d}),e[6]=t,e[7]=r,e[8]=d,e[9]=c):c=e[9],c}function ao(u){const e=$.c(72),{value:t,onChange:r,meta:l,decofile:o,sandboxRef:n,emptyMessage:i}=u,d=i===void 0?"No content yet. Add your first block below.":i,c=D();let f;e[0]!==l?(f=Lt(l),e[0]=l,e[1]=f):f=e[1];const b=f;let g;e[2]!==t?(g=()=>Ls(t),e[2]=t,e[3]=g):g=e[3];const[x,y]=G.useState(g),[a,m]=G.useState(t);t!==a&&(m(t),y(Is(x,t)));let p;e[4]!==x?(p=x.map(Rs),e[4]=x,e[5]=p):p=e[5];const h=p;let v;e[6]!==x?(v=x.map(Es),e[6]=x,e[7]=v):v=e[7];const N=v;let k;e[8]!==r?(k=F=>{y(F);const K=F.map(As);m(K),r(K)},e[8]=r,e[9]=k):k=e[9];const j=k;let C;e[10]!==x||e[11]!==j?(C=(F,K)=>{const M=[...x];M.splice(F,0,{id:pe(),block:{__resolveType:K}}),j(M)},e[10]=x,e[11]=j,e[12]=C):C=e[12];const S=C;let B;e[13]!==x||e[14]!==j?(B=(F,K)=>{j(x.map((M,ee)=>ee===F?{...M,block:K}:M))},e[13]=x,e[14]=j,e[15]=B):B=e[15];const w=B;let T;e[16]!==x||e[17]!==j?(T=F=>{j(x.filter((K,M)=>M!==F))},e[16]=x,e[17]=j,e[18]=T):T=e[18];const L=T;let P;e[19]!==x||e[20]!==j?(P=F=>{const K=x[F];if(!K)return;const M=[...x];M.splice(F+1,0,{id:pe(),block:structuredClone(K.block)}),j(M)},e[19]=x,e[20]=j,e[21]=P):P=e[21];const I=P;let _;e[22]===Symbol.for("react.memo_cache_sentinel")?(_={activationConstraint:{distance:6}},e[22]=_):_=e[22];let z;e[23]===Symbol.for("react.memo_cache_sentinel")?(z={coordinateGetter:Ge},e[23]=z):z=e[23];const U=qe(me(He,_),me(Ue,z));let J;e[24]!==x||e[25]!==j?(J=F=>{const{active:K,over:M}=F;if(!M||K.id===M.id)return;const ee=x.findIndex(oe=>oe.id===String(K.id)),H=x.findIndex(oe=>oe.id===String(M.id));ee===-1||H===-1||j(Ve(x,ee,H))},e[24]=x,e[25]=j,e[26]=J):J=e[26];const W=J;let q;if(e[27]!==x||e[28]!==b||e[29]!==o||e[30]!==I||e[31]!==S||e[32]!==l||e[33]!==L||e[34]!==n||e[35]!==w){let F;e[37]!==b||e[38]!==o||e[39]!==I||e[40]!==S||e[41]!==l||e[42]!==L||e[43]!==n||e[44]!==w?(F=(K,M)=>{const{id:ee,block:H}=K;return s.jsxs("div",{children:[s.jsx($s,{blockTypes:b,onInsert:oe=>S(M,oe)}),s.jsx(Ts,{id:ee,block:H,meta:l,onChange:oe=>w(M,oe),onDelete:()=>L(M),onDuplicate:()=>I(M),decofile:o,sandboxRef:n})]},ee)},e[37]=b,e[38]=o,e[39]=I,e[40]=S,e[41]=l,e[42]=L,e[43]=n,e[44]=w,e[45]=F):F=e[45],q=x.map(F),e[27]=x,e[28]=b,e[29]=o,e[30]=I,e[31]=S,e[32]=l,e[33]=L,e[34]=n,e[35]=w,e[36]=q}else q=e[36];let V;e[46]!==h||e[47]!==q?(V=s.jsx(Ke,{items:h,strategy:Pt,children:q}),e[46]=h,e[47]=q,e[48]=V):V=e[48];let A;e[49]!==W||e[50]!==U||e[51]!==V?(A=s.jsx(Ye,{sensors:U,collisionDetection:Je,onDragEnd:W,children:V}),e[49]=W,e[50]=U,e[51]=V,e[52]=A):A=e[52];let E;e[53]!==N.length||e[54]!==d?(E=N.length===0&&s.jsx("p",{className:"px-3 pb-1 pt-2 text-sm text-muted-foreground",children:d}),e[53]=N.length,e[54]=d,e[55]=E):E=e[55];let O;e[56]!==x.length||e[57]!==S?(O=F=>S(x.length,F),e[56]=x.length,e[57]=S,e[58]=O):O=e[58];let Y;e[59]===Symbol.for("react.memo_cache_sentinel")?(Y=s.jsx(Se,{size:16}),e[59]=Y):Y=e[59];let Q;e[60]!==c?(Q=c("sandbox.blockDocument.addBlock"),e[60]=c,e[61]=Q):Q=e[61];let X;e[62]!==Q?(X=s.jsxs("button",{type:"button",className:"mt-1 flex w-full items-center gap-2 rounded-md py-2 pl-14 pr-2 text-sm text-muted-foreground transition-colors hover:bg-muted/40 hover:text-foreground cursor-pointer",children:[Y,Q]}),e[62]=Q,e[63]=X):X=e[63];let Z;e[64]!==b||e[65]!==O||e[66]!==X?(Z=s.jsx(ft,{blockTypes:b,onInsert:O,children:X}),e[64]=b,e[65]=O,e[66]=X,e[67]=Z):Z=e[67];let le;return e[68]!==A||e[69]!==E||e[70]!==Z?(le=s.jsxs("div",{className:"mt-2",children:[A,E,Z]}),e[68]=A,e[69]=E,e[70]=Z,e[71]=le):le=e[71],le}function As(u){return u.block}function Es(u){return u.block}function Rs(u){return u.id}export{ao as B,ut as a,ro as b,io as c,no as d,dt as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as y,r as k,j as f}from"./index-
|
|
1
|
+
import{c as y,r as k,j as f}from"./index-B_jqJjWZ.js";const P={target:null,editSeoPageKey:null,variantOverride:null,focusedBlockKey:null};function m(t,e){switch(e.type){case"select":return{...t,target:e.target,variantOverride:null,editSeoPageKey:null,focusedBlockKey:null};case"edit-seo":return{...t,target:e.target,editSeoPageKey:e.target.key,variantOverride:null,focusedBlockKey:null};case"consume-edit-seo":return{...t,editSeoPageKey:null};case"variant-override":return{...t,variantOverride:e.params};case"focus-block":return{...t,focusedBlockKey:e.key}}}const p=k.createContext(null);function B(t){const e=y.c(10),{children:d}=t,[v,o]=k.useReducer(m,P);let c,l,i,n,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=r=>o({type:"select",target:r}),l=r=>o({type:"edit-seo",target:r}),i=()=>o({type:"consume-edit-seo"}),n=r=>o({type:"variant-override",params:r}),u=r=>o({type:"focus-block",key:r}),e[0]=c,e[1]=l,e[2]=i,e[3]=n,e[4]=u):(c=e[0],l=e[1],i=e[2],n=e[3],u=e[4]);let s;e[5]!==v?(s={state:v,selectTarget:c,editSeo:l,consumeEditSeo:i,setVariantOverride:n,setFocusedBlock:u},e[5]=v,e[6]=s):s=e[6];let a;return e[7]!==d||e[8]!==s?(a=f.jsx(p,{value:s,children:d}),e[7]=d,e[8]=s,e[9]=a):a=e[9],a}function K(){const t=k.use(p);if(!t)throw new Error("useBlocksPreviewWorkspace must be used inside BlocksPreviewWorkspaceProvider");return t}export{B,K as u};
|