decocms 4.516.0 → 4.517.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/{ActiveShapeUtils-BviJ1RJ0.js → ActiveShapeUtils-BB436TvV.js} +1 -1
- package/dist/client/assets/{AlertCircle-BzjzqqRa.js → AlertCircle-Cch634f7.js} +1 -1
- package/dist/client/assets/{AreaChart-DxdfvWkl.js → AreaChart-CpsihjcZ.js} +1 -1
- package/dist/client/assets/{ArrowLeft-D9e74CxD.js → ArrowLeft-CohopnCT.js} +1 -1
- package/dist/client/assets/{ArrowUp-BbhuuuwV.js → ArrowUp-DLUdomd9.js} +1 -1
- package/dist/client/assets/{BarChart-C6YMYkiP.js → BarChart-DC5-aC-9.js} +1 -1
- package/dist/client/assets/{Building02-C2flUGF-.js → Building02-BHJQSDUK.js} +1 -1
- package/dist/client/assets/{CartesianChart-CPZndNAT.js → CartesianChart-dMOiAgfo.js} +1 -1
- package/dist/client/assets/{CategoricalChart-BjLODSSF.js → CategoricalChart-BCAB1JR1.js} +1 -1
- package/dist/client/assets/{CheckCircle-4gdTBGy6.js → CheckCircle-Cs8i9zYt.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-YTUkgDHg.js → ChevronSelectorVertical-C5d75KyY.js} +1 -1
- package/dist/client/assets/{ChevronUp-BnA2Nw_G.js → ChevronUp-BT7eMKPK.js} +1 -1
- package/dist/client/assets/{Copy01-DK6eLr2i.js → Copy01-B341DqLV.js} +1 -1
- package/dist/client/assets/{CreditCard01-CMqZSaqi.js → CreditCard01-4Fwr0tNh.js} +1 -1
- package/dist/client/assets/{DotsVertical-C4UAKneF.js → DotsVertical-DbrlDgFh.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-bVCQsHLU.js → ErrorBarContext-t45nElJh.js} +1 -1
- package/dist/client/assets/{Globe04-DEY1e_cW.js → Globe04-BE6c1UDj.js} +1 -1
- package/dist/client/assets/{Image01-DwBREChx.js → Image01-hTzc15CE.js} +1 -1
- package/dist/client/assets/{Key01-MBTcw2W0.js → Key01-kTu6t6u_.js} +1 -1
- package/dist/client/assets/{Link01-CHLntxrX.js → Link01-hfA48cFL.js} +1 -1
- package/dist/client/assets/{LinkBroken01-CTiL1Fp-.js → LinkBroken01-Dioz3u9i.js} +1 -1
- package/dist/client/assets/{Minus-BCeBycMD.js → Minus-DqDPTtRG.js} +1 -1
- package/dist/client/assets/{Monitor01-DtC0vfP6.js → Monitor01-Bz6QaUO4.js} +1 -1
- package/dist/client/assets/{Play-DV5Ma4c6.js → Play-CByslM3d.js} +1 -1
- package/dist/client/assets/{Plus-CxQiW556.js → Plus-Dewm72je.js} +1 -1
- package/dist/client/assets/{ReferenceLine-CyFWmCIf.js → ReferenceLine-DV9hYxt_.js} +1 -1
- package/dist/client/assets/{SearchMd-CYuw_TlP.js → SearchMd-7Jo0ZofC.js} +1 -1
- package/dist/client/assets/{Sector-7HoHBp31.js → Sector-D64VY8hG.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-hqBb4euZ.js → ShoppingBag01-BStpgW0a.js} +1 -1
- package/dist/client/assets/{Sun-_7OyKm8q.js → Sun-C37Hpdko.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-Ik-Wu8bp.js → SwitchHorizontal01-CrC4ThKg.js} +1 -1
- package/dist/client/assets/{Tool01-CEmvRWh7.js → Tool01-2gJDR0Ho.js} +1 -1
- package/dist/client/assets/{Trash01-7PWQCtvD.js → Trash01-DjE7Raat.js} +1 -1
- package/dist/client/assets/{Upload01-d0p8GdRf.js → Upload01-CYfTR3aZ.js} +1 -1
- package/dist/client/assets/{User01-CvsUVXiw.js → User01-X6IeKYZH.js} +1 -1
- package/dist/client/assets/{UserSquare-CRvybnC2.js → UserSquare-pmxb5ZdZ.js} +1 -1
- package/dist/client/assets/{Users01-BpDVBOEG.js → Users01-uKJoVSle.js} +1 -1
- package/dist/client/assets/{XClose-CjXzVHwC.js → XClose-BVxVAZ6V.js} +1 -1
- package/dist/client/assets/{ZoomOut-CLJKIGNa.js → ZoomOut-DixQygt2.js} +1 -1
- package/dist/client/assets/{access-gate-C_XxaZ28.js → access-gate-BpfEc6VH.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-TX2J4mBu.js → add-connection-dialog-BZwLO1Ja.js} +1 -1
- package/dist/client/assets/agent-analytics-Cb2tda3-.js +1 -0
- package/dist/client/assets/agent-app-HX00w6TV.js +1 -0
- package/dist/client/assets/{agent-assets-DzeNVWVS.js → agent-assets-e6Gk5J-Q.js} +1 -1
- package/dist/client/assets/{agent-automation-fasQYxyE.js → agent-automation-jGwXvC8f.js} +1 -1
- package/dist/client/assets/{agent-automations-CFCWY442.js → agent-automations-DzW1crP1.js} +1 -1
- package/dist/client/assets/agent-calendar-DCHNIRTc.js +1 -0
- package/dist/client/assets/{agent-connect-sources-CUS1mQBU.js → agent-connect-sources-6bCKMOK5.js} +1 -1
- package/dist/client/assets/agent-deck-BV-5B8og.js +1 -0
- package/dist/client/assets/{agent-e2e-JX70_ikL.js → agent-e2e-DwASXEee.js} +1 -1
- package/dist/client/assets/agent-experiments-DetDutY3.js +1 -0
- package/dist/client/assets/agent-file-BvfhZ3mT.js +1 -0
- package/dist/client/assets/{agent-hosting-DXYhe_Ly.js → agent-hosting-BVT3wdCc.js} +1 -1
- package/dist/client/assets/{agent-icon-DhApO92C.js → agent-icon-CiKTiUdq.js} +1 -1
- package/dist/client/assets/agent-library-DSuyqe6T.js +1 -0
- package/dist/client/assets/agent-library-file-B1l2ZLvA.js +1 -0
- package/dist/client/assets/{agent-monitor-DGuiH3_O.js → agent-monitor-C_MtaF0x.js} +1 -1
- package/dist/client/assets/{agent-overview-DGX_nSiA.js → agent-overview-BaJQVLzH.js} +1 -1
- package/dist/client/assets/{agent-releases-B4Wvo_4b.js → agent-releases-rSbadgkl.js} +1 -1
- package/dist/client/assets/agent-settings-DCjo4ZYC.js +1 -0
- package/dist/client/assets/{agent-site-editor-CLwG7od-.js → agent-site-editor-DGIssniL.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-BVwfCzHc.js +2 -0
- package/dist/client/assets/agent-site-editor-content-BU-vFmu-.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-Coo-Ni4u.js +1 -0
- package/dist/client/assets/agent-view-CftHb5tC.js +1 -0
- package/dist/client/assets/{agent-view-guard-wNwTHz77.js → agent-view-guard-Cz_9FSeB.js} +1 -1
- package/dist/client/assets/{agents-list-Cikp_zRW.js → agents-list-BehVRlw8.js} +1 -1
- package/dist/client/assets/{ai-providers-BSKNGjn3.js → ai-providers-Cfzh0dop.js} +1 -1
- package/dist/client/assets/{alert-DK8EW5eY.js → alert-DlpN1nbO.js} +1 -1
- package/dist/client/assets/{alert-dialog--q-PWeut.js → alert-dialog-BdWXpnme.js} +1 -1
- package/dist/client/assets/{analytics-sections-DMQ7rbtm.js → analytics-sections-CBRurMfi.js} +1 -1
- package/dist/client/assets/{analytics-tab-DBS1a1Hh.js → analytics-tab-Bu3yOSFE.js} +1 -1
- package/dist/client/assets/{api-keys-Dq1k7MiZ.js → api-keys-SwcfBYZn.js} +1 -1
- package/dist/client/assets/api-keys-jGYtI-cW.js +1 -0
- package/dist/client/assets/{app-editor-CrjU5dmy.js → app-editor-BzaLO82-.js} +1 -1
- package/dist/client/assets/{asset-utils-DobQJkEL.js → asset-utils-CYj7sEud.js} +1 -1
- package/dist/client/assets/{auth-BCqAeFp3.js → auth-DVebpHI3.js} +1 -1
- package/dist/client/assets/{auth-catchall-BZEwAlpH.js → auth-catchall-CM988zgH.js} +1 -1
- package/dist/client/assets/{auth-entry-Buz4HmC0.js → auth-entry-BM6bA3ji.js} +1 -1
- package/dist/client/assets/{auth-split-layout-C7U-I3vQ.js → auth-split-layout-BnlVBIeL.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-BAReQnW9.js → authenticate-and-persist-oauth-qcbNyaRp.js} +1 -1
- package/dist/client/assets/{automation-list-row-DYoDbKDa.js → automation-list-row-BIlvc0v-.js} +1 -1
- package/dist/client/assets/{automation-runs-DS3JbQ2r.js → automation-runs-jRApvuta.js} +1 -1
- package/dist/client/assets/{automations-DnYOtmr4.js → automations-DMHgje9o.js} +1 -1
- package/dist/client/assets/{autosend-CC_H9WVC.js → autosend-BTx7-p6a.js} +1 -1
- package/dist/client/assets/{avatar-BCxNXTas.js → avatar-DjIkOwsx.js} +1 -1
- package/dist/client/assets/{badge-Ccv2yax2.js → badge-BfMggcm8.js} +1 -1
- package/dist/client/assets/{block-document-pbAqRC0D.js → block-document-DKju3Lsl.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-CAntUw6y.js → blocks-preview-workspace-context-AokvrTWO.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-B-gG8PUG.js → blocks-tab-states-5tpSikld.js} +1 -1
- package/dist/client/assets/{blog-schema-DP6BXJ_v.js → blog-schema-B8hGgOKc.js} +1 -1
- package/dist/client/assets/{buckets-YwJbmX1H.js → buckets-DzW1ArnB.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-yJWFG-Qh.js → build-improve-prompt-doc-BGKe2ED3.js} +1 -1
- package/dist/client/assets/{calendar-CWZHYNsm.js → calendar-kdikRXDO.js} +1 -1
- package/dist/client/assets/{campaigns-view-BJ3dqrez.js → campaigns-view-CXUV2H04.js} +1 -1
- package/dist/client/assets/{capability-load-error-ClFcG_k7.js → capability-load-error-BuC7MxXm.js} +1 -1
- package/dist/client/assets/{category-editor-BdRz9cOQ.js → category-editor-jRguVRoH.js} +1 -1
- package/dist/client/assets/{chart-ecSSTZTh.js → chart-aHPEwhl0.js} +1 -1
- package/dist/client/assets/{chat-context-BE5W0eRy.js → chat-context-BEyCIAaN.js} +1 -1
- package/dist/client/assets/{chat-draft-Bc38hokV.js → chat-draft-Dql_zG1A.js} +1 -1
- package/dist/client/assets/{checkbox-BUQlb_zR.js → checkbox-R6Pm_B33.js} +1 -1
- package/dist/client/assets/{choose-editor-CTk7V5dU.js → choose-editor-C1zV1Fp9.js} +1 -1
- package/dist/client/assets/{cli-auth-success-PigkRVuP.js → cli-auth-success-Dw0y5N0L.js} +1 -1
- package/dist/client/assets/{client-icons-CfYl7gN_.js → client-icons-C_WiAP0u.js} +1 -1
- package/dist/client/assets/cms-settings-editor-BAGntXvx.js +1 -0
- package/dist/client/assets/{collapsible-CUpe_nLN.js → collapsible-BcZaehP2.js} +1 -1
- package/dist/client/assets/{collection-detail-DMeJtWOq.js → collection-detail-AO17C_8B.js} +1 -1
- package/dist/client/assets/{collection-display-button-BA8_qWgd.js → collection-display-button-C0cYhq66.js} +1 -1
- package/dist/client/assets/{collection-search-D3DfnNEj.js → collection-search-7sBPioRN.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BpHyZuIk.js → collection-table-wrapper-BzgZq6u7.js} +1 -1
- package/dist/client/assets/{collection-tabs-BeE9JyBt.js → collection-tabs-DMsbicTn.js} +1 -1
- package/dist/client/assets/{column-rules-HrQ_91De.js → column-rules-CBkHBJjn.js} +1 -1
- package/dist/client/assets/{combobox-pGuSce6D.js → combobox-CEzxugDA.js} +1 -1
- package/dist/client/assets/{command-Due3aGE_.js → command-KmLWWmqo.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-B_r6DOQv.js → companion-mcps-section-vJ3FRpYP.js} +1 -1
- package/dist/client/assets/{config-4MxJL_Fy.js → config-0t8v4_10.js} +1 -1
- package/dist/client/assets/{connect-BmT0JQ1F.js → connect-Ceo_a42v.js} +1 -1
- package/dist/client/assets/{connect-layout-2QgFH1-_.js → connect-layout-DXn91Bwy.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-_wKkm_O5.js → connect-source-dialog-DCA13Vr9.js} +1 -1
- package/dist/client/assets/{connection-z8RZuoJq.js → connection-BXCm7RUN.js} +1 -1
- package/dist/client/assets/{connection-card-CawZtrlG.js → connection-card-DudSxk_f.js} +1 -1
- package/dist/client/assets/{connection-detail-Dm8uTSp4.js → connection-detail-Bzj7ZAYC.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-_rP_t0oA.js → connection-form-helpers-BCgvOrMH.js} +1 -1
- package/dist/client/assets/{connections-DY1nEMCe.js → connections-DZsQ6PqI.js} +1 -1
- package/dist/client/assets/{content-tab-BMyhmLPO.js → content-tab-B8CAyeYn.js} +3 -3
- package/dist/client/assets/{context-Br81mOVA.js → context-Dxx9Nppi.js} +1 -1
- package/dist/client/assets/{context-menu-wXhD1da2.js → context-menu-Bup14w-O.js} +1 -1
- package/dist/client/assets/{context-shell-CSyiGVu3.js → context-shell-YuMc6M7u.js} +3 -3
- package/dist/client/assets/{core.esm-C9O_xZ-F.js → core.esm-BmE_KURk.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-BULehCnN.js → create-organization-dialog-oYjru5bh.js} +1 -1
- package/dist/client/assets/{daily-pulse-Biczsq5_.js → daily-pulse-Cj6zflmn.js} +1 -1
- package/dist/client/assets/{discover-DY6Qihlm.js → discover-BsfuhgQD.js} +1 -1
- package/dist/client/assets/{domain-settings-D_mRu3Vm.js → domain-settings-BCFlmNLU.js} +1 -1
- package/dist/client/assets/{drawer-BXIYbAX4.js → drawer-Bi1-udV5.js} +1 -1
- package/dist/client/assets/{editor-DfNlEhGy.js → editor-DAekV0he.js} +1 -1
- package/dist/client/assets/{editor-classes-BgZFSVD_.js → editor-classes-BaBC2QPU.js} +1 -1
- package/dist/client/assets/{empty-state-DHTpGmzV.js → empty-state-B4dSQMeM.js} +1 -1
- package/dist/client/assets/{empty-state-DK4d2ph4.js → empty-state-wXIjf_EN.js} +1 -1
- package/dist/client/assets/{experiments-tab-Bxbw5NAx.js → experiments-tab-PntzDOfu.js} +1 -1
- package/dist/client/assets/{experiments-tab-choice-Du4Lvv_w.js → experiments-tab-choice-CQ5EsK8h.js} +1 -1
- package/dist/client/assets/{extract-connection-data-9sczZwO0.js → extract-connection-data-Bg9K46Rs.js} +1 -1
- package/dist/client/assets/{feature-gate-b0u-JPA_.js → feature-gate-4u7sb4lR.js} +1 -1
- package/dist/client/assets/{feature-paywall-BarXN_Ju.js → feature-paywall-BsVH1P4Z.js} +1 -1
- package/dist/client/assets/{file-explorer-DnOLSPWJ.js → file-explorer-CsBngoR2.js} +1 -1
- package/dist/client/assets/{file-preview-Cak1nE11.js → file-preview-CVVpAx14.js} +1 -1
- package/dist/client/assets/{file-share-button-kIwp5G-u.js → file-share-button-Dh2OblA7.js} +1 -1
- package/dist/client/assets/{file-type-icon-6tQy_IZ-.js → file-type-icon-DYeFNgMs.js} +1 -1
- package/dist/client/assets/{folder-icon-R5rTkj7V.js → folder-icon-CMfbCZZj.js} +1 -1
- package/dist/client/assets/{form-DuWo7Npn.js → form-BGI3x6he.js} +1 -1
- package/dist/client/assets/{general-Cez86_jx.js → general-AgdwRV2K.js} +1 -1
- package/dist/client/assets/{home-3R5Jmd9M.js → home-B3JLIiqG.js} +1 -1
- package/dist/client/assets/{hosted-publish-api-CReqocob.js → hosted-publish-api-Cg6A3e6a.js} +1 -1
- package/dist/client/assets/{hosted-publish-feedback-BuFauPpC.js → hosted-publish-feedback-R86hK4rw.js} +1 -1
- package/dist/client/assets/{icon-button-DetNbpEP.js → icon-button-Du_O8eku.js} +1 -1
- package/dist/client/assets/{index-DjG04H6F.js → index-BEaGR-Ng.js} +1 -1
- package/dist/client/assets/{index-BdhYTUJI.js → index-BWEksKOa.js} +1 -1
- package/dist/client/assets/{index-CkQE3ies.js → index-BXwVgYyP.js} +1 -1
- package/dist/client/assets/{index-D_jzSCP9.js → index-BeWb3VLq.js} +7 -7
- package/dist/client/assets/{index-BOTs238f.js → index-BflgjdLH.js} +1 -1
- package/dist/client/assets/{index-B0KYQovx.js → index-BliYmmPu.js} +1 -1
- package/dist/client/assets/{index-CRcEuXTH.js → index-BnbMIYQC.js} +1 -1
- package/dist/client/assets/{index-Cl9QwptG.js → index-CEnumkKh.js} +1 -1
- package/dist/client/assets/{index-Nkc_avaN.js → index-CcDpskhn.js} +1 -1
- package/dist/client/assets/{index-DHWYq2vY.js → index-CdhgpKbn.js} +1 -1
- package/dist/client/assets/{index-DppGNDNw.js → index-CkwxAoM4.js} +1 -1
- package/dist/client/assets/{index-C9OicJ74.js → index-CqX2WR0x.js} +1 -1
- package/dist/client/assets/{index-CU2v_61i.js → index-CqllmV-p.js} +1 -1
- package/dist/client/assets/{index-DlAj9KxS.js → index-DVxNOEMj.js} +1 -1
- package/dist/client/assets/{index-DyvCBoQO.js → index-Dw3D39xs.js} +1 -1
- package/dist/client/assets/{index-redirect-ZRzjZAU7.js → index-redirect-BpERt5XK.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-nO7Ij1Gh.js → infiniteQueryObserver-BOCgDRcQ.js} +1 -1
- package/dist/client/assets/{infra-billing-BzKPkpZz.js → infra-billing-443Q4BKf.js} +1 -1
- package/dist/client/assets/{input-BS1vg5HJ.js → input-D1nDj3Gx.js} +3 -3
- package/dist/client/assets/{input---GPY-WG.js → input-D9vH1igB.js} +1 -1
- package/dist/client/assets/{integration-icon-BKkvrbiZ.js → integration-icon-VoZokpOe.js} +1 -1
- package/dist/client/assets/{jira-icon-CNOdA3T8.js → jira-icon-BOD4UX3O.js} +1 -1
- package/dist/client/assets/{label-BHfVaXR7.js → label-TKhfC6jr.js} +1 -1
- package/dist/client/assets/{layout-CDcVgS1C.js → layout-OvvfNrHJ.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-DPDWZmqy.js → legacy-agents-deep-Bj2cFPCz.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-Cg_g45Jd.js → legacy-main-redirect-Y-IABTgs.js} +1 -1
- package/dist/client/assets/library-CEpc5ko6.js +1 -0
- package/dist/client/assets/{login-wOfUg9Nh.js → login-d1G00P7v.js} +1 -1
- package/dist/client/assets/{markdown-Cd88osrX.js → markdown-D_Bab0vD.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-CFMsjvxz.js → mcp-app-renderer-C5DYTOzS.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CReJrypj.js → mcp-oauth-Bv0ymH6e.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DQ_xwjzU.js → mcp-oauth-gJmjFND6.js} +1 -1
- package/dist/client/assets/{members-EL9Mc9m1.js → members-CGCmgk2j.js} +1 -1
- package/dist/client/assets/{memory-BawNPVGj.js → memory-DjHNNPOW.js} +1 -1
- package/dist/client/assets/{mini-report-page-BAVRLfhx.js → mini-report-page-BSYlfSmZ.js} +1 -1
- package/dist/client/assets/{mock-board-CUvkl6Lq.js → mock-board-BCQJ9AHq.js} +3 -3
- package/dist/client/assets/{monaco-editor-q0K0FpZQ.js → monaco-editor-CVRVgXSh.js} +1 -1
- package/dist/client/assets/monitoring-mogv5pNr.js +1 -0
- package/dist/client/assets/{monitoring-stats-row-BsUBQUMM.js → monitoring-stats-row-BEpenrU2.js} +1 -1
- package/dist/client/assets/{multi-select-Db_ThqMQ.js → multi-select-ZwwArowo.js} +1 -1
- package/dist/client/assets/{mustache-Pqeakuud.js → mustache-B20fDMb8.js} +1 -1
- package/dist/client/assets/{named-rule-uses-CocrtMGd.js → named-rule-uses-Bxr3PCeC.js} +1 -1
- package/dist/client/assets/{named-rule-view-DI8em1Ln.js → named-rule-view-pF5yBmDb.js} +1 -1
- package/dist/client/assets/{new-project-dialog-CP7YY3zi.js → new-project-dialog-DfI138Mw.js} +1 -1
- package/dist/client/assets/{oauth-callback-C87YK0QM.js → oauth-callback-C0l4AVA-.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BiPEsxGS.js → oauth-callback-ai-provider-DlpJWGZf.js} +1 -1
- package/dist/client/assets/{onboarding-BkgYJN30.js → onboarding-DMkG4-4M.js} +1 -1
- package/dist/client/assets/{openai-conversation-CMtl-uGo.js → openai-conversation-BcQvnIOU.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-Dfnv2eVq.js → optimistic-project-sidebar-views-CBzXyVUz.js} +1 -1
- package/dist/client/assets/{order-monitor-day-B8b4_NRG.js → order-monitor-day-raWLiT1v.js} +1 -1
- package/dist/client/assets/{organization-choice-D2OqEnT1.js → organization-choice-CSBUJWem.js} +1 -1
- package/dist/client/assets/{orgs-BT5DM-wr.js → orgs-DYr5Iir2.js} +1 -1
- package/dist/client/assets/{page-seo-form-BZ5qz5Jc.js → page-seo-form-C0_Mzxj0.js} +1 -1
- package/dist/client/assets/{pair-CbWxf18N.js → pair-v8_ULhan.js} +1 -1
- package/dist/client/assets/{parse-sections-C-MhwiHZ.js → parse-sections-CigeyiXV.js} +1 -1
- package/dist/client/assets/{plan-DZXfEuaN.js → plan-BYiUi2-G.js} +1 -1
- package/dist/client/assets/{plan-ladder-jDYqtD5Q.js → plan-ladder-CtR99jrd.js} +1 -1
- package/dist/client/assets/{popover-BVmz1c3N.js → popover-s88DXvPL.js} +1 -1
- package/dist/client/assets/{post-calendar-B_8534k5.js → post-calendar-DbUDJn5r.js} +1 -1
- package/dist/client/assets/{post-editor-B2niN_j8.js → post-editor-CdhtoksR.js} +1 -1
- package/dist/client/assets/{preview-content-3uKit-hf.js → preview-content-BNZ95rhM.js} +1 -1
- package/dist/client/assets/{preview-dialog-Du1qcsYi.js → preview-dialog-BZcvH5f1.js} +1 -1
- package/dist/client/assets/{preview-panel-BoHCLryt.js → preview-panel-CjWzxG-O.js} +1 -1
- package/dist/client/assets/{preview-tab-DYBrEyCh.js → preview-tab-ztwq5J9Z.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-DPPSOqIw.js → product-picker-dialog-CecFCJox.js} +1 -1
- package/dist/client/assets/{profile-CkB0-zr4.js → profile-Bo384oXV.js} +1 -1
- package/dist/client/assets/{project-app-view-DXEcNYan.js → project-app-view-C-JC6Lnp.js} +1 -1
- package/dist/client/assets/{project-apps-B5YazmD2.js → project-apps-BQ30Q_BX.js} +1 -1
- package/dist/client/assets/{project-feed-DmjT3iA5.js → project-feed--d7Txdh1.js} +1 -1
- package/dist/client/assets/{project-icon-BsqqQ1nI.js → project-icon-Ds8VtVRG.js} +1 -1
- package/dist/client/assets/project-reports-BRMk8sbv.js +1 -0
- package/dist/client/assets/project-tasks-DPFfk-Co.js +1 -0
- package/dist/client/assets/{projects-Cwzu5Iqo.js → projects-BN_UNvg1.js} +1 -1
- package/dist/client/assets/{projects-empty-state-Br0wajyI.js → projects-empty-state-CmS_yrG7.js} +1 -1
- package/dist/client/assets/{prompts-DIIjyoc9.js → prompts-g_Bby1s0.js} +1 -1
- package/dist/client/assets/record-editor-CmI7uwKH.js +1 -0
- package/dist/client/assets/{redirect-editor-B4oKb1GO.js → redirect-editor-CBEbRvVY.js} +1 -1
- package/dist/client/assets/{releases-api-D9GDZds6.js → releases-api-DbKlRR9w.js} +1 -1
- package/dist/client/assets/reports-BKtNuFy0.js +1 -0
- package/dist/client/assets/{reports-BLHz2f-u.js → reports-Bgmc-lqT.js} +1 -1
- package/dist/client/assets/{reports-onboarding-8l7cEi9O.js → reports-onboarding-D6-A2sL7.js} +1 -1
- package/dist/client/assets/{reports-tab-0lUp3BwL.js → reports-tab-B_Sk2TLl.js} +2 -2
- package/dist/client/assets/repositories-C2vwcNjc.js +1 -0
- package/dist/client/assets/repositories-CszhODTX.js +1 -0
- package/dist/client/assets/{repository-binding-Cl8gyVcv.js → repository-binding-Cf_thK-b.js} +1 -1
- package/dist/client/assets/{repository-import-picker-3obW4oiZ.js → repository-import-picker-BOku3VrR.js} +1 -1
- package/dist/client/assets/repository-picker-CeCsQGv8.js +1 -0
- package/dist/client/assets/{require-capability-NNP8AGk1.js → require-capability-DC_q9Xad.js} +1 -1
- package/dist/client/assets/{required-auth-layout-D4sDIyJ3.js → required-auth-layout-DhxdstQv.js} +1 -1
- package/dist/client/assets/{reset-password-CXaP1BPU.js → reset-password-BCS7WVZ6.js} +1 -1
- package/dist/client/assets/{resizable-DVzR2wEK.js → resizable-BySAwPSW.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-BdFEwYlo.js → resolve-tab-icon-B7CsMGsC.js} +1 -1
- package/dist/client/assets/{review-settings-CQ-ke_sY.js → review-settings-DtZi6zHg.js} +1 -1
- package/dist/client/assets/{roles-CSdPRDeD.js → roles-CGYNn4dv.js} +1 -1
- package/dist/client/assets/{route-CN2nYP-k.js → route-ChD1cXkH.js} +1 -1
- package/dist/client/assets/{route-CGCaN7RC.js → route-ChLLCXC9.js} +1 -1
- package/dist/client/assets/route-_su_B2um.js +1 -0
- package/dist/client/assets/{runnable-block-editor-BCPCXDwB.js → runnable-block-editor-Bod17qTV.js} +3 -3
- package/dist/client/assets/{sandbox-lifecycle-context-D9f3Vvrq.js → sandbox-lifecycle-context-CCjKxqdS.js} +1 -1
- package/dist/client/assets/{schema-DIOdOlgE.js → schema-ClGCzPdy.js} +1 -1
- package/dist/client/assets/{schema-JPrgW9NA.js → schema-b5uziS6S.js} +1 -1
- package/dist/client/assets/{scroll-area-BzPxgY-4.js → scroll-area-BVZXqx5M.js} +1 -1
- package/dist/client/assets/{search-input-CAgDD0MP.js → search-input-BL6XGlmm.js} +1 -1
- package/dist/client/assets/{search-toggle-DxyC7mO0.js → search-toggle-IRNGzCzn.js} +1 -1
- package/dist/client/assets/{secret-ciphertext-DIyWW8ea.js → secret-ciphertext-CKG2rzpX.js} +1 -1
- package/dist/client/assets/{secret-picker-BaxV5boV.js → secret-picker-NNIqKwTx.js} +1 -1
- package/dist/client/assets/{secrets-DSOCKy5q.js → secrets-BLs8g0Qc.js} +1 -1
- package/dist/client/assets/{sections-BsNG86P-.js → sections-Dw8sSpTv.js} +1 -1
- package/dist/client/assets/{sections-editor-Ba5HL_GU.js → sections-editor-IbsR8YsO.js} +1 -1
- package/dist/client/assets/{select-C1PBhx94.js → select-H4FJk0rp.js} +1 -1
- package/dist/client/assets/{select-model-B3qCPlEj.js → select-model-VSltfcKe.js} +1 -1
- package/dist/client/assets/{seo-editor-CBXv1v_K.js → seo-editor-DJxK0wxd.js} +1 -1
- package/dist/client/assets/{separator-DI0EmK0i.js → separator-l8ktDBQ-.js} +1 -1
- package/dist/client/assets/settings-tab-D08h17sS.js +1 -0
- package/dist/client/assets/{sheet-DaxppAym.js → sheet-DdrzSnyB.js} +1 -1
- package/dist/client/assets/{shell-layout-CKWLH4bq.js → shell-layout-Dpds4_um.js} +1 -1
- package/dist/client/assets/{site-draft-actions-Ck0Qp0lI.js → site-draft-actions-B1VIigls.js} +1 -1
- package/dist/client/assets/site-draft-view-BvQXujRd.js +2 -0
- package/dist/client/assets/site-editor-B8qpeTpl.js +1 -0
- package/dist/client/assets/{site-editor-toast-vUK6CnYX.js → site-editor-toast-C48kJZ8y.js} +1 -1
- package/dist/client/assets/{skills-Conq58a1.js → skills-F7XSMMWV.js} +1 -1
- package/dist/client/assets/{slider-B4XFe7FF.js → slider-tSRa1HDF.js} +1 -1
- package/dist/client/assets/{sortable.esm-Mem55hqW.js → sortable.esm-CE2eXOQU.js} +1 -1
- package/dist/client/assets/{sso-4h0pQdIc.js → sso-B_KsCvoW.js} +1 -1
- package/dist/client/assets/{suggestion-DXfrHDfU.js → suggestion-Bu3BweEe.js} +1 -1
- package/dist/client/assets/{switch-BZ12Wlze.js → switch-BI2l0q9a.js} +1 -1
- package/dist/client/assets/{symbol-NtdYAab7.js → symbol-CW0bfPL3.js} +1 -1
- package/dist/client/assets/{synced-repos-C66vtPZX.js → synced-repos-BXQtYjtL.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-D8h09tlE.js → tab-icon-glyph-B_hAV_wB.js} +1 -1
- package/dist/client/assets/{table-cd8TiUS7.js → table-BI-3H0Nx.js} +1 -1
- package/dist/client/assets/{tabs-PlTfpfXH.js → tabs-Cw5epDK7.js} +1 -1
- package/dist/client/assets/{task-assignee-avatar-CgqWAIyd.js → task-assignee-avatar-B4jYRjC8.js} +1 -1
- package/dist/client/assets/{task-board-DZKwU9_n.js → task-board-ByNQwZsl.js} +1 -1
- package/dist/client/assets/{task-route-CtG_ZySh.js → task-route-B8oSJFnj.js} +1 -1
- package/dist/client/assets/{task-status-DWzfRk3b.js → task-status-GAY2L2Vz.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-CdVp5AM1.js → taskboard-analytics-MtxZahkF.js} +1 -1
- package/dist/client/assets/{tasks-DME9mnR2.js → tasks-CaRFrr2H.js} +1 -1
- package/dist/client/assets/tasks-Zus8qgLK.js +1 -0
- package/dist/client/assets/{textarea-CbCQygtF.js → textarea-7I-DLD6x.js} +1 -1
- package/dist/client/assets/{thread-analytics-D0HqEGEH.js → thread-analytics-BhyMnytl.js} +1 -1
- package/dist/client/assets/{thread-intent-DYTU11gs.js → thread-intent-CoB1rbzj.js} +1 -1
- package/dist/client/assets/{thread-route-BrF-OvAm.js → thread-route-BPSSuk8V.js} +1 -1
- package/dist/client/assets/{thread-route-BwLT1XI-.js → thread-route-Bjcqwe4C.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-BClkfRHz.js → thread-sheet-body-DyDxpawL.js} +1 -1
- package/dist/client/assets/{time-range-picker-Dc0YWA3V.js → time-range-picker-DJ-TaM2M.js} +1 -1
- package/dist/client/assets/{toggle-group-CG3xZyLa.js → toggle-group-BngkTNsG.js} +1 -1
- package/dist/client/assets/{tool-namespace-BffmviW3.js → tool-namespace-DePiqr-m.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-Dvrbx_wP.js → toolbar-icon-button-DKjsnGdZ.js} +1 -1
- package/dist/client/assets/{tooltip-DZoMaiH-.js → tooltip-4vv5k-uR.js} +1 -1
- package/dist/client/assets/{tooltipContext-D6Gsaqky.js → tooltipContext-B3bWUtmi.js} +1 -1
- package/dist/client/assets/{track-Cv2e7Jw0.js → track-C0wfSYRO.js} +1 -1
- package/dist/client/assets/{types-D8wZ_EZc.js → types-CNU-uWw-.js} +1 -1
- package/dist/client/assets/{url-slug-C8xJrS8o.js → url-slug-DU3tFMUC.js} +1 -1
- package/dist/client/assets/{usage-stats-B6igVHuP.js → usage-stats-CKpL0uWf.js} +1 -1
- package/dist/client/assets/{use-ai-providers-DgzZ7YKT.js → use-ai-providers-Ct47MIru.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-BXu1w5Bp.js → use-apply-named-rule-R20A_NaL.js} +1 -1
- package/dist/client/assets/{use-automations-DZTdfMuj.js → use-automations-Ho0ayZT_.js} +1 -1
- package/dist/client/assets/{use-autosave-C5yHGYj0.js → use-autosave-DzNsVsl3.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-fUIATILp.js → use-chat-layout-state-CWI-mwQI.js} +1 -1
- package/dist/client/assets/{use-clock-tick-DiijcghV.js → use-clock-tick-DE4s8Okz.js} +1 -1
- package/dist/client/assets/{use-connect-companion-DvHSKAIT.js → use-connect-companion-Dmdscsai.js} +1 -1
- package/dist/client/assets/{use-connection-BZmon5tp.js → use-connection-HenJjVMr.js} +1 -1
- package/dist/client/assets/{use-content-sync-DQGv9jMR.js → use-content-sync-C0CqYtRD.js} +1 -1
- package/dist/client/assets/{use-copy-Dl7HNmsM.js → use-copy-C4LbXPXl.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-Y_WqPwQW.js → use-create-virtual-mcp-dBeQ8KM_.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-C4tTGqdg.js → use-date-fns-locale-DBqQ9Xwt.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-iEzw6avK.js → use-debounced-autosave-B_kpX8YN.js} +1 -1
- package/dist/client/assets/{use-debounced-value-DNoCsO37.js → use-debounced-value-Br6JzfN-.js} +1 -1
- package/dist/client/assets/{use-deco-credits-Bb3hLWha.js → use-deco-credits-DhL8Ql0T.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-Bfz-bAKi.js → use-decopilot-events-CuBncVze.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DHMSyjey.js → use-delete-connection-DuErB0IF.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CU8I3_7G.js → use-deployment-admin-BOXhbvir.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-CBDC7qwh.js → use-fast-preview-draft-url-BPrZ2XMf.js} +1 -1
- package/dist/client/assets/{use-file-configs-BXF9rvXJ.js → use-file-configs-B_k4AoEo.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-aT0WvD_J.js → use-inbox-feed-D96kN3Ph.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-ZRIHRcVb.js → use-infinite-scroll-Ba0Xf9MO.js} +1 -1
- package/dist/client/assets/{use-join-requests-p5BU3YYl.js → use-join-requests-DNpCy_xv.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-69xs0HVG.js → use-main-panel-tabs-BndsHuRH.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-SoBS-b1c.js → use-mcp-auth-status-BOQ5PtOH.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DqYHf07G.js → use-mcp-client-2WkK0AxE.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-Cu6zSvAs.js → use-mcp-prompts-BY0itm-N.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CTx7o8Po.js → use-mcp-tools-Wkfd46Rr.js} +1 -1
- package/dist/client/assets/{use-members-7fbiQ1L2.js → use-members-Cl1_-fx1.js} +1 -1
- package/dist/client/assets/{use-mobile-Df_3y675.js → use-mobile-BAnIvR27.js} +1 -1
- package/dist/client/assets/{use-move-blocks-2-4mcwFX.js → use-move-blocks-lN8kagdi.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DOId9IHj.js → use-navigate-to-agent-C2NQ-36B.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-_IkiYFNL.js → use-open-billing-url-Bewtr0D-.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-D-Dp-TzJ.js → use-org-auth-client-vWdVrvgR.js} +1 -1
- package/dist/client/assets/{use-org-fs-CLvO6ZX7.js → use-org-fs-CxjQMzFd.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-kBybWkDI.js → use-org-repo-syncs-dRJpc7Ti.js} +1 -1
- package/dist/client/assets/{use-org-sso-DzwVU3EX.js → use-org-sso-BnFa9r-G.js} +1 -1
- package/dist/client/assets/{use-organization-roles-LxJNrgl3.js → use-organization-roles-D9hV-WPT.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BXo7nhZ3.js → use-organization-settings-CE5BJyh9.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-DGz4w4gD.js → use-panel-navigate-CXkMPISv.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-DVu_UG8f.js → use-project-native-view-presence-D4-BL2Rg.js} +1 -1
- package/dist/client/assets/{use-project-scope-B2UHdHkf.js → use-project-scope-BOj2O9A_.js} +1 -1
- package/dist/client/assets/{use-recent-apps-BOqc2cRg.js → use-recent-apps-Cj-iBJUa.js} +1 -1
- package/dist/client/assets/{use-releases-Bvh7Pdaa.js → use-releases-2-Z6BMdW.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-Dct34RIh.js → use-reports-diagnostic-D--oIp45.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-DxcL_G2x.js → use-sandbox-events-BVhJrX2Z.js} +1 -1
- package/dist/client/assets/{use-secrets-Cgbmwf1E.js → use-secrets-CQ9dfY46.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-CMHXbkVq.js → use-section-preview-base-CrcAXE9z.js} +1 -1
- package/dist/client/assets/{use-session-runtime-7d3qKI0U.js → use-session-runtime-CqJF6neP.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-CEbyuj9_.js → use-sidebar-collapsed-NZNztmvG.js} +1 -1
- package/dist/client/assets/{use-tags-DOizZBvn.js → use-tags-BG7cxCCb.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-hmTm3Xr8.js → use-task-board-analytics-BhvhSxL9.js} +1 -1
- package/dist/client/assets/{use-task-board-events-Sjn1d0ir.js → use-task-board-events-CtQgceab.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-BzC_DBWs.js → use-task-board-item-prs-Dp099nXL.js} +1 -1
- package/dist/client/assets/{use-task-metadata-CSxCj4yy.js → use-task-metadata-BBoC1uvX.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-DfMbrXTf.js → use-thread-analytics-g0_FCkSl.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-B3pyBOho.js → use-thread-outputs-C38yfNsJ.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CxzyY6DS.js +1 -0
- package/dist/client/assets/{useQueries-uLX23MNk.js → useQueries-DSs3oNbf.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CWvS_hOW.js +1 -0
- package/dist/client/assets/{users-Ib8R59dI.js → users-BAyRTNUi.js} +1 -1
- package/dist/client/assets/{utils-LrUUDN57.js → utils-t1gjPfET.js} +1 -1
- package/dist/client/assets/{variant-calendar-DOoqqIzr.js → variant-calendar-BYITnHO8.js} +1 -1
- package/dist/client/assets/{variant-draft-pointer-DNyBkOr3.js → variant-draft-pointer-Cjn_TXkR.js} +1 -1
- package/dist/client/assets/{virtual-mcp-B7o88283.js → virtual-mcp-cTWrWR4Y.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-DIAPPzx7.js → watch-sse-pool-C9NPGTmI.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/migrate.js +214 -209
- package/dist/server/server.js +633 -633
- package/package.json +1 -1
- package/dist/client/assets/agent-analytics-CDwx4a2N.js +0 -1
- package/dist/client/assets/agent-app-G-hsYMQ8.js +0 -1
- package/dist/client/assets/agent-calendar-DaZrWfix.js +0 -1
- package/dist/client/assets/agent-deck-CqPaTZAU.js +0 -1
- package/dist/client/assets/agent-experiments-Cvjx0r-V.js +0 -1
- package/dist/client/assets/agent-file-bVYB1cfC.js +0 -1
- package/dist/client/assets/agent-library-D15ABzqd.js +0 -1
- package/dist/client/assets/agent-library-file-B9iyqErA.js +0 -1
- package/dist/client/assets/agent-settings-AZLE4kyB.js +0 -1
- package/dist/client/assets/agent-site-editor-code-Dqh-CK3q.js +0 -2
- package/dist/client/assets/agent-site-editor-content-ZYGhs3a9.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-DTKZdYCv.js +0 -1
- package/dist/client/assets/agent-view-D3mqLvwq.js +0 -1
- package/dist/client/assets/api-keys-J75u9n5h.js +0 -1
- package/dist/client/assets/cms-settings-editor-B-g4hnK1.js +0 -1
- package/dist/client/assets/library-DJVFXK7P.js +0 -1
- package/dist/client/assets/monitoring-CmUEkQAu.js +0 -1
- package/dist/client/assets/project-reports-CFxmXR8C.js +0 -1
- package/dist/client/assets/project-tasks-DIAs0Pxy.js +0 -1
- package/dist/client/assets/record-editor-C5o_Ofe0.js +0 -1
- package/dist/client/assets/reports-CmJOblfH.js +0 -1
- package/dist/client/assets/repositories-BZY63VIV.js +0 -1
- package/dist/client/assets/repositories-DIzNxooQ.js +0 -1
- package/dist/client/assets/repository-picker-0eUSIZ5X.js +0 -1
- package/dist/client/assets/route-BuTkxBLT.js +0 -1
- package/dist/client/assets/settings-tab-D7gwu_vw.js +0 -1
- package/dist/client/assets/site-draft-view-DwI6BUF-.js +0 -2
- package/dist/client/assets/site-editor-C14MF5hG.js +0 -1
- package/dist/client/assets/tasks-4t3a03Q3.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BuR8X__X.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-B04nA0hC.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as ct,b as Lt,r as R,l as me,j as o,b2 as li,B as Et,U as ln,ag as ci,X as ui,V as di,a as Io,F as fi,K as Ko,m as mi,o as pi,h as hi,t as ae}from"./index-D_jzSCP9.js";import{u as gi}from"./chat-context-BE5W0eRy.js";import{$ as vi,H as Zn,a0 as yi,a1 as xi,a2 as bi,a3 as Si,a4 as _i,a5 as wi,a6 as Xr,a7 as ji,a8 as ki,y as kt,a9 as Le,aa as Ei,z as Gn,w as Un,d as Ri,u as Ai,ab as Zr,i as Ci,ac as Ni,k as Ti,h as Vi,ad as Fo,ae as Pi,af as Mi,t as eo,ag as Di,ah as Ii,ai as Wn,aj as to,ak as no,al as so,am as vs,an as Ki,C as Fi,ao as Bi,x as Oi,ap as ro,aq as Li,ar as oo,as as ao,at as io,M as $i,au as lo,a as zi,av as cn,aw as Hi,ax as Wi,ay as jn,az as ys}from"./runnable-block-editor-BCPCXDwB.js";import{c as qi}from"./repository-binding-Cl8gyVcv.js";import{n as Gi,t as Ui}from"./ChevronUp-BnA2Nw_G.js";import{aa as Bo,b as Qn,ap as Yi,H as Ji,a4 as co,a0 as uo}from"./agent-icon-DhApO92C.js";import{S as un}from"./scroll-area-BzPxgY-4.js";import{c as At,T as Ct,a as Nt}from"./tooltip-DZoMaiH-.js";import{am as Qi,a2 as fo,l as Xi,u as Zi,m as el,C as tl,Q as nl,A as sl,a0 as Kt,a1 as Ft,ar as mo,J as rl,at as ol}from"./site-editor-toast-vUK6CnYX.js";import{f as al,u as il,G as ll,t as xs,H as po,s as cl,m as ul,I as dl}from"./blocks-tab-states-B-gG8PUG.js";import{m as fl,u as ml,P as pl}from"./mustache-Pqeakuud.js";import{b0 as hl,b as Is,b2 as Oo,G as gl,b3 as ot,b4 as Es,b5 as Lo,al as Qt,a7 as Rs,b6 as As,am as Ot,a8 as dn,e as vl,j as yl,A as xl,q as qn,p as En,ax as bl,aj as Jt,aa as bs,ai as St,ah as kn,b7 as Sl,H as _l,an as ho,ao as go,ak as wl,b8 as jl,b9 as Bt,ba as kl,bb as El,bc as Rl,ag as vo,bd as Ss,be as Al,bf as Cl,bg as Nl,ae as Tl,aN as Vl,aP as Pl,aI as Ml,bh as Dl,bi as Il,bj as Kl,a9 as yo,bk as Fl,ad as Bl,bl as Ol}from"./parse-sections-C-MhwiHZ.js";import{a as Ll}from"./Copy01-DK6eLr2i.js";import{a as Cs,e as $o}from"./UserSquare-CRvybnC2.js";import{i as xo}from"./Tool01-CEmvRWh7.js";import{s as bo}from"./Image01-DwBREChx.js";import{s as $l}from"./Plus-CxQiW556.js";import{s as zl}from"./Trash01-7PWQCtvD.js";import{i as Ns}from"./ZoomOut-CLJKIGNa.js";import{u as Hl,a as So,K as Wl,P as ql,b as Gl,C as Ul,D as Yl,c as Jl}from"./core.esm-C9O_xZ-F.js";import{u as Ql,s as Xl,a as Yn,S as Zl,v as ec}from"./sortable.esm-Mem55hqW.js";import{s as tc,g as nc,u as sc,A as rc}from"./use-section-preview-base-CMHXbkVq.js";import{i as oc}from"./thread-intent-DYTU11gs.js";import{A as _s}from"./avatar-BCxNXTas.js";import{e as ac,d as _o,b as ic,A as lc,a as cc,f as uc}from"./alert-dialog--q-PWeut.js";import{b as dc}from"./format-time-Cq80KKvY.js";import{e as fc}from"./shell-layout-CKWLH4bq.js";import{u as mc}from"./use-members-7fbiQ1L2.js";import{a as pc,P as wo,w as hc,b as gc}from"./page-seo-form-BZ5qz5Jc.js";import{u as vc}from"./use-apply-named-rule-BXu1w5Bp.js";import{c as jo,d as ko,e as yc,f as xc,g as bc}from"./variant-draft-pointer-DNyBkOr3.js";import"./use-panel-navigate-DGz4w4gD.js";import"./thread-route-BrF-OvAm.js";import"./use-project-scope-B2UHdHkf.js";import"./autosend-CC_H9WVC.js";import"./use-mcp-client-DqYHf07G.js";import"./auth-BCqAeFp3.js";import"./use-decopilot-events-Bfz-bAKi.js";import"./watch-sse-pool-DIAPPzx7.js";import"./task-board-DZKwU9_n.js";import"./schema-JPrgW9NA.js";import"./backoff-CrEUbyZT.js";import"./use-ai-providers-DgzZ7YKT.js";import"./location-V0VwTJTt.js";import"./use-organization-settings-BXo7nhZ3.js";import"./utils-LrUUDN57.js";import"./Play-DV5Ma4c6.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-CbWxf18N.js";import"./LinkBroken01-CTiL1Fp-.js";import"./collapsible-CUpe_nLN.js";import"./use-copy-Dl7HNmsM.js";import"./usage-stats-B6igVHuP.js";import"./tool-namespace-BffmviW3.js";import"./form-DuWo7Npn.js";import"./label-BHfVaXR7.js";import"./utils-CVEq3hMx.js";import"./markdown-Cd88osrX.js";import"./use-mobile-Df_3y675.js";import"./use-clock-tick-DiijcghV.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-CFMsjvxz.js";import"./types-D8wZ_EZc.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./AlertCircle-BzjzqqRa.js";import"./XClose-CjXzVHwC.js";import"./ShoppingBag01-hqBb4euZ.js";import"./SearchMd-CYuw_TlP.js";import"./sheet-DaxppAym.js";import"./integration-icon-BKkvrbiZ.js";import"./use-connection-BZmon5tp.js";import"./use-navigate-to-agent-DOId9IHj.js";import"./Link01-CHLntxrX.js";import"./use-mcp-prompts-Cu6zSvAs.js";import"./Monitor01-DtC0vfP6.js";import"./use-thread-outputs-B3pyBOho.js";import"./file-type-icon-6tQy_IZ-.js";import"./secret-ciphertext-DIyWW8ea.js";import"./alert-DK8EW5eY.js";import"./switch-BZ12Wlze.js";import"./textarea-CbCQygtF.js";import"./ChevronSelectorVertical-YTUkgDHg.js";import"./command-Due3aGE_.js";import"./index-B0KYQovx.js";import"./popover-BVmz1c3N.js";import"./monaco-editor-q0K0FpZQ.js";import"./editor-DfNlEhGy.js";import"./delay-CnY5UFtP.js";import"./calendar-CWZHYNsm.js";import"./SwitchHorizontal01-Ik-Wu8bp.js";import"./Minus-BCeBycMD.js";import"./select-C1PBhx94.js";import"./index-BdQq_4o_.js";import"./index-DHWYq2vY.js";import"./editor-classes-BgZFSVD_.js";import"./toggle-group-CG3xZyLa.js";import"./active-indicator-CCMhAsc_.js";import"./combobox-pGuSce6D.js";import"./Upload01-d0p8GdRf.js";import"./DotsVertical-C4UAKneF.js";import"./search-input-CAgDD0MP.js";import"./tabs-PlTfpfXH.js";import"./use-debounced-value-DNoCsO37.js";import"./use-file-configs-BXF9rvXJ.js";import"./asset-utils-DobQJkEL.js";import"./useInfiniteQuery-BuR8X__X.js";import"./infiniteQueryObserver-nO7Ij1Gh.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./use-session-runtime-7d3qKI0U.js";import"./sandbox-git-api-CH_-QFpD.js";import"./sandbox-url-D3mC8qhT.js";import"./ArrowUp-BbhuuuwV.js";import"./ArrowLeft-D9e74CxD.js";import"./Building02-C2flUGF-.js";import"./CheckCircle-4gdTBGy6.js";import"./CreditCard01-CMqZSaqi.js";import"./Globe04-DEY1e_cW.js";import"./Key01-MBTcw2W0.js";import"./Sun-_7OyKm8q.js";import"./User01-CvsUVXiw.js";import"./Users01-BpDVBOEG.js";import"./experiments-tab-choice-Du4Lvv_w.js";import"./use-sandbox-events-DxcL_G2x.js";import"./slider-B4XFe7FF.js";import"./index-DjG04H6F.js";import"./tooltipContext-D6Gsaqky.js";import"./CategoricalChart-BjLODSSF.js";import"./index-DlAj9KxS.js";import"./ActiveShapeUtils-BviJ1RJ0.js";import"./Sector-7HoHBp31.js";import"./symbol-NtdYAab7.js";import"./empty-state-DHTpGmzV.js";import"./section-preview-url-7zfngvgW.js";import"./slugify-CEUa2lfQ.js";import"./differenceInSeconds-C3x8sHUj.js";import"./project-icon-BsqqQ1nI.js";import"./new-project-dialog-CP7YY3zi.js";import"./repository-import-picker-3obW4oiZ.js";import"./repository-picker-0eUSIZ5X.js";import"./collection-search-D3DfnNEj.js";import"./required-auth-layout-D4sDIyJ3.js";import"./use-org-sso-DzwVU3EX.js";import"./use-org-auth-client-D-Dp-TzJ.js";import"./use-move-blocks-2-4mcwFX.js";const Sc={escape:vi};function _c(n,e){for(const r of tc(n,e)){const a=typeof r.title=="string"?r.title:void 0;if(a?.includes("{{"))return a}}function wc(n,e){if(!e)return;const r=hl(n,oc(e));if(r)try{const a=_c(r.resolveType,e);return a&&fl.render(a,r.data,{},Sc).trim()||void 0}catch{return}}function jc(n){const e=ct.c(13),{icon:r,label:a,className:l}=n;let u;e[0]!==l?(u=me("size-3.5",l),e[0]=l,e[1]=u):u=e[1];let y;e[2]!==r||e[3]!==u?(y=o.jsx(r,{className:u}),e[2]=r,e[3]=u,e[4]=y):y=e[4];let m;e[5]!==a||e[6]!==y?(m=o.jsx(Ct,{asChild:!0,children:o.jsx("span",{role:"img","aria-label":a,className:"shrink-0 cursor-help",children:y})}),e[5]=a,e[6]=y,e[7]=m):m=e[7];let b;e[8]!==a?(b=o.jsx(Nt,{className:"max-w-56",children:a}),e[8]=a,e[9]=b):b=e[9];let h;return e[10]!==m||e[11]!==b?(h=o.jsxs(At,{children:[m,b]}),e[10]=m,e[11]=b,e[12]=h):h=e[12],h}const kc="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function Eo(n){return Array.from({length:n},(e,r)=>({id:crypto.randomUUID(),index:r}))}function zo(n){return n.map((e,r)=>({...e,index:r}))}function Ec(n,e){if(e===n.length)return n;if(e<n.length)return zo(n.slice(0,e));const r=Array.from({length:e-n.length},(a,l)=>({id:crypto.randomUUID(),index:n.length+l}));return[...n,...r]}function Ho(n){const e=ct.c(44),{section:r,raw:a,meta:l,decofile:u}=n,y=Lt(),m=Zn(),b=r.isSavedBlock===!0,h=r.isMultivariate===!0;let k;e[0]!==l||e[1]!==a?(k=a&&l?nc(a,l):void 0,e[0]=l,e[1]=a,e[2]=k):k=e[2];const N=k;let L;e[3]!==l||e[4]!==h||e[5]!==a||e[6]!==b?(L=a&&l&&!b&&!h?wc(a,l):void 0,e[3]=l,e[4]=h,e[5]=a,e[6]=b,e[7]=L):L=e[7];const z=L;let H;e[8]!==u||e[9]!==l||e[10]!==a||e[11]!==r?(H=wi(a,r,u,l),e[8]=u,e[9]=l,e[10]=a,e[11]=r,e[12]=H):H=e[12];const B=H;let w;e[13]!==h||e[14]!==a?.__resolveType?(w=!h&&Is(a?.__resolveType??""),e[13]=h,e[14]=a?.__resolveType,e[15]=w):w=e[15];const p=w,te=b?Qn:h?Bo:$o;let E;e[16]!==h||e[17]!==b?(E=b?{color:gl}:h?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=h,e[17]=b,e[18]=E):E=e[18];const W=E;let V;e[19]!==te||e[20]!==m?(V=m?o.jsxs("span",{className:"relative size-4 shrink-0",children:[o.jsx(te,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),o.jsx(ki,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):o.jsx(Yi,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=te,e[20]=m,e[21]=V):V=e[21];let J;e[22]!==N?(J=N&&o.jsx("img",{src:N,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=N,e[23]=J):J=e[23];let g;e[24]!==m||e[25]!==W?(g=!m&&o.jsx(Cs,{className:"h-4 w-4 shrink-0",style:W}),e[24]=m,e[25]=W,e[26]=g):g=e[26];const Q=m?"shrink":"flex-1",x=r.isHidden&&"line-through opacity-50";let Z;e[27]!==x||e[28]!==Q?(Z=me("min-w-0 truncate text-sm font-medium",Q,x),e[27]=x,e[28]=Q,e[29]=Z):Z=e[29];const q=z??r.label;let pe;e[30]!==Z||e[31]!==q?(pe=o.jsx("span",{className:Z,children:q}),e[30]=Z,e[31]=q,e[32]=pe):pe=e[32];let ye;e[33]!==p||e[34]!==m||e[35]!==B||e[36]!==y?(ye=m?o.jsxs(o.Fragment,{children:[p&&o.jsx(jc,{icon:Ns,label:y("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),B&&o.jsx(Xr,{}),o.jsx("span",{className:"min-w-0 flex-1"})]}):B&&o.jsx(Xr,{className:"absolute -right-0.5 -top-0.5"}),e[33]=p,e[34]=m,e[35]=B,e[36]=y,e[37]=ye):ye=e[37];let ue;return e[38]!==pe||e[39]!==ye||e[40]!==V||e[41]!==J||e[42]!==g?(ue=o.jsxs(o.Fragment,{children:[V,J,g,pe,ye]}),e[38]=pe,e[39]=ye,e[40]=V,e[41]=J,e[42]=g,e[43]=ue):ue=e[43],ue}const Rc="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Ac="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]";function Wo(n,e,r){if(r)return ji({selected:e});const a=n.isSavedBlock===!0,l=n.isMultivariate===!0;return me("group relative flex select-none items-center gap-2 rounded-[var(--studio-control-radius,var(--radius-md))] px-2 py-2.5",e?"bg-accent text-accent-foreground":a?Rc:l?Ac:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function ws(n,e){return me("h-7 shrink-0 overflow-hidden",e?"w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]":n?"w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100":"w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]")}function Cc(n){const e=ct.c(90),{section:r,raw:a,meta:l,decofile:u,sortableId:y,selected:m,onSelect:b,onDelete:h,onDuplicate:k,onMakeReusable:N,onToggleHidden:L,onToggleLazy:z,onAddVariant:H,onDetach:B}=n,w=Lt(),p=Zn(),te=a?Is(a.__resolveType??""):!1,E=r.isHidden===!0,W=te||E;let V;e[0]!==r?(V=Oo(r),e[0]=r,e[1]=V):V=e[1];const J=V,g=!!z&&!r.isMultivariate;let Q;e[2]!==y?(Q={id:y,animateLayoutChanges:Vc},e[2]=y,e[3]=Q):Q=e[3];const{attributes:x,listeners:Z,setNodeRef:q,transform:pe,isDragging:ye}=Ql(Q);let ue;e[4]!==pe?(ue=Ul.Transform.toString(pe?{...pe,x:0}:null),e[4]=pe,e[5]=ue):ue=e[5];const fe=ye?0:void 0;let Re;e[6]!==ue||e[7]!==fe?(Re={transform:ue,opacity:fe},e[6]=ue,e[7]=fe,e[8]=Re):Re=e[8];const j=Re;let re;e[9]!==r?(re=xi(r),e[9]=r,e[10]=re):re=e[10];const Ae=re,Ce="button",S=0;let I;e[11]!==b?(I=K=>{(K.key==="Enter"||K.key===" ")&&(K.preventDefault(),b())},e[11]=b,e[12]=I):I=e[12];const he=ye?"cursor-grabbing":"cursor-pointer";let M;e[13]!==p||e[14]!==r||e[15]!==m||e[16]!==he?(M=me("touch-none transition-colors",he,Wo(r,m,p)),e[13]=p,e[14]=r,e[15]=m,e[16]=he,e[17]=M):M=e[17];let xe;e[18]!==u||e[19]!==l||e[20]!==a||e[21]!==r?(xe=o.jsx(Ho,{section:r,raw:a,meta:l,decofile:u}),e[18]=u,e[19]=l,e[20]=a,e[21]=r,e[22]=xe):xe=e[22];const O=!p&&g&&o.jsxs(At,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(Et,{type:"button",variant:"ghost",size:"icon","aria-label":w(te?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:me(ws(W,te)),onClick:K=>{K.stopPropagation(),z?.()},onPointerDown:Tc,children:o.jsx(Ns,{className:me("h-3.5 w-3.5",te&&"text-warning")})})}),o.jsx(Nt,{side:"bottom",children:w(te?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),oe=p?o.jsx(bi,{label:w(E?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:E,onToggle:L,children:E?o.jsx(xo,{className:"h-3.5 w-3.5"}):o.jsx(bo,{className:"h-3.5 w-3.5"})}):o.jsxs(At,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(Et,{type:"button",variant:"ghost",size:"icon","aria-label":w(E?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:me(ws(W,E)),onClick:K=>{K.stopPropagation(),L()},onPointerDown:Nc,children:E?o.jsx(xo,{className:"h-3.5 w-3.5"}):o.jsx(bo,{className:"h-3.5 w-3.5"})})}),o.jsx(Nt,{side:"bottom",children:w(E?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),G=ui,Ie=Si;let ke;e[23]!==w?(ke=w("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=w,e[24]=ke):ke=e[24];const ut=me(ws(W,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let Ze;e[25]!==Ie||e[26]!==ke||e[27]!==ut?(Ze=o.jsx(Ie,{label:ke,classicClassName:ut}),e[25]=Ie,e[26]=ke,e[27]=ut,e[28]=Ze):Ze=e[28];let $e;e[29]!==p||e[30]!==g||e[31]!==te||e[32]!==z||e[33]!==w?($e=p&&g&&o.jsxs(o.Fragment,{children:[o.jsxs(ln,{onClick:K=>{K.stopPropagation(),z?.()},children:[o.jsx(Ns,{className:"h-4 w-4"}),w(te?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),o.jsx(ci,{})]}),e[29]=p,e[30]=g,e[31]=te,e[32]=z,e[33]=w,e[34]=$e):$e=e[34];let qe;e[35]!==k?(qe=K=>{K.stopPropagation(),k()},e[35]=k,e[36]=qe):qe=e[36];let at;e[37]===Symbol.for("react.memo_cache_sentinel")?(at=o.jsx(Ll,{className:"h-4 w-4"}),e[37]=at):at=e[37];let Ge;e[38]!==w?(Ge=w("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=w,e[39]=Ge):Ge=e[39];let Ue;e[40]!==qe||e[41]!==Ge?(Ue=o.jsxs(ln,{onClick:qe,children:[at,Ge]}),e[40]=qe,e[41]=Ge,e[42]=Ue):Ue=e[42];let Ye;e[43]!==p||e[44]!==J||e[45]!==H||e[46]!==w?(Ye=J&&o.jsxs(ln,{className:me(!p&&_i),onClick:K=>{K.stopPropagation(),H()},children:[o.jsx(Bo,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=p,e[44]=J,e[45]=H,e[46]=w,e[47]=Ye):Ye=e[47];let de;e[48]!==p||e[49]!==Ae||e[50]!==N||e[51]!==w?(de=Ae&&o.jsxs(ln,{className:me(!p&&kc),onClick:K=>{K.stopPropagation(),N()},children:[p?o.jsx(Qn,{className:"h-4 w-4"}):o.jsx(Cs,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=p,e[49]=Ae,e[50]=N,e[51]=w,e[52]=de):de=e[52];let ge;e[53]!==p||e[54]!==B||e[55]!==r.isMultivariate||e[56]!==r.isSavedBlock||e[57]!==w?(ge=r.isSavedBlock===!0&&!r.isMultivariate&&o.jsxs(ln,{onClick:K=>{K.stopPropagation(),B()},children:[p?o.jsx($o,{className:"h-4 w-4"}):o.jsx(Cs,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=p,e[54]=B,e[55]=r.isMultivariate,e[56]=r.isSavedBlock,e[57]=w,e[58]=ge):ge=e[58];let be;e[59]!==h?(be=K=>{K.stopPropagation(),h()},e[59]=h,e[60]=be):be=e[60];let ee;e[61]===Symbol.for("react.memo_cache_sentinel")?(ee=o.jsx(zl,{className:"h-4 w-4"}),e[61]=ee):ee=e[61];let F;e[62]!==w?(F=w("sectionsEditor.sectionList.deleteMenuItem"),e[62]=w,e[63]=F):F=e[63];let De;e[64]!==be||e[65]!==F?(De=o.jsxs(ln,{variant:"destructive",onClick:be,children:[ee,F]}),e[64]=be,e[65]=F,e[66]=De):De=e[66];let et;e[67]!==$e||e[68]!==Ue||e[69]!==Ye||e[70]!==de||e[71]!==ge||e[72]!==De?(et=o.jsxs(di,{align:"end",className:"w-44",children:[$e,Ue,Ye,de,ge,De]}),e[67]=$e,e[68]=Ue,e[69]=Ye,e[70]=de,e[71]=ge,e[72]=De,e[73]=et):et=e[73];let tt;e[74]!==G||e[75]!==Ze||e[76]!==et?(tt=o.jsxs(G,{children:[Ze,et]}),e[74]=G,e[75]=Ze,e[76]=et,e[77]=tt):tt=e[77];let st;return e[78]!==x||e[79]!==Z||e[80]!==b||e[81]!==q||e[82]!==j||e[83]!==M||e[84]!==xe||e[85]!==O||e[86]!==oe||e[87]!==tt||e[88]!==I?(st=o.jsxs("div",{ref:q,style:j,...x,...Z,role:Ce,tabIndex:S,onClick:b,onKeyDown:I,className:M,children:[xe,O,oe,tt]}),e[78]=x,e[79]=Z,e[80]=b,e[81]=q,e[82]=j,e[83]=M,e[84]=xe,e[85]=O,e[86]=oe,e[87]=tt,e[88]=I,e[89]=st):st=e[89],st}function Nc(n){return n.stopPropagation()}function Tc(n){return n.stopPropagation()}function Vc(){return!1}function Ts(n){const e=ct.c(11),{canAddSection:r,onAddSection:a,className:l,size:u}=n,y=Lt();let m;e[0]!==l?(m=me("w-full",l),e[0]=l,e[1]=m):m=e[1];const b=!r;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx($l,{size:14}),e[2]=h):h=e[2];let k;e[3]!==y?(k=y("sectionsEditor.sectionList.addSectionButton"),e[3]=y,e[4]=k):k=e[4];let N;return e[5]!==a||e[6]!==u||e[7]!==m||e[8]!==b||e[9]!==k?(N=o.jsxs(Et,{type:"button",variant:"outline",size:u,className:m,disabled:b,onClick:a,children:[h,k]}),e[5]=a,e[6]=u,e[7]=m,e[8]=b,e[9]=k,e[10]=N):N=e[10],N}function Pc(n){const e=ct.c(101),{listKey:r,rawSections:a,sections:l,meta:u,decofile:y,selectedIndex:m,onSelect:b,onReorder:h,onDelete:k,onDuplicate:N,onMakeReusable:L,onToggleHidden:z,onToggleLazy:H,onAddVariant:B,onDetach:w,onAddSection:p,canAddSection:te}=n,E=te===void 0?!0:te,W=Lt(),V=Zn();let J;e[0]!==l.length?(J=()=>Eo(l.length),e[0]=l.length,e[1]=J):J=e[1];const[g,Q]=R.useState(J),[x,Z]=R.useState(null),[q,pe]=R.useState(r),[ye,ue]=R.useState(l.length),fe=R.useRef(!1);q!==r?(pe(r),ue(l.length),Q(Eo(l.length))):ye!==l.length&&(ue(l.length),Q(Je=>Ec(Je,l.length)));let Re;e[2]===Symbol.for("react.memo_cache_sentinel")?(Re={activationConstraint:{distance:8}},e[2]=Re):Re=e[2];let j;e[3]===Symbol.for("react.memo_cache_sentinel")?(j={coordinateGetter:Xl},e[3]=j):j=e[3];const re=Hl(So(ql,Re),So(Wl,j));let Ae;e[4]!==g?(Ae=g.map(Mc),e[4]=g,e[5]=Ae):Ae=e[5];const Ce=Ae;let S;e[6]===Symbol.for("react.memo_cache_sentinel")?(S=Je=>{Z(String(Je.active.id))},e[6]=S):S=e[6];const I=S;let he;e[7]!==Ce||e[8]!==h?(he=Je=>{Z(null);const{active:ie,over:Ne}=Je;if(!Ne||ie.id===Ne.id)return;const ze=Ce.indexOf(String(ie.id)),rt=Ce.indexOf(String(Ne.id));ze===-1||rt===-1||(Q(it=>zo(Yn([...it],ze,rt))),fe.current=!0,requestAnimationFrame(()=>{fe.current=!1}),h?.(ze,rt))},e[7]=Ce,e[8]=h,e[9]=he):he=e[9];const M=he;let xe;e[10]===Symbol.for("react.memo_cache_sentinel")?(xe=()=>{Z(null)},e[10]=xe):xe=e[10];const O=xe;let oe,G,Ie,ke,ut,Ze,$e,qe,at,Ge,Ue,Ye,de,ge,be;if(e[11]!==x||e[12]!==E||e[13]!==V||e[14]!==y||e[15]!==g||e[16]!==Ce||e[17]!==M||e[18]!==u||e[19]!==p||e[20]!==B||e[21]!==k||e[22]!==w||e[23]!==N||e[24]!==L||e[25]!==b||e[26]!==z||e[27]!==H||e[28]!==a||e[29]!==l||e[30]!==m||e[31]!==re||e[32]!==W){ge=Symbol.for("react.early_return_sentinel");e:{const Je=ie=>{fe.current||b(ie)};if(e[48]!==x||e[49]!==E||e[50]!==V||e[51]!==g||e[52]!==p||e[53]!==a||e[54]!==l||e[55]!==W){const ie=x?g.find(Ne=>Ne.id===x):null;if(ke=ie!=null?l[ie.index]:null,Ie=ie!=null?a[ie.index]:void 0,g.length===0){let Ne;e[59]!==W?(Ne=W("sectionsEditor.sectionList.noSections"),e[59]=W,e[60]=Ne):Ne=e[60];let ze;e[61]!==Ne?(ze=o.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:Ne}),e[61]=Ne,e[62]=ze):ze=e[62];const rt=ze;let it;e[63]!==E||e[64]!==V||e[65]!==rt||e[66]!==p?(it=V?rt:o.jsxs("div",{className:"space-y-2",children:[rt,o.jsx(Ts,{canAddSection:E,onAddSection:p,size:"sm"})]}),e[63]=E,e[64]=V,e[65]=rt,e[66]=p,e[67]=it):it=e[67],ge=it;break e}de=me(ie&&"cursor-grabbing"),e[48]=x,e[49]=E,e[50]=V,e[51]=g,e[52]=p,e[53]=a,e[54]=l,e[55]=W,e[56]=Ie,e[57]=ke,e[58]=de}else Ie=e[56],ke=e[57],de=e[58];G=Yl,qe=re,at=Jl,Ge=I,Ue=M,Ye=O,oe=Zl,Ze=Ce,$e=ec,be="space-y-1",ut=g.map(ie=>{const Ne=l[ie.index];return Ne?o.jsx(Cc,{sortableId:ie.id,section:Ne,raw:a[ie.index],meta:u,decofile:y,selected:m===ie.index,onSelect:()=>Je(ie.index),onDelete:()=>k(ie.index),onDuplicate:()=>N(ie.index),onMakeReusable:()=>L(ie.index),onToggleHidden:()=>z(ie.index),onToggleLazy:H?()=>H(ie.index):void 0,onAddVariant:()=>B(ie.index),onDetach:()=>w(ie.index)},ie.id):null})}e[11]=x,e[12]=E,e[13]=V,e[14]=y,e[15]=g,e[16]=Ce,e[17]=M,e[18]=u,e[19]=p,e[20]=B,e[21]=k,e[22]=w,e[23]=N,e[24]=L,e[25]=b,e[26]=z,e[27]=H,e[28]=a,e[29]=l,e[30]=m,e[31]=re,e[32]=W,e[33]=oe,e[34]=G,e[35]=Ie,e[36]=ke,e[37]=ut,e[38]=Ze,e[39]=$e,e[40]=qe,e[41]=at,e[42]=Ge,e[43]=Ue,e[44]=Ye,e[45]=de,e[46]=ge,e[47]=be}else oe=e[33],G=e[34],Ie=e[35],ke=e[36],ut=e[37],Ze=e[38],$e=e[39],qe=e[40],at=e[41],Ge=e[42],Ue=e[43],Ye=e[44],de=e[45],ge=e[46],be=e[47];if(ge!==Symbol.for("react.early_return_sentinel"))return ge;let ee;e[68]!==ut||e[69]!==be?(ee=o.jsx("div",{className:be,children:ut}),e[68]=ut,e[69]=be,e[70]=ee):ee=e[70];let F;e[71]!==oe||e[72]!==Ze||e[73]!==$e||e[74]!==ee?(F=o.jsx(oe,{items:Ze,strategy:$e,children:ee}),e[71]=oe,e[72]=Ze,e[73]=$e,e[74]=ee,e[75]=F):F=e[75];let De;e[76]!==Ie||e[77]!==ke||e[78]!==V||e[79]!==y||e[80]!==u?(De=ke?o.jsx("div",{className:me("cursor-grabbing shadow-lift",Wo(ke,!1,V)),children:o.jsx(Ho,{section:ke,raw:Ie,meta:u,decofile:y})}):null,e[76]=Ie,e[77]=ke,e[78]=V,e[79]=y,e[80]=u,e[81]=De):De=e[81];let et;e[82]!==De?(et=li.createPortal(o.jsx(Gl,{dropAnimation:yi,children:De}),document.body),e[82]=De,e[83]=et):et=e[83];let tt;e[84]!==G||e[85]!==qe||e[86]!==at||e[87]!==Ge||e[88]!==Ue||e[89]!==Ye||e[90]!==F||e[91]!==et?(tt=o.jsxs(G,{sensors:qe,collisionDetection:at,onDragStart:Ge,onDragEnd:Ue,onDragCancel:Ye,children:[F,et]}),e[84]=G,e[85]=qe,e[86]=at,e[87]=Ge,e[88]=Ue,e[89]=Ye,e[90]=F,e[91]=et,e[92]=tt):tt=e[92];let st;e[93]!==E||e[94]!==V||e[95]!==p?(st=!V&&o.jsx(Ts,{canAddSection:E,onAddSection:p,size:"sm",className:"mt-2"}),e[93]=E,e[94]=V,e[95]=p,e[96]=st):st=e[96];let K;return e[97]!==de||e[98]!==tt||e[99]!==st?(K=o.jsxs("div",{className:de,children:[tt,st]}),e[97]=de,e[98]=tt,e[99]=st,e[100]=K):K=e[100],K}function Mc(n){return n.id}function js(n,e,r,a,l){if(!n||!e)return null;if(!e.isMultivariate)return kt(n,e,a,l)?.data??null;const u=ot(n,e),y=u?Es(u,al)[r]:void 0;return y?Lo(y.value,a)?.data??null:null}const Dc=50;function Ic(n,e){n.own.push(Le(e)),n.own.length>Dc&&n.own.shift()}function Ro(n,e){return n.own.includes(Le(e))}function Kc(n,e){const{sectionIndex:r,variantIndex:a,shown:l,next:u,sectionCount:y}=e;return n&&n.sectionIndex===r&&n.variantIndex===a&&n.emitted===l?(n.emitted=u,n):l?{sectionIndex:r,variantIndex:a,base:l,emitted:u,sectionCount:y,own:[Le(l)]}:null}function qo(n,e){return e!==null&&Le(n)!==Le(e)}function Go(n,e){return n.__resolveType!==e.__resolveType}function Fc(n,e,r,a){if(e.length===a)return"here";const l=Le(n),u=e.flatMap((y,m)=>m!==r&&y!==null&&Le(y)===l?[m]:[]);return u.length===1?u[0]:"unknown"}function Ao({formBase:n,rebased:e,versionOf:r}){let a=null;return{ifMatch:l=>{a=l,n&&(n.version===void 0||e)&&(n.version=r(l));const u=n?n.version:r(l);return u===void 0?void 0:{[l]:u}},onApplied:l=>{n&&a!==null&&Object.hasOwn(l,a)&&(n.version=l[a])},reloadOnConflict:!0}}function Bc({merged:n,tracked:e,current:r,saved:a}){return!!n&&!!e&&r===e&&e.emitted===a}function Co(n,e){return!!n&&!!e&&n.contains(e)}function Vs(n){const e=[],r=Ps("",n.ancestor,n.mine,n.theirs,e);return{...n,merged:r,pointers:e}}function Ps(n,e,r,a,l){const u=(y,m)=>Le(y)===Le(m);if(u(r,a)||u(e,a))return r;if(u(e,r))return a;if(ks(r)&&ks(a)){const y=ks(e)?e:{},m={},b=[...Object.keys(r),...Object.keys(a).filter(h=>!(h in r))];for(const h of b){const k=Ps(`${n}/${h.replaceAll("~","~0").replaceAll("/","~1")}`,y[h],r[h],a[h],l);k!==void 0&&(m[h]=k)}return m}return Array.isArray(e)&&Array.isArray(r)&&Array.isArray(a)&&r.length===e.length&&a.length===e.length?e.map((y,m)=>Ps(`${n}/${m}`,y,r[m],a[m],l)):(l.push(n),a)}function ks(n){return!!n&&typeof n=="object"&&!Array.isArray(n)}function Oc(n,e){let r=n.merged;for(const a of n.pointers)e[a]==="mine"&&(r=Hc(r,a,Xt(n.mine,a)));return r}function Lc(n,e){return Object.fromEntries(n.pointers.map(r=>[r,e]))}function Uo(n){return Lc(n,"mine")}function Ms(n,e,r){const a=Uo(r);for(const l of r.pointers){const u=e[l];if(!u||!n.pointers.includes(l))continue;["mine","theirs"].every(m=>Le(Xt(n[m],l))===Le(Xt(r[m],l)))&&(a[l]=u)}return a}function Yo(n,e,r={}){const a=e.pointers.filter(l=>!n.pointers.includes(l)||Le(Xt(n.theirs,l))!==Le(Xt(e.theirs,l)));return a.length===0?r:{...r,...Object.fromEntries(a.map(l=>[l,(r[l]??0)+1]))}}function $c(n,e,r){if(!e||Go(n.plan.ancestor,e)||!qo(n.plan.theirs,e)||r(e))return null;const a=Vs({...n.plan,theirs:e});return a.pointers.length===0?null:{plan:a,choices:Ms(n.plan,n.choices,a),fresh:Yo(n.plan,a,n.fresh)}}function zc(n,e){return n.pointers.map(r=>({pointer:r,label:Ei(r,e),mine:Xt(n.mine,r),theirs:Xt(n.theirs,r),schema:Wc(e??null,r)}))}function Ks(n){return n.split("/").slice(1).map(e=>e.replaceAll("~1","/").replaceAll("~0","~"))}function Xt(n,e){let r=n;for(const a of Ks(e))if(Array.isArray(r))r=r[Number(a)];else if(r&&typeof r=="object")r=r[a];else return;return r}function Hc(n,e,r){const a=Ks(e),l=(u,y)=>{if(y===a.length)return r;const m=a[y];if(Array.isArray(u)){const k=[...u];return k[Number(m)]=l(u[Number(m)],y+1),k}const b=u&&typeof u=="object"?{...u}:{},h=l(b[m],y+1);return h===void 0?delete b[m]:b[m]=h,b};return l(n,0)}function Wc(n,e){let r=n;for(const a of Ks(e)){if(!r)return null;r=/^\d+$/.test(a)&&!r.properties?.[a]?r.items:r.properties?.[a]}return r??null}const qc=/\.(png|jpe?g|gif|webp|avif|svg)(\?.*)?$/i,No=60,Gc=3;function Jo(n,e){return e?.format==="image-uri"?!0:n.startsWith("data:image/")||/^(https?:)?\/\//.test(n)&&qc.test(n)}function Ds(n,e){if(!(e?.format==="rich-text"||e?.format==="rich-text-inline"||e?.format==="html"||/<\/?[a-z][^>]*>/i.test(n)))return n;const a=n.replace(/<br\s*\/?>/gi,`
|
|
1
|
+
import{c as ct,b as Lt,r as R,l as me,j as o,b2 as li,B as Et,U as ln,ag as ci,X as ui,V as di,a as Io,F as fi,K as Ko,m as mi,o as pi,h as hi,t as ae}from"./index-BeWb3VLq.js";import{u as gi}from"./chat-context-BEyCIAaN.js";import{$ as vi,H as Zn,a0 as yi,a1 as xi,a2 as bi,a3 as Si,a4 as _i,a5 as wi,a6 as Xr,a7 as ji,a8 as ki,y as kt,a9 as Le,aa as Ei,z as Gn,w as Un,d as Ri,u as Ai,ab as Zr,i as Ci,ac as Ni,k as Ti,h as Vi,ad as Fo,ae as Pi,af as Mi,t as eo,ag as Di,ah as Ii,ai as Wn,aj as to,ak as no,al as so,am as vs,an as Ki,C as Fi,ao as Bi,x as Oi,ap as ro,aq as Li,ar as oo,as as ao,at as io,M as $i,au as lo,a as zi,av as cn,aw as Hi,ax as Wi,ay as jn,az as ys}from"./runnable-block-editor-Bod17qTV.js";import{c as qi}from"./repository-binding-Cf_thK-b.js";import{n as Gi,t as Ui}from"./ChevronUp-BT7eMKPK.js";import{aa as Bo,b as Qn,ap as Yi,H as Ji,a4 as co,a0 as uo}from"./agent-icon-CiKTiUdq.js";import{S as un}from"./scroll-area-BVZXqx5M.js";import{c as At,T as Ct,a as Nt}from"./tooltip-4vv5k-uR.js";import{am as Qi,a2 as fo,l as Xi,u as Zi,m as el,C as tl,Q as nl,A as sl,a0 as Kt,a1 as Ft,ar as mo,J as rl,at as ol}from"./site-editor-toast-C48kJZ8y.js";import{f as al,u as il,G as ll,t as xs,H as po,s as cl,m as ul,I as dl}from"./blocks-tab-states-5tpSikld.js";import{m as fl,u as ml,P as pl}from"./mustache-B20fDMb8.js";import{b0 as hl,b as Is,b2 as Oo,G as gl,b3 as ot,b4 as Es,b5 as Lo,al as Qt,a7 as Rs,b6 as As,am as Ot,a8 as dn,e as vl,j as yl,A as xl,q as qn,p as En,ax as bl,aj as Jt,aa as bs,ai as St,ah as kn,b7 as Sl,H as _l,an as ho,ao as go,ak as wl,b8 as jl,b9 as Bt,ba as kl,bb as El,bc as Rl,ag as vo,bd as Ss,be as Al,bf as Cl,bg as Nl,ae as Tl,aN as Vl,aP as Pl,aI as Ml,bh as Dl,bi as Il,bj as Kl,a9 as yo,bk as Fl,ad as Bl,bl as Ol}from"./parse-sections-CigeyiXV.js";import{a as Ll}from"./Copy01-B341DqLV.js";import{a as Cs,e as $o}from"./UserSquare-pmxb5ZdZ.js";import{i as xo}from"./Tool01-2gJDR0Ho.js";import{s as bo}from"./Image01-hTzc15CE.js";import{s as $l}from"./Plus-Dewm72je.js";import{s as zl}from"./Trash01-DjE7Raat.js";import{i as Ns}from"./ZoomOut-DixQygt2.js";import{u as Hl,a as So,K as Wl,P as ql,b as Gl,C as Ul,D as Yl,c as Jl}from"./core.esm-BmE_KURk.js";import{u as Ql,s as Xl,a as Yn,S as Zl,v as ec}from"./sortable.esm-CE2eXOQU.js";import{s as tc,g as nc,u as sc,A as rc}from"./use-section-preview-base-CrcAXE9z.js";import{i as oc}from"./thread-intent-CoB1rbzj.js";import{A as _s}from"./avatar-DjIkOwsx.js";import{e as ac,d as _o,b as ic,A as lc,a as cc,f as uc}from"./alert-dialog-BdWXpnme.js";import{b as dc}from"./format-time-Cq80KKvY.js";import{e as fc}from"./shell-layout-Dpds4_um.js";import{u as mc}from"./use-members-Cl1_-fx1.js";import{a as pc,P as wo,w as hc,b as gc}from"./page-seo-form-C0_Mzxj0.js";import{u as vc}from"./use-apply-named-rule-R20A_NaL.js";import{c as jo,d as ko,e as yc,f as xc,g as bc}from"./variant-draft-pointer-Cjn_TXkR.js";import"./use-panel-navigate-CXkMPISv.js";import"./thread-route-BPSSuk8V.js";import"./use-project-scope-BOj2O9A_.js";import"./autosend-BTx7-p6a.js";import"./use-mcp-client-2WkK0AxE.js";import"./auth-DVebpHI3.js";import"./use-decopilot-events-CuBncVze.js";import"./watch-sse-pool-C9NPGTmI.js";import"./task-board-ByNQwZsl.js";import"./schema-b5uziS6S.js";import"./backoff-CrEUbyZT.js";import"./use-ai-providers-Ct47MIru.js";import"./location-V0VwTJTt.js";import"./use-organization-settings-CE5BJyh9.js";import"./utils-t1gjPfET.js";import"./Play-CByslM3d.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-v8_ULhan.js";import"./LinkBroken01-Dioz3u9i.js";import"./collapsible-BcZaehP2.js";import"./use-copy-C4LbXPXl.js";import"./usage-stats-CKpL0uWf.js";import"./tool-namespace-DePiqr-m.js";import"./form-BGI3x6he.js";import"./label-TKhfC6jr.js";import"./utils-CVEq3hMx.js";import"./markdown-D_Bab0vD.js";import"./use-mobile-BAnIvR27.js";import"./use-clock-tick-DE4s8Okz.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-C5DYTOzS.js";import"./types-CNU-uWw-.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./AlertCircle-Cch634f7.js";import"./XClose-BVxVAZ6V.js";import"./ShoppingBag01-BStpgW0a.js";import"./SearchMd-7Jo0ZofC.js";import"./sheet-DdrzSnyB.js";import"./integration-icon-VoZokpOe.js";import"./use-connection-HenJjVMr.js";import"./use-navigate-to-agent-C2NQ-36B.js";import"./Link01-hfA48cFL.js";import"./use-mcp-prompts-BY0itm-N.js";import"./Monitor01-Bz6QaUO4.js";import"./use-thread-outputs-C38yfNsJ.js";import"./file-type-icon-DYeFNgMs.js";import"./secret-ciphertext-CKG2rzpX.js";import"./alert-DlpN1nbO.js";import"./switch-BI2l0q9a.js";import"./textarea-7I-DLD6x.js";import"./ChevronSelectorVertical-C5d75KyY.js";import"./command-KmLWWmqo.js";import"./index-BliYmmPu.js";import"./popover-s88DXvPL.js";import"./monaco-editor-CVRVgXSh.js";import"./editor-DAekV0he.js";import"./delay-CnY5UFtP.js";import"./calendar-kdikRXDO.js";import"./SwitchHorizontal01-CrC4ThKg.js";import"./Minus-DqDPTtRG.js";import"./select-H4FJk0rp.js";import"./index-BdQq_4o_.js";import"./index-CdhgpKbn.js";import"./editor-classes-BaBC2QPU.js";import"./toggle-group-BngkTNsG.js";import"./active-indicator-CCMhAsc_.js";import"./combobox-CEzxugDA.js";import"./Upload01-CYfTR3aZ.js";import"./DotsVertical-DbrlDgFh.js";import"./search-input-BL6XGlmm.js";import"./tabs-Cw5epDK7.js";import"./use-debounced-value-Br6JzfN-.js";import"./use-file-configs-B_k4AoEo.js";import"./asset-utils-CYj7sEud.js";import"./useInfiniteQuery-CxzyY6DS.js";import"./infiniteQueryObserver-BOCgDRcQ.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./use-session-runtime-CqJF6neP.js";import"./sandbox-git-api-CH_-QFpD.js";import"./sandbox-url-D3mC8qhT.js";import"./ArrowUp-DLUdomd9.js";import"./ArrowLeft-CohopnCT.js";import"./Building02-BHJQSDUK.js";import"./CheckCircle-Cs8i9zYt.js";import"./CreditCard01-4Fwr0tNh.js";import"./Globe04-BE6c1UDj.js";import"./Key01-kTu6t6u_.js";import"./Sun-C37Hpdko.js";import"./User01-X6IeKYZH.js";import"./Users01-uKJoVSle.js";import"./experiments-tab-choice-CQ5EsK8h.js";import"./use-sandbox-events-BVhJrX2Z.js";import"./slider-tSRa1HDF.js";import"./index-BEaGR-Ng.js";import"./tooltipContext-B3bWUtmi.js";import"./CategoricalChart-BCAB1JR1.js";import"./index-DVxNOEMj.js";import"./ActiveShapeUtils-BB436TvV.js";import"./Sector-D64VY8hG.js";import"./symbol-CW0bfPL3.js";import"./empty-state-B4dSQMeM.js";import"./section-preview-url-7zfngvgW.js";import"./slugify-CEUa2lfQ.js";import"./differenceInSeconds-C3x8sHUj.js";import"./project-icon-Ds8VtVRG.js";import"./new-project-dialog-DfI138Mw.js";import"./repository-import-picker-BOku3VrR.js";import"./repository-picker-CeCsQGv8.js";import"./collection-search-7sBPioRN.js";import"./required-auth-layout-DhxdstQv.js";import"./use-org-sso-BnFa9r-G.js";import"./use-org-auth-client-vWdVrvgR.js";import"./use-move-blocks-lN8kagdi.js";const Sc={escape:vi};function _c(n,e){for(const r of tc(n,e)){const a=typeof r.title=="string"?r.title:void 0;if(a?.includes("{{"))return a}}function wc(n,e){if(!e)return;const r=hl(n,oc(e));if(r)try{const a=_c(r.resolveType,e);return a&&fl.render(a,r.data,{},Sc).trim()||void 0}catch{return}}function jc(n){const e=ct.c(13),{icon:r,label:a,className:l}=n;let u;e[0]!==l?(u=me("size-3.5",l),e[0]=l,e[1]=u):u=e[1];let y;e[2]!==r||e[3]!==u?(y=o.jsx(r,{className:u}),e[2]=r,e[3]=u,e[4]=y):y=e[4];let m;e[5]!==a||e[6]!==y?(m=o.jsx(Ct,{asChild:!0,children:o.jsx("span",{role:"img","aria-label":a,className:"shrink-0 cursor-help",children:y})}),e[5]=a,e[6]=y,e[7]=m):m=e[7];let b;e[8]!==a?(b=o.jsx(Nt,{className:"max-w-56",children:a}),e[8]=a,e[9]=b):b=e[9];let h;return e[10]!==m||e[11]!==b?(h=o.jsxs(At,{children:[m,b]}),e[10]=m,e[11]=b,e[12]=h):h=e[12],h}const kc="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function Eo(n){return Array.from({length:n},(e,r)=>({id:crypto.randomUUID(),index:r}))}function zo(n){return n.map((e,r)=>({...e,index:r}))}function Ec(n,e){if(e===n.length)return n;if(e<n.length)return zo(n.slice(0,e));const r=Array.from({length:e-n.length},(a,l)=>({id:crypto.randomUUID(),index:n.length+l}));return[...n,...r]}function Ho(n){const e=ct.c(44),{section:r,raw:a,meta:l,decofile:u}=n,y=Lt(),m=Zn(),b=r.isSavedBlock===!0,h=r.isMultivariate===!0;let k;e[0]!==l||e[1]!==a?(k=a&&l?nc(a,l):void 0,e[0]=l,e[1]=a,e[2]=k):k=e[2];const N=k;let L;e[3]!==l||e[4]!==h||e[5]!==a||e[6]!==b?(L=a&&l&&!b&&!h?wc(a,l):void 0,e[3]=l,e[4]=h,e[5]=a,e[6]=b,e[7]=L):L=e[7];const z=L;let H;e[8]!==u||e[9]!==l||e[10]!==a||e[11]!==r?(H=wi(a,r,u,l),e[8]=u,e[9]=l,e[10]=a,e[11]=r,e[12]=H):H=e[12];const B=H;let w;e[13]!==h||e[14]!==a?.__resolveType?(w=!h&&Is(a?.__resolveType??""),e[13]=h,e[14]=a?.__resolveType,e[15]=w):w=e[15];const p=w,te=b?Qn:h?Bo:$o;let E;e[16]!==h||e[17]!==b?(E=b?{color:gl}:h?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=h,e[17]=b,e[18]=E):E=e[18];const W=E;let V;e[19]!==te||e[20]!==m?(V=m?o.jsxs("span",{className:"relative size-4 shrink-0",children:[o.jsx(te,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),o.jsx(ki,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):o.jsx(Yi,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=te,e[20]=m,e[21]=V):V=e[21];let J;e[22]!==N?(J=N&&o.jsx("img",{src:N,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=N,e[23]=J):J=e[23];let g;e[24]!==m||e[25]!==W?(g=!m&&o.jsx(Cs,{className:"h-4 w-4 shrink-0",style:W}),e[24]=m,e[25]=W,e[26]=g):g=e[26];const Q=m?"shrink":"flex-1",x=r.isHidden&&"line-through opacity-50";let Z;e[27]!==x||e[28]!==Q?(Z=me("min-w-0 truncate text-sm font-medium",Q,x),e[27]=x,e[28]=Q,e[29]=Z):Z=e[29];const q=z??r.label;let pe;e[30]!==Z||e[31]!==q?(pe=o.jsx("span",{className:Z,children:q}),e[30]=Z,e[31]=q,e[32]=pe):pe=e[32];let ye;e[33]!==p||e[34]!==m||e[35]!==B||e[36]!==y?(ye=m?o.jsxs(o.Fragment,{children:[p&&o.jsx(jc,{icon:Ns,label:y("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),B&&o.jsx(Xr,{}),o.jsx("span",{className:"min-w-0 flex-1"})]}):B&&o.jsx(Xr,{className:"absolute -right-0.5 -top-0.5"}),e[33]=p,e[34]=m,e[35]=B,e[36]=y,e[37]=ye):ye=e[37];let ue;return e[38]!==pe||e[39]!==ye||e[40]!==V||e[41]!==J||e[42]!==g?(ue=o.jsxs(o.Fragment,{children:[V,J,g,pe,ye]}),e[38]=pe,e[39]=ye,e[40]=V,e[41]=J,e[42]=g,e[43]=ue):ue=e[43],ue}const Rc="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Ac="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]";function Wo(n,e,r){if(r)return ji({selected:e});const a=n.isSavedBlock===!0,l=n.isMultivariate===!0;return me("group relative flex select-none items-center gap-2 rounded-[var(--studio-control-radius,var(--radius-md))] px-2 py-2.5",e?"bg-accent text-accent-foreground":a?Rc:l?Ac:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function ws(n,e){return me("h-7 shrink-0 overflow-hidden",e?"w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]":n?"w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100":"w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]")}function Cc(n){const e=ct.c(90),{section:r,raw:a,meta:l,decofile:u,sortableId:y,selected:m,onSelect:b,onDelete:h,onDuplicate:k,onMakeReusable:N,onToggleHidden:L,onToggleLazy:z,onAddVariant:H,onDetach:B}=n,w=Lt(),p=Zn(),te=a?Is(a.__resolveType??""):!1,E=r.isHidden===!0,W=te||E;let V;e[0]!==r?(V=Oo(r),e[0]=r,e[1]=V):V=e[1];const J=V,g=!!z&&!r.isMultivariate;let Q;e[2]!==y?(Q={id:y,animateLayoutChanges:Vc},e[2]=y,e[3]=Q):Q=e[3];const{attributes:x,listeners:Z,setNodeRef:q,transform:pe,isDragging:ye}=Ql(Q);let ue;e[4]!==pe?(ue=Ul.Transform.toString(pe?{...pe,x:0}:null),e[4]=pe,e[5]=ue):ue=e[5];const fe=ye?0:void 0;let Re;e[6]!==ue||e[7]!==fe?(Re={transform:ue,opacity:fe},e[6]=ue,e[7]=fe,e[8]=Re):Re=e[8];const j=Re;let re;e[9]!==r?(re=xi(r),e[9]=r,e[10]=re):re=e[10];const Ae=re,Ce="button",S=0;let I;e[11]!==b?(I=K=>{(K.key==="Enter"||K.key===" ")&&(K.preventDefault(),b())},e[11]=b,e[12]=I):I=e[12];const he=ye?"cursor-grabbing":"cursor-pointer";let M;e[13]!==p||e[14]!==r||e[15]!==m||e[16]!==he?(M=me("touch-none transition-colors",he,Wo(r,m,p)),e[13]=p,e[14]=r,e[15]=m,e[16]=he,e[17]=M):M=e[17];let xe;e[18]!==u||e[19]!==l||e[20]!==a||e[21]!==r?(xe=o.jsx(Ho,{section:r,raw:a,meta:l,decofile:u}),e[18]=u,e[19]=l,e[20]=a,e[21]=r,e[22]=xe):xe=e[22];const O=!p&&g&&o.jsxs(At,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(Et,{type:"button",variant:"ghost",size:"icon","aria-label":w(te?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:me(ws(W,te)),onClick:K=>{K.stopPropagation(),z?.()},onPointerDown:Tc,children:o.jsx(Ns,{className:me("h-3.5 w-3.5",te&&"text-warning")})})}),o.jsx(Nt,{side:"bottom",children:w(te?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),oe=p?o.jsx(bi,{label:w(E?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:E,onToggle:L,children:E?o.jsx(xo,{className:"h-3.5 w-3.5"}):o.jsx(bo,{className:"h-3.5 w-3.5"})}):o.jsxs(At,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(Et,{type:"button",variant:"ghost",size:"icon","aria-label":w(E?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:me(ws(W,E)),onClick:K=>{K.stopPropagation(),L()},onPointerDown:Nc,children:E?o.jsx(xo,{className:"h-3.5 w-3.5"}):o.jsx(bo,{className:"h-3.5 w-3.5"})})}),o.jsx(Nt,{side:"bottom",children:w(E?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),G=ui,Ie=Si;let ke;e[23]!==w?(ke=w("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=w,e[24]=ke):ke=e[24];const ut=me(ws(W,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let Ze;e[25]!==Ie||e[26]!==ke||e[27]!==ut?(Ze=o.jsx(Ie,{label:ke,classicClassName:ut}),e[25]=Ie,e[26]=ke,e[27]=ut,e[28]=Ze):Ze=e[28];let $e;e[29]!==p||e[30]!==g||e[31]!==te||e[32]!==z||e[33]!==w?($e=p&&g&&o.jsxs(o.Fragment,{children:[o.jsxs(ln,{onClick:K=>{K.stopPropagation(),z?.()},children:[o.jsx(Ns,{className:"h-4 w-4"}),w(te?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),o.jsx(ci,{})]}),e[29]=p,e[30]=g,e[31]=te,e[32]=z,e[33]=w,e[34]=$e):$e=e[34];let qe;e[35]!==k?(qe=K=>{K.stopPropagation(),k()},e[35]=k,e[36]=qe):qe=e[36];let at;e[37]===Symbol.for("react.memo_cache_sentinel")?(at=o.jsx(Ll,{className:"h-4 w-4"}),e[37]=at):at=e[37];let Ge;e[38]!==w?(Ge=w("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=w,e[39]=Ge):Ge=e[39];let Ue;e[40]!==qe||e[41]!==Ge?(Ue=o.jsxs(ln,{onClick:qe,children:[at,Ge]}),e[40]=qe,e[41]=Ge,e[42]=Ue):Ue=e[42];let Ye;e[43]!==p||e[44]!==J||e[45]!==H||e[46]!==w?(Ye=J&&o.jsxs(ln,{className:me(!p&&_i),onClick:K=>{K.stopPropagation(),H()},children:[o.jsx(Bo,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=p,e[44]=J,e[45]=H,e[46]=w,e[47]=Ye):Ye=e[47];let de;e[48]!==p||e[49]!==Ae||e[50]!==N||e[51]!==w?(de=Ae&&o.jsxs(ln,{className:me(!p&&kc),onClick:K=>{K.stopPropagation(),N()},children:[p?o.jsx(Qn,{className:"h-4 w-4"}):o.jsx(Cs,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=p,e[49]=Ae,e[50]=N,e[51]=w,e[52]=de):de=e[52];let ge;e[53]!==p||e[54]!==B||e[55]!==r.isMultivariate||e[56]!==r.isSavedBlock||e[57]!==w?(ge=r.isSavedBlock===!0&&!r.isMultivariate&&o.jsxs(ln,{onClick:K=>{K.stopPropagation(),B()},children:[p?o.jsx($o,{className:"h-4 w-4"}):o.jsx(Cs,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=p,e[54]=B,e[55]=r.isMultivariate,e[56]=r.isSavedBlock,e[57]=w,e[58]=ge):ge=e[58];let be;e[59]!==h?(be=K=>{K.stopPropagation(),h()},e[59]=h,e[60]=be):be=e[60];let ee;e[61]===Symbol.for("react.memo_cache_sentinel")?(ee=o.jsx(zl,{className:"h-4 w-4"}),e[61]=ee):ee=e[61];let F;e[62]!==w?(F=w("sectionsEditor.sectionList.deleteMenuItem"),e[62]=w,e[63]=F):F=e[63];let De;e[64]!==be||e[65]!==F?(De=o.jsxs(ln,{variant:"destructive",onClick:be,children:[ee,F]}),e[64]=be,e[65]=F,e[66]=De):De=e[66];let et;e[67]!==$e||e[68]!==Ue||e[69]!==Ye||e[70]!==de||e[71]!==ge||e[72]!==De?(et=o.jsxs(di,{align:"end",className:"w-44",children:[$e,Ue,Ye,de,ge,De]}),e[67]=$e,e[68]=Ue,e[69]=Ye,e[70]=de,e[71]=ge,e[72]=De,e[73]=et):et=e[73];let tt;e[74]!==G||e[75]!==Ze||e[76]!==et?(tt=o.jsxs(G,{children:[Ze,et]}),e[74]=G,e[75]=Ze,e[76]=et,e[77]=tt):tt=e[77];let st;return e[78]!==x||e[79]!==Z||e[80]!==b||e[81]!==q||e[82]!==j||e[83]!==M||e[84]!==xe||e[85]!==O||e[86]!==oe||e[87]!==tt||e[88]!==I?(st=o.jsxs("div",{ref:q,style:j,...x,...Z,role:Ce,tabIndex:S,onClick:b,onKeyDown:I,className:M,children:[xe,O,oe,tt]}),e[78]=x,e[79]=Z,e[80]=b,e[81]=q,e[82]=j,e[83]=M,e[84]=xe,e[85]=O,e[86]=oe,e[87]=tt,e[88]=I,e[89]=st):st=e[89],st}function Nc(n){return n.stopPropagation()}function Tc(n){return n.stopPropagation()}function Vc(){return!1}function Ts(n){const e=ct.c(11),{canAddSection:r,onAddSection:a,className:l,size:u}=n,y=Lt();let m;e[0]!==l?(m=me("w-full",l),e[0]=l,e[1]=m):m=e[1];const b=!r;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx($l,{size:14}),e[2]=h):h=e[2];let k;e[3]!==y?(k=y("sectionsEditor.sectionList.addSectionButton"),e[3]=y,e[4]=k):k=e[4];let N;return e[5]!==a||e[6]!==u||e[7]!==m||e[8]!==b||e[9]!==k?(N=o.jsxs(Et,{type:"button",variant:"outline",size:u,className:m,disabled:b,onClick:a,children:[h,k]}),e[5]=a,e[6]=u,e[7]=m,e[8]=b,e[9]=k,e[10]=N):N=e[10],N}function Pc(n){const e=ct.c(101),{listKey:r,rawSections:a,sections:l,meta:u,decofile:y,selectedIndex:m,onSelect:b,onReorder:h,onDelete:k,onDuplicate:N,onMakeReusable:L,onToggleHidden:z,onToggleLazy:H,onAddVariant:B,onDetach:w,onAddSection:p,canAddSection:te}=n,E=te===void 0?!0:te,W=Lt(),V=Zn();let J;e[0]!==l.length?(J=()=>Eo(l.length),e[0]=l.length,e[1]=J):J=e[1];const[g,Q]=R.useState(J),[x,Z]=R.useState(null),[q,pe]=R.useState(r),[ye,ue]=R.useState(l.length),fe=R.useRef(!1);q!==r?(pe(r),ue(l.length),Q(Eo(l.length))):ye!==l.length&&(ue(l.length),Q(Je=>Ec(Je,l.length)));let Re;e[2]===Symbol.for("react.memo_cache_sentinel")?(Re={activationConstraint:{distance:8}},e[2]=Re):Re=e[2];let j;e[3]===Symbol.for("react.memo_cache_sentinel")?(j={coordinateGetter:Xl},e[3]=j):j=e[3];const re=Hl(So(ql,Re),So(Wl,j));let Ae;e[4]!==g?(Ae=g.map(Mc),e[4]=g,e[5]=Ae):Ae=e[5];const Ce=Ae;let S;e[6]===Symbol.for("react.memo_cache_sentinel")?(S=Je=>{Z(String(Je.active.id))},e[6]=S):S=e[6];const I=S;let he;e[7]!==Ce||e[8]!==h?(he=Je=>{Z(null);const{active:ie,over:Ne}=Je;if(!Ne||ie.id===Ne.id)return;const ze=Ce.indexOf(String(ie.id)),rt=Ce.indexOf(String(Ne.id));ze===-1||rt===-1||(Q(it=>zo(Yn([...it],ze,rt))),fe.current=!0,requestAnimationFrame(()=>{fe.current=!1}),h?.(ze,rt))},e[7]=Ce,e[8]=h,e[9]=he):he=e[9];const M=he;let xe;e[10]===Symbol.for("react.memo_cache_sentinel")?(xe=()=>{Z(null)},e[10]=xe):xe=e[10];const O=xe;let oe,G,Ie,ke,ut,Ze,$e,qe,at,Ge,Ue,Ye,de,ge,be;if(e[11]!==x||e[12]!==E||e[13]!==V||e[14]!==y||e[15]!==g||e[16]!==Ce||e[17]!==M||e[18]!==u||e[19]!==p||e[20]!==B||e[21]!==k||e[22]!==w||e[23]!==N||e[24]!==L||e[25]!==b||e[26]!==z||e[27]!==H||e[28]!==a||e[29]!==l||e[30]!==m||e[31]!==re||e[32]!==W){ge=Symbol.for("react.early_return_sentinel");e:{const Je=ie=>{fe.current||b(ie)};if(e[48]!==x||e[49]!==E||e[50]!==V||e[51]!==g||e[52]!==p||e[53]!==a||e[54]!==l||e[55]!==W){const ie=x?g.find(Ne=>Ne.id===x):null;if(ke=ie!=null?l[ie.index]:null,Ie=ie!=null?a[ie.index]:void 0,g.length===0){let Ne;e[59]!==W?(Ne=W("sectionsEditor.sectionList.noSections"),e[59]=W,e[60]=Ne):Ne=e[60];let ze;e[61]!==Ne?(ze=o.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:Ne}),e[61]=Ne,e[62]=ze):ze=e[62];const rt=ze;let it;e[63]!==E||e[64]!==V||e[65]!==rt||e[66]!==p?(it=V?rt:o.jsxs("div",{className:"space-y-2",children:[rt,o.jsx(Ts,{canAddSection:E,onAddSection:p,size:"sm"})]}),e[63]=E,e[64]=V,e[65]=rt,e[66]=p,e[67]=it):it=e[67],ge=it;break e}de=me(ie&&"cursor-grabbing"),e[48]=x,e[49]=E,e[50]=V,e[51]=g,e[52]=p,e[53]=a,e[54]=l,e[55]=W,e[56]=Ie,e[57]=ke,e[58]=de}else Ie=e[56],ke=e[57],de=e[58];G=Yl,qe=re,at=Jl,Ge=I,Ue=M,Ye=O,oe=Zl,Ze=Ce,$e=ec,be="space-y-1",ut=g.map(ie=>{const Ne=l[ie.index];return Ne?o.jsx(Cc,{sortableId:ie.id,section:Ne,raw:a[ie.index],meta:u,decofile:y,selected:m===ie.index,onSelect:()=>Je(ie.index),onDelete:()=>k(ie.index),onDuplicate:()=>N(ie.index),onMakeReusable:()=>L(ie.index),onToggleHidden:()=>z(ie.index),onToggleLazy:H?()=>H(ie.index):void 0,onAddVariant:()=>B(ie.index),onDetach:()=>w(ie.index)},ie.id):null})}e[11]=x,e[12]=E,e[13]=V,e[14]=y,e[15]=g,e[16]=Ce,e[17]=M,e[18]=u,e[19]=p,e[20]=B,e[21]=k,e[22]=w,e[23]=N,e[24]=L,e[25]=b,e[26]=z,e[27]=H,e[28]=a,e[29]=l,e[30]=m,e[31]=re,e[32]=W,e[33]=oe,e[34]=G,e[35]=Ie,e[36]=ke,e[37]=ut,e[38]=Ze,e[39]=$e,e[40]=qe,e[41]=at,e[42]=Ge,e[43]=Ue,e[44]=Ye,e[45]=de,e[46]=ge,e[47]=be}else oe=e[33],G=e[34],Ie=e[35],ke=e[36],ut=e[37],Ze=e[38],$e=e[39],qe=e[40],at=e[41],Ge=e[42],Ue=e[43],Ye=e[44],de=e[45],ge=e[46],be=e[47];if(ge!==Symbol.for("react.early_return_sentinel"))return ge;let ee;e[68]!==ut||e[69]!==be?(ee=o.jsx("div",{className:be,children:ut}),e[68]=ut,e[69]=be,e[70]=ee):ee=e[70];let F;e[71]!==oe||e[72]!==Ze||e[73]!==$e||e[74]!==ee?(F=o.jsx(oe,{items:Ze,strategy:$e,children:ee}),e[71]=oe,e[72]=Ze,e[73]=$e,e[74]=ee,e[75]=F):F=e[75];let De;e[76]!==Ie||e[77]!==ke||e[78]!==V||e[79]!==y||e[80]!==u?(De=ke?o.jsx("div",{className:me("cursor-grabbing shadow-lift",Wo(ke,!1,V)),children:o.jsx(Ho,{section:ke,raw:Ie,meta:u,decofile:y})}):null,e[76]=Ie,e[77]=ke,e[78]=V,e[79]=y,e[80]=u,e[81]=De):De=e[81];let et;e[82]!==De?(et=li.createPortal(o.jsx(Gl,{dropAnimation:yi,children:De}),document.body),e[82]=De,e[83]=et):et=e[83];let tt;e[84]!==G||e[85]!==qe||e[86]!==at||e[87]!==Ge||e[88]!==Ue||e[89]!==Ye||e[90]!==F||e[91]!==et?(tt=o.jsxs(G,{sensors:qe,collisionDetection:at,onDragStart:Ge,onDragEnd:Ue,onDragCancel:Ye,children:[F,et]}),e[84]=G,e[85]=qe,e[86]=at,e[87]=Ge,e[88]=Ue,e[89]=Ye,e[90]=F,e[91]=et,e[92]=tt):tt=e[92];let st;e[93]!==E||e[94]!==V||e[95]!==p?(st=!V&&o.jsx(Ts,{canAddSection:E,onAddSection:p,size:"sm",className:"mt-2"}),e[93]=E,e[94]=V,e[95]=p,e[96]=st):st=e[96];let K;return e[97]!==de||e[98]!==tt||e[99]!==st?(K=o.jsxs("div",{className:de,children:[tt,st]}),e[97]=de,e[98]=tt,e[99]=st,e[100]=K):K=e[100],K}function Mc(n){return n.id}function js(n,e,r,a,l){if(!n||!e)return null;if(!e.isMultivariate)return kt(n,e,a,l)?.data??null;const u=ot(n,e),y=u?Es(u,al)[r]:void 0;return y?Lo(y.value,a)?.data??null:null}const Dc=50;function Ic(n,e){n.own.push(Le(e)),n.own.length>Dc&&n.own.shift()}function Ro(n,e){return n.own.includes(Le(e))}function Kc(n,e){const{sectionIndex:r,variantIndex:a,shown:l,next:u,sectionCount:y}=e;return n&&n.sectionIndex===r&&n.variantIndex===a&&n.emitted===l?(n.emitted=u,n):l?{sectionIndex:r,variantIndex:a,base:l,emitted:u,sectionCount:y,own:[Le(l)]}:null}function qo(n,e){return e!==null&&Le(n)!==Le(e)}function Go(n,e){return n.__resolveType!==e.__resolveType}function Fc(n,e,r,a){if(e.length===a)return"here";const l=Le(n),u=e.flatMap((y,m)=>m!==r&&y!==null&&Le(y)===l?[m]:[]);return u.length===1?u[0]:"unknown"}function Ao({formBase:n,rebased:e,versionOf:r}){let a=null;return{ifMatch:l=>{a=l,n&&(n.version===void 0||e)&&(n.version=r(l));const u=n?n.version:r(l);return u===void 0?void 0:{[l]:u}},onApplied:l=>{n&&a!==null&&Object.hasOwn(l,a)&&(n.version=l[a])},reloadOnConflict:!0}}function Bc({merged:n,tracked:e,current:r,saved:a}){return!!n&&!!e&&r===e&&e.emitted===a}function Co(n,e){return!!n&&!!e&&n.contains(e)}function Vs(n){const e=[],r=Ps("",n.ancestor,n.mine,n.theirs,e);return{...n,merged:r,pointers:e}}function Ps(n,e,r,a,l){const u=(y,m)=>Le(y)===Le(m);if(u(r,a)||u(e,a))return r;if(u(e,r))return a;if(ks(r)&&ks(a)){const y=ks(e)?e:{},m={},b=[...Object.keys(r),...Object.keys(a).filter(h=>!(h in r))];for(const h of b){const k=Ps(`${n}/${h.replaceAll("~","~0").replaceAll("/","~1")}`,y[h],r[h],a[h],l);k!==void 0&&(m[h]=k)}return m}return Array.isArray(e)&&Array.isArray(r)&&Array.isArray(a)&&r.length===e.length&&a.length===e.length?e.map((y,m)=>Ps(`${n}/${m}`,y,r[m],a[m],l)):(l.push(n),a)}function ks(n){return!!n&&typeof n=="object"&&!Array.isArray(n)}function Oc(n,e){let r=n.merged;for(const a of n.pointers)e[a]==="mine"&&(r=Hc(r,a,Xt(n.mine,a)));return r}function Lc(n,e){return Object.fromEntries(n.pointers.map(r=>[r,e]))}function Uo(n){return Lc(n,"mine")}function Ms(n,e,r){const a=Uo(r);for(const l of r.pointers){const u=e[l];if(!u||!n.pointers.includes(l))continue;["mine","theirs"].every(m=>Le(Xt(n[m],l))===Le(Xt(r[m],l)))&&(a[l]=u)}return a}function Yo(n,e,r={}){const a=e.pointers.filter(l=>!n.pointers.includes(l)||Le(Xt(n.theirs,l))!==Le(Xt(e.theirs,l)));return a.length===0?r:{...r,...Object.fromEntries(a.map(l=>[l,(r[l]??0)+1]))}}function $c(n,e,r){if(!e||Go(n.plan.ancestor,e)||!qo(n.plan.theirs,e)||r(e))return null;const a=Vs({...n.plan,theirs:e});return a.pointers.length===0?null:{plan:a,choices:Ms(n.plan,n.choices,a),fresh:Yo(n.plan,a,n.fresh)}}function zc(n,e){return n.pointers.map(r=>({pointer:r,label:Ei(r,e),mine:Xt(n.mine,r),theirs:Xt(n.theirs,r),schema:Wc(e??null,r)}))}function Ks(n){return n.split("/").slice(1).map(e=>e.replaceAll("~1","/").replaceAll("~0","~"))}function Xt(n,e){let r=n;for(const a of Ks(e))if(Array.isArray(r))r=r[Number(a)];else if(r&&typeof r=="object")r=r[a];else return;return r}function Hc(n,e,r){const a=Ks(e),l=(u,y)=>{if(y===a.length)return r;const m=a[y];if(Array.isArray(u)){const k=[...u];return k[Number(m)]=l(u[Number(m)],y+1),k}const b=u&&typeof u=="object"?{...u}:{},h=l(b[m],y+1);return h===void 0?delete b[m]:b[m]=h,b};return l(n,0)}function Wc(n,e){let r=n;for(const a of Ks(e)){if(!r)return null;r=/^\d+$/.test(a)&&!r.properties?.[a]?r.items:r.properties?.[a]}return r??null}const qc=/\.(png|jpe?g|gif|webp|avif|svg)(\?.*)?$/i,No=60,Gc=3;function Jo(n,e){return e?.format==="image-uri"?!0:n.startsWith("data:image/")||/^(https?:)?\/\//.test(n)&&qc.test(n)}function Ds(n,e){if(!(e?.format==="rich-text"||e?.format==="rich-text-inline"||e?.format==="html"||/<\/?[a-z][^>]*>/i.test(n)))return n;const a=n.replace(/<br\s*\/?>/gi,`
|
|
2
2
|
`).replace(/<\/(p|div|li|h[1-6])>/gi,`
|
|
3
3
|
`);return Yc(a).replace(/\u00a0/g," ").replace(/\n{2,}/g,`
|
|
4
4
|
`).trim()}const Uc={" ":" ","&":"&","<":"<",">":">",""":'"',"'":"'"};function Yc(n){if(typeof DOMParser<"u")return new DOMParser().parseFromString(n,"text/html").body.textContent??"";let e=n;for(let r="";r!==e;)r=e,e=e.replace(/<[^<>]*>/g,"");return e.replace(/<|>/g,"").replace(/&(nbsp|amp|lt|gt|quot|#39);/g,r=>Uc[r]??r)}function Jn(n){const e=n.replace(/\s+/g," ").trim();return e.length>No?`${e.slice(0,No-1)}…`:e}function Jc(n){if(n.startsWith("data:"))return"image";const e=n.split(/[?#]/)[0]??n;return decodeURIComponent(e.split("/").pop()||n)}function Xn(n,e){if(n==null||n==="")return{kind:"empty"};if(typeof n=="string")return Jo(n,e)?{kind:"image",src:n}:{kind:"text",text:Ds(n,e)};if(typeof n=="number"||typeof n=="bigint")return{kind:"text",text:String(n)};if(typeof n=="boolean")return{kind:"yesNo",value:n};if(Array.isArray(n)){const r=e?.items??null;return{kind:"list",count:n.length,items:n.slice(0,Gc).map(a=>Qc(a,r)??"")}}if(typeof n=="object"){const r=n;if("value"in r&&Object.keys(r).length<=2)return Xn(r.value,e?.properties?.value??e);const a=Object.entries(r).filter(([l,u])=>!l.startsWith("__")&&u!==void 0).flatMap(([l,u])=>{const y=e?.properties?.[l]??null,m=Xn(u,y);if(m.kind==="empty")return[];const b=m.kind==="text"?Jn(m.text):m.kind==="image"?Jc(m.src):m.kind==="yesNo"?m.value?"✓":"✗":m.kind==="list"?`${m.count}`:"…";return[{label:y?.title?.trim()||l,text:b}]}).slice(0,4);return a.length>0?{kind:"fields",entries:a}:{kind:"empty"}}return{kind:"text",text:String(n)}}function Qc(n,e){if(typeof n=="string")return Jn(Ds(n,e));if(!n||typeof n!="object"||Array.isArray(n))return null;const r=n,a=e?.titleBy,l=a?r[a]:void 0;if(typeof l=="string"&&l.trim())return Jn(l);for(const[u,y]of Object.entries(r))if(!(u.startsWith("__")||typeof y!="string"||!y.trim())&&!Jo(y,e?.properties?.[u]??null))return Jn(Ds(y,null));return null}const To=1500;function Xc(n,e){const r=n.split(/(\s+)/).filter(k=>k!==""),a=e.split(/(\s+)/).filter(k=>k!=="");if(r.length>To||a.length>To)return{mine:[{text:n,kind:"changed"}],theirs:[{text:e,kind:"changed"}]};const l=Array.from({length:r.length+1},()=>new Array(a.length+1).fill(0));for(let k=r.length-1;k>=0;k--)for(let N=a.length-1;N>=0;N--){const L=l[k];L[N]=r[k]===a[N]?l[k+1][N+1]+1:Math.max(l[k+1][N],L[N+1])}const u=[],y=[],m=(k,N,L)=>{const z=k.at(-1);z&&(z.kind===L||L==="same"&&!N.trim())?z.text+=N:k.push({text:N,kind:L})};let b=0,h=0;for(;b<r.length&&h<a.length;)r[b]===a[h]?(m(u,r[b],"same"),m(y,a[h],"same"),b++,h++):l[b+1][h]>=l[b][h+1]?(m(u,r[b],"changed"),b++):(m(y,a[h],"changed"),h++);for(;b<r.length;b++)m(u,r[b],"changed");for(;h<a.length;h++)m(y,a[h],"changed");return{mine:u,theirs:y}}function Zc(n){const e=ct.c(10);let r,a;e[0]!==n?({open:r,...a}=n,e[0]=n,e[1]=r,e[2]=a):(r=e[1],a=e[2]);const{data:l}=Io.useSession();let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=me("max-h-[85vh] grid-rows-[auto_minmax(0,1fr)_auto] sm:max-w-lg"),e[3]=u):u=e[3];const y=l?.user??null;let m;e[4]!==a||e[5]!==y?(m=o.jsx(ac,{className:u,"data-testid":"form-conflict-dialog",onEscapeKeyDown:tu,children:o.jsx(iu,{...a,viewer:y,heading:eu})}),e[4]=a,e[5]=y,e[6]=m):m=e[6];let b;return e[7]!==r||e[8]!==m?(b=o.jsx(uc,{open:r,children:m}),e[7]=r,e[8]=m,e[9]=b):b=e[9],b}function eu(n,e){return o.jsxs(ic,{className:"text-left",children:[o.jsx(lc,{children:n}),o.jsx(cc,{children:e})]})}function tu(n){return n.preventDefault()}const nu={},su=(n,e)=>o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("h2",{className:"text-lg font-semibold",children:n}),o.jsx("p",{className:"text-sm text-muted-foreground",children:e})]});function ru(n,e,r=0,a={},l=null){const u=e[Math.min(r,e.length-1)],y=l?.you?void 0:l?.name?.split(/\s+/)[0],m={field:u?au(u.label):"",label:u?.label??"",name:y??""},b=(h,k,N)=>n(l?.you?N:y?k:h,m);return e.length<=1?{title:b("sectionsEditor.formConflict.titleOne","sectionsEditor.formConflict.titleOneNamed","sectionsEditor.formConflict.titleOneYou"),description:n("sectionsEditor.formConflict.descriptionOne")}:{title:b("sectionsEditor.formConflict.titleStep","sectionsEditor.formConflict.titleStepNamed","sectionsEditor.formConflict.titleStepYou"),description:r>=e.length-1?o.jsx(ou,{t:n,fields:e,choices:a,name:y}):n("sectionsEditor.formConflict.descriptionStep")}}function ou(n){const e=ct.c(11),{t:r,fields:a,choices:l,name:u}=n;let y;if(e[0]!==l||e[1]!==a||e[2]!==u||e[3]!==r){let b;e[5]!==l||e[6]!==u||e[7]!==r?(b=(h,k)=>o.jsxs(R.Fragment,{children:[k>0&&" · ",`${h.label}: `,o.jsx("span",{className:"font-medium text-foreground",children:r((l[h.pointer]??"mine")==="mine"?"sectionsEditor.formConflict.summaryYours":u?"sectionsEditor.formConflict.summaryTheirsNamed":"sectionsEditor.formConflict.summaryTheirs",{name:u??""})})]},h.pointer),e[5]=l,e[6]=u,e[7]=r,e[8]=b):b=e[8],y=a.map(b),e[0]=l,e[1]=a,e[2]=u,e[3]=r,e[4]=y}else y=e[4];let m;return e[9]!==y?(m=o.jsx("span",{"data-testid":"form-conflict-summary",children:y}),e[9]=y,e[10]=m):m=e[10],m}function au(n){return/^[A-Z][a-z]/.test(n)&&!n.includes("›")?n.charAt(0).toLowerCase()+n.slice(1):n}function iu(n){const e=ct.c(68),r=Lt(),{fields:a,choices:l,changedAgain:u,fresh:y,heading:m}=n,b=u===void 0?!1:u,h=y===void 0?nu:y,k=m===void 0?su:m,N=a.length>1,[L,z]=R.useState(0),[H,B]=R.useState(lu);let w;e[0]===Symbol.for("react.memo_cache_sentinel")?(w={},e[0]=w):w=e[0];const[p,te]=R.useState(w),E=Math.max(0,Math.min(L,a.length-1)),W=a[E],V=E===a.length-1;let J;e[1]!==E||e[2]!==a||e[3]!==h?(J=xe=>{const O=a[E],oe=a[xe];!O||!oe||xe===E||(B(G=>new Set(G).add(O.pointer)),te(G=>({...G,[O.pointer]:h[O.pointer]??0,[oe.pointer]:h[oe.pointer]??0})),z(xe))},e[1]=E,e[2]=a,e[3]=h,e[4]=J):J=e[4];const g=J;let Q;e[5]!==E||e[6]!==g?(Q=xe=>{if(!xe)return;const O=oe=>{const G={ArrowLeft:-1,ArrowRight:1}[oe.key];!G||oe.defaultPrevented||oe.altKey||oe.ctrlKey||oe.metaKey||oe.shiftKey||fc(oe.target)||(oe.preventDefault(),g(E+G))};return xe.ownerDocument.addEventListener("keydown",O),()=>xe.ownerDocument.removeEventListener("keydown",O)},e[5]=E,e[6]=g,e[7]=Q):Q=e[7];const x=Q;if(!W)return null;let Z,q,pe,ye,ue;if(e[8]!==H||e[9]!==E||e[10]!==l||e[11]!==a||e[12]!==h||e[13]!==g||e[14]!==k||e[15]!==x||e[16]!==N||e[17]!==n||e[18]!==p||e[19]!==r){const{title:xe,description:O}=ru(r,a,E,l,n.author??null);let oe;e[25]!==n?(oe=G=>{G.detail>1||n.onApply()},e[25]=n,e[26]=oe):oe=e[26],Z=oe,q=N?x:void 0,pe="flex min-w-0 flex-col gap-3",e[27]!==H||e[28]!==E||e[29]!==a||e[30]!==h||e[31]!==g||e[32]!==N||e[33]!==p||e[34]!==r?(ye=N&&o.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o.jsx("div",{role:"group","aria-label":r("sectionsEditor.formConflict.steps"),className:"-m-1 flex flex-wrap items-center",children:a.map((G,Ie)=>{const ke=Ie!==E&&(h[G.pointer]??0)>(p[G.pointer]??0);return o.jsx("button",{type:"button","aria-label":ke?r("sectionsEditor.formConflict.stepChangedAgain",{label:G.label}):G.label,"aria-current":Ie===E?"step":void 0,"data-answered":Ie!==E&&H.has(G.pointer)?"":void 0,"data-changed-again":ke?"":void 0,onClick:()=>g(Ie),className:"group cursor-pointer rounded-full p-1 focus-ring",children:o.jsx("span",{className:me("block h-2 w-2 rounded-full bg-border transition-[width,background-color,box-shadow] motion-reduce:transition-none","group-hover:bg-muted-foreground/60","group-data-[answered]:bg-foreground/45","group-aria-[current=step]:w-5 group-aria-[current=step]:bg-foreground","group-data-[changed-again]:ring-2 group-data-[changed-again]:ring-warning group-data-[changed-again]:ring-offset-1 group-data-[changed-again]:ring-offset-background")})},G.pointer)})}),o.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:r("sectionsEditor.formConflict.stepCount",{step:String(E+1),count:String(a.length)})})]}),e[27]=H,e[28]=E,e[29]=a,e[30]=h,e[31]=g,e[32]=N,e[33]=p,e[34]=r,e[35]=ye):ye=e[35],ue=k(xe,O),e[8]=H,e[9]=E,e[10]=l,e[11]=a,e[12]=h,e[13]=g,e[14]=k,e[15]=x,e[16]=N,e[17]=n,e[18]=p,e[19]=r,e[20]=Z,e[21]=q,e[22]=pe,e[23]=ye,e[24]=ue}else Z=e[20],q=e[21],pe=e[22],ye=e[23],ue=e[24];let fe;e[36]!==q||e[37]!==pe||e[38]!==ye||e[39]!==ue?(fe=o.jsxs("div",{ref:q,className:pe,children:[ye,ue]}),e[36]=q,e[37]=pe,e[38]=ye,e[39]=ue,e[40]=fe):fe=e[40];const Re=!b&&"sr-only";let j;e[41]!==Re?(j=me("text-sm text-muted-foreground",Re),e[41]=Re,e[42]=j):j=e[42];let re;e[43]!==b||e[44]!==N||e[45]!==r?(re=b?r(N?"sectionsEditor.formConflict.changedAgainSteps":"sectionsEditor.formConflict.changedAgain"):"",e[43]=b,e[44]=N,e[45]=r,e[46]=re):re=e[46];let Ae;e[47]!==j||e[48]!==re?(Ae=o.jsx("p",{role:"status",className:j,children:re}),e[47]=j,e[48]=re,e[49]=Ae):Ae=e[49];const Ce=N?"vertical":"all";let S;e[50]!==W||e[51]!==n||e[52]!==Ce?(S=o.jsx(fu,{field:W,...n,arrows:Ce}),e[50]=W,e[51]=n,e[52]=Ce,e[53]=S):S=e[53];let I;e[54]!==Ae||e[55]!==S?(I=o.jsxs("div",{className:"-mx-2 flex min-h-0 flex-col gap-3 overflow-y-auto px-2 py-1",children:[Ae,S]}),e[54]=Ae,e[55]=S,e[56]=I):I=e[56];let he;e[57]!==Z||e[58]!==E||e[59]!==g||e[60]!==V||e[61]!==N||e[62]!==r?(he=N?o.jsxs(_o,{className:"flex-row flex-wrap items-center justify-between gap-2 sm:justify-between",children:[o.jsx(Et,{type:"button",variant:"outline","aria-disabled":E===0,onClick:()=>g(E-1),className:"aria-disabled:cursor-default aria-disabled:opacity-45",children:r("sectionsEditor.formConflict.back")}),o.jsx(Et,{type:"button","data-testid":"form-conflict-primary",onClick:V?Z:()=>g(E+1),children:r(V?"sectionsEditor.formConflict.ok":"sectionsEditor.formConflict.next")})]}):o.jsx(_o,{className:"items-center gap-2",children:o.jsx(Et,{type:"button","data-testid":"form-conflict-primary",onClick:Z,children:r("sectionsEditor.formConflict.ok")})}),e[57]=Z,e[58]=E,e[59]=g,e[60]=V,e[61]=N,e[62]=r,e[63]=he):he=e[63];let M;return e[64]!==fe||e[65]!==I||e[66]!==he?(M=o.jsxs(o.Fragment,{children:[fe,I,he]}),e[64]=fe,e[65]=I,e[66]=he,e[67]=M):M=e[67],M}function lu(){return new Set}function cu(n){const e=Xn(n.mine,n.schema),r=Xn(n.theirs,n.schema),a=e.kind==="text"&&r.kind==="text"?Xc(e.text,r.text):null;return l=>a?o.jsx(pu,{parts:a[l]}):o.jsx(gu,{preview:l==="mine"?e:r})}const uu={all:{ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1},vertical:{ArrowDown:1,ArrowUp:-1}};function du(n,e){const r=uu[e][n.key];if(!r)return;const a=[...n.currentTarget.querySelectorAll('[role="radio"]')],l=a.indexOf(document.activeElement);if(l<0)return;n.preventDefault();const u=a[(l+r+a.length)%a.length];u?.focus(),u?.click()}function fu(n){const e=ct.c(65),{field:r,choices:a,viewer:l,author:u,onChoose:y,arrows:m}=n,b=u===void 0?null:u,h=Lt(),[k]=fi(),{language:N}=k;let L,z,H,B,w,p,te,E,W,V,J,g,Q,x;if(e[0]!==m||e[1]!==b||e[2]!==a||e[3]!==r||e[4]!==N||e[5]!==y||e[6]!==h||e[7]!==l?.image||e[8]!==l?.name){const pe=cu(r),ye=a[r.pointer]??"mine",ue=l?.image??void 0;let fe;e[23]!==h||e[24]!==l?.name?(fe=l?.name?.trim()||h("sectionsEditor.formConflict.you"),e[23]=h,e[24]=l?.name,e[25]=fe):fe=e[25];let Re;e[26]!==ue||e[27]!==fe?(Re=o.jsx(_s,{url:ue,fallback:fe,shape:"circle",size:"sm",className:"text-xs"}),e[26]=ue,e[27]=fe,e[28]=Re):Re=e[28];const j=Re;let re;e[29]!==b||e[30]!==j?(re=b?.you?j:b?.name?o.jsx(_s,{url:b.avatarUrl,fallback:b.name,shape:"circle",size:"sm",className:"text-xs"}):o.jsx(_s,{url:"icon://user",fallback:"",muted:!0,shape:"circle",size:"sm"}),e[29]=b,e[30]=j,e[31]=re):re=e[31];const Ae=re,Ce=b?new Date(b.at):null;H="radiogroup",B=r.label,w="flex flex-col gap-2",e[32]!==m?(p=M=>du(M,m),e[32]=m,e[33]=p):p=e[33];let S;e[34]!==r.pointer||e[35]!==y?(S=()=>y(r.pointer,"mine"),e[34]=r.pointer,e[35]=y,e[36]=S):S=e[36];let I;e[37]!==h?(I=h("sectionsEditor.formConflict.you"),e[37]=h,e[38]=I):I=e[38];let he;e[39]!==h?(he=h("sectionsEditor.formConflict.yourVersionNotSaved"),e[39]=h,e[40]=he):he=e[40],te=o.jsx(Vo,{side:"mine",checked:ye==="mine",onChoose:S,avatar:j,who:I,meta:he,children:pe("mine")}),L=Vo,E="theirs",W=ye==="theirs",e[41]!==r.pointer||e[42]!==y?(V=()=>y(r.pointer,"theirs"),e[41]=r.pointer,e[42]=y,e[43]=V):V=e[43],J=Ae,e[44]!==b?.name||e[45]!==b?.you||e[46]!==h?(g=b?.you?h("sectionsEditor.formConflict.youElsewhere"):b?.name||h("sectionsEditor.formConflict.someoneElse"),e[44]=b?.name,e[45]=b?.you,e[46]=h,e[47]=g):g=e[47],Q=Ce?h("sectionsEditor.formConflict.savedAt",{when:dc(Ce,N)}):h("sectionsEditor.formConflict.theirVersionSaved"),x=Ce?mu(Ce,N):void 0,z=pe("theirs"),e[0]=m,e[1]=b,e[2]=a,e[3]=r,e[4]=N,e[5]=y,e[6]=h,e[7]=l?.image,e[8]=l?.name,e[9]=L,e[10]=z,e[11]=H,e[12]=B,e[13]=w,e[14]=p,e[15]=te,e[16]=E,e[17]=W,e[18]=V,e[19]=J,e[20]=g,e[21]=Q,e[22]=x}else L=e[9],z=e[10],H=e[11],B=e[12],w=e[13],p=e[14],te=e[15],E=e[16],W=e[17],V=e[18],J=e[19],g=e[20],Q=e[21],x=e[22];let Z;e[48]!==L||e[49]!==z||e[50]!==E||e[51]!==W||e[52]!==V||e[53]!==J||e[54]!==g||e[55]!==Q||e[56]!==x?(Z=o.jsx(L,{side:E,checked:W,onChoose:V,avatar:J,who:g,meta:Q,metaTitle:x,children:z}),e[48]=L,e[49]=z,e[50]=E,e[51]=W,e[52]=V,e[53]=J,e[54]=g,e[55]=Q,e[56]=x,e[57]=Z):Z=e[57];let q;return e[58]!==H||e[59]!==B||e[60]!==w||e[61]!==p||e[62]!==te||e[63]!==Z?(q=o.jsxs("div",{role:H,"aria-label":B,className:w,onKeyDown:p,children:[te,Z]}),e[58]=H,e[59]=B,e[60]=w,e[61]=p,e[62]=te,e[63]=Z,e[64]=q):q=e[64],q}const mu=(n,e)=>n.toLocaleString(e,{dateStyle:"medium",timeStyle:"short"});function Vo(n){const e=ct.c(28),{side:r,checked:a,onChoose:l,avatar:u,who:y,meta:m,metaTitle:b,children:h}=n,k=R.useId(),N=`${k}-who`,L=`${k}-meta ${k}-value`,z=a?0:-1,H=a?"border-primary bg-primary/5 ring-1 ring-primary":"hover:bg-accent";let B;e[0]!==H?(B=me("grid w-full cursor-pointer grid-cols-[auto_minmax(0,1fr)] items-start gap-3 rounded-xl border bg-background p-3 text-left transition-[border-color,box-shadow,background-color] focus-ring",H),e[0]=H,e[1]=B):B=e[1];const w=`${k}-who`;let p;e[2]!==w||e[3]!==y?(p=o.jsx("span",{id:w,className:"text-sm font-medium text-foreground",children:y}),e[2]=w,e[3]=y,e[4]=p):p=e[4];const te=`${k}-meta`;let E;e[5]!==m||e[6]!==b||e[7]!==te?(E=o.jsx("span",{id:te,title:b,children:m}),e[5]=m,e[6]=b,e[7]=te,e[8]=E):E=e[8];let W;e[9]!==p||e[10]!==E?(W=o.jsxs("span",{className:"flex flex-wrap items-baseline gap-x-1.5 text-xs text-muted-foreground",children:[p,E]}),e[9]=p,e[10]=E,e[11]=W):W=e[11];const V=`${k}-value`,J=`conflict-${r}`;let g;e[12]!==h||e[13]!==V||e[14]!==J?(g=o.jsx("span",{id:V,"data-testid":J,className:"min-w-0 text-sm",children:h}),e[12]=h,e[13]=V,e[14]=J,e[15]=g):g=e[15];let Q;e[16]!==W||e[17]!==g?(Q=o.jsxs("span",{className:"flex min-w-0 flex-col gap-1",children:[W,g]}),e[16]=W,e[17]=g,e[18]=Q):Q=e[18];let x;return e[19]!==u||e[20]!==a||e[21]!==l||e[22]!==N||e[23]!==Q||e[24]!==L||e[25]!==z||e[26]!==B?(x=o.jsxs("button",{type:"button",role:"radio","aria-checked":a,"aria-labelledby":N,"aria-describedby":L,tabIndex:z,onClick:l,className:B,children:[u,Q]}),e[19]=u,e[20]=a,e[21]=l,e[22]=N,e[23]=Q,e[24]=L,e[25]=z,e[26]=B,e[27]=x):x=e[27],x}function pu(n){const e=ct.c(4),{parts:r}=n;let a;e[0]!==r?(a=r.map(hu),e[0]=r,e[1]=a):a=e[1];let l;return e[2]!==a?(l=o.jsx("span",{className:"whitespace-pre-wrap break-words",children:a}),e[2]=a,e[3]=l):l=e[3],l}function hu(n,e){return n.kind==="changed"?o.jsx("mark",{className:"rounded-sm bg-warning/20 px-0.5 text-foreground",children:n.text},e):o.jsx("span",{children:n.text},e)}function gu(n){const e=ct.c(29),{preview:r}=n,a=Lt();switch(r.kind){case"empty":{let l;e[0]!==a?(l=a("sectionsEditor.formConflict.empty"),e[0]=a,e[1]=l):l=e[1];let u;return e[2]!==l?(u=o.jsx("span",{className:"italic text-muted-foreground",children:l}),e[2]=l,e[3]=u):u=e[3],u}case"text":{let l;return e[4]!==r.text?(l=o.jsx("span",{className:"whitespace-pre-wrap break-words",children:r.text}),e[4]=r.text,e[5]=l):l=e[5],l}case"image":{let l;return e[6]!==r.src?(l=o.jsx("img",{src:r.src,alt:"",className:"max-h-24 max-w-full rounded border object-contain"}),e[6]=r.src,e[7]=l):l=e[7],l}case"yesNo":{const l=r.value?"sectionsEditor.formConflict.yes":"sectionsEditor.formConflict.no";let u;e[8]!==a||e[9]!==l?(u=a(l),e[8]=a,e[9]=l,e[10]=u):u=e[10];let y;return e[11]!==u?(y=o.jsx("span",{children:u}),e[11]=u,e[12]=y):y=e[12],y}case"list":{const l=r.count===1?"sectionsEditor.formConflict.oneItem":"sectionsEditor.formConflict.items",u=String(r.count);let y;e[13]!==a||e[14]!==l||e[15]!==u?(y=a(l,{count:u}),e[13]=a,e[14]=l,e[15]=u,e[16]=y):y=e[16];let m;e[17]!==y?(m=o.jsx("span",{className:"text-muted-foreground",children:y}),e[17]=y,e[18]=m):m=e[18];let b;e[19]!==r.count||e[20]!==r.items?(b=r.items.some(Boolean)&&o.jsxs("span",{className:"flex flex-col",children:[r.items.map(yu),r.count>r.items.length&&o.jsx("span",{children:"…"})]}),e[19]=r.count,e[20]=r.items,e[21]=b):b=e[21];let h;return e[22]!==m||e[23]!==b?(h=o.jsxs("span",{className:"flex flex-col gap-1",children:[m,b]}),e[22]=m,e[23]=b,e[24]=h):h=e[24],h}case"fields":{let l;e[25]!==r.entries?(l=r.entries.map(vu),e[25]=r.entries,e[26]=l):l=e[26];let u;return e[27]!==l?(u=o.jsx("dl",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-0.5",children:l}),e[27]=l,e[28]=u):u=e[28],u}}}function vu(n){return o.jsxs("div",{className:"contents",children:[o.jsx("dt",{className:"text-muted-foreground",children:n.label}),o.jsx("dd",{className:"truncate",children:n.text})]},n.label)}function yu(n,e){return o.jsx("span",{className:"truncate",children:`${e+1}. ${n||"…"}`},e)}function xu(n,e){return n.kind==="protocol"&&n.source==="github"?e:null}function bu(n,e){if(Object.hasOwn(n,e))return n[e]??null;const r=fo(e),a=Object.keys(n).find(l=>fo(l)===r);return a===void 0?null:n[a]??null}async function Su(n,e){try{const r=await fetch(`/api/${n.orgSlug}/decofile/${encodeURIComponent(n.virtualMcpId)}/${encodeURIComponent(n.branch)}`,{cache:"no-store",headers:Qi("v8")});if(!r.ok)return null;const a=await r.json().catch(()=>({})),l=bu(a.changedBy??{},e);return l&&typeof l.userId=="string"&&Number.isFinite(Date.parse(l.at))?l:null}catch{return null}}function _u(n,e,r){const a=e.find(y=>y.userId===n.userId),l=a?.user?.name?.trim(),u=a?.user?.image??void 0;return{...l?{name:l}:{},...u?{avatarUrl:u}:{},at:n.at,you:!!r&&n.userId===r}}function wu(n){let e=2166136261,r=0;for(let a=0;a<n.length;a++){const l=n.charCodeAt(a);e=Math.imul(e^l,16777619),r=Math.imul(r,31)+l|0}return`${(e>>>0).toString(36)}${(r>>>0).toString(36)}:${n.length}`}function ju(n,e,r){const a=ct.c(19),l=!!n&&!!e&&r!==null;let u;a[0]!==e||a[1]!==n||a[2]!==r?(u=Ko.conflictAuthor(n?`${n.orgSlug}/${n.virtualMcpId}/${n.branch}`:"",e??"",r??""),a[0]=e,a[1]=n,a[2]=r,a[3]=u):u=a[3];let y;a[4]!==e||a[5]!==n?(y=()=>Su(n,e),a[4]=e,a[5]=n,a[6]=y):y=a[6];let m;a[7]!==l||a[8]!==u||a[9]!==y?(m={queryKey:u,queryFn:y,enabled:l,staleTime:Number.POSITIVE_INFINITY,gcTime:6e5,retry:!1,refetchOnWindowFocus:!1},a[7]=l,a[8]=u,a[9]=y,a[10]=m):m=a[10];const{data:b}=mi(m),h=l?b??null:null,k=!!h;let N;a[11]!==k?(N={enabled:k},a[11]=k,a[12]=N):N=a[12];const{data:L}=mc(N);let z;a[13]!==L?(z=L?.data?.members??[],a[13]=L,a[14]=z):z=a[14];const H=z,{data:B}=Io.useSession();if(!h)return null;const w=B?.user?.id??null;let p;return a[15]!==h||a[16]!==H||a[17]!==w?(p=_u(h,H,w),a[15]=h,a[16]=H,a[17]=w,a[18]=p):p=a[18],p}function ku(n,e,r,a){if(!n||typeof n!="object")return{kind:"error",reason:"no-matcher-rule"};const l=e.trim();if(!l)return Qt(n,r,a)?{kind:"inline",blockKey:n.__resolveType??"",inlinedRule:Rs(n,r,a)}:{kind:"noop"};const u=As(n,r,a);if(!u)return{kind:"error",reason:"unreadable-rule"};if(u.blockKey)return{kind:"updateBlock",blockKey:u.blockKey,blockData:Ot(u.resolveType,u.data,l)};const y=Gn(l),m=Un(y,r);return m?{kind:"error",reason:"invalid-block-id",message:m}:{kind:"createBlock",blockId:y,blockData:Ot(u.resolveType,u.data,l),reference:dn(y)}}const Po="section-form-stale-save",Eu=3,Ru=1e3;function Mo(n,e,r){const a=e.global&&e.pageKey?[{label:"Default",sections:[{__resolveType:e.pageKey}]}]:Fo(e.pageKey?n[e.pageKey]?.sections:void 0,n,r),l=Math.max(0,Math.min(e.pageVariantIndex,a.length-1)),u=a[l]?.sections??[];return{pageVariants:a,variantIndex:l,rawSections:u,parsedSections:En(u,n,r)}}const Do=new WeakMap;let Au=0;function Cu(n){let e=Do.get(n);return e===void 0&&(e=++Au,Do.set(n,e)),e}function gm({orgSlug:n,virtualMcpId:e,branch:r,previewReady:a=!0,previewUrl:l,currentPath:u,activePageBlockKey:y=null,activeGlobalBlockKey:m=null,externalSelection:b,onSaved:h,initialEditSeo:k=!1,onExitSeo:N,onSelectRoot:L,onViewJsonFile:z,onFocusedBlockChange:H,onVariantPreviewOverride:B,focusVariant:w}){const p=Lt(),te=gi(),E=te?.taskId??null,W=a?{orgSlug:n,virtualMcpId:e,branch:r,threadId:E,previewUrl:l}:null,[V,J]=R.useState([]),{data:g,isLoading:Q}=Xi(W,{pollWhile:V.length>0}),{data:x,isLoading:Z}=il(W),q=Zn(),pe=te?.virtualMcpId,ue=qi(pe===e?e:null)?.metadata?.siteSlug??null,fe=sc({virtualMcpId:e,branch:r,sandboxUrl:l}),Re=Zi(e,r),j=el(Re),re=ul(j),Ae=!j,Ce=!!fe||j,[S,I]=R.useState(null),[he,M]=R.useState(null),[xe,O]=R.useState(null),[oe,G]=R.useState(0),[Ie,ke]=R.useState(void 0),[ut,Ze]=R.useState(null),[$e,qe]=R.useState(null);w&&w.seq!==ut&&(Ze(w.seq),qe(w));const[at,Ge]=R.useState(null),Ue={index:at,remember:Ge},[Ye,de]=R.useState(null),[ge,be]=R.useState(null),[ee,F]=R.useState([]),De=R.useRef(null),[et,tt]=R.useState(ee.length);et!==ee.length&&(tt(ee.length),requestAnimationFrame(()=>{De.current&&(De.current.scrollTop=0)}));const[st,K]=R.useState(0),[Je,ie]=R.useState(null),[Ne,ze]=R.useState(null),[rt,it]=R.useState(null),[Qo,Zt]=R.useState(!1),[Fs,es]=R.useState(!1),Rn=R.useRef(null),[An,Xo]=R.useState(!0),[en,Cn]=R.useState(!1),[$t,Nn]=R.useState(!1),[He,fn]=R.useState(k),[Bs,Os]=R.useState(k);k&&!Bs&&(Os(!0),fn(!0),I(null),M(null),O(null),F([])),!k&&Bs&&Os(!1);const[Zo,mn]=R.useState(null),[Ls,Tn]=R.useState(void 0),[$s,zt]=R.useState([]),[zs,tn]=R.useState(0),[Qe,dt]=R.useState(0),[ea,Xe]=R.useState(null),[nn,nt]=R.useState(null),[Hs,Ws]=R.useState(null),qs=pi(),Gs=tl({orgSlug:n,virtualMcpId:e,branch:r},{tunnel:!1}),pn=Ri({orgSlug:n,virtualMcpId:e,branch:r}),[ta,na]=R.useState(u),[sa,ra]=R.useState(y),[oa,aa]=R.useState(m);(ta!==u||sa!==y||oa!==m)&&(queueMicrotask(()=>pn.flush()),na(u),ra(y),aa(m),I(null),M(null),O(null),G(0),de(null),be(null),dt(0),Xe(null),nt(null),F([]),K(t=>t+1),fn(!1),mn(null),Tn(void 0),zt([]),tn(t=>t+1));const X=Ai({orgSlug:n,virtualMcpId:e,branch:r}),hn=zi((t,s)=>{X.mutate({blockKey:t,data:s},{onSuccess:()=>h?.(),onError:X.reportError})}),Vn=ml({orgSlug:n,virtualMcpId:e,branch:r}),Us=vc({orgSlug:n,virtualMcpId:e,branch:r}),[sn,rn]=R.useState(!1),$=R.useRef(null),Tt=R.useRef(null),ht=R.useRef(null),gt=R.useRef(null),Pn=R.useRef({}),Ht=R.useRef(null),gn=R.useRef(!1),vn=R.useRef(!1),Ke=R.useRef(new Map),on=R.useRef(!1),_t=R.useRef([]),ts=R.useRef(new WeakSet);nl(n,e,t=>{const{activePageKey:s,rawSections:i,parsedSections:c,selectedSectionIndex:d}=Se.current,v=new Set;s&&v.add(s);for(const f of[Tt.current?.sectionIndex,d]){const _=f==null?void 0:i[f],D=f==null?void 0:c[f],A=_&&D?.isSavedBlock?ys(_,D):null;A&&v.add(A)}if([...v].some(f=>t.has(f))){for(const f of[$,ht,gt])f.current&&clearTimeout(f.current),f.current=null;Tt.current=null,Ke.current.clear(),s&&t.has(s)&&(Pn.current={})}});const Se=R.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[Ys,Js]=R.useState(0),[ia,la]=R.useState(0),ca=ju(xu(Re,{orgSlug:n,virtualMcpId:e,branch:r}),V[0]?.blockKey??null,V[0]?wu(Le(V[0].plan.theirs)):null),[ua,da]=R.useState(null),ns=sl(n,e).epoch,[fa,ma]=R.useState(ns);if(!a||Q||Z)return o.jsx("div",{className:"h-full w-full flex items-center justify-center",children:o.jsx(hi,{className:"size-5 text-muted-foreground"})});if(!g||!x)return o.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:p("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const pa=vl(g,x),ne=!!m,_e=ne?null:yl(pa,u,y),C=ne?m:_e?.key??null,Mn=ne&&m?g[m]:void 0,Qs=ne&&m&&Mn?xl(m,Mn):ne&&m?m:"",Wt=!ne&&C&&g[C]?g[C]:null,ss=He&&g&&x&&C&&_e?Zr(g,{kind:"page",pageKey:C,pageName:String(_e.name??""),path:String(_e.path??"")},x):null,ha=He?Wt?.seo:void 0,Dn=Ls!==void 0?Ls:ha,ga=He?Ci(Dn):void 0,Xs=ss?.seoTypeOptions??[],Zs=He&&x?Ni(x):"",rs=Zo??ga??{},In=He&&ss?pc(rs,ss):null,er=He&&In&&Ti(Dn)?qn(In,x):null,tr=He?Vi(g,x)?.seoData:void 0,Te=ne?[{label:"Default",sections:[{__resolveType:m}]}]:Fo(Wt?.sections,g??{},j),vt=Te.length>1,ve=Math.min(oe,Te.length-1),Fe=Te[ve],U=Fe?.sections??[],Ve=En(U,g,j),Kn=!ne&&bl(Wt?.sections,j);if(ne&&m&&Hs!==m){Ws(m);const t=U[0],s=Ve[0];if(t&&s){I(0),dt(0),F([]);const i=kt(t,s,g,j);i&&(M(i.data),O(i.resolveType),nt(null),Xe(null))}}!ne&&Hs!==null&&Ws(null),Se.current={rawSections:U,parsedSections:Ve,decofile:g??{},activePageKey:C,pageVariants:Te,variantIndex:ve,sectionVariantIndex:Qe,selectedSectionIndex:S};const va=()=>({multivariate:Kn,index:ve,variants:Te.map(t=>({rule:t.rule})),lazyValues:j&&Kn&&Ml(Wt?.sections?.variants?.[ve]?.value)}),os=(t,s)=>{if(!B)return;if(!C||!Kn||t.length<=1){B(null);return}const i={multivariate:!0,index:s,variants:t},c=j?jo(C,i):ko(C,i,g,x);B(c.length>0?c:null)},as=B&&C&&Kn&&vt&&!Q&&!Z?C:null;if(as!==ua&&(da(as),as)){const t=Te.map(i=>({rule:i.rule})),s=ve;queueMicrotask(()=>os(t,s))}const qt=(t,s,i)=>{if(!B)return;if(!C){B(null);return}const c=va(),d=j?jo(C,c):ko(C,c,g,x);if(!t||s<0){B(d.length>0?d:null);return}const v={pageKey:C,page:c,sectionIndex:s,sectionLazy:Ve[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:i},f=j?yc(v):xc({...v,decofile:g,meta:x}),_=j?bc(d,f):[...d,...f];B(_.length>0?_:null)},wt=(t,s,i,c=S??-1,d=!1)=>{const v=ot(t,s);if(!v){M(null),O(null),nt(null),Xe(null),d&&qt(null,c,i);return}const _=Es(v,re)[i];if(!_){M(null),O(null),nt(null),Xe(null),d&&qt(null,c,i);return}const D=Lo(_.value,g);M(D?.data??null),O(D?.resolveType??null);const{resolveType:A,formValue:T}=Jt(_.rule,g,x??void 0);nt(A),Xe(T),d&&qt(v,c,i)},yn=t=>{ze(null),G(t),I(null),M(null),O(null),F([]);const s=Te[t]?.rule,{resolveType:i,formValue:c}=Jt(s,g??{},x??void 0);be(i),de(c),os(Te.map(d=>({rule:d.rule})),t)},nr=(t,s)=>{const i=U[t],c=Ve[t];if(!i||!c)return!1;const d=c.isMultivariate?ot(i,c)?.variants?.length??0:0,v=s<d?s:0;if(I(t),dt(v),F([]),K(f=>f+1),c.isMultivariate)wt(i,c,v,t);else{const f=kt(i,c,g,j);f?(M(f.data),O(f.resolveType)):(M(null),O(null)),nt(null),Xe(null)}return!0},sr=b?.index;if(b!==void 0&&(b?.seq??null)!==Ie&&(ke(b?.seq??null),typeof sr=="number"&&nr(sr,0)),$e&&(ne?Mn:Wt)){const t=$e.pageVariant,s=!ne&&t!==void 0&&t<Te.length;if(s&&t!==ve)yn(t);else{qe(null);const{section:i,variant:c}=$e;if(ne)c!==void 0&&(Ge(c),F([]),K(d=>d+1));else if(i!==void 0&&nr(i,c??0)){const d=U[i],v=Ve[i],f=v.isMultivariate?ot(d,v):null;f&&c!==void 0&&queueMicrotask(()=>qt(f,i,c))}else s&&yn(t)}}if(ns!==fa){ma(ns);const t=$.current!==null||Ke.current.size>0||gt.current!==null||ht.current!==null||X.isPending||pn.isPending||V.length>0,s=S!==null&&Co(De.current,document.activeElement);if(!t&&s&&(on.current=!0),!t&&!s&&S!==null){const i=U[S],c=Ve[S];if(F([]),K(d=>d+1),!i||!c)I(null),M(null),O(null);else if(c.isMultivariate)wt(i,c,Qe,S);else{const d=kt(i,c,g,j);M(d?.data??null),O(d?.resolveType??null)}}!t&&He&&(mn(null),Tn(void 0),tn(i=>i+1))}if(Ys!==ia){la(Ys);const t=S!==null?U[S]:null,s=S!==null?Ve[S]:null;if(t&&s&&S!==null)if(F([]),K(i=>i+1),s.isMultivariate)wt(t,s,Qe,S);else{const i=kt(t,s,g,j);M(i?.data??null),O(i?.resolveType??null)}}const ft=V[0];if(ft){const{formBase:t,target:s}=ft,i=Mo(g,s,j),c=t.sectionIndex,d=i.rawSections.length===t.sectionCount?js(i.rawSections[c],i.parsedSections[c],s.sectionVariantIndex,g,j):null,v=$c(ft,d,f=>Ro(t,f));if(v){const _=[{...ft,...v,changedAgain:!0},...V.slice(1)];_t.current=_,J(_)}}const xn={orgSlug:n,virtualMcpId:e,branch:r,threadId:E,previewUrl:j?void 0:l??void 0,siteSlug:ue},Fn=xe&&x?qn(xe,x):null,mt=(t,s)=>{if(!C)return;$.current&&(clearTimeout($.current),$.current=null),Ke.current.clear(),gt.current&&(clearTimeout(gt.current),gt.current=null),ht.current&&(clearTimeout(ht.current),ht.current=null);const i=cn(g,C,t,ve,Te);X.mutate({blockKey:C,data:i},{onSuccess:()=>s?.onSuccess?.()??h?.(),onError:c=>{s?.onError?.(),X.reportError(c)}})},Gt=()=>{H?.(null),I(null),Nn(!1),M(null),O(null),dt(0),Xe(null),nt(null),F([]),K(t=>t+1)},rr=()=>Co(De.current,document.activeElement),is=(t=p("sectionsEditor.sectionsEditor.blockChangedElsewhere"))=>{if($.current&&(clearTimeout($.current),$.current=null),Ke.current.clear(),Tt.current=null,ae.error(t,{id:Po}),rr()){on.current=!0;return}Js(s=>s+1)},or=()=>{!on.current||rr()||_t.current.length>0||$.current!==null||gn.current||vn.current||Ke.current.size>0||(on.current=!1,Js(t=>t+1))},ar=()=>{on.current&&setTimeout(or,0)},ir=t=>ol(qs,Gs,t),lr=t=>{Ke.current.size!==0&&setTimeout(()=>{if(gn.current||vn.current)return;const s=[...Ke.current.values()];Ke.current.clear();for(const i of s)i()},t)},ya=t=>{const{activePageKey:s,variantIndex:i,sectionVariantIndex:c}=Se.current,d=Ht.current;return{formBase:d?.sectionIndex===t&&d.variantIndex===c?d:null,pageKey:s,global:ne,pageVariantIndex:i,sectionVariantIndex:c,schema:Fn}},bn=t=>{_t.current=t,J(t)},xa=t=>{const s=_t.current,i=s.findIndex(v=>v.formBase===t.formBase),c=i>=0?s[i]:void 0,d=c?s.with(i,{...t,choices:Ms(c.plan,c.choices,t.plan),fresh:Yo(c.plan,t.plan,c.fresh),changedAgain:c.changedAgain||Le(c.plan.theirs)!==Le(t.plan.theirs)}):[...s,{...t,changedAgain:ts.current.has(t.formBase)}];bn(d)},cr=(t,s)=>{const i=_t.current,c=i.findIndex(f=>f.formBase===t),d=i[c];if(!d)return!1;if(Le(d.plan.mine)===Le(s))return!0;const v=Vs({...d.plan,mine:s});if(v.pointers.length===0){const f=i.filter(_=>_!==d);return bn(f),!1}return bn(i.with(c,{...d,plan:v,choices:Ms(d.plan,d.choices,v)})),!0},ba=t=>{const s=Se.current;return s.selectedSectionIndex===t.formBase.sectionIndex&&s.activePageKey===t.target.pageKey&&s.variantIndex===t.target.pageVariantIndex&&s.sectionVariantIndex===t.target.sectionVariantIndex},Sa=()=>{const t=_t.current[0];if(!t)return null;const{formBase:s,target:i}=t;$.current&&Tt.current?.sectionIndex===s.sectionIndex&&Tt.current.sectionVariantIndex===i.sectionVariantIndex&&(clearTimeout($.current),$.current=null,Tt.current=null),Ke.current.delete(`${i.pageKey}:${s.sectionIndex}:${i.sectionVariantIndex}`);const c=s.emitted;return c&&typeof c=="object"&&!cr(s,c)&&Sn(c,s.sectionIndex,0,i),_t.current[0]??null},_a=()=>{const t=_t.current[0],s=Sa();if(!s||!t||s.formBase!==t.formBase||s.plan.pointers.some(v=>!t.plan.pointers.includes(v)))return;const i=Oc(s.plan,s.choices);bn(_t.current.slice(1));const{formBase:c,target:d}=s;c.base=s.plan.theirs,c.version=void 0,c.emitted=i,ts.current.add(c),(Ht.current===c||ba(s))&&(Ht.current=c,M(i),K(v=>v+1)),Sn(i,c.sectionIndex,0,d)},wa=t=>{const[s,...i]=_t.current;s&&bn([{...s,choices:t},...i])},Sn=(t,s,i=0,c)=>{const d=c??ya(s),v=d.sectionVariantIndex,f=d.formBase,_=Tt.current;$.current&&(clearTimeout($.current),$.current=null,_&&(_.sectionIndex!==s||_.sectionVariantIndex!==v)&&_.write());const D=`${d.pageKey}:${s}:${v}`,A=()=>{if(gn.current||vn.current){Ke.current.set(D,A);return}const T=typeof t=="function"?t():t;if(f&&cr(f,T))return;const P=Se.current.decofile,{rawSections:se,parsedSections:le,pageVariants:Be,variantIndex:we}=Mo(P,d,j),Pe=d.pageKey,Y=se[s];if(!Y)return;const ce=le[s];if(!ce)return;const Me=f?.base,We=js(Y,ce,v,P,j),xt=!!Me&&!!We&&qo(Me,We)&&!(f&&Ro(f,We));if(xt&&Me&&We){if(Go(Me,We)){is(p("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}const je=ce.isSavedBlock?"here":Fc(Me,se.map((Ee,It)=>js(Ee,le[It],v,P,j)),s,f?.sectionCount??se.length);if(je==="unknown"){is(p("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}if(typeof je=="number"&&f){f.sectionCount=se.length,f.sectionIndex=je,Ht.current===f&&I(je),Sn(T,je,i,d);return}}const lt=xt&&Me&&We?Vs({ancestor:Me,mine:T,theirs:We}):null;if(lt&<.pointers.length>0&&f){f.sectionCount=se.length,xa({plan:lt,formBase:f,target:d,sectionIndex:s,choices:Uo(lt),changedAgain:!1,blockKey:ce.isSavedBlock?ys(Y,ce):Pe,fresh:{}});return}const bt=lt?lt.merged:null,Dt=bt??T,Yr=Bc({merged:!!bt,tracked:f,current:Ht.current,saved:T});bt&&ae.info(p("sectionsEditor.sectionsEditor.blockMergedWithOthers"),{id:Po}),Yr&&f&&(f.emitted=bt,M(bt));const gs=Yr||!bt?Dt:T;f&&(f.base=gs,f.sectionCount=se.length,Ic(f,gs));const Jr={onSuccess:()=>{f&&ts.current.delete(f),h?.()},onError:je=>{if(f?.base===gs&&Me&&(f.base=Me),je instanceof rl){f&&(f.version=void 0),i<Eu?(Ke.current.delete(D),vn.current=!0,setTimeout(()=>{vn.current=!1,Sn(()=>{const Ee=f?.emitted;return Ee&&typeof Ee=="object"?Ee:T},s,i+1,d),Ke.current.delete(D),lr(jn)},Ru*2**i)):is();return}X.reportError(je)}},Qr=je=>{gn.current=!0;let Ee=!1;X.mutateAsync(je).then(()=>Jr.onSuccess(),It=>{Ee=!0,Jr.onError(It)}).finally(()=>{gn.current=!1,lr(Ee?jn:0),or()})};if(ce.isSavedBlock){const je=ys(Y,ce);if(!je)return;Qr({blockKey:je,data:Dt,...Me?{base:{value:bt?We:Me}}:{},rebaseOnConflict:!1,guard:Ao({formBase:f,rebased:!!bt,versionOf:ir})});return}if(!Pe)return;const Hn={...P[Pe]},Yt=[...se];if(ce.isMultivariate){const je=ot(Y,ce);if(!je||!Pe)return;const Ee=Kl(je,v,Dt);Yt[s]=Bt(Y,ce,Ee)}else if(ce.isHidden){const je=Is(Y.__resolveType),Ee=je?{...Y.section}:{...Y},It=Array.isArray(Ee.variants)?[...Ee.variants]:[];It[0]&&(It[0]=yo(Ee.__resolveType,It[0],Dt)),Ee.variants=It,je?Yt[s]={...Y,section:Ee}:Yt[s]=Ee}else ce.isLazy?Yt[s]={...Y,section:Dt}:Yt[s]=Dt;if(Be.length>1){const je=Hn.sections,Ee=[...je?.variants??[]];Ee[we]&&(Ee[we]=yo(je?.__resolveType,Ee[we],Yt)),Hn.sections={...je,variants:Ee}}else Hn.sections=Yt;Qr({blockKey:Pe,data:Hn,rebaseOnConflict:!1,guard:Ao({formBase:null,rebased:!1,versionOf:ir})})};Tt.current={sectionIndex:s,sectionVariantIndex:v,write:A},$.current=setTimeout(()=>{$.current=null,A()},jn)},ja=t=>{on.current=!1,I(t),dt(0),F([]),K(d=>d+1);const s=U[t],i=Ve[t];if(H?.(i?.isSavedBlock?i.resolveType??null:null),!s||!i)return;if(i.isMultivariate){wt(s,i,0,t);return}const c=kt(s,i,g,j);if(!c){M(null),O(null),nt(null),Xe(null),qt(null,t,0);return}M(c.data),O(c.resolveType),nt(null),Xe(null),qt(null,t,0)},ur=t=>{const s=t;S!==null&&(Ht.current=Kc(Ht.current,{sectionIndex:S,variantIndex:Se.current.sectionVariantIndex,shown:he,next:s,sectionCount:Se.current.rawSections.length})),M(s),S!==null&&Sn(s,S)},ls=t=>{if(!C||!g||!x||!_e)return;const s={kind:"page",pageKey:C,pageName:String(_e.name??""),path:String(_e.path??"")},i=Zr(g,s,x);i&&pn.save(C,()=>{const c=qs.getQueryData(Ko.decofile(Gs))?.[C];if(!c||typeof c!="object"||c===null||Array.isArray(c))return null;const d={...c,...Pn.current};return Pn.current={},t?.raw!==void 0?hc(d,t.raw,x):t?.inner!==void 0?gc(s,i,d,t.inner):d})},dr=(t,s)=>{C&&(Pn.current[t]=s,ls())},ka=(t,s)=>{if(!C)return;const i=Yn([...U],t,s);S!==null&&(S===t?I(s):t<S&&s>=S?I(S-1):t>S&&s<=S&&I(S+1)),mt(i)},Ea=t=>{if(!C)return;const s=U.filter((i,c)=>c!==t);S===t?Gt():S!==null&&S>t&&I(S-1),mt(s)},Ra=t=>{if(!C)return;const s=U[t];if(!s)return;const i=[...U];i.splice(t+1,0,Hi(s)),S!==null&&S>t&&I(S+1),mt(i)},Aa=t=>{if(!C)return;const s=U[t],i=Ve[t];if(!s||!i)return;const c=i.isHidden?Cl(s,j):Nl(s,x);if(!c)return;const d=[...U];d[t]=c,S===t&&Gt(),mt(d)},Ca=t=>{if(!C)return;const s=U[t],i=Ve[t];if(!s||!i||i.isMultivariate)return;const c=Al(s);if(!c)return;const d=[...U];d[t]=c,S===t&&Gt(),mt(d)},Na=t=>{if(!C)return;const s=U[t],i=Ve[t];if(!s||!i?.isSavedBlock)return;const c=kt(s,i,g,j);if(!c?.data)return;const{name:d,...v}=c.data,f=[...U];i.isLazy?f[t]={...s,section:v}:f[t]=v,S===t&&Gt(),mt(f)},Ta=t=>{if(!C)return;const s=[...U,{__resolveType:t.resolveType}],i=s.length-1;mt(s,{onError:()=>{Se.current.selectedSectionIndex===i&&Gt()}}),Zt(!1),I(i),dt(0),F([]),K(f=>f+1);const c=s[i],d=En(s,g,j)[i];if(!c||!d)return;if(d.isMultivariate){wt(c,d,0);return}const v=kt(c,d,g,j);if(!v){M(null),O(null),nt(null),Xe(null);return}M(v.data),O(v.resolveType),nt(null),Xe(null)},fr=t=>{Rn.current=t.append,Zt(!0)},Va=t=>{const s=Rn.current;if(!s){Ta(t);return}s({__resolveType:t.resolveType}),Zt(!1),Rn.current=null},mr=t=>{if(S===null)return;const s=U[S],i=Ve[S];!s||!i?.isMultivariate||(dt(t),F([]),K(c=>c+1),wt(s,i,t,S,!0))},Pa=t=>{if(S===null||!C)return;const s=U[S],i=Ve[S];if(!s||!i?.isMultivariate)return;const c=ot(s,i);if(!c)return;const d=El(c,t);if(!d){ae.error(p("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const v=[...U];v[S]=Bt(s,i,d);const f=d.variants;let _=Qe;t===Qe?_=Math.min(t,f.length-1):t<Qe&&(_=Qe-1),dt(_),F([]),K(D=>D+1),wt(v[S],i,_),mt(v)},Ma=t=>{if(S===null||!C)return;const s=U[S],i=Ve[S];if(!s||!i?.isMultivariate)return;const c=ot(s,i);if(!c)return;const d=Rl(c,t,j),v=[...U];v[S]=Bt(s,i,d);const f=vo(c.variants??[],t,j);dt(f),F([]),K(_=>_+1),wt(v[S],i,f,S,j),mt(v)},Da=(t,s)=>{if(S===null||!C||t===s)return;const i=U[S],c=Ve[S];if(!i||!c?.isMultivariate)return;const d=ot(i,c);if(!d)return;const v=jl(d,t,s),f=[...U];f[S]=Bt(i,c,v);let _=Qe;Qe===t?_=s:t<Qe&&s>=Qe?_=Qe-1:t>Qe&&s<=Qe&&(_=Qe+1),dt(_),wt(f[S],c,_,S,j),mt(f)},_n=t=>{const s=t??S;if(s===null||!C)return;const i=U[s],c=Ve[s];if(!i||!c)return;const d=Sl(i,c,void 0,x,j);if(!d){ae.error(p("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const v=[...U];v[s]=d.section;const f=En(v,g,j)[s];if(!f?.isMultivariate){ae.error(p("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}I(s),dt(d.newVariantIndex),F([]),K(_=>_+1),wt(d.section,f,d.newVariantIndex,s,j),mt(v)},pr=()=>{if(S===null||!C)return;const t=U[S],s=Ve[S];if(!t||!s?.isMultivariate)return;const i=ot(t,s);if(!i)return;const c=kl(t,s,i);if(!c){ae.error(p("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const d=[...U];d[S]=c;const v=En(d,g,j)[S];if(!v)return;dt(0),nt(null),Xe(null),F([]),K(_=>_+1);const f=kt(c,v,g,j);f?(M(f.data),O(f.resolveType)):(M(null),O(null)),qt(null,S,0),mt(d)},Ia=async t=>{if(Je===null||!C)return;const s=Un(t,g,x);if(s){ae.error(s);return}const i=U[Je],c=Ve[Je];if(!i||!c)return;const d=kt(i,c,g,j);if(!d){ae.error(p("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const v={...d.data,name:t};try{await X.mutateAsync({blockKey:t,data:v});const f=[...U];f[Je]={__resolveType:t},await X.mutateAsync({blockKey:C,data:cn(g,C,f,ve,Te)}),S===Je&&Gt(),ie(null),ae.success(p("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),h?.()}catch(f){ae.error(p("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"),{description:Kt(p,Ft(f))})}},hr=Fe?.rule;if(vt&&S===null&&ge===null&&hr){const{resolveType:t,formValue:s}=Jt(hr,g??{},x??void 0);be(t),de(s)}const an=x?Pi(x):[],cs=x&&g?Mi(x,g):[],Ut=j&&x&&g?ll(x,g):[],us=(t,s)=>{if(Ut.length===0)return;const i=wl(t);return{kinds:Ut,selected:i,campaignPrefill:cl(t),onPick:s}},gr=!ne&&!!(Ce&&x&&g),vr=ge&&x?qn(ge,x):null,yt=()=>{ht.current&&(clearTimeout(ht.current),ht.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null)},jt=async(t,s)=>{if(!(Il(s,t,x)>0))try{await Vn.mutateAsync({blockKey:t})}catch(i){ae.error(p("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"),{description:Kt(p,Ft(i))})}},yr=t=>{ht.current&&clearTimeout(ht.current),ht.current=setTimeout(()=>{const{activePageKey:s,decofile:i,variantIndex:c}=Se.current;if(!s)return;const d={...i[s]},v={...d.sections},f=[...v.variants??[]],_=f[c],D=_?.rule;if(Qt(D,i,x)){const A=D?.__resolveType??"",T=i[A],P=typeof T?.name=="string"?T.name:A,{__resolveType:se,...le}=t;X.mutate({blockKey:A,data:Ot(se??"",le,P)},{onSuccess:()=>h?.(),onError:X.reportError});return}_&&(f[c]={..._,rule:t}),d.sections={...v,variants:f},X.mutate({blockKey:s,data:d},{onSuccess:()=>h?.(),onError:X.reportError})},jn)},xr=t=>{be(t);const s=t?ho(t,x):{__resolveType:go(x)};de(t?s:{}),yr(s)},br=t=>{const s=t;de(s);const i=ge?{__resolveType:ge,...s}:{...s};yr(i)},Bn=async(t,s,i)=>{const c=dl(s,t);if(!c.ok)return c.reason==="conflict"&&ae.info(t.kind==="experiments"?p("sectionsEditor.namedRulePicker.conflictTests"):p("sectionsEditor.namedRulePicker.conflictCampaigns"),mo),null;const d={};if(i){const v=i(c.rule);if(!v)return null;d[v.blockKey]=v.data}return c.blockWrite&&(d[c.blockWrite.blockKey]=c.blockWrite.block),Object.keys(d).length>0&&!(await Us.apply({writes:d})).ok?null:(c.blockWrite&&ae.success(t.kind==="experiments"?p("sectionsEditor.namedRulePicker.createdTest",{name:t.name.trim()}):p("sectionsEditor.namedRulePicker.createdCampaign",{name:t.name.trim()}),{...mo,description:p("sectionsEditor.namedRulePicker.createdHint")}),{rule:c.rule,projected:{...s,...d}})},Sr=Ut.length>0?{kinds:Ut,prepare:async t=>(await Bn(t,Se.current.decofile,void 0))?.rule??null,ensureBlock:async t=>{const s=Vl(Se.current.decofile,t);return s.kind==="saved"?!0:s.kind==="conflict"?!1:(await Us.apply({writes:{[Pl(t).blockKey]:s.block}})).ok}}:null,_r=async t=>{yt();const{activePageKey:s,decofile:i,variantIndex:c}=Se.current;if(!s)return;let d=null;const v=await Bn(t,i,D=>{const A=i[s],T=A?.sections;if(!T||typeof T!="object"||Array.isArray(T))return null;const P=T;if(!Array.isArray(P.variants))return null;const se=[...P.variants],le=se[c];return le?(d=St(le.rule,i,x),se[c]={...le,rule:D},{blockKey:s,data:{...A,sections:{...P,variants:se}}}):null});if(!v)return;const{resolveType:f,formValue:_}=Jt(v.rule,v.projected,x??void 0);be(f),de(_),d&&await jt(d,v.projected),h?.()},wr=async t=>{yt();const{activePageKey:s,decofile:i,variantIndex:c}=Se.current;if(!s)return;const d=i[s],v=d?.sections;if(!v||typeof v!="object"||Array.isArray(v))return;const f=v;if(!Array.isArray(f.variants))return;const _=[...f.variants],D=_[c];if(!D)return;const A=St(D.rule,i,x),T=dn(t);_[c]={...D,rule:T};const P={...i,[s]:{...d,sections:{...f,variants:_}}},{resolveType:se,formValue:le}=Jt(T,P,x??void 0);be(se),de(le);try{await X.mutateAsync({blockKey:s,data:P[s]}),A&&A!==t&&await jt(A,P),h?.()}catch(Be){ae.error(p("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Kt(p,Ft(Be))})}},jr=t=>{gt.current&&clearTimeout(gt.current);const{selectedSectionIndex:s,sectionVariantIndex:i}=Se.current;s!==null&&(gt.current=setTimeout(()=>{const{rawSections:c,parsedSections:d,decofile:v,activePageKey:f,pageVariants:_,variantIndex:D}=Se.current;if(!f)return;const A=c[s],T=d[s];if(!A||!T?.isMultivariate)return;const P=ot(A,T);if(!P)return;const le=(P.variants??[])[i]?.rule;if(Qt(le,v,x)){const Y=le?.__resolveType??"",ce=v[Y],Me=typeof ce?.name=="string"?ce.name:Y,{__resolveType:We,...xt}=t;X.mutate({blockKey:Y,data:Ot(We??"",xt,Me)},{onSuccess:()=>h?.(),onError:X.reportError});return}const Be=Ss(P,i,t),we=[...c];we[s]=Bt(A,T,Be);const Pe=cn(v,f,we,D,_);X.mutate({blockKey:f,data:Pe},{onSuccess:()=>h?.(),onError:X.reportError})},jn))},Ka=t=>{nt(t);const s=t?ho(t,x):{__resolveType:go(x)};Xe(t?s:{}),jr(s)},Fa=t=>{const s=t;Xe(s);const i=nn?{__resolveType:nn,...s}:{...s};jr(i)},Ba=async t=>{yt();const{selectedSectionIndex:s,sectionVariantIndex:i,rawSections:c,parsedSections:d,decofile:v,activePageKey:f,pageVariants:_,variantIndex:D}=Se.current;if(s===null||!f)return;let A=null;const T=await Bn(t,v,le=>{const Be=c[s],we=d[s];if(!Be||!we?.isMultivariate)return null;const Pe=ot(Be,we);if(!Pe)return null;const Y=Pe.variants??[];A=St(Y[i]?.rule,v,x);const ce=[...c];return ce[s]=Bt(Be,we,Ss(Pe,i,le)),{blockKey:f,data:cn(v,f,ce,D,_)}});if(!T)return;const{resolveType:P,formValue:se}=Jt(T.rule,T.projected,x??void 0);nt(P),Xe(se),A&&await jt(A,T.projected),h?.()},Oa=async t=>{yt();const{selectedSectionIndex:s,sectionVariantIndex:i,rawSections:c,parsedSections:d,decofile:v,activePageKey:f,pageVariants:_,variantIndex:D}=Se.current;if(s===null||!f)return;const A=c[s],T=d[s];if(!A||!T?.isMultivariate)return;const P=ot(A,T);if(!P)return;const se=P.variants??[],le=St(se[i]?.rule,v,x),Be=dn(t),we=Ss(P,i,Be),Pe=[...c];Pe[s]=Bt(A,T,we);const Y=cn(v,f,Pe,D,_),ce={...v,[f]:Y},{resolveType:Me,formValue:We}=Jt(Be,ce,x??void 0);nt(Me),Xe(We);try{await X.mutateAsync({blockKey:f,data:Y}),le&&le!==t&&await jt(le,ce),h?.()}catch(xt){ae.error(p("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Kt(p,Ft(xt))})}};if(!ne&&!_e)return o.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:p("sectionsEditor.sectionsEditor.noPageFound",{currentPath:u})});if(ne&&!Mn)return o.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:p("sectionsEditor.sectionsEditor.globalBlockNotFound")});const Oe=S!==null?Ve[S]??null:null,kr=S!==null?U[S]:null,Er=kr&&Oe?.isMultivariate?ot(kr,Oe):null,Vt=Er?Es(Er,re):[],On=Math.min(Qe,Math.max(Vt.length-1,0)),Rt=Vt[On]??null,Pt=Oe?.isMultivariate===!0,ds=S!==null&&Oe!==null,Mt=ds&&(Pt||!!(Fn&&he)),La=Mt&&!ne&&Oe?.isSavedBlock===!0,pt=ne||La,Rr=ne?Qs:Oe?.label??"",$a=nn&&x?qn(nn,x):null,Ar=(t,s)=>s&&q?`${t} · ${s}`:t,Cr=Oe?Oe.variantOf??Oe.label:"",za=(()=>{const t=Pt&&Rt?Rt.label:null;return t?q?[Ar(Cr,t)]:[Oe.label,t]:[Oe?.label??""]})(),fs=Ar(_e?.name??"",vt?Fe?.label:null),Ln=Mt&&(!ne||ee.length>0)?ne?[Qs,...ee]:[fs,...za,...ee]:[],Nr=He&&_e?[_e.name,"SEO",...$s]:[],Tr=p("sectionsEditor.pageVariantTabs.variantsLabel"),Vr=en&&_e?[_e.name,Tr]:$t&&_e&&Oe?[fs,Cr,Tr]:[],$n=Vr.length>0?Vr:Nr.length>0?Nr:pt?Ln.length>0?Ln:[Rr]:Ln.length>0?Ln:[fs],Pr=ds&&!Pt&&!Oe?.isHidden&&!!C,Ha=pt||!ne&&vt&&!!Fe||Pr,Wa=ds&&!Pt&&!ne&&ee.length===0&&!!Oe&&Oo(Oe)&&!!C,qa=q&&Mt&&!$t&&Pt&&ee.length===0&&!!Rt,Mr=q&&ee.length>0?eo(ee[ee.length-1]):null,Ga=ee.length>1?eo(ee[ee.length-2]):null,Dr=pt?Rr:Mt?Oe?.label??"":_e?.name??"",Ua=en||$t?p("sectionsEditor.pageVariantTabs.variantsLabel"):He?p("sectionsEditor.panelSections.seo"):Mr??Dr,Ir=$t?Oe?.variantOf??Oe?.label??"":en||He?_e?.name??"":Mr?Ga??Dr:pt?p("sectionsEditor.sectionsEditor.globalSectionSubtitle"):Mt?_e?.name??"":_e?.path??"",ms=!en&&!$t&&!He&&!Mt&&!pt,Ya=!q&&!He&&!ne&&Pt&&ee.length===0,wn=()=>{if(!C)return;yt(),$.current&&(clearTimeout($.current),$.current=null),Ke.current.clear();const t=g[C],s=_l(t.sections,U,x,j);if(!s)return;const{sections:i,newVariantIndex:c}=s;X.mutate({blockKey:C,data:{...t,sections:i}},{onSuccess:()=>{G(c),I(null),M(null),O(null),F([]),de(null),be(null)},onError:X.reportError})},zn=(t,s,i)=>{if(!C)return;yt(),$.current&&(clearTimeout($.current),$.current=null),Ke.current.clear();const c=g[C],d=c.sections;if(!d||typeof d!="object"||Array.isArray(d))return;const v=d;if(!Array.isArray(v.variants))return;const f=t([...v.variants]);if(!f)return;const _=Dl(v,f),D={...g,[C]:{...c,sections:_}};X.mutate({blockKey:C,data:D[C]},{onSuccess:()=>{s?.();const A=typeof i=="string"?[i]:i??[];(async()=>{for(const T of A)await jt(T,D)})()},onError:X.reportError})},Kr=(t,s)=>{if(t===s)return;let i=ve;ve===t?i=s:t<ve&&s>=ve?i=ve-1:t>ve&&s<=ve&&(i=ve+1),G(i);const c=Yn(Te.map(d=>({rule:d.rule})),t,s);os(c,i),zn(d=>Yn(d,t,s))},Fr=t=>{const s=Te[t]?.rule,i=St(s,g??{},x??void 0);zn(c=>c.length<=1?null:(c.splice(t,1),c),()=>{Te.length-1===1?G(0):t<ve?G(ve-1):t===ve&&G(Math.max(0,t-1)),I(null),M(null),O(null),F([]),de(null),be(null)},i)},Ja=()=>{const t=Te.map((s,i)=>({variant:s,index:i})).filter(({variant:s})=>!Tl(s.rule)).map(({variant:s})=>St(s.rule,g??{},x??void 0)).filter(s=>!!s);zn(s=>{const i=Fl({variants:s}),c=s[i];return c?[{...c,rule:Bl(x)}]:null},()=>{G(0),I(null),M(null),O(null),F([]),de(null),be(null),Cn(!1)},t)},Br=t=>{let s=t+1;zn(i=>(s=vo(i,t,j),Ol(i,t,j)),()=>{G(s),I(null),M(null),O(null),F([]),de(null),be(null)})},Qa=async(t,s)=>{yt(),$.current&&(clearTimeout($.current),$.current=null),Ke.current.clear();const i=Se.current.activePageKey,c=Se.current.decofile;if(!i)return;const d=c[i],v=d.sections;if(!v||typeof v!="object"||Array.isArray(v))return;const f=v;if(!Array.isArray(f.variants))return;const _=[...f.variants],D=_[t];if(!D?.rule||typeof D.rule!="object"){ae.error(p("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const A=D.rule,T=s.trim();rn(!0);try{if(!T){if(!Qt(A,c,x)){ze(null);return}const Pe=A.__resolveType??"";_[t]={...D,rule:Rs(A,c,x)};const Y={...c,[i]:{...d,sections:{...f,variants:_}}};await X.mutateAsync({blockKey:i,data:Y[i]}),await jt(Pe,Y),ze(null),h?.();return}const P=As(A,c,x);if(!P){ae.error(p("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(P.blockKey){await X.mutateAsync({blockKey:P.blockKey,data:Ot(P.resolveType,P.data,T)}),ze(null),h?.();return}const se=Gn(T),le=Un(se,c,x);if(le){ae.error(le);return}const Be=Ot(P.resolveType,P.data,T);let we=null;try{await X.mutateAsync({blockKey:se,data:Be}),we=se,_[t]={...D,rule:dn(se)},await X.mutateAsync({blockKey:i,data:{...d,sections:{...f,variants:_}}}),we=null}catch(Pe){throw we&&await Vn.mutateAsync({blockKey:we}).catch(()=>{}),Pe}ze(null),ae.success(p("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:T})),h?.()}catch(P){ae.error(p("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Kt(p,Ft(P))})}finally{rn(!1)}},Xa=async(t,s)=>{yt(),$.current&&(clearTimeout($.current),$.current=null),Ke.current.clear();const{selectedSectionIndex:i,rawSections:c,parsedSections:d,decofile:v,activePageKey:f,pageVariants:_,variantIndex:D}=Se.current;if(i===null||!f)return;const A=c[i],T=d[i];if(!A||!T?.isMultivariate)return;const P=ot(A,T);if(!P)return;const se=P.variants??[],le=se[t];if(!le?.rule||typeof le.rule!="object"){ae.error(p("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const Be=le.rule,we=s.trim();rn(!0);const Pe=async Y=>{const ce={...P,variants:Y},Me=[...c];Me[i]=Bt(A,T,ce);const We=cn(v,f,Me,D,_);return await X.mutateAsync({blockKey:f,data:We}),{...v,[f]:We}};try{if(!we){if(!Qt(Be,v,x)){it(null);return}const lt=Be.__resolveType??"",bt=[...se];bt[t]={...le,rule:Rs(Be,v,x)};const Dt=await Pe(bt);await jt(lt,Dt),it(null),h?.();return}const Y=As(Be,v,x);if(!Y){ae.error(p("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(Y.blockKey){await X.mutateAsync({blockKey:Y.blockKey,data:Ot(Y.resolveType,Y.data,we)}),it(null),h?.();return}const ce=Gn(we),Me=Un(ce,v,x);if(Me){ae.error(Me);return}const We=Ot(Y.resolveType,Y.data,we);let xt=null;try{await X.mutateAsync({blockKey:ce,data:We}),xt=ce;const lt=[...se];lt[t]={...le,rule:dn(ce)},await Pe(lt),xt=null}catch(lt){throw xt&&await Vn.mutateAsync({blockKey:xt}).catch(()=>{}),lt}it(null),ae.success(p("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:we})),h?.()}catch(Y){ae.error(p("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Kt(p,Ft(Y))})}finally{rn(!1)}},Or=async(t,s,i)=>{M(i);try{await X.mutateAsync({blockKey:t,data:i})}catch(c){throw M(d=>d===i?s:d),c}},Za={rename:async(t,s,i)=>{yt(),$.current&&(clearTimeout($.current),$.current=null),Ke.current.clear();const{activePageKey:c,decofile:d}=Se.current;if(!c)return;const v=Array.isArray(t.variants)?[...t.variants]:[],f=v[s],_=f?.rule&&typeof f.rule=="object"?f.rule:void 0,D=async T=>{const P={...t,variants:T};return await Or(c,t,P),{...d,[c]:P}},A=ku(_,i,d,x);if(A.kind!=="noop"){if(A.kind==="error"){ae.error(A.reason==="no-matcher-rule"?p("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):A.reason==="unreadable-rule"?p("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):A.message??p("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}rn(!0);try{if(A.kind==="inline"){const P=[...v];P[s]={...f,rule:A.inlinedRule};const se=await D(P);await jt(A.blockKey,se),h?.();return}if(A.kind==="updateBlock"){await X.mutateAsync({blockKey:A.blockKey,data:A.blockData}),h?.();return}let T=null;try{await X.mutateAsync({blockKey:A.blockId,data:A.blockData}),T=A.blockId;const P=[...v];P[s]={...f,rule:A.reference},await D(P),T=null}catch(P){throw T&&await Vn.mutateAsync({blockKey:T}).catch(()=>{}),P}ae.success(p("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:i.trim()})),h?.()}catch(T){ae.error(p("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Kt(p,Ft(T))})}finally{rn(!1)}}},selectGlobal:async(t,s,i)=>{yt(),$.current&&(clearTimeout($.current),$.current=null),Ke.current.clear();const{activePageKey:c,decofile:d}=Se.current;if(!c)return;const v=Array.isArray(t.variants)?[...t.variants]:[],f=v[s];if(!f)return;const _=St(f.rule,d,x);v[s]={...f,rule:dn(i)};const D={...t,variants:v},A={...d,[c]:D};try{await Or(c,t,D),_&&_!==i&&await jt(_,A),h?.()}catch(T){ae.error(p("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Kt(p,Ft(T))})}},selectNamedRule:async(t,s,i)=>{yt(),$.current&&(clearTimeout($.current),$.current=null),Ke.current.clear();const{activePageKey:c,decofile:d}=Se.current;if(!c)return;let v=null,f=null;const _=await Bn(i,d,D=>{const A=Array.isArray(t.variants)?[...t.variants]:[],T=A[s];return T?(v=St(T.rule,d,x),A[s]={...T,rule:D},f={...t,variants:A},{blockKey:c,data:f}):null});!_||!f||(M(f),v&&await jt(v,_.projected),h?.())}},Lr=()=>{Gt()},$r=t=>{mn(t),ls({inner:t})},zr=t=>{Tn(t),ls({raw:t})},Hr=()=>{mn(null),zt([])},Wr=()=>tn(t=>t+1),qr=()=>{pn.flush(),fn(!1),mn(null),Tn(void 0),zt([]),tn(t=>t+1),N?.()},ei=()=>{Cn(!1),Nn(!1),I(null),fn(!0)},ti=()=>{He&&qr(),I(null),Cn(!0)},ni=()=>Nn(!0),ps=t=>{if(en&&t===0){Cn(!1);return}if($t&&t<2){Nn(!1),t===0&&I(null);return}if(He){if(t===0){qr();return}if(t===1){zt([]),tn(i=>i+1);return}zt($s.slice(0,t-1)),tn(i=>i+1);return}if(ne){F(ee.slice(0,t)),K(i=>i+1);return}if(t===0){Lr();return}if(t===1){F([]),K(i=>i+1);return}const s=!q&&Pt&&Rt?1:0;if(s===1&&t===2){F([]),K(i=>i+1);return}F(ee.slice(0,t-1-s))},hs=$n.length>1?o.jsx("button",{type:"button",onClick:()=>ps(Wi($n.length,{isMultivariateSectionTop:Ya})),title:p("sectionsEditor.sectionsEditor.back"),"aria-label":p("sectionsEditor.sectionsEditor.back"),className:me("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",pt?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:o.jsx(Ji,{className:"size-4"})}):null,si=pt||Mt||He?Ha&&o.jsxs("div",{className:me("border-b px-3 py-2.5",pt&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!ne&&vt&&Fe&&o.jsxs("button",{type:"button",onClick:Lr,title:p("sectionsEditor.sectionsEditor.editingInVariant",{variant:Fe.label}),className:me("shrink-0 inline-flex items-center gap-1 rounded-lg h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",Ii),children:[o.jsx(Di,{rule:bs(Fe.rule,g??{},x??void 0),matchers:an}),o.jsx("span",{className:"max-w-[160px] truncate",children:Fe.label})]}),o.jsx("div",{className:"flex-1"}),pt&&o.jsxs(At,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx("span",{className:"shrink-0 cursor-help",children:o.jsx(Qn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),o.jsx(Nt,{side:"bottom",className:"max-w-[260px]",children:p("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Pr&&o.jsx(Wn,{onClick:()=>_n()})]}),pt&&o.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:p("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):o.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[o.jsx("div",{className:"flex-1 min-w-0",children:o.jsx(to,{pageKey:C,initialName:_e.name,initialPath:_e.path,onFieldChange:dr,variant:"header"})}),o.jsxs(At,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(Et,{type:"button",variant:"ghost",size:"icon-sm","aria-label":p("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:()=>fn(!0),children:o.jsx(co,{size:14})})}),o.jsx(Nt,{side:"bottom",children:p("sectionsEditor.sectionsEditor.editSeo")})]}),o.jsxs(At,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(Et,{type:"button",variant:"ghost",size:"icon-sm","aria-label":p("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>z&&C?z():es(!0),children:o.jsx(uo,{size:14})})}),o.jsx(Nt,{side:"bottom",children:p("sectionsEditor.sectionsEditor.viewJson")})]}),o.jsx(Wn,{onClick:wn})]}),ri=o.jsxs(o.Fragment,{children:[vt&&C&&o.jsx(no,{listKey:C,variants:Te,activeIndex:ve,decofile:g??{},meta:x,matchers:an,onSelect:yn,onReorder:Kr,onRename:ze,onDuplicate:Br,onDelete:Fr,onAdd:wn}),vt&&ge!==null&&o.jsx(so,{className:"mt-3",children:o.jsx("div",{className:me("space-y-3",sn&&"pointer-events-none opacity-50"),children:o.jsx(vs,{currentRt:ge,currentLabel:kn(Fe?.rule,g??{},re,x??void 0),currentGlobalKey:St(Fe?.rule,g??{},x??void 0)??void 0,matchers:an,globals:cs,onSelect:xr,onSelectGlobal:wr,named:us(Fe?.rule,_r),namedRow:xs(Fe?.rule,Ut),rule:Fe?.rule,schema:vr,formValue:Ye,onChange:br,formKey:`${ve}:${ge??""}`,formWrapperClassName:"space-y-3",meta:x??void 0,decofile:g,onSaveReferencedBlock:hn,sandbox:xn})})})]}),Gr=o.jsxs(o.Fragment,{children:[o.jsx(Ki,{listKey:`${C??""}:${S??""}`,variants:Vt.map((t,s)=>({index:s,label:t.label})),selectedIndex:On,onSelect:mr,onRename:it,onDuplicate:Ma,onDelete:Pa,onRemoveAll:pr,onReorder:Da,onAdd:()=>_n()}),o.jsx(so,{children:o.jsx(vs,{currentRt:nn??"",currentLabel:kn(Rt?.rule,g??{},re,x??void 0),currentGlobalKey:St(Rt?.rule,g??{},x??void 0)??void 0,matchers:an,globals:cs,onSelect:Ka,onSelectGlobal:Oa,named:us(Rt?.rule,Ba),namedRow:xs(Rt?.rule,Ut),rule:Rt?.rule,schema:$a,formValue:ea,onChange:Fa,formKey:`${S??"none"}:${On}:${nn??""}`,formWrapperClassName:"pt-1",meta:x??void 0,decofile:g,onSaveReferencedBlock:hn,sandbox:xn})})]}),Ur=o.jsx("div",{className:me(q?"px-2":"p-2 pt-3"),children:o.jsx(Pc,{listKey:`${C??""}-${ve}`,rawSections:U,sections:Ve,meta:x,decofile:g,selectedIndex:S,onSelect:ja,onReorder:ka,onDelete:Ea,onDuplicate:Ra,onMakeReusable:ie,onToggleHidden:Aa,onToggleLazy:Ae?Ca:void 0,onAddVariant:_n,onDetach:Na,onAddSection:()=>Zt(!0),canAddSection:gr})}),oi=o.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[C&&_e&&o.jsx(to,{pageKey:C,initialName:_e.name,initialPath:_e.path,onFieldChange:dr}),Wt&&C?o.jsx(wo,{rawSeo:Dn,innerSeo:rs,defaultResolveType:Zs,seoTypesLoading:j&&!x,seoSchema:er,activeResolveType:In,seoTypeOptions:Xs,formResetKey:zs,siteDefaultSeo:tr,onBreadcrumbChange:zt,onPersistRaw:zr,onInnerChange:$r,onClearForm:Hr,onBumpFormKey:Wr,asyncRenderAvailable:Ae}):o.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:p("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),ai=o.jsx(un,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:o.jsx("div",{className:"mx-auto max-w-2xl",children:Wt&&C?o.jsx(wo,{rawSeo:Dn,innerSeo:rs,defaultResolveType:Zs,seoTypesLoading:j&&!x,seoSchema:er,activeResolveType:In,seoTypeOptions:Xs,formResetKey:zs,siteDefaultSeo:tr,onBreadcrumbChange:zt,onPersistRaw:zr,onInnerChange:$r,onClearForm:Hr,onBumpFormKey:Wr,asyncRenderAvailable:Ae}):o.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:p("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),ii=o.jsxs(un,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[vt&&C&&o.jsx(no,{listKey:C,variants:Te,activeIndex:ve,decofile:g??{},meta:x,matchers:an,onSelect:yn,onReorder:Kr,onRename:ze,onDuplicate:Br,onDelete:Fr,onAdd:wn}),vt&&ge!==null&&o.jsxs("div",{className:me("px-3 border-b",An?"pt-3 pb-5 space-y-3":"py-2"),children:[o.jsxs("button",{type:"button",onClick:()=>Xo(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-[var(--studio-control-radius,var(--radius-sm))] py-0.5 hover:bg-accent","aria-expanded":An,children:[o.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:p("sectionsEditor.sectionsEditor.variantRule")}),An?o.jsx(Gi,{className:"size-3.5 shrink-0 text-muted-foreground"}):o.jsx(Ui,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),An&&o.jsx("div",{className:me("space-y-3",sn&&"pointer-events-none opacity-50"),children:o.jsx(vs,{currentRt:ge,currentLabel:kn(Fe?.rule,g??{},re,x??void 0),currentGlobalKey:St(Fe?.rule,g??{},x??void 0)??void 0,matchers:an,globals:cs,onSelect:xr,onSelectGlobal:wr,named:us(Fe?.rule,_r),namedRow:xs(Fe?.rule,Ut),rule:Fe?.rule,schema:vr,formValue:Ye,onChange:br,formKey:`${ve}:${ge??""}`,formWrapperClassName:"space-y-3",meta:x??void 0,decofile:g,onSaveReferencedBlock:hn,sandbox:xn})})]}),Ur]},"editor-section-list");return o.jsx(Fi,{value:j,children:o.jsx(Bi,{children:o.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!q&&hs&&o.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:hs}),(q||$n.length>1)&&o.jsx(Oi,{crumbs:$n,onSelect:ps,onSelectRoot:()=>{pn.flush(),L?L():ps(0)}}),o.jsx("div",{className:"shrink-0",children:q?o.jsxs("div",{className:me("flex items-center gap-2 border-b px-3 py-2.5",pt&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[q&&hs,pt&&o.jsxs(At,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx("span",{className:"shrink-0 cursor-help",children:o.jsx(Qn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),o.jsx(Nt,{side:"bottom",className:"max-w-[260px]",children:p("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),o.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[o.jsx("span",{className:"truncate text-sm font-semibold",children:Ua}),Ir&&o.jsx("span",{className:"truncate text-xs text-muted-foreground",children:Ir})]}),ms&&vt&&Fe&&o.jsx(ro,{variants:Te,activeIndex:ve,onSelect:yn,onManage:ti,onRemoveAll:Ja}),qa&&o.jsx(ro,{variants:Vt,activeIndex:On,onSelect:mr,onManage:ni,onRemoveAll:pr}),ms&&!vt&&o.jsx(Wn,{onClick:wn}),Wa&&o.jsx(Wn,{onClick:()=>_n()}),o.jsx(Li,{}),ms&&o.jsxs(o.Fragment,{children:[o.jsxs(At,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(Et,{type:"button",variant:"outline",size:"icon-sm","aria-label":p("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:ei,children:o.jsx(co,{size:14})})}),o.jsx(Nt,{side:"bottom",children:p("sectionsEditor.sectionsEditor.editSeo")})]}),!z&&o.jsxs(At,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(Et,{type:"button",variant:"outline",size:"icon-sm","aria-label":p("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>es(!0),children:o.jsx(uo,{size:14})})}),o.jsx(Nt,{side:"bottom",children:p("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):si}),ft&&o.jsx(Zc,{open:!0,fields:zc(ft.plan,ft.target.schema),choices:ft.choices,changedAgain:ft.changedAgain,author:ca,fresh:ft.fresh,onChoose:(t,s)=>wa({...ft.choices,[t]:s}),onApply:_a},Cu(ft.formBase)),$t?o.jsx(oo,{onAdd:()=>_n(),children:Gr},"editor-section-variants"):Mt?o.jsxs(un,{viewportRef:De,onBlur:ar,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!q&&Pt&&Vt.length>0&&ee.length===0&&Gr,o.jsx(po,{value:Sr,children:o.jsx(ao,{value:ne&&j?Ue:null,children:o.jsx(io,{activeSchema:Fn,formValue:he,formResetKey:st,onFormChange:ur,onBreadcrumbChange:F,breadcrumbPath:ee,emptyMessage:p("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:x,decofile:g,onSaveReferencedBlock:hn,sandbox:xn,previewBaseUrl:fe,onRequestAddSection:fr,onVariantMatcherOp:ne?Za:void 0})})})]},"editor-section-form"):ne?o.jsx(un,{viewportRef:De,onBlur:ar,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx(po,{value:Sr,children:o.jsx(ao,{value:ne&&j?Ue:null,children:o.jsx(io,{activeSchema:Fn,formValue:he,formResetKey:st,onFormChange:ur,onBreadcrumbChange:F,breadcrumbPath:ee,emptyMessage:p("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:x,decofile:g,onSaveReferencedBlock:hn,sandbox:xn,previewBaseUrl:fe,onRequestAddSection:fr})})})},"editor-global-block"):He?q?o.jsx(un,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"p-3",children:oi})},"editor-seo"):ai:en?o.jsx(oo,{onAdd:wn,children:ri},"editor-variants"):q?o.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[o.jsx(un,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"py-2",children:Ur})}),o.jsx("div",{className:"shrink-0 border-t p-2",children:o.jsx(Ts,{canAddSection:gr,onAddSection:()=>Zt(!0)})})]},"editor-section-list"):ii,o.jsx($i,{open:Je!==null,onOpenChange:t=>{t||ie(null)},defaultBlockId:Je!==null?Gn(Ve[Je]?.label??""):"",isPending:X.isPending,onSubmit:Ia}),Ce&&o.jsx(rc,{open:Qo,onOpenChange:t=>{Zt(t),t||(Rn.current=null)},meta:x,decofile:g,previewBaseUrl:fe,onSelect:Va}),Fs&&C&&g&&o.jsx(pl,{open:Fs,onOpenChange:es,pageKey:C,decofile:g}),Ne!==null&&o.jsx(lo,{open:!0,initialName:Qt(Te[Ne]?.rule,g??{},x??void 0)?kn(Te[Ne]?.rule,g??{},re,x??void 0):"",autoLabel:re(bs(Te[Ne]?.rule,g??{},x??void 0)),isPending:sn,onSubmit:async t=>{await Qa(Ne,t)},onOpenChange:t=>{!t&&!sn&&ze(null)}}),rt!==null&&o.jsx(lo,{open:!0,initialName:Qt(Vt[rt]?.rule,g??{},x??void 0)?kn(Vt[rt]?.rule,g??{},re,x??void 0):"",autoLabel:re(bs(Vt[rt]?.rule,g??{},x??void 0)),isPending:sn,onSubmit:async t=>{await Xa(rt,t)},onOpenChange:t=>{!t&&!sn&&it(null)}})]})})})}export{gm as SectionsEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d,bw as rt,bx as _e,j as c,by as st,bz as Ie,bA as k,bB as lt,bC as j,bD as N,bE as $,bF as at,b2 as Ee,bG as Re,bH as it,bI as ct,bJ as dt,bK as ut,bL as pt,bM as ft,bN as mt,bO as ht,bP as vt,bQ as gt,bR as xt,bS as St,c as ee,l as oe,af as wt}from"./index-D_jzSCP9.js";import{c as Ne}from"./index-BdQq_4o_.js";import{V as Ct}from"./index-DHWYq2vY.js";import{t as je,n as bt}from"./ChevronUp-BnA2Nw_G.js";var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,Tt]=it(J),[ne]=vt(J,[Tt,Re]),pe=Re(),[_t,G]=ne(J),[Nt,Pt]=ne(J),Me=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:l,value:s,defaultValue:a,onValueChange:i,dir:u,name:f,autoComplete:m,disabled:w,required:C,form:S}=r,p=pe(e),[g,b]=d.useState(null),[v,x]=d.useState(null),[F,M]=d.useState(!1),re=rt(u),[P,O]=_e({prop:o,defaultProp:n??!1,onChange:l,caller:J}),[U,q]=_e({prop:s,defaultProp:a,onChange:i,caller:J}),L=d.useRef(null),B=g?S||!!g.closest("form"):!0,[W,V]=d.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return c.jsx(st,{...p,children:c.jsxs(_t,{required:C,scope:e,trigger:g,onTriggerChange:b,valueNode:v,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:Ie(),value:U,onValueChange:q,open:P,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:w,children:[c.jsx(de.Provider,{scope:e,children:c.jsx(Nt,{scope:r.__scopeSelect,onNativeOptionAdd:d.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:d.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?c.jsxs(et,{"aria-hidden":!0,required:C,tabIndex:-1,name:f,autoComplete:m,value:U,onChange:E=>q(E.target.value),disabled:w,form:S,children:[U===void 0?c.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};Me.displayName=J;var Ae="SelectTrigger",Oe=d.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,l=pe(t),s=G(Ae,t),a=s.disabled||o,i=k(e,s.onTriggerChange),u=ue(t),f=d.useRef("touch"),[m,w,C]=ot(p=>{const g=u().filter(x=>!x.disabled),b=g.find(x=>x.value===s.value),v=nt(g,p,b);v!==void 0&&s.onValueChange(v.value)}),S=p=>{a||(s.onOpenChange(!0),C()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return c.jsx(lt,{asChild:!0,...l,children:c.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":tt(s.value)?"":void 0,...n,ref:i,onClick:N(n.onClick,p=>{p.currentTarget.focus(),f.current!=="mouse"&&S(p)}),onPointerDown:N(n.onPointerDown,p=>{f.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:N(n.onKeyDown,p=>{const g=m.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&w(p.key),!(g&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Oe.displayName=Ae;var De="SelectValue",ke=d.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:l,placeholder:s="",...a}=r,i=G(De,t),{onValueNodeHasChildrenChange:u}=i,f=l!==void 0,m=k(e,i.onValueNodeChange);return $(()=>{u(f)},[u,f]),c.jsx(j.span,{...a,ref:m,style:{pointerEvents:"none"},children:tt(i.value)?c.jsx(c.Fragment,{children:s}):l})});ke.displayName=De;var Et="SelectIcon",Le=d.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return c.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});Le.displayName=Et;var Rt="SelectPortal",Be=r=>c.jsx(at,{asChild:!0,...r});Be.displayName=Rt;var Q="SelectContent",Ve=d.forwardRef((r,e)=>{const t=G(Q,r.__scopeSelect),[o,n]=d.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const l=o;return l?Ee.createPortal(c.jsx(He,{scope:r.__scopeSelect,children:c.jsx(de.Slot,{scope:r.__scopeSelect,children:c.jsx("div",{children:r.children})})}),l):null}return c.jsx(ze,{...r,ref:e})});Ve.displayName=Q;var A=10,[He,Y]=ne(Q),jt="SelectContentImpl",Mt=gt("SelectContent.RemoveScroll"),ze=d.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:l,onPointerDownOutside:s,side:a,sideOffset:i,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:w,collisionPadding:C,sticky:S,hideWhenDetached:p,avoidCollisions:g,...b}=r,v=G(Q,t),[x,F]=d.useState(null),[M,re]=d.useState(null),P=k(e,h=>F(h)),[O,U]=d.useState(null),[q,L]=d.useState(null),B=ue(t),[W,V]=d.useState(!1),H=d.useRef(!1);d.useEffect(()=>{if(x)return ut(x)},[x]),pt();const E=d.useCallback(h=>{const[T,...R]=B().map(_=>_.ref.current),[y]=R.slice(-1),I=document.activeElement;for(const _ of h)if(_===I||(_?.scrollIntoView({block:"nearest"}),_===T&&M&&(M.scrollTop=0),_===y&&M&&(M.scrollTop=M.scrollHeight),_?.focus(),document.activeElement!==I))return},[B,M]),D=d.useCallback(()=>E([O,x]),[E,O,x]);d.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=v;d.useEffect(()=>{if(x){let h={x:0,y:0};const T=y=>{h={x:Math.abs(Math.round(y.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(y.pageY)-(K.current?.y??0))}},R=y=>{h.x<=10&&h.y<=10?y.preventDefault():x.contains(y.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),d.useEffect(()=>{const h=()=>z(!1);return window.addEventListener("blur",h),window.addEventListener("resize",h),()=>{window.removeEventListener("blur",h),window.removeEventListener("resize",h)}},[z]);const[fe,ae]=ot(h=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),y=nt(T,h,R);y&&setTimeout(()=>y.ref.current.focus())}),me=d.useCallback((h,T,R)=>{const y=!H.current&&!R;(v.value!==void 0&&v.value===T||y)&&(U(h),y&&(H.current=!0))},[v.value]),he=d.useCallback(()=>x?.focus(),[x]),te=d.useCallback((h,T,R)=>{const y=!H.current&&!R;(v.value!==void 0&&v.value===T||y)&&L(h)},[v.value]),ie=o==="popper"?Se:Fe,se=ie===Se?{side:a,sideOffset:i,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:w,collisionPadding:C,sticky:S,hideWhenDetached:p,avoidCollisions:g}:{};return c.jsx(He,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:c.jsx(ft,{as:Mt,allowPinchZoom:!0,children:c.jsx(mt,{asChild:!0,trapped:v.open,onMountAutoFocus:h=>{h.preventDefault()},onUnmountAutoFocus:N(n,h=>{v.trigger?.focus({preventScroll:!0}),h.preventDefault()}),children:c.jsx(ht,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:h=>h.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:c.jsx(ie,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:h=>h.preventDefault(),...b,...se,onPlaced:()=>V(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:N(b.onKeyDown,h=>{const T=h.ctrlKey||h.altKey||h.metaKey;if(h.key==="Tab"&&h.preventDefault(),!T&&h.key.length===1&&ae(h.key),["ArrowUp","ArrowDown","Home","End"].includes(h.key)){let y=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(h.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(h.key)){const I=h.target,_=y.indexOf(I);y=y.slice(_+1)}setTimeout(()=>E(y)),h.preventDefault()}})})})})})})});ze.displayName=jt;var At="SelectItemAlignedPosition",Fe=d.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,l=G(Q,t),s=Y(Q,t),[a,i]=d.useState(null),[u,f]=d.useState(null),m=k(e,P=>f(P)),w=ue(t),C=d.useRef(!1),S=d.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:b,focusSelectedItem:v}=s,x=d.useCallback(()=>{if(l.trigger&&l.valueNode&&a&&u&&p&&g&&b){const P=l.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=l.valueNode.getBoundingClientRect(),q=b.getBoundingClientRect();if(l.dir!=="rtl"){const I=q.left-O.left,_=U.left-I,X=P.left-_,Z=P.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(_,[A,Math.max(A,ge-ve)]);a.style.minWidth=Z+"px",a.style.left=xe+"px"}else{const I=O.right-q.right,_=window.innerWidth-U.right-I,X=window.innerWidth-P.right-_,Z=P.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(_,[A,Math.max(A,ge-ve)]);a.style.minWidth=Z+"px",a.style.right=xe+"px"}const L=w(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(g.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=P.top+P.height/2-A,ie=B-te,se=g.offsetHeight/2,h=g.offsetTop+se,T=H+E+h,R=K-T;if(T<=te){const I=L.length>0&&g===L[L.length-1].ref.current;a.style.bottom="0px";const _=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ie,se+(I?he:0)+_+D),Z=T+X;a.style.height=Z+"px"}else{const I=L.length>0&&g===L[0].ref.current;a.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;a.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}a.style.margin=`${A}px 0`,a.style.minHeight=fe+"px",a.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>C.current=!0)}},[w,l.trigger,l.valueNode,a,u,p,g,b,l.dir,o]);$(()=>x(),[x]);const[F,M]=d.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=d.useCallback(P=>{P&&S.current===!0&&(x(),v?.(),S.current=!1)},[x,v]);return c.jsx(Dt,{scope:t,contentWrapper:a,shouldExpandOnScrollRef:C,onScrollButtonChange:re,children:c.jsx("div",{ref:i,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:c.jsx(j.div,{...n,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});Fe.displayName=At;var Ot="SelectPopperPosition",Se=d.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...l}=r,s=pe(t);return c.jsx(xt,{...s,...l,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=Ot;var[Dt,Te]=ne(Q,{}),we="SelectViewport",Ue=d.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,l=Y(we,t),s=Te(we,t),a=k(e,l.onViewportChange),i=d.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),c.jsx(de.Slot,{scope:t,children:c.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:N(n.onScroll,u=>{const f=u.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:w}=s;if(w?.current&&m){const C=Math.abs(i.current-f.scrollTop);if(C>0){const S=window.innerHeight-A*2,p=parseFloat(m.style.minHeight),g=parseFloat(m.style.height),b=Math.max(p,g);if(b<S){const v=b+C,x=Math.min(S,v),F=v-x;m.style.height=x+"px",m.style.bottom==="0px"&&(f.scrollTop=F>0?F:0,m.style.justifyContent="flex-end")}}}i.current=f.scrollTop})})})]})});Ue.displayName=we;var We="SelectGroup",[kt,Lt]=ne(We),Bt=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=Ie();return c.jsx(kt,{scope:t,id:n,children:c.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Bt.displayName=We;var Ke="SelectLabel",Vt=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=Lt(Ke,t);return c.jsx(j.div,{id:n.id,...o,ref:e})});Vt.displayName=Ke;var ce="SelectItem",[Ht,$e]=ne(ce),Ge=d.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:l,...s}=r,a=G(ce,t),i=Y(ce,t),u=a.value===o,[f,m]=d.useState(l??""),[w,C]=d.useState(!1),S=k(e,v=>i.itemRefCallback?.(v,o,n)),p=Ie(),g=d.useRef("touch"),b=()=>{n||(a.onValueChange(o),a.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(Ht,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:d.useCallback(v=>{m(x=>x||(v?.textContent??"").trim())},[]),children:c.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:f,children:c.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":w?"":void 0,"aria-selected":u&&w,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:N(s.onFocus,()=>C(!0)),onBlur:N(s.onBlur,()=>C(!1)),onClick:N(s.onClick,()=>{g.current!=="mouse"&&b()}),onPointerUp:N(s.onPointerUp,()=>{g.current==="mouse"&&b()}),onPointerDown:N(s.onPointerDown,v=>{g.current=v.pointerType}),onPointerMove:N(s.onPointerMove,v=>{g.current=v.pointerType,n?i.onItemLeave?.():g.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(s.onPointerLeave,v=>{v.currentTarget===document.activeElement&&i.onItemLeave?.()}),onKeyDown:N(s.onKeyDown,v=>{i.searchRef?.current!==""&&v.key===" "||(It.includes(v.key)&&b(),v.key===" "&&v.preventDefault())})})})})});Ge.displayName=ce;var le="SelectItemText",Ye=d.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...l}=r,s=G(le,t),a=Y(le,t),i=$e(le,t),u=Pt(le,t),[f,m]=d.useState(null),w=k(e,b=>m(b),i.onItemTextChange,b=>a.itemTextRefCallback?.(b,i.value,i.disabled)),C=f?.textContent,S=d.useMemo(()=>c.jsx("option",{value:i.value,disabled:i.disabled,children:C},i.value),[i.disabled,i.value,C]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=u;return $(()=>(p(S),()=>g(S)),[p,g,S]),c.jsxs(c.Fragment,{children:[c.jsx(j.span,{id:i.textId,...l,ref:w}),i.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ee.createPortal(l.children,s.valueNode):null]})});Ye.displayName=le;var qe="SelectItemIndicator",Xe=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return $e(qe,t).isSelected?c.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});Xe.displayName=qe;var Ce="SelectScrollUpButton",Ze=d.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,l]=d.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let a=function(){const u=i.scrollTop>0;l(u)};const i=t.viewport;return a(),i.addEventListener("scroll",a),()=>i.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),n?c.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:i}=t;a&&i&&(a.scrollTop=a.scrollTop-i.offsetHeight)}}):null});Ze.displayName=Ce;var be="SelectScrollDownButton",Je=d.forwardRef((r,e)=>{const t=Y(be,r.__scopeSelect),o=Te(be,r.__scopeSelect),[n,l]=d.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let a=function(){const u=i.scrollHeight-i.clientHeight,f=Math.ceil(i.scrollTop)<u;l(f)};const i=t.viewport;return a(),i.addEventListener("scroll",a),()=>i.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),n?c.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:i}=t;a&&i&&(a.scrollTop=a.scrollTop+i.offsetHeight)}}):null});Je.displayName=be;var Qe=d.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,l=Y("SelectScrollButton",t),s=d.useRef(null),a=ue(t),i=d.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return d.useEffect(()=>()=>i(),[i]),$(()=>{a().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),c.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:N(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:N(n.onPointerMove,()=>{l.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:N(n.onPointerLeave,()=>{i()})})}),zt="SelectSeparator",Ft=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return c.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});Ft.displayName=zt;var ye="SelectArrow",Ut=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),l=G(ye,t),s=Y(ye,t);return l.open&&s.position==="popper"?c.jsx(St,{...n,...o,ref:e}):null});Ut.displayName=ye;var Wt="SelectBubbleInput",et=d.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=d.useRef(null),l=k(o,n),s=ct(e);return d.useEffect(()=>{const a=n.current;if(!a)return;const i=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(i,"value").set;if(s!==e&&f){const m=new Event("change",{bubbles:!0});f.call(a,e),a.dispatchEvent(m)}},[s,e]),c.jsx(j.select,{...t,style:{...Ct,...t.style},ref:l,defaultValue:e})});et.displayName=Wt;function tt(r){return r===""||r===void 0}function ot(r){const e=dt(r),t=d.useRef(""),o=d.useRef(0),n=d.useCallback(s=>{const a=t.current+s;e(a),(function i(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>i(""),1e3))})(a)},[e]),l=d.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,l]}function nt(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,l=t?r.indexOf(t):-1;let s=Kt(r,Math.max(l,0));n.length===1&&(s=s.filter(u=>u!==t));const i=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return i!==t?i:void 0}function Kt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var $t=Me,Gt=Oe,Yt=ke,qt=Le,Xt=Be,Zt=Ve,Jt=Ue,Qt=Ge,Pe=Ye,eo=Xe,to=Ze,oo=Je;function co(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx($t,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx(Yt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(15);let t,o,n,l,s;e[0]!==r?({className:o,size:l,variant:s,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=l===void 0?"default":l,i=s===void 0?"outline":s;let u;e[6]!==o?(u=oe("data-[placeholder]:text-subtle-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-ring aria-invalid:bg-destructive/10 aria-invalid:shadow-[inset_0_0_0_1px_var(--destructive)] flex w-fit items-center justify-between gap-1.5 px-3 text-sm whitespace-nowrap transition-[color,background-color,box-shadow] outline-none disabled:text-subtle-foreground disabled:pointer-events-none","data-[variant=outline]:rounded-[var(--studio-control-radius,var(--radius-lg))] data-[variant=outline]:bg-[var(--studio-input-background)] data-[variant=outline]:shadow-edge data-[variant=outline]:hover:bg-sidebar","data-[variant=filled]:rounded-full data-[variant=filled]:bg-muted data-[variant=filled]:hover:bg-secondary-hover","data-[variant=pill]:rounded-full data-[variant=pill]:bg-card data-[variant=pill]:shadow-edge data-[variant=pill]:hover:bg-[var(--studio-outline-hover-background)]","data-[size=default]:h-[var(--studio-control-height,2.25rem)] data-[size=default]:pl-4 data-[size=sm]:h-8 data-[size=xs]:h-7 data-[size=xs]:px-2.5 data-[size=xs]:text-xs data-[size=xs]:font-medium","*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",o),e[6]=o,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=c.jsx(qt,{asChild:!0,children:c.jsx(je,{className:"size-3.5 stroke-[1.5]"})}),e[8]=f):f=e[8];let m;return e[9]!==t||e[10]!==n||e[11]!==a||e[12]!==u||e[13]!==i?(m=c.jsxs(Gt,{"data-slot":"select-trigger","data-size":a,"data-variant":i,className:u,...n,children:[t,f]}),e[9]=t,e[10]=n,e[11]=a,e[12]=u,e[13]=i,e[14]=m):m=e[14],m}function fo(r){const e=ee.c(25);let t,o,n,l,s;e[0]!==r?({className:o,children:t,position:l,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=l===void 0?"popper":l,i=s===void 0?!1:s,u=a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let f;e[6]!==o||e[7]!==u?(f=oe("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-[var(--studio-surface-radius,var(--radius-lg))] border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=f):f=e[8];let m;e[9]!==i?(m=!i&&c.jsx(no,{}),e[9]=i,e[10]=m):m=e[10];const w=a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let C;e[11]!==w?(C=oe("p-1",w),e[11]=w,e[12]=C):C=e[12];let S;e[13]!==t||e[14]!==C?(S=c.jsx(Jt,{className:C,children:t}),e[13]=t,e[14]=C,e[15]=S):S=e[15];let p;e[16]!==i?(p=!i&&c.jsx(ro,{}),e[16]=i,e[17]=p):p=e[17];let g;return e[18]!==a||e[19]!==n||e[20]!==f||e[21]!==m||e[22]!==S||e[23]!==p?(g=c.jsx(Xt,{children:c.jsxs(Zt,{"data-slot":"select-content",translate:"no",className:f,position:a,...n,children:[m,S,p]})}),e[18]=a,e[19]=n,e[20]=f,e[21]=m,e[22]=S,e[23]=p,e[24]=g):g=e[24],g}function mo(r){const e=ee.c(19);let t,o,n,l,s;e[0]!==r?({className:o,children:t,description:n,hideCheck:s,...l}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=s===void 0?!1:s,i=n&&"items-start py-2";let u;e[6]!==o||e[7]!==i?(u=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",i,o),e[6]=o,e[7]=i,e[8]=u):u=e[8];let f;e[9]!==a?(f=!a&&c.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:c.jsx(eo,{children:c.jsx(wt,{className:"size-4"})})}),e[9]=a,e[10]=f):f=e[10];let m;e[11]!==t||e[12]!==n?(m=n?c.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[c.jsx(Pe,{children:t}),c.jsx("span",{className:"text-xs text-muted-foreground whitespace-normal",children:n})]}):c.jsx(Pe,{children:t}),e[11]=t,e[12]=n,e[13]=m):m=e[13];let w;return e[14]!==l||e[15]!==u||e[16]!==f||e[17]!==m?(w=c.jsxs(Qt,{"data-slot":"select-item",className:u,...l,children:[f,m]}),e[14]=l,e[15]=u,e[16]=f,e[17]=m,e[18]=w):w=e[18],w}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsx(bt,{className:"size-4"}),e[5]=l):l=e[5];let s;return e[6]!==o||e[7]!==n?(s=c.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:l}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsx(je,{className:"size-4"}),e[5]=l):l=e[5];let s;return e[6]!==o||e[7]!==n?(s=c.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:l}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{co as S,uo as a,po as b,mo as c,fo as d};
|
|
1
|
+
import{r as d,bw as rt,bx as _e,j as c,by as st,bz as Ie,bA as k,bB as lt,bC as j,bD as N,bE as $,bF as at,b2 as Ee,bG as Re,bH as it,bI as ct,bJ as dt,bK as ut,bL as pt,bM as ft,bN as mt,bO as ht,bP as vt,bQ as gt,bR as xt,bS as St,c as ee,l as oe,af as wt}from"./index-BeWb3VLq.js";import{c as Ne}from"./index-BdQq_4o_.js";import{V as Ct}from"./index-CdhgpKbn.js";import{t as je,n as bt}from"./ChevronUp-BT7eMKPK.js";var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,Tt]=it(J),[ne]=vt(J,[Tt,Re]),pe=Re(),[_t,G]=ne(J),[Nt,Pt]=ne(J),Me=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:l,value:s,defaultValue:a,onValueChange:i,dir:u,name:f,autoComplete:m,disabled:w,required:C,form:S}=r,p=pe(e),[g,b]=d.useState(null),[v,x]=d.useState(null),[F,M]=d.useState(!1),re=rt(u),[P,O]=_e({prop:o,defaultProp:n??!1,onChange:l,caller:J}),[U,q]=_e({prop:s,defaultProp:a,onChange:i,caller:J}),L=d.useRef(null),B=g?S||!!g.closest("form"):!0,[W,V]=d.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return c.jsx(st,{...p,children:c.jsxs(_t,{required:C,scope:e,trigger:g,onTriggerChange:b,valueNode:v,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:Ie(),value:U,onValueChange:q,open:P,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:w,children:[c.jsx(de.Provider,{scope:e,children:c.jsx(Nt,{scope:r.__scopeSelect,onNativeOptionAdd:d.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:d.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?c.jsxs(et,{"aria-hidden":!0,required:C,tabIndex:-1,name:f,autoComplete:m,value:U,onChange:E=>q(E.target.value),disabled:w,form:S,children:[U===void 0?c.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};Me.displayName=J;var Ae="SelectTrigger",Oe=d.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,l=pe(t),s=G(Ae,t),a=s.disabled||o,i=k(e,s.onTriggerChange),u=ue(t),f=d.useRef("touch"),[m,w,C]=ot(p=>{const g=u().filter(x=>!x.disabled),b=g.find(x=>x.value===s.value),v=nt(g,p,b);v!==void 0&&s.onValueChange(v.value)}),S=p=>{a||(s.onOpenChange(!0),C()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return c.jsx(lt,{asChild:!0,...l,children:c.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":tt(s.value)?"":void 0,...n,ref:i,onClick:N(n.onClick,p=>{p.currentTarget.focus(),f.current!=="mouse"&&S(p)}),onPointerDown:N(n.onPointerDown,p=>{f.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:N(n.onKeyDown,p=>{const g=m.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&w(p.key),!(g&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Oe.displayName=Ae;var De="SelectValue",ke=d.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:l,placeholder:s="",...a}=r,i=G(De,t),{onValueNodeHasChildrenChange:u}=i,f=l!==void 0,m=k(e,i.onValueNodeChange);return $(()=>{u(f)},[u,f]),c.jsx(j.span,{...a,ref:m,style:{pointerEvents:"none"},children:tt(i.value)?c.jsx(c.Fragment,{children:s}):l})});ke.displayName=De;var Et="SelectIcon",Le=d.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return c.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});Le.displayName=Et;var Rt="SelectPortal",Be=r=>c.jsx(at,{asChild:!0,...r});Be.displayName=Rt;var Q="SelectContent",Ve=d.forwardRef((r,e)=>{const t=G(Q,r.__scopeSelect),[o,n]=d.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const l=o;return l?Ee.createPortal(c.jsx(He,{scope:r.__scopeSelect,children:c.jsx(de.Slot,{scope:r.__scopeSelect,children:c.jsx("div",{children:r.children})})}),l):null}return c.jsx(ze,{...r,ref:e})});Ve.displayName=Q;var A=10,[He,Y]=ne(Q),jt="SelectContentImpl",Mt=gt("SelectContent.RemoveScroll"),ze=d.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:l,onPointerDownOutside:s,side:a,sideOffset:i,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:w,collisionPadding:C,sticky:S,hideWhenDetached:p,avoidCollisions:g,...b}=r,v=G(Q,t),[x,F]=d.useState(null),[M,re]=d.useState(null),P=k(e,h=>F(h)),[O,U]=d.useState(null),[q,L]=d.useState(null),B=ue(t),[W,V]=d.useState(!1),H=d.useRef(!1);d.useEffect(()=>{if(x)return ut(x)},[x]),pt();const E=d.useCallback(h=>{const[T,...R]=B().map(_=>_.ref.current),[y]=R.slice(-1),I=document.activeElement;for(const _ of h)if(_===I||(_?.scrollIntoView({block:"nearest"}),_===T&&M&&(M.scrollTop=0),_===y&&M&&(M.scrollTop=M.scrollHeight),_?.focus(),document.activeElement!==I))return},[B,M]),D=d.useCallback(()=>E([O,x]),[E,O,x]);d.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=v;d.useEffect(()=>{if(x){let h={x:0,y:0};const T=y=>{h={x:Math.abs(Math.round(y.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(y.pageY)-(K.current?.y??0))}},R=y=>{h.x<=10&&h.y<=10?y.preventDefault():x.contains(y.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),d.useEffect(()=>{const h=()=>z(!1);return window.addEventListener("blur",h),window.addEventListener("resize",h),()=>{window.removeEventListener("blur",h),window.removeEventListener("resize",h)}},[z]);const[fe,ae]=ot(h=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),y=nt(T,h,R);y&&setTimeout(()=>y.ref.current.focus())}),me=d.useCallback((h,T,R)=>{const y=!H.current&&!R;(v.value!==void 0&&v.value===T||y)&&(U(h),y&&(H.current=!0))},[v.value]),he=d.useCallback(()=>x?.focus(),[x]),te=d.useCallback((h,T,R)=>{const y=!H.current&&!R;(v.value!==void 0&&v.value===T||y)&&L(h)},[v.value]),ie=o==="popper"?Se:Fe,se=ie===Se?{side:a,sideOffset:i,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:w,collisionPadding:C,sticky:S,hideWhenDetached:p,avoidCollisions:g}:{};return c.jsx(He,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:c.jsx(ft,{as:Mt,allowPinchZoom:!0,children:c.jsx(mt,{asChild:!0,trapped:v.open,onMountAutoFocus:h=>{h.preventDefault()},onUnmountAutoFocus:N(n,h=>{v.trigger?.focus({preventScroll:!0}),h.preventDefault()}),children:c.jsx(ht,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:h=>h.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:c.jsx(ie,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:h=>h.preventDefault(),...b,...se,onPlaced:()=>V(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:N(b.onKeyDown,h=>{const T=h.ctrlKey||h.altKey||h.metaKey;if(h.key==="Tab"&&h.preventDefault(),!T&&h.key.length===1&&ae(h.key),["ArrowUp","ArrowDown","Home","End"].includes(h.key)){let y=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(h.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(h.key)){const I=h.target,_=y.indexOf(I);y=y.slice(_+1)}setTimeout(()=>E(y)),h.preventDefault()}})})})})})})});ze.displayName=jt;var At="SelectItemAlignedPosition",Fe=d.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,l=G(Q,t),s=Y(Q,t),[a,i]=d.useState(null),[u,f]=d.useState(null),m=k(e,P=>f(P)),w=ue(t),C=d.useRef(!1),S=d.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:b,focusSelectedItem:v}=s,x=d.useCallback(()=>{if(l.trigger&&l.valueNode&&a&&u&&p&&g&&b){const P=l.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=l.valueNode.getBoundingClientRect(),q=b.getBoundingClientRect();if(l.dir!=="rtl"){const I=q.left-O.left,_=U.left-I,X=P.left-_,Z=P.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(_,[A,Math.max(A,ge-ve)]);a.style.minWidth=Z+"px",a.style.left=xe+"px"}else{const I=O.right-q.right,_=window.innerWidth-U.right-I,X=window.innerWidth-P.right-_,Z=P.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(_,[A,Math.max(A,ge-ve)]);a.style.minWidth=Z+"px",a.style.right=xe+"px"}const L=w(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(g.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=P.top+P.height/2-A,ie=B-te,se=g.offsetHeight/2,h=g.offsetTop+se,T=H+E+h,R=K-T;if(T<=te){const I=L.length>0&&g===L[L.length-1].ref.current;a.style.bottom="0px";const _=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ie,se+(I?he:0)+_+D),Z=T+X;a.style.height=Z+"px"}else{const I=L.length>0&&g===L[0].ref.current;a.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;a.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}a.style.margin=`${A}px 0`,a.style.minHeight=fe+"px",a.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>C.current=!0)}},[w,l.trigger,l.valueNode,a,u,p,g,b,l.dir,o]);$(()=>x(),[x]);const[F,M]=d.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=d.useCallback(P=>{P&&S.current===!0&&(x(),v?.(),S.current=!1)},[x,v]);return c.jsx(Dt,{scope:t,contentWrapper:a,shouldExpandOnScrollRef:C,onScrollButtonChange:re,children:c.jsx("div",{ref:i,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:c.jsx(j.div,{...n,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});Fe.displayName=At;var Ot="SelectPopperPosition",Se=d.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...l}=r,s=pe(t);return c.jsx(xt,{...s,...l,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=Ot;var[Dt,Te]=ne(Q,{}),we="SelectViewport",Ue=d.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,l=Y(we,t),s=Te(we,t),a=k(e,l.onViewportChange),i=d.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),c.jsx(de.Slot,{scope:t,children:c.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:N(n.onScroll,u=>{const f=u.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:w}=s;if(w?.current&&m){const C=Math.abs(i.current-f.scrollTop);if(C>0){const S=window.innerHeight-A*2,p=parseFloat(m.style.minHeight),g=parseFloat(m.style.height),b=Math.max(p,g);if(b<S){const v=b+C,x=Math.min(S,v),F=v-x;m.style.height=x+"px",m.style.bottom==="0px"&&(f.scrollTop=F>0?F:0,m.style.justifyContent="flex-end")}}}i.current=f.scrollTop})})})]})});Ue.displayName=we;var We="SelectGroup",[kt,Lt]=ne(We),Bt=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=Ie();return c.jsx(kt,{scope:t,id:n,children:c.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Bt.displayName=We;var Ke="SelectLabel",Vt=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=Lt(Ke,t);return c.jsx(j.div,{id:n.id,...o,ref:e})});Vt.displayName=Ke;var ce="SelectItem",[Ht,$e]=ne(ce),Ge=d.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:l,...s}=r,a=G(ce,t),i=Y(ce,t),u=a.value===o,[f,m]=d.useState(l??""),[w,C]=d.useState(!1),S=k(e,v=>i.itemRefCallback?.(v,o,n)),p=Ie(),g=d.useRef("touch"),b=()=>{n||(a.onValueChange(o),a.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(Ht,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:d.useCallback(v=>{m(x=>x||(v?.textContent??"").trim())},[]),children:c.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:f,children:c.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":w?"":void 0,"aria-selected":u&&w,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:N(s.onFocus,()=>C(!0)),onBlur:N(s.onBlur,()=>C(!1)),onClick:N(s.onClick,()=>{g.current!=="mouse"&&b()}),onPointerUp:N(s.onPointerUp,()=>{g.current==="mouse"&&b()}),onPointerDown:N(s.onPointerDown,v=>{g.current=v.pointerType}),onPointerMove:N(s.onPointerMove,v=>{g.current=v.pointerType,n?i.onItemLeave?.():g.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(s.onPointerLeave,v=>{v.currentTarget===document.activeElement&&i.onItemLeave?.()}),onKeyDown:N(s.onKeyDown,v=>{i.searchRef?.current!==""&&v.key===" "||(It.includes(v.key)&&b(),v.key===" "&&v.preventDefault())})})})})});Ge.displayName=ce;var le="SelectItemText",Ye=d.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...l}=r,s=G(le,t),a=Y(le,t),i=$e(le,t),u=Pt(le,t),[f,m]=d.useState(null),w=k(e,b=>m(b),i.onItemTextChange,b=>a.itemTextRefCallback?.(b,i.value,i.disabled)),C=f?.textContent,S=d.useMemo(()=>c.jsx("option",{value:i.value,disabled:i.disabled,children:C},i.value),[i.disabled,i.value,C]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=u;return $(()=>(p(S),()=>g(S)),[p,g,S]),c.jsxs(c.Fragment,{children:[c.jsx(j.span,{id:i.textId,...l,ref:w}),i.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ee.createPortal(l.children,s.valueNode):null]})});Ye.displayName=le;var qe="SelectItemIndicator",Xe=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return $e(qe,t).isSelected?c.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});Xe.displayName=qe;var Ce="SelectScrollUpButton",Ze=d.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,l]=d.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let a=function(){const u=i.scrollTop>0;l(u)};const i=t.viewport;return a(),i.addEventListener("scroll",a),()=>i.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),n?c.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:i}=t;a&&i&&(a.scrollTop=a.scrollTop-i.offsetHeight)}}):null});Ze.displayName=Ce;var be="SelectScrollDownButton",Je=d.forwardRef((r,e)=>{const t=Y(be,r.__scopeSelect),o=Te(be,r.__scopeSelect),[n,l]=d.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let a=function(){const u=i.scrollHeight-i.clientHeight,f=Math.ceil(i.scrollTop)<u;l(f)};const i=t.viewport;return a(),i.addEventListener("scroll",a),()=>i.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),n?c.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:i}=t;a&&i&&(a.scrollTop=a.scrollTop+i.offsetHeight)}}):null});Je.displayName=be;var Qe=d.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,l=Y("SelectScrollButton",t),s=d.useRef(null),a=ue(t),i=d.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return d.useEffect(()=>()=>i(),[i]),$(()=>{a().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),c.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:N(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:N(n.onPointerMove,()=>{l.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:N(n.onPointerLeave,()=>{i()})})}),zt="SelectSeparator",Ft=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return c.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});Ft.displayName=zt;var ye="SelectArrow",Ut=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),l=G(ye,t),s=Y(ye,t);return l.open&&s.position==="popper"?c.jsx(St,{...n,...o,ref:e}):null});Ut.displayName=ye;var Wt="SelectBubbleInput",et=d.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=d.useRef(null),l=k(o,n),s=ct(e);return d.useEffect(()=>{const a=n.current;if(!a)return;const i=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(i,"value").set;if(s!==e&&f){const m=new Event("change",{bubbles:!0});f.call(a,e),a.dispatchEvent(m)}},[s,e]),c.jsx(j.select,{...t,style:{...Ct,...t.style},ref:l,defaultValue:e})});et.displayName=Wt;function tt(r){return r===""||r===void 0}function ot(r){const e=dt(r),t=d.useRef(""),o=d.useRef(0),n=d.useCallback(s=>{const a=t.current+s;e(a),(function i(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>i(""),1e3))})(a)},[e]),l=d.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,l]}function nt(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,l=t?r.indexOf(t):-1;let s=Kt(r,Math.max(l,0));n.length===1&&(s=s.filter(u=>u!==t));const i=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return i!==t?i:void 0}function Kt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var $t=Me,Gt=Oe,Yt=ke,qt=Le,Xt=Be,Zt=Ve,Jt=Ue,Qt=Ge,Pe=Ye,eo=Xe,to=Ze,oo=Je;function co(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx($t,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx(Yt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(15);let t,o,n,l,s;e[0]!==r?({className:o,size:l,variant:s,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=l===void 0?"default":l,i=s===void 0?"outline":s;let u;e[6]!==o?(u=oe("data-[placeholder]:text-subtle-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-ring aria-invalid:bg-destructive/10 aria-invalid:shadow-[inset_0_0_0_1px_var(--destructive)] flex w-fit items-center justify-between gap-1.5 px-3 text-sm whitespace-nowrap transition-[color,background-color,box-shadow] outline-none disabled:text-subtle-foreground disabled:pointer-events-none","data-[variant=outline]:rounded-[var(--studio-control-radius,var(--radius-lg))] data-[variant=outline]:bg-[var(--studio-input-background)] data-[variant=outline]:shadow-edge data-[variant=outline]:hover:bg-sidebar","data-[variant=filled]:rounded-full data-[variant=filled]:bg-muted data-[variant=filled]:hover:bg-secondary-hover","data-[variant=pill]:rounded-full data-[variant=pill]:bg-card data-[variant=pill]:shadow-edge data-[variant=pill]:hover:bg-[var(--studio-outline-hover-background)]","data-[size=default]:h-[var(--studio-control-height,2.25rem)] data-[size=default]:pl-4 data-[size=sm]:h-8 data-[size=xs]:h-7 data-[size=xs]:px-2.5 data-[size=xs]:text-xs data-[size=xs]:font-medium","*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",o),e[6]=o,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=c.jsx(qt,{asChild:!0,children:c.jsx(je,{className:"size-3.5 stroke-[1.5]"})}),e[8]=f):f=e[8];let m;return e[9]!==t||e[10]!==n||e[11]!==a||e[12]!==u||e[13]!==i?(m=c.jsxs(Gt,{"data-slot":"select-trigger","data-size":a,"data-variant":i,className:u,...n,children:[t,f]}),e[9]=t,e[10]=n,e[11]=a,e[12]=u,e[13]=i,e[14]=m):m=e[14],m}function fo(r){const e=ee.c(25);let t,o,n,l,s;e[0]!==r?({className:o,children:t,position:l,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=l===void 0?"popper":l,i=s===void 0?!1:s,u=a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let f;e[6]!==o||e[7]!==u?(f=oe("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-[var(--studio-surface-radius,var(--radius-lg))] border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=f):f=e[8];let m;e[9]!==i?(m=!i&&c.jsx(no,{}),e[9]=i,e[10]=m):m=e[10];const w=a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let C;e[11]!==w?(C=oe("p-1",w),e[11]=w,e[12]=C):C=e[12];let S;e[13]!==t||e[14]!==C?(S=c.jsx(Jt,{className:C,children:t}),e[13]=t,e[14]=C,e[15]=S):S=e[15];let p;e[16]!==i?(p=!i&&c.jsx(ro,{}),e[16]=i,e[17]=p):p=e[17];let g;return e[18]!==a||e[19]!==n||e[20]!==f||e[21]!==m||e[22]!==S||e[23]!==p?(g=c.jsx(Xt,{children:c.jsxs(Zt,{"data-slot":"select-content",translate:"no",className:f,position:a,...n,children:[m,S,p]})}),e[18]=a,e[19]=n,e[20]=f,e[21]=m,e[22]=S,e[23]=p,e[24]=g):g=e[24],g}function mo(r){const e=ee.c(19);let t,o,n,l,s;e[0]!==r?({className:o,children:t,description:n,hideCheck:s,...l}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=s===void 0?!1:s,i=n&&"items-start py-2";let u;e[6]!==o||e[7]!==i?(u=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",i,o),e[6]=o,e[7]=i,e[8]=u):u=e[8];let f;e[9]!==a?(f=!a&&c.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:c.jsx(eo,{children:c.jsx(wt,{className:"size-4"})})}),e[9]=a,e[10]=f):f=e[10];let m;e[11]!==t||e[12]!==n?(m=n?c.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[c.jsx(Pe,{children:t}),c.jsx("span",{className:"text-xs text-muted-foreground whitespace-normal",children:n})]}):c.jsx(Pe,{children:t}),e[11]=t,e[12]=n,e[13]=m):m=e[13];let w;return e[14]!==l||e[15]!==u||e[16]!==f||e[17]!==m?(w=c.jsxs(Qt,{"data-slot":"select-item",className:u,...l,children:[f,m]}),e[14]=l,e[15]=u,e[16]=f,e[17]=m,e[18]=w):w=e[18],w}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsx(bt,{className:"size-4"}),e[5]=l):l=e[5];let s;return e[6]!==o||e[7]!==n?(s=c.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:l}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsx(je,{className:"size-4"}),e[5]=l):l=e[5];let s;return e[6]!==o||e[7]!==n?(s=c.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:l}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{co as S,uo as a,po as b,mo as c,fo as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as $,b as A,r as R,l as G,j as l,B as H,p as J,v as K,q as Q,D as U}from"./index-
|
|
1
|
+
import{c as $,b as A,r as R,l as G,j as l,B as H,p as J,v as K,q as Q,D as U}from"./index-BeWb3VLq.js";import{c as V,b as W,a as X,D as Y}from"./drawer-Bi1-udV5.js";import{u as Z}from"./use-mobile-BAnIvR27.js";import{d as ee}from"./chat-context-BEyCIAaN.js";import{S as q,a as le,M as se,c as te}from"./index-BnbMIYQC.js";function me(L){const e=$.c(48),{variant:o,className:t,placeholder:n,model:s,isLoading:I,credentialId:P,onCredentialChange:k,onModelChange:b,filterModels:E}=L,z=o===void 0?"borderless":o,w=n===void 0?"Select model":n,r=A(),[a,S]=R.useState(!1),i=b!==void 0,F=Z(),O=z==="borderless"?"ghost":"outline",_=z==="borderless"&&"md:border-none";let d;e[0]!==t||e[1]!==_?(d=G("text-sm hover:bg-accent py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group min-w-0 shrink justify-start overflow-hidden",_,t),e[0]=t,e[1]=_,e[2]=d):d=e[2];let c;e[3]!==I||e[4]!==s||e[5]!==w||e[6]!==i?(c=i?l.jsx(q,{model:s??null,placeholder:w,isLoading:I}):l.jsx(ne,{placeholder:w}),e[3]=I,e[4]=s,e[5]=w,e[6]=i,e[7]=c):c=e[7];let D;e[8]!==O||e[9]!==d||e[10]!==c?(D=l.jsx(H,{variant:O,size:"sm",className:d,children:c}),e[8]=O,e[9]=d,e[10]=c,e[11]=D):D=e[11];const m=D;let y;e[12]===Symbol.for("react.memo_cache_sentinel")?(y=l.jsx(le,{}),e[12]=y):y=e[12];let N;e[13]!==P||e[14]!==E||e[15]!==s||e[16]!==k||e[17]!==b||e[18]!==i?(N=l.jsx(R.Suspense,{fallback:y,children:i?l.jsx(se,{onClose:()=>S(!1),credentialId:P??null,onCredentialChange:k??oe,selectedModel:s??null,onModelChange:b,filterModels:E}):l.jsx(te,{onClose:()=>S(!1)})}),e[13]=P,e[14]=E,e[15]=s,e[16]=k,e[17]=b,e[18]=i,e[19]=N):N=e[19];const f=N;if(F){let g;e[20]!==m?(g=l.jsx(V,{asChild:!0,children:m}),e[20]=m,e[21]=g):g=e[21];let j;e[22]!==r?(j=r("chat.selectModel.selectModel"),e[22]=r,e[23]=j):j=e[23];let M;e[24]!==j?(M=l.jsx(W,{className:"sr-only",children:j}),e[24]=j,e[25]=M):M=e[25];let C;e[26]!==f?(C=l.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:f}),e[26]=f,e[27]=C):C=e[27];let v;e[28]!==M||e[29]!==C?(v=l.jsxs(X,{className:"p-0 flex flex-col max-h-[95vh]",children:[M,C]}),e[28]=M,e[29]=C,e[30]=v):v=e[30];let T;return e[31]!==a||e[32]!==g||e[33]!==v?(T=l.jsxs(Y,{open:a,onOpenChange:S,children:[g,v]}),e[31]=a,e[32]=g,e[33]=v,e[34]=T):T=e[34],T}let h;e[35]!==m?(h=l.jsx(J,{asChild:!0,children:m}),e[35]=m,e[36]=h):h=e[36];let x;e[37]!==r?(x=r("chat.selectModel.selectModel"),e[37]=r,e[38]=x):x=e[38];let p;e[39]!==x?(p=l.jsx(K,{className:"sr-only",children:x}),e[39]=x,e[40]=p):p=e[40];let u;e[41]!==f||e[42]!==p?(u=l.jsxs(Q,{className:"p-0 gap-0 sm:max-w-fit overflow-hidden h-[100dvh] sm:h-auto max-h-[100dvh] sm:max-h-[85vh] w-full max-w-full sm:max-w-fit rounded-none sm:rounded-xl border-0 sm:border",closeButtonClassName:"top-3.5 right-3.5 z-20",children:[p,f]}),e[41]=f,e[42]=p,e[43]=u):u=e[43];let B;return e[44]!==a||e[45]!==h||e[46]!==u?(B=l.jsxs(U,{open:a,onOpenChange:S,children:[h,u]}),e[44]=a,e[45]=h,e[46]=u,e[47]=B):B=e[47],B}function oe(){}function ne(L){const e=$.c(4),{placeholder:o}=L,{selectedModel:t,isModelsLoading:n}=ee();let s;return e[0]!==n||e[1]!==t||e[2]!==o?(s=l.jsx(q,{model:t,placeholder:o,isLoading:n}),e[0]=n,e[1]=t,e[2]=o,e[3]=s):s=e[3],s}export{me as M};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as T,b as be,j as o,r as te,av as Ne,B as we,h as _e}from"./index-D_jzSCP9.js";import{a4 as he}from"./agent-icon-DhApO92C.js";import{S as ve}from"./scroll-area-BzPxgY-4.js";import{F as ye,ab as Ee,i as Pe,k as Te,ac as Fe,h as Re,aE as Ce}from"./runnable-block-editor-BCPCXDwB.js";import{q as Ke}from"./parse-sections-C-MhwiHZ.js";import{u as ze,a as De,P as $e}from"./page-seo-form-BZ5qz5Jc.js";import{a as je}from"./Image01-DwBREChx.js";import{u as Be,m as Ie}from"./site-editor-toast-vUK6CnYX.js";import"./AlertCircle-BzjzqqRa.js";import"./Tool01-CEmvRWh7.js";import"./ArrowUp-BbhuuuwV.js";import"./ArrowLeft-D9e74CxD.js";import"./LinkBroken01-CTiL1Fp-.js";import"./ShoppingBag01-hqBb4euZ.js";import"./ZoomOut-CLJKIGNa.js";import"./Building02-C2flUGF-.js";import"./CheckCircle-4gdTBGy6.js";import"./ChevronUp-BnA2Nw_G.js";import"./ChevronSelectorVertical-YTUkgDHg.js";import"./UserSquare-CRvybnC2.js";import"./Copy01-DK6eLr2i.js";import"./CreditCard01-CMqZSaqi.js";import"./DotsVertical-C4UAKneF.js";import"./Globe04-DEY1e_cW.js";import"./SwitchHorizontal01-Ik-Wu8bp.js";import"./Key01-MBTcw2W0.js";import"./Link01-CHLntxrX.js";import"./Minus-BCeBycMD.js";import"./Monitor01-DtC0vfP6.js";import"./Sun-_7OyKm8q.js";import"./Play-DV5Ma4c6.js";import"./Plus-CxQiW556.js";import"./SearchMd-CYuw_TlP.js";import"./Trash01-7PWQCtvD.js";import"./Upload01-d0p8GdRf.js";import"./User01-CvsUVXiw.js";import"./Users01-BpDVBOEG.js";import"./XClose-CjXzVHwC.js";import"./index-BdQq_4o_.js";import"./utils-LrUUDN57.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-CbWxf18N.js";import"./format-time-Cq80KKvY.js";import"./differenceInSeconds-C3x8sHUj.js";import"./collapsible-CUpe_nLN.js";import"./use-copy-Dl7HNmsM.js";import"./usage-stats-B6igVHuP.js";import"./tool-namespace-BffmviW3.js";import"./form-DuWo7Npn.js";import"./label-BHfVaXR7.js";import"./utils-CVEq3hMx.js";import"./markdown-Cd88osrX.js";import"./location-V0VwTJTt.js";import"./use-mobile-Df_3y675.js";import"./use-panel-navigate-DGz4w4gD.js";import"./thread-route-BrF-OvAm.js";import"./use-project-scope-B2UHdHkf.js";import"./repository-binding-Cl8gyVcv.js";import"./use-mcp-client-DqYHf07G.js";import"./auth-BCqAeFp3.js";import"./tooltip-DZoMaiH-.js";import"./index-DHWYq2vY.js";import"./use-decopilot-events-Bfz-bAKi.js";import"./thread-intent-DYTU11gs.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-DIAPPzx7.js";import"./task-board-DZKwU9_n.js";import"./schema-JPrgW9NA.js";import"./slugify-CEUa2lfQ.js";import"./chat-context-BE5W0eRy.js";import"./autosend-CC_H9WVC.js";import"./use-ai-providers-DgzZ7YKT.js";import"./use-organization-settings-BXo7nhZ3.js";import"./use-clock-tick-DiijcghV.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-CFMsjvxz.js";import"./types-D8wZ_EZc.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./shell-layout-CKWLH4bq.js";import"./avatar-BCxNXTas.js";import"./command-Due3aGE_.js";import"./index-B0KYQovx.js";import"./integration-icon-BKkvrbiZ.js";import"./project-icon-BsqqQ1nI.js";import"./new-project-dialog-CP7YY3zi.js";import"./repository-import-picker-3obW4oiZ.js";import"./use-navigate-to-agent-DOId9IHj.js";import"./repository-picker-0eUSIZ5X.js";import"./useInfiniteQuery-BuR8X__X.js";import"./infiniteQueryObserver-nO7Ij1Gh.js";import"./collection-search-D3DfnNEj.js";import"./use-debounced-value-DNoCsO37.js";import"./required-auth-layout-D4sDIyJ3.js";import"./use-org-sso-DzwVU3EX.js";import"./sheet-DaxppAym.js";import"./use-connection-BZmon5tp.js";import"./use-mcp-prompts-Cu6zSvAs.js";import"./use-thread-outputs-B3pyBOho.js";import"./file-type-icon-6tQy_IZ-.js";import"./secret-ciphertext-DIyWW8ea.js";import"./alert-DK8EW5eY.js";import"./switch-BZ12Wlze.js";import"./textarea-CbCQygtF.js";import"./popover-BVmz1c3N.js";import"./blocks-tab-states-B-gG8PUG.js";import"./slider-B4XFe7FF.js";import"./index-DjG04H6F.js";import"./tooltipContext-D6Gsaqky.js";import"./CategoricalChart-BjLODSSF.js";import"./index-DlAj9KxS.js";import"./ActiveShapeUtils-BviJ1RJ0.js";import"./Sector-7HoHBp31.js";import"./symbol-NtdYAab7.js";import"./use-session-runtime-7d3qKI0U.js";import"./empty-state-DHTpGmzV.js";import"./monaco-editor-q0K0FpZQ.js";import"./editor-DfNlEhGy.js";import"./calendar-CWZHYNsm.js";import"./select-C1PBhx94.js";import"./editor-classes-BgZFSVD_.js";import"./core.esm-C9O_xZ-F.js";import"./sortable.esm-Mem55hqW.js";import"./toggle-group-CG3xZyLa.js";import"./active-indicator-CCMhAsc_.js";import"./combobox-pGuSce6D.js";import"./alert-dialog--q-PWeut.js";import"./search-input-CAgDD0MP.js";import"./tabs-PlTfpfXH.js";import"./use-file-configs-BXF9rvXJ.js";import"./asset-utils-DobQJkEL.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./sandbox-git-api-CH_-QFpD.js";import"./sandbox-url-D3mC8qhT.js";import"./experiments-tab-choice-Du4Lvv_w.js";import"./use-sandbox-events-DxcL_G2x.js";function M(d){return typeof d=="string"&&d.trim()?d:void 0}function ge(d,e){if(d){if(e)try{const t=new URL(d,e).href;return ye(t)}catch{return}return ye(d)}}function Le(d){if(!d)return{};const e=M(d.title),t=M(d.titleTemplate);return{title:e&&t?.includes("%s")?t.replace(/%s/g,e):e,description:M(d.description),image:M(d.image),favicon:M(d.favicon)}}function Oe(d){if(!d)return"example.com";try{return new URL(d).host}catch{return"example.com"}}const Ue=[{id:"google",labelKey:"sectionsEditor.seoPreview.platformGoogle",color:"#4285F4",layout:"search"},{id:"facebook",labelKey:"sectionsEditor.seoPreview.platformFacebook",color:"#1877F2",layout:"card"},{id:"twitter",labelKey:"sectionsEditor.seoPreview.platformTwitter",color:"#0f1419",layout:"card"},{id:"linkedin",labelKey:"sectionsEditor.seoPreview.platformLinkedin",color:"#0A66C2",layout:"card"},{id:"whatsapp",labelKey:"sectionsEditor.seoPreview.platformWhatsapp",color:"#25D366",layout:"chat"},{id:"telegram",labelKey:"sectionsEditor.seoPreview.platformTelegram",color:"#229ED9",layout:"chat"},{id:"slack",labelKey:"sectionsEditor.seoPreview.platformSlack",color:"#611f69",layout:"attachment"},{id:"discord",labelKey:"sectionsEditor.seoPreview.platformDiscord",color:"#5865F2",layout:"attachment"}];function ue(d){const e=T.c(10),{src:t,className:a,iconSize:y}=d,r=y===void 0?20:y;if(t){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={objectFit:"cover"},e[0]=m):m=e[0];let p;return e[1]!==a||e[2]!==t?(p=o.jsx("img",{src:t,alt:"",referrerPolicy:"no-referrer",className:a,style:m}),e[1]=a,e[2]=t,e[3]=p):p=e[3],p}let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s={display:"flex",alignItems:"center",justifyContent:"center",background:"#e5e7eb",color:"#9ca3af"},e[4]=s):s=e[4];let i;e[5]!==r?(i=o.jsx(je,{size:r}),e[5]=r,e[6]=i):i=e[6];let n;return e[7]!==a||e[8]!==i?(n=o.jsx("div",{className:a,style:s,children:i}),e[7]=a,e[8]=i,e[9]=n):n=e[9],n}function Ae(d){const e=T.c(33),{seo:t,host:a,path:y,t:r}=d;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#fff",border:"1px solid #dadce0"},e[0]=s):s=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={background:"#f1f3f4"},e[1]=i):i=e[1];let n;e[2]!==t.favicon?(n=o.jsx("div",{className:"flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-full",style:i,children:t.favicon?o.jsx("img",{src:t.favicon,alt:"",className:"size-full object-cover"}):o.jsx(je,{size:12,color:"#9aa0a6"})}),e[2]=t.favicon,e[3]=n):n=e[3];let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m={color:"#202124"},e[4]=m):m=e[4];let p;e[5]!==a?(p=o.jsx("div",{className:"truncate text-[13px] leading-tight",style:m,children:a}),e[5]=a,e[6]=p):p=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f={color:"#4d5156"},e[7]=f):f=e[7];let l;e[8]!==a||e[9]!==y?(l=o.jsxs("div",{className:"truncate text-[12px] leading-tight",style:f,children:[a,y]}),e[8]=a,e[9]=y,e[10]=l):l=e[10];let c;e[11]!==p||e[12]!==l?(c=o.jsxs("div",{className:"min-w-0",children:[p,l]}),e[11]=p,e[12]=l,e[13]=c):c=e[13];let x;e[14]!==n||e[15]!==c?(x=o.jsxs("div",{className:"flex items-center gap-2",children:[n,c]}),e[14]=n,e[15]=c,e[16]=x):x=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u={color:"#1a0dab"},e[17]=u):u=e[17];let h;e[18]!==t.title||e[19]!==r?(h=t.title??r("sectionsEditor.seoPreview.fallbackTitle"),e[18]=t.title,e[19]=r,e[20]=h):h=e[20];let v;e[21]!==h?(v=o.jsx("div",{className:"mt-1.5 truncate text-[18px] leading-snug",style:u,children:h}),e[21]=h,e[22]=v):v=e[22];let b;e[23]===Symbol.for("react.memo_cache_sentinel")?(b={color:"#4d5156"},e[23]=b):b=e[23];let S;e[24]!==t.description||e[25]!==r?(S=t.description??r("sectionsEditor.seoPreview.fallbackDescription"),e[24]=t.description,e[25]=r,e[26]=S):S=e[26];let j;e[27]!==S?(j=o.jsx("div",{className:"mt-0.5 line-clamp-2 text-[13px] leading-snug",style:b,children:S}),e[27]=S,e[28]=j):j=e[28];let k;return e[29]!==v||e[30]!==j||e[31]!==x?(k=o.jsxs("div",{className:"rounded-lg p-3 text-left",style:s,children:[x,v,j]}),e[29]=v,e[30]=j,e[31]=x,e[32]=k):k=e[32],k}function Me(d){const e=T.c(26),{seo:t,host:a,t:y}=d;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={background:"#fff",border:"1px solid #e2e8f0"},e[0]=r):r=e[0];let s;e[1]!==t.image?(s=o.jsx(ue,{src:t.image,className:"h-40 w-full"}),e[1]=t.image,e[2]=s):s=e[2];let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i={borderTop:"1px solid #e2e8f0"},e[3]=i):i=e[3];let n;e[4]===Symbol.for("react.memo_cache_sentinel")?(n={color:"#8a9099"},e[4]=n):n=e[4];let m;e[5]!==a?(m=o.jsx("div",{className:"truncate text-[11px]",style:n,children:a}),e[5]=a,e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#1c2024"},e[7]=p):p=e[7];let f;e[8]!==t.title||e[9]!==y?(f=t.title??y("sectionsEditor.seoPreview.fallbackTitle"),e[8]=t.title,e[9]=y,e[10]=f):f=e[10];let l;e[11]!==f?(l=o.jsx("div",{className:"line-clamp-1 text-[14px] font-semibold",style:p,children:f}),e[11]=f,e[12]=l):l=e[12];let c;e[13]===Symbol.for("react.memo_cache_sentinel")?(c={color:"#60666c"},e[13]=c):c=e[13];let x;e[14]!==t.description||e[15]!==y?(x=t.description??y("sectionsEditor.seoPreview.fallbackDescription"),e[14]=t.description,e[15]=y,e[16]=x):x=e[16];let u;e[17]!==x?(u=o.jsx("div",{className:"line-clamp-2 text-[12px]",style:c,children:x}),e[17]=x,e[18]=u):u=e[18];let h;e[19]!==u||e[20]!==m||e[21]!==l?(h=o.jsxs("div",{className:"px-3 py-2",style:i,children:[m,l,u]}),e[19]=u,e[20]=m,e[21]=l,e[22]=h):h=e[22];let v;return e[23]!==h||e[24]!==s?(v=o.jsxs("div",{className:"overflow-hidden rounded-lg text-left",style:r,children:[s,h]}),e[23]=h,e[24]=s,e[25]=v):v=e[25],v}function Ge(d){const e=T.c(36),{seo:t,host:a,accent:y,t:r}=d;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#f0f2f5"},e[0]=s):s=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={color:"#3b4045"},e[1]=i):i=e[1];let n;e[2]!==r?(n=r("sectionsEditor.seoPreview.chatCardHint"),e[2]=r,e[3]=n):n=e[3];let m;e[4]!==n?(m=o.jsx("p",{className:"px-1 pb-1.5 text-[12px]",style:i,children:n}),e[4]=n,e[5]=m):m=e[5];const p=`3px solid ${y}`;let f;e[6]!==p?(f={background:"#fff",borderLeft:p},e[6]=p,e[7]=f):f=e[7];let l;e[8]!==t.image?(l=o.jsx(ue,{src:t.image,className:"h-28 w-full",iconSize:18}),e[8]=t.image,e[9]=l):l=e[9];let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c={color:"#1c2024"},e[10]=c):c=e[10];let x;e[11]!==t.title||e[12]!==r?(x=t.title??r("sectionsEditor.seoPreview.fallbackTitle"),e[11]=t.title,e[12]=r,e[13]=x):x=e[13];let u;e[14]!==x?(u=o.jsx("div",{className:"line-clamp-1 text-[12px] font-semibold",style:c,children:x}),e[14]=x,e[15]=u):u=e[15];let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h={color:"#60666c"},e[16]=h):h=e[16];let v;e[17]!==t.description||e[18]!==r?(v=t.description??r("sectionsEditor.seoPreview.fallbackDescription"),e[17]=t.description,e[18]=r,e[19]=v):v=e[19];let b;e[20]!==v?(b=o.jsx("div",{className:"line-clamp-2 text-[11px]",style:h,children:v}),e[20]=v,e[21]=b):b=e[21];let S;e[22]===Symbol.for("react.memo_cache_sentinel")?(S={color:"#8a9099"},e[22]=S):S=e[22];let j;e[23]!==a?(j=o.jsx("div",{className:"mt-0.5 text-[10px]",style:S,children:a}),e[23]=a,e[24]=j):j=e[24];let k;e[25]!==u||e[26]!==b||e[27]!==j?(k=o.jsxs("div",{className:"px-2.5 py-1.5",children:[u,b,j]}),e[25]=u,e[26]=b,e[27]=j,e[28]=k):k=e[28];let g;e[29]!==k||e[30]!==f||e[31]!==l?(g=o.jsxs("div",{className:"overflow-hidden rounded-[var(--studio-surface-radius,var(--radius-md))]",style:f,children:[l,k]}),e[29]=k,e[30]=f,e[31]=l,e[32]=g):g=e[32];let N;return e[33]!==g||e[34]!==m?(N=o.jsxs("div",{className:"rounded-lg p-2 text-left",style:s,children:[m,g]}),e[33]=g,e[34]=m,e[35]=N):N=e[35],N}function He(d){const e=T.c(39),{seo:t,host:a,accent:y,dark:r,t:s}=d,i=r?"#2b2d31":"#fff",n=r?"#00a8fc":"#1264a3",m=r?"#dbdee1":"#3b4045",p=r?"#949ba4":"#8a9099",f=r?"none":"1px solid #e2e8f0";let l;e[0]!==i||e[1]!==f?(l={background:i,border:f},e[0]=i,e[1]=f,e[2]=l):l=e[2];const c=`3px solid ${y}`;let x;e[3]!==c?(x={borderLeft:c,borderRadius:2},e[3]=c,e[4]=x):x=e[4];let u;e[5]!==p?(u={color:p},e[5]=p,e[6]=u):u=e[6];let h;e[7]!==a||e[8]!==u?(h=o.jsx("div",{className:"text-[10px]",style:u,children:a}),e[7]=a,e[8]=u,e[9]=h):h=e[9];let v;e[10]!==n?(v={color:n},e[10]=n,e[11]=v):v=e[11];let b;e[12]!==t.title||e[13]!==s?(b=t.title??s("sectionsEditor.seoPreview.fallbackTitle"),e[12]=t.title,e[13]=s,e[14]=b):b=e[14];let S;e[15]!==v||e[16]!==b?(S=o.jsx("div",{className:"line-clamp-1 text-[13px] font-semibold",style:v,children:b}),e[15]=v,e[16]=b,e[17]=S):S=e[17];let j;e[18]!==m?(j={color:m},e[18]=m,e[19]=j):j=e[19];let k;e[20]!==t.description||e[21]!==s?(k=t.description??s("sectionsEditor.seoPreview.fallbackDescription"),e[20]=t.description,e[21]=s,e[22]=k):k=e[22];let g;e[23]!==j||e[24]!==k?(g=o.jsx("div",{className:"line-clamp-2 text-[12px]",style:j,children:k}),e[23]=j,e[24]=k,e[25]=g):g=e[25];let N;e[26]!==g||e[27]!==h||e[28]!==S?(N=o.jsxs("div",{className:"min-w-0 flex-1",children:[h,S,g]}),e[26]=g,e[27]=h,e[28]=S,e[29]=N):N=e[29];let w;e[30]!==t.image?(w=o.jsx(ue,{src:t.image,className:"size-14 shrink-0 rounded-[var(--studio-control-radius,var(--radius))]",iconSize:16}),e[30]=t.image,e[31]=w):w=e[31];let _;e[32]!==N||e[33]!==w||e[34]!==x?(_=o.jsxs("div",{className:"flex gap-2.5 pl-2.5",style:x,children:[N,w]}),e[32]=N,e[33]=w,e[34]=x,e[35]=_):_=e[35];let E;return e[36]!==_||e[37]!==l?(E=o.jsx("div",{className:"rounded-lg p-2.5 text-left",style:l,children:_}),e[36]=_,e[37]=l,e[38]=E):E=e[38],E}function Ve(d){const e=T.c(21),{platform:t,seo:a,host:y,path:r,t:s}=d;let i;e[0]!==y||e[1]!==r||e[2]!==t.color||e[3]!==t.id||e[4]!==t.layout||e[5]!==a||e[6]!==s?(i=t.layout==="search"?o.jsx(Ae,{seo:a,host:y,path:r,t:s}):t.layout==="card"?o.jsx(Me,{seo:a,host:y,path:r,t:s}):t.layout==="chat"?o.jsx(Ge,{seo:a,host:y,path:r,accent:t.color,t:s}):o.jsx(He,{seo:a,host:y,path:r,accent:t.color,dark:t.id==="discord",t:s}),e[0]=y,e[1]=r,e[2]=t.color,e[3]=t.id,e[4]=t.layout,e[5]=a,e[6]=s,e[7]=i):i=e[7];const n=i;let m;e[8]!==t.color?(m=o.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{background:t.color}}),e[8]=t.color,e[9]=m):m=e[9];let p;e[10]!==t.labelKey||e[11]!==s?(p=s(t.labelKey),e[10]=t.labelKey,e[11]=s,e[12]=p):p=e[12];let f;e[13]!==p?(f=o.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:p}),e[13]=p,e[14]=f):f=e[14];let l;e[15]!==m||e[16]!==f?(l=o.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5",children:[m,f]}),e[15]=m,e[16]=f,e[17]=l):l=e[17];let c;return e[18]!==n||e[19]!==l?(c=o.jsxs("div",{children:[l,n]}),e[18]=n,e[19]=l,e[20]=c):c=e[20],c}function qe(d){const e=T.c(18),{seo:t,url:a,path:y}=d,r=y===void 0?"/":y,s=be();let i,n,m;if(e[0]!==t||e[1]!==a){const v=Le(t);i=v,n=ge(v.image,a),m=ge(v.favicon,a),e[0]=t,e[1]=a,e[2]=i,e[3]=n,e[4]=m}else i=e[2],n=e[3],m=e[4];let p;e[5]!==i||e[6]!==n||e[7]!==m?(p={...i,image:n,favicon:m},e[5]=i,e[6]=n,e[7]=m,e[8]=p):p=e[8];const f=p;let l;e[9]!==a?(l=Oe(a),e[9]=a,e[10]=l):l=e[10];const c=l,x=r==="/"?"":r;let u;e[11]!==x||e[12]!==c||e[13]!==s||e[14]!==f?(u=Ue.map(v=>o.jsx(Ve,{platform:v,seo:f,host:c,path:x,t:s},v.id)),e[11]=x,e[12]=c,e[13]=s,e[14]=f,e[15]=u):u=e[15];let h;return e[16]!==u?(h=o.jsx("div",{className:"grid grid-cols-1 gap-4 @2xl:grid-cols-2",children:u}),e[16]=u,e[17]=h):h=e[17],h}function Ei(d){const e=T.c(73),{orgSlug:t,virtualMcpId:a,branch:y,decofile:r,meta:s,target:i,previewBaseUrl:n,onSaved:m,onEditDefaultSeo:p,onBack:f}=d,l=be(),c=Ee(r,i,s),x=Be(a,y);let u;e[0]!==x?(u=Ie(x),e[0]=x,e[1]=u):u=e[1];const h=!u,v=c?.seoData,b=i.kind==="site"?"site":i.pageKey,[S,j]=te.useState(b),[k,g]=te.useState(null),[N,w]=te.useState(0),[_,E]=te.useState(void 0);S!==b&&(j(b),g(null),E(void 0),w(Je));const{persistSeo:K,persistRawSeo:oe,flush:ie,isPending:se}=ze({orgSlug:t,virtualMcpId:a,branch:y,target:i,resolved:c,meta:s,onSaved:m}),G=i.kind==="page",Se=G?c?.rawSeoData:void 0,A=_!==void 0?_:Se,ke=G?Pe(A)??void 0:void 0,P=k??ke??v??{},F=c?De(P,c):null,z=F&&(!G||Te(A))?Ke(F,s):null;let H;e[2]!==s?(H=Fe(s),e[2]=s,e[3]=H):H=e[3];const le=H;let R,V;e[4]!==r||e[5]!==P||e[6]!==s||e[7]!==i.kind?(R=i.kind==="page"?Re(r,s)?.seoData??{}:{},V=i.kind==="page"?Xe(R,P):P,e[4]=r,e[5]=P,e[6]=s,e[7]=i.kind,e[8]=R,e[9]=V):(R=e[8],V=e[9]);const re=V;let q;e[10]!==K||e[11]!==c||e[12]!==g?(q=C=>{if(!c)return;const xe=C;g(xe),K(xe)},e[10]=K,e[11]=c,e[12]=g,e[13]=q):q=e[13];const ae=q;let W;e[14]!==g?(W=()=>g(null),e[14]=g,e[15]=W):W=e[15];const ce=W;let J;e[16]!==w?(J=()=>w(We),e[16]=w,e[17]=J):J=e[17];const ne=J;let Q;e[18]!==ie||e[19]!==f?(Q=()=>{ie(),f?.()},e[18]=ie,e[19]=f,e[20]=Q):Q=e[20];const me=Q,D=i.kind==="page"?i.path:"/";let X;e[21]!==D||e[22]!==n||e[23]!==i.kind?(X=i.kind==="page"&&n?Qe(D,n):n??null,e[21]=D,e[22]=n,e[23]=i.kind,e[24]=X):X=e[24];const de=X;let Y;e[25]!==c||e[26]!==l||e[27]!==i.kind?(Y=i.kind==="site"?l("sectionsEditor.seoEditor.noSiteSeoBlock"):l(c?"sectionsEditor.seoEditor.noSeoSchema":"sectionsEditor.seoEditor.couldNotLoadSeo"),e[25]=c,e[26]=l,e[27]=i.kind,e[28]=Y):Y=e[28];const pe=Y,Z=G&&c,fe=i.kind==="site"&&c&&z;let $;e[29]!==me||e[30]!==l||e[31]!==i.kind||e[32]!==i.pageName?($=i.kind==="page"?o.jsxs("nav",{className:"flex min-w-0 items-center gap-1 text-sm",children:[o.jsx("button",{type:"button",onClick:me,title:i.pageName,className:"min-w-0 truncate rounded-[var(--studio-control-radius,var(--radius-md))] px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:i.pageName}),o.jsx(Ne,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("span",{className:"px-1 py-0.5 font-medium text-foreground",children:"SEO"})]}):o.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(he,{size:16,className:"shrink-0 text-muted-foreground"}),o.jsx("span",{className:"text-sm font-medium",children:l("sectionsEditor.seoEditor.defaultSeoLabel")}),o.jsxs("span",{className:"hidden truncate text-xs text-muted-foreground sm:inline",children:["· ",l("sectionsEditor.seoEditor.appliedToEveryPage")]})]}),e[29]=me,e[30]=l,e[31]=i.kind,e[32]=i.pageName,e[33]=$):$=e[33];let B;e[34]!==se?(B=se&&o.jsx(_e,{className:"size-3.5 text-muted-foreground"}),e[34]=se,e[35]=B):B=e[35];let I;e[36]!==p||e[37]!==l||e[38]!==i.kind?(I=i.kind==="page"&&p&&o.jsxs(we,{type:"button",variant:"outline",size:"sm",onClick:p,children:[o.jsx(he,{size:14}),l("sectionsEditor.seoEditor.editDefaultSeoButton")]}),e[36]=p,e[37]=l,e[38]=i.kind,e[39]=I):I=e[39];let L;e[40]!==B||e[41]!==I?(L=o.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[B,I]}),e[40]=B,e[41]=I,e[42]=L):L=e[42];let O;e[43]!==$||e[44]!==L?(O=o.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[$,L]}),e[43]=$,e[44]=L,e[45]=O):O=e[45];let U;e[46]!==F||e[47]!==h||e[48]!==ne||e[49]!==ce||e[50]!==le||e[51]!==A||e[52]!==P||e[53]!==pe||e[54]!==N||e[55]!==ae||e[56]!==D||e[57]!==oe||e[58]!==K||e[59]!==re||e[60]!==de||e[61]!==c||e[62]!==z||e[63]!==g||e[64]!==E||e[65]!==Z||e[66]!==fe||e[67]!==R||e[68]!==l?(U=!c||!Z&&!fe?o.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center text-sm text-muted-foreground",children:pe}):o.jsxs("div",{className:"flex min-h-0 flex-1",children:[o.jsx(ve,{className:"w-full max-w-md shrink-0 border-r [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-5 py-4",children:Z?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:l("sectionsEditor.seoEditor.emptyFieldsHint")}),o.jsx($e,{rawSeo:A,innerSeo:P,defaultResolveType:le,seoSchema:z,activeResolveType:F,seoTypeOptions:c.seoTypeOptions,formResetKey:N,siteDefaultSeo:R,onPersistRaw:C=>{E(C),oe(C)},onInnerChange:C=>{g(C),K(C)},onClearForm:ce,onBumpFormKey:ne,asyncRenderAvailable:h})]}):z&&F&&o.jsx(Ce,{schema:z,resolveType:F,value:P,formResetKey:N,onChange:ae})})}),o.jsx(ve,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"@container px-5 py-4",children:o.jsx(qe,{seo:re,url:de,path:D})})})]}),e[46]=F,e[47]=h,e[48]=ne,e[49]=ce,e[50]=le,e[51]=A,e[52]=P,e[53]=pe,e[54]=N,e[55]=ae,e[56]=D,e[57]=oe,e[58]=K,e[59]=re,e[60]=de,e[61]=c,e[62]=z,e[63]=g,e[64]=E,e[65]=Z,e[66]=fe,e[67]=R,e[68]=l,e[69]=U):U=e[69];let ee;return e[70]!==O||e[71]!==U?(ee=o.jsxs("div",{className:"flex h-full w-full flex-col",children:[O,U]}),e[70]=O,e[71]=U,e[72]=ee):ee=e[72],ee}function We(d){return d+1}function Je(d){return d+1}function Qe(d,e){try{return new URL(d,e).href}catch{return e}}function Xe(d,e){const t=e.__resolveType,a=d.__resolveType;if(typeof t=="string"&&typeof a=="string"&&t!==a)return{...e};const y={...d};for(const[r,s]of Object.entries(e))r!=="__resolveType"&&s!=null&&(typeof s=="string"&&s.trim()===""||(y[r]=s));return y}export{Ei as SeoEditor};
|
|
1
|
+
import{c as T,b as be,j as o,r as te,av as Ne,B as we,h as _e}from"./index-BeWb3VLq.js";import{a4 as he}from"./agent-icon-CiKTiUdq.js";import{S as ve}from"./scroll-area-BVZXqx5M.js";import{F as ye,ab as Ee,i as Pe,k as Te,ac as Fe,h as Re,aE as Ce}from"./runnable-block-editor-Bod17qTV.js";import{q as Ke}from"./parse-sections-CigeyiXV.js";import{u as ze,a as De,P as $e}from"./page-seo-form-C0_Mzxj0.js";import{a as je}from"./Image01-hTzc15CE.js";import{u as Be,m as Ie}from"./site-editor-toast-C48kJZ8y.js";import"./AlertCircle-Cch634f7.js";import"./Tool01-2gJDR0Ho.js";import"./ArrowUp-DLUdomd9.js";import"./ArrowLeft-CohopnCT.js";import"./LinkBroken01-Dioz3u9i.js";import"./ShoppingBag01-BStpgW0a.js";import"./ZoomOut-DixQygt2.js";import"./Building02-BHJQSDUK.js";import"./CheckCircle-Cs8i9zYt.js";import"./ChevronUp-BT7eMKPK.js";import"./ChevronSelectorVertical-C5d75KyY.js";import"./UserSquare-pmxb5ZdZ.js";import"./Copy01-B341DqLV.js";import"./CreditCard01-4Fwr0tNh.js";import"./DotsVertical-DbrlDgFh.js";import"./Globe04-BE6c1UDj.js";import"./SwitchHorizontal01-CrC4ThKg.js";import"./Key01-kTu6t6u_.js";import"./Link01-hfA48cFL.js";import"./Minus-DqDPTtRG.js";import"./Monitor01-Bz6QaUO4.js";import"./Sun-C37Hpdko.js";import"./Play-CByslM3d.js";import"./Plus-Dewm72je.js";import"./SearchMd-7Jo0ZofC.js";import"./Trash01-DjE7Raat.js";import"./Upload01-CYfTR3aZ.js";import"./User01-X6IeKYZH.js";import"./Users01-uKJoVSle.js";import"./XClose-BVxVAZ6V.js";import"./index-BdQq_4o_.js";import"./utils-t1gjPfET.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-v8_ULhan.js";import"./format-time-Cq80KKvY.js";import"./differenceInSeconds-C3x8sHUj.js";import"./collapsible-BcZaehP2.js";import"./use-copy-C4LbXPXl.js";import"./usage-stats-CKpL0uWf.js";import"./tool-namespace-DePiqr-m.js";import"./form-BGI3x6he.js";import"./label-TKhfC6jr.js";import"./utils-CVEq3hMx.js";import"./markdown-D_Bab0vD.js";import"./location-V0VwTJTt.js";import"./use-mobile-BAnIvR27.js";import"./use-panel-navigate-CXkMPISv.js";import"./thread-route-BPSSuk8V.js";import"./use-project-scope-BOj2O9A_.js";import"./repository-binding-Cf_thK-b.js";import"./use-mcp-client-2WkK0AxE.js";import"./auth-DVebpHI3.js";import"./tooltip-4vv5k-uR.js";import"./index-CdhgpKbn.js";import"./use-decopilot-events-CuBncVze.js";import"./thread-intent-CoB1rbzj.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-C9NPGTmI.js";import"./task-board-ByNQwZsl.js";import"./schema-b5uziS6S.js";import"./slugify-CEUa2lfQ.js";import"./chat-context-BEyCIAaN.js";import"./autosend-BTx7-p6a.js";import"./use-ai-providers-Ct47MIru.js";import"./use-organization-settings-CE5BJyh9.js";import"./use-clock-tick-DE4s8Okz.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-C5DYTOzS.js";import"./types-CNU-uWw-.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./shell-layout-Dpds4_um.js";import"./avatar-DjIkOwsx.js";import"./command-KmLWWmqo.js";import"./index-BliYmmPu.js";import"./integration-icon-VoZokpOe.js";import"./project-icon-Ds8VtVRG.js";import"./new-project-dialog-DfI138Mw.js";import"./repository-import-picker-BOku3VrR.js";import"./use-navigate-to-agent-C2NQ-36B.js";import"./repository-picker-CeCsQGv8.js";import"./useInfiniteQuery-CxzyY6DS.js";import"./infiniteQueryObserver-BOCgDRcQ.js";import"./collection-search-7sBPioRN.js";import"./use-debounced-value-Br6JzfN-.js";import"./required-auth-layout-DhxdstQv.js";import"./use-org-sso-BnFa9r-G.js";import"./sheet-DdrzSnyB.js";import"./use-connection-HenJjVMr.js";import"./use-mcp-prompts-BY0itm-N.js";import"./use-thread-outputs-C38yfNsJ.js";import"./file-type-icon-DYeFNgMs.js";import"./secret-ciphertext-CKG2rzpX.js";import"./alert-DlpN1nbO.js";import"./switch-BI2l0q9a.js";import"./textarea-7I-DLD6x.js";import"./popover-s88DXvPL.js";import"./blocks-tab-states-5tpSikld.js";import"./slider-tSRa1HDF.js";import"./index-BEaGR-Ng.js";import"./tooltipContext-B3bWUtmi.js";import"./CategoricalChart-BCAB1JR1.js";import"./index-DVxNOEMj.js";import"./ActiveShapeUtils-BB436TvV.js";import"./Sector-D64VY8hG.js";import"./symbol-CW0bfPL3.js";import"./use-session-runtime-CqJF6neP.js";import"./empty-state-B4dSQMeM.js";import"./monaco-editor-CVRVgXSh.js";import"./editor-DAekV0he.js";import"./calendar-kdikRXDO.js";import"./select-H4FJk0rp.js";import"./editor-classes-BaBC2QPU.js";import"./core.esm-BmE_KURk.js";import"./sortable.esm-CE2eXOQU.js";import"./toggle-group-BngkTNsG.js";import"./active-indicator-CCMhAsc_.js";import"./combobox-CEzxugDA.js";import"./alert-dialog-BdWXpnme.js";import"./search-input-BL6XGlmm.js";import"./tabs-Cw5epDK7.js";import"./use-file-configs-B_k4AoEo.js";import"./asset-utils-CYj7sEud.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./sandbox-git-api-CH_-QFpD.js";import"./sandbox-url-D3mC8qhT.js";import"./experiments-tab-choice-CQ5EsK8h.js";import"./use-sandbox-events-BVhJrX2Z.js";function M(d){return typeof d=="string"&&d.trim()?d:void 0}function ge(d,e){if(d){if(e)try{const t=new URL(d,e).href;return ye(t)}catch{return}return ye(d)}}function Le(d){if(!d)return{};const e=M(d.title),t=M(d.titleTemplate);return{title:e&&t?.includes("%s")?t.replace(/%s/g,e):e,description:M(d.description),image:M(d.image),favicon:M(d.favicon)}}function Oe(d){if(!d)return"example.com";try{return new URL(d).host}catch{return"example.com"}}const Ue=[{id:"google",labelKey:"sectionsEditor.seoPreview.platformGoogle",color:"#4285F4",layout:"search"},{id:"facebook",labelKey:"sectionsEditor.seoPreview.platformFacebook",color:"#1877F2",layout:"card"},{id:"twitter",labelKey:"sectionsEditor.seoPreview.platformTwitter",color:"#0f1419",layout:"card"},{id:"linkedin",labelKey:"sectionsEditor.seoPreview.platformLinkedin",color:"#0A66C2",layout:"card"},{id:"whatsapp",labelKey:"sectionsEditor.seoPreview.platformWhatsapp",color:"#25D366",layout:"chat"},{id:"telegram",labelKey:"sectionsEditor.seoPreview.platformTelegram",color:"#229ED9",layout:"chat"},{id:"slack",labelKey:"sectionsEditor.seoPreview.platformSlack",color:"#611f69",layout:"attachment"},{id:"discord",labelKey:"sectionsEditor.seoPreview.platformDiscord",color:"#5865F2",layout:"attachment"}];function ue(d){const e=T.c(10),{src:t,className:a,iconSize:y}=d,r=y===void 0?20:y;if(t){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={objectFit:"cover"},e[0]=m):m=e[0];let p;return e[1]!==a||e[2]!==t?(p=o.jsx("img",{src:t,alt:"",referrerPolicy:"no-referrer",className:a,style:m}),e[1]=a,e[2]=t,e[3]=p):p=e[3],p}let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s={display:"flex",alignItems:"center",justifyContent:"center",background:"#e5e7eb",color:"#9ca3af"},e[4]=s):s=e[4];let i;e[5]!==r?(i=o.jsx(je,{size:r}),e[5]=r,e[6]=i):i=e[6];let n;return e[7]!==a||e[8]!==i?(n=o.jsx("div",{className:a,style:s,children:i}),e[7]=a,e[8]=i,e[9]=n):n=e[9],n}function Ae(d){const e=T.c(33),{seo:t,host:a,path:y,t:r}=d;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#fff",border:"1px solid #dadce0"},e[0]=s):s=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={background:"#f1f3f4"},e[1]=i):i=e[1];let n;e[2]!==t.favicon?(n=o.jsx("div",{className:"flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-full",style:i,children:t.favicon?o.jsx("img",{src:t.favicon,alt:"",className:"size-full object-cover"}):o.jsx(je,{size:12,color:"#9aa0a6"})}),e[2]=t.favicon,e[3]=n):n=e[3];let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m={color:"#202124"},e[4]=m):m=e[4];let p;e[5]!==a?(p=o.jsx("div",{className:"truncate text-[13px] leading-tight",style:m,children:a}),e[5]=a,e[6]=p):p=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f={color:"#4d5156"},e[7]=f):f=e[7];let l;e[8]!==a||e[9]!==y?(l=o.jsxs("div",{className:"truncate text-[12px] leading-tight",style:f,children:[a,y]}),e[8]=a,e[9]=y,e[10]=l):l=e[10];let c;e[11]!==p||e[12]!==l?(c=o.jsxs("div",{className:"min-w-0",children:[p,l]}),e[11]=p,e[12]=l,e[13]=c):c=e[13];let x;e[14]!==n||e[15]!==c?(x=o.jsxs("div",{className:"flex items-center gap-2",children:[n,c]}),e[14]=n,e[15]=c,e[16]=x):x=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u={color:"#1a0dab"},e[17]=u):u=e[17];let h;e[18]!==t.title||e[19]!==r?(h=t.title??r("sectionsEditor.seoPreview.fallbackTitle"),e[18]=t.title,e[19]=r,e[20]=h):h=e[20];let v;e[21]!==h?(v=o.jsx("div",{className:"mt-1.5 truncate text-[18px] leading-snug",style:u,children:h}),e[21]=h,e[22]=v):v=e[22];let b;e[23]===Symbol.for("react.memo_cache_sentinel")?(b={color:"#4d5156"},e[23]=b):b=e[23];let S;e[24]!==t.description||e[25]!==r?(S=t.description??r("sectionsEditor.seoPreview.fallbackDescription"),e[24]=t.description,e[25]=r,e[26]=S):S=e[26];let j;e[27]!==S?(j=o.jsx("div",{className:"mt-0.5 line-clamp-2 text-[13px] leading-snug",style:b,children:S}),e[27]=S,e[28]=j):j=e[28];let k;return e[29]!==v||e[30]!==j||e[31]!==x?(k=o.jsxs("div",{className:"rounded-lg p-3 text-left",style:s,children:[x,v,j]}),e[29]=v,e[30]=j,e[31]=x,e[32]=k):k=e[32],k}function Me(d){const e=T.c(26),{seo:t,host:a,t:y}=d;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={background:"#fff",border:"1px solid #e2e8f0"},e[0]=r):r=e[0];let s;e[1]!==t.image?(s=o.jsx(ue,{src:t.image,className:"h-40 w-full"}),e[1]=t.image,e[2]=s):s=e[2];let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i={borderTop:"1px solid #e2e8f0"},e[3]=i):i=e[3];let n;e[4]===Symbol.for("react.memo_cache_sentinel")?(n={color:"#8a9099"},e[4]=n):n=e[4];let m;e[5]!==a?(m=o.jsx("div",{className:"truncate text-[11px]",style:n,children:a}),e[5]=a,e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#1c2024"},e[7]=p):p=e[7];let f;e[8]!==t.title||e[9]!==y?(f=t.title??y("sectionsEditor.seoPreview.fallbackTitle"),e[8]=t.title,e[9]=y,e[10]=f):f=e[10];let l;e[11]!==f?(l=o.jsx("div",{className:"line-clamp-1 text-[14px] font-semibold",style:p,children:f}),e[11]=f,e[12]=l):l=e[12];let c;e[13]===Symbol.for("react.memo_cache_sentinel")?(c={color:"#60666c"},e[13]=c):c=e[13];let x;e[14]!==t.description||e[15]!==y?(x=t.description??y("sectionsEditor.seoPreview.fallbackDescription"),e[14]=t.description,e[15]=y,e[16]=x):x=e[16];let u;e[17]!==x?(u=o.jsx("div",{className:"line-clamp-2 text-[12px]",style:c,children:x}),e[17]=x,e[18]=u):u=e[18];let h;e[19]!==u||e[20]!==m||e[21]!==l?(h=o.jsxs("div",{className:"px-3 py-2",style:i,children:[m,l,u]}),e[19]=u,e[20]=m,e[21]=l,e[22]=h):h=e[22];let v;return e[23]!==h||e[24]!==s?(v=o.jsxs("div",{className:"overflow-hidden rounded-lg text-left",style:r,children:[s,h]}),e[23]=h,e[24]=s,e[25]=v):v=e[25],v}function Ge(d){const e=T.c(36),{seo:t,host:a,accent:y,t:r}=d;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#f0f2f5"},e[0]=s):s=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={color:"#3b4045"},e[1]=i):i=e[1];let n;e[2]!==r?(n=r("sectionsEditor.seoPreview.chatCardHint"),e[2]=r,e[3]=n):n=e[3];let m;e[4]!==n?(m=o.jsx("p",{className:"px-1 pb-1.5 text-[12px]",style:i,children:n}),e[4]=n,e[5]=m):m=e[5];const p=`3px solid ${y}`;let f;e[6]!==p?(f={background:"#fff",borderLeft:p},e[6]=p,e[7]=f):f=e[7];let l;e[8]!==t.image?(l=o.jsx(ue,{src:t.image,className:"h-28 w-full",iconSize:18}),e[8]=t.image,e[9]=l):l=e[9];let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c={color:"#1c2024"},e[10]=c):c=e[10];let x;e[11]!==t.title||e[12]!==r?(x=t.title??r("sectionsEditor.seoPreview.fallbackTitle"),e[11]=t.title,e[12]=r,e[13]=x):x=e[13];let u;e[14]!==x?(u=o.jsx("div",{className:"line-clamp-1 text-[12px] font-semibold",style:c,children:x}),e[14]=x,e[15]=u):u=e[15];let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h={color:"#60666c"},e[16]=h):h=e[16];let v;e[17]!==t.description||e[18]!==r?(v=t.description??r("sectionsEditor.seoPreview.fallbackDescription"),e[17]=t.description,e[18]=r,e[19]=v):v=e[19];let b;e[20]!==v?(b=o.jsx("div",{className:"line-clamp-2 text-[11px]",style:h,children:v}),e[20]=v,e[21]=b):b=e[21];let S;e[22]===Symbol.for("react.memo_cache_sentinel")?(S={color:"#8a9099"},e[22]=S):S=e[22];let j;e[23]!==a?(j=o.jsx("div",{className:"mt-0.5 text-[10px]",style:S,children:a}),e[23]=a,e[24]=j):j=e[24];let k;e[25]!==u||e[26]!==b||e[27]!==j?(k=o.jsxs("div",{className:"px-2.5 py-1.5",children:[u,b,j]}),e[25]=u,e[26]=b,e[27]=j,e[28]=k):k=e[28];let g;e[29]!==k||e[30]!==f||e[31]!==l?(g=o.jsxs("div",{className:"overflow-hidden rounded-[var(--studio-surface-radius,var(--radius-md))]",style:f,children:[l,k]}),e[29]=k,e[30]=f,e[31]=l,e[32]=g):g=e[32];let N;return e[33]!==g||e[34]!==m?(N=o.jsxs("div",{className:"rounded-lg p-2 text-left",style:s,children:[m,g]}),e[33]=g,e[34]=m,e[35]=N):N=e[35],N}function He(d){const e=T.c(39),{seo:t,host:a,accent:y,dark:r,t:s}=d,i=r?"#2b2d31":"#fff",n=r?"#00a8fc":"#1264a3",m=r?"#dbdee1":"#3b4045",p=r?"#949ba4":"#8a9099",f=r?"none":"1px solid #e2e8f0";let l;e[0]!==i||e[1]!==f?(l={background:i,border:f},e[0]=i,e[1]=f,e[2]=l):l=e[2];const c=`3px solid ${y}`;let x;e[3]!==c?(x={borderLeft:c,borderRadius:2},e[3]=c,e[4]=x):x=e[4];let u;e[5]!==p?(u={color:p},e[5]=p,e[6]=u):u=e[6];let h;e[7]!==a||e[8]!==u?(h=o.jsx("div",{className:"text-[10px]",style:u,children:a}),e[7]=a,e[8]=u,e[9]=h):h=e[9];let v;e[10]!==n?(v={color:n},e[10]=n,e[11]=v):v=e[11];let b;e[12]!==t.title||e[13]!==s?(b=t.title??s("sectionsEditor.seoPreview.fallbackTitle"),e[12]=t.title,e[13]=s,e[14]=b):b=e[14];let S;e[15]!==v||e[16]!==b?(S=o.jsx("div",{className:"line-clamp-1 text-[13px] font-semibold",style:v,children:b}),e[15]=v,e[16]=b,e[17]=S):S=e[17];let j;e[18]!==m?(j={color:m},e[18]=m,e[19]=j):j=e[19];let k;e[20]!==t.description||e[21]!==s?(k=t.description??s("sectionsEditor.seoPreview.fallbackDescription"),e[20]=t.description,e[21]=s,e[22]=k):k=e[22];let g;e[23]!==j||e[24]!==k?(g=o.jsx("div",{className:"line-clamp-2 text-[12px]",style:j,children:k}),e[23]=j,e[24]=k,e[25]=g):g=e[25];let N;e[26]!==g||e[27]!==h||e[28]!==S?(N=o.jsxs("div",{className:"min-w-0 flex-1",children:[h,S,g]}),e[26]=g,e[27]=h,e[28]=S,e[29]=N):N=e[29];let w;e[30]!==t.image?(w=o.jsx(ue,{src:t.image,className:"size-14 shrink-0 rounded-[var(--studio-control-radius,var(--radius))]",iconSize:16}),e[30]=t.image,e[31]=w):w=e[31];let _;e[32]!==N||e[33]!==w||e[34]!==x?(_=o.jsxs("div",{className:"flex gap-2.5 pl-2.5",style:x,children:[N,w]}),e[32]=N,e[33]=w,e[34]=x,e[35]=_):_=e[35];let E;return e[36]!==_||e[37]!==l?(E=o.jsx("div",{className:"rounded-lg p-2.5 text-left",style:l,children:_}),e[36]=_,e[37]=l,e[38]=E):E=e[38],E}function Ve(d){const e=T.c(21),{platform:t,seo:a,host:y,path:r,t:s}=d;let i;e[0]!==y||e[1]!==r||e[2]!==t.color||e[3]!==t.id||e[4]!==t.layout||e[5]!==a||e[6]!==s?(i=t.layout==="search"?o.jsx(Ae,{seo:a,host:y,path:r,t:s}):t.layout==="card"?o.jsx(Me,{seo:a,host:y,path:r,t:s}):t.layout==="chat"?o.jsx(Ge,{seo:a,host:y,path:r,accent:t.color,t:s}):o.jsx(He,{seo:a,host:y,path:r,accent:t.color,dark:t.id==="discord",t:s}),e[0]=y,e[1]=r,e[2]=t.color,e[3]=t.id,e[4]=t.layout,e[5]=a,e[6]=s,e[7]=i):i=e[7];const n=i;let m;e[8]!==t.color?(m=o.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{background:t.color}}),e[8]=t.color,e[9]=m):m=e[9];let p;e[10]!==t.labelKey||e[11]!==s?(p=s(t.labelKey),e[10]=t.labelKey,e[11]=s,e[12]=p):p=e[12];let f;e[13]!==p?(f=o.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:p}),e[13]=p,e[14]=f):f=e[14];let l;e[15]!==m||e[16]!==f?(l=o.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5",children:[m,f]}),e[15]=m,e[16]=f,e[17]=l):l=e[17];let c;return e[18]!==n||e[19]!==l?(c=o.jsxs("div",{children:[l,n]}),e[18]=n,e[19]=l,e[20]=c):c=e[20],c}function qe(d){const e=T.c(18),{seo:t,url:a,path:y}=d,r=y===void 0?"/":y,s=be();let i,n,m;if(e[0]!==t||e[1]!==a){const v=Le(t);i=v,n=ge(v.image,a),m=ge(v.favicon,a),e[0]=t,e[1]=a,e[2]=i,e[3]=n,e[4]=m}else i=e[2],n=e[3],m=e[4];let p;e[5]!==i||e[6]!==n||e[7]!==m?(p={...i,image:n,favicon:m},e[5]=i,e[6]=n,e[7]=m,e[8]=p):p=e[8];const f=p;let l;e[9]!==a?(l=Oe(a),e[9]=a,e[10]=l):l=e[10];const c=l,x=r==="/"?"":r;let u;e[11]!==x||e[12]!==c||e[13]!==s||e[14]!==f?(u=Ue.map(v=>o.jsx(Ve,{platform:v,seo:f,host:c,path:x,t:s},v.id)),e[11]=x,e[12]=c,e[13]=s,e[14]=f,e[15]=u):u=e[15];let h;return e[16]!==u?(h=o.jsx("div",{className:"grid grid-cols-1 gap-4 @2xl:grid-cols-2",children:u}),e[16]=u,e[17]=h):h=e[17],h}function Ei(d){const e=T.c(73),{orgSlug:t,virtualMcpId:a,branch:y,decofile:r,meta:s,target:i,previewBaseUrl:n,onSaved:m,onEditDefaultSeo:p,onBack:f}=d,l=be(),c=Ee(r,i,s),x=Be(a,y);let u;e[0]!==x?(u=Ie(x),e[0]=x,e[1]=u):u=e[1];const h=!u,v=c?.seoData,b=i.kind==="site"?"site":i.pageKey,[S,j]=te.useState(b),[k,g]=te.useState(null),[N,w]=te.useState(0),[_,E]=te.useState(void 0);S!==b&&(j(b),g(null),E(void 0),w(Je));const{persistSeo:K,persistRawSeo:oe,flush:ie,isPending:se}=ze({orgSlug:t,virtualMcpId:a,branch:y,target:i,resolved:c,meta:s,onSaved:m}),G=i.kind==="page",Se=G?c?.rawSeoData:void 0,A=_!==void 0?_:Se,ke=G?Pe(A)??void 0:void 0,P=k??ke??v??{},F=c?De(P,c):null,z=F&&(!G||Te(A))?Ke(F,s):null;let H;e[2]!==s?(H=Fe(s),e[2]=s,e[3]=H):H=e[3];const le=H;let R,V;e[4]!==r||e[5]!==P||e[6]!==s||e[7]!==i.kind?(R=i.kind==="page"?Re(r,s)?.seoData??{}:{},V=i.kind==="page"?Xe(R,P):P,e[4]=r,e[5]=P,e[6]=s,e[7]=i.kind,e[8]=R,e[9]=V):(R=e[8],V=e[9]);const re=V;let q;e[10]!==K||e[11]!==c||e[12]!==g?(q=C=>{if(!c)return;const xe=C;g(xe),K(xe)},e[10]=K,e[11]=c,e[12]=g,e[13]=q):q=e[13];const ae=q;let W;e[14]!==g?(W=()=>g(null),e[14]=g,e[15]=W):W=e[15];const ce=W;let J;e[16]!==w?(J=()=>w(We),e[16]=w,e[17]=J):J=e[17];const ne=J;let Q;e[18]!==ie||e[19]!==f?(Q=()=>{ie(),f?.()},e[18]=ie,e[19]=f,e[20]=Q):Q=e[20];const me=Q,D=i.kind==="page"?i.path:"/";let X;e[21]!==D||e[22]!==n||e[23]!==i.kind?(X=i.kind==="page"&&n?Qe(D,n):n??null,e[21]=D,e[22]=n,e[23]=i.kind,e[24]=X):X=e[24];const de=X;let Y;e[25]!==c||e[26]!==l||e[27]!==i.kind?(Y=i.kind==="site"?l("sectionsEditor.seoEditor.noSiteSeoBlock"):l(c?"sectionsEditor.seoEditor.noSeoSchema":"sectionsEditor.seoEditor.couldNotLoadSeo"),e[25]=c,e[26]=l,e[27]=i.kind,e[28]=Y):Y=e[28];const pe=Y,Z=G&&c,fe=i.kind==="site"&&c&&z;let $;e[29]!==me||e[30]!==l||e[31]!==i.kind||e[32]!==i.pageName?($=i.kind==="page"?o.jsxs("nav",{className:"flex min-w-0 items-center gap-1 text-sm",children:[o.jsx("button",{type:"button",onClick:me,title:i.pageName,className:"min-w-0 truncate rounded-[var(--studio-control-radius,var(--radius-md))] px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:i.pageName}),o.jsx(Ne,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("span",{className:"px-1 py-0.5 font-medium text-foreground",children:"SEO"})]}):o.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(he,{size:16,className:"shrink-0 text-muted-foreground"}),o.jsx("span",{className:"text-sm font-medium",children:l("sectionsEditor.seoEditor.defaultSeoLabel")}),o.jsxs("span",{className:"hidden truncate text-xs text-muted-foreground sm:inline",children:["· ",l("sectionsEditor.seoEditor.appliedToEveryPage")]})]}),e[29]=me,e[30]=l,e[31]=i.kind,e[32]=i.pageName,e[33]=$):$=e[33];let B;e[34]!==se?(B=se&&o.jsx(_e,{className:"size-3.5 text-muted-foreground"}),e[34]=se,e[35]=B):B=e[35];let I;e[36]!==p||e[37]!==l||e[38]!==i.kind?(I=i.kind==="page"&&p&&o.jsxs(we,{type:"button",variant:"outline",size:"sm",onClick:p,children:[o.jsx(he,{size:14}),l("sectionsEditor.seoEditor.editDefaultSeoButton")]}),e[36]=p,e[37]=l,e[38]=i.kind,e[39]=I):I=e[39];let L;e[40]!==B||e[41]!==I?(L=o.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[B,I]}),e[40]=B,e[41]=I,e[42]=L):L=e[42];let O;e[43]!==$||e[44]!==L?(O=o.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[$,L]}),e[43]=$,e[44]=L,e[45]=O):O=e[45];let U;e[46]!==F||e[47]!==h||e[48]!==ne||e[49]!==ce||e[50]!==le||e[51]!==A||e[52]!==P||e[53]!==pe||e[54]!==N||e[55]!==ae||e[56]!==D||e[57]!==oe||e[58]!==K||e[59]!==re||e[60]!==de||e[61]!==c||e[62]!==z||e[63]!==g||e[64]!==E||e[65]!==Z||e[66]!==fe||e[67]!==R||e[68]!==l?(U=!c||!Z&&!fe?o.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center text-sm text-muted-foreground",children:pe}):o.jsxs("div",{className:"flex min-h-0 flex-1",children:[o.jsx(ve,{className:"w-full max-w-md shrink-0 border-r [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-5 py-4",children:Z?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:l("sectionsEditor.seoEditor.emptyFieldsHint")}),o.jsx($e,{rawSeo:A,innerSeo:P,defaultResolveType:le,seoSchema:z,activeResolveType:F,seoTypeOptions:c.seoTypeOptions,formResetKey:N,siteDefaultSeo:R,onPersistRaw:C=>{E(C),oe(C)},onInnerChange:C=>{g(C),K(C)},onClearForm:ce,onBumpFormKey:ne,asyncRenderAvailable:h})]}):z&&F&&o.jsx(Ce,{schema:z,resolveType:F,value:P,formResetKey:N,onChange:ae})})}),o.jsx(ve,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"@container px-5 py-4",children:o.jsx(qe,{seo:re,url:de,path:D})})})]}),e[46]=F,e[47]=h,e[48]=ne,e[49]=ce,e[50]=le,e[51]=A,e[52]=P,e[53]=pe,e[54]=N,e[55]=ae,e[56]=D,e[57]=oe,e[58]=K,e[59]=re,e[60]=de,e[61]=c,e[62]=z,e[63]=g,e[64]=E,e[65]=Z,e[66]=fe,e[67]=R,e[68]=l,e[69]=U):U=e[69];let ee;return e[70]!==O||e[71]!==U?(ee=o.jsxs("div",{className:"flex h-full w-full flex-col",children:[O,U]}),e[70]=O,e[71]=U,e[72]=ee):ee=e[72],ee}function We(d){return d+1}function Je(d){return d+1}function Qe(d,e){try{return new URL(d,e).href}catch{return e}}function Xe(d,e){const t=e.__resolveType,a=d.__resolveType;if(typeof t=="string"&&typeof a=="string"&&t!==a)return{...e};const y={...d};for(const[r,s]of Object.entries(e))r!=="__resolveType"&&s!=null&&(typeof s=="string"&&s.trim()===""||(y[r]=s));return y}export{Ei as SeoEditor};
|